The Dink Network

Reply to Re: External spawnings attached to number 1000

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:
 
 
May 4th 2003, 08:38 AM
pq_frog.gif
Ric
Peasant They/Them Canada
 
When you use external in one script, to call a procedure from a second script, Dink acts as though that other procedure is there in place of the command "external.". So if the procedure called in controls "&current_sprite", it will control the sprite that the first script is attached to. It saves typing and memory. You can use external to run talk, attack, die, or anything from another sprite you think will work. You can even use extenal to run a procedure within the first script, knowing it will return to the "external" command when it is done. Handy.
Room scripts are the best for setting visions because it is run before the screen is drawn, and so you don't need to force_vision. Graphics will run smoother too, unless you have a wait() or a random() in it. Room scripts can create_sprite and other things too, but don't use things like talk() or hit() unless you attach it to a sprite with sp_script_attach().
Spawn runs a script starting with its main() without interupting the script that spawned it. If you need that script attached to a sprite (even sp 1000 ) I would just use sp_script(1000,"scriptname"); . Always end that script with Kill_this_task(); or it will never end. (Most sprite scripts die when you leave the screen, but sp 1000 never dies.)