ScenEdit_SetDoctrine takes a table as a parameter.
ScenEdit_GetDoctrine returns a table.
FYI: an empty table is the default doctrige for all units, this corespondes to all doctrine values are inherited from the parent.
To Set the doctrine of a unit in an event to inherit all values from the parent, I must create a script for the action.
This appears as:
Code: Select all
script = "ScenEdit_SetDoctrine({})"Code: Select all
script = "ScenEdit_SetDoctrine({ "..
"weapon_control_status_land = '0',"..
"engage_opportunity_targets = '1' })"Code: Select all
script="ScenEdit_SetDoctrine("..doctrineStr..")"Code: Select all
print(ScenEdit_GetDoctrine({side="???", name="???",})This is all fine and dandy, but what if in a later event, I want to return the doctrine to whatever it was before I mucked with it? TO do this using my odd event, I need the doctrine table as a string. Something equivalent to what is printed to the screen/console when I execute a print on the ScenEdit_GetDoctrine call.
So one might say, just grab the table, and call tostring on it. It doesn not work. I ran the following code:
Code: Select all
docTable = ScenEdit_GetDoctrine({side='USA', name='73rd Batallion 2nd Company 1st Platoon (M2A3 Bradley AFV x 4)'})
docStr = tostring(docTable)
print(docStr)
print(docTable)Code: Select all
table: 2BB97C78
{ ignore_plotted_course = '1', engage_opportunity_targets = '1', weapon_control_status_land = '0' }So the short of all this is: does anyone know how to get the equivalent of a print(ScenEdit_GetDoctrine(???)) call into a string value without calling print?
[&:]

