Hey, I'm working on a 2d top down rpg where players wander around the world, and battle in a separate scene where the layout is similar to older Final Fantasy games. Example here.

For random encounters the default battle spots appear to work well, but for boss fights I would like to explicitly place them at a specific position. Ideally I could just create a custom battle scene with its own start event and pre-place all the combatants. When I try to do that though, the enemy still gets spawned, even though it's already there.

Alternatively I updated the Battle component settings to use "Own Spots", with an empty game object specified for each player and enemy at the corresponding position, but they do not appear to get used. I feel like I'm using this feature incorrectly? Not sure what type of game object these spots are expecting. I think what I'm trying to do is similar to this post but I don't think I quite understand the solution described, specifically:
1) Make them child objects of your battle's game object - they should be transported over to the new scene as well.
Again though, I'd prefer if I could just drop the enemy in to the battle manually in this case and not have it spawn another.

I invoke the Start Battle node with the enemy combatant I want to fight, which points to a Battle object in the same "field" scene that uses a custom Start Battle Event that loads a custom battle scene. Here are some screenshots for context:
image
image
Where each "spot" is an empty game object just indicating the position (I get the feeling that is incorrect).

I've tried playing around with a few settings here and there but can't get it to work. Appreciate your help. Thanks.
  • Since you're loading a battle scene, the custom battle spots you're using (which just have to be game objects in your scene, so an empty game object is all you need) have to be parented onto the Battle component's game object, as they'd otherwise not exist in the new scene.

    When the battle loads a new scene, only the Battle component's game object and it's child objects will be transfered over (and placed at the defined spawn point).
    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!
  • This clarifies a few things. I didn't realize that when loading a new scene it brings in the Battle object. I already had another Battle object in the fight scene, so I've removed that.

    It still seems a bit confusing to specify the spots under the Battle object in the Field scene, when the positions correspond to the Battle scene, but can definitely work with that. I suppose there isn't a way to just manually add the combatant to the Battle scene without it being spawned again (as a duplicate) when the battle starts?
  • edited March 9
    Yeah, the other battle object wouldn't be used, since there already was an ongoing battle. You can do this in 2 ways, either with the battle in your field scene doing the scene loading (like in this gameplay tutorial), or loading a scene via other means (e.g. scene changer or regular game event) and have a battle in that scene start the battle (e.g. via Autostart).

    The 1st way (Battle in the scene, combatant spawners or using Random Battle Areas) is the usual go-to method, but the 2nd one could be a good option for loading into special battles, e.g. boss encounters that should be set up a certain way in the new scene (but you'll have to use different battle start/end events if there's a different setup, e.g. no scene loading needed).

    The Auto Join Settings in Battle System > Battle Settings allow you to set up combatants joining an ongoing battle, i.e. a placed combatant in the battle scene could join in like that - but for getting into the scene, you already need at least 1 enemy in the battle set up or the battle can't start. For this scenario, loading the boss battle via a regular event and having the battle set up in the scene as you need it might be the better option.
    Generally, the battle's game object is kept alive and placed at the spawn point, i.e. the child objects you're using as battle spots would stay at the same position relative to the battle game object.
    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!
  • Hey thanks a bunch. I followed the tutorial you linked to get everything setup to where it is and it's worked well for random encounters.

    I'll give the approach you mentioned a try. It's at least helpful to understand what options are worth pursuing.

    Thanks again for your help.
  • I've had a chance to test things out a bit, and the 2nd solution seems to work in theory, however when I set the battle to autostart it doesn't happen consistently. I've tested this by adding a debug log to the custom battle start event, and just playing/stopping the scene in Unity repeatedly.

    This behaviour seems consistent with a similar issue I noticed in another project where the autostart event wasn't triggering. In that case I ended up justing placing a trigger over the player spawn position, but that's not really an option this time.

    Any idea why this might be happening? I've tried adding a delay (eg. start after 0.5s) but still behaves unpredictably. I just updated to the latest version 2.30.2 available in the asset store, but I noticed my ORK Project is still 2.30.2. Not sure if there is anything else I'm supposed to do when upgrading. Thanks.
  • Well, it depends on the state of the game - i.e. if the battle can be started.

    E.g. coming from the other scene, it could be due to the controls being blocked, enabling In Blocked Control would prevent that.

    The latest version is ORK 2.31.0, but there's a know issue/bug in the package manager that doesn't download the new version. Only clearing the package manager's cache would fix that.
    Unity just posted today that they finally rolled out a fix for this with 2020.3.0 and 2019.4.23.
    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!
  • In my example I started the battle scene directly in Unity (via the play button), so there was nothing else happening in the game, yet it was still unpredictable. I don't see what could be interfering with it if there's nothing else happening.

    And I will look into that update. Thanks.
  • The battle can't start without a player, e.g. when starting directly in the scene it might lead to the battle starting before the player group was set up by the start 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!
  • I'm seeing the same issue in the game. I just updated to 2.32.1 today and think it may be related as it seemed to be consistently working (in game) after your reply above.

    I have an event with some dialog, and at the end it changes a quest task status, stores the scene, and then loads the boss battle scene. The boss battle scene has its own battle object with its own battle start event (plays a sound and spawns combatants) however often I'm seeing the battle start event doesn't even get invoked (my debug message at the beginning of the event doesn't get logged).

    My battle uses the Autostart type with "In Blocked Control" checked and whether I specify "Start After" to 0.1s or 1s I see similar behaviour.

    Is there anything that sounds off to you? Let me know if there's anything else I can provide that'd be helpful. Thanks
  • Hm, I'll check it out.
    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 think there is an issue where this can ignore the In Blocked Control setting via autostart - will fix it in the next update.
    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!
  • Alright thanks for looking into it.
  • For now you should be able to work around that by unblocking player controls before your scene change.
    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, I took a break on this problem to focus on something else but coming back to it now and still having issues. Wondering if you have any new ideas what might be happening?

    I gave up on autostart since (from my experience with multiple ORK projects) it doesn't work reliably when a new scene is loaded. Instead I have the battle to start on "Trigger Stay" and that appears to be working. The problem now is that the "own" player battle spots are being ignored.

    To recap my setup...
    - I have a game event that shows some dialog, unblocks player control, then stores the current scene and loads the battle scene (spawning players at spawn point 0)
    - as mentioned above, in the battle scene the battle starts by the player triggering the collider attached to the battle component
    - the battle start event plays a sound and spawns the battle combatants
    - the battle components has its "own spots" set pointing to empty game objects for the player and enemies. the enemy is spawning in the correct location, but the players are not. i imagine this might be because they are already present in the scene, and they aren't getting moved/spawned in the "own spots" locations?

    ultimately i just want my players to have a dialog with a boss character, fight the boss in a separate scene, then continue the dialog with the boss in the original scene after the fight.

    any help you could provide would be super appreciated. ty!
  • Did you update to the latest ORK release (2.33.0)? The update should fix the autostart issues, in case your issue is the one I found and fixed :)

    The Place At Spots node is used to place already existing combatants at their battle spots in your battle start 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!
Sign In or Register to comment.