Change View Coordinate of Csgo bots.

Please post any questions about developing your plugin here. Please use the search function before posting!
Frank_der_Golf_Fahrer
Junior Member
Posts: 10
Joined: Sat Feb 12, 2022 10:26 am

Change View Coordinate of Csgo bots.

Postby Frank_der_Golf_Fahrer » Thu Feb 24, 2022 5:45 pm

How do I change the view angle of a bot? I know how to change it on a player and I can interact with bots a player instance the problem is that when I change the angle. The bots will change their viewing angle but they don't stay there they will always go back to where they looked previously. I have tried numerous things like setting the bot_stop Cvar or the bot_freeze Cvar that changed nothing.

This is my code so far:

Syntax: Select all

from events import Event
from filters.players import PlayerIter

@Event('player_say')
def on_player_say(event):

for player in PlayerIter('bot'):

x = randint(-90, 90)
y = randint(-90, 90)
z = randint(-90, 90)
player.client_command(f"setang {x} {y} {z}", True)


And yes I tried using the

Syntax: Select all

player.set_view_coordinates()
method there I got the same results
Last edited by Frank_der_Golf_Fahrer on Fri Mar 18, 2022 4:59 pm, edited 1 time in total.
User avatar
Kami
Global Moderator
Posts: 264
Joined: Wed Aug 15, 2012 1:24 am
Location: Germany

Re: Change View Coordinate of bots.

Postby Kami » Thu Feb 24, 2022 8:18 pm

You can try to change the MoveType of the bot, so it cannot move on its own.

Search the wiki for "MoveType" ans "move_type" and you should be able to find what you Need.

I'd suggest MoveType.NONE as I think it prohibits any movement. After that you can change the View angle.
Frank_der_Golf_Fahrer
Junior Member
Posts: 10
Joined: Sat Feb 12, 2022 10:26 am

Re: Change View Coordinate of bots.

Postby Frank_der_Golf_Fahrer » Thu Feb 24, 2022 8:44 pm

I was able to change the move type but nothing changed the still move back to their previous position
User avatar
Kami
Global Moderator
Posts: 264
Joined: Wed Aug 15, 2012 1:24 am
Location: Germany

Re: Change View Coordinate of bots.

Postby Kami » Fri Mar 04, 2022 7:23 pm

I just did some testing and the solution to this seems to be to set bot_flipout to 1 and at the same time change the movetype to NONE.

This way the AI is disabled without the bots going crazy. Not sure if this will affect your ability to control the bots otherwise.
Frank_der_Golf_Fahrer
Junior Member
Posts: 10
Joined: Sat Feb 12, 2022 10:26 am

Re: Change View Coordinate of bots.

Postby Frank_der_Golf_Fahrer » Fri Mar 18, 2022 4:57 pm

it seems like they removed this ConVar from the game
User avatar
Kami
Global Moderator
Posts: 264
Joined: Wed Aug 15, 2012 1:24 am
Location: Germany

Re: Change View Coordinate of Csgo bots.

Postby Kami » Sat Mar 19, 2022 8:05 pm

I'm sorry, I didn't see that you were trying this on CS:GO. I did some more testing and could not find a solution.

I guess that the idle animation just always kicks in so if you can somehow disable that you should be able to change the viewangle. I don't know how to do that though, maybe someone else can help.

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 4 guests