Data Realms Fan Forums http://45.55.195.193/ |
|
Script depending on other script http://45.55.195.193/viewtopic.php?f=73&t=16015 |
Page 1 of 1 |
Author: | MaximDude [ Sun Jul 26, 2009 10:38 pm ] |
Post subject: | 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. |
Author: | mail2345 [ Sun Jul 26, 2009 11:00 pm ] |
Post subject: | Re: Script depending on other script |
viewtopic.php?f=73&t=15692 |
Author: | MaximDude [ Sun Jul 26, 2009 11:26 pm ] |
Post subject: | Re: Script depending on other script |
Interesting... I'll look into it and try not to fail >____>' Thanks. :D |
Author: | MooCow13 [ Wed Jul 29, 2009 1:31 am ] |
Post subject: | 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 |
Author: | Grif [ Wed Jul 29, 2009 1:46 am ] |
Post subject: | 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. |
Author: | MaximDude [ Wed Jul 29, 2009 11:26 am ] |
Post subject: | Re: Script depending on other script |
Well, I already did what I needed to do with some hackyness. |
Page 1 of 1 | All times are UTC [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |