These Switches are Switching me Off

Status
Not open for further replies.

Frosty10001

Villager
Member
Joined
Jul 25, 2013
Messages
18
Reaction score
3
First Language
English
Primarily Uses
Don't mind the title, it's just me trying to be witty and make a joke out of the problem I'm currently having.
This'll be a long post, so I hope you have some time to spare! (This is also my first post outside of my Introductory thread, woo!)
 
I have a dungeon, which consists of three parts so far. After the player completes the first part and when they move on they will find themselves here:

This part challenges the player to move as quickly as possible to the exit without touching the fire geysers that will spew beneath them when the walk atop an event on the darkened tiles. (Only one fire geyser event exists in the corridor for testing.)

In order to start it, the player must read the sign by activating the event directly above the Player Start event. (Which is there solely for testing purposes.)

If the player decides he is ready by selecting the Yes option, he will be teleported in the corridor, which is above the red sphere event northeast of the Player Start event. A countdown will begin and prompt the player to run. As the player runs over the fire geyser events, they will pop up in a few frames. If the player manages to make contact with a fire geyser event, they will be teleported back to the room where the sign is located, adding +1 to a variable "TimesBurned".

The player will then have an option to retry the trial by talking to the sign again. If the player selects Yes, he will be teleported back into the corridor to try the challenge again.

That is what is supposed to happen.

However, by playtesting, I realized that, while the first attempt works fine, if and when the player fails, the second and subsequent retries will fail to work or even start.

Here is how I set up my events,

When the player initially starts the challenge for the first time by talking to the sign, this is the event:

When the player is teleported after selecting Yes, this is the event that handles the countdown:



The event commands that are cut off are

-Play SE: 'Gun1', 100, 85

-Play BGM: 'Battle8', 100, 120

-Self-Switch Operation: A = ON

Branch End

(There are no event commands on Event Page 2, with only the condition 'Self-Switch A is On'.)
This is what the Fire Geyser event looks like:





The script present in Event Page 2 for the Conditional Branch is

$game_player.x == $game_map.events[@event_id].x and $game_player.y == $game_map.events[@event_id].yWhich is made possible from a script I added below Materials called "Shaz's Remember Event Position"

#--------------------------------------------------# Remember Event Position 1.0#--------------------------------------------------## Author: Shaz## Description: This script lets you set the position and direction# where an event will appear next time the map is# loaded. Events will appear in this new position# rather than the place they were put during design.##--------------------------------------------------## Installation: Copy into a new script slot in the Materials section##--------------------------------------------------## Use:## To tell an event to move to its current position the next time# the map is loaded, execute the following in a script call:# $game_map.events[event_id].save_pos()## To tell an event to move to a particular position (not its# current position) the next time the map is loaded,# execute the following in a script call:# $game_map.events[event_id].save_pos(1, 2, 8)# - the above will move the event to x=1, y=2, facing up## To tell an event to forget its previously remembered position# and go back to its default position the next time time map# is loaded, execute the following in a script call:# $game_map.events[event_id].forget_pos()#--------------------------------------------------class Game_System alias shaz_mem_position_gs_init initialize attr_accessor :event_positions def initialize shaz_mem_position_gs_init @event_positions = {} endendclass Game_CharacterBase attr_accessorendclass Game_Event alias shaz_mem_position_gcb_init initialize def initialize(map_id, event) shaz_mem_position_gcb_init(map_id, event) if $game_system.event_positions.has_key?([map_id, @id]) mvx, mvy, mvdir = $game_system.event_positions[[map_id, @id]] moveto(mvx, mvy) if mvdir != nil set_direction(mvdir) end @stop_count = 0 refresh end end def save_pos(x = @x, y = @y, dir = @direction) $game_system.event_positions[[@map_id, @id]] = [x, y, dir] end def forget_pos $game_system.event_positions.delete([@map_id, @id]) endend
When the player fails and comes in contact with a fire geyser, this is the event that handles the little cutscene that follows:

