Help me with a trigger

leo120120

New Member
Reaction score
0
I want to do that when a Unit activates an ability, creates a destructible in that position and removes 1 of gold from the player (but if he don't have gold to pay it, he can't do it)

Please help me
 

Squishy

You can change this now in User CP.
Reaction score
127
Make your ability based off of Charge Gold and Lumber. Make the ability cost 1 gold. Then make a trigger that when the ability is cast, create your destructable at the target point of the ability being cast.
 

leo120120

New Member
Reaction score
0
I do what Squishy said, but it don't work, can anyone could help me??

this is the trigger that i have created:

Events
Unit-A unit begins Casting an ability

Conditions
(Ability being cast) Equal to Create a Barrel (the ability)

Actions
Destructible - Create a Barrel at (Position of (Casting unit)) facing (Random angle) with scale 1.00 and variation 0

somebody can help me?
 

jnZ

I
Reaction score
64
JASS:
TEST1
    Events
    Conditions
        Player[(Player Number Of Owner Of Triggering Unit) Gold) Greater Than or Equal To 1


is that the condition you are looking 4?
 

leo120120

New Member
Reaction score
0
nop, the cost of the barrel is in the ability, the problem is that when i use the ability, the barrel doesn't appear, but the cost of the skill is working. so probably the problem is on the trigger.

Any ideas?
 

Samael88

Evil always finds a way
Reaction score
181
I just tested that, and it worked for me.
You could try using a flying unit as caster, I think it can have something to do with the collision.
Code:
Create a Barrel
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Create a Barrel 
    Actions
        Set A = (Position of (Triggering unit))
        Destructible - Create a Barrel at A facing (Random angle) with scale 1.00 and variation 0
        Custom script:   call RemoveLocation(udg_A)

And btw you may want to destroy the leak by doing what I did above, A is a point variable.
 

leo120120

New Member
Reaction score
0
still don't working after make the unit flying and using the trigger

What ability have you used for doing that?? i used Charge lumber and gold, maybe that is the problem
 

Samael88

Evil always finds a way
Reaction score
181
I used channel as a dummy spell, and then added the gold cost to the object data of the spell.
 

Samael88

Evil always finds a way
Reaction score
181
here is an example map.
It did not work to add the gold cost to the data, so I added it to the trigger instead.
 

ShinyPickle

New Member
Reaction score
9
Wouldn't it be easier to make a trigger that removes the gold, but if he has no gold, the ability is unusable.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top