Models crash Hammer - help? Created 9 years ago2015-11-24 08:52:26 UTC by Dallas Dallas

Created 9 years ago2015-11-24 08:52:26 UTC by Dallas Dallas

Posted 9 years ago2015-11-24 08:52:26 UTC Post #327517
Hello there,

I've been working on a single player HL1 map using hammer 3.5.2.

Any time I try and point a env_sprite, or a cycler_sprite to a custom model (.mdl) I have made hammer crashes. Any time I try and load a .rmf that has an entity pointing to a custom model in it Hammer errors out with an "out of memory."

I seem to have read a few places that this latest version of hammer for HL1 maps has issues with custom models - what are the fixes or workarounds to this problem? Do I need to place my .mdl's somewhere special in addition to my mod folder so that hammer can properly understand them?

How can I add custom .mdls to my map?

Thanks for your help.
Posted 9 years ago2015-11-24 10:01:25 UTC Post #327520
I've been using Penguinboy's map editor: Sledge for a while now.
It works almost exactly like hammer does, with a few tweaks.

Sledge supports texture transparency, model rendering, and a bunch of other improvements.
Tetsu0 Tetsu0Positive Chaos
Posted 9 years ago2015-11-24 14:46:09 UTC Post #327525
The workaround is not to have the models in a place that Hammer can see them. Hammer won't crash if it doesn't try to render the model.

You can still place them in your map, they will just show as colored blocks like the other entities.
Posted 9 years ago2015-11-24 16:41:21 UTC Post #327527
my 3.5 doesnt crash but it needed some fix in the .cfg
Posted 9 years ago2015-11-24 17:49:53 UTC Post #327529
Instead of using models/model.mdl try this instead models\model.mdl. It prevents hammer from rendering the model and it can be used that way.
Suparsonik SuparsonikI'm going off the edge to meet my maker.
Posted 9 years ago2015-11-24 20:19:40 UTC Post #327530
If your Hammer crashes when using models it means that there's something wrong in the FGD you're using.
I have no issues with model rendering in Hammer. I'll post my cycler, cycler_sprite and env_model strings from my FGDs, it might help:

CYCLER:

[quote]@PointClass base(Targetname, Angles, Sequence) size(-16 -16 0, 16 16 72) studio() = cycler : "Monster Cycler"
[
model(studio) : "Model"
renderfx(choices) :"Render FX" : 0 =
[
	0: "Normal"
	1: "Slow Pulse"
	2: "Fast Pulse"
	3: "Slow Wide Pulse"
	4: "Fast Wide Pulse"
	9: "Slow Strobe"
	10: "Fast Strobe"
	11: "Faster Strobe"
	12: "Slow Flicker"
	13: "Fast Flicker"
	5: "Slow Fade Away"
	6: "Fast Fade Away"
	7: "Slow Become Solid"
	8: "Fast Become Solid"
	14: "Constant Glow"
	15: "Distort"
	16: "Hologram (Distort + fade)"
]
rendermode(choices) : "Render Mode" : 0 =
[
	0: "Normal"
	1: "Color"
	2: "Texture"
	3: "Glow"
	4: "Solid"
	5: "Additive"
]
renderamt(integer) : "FX Amount (1 - 255)"
rendercolor(color255) : "FX Color (R G B)" : "0 0 0"
][/quote]

CYCLER_SPRITE:

[quote]@PointClass base(Targetname, Angles) sprite() = cycler_sprite : "Sprite Cycler"
[
model(sprite) : "Sprite"
framerate(integer) : "Frames per second" : 10
renderfx(choices) :"Render FX" : 0 =
[
	0: "Normal"
	1: "Slow Pulse"
	2: "Fast Pulse"
	3: "Slow Wide Pulse"
	4: "Fast Wide Pulse"
	9: "Slow Strobe"
	10: "Fast Strobe"
	11: "Faster Strobe"
	12: "Slow Flicker"
	13: "Fast Flicker"
	5: "Slow Fade Away"
	6: "Fast Fade Away"
	7: "Slow Become Solid"
	8: "Fast Become Solid"
	14: "Constant Glow"
	15: "Distort"
	16: "Hologram (Distort + fade)"
]
rendermode(choices) : "Render Mode" : 0 =
[
	0: "Normal"
	1: "Color"
	2: "Texture"
	3: "Glow"
	4: "Solid"
	5: "Additive"
]
renderamt(integer) : "FX Amount (1 - 255)"
rendercolor(color255) : "FX Color (R G B)" : "0 0 0"
][/quote]

