Re: switching player/bot:coding question -
01-02-2010
That is right,
The biggest problem ( for me) is the other way round, that is for the human player
1- to control a bot through keyboard,...
2- to keep visual/data consistency when swapping;
I have done it ok, in particular with a "safe" little hack (on CS1.5-WON), ie swapping the first data member of CBaseEntity which is a pointer to associated entvars_t; actually I directly swap on pvPrivateData.
This means this part of my code should work on any Mod.
3- to have the proper screen for the human client( health, ammo,status icon,...); this I failed to do as a whole ( resetHUD does nothing!) and for now I send messages to the mod dll with the actual( current) value of the data ( the core data is ok after swap, it is just that the screen is not updated) ;
Besides, I tried first to re-rout keyboard input using their console keyword( like "+forward","buy",..., but ClientCommand apparently does not
catch/use commands which are hl standards ( like "+forward","+jump").
I had the idea to manipulate bindings config ( forcing binding to my own command names then issue the right command to the right edict within ClientCommand, while keeping the same "apparent" key-mapping for the human client) but did not try and implement it.
I think also about re-routing the usercmd_t data.
thanks
|