OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: THobson on 26 Mar 2005, 23:01:33

Title: A unit has boarded himself, and will not disembark
Post by: THobson on 26 Mar 2005, 23:01:33
I have had several units join the players group.  Some joined as a group and others joined individually.  I have a problem with one of the ones that joined individually.  See the attached picture.

Loon 6 just stands still and will not move, he will change behaviour to and from AWARE etc. when I tell him but apart from saying 'Roger' to all my instructions he completely ignors me.

As you can see from the picture he has a '6' behind him.  Just what any unit would have if they were in a vehicle commanded by unit 6.  So it seems he is in his own vehicle and I can't get him out.

Has anyone seen this sort of thing before?
Title: Re:A unit has boarded himself, and will not disembark
Post by: Planck on 26 Mar 2005, 23:04:19
Never................a case of split personality I think.


Planck
Title: Re:A unit has boarded himself, and will not disembark
Post by: Blanco on 26 Mar 2005, 23:10:47
weird, have you tried :
name_of_nr6 action ["eject",vehicle name_of_nr6]
and see what happens?

Are you using any scripts or do they join via a join-wp?




Title: Re:A unit has boarded himself, and will not disembark
Post by: THobson on 26 Mar 2005, 23:38:40
It is all done in a script.  I notice that I have him join grpNull twice before joining the player.  I have taken one of these out.  In fact I will take them both out and see what happens.  Eject is an intersting idea.  Thanks.
Title: Re:A unit has boarded himself, and will not disembark
Post by: dmakatra on 27 Mar 2005, 01:19:28
Some weird bug... Try removing him, place a new unit and name him something else and then try it.

:beat: *Gets Shot* :beat:
Title: Re:A unit has boarded himself, and will not disembark
Post by: THobson on 27 Mar 2005, 09:31:26
I might just have to do that, but I'll try to fix it first.  I have done some experimenting and think I am homing in on the problem.  Key points are:
The guy starts as leader of a group - he is called Yuri by the way.  The following are extracts from the script:

Code: [Select]
_civis = units group Yuri
.
.
.
{_x assignascargo (vehicle Alexi)} forEach _civis
_civis  orderGetIn true
.
.
.
{unassignVehicle _x} forEach units group Yuri
{unassignVehicle _x} forEach units group Alexi
Yuri setPos getMarkerPos "Yuri"
.
.
.
{[_x] join grpNull} forEach (_civis - [Yuri])
{_x doMove getPos (object 88684)} forEach (_civis - [Yuri])
.
.
.
[Yuri] join Alexi

I suspect the problem is somewhere here:
Code: [Select]
{unassignVehicle _x} forEach units group Yuri
{unassignVehicle _x} forEach units group Alexi
Yuri setPos getMarkerPos "Yuri"
because even when Alexi has one of his guys in the vehicle he does not get out.  All of Yuri's group do get out of the vehicle though and they head off for the location indicated.  Perhaps I need some short time delay here.  Something like:
Code: [Select]
{unassignVehicle _x} forEach (units group Yuri + units group Alexi)
~1
Yuri setPos getMarkerPos "Yuri"


I will try that once I have set up a simple mission that will let me test it without running through all the cuscene stuff each time.

EDIT:
Well what do you know!

The ~1 seems to fix the problem with 6, but the other guys in Alexi's group that are still in a vehicle don't get out.  That is no problem, just a puzzle.

I will leave the thread open for a while to see if anyone has any relevant comments.


EDIT2:
I just repeated exactly the same thing with no change and the problem is back!!  I may well have ot fall back on dmakatra's idea.
Title: Re:A unit has boarded himself, and will not disembark
Post by: UNN on 27 Mar 2005, 15:59:42
I had exactly the same problem, it's down to setpos'ing a unit out of a vehicle. Call the GetOut Action first then setpos them.
Title: Re:A unit has boarded himself, and will not disembark
Post by: Blanco on 27 Mar 2005, 17:52:26
Maybe put a @ condition between the unassignvehicle and setpos line to check if they are really out of the vehicle.
Title: Re:A unit has boarded himself, and will not disembark
Post by: THobson on 27 Mar 2005, 18:41:39
As soon as the problem came back without me changing anything I decided this was something that needed a very robust solution.  

I have taken dmakatra's suggestion.  All the mucking about at the begining getting in and out of vehciles etc is done by YuriClone while the real Yuri is patiently waiting on off shore island.  The real Yuri gets setPosed into the scene just as YuriClone gets deleted.
Title: Re:A unit has boarded himself, and will not disembark
Post by: UNN on 27 Mar 2005, 22:12:12
I just went back and tested it, still the same problem. But here's the rub, only with guys in Cargo. Driver, Gunner and Commander can be setpos'ed without any problems  :o

Here's a test mission to demonstrate:

Crew_Test.Eden.zip (http://homepages.gotadsl.co.uk/~gssoft/Crew_Test.Eden.zip)
Title: Re:A unit has boarded himself, and will not disembark
Post by: THobson on 28 Mar 2005, 02:00:01
Yeh this guy was in cargo