Forum Discussion
I didn't get familiar with the vector and teleport system yet, but this would be my approach:
When the player deploys (which will be always a random location in TDM or FFA) you save the position in a new variable aiPosition.
As long as (while) the eventplayer is AI (assuming you only have this one AI) and alive, you teleport the AI back to the saved position. It will either wait 5 seconds between performing the teleport or wait until the actual position is not anymore equal to the saved position in the variable aiPosition.
Please let me know if that worked! 🙂
Edit: Add a SpotPlayer (Gameplay > SpotPlayer) after the SetVariable with values EventPlayer and 30 to have the AI spotted for 30 seconds after deploying. This way you can easily see if it is able to move.
I'm trying to do something similar but with the onMandown (if you get downed you get revived but are "stunned" for a few seconds)
I got the teleport to trigger but it didn't teleport them where they were downed
- 4 years ago@Z1NTH0S Try using an Ongoing EVENT instead of the OnPlayerDeployed. I believe the reason it doesn't work after the AI dies is because the AI doesn't deploy in the sense that a normal player does after death, and because of this, the event isn't triggered again.
- 4 years ago@FastBuddha That probably won't work with OnGoing, because it will always change the variable to the current position, if it is not executed by the game fast enough, then it will not be the exact same position. So the variable has to bet set one time at AI live. So there has to be a one time trigger. Cant test things rn to try to find a better solution. If there is no delay during the execution then OnGoing could work though, but that requires other "wait" parameters nonetheless. Probably just a wait 0.01
- 4 years ago@piri89 What if you combine the two? and use the saved variable from the initial OnPlayerDeployed event in the Ongoing event.
- 4 years ago
Try this one:
In case it is not clear what it does: The first operation is the same (since this was confirmed to work), it just adds a new variable positionTracked. This has to be set to true at the beginning, so it won't trigger the ongoing event that follows. When he dies the first time it changes to "false". After that, there is an ongoing check if the solder is an AI, is alive and has the positionTracked to false.
If that applies (what will be the case after it first days and is alive again), the event is triggered, doing the same like the first event, but with the updated position. Because I don't know when an AI will have the new position assigned while it's dead, it waits for 10 seconds after dieing, before it sets the variable back to false and thus triggers the event again. Maybe try different numbers for the wait here, if it first moves for a few second before it will be teleport-stuck on its position again.
- MADrag0n4 years agoLegend
Your mistake is that you are missing the server limit for NON-DELAYed cycles with an undefined number - the limit is set to 1024 cycles. U need to count 1024 cycles and wait or just use "wait ( 1 )" anywhere inside the "while".
Using "WaitUntil" instead of "Wait" inside a "While" is not a good idea, because you cannot control the speed and number of loops, and exceed limit.
You can use one of the two options below:
or
The problem is that a mandatory delay of 1 second will lead to unpredictable results, AI-ghosts and AI-hares. )))
About Battlefield 2042 General Discussion
Recent Discussions
- 6 hours ago