Spawning NPC Ents
I've edited, changed and added to many plugins in the past, but when it comes to creating my own, I'm completely friggin scrub. I figured it was time to start learning, 'cause there isn't any other way of getting what I need out of quick-editing other plugins.
So anyway, I'm trying to spawn Solid NPC's that do nothing besides their idle animation. Here's what I have so far: Code:
Now of course, something is seriously wrong with this, cause it didn't work. I was going to use Fakemeta, but since it is my first plugin, I went with Engine for now. I'm trying to get the basics down before I move anywhere else. Also, if anyone could post any other tutorials/helpful info that isn't in the stickies and whatnot, that'd be great. Thanks in advance |
Re: Spawning NPC Ents
|
Re: Spawning NPC Ents
I saw that, but I want it to spawn NPC's at the given coords, and do this every map load, so I don't have to redo it when the map restarts.
I can also leave out the precache, since it is already in the map. |
Re: Spawning NPC Ents
I havn't bothered checking your ent creation code but the most obvious problem is that fakenpc1 is never called.
The plugin_init function is run automatically when the plugin is loaded. Remove id from fakenpc1 becuase it isn't called for a particular player. Make it "public fakenpc1() {..." Then in plugin_init add the line "fakenpc1()" and see if it works.. |
Re: Spawning NPC Ents
Quote:
Alright, I managed to get it to spawn and work. Now I'm having a problem when I try to do multiple NPC's... Code:
The part that is screwing up is the Code:
I defined and used it in the first one, but when it comes to the second one, I don't know how to "re-use" Vec and reset it's coordinates. I don't think I need 500 new Float:Vec's for all my NPC's.. There has to be another way. I'm trying to catch my mistakes early, so if anyone can help me, it'd be great. Error: Code:
Error: Array index out of bounds (variable "Vec") on line 36 |
| All times are GMT -4. The time now is 10:37. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.