Trigger help with ownership effect.

Haxxors

New Member
Reaction score
1
Im encountering another problem :(

Basically, when a player controls a certain building, i want to give them a buff, such as a passive 5% damage bonus for all units. First I created a custom spell (a modified command aura that gives 5% damage bonus).

I want it to work like this -

1. A player controls Certain Building
2. Once they control it all their units get the 5% damage bonus.
3. If another player takes control of that unit they get the 5% bonus, and the player that previously had the bonus loses it.

This is what I was able to come up with, and it sucks lol. In this case, the building is Mount Kilimanjaro.

Code:
Kilimanjaro Bonus
    Events
    Conditions
        (Owner of Mount Kilimanjaro Control 0011 <gen>) Equal to Player 1 (Red)
    Actions
        Player - Enable Kilomanjaro Bonus  for Player 1 (Red)


Also the "Kilomanjaro Bonus" is the spell that adds 5% damage bonus"
 

eXirrah

New Member
Reaction score
51
I think your trigger should look like this
Trigger:
  • Untitled Trigger 002
    • Events
      • Unit - A unit Changes owner
    • Conditions
      • (Triggering unit) Equal to Mount Kilimanjaro Control 0011 &lt;gen&gt;
    • Actions
      • Set TempForce = (All players matching ((Matching player) Not equal to (Owner of (Triggering unit))))
      • Player - Enable Kilomanjaro Bonus for (Owner of (Triggering unit))
      • Player Group - Pick every player in TempForce and do (Actions)
        • Loop - Actions
          • Player - Disable Kilomanjaro Bonus for (Picked player)
      • Custom script: call DestroyForce(udg_TempForce)
 

Haxxors

New Member
Reaction score
1
Call me bad but, I cant find out how to do the Tempforce thing :O

Sorry lol.

Thank you for your help though!
 

mgsfan18

New Member
Reaction score
1
I am not sure but I think the tempforce is a variable.

All I am basing this guess on is the little icon is a green x which is what the create new variable icon sort of looks like...lol i realize that probably didn't help much


sorry I type slow
 

Haxxors

New Member
Reaction score
1
It is a variable. I just dont understand how they work :/ this whole part of the trigger confuses me.

Set TempForce = (All players matching ((Matching player) Not equal to (Owner of (Triggering unit))))
 

squorpion

New Member
Reaction score
12
It is a variable. I just dont understand how they work :/ this whole part of the trigger confuses me.

Set TempForce = (All players matching ((Matching player) Not equal to (Owner of (Triggering unit))))

here in easy steps...
1)create a vaible
2)select player in the list of variable types
3)leave array unchecked
4)press ok
5)right click actions and create new action. then select all and find set variable
6)set up the trigger he showd you

if you don't understand it like that. well your hopeless then XD
 

Haxxors

New Member
Reaction score
1
here in easy steps...
1)create a vaible
2)select player in the list of variable types
3)leave array unchecked
4)press ok
5)right click actions and create new action. then select all and find set variable
6)set up the trigger he showd you

if you don't understand it like that. well your hopeless then XD


Well this is what i was able to get it to.

There is just one part I cannot get right.


instead of

Set Tempforce = (All players matching ((Owner of (Matching unit)) Not equal to (Owner of (Triggering unit))))

it needs to be

Set Tempforce = (All players matching ((Matching player)) Not equal to (Owner of (Triggering unit))))

Code:
Kilomanjaro Bonus
    Events
        Unit - A unit Changes owner
    Conditions
        (Triggering unit) Equal to Mount Kilomanjaro Control 0011 <gen>
    Actions
        Set Tempforce = (All players matching ((Owner of (Matching unit)) Not equal to (Owner of (Triggering unit))))
        Player - Disable Kilomanjaro Bonus  for (Owner of (Triggering unit))
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                Player - Disable Kilomanjaro Bonus  for Player 1 (Red)
        Custom script:   call DestroyForce(udg_TempForce)
 

bOb666777

Stand against the ugly world domination face!
Reaction score
117
Every time i try to test the trigger this part gives an error



Custom script: call DestroyForce(udg_TempForce)


Make sure your force variable is named TempForce

And about your problem, you could just give THAT building the command aura you made
Aura buffs automatically disappear when the aura giving unit dies or changes owner
 

Sajberhippie

New Member
Reaction score
30
Just give the aura to the building, and make sure it's radius is enough (if over the whole level, press shift+enter when the radius field is selected and put in like 9999999)
 

bOb666777

Stand against the ugly world domination face!
Reaction score
117
Just give the aura to the building, and make sure it's radius is enough (if over the whole level, press shift+enter when the radius field is selected and put in like 9999999)

Exactly. Like I said, auras automatically give the buff/remove it when the unit with the said aura is owned by an ally of the owner of the other units and is close enought. Just get rid of the checking if its close enought by making the radius mapwide.
 

eXirrah

New Member
Reaction score
51
Well this is what i was able to get it to.

There is just one part I cannot get right.


instead of

Set Tempforce = (All players matching ((Owner of (Matching unit)) Not equal to (Owner of (Triggering unit))))

it needs to be

Set Tempforce = (All players matching ((Matching player)) Not equal to (Owner of (Triggering unit))))

My bad it really needs to be Set Tempforce = (All players matching ((Matching player)) Not equal to (Owner of (Triggering unit))))

@bOb666777: This is not right man.... if the aura is set to Targets allowed Friedn then it will affect all allied players as well. If I'm not mistaken there is an option that you can select Targets allowed : Player I believe that this will make the aura affect only the units owned by the player owning the unit with the aura ....

EDIT: Btw in GUI it is Player Group ... but in JASS it is force so instead of making 2 variables TempUnitGroup and TempPlayerGroup I create TempGroup and TempFroce. Unit Group in JASS goes for just group
 
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