[How-To] Autoload Maps / Selecting Map Spawning areas

Ok since the wiki seems to be down, I thought I’d answer a few questions about how to autoload server maps and how to select the spawn points.

First you need a working server map probably downloaded from here:
GTA5-Mods.com Map Section

Most of these maps were created for the original fivem, some things have changed since then. Most of these maps were initially made to be loaded through a trainer client side, which is becoming more difficult to accomplish, and ineffectual to multiplayer anyways.

There are three streaming tutorials on here already so I will only quickly go over what needs to be done, but am willing to answer questions so long as I am working with this project.

Take the map gokart from gta5-mods. When you extract the map to resources folder of your server you will have 1 folder and 4 files in the gokart directory: \resources\gokart\

images <–(folder)
gokart.json
gokart.meta
images.meta
water.xml

you need to create a new text file: __resources.lua <-(note the two underscores in front of it)

in this file I’ll highlight in bold what differs to allow map to autoload:

resource_type ‘map’ { gameTypes = { fivem = true } }

map 'map.lua’

replace_level_meta ‘gokart’

files {
‘gokart.meta’,
‘gokart.json’,
‘images.meta’,
‘water.xml’
}

That will allow the map to autoload but we need to fix a path in the gokart.meta:

In order to load the maps clientside they required a path usermaps:/
For serverside it needs to be resources:/

so open up gokart.meta and find and replace all occurences of usermaps (with) resources .

do the same thing in images.meta.

Also the game engine now loads data from the stream folder instead of the images folder, so rename the folder in gokart images (with) stream

You’ll need to edit all the meta files path from images to stream in the same areas usermaps would have been in originally usually:

for example the last item of images.meta:

	<Item>
	<filename>usermaps:/gokart/images/v.rpf</filename>
	<contents>CONTENTS_MAP</contents>
	<fileType>RPF_FILE</fileType>
    <installPartition>PARTITION_2</installPartition>
</Item>

becomes

	<Item>
	<filename>resources:/gokart/stream/v.rpf</filename>
	<contents>CONTENTS_MAP</contents>
	<fileType>RPF_FILE</fileType>
    <installPartition>PARTITION_2</installPartition>
</Item>

Once you’ve done this you relaunch your server after deleting its cache directory of course:

Then when it loads the map will be autoloaded, great exceapt you fall into an ocean of nothing. cause the spawn points aren’t here:

to create spawnpoints we need to create a new text file map.lua in the gokart directory:

it contains this:

spawnpoint ‘a_m_y_skater_01’ { x = 2665, y = -395, z = 35 }
spawnpoint ‘a_m_y_skater_02’ { x = 2665, y = -395, z = 35 }

I’ve already mapped out the spawnpoint for you to start at the finish lane of the map. But how do I get the spawn points of the map, you ask?

If you remember math, x is horizontal space y is vertical space and z is elevated space (how high you are).

To find out where to place a spawn point. Open up the gokart.json file, this is the list of every object in the map, find an item that lists a “position” variable, a lot of this is trial and error: for example:

I found an item here:

{
  "position": [
    2668.209,
    -453.8654,
    41.495
  ],
  "rotation": [
    0.0,
    0.0,
    0.0,
    1.0
  ],
  "guid": "d5ad2b6c-dd19-4a36-b928-bf6672c20036",
  "archetypeName": "hash:1000935171"
},

2668 is x -453 is y and 42 is how high it is

so back in my map.lua I would put something like:

spawnpoint ‘a_m_y_skater_01’ { x = 2670, y = -455, z = 45 }
spawnpoint ‘a_m_y_skater_02’ { x = 2670, y = -455, z = 45 }

The z is kinda important especially on maps with mountains and hills, as you don’t want to start under the mountain or way to high with a parachute (unless you want to).

clear your cache make sure your mod is loaded of course: in the citmp-server.yml under AutostartResources: -gokart

This works well for small maps with low texture resolution. In theory it works for huge maps too, but you’ll likely get the dreaded zlib error verify game cache, as textures bigger the 1024 will hang the client (dunno if they are going to fix that), or possibly even some other random error message as the bigger the map the bigger the chances some complex thing will go wrong.

Any questions, let me know? I’ve got some maps i’m still trying to get to work myself but this is the basics so far.

3 Likes

RENAMING MAIN MAP TO CUSTOM NAME:

If you noticed the map-fivem-skater map has a __resource.lua and map.lua, as we talked about map.lua earlier it sets up spawn points.

If you want to make a quick spawnpoint setup with different models for the default map, and rename it something other then map-fivem-skater try this:

in server/resources copy map-fivem-skater to crazy_spawns_map

then open up crazy_spawns_map
it will have a bunch of spawnpoints with two sets of models:

