The Dink Network

External

June 27th 2005, 09:06 PM
goblinm.gif
I use external a lot, but I don't understand it. All I know is that a procedure called with external seems to kill itself as soon as it hits a wait or return, so you don't need a kill_this_task?
June 27th 2005, 09:11 PM
custom_king.png
redink1
King Male United States xbox steam bloop
A mother ducking wizard 
A procedure called with external kills itself as soon as it hits a wait? Weird...
June 27th 2005, 10:26 PM
goblinm.gif
I use emake.c to do cutscenes whenever something dies, and I accidentally put a wait statement in there. Needless to say, the following lines did not seem to run. Perhaps this was because &save_x and &save_y got changed, but I vaguely recall that I passed them to locals, so the best explanation seems to be external dying on wait. I should test more.
June 28th 2005, 01:50 AM
wizardg.gif
Paul
Peasant Male United States
 
Ah, that would make sense, because when you call a script with external, it's sort of treated as part of the script that called it. Since the script that called it is attached to a dying creature, it's not too surprising that the whole thing collapses when it the sprite is killed (ie. when it comes to a wait).

You can get around this by either using script_attached(1000) or using spawn isntead of external. In either case, make sure put kill_this_task at the end.
June 28th 2005, 09:49 AM
custom_magicman.gif
magicman
Peasant Male Netherlands steam duck
Mmmm, pizza. 
So if I read this correctly, external() is more like include() (PHP-style), but with a proc reference?
April 3rd, 10:48 PM
duckdie.gif
crypto
Peasant
 
Yes is there more info on this command ?
April 4th, 02:25 PM
dinkdead.gif
Some in the DinkC Reference v4, found in your Dink/develop folder. I believe this has been mentioned once or twice