Talk:Authoring a Model Entity

From Valve Developer Community
Jump to: navigation, search

No idea why but it just doesn't move after compiling cpp/vmf. I double checked the whole tutorial and ended up just copying the provided source over my own code, and still nothing. I tried moving the model around, made sure hammer pointed to the .fgd, starting it toggled, but nothing. I will keep trying and will post if something works. Jazmeister 01:22, 7 Apr 2008 (PDT)

Actually, it turned out to be the toggling. I somehow missed the bit about putting "ent_fire my_model_entity toggle" into the console. Well, it still counts as progress; at least one other person will be as daft as me. Jazmeister 01:25, 7 Apr 2008 (PDT)
Thanks for that. I added a note about it near the beginning. --TomEdwards 06:51, 7 Apr 2008 (PDT)
Hmmm. If implemented properly, and with some code for death and fear, this could make a generic civilian entity for a MP MOD. (Imagine CS:S on the streets with bystanders) --JeffMOD 13:49, 7 Sep 2008 (PDT)

Hey, I have found out how to make this so that you can choose the model, cick here and there is the code for it MLSTRM

After checking and rechecking all my code, and pasting the code in and compiling and checking that hammer was configured correctly I still cannot stop the model from being created halfway into a wall, no matter where I aim at. what am I doing wrong? sync

You're not doing anything wrong. The advice to use a console command to spawn the entity is bad (and has been removed); place it in Hammer instead. --TomEdwards 21:06, 4 April 2009 (UTC)

Ok I don't know what's up with this. I typed out all the code, and ran into a problem boiling down to this: SetNextThink(int, float) is PRIVATE. SetNextThink(float, const char) is public. Since this code uses the (int, float) variation, I had to go into baseentity.h and isolate the block where "//Sets/Gets the next think based on context index" to be protected/public. Well, after doing that, testing crashed when the Toggle was fired, for a bad memory read. I went back and took the provided full code and used it to overwrite all I had written. I put the SetNextThink(int, float) back to private and recompiled, and found no problems. I still cannot figure out what I had different; I had the inheritance the same, same order of lines of code, same everything.. so, whatever. --DaSwish 16:12, 18 July 2010 (EDT)

Problem with Movement

I had this problem when I first tried my model out - It wouldn't move, It glitched periodically (in time with the think delay) in place, then went back to its default position.

It turned out that I had placed my entity too close to the floor. I simply moved it up a little bit in hammer and it flew around the room quite happily.


  • "Remember why we put void in front of all of our functions?"

Why is this asked in the Tip in the MoveThink() section? Maybe it should be made clearer by giving the answer or a hint? Or perhaps be removed altogether? --Kodak 08:27, 30 January 2009 (UTC)

No model showing

Hi, I can't see any model! I've followed both this tutorial and the one on logical entities, and everything compiles fine in VS. I've dubble checked the path in Hammer, making sure it's right, and I've tried to write "ent_fire my_model_entity toggle" several times, before loading the map, after that, before loading the guns after that... Nothing works. Help? --Kweiko 07 Jun 2009 01:09

Have you placed it in the map? --TomEdwards 10:31, 7 June 2009 (UTC)
I can't believe I missed that first sentence! Thank! However, I still have problems with the map. I use sdk_shaders_sample.bsp and apparently you can't open .bsp-files in Hammer, so I just used some .vmf-file and put something in it in Hammer, but now it's not playable. -.-' I googled a bit but I'm not really sure what to search for... :( --Kweiko 07 Jun 2009 15:11
EDIT: Suddenly I had a .bsp, .log and a .vmx-file of the .vmf-file I used in Hammer. I don't know what I did to make them appear but I got an error when trying to write "map npc_gman_overwatch" in the console when I started my mod:
"Engine Error
13/trigger_gman_overwatch_&i - trigger_once: UTIL_SetModel: not precached: *2"
I really have no idea what's going on anymore õ.Ó --Kweiko 07 Jun 2009 17:39
Take a look at the Hammer documentation. BTW, you didn't miss the sentence - I only just added it! ;-) --TomEdwards 16:12, 7 June 2009 (UTC)
The thing is, in my course we were told to concentrate more on the programming part, that's why I didn't care much about Hammer, but since I had major problems with maps and .bps and .vmf-files, I couldn't figure out how to place my entity in the map, so I chose a video tutorial about how to make a map, followed it, put my_model_entity in there and now everything's just fine ;) Thanx! --Kweiko 14 Jun 2009 18:03