Jump to content
MrPolka

Swapping objects upon mission start with a script?

Recommended Posts

Hello!

 

EDEN editor doesn't load all the objects for me, some are missing and it just so happens it's those I desperately need.

I thought if it could be possible to place an object of any kind and then via script change what that object will be replaced with upon the mission start? That would be the weapons I cannot find in the EDEN, but otherwise have in the arsenal.

 

Thanks!

 

 

Share this post


Link to post
Share on other sites

Part of code used in my Ghosts Wanted mission:

 

Player switchMove "AinvPknlMstpSnonWnonDnon_medicUp1";
sleep 3.846;
_pos = getPos fence0;
_newfence = createVehicle ["Land_IndFnc_3_D_F", _pos, [], 0, "CAN_COLLIDE"];
deleteVehicle fence0;

the fence part should be the one you need :thumbsup:

Share this post


Link to post
Share on other sites

Do I paste it into the object's ini and then modify the variables with what I want it to be replaced with?

Edit I figured it out. I just luckily found a thread that worked. Not sure how I didn't see it before.

 

Holder = createvehicle [ "weaponholdersimulated",[5375.729,10136.985,0.761],[], 0, "can_Collide"];  
Holder addweaponcargo ["CUP_arifle_HK_M27",1];

 

change the coordinates to what you need to spawn it at.

I placed a box and an empty ground marker on top of it. Made them both into simple objects. I took copied the ground markers cords and inputted them into the code. It worked.

When the things aren't map objects, the weapon will spawn on the ground. But hey it works lol

Edited by MrPolka
Found out an answer
  • Like 1

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

×