if someone knows a trigger?

vexoh

Member
Reaction score
0
I need some triggers for a few things..

1. how do i make a unit be removed once he builds a certain building.. I tried to do this but when i click the building and am about to place it, the wisp is removed and also when i go into water or near a gold mine the wisp is removed.. :(

2.how can i set a trigger so that when a certain unit reaches certain ammount of HP he does an ability?

3. i set a trigger for 3 units to appear in my map when my building casts an ability but i dont want them to just appear, is their any way i can make them walk through a portal or atleast make it look like they where teleported their, And not just appeared

4. How can i ake a message appear where a unit enters specific area on my map and it says -Entering Murky swamp- and when they leave -Leaving Murky swamp- and i want the message to be sent to player entering not all the players ingame.

Any help will be awsome!!! Ty.
(4) is most important question ;P
 

jnZ

I
Reaction score
64
1:
not sure. is there a finished construction event? can't check right now since i don't have WE

2:
Code:
Event: Generic Unit Event - A Unit Takes Damage
Conditions: Integer Comparison - Unit - Life of Unit < 100
Actions: XXX

3:
Code:
Create Special Effect At Point
Create Unit At Point
Destroy Speciall Effect

4:
Code:
Event: A Unit Enters Region
Condition: Region Contains Unit: Swamp,Triggering Unit
Actions: Game - Text Message To All "Entering Swamp"
 

Xan_Kriegor

I can change this now in User CP.
Reaction score
12
(1) There should be an event for Unit - Finishes constructing a building. Try using that and see if it works.

(2) There are a few ways to do this, most of them somewhat complicated. The easiest one I can think of is simple, but also probably not what you want because it will spam the ability. What you would do is add any units you want to do this in a unit group, and then periodically do Pick all units in (group) If HP is less than *amount* then order picked unit to cast *ability* else do nothing. This will also only work if it's a targetless ability (such as Warstomp) unless you add in a way for it to target a nearby unit. The problem with this way is that it will spam the ability whenever the unit is low on health and the cooldown refreshes until it runs out of mana. Feel free to use this, but unless someone comes up with a better set-up this doesn't seem desirable.

(3) If you want to use a portal, I'd suggest making a dummy unit with the portal as its model, play the birth/death animation, and then spawn your units. Alternatively, if you want them to fade in, I'd put them in a unit group, set their transparency to 100%, and periodically set it lower (say every .05 seconds decrease transparency by 4%) would be my suggestion.

Hope this helps, and good luck with your map! EDIT: Curses, I knew I was going to get ninja'd.
 

jnZ

I
Reaction score
64
(2) There are a few ways to do this, most of them somewhat complicated. The easiest one I can think of is simple, but also probably not what you want because it will spam the ability. What you would do is add any units you want to do this in a unit group, and then periodically do Pick all units in (group) If HP is less than *amount* then order picked unit to cast *ability* else do nothing. This will also only work if it's a targetless ability (such as Warstomp) unless you add in a way for it to target a nearby unit. The problem with this way is that it will spam the ability whenever the unit is low on health and the cooldown refreshes until it runs out of mana. Feel free to use this, but unless someone comes up with a better set-up this doesn't seem desirable.

you could control that by the mana cost of the ability, ability cooldown or by setting the custom value of a unit who used an ability via this trigger to 0 and add a condition to the trigger to only run when custom value != 0
 

vexoh

Member
Reaction score
0
1:


4:
Code:
Event: A Unit Enters Region
Condition: Region Contains Unit: Swamp,Triggering Unit
Actions: Game - Text Message To All "Entering Swamp"
That wont work, because if i leave the swamp in the same direction it will say "entering swamp"
 

jnZ

I
Reaction score
64
thats just the simple version. something like that can be achieved by another region next to it and a simple variable.

but iam not up to date concerning the editor. there might even be an event like "unit leaves region"
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
1). Is your intended effect the same as when a wisp disappears after building an ancient? Or do you want the builder to disappear once the building starts construction?

2). If it's just one unit, there's the Unit - Life event that detects when a unit's life changes to above, below or equal to a certain value. If you have more than one units, create a dummy trigger with no events, then pick all your units and add their events to the dummy trigger with the Trigger - Add Event action.

4).
Trigger:
  • Entering Swamp
    • Events
      • Unit - A unit enters Swamp &lt;gen&gt;
    • Conditions
    • Actions
      • Game - Display to (Player group((Owner of (Triggering unit)))) the text: Entering Swamp.

Trigger:
  • Leaving Swamp
    • Events
      • Unit - A unit leaves Swamp &lt;gen&gt;
    • Conditions
    • Actions
      • Game - Display to (Player group((Owner of (Triggering unit)))) the text: Leaving Swamp.
 

vexoh

Member
Reaction score
0
1). Is your intended effect the same as when a wisp disappears after building an ancient? Or do you want the builder to disappear once the building starts construction?

2). If it's just one unit, there's the Unit - Life event that detects when a unit's life changes to above, below or equal to a certain value. If you have more than one units, create a dummy trigger with no events, then pick all your units and add their events to the dummy trigger with the Trigger - Add Event action.

4).
Trigger:
  • Entering Swamp
    • Events
      • Unit - A unit enters Swamp &lt;gen&gt;
    • Conditions
    • Actions
      • Game - Display to (Player group((Owner of (Triggering unit)))) the text: Entering Swamp.

Trigger:
  • Leaving Swamp
    • Events
      • Unit - A unit leaves Swamp &lt;gen&gt;
    • Conditions
    • Actions
      • Game - Display to (Player group((Owner of (Triggering unit)))) the text: Leaving Swamp.

Ok i just want the wisp to dissapear during or after construction either are fine. And for (4) it wont work, Because say i have an area thats Shaped as a triangle which i have... I cant place just 1 Region because regions can only be shaped as a square I would need to place several regions and that wont work
 

jnZ

I
Reaction score
64
just do it the way i told you

for example

X 1 X
2 O X
X 3 X

thats the "swamp" area with 3 entrances (doesn't have to be rectangular)

create 2 regions next to each other at every entrance. the inner region is SwampEnter and the outer one is SwampExit. make sure the unit has to walk over the region when entering/leaving the swamp.

the rest is triggered

trigger 1 (unit enters swamp)
Code:
Event: 
Unit Enters Region: SwampEnter1
Unit Enters Region: SwampEnter2
Unit Enters Region: SwampEnter3

Conditions: 
SwampEntered = false

Actions:
Game - Text Message: Entered Swamp
set SwampEntered = true

trigger 2 (unit exits swamp)
Code:
Event: 
Unit Enters Region: SwampExit1
Unit Enters Region: SwampExit2
Unit Enters Region: SwampExit3

Conditions: 
SwampEntered = true

Actions:
Game - Text Message: Exited Swamp
set SwampEntered = false

SwampEntered is a global boolean variable

EDIT: things like that are the most basic logical solutions. people here took their time to give you the right pieces i think you could at least try to puzzle them together to get your answer
 
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