HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Hero Arena Dueling

06-12-2005, 06:02 PM#1
MrApples
Ok, basically I want to set it up when you type a message = to like -duelred a dialog box comes up for that player. If that player accepts you and the player are teleported to a arena. Problem is, can't get the triggering player to teleport there.

TRIGGER
EVENTS
Player - Player 2 (Blue) types a chat message containing -duelred as An exact match
Player - Player 3 (Teal) types a chat message containing -duelred as An exact match
Player - Player 4 (Purple) types a chat message containing -duelred as An exact match
Player - Player 5 (Yellow) types a chat message containing -duelred as An exact match
Player - Player 6 (Orange) types a chat message containing -duelred as An exact match
Player - Player 7 (Green) types a chat message containing -duelred as An exact match
Player - Player 8 (Pink) types a chat message containing -duelred as An exact match
Player - Player 9 (Gray) types a chat message containing -duelred as An exact match
Player - Player 10 (Light Blue) types a chat message containing -duelred as An exact match
CONDITIONS
ACTIONS
Dialog - Show Dialog for Player 1 (Red)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Units in Duel1 <gen> matching (((Matching unit) is A Hero) Equal to True)) is empty) Equal to True
Then - Actions
Wait until ((Clicked dialog button) Equal to Accept), checking every 1.00 seconds
Unit Group - Pick every unit in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True)) and do (Unit - Move (Picked unit) instantly to (Center of DuelRight Up <gen>))
Else - Actions
Wait until ((Clicked dialog button) Equal to Decline), checking every 1.00 seconds
Game - Display to (All players) for 30.00 seconds the text: Your Duel offer was...

Help please?
06-12-2005, 07:44 PM#2
JetPack
Code:
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Unit - Move (Picked unit) instantly to (Center of (Playable map area)))
Just add that into your trigger, it should work. You should probobly change where it moves the unit too though.
06-12-2005, 09:09 PM#3
MrApples
Its absolutely amazing that you could give me such a wrong answer as that one...

Someone who knows triggers well enough or actually read what I'm trying to do with it please help?
06-12-2005, 09:45 PM#4
Anitarf
You are wrong in using "clicked dialog button", that's an event response that only gives you a value if the trigger runs on "a player clicks a dialogue button" event. You would need to split this up into two triggers, and that would probably mean reworking some structure, maybe require additional variables to pass data between triggers...
06-12-2005, 10:16 PM#5
Guest
Code:
CreateDialogButton
	Events
		Map initialization
	Conditions
	Actions
		Dialog - Create a dialog button for DuelDialog labelled Accept Duel
		Set DuelDialogButtonAccept = (Last created dialog Button)
		Dialog - Create a dialog button for DuelDialog labelled Decline Duel

