• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Player alliances through dialog boxes

Status
Not open for further replies.
Level 3
Joined
Dec 24, 2007
Messages
29
Pretty much what I would like to do is make it so if a player types something like "-ally blue", a dialog box will pop up for blue saying "Accept alliance with red" or something to that effect with a "yes" or "no" option... and have this command available for all players... I know the basics of dialog boxes but I just can't figure out how to go about doing this for all 12 players... help is appreciated.
 
My trigger doesnt use player colors, but player numbers. I dont know if it will work, the only way to try is to try it on battlenet.
  • Ally Start
    • Events
      • Player - Player 1 (Red) types a chat message containing -ally as A substring
      • Player - Player 2 (Blue) types a chat message containing -ally as A substring
      • Player - Player 3 (Teal) types a chat message containing -ally as A substring
      • Player - Player 4 (Purple) types a chat message containing -ally as A substring
      • Player - Player 5 (Yellow) types a chat message containing -ally as A substring
      • Player - Player 6 (Orange) types a chat message containing -ally as A substring
      • Player - Player 7 (Green) types a chat message containing -ally as A substring
      • Player - Player 8 (Pink) types a chat message containing -ally as A substring
      • Player - Player 9 (Gray) types a chat message containing -ally as A substring
      • Player - Player 10 (Light Blue) types a chat message containing -ally as A substring
      • Player - Player 11 (Dark Green) types a chat message containing -ally as A substring
      • Player - Player 12 (Brown) types a chat message containing -ally as A substring
    • Conditions
    • Actions
      • Set TempIntA = (Integer((Substring((Entered chat string), 7, 9))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering player) is an ally of (Player(TempIntA))) Equal to False
        • Then - Actions
          • Set AllyPlayer[TempIntA] = (Player number of (Triggering player))
          • Dialog - Clear AllyDio
          • Dialog - Change the title of AllyDio to (Do you want to allign with + (Name of (Triggering player)))
          • Dialog - Create a dialog button for AllyDio labelled Yes
          • Set AllyButton[1] = (Last created dialog Button)
          • Dialog - Create a dialog button for AllyDio labelled No
          • Set AllyButton[2] = (Last created dialog Button)
          • Dialog - Show AllyDio for (Player(TempIntA))
        • Else - Actions
          • Game - Display to (Player group((Triggering player))) for 5.00 seconds the text: You are already all...
  • Ally Finish
    • Events
      • Dialog - A dialog button is clicked for AllyDio
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to AllyButton[1]
        • Then - Actions
          • Player - Make (Triggering player) treat (Player(AllyPlayer[(Player number of (Triggering player))])) as an Ally with shared vision
          • Game - Display to (All players) the text: (((Name of (Triggering player)) + has accepted the alliance of ) + (Name of (Player(AllyPlayer[(Player number of (Triggering player))]))))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to AllyButton[2]
        • Then - Actions
          • Game - Display to (All players) the text: (((Name of (Triggering player)) + has rejected the alliance of ) + (Name of (Player(AllyPlayer[(Player number of (Triggering player))]))))
        • Else - Actions
 
Level 9
Joined
Oct 17, 2007
Messages
547
If you want to use player colors make a string array and add the colors in, have teh trigger check for the exact string when activate.
 
Level 6
Joined
Feb 21, 2008
Messages
205
Nice trigger, am stealing this :p

But, (as always) am having problems with finding these triggers.

So I'll edit this post everytime I come to a trigger I cant find :thumbs_up:

1:
  • ((Triggering player) is an ally of (Player(TempIntA))) Equal to False
I find triggering player, but "is an ally of"? help!
 
Level 3
Joined
Dec 24, 2007
Messages
29
Nice trigger, am stealing this :p

But, (as always) am having problems with finding these triggers.

So I'll edit this post everytime I come to a trigger I cant find :thumbs_up:

1:
  • ((Triggering player) is an ally of (Player(TempIntA))) Equal to False
I find triggering player, but "is an ally of"? help!

That took my awhile to find too... its worded differently in the drop down menu.
 
Level 17
Joined
Apr 13, 2008
Messages
1,598
Man, don't doublepost. The edit button is there for a reason. The 15 character limit if there for a reason, so you won't post stuff like 'eh?'
And what do you think, what kind of variable is the tempintA?
temp...int...a... tempinta.. temporary integer A... With a value between 1-12.
 
Level 6
Joined
Feb 21, 2008
Messages
205
If you could please, stop acting like that, and just say, the variable is an integer.

If I set TempintA to integer, I cant choose that variable in this trigger then:
Set TempIntA = (Integer((Substring((Entered chat string), 7, 9)))
And this
Dialog - Show AllyDio for (Player(TempIntA))
 
Level 6
Joined
Feb 21, 2008
Messages
205
Well, he hinted that the variable should be "integer", I had mine on "player".

When I shifted my to integer those 2 triggers got destroyed, and I cant put an "integer" trigger in those variable spots.
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
Hmm
I don't like that :D
I think it should put up the ally dialog when you type the command or use some skill.
In the dialog there should be listed all the currently playing players. When you click one you get a confirmation dialog asking you whether you wish to continue with depending whether you are ally or not with the player ally or unally with him.
I am too lazy at the moment to post the trigger :p
 
Level 6
Joined
Feb 21, 2008
Messages
205
I give up on this one, been trying for quite a while. I almost get the trigger working but then some error comes and fucks up my variable triggers.
This is really hard for me since I have very little experience with variables.
So if I could ask so kindly if some1 would volunteer to fix the trigger in my map, would any1 do it? :hohum:

You get to see an awesome map before release day! :grin:

(To all people who say I should do this myself to learn, I tried, ok?)
Edit: When I just type "-ally" and nothing else, every person on the server get their wc3 crashed.)
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
I believe that the best you can do is to look at the Gui tutorials (I you havent done that already)

Here is a link for it. Then look through the tutorials which could help you (basic of triggers, basic of triggering, dialogs, variables etc)
http://www.hiveworkshop.com/forums/showthread.php?t=62672

This is what I can contribute to now, thus Im in school and cant do anything but inet.
/regards
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
Well generally I would gladly do it, but this Sunday and Tuesday I have exams :D
So I will not promise anything, but I will try to post triggers. For what I suggested?
 
Status
Not open for further replies.
Top