MantisBT - Soldat Dedicated Server
View Issue Details
0000126Soldat Dedicated ServerScripting Corepublic2011-10-31 20:272012-08-23 21:23
fri 
Falcon 
normalminoralways
closedsuspended 
x64Windows7 SP1
2.7.2 
 
0000126: Bots not triggering some scriptcore events
There are some differences between bots and humans in triggering scriptcore events. To check it, I made a simple script to show a nickname and name of event triggered:

procedure onweaponchange(id, primarynum, secondarynum: byte);
begin
    writeln(idtoname(id) + ' triggered OnWeaponChange');
end;

procedure onjoingame(id, team: byte);
begin
    writeln(idtoname(id) + ' triggered OnJoinGame');
end;

procedure onjointeam(id, team: byte);
begin
    writeln(idtoname(id) + ' triggered OnJoinTeam');
end;

procedure onleavegame(id, team: byte; kicked: boolean);
begin
    writeln(idtoname(id) + ' triggered OnLeaveGame');
end;

procedure onflaggrab(id, teamflag: byte; grabbedinbase: boolean);
begin
    writeln(idtoname(id) + ' triggered OnFlagGrab');
end;

procedure onflagreturn(id, teamflag: byte);
begin
    writeln(idtoname(id) + ' triggered OnFlagReturn');
end;

procedure onflagscore(id, teamflag: byte);
begin
    writeln(idtoname(id) + ' triggered OnFlagScore');
end;

procedure onplayerrespawn(id: byte);
begin
    writeln(idtoname(id) + ' triggered OnPlayerRespawn');
end;


While most of them work properly with bots, two don't: OnJoinGame and OnJoinTeam. Additionally, if a human joins the game, OnPlayerRespawn is triggered before anything else (shouldn't it fire after OnJoinTeam?).

Comparison human-bot in joining:
[ human ]
127.0.0.1:59941 requesting game...
fri joining game (127.0.0.1:59941) HWID:---
fri triggered OnPlayerRespawn
fri triggered OnJoinGame
fri has joined alpha team.
fri triggered OnJoinTeam
fri triggered OnWeaponChange (bare fists, before weapon menu shows up)
fri triggered OnWeaponChange (after choosing a weapon)

[ bot ]
/addbot1 Commando(127.0.0.1[fri])
Commando triggered OnPlayerRespawn
Commando triggered OnWeaponChange

As you can see, bots don't cause OnJoinGame and OnJoinTeam events to fire. They should at least trigger OnJoinTeam.


Also, on leaving, humans trigger OnWeaponChange, while bots don't. I find it trivial, but I'm reporting it anyway.
No tags attached.
Issue History
2011-10-31 20:27friNew Issue
2011-11-02 13:10tkNote Added: 0001251
2011-11-02 13:35friNote Added: 0001252
2011-12-21 10:47ShoozzaStatusnew => acknowledged
2012-02-29 20:13FalconAssigned To => Falcon
2012-02-29 20:13FalconStatusacknowledged => assigned
2012-08-23 21:23FalconNote Added: 0001578
2012-08-23 21:23FalconStatusassigned => closed
2012-08-23 21:23FalconResolutionopen => suspended

Notes
(0001251)
tk   
2011-11-02 13:10   
Bots trigger onweaponchange too.
(0001252)
fri   
2011-11-02 13:35   
I checked it a few times and a kicked bot didn't trigger OnWeaponChange as a human did.

I should clear something up too: bots DO trigger OnJoinTeam, but only after using /setteam on them. The issue is that they don't trigger OnJoinTeam on /addbot.
(0001578)
Falcon   
2012-08-23 21:23   
I'm not sure if i'll be fixing this, my scripts does rely on that behavior so i assume that others might "abuse" that too