ScenEdit_SetSidePosture

All discussions & material related to Command's Lua interface

Moderators: RoryAndersonCDT, michaelm75au, angster, MOD_Command

Post Reply
DavidRN
Posts: 91
Joined: Tue Jan 17, 2023 8:41 pm

ScenEdit_SetSidePosture

Post by DavidRN »

Hi

I used the Lua scripting as below to set side posture in a area defined by RP's

ScenEdit_SetSidePosture("Hostage Ship", "JMSDF", "F")
inArea=({'RP-69', 'RP-70', 'RP-71', 'RP-72'})

Seems to work okay as I did a test run and the hostage ship changed from hostile towards the JMSDF to friendly, when a JMSDF helicopter entered the area, only knew this when editing sides and saw the change, the hostage ship remained red.

Is there any way I can change the color at the time of change in side posture? e.g red to blue

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

Re: ScenEdit_SetSidePosture

Post by Parel803 »

Good evening,

Not an answer but I had something simulare with change side, and with that the posture.
Contact stayed in the original color. After deleting the contact it came back in the correct color.
I can look for what I did if required.

best regards GJ
DavidRN
Posts: 91
Joined: Tue Jan 17, 2023 8:41 pm

Re: ScenEdit_SetSidePosture

Post by DavidRN »

Parel803 wrote: Fri Jan 20, 2023 1:44 pm Good evening,

Not an answer but I had something simulare with change side, and with that the posture.
Contact stayed in the original color. After deleting the contact it came back in the correct color.
I can look for what I did if required.

best regards GJ
That would be good if could.

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

Re: ScenEdit_SetSidePosture

Post by Parel803 »

DavidRN,

I have to apologize. Cannot get it as I thought I saw it. My contact that change side with posture to new. In pause game you see at that moment two contact, looks like, and the (in my case friendly) stays on when pressing play.
I'm on latest beta. And tried to simulate boarding ops.

regards GJ
KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

Re: ScenEdit_SetSidePosture

Post by KnightHawk75 »

Is there any way I can change the color at the time of change in side posture? e.g red to blue

If I understand this correct...and I might not...
You change some stuff from hostile to friendly (but not the side membership), but you have a lingering perhaps duplicate hostile contact object still around and you want to remove it? Yes you can remove that contact via getting the contact object and invoking :delete(). You can find that various ways, usually if you already have the real units object wrapper peeking into .ascontact table, and grabbing the contactguid that matches the sideguid you want it removed from, assuming this is a duplicate at same exact location issue. I can't recall having to do that before with posture changes but I can recall having to do it when cleaning up contacts after side changes. IDK I might be off on what's actually being asked here if so ignore me. sample of problem?
DavidRN
Posts: 91
Joined: Tue Jan 17, 2023 8:41 pm

Re: ScenEdit_SetSidePosture

Post by DavidRN »

KnightHawk75 wrote: Sat Jan 21, 2023 5:27 pm Is there any way I can change the color at the time of change in side posture? e.g red to blue

If I understand this correct...and I might not...
You change some stuff from hostile to friendly (but not the side membership), but you have a lingering perhaps duplicate hostile contact object still around and you want to remove it? Yes you can remove that contact via getting the contact object and invoking :delete(). You can find that various ways, usually if you already have the real units object wrapper peeking into .ascontact table, and grabbing the contactguid that matches the sideguid you want it removed from, assuming this is a duplicate at same exact location issue. I can't recall having to do that before with posture changes but I can recall having to do it when cleaning up contacts after side changes. IDK I might be off on what's actually being asked here if so ignore me. sample of problem?

Thanks for that got a spare Sunday so I will play around with Lua and see what I can find.

DB
Post Reply

Return to “Lua Legion”