Xwaw Posted August 22, 2023 Share Posted August 22, 2023 Ok so recently I was thinking of reworking the police from gta san andreas to mta san andreas and making a police waves style minigame you have to survive. I have an idea how to do it but I don't know if the engine will allow me to do it. So my question is, if I want to program a ped to get to the player's position avoiding obstacles (without jumping over them) with the a* algorithm, am I able to do that? Because the last time I did this type of thing, one such npc could crash my entire game. As for the respawn of such bots, it would work more or less in the same way as in the original version of gta sa Link to comment
DiSaMe Posted August 26, 2023 Share Posted August 26, 2023 MTA allows setting ped control states, camera angle and some other things, and that's all you need most of the time. Determining what control states and camera angle to set is up to you. If you want the ped to follow the player, the main part of that is setting the forwards control state and changing the camera angle to control the direction, regardless of how you determine that direction - so yes, you can do it using A* algorithm. And if a ped caused MTA to crash, that must have been a bug, because generally a script is not supposed to crash the game. But I don't remember that consistently happening to me, even though I used to spend a lot of time scripting peds. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now