Is there any way to call an Event from within an Event and pass in parameters as you would a function call in C#?

I find that I would like to do this fairly often to reduce duplicated states:
- I have spells that store information in game variables. The only thing different between them is the value that gets stored. It would be nice to be able to pass in the value and just have 1 event.
- I want my player to select 4 job classes. Each of the selection screens would be the same. The only difference is which combatant the player is editing. I'd like to make a master event for party selection which calls a character creator event 4 times.
- I have a few different battle end events for side-quests. They are exactly the same as the standard battle end, except they store information in a game variable. It would be nice to call the standard battle end event from within the side quests.

Thanks!
  • edited September 2017
    Did you try the call event node and the check game variable fork though?
    Post edited by UserName on
  • Are you suggesting to set a game variable before calling the event node and then check the game variable from within the sub-event? That does work for things that are simple types that can be game variables. It won't work for passing in prefabs or actors into events.

    For the character creation use case, maybe I could store the combatants in global objects and use a game variable to reference which one the sub-event is supposed to be acting on.

    The battle end events have no way to call other battle end events that I can see.
  • Yes that's what I'm suggesting. It's a work around and I don't know your set up, but I'm thinking you put a game var on a combatant and check for that var. That's what I use for AI and my battle system, but I would also need a more advanced solution for the long run, because I have to duplicate too many nodes one by one.
  • If you get Makinom, you can start a schematic from an ORK Event, pass variables into the schematic, and then have the schematic set new values on the ORK variables (if desired).

    That was the main reason I purchased Makinom -- I couldn't do what I wanted to with ORK events without an excessive amount of duplicatation. Makinom schematics allowed me to create more reusable "functions."

    You should also be able to start ORK events from Makinom schematics, so this would let you chain together ORK events in ways you can't do with just ORK. You can call Move and Battle events from a Game event, but not another Game event. So you can use Makinom to glue them all together and pass local variables back and forth.
  • Well, in ORK you can use the Call Global Event node to start one of the set up global events (which are just game events) and share the variables, selected data and found objects.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • @Keldryn that sounds really interesting. What else can you do with Makinom? My problem is this: I have big a big battle event with a hundreds nodes that I have to duplicate. Essentially it's a simple battle event with the same 10 nodes repeating themselves. The only differences are console line texts, selected equipment, some formulas. The nodes are the same and so are the game variables used in them. You think Makinom could simplify this for me?
  • @Keldryn
    would you like to share what you mainly used Makinom for? Considering to get a copy recently.
  • @UserName
    If it's just different things based on variables, you can use global events for that (or using a Call Battle Event node to use another battle event). They can share variables, selected data and found objects with the event that called them.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.