Clone Interior Cells

Hey there. I know that certain interior cells exist, both that people can teleport to and enter via a door. Is it possible to clone multiple instances of a interior cell, e.g. Trevor’s trailer and link that to a teleport at another trailer, Thus allowing multiple interiors for non interior based buildings?

Just something ive tried searching for on here with little to no results.

Does this look like a FiveM Feature Request?

It is possible to create a clone of an existing interior (CMloArchetypeDef) inside of a new ymap (CMloInstanceDef) and stream in a FiveM resource like any other map.

Here is your suggested example above that demonstrates how to create a clone of Trevors trailer. I placed this into a trailer in the biker park in Sandy which you can teleport into at coords (11.60689, 3697.542, 40.73159)

This was a quick job, I’m aware you walk out of the door from the inside through the exterior trailer wall and watch the door close and disappear back inside of the wall. You cannot use the door to get in. Changes like this are more complicated and require time and effort, most times editing models or customizing the CMloArchetypeDef itself, though most anything is possible if you work towards it.

1.) Your resource needs to stream a ymap that will place the interior at your desired location / rotation. It is important that you have the streaming extents, entities extents, position, and rotation correct for this or your interior will not load. I used CodeWalker and OpenIV to create the below ymap.

interior_trevorstrailertidy.ymap

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<CMapData>
  <name>interior_trevorstrailertidy</name>
  <parent/>
  <flags value="1"/>
  <contentFlags value="73"/>
  <streamingExtentsMin x="-23.09499000" y="3663.21400000" z="19.32845000"/>
  <streamingExtentsMax x="44.88948000" y="3729.38700000" z="62.78938000"/>
  <entitiesExtentsMin x="2.46752700" y="3688.77600000" z="39.32845000"/>
  <entitiesExtentsMax x="19.32696000" y="3703.82400000" z="42.78939000"/>
  <entities>
    <Item type="CMloInstanceDef">
      <archetypeName>V_TrailerTIDY</archetypeName>
      <flags value="1572864"/>
      <guid value="1683234893"/>
      <position x="11.80372000" y="3695.67400000" z="39.32845000"/>
      <rotation x="0.00000000" y="0.00000000" z="-0.98532120" w="0.17071090"/>
      <scaleXY value="1.00000000"/>
      <scaleZ value="1.00000000"/>
      <parentIndex value="-1"/>
      <lodDist value="20.00000000"/>
      <childLodDist value="0.00000000"/>
      <lodLevel>LODTYPES_DEPTH_ORPHANHD</lodLevel>
      <numChildren value="0"/>
      <priorityLevel>PRI_REQUIRED</priorityLevel>
      <extensions/>
      <ambientOcclusionMultiplier value="255"/>
      <artificialAmbientOcclusion value="255"/>
      <tintValue value="0"/>
      <groupId value="0"/>
      <floorId value="0"/>
      <defaultEntitySets/>
      <numExitPortals value="6"/>
      <MLOInstflags value="0"/>
    </Item>
  </entities>
  <containerLods/>
  <boxOccluders/>
  <occludeModels/>
  <physicsDictionaries>
    <Item>V_TrailerTIDY</Item>
  </physicsDictionaries>
  <instancedData>
    <ImapLink/>
    <PropInstanceList/>
    <GrassInstanceList/>
  </instancedData>
  <timeCycleModifiers/>
  <carGenerators/>
  <LODLightsSOA>
    <direction/>
    <falloff/>
    <falloffExponent/>
    <timeAndStateFlags/>
    <hash/>
    <coneInnerAngle/>
    <coneOuterAngleOrCapExt/>
    <coronaIntensity/>
  </LODLightsSOA>
  <DistantLODLightsSOA>
    <position/>
    <RGBI/>
    <numStreetLights value="0"/>
    <category value="0"/>
  </DistantLODLightsSOA>
  <block>
    <version value="0"/>
    <flags value="0"/>
    <name>interior_trevorstrailertidy</name>
    <exportedBy/>
    <owner/>
    <time/>
  </block>
</CMapData>

2.) Your resource needs to stream a _manifest.ymf file to tie your interior clone to it’s ytyp file that contains the CMloArchetypeDef.

_mainifest.ymf

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<CPackFileMetaData>
  <MapDataGroups/>
  <HDTxdBindingArray/>
  <imapDependencies/>
  <imapDependencies_2>
    <Item>
      <imapName>interior_trevorstrailertidy</imapName>
      <manifestFlags>INTERIOR_DATA</manifestFlags>
      <itypDepArray>
        <Item>v_int_26</Item>
      </itypDepArray>
    </Item>
  </imapDependencies_2>
  <itypDependencies_2/>
  <Interiors/>
</CPackFileMetaData>

3.) Your resource needs a __resource.lua file to declare it as a map

__resource.lua

resource_manifest_version '77731fab-63ca-442c-a67b-abc70f28dfa5'

this_is_a_map 'yes'

4.) Your resource needs to toggle the ymap on and off as you enter and exit it (teleport). If you just want the ymap to load on it’s own and stay loaded you can change in the ymap

<flags value="0"/> instead of <flags value="1"/>

Toggle On if flags value=“1”

REQUEST_IPL("interior_trevorstrailertidy")

Toggle Off if flags value=“1”

REMOVE_IPL("interior_trevorstrailertidy")
6 Likes

This is a great solution for IPLs, but how would I need to approach this if I want multiple instances of an ymap interior? You can’t call it like an IPL (or can you?).

I don’t want to place 20 copies of the ymap (its an apartment), but use instancing or this like you can do with IPLs, but how can you this with ymap instead of an IPL?

Thx!

Hello Anders, thx a lot for your nice tutorial he is very usefull for a lot of us. Im asking to me, how to “create” this __manifest.ymf file ? im looking for a way to create one, to stream medicals props into my five m server. Thx a alot for your help

I export an existing .ymf file from Open IV, then import it into my .rpf in Open IV, then open and edit that one. Hope that makes sense. Code Walker project has an option to generate the contents of what should go into that manifest file but occasionally it includes more than you actually need depending on the ymap you have loaded into the project.

Awesome example and thanks for Detail… I am trying to get the motel room to go under the map, I have got all the right information for it; I can spawn it fine when it is inside the trailer, i just replace the code for the trailer in the manifest and ymap, and it loads in the trailer that you made, but when i want to put it under the map, I can walk inside of it… but it is totally invisible… all i did was move the Z coords to be negative. Am I missing something? As I want it to be under the map.

or at least where do I get extents and entities min and max, easily?

Use CodeWalker to do this, open the ymap there and then do the movement, then you have an option to calculate the extents. Save the ymap and you should be good. With this trailer interior I did notice the coords you teleport into are pretty finicky, if you’re not in a good spot the interior is invisible, I think I had the best success getting it to load by having the coords right inside coords for the door and a little bit down on the z.

Help!

I’m trying for the inside v_trailertidy, but instead of appearing inside, nothing appears.

Ok, so i cloned some interiors wihch is a great thing to play around, thx @anders for sharing this with us.

I came across and issue unfortunately. I played with 3d models and collisions so i could fit inteirors inside random buildings.
The only issue i’m having is vanishing environment when being inside while moving back and forward. Other players being invisible for a second when they change rooms. Same thing happens when i go outside. It seems to be connetcted with the camera point being outside/moving in and out the boarder of certain areas.

Any ideas?

18%20PM