Raised This Month: $ Target: $400
 0% 

Copy Ent?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Unidentified
Senior Member
Join Date: Aug 2005
Location: Compton, L.A. Thug
Old 12-12-2005 , 20:19   Copy Ent?
Reply With Quote #1

Okay, let's say I want to copy an existing door on the map, but give It a new entid(If cannot do, nvm then). Anyways, I want to copy an existing door entity to a new origin. How would I do this?
Unidentified is offline
Ingram
Veteran Member
Join Date: May 2004
Old 12-13-2005 , 01:38  
Reply With Quote #2

copying doors might be a little tricky, basically they use more keyvalues than engine can get (to my knowledge), so if you wanted the door to rotate, you'd have to record them on map start. You could just make a wall (not rotating door) with the size and model of the door by copying the keyvalues that engine allows from the original door to the new door.
Ingram is offline
atomic
Veteran Member
Join Date: Jan 2005
Location: What The Foot?
Old 12-13-2005 , 09:00  
Reply With Quote #3

That would be like copying a ladder, that is impossible!
__________________
atomic is offline
Cheap_Suit
Veteran Member
Join Date: May 2004
Old 12-13-2005 , 11:58  
Reply With Quote #4

Look at the code in Plant Anywhere by KRoTaL. I remember seeing something like this but with the bombsite.
__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.
Cheap_Suit is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 12-13-2005 , 14:48  
Reply With Quote #5

It is, in theory, possible to copy any entity.
What I would do is this:

Create a global dynamic array using Array module.
Hook create_entity in FM, both of them.

On each create_entity, make a dynamic keytable, and store its index into the global dynamic array, at the index which is its ent ID.

Use engine or FM to hook when key/values are initialized, and store all entity key/values into the dynamic keytable represented by their entID's.

Now you have a massive table of all the entities, and all of their key/values. From this, you can completely copy an entity.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 12-13-2005 , 14:49  
Reply With Quote #6

Quote:
Originally Posted by atomic
That would be like copying a ladder, that is impossible!
Copying doors is very possible...
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Ingram
Veteran Member
Join Date: May 2004
Old 12-13-2005 , 15:11  
Reply With Quote #7

Twilight Suzuka, i did that using ur ArrayX plugin, but i haven't really tested it, kinda stopped running a server. I'm now thinking i change it to nvault. You took over entmoving anyway (well not really, but u said u did), so i guess it doesn't really matter

atomic copying a ladder is possible, the part you actually climb is called func_ladder. When you just copy the model thats on top of func_ladder, there is just nothing for you to climb
Ingram is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 12-13-2005 , 15:16  
Reply With Quote #8

Array module is now part of default lineup ^^
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
Unidentified
Senior Member
Join Date: Aug 2005
Location: Compton, L.A. Thug
Old 12-13-2005 , 18:35  
Reply With Quote #9

I'm confused. Would someone help?

Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <engine> #define PLUGIN "New Plugin" #define VERSION "1.0" #define AUTHOR "Author" new entity = create_entity("func_door") public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     } public newdoor(){     find_ent_by_class("entid, classname")     entity_get_string(" ) // this part confuses me         // bah...

:/ entities confuse me
Unidentified is offline
Unidentified
Senior Member
Join Date: Aug 2005
Location: Compton, L.A. Thug
Old 12-13-2005 , 21:08  
Reply With Quote #10

Okay, I think I understand It a little better. Would this work?

Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <engine> #define PLUGIN "New Plugin" #define VERSION "1.0" #define AUTHOR "Author" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)                 // Would I need a set_task here?     } public newdoor(){     new entity = create_entity("func_door")     entity_set_origin("604 477 -155")         entity_set_int(ent,EV_INT_solid, 2)         entity_set_string(ent,EV_SZ_classname,"model");     entity_set_model(ent,"models/mymodel.mdl");         return PLUGIN_HANDLED }

If It would work, would there be any strange affects or anything?
Unidentified 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 15:48.


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