Jump to content
Sign in to follow this  
yourry

setpos on backpack

Recommended Posts

Hi,

I do not understand, I can not teleport a player on a bag on the ground (named bob):

player setpos (getpos bob);

I spawn in water as if the position is not good. Yet the subject is well known with a test "isnull" to false.

I placed next to the bag and the .rpt I display the coordinates of the bag and me:

player: "[1851.17,5746.79,0.00143862]"
backpack:"[3702.93,11492.2,11.8185]"

http://img4.hostingpics.net/pics/482718sac.png

Coordinates are radically different.

I do not understand. Is this is a bug in the game or that I mistaken somewhere ?

Share this post


Link to post
Share on other sites

Yeah I think it's messed up. Maybe it's related to this & this.

Here's what should be a work around (from the linked thread):

_bp = createVehicle ["B_UAV_01_backpack_F", getPosATL someObject, [], 0, "CAN_COLLIDE"];
_backPackLoc = _bp modelToWorld [0,0,0];
player setPos _backPackLoc; 

Edited by Iceman77
changed spawn position of backpack from player & shortened the script

Share this post


Link to post
Share on other sites

Thank you very much for the answer.

I tested the following command:

player setpos (bob modelToWorld [0,0,0])

It works well.

Thank you!

Share this post


Link to post
Share on other sites

Objects on the ground like weapons, ammo, bags are placed in an object named weapon holder, "GroundWeaponHolder", so you should check for a near weapon holder, not a bag.

nearestObject [player, "B_AssaultPack_cbr"]; // return <NULL-object>
nearestObject [player, "GroundWeaponHolder"]; // return the ground weapon holder : 517cc800# 1770531: dummyweapon.p3d

Edited by Zigomarvin

Share this post


Link to post
Share on other sites

I think he wants to teleport to a specific bag that he's created. Is there any need to return nearest weaponHolder after creating / placing the backpack, instead of the location & just going directly to the backpack's position? I could be wrong though :p

Edited by Iceman77

Share this post


Link to post
Share on other sites

nearestObject was just an exemle, however, I've just tryed this

"B_AssaultPack_cbr" createVehicle getPos player; // i can see a bag on my position
nearestObject [player, "B_AssaultPack_cbr"]; // return <NULL-object>
nearestObject [player, "GroundWeaponHolder"]; // return the ground weapon holder : 517cc800# 1770531: dummyweapon.p3d

Seems bags and probably weapons, ammo, items... are automaticatly placed in a weapon holder at they creation.

Share this post


Link to post
Share on other sites

Yeah they do if I'm not mistaken. Also, today I found weaponHolderSimulated courtesy of Zapat. That can be used to detect dead body weaponholders / weapons and such.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×