No matter what I do...(Switches/variables) - Please Help

Discussion in 'RPG Maker VX Ace' started by TheDeadYoshi, May 17, 2014.

  1. TheDeadYoshi

    TheDeadYoshi Villager Member

    Messages:
    17
    Likes Received:
    0
    First Language:
    English
    Hi everyone,

    I'm so sorry to bother you with my noobish problems but I just cannot get this sequence in particular to work no matter how I try to tweak it. I want the game to start with a very simple tutorial. Your character is escorted down to another part of the map and you have to take part in two battles to learn about offense and defense. (so I've set up a variable to add one value upon the completion of each battle). This then leads to the NPC who escorted you earlier giving you a key to advance onwards. 

    Here is a breakdown of all the things I have in place to make this happen and I will explain after what is going wrong:

    - Opening dialogue (common event), after this Switch A is activated.

    - Switch A has NPC movement, going south to another part of the map. Switch B is then activated.

    - Switch B then replaces the current event (the NPC with a clone NPC with the next stage of dialogue and options) The original NPC is meant to go transparent and the second NPC is meant to take its 

    place and have a sprite.

    - Second event (second NPC) has Switch B on and on that event page there is additional dialogue about what the player needs to do.

    -The player then completes both battles and has the variable value of +2

    - On the second event page for the clone NPC, a variable +2 condition is set up which gives the player an item needed to proceed. Then Switch C is activated. 

    - Switch C has some extra dialogue and is mainly there to stop the player from receiving multiple key items. 

    - Returning north there is a laser field blocking your path with a key reader beside it. The event the player uses the action button on activates Switch D.

    - Switch D is meant to consume the key item, change the sprites for the key reader and remove the sprites for the laser field (four sprite changes in total), which would then allow the player to proceed.

    Sorry if I've bored you to tears already, here is what is happening...

    The opening scene all runs fine, the NPC moves to its next location and disappears never to be seen again (perfect) but for whatever reason the next NPC does not appear and I cannot tell why. Furthermore once I've collected the variable values, again, it's not there to give the player the key item. I did manage to get it to work before and the reason the state of the events is like it is (above) is down to the original NPC still appearing at the start of the map for some reason. So I cannot test if the key item works on the last portion of the sequence (but when it did work before, the sprites didn't change, again - for some reason).

    I've tried so many combinations now and I'm at my wits end.

    Any help would be greatly appreciated. 

    Chris.
     
    #1
  2. Andar

    Andar Veteran Veteran

    Messages:
    27,113
    Likes Received:
    5,947
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    please post screenshots of your events, most probably you just made a mistake with the conditions and page priority.


    However, one advice: you should have only one event controlling your cutscene, and that event should not be part of the scene but remain permanently invisible, controlling the other events as they move around. It has been proven countless times that haviung more than one event controlling a cutscene will result in a lot of problems during that cutscene, unless you know exactly what you're doing...
     
    #2
  3. TheDeadYoshi

    TheDeadYoshi Villager Member

    Messages:
    17
    Likes Received:
    0
    First Language:
    English
    Here are screenshots of the events. It's all a bit a convoluted but I do struggle to get my head around incorporating so much in one single event (with lots of moving parts). In all the tutorials I've tried to understand, switches have been made out to be such a simple thing, switch one on, it functions until it is switched off. I don't understand why it's so complicated. So if there's an easier less messy way, I'm willing to learn. 

    So far I'm pouring hours into something that should take about 3 minutes to play and complete.

    Thanks.

    event1.jpg

    event2.jpg

    event3.jpg

    event4.jpg

    event5.jpg

    event6.jpg

    event7.jpg

    event8.jpg

    event9.jpg

    event10.jpg
     
    #3
  4. Tommy Gun

    Tommy Gun ♩ ♪ ♫ ♬ Veteran

    Messages:
    385
    Likes Received:
    120
    First Language:
    English
    I didn't read through the whole thing, but pics 5 and 7 use self-switches, but I don't see where they're actually activated -- did you mean to use a regular switch for those? So you can activate it in a separate event? That might be your problem. Self-switches need to be set in each event (hence the name).

    I'm pretty sure that's your problem. You should use a variable instead of self-switches.
     
    Last edited by a moderator: May 17, 2014
    #4
  5. TheDeadYoshi

    TheDeadYoshi Villager Member

    Messages:
    17
    Likes Received:
    0
    First Language:
    English
    Hi Psychonaut, those switches are activated by another event (and that event also has conditions for the same switches, so that one goes transparent and stops being used and the other event is activated and replaces it with new dialogue and events)

    Maybe that's a bad idea though...I don't know - I've always found switches and variables a bit confusing as there's never a particularly clear explanation or demonstration anywhere. 
     
    #5
  6. Andar

    Andar Veteran Veteran

    Messages:
    27,113
    Likes Received:
    5,947
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    Your first problem is obvious: you're using parallel processes.


    Parallel processes are needed for a few very specific purposes, but a cutscene is usually done without parallel processes. That is because it's very difficult to make a sequence when there are parallel processes interfering with your intentions...


    One thing that you always have to keep in mind is that parallel processes automatically loop - for example the "set location" command in the fourth screenshot (page 3 of event 12) will be executed sixty times per second because of this...


    The next problem you have is that you misunderstood the basics of self-switches. There is a reason why they are not named like general switches, and use different commands: Self switches are event based, which means that the self-switch A from event 12 is a different self-switch than self-switch A on event 14. And all self-switch-command always and only affect the self-switches of the event using that command - that's why they're called "self".


    So your event 14 will never run, because all it's pages are either conditioned to its self-switch B or self-switch C, and there is nothing inside that does command the self-switch B ON, so the first page will never be triggered.


    To trigger a different event, you have to use the general switches, not self-switches, because the general switches are the same for all events, they're game-based instead of event-based like the self-switches.


    I think you should go back to the basics to learn the use of different switches and variables - if you follow the link in my signature, you'll get to several tutorials, including the variables guide. I think the variables guide as well as the sample game are good ways to teach you how to really use switches.
     
    #6
  7. Tommy Gun

    Tommy Gun ♩ ♪ ♫ ♬ Veteran

    Messages:
    385
    Likes Received:
    120
    First Language:
    English
    EDIT: Beaten by Andar. :p

    But those aren't switches -- they're SELF-switches, which mean they can only control the event they're IN. That's why your other event isn't being activated. You need to use something "global" like a regular variable.

    Look at pic 5. The first page is only activated if self-switch B is on, but it never will be! Change that to a variable and everything should be fine. So the first event uses a variable like "cutscene = 1", and on page two it would be "cutscene = 2" instead of switch B = on.

    Then pic 5 would use "variable cutscene is 2 or above". 

    Does that make sense?
     
    Last edited by a moderator: May 17, 2014
    #7
  8. TheDeadYoshi

    TheDeadYoshi Villager Member

    Messages:
    17
    Likes Received:
    0
    First Language:
    English
    This is great, thank you both. I'm going to back and redo everything.

    I'll have a look at that link. The tutorials for switches and self switches (that I have checked out) led me to believe that they can set conditions for an entire map. For instance, I've been trying to use them to set conditions once certain events have transpired (and shouldn't be looped). 

    What you said about "set location" looping sixty times per second made me laugh. Oops.

    Psychonaut, in terms of using variables, do they work similar to switches? I.e. The NPC I'm using transports back to his starting position, normally I would prevent this with a self switch so that when I return to the map he's in the position I last left him - can a variable dictate the same thing?

    Thanks
     
    #8
  9. Andar

    Andar Veteran Veteran

    Messages:
    27,113
    Likes Received:
    5,947
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    Variables work like general switches - one value that is accessed throughout the entire game. Which means not only a single map, they're affecting every map where they're used.


    Only self-switches are limited to their own events.


    EDIT:


    Search the forum for a script called "remember event position", that is a lot easier to use than self-switches and set location commands (OK, you'll have to make a script call - but no mixing up parallel processes and the like)
     
    Last edited by a moderator: May 17, 2014
    #9
  10. TheDeadYoshi

    TheDeadYoshi Villager Member

    Messages:
    17
    Likes Received:
    0
    First Language:
    English
    I'm going to put everything in one event and see what I can do to manipulate all the chess pieces to get the result I want. 

    Then I'll sort out the key item/ laser field nonsense.
     
    #10
  11. TheDeadYoshi

    TheDeadYoshi Villager Member

    Messages:
    17
    Likes Received:
    0
    First Language:
    English
    Ok I've done a major clean up. It works much better apart from one aspect and that's once the variable (for having completed the tutorial) comes into effect. 

    Once the variable reaches +2 the dialogue should be different and lead the protagonist to receiving the first key item. I'm doing something wrong so only if you don't mind, can I quickly show you the updated and cleaner event pages? This is a good way for me to learn (but I will of course read up on it more tonight - I'm just determined to get this working haha).

    Ta

    So just to note, there are two variables in play. The first works perfectly. The second which involves the variable gaining one value upon battling an enemy is not changing anything once I return to the original event/NPC. 

    revisedevent1.jpg

    revisedevent2.jpg

    revisedevent3.jpg

    revisedevent4.jpg

    revisedevent5.jpg
     
    #11
  12. Tommy Gun

    Tommy Gun ♩ ♪ ♫ ♬ Veteran

    Messages:
    385
    Likes Received:
    120
    First Language:
    English
    I don't think any of those screenshots show the part that isn't working. The battle part isn't shown. Also, a "key item" is a very specific thing that you only need if you're going to "ask" the player for an item he has to pick. If it's just a required item, it doesn't need to be set as a "key item". (But it won't cause any harm if it is.)

    (btw, my name is Tommy Gun -- Psychonaut is my member title thing; name is in the blue bar above it)
     
    #12
  13. TheDeadYoshi

    TheDeadYoshi Villager Member

    Messages:
    17
    Likes Received:
    0
    First Language:
    English
    Hi Tommy Gun,

    I've just been referring to it as a key item as it's a key card that's vital in game progression. Good news is I've fixed the final part of the sequence, with the laser barrier etc... so now I've just got to see to the middle section of the tutorial. The battles, as you mentioned. Currently I've got it set that when the enemy's HP reaches 0% the variable increases by 1. There are two enemies, one each in two rooms the player visits. The event/NPC waiting outside has dialogue etc set up to happen once the player has battled these enemies but nothing is happening once I've faced them and returned. 

    I can post screenshots if it helps. Unless you can recommend a better way of setting this up? 

    Chris.
     
    #13
  14. Tommy Gun

    Tommy Gun ♩ ♪ ♫ ♬ Veteran

    Messages:
    385
    Likes Received:
    120
    First Language:
    English
    I don't have battles in my game, so someone else will have to field this one. But yes, screenshots will probably help.
     
    #14
  15. TheDeadYoshi

    TheDeadYoshi Villager Member

    Messages:
    17
    Likes Received:
    0
    First Language:
    English
    Thanks for your help, Tommy Gun. I appreciate it.

    I'll post a screenshot and hopefully someone will know where I'm going wrong. I'll read up on events and variables later on as well...

    battlevariable.jpg
     
    #15
  16. Andar

    Andar Veteran Veteran

    Messages:
    27,113
    Likes Received:
    5,947
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    I think the problem is at another place, because of the page priorities.


    If several page conditions are fulfilled, the page with the highest number gets priority and the other pages will be ignored - which means as soon as the player gets the item, it will no longer matter how high the variable counts. The fourth page will always be active as soon as the player gets the key.


    The same happens to page two when the condition of page three is fulfilled - why are you using two different variables for the page conditions?


    Using variables for page conditions can help a lot, but as they have more values, you'll need more care than with switches to set the correct conditions.


    And if a single event has three different conditions, then you have to make sure that those conditions can only be fullfilled in the correct order, or you have to reorder the pages to account for page priority.
     
    #16
  17. TheDeadYoshi

    TheDeadYoshi Villager Member

    Messages:
    17
    Likes Received:
    0
    First Language:
    English
    Hi there, I've tried re-ordering the pages.

    Having multiple variables was following Tommy Gun's suggestion (not really to have multiple ones but to try using a variable for cutscenes instead of what I was doing, which was using self switches). 

    Everything is working apart from that final little problem of getting the NPC(/event) to recognize the variable value being +2 and to move onto the next phase of the event. I don't understand why the software is designed to prioritize pages in the way it does (which surely can't benefit anyone) instead of allowing users to control the chronological order of events you want to transpire. It's a bit odd to me. But whatever, I'll keep trying.

    I really don't think there's much more I can explain. It's all above ^ I've just got to keep fiddling with it. But if anyone has a bright idea, I would be very grateful. Say if you can tell me from experience how you approach these kinds of events/situations. 

    Thanks so much for all your help. It's made a big difference so far.
     
    #17
  18. Tommy Gun

    Tommy Gun ♩ ♪ ♫ ♬ Veteran

    Messages:
    385
    Likes Received:
    120
    First Language:
    English
    Yeah, I didn't say to use multiple variables. But one thing is that you don't need to have a separate page for "item exists". I would just set that as an IF condition:

    IF item exists

     "advance to CIC"

    ELSE

     "you need a pass key!"

    or whatever. There are a lot of ways to do these things. What you're doing is fairly basic, so reading some tutorials should help.
     
    #18

Share This Page