(There are no event commands on Event Page 2, with only the condition 'Self-Switch A is On'.)
And when the player speaks to the sign again, which is the same event as the first sign I've told you about, this is the second event page:

To reiterate the problem again, whenever the player retries the challenge if the player has failed before, the countdown and fire geysers will simply not work.

I've tried a few methods to try and see if anything else works when reattempting the course, such as using variables instead, a condensed structure using conditional branches, and adding a new switch called "GD-Trial2OFF" to go along with the other switch, but all these methods proved to not work either.

I may be blind to the answer and it may just be a simple logic error, but it's driving me nuts!

Thanks in advance to those that help out!
 

Celianna

Tileset artist
Veteran
Joined
Mar 1, 2012
Messages
10,557
Reaction score
5,592
First Language
Dutch
Primarily Uses
RMMV
Yup, you missed the spot where you turned on self switch A at the end of your Trial2 hurt event. This means the event will activate the second event page instead, and skip over the first. Simply remove the entire second event page all together (no need to turn the event off when you're already doing it by turning off switch GD-Trial2), and everything should work again.
 

Frosty10001

Villager
Member
Joined
Jul 25, 2013
Messages
18
Reaction score
3
First Language
English
Primarily Uses
Yup, you missed the spot where you turned on self switch A at the end of your Trial2 hurt event. This means the event will activate the second event page instead, and skip over the first. Simply remove the entire second event page all together (no need to turn the event off when you're already doing it by turning off switch GD-Trial2), and everything should work again.
Thank you for replying! But after doing what you suggested, the reattempts still wouldn't work, I tried playing around for a bit, but I felt like I would only cause more unneeded problems within the events!
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,358
Reaction score
7,671
First Language
German
Primarily Uses
RMMV
I admit that I don't have the time to check through every event page and see how they work together, but I can give some general advice and confirm that Celianna has found at least part of the problem.

If you want to repeat a sequence, then you need every part and condition of that sequence back to its original status.

If that sequence works once but fails on reattempts, then some parts are not reset after making the first attempts.

Since you do not remove the self-switch A from the trial2hurt event before trying it a second time, that part will fail. If correcting that doesn't change the failure, then there has to be one additional part that is not reset - but you would have to reset it to the original status anyway for the sequence to be able to work again.

If you continue having problems with this, then perhaps you should rewrite the logic behind those events into a more complex but also more streamlined sequence:

Give each event a minimum of three pages and consider those pages the "current status" of the sequence.

One page should be "standby/before trial", one page should be "on Trial" and one page should be "after trial" - the last one might be two pages for success/failure.

The sign should then switch all events to the page "on trial" if the trial starts, removing the conditions for after trial success/failure.

You'll need more general switches if the sign controls the status (you can't use self switches in this case), but it should help clearing the problem - you might try to simplify it or go back to self-switches after you got it working correctly...
 

Belone

Villager
Member
Joined
Jul 19, 2013
Messages
11
Reaction score
2
First Language
English
Primarily Uses
Right I think I've read through all your events correctly, here's what I would do:-

From Sign4, delete the line "Self-Switch Operation: A = ON", the line "Switch Operation: [0027:GD-Trial2ON] and completely delete Page 2 (as I presume this is blank). You don't need these here. I would then add at the bottom of your "BRING IT ON" choice branch a normal switch operation to turn on a new switch called something like "GD-CountdownOn" Sorry didn't see the last spoiler - I would remove the "Switch Operation: [0027:GD-Trial2ON] = ON" lines from both pages and replace them with turning on a new switch called something like "GD-CountdownOn"

Then on Trial2Auto replace the start condition switch with the new "GD-CountdownOn" switch instead of the one it currently is. Then at the bottom of both your conditional branches replace the self switch operation with the turning off the "GD-CountdownOn" switch and turn on the "GD-Trial2ON switch here. (Make sure you have both these switch operations at the bottom of both conditional branches). And delete Page 2 (you no longer need this). A

On the Fire Geyser I would delete Page 1. Then on Page 2 make the required switch "GD-Trial2On" and remove the requirement for Self-Switch, then remove the bottom line "Self-Switch Operation: B = ON" and the line "Self-Switch Operation: C  = ON" and finally delete the pages 3 & 4.

FInally on Trial2Hurt I would remove the line "Self-Switch Operation: A = ON" and then delete Page 2.

Sorry for the great wall of text, I'll try and screenshot each of these events for you when I'm back home in a few hours.
 
Last edited by a moderator:

Frosty10001

Villager
Member
Joined
Jul 25, 2013
Messages
18
Reaction score
3
First Language
English
Primarily Uses
I admit that I don't have the time to check through every event page and see how they work together, but I can give some general advice and confirm that Celianna has found at least part of the problem.

If you want to repeat a sequence, then you need every part and condition of that sequence back to its original status.

If that sequence works once but fails on reattempts, then some parts are not reset after making the first attempts.

Since you do not remove the self-switch A from the trial2hurt event before trying it a second time, that part will fail. If correcting that doesn't change the failure, then there has to be one additional part that is not reset - but you would have to reset it to the original status anyway for the sequence to be able to work again.

If you continue having problems with this, then perhaps you should rewrite the logic behind those events into a more complex but also more streamlined sequence:

Give each event a minimum of three pages and consider those pages the "current status" of the sequence.

One page should be "standby/before trial", one page should be "on Trial" and one page should be "after trial" - the last one might be two pages for success/failure.

The sign should then switch all events to the page "on trial" if the trial starts, removing the conditions for after trial success/failure.

You'll need more general switches if the sign controls the status (you can't use self switches in this case), but it should help clearing the problem - you might try to simplify it or go back to self-switches after you got it working correctly...
Thank you Andar for the advice! Using it, I was able to make a more condensed structure using only the sign event to handle everything.

