Guest User

Untitled

a guest
Sep 13th, 2013
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.80 KB | None | 0 0
  1. [22:26] <arkore> ok, so i got it working so a bot joins when i join, and bot leaves(using ConsoleCommand("removebots")) when i go spectator(DISCONNECT). but, that's all i can do; that's not a real DISCONNECT. i would prefer a way to execute "removebots" when I actually disconnect from the server.
  2. [22:32] <@TheMasterCat> do a check to see if there are 0 players
  3. [22:50] <arkore> its not working. this is the code i have (and i know this code works): http://pastebin.com/PPNBLhLr it works when i goto spectator(which is what Zandronum considers "DISCONNECT") but doesnt work when i actually disconnect from the server.
  4. [22:51] <arkore> ingame == 1 means 1 player is entered and running around the map. so, according to that code, the bot always is removed when i either go spectator, and should also work when i disconnect from the server(but doesn't work)
  5. [23:13] <arkore> in fact, if i remove all that code and just put: script 6 (int player) DISCONNECT { ConsoleCommand("removebots"); } --- it still doesn't work when i disconnect from the server. the bot is still there.
  6. [23:19] * Qent is tired, but remembers that bots don't fight when all the players are gone... maybe it has something to do with that?
  7. [23:20] <Qent> "gone" i.e. disconnected completely for real
  8. [23:21] <WaTaKiD> 2013-09-12 12:28:11 <Jes> bots freeze when no players are around
  9. [23:21] <WaTaKiD> 2013-09-12 12:28:13 <Jes> much like monsters
  10. [23:23] <arkore> yes, but the bot is still there on the server. there's no way for me to execute "removebots" when everyone leaves the server.
  11. [23:23] <WaTaKiD> rcon puke
  12. [23:23] <WaTaKiD> >;p
  13. [23:23] <arkore> what does puke do?
  14. [23:23] <WaTaKiD> puke can execute a script
  15. [23:24] <Qent> well i'm wondering if all the ACS freezes along with bots and monsters because i r server i r so smrt
  16. [23:25] <arkore> WaTaKiD, cool, didn't know that. but, i can already execute a script. the problem is, there's no "event" for when a player exits a server when server is running a gamemode such as "duel" in which case "DISCONNECT" scripts actually occur when a player goes Spectator, not when a player disconnects from the server.
  17. [23:25] <arkore> Qent, that may be right, because I can't come to any other conclusion.
  18. [23:26] <Qent> er
  19. [23:26] <Qent> DISCONNECT scripts do run when you exit a server
  20. [23:26] <Qent> try having two of yourself in the server
  21. 03[23:26] * agaures is now known as Guest74132
  22. [23:26] <Qent> so that one is still there to see it happen
  23. [23:26] <WaTaKiD> perhaps this could help for something in the future: http://zdoom.org/wiki/CCMDs:Debug#puke
  24. [23:26] <arkore> yes, Qent, but "script 6 (int player) DISCONNECT { ConsoleCommand("removebots"); }" is not working. it only works when I leave a duel and go into spectator.
  25. [23:27] <Qent> hm
  26. [23:27] <Qent> that's weird
  27. [23:27] <arkore> yup
  28. [23:27] <Qent> it's supposed to consider both spectating and actual disconnects to be disconnects
  29. [23:27] <arkore> bug? or feature request?
  30. [23:28] * arkore heads over to the zandronum tracker.
  31. [23:28] <Qent> that's intended behavior and there are ways to work around it
  32. [23:31] <arkore> Qent, i don't see a way of working around it. There is only OPEN, ENTER, RETURN, RESPAWN, DEATH, LIGHTNING, UNLOADING, and DISCONNECT. And only "DISCONNECT" comes closest to what we need; but isn't quite doing what we expected. DISCONNECT only occurs when someone disconnects from a multiplayer game. how do we execute a script when someone disconnects from the server?
  33. [23:32] <Qent> if they're a spectator /already/ then i don't think there's an easy way to do it
  34. [23:33] <Qent> but are you saying if they're playing the game, and they disconnect without spectating, it won't run?
  35. [23:33] <arkore> correct
  36. [23:33] <arkore> while playing in the game/match, and they disconnect from server.
  37. [23:33] <Qent> even if there is another player who is still playing in-game
  38. [23:33] <arkore> yes.
  39. [23:34] <arkore> it works fine for when the person goes to spectator. the bots are removed. but doesn't work if the player directly disconnects from the server from within a game/match.
  40. [23:35] <arkore> that's my problem. because some people are just going to quit the game while in a fight, and then my script wont execute, and then the bot stays there forever.
  41. [23:40] <arkore> you see?
  42. [23:40] <Qent> hm
  43. [23:40] <Qent> it works as i'd expect for me
  44. [23:40] <Qent> playing the game and spectate, bots get removed
  45. [23:41] <Qent> playing the game and quit, bots stay but get removed when i reconnect (???)
  46. [23:41] <Qent> 2 people playing the game and one quits or spectates, bots get removed
  47. [23:42] <WaTaKiD> maybe cuz nobody was in the server, the script couldnt activate or w/e ?
  48. [23:42] <Qent> i think so
  49. [23:42] <Qent> could be a problem since people don't like empty servers with a lot of bots
  50. [23:43] <Qent> maybe the problem is how you're counting "still in-game" people
  51. [23:43] <arkore> i even tried without the "ingame counting logic"
  52. [23:43] <arkore> i stripped all that out, and just tried: script 6 (int player) DISCONNECT { ConsoleCommand("removebots"); }
  53. [23:44] <Qent> yes that's what worked for me
  54. [23:44] <arkore> yes, it works if you spectate, but not if you quit game while fighting
  55. [23:44] <Qent> it did for me (with another player)
  56. [23:44] <WaTaKiD> well technically the script works right? it just activates too late or something
  57. [23:45] <arkore> Qent (with another player)? does that mean 2 players, and 1 bot?
  58. [23:45] <Qent> yes
  59. [23:45] <arkore> ok, but what about 1 player and 1 bot. when the player disconnects the server while fighting, the bot is not removed.
  60. [23:45] <Qent> is it removed when you reconnect to the server?
  61. [23:46] <arkore> woah. yes. wtf
  62. [23:46] <Qent> ikr.
  63. [23:46] <arkore> so, the script is paused?
  64. [23:46] <arkore> until real clients connect or something
  65. [23:47] <Qent> i...guess so?
  66. [23:47] <WaTaKiD> so it looks like monsters, bots, and scripts all freeze/pause while no players are connected to the server, but resume once someone connectsa
  67. [23:47] <WaTaKiD> -a
  68. [23:47] <arkore> is there a way around this? because if the bot remains there, then best-ever will be mad.
  69. [23:47] <arkore> WaTaKiD, looks that way.
  70. [23:47] <Qent> yeah they will :/
  71. [23:47] <arkore> what you recommend i do, Qent? "feature request" on zandro tracker?
  72. [23:47] <Qent> yep!
  73. [23:47] <Qent> i don't see anything else for it
  74. [23:48] <Qent> you literally can't do ANYTHING because it's paused
  75. [23:48] <arkore> if you were me, how would you phrase the feature request? like, what i mean is, what exactly would you ask for?
  76. [23:48] <Qent> eeeeeeeeeeeeeeeeeeeee I'm not sure.
  77. [23:48] * Qent is too tired
  78. [23:48] <arkore> yah. me too. i guess i'll just explain the issue, and ask for a feature request for them to figure out a way around this.
  79. [23:48] * WaTaKiD is too inexperienced
  80. [23:49] <arkore> WaTaKiD, your face is inexperienced
  81. [23:49] <Qent> on the one hand you could ask that the server NOT be paused, and that would be super general but probably break something else
  82. [23:49] <WaTaKiD> go wash my face
  83. [23:49] <WaTaKiD> wat
  84. [23:49] <arkore> lol
  85. [23:49] <arkore> Qent, yah, probably a lot of good things come from that "pause" being on.
  86. [23:49] <Qent> or you could specifically ask for a cvar that removed all bots when the server is empty, and then it would only be useful for the crappy zandronum bots
  87. [23:49] <WaTaKiD> or have some way to activate that script the very exact moment the player leaves
  88. [23:49] <arkore> have to think of another way around it.
  89. [23:50] <Qent> impossible, they can exit instantly
  90. [23:50] <arkore> cvar sounds nice
  91. [23:50] <WaTaKiD> oh well, wut do i know :p
  92. [23:50] <WaTaKiD> bots are crap anyways, ban them all
  93. [23:50] <Qent> lol
  94. [23:50] <WaTaKiD> they make me look like a good player
  95. [23:51] <arkore> WaTaKiD, bots in my mod are actually fun. it's a simple 1-room arena map with all weapons given to the bot, and set botskill to highest "4", and it's pretty fun.
  96. [23:51] <arkore> better than "nothing"(no other players connecting/playing because they're too cool to try my god damn wad)
  97. [23:51] <WaTaKiD> ur wads suck i hate u go drown in chillax
  98. [23:51] <WaTaKiD> :D
  99. [23:51] <arkore> lol
  100. [23:54] <Qent> come to think of it, maybe a cvar is better, because eventually they will have to convert it not to use consolecommand
  101. [23:54] <WaTaKiD> oh yea huh
  102. [23:55] <WaTaKiD> sv_removebotswhenserverisempty
  103. [23:55] <WaTaKiD> since they love commands named like that :D
  104. [23:55] <Qent> lol
  105. [23:55] <Qent> but then you gotta wonder how you'd get the bots BACK
  106. [23:56] <arkore> i already have that part covered. a bot joins when a player enters the arena.
  107. [23:56] <Qent> an acs function AddBot(str name, int team)?
  108. [23:56] <Qent> i mean without consolecommand
  109. [23:56] <WaTaKiD> gasp
  110. [23:56] <Qent> le gasp!
  111. [23:56] <WaTaKiD> sv_addbotwhensomeonejoinsthegame
  112. [23:56] <arkore> team? bots aren't coop yet.
Advertisement
Add Comment
Please, Sign In to add comment