Jump to content
DerelictStudios Forums
Sign in to follow this  
Accele

While I'm Here... Are Special Powers Hardcoded Or Am I An Idiot?

Recommended Posts

Is there some kind of limit on special powers? I'm trying to clone the Bloodhound power so I can fly in other stuff rather than have it built in a warfactory, but for some reason I can't make another bloodhound-style support power. I can edit the old one, but whenever I try to clone it the button doesn't appear in the upper left. I think I did everything, but either it's hardcoded or there's something else I have to do.

 

I've added (cloned and name changed, that's it) the entries in SpecialPowerTemplate, LogicCommand, LogicCommandSet, ObjectCreationList, and the relative object the power is attached to, but nothing. My LogicCommand and LogicCommandSet entries are actually in the same file as the unit with this power, because my LogicCommand and ...Set .xmls came with random things missing and give me errors when I compile them.

 

Any advice would be appreciated.

Share this post


Link to post
Share on other sites

Nope it's not hardcoded but you need to add it to a looooot of places...

 

You need to add it to the

PlayerSpellBook.xml

 

Also make sure you add it to the

PlayerSpellBookCommandSet

in the main

LogicCommandSet.xml

 

Finally, make sure you actually define the button you want to appear, this needs to be done in the

PowerAbilityButtons.xml

and I think also in the

UnitAbilityButtons.xml

 

I think that is everything...

 

gl :)

Share this post


Link to post
Share on other sites

oof sorry, I've messed about with the names a little, the cnc3 one is called

PlayerPowerButtonTemplates.xml

it's in the /GlobalData folder with the other stuff

 

Also "UnitAbilityButtons" should be

UnitAbilityButtonTemplates.xml

 

hope that sorts you out ;)

Share this post


Link to post
Share on other sites

When editing the UnitAbilityButtonTemplateStore and PlayerPowerButtonTemplateStore be aware that these listings are game assets as a whole, you can´t just pull out one button and edit it like you could edit a single weapon template in it´s own file but must modify the complete ButtonTemplateStore. Also, you must change the ID of the ButtonTemplateStore that you edited, else the game will use the original one.

Edited by Golan

Share this post


Link to post
Share on other sites

Ugh damn, yeah another issue is that the new listing generally overwrites the old one, so you must include any buttons you want from the existing game in your new file.

Share this post


Link to post
Share on other sites

Ok, well, I think I've done all that, but it still isn't working. I think it's something to do with the command button, since if I edit everything other than that it works. Not sure what to make of this.

Edited by Accele

Share this post


Link to post
Share on other sites

No, it's still just refusing to work. No button is showing up or anything.

 

I've got time now, so I'm going to post what I've got here. This is for a unit called "FCS"

 

In SpecialPowerTemplates.xml

	<SpecialPowerTemplate
	id="SpecialPowerCallSupportFCS"
	Flags="NOT_CLIFF_CELL IS_PLAYER_POWER NO_FORBIDDEN_OBJECTS SHARED_SYNC"
	ReloadTime="1s"
		ForbiddenObjectRange="140"
	RadiusCursorRadius="140"
	TargetType="LOCATION" 
	EvaEventToPlayWhenSelectingTarget="SelectSpecialPowerTarget"
	Money="-200"
   InitiateAtLocationSound="GDI_Ox_VoiceReinforcements">
	<ForbiddenObjectFilter
		Rule="ANY" 
		Include="VEHICLE"
	/>
<!--		<GameDependency>
		<RequiredObject>USCommandVehicle</RequiredObject>
	</GameDependency> -->
</SpecialPowerTemplate>

 

In PlayerPowerButtonTemplates.xml

 

			<TargetedPowerButton
			RadiusCursor="TargetingDecalBloodhound"
			id="SpecialPowerCallSupportFCS">
			<State
				Image="Button_PlayerPowerBloodhounds"
				Title="NAME:PlayerPowerBloodhound"
				TypeDescription="TYPE:PlayerPowerBloodhound"
				Description="DESC:PlayerPowerBloodhound" />
		</TargetedPowerButton>

 