Right I think I've read through all your events correctly, here's what I would do:-

From Sign4, delete the line "Self-Switch Operation: A = ON", the line "Switch Operation: [0027:GD-Trial2ON] and completely delete Page 2 (as I presume this is blank). You don't need these here. I would then add at the bottom of your "BRING IT ON" choice branch a normal switch operation to turn on a new switch called something like "GD-CountdownOn" Sorry didn't see the last spoiler - I would remove the "Switch Operation: [0027:GD-Trial2ON] = ON" lines from both pages and replace them with turning on a new switch called something like "GD-CountdownOn"

Then on Trial2Auto replace the start condition switch with the new "GD-CountdownOn" switch instead of the one it currently is. Then at the bottom of both your conditional branches replace the self switch operation with the turning off the "GD-CountdownOn" switch and turn on the "GD-Trial2ON switch here. (Make sure you have both these switch operations at the bottom of both conditional branches). And delete Page 2 (you no longer need this). A

On the Fire Geyser I would delete Page 1. Then on Page 2 make the required switch "GD-Trial2On" and remove the requirement for Self-Switch, then remove the bottom line "Self-Switch Operation: B = ON" and the line "Self-Switch Operation: C  = ON" and finally delete the pages 3 & 4.

FInally on Trial2Hurt I would remove the line "Self-Switch Operation: A = ON" and then delete Page 2.

Sorry for the great wall of text, I'll try and screenshot each of these events for you when I'm back home in a few hours.
Thank you Belone for helping me out with the solution! There is no need to screenshot these events, as I fixed the problem with your help and Andar's.
 

Celianna

Tileset artist
Veteran
Joined
Mar 1, 2012
Messages
10,557
Reaction score
5,592
First Language
Dutch
Primarily Uses
RMMV
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:

Forum statistics

Threads
105,854
Messages
1,017,004
Members
137,562
Latest member
tamedeathman
Top