View unanswered posts | View active topics It is currently Fri Dec 27, 2024 9:20 am



Reply to topic  [ 2 posts ] 
 Attaching Scripts to Stuff (in game) [REQ] 
Author Message
User avatar

Joined: Mon Jun 29, 2009 2:40 am
Posts: 610
Location: Deep below The Map of Mars
Reply with quote
Post 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.


Mon Jan 25, 2010 7:39 pm
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post 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.


Mon Jan 25, 2010 8:04 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 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.095s | 13 Queries | GZIP : Off ]