Start trigger when any unit owned by player 15 goes within 20.0 yards of the playerUnit owned by player 1.
Check if playerUnit is alive.
Check if torch variable is true.
If true, the player 15 unit is issued to attack the playerUnit.
If false, do nothing.
Something to take in consideration is there will be up to 12 players. The basic idea is if the playerUnit has their flashlight turned on the enemy will detect them from a further distance.
I don't know how to make it into a trigger. I did say "I want to make a trigger that does this:"
Oh but you do and you've gone it perfectly. The way that you've stated it is exactly how you should be thinking about how its made. IE
1.Start trigger when any unit owned by player 15 goes within 20.0 yards of the playerUnit owned by player 1.
- Obviously the first part of the event of the trigger. Event will be unit events range of unit. The "player 15" owner is something that you can check in the conditions
2.Check if playerUnit is alive.
-If there is something your looking for or want to restrict the even it is done in the conditions
3.Check if torch variable is true.
-Again in conditions
4.If true, the player 15 unit is issued to attack the playerUnit.
-The only real things the unit is going to do and thus the "action"
5.If false, do nothing.
-All part of why you have conditions which tell the trigger the only run if they are met otherwise it doesn't go.
Oh but you do and you've gone it perfectly. The way that you've stated it is exactly how you should be thinking about how its made. IE
1.Start trigger when any unit owned by player 15 goes within 20.0 yards of the playerUnit owned by player 1. - Obviously the first part of the event of the trigger. Event will be unit events range of unit. The "player 15" owner is something that you can check in the conditions
Because this is a multiplayer map I needed to figure out how to make it so. I wanted to ask how to get the unit that has the distance and figured it was "Triggering range unit". This is what I came up with with the Action selected:
Going to test it...
It doesn't work. My guess is the (Triggering range unit) in the Event is what's wrong.
Your using both "triggering range unit" as well as "playerUnit" which should be the same unit; and i would also guess one or neither of these are setup from the others triggers you have.
Your using both "triggering range unit" as well as "playerUnit" which should be the same unit; and i would also guess one or neither of these are setup from the others triggers you have.
Your first sentence: am I doing something wrong or are you just pointing out they should be the same thing?
What do you mean "I would also guess one or neight of these..."? This is one trigger. Are you seeing if I turn on this trigger via action from the Map Initialization trigger?
If I try to change the event's Triggering range unit to playerUnit, I cannot. The variable does not show up.
Triggering range unit should not be used in the event. The event creates the definition for triggering range unit, using that unit inside the event will break the entire thing because it hasn't been defined yet.
It's like asking if John got into Bob's car, but you have no idea who Bob is or what his car looks like...so how the hell should you know?
The reason the playerUnit variable does not show up is because events can only activate using constants. You will have to set it to 'any unit' which is either in normal functions or presets, and then check to see if it is the correct unit in the conditions.
Alright well, looking at it I can't find any way to set the range unit to any unit, so you have to use a specific unit. Worse is that I can't find any way to do that without giving it a specific value (meaning it has to be on the map when the game starts).
I tried using a unit from unit group, and using a unit from a data table...but it doesn't seem to do anything. Using the unit value itself worked though.
You may be better off doing something with a region, say, attaching it to a unit and then checking when a unit enters that region instead.
The region should be on the marine and not the automatron and make the automatron attack the marine. Basically I want the torch or flashlight to attract enemies while it is turned on, but turned off reduces everything to being dark (enough to barely see). I will be testing it out on my map now.
Update: I must be doing something wrong because it won't have the triggering unit attack the playerUnit.
Alright well, looking at it I can't find any way to set the range unit to any unit, so you have to use a specific unit. Worse is that I can't find any way to do that without giving it a specific value (meaning it has to be on the map when the game starts).
I tried using a unit from unit group, and using a unit from a data table...but it doesn't seem to do anything. Using the unit value itself worked though.
You may be better off doing something with a region, say, attaching it to a unit and then checking when a unit enters that region instead.
The description for Triggering range unit says it is the unit that the radius starts from rather than the entering unit.
I had a look too. It very weird that you can set things like unit group in the event and its register fine but simple does work for the event. Looks like there's no way trigger wise to do this if the unit is not preplaced (or even a region for that matter). Triggering range unit or anything "triggering"of course can't be used in an event
I think the next step would be to instead to just simply run an action definition with some type of looping check that you apply when the unit is created in the original trigger. In most cases I don't even use unit enters triggers at all as its often better to just do things via definitions.
I had a look too. It very weird that you can set things like unit group in the event and its register fine but simple does work for the event. Looks like there's no way trigger wise to do this if the unit is not preplaced (or even a region for that matter). Triggering range unit or anything "triggering"of course can't be used in an event
I think the next step would be to instead to just simply run an action definition with some type of looping check that you apply when the unit is created in the original trigger. In most cases I don't even use unit enters triggers at all as its often better to just do things via definitions.
Since the map is a TPS and uses a periodic trigger for movement, I'll try to add the trigger in it. I will be publishing the map here soon and test it with a RL friend to see how the lag is. I used the camera setting that sets maximum viewing distance to a low number (30) and had the fog black with adjusted fields.
I am wanting to make a trigger that does this:
Something to take in consideration is there will be up to 12 players. The basic idea is if the playerUnit has their flashlight turned on the enemy will detect them from a further distance.
Does playerUnit move around, or is it sitting still?
It is moving around.
@admielke: Go
You're not saying what the issue is. Seems to me you know what you want.
I don't know how to make it into a trigger. I did say "I want to make a trigger that does this:"
Is playerunit a variable or a preset unit.
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
Oh but you do and you've gone it perfectly. The way that you've stated it is exactly how you should be thinking about how its made. IE
1.Start trigger when any unit owned by player 15 goes within 20.0 yards of the playerUnit owned by player 1. - Obviously the first part of the event of the trigger. Event will be unit events range of unit. The "player 15" owner is something that you can check in the conditions
2.Check if playerUnit is alive. -If there is something your looking for or want to restrict the even it is done in the conditions
3.Check if torch variable is true. -Again in conditions
4.If true, the player 15 unit is issued to attack the playerUnit. -The only real things the unit is going to do and thus the "action"
5.If false, do nothing. -All part of why you have conditions which tell the trigger the only run if they are met otherwise it doesn't go.
Variable made in a Map Initialization trigger.
Because this is a multiplayer map I needed to figure out how to make it so. I wanted to ask how to get the unit that has the distance and figured it was "Triggering range unit". This is what I came up with with the Action selected:
Going to test it... It doesn't work. My guess is the (Triggering range unit) in the Event is what's wrong.
@admielke: Go
Your using both "triggering range unit" as well as "playerUnit" which should be the same unit; and i would also guess one or neither of these are setup from the others triggers you have.
Your first sentence: am I doing something wrong or are you just pointing out they should be the same thing?
What do you mean "I would also guess one or neight of these..."? This is one trigger. Are you seeing if I turn on this trigger via action from the Map Initialization trigger?
If I try to change the event's Triggering range unit to playerUnit, I cannot. The variable does not show up.
Triggering range unit should not be used in the event. The event creates the definition for triggering range unit, using that unit inside the event will break the entire thing because it hasn't been defined yet.
It's like asking if John got into Bob's car, but you have no idea who Bob is or what his car looks like...so how the hell should you know?
The reason the playerUnit variable does not show up is because events can only activate using constants. You will have to set it to 'any unit' which is either in normal functions or presets, and then check to see if it is the correct unit in the conditions.
Alright well, looking at it I can't find any way to set the range unit to any unit, so you have to use a specific unit. Worse is that I can't find any way to do that without giving it a specific value (meaning it has to be on the map when the game starts).
I tried using a unit from unit group, and using a unit from a data table...but it doesn't seem to do anything. Using the unit value itself worked though.
You may be better off doing something with a region, say, attaching it to a unit and then checking when a unit enters that region instead.
I made a quick sample map you can look at.
@rtschutter: Go
Thats what I ended up doing for my maps when i had this problem.
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
The region should be on the marine and not the automatron and make the automatron attack the marine. Basically I want the torch or flashlight to attract enemies while it is turned on, but turned off reduces everything to being dark (enough to barely see). I will be testing it out on my map now.
Update: I must be doing something wrong because it won't have the triggering unit attack the playerUnit.
Interresting, I didnt know that its possible to get the triggering range unit. :)
When adding a unit enters range of unit event and looking at its hint text (the "documentation") it doesnt mention this either. :(
I always worked around this issue by dynamically attaching regions to units and adding event handlers via custom script.
The description for Triggering range unit says it is the unit that the radius starts from rather than the entering unit.
@rtschutter: Go
I had a look too. It very weird that you can set things like unit group in the event and its register fine but simple does work for the event. Looks like there's no way trigger wise to do this if the unit is not preplaced (or even a region for that matter). Triggering range unit or anything "triggering"of course can't be used in an event
I think the next step would be to instead to just simply run an action definition with some type of looping check that you apply when the unit is created in the original trigger. In most cases I don't even use unit enters triggers at all as its often better to just do things via definitions.
Since the map is a TPS and uses a periodic trigger for movement, I'll try to add the trigger in it. I will be publishing the map here soon and test it with a RL friend to see how the lag is. I used the camera setting that sets maximum viewing distance to a low number (30) and had the fog black with adjusted fields.
@admielke: Go
Do it in a seperate threaded definition. I would also stray away from the periodic trigger and also put that in a threaded definition with a loop.