Unit remains in area ANY unit for side?

All discussions & material related to Command's Lua interface

Moderators: RoryAndersonCDT, michaelm75au, angster, MOD_Command

Post Reply
Whicker
Posts: 665
Joined: Tue Jun 19, 2018 9:54 pm

Unit remains in area ANY unit for side?

Post 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.
TyphoonFr
Posts: 188
Joined: Thu Nov 23, 2017 4:27 pm
Location: FRA
Contact:

RE: Unit remains in area ANY unit for side?

Post 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 ....
Christophe

To all English teachers of the forum, sorry if English is not my mother language.
Whicker
Posts: 665
Joined: Tue Jun 19, 2018 9:54 pm

RE: Unit remains in area ANY unit for side?

Post 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.
Parel803
Posts: 962
Joined: Thu Oct 10, 2019 3:39 pm
Location: Netherlands

RE: Unit remains in area ANY unit for side?

Post by Parel803 »

I was wondering if there is a value for TargetType so that all from that side is included.
regards GJ
KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

RE: Unit remains in area ANY unit for side?

Post 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.

Parel803
Posts: 962
Joined: Thu Oct 10, 2019 3:39 pm
Location: Netherlands

RE: Unit remains in area ANY unit for side?

Post by Parel803 »

Thank you, appriciated
regards GJ
Post Reply

Return to “Lua Legion”