Detecting dialouge button click -1 reply

Please wait...

beier

TFT

50 XP

15th October 2004

0 Uploads

41 Posts

0 Threads

#1 14 years ago

Im trying to make a dialouge for a leader of a team, when one of his team leaves the game. This dialouge should be to assign who should have control.

The dialouge does show as intended, but clicking the button doesn't give me controle. It does if i delete the condition just before giving controle, but this means that every player will get controle regardless of wht button i press.

Keep in mind that in this example i have only written the funcions for creating and detecting Player 1 (red)s button, the others is the same, exept for the player ofc :D

Variabels used

Integer EkstraVariabels[1-100] (Only use 1 here) DialougeShown

Dialouge PlayerLeaveDialouge[1-12]

Dialouge Button LeaveDialougeButton[1-200] (Can only use up to 67 here)

Player Group NotActivePlayers

Player LeaderTeam (The leader is declared elsewhere)

To create the dialouge i have

Events Every 5 seconds

Acrions For each (integer EkstraVariabels[1]) from 1 to 12 do (actions) { If (All conditions are True) then do (then actions) else do (else actions) { Conditions (Player(EkstraVariabels[1]) slot status Not Equal to is playing (Player(EkstraVariabels[1]) is in NotActivePlayers Equal to False

Then Actions Dialouge - Change the titel of PlayerLeaveDialouge[EkstraVariabels[1]] to (Name of (Player(EkstraVariables[1])] + has left the game.

Player group - add (Player(EkstraVariabels[1]) to NotActivePlayers

If (All conditions are True) then do (then actions) else do (else actions) { Conditions (Player 1 (red)) slot status equal to Is Playing

Then actions Dialouge - Create dialouge button for (PlayerLeaveDialouge[EkstraVariables[1]]) labbled (Name of (Player 1(red))

Set LeaveDialogeButton[(((EkstraVariables[1]-1)*6)+1)] = (Last created dialouge button) } Set DialougeShown = EkstraVariables[1] Dialouge - Show PlayerLeaveDialouge[EkstraVariables[1]] for LeaderTeam } }

And when a button is pressed i use

Events Dialouge - A dialouge button is pressed for PlayerLeaveDialouge[1] Dialouge - A dialouge button is pressed for PlayerLeaveDialouge[2] Dialouge - A dialouge button is pressed for PlayerLeaveDialouge[3] Dialouge - A dialouge button is pressed for PlayerLeaveDialouge[4] etc.

Actions Dialouge - Clear PlayerLeaveDialouge[DialougeShown] If (All conditions are True) then do (then actions) else do (else actions) { Conditions (Clicked dialouge button) Equal to LeaveDialougeButton[(((DialougeShown-1)*6)+1)]

Then Actions Make (Player(DialougeShown)) Threat (Player 1 (red)) as an Ally with shared vision and full shared units }

Both triggers are longer, with more players and stuff added to them, but writing it all makes it to long, and i think its irelevant aswell. :uhm:

If it could help, i am willing to send you the map in an email.;)




beier

TFT

50 XP

15th October 2004

0 Uploads

41 Posts

0 Threads

#2 14 years ago

hmm. a little slipu.. sry. got another post just like this one