2019-07-16 23:02:18 (edited by Sean-Terry01 2019-07-16 23:03:49)

I'm sure we can already put button combos together. I believe we can do it by combining a button hold event with a button pressed event.

Aron, did you see my code in post 19?

2019-07-16 23:03:47

Dont worry Sean. I'm still going to look through the code. But to quickly answer Charles. Simply setting a variable on buttom 5 and then checking for that variable on other buttons presses would do it. So yes the GDE is very capable of this

2019-07-16 23:10:06

Ok Sean. Delete line 6. Same issue as before. This is ending the collide with player condition to early. Also there are  more condition end actions that there are condition begin actions.

Removing line 6 will fix that

Also in the door hold events. You are altering the coordinates of the door itself. Not the player.

Try these fixes and let me know how it goes

2019-07-16 23:22:45

Ok, here is the new code for the button 3 pressed event on the doorknob.

setlv "Changed State" "False"
if "Col" "Player" "==" "L" ""
if "L" "State" "==" "C" "Closed" "Main House Front Door"
setlv "State" "Open" "Main House Front Door"
setlv "Changed State" "True"
if "L" "State" "==" "C" "Open" "Main House Front Door"
if "L" "Changed State" "==" "C" "True"
setlv "State" "Closed" "Main House Front Door"
endif

And here is the up and down pressed events on the door itself.

if "L" "State" "==" "C" "Closed"
if "Col" "Player" "==" "L" ""
subz "1" "Player"
endif
endif

if "L" "State" "==" "C" "Closed"
if "Col" "Player" "==" "L" ""
addz "1" "Player"
endif
endif

Should those have been on the pressed events or the held ones?

2019-07-17 00:11:33

Your door knob now has 4 condition begins and only one condition end. I think you removed more than just line 6

2019-07-17 00:35:59

Ok, I have this, but, button 3 still doesn't want to make the state switch from closed to open.

Button 3 Pressed
setlv "Changed State" "False"
if "Col" "Player" "==" "L" ""
if "L" "State" "==" "C" "Closed" "Main House Front Door"
setlv "State" "Open" "Main House Front Door"
setlv "Changed State" "True"
endif
if "L" "State" "==" "C" "Open" "Main House Front Door"
if "L" "Changed State" "==" "C" "True"
setlv "State" "Closed" "Main House Front Door"
endif
endif
endif

I've also got the door to make a sound if it is closed and the player runs into it. Not sure what the heck I'm missing. I know... I'm close... Somehow. But, I can't figure out where. Lol.

2019-07-17 01:03:16

I think

if "L" "Changed State" "==" "C" "True"

Should be

if "L" "Changed State" "==" "C" "False"

The purpose of this variable is to stop it changing the door state value twice in one event run. Because you are checking if it is true. Your are changing the door state to open and then straight back to closed again.

Try altering this and let me know

2019-07-17 01:54:17

Oh wow, I feel stupid now. Lol. It does work. Now I just need to add an opening and closing sound. I should be able to do this with no help though. Man, I feel so good now. Yay. Thanks again. Now, I can also create more doors.

2019-07-17 02:26:28

Here's a bit more of exciting news!!! The door opens and closes perfectly now. On top of that, It now plays an open and close sound when opening or closing it. I've also moved the use of the doorknob from button 3 to button 2. Same button to use the starter lever on the generator. I ran a debug test, and it all works completely perfectly!!! I feel as if I've really started to make a major breakthrough!!!

2019-07-18 06:16:17 (edited by Sean-Terry01 2019-07-18 07:02:09)

Ok. I'm having a bit of trouble. I was successful in creating and making the back door of the house work perfectly. But, When trying to make the front bedroom door open and close, it plays the sounds like it should, but, I can't pass through the door. Here is the codes for, first the back door which works, and then the code for the front bedroom door which is giving me trouble.

Back Doorknob
setlv "Changed State" "False"
if "Col" "Player" "==" "L" ""
if "L" "State" "==" "C" "Closed" "Main House Back Door"
setlv "State" "Open" "Main House Back Door"
playa "Main House Front Door Open" "0.5" "Main House Back Door"
setlv "Changed State" "True"
endif
if "L" "State" "==" "C" "Open" "Main House Back Door"
if "L" "Changed State" "==" "C" "False"
setlv "State" "Closed" "Main House Back Door"
playa "Main House Front Door Close" "0.5" "Main House Back Door"
endif
endif
endif

Front Bedroom Doorknob
setlv "Changed State" "False"
if "Col" "Player" "==" "L" ""
if "L" "State" "==" "C" "Closed" "Main House Front Bedroom Door"
setlv "State" "Open" "Main House Front Bedroom Door"
playa "Main House Front Bedroom Door Open" "0.5" "Main House Front Bedroom Door"
setlv "Changed State" "True"
endif
if "L" "State" "==" "C" "Open" "Main House Front Bedroom Door"
if "L" "Changed State" "==" "C" "False"
setlv "State" "Closed" "Main House Front Bedroom Door"
playa "Main House Front Bedroom Door Close" "0.5" "Main House Front Bedroom Door"
endif
endif
endif

I don't know what the heck I did to not allow the player to pass through the bedroom door. But, it's perfect for both the front and back doors. Lol. I do have the same exact Local variables on the bedroom door and it's knob as I do on the front and back doors and their knobs.

2019-07-18 09:38:44

Could you supply some code for the bedroom door hold events as well. The part that actually stops the player going through?

2019-07-18 10:25:33 (edited by Sean-Terry01 2019-07-18 10:27:28)

Ok. Here is the events on the front bedroom Door itself.

Left Held
if "L" "State" "==" "C" "Closed"
if "Col" "Player" "==" "L" ""
stopa "Walk Sound"
addx "1" "Player"
create "Main House Front Bedroom Door Hit.dat"
playa "Main House Back Door Hit" "1" "Main House Front Bedroom Door Hit"
endif
endif
endif

Right Held
if "L" "State" "==" "C" "Closed"
if "Col" "Player" "==" "L" ""
stopa "Walk Sound"
subx "1" "Player"
create "Main House Front Bedroom Door Hit.dat"
playa "Main House Back Door Hit" "1" "Main House Front Bedroom Door Hit"
endif
endif
endif

Those are the only events on that door.
Here are the events on the Back door.

Left Held
if "L" "State" "==" "C" "Closed"
if "Col" "Player" "==" "L" ""
stopa "Walk Sound"
addx "1" "Player"
create "Main House Back Door Hit.dat"
playa "Main House Back Door Hit" "1" "Main House Back Door Hit"
endif
endif
endif

Right Held
if "L" "State" "==" "C" "Closed"
if "Col" "Player" "==" "L" ""
stopa "Walk Sound"
subx "1" "Player"
create "Main House Back Door Hit.dat"
playa "Main House Back Door Hit" "1" "Main House Back Door Hit"
endif
endif
endif

Same thing as above. Those are the only events on that door as well.
The back door hit sound is there on the front bedroom door cause I haven't found a good sound for hitting a hollow door. It's just a place holder for now.

2019-07-18 11:30:45

You have more condition ends than begins. That could be an issue. Try removing an endif from the bottom

2019-07-18 16:43:58

Oh I feel completely stupid now. Lol. So, after having a good bit of sleep. I went through my creation events on the Player object. I must have not been paying to much attention to what I was doing. I created 2 front bedroom door.dat objects. Oops. It was really nothing wrong with the code. Well, accept you said I had to many end ifs on the key held events on the door.

2019-07-18 16:49:57

Glad you got it sorted. No end of times I've stuggled for hours on a problem and solved the issue in minutes after some good sleep.