Jump to content
Mynock

Placing non-vanilla p3d model with createVehicle?

Recommended Posts

Trying to do something I haven't done before. My googling has left me sort of confused and unable to get it working right as, for me, this is rather advanced (feel free to talk crap about how stupid I am). Basically I want to place a p3d model in a mission with createVehicle (I assume that's what I want to use, feel free to correct me if I'm totally wrong) that is not included in the vanilla game; aka it's custom. I have the p3d in my mission folder already, within another folder, so I've been trying to place it on an invisible helipad with 

myObject = "myFolder\myObject.p3d" createVehicle position myHelipad;

I'm not getting any error messages, and I can't see the object... So I'm not really sure what I'm doing wrong without any error messages. I've also tried it with a marker instead of an invisible helipad without luck. Not really sure where to go from here.

Share this post


Link to post
Share on other sites
55 minutes ago, johnnyboy said:

Blondie...maybe its CreateSimpleObject you should use?

 

I see something on that page in the comments section about needing the mission root directory or something. I'll have to suffer through trying to figure that out I guess. But I'm assuming with createSimpleObject I can't make it explode, which is sort of important lol.

Share this post


Link to post
Share on other sites

@Mynock I've never used the command, so have no advice to offer.  I just remember KK recommending it for creating a custom object without a mod.  Good luck mate.

Share this post


Link to post
Share on other sites

I can basically achieve the same results with createSimpleObject, as in I can make it so there are no error messages, but if it's even there, it's still invisible. The object is from a mod already, so I know the object works and stuff, I just don't want to run the whole mod for a single object if I can put it straight into the mission. But that might not be possible, and thus would ruin the shock value of having it in the mission in the first place, which ultimately make it pointless to use it lol. I actually have the entire mod in the mission folder itself, so I don't think it's due to missing a config file or whatever, because I unpacked the mod and stuck everything in the mission folder so I wouldn't break anything I want to use from said mod, but yeah I don't know what I'm doing obviously.

 

Frustrating. But then again there are probably people laughing at me right now for being unable to figure it out and it's child's play to them.

Share this post


Link to post
Share on other sites

Do it like this, but supply the full path to the p3d model in the mission folder.

 

//spawn thing..
_posnew4 = getpos junk9;
_sol5 = createSimpleObject ["myFolder\myObject.p3d", _posnew4];
_sol5 setPos [_posnew4 select 0, _posnew4 select 1, 1.0];

 

This code might work. Name an object "junk9" where you want to spawn it. If you could send me the object I could try and debug this for you.

Share this post


Link to post
Share on other sites
10 hours ago, Mynock said:

 

I see something on that page in the comments section about needing the mission root directory or something. I'll have to suffer through trying to figure that out I guess. But I'm assuming with createSimpleObject I can't make it explode, which is sort of important lol.

 

You cannot damage objects spawned with createsimpleobject, that is impossible.

Share this post


Link to post
Share on other sites
47 minutes ago, jakeplissken said:

 

You cannot damage objects spawned with createsimpleobject, that is impossible.

You can place a dummy object inside and use event handlers.

Share this post


Link to post
Share on other sites
4 hours ago, jakeplissken said:

Do it like this, but supply the full path to the p3d model in the mission folder.

 


//spawn thing..
_posnew4 = getpos junk9;
_sol5 = createSimpleObject ["myFolder\myObject.p3d", _posnew4];
_sol5 setPos [_posnew4 select 0, _posnew4 select 1, 1.0];

 

This code might work. Name an object "junk9" where you want to spawn it. If you could send me the object I could try and debug this for you.

 

That's basically what I was trying previously, yours is slightly different looking so I'll try it later today. Because I ripped the model from a mod I'm hesitant to send it out since I don't own it; I'd have to contact the creator to get permission, just like I would have to do if I ever made this mission public. The mod is public, but because I'm circumventing the mod requirement for the mission I'd probably be breaching something if I shared the files or made the mission public.

 

4 hours ago, jakeplissken said:

 

You cannot damage objects spawned with createsimpleobject, that is impossible.

 

3 hours ago, theend3r said:

You can place a dummy object inside and use event handlers.

 

I've decided if createSimpleObject is all that will work to get it into the mission, I'll script the possible explosion manually.

Share this post


Link to post
Share on other sites

I solved it. I tried a model from the Arma 3 samples and I got it to work. You need to properly specify the mission path.

 

//spawn the lamp.
_posnew17 = getpos oil2;
_sol19 = createSimpleObject [(str missionConfigFile select [0, count str missionConfigFile - 15]) + "media\Test_lamp_01_off_F.p3d", _posnew17];
_sol19 setPos [_posnew17 select 0, _posnew17 select 1, 4.0];

This worked for me testing from EDEN. You just need to tweak the height of the object specified here.

 

_sol19 setPos [_posnew17 select 0, _posnew17 select 1, 4.0];

Give this a shot, it should work fine.

  • Like 1

Share this post


Link to post
Share on other sites
4 hours ago, jakeplissken said:

I solved it. I tried a model from the Arma 3 samples and I got it to work. You need to properly specify the mission path.

 


//spawn the lamp.
_posnew17 = getpos oil2;
_sol19 = createSimpleObject [(str missionConfigFile select [0, count str missionConfigFile - 15]) + "media\Test_lamp_01_off_F.p3d", _posnew17];
_sol19 setPos [_posnew17 select 0, _posnew17 select 1, 4.0];

This worked for me testing from EDEN. You just need to tweak the height of the object specified here.

 


_sol19 setPos [_posnew17 select 0, _posnew17 select 1, 4.0];

Give this a shot, it should work fine.

 

Ahh, yes it does work. I guess I was goofing up how I was trying to get the mission root file. Never done that before. I appreciate the assistance, thank you very much. Now to try and solve the new issue of it throwing a texture error and not being textured. I'll probably have to change the path it looks for the texture or something I'm assuming, although I've never messed with config.bin files before so this might take me a while. Unless anyone knows how to do it another way, I'm open to anything seeing as I have no clue and setObjectTexture doesn't seem to work for this (I tried it using the above string method to pull the mission root file and then linking to the various textures associated with the model, but no luck). I might try contacting the creator at this point to see if he has any suggestions, and to get permission to use it in this way.

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

×