Hello again,

I'm trying to make my battle system to transition into a new scene and load a battle upon loading that scene. I have the scene setup with a Battle object that is set to auto start. However upon loading into the scene no battle menu UI loads in, nor does any prefabs load in or anything. Doesn't seem like the event is starting at all, I was wondering if anyone could provide any insight into why this may be. image
  • Check out this gameplay tutorial on fighting in a different scene.
    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 I will give that a shot.
  • edited August 3
    Hi bumping this because I've ran into issues trying to get this battle to start at all. I've setup everything according to that tutorial and have a battle event in my scene but it would seem that the battle event doesn't trigger or event start. I think I'm missing something or have some setting misplaced here and was hoping you could help.

    I have the events setup like the tutorial you linked me, and have them set into the battle event. The battle event is placed in the main scene with a start type UI. I have a button that activates with the Battle event slotted in On Click() - BattleComponent.UIStart, but still nothing happens on click. The battle never seems to load. I wondered if a blocking event was causing this or something but I checked and didn't have any blocking events active.

    Thanks for the help. I'm going to keep trying to tinker with it in the meantime.

    EDIT: Wow literally as I post this it works. So it seems to be spawning in my combatants but I don't see any of my prefabs spawning for my combatants. Would this be a battle spot positioning issue? The menu also pops up for my options like skills, items, etc but it doesn't let me click on them accurately which I'm assuming is something I have to fix with my GUI boxes.
    Post edited by supportreport1 on
  • A battle can only start if:
    - either not using Scene ID or the defined ID wasn't used by another battle (i.e. marked as battle finished for that ID)
    - the battle's combatants are in an enemy faction (i.e. enemies of the player)
    - the variable/quest conditions are valid

    Naturally, the used start type also has to work, e.g. Trigger Enter can only work if you've got a trigger attached to the battle and rigidbodies are involved to cause the trigger enter :)
    Also, if the battle should start via the start type during blocked player controls, enable In Blocked Controls.

    As for the spawning - that's something you need to do in the battle start event you're using, so I'd check there :)
    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!
  • edited August 5
    Thank you for the info that all makes its a lot clearer for me.

    I was going through the battle event and taking a look at the battle spots and I did have some predefined but they still wouldn't spawn in the scene. I was hoping to use custom battle spots by using an object but since I will be loading my battle in a separate scene, would the only way to define my spawn points by object in the battle scene to define those spots as a global object?

    I just can't seem to figure out how to setup the spawn points in the next scene by object since my battle will be taking place in another scene if that makes sense.
    Post edited by supportreport1 on
  • When using the method from the tutorial, the battle (game object) will be spawned at the used spawn point, i.e. your battle spots should be child objects in the original (field) scene.

    Alternatively, you can also have the battle set up in the scene and start it via Autostart start type - but you might need to use a short delay (Start After setting) or use the In Blocked Control setting to be able to start it when loading the scene. When using this, you need to load the scene from e.g. a scene changer or a game event, but not from another Battle component, as that'll already have a battle going on and prevent the one in the scene from starting.
    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!
  • edited August 6
    The battle setup in the new scene worked perfectly and I can now see my little creatures in the battle, thank you so much! The only thing is, it does seem finicky. Like even if I just move an object in the scene unrelated to the event the battle at times won't load until I relaunch unity altogether. This shouldn't happen right? It even stopped working after changing a shader on a unrelated object.

    The other thing I figure I might as well ask here, is a couple GUI box related questions.

    1. I'm setting up my GUI box for my battle menu, I want to be able to click on the separate buttons to activate them but it seems like no matter where I click on the screen it activates the same currently selected one and doesn't allow me to select others without using a input key on my keyboard.

    2. Is there a way to activate a custom UI Image at the same time as these battle menus activate, and then deactivate it? I figured out a solution for this when it comes to dialogue in game but was wondering if you had an easy way to link the battle menu to it.

    Thanks again so much really.
    Post edited by supportreport1 on
  • Yeah, that's strange and shouldn't happen. Do you get any errors in the Unity console in those cases?

    1) Hm, by any chance, did you set an input key with mouse click as your accept button?

    2) You could use the potrait settings of the battle menu, but the portrait would be displayed the whole time and not go away after some time.
    As an alternative solution, you can use turn start events to e.g. show a notification/auto close dialogue for your image. Turn start events are set up in Battle System > Battle Settings for all combatants and can be overridden by each combatant individually. They basically use a game event at the start of a combatant's turn.
    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!
  • edited August 6
    I did happen to get a compiler error that I didn't notice and fixing that makes it work every time, thank you. Edit: Well... I spoke to soon. It seemingly is doing the same thing again where it will activate upon a relaunch at time but other times the event will not start. I haven't touched anything to do with the event just added some objects to the scene the battle takes place in. I do have an error now upon running that states I have 2 audio listeners for some reason when I only do have one component in the scene. Would this be throwing it off? I was wondering if for some reason it would be carrying over a second audio listener from a previous scene and that would be causing this as I've triple checked all my objects and searched for Audio Listener components but it is only one the one Camera.

    1. Yes I have a accept input tied to my Mouse click to advance dialogue in my scene. Would that be throwing it off? If so is there a particular setting I can change to fix this?

    2. I think the battle turn start events are going to be the way to go messing around with it, appreciate it thank you lots.
    Post edited by supportreport1 on
  • Hm, no, audio listeners shouldn't impact that at all - but it hints at having 2 cameras in your scene (which usually have an audio listener attached). Is your camera mounted on the player or something like that?
    Or, if your camera is part of the event object, that'll be carried over (while the event runs) to the next scene and destroyed after the event is finished.

    Not starting could also be a timing issue, but that should be fixed when using a short delay (Start After) and/or enabling In Blocked Control in the battle component.

    1) Yes, because every mouse click is handled as an accept input, so it'll accept the selected choice. You could override the menu controls in your battle menu's GUI box to use a different input key (e.g. a None key) as accept, or use cursor over selection to automatically select what's below the cursor.
    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!
  • edited August 9
    Hello thanks for your response,

    I was messing around with it a bit and I found that the most likely reason why it was sometimes working and sometimes not is that because I was accidentally trying to spawn my player combatant in the battle event in the battle settings rather than it just spawning the combatant that was already in my party. Working 100% of the time now after numerous tests.

    The cursor over selection works well thank you.

    I had one more additional question that I may as well throw here rather than starting a new thread.

    So I'm working on getting my GUI boxes setup with the UI elements I want. I've placed a PNG image in the GUI Base Skin that I want to be shown as the box around the content. For the most part this works extremely well but I ran into an issue.

    Upon fading in and out the content box it seems like it works weird at certain times. I've added a video below for you to see exactly what I'm talking about, but basically it looks like after the first initial window fade it is repeatedly added the next UI box on instead of waiting for the next event to start before fading in again. I double checked all my settings and they all have the wait button checked. Another weird this is that it will wait to popup in this first scene here, but when it transitions to my next scene and has a dialogue event it will immediately show the box rather than waiting for the fade. This happens even when applying a "Wait" node with a time value.

    Does this make sense how I'm explaining it? Do you know why it would be spawning those UI boxes before its dialogue event even happens?

    Heres the video, thanks a lot gamingislove.

    Vid: https://webmshare.com/play/wZow0
    Post edited by supportreport1 on
  • This generally depends on your event's setup - each dialogue node uses a new GUI box, i.e. between 2 dialogue nodes it'll fade out the box of the 1st node and fade in the one of the next node.

    You can string multiple dialogues together by putting them into a single dialogue node and using the Page End text code (#>) between them.
    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!
  • edited August 10
    Hmm it's just strange because the box seems to be popping up before the next dialogue node even occurs.

    I would use that string method but I have nodes I want to happen between the next dialogue showing in the event.

    For reference here is the settings between the two dialogue nodes in the video above as well as my event settings: https://imgur.com/a/kegTq0T

    They appear to have the exact same settings its just it shows the 2nd GUI box before the dialogue even appears meaning its seemingly constant on the screen until the last dialogue node is closed out in the event.


    Edit: Hmm upon changing the event settings in that scene to a Blocking Event it appears to be working functionally fading in the boxes and out at the appropriate times. But when adding a Blocking event to my second scene that this one loads into, it doesn't start the scene event at all so hm I'm stumped kind of. Any solutions you can offer?
    Post edited by supportreport1 on
  • Well, when both events are blocking events, an already running blocking event will prevent the other from starting (that's what that option is there for).

    E.g. if in your 2nd scene there's an autostart event, but your scene transition is coming from a blocking event, that event will still be running when loading the scene. A little delayed start (Start After setting in the interaction) should solve that.

    Otherwise, don't use blocking events if you don't really need them :)


    Regarding the GUI boxes - check if your box close behaviour's fade is set up correctly, e.g. if you by accident set it up to fade out from alpha 0 to full alpha it'd fade in again instead of fade out (and be removed afterwards).
    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 the information, the only reason I had it selected now was because that was the only way the GUI box fades were working properly. I disabled it now but the problem once again remains.

    I've checked the GUI fades too. It works the right way for the first two GUI boxes of my entire game, and then it falls apart and displays a GUI box basically until all of my event nodes are finished like I described earlier. Messed around with the Fade Settings and Event ones to see if I can fix this but I can't. Do you need any other information from me in order to help? Really can't figure out why this is occurring like this.

    Like I said before too, the 2nd scene that loads seemingly pops up a GUI box right away even though the dialogue node event is 5 nodes away from the start of the event , and even with a wait node placed too.
Sign In or Register to comment.