Suggestion: Event condition EQUAL TO a variable

● ARCHIVED · READ-ONLY
Started by Crifmer 10 posts View original ↗
  1. I tried searching for this, but it's very specific and my search-fu turned up lots of hits that wasn't really what I was looking for.

    I thought perhaps that it'd be pretty keen if an event condition could be equal to a variable instead of equal to or greater.  I know it would certainly help me write events with greater precision.

    I need to keep track of the actor in the party member 1 slot for event purposes.  If I just needed it for in-event conditions, I could do it with just a call to the variable (which I'm still doing), but for some cutscenes, I need to change character graphics depending on who's on first.  So instead of having the events process the variable all at the same time, I'm doing it with page conditions and switches.  It's not so bad, really, but if I could just make the condition equal to a single value, I could use one variable instead of four switches and set the variable in the master event controlling the cutscene instead of calling a common event or putting it in a script.

    It's not really that big a deal (yet - I haven't done anything too elaborate yet), but I do think it would be helpful. To me, anyway.

    And if there's an efficient way of doing this without scripts, that'd be keen too.

    Sorry if this has been discussed before.  My search-fu is not that great.
  2. If you want a page to be active if a variable is 1, then make it active for greater/equal 1 and add a new page above that is active for greater/equal 2. 
  3. Any change to the event conditions would require a change in the editor, and unfortunately that is a no-go.


    However, there is a way to use multiple pages for the same effect.


    Let's for example assume you want to check if a variable is equal to 5.


    Then you make one event page with condition var equal or greater 5, and place the commands there that should happen if the variable is equal to 5.


    And then you make an additional page with a higher page number conditioned to var equal or greater than 6.


    If the variable is 6, then both page conditions would be fulfilled, but the priority would make the page with the condition 6 or greater active.


    The page with the condition set to equal or greater than 5 would only be active if the variable is equal to 5, not if it's greater, because the greater number would trigger the next page.


    The only other way to make such a condition would be to use scripts, as you assumed yourself.
  4. Andar said:
    Any change to the event conditions would require a change in the editor, and unfortunately that is a no-go.

    However, there is a way to use multiple pages for the same effect.

    Let's for example assume you want to check if a variable is equal to 5.

    Then you make one event page with condition var equal or greater 5, and place the commands there that should happen if the variable is equal to 5.

    And then you make an additional page with a higher page number conditioned to var equal or greater than 6.

    If the variable is 6, then both page conditions would be fulfilled, but the priority would make the page with the condition 6 or greater active.

    The page with the condition set to equal or greater than 5 would only be active if the variable is equal to 5, not if it's greater, because the greater number would trigger the next page.

    The only other way to make such a condition would be to use scripts, as you assumed yourself.
    I think if I only had one or two pages going on I may have thought of that... I'll keep it in mind, but I've got so many pages and switches in multiple events that I wanted to keep it as simple as possible visually.  I'm also trying to do this with an eye toward readability.  So in this case, I think the common event call and multiple switches is the way to go.

    The title of the thread, though, is actually a suggestion for the next iteration of the editor.  I think having a condition able to just be equal to a variable would be a big help.  To be frank (respectfully speaking) there are a lot of options for setting variables and conditions that aren't included that have me scratching my head.  I'm sure it has to do with the way the editor is set up.

    Thank you guys for the suggestion.
  5. If you want some additional help, I usually enjoy looking throught other peoples work and search for ways and methods to simplify eventing and scripting. Maybe I can help to make your events a little bit less complicated or can think of some script snippets to simplify stuff. PM me if you're interrested.
  6. You would also need an earlier page for if the variable is less than 5.


    Otherwise, if you have many pages and at some point on several of them you want the sprite to change depending on who is the leader, just do a Call Common Event, and set up a new common event that uses a conditional branch to see if it's actor 5 in the lead and do one thing, else do the other thing.
  7. Tsukihime said:
    This script allows you to use a conditional branch as a page condition

    http://himeworks.com/event-page-conditions

    Conditional branches have "equal to" operator.
    Oh that's snazzy.  I have my reasons for trying to figure all this out without scripts, but Imma glom this one.  Thankee.
  8. Andar said:
    Any change to the event conditions would require a change in the editor, and unfortunately that is a no-go.


    However, there is a way to use multiple pages for the same effect.


    Let's for example assume you want to check if a variable is equal to 5.


    Then you make one event page with condition var equal or greater 5, and place the commands there that should happen if the variable is equal to 5.


    And then you make an additional page with a higher page number conditioned to var equal or greater than 6.


    If the variable is 6, then both page conditions would be fulfilled, but the priority would make the page with the condition 6 or greater active.


    The page with the condition set to equal or greater than 5 would only be active if the variable is equal to 5, not if it's greater, because the greater number would trigger the next page.


    The only other way to make such a condition would be to use scripts, as you assumed yourself.

    That only works for some cases. In the event of making a sequential switch this does not work. If you have four switches that have to be opened in a specific order, If you set the first one to 5, second to 6, third to 7 and fourth to 8, all the conditions are met no matter what order you flip the switch. I dont understand why the conditions area was created so flawed in VX Ace.
  9. @xShoot4WarAmpsx
    For any sequence, you use a variable instead of switches.
    The events portrait switches to the player, but the code checks if the switch is in order and then either counts up a variable or not. And the check for switch order is simple: The counting variable has to have the number of correctly turned previous switches.

    There are a number of reasons why the conditions on the events have to be limited, but the result is sufficient for almost any case if you are using the correct elements.