switch tree's

Oddball

Veteran
Veteran
Joined
Sep 4, 2014
Messages
1,923
Reaction score
534
First Language
English
Primarily Uses
N/A
how do you put a switch tree into a game? like...

switch 1 can result in switches a, b, or c being turned on. switch a has sub-switch's a1, a2, and a3. sitch b has sub-switches b1 and b2. while switch c has c1 and c2

while switch 2 has switches d and e. d has d1, and d2, and e has e1, e2, e3 and e4 and so on

basicly, i'd like a path to were it's 1 switch, 1 sub-switch and one sub-sub-switch. how do you do that? these would be set at the beginning of the game or after a certain part of the game. this isn't for my current project, but one i have planned in the future
 

EternalShadow

Veteran
Veteran
Joined
Sep 16, 2012
Messages
5,781
Reaction score
1,041
First Language
English
Primarily Uses
Conditional branches. Time-consuming though, but easy.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I've moved this thread to VX Ace Support. Please be sure to post your threads in the correct forum next time. Thank you.


"How do I ..." questions ALWAYS go in Support or Script Support, if you're trying to do something in RPG Maker :)
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
Switches have no structure, they're at first independent of each other. You create any conditional structure by assigning several switches to their use.


If that structure is more complex, you should start by designing it somewhere else (on paper or a game development file), then assign those switches with names that will help you identifying the structure.


After that, you have to implement that structure manually - usually by a mixture of conditions and conditional branches like said above.


The reason why you should design and write down the structure elsewhere is to get a reference when to place which conditions - there is a high risk of setting a wrong condition if the structure is complex and you're working from memory, and that will result in a very complex bughunting if you have dozens of events without a reference what each event should be conditioned to.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
switch 1 can result in switches a, b, or c being turned on
So when 1 is turned ON, a random switch from a,b,c will be ON too? How do you decide which sub-switch get's turned on? And what's the use of that (I kind of fail to see how the idea would be implemented)?
 

Susan

Veteran
Veteran
Joined
Sep 1, 2014
Messages
2,748
Reaction score
8,346
First Language
No idea...
Primarily Uses
RMMV
Not sure how you intend to use this 'switch tree' but it sounds a bit like dice rolling in a gamebook.

You can set a control variable command to a random number (eg 1-100).

Below that, you create multiple branches checking that variable (eg 1 for less than 33, 1 for 33 - 66, 1 for more than 67).

You can set your events under each branch.

Each branch can switch on different switches, or lead to more conditional branches.
 

Oddball

Veteran
Veteran
Joined
Sep 4, 2014
Messages
1,923
Reaction score
534
First Language
English
Primarily Uses
N/A
So when 1 is turned ON, a random switch from a,b,c will be ON too? How do you decide which sub-switch get's turned on? And what's the use of that (I kind of fail to see how the idea would be implemented)?
a switch would be chosen at random to be turned on. then, that switch triggers 1 random sub-switch being turned on. then, a sub-switch of the sub-switch is randomly turned on. this all happens at the beginning of the game or at a certain part of the game
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
You can do this via simple script calls after the switch is turned on

SWITCH WHATEVER IS ON

Script: 

x = rand(HIGH_ID) + LOW_ID

$game_switches[x] = true
 

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

Latest Threads

Latest Posts

Latest Profile Posts

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.
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'??

Forum statistics

Threads
105,863
Messages
1,017,053
Members
137,571
Latest member
grr
Top