Raised This Month: $ Target: $400
 0% 

No model is spawning


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
r00tage
Senior Member
Join Date: Nov 2008
Old 01-05-2011 , 14:35   No model is spawning
Reply With Quote #1

Code:
flagEnt[index] = CreateEntityByName("prop_dynamic_override");
if (flagEnt[index] != -1)
{
	DispatchKeyValue(flagEnt[index], "solid", "6");
	DispatchKeyValue(flagEnt[index], "model", "models/props/slow/bluetube/slow_bluetube.mdl");
	DispatchSpawn(flagEnt[index]);
	SetEntityModel(flagEnt[index], "models/props/slow/bluetube/slow_bluetube.mdl");
	TeleportEntity(flagEnt[index], vec, NULL_VECTOR, NULL_VECTOR);
	PrintToServer("Created flag");
	PrintToServer("Flag created at: %f %f %f", vec[0], vec[1], vec[2]);
}
Any ideas as to why the model wont spawn?
r00tage is offline
Leonardo
Veteran Member
Join Date: Feb 2010
Location: 90's
Old 01-05-2011 , 14:44   Re: No model is spawning
Reply With Quote #2

model isn't precached?
__________________
Leonardo is offline
r00tage
Senior Member
Join Date: Nov 2008
Old 01-05-2011 , 14:48   Re: No model is spawning
Reply With Quote #3

In the method OnMapStart I have a method called PrecacheModels() which gets called.

In PrecacheModels(), the following line should have precached the model.

PrecacheModel("models/props/slow/bluetube/slow_bluetube.mdl");

Though my console has no errors about late precache or anything else.
r00tage is offline
Leonardo
Veteran Member
Join Date: Feb 2010
Location: 90's
Old 01-05-2011 , 14:51   Re: No model is spawning
Reply With Quote #4

wrong origin?
__________________
Leonardo is offline
r00tage
Senior Member
Join Date: Nov 2008
Old 01-05-2011 , 16:15   Re: No model is spawning
Reply With Quote #5

Correct origin as well =/
r00tage is offline
Monkeys
Veteran Member
Join Date: Jan 2010
Old 01-05-2011 , 16:45   Re: No model is spawning
Reply With Quote #6

It's possible your client doesn't have the required models, or simply didn't load them. (This sometimes happens for me on first attempts)

Try doing it with a standard model and see if it shows up.

And no need to set the model twice.


For the sake of completion: Is your location perhaps close to a wall/floor?
It's possible the angle causes it to appear inside that, or it simply fell through.
__________________
Get a lid on that zombie,
he's never gonna be alri-i-ight.
Oooh get a lid on that zombie,
or he's gonna feed all night.
Monkeys is offline
Leonardo
Veteran Member
Join Date: Feb 2010
Location: 90's
Old 01-05-2011 , 20:12   Re: No model is spawning
Reply With Quote #7

Quote:
Originally Posted by Monkeys View Post
client doesn't have the required models
then you will see this
__________________
Leonardo is offline
Monkeys
Veteran Member
Join Date: Jan 2010
Old 01-05-2011 , 21:16   Re: No model is spawning
Reply With Quote #8

Quote:
Originally Posted by Leonardo View Post
then you will see this
Not always, some odd occurances it simply doesn't show/prints an error in console.
__________________
Get a lid on that zombie,
he's never gonna be alri-i-ight.
Oooh get a lid on that zombie,
or he's gonna feed all night.
Monkeys is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 01-06-2011 , 02:29   Re: No model is spawning
Reply With Quote #9

Try without the solid flag. I attempted to spawn a prop_physics today and this flag (and others) made it invisible. Also does it show if you spawn as a "prop_dynamic" instead?

As said SetEntityModel() and DispatchKeyValue(index, "model", "blah.mdl") are the same.
__________________
Silvers is offline
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 01-06-2011 , 07:59   Re: No model is spawning
Reply With Quote #10

have you tried to activate the entity after spawning it.

Last edited by blodia; 01-06-2011 at 08:01.
blodia is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:11.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode