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

Some Triggerquestions

Status
Not open for further replies.
Level 1
Joined
Sep 30, 2008
Messages
4
Hello,
i am already working on a special Map but now i have some Problems with some Trigger.

1. If a Unit pick up a certain Item, this Unit should get a certain Spell. And also should lose this Spell if this Unit drop the Item.

1.2 If no exemplar of this certain Item is in the Inventory of the Unit a certain Type of a Unit should be erased.

2. If the Player activate a certain Spell the Unit should not be able to attack. Like a standbymode. And the Player should get for each Unit in this "standby"-mode something like wood (for example) every 5 Seconds.

3. How can i set a Limit for Items in the Inventory: No Hero or Unit should carry an item more then once. And it should be unable to pick up or buy the same item twice

thanks

Darth Eye

PS.: the most problems that i have are the conditions^^°
 
Level 13
Joined
Sep 14, 2008
Messages
1,407
1.
  • a
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to (YourItem)
        • Then - Actions
          • Unit - Add (YourAbility) to (Triggering unit)
        • Else - Actions
When a unit gets an item this trigger checks wether it is "youritem" and if it is then it adds the ability to the unit.

1.2
  • a
    • Events
      • Unit - A unit Loses an item
      • Unit - A unit Pawns an item (to shop)
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to (YourItem)
        • Then - Actions
          • Unit - Remove (YourAbility) from (Triggering unit)
        • Else - Actions

When a unit gets an item this trigger checks wether it is "youritem" and if it is then it removes the ability to the unit.

2. First:
  • a
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to (YourAbility)
    • Actions
      • Unit Group - Pick every unit in StandbyUnits and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering unit) Equal to (Picked unit)
            • Then - Actions
              • Set Boolean = False
              • Unit - Set (Triggering unit) acquisition range to (StandartAcqusitionRange)
              • Unit - Set (Triggering unit) movement speed to (Default movement speed of (Triggering unit))
              • Unit Group - Remove (Triggering unit) from StandbyUnits
            • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Boolean Equal to True
      • Then - Actions
        • Unit Group - Add (Triggering unit) to StandbyUnits
        • Unit - Set (Triggering unit) acquisition range to 0.00
        • Unit - Set (Triggering unit) movement speed to 0.00
      • Else - Actions
        • Set Boolean = True
When a unit uses the ability this trigger checks if the unit is in the unit group "StandbyUnits" and if it is, it is removed. If not it is added.

Second:
  • a
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in StandbyUnits and do (Actions)
        • Loop - Actions
          • Player - Add 5 to (Owner of (Picked unit)) Current gold
Every 5 seconds this trigger picks every unit in "StandbyUnits" and adds 5 gold to the owner of the unit for each unit.

3.
  • Stack Items
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Deku Stick
    • Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item carried by (Triggering unit) in slot (Integer A)) Equal to (Item being manipulated)
            • Then - Actions
              • Set SlotNumber = (Integer A)
            • Else - Actions
      • For each (Integer B) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • (Integer B) Not equal to SlotNumber
                  • (Item-type of (Item carried by (Triggering unit) in slot SlotNumber)) Equal to (Item-type of (Item carried by (Triggering unit) in slot (Integer B)))
            • Then - Actions
              • Item - Remove (Item being manipulated)
            • Else - Actions
This trigger checks if a unit already has the item when picking up a new one. If it has then the new one is removed. You can also use Hero - drop.

This are a lot of triggers... I think they all should work but I am not completly sure...
 
Level 1
Joined
Sep 30, 2008
Messages
4
wow o.o thanks allot that will help me allot *domo arigatou gozaimasu*

/Edit: can you tell me which Variables do you used?
For "StandbyUnit" i created one:
Name: StandbyGroup
Typ of Variable: Unitgroup
Startvalue: empty Unitgroup

sorry >.<
to 1.2: A certain Unit-typ (like Soldiers oder Mailhalls) should be erased from the Map from the Player who dropt den Item. Like the Unit who owned the Item use the Spell he got from that Item to summon or create another Unit. Now if the Summoner drop the Item the summoned Units should be erased.^^°
 
Last edited:
Level 13
Joined
Sep 14, 2008
Messages
1,407
  • a
    • Events
      • Unit - A unit Spawns a summoned unit
    • Conditions
      • (Unit-type of (Summoned unit)) Equal to (Unit your item spawns)
    • Actions
      • Set SummonUnit = (Last created unit)
  • a
    • Events
      • Unit - A unit Loses an item
      • Unit - A unit Pawns an item (to shop)
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to (YourItem)
        • Then - Actions
          • Unit - Remove (YourAbility) from (Triggering unit)
          • Unit - Remove (Summond Unit) from game
        • Else - Actions
Variables:

Summoned Unit = Unit
(If meant to be used by more than 1 hero at the same time ) = array
Then use Summond Unit[Player Number of (owner of (triggering unit))]

StandbyUnits = Unit group

Boolean = boolean...

Slot number = integer
 
Status
Not open for further replies.
Top