So right now I am testing how to add loot spawns to maps that aren't supported by default. The map I am currently testing this with it gm_construct.
I am getting errors when trying to add prop spawns through the files and the command "mu_loot_add random"
1) Added ^gm_ to Murder.txt
2) Added gm_construct folder to "\murder\content\data\murder" along with the loot.txt and the spawn folder with the spawn .txt
3) Added the following to the loot.txt
[CODE]{
"1":{"pos":"[755.52 -1356.49 -79.97]","angle":"{3.23 -135.6 0.00}","model":"models/props_c17/doll01.mdl"},
"2":{"pos":"[1589.29 -1950.73 -79.97]","angle":"{15.39 49.10 0.00}","model":"models/props/cs_militia/toothbrushset01.mdl"},
}[/CODE]
4) Errors occurred with spawning, which is from me setting no spawn points and loot spawn errors
Player Spawn error
[img]http://puu.sh/aU8Q2/252d872df7.png[/img]
Loot Spawn error
[img]http://puu.sh/aU8Oo/c066247dfd.png[/img]
[img]http://puu.sh/aUawB/a0ce29c6e1.png[/img]
How I'm I supposed to add loot without getting errors?
That isn't valid JSON...
I'm guessing you wanted:
[code]local _tab = {
{ pos = Vector( 755.52, -1356.49, -79.97 ), angle = Angle( 3.23, -135.6, 0.00 ), model = "models/props_c17/doll01.mdl" };
{ pos = Vector( 1589.29, -1950.73, -79.97 ), angle = Angle( 15.39, 49.10, 0.00 ), model = "models/props/cs_militia/toothbrushset01.mdl" };
};
local _json = util.TableToJSON( _tab );
local _tabagain = util.JSONToTable( _json );
print( string.rep( "*", 50 ) );
print( _tab );
print( string.rep( "*", 50 ) );
print( _json )
print( string.rep( "*", 50 ) );
print( _tabagain )
print( string.rep( "*", 50 ) );[/code]
Custom table output, but the table, then json, then converted back to table.
[code]**************************************************
[1]
[angle] = Angle( 3.2300000190735, -135.60000610352, 0 )
[model] = models/props_c17/doll01.mdl
[pos] = Vector( 755.52001953125, -1356.4899902344, -79.970001220703 )
[2]
[angle] = Angle( 15.390000343323, 49.099998474121, 0 )
[model] = models/props/cs_militia/toothbrushset01.mdl
[pos] = Vector( 1589.2900390625, -1950.7299804688, -79.970001220703 )
**************************************************
{"1":{"angle":"{3.23 -135.6 0}","model":"models/props_c17/doll01.mdl","pos":"[755.52 -1356.49 -79.97]"},"2":{"angle":"{15.39 49.1 0}","model":"models/props/cs_militia/toothbrushset01.mdl","pos":"[1589.29 -1950.73 -79.97]"}}
**************************************************
[1]
[model] = models/props_c17/doll01.mdl
[pos] = Vector( 755.52001953125, -1356.4899902344, -79.970001220703 )
[angle] = Angle( 3.2300000190735, -135.60000610352, 0 )
[2]
[model] = models/props/cs_militia/toothbrushset01.mdl
[pos] = Vector( 1589.2900390625, -1950.7299804688, -79.970001220703 )
[angle] = Angle( 15.390000343323, 49.099998474121, 0 )
**************************************************[/code]
You have an error in your JSON, which is why the table is nil. What I recommend doing is this:
[code]// Basically the file.Read, if it fails ( empty file ) use "{ }" for empty JSON Table. Now, if the JSON To Table fails, use { }, an actual empty table.
local _tab = util.JSONToTable( file.Read( "file.txt", "DATA" ) || "{ }" ) || { };[/code]
Sorry for the effort you just put in because they didnt spawn because i didnt have spawn points in the spawn.txt X_X
[editline]15th August 2014[/editline]
Now my issue is some of the loot cant be collect, but others can
i spammed "mu_loot_add random" and some were not able to be picked up
I get this:
[img]http://puu.sh/aUd8l/ae322e6080.png[/img]
I tried loot spawns in cs_italy and gm_construct and the same ones are missing the model.
mu_loot_models_list
[code]
Loot models
lamp: models/props_lab/desklamp01.mdl
beer1: models/props_junk/glassbottle01a.mdl
familyphoto: models/props_lab/frame002a.mdl
battery: models/items/car_battery01.mdl
huladoll: models/props_lab/huladoll.mdl
suitcase2: models/props_c17/suitcase001a.mdl
baby: models/props_c17/doll01.mdl
suitcase1: models/props_c17/suitcase_passenger_physics.mdl
orange: models/props/cs_italy/orange.mdl
banana: models/props/cs_italy/bananna.mdl
toothbrush: models/props/cs_militia/toothbrushset01.mdl
sawblade: models/props_junk/sawblade001a.mdl
cactus: models/props_lab/cactus.mdl
consolebox: models/props_c17/consolebox01a.mdl
cashregister: models/props_c17/cashregister01a.mdl
bananabunch: models/props/cs_italy/bananna_bunch.mdl
breenclock: models/props_combine/breenclock.mdl
briefcase: models/props_c17/BriefCase001a.mdl
circlesaw: models/props/cs_militia/circularsaw01.mdl
axe: models/props/cs_militia/axe.mdl
skull: models/Gibs/HGIBS.mdl
wrench: models/props_c17/tools_wrench01a.mdl
beer2: models/props_junk/glassjug01.mdl
breenbust: models/props_combine/breenbust.mdl
antlionhead: models/Gibs/Antlion_gib_Large_2.mdl
clipboard: models/props_lab/clipboard.mdl
turtle: models/props/de_tides/vending_turtle.mdl
[/code]
Models that are "Missing":
[code]
axe: models/props/cs_militia/axe.mdl
bananabunch: models/props/cs_italy/bananna_bunch.mdl
banana: models/props/cs_italy/bananna.mdl
toothbrush: models/props/cs_militia/toothbrushset01.mdl
circlesaw: models/props/cs_militia/circularsaw01.mdl
orange: models/props/cs_italy/orange.mdl
turtle: models/props/de_tides/vending_turtle.mdl
[/code]
Does anyone know why these models saying missing?
do you have CS:S mounted on the server?
yes i've used this server with prop hunt. Nothing shows as purple or errors even the models that are "Missing"
Solved, friend helped me :)
Sorry, you need to Log In to post a reply to this thread.