Raised This Month: $ Target: $400
 0% 

removing entity members


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
commonbullet
Veteran Member
Join Date: Oct 2005
Old 11-04-2005 , 23:05   removing entity members
Reply With Quote #1

I wonder if there's a way to remove an entity member
i.e. removing the "target" entry of a func_button
(not the same as setting target to a string like "").

thanks.
commonbullet is offline
Send a message via ICQ to commonbullet Send a message via MSN to commonbullet
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 11-04-2005 , 23:10  
Reply With Quote #2

You mean classname:

"info_target"

to

"info_"

? I don't get it.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 11-04-2005 , 23:17  
Reply With Quote #3

Code:
// assuming "ent" is your func_button  new target[32];  entity_get_string(ent,EV_SZ_target,target,31);  new tEnt = find_ent_by_tname(-1,target);  if(is_valid_ent(tEnt)) remove_entity(tEnt);
XxAvalanchexX is offline
commonbullet
Veteran Member
Join Date: Oct 2005
Old 11-04-2005 , 23:40  
Reply With Quote #4

I mean a property of a entity.
Let's take this example of a func_breakable.
These are some values of an entity recorded into the bsp file:
Code:
{
"model" "*54"
"explodemagnitude" "40"
"spawnobject" "0"
"explosion" "0"
"material" "6"
"health" "550"
"delay" "0"
"target" "spy_dev_destroyed"
"rendercolor" "0 0 0"
"renderamt" "0"
"classname" "func_breakable"
}
I know i can pick up or change these values with engine functions like
entity_get_string, entity_set_int, etc...
But I wonder if remove a property like "target", instead of setting it to an empty string...
commonbullet is offline
Send a message via ICQ to commonbullet Send a message via MSN to commonbullet
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 11-05-2005 , 00:37  
Reply With Quote #5

I don't think you can, Pawn has no NULL. When would you need to completely null it instead of having it as an empty string?
XxAvalanchexX is offline
commonbullet
Veteran Member
Join Date: Oct 2005
Old 11-05-2005 , 07:55  
Reply With Quote #6

doors for instance...
if a door has got any targetname reference, like targetname="";
this will cause it to be opened only with a external link, like buttons, etc.

I'll try to copy the entire entity members collection, remove the entity and then respawn it only with the desired properties.
commonbullet is offline
Send a message via ICQ to commonbullet Send a message via MSN to commonbullet
commonbullet
Veteran Member
Join Date: Oct 2005
Old 11-05-2005 , 09:48  
Reply With Quote #7

but I can't find some indexes correspondence in Engine constants.
i.e.,
what's is the key for "delay" property?
there's nothing like ENV_FL_delay...

Is there any reference somewhere in SDK?
commonbullet is offline
Send a message via ICQ to commonbullet Send a message via MSN to commonbullet
commonbullet
Veteran Member
Join Date: Oct 2005
Old 11-05-2005 , 14:15  
Reply With Quote #8

I'm sorry. Maybe I'm getting a little non-sense.
I'm too newbie...

The question is simpler:
How can I read the "delay" or "wait" property of a func_door?
commonbullet is offline
Send a message via ICQ to commonbullet Send a message via MSN to commonbullet
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 11-05-2005 , 14:38  
Reply With Quote #9

You'd have to do something like this...

Code:
public pfn_keyvalue(ent) {    new classname[32], keyname[32], keyvalue[32];    copy_keyvalue(classname,31,keyname,31,keyvalue,31);    if(equali(classname,"func_door") && equali(keyname,"wait")) {       entity_set_float(ent,EV_FL_fuser1,floatstr(keyvalue));    }    else if(equali(classname,"func_door") && equali(keyname,"delay")) {       entity_set_float(ent,EV_FL_fuser2,floatstr(keyvalue));    } }

This hooks keyvalues being set and then will store "wait" and "delay" in seperate containers within a func_door. Use EV_FL_fuser1 and EV_FL_fuser2 to retrieve them.
XxAvalanchexX is offline
commonbullet
Veteran Member
Join Date: Oct 2005
Old 11-05-2005 , 17:39  
Reply With Quote #10

Thank you. I'll try it.

How do these forwards work? I mean, when are these values being set?
Is there any reference to it?
commonbullet is offline
Send a message via ICQ to commonbullet Send a message via MSN to commonbullet
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 23:40.


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