Home » Renegade Discussions » Mod Forum » Buying Back Dead Buildings
Buying Back Dead Buildings [message #315170] |
Sat, 02 February 2008 18:50 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
Since i dont know anything about c++ and im doing my friend a favor since he dont have much time to do this himself =/ i want to know if anyone has a
buy back a building script that i can have? and idk how but ill return the favor back any way i could...please?
|
|
|
|
Re: Buying Back Dead Buildings [message #315201 is a reply to message #315170] |
Sat, 02 February 2008 23:35 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
well its for a freind who has a server and idk hwo to use this or have the time to learn how to make one ill take me months and months im jsut asking if someome has one there willing to let me have
|
|
|
|
Re: Buying Back Dead Buildings [message #315214 is a reply to message #315207] |
Sun, 03 February 2008 03:45 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
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.
|
|
|
|
|
Re: Buying Back Dead Buildings [message #315219 is a reply to message #315218] |
Sun, 03 February 2008 04:11 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
MadRockz wrote on Sun, 03 February 2008 05:56 | Kamuix_Rebuild_Structure_Zone
|
That script will create a preset, the buildings are not presets.
Commands->Create_Object(preset,spawn_position);
Where the preset variable is defined as:
preset = Get_Parameter("Preset");
|
|
|
|
|
Re: Buying Back Dead Buildings [message #315279 is a reply to message #315275] |
Sun, 03 February 2008 15:16 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
Yrr wrote on Sun, 03 February 2008 17:00 | Get Resurrection, enable revivable buildings in configuration and attach script RR_ReviveBuilding to the building to revive it.
|
Please can you explain how that works in depth? Did you actually manage find the right calls and update the client or have you done it some other way?
Please can you explain it with detail?
|
|
|
|
Re: Buying Back Dead Buildings [message #315287 is a reply to message #315282] |
Sun, 03 February 2008 16:29 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
MadRockz wrote on Sun, 03 February 2008 17:35 | Kamuix_Revive_Structure
|
That script merely sets the health to 500. OK the building is back to life, but it wouldn't set the dependancies back again. By that I mean if the HON died then you set it's health back to 500, it would technically be alive, but you would not be able to buy advanced infantry (even leaving and rejoining).
Here..
I wrote a simple chat hook to do just that actually, you can see for yourself this way.
class idChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
GameObject *obj = Get_GameObj(ID);
int BuildingID = Commands->Get_ID(Find_Soldier_Factory(0));
GameObject *thebuilding = Commands->Find_Object(BuildingID);
char mad[255];
Console_Input(mad);
sprintf(mad,"msg Setting Hand Of Nod health to 100");
Console_Input(mad);
Commands->Set_Health(thebuilding,100);
}
};
ChatCommandRegistrant<idChatCommand> idChatCommandReg("!id",CHATTYPE_TEAM,0,GAMEMODE_AOW);
That script will set the health of the Hand Of Nod to 100, regardless of whether it is dead or not.. Try it out. It will set the health fine.. But try and buy and advanced character from the PT.
If it was really as simple as setting the health, I would of done it myself
[Updated on: Sun, 03 February 2008 16:31] Report message to a moderator
|
|
|
Re: Buying Back Dead Buildings [message #315291 is a reply to message #315279] |
Sun, 03 February 2008 16:40 |
|
reborn wrote on Sun, 03 February 2008 23:16 |
Yrr wrote on Sun, 03 February 2008 17:00 | Get Resurrection, enable revivable buildings in configuration and attach script RR_ReviveBuilding to the building to revive it.
|
Please can you explain how that works in depth? Did you actually manage find the right calls and update the client or have you done it some other way?
Please can you explain it with detail?
|
Since a real revive for normal Renegade users is impossible, RR does it like that:
On building destruction, it sends the following information to non-RR clients instead of sending the destruction:
- set health to 1hp
- turn power off
So non-RR clients can still target the building and it is not darkened, but from inside it looks like destroyed ans there is no health bar.
RR-clients have a client-side fix to allow resurrectable buildings so they see buildings destroyed as usual.
Once RR revives a building, it sets health to 50%, enables power, reinitializes it, re-attaches preset scripts and for AGT and Obelisk, it re-initializes their turrets.
Took me some days to make all that work correctly.
It can be used easily soon, since I'm currently a plugin system for RR, and there you only have to use building.revive();
Yrr.
Creator of...
Resurrection, a Command & Conquer: Renegade Modification
LevelRedit, a .mix to .lvl converter
|
|
|
Re: Buying Back Dead Buildings [message #315297 is a reply to message #315291] |
Sun, 03 February 2008 17:32 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
Yrr wrote on Sun, 03 February 2008 18:40 |
reborn wrote on Sun, 03 February 2008 23:16 |
Yrr wrote on Sun, 03 February 2008 17:00 | Get Resurrection, enable revivable buildings in configuration and attach script RR_ReviveBuilding to the building to revive it.
|
Please can you explain how that works in depth? Did you actually manage find the right calls and update the client or have you done it some other way?
Please can you explain it with detail?
|
Since a real revive for normal Renegade users is impossible, RR does it like that:
On building destruction, it sends the following information to non-RR clients instead of sending the destruction:
- set health to 1hp
- turn power off
So non-RR clients can still target the building and it is not darkened, but from inside it looks like destroyed ans there is no health bar.
RR-clients have a client-side fix to allow resurrectable buildings so they see buildings destroyed as usual.
Once RR revives a building, it sets health to 50%, enables power, reinitializes it, re-attaches preset scripts and for AGT and Obelisk, it re-initializes their turrets.
Took me some days to make all that work correctly.
It can be used easily soon, since I'm currently a plugin system for RR, and there you only have to use building.revive();
|
That's pretty cool. But how do you make the Purchase terminal appear "disabled" for the non-rr clients when a building is supposed to be dead?
Also, how do you make the clients see the prices doubled for when the power plant is supposed to be dead, but really it's just had it's health set to 1?
v00d00 also said it was impossible to make clients update the purchase terminal without rejoining the server, however, I also heard that Silent Kane manged it server-side. Perhaps it was a Chinese whisper :-/
|
|
|
Re: Buying Back Dead Buildings [message #315302 is a reply to message #315297] |
Sun, 03 February 2008 18:04 |
|
reborn wrote on Mon, 04 February 2008 01:32 |
Yrr wrote on Sun, 03 February 2008 18:40 |
reborn wrote on Sun, 03 February 2008 23:16 |
Yrr wrote on Sun, 03 February 2008 17:00 | Get Resurrection, enable revivable buildings in configuration and attach script RR_ReviveBuilding to the building to revive it.
|
Please can you explain how that works in depth? Did you actually manage find the right calls and update the client or have you done it some other way?
Please can you explain it with detail?
|
Since a real revive for normal Renegade users is impossible, RR does it like that:
On building destruction, it sends the following information to non-RR clients instead of sending the destruction:
- set health to 1hp
- turn power off
So non-RR clients can still target the building and it is not darkened, but from inside it looks like destroyed ans there is no health bar.
RR-clients have a client-side fix to allow resurrectable buildings so they see buildings destroyed as usual.
Once RR revives a building, it sets health to 50%, enables power, reinitializes it, re-attaches preset scripts and for AGT and Obelisk, it re-initializes their turrets.
Took me some days to make all that work correctly.
It can be used easily soon, since I'm currently a plugin system for RR, and there you only have to use building.revive();
|
That's pretty cool. But how do you make the Purchase terminal appear "disabled" for the non-rr clients when a building is supposed to be dead?
Also, how do you make the clients see the prices doubled for when the power plant is supposed to be dead, but really it's just had it's health set to 1?
v00d00 also said it was impossible to make clients update the purchase terminal without rejoining the server, however, I also heard that Silent Kane manged it server-side. Perhaps it was a Chinese whisper :-/
|
- The PP multiplier is simple since disabling the PP's power has the same effect.
- The terminals are not disabled as usual. Non-RR clients can still enter the soldier and the vehicle purchase menu. But all soldiers and vehicles in these windows are disabled. That can be set server-side even without destroying any building.
Since the buildings are never destroyed for non-RR clients, there is no problem with joining or having to rejoin.
Yrr.
Creator of...
Resurrection, a Command & Conquer: Renegade Modification
LevelRedit, a .mix to .lvl converter
|
|
|
|
Re: Buying Back Dead Buildings [message #315349 is a reply to message #315302] |
Mon, 04 February 2008 03:24 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
Yrr wrote on Sun, 03 February 2008 20:04 |
reborn wrote on Mon, 04 February 2008 01:32 |
Yrr wrote on Sun, 03 February 2008 18:40 |
reborn wrote on Sun, 03 February 2008 23:16 |
Yrr wrote on Sun, 03 February 2008 17:00 | Get Resurrection, enable revivable buildings in configuration and attach script RR_ReviveBuilding to the building to revive it.
|
Please can you explain how that works in depth? Did you actually manage find the right calls and update the client or have you done it some other way?
Please can you explain it with detail?
|
Since a real revive for normal Renegade users is impossible, RR does it like that:
On building destruction, it sends the following information to non-RR clients instead of sending the destruction:
- set health to 1hp
- turn power off
So non-RR clients can still target the building and it is not darkened, but from inside it looks like destroyed ans there is no health bar.
RR-clients have a client-side fix to allow resurrectable buildings so they see buildings destroyed as usual.
Once RR revives a building, it sets health to 50%, enables power, reinitializes it, re-attaches preset scripts and for AGT and Obelisk, it re-initializes their turrets.
Took me some days to make all that work correctly.
It can be used easily soon, since I'm currently a plugin system for RR, and there you only have to use building.revive();
|
That's pretty cool. But how do you make the Purchase terminal appear "disabled" for the non-rr clients when a building is supposed to be dead?
Also, how do you make the clients see the prices doubled for when the power plant is supposed to be dead, but really it's just had it's health set to 1?
v00d00 also said it was impossible to make clients update the purchase terminal without rejoining the server, however, I also heard that Silent Kane manged it server-side. Perhaps it was a Chinese whisper :-/
|
- The PP multiplier is simple since disabling the PP's power has the same effect.
- The terminals are not disabled as usual. Non-RR clients can still enter the soldier and the vehicle purchase menu. But all soldiers and vehicles in these windows are disabled. That can be set server-side even without destroying any building.
Since the buildings are never destroyed for non-RR clients, there is no problem with joining or having to rejoin.
|
Ah OK, I didn't realise turning the power off for the PP had that effect, I never noticed before. Thankyou.
It would be nice to actually show the purchase terminal as destroyed, but I guess that's as close as you're going to get it.
Using the same method it should be possible to replicate this in the renegade API for non-rr server owners. I might give it a go.
|
|
|
Re: Buying Back Dead Buildings [message #315392 is a reply to message #315349] |
Mon, 04 February 2008 08:24 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
reborn wrote on Mon, 04 February 2008 02:24 |
Yrr wrote on Sun, 03 February 2008 20:04 |
reborn wrote on Mon, 04 February 2008 01:32 |
Yrr wrote on Sun, 03 February 2008 18:40 |
reborn wrote on Sun, 03 February 2008 23:16 |
Yrr wrote on Sun, 03 February 2008 17:00 | Get Resurrection, enable revivable buildings in configuration and attach script RR_ReviveBuilding to the building to revive it.
|
Please can you explain how that works in depth? Did you actually manage find the right calls and update the client or have you done it some other way?
Please can you explain it with detail?
|
Since a real revive for normal Renegade users is impossible, RR does it like that:
On building destruction, it sends the following information to non-RR clients instead of sending the destruction:
- set health to 1hp
- turn power off
So non-RR clients can still target the building and it is not darkened, but from inside it looks like destroyed ans there is no health bar.
RR-clients have a client-side fix to allow resurrectable buildings so they see buildings destroyed as usual.
Once RR revives a building, it sets health to 50%, enables power, reinitializes it, re-attaches preset scripts and for AGT and Obelisk, it re-initializes their turrets.
Took me some days to make all that work correctly.
It can be used easily soon, since I'm currently a plugin system for RR, and there you only have to use building.revive();
|
That's pretty cool. But how do you make the Purchase terminal appear "disabled" for the non-rr clients when a building is supposed to be dead?
Also, how do you make the clients see the prices doubled for when the power plant is supposed to be dead, but really it's just had it's health set to 1?
v00d00 also said it was impossible to make clients update the purchase terminal without rejoining the server, however, I also heard that Silent Kane manged it server-side. Perhaps it was a Chinese whisper :-/
|
- The PP multiplier is simple since disabling the PP's power has the same effect.
- The terminals are not disabled as usual. Non-RR clients can still enter the soldier and the vehicle purchase menu. But all soldiers and vehicles in these windows are disabled. That can be set server-side even without destroying any building.
Since the buildings are never destroyed for non-RR clients, there is no problem with joining or having to rejoin.
|
Ah OK, I didn't realise turning the power off for the PP had that effect, I never noticed before. Thankyou.
It would be nice to actually show the purchase terminal as destroyed, but I guess that's as close as you're going to get it.
Using the same method it should be possible to replicate this in the renegade API for non-rr server owners. I might give it a go.
|
intersting ...info....
|
|
|
|
Re: Buying Back Dead Buildings [message #315410 is a reply to message #315408] |
Mon, 04 February 2008 10:57 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
cnc95fan wrote on Mon, 04 February 2008 12:49 | I'm sure I was in the MP-Gaming server (reborn?) when I got a PM from the "host" buy back your dead power plant for 14,000....
|
As said in this thread, v00d00 found the calls and then made a function for Zunnie. Zunnie then made use of the call to bring the building back to life through a chat hook that cost x amount of cash. However v00d00 never found a way to update the clients purchase terminals after a dead building had been revived. Clients wishing to use the purchase terminal have to leave and rejoin. Or they can use switches which have a poke and buy script on it.
I had nothing to do with the development of that server mod BTW, I actually cannot stand the mod and think it's quite tacky TBH. I do still host it, but that's only because I always seem to get side-tracked with other things rather then make a replacement (although it is in development, I just never seem to make time for it).
|
|
|
|
Re: Buying Back Dead Buildings [message #315441 is a reply to message #315415] |
Mon, 04 February 2008 14:20 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
Zack wrote on Mon, 04 February 2008 13:27 | Tbh, reborn we think alike...
The idea you mentioned above is similar, if not exactly, how I was thinking about doing it...lol
~Zack
|
Well according to Yrr, that's how he decided to do it too for non-rr clients. Apparantly all three of us had a similar approach.
|
|
|
|
|
Goto Forum:
Current Time: Tue Nov 05 06:10:15 MST 2024
Total time taken to generate the page: 0.01183 seconds
|