• 🏆 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!

Integer -add gold problem

Status
Not open for further replies.
Level 4
Joined
Oct 28, 2007
Messages
72
Hi after long time i start to play with editor and am stuck at this a bit complicated trigger i think all works but i can get gold when group 1 or 2 win
if anyone can see problem pls...if you need more question, yeah is a kind of lottery system that am testing for now only for 1 player but am playing like with min 3+me and max 11+me players...hope that helps...btw add gold is integer i try to convert to real same...
begining

  • install
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player - Set Player 1 (Red) Current gold to 200
2nd
  • start
    • Events
      • Player - Player 1 (Red) types a chat message containing go as An exact match
    • Conditions
      • (Entered chat string) Equal to go
    • Actions
      • Set totalplayers = (Random integer number between 3 and 11)
      • Set TotalGold = (((totalplayers + 1) x 50) - 50)
      • Game - Display to (All players) for 15.00 seconds the text: ((((Total players are + (String((totalplayers + 1)))) + and total gold is ) + (String(TotalGold))) + , vote please 1 or 2 (just type).)
      • Set NumWingroup = (Random integer number between 1 and 2)
      • Set trigger = 1
      • Player - Add -50 to Player 1 (Red) Current gold
      • Trigger - Turn off (This trigger)
last one
  • finish
    • Events
      • Player - Player 1 (Red) types a chat message containing 1 as An exact match
      • Player - Player 1 (Red) types a chat message containing 2 as An exact match
    • Conditions
      • trigger Equal to 1
    • Actions
      • Set playersgroup1 = (totalplayers - (Random integer number between 0 and totalplayers))
      • Set playersgroup2 = (totalplayers - playersgroup1)
      • Game - Display to (All players) the text: (total players in group 1 are + (String(playersgroup1)))
      • Wait 2.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Entered chat string) Equal to 1
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • NumWingroup Equal to 1
            • Then - Actions
              • Set givegold = ((playersgroup1 + 1) / TotalGold)
              • Player - Add givegold to Player 1 (Red) Current gold
              • Game - Display to (All players) the text: (You just won + (((String(givegold)) + cuz group ) + ((String(NumWingroup)) + (won with + ((String((playersgroup1 + 1))) + (players, out of + (String((totalplayers + 1)))))))))
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • NumWingroup Equal to 2
            • Then - Actions
              • Game - Display to (All players) for 15.00 seconds the text: (((((Victory group is + (String(NumWingroup))) + with ) + (String(playersgroup1))) + players, and oposit group have) + (String((playersgroup2 + 1))))
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Entered chat string) Equal to 2
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • NumWingroup Equal to 1
            • Then - Actions
              • Game - Display to (All players) for 15.00 seconds the text: (((((Victory group is + (String(NumWingroup))) + with ) + (String(playersgroup2))) + players, and oposit group have) + (String((playersgroup1 + 1))))
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • NumWingroup Equal to 2
            • Then - Actions
              • Set givegold = ((playersgroup2 + 1) / TotalGold)
              • Player - Add givegold to Player 1 (Red) Current gold
              • Game - Display to (All players) the text: (You just won + (((String(givegold)) + cuz group ) + ((String(NumWingroup)) + (won with + ((String((playersgroup2 + 1))) + (players, out of + (String((totalplayers + 1)))))))))
            • Else - Actions
        • Else - Actions
      • Set trigger = 0
      • Trigger - Turn on start <gen>
 
Level 4
Joined
Oct 28, 2007
Messages
72
.

i have 2 cases when i vote for group 1 and if group one win (NumWingroup Equal to 1) then i get gold if not and i voted for 1 then i get nothing if i vote for group 2 same story...to see how it works 1st minimaze all then open it one by one this way when all is opened is confusing...and to answer you no you can choice before you know weach one group won..
 
Level 4
Joined
Oct 28, 2007
Messages
72
kk the group 1 and 2 they arent a player group they are just a integer that count a players that are randomly added to every intreger ...
 
Status
Not open for further replies.
Top