Forum

every bot guru, Can you do me a favor?

Discuss anything not covered by any of the other categories.

Moderator: InsideQC Admins

every bot guru, Can you do me a favor?

Postby lukeyuan » Wed Jan 19, 2005 1:22 am

when we add bot, we have to connect myself to server and then in the console input the 'impulse 100'. I have one question, Can I add bot from server side without the connection intervention?
I tried to input 'impulse 100' on the server side, nothing happens. who can tell me how to solve this problem?
thanks
lukeyuan
 
Posts: 10
Joined: Sat Oct 30, 2004 5:48 am

Re: every bot guru, Can you do me a favor?

Postby Tei » Wed Jan 19, 2005 2:27 pm

Some engines support "qcexec".
You can have a function that spawn a bot with name "addbot"

Something like this qc code:

void () addbot =
{
Foo();
Bar();
SpawnANewBotStuff();
}

then you can try "qcexec addbot" on console. Of course, you need that "addbot" function, but looks like easy to add to any QC mod.

Another hideous way can be to set a console var to some magic value:

temp1 38

then read temp1 all frames finding this value

float MAGIC_NUM = 38;

....
if (cvar("temp1")==MAGIC_NUM)
{
SpawnBot();
localcmd( "temp1 0\n");
}
...
User avatar
Tei
 
Posts: 193
Joined: Mon Oct 25, 2004 12:22 pm

Postby Wazat » Wed Jan 19, 2005 6:02 pm

lukeyuan:
To simplify what was said above, a coder would have to modify the mod to test a variable that can be set in a server console instead of relying on impulses.

The temp1 method wouldn't be too hard, actually.
When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work.
Wazat
 
Posts: 771
Joined: Fri Oct 15, 2004 9:50 pm
Location: Middle 'o the desert, USA


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests