The Dink Network

Events

December 17th 2004, 02:40 PM
goblinm.gif
I'm sorry if this isn't clear... oh well.

I think that you should have, beyond normal events like talk, hit, etc., certain custom events which can be triggered via script. In specific, you could have the engine (or some global script) check when variables satisfy various conditions, and then scripts could run procedures based on that.

For example: let's say that the too_high event is triggered by Dink's y position being smaller than 5. Then you could put a too_high procedure into the scripts of various sprites, so that they do something when Dink's y achieves a low enough value.

In Dink, you can do this with loops, however:

1. This type of loop sucks ass.
2. If you didn't know the correct sprite numbers, you would have to script a loop into each sprite which is supposed to react, which would drastically slow things down.

Again, sorry if that doesn't make any sense.

A similar idea, although it sucks more:
You could have some protocol for having a procedure run under certain conditions, say:

blah[whatever>3]()
{
//stuff
}

which would run when "whenever" exceeds three. This sucks almost as hard as the current system though.
December 18th 2004, 01:25 PM
pq_frog.gif
Ric
Peasant They/Them Canada
 
Hmm...
(Sp script)
void main ()
{
Int &run;
loop:
&run= sp_y(1,-1);
if (&run < 10)
{
goto Here;
}
wait(200);
goto loop;
Here:
sp_seq(&current_sprite,250[eg]);
}
I forget if thats how to get Dinks' y cord, but I could see somthing like that.
*edited once*
December 18th 2004, 01:35 PM
goblinm.gif
That'll work, but I wouldn't want too many sprites to be running that sort of loop. Also its a pain to write, and there are situations where you wouldn't want to, i.e., things created with create sprite because their sprite numbers (I think) are prone to change.
December 18th 2004, 01:42 PM
pq_frog.gif
Ric
Peasant They/Them Canada
 
This is attached to the sprite and only reads 1, and &current_sprite.
I think it could be attached to about 10 or 20 sprites without going crash.
December 18th 2004, 02:22 PM
goblinm.gif
If you wanted something to happen to a different sprite, though, you might have trouble.

Edit: this is a problem that my idea wouldn't eliminate...