Hello,
I have a question.
What would be the easiest way to start a battle via menu screen?
My goal is to have different menu screens for different battles. (My game doesn't have open world or walking and only consists of menus.

EP
  • edited February 14
    @EtherealPlayer there is the Start Battle node in schematics, or you can use Notify Start on a Battle Component under Start Settings -> Auto -> Add Notify Start, or depending on your setup if there are game objects to click on you can put a Battle Component directly on the objects and Start Type -> Interaction.

    So like if it was a map with HUDs with HUD Click components then the click could call schematic that starts the battle or changes a variable that starts it.

    Or like an Interaction Machine with a Show Dialogue -> Choice node and the choices start different battles.

    Or a button list in a menu with buttons calling different schematics.

    Probably more too, guess it really depends on what your menus are supposed to represent / look like. I take it it's like a "hub" UI the player interacts with.

    If the battles are in different scenes check out the 2D tutorial with teleporting battle or this doc:

    https://orkframework.com/guide/documentation/battles/adding-battles-to-scenes/#10-toc-title

    Then you can just start the battle when the scene loads basically
    Post edited by GeneralK on
  • Hey GeneralK,

    Thanks for the reply.

    I was not aware of the Add Notify Start to start battles! I'll definitely be exploring that option and see what it leads to.

    I do know about the schematics, Start Battle node but didn't like the option of having to make multiple schematics for different battles.

    Thanks again!

    EP
  • @GeneralK

    The notify to start worked wonderfully except I now have 2 issue. When a battle is finished, if I want to start the battle again, it doesn't work.

    I looked into it and found out that the prefab gets deleted/removed in the hierarchy. The only way is to exit play mode and enter again for them to reappear. Is there a way to not have the prefab with its battle component removed after a battle is finished?

    The other issue is the positioning, all the combatants go into their assigned battle spots but because I'm using the notify start method via menu screens which goes under "Dontdestroyonload" in the hierarchy; it changes the Z position of the combatants, causing the combatants to show up very small on the battlefield (Game is 2D & Z axis makes combatants smaller or bigger).

    Any help is appreciated, thanks!

    EP
  • I used something similar with buttons on a image and the easiest way was to simply load a scene (you can fork that in the schematic to have a random scene loaded if you want)with the battle component, an automachine component (to trigger the startbattle schematic if needed) the position, camera and everything you need^^

    This way the scene keep everything everytime its loaded.

    So :
    1/ the hud trigger a schematic with a load scene of your choice(using hud click)

    2/ in the scene setup everything needed for the battle itself.

    3/ You can send back your player to the previous scene trough the victory schematic that you can setup for each scene directly in the battle component ^^
  • Hey @omeegaa,
    Thanks for the reply

    That's an interesting way to set it up and fix the position and camera of combatants, it may also resolve my first issue which is the battles being removed from hierarchy after being completed.

    Thanks!

    EP
  • Check your battle's Use Scene ID settings (in the Battle component). If enabled, the battle (and any battle in the scene with the same ID) can only occur once.
    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!
  • Got it, thanks!

    EP
Sign In or Register to comment.