CnC Source Forums: ArmorUpgrade issue - CnC Source Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

ArmorUpgrade issue Rate Topic: -----

#1 User is offline   Madin 

  • Rocket Soldier
  • Group: Members
  • Posts: 76
  • Joined: 01-January 07

Posted 23 February 2009 - 03:22 PM

  <?xml version="1.0" encoding="us-ascii" ?> 
- <ArmorUpgrade xmlns="uri:ea.com:eala:asset" id="ModuleTag_InfusedCompositeArmorUpgrade" Permanent="true" ArmorSetFlag="PLAYER_UPGRADE_3">
  <TriggeredBy>Upgrade_GDICompositeArmor</TriggeredBy> 
  <TriggeredBy>Upgrade_TiberiumInfusion</TriggeredBy> 
  </ArmorUpgrade>

The above code does not work. The idea is to experiment with cross faction upgrades. In this case if a nod militant squad get both the Tiberium infusion and the composite armor upgrades, they are suppossed to get a new unique armor.
The new armor template is done and referenced in a similar style to how the tiberium infused armor is referenced.

The nod squad can get the composite armor or tiberium infusion upgrade on its own. Has you can see from the above code, the armor set flag is unique (composite armor by itself is set to "PLAYER_UPGRADE_2").

Is the reason that the above code does not work because 2 "TriggeredBy" elements are not allowed?
If thats the case can I please have some pointers on how to get this unique armor to require that the player already has both tiberium infusion and composite armor?
0

#2 User is offline   Mighty BOB! 

  • Dark Lord of the Source
  • View blog
  • Group: Network Admin
  • Posts: 2,067
  • Joined: 24-March 05

Posted 23 February 2009 - 03:55 PM

http://forums.revora.net/index.php?showtop...l=neededupgrade

;)
0

#3 User is offline   Golan 

  • funky spacebeat opposition
  • Group: Network Mod Staff
  • Posts: 212
  • Joined: 30-October 05

Posted 23 February 2009 - 04:01 PM

The ArmorUpgradeModule is an extension of the UpgradeModule, it doesn't support gamedependency.

AFAIK the Upgrade module and all its extensions can only handle one TriggeredBy but an unlimited number of ConflictsWith. You could try adding RequiresAllTriggers=true, this should theoretically make it work as intended but I've never tested it.

If it doesn't work, there's two ways to bypass this that I can think of:
A) Make an "anti-upgrade" for each of the xtech upgrades that is granted to every player by default. I.e. for the composite upgrade, create a new playerupgrade AntiCompositeArmor and set the PlayerSpellBook to grant it on creation. Now, add a RemoveUpgradeUpgrade that will remove AntiCompositeArmor when Upgrade_GDICompositeArmor to the PlayerSpellBook. Set the xtech condition to conflict with the anti-upgrade.
B) Use dummies to check the upgrade conditions and combine several upgrades into one. For the Composite->Infusion sequence, add a SpawnBehavior to the PlayerSpellBook that spawns a dummy when Upgrade_GDICompositeArmor is purchased, let's call it DummyCompositeArmorUpgrade1 for example. Said dummy is invisible, invincible etc. and only has another SpawnBehavior that gets triggered when the player acquires Upgrade_TiberiumInfusion and then spawns DummyTiberiumInfusionUpgrade2. This dummy is like the previous one, but instead of another SpawnBehavior it features a GrantUpgradeCreate that grants a special upgrade to indicate that both upgrades have been purchased, e.g. UpgradeCompositeInfusionCombined. Set the ArmorUpgrade to get triggered by this third upgrade.
0

#4 User is offline   Madin 

  • Rocket Soldier
  • Group: Members
  • Posts: 76
  • Joined: 01-January 07

Posted 27 February 2009 - 02:05 PM

View PostGolan, on Feb 23 2009, 11:01 PM, said:

