Events
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.
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.
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(¤t_sprite,250[eg]);
}
I forget if thats how to get Dinks' y cord, but I could see somthing like that.
*edited once*
(Sp script)
void main ()
{
Int &run;
loop:
&run= sp_y(1,-1);
if (&run < 10)
{
goto Here;
}
wait(200);
goto loop;
Here:
sp_seq(¤t_sprite,250[eg]);
}
I forget if thats how to get Dinks' y cord, but I could see somthing like that.
*edited once*
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.
This is attached to the sprite and only reads 1, and ¤t_sprite.
I think it could be attached to about 10 or 20 sprites without going crash.
I think it could be attached to about 10 or 20 sprites without going crash.