Page 2 of 2

Re: Retrieving Object Parameter Values

Posted: Wed Oct 22, 2014 7:09 pm
by SnowyOwl47
NutJob wrote:
SnowyOwl47 wrote:This is lua not javascript and another thing, well what are you trying to get with the hudPrint?
This.
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:

Code: Select all

function sayAmsg()
	hudPrint(self.id)
end
So, my question is "How do I get the object calling my function?"

With the code above I expected "Lever_3" in hopes of being able to use the "calling" object properties to progress some other code.
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?

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.

Re: Retrieving Object Parameter Values

Posted: Wed Oct 22, 2014 7:56 pm
by NutJob
Can a moderator please just unregister my account. ~laughs~

Re: Retrieving Object Parameter Values

Posted: Thu Oct 23, 2014 11:47 am
by NutJob
It's unfair to not call-out myself, so "I was wrong." There, that was easy. Now back to beering myself.