View unanswered posts | View active topics It is currently Thu Dec 26, 2024 5:57 pm



Reply to topic  [ 6 posts ] 
 Script depending on other script 
Author Message
User avatar

Joined: Wed Nov 22, 2006 3:19 pm
Posts: 2073
Reply with quote
Post Script depending on other script
Is it possible to have a script that depends on another one?

Like, if script A results in 'true', it would trigger Script B (Which is a completely different .lua file that is attached to a different emitter/particle/actor/whatever).

If it is possible, then i'd like to know how.

PS. I can do this in rather hacky ways, but i'm asking if there's a direct way to do it.


Sun Jul 26, 2009 10:38 pm
Profile
User avatar

Joined: Tue Nov 06, 2007 6:58 am
Posts: 2054
Reply with quote
Post Re: Script depending on other script
viewtopic.php?f=73&t=15692


Sun Jul 26, 2009 11:00 pm
Profile
User avatar

Joined: Wed Nov 22, 2006 3:19 pm
Posts: 2073
Reply with quote
Post Re: Script depending on other script
Interesting... I'll look into it and try not to fail >____>'

Thanks. :D


Sun Jul 26, 2009 11:26 pm
Profile
User avatar

Joined: Wed Aug 27, 2008 6:44 am
Posts: 20
Reply with quote
Post Re: Script depending on other script
Correct me if i am wrong, but isn't are you need are global variables.

http://lua-users.org/wiki/ScopeTutorial

Just don't make the variable somethin common


Wed Jul 29, 2009 1:31 am
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: Script depending on other script
Yes, but a global variable would be changed by each instance of the object; say you had a screen that would only work if there's an antenna for it. If someone built one antenna that has global variable "showscreens" then any screen on the map is going to be lit up. So you could do a global list, and find a partner within that list (see: teleporters, etc) or you can use mail's increasingly insane workarounds.


Wed Jul 29, 2009 1:46 am
Profile
User avatar

Joined: Wed Nov 22, 2006 3:19 pm
Posts: 2073
Reply with quote
Post Re: Script depending on other script
Well, I already did what I needed to do with some hackyness.


Wed Jul 29, 2009 11:26 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.340s | 13 Queries | GZIP : Off ]