Data Realms Fan Forums http://45.55.195.193/ |
|
Attaching Scripts to Stuff (in game) [REQ] http://45.55.195.193/viewtopic.php?f=73&t=17662 |
Page 1 of 1 |
Author: | PhantomAGN [ Mon Jan 25, 2010 7:39 pm ] |
Post subject: | Attaching Scripts to Stuff (in game) [REQ] |
Hey Lua-using folk! I made myself a "add this object back to inventory on activation" script a while ago for someone who wanted infinite bombs, and I've just realized that it would be nice to have a tool to attach the script to arbitrary tools and things while playing (As opposed to attaching it in ini to CopyOf incarnations of all the devices I want changed). I've built up a tool that finds an area around whatever you are aiming at, and can read out the closest thing (currently targeting explosives). I'd like to somehow forcibly make this object carry my script (or any script!). Can this be done? I am anticipating needing to make the script add itself to the object added back to my inventory as well, but that's essentially the same as the above. On an unrelated sidenote, can we detect the Caps-Lock key's activation? it would make an excellent toggle-tool. |
Author: | CaveCricket48 [ Mon Jan 25, 2010 8:04 pm ] |
Post subject: | Re: Attaching Scripts to Stuff (in game) [REQ] |
If you used the phoenix potion before (man I need to update that some time) you'll notice that the targeted actor gets the phoenix effect, without changing into a pre-made actor by using a MOPixel to do all the Luaing. To "Add" Lua to an object, you need a pointer to the object and make the Lua'd object do stuff to the targeted object. A simpler way to say this: make a Lua'ed object do stuff to the target. |
Page 1 of 1 | All times are UTC [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |