Change the color of a button by activating

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
User avatar
maneus
Posts: 246
Joined: Mon Jun 17, 2013 10:42 pm
Location: Switzerland

Change the color of a button by activating

Post by maneus »

I will change the color of a button when a door or portcullis is open or closed. Therefor I have made two models. One with green button and one with a red button.

I wrote the following script to the "red button", which is primarily there.

Code: Select all

function buttondrop()
     if khorne_door_portcullis_6:isOpen() then
     spawn("khorne_button_green", 2, 2, 19, 1)
     else
     spawn("khorne_button_red", 2, 2, 19, 1)
     end
end
All what happens now is that by opening the portcullis the red button changed into a green button. But by activating again the portcullis will be closed and the color remains green.
User avatar
maneus
Posts: 246
Joined: Mon Jun 17, 2013 10:42 pm
Location: Switzerland

Re: Change the color of a button by activating

Post by maneus »

I have did it by myself.
The code was:

Code: Select all

function buttondrop()
     if khorne_door_portcullis_6:isOpen() then
     spawn("khorne_button_green", 2, 2, 19, 1, "green_button")
     else
     green_button:destroy()
     end
end
Post Reply