Raised This Month: $ Target: $400
 0% 

Question about changing entity type


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
finishlast
Senior Member
Join Date: Nov 2018
Location: In Reno with the vitamin
Old 11-01-2024 , 14:05   Question about changing entity type
Reply With Quote #1

Hello there,

just out of curiosity, is it possible to change the type of an entity?

I know that I could simply read the pos and ang then delete the prop_dynamic and spawn a new one as prop_physics at the same locations and angle.

But is it possible to change the original entity to become prop_physics?

Example, when you have pills lying around on the map, they are normally "fixed" and cant be shot.

When you manually spawn them by

int ent=CreateEntityByName("weapon_pain_pills");

They are "shootable".

Is there any way to change that on the fly?!
__________________
finishlast is offline
Earendil
Senior Member
Join Date: Jan 2020
Location: Spain
Old 11-04-2024 , 09:07   Re: Question about changing entity type
Reply With Quote #2

From my experience 10-12 years ago making maps: Yes its possible, but there is a high chance to cause serious bugs or even server crashes.
So I would you recomend to just get entity position, spawn a new one with the entity type you want in that position with the properties you want and destroy the old one.

Just a safer way to spawn a "weapon_pain_pills" and destroy the "weapon_pain_pills_spawn".
__________________
>>My plugins<<
>>GitHub<<

Last edited by Earendil; 11-04-2024 at 09:08.
Earendil 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 15:54.


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