Raised This Month: $ Target: $400
 0% 

Spawning working entities in NS -solved


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Rorthic
Junior Member
Join Date: Apr 2005
Old 05-16-2005 , 00:28   Spawning working entities in NS -solved
Reply With Quote #1

i want to spawn a armory in ns that works, but i cant seem to get it right.

i have this

Code:
public cmdArmory(id) {     new ent     ent = create_entity("team_armory")     new Float:origin[3]         entity_set_model(ent,"models/b_armory.mdl")         entity_set_int(ent, EV_INT_movetype, 6)     entity_get_vector(id,EV_VEC_origin,origin);         entity_set_origin ( ent, origin )     origin[2] += 100.0 //moves player out of the way 2 is up     entity_set_origin(id,origin)         entity_set_int(ent, EV_INT_solid, 1)     //entity_set_float(ent,EV_FL_animtime,2.0)     //entity_set_float(ent,EV_FL_framerate,1.0)     //entity_set_int(ent,EV_INT_sequence,0);         return PLUGIN_HANDLED; }

it spawns it but it isnt solid and it dosent do anything but sit there. Any ideas?
Rorthic is offline
sambro
Member
Join Date: May 2005
Old 05-16-2005 , 03:02  
Reply With Quote #2

I had this problem too, when I tried changing a hostage model in CS.

I fixed it by calling DispatchSpawn(id).

Code:
public cmdArmory(id) {     new ent     ent = create_entity("team_armory")     new Float:origin[3]         entity_set_model(ent,"models/b_armory.mdl")         entity_set_int(ent, EV_INT_movetype, 6)     entity_get_vector(id,EV_VEC_origin,origin);         entity_set_origin ( ent, origin )     origin[2] += 100.0 //moves player out of the way 2 is up     entity_set_origin(id,origin)         entity_set_int(ent, EV_INT_solid, 1)     //entity_set_float(ent,EV_FL_animtime,2.0)     //entity_set_float(ent,EV_FL_framerate,1.0)     //entity_set_int(ent,EV_INT_sequence,0);     DispatchSpawn(ent);     return PLUGIN_HANDLED; }
sambro is offline
Send a message via MSN to sambro
Rorthic
Junior Member
Join Date: Apr 2005
Old 05-16-2005 , 21:09  
Reply With Quote #3

DispatchSpawn(ent); made it solid but it still isnt functioning. it just sits there, cant be built and cant be used. Im wondering if there is a command that allows the ent to be used?
Rorthic is offline
karlos
Veteran Member
Join Date: Apr 2004
Location: Germany/Poland
Old 05-17-2005 , 06:19  
Reply With Quote #4

try to set EV_FL_fuser1
it is the status to define if its already build or inbuilt
1000.0 = built
everything below = building it

also set EV_INT_sequence to something bigger 0
and EV_INT_solid set to 2

maybe it helps
__________________
alias White Panther
karlos is offline
Rorthic
Junior Member
Join Date: Apr 2005
Old 05-17-2005 , 17:50  
Reply With Quote #5

still no luck, its there and solid but not usable. you would think there would be an easy, its built into the game.
Rorthic is offline
Rorthic
Junior Member
Join Date: Apr 2005
Old 05-20-2005 , 20:47  
Reply With Quote #6

this answer comes from the plugin combat buildings by #endgame at modns
http://www.modns.org/forums/index.php?showtopic=1345

Code:
public cmdArmory(id) {     new team = get_team(id);     new name[] = "team_armory" //added for testing     new ent = create_entity(name); //greate the entity?     new Float:origin[3]; //create a value to hold origin     entity_get_vector(id, EV_VEC_origin,origin); //not sure what this does     entity_set_origin(ent,origin); //set the entities origin     DispatchSpawn(ent); //spawn the entity     set_pev(ent,pev_fuser1,0); //set fuser1 to 0 not sure what fuser is     set_pev(ent,pev_fuser2,500); //set fuser2 to 500 not sure what it is     set_pev(ent,pev_team,team); //assign a team to the entity     ns_set_struct_owner(ent, id); //assign an owner to the entity     return PLUGIN_HANDLED; } get_team(id){ //gets the team to assign to an entity, note: not all classes are listed.     new class = ns_get_class(id);     if((class == CLASS_MARINE) || (class == CLASS_JETPACK) || (class == CLASS_HEAVY))         return MARINE;     return ALIEN; }

this will spawn a working armory for what ever team the user is on. the code is probable a bit rough for use with NS classic, it came from a combat plugin.
Rorthic 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 16:48.


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