golding on attack trigger

Ormagon

New Member
Reaction score
1
hey its me again umm i was wondering y this trigger doiesnt work

Code:
Golding
    Events
        Unit - A unit Is issued an order targeting an object
    Conditions
        (Unit-type of (Targeted unit)) Equal to Arcane Energy
        Or - Any (Conditions) are true
            Conditions
                ((Triggering unit) is A Hero) Equal to False
    Actions
        Player - Add 1 to (Owner of (Triggering unit)) Current gold
thx in advance for ut answers

and i want this trigger to give 1 gold to the player whos unit is ihtting the arcane energyfor every hit it does on it if im doing it wrong plsease post a trigger that would be right ty
 

Exide

I am amazingly focused right now!
Reaction score
448
First of all, your 'Or - multiple conditions' doesn't work, the way you use it, since one of the conditions is Outside of it. (Either put both conditions inside the Or function, or remove it completely.)

Also, try using a different event:

Code:
Unit - A unit Is attacked

with a suiting condition:

Code:
(Unit-type of (Triggering unit)) Equal to *Arcane Energy*
((attacking unit) is A Hero) Equal to False

and finally, since we changed the event, use this action:

Code:
Player - Add 1 to (Owner of (attacking unit)) Current gold

something like that.
 

Ormagon

New Member
Reaction score
1
the or cindition is fine because there are some unit i dunot want to be able to gold witch is the purpose of the or multi function he condition that is found outside is intentional since well its always there


Ty for the reply<3:thup:
 

Exide

I am amazingly focused right now!
Reaction score
448
Well, the "Main" conditions are 'And'.
So:

Code:
Conditions
    ((Triggering unit) is A Hero) Equal to True
    (Item-type of (Item being manipulated)) Equal to Objective

Would mean: If the First Condition AND the second condition is met, then run the trigger, else don't.

If you do it like this:

Code:
Conditions
    ((Triggering unit) is A Hero) Equal to True
    Or - Any (Conditions) are true
        Conditions
            (Item-type of (Item being manipulated)) Equal to Objective

Then the first Condition ((Triggering unit) is A Hero) Equal to True AND the second condtion Or - Any (Conditions) are true (meaning anything that's inside this function) has to be met, in order for the trigger to run.
So basically, it does the same thing. -Only with more lines.

It might be easier to see the difference of the triggers in JASS:

Trigger WITHOUT the Or - function:
JASS:

function Trig_Untitled_Trigger_002_Conditions takes nothing returns boolean
    if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true ) ) then
        return false
    endif
    if ( not ( GetItemTypeId(GetManipulatedItem()) == &#039;I00R&#039; ) ) then
        return false
    endif
    return true
endfunction

function Trig_Untitled_Trigger_002_Actions takes nothing returns nothing
endfunction

//===========================================================================
function InitTrig_Untitled_Trigger_002 takes nothing returns nothing
    set gg_trg_Untitled_Trigger_002 = CreateTrigger(  )
    call TriggerAddCondition( gg_trg_Untitled_Trigger_002, Condition( function Trig_Untitled_Trigger_002_Conditions ) )
    call TriggerAddAction( gg_trg_Untitled_Trigger_002, function Trig_Untitled_Trigger_002_Actions )
endfunction


Trigger WITH the Or - function:
JASS:

function Trig_Untitled_Trigger_002_Func002C takes nothing returns boolean
    if ( ( GetItemTypeId(GetManipulatedItem()) == &#039;I00R&#039; ) ) then
        return true
    endif
    return false
endfunction

function Trig_Untitled_Trigger_002_Conditions takes nothing returns boolean
    if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true ) ) then
        return false
    endif
    if ( not Trig_Untitled_Trigger_002_Func002C() ) then
        return false
    endif
    return true
endfunction

function Trig_Untitled_Trigger_002_Actions takes nothing returns nothing
endfunction

//===========================================================================
function InitTrig_Untitled_Trigger_002 takes nothing returns nothing
    set gg_trg_Untitled_Trigger_002 = CreateTrigger(  )
    call TriggerAddCondition( gg_trg_Untitled_Trigger_002, Condition( function Trig_Untitled_Trigger_002_Conditions ) )
    call TriggerAddAction( gg_trg_Untitled_Trigger_002, function Trig_Untitled_Trigger_002_Actions )
endfunction


See? :p
 

Ormagon

New Member
Reaction score
1
alright well i tested the trigger and well i there a way to make this same thing but in a way that wont get bused example i cn hit hold position like mad and my gold goes up Really fast so i was wondering if there is a way to put a cooldown on it

and yes i wanted them both to be met if teh trigger was to run
 

Exide

I am amazingly focused right now!
Reaction score
448
>and yes i wanted them both to be met if teh trigger was to run
-Exactly, that's why there's no need for the 'Or, multiple Conditions - function'.

I guess you could scrap that trigger and try using the Orc 'Pillage' Ability, and add to 'targets allowed' 'ground' and 'air'. Then add the ability to all units that you want. (Not sure if that works, never tested.)
 

Ormagon

New Member
Reaction score
1
im double posting s a bump so dont yell!

ok so i was thinking if i made an abllity based on heal that can be autocast and make it only attack enemy buildings will this work if i trigger it so that the abillity needs to be the 1 that has effect on the trget to gain 1 gold?

also the Or was thinking ahead for now there was 1 condition but i was gon add alot more
 

cleeezzz

The Undead Ranger.
Reaction score
268
why would your pillage need a cooldown, its a passive ability, not a trigger giving money when issued an order.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top