Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Buying Back Dead Buildings
Re: Buying Back Dead Buildings [message #315214 is a reply to message #315207] Sun, 03 February 2008 03:45 Go to previous messageGo to previous message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma:
General (3 Stars)
hatstand wrote on Sun, 03 February 2008 04:42

shouldnt be *that* hard to do.... just grab the status of the building, wrap that into an if statement, have another if statement related to the cost of the building, then crate a new controller... the wf/airstrip/refineries might be a bit harder to do though, what with the zones, etc.....


Building controllers must be created on the start of the map, you cannot simply create a new one if one is dead.
You also can't really create a "spare" one either...
You have to actually bring it back from the dead.
V00d00 managed to do this, however he said that when you join the map, the client is told of the building is dead or not, when it is set to dead then the only way a client can be told that the controller is alive again is if he exits the map then rejoins for the purchase terminals to work again.
Not really a major problem for something like an AGT (although still an issue), but it's a bit of a problem for other buildings.

The server that Zunnie and Iwar created that MP-Gaming is running now makes use of this in it's ultra aow server. I may actually have a copy of the source code for it somewhere but I didn't write it and it isn't really mine to distribute.
TBH it's a totally crappy way of doing it imo, I mean honestly.. Leave and rejoin?

There are other ways of achieving the same effect, but in the strictest sense, no one has really successfully managed to bring a building back from the dead server side without the need for clients to exit then rejoin the server.

If I was going to attempt this, I would look into doing it a little more sneaky, I would perhaps try to set the health of all the buildings to 2001, then when the health of the building reaches 1, I would set it's skin type to Blamo, remove the power from the building and either move/destroy or disable somehow the purchase terminals. If it was a weapons factory then I would destroy any vehichle created immediately and refund the price to the purchaser, and apply that same type of method to the other buildings. Essentially rendering them dead (although on the PT I guess they would still show up).
Then if I wanted to bring it back to life (although really it never died) I would set it's health to 2001 again and change it's skin type back to normal.
You would also have to allow for win conditions too (i.e if all buildings health where at 1 for a particular team, then I would destroy that teams controllers).
That still isn't preferable, and just because that's the way I would do it, it doesn't mean that's the best way by a very long shot. There must be a way to do it properly, but it's deffinately out of my reach. Perhaps Silent_Kane might one day shed some light on it, I was told by v00d00 (I think) some time ago that he had managed to do it, but I never saw this for myself.



 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: need file name
Next Topic: Predator Stealth?
Goto Forum:
  


Current Time: Tue Feb 18 21:36:29 MST 2025

Total time taken to generate the page: 0.01727 seconds