Re: Retrieving Object Parameter Values
Posted: Wed Oct 22, 2014 7:09 pm
From what I Can tell you want to have 3 triggers trigger a function in a script to make it print a message to the played script?NutJob wrote:This.SnowyOwl47 wrote:This is lua not javascript and another thing, well what are you trying to get with the hudPrint?
NutJob wrote:
I've set up a Lever, a Button, and a Floor Trigger and they all connect to one script_entity and call this function:
So, my question is "How do I get the object calling my function?"Code: Select all
function sayAmsg() hudPrint(self.id) end
With the code above I expected "Lever_3" in hopes of being able to use the "calling" object properties to progress some other code.
Well for one:
Code: Select all
-- To print something to a players screen you can easily call the hudPrint function like this hudPrint("Something to be displayed to the players screen")
--
-- To call a function from a trigger of sorts simply add a connector from those triggers to the function and so it would look like this:
--
-- onActivate, script_entity_1, Amsg
--
-- To do this proggramatically simpply say the following: lever_name.lever:addConnector("onActivate", "script_entity_1", "Amsg")
--
-- You can also use the methods onDeactivate and onToggle.
--
-- Another thing I haven't needed to mess around with adding connectors through script but I might be wrong about the "" on some of the things.