edited August 2015 in ORK Support
Hi! My name is Gerardo, and I was curious on how to script a Boss confrontation event, like a lecture before the fight event that commonly happens in RPGs. I tried to start battle after player chooses to fight from the dialogue, but I guess I don't have significant knowledge nor experience to know how to yet.

Can someone help me?
Post edited by gamingislove on
  • You can use the Start Battle step in your game event for that. This step uses a game object (e.g. an actor) with either a Battle component (where the battle is set up) or with a combatant (e.g. through an Add Combatant component or spawned through a Combatant Spawner).

    The event will continue after the battle is finished.
    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!
  • Thank you! :D
  • Hi Gil! I hope you had a great week!

    Thank you so much for the reply!
    So I followed your advice and it's not working out over here. What I did was I created a choice when the NPC asks, "Do you want to fight?" and of course there is cancel, Yes, and No that branches out in the node. When I connect the node to "Start Battle" when player selects Yes, nothing happens in game.
    I setup the NPC with a Battle Component (the one gameObject asking the question) , and see that "_Battle" gameObject spawns when player selects Yes to fight, but nothing happens. I see in the inspector in "_Battle" and start type is set to "none", how can I change that?

    Also I saw that using "Battle Start Event" script works with initializing dialogue and settings, except I can't cancel the battle when player selects out of the fight that way because how its design to go into battle regardless of conditions (So I think). I tried different nodes but the battle event continues until the fight is finished with Battle Start Event.

    I see how the functions play out now but I also want the player to choose his fights. How should I go about doing that?

    (I'm using Unity5)
  • If a _Battle game object is spawned, it means that you somewhere started a battle by getting near an enemy combatant that's not using a Battle game object (e.g. through a combatant spawner).

    Did a quick test and it worked fine here - so I guess either your NPC or a game object nearby is an enemy combatant, triggering the battle when you're near due to the auto start battle settings of the combatant (where you can define if getting near it will start battles and the range).
    When using a Battle component in the Start Battle step, you should use the None start type in the component. Also, make sure you're using an enemy faction, otherwise the battle wont start for that component.
    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!
  • BRILLIANT!

    Thank you Gil! Now I get it.

    What I did was the following to make it work:

    image

    Of course there is more details, but that's simply the summary. It finally works! I'm super happy! Next up: Variables and Conditions! :D

    Thank you so much!
  • If you already add a Battle component to the game object, you wouldn't need to add a combatant in the event, just have the combatant set up in the Battle component. Or not use the Battle component and just add the combatant in the event :)
    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!
  • Hey gil,
    So I did try without Battle component and did Add Combatant, and it works that way too. So far this is my progress as I'm experimenting with ORK. My mission right now is to create a reference project with all the working examples from your tutorials.

    This is the video so far:


    Since I have the player and enemy on a platform, the battle positions get all messy if I don't assign it with Battle Component, but a clone happens to spawn when I do (example in the video) in which is remedy if I just do Add Combatant instead. I just need to somehow figure out how to fix that clone issue with making the NPC invisible or something.

    But I'm really happy with the progress and the ease of use of the system.
    You are one seriously brilliant dude!
  • edited August 2015
    You could do the following:
    - add an empty game object with a Battle component set up how you need it (battle spots, etc., ignoring the combatants) and the None start type
    - add an Add Combatant component to the game object with the combatant set up you want to fight, but with a faction that's not an enemy of the player
    - in the Add Combatant component, you can select a game object that will be used as battle arena, select the battle object you've set up previously
    - in the event, change the NPC's faction and start the battle (using the NPC as object)

    Or you could hide the NPC before the battle starts (using an Object Visible step) to prevent having 2 objects :)
    Post edited by gamingislove on
    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.