• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[General] Integer Help :3

Status
Not open for further replies.
Level 11
Joined
Oct 31, 2010
Messages
1,057
hmm weird, every time i use integer to count stuffs like unit kills
i get 0 first O:, how do i fix this ?

example (actual thing actually): i got a quest and i want the player to kill 3 satyrs
attachment.php



but when i kill the first satyr, the game messages = 0 satyr, 1 satyr , 2 satyr so i have to kill 4 satyrs :C how do i fix this ?

attachment.php


  • Quest Satyrs killed my husband repeatable
    • Events
      • Unit - Sorceress 0170 <gen> Is selected
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Satyrskilledmyhusband is completed) Equal to False
        • Then - Actions
          • Quest - Enable Satyrskilledmyhusband
          • Quest - Display to (All players) the Quest Update message: |cffffcc00The satyr...
          • Quest - Create a Required quest titled Satyrs killed my hu... with the description The satyrs out in t..., using icon path ReplaceableTextures\CommandButtons\BTNSatyrTrickster.blp
          • Set Satyrskilledmyhusband = (Last created quest)
          • Special Effect - Destroy SpecialEffect_Quests[1]
          • Set QuestKills[1] = 0
          • Set QuestKills[2] = 0
          • Set QuestKills[3] = 0
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
            • Then - Actions
            • Else - Actions
  • Quest Satyrs killed my husband repeatable Killing Spree
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Satyrskilledmyhusband is enabled) Equal to True
          • ((Dying unit) is in (Units of type Satyr)) Equal to True
        • Then - Actions
          • Game - Display to (All players) the text: (You guys have killed + ((String(QuestKills[1])) + |cffff8c00Satyrs|r))
          • Set QuestKills[1] = (QuestKills[1] + 1)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Satyrskilledmyhusband is enabled) Equal to True
              • ((Dying unit) is in (Units of type Satyr Trickster)) Equal to True
            • Then - Actions
              • Game - Display to (All players) the text: (You guys have killed + ((String(QuestKills[2])) + |cffff8c00Satyr Soulstealers|r))
              • Set QuestKills[2] = (QuestKills[2] + 1)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Satyrskilledmyhusband is enabled) Equal to True
                  • ((Dying unit) is in (Units of type Satyr Shadowdancer)) Equal to True
                • Then - Actions
                  • Game - Display to (All players) the text: (You guys have killed + ((String(QuestKills[3])) + |cffff8c00Satyr Shadowdancers|r))
                  • Set QuestKills[3] = (QuestKills[3] + 1)
                • Else - Actions
                  • Do nothing
 

Attachments

  • Integer help.PNG
    Integer help.PNG
    1.4 MB · Views: 263
  • Integer help2.png
    Integer help2.png
    1.3 MB · Views: 253
Level 20
Joined
Jul 14, 2011
Messages
3,213
  • Game - Display to (All players) the text: (You guys have killed + ((String(QuestKills[1])) + |cffff8c00Satyrs|r))
  • Set QuestKills[1] = (QuestKills[1] + 1)
You're displaying the message before increasing the value.
 
Status
Not open for further replies.
Top