Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Tiberian Technologies / Blackhand Studios » Tiberian Technologies Forum » Syncing or changing BuildingGameObj 'IsDetroyed' state for clients
Re: Syncing or changing BuildingGameObj 'IsDetroyed' state for clients [message #488190 is a reply to message #488178] Tue, 01 July 2014 05:46 Go to previous messageGo to previous message
dblaney1 is currently offline  dblaney1
Messages: 358
Registered: March 2014
Location: United States
Karma:
Commander
jonwil wrote on Tue, 01 July 2014 01:43

The following events happen in the On_Destroyed event (called when a building is destroyed):
BuildingGameObj IsDestroyed is set to true, BaseControllerClass::On_Building_Destroyed is called (this plays the "building destroyed" sound and sets the "base destroyed" flag if all buildings are dead), BaseControllerClass::Check_Prerequisites is called (this goes with the prerequisite logic where stuff you buy from the sidebar can have a flag that says "this building must exist/must be alive for the object to be purchasable") and the building is made visible in the single player encyclopedia.

AirFactoryGameObj BaseControllerClass::Check_Vehicle_Factory is called (this sets the CanGenerateVehicles flag appropriately based on the buildings that are present and alive)

ComCenterGameObj BaseControllerClass::Check_Radar is called (this toggles the radar depending on what buildings exist/are alive)

NavalFactoryGameObj BaseControllerClass::Check_Vehicle_Factory is called (this sets the CanGenerateVehicles flag appropriately based on the buildings that are present and alive)

PowerPlantGameObj BaseControllerClass::Check_Base_Power is called (this sets the base power as appropriate based on the buildings that are present and alive)

RefineryGameObj Destroys any instances of the harvester preset, also disables any spawners that would spawn the harvester preset (said spawners are used for maps that have a refinery but no weapons factory)

SoldierFactoryGameObj Sets the CanGenerateSoldiers flag to off.

WeaponsFactoryGameObj BaseControllerClass::Check_Vehicle_Factory is called (this sets the CanGenerateVehicles flag appropriately based on the buildings that are present and alive)

So yes more happens than just toggling the flag and any engine feature that might be added in the future would be undoing those other things that happen (e.g. turning CanGenerateSoldiers back on for a SoldierFactoryGameObj, restoring the harvester spawners for a RefineryGameObj etc)



Everything you put there can be already be done. It works properly already. The only thing that doesn't work is syncing the client isdestroyed flag. Thats why it is confusing that you would want to write an entirely new netcode/engine feature for something that already works except for one thing.

[Updated on: Tue, 01 July 2014 05:57]

Report message to a moderator

 
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
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
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
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: Trouble downloading scripts
Next Topic: Can't see player names anymore?
Goto Forum:
  


Current Time: Tue Nov 26 23:52:32 MST 2024

Total time taken to generate the page: 0.02010 seconds