switch tree's

● ARCHIVED · READ-ONLY
Started by Oddball 8 posts View original ↗
  1. 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
  2. Conditional branches. Time-consuming though, but easy.
  3. 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 :)
  4. 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.
  5. 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)?
  6. 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.
  7. Engr. Adiktuzmiko said:
    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
  8. 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