Echo effect
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?
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?
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.
The sound could be a bit harder. You could certainly try, but I'm not sure if you could do such a thing.
Heh, reckon you could explain how to repeat text?
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:
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.
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.
"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...
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...
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.
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.

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^^

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.
Thanks dude.

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.

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?
Text sprites are different... I don't think stuff like sp_whatever() works with them.
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.
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.
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.
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.
Perhaps replacing every single sound file would be heavy, but replacing some of them might be enough to create some atmosfear.