CnC Source Forums: General modding questions - CnC Source Forums

Jump to content

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

General modding questions Rate Topic: -----

#1 User is offline   Madin 

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

Posted 24 February 2009 - 04:50 PM

Any idea about the significance of the geometry folder that usually sits at the bottom of a structures XML file? (example below). I'm kind off concerned because I've been using existing structures has templates for my new models, so I'm guessing all the 'geometry' data is wrong.
- <!--Geometry Data Example -->
- <Geometry IsSmall="false">
- <Shape Type="BOX" MajorRadius="50.0" MinorRadius="50.0" Height="15.0">
<Offset x="0" y="0" z="0" />
</Shape>
- <Shape Type="BOX" MajorRadius="10.0" MinorRadius="50.0" Height="75.0">
<Offset x="0" y="0" z="0" />
</Shape>
- <ContactPoint>
<Pos x="-42.0" y="48.0" z="30" />
</ContactPoint>
- <ContactPoint>
<Pos x="44.0" y="48.0" z="0" />
</ContactPoint>
- <ContactPoint>
<Pos x="44.0" y="-30.0" z="30" />
</ContactPoint>
- <ContactPoint>
<Pos x="44.0" y="48.0" z="0" />
</ContactPoint>
- <ContactPoint>
<Pos x="-40.0" y="-45.0" z="30" />
</ContactPoint>
- <ContactPoint>
<Pos x="44.0" y="48.0" z="0" />
</ContactPoint>
- <ContactPoint>
<Pos x="-40.0" y="-45.0" z="30" />
</ContactPoint>
- <ContactPoint>
<Pos x="-42.0" y="48.0" z="0" />
</ContactPoint>
</Geometry>



I've tried modifying Golan's Titan and I'd like for the existing special power to be unlocked only when the unit reaches the Heroic rank. Any idea how I'd do this? Golan's code already has this code:
- <!-- Smoke Screen Special Power -->
<SpecialPower id="ModuleTag_DeploySmokeScreen" SpecialPowerTemplate="SpecialPower_DeploySmokeScreen" UpdateModuleStartsAttack="true" />
<WeaponFireSpecialAbilityUpdate id="ModuleTag_DeploySmokeScreenUpdate" SpecialWeapon="GDITitanSmokeGrenadeLauncher" SpecialPowerTemplate="SpecialPower_DeploySmokeScreen" StartAbilityRange="=$GDITitan_PwrSmokeScreen_Range + 50" PersistentPrepTime="=$GDITitan_SmokeNader_FireDur" PersistentCount="6" WhichSpecialWeapon="1" />


I'd like to try and replicate the Avatar and juggernaut warfactory exit animations (ducking while sliding out the factory) but I don't understand the animation when I view it in max. It shows the walker stationary with a box that moves towards the walker! How is the exit animation derived from this? the walker does not move.
Also I'd like to try and make it so the Titan leaves a capturable husk when destroyed. Will this be relatively easy? I've seen most of the XML codes, I'm more talking about the 3ds max side things.
0

#2 User is offline   Golan 

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

Posted 25 February 2009 - 02:47 AM

The Geometry defines an object's shape for collision detection. Basically, every object can have up to three different "shapes":
The first is the model, which defines the shape that is displayed to the players - this is purely cosmetic.
The second one is the OBBox or Selection box (which is, like bones, stored in a W3X file and thus usually linked to a model) - this defines where a unit can be selected. While it usually appears that one has to click on the Model to select a unit, technically you have to click the (invisible) OBBox.
The third one is the Geometry, which is the only one purely defined in the XMLs. The <Shape/> elements define an object's size for the purpose of collision - for example, this defines how close objects can be to each other and when a projectile actually hits the object. The <ContactPoint/> elements can be used to force attacking units to target specific locations on the object.

As a general rule, the OBBox and Geometry should roughly match the model while not being too complicated.
---------------------------