In PlayerSpellBook

		<!-- US Call Support FCS -->
		<PlayerPowerManager
			id="ModuleTag_PlayerPowerManager_CallSupportFCS"
			SpecialPowerTemplate="SpecialPowerCallSupportFCS" 
		/>

 

In LogicCommand

	<LogicCommand
	Options="NEED_TARGET_POS"
	Type="SPECIAL_POWER"
	id="Command_CommandPostCallFCS">
	<SpecialPower>SpecialPowerCallSupportFCS</SpecialPower>
</LogicCommand>

 

In LogicCommandSet (note that I'm simply adding the Cmd to GDIAirTowerCommandSet, I did correctly switch the CommandSet on my calling-it-in object to reflect that.

	<LogicCommandSet
	id="GDIAirTowerCommandSet">
	<Cmd>Command_ConstructGDIOrca</Cmd>
	<Cmd>Command_ConstructGDIFireHawk</Cmd>
	<Cmd>Command_GDIRecallAllAircraft</Cmd>
	<Cmd>Command_CommandPostCallBloodhound</Cmd>
	<Cmd>Command_CommandPostCallFCS</Cmd>
	<Cmd>Command_CommandPostBombingRun</Cmd>
	<Cmd>Command_TogglePower</Cmd>
	<Cmd>Command_SelfRepair</Cmd>
	<Cmd>Command_Sell</Cmd>
	<Cmd>Command_SetRallyPoint_Aircraft</Cmd>
</LogicCommandSet>

 

Also, later in LogicCommandSet...

	<LogicCommandSet
	id="PlayerSpellBookCommandSet">
	<Cmd>Command_LaunchCatalystMissile</Cmd>
	<Cmd>Command_ComputerCounterMeasures</Cmd>
	<Cmd>Command_CommandPostCallAirborne</Cmd>
	<Cmd>Command_CommandPostCallBloodhound</Cmd>
	<Cmd>Command_CommandPostCallFCS</Cmd>
	<Cmd>Command_CommandPostCallHunterKiller</Cmd>
	<Cmd>Command_SpaceCommandGDIDropPods</Cmd>
	<Cmd>Command_SpaceCommandGDIShockwave</Cmd>
	<Cmd>Command_CommandPostRadarScan</Cmd>
	<Cmd>Command_CommandPostBombingRun</Cmd>
	<Cmd>Command_IonCannonSuperweapon</Cmd>
	<Cmd>Command_TempleOfNodNuclearMissile</Cmd>
	<Cmd>Command_SelectObjectsForClone</Cmd>
	<Cmd>Command_SpawnObjectsForClone</Cmd>
	<Cmd>Command_FireRadarJammingMissile</Cmd>
	<Cmd>Command_NODBurrowMines</Cmd>
	<Cmd>Command_TiberiumFacilitySeedTiberium</Cmd>
	<Cmd>Command_TiberiumFacilityAirDispersion</Cmd>
	<Cmd>Command_RedShadowStrikeTeam</Cmd>
	<Cmd>Command_CloakingField</Cmd>
	<Cmd>Command_AlienRepairDrones</Cmd>
	<Cmd>Command_TiberiumVibrationScan</Cmd>
	<Cmd>Command_LightningSpike</Cmd>
	<Cmd>Command_SummonMothership</Cmd>
	<Cmd>Command_RiftGeneratorSuperweapon</Cmd>
	<Cmd>Command_SpecialPowerCrystalField</Cmd>
	<Cmd>Command_SpecialPowerSwarm</Cmd>
	<Cmd>Command_SpecialPowerPhaseField</Cmd>
   <Cmd>Command_EMPControlCenterEMP</Cmd>
</LogicCommandSet>

 

In USCommandVehicle (this power is going to be deployed from a vehicle... to give a more overarching idea of what I'm doing: I'm trying to make one side with no base, just a command vehicle that calls for reinforcements. More flexible, more mobile, but of course less capable of holding ground and subject to getting the command vehicle blown up.

 

Anyway, in <behaviors>...

			<OCLSpecialPower
			id="ModuleTag_CallSupportFCS"
			SpecialPowerTemplate="SpecialPowerCallSupportFCS"
			TriggerFX="FX_GDICallForTransportFlare"
			OCL="OCL_CallSupportFCS"
			CreateLocation="CREATE_AT_EDGE_NEAR_SOURCE"
		/>
		<AISpecialPowerUpdate
			id="ModuleTag_CommandPostCallFCSAI"
			CommandButtonName="Command_CommandPostCallFCS"
			ReinforceDistance="400.0"
			SpecialPowerRadius="300.0"
			SpecialPowerAIType="SPECIAL_POWER_REINFORCEMENT" 
		/>

 

and later....

		<ClientUpdates>
		<EvaAnnounceSpecialPowerReadyClientUpdate
			id="AnnounceFCSReady"
			AnnouncementEventOwner="ReinforcementsReady"
			SpecialPowerTemplate="SpecialPowerCallSupportFCS"
			JustMonitorPercentReady="true" 
		/>
	</ClientUpdates>

 

And the OCL it links to is fine. I checked by leaving everything else untouched except switching the OCL to my new one. And my mod.xml is fine.

 

I've also been able to simply add the unedited Bloodhounds power to the USCommandVehicle, so I know it works on vehicles.

 

Thanks for the help so far guys, I appreciate it.

Edited by Accele

Share this post


Link to post
Share on other sites

Ok, well, it works now. I still have no fucking clue exactly what I did (I just deleted it all and started over using the A10 mod example code as a base), although the playerpowerbutton thing helped a lot, because I was totally missing that when I originally made this thread.

 

Again, thanks a lot for the help guys. Hopefully I don't lose interest in this mod in a few weeks, lol.

Share this post


Link to post
Share on other sites

Yeah when I was having problems with my button in that thread I linked it was something wrong in the code somewhere, starting from scratch resolved the problem.

Share this post


Link to post
Share on other sites

Sometimes you need to flush the cache

CnC3\MOD SDK\BuiltMods\mods\mec2\data

(the contents of this folder)

 

I saved about 20% off the size of the latest mec build by doing this :o

 

The compiler seems really bad about clearing out its unused or old data.

Share this post


Link to post
Share on other sites

Speaking of that, I've discovered that a lot of times it will just refuse to override your old files with updated versions of them. Regular builtmods flushing is becoming important. It's weird though, the mod only got that way once it got big.

 

Anyway, another question. I've been hunting through the SkirmishAI stuff, and I'm looking for a way to make the AI use the specialpower I described in this thread. I suspect it's possible, although I admit I haven't seen the AI use Bloodhounds or Sniper Teams or the infantry one in combat, but they have used the Orca bombing run special and obviously will use Superweapons. Which all work on the same principle, right?

 

Anyway, I've got one side that exclusively calls things in (no base) so if I'm going to have any AI work at all I need to be able to do this. I've been looking through it for a little while now and I'm not seeing a good starting point, although I think I'm fairly familiar with what all the files are for.

 

If anyone has any advice on how to make the AI use a bloodhounds-style reinforcement it'd be much appreciated. Even more so if you can figure out a way to make them use the reinforcement and then do something with the units after, but honestly as long as it's sort-of halfway functional I'll be pleased.

Share this post


Link to post
Share on other sites

I guess, that's scripted stuff made with the World Builder. The xml's handle one general part, the sripts obviously the more detailed rest of how skirmish troops behave. You'd need to get the original Skirmish scripts for this if you don't want to rebuild them completely.

Edited by Dibelius

Share this post


Link to post
Share on other sites

How could I get a hold of the originals? I haven't heard anything about them, I didn't even think C&C3 used them at all.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×