Miscreated

Miscreated

Not enough ratings
Advanced server modding
By Outpox
This guide aims to show you which advanced server modding features are available. Basic programming skill recommended.
   
Award
Favorite
Favorited
Unfavorite
Introduction
Hey there,

I used to mod back on Crysis and I've been playing Miscreated and hosting a dedicated server for some time recently.

Today (01/23/19) Miscreated was updated to 1.0.1 and the scripts.pak file is finally editable!

In CryEngine games (to my limited knowledge) this is where the interesting stuff happens. This archive contains the scripts that configure the game to a certain extent.

The initial goal of this guide is to help you know what to look for, where and how to edit it and what's available.
Requirements
To get you started, we first have to make sure that you have the required tools.
It is assumed that you're working on Windows. If you're on Linux I believe you don't need me to suggests you a specific tool

We'll need:

A working dedicated server
That means one that you manually host, not an i3D rented server as they doesn't support modding.
I won't be explaining here how to setup a dedicated server, you'll find other guides or resources for this online.

An archive utility
I suggest you 7-Zip[www.7-zip.org]. This is what I'm using but WinRar might do the trick.

A text editor
I suggest you VS Code[code.visualstudio.com] but Notepad++ or any decent text editor will do. Do not use notepad as it doesn't correctly support the line jump nor wordpad as its default encoding is not compatible with the game.

(Optional) A sqlite client
I strongly suggest sqlite browser[sqlitebrowser.org].

(Optional but recommended) Some programming skills
In this guide we'll mostly be editing .lua files but a basic understanding of scripting will help you understand what you're doing. I have no resource to suggest you for this.
Scripts.pak
This is our starting point.

First locate your Miscreated server folder. Not your game installation !

In said folder you will find a "GameSDK" directory, open it and you should see the "Scripts.pak" file.


Open the file using 7zip. You should see two folders:
  • Entities
  • Scripts

Browse "Scripts" and you will see a long folder and files list.

Changing the vehicles quantity
First open the "Spawners" folder. Then drag the "VehicleSpawnerManager.lua" file and drop it outside 7zip on your desktop or in a temporary folder.


