Button Add Connector?

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
MM037
Posts: 14
Joined: Thu Sep 20, 2012 3:12 am

Button Add Connector?

Post by MM037 »

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?
User avatar
msyblade
Posts: 792
Joined: Fri Oct 12, 2012 4:40 am
Location: New Mexico, USA
Contact:

Re: Button Add Connector?

Post by msyblade »

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
User avatar
antti
Posts: 688
Joined: Thu Feb 23, 2012 1:43 pm
Location: Espoo, Finland
Contact:

Re: Button Add Connector?

Post by antti »

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")
Steven Seagal of gaming industry
User avatar
msyblade
Posts: 792
Joined: Fri Oct 12, 2012 4:40 am
Location: New Mexico, USA
Contact:

Re: Button Add Connector?

Post by msyblade »

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
MM037
Posts: 14
Joined: Thu Sep 20, 2012 3:12 am

Re: Button Add Connector?

Post by MM037 »

Ah, awesome. Works great now. Many thanks. Learning Lua as I go. Hehe.
Post Reply