Fix room3 logic issues
This commit is contained in:
committed by
Julian Murgia
parent
78b0ea5182
commit
3fd481df32
@@ -1,19 +1,21 @@
|
|||||||
:ready
|
|
||||||
set_state r3_button button_broken
|
|
||||||
|
|
||||||
|
|
||||||
:look
|
:look
|
||||||
say player "That button must activate the bridge, but it is broken." [button_broken]
|
say player "That button must activate the bridge, but it is broken." [r3_button_broken]
|
||||||
say player "It should work now." [!button_broken]
|
say player "It should work now." [!r3_button_broken]
|
||||||
|
|
||||||
:push
|
:push
|
||||||
say player "I must USE this."
|
say player "I must USE this."
|
||||||
|
|
||||||
|
|
||||||
:use
|
:use
|
||||||
> [!button_broken, !r3_bridge_closed]
|
# Button is fixed, bridge is open - close the bridge
|
||||||
|
> [!r3_button_broken, !r3_bridge_closed]
|
||||||
|
# Set the bridge state to closed. This will trigger the bridge animation.
|
||||||
set_state r3_bridge bridge_close
|
set_state r3_bridge bridge_close
|
||||||
|
# Make it so the player can cross the whole room
|
||||||
enable_terrain bridge_closed
|
enable_terrain bridge_closed
|
||||||
set_global r3_bridge_closed true
|
set_global r3_bridge_closed true
|
||||||
|
# Make it so the right hand side of the screen is no longer an "item" you can
|
||||||
|
# look at to be told you can't reach it.
|
||||||
set_interactive r3_right_platform false
|
set_interactive r3_right_platform false
|
||||||
set_interactive r3_r_exit true
|
set_interactive r3_r_exit true
|
||||||
# We start with the collision polygon on the right door disabled
|
# We start with the collision polygon on the right door disabled
|
||||||
@@ -25,30 +27,29 @@ say player "I must USE this."
|
|||||||
custom r3_r_exit door_enabler enable_door
|
custom r3_r_exit door_enabler enable_door
|
||||||
stop
|
stop
|
||||||
|
|
||||||
> [!button_broken, r3_bridge_closed]
|
# Button is fixed, bridge is open.
|
||||||
set_state r3_bridge bridge_open
|
> [!r3_button_broken, r3_bridge_closed]
|
||||||
enable_terrain bridge_open
|
say player "I don't want to close the bridge."
|
||||||
set_global r3_bridge_closed false
|
|
||||||
set_interactive r3_right_platform true
|
|
||||||
# Disable the door collision so it acts like part of the right
|
|
||||||
# platform again.
|
|
||||||
custom r3_r_exit door_enabler disable_door
|
|
||||||
stop
|
|
||||||
|
|
||||||
> [button_broken]
|
> [r3_button_broken]
|
||||||
say player "The button is broken!"
|
say player "The button is broken!"
|
||||||
stop
|
stop
|
||||||
|
|
||||||
:talk
|
:talk
|
||||||
> [button_broken]
|
> [r3_button_broken]
|
||||||
|
# Disable input so that the player can't interrupt this sequence of events
|
||||||
|
accept_input SKIP
|
||||||
say player "Please, will you repair yourself?"
|
say player "Please, will you repair yourself?"
|
||||||
wait 1
|
wait 1
|
||||||
|
# Turn off the button's smoke animation
|
||||||
set_state r3_button button_repaired
|
set_state r3_button button_repaired
|
||||||
set_global button_broken false
|
set_global r3_button_broken false
|
||||||
wait 1
|
wait 1
|
||||||
say player "Oh, it worked!"
|
say player "Oh, it worked!"
|
||||||
|
# Reenable input
|
||||||
|
accept_input ALL
|
||||||
stop
|
stop
|
||||||
> [!button_broken]
|
> [!r3_button_broken]
|
||||||
say player "I better not talk to it any more, it might break again."
|
say player "I better not talk to it any more, it might break again."
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,5 +3,6 @@ set_angle player 90
|
|||||||
say player "That's the other side."
|
say player "That's the other side."
|
||||||
|
|
||||||
:arrived
|
:arrived
|
||||||
set_angle player 90
|
> [!r3_bridge_closed]
|
||||||
say player "I can't reach it."
|
set_angle player 90
|
||||||
|
say player "I can't reach it."
|
||||||
|
|||||||
@@ -3,11 +3,14 @@
|
|||||||
|
|
||||||
:setup
|
:setup
|
||||||
|
|
||||||
|
# If the room hasn't been visited previously, open the bridge and break the button
|
||||||
> [!room3_visited]
|
> [!room3_visited]
|
||||||
set_global room3_visited true
|
set_global room3_visited true
|
||||||
|
# Mark the bridge as open
|
||||||
set_global r3_bridge_closed false
|
set_global r3_bridge_closed false
|
||||||
set_state r3_button button_broken
|
# Set a global for the button state so we can write test logic for it
|
||||||
set_global button_broken true
|
# This will start the animation with the check in the "ready:" state below.
|
||||||
|
set_global r3_button_broken true
|
||||||
|
|
||||||
> [r3_bridge_closed]
|
> [r3_bridge_closed]
|
||||||
# Make set_state IMMEDIATE to reach the final frame immediately
|
# Make set_state IMMEDIATE to reach the final frame immediately
|
||||||
@@ -17,30 +20,51 @@
|
|||||||
set_interactive r3_r_exit true
|
set_interactive r3_r_exit true
|
||||||
# We use a custom function to enable the collision polygon on the door
|
# We use a custom function to enable the collision polygon on the door
|
||||||
# to enable it to work as a door once the bridge is closed.
|
# to enable it to work as a door once the bridge is closed.
|
||||||
|
# You'll find the script in room3/Hotspots/r_door/door_enabler
|
||||||
custom r3_r_exit door_enabler enable_door
|
custom r3_r_exit door_enabler enable_door
|
||||||
|
|
||||||
> [eq ESC_LAST_SCENE room2]
|
> [eq ESC_LAST_SCENE room2]
|
||||||
teleport player r3_l_exit
|
teleport player r3_l_exit
|
||||||
# Set player look down
|
# Set player look down
|
||||||
set_angle player 180
|
set_angle player 180
|
||||||
|
# > [r3_button_broken]
|
||||||
|
# set_state r3_button button_broken
|
||||||
stop
|
stop
|
||||||
|
|
||||||
> [eq ESC_LAST_SCENE room4]
|
> [eq ESC_LAST_SCENE room4]
|
||||||
|
# Set the bridge closed and button fixed or else you cant get back to the left hand side
|
||||||
|
# if you started the game in room 4
|
||||||
|
set_global r3_bridge_closed true
|
||||||
|
set_global r3_button_broken false
|
||||||
|
|
||||||
|
# Turn off the button's smoke animation
|
||||||
|
#set_state r3_button button_repaired true
|
||||||
|
|
||||||
teleport player r3_r_exit
|
teleport player r3_r_exit
|
||||||
|
# Set the bridge state which will also run the bridge closing animation
|
||||||
|
set_state r3_bridge bridge_close true
|
||||||
|
# Enable the whole room terrain so the player can walk across the whole room
|
||||||
|
enable_terrain bridge_closed
|
||||||
|
# Don't make the right platform a separate object you can click. This is only valid when
|
||||||
|
# the bridge is open
|
||||||
|
set_interactive r3_right_platform false
|
||||||
|
set_interactive r3_r_exit true
|
||||||
|
# We use a custom function to enable the collision polygon on the door
|
||||||
|
# to enable it to work as a door once the bridge is closed.
|
||||||
|
custom r3_r_exit door_enabler enable_door
|
||||||
# Set player look left
|
# Set player look left
|
||||||
set_angle player 270
|
set_angle player 270
|
||||||
|
|
||||||
# If bridge not closed
|
|
||||||
> [!r3_bridge_closed]
|
|
||||||
set_interactive r3_right_platform false
|
|
||||||
stop
|
stop
|
||||||
|
|
||||||
|
|
||||||
:ready
|
:ready
|
||||||
|
> [r3_button_broken]
|
||||||
|
# Mark the button as broken and play the smoke animation
|
||||||
|
set_state r3_button button_broken
|
||||||
|
> [!r3_button_broken]
|
||||||
|
# Turn off the button's smoke animation
|
||||||
|
set_state r3_button button_repaired true
|
||||||
|
> [r3_bridge_closed]
|
||||||
|
# This is for when you close the bridge then go back to room 2
|
||||||
|
# Set the bridge closed
|
||||||
|
|
||||||
# DEBUG
|
set_global r3_bridge_closed true
|
||||||
#set_state r3_bridge bridge_close
|
|
||||||
#enable_terrain bridge_closed
|
|
||||||
#set_global bridge_closed true
|
|
||||||
#set_interactive r3_right_platform false
|
|
||||||
## /DEBUG
|
|
||||||
|
|
||||||
@@ -305,6 +305,7 @@ animations = null
|
|||||||
|
|
||||||
[node name="Particles2D" type="Particles2D" parent="r3_button"]
|
[node name="Particles2D" type="Particles2D" parent="r3_button"]
|
||||||
position = Vector2( 374, 154 )
|
position = Vector2( 374, 154 )
|
||||||
|
emitting = false
|
||||||
amount = 16
|
amount = 16
|
||||||
lifetime = 4.0
|
lifetime = 4.0
|
||||||
preprocess = 1.99
|
preprocess = 1.99
|
||||||
|
|||||||
Reference in New Issue
Block a user