OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: XCess on 02 Jan 2006, 13:15:46
-
I don't know if anybody's has noticed this before, bit I noticed something really strange today, which could have an effect on game performance.
I made a group of Resistance soldiers, BMI dudes, and I wanted them on the west so I grouped them to a west soldier of higher rank and deleteVehicle'd him via a trigger.
Later, I decided to put the Res guys in a Blackhawk. As the Res guys init fields were full of addWeapons and such (I wasn't in the mood for constant alt-tabbing at the time) I put the grp = this; "_x moveincargo.... into the west guy's init field.
Sure enough, my group of Res guys went into the helo... but strangely.. so did the West guy who I'd deleteVehicle'd already.
Strange. And show's deleteVehicle doesn't entirely delete a unit...
-
Because the moveIn command is in the west guy's init field it will be executed before the trigger that deletes him. deleveVehicle on a unit that is in a vehcile does not work properly. The only way I have found round this is to move him out first:
unassignVehicle unitname
unitname setPos [0,0,0]
deleteVehicle unitName
That should solve it for you. The unnassignVehicle may not be necessary, but it can't do any harm
-
The command seemed to sort of work. He was not leader of my group, nor was he in it. I'm gonna test whether he is still registered by enemy AI. Strange bug though.
**EDIT**
Seems THobson was right as always. Althought the guy didn't seem to want to respond to any script commands, although that could have been my very rusted scripting skills failing me.
-
Sorry I should also have said that a lot of this complication could be avoided in this case by setting the condition of presence to false for the west group leader.
-
Set the guy's presence to false and everything went perfect, even sorted out the unit numbering. Thanks THob, you saved me the hassle of regrouping them turnin radio off n on etc.