The Dink Network

Reply to Re: Scripting problem

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:
 
 
October 4th 2010, 03:23 AM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
I knew that external() procedures would not be able to use the local variables from the script that created them. That's why the original game uses the globals &save_x and &save_y for saving x and y positions when using external() to place goodies when monsters die. But that intuitively makes sense as you use a physically different script to write it in. Custom procedures are written in the same script, so it sounds like a strange and unnecessary step to create a new script, especially as other procedures such as hit() and main() all use the same script.

I am kind of worried about this actually as I use quite a few custom procedures in my latest DMOD(s). I just hope that using a return(); kills of the newly created "script" when you use a custom procedure. Otherwise using custom procedures becomes almost totally useless as you can't return variables without keeping an extra local script alive...

It does sound nice that at least theoretically newly created variables in custom procedures only take up variable space as long as the procedure is active, that offers perspective... I'll try and see what I can find this week...