For the SpecialPower to be available only after the unit has reached heroic rank, you have to add a Gamedependency to the actual SpecialPower (SpecialPower_DeploySmokeScreen) that references the Heroic upgrade (this is granted automatically when the unit reaches the heroic status). It should look akin to this:
	<SpecialPowerTemplate
		id="ElitePower_InitiateRakZeroHE"
		ReloadTime="30s"
		TargetType="LOCATION"
		NameOfVoiceNameToUseAsInitiateIntendToDoVoice="voiceAttack"
		WaypointModeTerminal="false"
		RadiusCursorRadius="30" >
		<GameDependency>
			<NeededUpgrade>Upgrade_Veterancy_ELITE</NeededUpgrade>
		</GameDependency>
	</SpecialPowerTemplate>


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

Warfactory animation:
Keep in mind that the unit actually moves at its normal speed when leaving the factory! The box is only used as a dummy to visualize the first rally point where the unit moves to when coming out of the factory. Just import the one used by the Juggernaught (in 3DS9: open the Titan's file, then go to File -> Merge, then select the GUJugg_BLDA.max and choose only Box01 to be merged) and use it as a reference to deduce the movement of the Titan, i.e. when the Box reaches the Titan, the Titan's feet should move at the same speed as the and it should end with its IDLE stance.
It's similar to the technique used in the first animation test for the Titan. Here the Titan also always stays at the same spot, but the ground was animated to move relative to it as if the Titan would actually move. This makes animating a uniform movement much easier as it would be without such a reference.

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

Capturable Husk:
You can already do this with the existing Titan files as you can simply use the last frame of the Titan's death animation for its husk object and reverse the death animation to make it get up again - granted though, this probably doesn't look all that good.
In essence though, all you need is a proper Death animation and an animation for the Titan rising again. The rest is just copy-pasting existing code.
0

#3 User is offline   Madin 

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

Posted 25 February 2009 - 12:23 PM

Thank goodness Golan still checks up from time to time!
Do you think its possible that bad geometry/OBBOX is responsible for the 'targeted vehicle repair' power not working on my structure? I've added the battle base command set to a predator tank, and it can execute a targeted repair, There's no reason I can find why my repair bay can't. My OBBOX is similar to the size of the bay, but extensive testing has revealed that I'm only able to select my model on half its surface area. For example, If I force fire on the half of the model that I cannot select, the structure takes damage and is destroyed (the projectile collision is correct), but after the structure is destroyed whatever was force firing continues to fire at the same spot. Has far has the games was concerned it is firing on an area of ground, not a valid target, hence why it does not stop once the structure is destroyed.
I'll try and find a structure with similar geometry to mine, and match the 'geometry' data.
0

#4 User is offline   Assassin 

  • Black Hand Assassin
  • View blog
  • Group: Network Admin
  • Posts: 2,482
  • Joined: 29-December 02

Posted 25 February 2009 - 07:26 PM

Golan, what about when your using multiple OOBox's? How are these measured, multple entrys for each OOBox? or the total area of all OO box's together? As C&C3 commonly uses multiple box's conforming to the shape of the object, instead of one giant box like Zero Hour.

Been a little curious bout clarifying some of the geometry coding myself as theres a hell of alot more in C&C3 then Zero Hour.

In regards to measuring geometry data, you can do it very accuratly using the Measuring tape tool in 3d Studio Max. As long as you follow Golans guide here of what everything does and apply the correct measurements this should fix alot of your problems.
0

#5 User is offline   Golan 

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

Posted 26 February 2009 - 03:05 AM

Each OBBox is saved individually in the W3X as so called W3DCollisionBox. This also means that each keeps its shape so you can use multiple OBBoxes to form a more diverse selection area - the player only has to hit one of the boxes. The PAC is a good example for how many OBBoxes form a complex structure.
Just keep in mind that the OBBox is not a regular geometry object. The only thing that is saved when exporting is its bounding box, not the actual shape! For example, using a Sphere with radius 3 as an OBBox will generate the OBBox as a box with edge length of 6. Also, OBBoxes cannot be animated or linked to moving bones, so it's often best not to make an overly precise OBBox for moving parts (turrets, mechs etc.).

€dit
Eh, forget that last part, Stygs says they can indeed be animated and apparently, they indeed have a bone index in the hierarchy. All Hail the Hypno Stygs. -_-;
0

#6 User is offline   Madin 

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

Posted 26 February 2009 - 11:30 AM

This geometry thing still makes no sense to me. Here is the Alien tech center (AlienReactor.xml).
- <Geometry IsSmall="false">
- <Shape Type="BOX" MajorRadius="9.18358" MinorRadius="44.0272" Height="15.6661">
  <Offset x="0.00120163" y="0.0" z="0.0" /> 
  </Shape>
- <Shape Type="BOX" MajorRadius="70.1626" MinorRadius="9.49226" Height="8.4597">
  <Offset x="0.00120544" y="0.0" z="0.0" /> 
  </Shape>
- <Shape Type="BOX" MajorRadius="23.4992" MinorRadius="23.7693" Height="15.6661">
  <Offset x="49.4305" y="-0.985332" z="0.0" /> 
  </Shape>
- <Shape Type="BOX" MajorRadius="23.4992" MinorRadius="23.7693" Height="15.6661">
  <Offset x="-45.7104" y="-0.985332" z="0.0" /> 
  </Shape>

It has 3 shape vaules.
What does major and minor radius indicate? height is obvious. What about the offset value? Do the X,Y & Z values conform to 3ds max world view coordinates? For example I believe that The XML files use X & Y to indicate positioning along the 'ground' level, with 'Z' being the height above or below the ground. In max the 'Height' axis is Y.
Basically the whole thing still makes no sense to me, my object still behaves weirdly.

Here is the GDI warfactory geometry values:
- <Geometry IsSmall="false">
- <Shape Type="BOX" MajorRadius="50.0" MinorRadius="50.0" Height="30.0">
  <Offset x="0" y="0" z="0" /> 
  </Shape>
- <Shape Type="BOX" MajorRadius="10.0" MinorRadius="50.0" Height="75.0">
  <Offset x="-24" y="0" z="0" /> 
  </Shape>

0

#7 User is offline   Golan 

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

Posted 26 February 2009 - 12:40 PM

Max should also use the regular X-Y-Z norm in that Z is height. Otherwise, you might have changed some settings. You can take the offset directly from Max' coordinates.
MajorRadius and MinorRadius define the radius in X (major) and Y (minor) direction, thus allowing you to form basic ellipses. This also applies to the Box shape, which uses Radius in the meaning of 1/2 edge length. For example, a box with MajorRadius=4, MinorRadius=6, Height=5 would have the the size of 8x12x5 (XxYxZ).
0

#8 User is offline   Madin 

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

Posted 26 February 2009 - 02:40 PM

Thanks for the explanation.

The special power is now only available upon reaching heroic status, however the ability is visible the whole tima and also shows a null 'required' tag in its description. Is there a way to have the unit ability button hidden until the unit reaches heroic? so that the ability comes has a surprise when you reach the heroic rank.
0

#9 User is offline   Golan 

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

Posted 26 February 2009 - 03:49 PM

You can use a commandsetupgrade. IIRC the schema is quite self-explanatory.

I'd suggest using Lauren's solution from the EA forums (using an UnpauseSpecialPowerUpgrade ) though, otherwise the ability cannot be triggered when multiple Titans are selected as this will always show the default command set.
0

#10 User is offline   Madin 

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

Posted 27 February 2009 - 03:32 AM

Everything is going very well, quick question, how do I reverse an animation in max? Basically I'm going to reverse the Titan death animation so it gets up when captured by an engineer. My attempt has not worked at all!
0

Share this topic:


  • 2 Pages +
  • 1
  • 2
  • 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