The Dink Network

Reply to Re: save_x and save_y

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
September 21st 2008, 07:58 AM
fairy.gif
Someone
Peasant He/Him Australia
 
Yeah the tutorial is unclear in several parts.. but Sparrowhawk does know what I meant there.

It's a little funny that Seth went to so much trouble putting two lines in every enemy script and reserving two globals in order to save the position information across the transfer from the enemy script to emake... when really the transfer is a bit of an illusion and that information isn't lost in the first place. Calling a script with external() will use the same script number and that's all dink.exe cares about (not the script name).. hence why &current_sprite still works.

So:
put
int &save_x = sp_x(&current_sprite,-1);
int &save_y ...

at top of each emake function (small, medium, large I think they are called)
and you can del &save_x and &save_y.. you should also delete the 2 lines which involve &save_x/y from each enemy script die procedure.

Also, from memory, the newer versions of Prophecy of the Ancients don't have &save_x/y. Nexis used the (less efficient) strategy rabidwolf detailed in this thread. So that proves you can delete those variables (i.e. there are no internal calls to them, as that would crash dink.exe).