A item with 10 charges (ammo), that when picked up by a hero, sits in their inventory, displays the charges remaining, and enables psi storm
Every time the hero casts psi storm, a charge is deducted from the item ammo (in warcraft3 you could do this with triggers, but i'm not sure if you can deduct item charges through triggers in sc2...)
When charges reach 0, the item is removed, and the ability is removed from the hero
What method could make this work? and can you remove item charges with triggers in sc2?
Yes, you can, and thats the method I would use probably.
However, maybe, there is even another way: Charges are linked by a link, and can be specifically linked to a unit. For an item, they are usually linked to the item, but you can set them to link to the caster (the unit holding the item). If you then make the psi storm use the exact same link for its own charges... let me try this ;)
€ sort of works. You gain charges for picking up the item, both the item and the ability lose charges, you can use either the item or the ability to cast (however item cast behaves different, no AoE marker and no cast animation), also the item seems to only be removed, when you cast the last charge from the item, and dropping and re-taking the item results in another 10 charges ;)
Well, its a start, and I am sure the problems can be solved; eventually with triggers (atm its pure data).
The cast from item thing is not needed anyway, you could remove that, Then you could make the item undroppable and check for charges in a trigger, whenever psi storm is used and remove the item in the case of 0 charges left.
The items need to be droppable, as swapping items and "trading" is a part of my map.
I think I need to use triggers to remove charges, since i'm using triggers to create dummy unit which actually does the damage spell (the hero carrying the item only does a dummy aoe splat spell)
I have tried actions such as "add charge (-1) used to item carried by triggering unit in slot 1, "
or add positive charges, and removing charges used also, but none of these have worked...I have also tried slot 0, 1, 2, 3 etc, but none have worked
What triggers should I be using to subtract a charge from the item (when hero casts dummy spell and spawns dummy unit)?
And does it have to do something with charge itemlink? which is just the item name right?
In warcraft 3 editor this was soooo much easier to do lol...
So which trigger action should I be using or method for this?
go to the hightemplar psi storm ability, Set the charges., also make sure its set to "unit" as the cooldown. Even though it has no cooldown just set it to unit.
then go to the items section, and create an item based of ability. Link the psi storm ability to that item. then flag the item as "can drop" and "destroy when depleted"
Thanks for your help guys! I think i got it down but I have another problem now, with the item not removing when out of charges
even though I have set the flag "Destroy when Depleted"
Right I have an item(instant), with no effect, that uses up 1 charge when its clicked
And then I have a trigger that "Adds 1.0 charge used for unit charge "item/Noodles" on Hero unit", on a period event every 2 seconds
Ok so the item's charges go down 1 by 1 from the trigger, but then when it reaches 0 charges, it doesnt remove itself (and the icon is just shaded grey)
However if I rapidly click the item to use itself, the charges go down and it does remove itself when depleted
So anyone know why the Action will bring the item down to 0 charge but the item isnt removed?
Erm try removing the destroy when depleted (has 0 charges)? Or use a validator that causes a behavior on the item with an effect tree that destoys it if there are 0 charges.
Actions
Unit Group - Pick each unit in (All items carried by (Triggering unit)) and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Charges used of charge "Item/Noodles" on unit (Hero)) == 5.0
Then
Unit - Remove inventory item (Picked unit)
Unit - Remove (Picked unit) from the game
Else
Ya I'm having the same issue. If an items effect is triggered, it will not be removed, so I had to remove it in the trigger. When I checked "Destroy when depleted", the Trigger did not fire.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Basically what im trying to make is:
A item with 10 charges (ammo), that when picked up by a hero, sits in their inventory, displays the charges remaining, and enables psi storm
Every time the hero casts psi storm, a charge is deducted from the item ammo (in warcraft3 you could do this with triggers, but i'm not sure if you can deduct item charges through triggers in sc2...)
When charges reach 0, the item is removed, and the ability is removed from the hero
What method could make this work? and can you remove item charges with triggers in sc2?
Thanks
Yes, you can, and thats the method I would use probably.
However, maybe, there is even another way: Charges are linked by a link, and can be specifically linked to a unit. For an item, they are usually linked to the item, but you can set them to link to the caster (the unit holding the item). If you then make the psi storm use the exact same link for its own charges... let me try this ;)
€ sort of works. You gain charges for picking up the item, both the item and the ability lose charges, you can use either the item or the ability to cast (however item cast behaves different, no AoE marker and no cast animation), also the item seems to only be removed, when you cast the last charge from the item, and dropping and re-taking the item results in another 10 charges ;)
Well, its a start, and I am sure the problems can be solved; eventually with triggers (atm its pure data).
The cast from item thing is not needed anyway, you could remove that, Then you could make the item undroppable and check for charges in a trigger, whenever psi storm is used and remove the item in the case of 0 charges left.
The items need to be droppable, as swapping items and "trading" is a part of my map.
I think I need to use triggers to remove charges, since i'm using triggers to create dummy unit which actually does the damage spell (the hero carrying the item only does a dummy aoe splat spell)
I have tried actions such as "add charge (-1) used to item carried by triggering unit in slot 1, " or add positive charges, and removing charges used also, but none of these have worked...I have also tried slot 0, 1, 2, 3 etc, but none have worked
What triggers should I be using to subtract a charge from the item (when hero casts dummy spell and spawns dummy unit)? And does it have to do something with charge itemlink? which is just the item name right?
In warcraft 3 editor this was soooo much easier to do lol...
So which trigger action should I be using or method for this?
go to the hightemplar psi storm ability, Set the charges., also make sure its set to "unit" as the cooldown. Even though it has no cooldown just set it to unit.
then go to the items section, and create an item based of ability. Link the psi storm ability to that item. then flag the item as "can drop" and "destroy when depleted"
Thanks for your help guys! I think i got it down but I have another problem now, with the item not removing when out of charges
even though I have set the flag "Destroy when Depleted"
Right I have an item(instant), with no effect, that uses up 1 charge when its clicked
And then I have a trigger that "Adds 1.0 charge used for unit charge "item/Noodles" on Hero unit", on a period event every 2 seconds
Ok so the item's charges go down 1 by 1 from the trigger, but then when it reaches 0 charges, it doesnt remove itself (and the icon is just shaded grey)
However if I rapidly click the item to use itself, the charges go down and it does remove itself when depleted
So anyone know why the Action will bring the item down to 0 charge but the item isnt removed?
Thanks
Erm try removing the destroy when depleted (has 0 charges)? Or use a validator that causes a behavior on the item with an effect tree that destoys it if there are 0 charges.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
Thanks got it to work!
This is basically what i did:
Actions
Unit Group - Pick each unit in (All items carried by (Triggering unit)) and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Charges used of charge "Item/Noodles" on unit (Hero)) == 5.0
Then
Unit - Remove inventory item (Picked unit)
Unit - Remove (Picked unit) from the game
Else
5 is the max number of charges on noodles
@HatsuneMikuMegurine: Go
Ya I'm having the same issue. If an items effect is triggered, it will not be removed, so I had to remove it in the trigger. When I checked "Destroy when depleted", the Trigger did not fire.