.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   Sandbot (http://forums.bots-united.com/forumdisplay.php?f=85)
-   -   Sandbot v0.3 (http://forums.bots-united.com/showthread.php?t=10042)

tschumann 26-01-2017 07:25

Re: Sandbot v0.3
 
Quote:

Originally Posted by The Storm (Post 66653)
@tschumann Podbot_mm detect correctly light level of bots. Perhaps you can check out the code there. :)

I couldn't find it in Podbot MM (possibly they replaced it with the way in the thread I linked earlier?) but I found how it's done in Foxbot: https://github.com/APGRoboCop/foxbot...bd889f/dll.cpp

PHP Code:

                        pPoint CREATE_NAMED_ENTITY(MAKE_STRING("info_target"));
                        
DispatchSpawn(pPoint);
                        
pPoint->v.origin pBot->enemy.ptr->v.origin;
                        
pPoint->v.takedamage DAMAGE_NO;
                        
pPoint->v.solid SOLID_NOT;
                        
pPoint->v.owner pBot->enemy.ptr;
                        
pPoint->v.movetype MOVETYPE_FLY// noclip
                        
pPoint->v.classname MAKE_STRING("entity_botlightvalue");
                        
pPoint->v.nextthink gpGlobals->time;
                        
pPoint->v.rendermode kRenderNormal;
                        
pPoint->v.renderfx kRenderFxNone;
                        
pPoint->v.renderamt 0;
                        
SET_MODEL(pPoint"models/mechgibs.mdl");
                        
amb GETENTITYILLUM(pPoint); 


The Storm 30-01-2017 01:24

Re: Sandbot v0.3
 
I guess in Podbot_mm should be the same trick but nice that you have found it. Actually now by looking at it it looks pretty simple. If you cannot get the light level of FakeClient just attach a hidden entity to him and done. :D

tschumann 30-01-2017 12:34

Re: Sandbot v0.3
 
I looked but it looks like Podbot_mm gets the world model and then uses structures from com_model.h to get the lighting - I couldn't see mechgibs.mdl though I only looked in the obvious places.
Oddly the hidden entity method didn't work when I tried it...


All times are GMT +2. The time now is 13:23.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.