Scripts / Help needed : How to Rotate an AI bot away from the player ?

Author
Message
reyandekcire
8
Years of Service
User Offline
Joined: 18th Feb 2016
Location:
Posted: 27th Feb 2018 20:10
A stupid question I guess but is there an "opposite" command to RotateToPlayer ? ( ie I would like a boot to face away from player ) ?
I have tried RotateY and g_Entity['y'] with no success...

Thanks you all for any tip...
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 27th Feb 2018 20:27
ResetRotation(e,x,y,z) will rotate an entity any which way you want but if the character is under the control of the AI module scripts it will be overridden by those so you would either need to change the AI script to suit your needs or create your own from scratch (or find one of the existing scripts that nearest to what you want and edit a copy of that).

Been there, done that, got all the T-Shirts!
PM
reyandekcire
8
Years of Service
User Offline
Joined: 18th Feb 2016
Location:
Posted: 27th Feb 2018 20:31
Thank you AmenMoses, will try it right away ( I have customized default AI module combatcore so hopefuly it will work)

PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 27th Feb 2018 20:45
You may have to do the following:

CollisionOff(e)
ResetRotation(e, 0, Y-angle, 0 )
CollisionOn(e)

Don't know why exactly but if you don't it may not move at all!

Y-angle should be -180 to +180 btw but if all you want is for it to face away from you just use the player Y angle. (i.e. g_PlayerAngY)
Been there, done that, got all the T-Shirts!
PM
reyandekcire
8
Years of Service
User Offline
Joined: 18th Feb 2016
Location:
Posted: 27th Feb 2018 20:57
Many thanks AmenMoses, it works perfectly.

Another question : does anyone knows if the View Cone Angle of an AI bot can be changed through scripting ( I have not found any matching command is the global file)...
PM

Login to post a reply

Server time is: 2024-12-22 19:05:31
Your offset time is: 2024-12-22 19:05:31