Home   Help Search Login Register  

Author Topic: Something Strange  (Read 924 times)

0 Members and 1 Guest are viewing this topic.

Offline XCess

  • Former Staff
  • ****
Something Strange
« 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...

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Something Strange
« Reply #1 on: 02 Jan 2006, 13:41:12 »
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:

Code: [Select]
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

Offline XCess

  • Former Staff
  • ****
Re:Something Strange
« Reply #2 on: 02 Jan 2006, 13:53:32 »
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.
« Last Edit: 02 Jan 2006, 14:06:05 by XCess »

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Something Strange
« Reply #3 on: 03 Jan 2006, 09:06:03 »
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.

Offline XCess

  • Former Staff
  • ****
Re:Something Strange
« Reply #4 on: 04 Jan 2006, 11:30:18 »
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.