Hey everyone so i got a fairly simple question but cant figure it out. So i have creep have a 50% chance to drop items on death "Scrap Material". Now my hero can pick these up and use them anywhere. I want to make it were the hero is required to be next to a refinery to use them. heres all the triggers and data i use.
Events
Unit - Any Unit dies
Local Variables
Random Integer = 0 <Integer>
Conditions
(Owner of (Triggering unit)) == 11
Actions
Variable - Set Random Integer = (Random integer between 1 and 2)
General - If (Conditions) then do (Actions) else do (Actions)
If
Random Integer == 1
Then
Unit - Create 1 Scrap Material for player (Killing player) at (Position of (Triggering unit)) facing 270.0
degrees (No Options)
Then i have my unit (item), Item, and ability all setup. When the item is used it adds 1 vespian gas to player 11, whos resource pool is used for team creep upgrades.
So this trigger drops the item which can then be picked up and is put in the heros inventory. and i want the item to only be able to be used when the here is in a certain region which is going to have a refinery in it.
Thomm almost has it right. all you need is a if then else. you want to check that your hero is in a certain range or your refinery, or your hero is in a region, which you place around your refinery. Either of these options will work.
Rollback Post to RevisionRollBack
Current Project: Community Project
To post a comment, please login or register a new account.
Hey everyone so i got a fairly simple question but cant figure it out. So i have creep have a 50% chance to drop items on death "Scrap Material". Now my hero can pick these up and use them anywhere. I want to make it were the hero is required to be next to a refinery to use them. heres all the triggers and data i use.
Events
Unit - Any Unit dies
Local Variables
Random Integer = 0 <Integer>
Conditions
(Owner of (Triggering unit)) == 11
Actions
Variable - Set Random Integer = (Random integer between 1 and 2)
General - If (Conditions) then do (Actions) else do (Actions)
If
Random Integer == 1
Then
Unit - Create 1 Scrap Material for player (Killing player) at (Position of (Triggering unit)) facing 270.0
degrees (No Options)
Then i have my unit (item), Item, and ability all setup. When the item is used it adds 1 vespian gas to player 11, whos resource pool is used for team creep upgrades.
So this trigger drops the item which can then be picked up and is put in the heros inventory. and i want the item to only be able to be used when the here is in a certain region which is going to have a refinery in it.
Thanks for your continued help and resources.
@MrYourMom: Go
dont know what event but you have to make an if then else
thats all i know, hope i helped you
@thommiej: Go
Thomm almost has it right. all you need is a if then else. you want to check that your hero is in a certain range or your refinery, or your hero is in a region, which you place around your refinery. Either of these options will work.