Help making a trigger

bessomi

New Member
Reaction score
9
I am pretty lousy with triggers and so i need your help.

I need to make a trigger that does this.

A unit a comes within 100 range of unit b
Unit a has a specific item in his inventory.
Unit b does not have a specific item in his inventory.

Unit b is given that item and that item is removed from unit a.

Its the comes within range of unit part that confuses me.

Thanks in return.
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
Code:
              Events- Unit comes within so and so range of your unit
              Conditions- Or Any conditions true -
              - One unit has this
              - One unit has this
              Actions - If/then
              - Check for the people's items again but see if only one has
 

TfauxT

New Member
Reaction score
2
Events - A unit comes within 100 range of (unit B)
Conditions - unit type of triggering unit is (Unit A)
unit has item of type (your item) in inventory
Actions - item - order (unit A) to give item of type (youritem) to (unit B)


Hope this helps :thup:
 

AoW_Hun7312

I'm a magic man, I've got magic hands.
Reaction score
76
Code:
Trigger
    Events
        Unit - A unit comes within 256.00 of YourUnit <gen>
    Conditions
    Actions
        For each (Integer A) from 1 to 6, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Item-type of (Item carried by (Last created unit) in slot (Integer A))) Equal to Tome of Experience
                    Then - Actions
                        (DoYourActionsHere)
                    Else - Actions
 

bessomi

New Member
Reaction score
9
The unit is not in the map and cannot be chosen when making the event just like that.

That is what complicates the whole thing
 

Lightstalker

New Member
Reaction score
55
Set the unit to a variable?

You can't.

What you'll have to do is make 3 triggers.

One for when the unit aquires the item, where all you will do is assign the unit who aquires the item to a variable.

One for when the unit loses the item where you will set the variable to null. (if the item is ALWAYS going to be carried by someone, then you won't need this)

And one with a periodic event trigger, where you will pick every unit within range of the unit to which you assigned the variable.

If you need more help, just tell me.
 

Lightstalker

New Member
Reaction score
55
Attached is a map with triggers.

There is a unit group and a point leak. If that's not what you wanted, tell me.
 
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