• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

i have a couple question and trigger problem

Status
Not open for further replies.
Level 2
Joined
Apr 17, 2008
Messages
20
Hi, i'm making a survival map that some enemies will randomly drop some items that only have effect on towers. such as +500 hp or +5 armor...etc
so i create an item and an ability for the item
is there a way to make the effect (+500 hp or +5 armor...etc) only work on the tower (structure) but no effect on the worker?

i tried a few times (by changing the target allowed of the ability) but not working so i tried to do it with trigger. first i make the item have no ability and whenever a structure acquire such item will grant an ability.
however this is kinda complicate because there are 6 type of item(1-6) and each item have 3 level(a-c), therefore i create 18 dummy items and 6 ability, each ability with 3 level
then i make a trigger like this
  • Untitled Trigger 004
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • ((Triggering unit) is A structure) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to item1a
        • Then - Actions
          • Unit - Add ability1 to (Triggering unit)
        • Else - Actions
          • Skip remaining actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to item1b
        • Then - Actions
          • Unit - Add ability1 to (Triggering unit)
          • Wait 1.00 game-time seconds
          • Unit - Set level of ability1 for (Triggering unit) to 2
        • Else - Actions
          • Skip remaining actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to item1c
        • Then - Actions
          • Unit - Add ability1 to (Triggering unit)
          • Wait 1.00 game-time seconds
          • Unit - Set level of ability1 for (Triggering unit) to 3
        • Else - Actions
          • Skip remaining actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to item2a
        • Then - Actions
          • Unit - Add ability2 to (Triggering unit)
        • Else - Actions
          • Skip remaining actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to item2b
        • Then - Actions
          • Unit - Add ability2 to (Triggering unit)
          • Wait 1.00 game-time seconds
          • Unit - Set level of ability2 for (Triggering unit) to 2
        • Else - Actions
          • Skip remaining actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to item2c
        • Then - Actions
          • Unit - Add ability2 to (Triggering unit)
          • Wait 1.00 game-time seconds
          • Unit - Set level of ability2 for (Triggering unit) to 3
        • Else - Actions
          • Skip remaining actions
  • and so on for item3-6
This is way too long if i decide to add more item series!!
is there a better way to write this trigger?
thx for reading this and plz help
 
Last edited:
Level 2
Joined
Apr 17, 2008
Messages
20
the item editor do not have the "target allow" to choose, i can only do that from ability editor and then give that ability to the item
also i can set my worker's inventory to "cannot use item" but i wont do so cause i also create some item is for worker only... so plz help
 
Level 9
Joined
Oct 17, 2007
Messages
547
Use different types of classification for worker and a different one for towers. Make the workers/towers drop the items if they pick up other classification. Its the same concept as swords/shields/armor/helmets etcs.. in rpg maps.

Use normal skills, it should work, those actions are messy.
 
Level 2
Joined
Apr 17, 2008
Messages
20
but i want to make it realistic, a tower cant pick up an item by itself also it cant move! so the worker gotta pick it up and distribute to any tower....
 
Level 2
Joined
Apr 17, 2008
Messages
20
you can shorten it if u set the level of the item to the level u want your ability to have so you can set the level of ability to items level and so you just need one if/then/else for each item ...

well i set item1 = lvl 1, item2 = lvl 2, item3 = lvl 3 and then this trigger, but not working! it only give me lvl 1 ability1, how come?
  • Untitled Trigger 004
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • ((Triggering unit) is A structure) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Item-type of (Item being manipulated)) Equal to item1
              • (Item-type of (Item being manipulated)) Equal to item2
              • (Item-type of (Item being manipulated)) Equal to item3
        • Then - Actions
          • Unit - Add ability1 to (Triggering unit)
          • Wait 1.00 seconds
          • Unit - Set level of ability1 for (Triggering unit) to (Item level of (Item being manipulated))
        • Else - Actions
          • Skip remaining actions
 
Level 2
Joined
Apr 17, 2008
Messages
20
i think it will work if you give to towers the Inventory (Hero) ability and give to the worker the Backpack ability

dont think this will work coz both tower and worker using worker backpack however both getting effect

you have to change the level of the item in object editor
value - level (sth like that)

i did, like this in object editor for item1, and item2 lvl 2, item3 lvl 3...etc
Stats - Level 1
Stats - Level(unclassified) 1
but still not working

Do NOT double-post. Use the Edit Post button.
~Posts Merged
 
Last edited by a moderator:
Level 2
Joined
Apr 17, 2008
Messages
20
strange, did you try removing the wait? and you don't need the "skip remaining actions" thing if you don't have any remaining actions

i tried remove wait and skip remaining action but still not working

EDIT:
now i know why. when i using other ability is fine, but the new custom ability i use is from item life bonus, i dunno why this item ability does not work with the trigger but at least now i know what's wrong ><

Do NOT double-post. Use the Edit Post button.
~Posts Merged
 
Last edited by a moderator:
Level 19
Joined
Aug 24, 2007
Messages
2,888
make a variable called item (item type)
make a variable called gotitem (item type)
make a variable called ability (ability)
make a variable called num (integer)

in map initialization

Set item[0] = Vampric Aura item
Set ability[0] = Vampric Aura
Set item[1] = Death Pact item
Set ability[1] = Death Pact
and more

When someone aquired an item

Set num = 0
Set gotitem = item type of (Aquired item)
Custom script: loop
Custom script: exitwhen udg_gotitem == udg_item[udg_num]
Set num = num + 1
Custom script: endloop
Unit - Add ability[num] to (Triggering Unit)
Unit - Remove (Aquired item) from (Triggering Unit)
 
Level 2
Joined
Apr 17, 2008
Messages
20
that is a nice trigger although i still have to create more than 1 ability for the +hp items since cannot increase the lvl of it by trigger, thx anyway +rep to whoever help out
 
Status
Not open for further replies.
Top