Simple Eventing Question?

G4M5T3R

Villager
Member
Joined
Jun 1, 2013
Messages
15
Reaction score
0
First Language
English
Primarily Uses
Hello all,

I'm having some difficulties with, what I assume should be, some rather simple eventing. Basically I have 2 character graphics, Light tube ON, Light Tube Off. And A room of lets say 30 Light Tubes. Each is it's own event that, when touched by the player, turns ON the light tube (change graphic) and any other tubes that the player has touched turn OFF(change graphic of other events???). All tubes start with the OFF graphic when the player enters the room. Also, if possible through eventing, I would like to place 1 event in the center of the room that can turn ON any light tube through choice dialog. (This center event also needs to turn all tubes, other than the players choice, OFF.) 

What are some suggestions on achieving these effects?
 

seita

Donn_M
Veteran
Joined
Feb 6, 2013
Messages
2,254
Reaction score
611
First Language
English
Primarily Uses
Do you have a diagram of some sort to show how you have the tubes laid out? I've got a few ideas but each one may not be relevant depending on how the room would look.

Are they in a grid format, along a linear path, or something else entirely?
 

G4M5T3R

Villager
Member
Joined
Jun 1, 2013
Messages
15
Reaction score
0
First Language
English
Primarily Uses
They are in grid format,

I was thinking of using variables A-J to make a Battleship like grid (A1-10...J1-10) to use within the center events dialog (the command console if you will).

The room can hold 10x10 right now



This is what it'd look like but with more tubes and up to 10x10. The center being the little console 
 
Last edited by a moderator:

seita

Donn_M
Veteran
Joined
Feb 6, 2013
Messages
2,254
Reaction score
611
First Language
English
Primarily Uses
I haven't tested this out so it's theoretical for now. You won't need any custom scripts but you'll need to do some script calls.

So I figure it's probably best to use two pages in each lamp, this way you just have to work with self switches and one variable.

We'll use variable 10 for this example, but you can change it to whatever. Just change 10 in the script calls below to whatever you want to use.

Call the variable "Last Triggered Lamp" if you want.

To keep things simple, make sure to make all of the lamps together in a batch. That is, copy and paste them one after another until all of them are made, so they are in order according to their IDs.

Each lamp event will have two pages.

Page 1 will be triggered via player touch. It will call a our special common event.

Page 2 will have a self switch A condition, it will be lit, and there will be no actions on it.

The common event is like so:

no trigger

Conditional Branch: if Variable 10 is greater than or equal to 1.

Then

$game_self_switches[[mapid, $game_variables[10], 'A']] = false

Turn on Self Switch A.

script call:

$game_variables[10] = self.id

Now when you touch a lamp, it will trigger the common event. First it will check if the Last Triggered Lamp is 1 or more. Since it hasn't been used yet, it wont turn any lamps off.

Next it will turn on self switch A. This will turn on the current lamp.

After that it will record the ID of this lamp onto the Last Triggered Lamp.

That means next time you trigger a lamp, it will turn the previous lamp off based on its ID.

As for the thing in the center of the room, I'll need more details exactly what you want it to do. Will there be any switches that turn all of them on or off?
 

G4M5T3R

Villager
Member
Joined
Jun 1, 2013
Messages
15
Reaction score
0
First Language
English
Primarily Uses
Hmm, for some reason they wont stay lit. They flicker on then off once each time the action button is pressed.

Maybe I set up the common event wrong. All of that is placed under "Then" in the condition Right? Nothing is done with Else or after Branch End?
 

seita

Donn_M
Veteran
Joined
Feb 6, 2013
Messages
2,254
Reaction score
611
First Language
English
Primarily Uses
The only thing that goes inside the "then" for the conditional branch is the line directly underneath it, the $game_self_switches script call. Don't forget to replace mapID with the current map ID.

The rest are outside of the conditional branch in that order.
 

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
854
First Language
English
Primarily Uses
RMMV
I have created a quick project that creates the effect that you are after. You can nab the project here : Light Switch


Each light event must be named in the following manner : 'light_event_{number}' (example : light_event_14). The required name can be altered, but that is the default. In this way, it will not matter what order you place the events on the map, as the scriplet determines if the event is a light by inspecting the name. Also, you can easily enable a light by using the number input command and saving that number to a variable.
 

G4M5T3R

Villager
Member
Joined
Jun 1, 2013
Messages
15
Reaction score
0
First Language
English
Primarily Uses
The only thing that goes inside the "then" for the conditional branch is the line directly underneath it, the $game_self_switches script call. Don't forget to replace mapID with the current map ID.

The rest are outside of the conditional branch in that order.
Yea, after that last post my brain started working and I figured the first part out. After fixing that though (and mapid *faceplam*) I received the Script Game_Interpreter line 1411 error.  :(   I appreciate the attempt to help  :D

I have created a quick project that creates the effect that you are after. You can nab the project here : Light Switch

Each light event must be named in the following manner : 'light_event_{number}' (example : light_event_14). The required name can be altered, but that is the default. In this way, it will not matter what order you place the events on the map, as the scriplet determines if the event is a light by inspecting the name. Also, you can easily enable a light by using the number input command and saving that number to a variable.
Thanks  :D , I'll give that a look.
 

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

Latest Threads

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,081
Members
137,582
Latest member
Spartacraft
Top