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 #488165 is a reply to message #488164] Mon, 30 June 2014 19:12 Go to previous messageGo to previous message
dblaney1 is currently offline  dblaney1
Messages: 358
Registered: March 2014
Location: United States
Karma:
Commander
That sounds nice but a way to set just the isdestroyed flag would be nice as well. Both options have their advantages and disadvantages. I do have building specific code in my restore plugin, such as the refinery requesting a new harvester from the base controller and the communications center reenabling radar when restored. The power plant also turns base power back on when restored. Base Defenses just reattach their appropriate script. The Weapons Factory, Airstrip, Barracks, and Hand of Nod actually don't need anything special. Just the isdestroyed flag set on the clients is needed for them to work properly. Probably best to reset cangeneratevehicles as well though. If the harvester was dead before the restore and there is a still a refinery it automatically builds the harvester.

Ultimately its up to you how it would be done of course.

Anyway, here's some examples of some of the revive commands code.

class CommandREVIVENODPP :
	public ConsoleFunctionClass
{
public:
	const char* Get_Name() 
	{ 
		return "revivenodpp"; 
	}
	const char* Get_Help() 
	{ 
		return "REVIVENODPP - Revives the Nod Power Plant."; 
	}
	void Activate(const char* argumentsString)
	{
		Revive_Building(Find_Power_Plant(NOD));
		Commands->Set_Building_Power(Find_Power_Plant(NOD), true);
		BaseControllerClass* base = BaseControllerClass::Find_Base(NOD);
		if (base) 
		{
			base->Power_Base(true);
		}
	}
};


class CommandREVIVEGDIREF :
	public ConsoleFunctionClass
{
public:
	const char* Get_Name() 
	{ 
		return "revivegdiref"; 
	}
	const char* Get_Help() 
	{ 
		return "REVIVEGDIREF - Revives the GDI Refinery."; 
	}
	void Activate(const char* argumentsString)
	{
		Revive_Building(Find_Refinery(GDI));
		Find_Refinery(GDI)->As_BuildingGameObj()->As_RefineryGameObj()->Allow_Harvester_Spawn();
	}
};




[Updated on: Mon, 30 June 2014 20: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:48:05 MST 2024

Total time taken to generate the page: 0.02127 seconds