The Dink Network

Echo effect

March 21st 2010, 02:42 AM
sob_scorpy.gif
DinkDude95
Peasant He/Him Australia
The guy with the cute D-Mod. 
Is there perhaps some way I could create an echo effect in Dink?

If I have a script constantly running on a screen, is there any way I can fetch the sound bank number of any sound that is played? Or is there a way of repeating any text on a screen, but in a different position?
March 21st 2010, 04:36 AM
burntree.gif
Fireball5
Peasant He/Him Australia
Let me heat that up for you... 
The text repeating wouldn't be too hard...

The sound could be a bit harder. You could certainly try, but I'm not sure if you could do such a thing.
March 21st 2010, 07:09 AM
sob_scorpy.gif
DinkDude95
Peasant He/Him Australia
The guy with the cute D-Mod. 
Heh, reckon you could explain how to repeat text?
March 21st 2010, 09:42 AM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
Sure, it's a simple say_xy() in a script with a loop where you change the x and y value every cycle. Or did you have something else in mind? It could work like:

int &x = 100;
int &y = 200;
int &count = 5;

loop:
say_xy("This should echooooo", &x, &y);
&x += 20;
&y += 20;
&count -= 1;
if (&count > 0)
goto loop;


This would show the line of text 5 times with slightly displaced coordinates. You could add in a small wait if you wanted to add that delay effect.

EDIT: interesting thing to note is that this forum's code snippet can not contain the word & times (without the space) or it will place an "x" instead.
March 21st 2010, 06:58 PM
dinkdead.gif
"is there any way I can fetch the sound bank number of any sound that is played?"

You mean any sound, like punching stuff or fighting etc? Not sure that that would be possible, especially as some sounds like pillbugs are played at a random speed the echo might sound a bit weird.

The only way I can think of would be for example to have an invisible sprite that covers most of the screen to sense whenever Dink hits something and then repeat the punch sound using sound_set_vol() or something for the faint echo. Would be easy enough to do in a cut-scene but awkward when just roaming around...
March 22nd 2010, 12:00 AM
sob_scorpy.gif
DinkDude95
Peasant He/Him Australia
The guy with the cute D-Mod. 
Nah, Kyle, I don't want to go to the trouble of modifying every script set in a particular area, and my plan isn't to use a basic loop (although that probably would be possible). I want to know if I can have a separate script constantly running that fetches sound bank numbers and finds text and stuff.

If seems this may not be possible, so I'll have to develop something really messy to do this.

BTW: Sparrowhawk, that could be possible, I'll fiddle around with that command.
March 22nd 2010, 06:41 AM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
It is possible to do what you want with text at least. Text sprites are brain 8, so your script could constantly monitor for the presence of these sprites, just like you would for a screenlock script. Hope that helps you on your way If you can't figure it out, I'll see what I can do to make it work in a real script^^
March 22nd 2010, 07:16 AM
sob_scorpy.gif
DinkDude95
Peasant He/Him Australia
The guy with the cute D-Mod. 
Ah! Brain 8! I completely forgot about that. This makes things easier... However I still must figure out how to duplicate these text sprites.

Thanks dude.
March 22nd 2010, 09:06 AM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
Oh, hmm... Actually copying the content of the text sprite isn't possible I think That's because you can't store string values in variables in this game.
March 22nd 2010, 10:34 AM
custom_iplaydink.gif
iplaydink
Peasant He/Him Sweden
Hmm.. 
What about getting the sprite with brain 8 within a loop and give it sp_kill of 0 wait about 1 second then make it invisible (sp_nodraw) wait for a delay effect and then give it a random x and y coordinate and make it visible for some seconds before killing it?
March 22nd 2010, 12:36 PM
dinkdead.gif
Text sprites are different... I don't think stuff like sp_whatever() works with them.
March 22nd 2010, 01:35 PM
custom_iplaydink.gif
iplaydink
Peasant He/Him Sweden
Hmm.. 
sp_kill did work, but not sp_nodraw.
I made a script which got a random sprite of brain 8 and gave it sp_kill value of 0. When you pressed space the text would stay forever if you din't press it again, then it would change into a new random text which would stay until the next press etc.
March 22nd 2010, 05:13 PM
sob_scorpy.gif
DinkDude95
Peasant He/Him Australia
The guy with the cute D-Mod. 
Okay, I can't figure out how to do this. Perhaps I'm going to just go to each individual script involving text and check to see if dink is within the area where there is the echo and repeat the text and the sound in different positions.
March 23rd 2010, 07:30 AM
duckdie.gif
Ferk
Peasant They/Them Spain
 
Maybe you can temporally replace the default sound files with custom ones included in the dmod that have already the echo in the recording.

Perhaps replacing every single sound file would be heavy, but replacing some of them might be enough to create some atmosfear.