B) Use dummies to check the upgrade conditions and combine several upgrades into one. For the Composite->Infusion sequence, add a SpawnBehavior to the PlayerSpellBook that spawns a dummy when Upgrade_GDICompositeArmor is purchased, let's call it DummyCompositeArmorUpgrade1 for example. Said dummy is invisible, invincible etc. and only has another SpawnBehavior that gets triggered when the player acquires Upgrade_TiberiumInfusion and then spawns DummyTiberiumInfusionUpgrade2. This dummy is like the previous one, but instead of another SpawnBehavior it features a GrantUpgradeCreate that grants a special upgrade to indicate that both upgrades have been purchased, e.g. UpgradeCompositeInfusionCombined. Set the ArmorUpgrade to get triggered by this third upgrade.

- <SpawnBehavior id="ModuleTag_DummyCompositeArmorUpgrade1">
  <SpawnTemplate>DummyCompositeArmor1</SpawnTemplate> 
  </SpawnBehavior>

This does not allow for a 'triggeredby' element, it throws up a compiler error. Its blocking my whole code at the moment.

----------------------------------------------------------------------------------------------------------------------------------------

http://ppmsite.com/f...pic.php?t=17078
I based my Rocket predator tank on Rebelmoon's code. The only problem is that in both cases the Rockets refuse to auto fire on enemy targets, regardless of whether the units on aggressive or any other mode. You have to manually click on a target to get the predator to fire its rockets at the target, it will continue to use it's rockets until the target is destroyed and then you'll have to manually assign it another target.
I had a look at the mammoth tank's rocket pods, and I've tried to match the weapons XML has closely has possible but still no joy.
The mammoth tank rocket pods have there own turret that is parented to the main turret. They have their own rotation and everything.
The rocket predator does not have (and will not have) none of this.

Any idea's how to sort this out? :?

This post has been edited by Madin: 27 February 2009 - 03:54 PM

0

#5 User is offline   Golan 

  • funky spacebeat opposition
  • Group: Network Mod Staff
  • Posts: 212
  • Joined: 30-October 05

Posted 28 February 2009 - 08:48 AM

View PostMadin, on Feb 27 2009, 10:05 PM, said:

- <SpawnBehavior id="ModuleTag_DummyCompositeArmorUpgrade1">
  <SpawnTemplate>DummyCompositeArmor1</SpawnTemplate> 
  </SpawnBehavior>

This does not allow for a 'triggeredby' element, it throws up a compiler error. Its blocking my whole code at the moment.

The SpawnBehavior is an extension of the UpgradeModule, so it should be able to handle TriggeredBy in the same way. You might have to place the TriggeredBy element after the SpawnTemplate element, this is how it worked for me.

----------------------------------------------------------------------------------------------------------------------------------------

View PostMadin, on Feb 27 2009, 10:05 PM, said:

http://ppmsite.com/f...pic.php?t=17078
I based my Rocket predator tank on Rebelmoon's code. The only problem is that in both cases the Rockets refuse to auto fire on enemy targets, regardless of whether the units on aggressive or any other mode. You have to manually click on a target to get the predator to fire its rockets at the target, it will continue to use it's rockets until the target is destroyed and then you'll have to manually assign it another target.
I had a look at the mammoth tank's rocket pods, and I've tried to match the weapons XML has closely has possible but still no joy.
The mammoth tank rocket pods have there own turret that is parented to the main turret. They have their own rotation and everything.
The rocket predator does not have (and will not have) none of this.

Any idea's how to sort this out? :?

If the MissilePod is placed on the regular turret, I'd strongly recommend using the Mammoth's code as this will properly - remember that you can limit a turret's rotation or, even easier, simply set the firing bone as the turret (instead of the pod). This allows the weapons to be properly handled.
If both are mounted on the same turret and don't have to be able to target separate targets, you might also want to try setting the missile launcher as a secondary weapon. Keep in mind that you should set AllowInterleavedFiring to true when doing so.
0

#6 User is offline   Madin 

  • Rocket Soldier
  • Group: Members
  • Posts: 76
  • Joined: 01-January 07

Posted 28 February 2009 - 12:07 PM

- <SpawnBehavior id="ModuleTag_DummyCompositeArmorUpgrade1">
  <SpawnTemplate>DummyCompositeArmor1</SpawnTemplate> 
  <TriggeredBy>Upgrade_GDICompositeArmor</TriggeredBy> 
  </SpawnBehavior>


