Script Help

I need help with my script. I have an event where it shows an image and it is erased on trigger: player leave (meaning that the player is off event)

But, I want there to be an in between option, so when you're on the event, if you press the action button, another event happens.

Here's the screenshots of all the pages.

1.png2.png3.png
First of all, what script are you using?

Secondly "Self switch A = ON" and "Self switch B = ON" right after each other on page 1, I believe would only cause one or the other to execute. I don't think you can have two pages running at the same time.

Also I don't quite understand the logic, can you clarify: So there's an object on the ground. Player walks on it, shown a picture, and can interact to get money. However if the player walks off the image is erased.

From my knowledge, of which I require a more knowledgeable person to confirm, showing a picture behaves like a text box. The picture persists and the player cannot do anything but press the interact key to execute the next event content. So for example, when a text box appears the player cannot move but can only press the interact key to proceed. Similar concept. 

The solution I can think of for this is to have an event (below characters, player touch) to Set Self Switch A ON. Make a new page (condition: self switch A is ON) and have its content to show the picture. Right after the command "Show Picture" have loop command. In this loop command have a conditional branch that checks if the movement keys are being pressed and if so move the player accordingly and erase the picture. Else if the interact key is pressed give the gold, erase the picture and then whatever you want to happen to the event.

Like this:

Page 2 Content:

>Show Picture

>Loop

>  Conditional Branch: Is the up key being pressed?

>     True

>           Move event: player move up

>           Erase picture

>           Self Switch A = OFF

>     False

>           Conditional Branch: Is the down key being pressed?

>              True

>                   Move event: player move down

>                   Erase picture

>                   Self Switch A = OFF

>              False

>                   Conditional Branch: Is the left key being pressed?

>                      True

>                          Move event: player move left

>                          Erase picture

>                          Self Switch A = OFF

>                      False

>                          Conditional Branch: Is the right key being pressed?

>                             True

>                                  Move event: player move right

>                                  Erase picture

>                                  Self Switch A = OFF

>                            False

>                                Condition Branch: Is the (interact key) being pressed?

>                                    True

>                                        Give gold

>                                        Erase picture

>                                        Self Switch A = OFF

>                                     False

>

>Wait 3 Frames

>Back to Loop Start
Based on what you have, the picture would be shown after you walk on top of the coin image in page 1, then both self switch A and B would be turned on.

Your second page would never be executed because the event page priority thing which will cause page 3 to be executed, which turn off self switch A and B (even if you set the both pages' event trigger to parallel processing... assuming that there are no script in play).

I dont know what script you are using, assuming there is one by looking at the comment on your third page, but this might help you.

basically I moved the self switch B from page 1 to page 2 instead. This will allow you to enter whatever event processing you want before page 3. Again, I dont know what script you use, so you will have to decide on what trigger to use for page 2. (I forgot to remove the erase picture command from page 3)

event_zpsaddyacrr.jpg


If both pages are set on parallel processing, what will happen is that the image will be immediately erased after page 1 finished executing, you will see the text "Page 2" along with the coin sound effect, and then see the text "Page 3". The event will then reset back to page 1.

If your script only allows for page 3 to be executed once the player leave, then you will have to insert a page between page 2 and page 3 and use an extra self switch. Otherwise you will keep getting spammed with "Page 2" text along with the coin sound effect.
Hobbithole, just for your info:

What you have above is pure eventing, it has nothing to do whith what is called "scripting" in the RM community.

"Scripting" in this community means using Ruby/RGSS inside the script editor to change the engine itself, and is basically full programming of the engine.

That is why you were asked about "what script" in the first answer.

If you keep this in mind you'll get answers faster and easier.
Self Switch B has no purpose. Get rid of it.


And everything that is on the third page, put onto the second page. Then delete the third page.
That would be the case if he doesnt have a script like tsukihime's page condition, which allows him to enter custom page condition. Page 3 will not be executed unless the player leaves.

But yeah, I could be wrong there. 

Edit: typo.. "doesn't have" instead of just "have"

Original thread: https://forums.rpgmakerweb.com/threads/script-help.49348/