Ok this might be a stupid question, but:
I have spells work in field and real time battle. Field because I want the player to be able to attack an enemy when he sees it, not only once the enemy initiates battle or he is close enough for the battle to start automatically.
How do I start battle once the enemy is hit? Or at least once the player starts his ability.
So, in your battle event, after the Check Status node, use a Call Global Event node to start a global event (that you'll set up next) and use the Set Starting Object settings to have the target actor available in the global event.
For the global event, set up a game event that has a Starting Object actor (i.e. where the target will be available at) and use the Start Battle node to start the battle (with the starting object actor).
Set up a global event in World > Global Events and use the game event you've set up :)
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
So I don't have to create a new thread for two other battle questions I will just ask here GIL:
@gamingislove
1.) In my real time combat I want melee attacks (which only work in melee range anyway) to ALWAYS hit the target, but with the trigger method (damage dealer component on melee weapon and damage zone on enemy) it can happen that some attack animations does not hit the enemy exactly and then nothing happens of course. Making the box collider trigger on the sword longer and wider, which then SHOULD trigger it, strangely does not work - it seems the sword model itself needs to hit for it to work, which is strange.
What solution would you suggest so that melee attacks don't fall short of hitting?
2.) Range attacks, like let's say a fireball or an arrow should always go towards the target, even if it moves. If the target is closer it works, but from further away it always just flies by. It does damage while flying by, but it does not hit the target. I have the damage dealer and collider on the fireball prefab (just like in the 'throwing a fireball' tutorial) but instead of letting it just move in a direction, like in the tutorial, I use "change position" and use the target as target position. I use "move by speed" and "follow position". I also have "ignore height distance" deactivated, so a height difference does not cause troubles but still it flies right over the target if the player is slightly higher, even though the target is about 10 units away and the ball should have plenty of time to fly to the target. instead it just goes straight ahead.
What am I doing wrong here?
E.g. if you activate it before the animation and deactivate it afterwards, make sure the animation has an actual wait time. If you're using Mecanim, keep in mind that you'll have to do some additional setup to have a wait time in the animation node. Alternatively, you can just add a Wait node before disabling the damage dealer.
Also, since the attack should always hit, you could just change it to use the Calculate node instead of damage dealers :)
2) Hm, working fine here - try not using Controller Move and enable Face Direction.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
2.) it was a problem with the setup of the prefab (it had a movement script in it).
@gamingislove
But about the earlier question about starting battle and calling a global event to start the battle:
I call the global event in the battle event just like you described. And that itself works BUT I noticed that everything in the battle event AFTER I call the global event is ignored. It's like the global event is being called - it's being executed but from the moment the battle event calls the global one the battle event is over, no matter what I add after calling the global event. Is that intended to work that way?
And one more combat question:
what's the best way to stop the targets movement for a certain amount of time? If I stop movement and block move AI and add a 6 second wait (that's how long the target should be unable to move with a freeze spell) then the player can't move either for 6 seconds because the event is still running. If I add "unblock player control" then the player CAN move during that time, but he can't use another spell until the enemy can move again (= until that freeze event is over). which kinda defeats the purpose of the whole spell. The player should be able to stop the enemy and then run away and use spells while the enemy is "frozen".
Try starting the battle at the end of your battle event instead of somewhere in the middle.
Use a status effect to stop the combatant's movement. The Stop Movement option in the effect's settings will also block the move AI :)
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
I was so focused on getting the real time combat like I want it that I just now encountered two very basic (essential) issues. I hope you can help:
1.) The enemy follows the player up to a certain point, just like I set it to. But the player does not get out of combat once the enemy walks back. How can I make it so once the enemy stops following the player is out of combat?
2.) If I encounter a second enemy while figthing another the one I am not attacking is also not attacking me. It's always only one. What did I forget to do?
2) If a battle is already ongoing, you can have other combatants join in via the Auto Join Settings in Battle System > Battle Settings > Base Settings.
An alternative setup that might solve both of your issues would be having Real Time Battle Areas attached to your (enemy) combatant prefabs, using a collider/trigger to mark the area around them in which to do battle.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
One more battle question, then I should be ok :)
While melee works perfectly now for some reason my fireball (I use CALCULATE) always shows damage in my flying damage text over the enemy but on the target HUD (health bar) it only sometimes actually subtracts that amount.
Again, in my melee combat it shows as flying text and it always also gets subtracted from the health bar, but the fireball 3 out of 4 times only the flying text.
Since I use calculate I don't understand how this can happen.
Do you have any idea?
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!