The above code throws up the compiler error below.
Loading 'file://d:\program files\electronic arts\command & conquer 3\mod sdk\mods\tiberianhistory\data\playerspellbook.xml'.
Critical: XML validation error encountered in 'd:\program files\electronic arts\command & conquer 3\mod sdk\mods\tiberianhistory\data\playerspellbook.xml' near line 65:
   The element 'SpawnBehavior' in namespace 'uri:ea.com:eala:asset' has invalid child element 'TriggeredBy' in namespace 'uri:ea.com:eala:asset'. List of possible elements expected: 'SpawnTemplate' in namespace 'uri:ea.com:eala:asset'.

Am I making another mistake?
0

#7 User is offline   Golan 

  • funky spacebeat opposition
  • Group: Network Mod Staff
  • Posts: 212
  • Joined: 30-October 05

Posted 03 March 2009 - 02:56 AM

Sorry, I currently don't have access to my regular SDK, can't c/p my code. So far, I can only confirm that it is indeed valid (you can check SpawnBehavior.xsd and Upgrade.xsd yourself, it should be listed) but can't supply working code.

Regardless, you should expand the SpawnBehavior a bit, otherwise it won't do anything as it is by default set to spawn 0 entities. You will at least have to add SpawnNumberData="1".

€dit
Ugh, damnid... the code works on the Powerplant but not on the Spellbook. Got to do some more troubleshooting, I'd guess it's a problem with the inherit/XIncludes missing on the SpellBook.

			<SpawnBehavior
				id="ModuleTag_SpawnRepairDrones"
				SpawnNumberData="1"
				InitialBurst="1"
				InitialDelay="2s"
				SpawnReplaceDelayData="0.1s"
				SpawnedRequireSpawner="true"
				KillSpawnsOnCaptured="true"
				KillSpawnsOnDisabled="false"
				SpawnInsideBuilding="true">
				<Die
					DeathTypes="ALL" />
				<SpawnTemplate>GDIPowerPlant_GD</SpawnTemplate>
				<TriggeredBy>Upgrade_GameDependency</TriggeredBy>
			</SpawnBehavior>

0

#8 User is offline   Madin 

  • Rocket Soldier
  • Group: Members
  • Posts: 76
  • Joined: 01-January 07

Posted 03 March 2009 - 09:59 AM

Thanks for your efforts. I did check the schema for both, and concluded that the code should work.
At least the compiler is providing a critical error! it would be worse if there were no errors but the code still did nothing.

I'm guessing that the coding issues center around the 'armorset' method of upgrading.
If your having problems with the code I don't stand a chance!
0

#9 User is offline   Golan 

  • funky spacebeat opposition
  • Group: Network Mod Staff
  • Posts: 212
  • Joined: 30-October 05

Posted 04 March 2009 - 03:30 AM

I'm just doing a brute force approach as well. Anyways, it works now, but don't expect the solution to make much sense: it only works if the object inherits from something. It doesn't even have to be a useful inherit, it only needs to be valid (i.e. have an ID and a body module) and as soon as the PlayerSpellBook inherits from it, the error is gone.

  • Created the new object BaseInherit to serve as a trivial inherit object:
    [...]
    	<GameObject
    		id="BaseInherit"
    		>
    		<Body>
    			<HighlanderBody
    				id="ModuleTag_Body"
    				MaxHealth="1.0"
    				InitialHealth="1.0" />
    		</Body>
    	</GameObject>
    [...]

  • Included the BaseInherit in the SpellBook's file:
    [...]
    		<Include
    			type="instance"
    			source="BaseInherit.xml" />
    [...]

  • Made the SpellBook inherit the BaseInherit:
    [...]
    	<GameObject
    		id="PlayerSpellBook"
    		inheritFrom="BaseInherit"
    		Side="Neutral"
    [...]

0

#10 User is offline   Madin 

  • Rocket Soldier
  • Group: Members
  • Posts: 76
  • Joined: 01-January 07

Posted 05 March 2009 - 12:36 PM

Thanks for your help Golan!
Sadly I still cannot get the damn thing working. There are no compiler errors though, so I'm sure its a problem with my code.
I'm not very comfortable with the use of dummies (I mean I have no idea if they're being spawned or not), so i'll have to move on from this little problem.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users