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

[Trigger] Checking Item taken.

Status
Not open for further replies.
Level 3
Joined
Aug 12, 2011
Messages
44
I have a map where a rune spawns every 45 seconds at a random location. And there are destructibles that may drop an item.

If a rune hasn't been taken a new one should not spawn, but now I don't find a way to differentiate the Item - rune or not.

  • rune
    • Events
      • Time - Every 45.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RUNECHECK Equal to 0
        • Then - Actions
          • Set RUNECHECK = 1
          • Set Runespot = (Random integer number between 1 and 4)
          • Set Runetype = (Random integer number between 1 and 5)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Runetype Equal to 1
            • Then - Actions
              • Set Rune = Rune of Haste
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Runetype Equal to 2
                • Then - Actions
                  • Set Rune = Rune of Regeneration
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Runetype Equal to 3
                    • Then - Actions
                      • Set Rune = Rune of Armor
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Runetype Equal to 4
                        • Then - Actions
                          • Set Rune = Rune of Double Damage
                        • Else - Actions
                          • Set Rune = Rune of Invisibilty
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Runespot Equal to 1
            • Then - Actions
              • Item - Create Rune at (Center of Region 012 <gen>)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Runespot Equal to 2
                • Then - Actions
                  • Item - Create Rune at (Center of Region 014 <gen>)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Runespot Equal to 3
                    • Then - Actions
                      • Item - Create Rune at (Center of Region 015 <gen>)
                    • Else - Actions
                      • Item - Create Rune at (Center of Region 016 <gen>)
          • Game - Display to (All players) for 5.00 seconds the text: A rune has spawned.
        • Else - Actions
          • Game - Display to (All players) for 5.00 seconds the text: The rune spot is st...
  • rune taken
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-class of (Picked item)) Equal to Powerup
    • Actions
      • Set RUNECHECK = 0
      • Game - Display to (All players) for 5.00 seconds the text: rune taken
runecheck = 0 -> no rune on map
runecheck = 1 -> rune anywhere at map

It worked without that conditions (now it doesn't) but I hadn't added normal items at this point.

regards, toasted
 
Level 3
Joined
Aug 12, 2011
Messages
44
  • rune taken
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Picked item)) Equal to Rune of Armor
          • (Item-type of (Picked item)) Equal to Rune of Regeneration
          • (Item-type of (Picked item)) Equal to Rune of Double Damage
          • (Item-type of (Picked item)) Equal to Rune of Invisibilty
          • (Item-type of (Picked item)) Equal to Rune of Haste
    • Actions
      • Set RUNECHECK = 0
      • Game - Display to (All players) for 5.00 seconds the text: rune taken
Still doesn't work.
I think the problem is Itemtype/-class of Picked Item is the problem, but I didn't find any viable alternative aside from setting the rune as variable.
 
Level 16
Joined
Mar 3, 2006
Messages
1,564
  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set SpawnRune = True
      • -------- Set Location Variables --------
      • Set RuneLocation[1] = (Center of Region 000 <gen>)
      • Set RuneLocation[2] = (Center of Region 001 <gen>)
      • Set RuneLocation[3] = (Center of Region 002 <gen>)
      • Set RuneLocation[4] = (Center of Region 003 <gen>)
      • -------- Set Rune Type Variables --------
      • Set RuneType[1] = Rune of Speed
      • Set RuneType[2] = Rune of Healing
      • Set RuneType[3] = Rune of Dispel Magic
      • Set RuneType[4] = Rune of the Watcher
      • Set RuneType[5] = Rune of Greater Mana
  • Spawn A New Rune
    • Events
      • Time - Every 45.00 seconds of game time
    • Conditions
      • SpawnRune Equal to True
    • Actions
      • Set SpawnRune = False
      • Set RuneLocationIndex = (Random integer number between 1 and 4)
      • Set RuneTypeIndex = (Random integer number between 1 and 5)
      • Item - Create RuneType[RuneTypeIndex] at RuneLocation[RuneLocationIndex]
      • Game - Display to (All players) the text: A Rune has been spa...
  • A Rune Is Picked
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-class of (Item being manipulated)) Equal to Powerup
    • Actions
      • Set SpawnRune = True
      • Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + has picked the rune.)
 
Status
Not open for further replies.
Top