Author Topic: OnJoinGame for Bots?  (Read 1491 times)

0 Members and 1 Guest are viewing this topic.

Offline TheToast

  • Major
  • *
  • Posts: 52
OnJoinGame for Bots?
« on: February 17, 2008, 07:52:40 pm »
Hi,

i noticed that OnJoinGame is not called when a bot joins, is there any possibility to check if there's a new bot in the Game?

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: OnJoinGame for Bots?
« Reply #1 on: February 17, 2008, 08:09:52 pm »
under OnCommand, check using Copy if the first part of the text = '/addbot' then check if the character ater that is a # or a space; if space, set some var to 0; otherwise to the # thats inputed there.. if the # is between 0 and 5, then they correctly added a bot. Then check the lowest available id that the bot will take, and then do OnJoinGame(Id, Team) with the appropriate variables

or u can do Result := true; then take the team #, then do OnJoinGame(Command(Text), Team); sense Command('/addbot# ...') returns the id the bot will be

2nd one seems ezr to do

really don't know why it doesn't call that event...

Offline TheToast

  • Major
  • *
  • Posts: 52
Re: OnJoinGame for Bots?
« Reply #2 on: February 18, 2008, 03:32:59 pm »
Ah, thanks, the second one seems to be ok. It's enough, i'm just testing my script with Bots, on the real server it doesn't have to support bots.

But it would be cool if the next server would trigger "OnJoinGame" for bots too.

Offline ghg

  • Camper
  • ***
  • Posts: 411
  • Village Idiot
Re: OnJoinGame for Bots?
« Reply #3 on: February 18, 2008, 04:14:06 pm »
Or another procedure when bots join so atleast any functionality can be emulated.
-=Gradius wuz you=-

Offline danmer

  • Camper
  • ***
  • Posts: 466
  • crabhead
Re: OnJoinGame for Bots?
« Reply #4 on: February 18, 2008, 05:16:22 pm »
umm you could also make a custom command with

bot_ID := Command('/addbot BotName');

and then use bot_ID for whatever you need it O.o

Offline rhide

  • Major
  • *
  • Posts: 60
  • Coffee-addict
    • Vrastar-Hai soldat clan
Re: OnJoinGame for Bots?
« Reply #5 on: February 22, 2008, 12:58:41 pm »
This is one of the things programmers use to refer to as a design consideration to keep noobs away  8)

Uh no. It's really not - but one very strange thing that IS true is that OnLeaveGame is called for bots, but not OnJoinGame ... that made me scratch my head more than once before I figured it out >.<
Warning! Division by zero seriously injures yourself and the people in your surroundings.

Proud member of Vrastar-Hai:
http://www.guldheden.com/~erga050/vrastar-hai

Offline TheToast

  • Major
  • *
  • Posts: 52
Re: OnJoinGame for Bots?
« Reply #6 on: February 23, 2008, 08:43:45 pm »
Yeah, thanks to all, i think danmers method is the easiest one, because i just need Bots to test the script before it's used on a "real" server. No need to support Bots on the real Server.
« Last Edit: February 23, 2008, 08:52:08 pm by TheToast »