spawnpoint ‘a_m_y_skater_01’ { x = -802.311, y = 175.056, z = 72.8446 }
spawnpoint ‘a_m_y_skater_02’ { x = -9.96562, y = -1438.54, z = 31.1015 }
spawnpoint ‘a_m_y_skater_01’ { x = 0.916756, y = 528.485, z = 174.628 }
spawnpoint ‘a_m_y_skater_02’ { x = 1975.86, y = 3821.03, z = 33.4501 }
spawnpoint ‘a_m_y_skater_01’ { x = -181.615, y = 852.8, z = 232.701 }
spawnpoint ‘a_m_y_skater_02’ { x = 657.723, y = 457.342, z = 144.641 }
spawnpoint ‘a_m_y_skater_01’ { x = 134.387, y = 1150.31, z = 231.594 }
spawnpoint ‘a_m_y_skater_02’ { x = 726.14, y = 1196.91, z = 326.262 }
spawnpoint ‘a_m_y_skater_01’ { x = 740.792, y = 1283.62, z = 360.297 }
spawnpoint ‘a_m_y_skater_02’ { x = -437.009, y = 1059.59, z = 327.331 }
spawnpoint ‘a_m_y_skater_01’ { x = -428.771, y = 1596.8, z = 356.338 }
spawnpoint ‘a_m_y_skater_02’ { x = -1348.78, y = 723.87, z = 186.45 }
spawnpoint ‘a_m_y_skater_01’ { x = -1543.24, y = 830.069, z = 182.132 }
.
.
.

well what you are going to do is search and replace all a_m_y_skater_01 with a model name a_c_chimp
and say replace a_m_y_skater_02 with cs_priest

so it will look somethign like this:

spawnpoint ‘a_c_chimp’ { x = -802.311, y = 175.056, z = 72.8446 }
spawnpoint ‘cs_priest’ { x = -9.96562, y = -1438.54, z = 31.1015 }
spawnpoint ‘a_c_chimp’ { x = 0.916756, y = 528.485, z = 174.628 }
spawnpoint ‘cs_priest’ { x = 1975.86, y = 3821.03, z = 33.4501 }
spawnpoint ‘a_c_chimp’ { x = -181.615, y = 852.8, z = 232.701 }
spawnpoint ‘cs_priest’ { x = 657.723, y = 457.342, z = 144.641 }
spawnpoint ‘a_c_chimp’ { x = 134.387, y = 1150.31, z = 231.594 }
spawnpoint ‘cs_priest’ { x = 726.14, y = 1196.91, z = 326.262 }
spawnpoint ‘a_c_chimp’ { x = 740.792, y = 1283.62, z = 360.297 }
spawnpoint ‘cs_priest’ { x = -437.009, y = 1059.59, z = 327.331 }
spawnpoint ‘a_c_chimp’ { x = -428.771, y = 1596.8, z = 356.338 }
spawnpoint ‘cs_priest’ { x = -1348.78, y = 723.87, z = 186.45 }
spawnpoint ‘a_c_chimp’ { x = -1543.24, y = 830.069, z = 182.132 }
.
.
.

now you have the default map with a new name “crazy_spawns_map” and spawnpoints with two different sets of peds, chimpanzee’s and priests pretty wacky I know!

2 Likes

Question? Would that also change the Mini map and Menu Map?

It won’t. That’s not possible unless diffrent files are loaded.

How would I go about just loading in XML files like those found on GTA5-Mods Map sections with custom built ramps and things of that nature? I am really new to this and have been trying to figure out how exactly to load in just XML files so I can just add things to pre-existing maps. The two ramps and stuff I have downloaded only come with the XML files… Thanks a lot in advance!

Everytime I try this I get the following error, even when downloading the same map as the example.

[Window Title]
Error sink-speaker-triple

[Main Instruction]
RAGE error: ERR_SYS_FILELOAD

[Content]
A game error (at 00000001408c20c8) caused FiveM to stop working. A crash report has been uploaded to the FiveM developers.
If you require immediate support, please visit FiveM.net and mention the details below.

Corrupt game data. Please reboot, verify the game data, or reinstall the game. For more information, please visit: http://rsg.ms/verify




[Expanded Information]
Crash signature: gta-core-five.dll+3673C
Report ID: ... [uploading?] (use Ctrl+C to copy)

Same here. Checked everything and still have same issue.

Edit: I take back my previous comment. Read the instructions completely and make sure all lines of code are correct. Working now after finding some errors.

Same here, I forgot my Json files. However bigger maps ( GTA:SA / LIberty city ) do give me this error still because Im not doing something right :thinking:

-> I know I’m updating a very old topic but it might also bring information for some people :stuck_out_tongue:

So unfortunately it seems that editing/creating an images.meta and removing some part of the map does not actually remove its collision (unless if you don’t load the images.meta)
Any idea how to fix that?