ENV_MODEL:

[quote]@PointClass base(Targetname, Angles, RenderFields) studio() = env_model : "New alternative to cyclers"
[
model(studio) : "Model name"
skin(integer) : "Skin" : 0
body(integer) : "Body" : 0
// NEW 1.0
scale(string) : "Scale (1.0 = normal size)"
m_iszSequence_On(string) : "Sequence when on"
m_iAction_On(choices) : "Behaviour when on" : 0 =
[
	0: "Freeze when sequence ends"
	1: "Loop"
	2: "Change state when sequence ends"
]
m_iszSequence_Off(string) : "Sequence when off"
m_iAction_Off(choices) : "Behaviour when off" : 0 =
[
	0: "Freeze when sequence ends"
	1: "Loop"
	2: "Change state when sequence ends"
]
spawnflags(flags) =
[
	1: "Initially Off" : 0
	2: "Drop to Floor" : 0
	4: "Solid" : 0
]
][/quote]

Copy and paste these strings in your FGDs replacing the old ones and it should work fine. :)
Alberto309 Alberto309weapon_spaghetti
Posted 9 years ago2015-11-25 04:44:48 UTC Post #327534
There's nothing wrong with his FGD, Alberto. He was trying to use an entity normally used only for sprites for models. Hammer doesn't like that and will crash if it tries to render a model as a sprite. I posted a simple workaround that works in my other post.
Suparsonik SuparsonikI'm going off the edge to meet my maker.
Posted 9 years ago2015-11-25 08:54:43 UTC Post #327536
Thanks for the help guys, I got it sorted. Alberto's fix works, and I can see the models in my hammer 3D view without crashing.

His FGD mimics what is shown here in snarkpit:
http://www.snarkpit.net/index.php?s=forums&f=3&t=1766
Open the fgd in notepad.
Search for "cycler_sprite" (ctrl+f).
Change the first line for this entity from

@PointClass base(Targetname, Angles) sprite() = cycler_sprite : "Sprite Cycler"

to

@PointClass base(Targetname, Angles) studio() = cycler_sprite : "Sprite Cycler"

Save the file.
Reopen Hammer.
Posted 9 years ago2015-11-25 21:51:41 UTC Post #327546
There's nothing wrong with his FGD, Alberto.
Yes, there was.

Hammer crashes if you try to render a model without the entity having the "model(studio)" field.
Obviously, a cycler_sprite entity is meant for sprites, but its name is only relative: if I create an entity called holy_shit (lol) I can do whatever I want with it, no matter what its name is as long as the render fields have what I need to have to make it work as I want.

Hope it's clear enough.
Thanks for the help guys, I got it sorted. Alberto's fix works
Glad it has worked mate. :)
Alberto309 Alberto309weapon_spaghetti
Posted 9 years ago2015-11-26 01:02:54 UTC Post #327547
There is still nothing wrong with the FGD per se considering the entity is only meant for rendering sprites, but I suppose you're right that if he wanted to use the cycler_sprite entity for models then that would work.
Suparsonik SuparsonikI'm going off the edge to meet my maker.
Posted 9 years ago2015-11-26 03:32:49 UTC Post #327549
Of course that there wasn't anything wrong in the FGD itself, but I guess you got what I meant.

Also, CS:CZ and CS:CZ-DS uses cycler_sprites for in-game models. So basically the "fix" started from them at first.
Alberto309 Alberto309weapon_spaghetti
You must be logged in to post a response.