im a total noob with dialog. I've never even made one before. so explaining it will be key for me. I have a map, where one player is zerg and the rest are terrans trying to beat the zerg. I want a dialog option where players can opt in/out of being randomly picked to be zerg. (like all players who opted in will be randomly chosen from). also, time limit. (I know how to make a timer, but not how to tie it in) also, if they all opt out I want it to randomly pick one. I know this is a lot of work, but the first person who provides me an answer leading to a working model, will have a credit to them on the loading screen, somewhere on the map, and possibly on the opting menu itself.
EDIT: it is now semi-functional selecting op in/out will put you in corresponding player groups . I still cant do "random player form player group" like I want.
NOTE: if I don't solve if by the week, I will remove this system and have it randomly choose from all players.
So..
Create a dialog, save it in variable. Create 2 dialog items (buttons) in it, name one "opt-in", other "opt-out", save them in respective variables.
Next, have a trigger with event: any player uses dialog item (clicked). If player clicked item saved in variable "opt-in" -> add triggering player to player group "opt-in group". If player clicked item saved in "opt-out" ->remove triggering player from player group "opt-in group".
Moving on, when your timer expires:
1) destroy selection dialog.
2) If number of players in player group "opt-in group" > 0 then set variable "Zerg Player" to Random player from player group "opt-in group"
else set variable "Zerg Player" to Random player from player group "active players" (active players is one of default groups provided by game).
3) Give all zerg stuff to player "Zerg Player", give terran stuff to other players, you can get their numbers by copying player group "active players" and then removing "Zerg Player" from it.
luckily I was able to figure it out before I checked here, but ill still give you guys credit for helping me out. :) I was worried for a moment. also, ducky, there is no random player from player group option, that's what screwed me up. :)
Heh, silly me. I guess you used (random integer between 1 and amount of players in player group) instead. Also, no need to give me credits for something you figured out on your own .
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I have a complex question
im a total noob with dialog. I've never even made one before. so explaining it will be key for me. I have a map, where one player is zerg and the rest are terrans trying to beat the zerg. I want a dialog option where players can opt in/out of being randomly picked to be zerg. (like all players who opted in will be randomly chosen from). also, time limit. (I know how to make a timer, but not how to tie it in) also, if they all opt out I want it to randomly pick one. I know this is a lot of work, but the first person who provides me an answer leading to a working model, will have a credit to them on the loading screen, somewhere on the map, and possibly on the opting menu itself.
EDIT: it is now semi-functional selecting op in/out will put you in corresponding player groups . I still cant do "random player form player group" like I want.
NOTE: if I don't solve if by the week, I will remove this system and have it randomly choose from all players.
So..
Create a dialog, save it in variable. Create 2 dialog items (buttons) in it, name one "opt-in", other "opt-out", save them in respective variables.
Next, have a trigger with event: any player uses dialog item (clicked). If player clicked item saved in variable "opt-in" -> add triggering player to player group "opt-in group". If player clicked item saved in "opt-out" ->remove triggering player from player group "opt-in group".
Moving on, when your timer expires:
1) destroy selection dialog.
2) If number of players in player group "opt-in group" > 0 then set variable "Zerg Player" to Random player from player group "opt-in group"
else set variable "Zerg Player" to Random player from player group "active players" (active players is one of default groups provided by game).
3) Give all zerg stuff to player "Zerg Player", give terran stuff to other players, you can get their numbers by copying player group "active players" and then removing "Zerg Player" from it.
Hope it gives you some ideas.
luckily I was able to figure it out before I checked here, but ill still give you guys credit for helping me out. :) I was worried for a moment. also, ducky, there is no random player from player group option, that's what screwed me up. :)
@joey101d: Go
Heh, silly me. I guess you used (random integer between 1 and amount of players in player group) instead. Also, no need to give me credits for something you figured out on your own .