I've got an Infiltration type game coming up, and it's a really simple one.
You get a regular Ghost, with a few modifications such as only 3 Snipe Charges, no EMP, and the rest is regular.
I've got the gun alert down, if the Ghost uses his regular weapon he alerts the base. But the Snipe won't because it's "Silenced".
Anyways, I need to make it so that if a unit controlled by the computer is in the vision radius of another unit killed by "Snipe".
He'll run to a designated point and activate the alarms.
I've got everything down except how to check whether he's in the vision radius or not.
Then you can make a similiar event however i'd just make a trigger that'd check whether or not after you use snipe that another guard is nearby. The tricky part is that you need to make sure that the unit is visible to the other unit. Try checking to see if you can make a condition that checks if a point is visible to the other unit. that would be the best way to check.
RayzeTehaluRmEventsUnit-AnyUnitdiesLocalVariablesConditions(Killingunit)==TehNindjuhghsotActionsUnitGroup-Pickeachunitin(Anyunitsin(Region((Positionof(Triggeringunit)),8.0))ownedbyplayer(Triggeringplayer)matchingExcluded:Missile,Dead,Hidden,withatmostAnyAmount)anddo(Actions)ActionsGeneral-If(Conditions)thendo(Actions)elsedo(Actions)If(Unittypeof(Pickedunit))==Spehhsmuhreensekuritygard(Pickedunit)!=(Triggeringunit)ThenUnit-Order(Pickedunit)to(ScanMovetargeting(Positionof(Triggeringunit)))(ReplaceExistingOrders)General-Waitfor(Conditions),checkingevery0.5GameTimeseconds,fornolongerthan5.0secondsConditions(Distancebetween(Positionof(Pickedunit))and(Positionof(Triggeringunit)))<=1General-If(Conditions)thendo(Actions)elsedo(Actions)If((Pickedunit)isalive)==True(Distancebetween(Positionof(Pickedunit))and(Positionof(Triggeringunit)))<=1Then------- RAYZE TEH ALURMS MEN THARS A SKALLYWEG ON DEKElseElse
UntitledTrigger001EventsUnit-AnyUnitEnters(Entiremap)LocalVariablesConditions(Ownerof(Triggeringunit))==2ActionsUnitGroup-Add(Triggeringunit)toEnemyUnitsUntitledTrigger002EventsUnit-AnyUnitdiesLocalVariablesConditions(Ownerof(Triggeringunit))==2ActionsUnitGroup-Remove(Triggeringunit)fromEnemyUnitsUnitGroup-PickeachunitinEnemyUnitsanddo(Actions)ActionsGeneral-If(Conditions)thendo(Actions)elsedo(Actions)IfAndConditions(Closestunitto(Positionof(Triggeringunit))inEnemyUnits)==(Pickedunit)(Distancebetween(Positionof(Triggeringunit))and(Positionof(Pickedunit)))<=8.0Then------- SOUND THE ALARM!Else
Trigger 001 - Is for adding any unit on map owned by Player 2 To the Enemy Units unit group.
Trigger002 - Is a little more complex and actually took me awhile to figure out. Basically, when any unit dies and is owned by Player 2, it removes that unit from the Enemy Units unit group.
This is because if you don't, then the first condition below (Which finds the closest unit to the unit that died within that unit group) will just return the unit that died as the closest unit to the unit that died.
The second condition checks if the distance between the killed unit and the closest unit to the killed is less than or equal to 8. By doing this we can adjust the value of 8 to what we believe would make the closest unit within vision of the killed unit, since if the closest unit isn't in vision, none of them are.
If all equals true...
Then - SOUND THE ALARM.
Added a map to demonstrate if needed.
IMPORTANT - Make sure any of the units that are going to be triggering this trigger have a Death Time of 1 or more. This is because if the Death Time is set to 0, the unit will be gone before the trigger can do it's work. You can change the Death Time of a unit within the Data Editor under the Unit tab.
I hope that people will enjoy Ghost Infiltration, I'll eventually upload a map here for people to study.
-Example maps always help when learning the Editor.
I've got an Infiltration type game coming up, and it's a really simple one.
You get a regular Ghost, with a few modifications such as only 3 Snipe Charges, no EMP, and the rest is regular.
I've got the gun alert down, if the Ghost uses his regular weapon he alerts the base. But the Snipe won't because it's "Silenced".
Anyways, I need to make it so that if a unit controlled by the computer is in the vision radius of another unit killed by "Snipe". He'll run to a designated point and activate the alarms.
I've got everything down except how to check whether he's in the vision radius or not.
Than, in another trigger you can use the Boolean in an If Than Else to only alert if true.
Thank you very much.
Also; Can I apply this same concept to a killed unit, to make the effect of an allied unit seeing the unit get killed by the Ghost??
@Alnatair: Go
Are they preplaced or trigger added units.
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
Preplaced.
Then you can make a similiar event however i'd just make a trigger that'd check whether or not after you use snipe that another guard is nearby. The tricky part is that you need to make sure that the unit is visible to the other unit. Try checking to see if you can make a condition that checks if a point is visible to the other unit. that would be the best way to check.
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
Something like this should work:
@Alnatair: Go
Trigger 001 - Is for adding any unit on map owned by Player 2 To the Enemy Units unit group.
Trigger002 - Is a little more complex and actually took me awhile to figure out. Basically, when any unit dies and is owned by Player 2, it removes that unit from the Enemy Units unit group.
This is because if you don't, then the first condition below (Which finds the closest unit to the unit that died within that unit group) will just return the unit that died as the closest unit to the unit that died.
The second condition checks if the distance between the killed unit and the closest unit to the killed is less than or equal to 8. By doing this we can adjust the value of 8 to what we believe would make the closest unit within vision of the killed unit, since if the closest unit isn't in vision, none of them are.
If all equals true...
Then - SOUND THE ALARM.
Added a map to demonstrate if needed.
IMPORTANT - Make sure any of the units that are going to be triggering this trigger have a Death Time of 1 or more. This is because if the Death Time is set to 0, the unit will be gone before the trigger can do it's work. You can change the Death Time of a unit within the Data Editor under the Unit tab.
Awe, you all beat me to the punch. :P
Thank you so much, this really helps. ^_^
I hope that people will enjoy Ghost Infiltration, I'll eventually upload a map here for people to study. -Example maps always help when learning the Editor.
Again, thanks guys!