Jump to content
john123

Spawning Custom models from mission file

Recommended Posts

Hi guys I'm wondering if you can give me some advice.

I'm trying to spawn a custom model I've found online for experimental sake. 

I Unpack the pbo into the mission file and use this to spawn.

_pos = player getRelPos [10, 0]; 
_tank = createSimpleObject [MISSION_ROOT + "Barriere\Barriere.p3d", AGLtoASL _pos]; 

 

This spawns the object however with an error message saying it cannot find it .paa.

I've tried setting it with:

_tank setObjectTextureGlobal  [0, "Barriere\Metal.paa"]; 

However no luck. The .paa file is where it is saying it cannot find it. any Idea's

 

p.s I've tried leaving it as a pbo. same result

Share this post


Link to post
Share on other sites

First off, simple objects aren't PAAs, they are P3D shapes. Secondly, you can't load files relative that like for simple objects iirc. You need to use a full path, which KK had a tutorial on doing:

private _p3dPath = (str missionConfigFile select [0, count str missionConfigFile - 15]) + "yourModelFileName.p3d"

Also, if you load a simple object from a file directly and not a class, it cannot be textured.

Share this post


Link to post
Share on other sites
3 minutes ago, john123 said:

Can u explain what u mean by a class? and as for the path i'm using KKs method of defining MISSION_ROOT in the init which works

Class as in a class name (vehicles/objects being spawned as a simple object). You'd need a mod to do that on the client afaik.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...