Raised This Month: $32 Target: $400
 8% 

Entity not being created


Post New Thread Reply   
 
Thread Tools Display Modes
SpirT
Senior Member
Join Date: Sep 2018
Location: Portugal
Old 04-05-2021 , 05:55   Re: Entity not being created
Reply With Quote #11

Quote:
Originally Posted by andi67 View Post
Change prop_dynamic to prop_physics.....
I tried with prop_physics the entity (with the model, at least I couldn't see anything in game) won't even spawn...
__________________

Last edited by SpirT; 04-05-2021 at 05:56.
SpirT is offline
andi67
Veteran Member
Join Date: Mar 2007
Location: Somewhere near you!!!
Old 04-05-2021 , 08:05   Re: Entity not being created
Reply With Quote #12

Well is it a custommodel? Does it have a phymodel(ex "model.phy")? Also make sure your model is precached OnMapStart....
__________________
Waiting for HL3,Day of Defeat3 ,but will it ever come? So I'm gonna play COD WW2.>>>>SM_SKINCHOOSER<<<<
>>You need Models for DODS/CSS/CSGO , than click here!!!<<

Last edited by andi67; 04-05-2021 at 08:06.
andi67 is offline
SpirT
Senior Member
Join Date: Sep 2018
Location: Portugal
Old 04-05-2021 , 11:57   Re: Entity not being created
Reply With Quote #13

Quote:
Originally Posted by andi67 View Post
Well is it a custommodel? Does it have a phymodel(ex "model.phy")? Also make sure your model is precached OnMapStart....
Yes it is. No, it doesn't have any .phy. How am I able to create it?

EDIT: Would this be the proper way?
__________________

Last edited by SpirT; 04-05-2021 at 12:24.
SpirT is offline
andi67
Veteran Member
Join Date: Mar 2007
Location: Somewhere near you!!!
Old 04-05-2021 , 13:46   Re: Entity not being created
Reply With Quote #14

If you know how to model itīs easy if not itīs been a hard time for you but you could also use another prop_physics model make it invisible than parent your prop_dynamic to it so it will fall to the ground. Another way would be get the position of your model make a trace to the ground and teleport it x units per 0.1 second timer in direction to the ground.....
__________________
Waiting for HL3,Day of Defeat3 ,but will it ever come? So I'm gonna play COD WW2.>>>>SM_SKINCHOOSER<<<<
>>You need Models for DODS/CSS/CSGO , than click here!!!<<

Last edited by andi67; 04-05-2021 at 13:47.
andi67 is offline
SpirT
Senior Member
Join Date: Sep 2018
Location: Portugal
Old 04-05-2021 , 14:28   Re: Entity not being created
Reply With Quote #15

Quote:
Originally Posted by andi67 View Post
If you know how to model itīs easy if not itīs been a hard time for you but you could also use another prop_physics model make it invisible than parent your prop_dynamic to it so it will fall to the ground. Another way would be get the position of your model make a trace to the ground and teleport it x units per 0.1 second timer in direction to the ground.....
I just port models, I don't know how to model on my own. Could you give an example of how to that (teleporting the entity with the trace to the ground)?

Regards.
__________________
SpirT is offline
andi67
Veteran Member
Join Date: Mar 2007
Location: Somewhere near you!!!
Old 04-06-2021 , 12:47   Re: Entity not being created
Reply With Quote #16

Well you could try something like this as example(not tested):


At the beginning of your script:
Code:
#define DYNAMIC_MODEL	"models/weapons/spirtmodels/entityspawn.mdl"  // replace with your model
#define PHYSICS_MODEL	"models/gibs/hgibs.mdl"  //replace with a  model that has a phymodel



Code:
    int coin;
    float position[3];
    GetClientEyePosition(client, position);
	
	int phymdl = CreateEntityByName("prop_physics");
	if(IsValidEdict(phymdl))
	{	
		DispatchKeyValue(phymdl,"model", PHYSICS_MODEL); 
		DispatchKeyValue(phymdl,"SpawnFlags", "4");		
		DispatchSpawn(phymdl); 
		TeleportEntity(phymdl , position, NULL_VECTOR, NULL_VECTOR);
		SetEntityRenderMode(phymdl,  RENDER_TRANSCOLOR);
		SetEntityRenderColor(phymdl, 0, 0, 0, 0);
		

		float pos[3];
		float ang[3];
		
		GetEntPropVector(phymdl, Prop_Data, "m_vecOrigin",pos);
		GetEntPropVector(phymdl, Prop_Data, "m_angRotation",ang);		
		
	    if((coin = CreateEntityByName("prop_dynamic")) != -1)
	    {
	        PrintToChatAll("Entity is valid");

	        TeleportEntity(coin, pos, ang, NULL_VECTOR);
	        PrintToChatAll("Entity teleported to position %f", position);
        
	        DispatchKeyValue(coin, "model", DYNAMIC_MODEL);
	        PrintToChatAll("Coin model was set to %s", DYNAMIC_MODEL);
	        DispatchKeyValue(coin, "massScale", "8.0");
	        DispatchKeyValue(coin, "physicsmode", "2");
	        DispatchSpawn(coin);
        
	        SetEntProp(coin, Prop_Send, "m_usSolidFlags", 8);
	        SetEntProp(coin, Prop_Send, "m_CollisionGroup", 11);
	        
			SetVariantString("!activator");
			AcceptEntityInput(coin, "SetParent", phymdl, coin, 0);	
	        
	        
	        CreateTimer(1.0, CreateMessage,coin,TIMER_FLAG_NO_MAPCHANGE);	
		}
	}
__________________
Waiting for HL3,Day of Defeat3 ,but will it ever come? So I'm gonna play COD WW2.>>>>SM_SKINCHOOSER<<<<
>>You need Models for DODS/CSS/CSGO , than click here!!!<<

Last edited by andi67; 04-06-2021 at 12:48.
andi67 is offline
Reply


Thread Tools
Display Modes

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 19:09.


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