Code:
Challenge
	Events
		Player - Player 1 (Red) types a chat message containing -duel as A substring
		Player - Player 2 (Blue) types a chat message containing -duel as A substring
		Player - Player 3 (Teal) types a chat message containing -duel as A substring
		Player - Player 4 (Purple) types a chat message containing -duel as A substring
		Player - Player 5 (Yellow) types a chat message containing -duel as A substring
		Player - Player 6 (Orange) types a chat message containing -duel as A substring
		Player - Player 7 (Green) types a chat message containing -duel as A substring
		Player - Player 8 (Pink) types a chat message containing -duel as A substring
		Player - Player 9 (Gray) types a chat message containing -duel as A substring
		Player - Player 10 (Light Blue) types a chat message containing -duel as A substring
	Conditions
		((Length of (Entered chat string)) Equal to 6) or ((Length of (Entered chat string)) Equal to 7)
		(Integer((Substring((Entered chat string), 6, (Length of (Entered chat string)))))) Greater than or equal to 1
		(Integer((Substring((Entered chat string), 6, (Length of (Entered chat string)))))) Less than or equal to 10
	Actions
		Dialog - Change the title of DuelDialog to ((Name of (Triggering player)) + has challenged you !)
		Unit Group - Pick every unit in (Units owned by (Player((Integer((Substring((Entered chat string), 6, (Length of (Entered chat string)))))))) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
			Loop - Actions
				Unit - Pause (Picked unit)
		Unit Group - Pick every unit in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
			Loop - Actions
				Unit - Pause (Picked unit)
		Dialog - Show DuelDialog for (Player((Integer((Substring((Entered chat string), 6, (Length of (Entered chat string))))))))
		Wait until (DualDecided Equal to True), checking every 0.10 seconds
		If (All Conditions are True) then do (Then Actions) else do (Else Actions)
			If - Conditions
				DualAccepted Equal to True
			Then - Actions
				Unit Group - Pick every unit in (Units owned by (Player((Integer((Substring((Entered chat string), 6, (Length of (Entered chat string)))))))) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
					Loop - Actions
						Unit - Move (Picked unit) instantly to (Center of DuelLeft Up <gen>)
				Unit Group - Pick every unit in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
					Loop - Actions
						Unit - Move (Picked unit) instantly to (Center of DuelLeft Up <gen>), facing (Position of (Random unit from (Units owned by (Player((Integer((Substring((Entered chat string), 6, (Length of (Entered chat string)))))))) matching (((Matching unit) is A Hero) Equal to True))))
				Unit - Make (Random unit from (Units owned by (Player((Integer((Substring((Entered chat string), 6, (Length of (Entered chat string)))))))) matching (((Matching unit) is A Hero) Equal to True))) face (Random unit from (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True))) over 0.00 seconds
				Game - Display to (Player group((Triggering player))) the text: ((Name of (Player((Integer((Substring((Entered chat string), 6, (Length of (Entered chat string))))))))) + has accepted your challenge !)
			Else - Actions
				Game - Display to (Player group((Triggering player))) the text: ((Name of (Player((Integer((Substring((Entered chat string), 6, (Length of (Entered chat string))))))))) + has declined your challenge !)
		Unit Group - Pick every unit in (Units owned by (Player((Integer((Substring((Entered chat string), 6, (Length of (Entered chat string)))))))) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
			Loop - Actions
				Unit - Unpause (Picked unit)
		Unit Group - Pick every unit in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
			Loop - Actions
				Unit - Unpause (Picked unit)
 

Code:
DuelDialogButtonClick
	Events
		Dialog - A dialog button is clicked for DuelDialog
	Conditions
	Actions
		If (All Conditions are True) then do (Then Actions) else do (Else Actions)
			If - Conditions
				(Clicked dialog button) Equal to DuelDialogButtonAccept
			Then - Actions
				Set DualAccepted = True
			Else - Actions
				Set DualAccepted = False
		Set DualDecided = True

Warning : The player who wants to duel someone will have to type -duel1 to challenge player1, -duel2 to challenge player2, etc... I've amde this because it's more simple than doing 10 triggers.

I haven't tested it but it should work.

Sorry if some variable name are called "Dual..." instead of duel, (I've played GunBound too much :P), but it won't change anything.
06-12-2005, 11:09 PM#6
MrApples
Wow, windpower, I'll get right on deciphering that long trigger of your...

I did make it this afterwards

TRIGGER
Events
Player - Player 2 (Blue) types a chat message containing -duelred as An exact match
Player - Player 3 (Teal) types a chat message containing -duelred as An exact match
Player - Player 4 (Purple) types a chat message containing -duelred as An exact match
Player - Player 5 (Yellow) types a chat message containing -duelred as An exact match
Player - Player 6 (Orange) types a chat message containing -duelred as An exact match
Player - Player 7 (Green) types a chat message containing -duelred as An exact match
Player - Player 8 (Pink) types a chat message containing -duelred as An exact match
Player - Player 9 (Gray) types a chat message containing -duelred as An exact match
Player - Player 10 (Light Blue) types a chat message containing -duelred as An exact match
Conditions
Actions
Dialog - Show Dialog for Player 1 (Red)
Wait until ((Clicked dialog button) Equal to (Clicked dialog button)), checking every 1.00 seconds
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Clicked dialog button) Equal to Accept
((Units in Duel1 <gen> matching (((Matching unit) is A Hero) Equal to True)) is empty) Equal to True
Then - Actions
Unit Group - Pick every unit in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True)) and do (Unit - Move (Picked unit) instantly to (Center of DuelRight Up <gen>))
Else - Actions
Game - Display to (All players) for 30.00 seconds the text: Your Duel offer was...

