PDA

View Full Version : Ramming Unit



Dreamscape
06-03-2011, 07:22 PM
Hey all,

One of the next units we're planning on releasing is the United Coalition Shark. The unit is practically ready apart from a little coding problem.

The secondary works using the same princible as the Japan Shogun Battleship. The only difference is that we want the unit to suffer a certain amount of damage when it strikes (whether this be a percentage or a value drop in HP doesn't matter).

No matter what we've tried the unit doesn't seem to lose any health. Any ideas?

Many thanks

R3ven
06-05-2011, 03:07 PM
<MovementSpecialPower
id="ModuleTag_RammingSpeedspecialPower"
SpecialPowerTemplate="SpecialPower_RammingSpeed"
AttributeModifier="AttributeModifier_JapanAntiStructureShipRammingSpe ed"
AttributeModifierAffectsSelf="true"
MovementType="TARGETED"
Duration="5s"
BusyDurationOnExit="0s"
CollisionBounceHeight="0.0"
CollisionBounceDistance="25.0"
ObjectStatus="SPECIALABILITY_ACTIVE NO_SQUISHCOLLIDE_DELAY"
LocomotorSet="NORMAL_UPGRADED"/>


Since I'm assuming that you're using this block of code(same thing the Oni and Shogun Battleship use) use an attributemodifier to set a status.


<AttributeModifier
id="AttributeModifier_Dummy"
Category="NONE"
ObjectStatusToSet="PLAYER_POWER_1"
Duration="0.75s">
</AttributeModifier>


Then have a LoseHealthUpdate like this


<LoseHealthUpdate
id="ModuleTag_LoseHealthUpdate"
HealthTrigger="0%"
DamagePerSecond="200.0">
<ObjectStatusValidation
RequiredStatus="PLAYER_POWER_1" />
</LoseHealthUpdate>


Now this -should- work, but I didn't test it out, so you'll have to say if it works or not, but in theory it should.

Dreamscape
06-05-2011, 08:03 PM
I did think of something like this, but I have a feeling it will affect the unit on use of the power, not on impact of a unit.

R3ven
06-05-2011, 08:33 PM
If it's targeted, it is almost forced to hit it, so as long as too many things are attacking something, it should work fine, but you do have a good point.

Bibber
06-05-2011, 10:43 PM
Create a damage nugget (use different IDs if you have more than 1 DamageNugget) in the weapon template affecting the shark itself.

Incia
06-06-2011, 11:59 AM
I remember trying to give the Mammoth unit the ramming ability, but never got it to work... :/ Does the unit have to have a special 'running' animation or something before it can work?
I copy pasted the weapon and stuff and gave it a speed boost, but it never worked :S

Will give it a new shot now later this week...

SighNapse
06-10-2011, 08:21 AM
Forward from Open_Sketchbook since he can't login on this forum.

you could also make every unit explode with a damagetype that only hurts sharks