How to recreate some entities
With the new CSDM 2.1 at activating the mod some entities get removed from the map (hostage rescue zones, hostages, bomb zones, bomb, vip escape zones, some weapons they are on fy_xx maps on the ground etc). My problem is - if someone wants to disable CSDM - these entities should be recreated to continue the game with normal CS playing.
I have no idea what the data should I store (to use it later to recreate those entities), how to do it (in which moment I should store it etc). And also I don't know how should look the correct procedure with setting the properties of the recreated entity and the right moment with recreating it. I'm a person which can get the idea of coding when I have the working example of code and some theory. If there is only the theory - it's nothing for me. So if someone could write for me the working example of recreating for one of these entities listed above with eventually the info what should I store and then use with recreate for others entities - it would be sufficient for me and I will be very thankful. |
Re: How to recreate some entities
Example of brush-based entites (tested and works):
Code:
Still working on point-based entities. |
Re: How to recreate some entities
This works on point-based entities.
Code:
However, there is a catch: this doesn't work with Condition Zero hostages; the game crashes shortly after spawning them. However, I tested it in regular Counter-Strike, and it worked succesfully. |
Re: How to recreate some entities
Code:
This code will make linux server crash when hostages are removed. |
Re: How to recreate some entities
Oh. What for?
|
Re: How to recreate some entities
Counter Strike cache the hostage into memory somewhere. For windows it doesn't care if you remove hostage but for linux it does care. It will crash the server on the hostage removal. You have to hook FM_Spawn and remove it before the server caches the hostage.
|
Re: How to recreate some entities
Quote:
What about "info_hostage_rescue"? what the data should be stored (as sufficient to recreate it)? The same about the bomb Ts are carrying on their back. Quote:
|
Re: How to recreate some entities
Quote:
It is linux server that only care and will crash if you remove hostages at any other time then FM_Spawn from my experience when I had a linux server. Also that why CSDM and Twisted DeathMatch uses that method. |
Re: How to recreate some entities
KWo: For info_hostage_rescue, probably all you need to store is the origin. Also, there is no entity for the bomb on a Terrorist's back.
I don't know if it would work for you, but if you can find your way through GunGame's code you can see how I dynamically switch between objectives enabled and disabled (just search for gg_block_objectives). |
Re: How to recreate some entities
Quote:
@XxAvalanchexX - thank You. I'll try Your methods. :) |
All times are GMT -4. The time now is 13:07. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.