didn't work though...
06-12-2005, 11:57 PM#7
MrApples
what do you mean, or does anyone know what he means by
(Integer((Substring((
(Player((Integer((Substring((
06-13-2005, 01:13 AM#8
MrApples
nvm got it
06-13-2005, 01:15 AM#9
Guest
he means integer conversion string to integer
then the substring 6 is converted into integer
basicly -duel1 returns 1 as an integer
-duel3 returns 3 as an integer

Edit: lol dude i hit new post be4 u posted that, and when it reloaded ur post was there (check the post times
06-13-2005, 02:13 AM#10
MrApples
Quote:
Originally Posted by MrApples
nvm got it
its not working...
when we type -duel6 nothing happens, how exactly is it supposed to work?
06-15-2005, 08:53 PM#11
MrApples
Well got it to work, Final trigger

Code:
Duel Init
    Events
        Player - Player 1 (Red) types a chat message containing -duel as A substring
        Player - Player 2 (Blue) types a chat message containing -duel as A substring
        Player - Player 3 (Teal) types a chat message containing -duel as A substring
        Player - Player 4 (Purple) types a chat message containing -duel as A substring
        Player - Player 5 (Yellow) types a chat message containing -duel as A substring
        Player - Player 6 (Orange) types a chat message containing -duel as A substring
        Player - Player 7 (Green) types a chat message containing -duel as A substring
        Player - Player 9 (Gray) types a chat message containing -duel as A substring
        Player - Player 10 (Light Blue) types a chat message containing -duel as A substring
    Conditions
        ((Length of (Entered chat string)) Equal to 6) or ((Length of (Entered chat string)) Equal to 7)
        (Integer((Substring((Entered chat string), 6, (Length of (Entered chat string)))))) Greater than or equal to 1
        (Integer((Substring((Entered chat string), 6, (Length of (Entered chat string)))))) Less than or equal to 10
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Triggering player) is in (Player group((Player((Integer((Substring((Entered chat string), 6, (Length of (Entered chat string))))))))))) Equal to False
                ((Player((Integer((Substring((Entered chat string), 6, (Length of (Entered chat string)))))))) slot status) Equal to Is playing
                (((Random unit from (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True))) is in (Units in Duel1 <gen>)) Equal to False) or (((Random unit from (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True))) is in (Units in Duel2 <gen>)) Equal to False)
                (((Random unit from (Units owned by (Player((Integer((Substring((Entered chat string), 6, (Length of (Entered chat string)))))))) matching (((Matching unit) is A Hero) Equal to True))) is in (Units in Duel1 <gen>)) Equal to False) or (((Random unit from (Units owned by (Player((Integer((Substring((Entered chat string), 6, (Length of (Entered chat string)))))))) matching (((Matching unit) is A Hero) Equal to True))) is in (Units in Duel2 <gen>)) Equal to False)
            Then - Actions
                Dialog - Change the title of Dialog to ((Name of (Triggering player)) +  has challenged you to a duel!)
                Unit Group - Pick every unit in (Units owned by (Player((Integer((Substring((Entered chat string), 6, (Length of (Entered chat string)))))))) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
                    Loop - Actions
                        Unit - Pause (Picked unit)
                Unit Group - Pick every unit in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
                    Loop - Actions
                        Unit - Pause (Picked unit)
                Dialog - Show Dialog for (Player((Integer((Substring((Entered chat string), 6, (Length of (Entered chat string))))))))
                Wait until (DuelDecided Equal to True), checking every 0.10 seconds
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        DuelAccepted Equal to True
                    Then - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Number of units in (Units in Duel1 <gen> matching (((Matching unit) is A Hero) Equal to True))) Equal to 0
                            Then - Actions
                                Game - Display to (Player group((Triggering player))) for 30.00 seconds the text: ((Name of (Player((Integer((Substring((Entered chat string), 6, (Length of (Entered chat string))))))))) +  has accepted your duel request.)
                                Unit Group - Pick every unit in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
                                    Loop - Actions
                                        Unit - Move (Picked unit) instantly to (Center of DuelRight Down <gen>), facing (Position of (Random unit from (Units owned by (Player((Integer((Substring((Entered chat string), 6, (Length of (Entered chat string)))))))) matching (((Matching unit) is A Hero) Equal to True))))
                                Unit Group - Pick every unit in (Units owned by (Player((Integer((Substring((Entered chat string), 6, (Length of (Entered chat string)))))))) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
                                    Loop - Actions
                                        Unit - Move (Picked unit) instantly to (Center of DuelRight Up <gen>)
                                Unit - Make (Random unit from (Units owned by (Player((Integer((Substring((Entered chat string), 6, (Length of (Entered chat string)))))))) matching (((Matching unit) is A Hero) Equal to True))) face (Position of (Random unit from (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True)))) over 0.00 seconds
                                Unit Group - Pick every unit in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
                                    Loop - Actions
                                        Player Group - Pick every player in (All players controlled by a User player) and do (Player - Make (Owner of (Picked unit)) treat (Picked player) as an Enemy with shared vision)
                                        Unit - Unpause (Picked unit)
                                Unit Group - Pick every unit in (Units owned by (Player((Integer((Substring((Entered chat string), 6, (Length of (Entered chat string)))))))) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
                                    Loop - Actions
                                        Player Group - Pick every player in (All players controlled by a User player) and do (Player - Make (Owner of (Picked unit)) treat (Picked player) as an Enemy with shared vision)
                                        Unit - Unpause (Picked unit)
                            Else - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        (Number of units in (Units in Duel2 <gen> matching (((Matching unit) is A Hero) Equal to True))) Equal to 0
                                    Then - Actions
                                        Game - Display to (Player group((Triggering player))) for 30.00 seconds the text: ((Name of (Player((Integer((Substring((Entered chat string), 6, (Length of (Entered chat string))))))))) +  has accepted your duel request.)
                                        Unit Group - Pick every unit in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
                                            Loop - Actions
                                                Unit - Move (Picked unit) instantly to (Center of DuelRight Down2 <gen>), facing (Position of (Random unit from (Units owned by (Player((Integer((Substring((Entered chat string), 6, (Length of (Entered chat string)))))))) matching (((Matching unit) is A Hero) Equal to True))))
                                        Unit Group - Pick every unit in (Units owned by (Player((Integer((Substring((Entered chat string), 6, (Length of (Entered chat string)))))))) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
                                            Loop - Actions
                                                Unit - Move (Picked unit) instantly to (Center of DuelRight Up2 <gen>)
                                        Unit - Make (Random unit from (Units owned by (Player((Integer((Substring((Entered chat string), 6, (Length of (Entered chat string)))))))) matching (((Matching unit) is A Hero) Equal to True))) face (Position of (Random unit from (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True)))) over 0.00 seconds
                                        Unit Group - Pick every unit in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
                                            Loop - Actions
                                                Player Group - Pick every player in (All players controlled by a User player) and do (Player - Make (Owner of (Picked unit)) treat (Picked player) as an Enemy with shared vision)
                                                Unit - Unpause (Picked unit)
                                        Unit Group - Pick every unit in (Units owned by (Player((Integer((Substring((Entered chat string), 6, (Length of (Entered chat string)))))))) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
                                            Loop - Actions
                                                Player Group - Pick every player in (All players controlled by a User player) and do (Player - Make (Owner of (Picked unit)) treat (Picked player) as an Enemy with shared vision)
                                                Unit - Unpause (Picked unit)
                                    Else - Actions
                                        Game - Display to (Player group((Triggering player))) for 30.00 seconds the text: The dueling areas a...
                                        Game - Display to (Player group((Player((Integer((Substring((Entered chat string), 6, (Length of (Entered chat string)))))))))) for 30.00 seconds the text: The dueling areas a...
                    Else - Actions
                        Game - Display to (Player group((Triggering player))) for 30.00 seconds the text: ((Name of (Player((Integer((Substring((Entered chat string), 6, (Length of (Entered chat string))))))))) +  has declined your duel request.)
            Else - Actions
                Game - Display to (Player group((Triggering player))) for 30.00 seconds the text: Either your trying ...
06-15-2005, 09:11 PM#12
Guest
That's right. By (Player((Integer((Substring(( I try to get the player number of the player who will be prompted if he wnats to have a duel or not.

EDIT : oh and sorry for my lack of quickness, I don't check my inbox frequently to see if there are any posts that have received a reply.