boolean variable question ( SOLVED )

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
bigbrodeur
Posts: 3
Joined: Fri Jul 04, 2014 3:13 pm
Location: Montreal, Canada

boolean variable question ( SOLVED )

Post by bigbrodeur »

Hi, I have look around the forum but canot find the answer to this.
What I wanna do is close a door when you step on a hidden pressure plate but only if you have stepped on a previous pressure plate before.
This part works fine, the problem is that I have a button that would put the variable to false and open the door so that it could be done again.
But after i press the button it seems the variable plate01 become false but will never become true again.
The door does not close after I press the button and stepped on those 2 plate.
Thank you for your help.

function plate01()
plate01 = true
end

function door01()
if plate01 == true then
prison_door_portcullis_67:close()
end
end

function resetlabyrinth()
plate01 = false
end
Last edited by bigbrodeur on Mon Jul 07, 2014 1:08 pm, edited 1 time in total.
User avatar
Dr.Disaster
Posts: 2876
Joined: Wed Aug 15, 2012 11:48 am

Re: boolean variable question

Post by Dr.Disaster »

Did you set "activate once" for those plates?
bigbrodeur
Posts: 3
Joined: Fri Jul 04, 2014 3:13 pm
Location: Montreal, Canada

Re: boolean variable question

Post by bigbrodeur »

No, thats the first thing I checked.
Even if I press the button first, it wont work.
But if i step on those plate and dont press the button it work, its that button that is problematic.
User avatar
Allanius2
Posts: 124
Joined: Mon Apr 14, 2014 10:12 pm

Re: boolean variable question

Post by Allanius2 »

bigbrodeur wrote:Hi, I have look around the forum but canot find the answer to this.
What I wanna do is close a door when you step on a hidden pressure plate but only if you have stepped on a previous pressure plate before.
This part works fine, the problem is that I have a button that would put the variable to false and open the door so that it could be done again.
But after i press the button it seems the variable plate01 become false but will never become true again.
The door does not close after I press the button and stepped on those 2 plate.
Thank you for your help.

function plate01()
plate01 = true
end

function door01()
if plate01 == true then
prison_door_portcullis_67:close()
end
end

function resetlabyrinth()
plate01 = false
end
I noticed that you have the function and the variable with the same name, change the name of one or the other and it should work. Be sure to include the door:open statement in the resetlabyrinth function. Good luck.
bigbrodeur
Posts: 3
Joined: Fri Jul 04, 2014 3:13 pm
Location: Montreal, Canada

Re: boolean variable question

Post by bigbrodeur »

Yes it worked !!!!!!
Wow I didnt know function could not share the same name as variable.
Thank you allanius.
How can I changed the name of the topic to add SOLVED ?
User avatar
antti
Posts: 688
Joined: Thu Feb 23, 2012 1:43 pm
Location: Espoo, Finland
Contact:

Re: boolean variable question

Post by antti »

bigbrodeur wrote:Yes it worked !!!!!!
Wow I didnt know function could not share the same name as variable.
Thank you allanius.
How can I changed the name of the topic to add SOLVED ?
Nice 8-)
You can change the topic by pressing "edit" on your original post.
Steven Seagal of gaming industry
Post Reply