Beginner modelling problem - model displays as ERROR
0 replies, posted
Hi. I want to make a new prop model - specifically a power pylon, but for now just a cube. This is the first time I've tried to get a model into Garry's Mod, but not my first time modelling in Blender. I'm testing this on a local dedicated server. I've got stuck somewhere, and I'm not sure what I'm doing wrong. My model appears as an ERROR, but I can move it around with the physgun and gravgun, and it also looks like it was downloaded successfully.
It looks like the problem is with downloading the model to the client, but since Source tends to be finicky and since this is my first time making a model for Garry's Mod, I'll include the full details of what I did and what happened. (Maybe I need to set some weird property in the QC file to make it render correctly, or something)
I've created a cube in Blender. I've parented it to a bone, since I read somewhere that all Source models need to have at least one bone - correct me if this is wrong. Screenshot: [url]http://puu.sh/kU7LU.png[/url]
I haven't assigned a material yet. At this point I'm expecting it to show as the default pink and black checkerboard.
I exported it to an SMD file, then compiled it, with Blender Source Tools. My QC file contains:
[code]
$modelname "../addons/immibis/models/immibis/resourcerp/powerpole1.mdl"
$body powerpole1 "powerpole1.smd"
$staticprop
$surfaceprop combine_metal
$cdmaterials "models/immibis/resourcerp"
$sequence idle "powerpole1.smd"
$collisionmodel "powerpole1.smd"
[/code]
Compilation is successful, and generates .mdl, .phy, .vvd, .dx80.vtx, .dx90.vtx and .sw.vtx files.
I then created the file addons/immibis/lua/autorun/immibis_content.lua, containing:
[code]
if SERVER then
resource.AddFile("models/immibis/resourcerp/powerpole1.mdl")
end
util.PrecacheModel("models/immibis/resourcerp/powerpole1.mdl")
[/code]
I then started SRCDS, and connected to it. I used Lua to spawn a prop with this model (they don't seem to appear in any spawn list), but it appeared as a flashing red ERROR. Screenshot: [url]http://puu.sh/kU8Xi.jpg[/url] (although if you've played Garry's Mod for any length of time, I'm sure you know what the ERROR model looks like)
I've tested a few things, and it looks like the server loaded the model properly. I can move it around with the physgun or gravgun, and it behaves as I'd expect a cube to behave (e.g. it can lie flat on any side). If I look at where the cube should be, and run this in the server console, it prints the entity, indicating that the server knows I'm looking at the prop:
[code]
lua_run print(player.GetAll()[1]:GetEyeTrace().Entity)
[/code]
The same command on the client (with lua_run_cl) prints Entity[0][worldspawn], so the client does not know I'm looking at the prop.
The model files appear to have been downloaded, since the following command prints "true":
[code]
lua_run_cl print(file.Exists("models/immibis/resourcerp/powerpole1.mdl", "GAME"))
[/code]
and they also appear in the output of:
[code]
dumpstringtables_new downloadables
[/code]
[editline]23rd October 2015[/editline]
Update: I copied the compiled model to my client, and it works as expected. So, definitely a problem with downloading.
Sorry, you need to Log In to post a reply to this thread.