AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Can't change bot's origin (https://forums.alliedmods.net/showthread.php?t=61771)

alien 10-09-2007 09:19

Can't change bot's origin
 
Hello!
I just can't solve this. My intention is to have a bot preventing round drawns but also indicating some map position (on radar). The prevention part works fine. But I can't change bot's origin.

This is what I do in plugin_init():

PHP Code:

new ptr[128];
        
_anti_rd_bot engfunc(EngFunc_CreateFakeClientANTI_RD_BOT_NAME);
dllfunc(DLLFunc_ClientConnect_anti_rd_botANTI_RD_BOT_NAME"127.0.0.1"ptr);
dllfunc(DLLFunc_ClientPutInServer_anti_rd_bot);
        
cs_set_user_team(_anti_rd_botCS_TEAM_CT);
cs_set_user_vip(_anti_rd_bot); 

... and this is placed in new round event:

PHP Code:

set_pev(_anti_rd_botpev_effects, (pev(_anti_rd_botpev_effects) | 128));
set_pev(_anti_rd_botpev_solid0);
entity_set_origin(_anti_rd_bot_END_ORIGIN); 

I actually was able to set it's origin, but radar indicator stays unchanged whatever I do. And also, indicator is out of map boundaries - so I suppose it's set to null origin. Anyone could help, please? :|

Orangutanz 10-09-2007 13:47

Re: Can't change bot's origin
 
Your bot isn't thinking, get it to think once and the engine should update the bot data then.
Code:
engfunc( EngFunc_RunPlayerMove, BOT ID HERE, Float:{ 0.0, 0.0, 0.0 }, 0.0, 0.0, 0.0, 0, 0, 76 )
76 is a good value to kick the bot to do one shot things like in your case or when it connects.

alien 10-09-2007 17:14

Re: Can't change bot's origin
 
So what you say is that I can't teleport bot till it's not thinking? I tried to use call_think but no result. But thank you for reply!
And why am I able to change visibility and/or solidity without thinking?

Orangutanz 10-10-2007 12:01

Re: Can't change bot's origin
 
Teleport your bot as you normally do, then place that code I gave you after it. Should work perfectly then.

alien 10-10-2007 14:18

Re: Can't change bot's origin
 
It works as you said: perfectly. Thank you!


All times are GMT -4. The time now is 16:05.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.