I am trying to add a connector to a button through a script entity. It reads:
dungeon_secret_button_large_4:addConnector(toggle, script_entity_11, buttonstuck)
buttonstuck is the name of the function of the new entity. It keeps saying,
bad argument #1 to 'addConnector' (string expected, got nil)
Can anyone let me know what I did wrong?
Button Add Connector?
Re: Button Add Connector?
I'm not positive, but I believe (just by working with the editor) that the buttons lack the variable required for any connector to attach to them.(say to activate/deactivate it remotely) can connect the button to something(to change a variable), but connect to the button and there simply is no variable to change. You can see this in editor, connect to it and the "action" dropdown is blank (nil).Which is the error youre getting from the script.This is just guesswork on my part and I could be completely mistaken.
Currently conspiring with many modders on the "Legends of the Northern Realms"project.
"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
Re: Button Add Connector?
The addConnector-method expects strings so you need to put those parameters in quotes like so:
dungeon_secret_button_large_4:addConnector("toggle", "script_entity_11", "buttonstuck")
dungeon_secret_button_large_4:addConnector("toggle", "script_entity_11", "buttonstuck")
Steven Seagal of gaming industry
Re: Button Add Connector?
That is awesome, thank you antti!
Currently conspiring with many modders on the "Legends of the Northern Realms"project.
"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
Re: Button Add Connector?
Ah, awesome. Works great now. Many thanks. Learning Lua as I go. Hehe.