NimrodX -> RE: How to use Lua Script to mark a contact hostile? (5/26/2018 5:07:34 AM)
|
quote:
ORIGINAL: gf85 Thanks for NimrodX's answer, but I still don't know how to figure it out[:(] I do have the unit's ID (it's added through scenario editor, not by code), I have tried to set the unit's autodetectable = true but doesn't work ScenEdit_SetUnit ({side="Tatmadaw", unitname="Recon AC", autodetectable= true}) and I can't find a function that can set the property of contact... Ok, basically the problem is this: There's a "Unit" and there's a "Contact". These are different tables. A Unit is a table that describes what the unit physically is in reality according to the universe. There's only one Unit for a unit. A Contact is what a specific side *thinks* the unit is. So there's actually more than one Contact for the same unit. If we have sides A, B, and C then Unit X will have three Contacts, one for "what side A thinks X is", one for "what side B thinks X is", and one for "what side C thinks X is". So there will be a unit called X. Then there will be a Contact for what side PLAAF thinks X is and totally separate table for what every other side thinks X is. I'm pretty sure I know how to code this but it would save me some time if you could upload your scenario file as you have it now so that I can just open the event editor and have everything else set up already. I don't think there's any function for this, you just need to grab the Contact table for PLAAF's "view" of the Unit and set the table member by key using the table[key] = "xxx" syntax sort of like this: local contact = ScenEdit_GetContact({side="United States", guid="c4114322-900c-428d-a3e3-0af701e81a7a"}) contact["posture"] = "hostile" Anyway, post or PM me your scenario file and I can show you.
|
|
|
|