- Reaction score
- 1,710
This is the code: (Can you see this secret message?)
This is what happens:
----------------------
Okay, so I added these actions in the conditions. They are boldfaced and colored.
Unit[Integer(CTshop)] and Unit[Integer(Tshop)] are the coins in the picture.
But it doesn't work like it used to be.
================
Question: How do you set it up, so that the custom ability can be activated only when the unit is near the coins?
Or
How do you set it up so that when someone presses the ability button, and that unit has an arrow above its head, it would pop up a prompt?
Code:
Show
Events
Unit - A unit Begins casting an ability
Conditions
(Casting unit) Equal to Unit[(Player number of (Triggering player))]
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Ability being cast) Equal to BuyCT
Then - Actions
Dialog - Show Dialog[1] for (Owner of (Casting unit))
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Ability being cast) Equal to BuyT
Then - Actions
Dialog - Show Dialog[2] for (Owner of (Casting unit))
Else - Actions
This is what happens:
----------------------
Okay, so I added these actions in the conditions. They are boldfaced and colored.
Unit[Integer(CTshop)] and Unit[Integer(Tshop)] are the coins in the picture.
Code:
Show
Events
Unit - A unit Begins casting an ability
Conditions
(Casting unit) Equal to Unit[(Player number of (Triggering player))]
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Ability being cast) Equal to BuyCT
[COLOR="RoyalBlue"](Distance between (Position of Unit[(Integer(CTshop))]) and (Position of (Casting unit))) Less than or equal to 700.00[/COLOR]
Then - Actions
Dialog - Show Dialog[1] for (Owner of (Casting unit))
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Ability being cast) Equal to BuyT
[COLOR="RoyalBlue"](Distance between (Position of Unit[(Integer(Tshop))]) and (Position of (Casting unit))) Less than or equal to 700.00[/COLOR]
Then - Actions
Dialog - Show Dialog[2] for (Owner of (Casting unit))
Else - Actions
But it doesn't work like it used to be.
================
Question: How do you set it up, so that the custom ability can be activated only when the unit is near the coins?
Or
How do you set it up so that when someone presses the ability button, and that unit has an arrow above its head, it would pop up a prompt?