edited December 2023 in ORK Support
I'm running into an odd issue when trying to make a scripted/manual battle that occurs when talking to a character, which uses an Interaction Machine.

When using the Add Combatant component, anytime I approach the NPC, the battle starts automatically before I can even get close enough to activate the Interaction Machine. I'm sure there's some sort of setting I'm missing here to prevent this from happening, but I can't quite find the answer. I've tried modifying the collider of the enemy combatant prefab, but no luck.

Any ideas what I would need to change to fix this?
Post edited by LostForest on
Agender, curry fan, Top 10 lister, indie dev, gym hitter, musician, et al.
  • If they're set as an Enemy faction, then your auto battle range settings are likely kicking in (Combatants -> Auto Start Battle). You can either adjust those settings to not start battles on range/immediately, or you could make said NPC be a "neutral" faction through Add Combatant component, and then in your interaction machine before actually starting the battle use a Change Faction node to change them back into an "enemy"
  • Ah, that did the trick! I changed the distance to 0.1 in auto start and I can safely approach enemies without it instantly starting. Thank you so much for the help!
    Agender, curry fan, Top 10 lister, indie dev, gym hitter, musician, et al.
  • edited December 2023
    I actually am running into a weird bug in this same schematic, now though.

    After the battle completes and the schematic continues, I cannot get it to control or acknowledge any Find Data actors in the scene. For example, if I want to change position of an NPC in the same scene, setting them as an actor, the schematic will not find them or do anything with them. Sometimes it even freezes, for example if I tell it to change their color/fade out and tell it to Wait.

    Any ideas on what would be causing this? Something to do with the schematic not remembering the actors from before the battle? I can't even move the player to a different location after the battle completes.
    Post edited by LostForest on
    Agender, curry fan, Top 10 lister, indie dev, gym hitter, musician, et al.
  • You can also use the Add Combatant node in a schematic to add a combatant to a game object (like the component) to get around the battle starting issue.

    How's the actor set up?
    If the game object is part of your scene setup, I'd recommend using the Game Object actor type - this allows you to select the game object in the machine component.
    However, if the battle involves changing scenes, all those game objects are destroyed due to the scene change. In that case, searching for the game objects is better, e.g. the Find Actor Objects node redoes the search for actors that are set up to find game 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!
  • I have an NPC game object named Christoph, and the actor set up in the schematic settings is established with Find Object and Name (search name: Christoph).

    So to use the Game Object type of actor, I would manually set the Christoph game object in the same actor slot, in the Interaction Machine component of the starting machine?
    Agender, curry fan, Top 10 lister, indie dev, gym hitter, musician, et al.
  • edited December 2023
    I've tested it out using the NPC as a Game Object type, then adding a Find Actor Objects node, and it still doesn't seem to work after the battle.

    All nodes that do anything with the Actors, such as movement, change color, etc... refuse to work afterwards. I've noticed that the Find Actor Objects node says that only actors with 'find object' enabled will be searched again. I don't really understand how to have an actor listed as both Find Object and Game Object. Is there a setting I'm not seeing for that?
    Post edited by LostForest on
    Agender, curry fan, Top 10 lister, indie dev, gym hitter, musician, et al.
  • Also, here's the actor setup in the schematic:
    image

    And the Interaction Machine's actors in the component:
    image
    Agender, curry fan, Top 10 lister, indie dev, gym hitter, musician, et al.
  • edited December 2023
    The Find Actor Objects node is only used for actors that are searched in the scene, i.e. the Game Object actor isn't searched.

    Is your battle taking place in a different scene?
    You could use the Don't Destroy On Load node to mark the game object to not be destroyed on scene changes - but returning to the scene will have that game object twice, the one from the loaded scene and the one that's not destroyed from before.

    Or go with the search setup as before, using Find Actor Objects node after the battle to find it again.
    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!
  • Yes, the battle takes place in another scene and then returns to the original scene where the machine was. I'll look into using Don't Destroy On Load.

    Also though, I don't quite understand what you mean by "The Find Actor Objects node is only used for actors that are searched in the scene".
    The NPC I'm using is in the original scene, set him in the machine component, and I used Find Actor Objects after returning to that scene when the battle finishes.
    How would I set up my actors, to use that node correctly?
    Agender, curry fan, Top 10 lister, indie dev, gym hitter, musician, et al.
  • You need to use a Find Object type actor for that. That's the only one that searches for game objects in the scene and can search for them again via the node.
    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!
  • Okay! That seemed to do it. Using Find Actor Objects after the battle, in tandem with keeping the NPC as the Find Actor like I originally was, seemed to do the trick.

    Thanks so much, GiL! Your help and hard work is always really appreciated! Hope you have an awesome holiday season!
    Agender, curry fan, Top 10 lister, indie dev, gym hitter, musician, et al.
Sign In or Register to comment.