Jump to content
Sign in to follow this  
skobar7

Make an object appear as another

Recommended Posts

Hey all, first post. I've been working on a mission for the past week or so and I've been able to find information on most of the things I've needed, but I seem to be having trouble with this particular concept.

I would like to simply make an object (For example an ammo crate) LOOK like another (for example a shoebox). I don't want anything to trigger it, just to replace an individual ammo crate's object model with that of another item. I feel like it should be a simple INIT entry but am too new to this aspect of scripting to just wing it.

Anyone know what I can do? Is this even possible?

Thanks!

Share this post


Link to post
Share on other sites

You could hide the object and create a different one in the same spot. Not sure if that's what you're after

Share this post


Link to post
Share on other sites

_pos = _this select 0;
_box = _this select 1;
_newObjClassname = _this select 2;
hideObject _box;
_box allowDamage false; //safety to make sure it doesnt explode when the new object is created
_newObj = createVehicle[_newObjClassname,_pos,[],0,"CAN_COLLIDE"];

Try that inside a script then call it from init.sqf with the position, box object, and new object classname.

Share this post


Link to post
Share on other sites
Care to elaborate how you came to that conclusion?

Sure...

I would like to simply make an object (For example an ammo crate) LOOK like another (for example a shoebox). I don't want anything to trigger it, just to replace an individual ammo crate's object model with that of another item. I feel like it should be a simple INIT entry but am too new to this aspect of scripting to just wing it.

What I got from this was he wanted the inventory, but on a shoebox.. Though, he worded that like it was just an example and the inventory was not the goal, the model was.

I guess if you really want to do it, you would have to script a weaponHolder onto the shoebox object and use that as an inventory. But if you hide the weaponHolder, can you still access its inventory? Maybe through the action command.

Perhaps something like this could work...

_box = createVehicle ["Land_WheelieBin_01_F", getPos player, [], 0, "CAN_COLLIDE"]; 
_gear = createVehicle ["WeaponHolderSimulated", getPos player, [], 0, "CAN_COLLIDE"];
hideObjectGlobal _gear;   
_gear addItemCargoGlobal ["FirstAidKit",5]; 
_box addAction ["Open Box",{_this select 1 action ["Gear",_this select 3]},_gear];

As for replacing an objects model, that cant be done without an addon.

Edited by Fight9

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  

×