edited November 2015 in ORK Scripting
Hi,
is there a way to spawn an enemy by script with start type: interract (like the combatant spawner script can handle)?

I am not sure where to look in the code/api for this issue.

Many Thanks,

Dominik
Post edited by widnig89 on
  • Combatants don't have start types. If you want to spawn a combatant through interaction, use the combatant spawner component. If you want to start a battle through interaction, use the battle 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!
  • Hi,
    thanks for the fast response.

    but in my case I think both solutions do not work, but I guess there is a way doing it.

    More concrete:

    I want to spawn a combatant --> so combatant spawner. This combatant has a defined position. If I am in the near of this combatant, I want to talk to him. The dialog is something like: "Wanna battle? - yes -no"
    If I am choosing YES, the battle with that combatant starts.

    ATM I have a solution : faction of combatant is friendly first. If I say "Yes" the faction changes to enemy, and the battle starts.

    But I think there is a better solution?

    Many Thanks.
  • You can just have the game object just not be a combatant, i.e. a normal NPC and use a Battle component (either on the NPC or another game object) set up with the battle you want and start type None.

    Add a game event to the NPC with your dialogue and a Start Battle step to start the battle (using the game object with the Battle 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!
  • Thanks,
    i alredy thought the same.

    But then I still have the problem, that I do not know the status values of that npc before the battle starts, right?

    Because in my game I only want to have turn-based battles. And when the mouse hover a combatant (or a gameobject which has combatant component attached) I want to inform the user how strong the actual enemy is by displaying the level, stats and so on, before going in battle...
  • In that case, use an Add Combatant component to add a combatant to the NPC game object. You can either use your faction solution (being friendly first) or disable the combatant's auto start battle settings to prevent the battle from starting by coming near the NPC.
    You can use the NPC with the combatant in the Start Battle step to start the battle.
    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!
  • Many thanks.
Sign In or Register to comment.