Then open the file using your chosen text editor. I'm using VS Code.
Scroll to the line 26 and you should see the following:
(Please note that I've already edited mine and set it to 10 times its previous value)


initialMinVehicles = 1, -- Mine is 10 as I changed it already

That line define the minimum amount of "armored_truck_army" that should spawn.
You can edit each vehicle "code block" to set the desired minimum amount to spawn. Once done save the file with ctrl+s.

I've multiplied most of mines by 10 for testing purposes. Initially my server had a total of 54, and after the changes applied it went up to 175! Be careful tough, if you set too many vehicles the server might not be able to handle it.

We will explore how to apply these changes to your server in the next chapter.

I don't know yet of any other way to force the vehicles to respawn so I just deleted my miscreated.db (the database that contains everything, from the users location and stuff to vehicles locations) and then restarted my server.

You may not need to delete the database if your previous configuration had the default vehicle amount. It will spawn new ones.

In order to make sure that your changes were applied you can open the miscreated.db file using sqlite browser once your server finished loading (give it a good 2-3mn) and browse the "Vehicles" table. Here's mine:

Creating a mod
In order to apply the changes you made in the previous chapter or any new one we're going to explore the creation of a mod. This is quite simple, first you need to create an empty directory that will be the root of the mod.

The way a mod is made is that we will be creating a new .pak file that has the exact same structure as "Scripts.pak" but only containing the edited files.

The file you edited in the previous chapter is "VehicleSpawnerManager.lua" which is in "Scripts\Spawners\". That means that our mod must contains a folder named "Scripts" that contains a folder named "Spawners" which contains the editied VehicleSpawnerManager.lua file.

I created a folder my mod and created a "Scripts" folder inside of it.

Inside is the "Spawners" directory.

Inside are the files that I edited

Then go back to your root folder, right click on the "Scripts" folder and create an archive with 7zip.

Use the zip archive format. I set the compression level to "Store" which means it won't compress the files at all, I don't really think it's necessary.
Rename the destination file (Archive) to "zz_YOUR_MOD_NAME.pak". Make sure that it starts with "zz_" and ends with ".pak". This is really important. This prefix make it so that your mod is loaded after the default config and so overwrite it with its own config.
Then hit OK to create the archive.

You should have a "zz_YOUR_MOD_NAME.pak" file created. If you open your pak archive you should first see a "Scripts" folder and then the remaining of your files. If not, something went wrong.

You can now share this file as you wish. It just has to be placed inside your "GameSDK" folder along the other .pak files.

Here's one I created that greatly increase the vehicle amount and make them spawn repaired.
You may use it as a reference to make sure you did everything right.
https://cdn.discordapp.com/attachments/535889239012016148/538045878179725342/zz_tons_of_working_vehicles.pak
Changing individual item spawn rate
Follow the "Changing vehicle quantity" chapter but instead edit "ItemSpawnerManager.lua"

You will find each item drop chances in there, it might be tedious to go trough all of it but at least that can be fine tuned.


I believe it's not required to delete the database (miscreated.db) but you may have to wait quite a long time for items to respawn with the new percentage, so I would still suggest to delete it.
Changing zombies drop table
Each zombie has its own drop table, for example the default zombie "HumanZombie" drop table is:

{ { category = "Map", percent = 10 }, { class = "AmcoinLedger", percent = 7.5 }, { category = "RandomConsumable", percent = 25 }, { category = "RandomConsumable", percent = 25 }, { class = "Rocks", percent = 50 }, },

To find this, first got to "Scripts.pak/Scripts/Entities/Characters/Mutants/" there you will find several files, one for each mutant.


Extract and open the one you want to edit and look for the following line
esLootItemCategory = "SOME_TEXT_HERE"


Here, SOME_TEXT_HERE is "RandomMutantLoot". Copy that and search this (using ctrl+f) in the file "Scripts.pak/Scripts/Spawners/ItemSpawnerManager.lua" (extract it first as you will be editing it).

You should find:

Edit this at will by following the same syntax.

You can probably get the complete item list in the files but here it is : https://cdn.discordapp.com/attachments/523821770684497920/526537090188443658/ClassRegistry_1.txt
It was created by cSprance, a member of the Miscreated development team.
What I've gathered
It would be quickly repetitive to make a new section for each thing to change as the process is the same in each case, it's easier for me to list you some of the thing I've already found.

Tornado
You can change the tornado spawn location and destination in "Scripts.pak/Scripts/Weather/weather.lua" on line 206 and 207.
If you do so you should also change the lines 231 and 232 which represent the tornado sound.

You can force the weather to a tornado using RCON with the following command:

wm_startPattern NUMBER

Where NUMBER is:

NUMBER
Name
05
TornadoStorm
06
TornadoStorm_Tornado
07
TornadoRainThunder
08
TornadoRainThunder_Tornado
Reference[servers.miscreatedgame.com]


Closing notes
This is it. I will be updating this guide in the future if it seems useful and once I'll have invested a bit more time in it.

You may see .xml files in scripts.pak that can't be opened. I won't be able to help you for this.

Please remember that you can only edit your server files, if you try to do so on your game's you will, at best, be caught by the EAC and at worse banned.

Modifying your server won't be an issue.

Also you should probably make a backup of your database before trying anything funky.
If you want to restore your Scripts.pak I believe you can simply delete it and start a server update, I haven't looked much into it yet.

I would like to thanks Pitivier, the french Miscreated community manager, who I talked with quite a lot regarding all of this and who was of a great help. Thanks again buddy!

Outpox
18 Comments
Stoutman 27 Jun, 2023 @ 7:03pm 
Canyonlands probably does not have any spawn spots for jetski, I think they are missing any spawn spots for the police sedan too.
afrostevesixty 15 Feb, 2021 @ 4:17pm 
this is super useful stuff, thanks for taking the time to share!
Outpox  [author] 8 Jan, 2021 @ 8:41am 
Thansk for the feedback. Unfortunatly I've been away from the Miscreated scene for quite a while as I've stopped hosting servers so I won't be able to help you :(.
Xofar 8 Jan, 2021 @ 6:11am 
Thanks for this. Not sure why this is so inactive as it is a great primer for modding. If you have any guidance on more advanced modding, I would like to hear more. Like adding our own content like changing vehicle or creature models; and things like how does the game prevent jetskis in canyonlands? Setting the jetski's initialMinVehicles appears to have no effect in canyonlands.
Termin8rSmurf 31 Jan, 2020 @ 12:05pm 
Is there any way to change the number of chests/crates that a base can have?
kaPi* SKINS 20 Jan, 2020 @ 9:43pm 
How can I enable all recipes? For example roof, without reading
Chr0n0s 15 Jan, 2020 @ 2:17pm 
Hi there!
I see it's a bit inactive topic, but i try to take my chances. I succeded modding the Lua scripts, worked very well. Then i thought i will browse the workshop for some other mods. I found 2 actually. I edited the Host.cfg file to download those 2 mods via workshop. First it was okay, worked like a charm. Then i quitted the game, closed my slef hosted dedicated server, and restarted it. Then a juicy error appeared: "Error: 80, Could not copy file E:/...."

I deleted the files from the Mods folder under my MiscreatedServer folder, then it was fine again.

Is it possible, that i have to clear the Mods folder every time i restart the server?

Appretiate any help in advance!
DARK-other-SIDE 23 Dec, 2019 @ 5:26pm 
Hello
If I made a mod, how do I spend steam?
Kokosnuss 25 Feb, 2019 @ 1:12pm 
hello :) so i tried ur guide and changing the spawn lua´s wowks fine but can i change the xml files the same way? or do i have to change it otherwise?
Casy 14 Feb, 2019 @ 8:12am 
UPs no Loot box Storage box is this