PDA

View Full Version : Returning vehicle seat positions



DMarkwick
Jul 4 2009, 23:48
Thanks to the emptyPositions command I can discover if there are empty positions on any given vehicle.

Does anyone know how I can get the positional info, relative to the vehicle, of those empty seats?

Big Dawg KS
Jul 6 2009, 14:26
Create a game logic, move it into the position, get its world pos, then use worldToModel. Not a perfect solution but probably the best.

DMarkwick
Jul 6 2009, 17:29
I need a solution that works for any vehicle automatically. The game engine must have some way of doing this (otherwise how else do units get into empty seats?) and I was wondering if this method is known.

Big Dawg KS
Jul 6 2009, 17:39
I'm sure the game engine has a way of doing it on some level (not that I'm an expert on the internal workings of the engine), but whatever that is it's not available to scripters. I told you it's not a great solution but it's likely the only one.

TeRp
Jul 7 2009, 11:19
selectionPosition (http://community.bistudio.com/wiki/selectionPosition) is what you are looking for.
You could just check for the cargo proxies' positions (should be proxy:Cargo.001 or something).

T_D
Jul 7 2009, 11:59
There are no proxies in Geometry and Memory LOD ;)

TeRp
Jul 7 2009, 12:12
Oh, damn, you're right, I didn't read the whole description. :p
Yet it states 'geometry LODs' so that should include the fire geo as well as all the other geo lods.
So if there are proxies in the fire geo (which is the case for most unarmored vehicles), it should return their position. :)

Anyways, go for Big Dawg's solution to have it working for every vehicle :)

Big Dawg KS
Jul 7 2009, 13:11
...go for Big Dawks...

It's not a hard name, I don't get why they always mess it up... :icon_neutral:

TeRp
Jul 7 2009, 13:15
lol I'm sorry, messed up g and k. Fixed it :)

DMarkwick
Jul 7 2009, 22:18
Create a game logic, move it into the position, get its world pos, then use worldToModel. Not a perfect solution but probably the best.

I'm having difficulty doing this, which is annoying because everything I've read about it indicates that it's as simple as:

Gamelogic1 moveInCargo car1;

However interrogating the position of the game logic shows that it hasn't moved.

DMarkwick
Jul 8 2009, 02:02
Unfortunately Big Dawg, it seems you can no longer place game logics into vehicles.

Big Dawg KS
Jul 8 2009, 13:10
That's a shame. Try something other than a game logic then, and if all else fails you can create a unit or something.

armatech
Jul 25 2009, 17:20
_GetAllEmptyPositions =
{
_typofunit = _this select 0;
_vehicle = _typofunit createvehiclelocal [0,0,1000];
Cleanarray = [];
gunnerarray = [[0,1],[0,2],[0,3],[0,4],[0,5],[1,1],[1,2],[1,3],[1,4],[1,5],[2,1],[2,2],[2,3],[2,4],[2,5]];
for "_i" from 0 to 50 do
{
"USMC_Soldier" createUnit [position _vehicle, group player,"loon = this"];
{
loon moveInTurret [_vehicle, _x];
}foreach gunnerarray;
loon moveIndriver _vehicle;
loon moveIngunner _vehicle;
loon moveInCommander _vehicle;
loon moveInCargo _vehicle;
Cleanarray = Cleanarray + [loon];
};
_crewcount = count(crew _vehicle);
{
_x setdammage 1;
deleteVehicle _x;
}foreach Cleanarray;
deleteVehicle _vehicle;
_crewcount
};

_vehicle = _this select 0;
_positions = [_vehicle] call _GetAllEmptyPositions;
hintsilent format ["%1\nSeats%2",typeof _vehicle,_positions];