|
FAQ
• Search • Login
|
|
Page 1 of 1
|
[ 6 posts ] |
|
Script depending on other script
Author |
Message |
MaximDude
Joined: Wed Nov 22, 2006 3:19 pm Posts: 2073
|
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 |
|
|
mail2345
Joined: Tue Nov 06, 2007 6:58 am Posts: 2054
|
Re: Script depending on other script
|
Sun Jul 26, 2009 11:00 pm |
|
|
MaximDude
Joined: Wed Nov 22, 2006 3:19 pm Posts: 2073
|
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 |
|
|
MooCow13
Joined: Wed Aug 27, 2008 6:44 am Posts: 20
|
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/ScopeTutorialJust don't make the variable somethin common
|
Wed Jul 29, 2009 1:31 am |
|
|
Grif
REAL AMERICAN HERO
Joined: Sat Jan 27, 2007 10:25 pm Posts: 5655
|
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 |
|
|
MaximDude
Joined: Wed Nov 22, 2006 3:19 pm Posts: 2073
|
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 |
|
|
|
|
Page 1 of 1
|
[ 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
|
|