Page 1 of 1

Unit remains in area ANY unit for side?

Posted: Sun Aug 12, 2018 6:57 pm
by Whicker
I'd like to create a unit remains in area trigger via lua, but have it set to any unit for the side without specifying the target type - ie AC/Ship/Sub/Facility etc. Is this possible?

Here is what I would like to do - targetType = 0 means any type of unit I think.
ScenEdit_SetTrigger({mode="add",type='UnitRemainsInArea',name="testtrigger2", targetfilter={TargetType = '0' , TargetSide="A"},area={1,2,3,4},TD=25})

I'm pretty sure that TargetType = 0 is what I want - if I make a trigger manually and then look at it in the lua console that is what it is, but if I try to create one with TargetType = 0 it errors - `ScenEdit_SetTrigger 0 : ,Error in TargetFilter.Type!`. Same code but with TargetType = 1 works, so does 2,3,4.

I'm modifying Angster/Typhoon/Gunners downed pilot script to allow pickup by any type of unit, since I can't get TargetType = 0 to work I making 4 different triggers for every downed pilot. Seems like too much when there could just be 1 set to any unit. Weapons and satellites wouldn't matter as they would be going to fast anyways.

RE: Unit remains in area ANY unit for side?

Posted: Sun Aug 12, 2018 9:23 pm
by TyphoonFr
I think about it, but your pilot is a unit of type Facility that is already in the zone, so he will save himself alone ....

RE: Unit remains in area ANY unit for side?

Posted: Sun Aug 12, 2018 11:49 pm
by Whicker
yes, that would have happened... I've made a lot of changes, will post it soon. Would be nicer if there was a way to do it with 1 trigger rather than the 4 I have just to keep it cleaner. It works fine though.

RE: Unit remains in area ANY unit for side?

Posted: Mon Nov 22, 2021 3:17 pm
by Parel803
I was wondering if there is a value for TargetType so that all from that side is included.
regards GJ

RE: Unit remains in area ANY unit for side?

Posted: Tue Nov 23, 2021 12:25 pm
by KnightHawk75
ORIGINAL: Parel803

I was wondering if there is a value for TargetType so that all from that side is included.
regards GJ
Leaving it blank.

HOWEVER keep in mind when doing that I believe the specific trigger processing for that trigger still stops for that pulse on the 'first' hit/match of the trigger during the pulse, so it can get tricky depending on specifics. ie.. trigger-on-unit-in-area-anything-on-red side. If any red unit is inside it will fire, but only on the first matching unit (unpredictable if more than one unit matches the criteria which unit it will fire on) during processing cycle.


RE: Unit remains in area ANY unit for side?

Posted: Wed Nov 24, 2021 12:49 pm
by Parel803
Thank you, appriciated
regards GJ