Jump to content
Sign in to follow this  
Madin

Issues with spawned\attached model

Recommended Posts

I am having issues with a trial I am doing that concerns having a weapon spawned onto a vehicle.

 

When the vehicle is on an incline of any kind, the spawned model has issues sticking to the docking bone.

Does anyone have any experience with this?

 

(I have noted that C&C3 has issues with vehicles that are on an incline. The projectile launch does not line up with weapon fx, or barrel).

Edited by Madin

Share this post


Link to post

Are you using the CombinedInfoModule from the Scrin PAC? Because I once tried to add some animations for it and as far as I remember, the drones just stayed on their default position and never followed the PAC animation.

Share this post


Link to post

Does the attached unit have any locomotor?

Are you using the attacheupdate module or the spawn module?

Share this post


Link to post

This was indeed loosely based of the PAC code.

 

I have a docking bone defined in 'ExtraPublicBone' (FXBONE01).

 

I am using a 'SpawnBehavior':

<SpawnBehavior id="ModuleTag_SpawnGun" SpawnNumberData="1" InitialBurst="1" SpawnReplaceDelayData="0.1s" SpawnInsideBuilding="false" FadeInTime="1s" CombineOnCreate="true" PassExperienceToSpawned="true">
 <TriggeredBy>Upgrade_AbramGunner</TriggeredBy>
 <Die DeathTypes="ALL"/>
 <SpawnTemplate>AbramTankGun</SpawnTemplate>
 </SpawnBehavior>

Together with a 'CombinedInfoModule':

<CombinedInfoModule id="ModuleTag_CombinedInfoModule" DockingBone="FXBONE"/>

The AIUpdate has extra info pertaining to the docking:

<AI>
<AIUpdate id="ModuleTag_AI" AutoAcquireEnemiesWhenIdle="YES" AILuaEventsList="NODRaiderTankFunctions" SpawnOffsetRadius="14.835" MaxCombineChildren="1">
 <UnitAITargetChooserData CanPickDynamicTargets="false" SympathyRange="25.0"/>
 </AIUpdate>

The spawned gunner is using a slaved update:

<SlavedUpdate id="ModuleTag_SlavedUpdate" LeashRange="0" GuardMaxRange="0" GuardWanderRange="0" AttackRange="0" DieOnMastersDeath="true"/>

but no 'AttachUpdate'.

 

I started off using the PAC fighter 'Locomotor' for the spawned gunner, for my final test I was using a modified version of a tank locomotor:

<LocomotorTemplate id="AbramTankGunLocomotor" Name="AbramTankGunLocomotor" Surfaces="GROUND CRUSHABLE_OBSTACLE" TurnTimeSeconds="0.0s" TurnTimeDamagedSeconds="0.0s" MaxSpeedDamaged="100%" AccelerationSeconds="0.0s" BrakingSeconds="0.0s" SlowTurnRadius="0.0" FastTurnRadius="0.0" BehaviorZ="SURFACE_RELATIVE_HEIGHT" Appearance="TREADS" UseTerrainSmoothing="true" AccelPitchLimit="2.5d" BounceKick="0d" PitchStiffness="0.6" RollStiffness="0.4" PitchDamping="0.4" RollDamping="0.3" ForwardAccelerationPitchFactor="0.025" LateralAccelerationRollFactor="0.0" HasSuspension="true" ClampOrientationToPathTangent="true" ReorientIfTurnTooSharp="true"/>

The only change is the 'BehaviorZ="SURFACE_RELATIVE_HEIGHT"' ( was "NO_MOTIVE_FORCE" ).

Both responded has seen in the video.

Using a 'Locomotor' with 'NO_MOTIVE_FORCE' will cause the spawn to stick to the ground (it spawns at the correct height, but then quickly snaps tp the ground).

Edited by Madin

Share this post


Link to post

As it's just a gunner why not just use a model condition upgrade and make a hierarchical turret?

Share this post


Link to post

As it's just a gunner why not just use a model condition upgrade and make a hierarchical turret?

I already have, this is just a test.

Share this post


Link to post

As it's just a gunner why not just use a model condition upgrade and make a hierarchical turret?

He probably wants the gunner targetable by snipers or infantry or able to be killed and respawned. I had the same idea once more or less about making the weapon arms on wolverines and titans spawned objects and destructable....never worked it out tbh due to feeling in my case it was making a unit overcomplex.

But if you dont care about the gunner being vulnerable, megumi is right about the modelcondition thing.

 

I would try not giving it a locomotor or maybe change its geometry settings to miniscule so it doesnt interact with anything even the ground, i am assuming the gunner has a expected geometry setting and/or bounderybox etc like a normal object?.

 

Another thing you could try is setting SpawnInsideBuilding="true" in the master's spawn module...not sure how it will fair with targeting/firing then tho.

If your tank design allows it you could also try using the garrisonmechanic instead of the spawn mechanic. you could probably add the gamedependancy to the Opencontain module (hordegarrsions and garrisoncontain inherit from this one), thus enabling it by upgrade or so and give it a initial roster of the gunner.

Share this post


Link to post

If he wants snipers to kill it I would suggest adding a bone to the gunners head, calling it some name like "head" (you can set PreferredTargetBone in the weapon to the same and it will look like the weapon does headshots). Then giving the sniper a special weapon for this vehicle which triggers either a condition or lua event, and have that killing the gunner. If you want it to have a certain amount of hp I would suggest using a contained dummy for that and have the weapon kill that. This is basically ravens suggestion but I would only use this as a dummy and handle the other stuff like weapon logic and animation on the main object.

Edited by Lauren

Share this post


Link to post

He probably wants the gunner targetable by snipers or infantry or able to be killed and respawned. I had the same idea once more or less about making the weapon arms on wolverines and titans spawned objects and destructable....never worked it out tbh due to feeling in my case it was making a unit overcomplex.

But if you dont care about the gunner being vulnerable, megumi is right about the modelcondition thing.

 

I would try not giving it a locomotor or maybe change its geometry settings to miniscule so it doesnt interact with anything even the ground, i am assuming the gunner has a expected geometry setting and/or bounderybox etc like a normal object?.

 

Another thing you could try is setting SpawnInsideBuilding="true" in the master's spawn module...not sure how it will fair with targeting/firing then tho.

If your tank design allows it you could also try using the garrisonmechanic instead of the spawn mechanic. you could probably add the gamedependancy to the Opencontain module (hordegarrsions and garrisoncontain inherit from this one), thus enabling it by upgrade or so and give it a initial roster of the gunner.

I will try the spawn inside, and investigate the garrison option also.

 

I am aware of the standard model condition, hierarchal turret set-up, I have used it for years.

 

I was trying to find ways around how rubbish the muti-turret code is in C&C3 (especially when it comes to weapons that have different ranges, and are better against different target types i.e. vehicles vs infantry).

 

Having a spawned gunner, means that because the spawned model is a unique 'GameObject', it can have its own 'WeaponCategory', which allows it to prefer a different target type, and also it will continue to fire at enemies even if the main gun is firing on a target outside of the spawned guns range.

 

Thanks for your tips!

Edited by Madin

Share this post


Link to post

For those reasons the attachupdate might function better, but the trick might be to get it to attach to a specific spots, stead of general geometry as it does usually. The trick might be to offset the guners position abit in 3dsmax so that when it attaches to the vehicle its mesh and bones are in the correct spot . This way you could use its own object code and ai for targeting (specialy if its a turret setup like the gunner).

 

Ps: did your slave logic setup actually work with targetign units? in my experiences the combined docking stuff needs the slavedweapon nugget of the master to target anything?

 

If you combine the attachupdate like that with the spawn module you can do pretty much the same i think.

 

additionaly i used to use the spawn module + nod shredder self repair for an early component tower thing....

 

 

<SlowDeath
                id="ModuleTag_Death"
                SinkDelay="3.0s"
                SinkRate="4.0"
                DestructionDelay="8.0s">
                <DieMuxData
                    DeathTypes="SUICIDED" />
            </SlowDeath>            
            <KeepObjectDie
                id="ModuleTag_KeepObjectForRepair">
                <DieMuxData
                    DeathTypes="ALL"
                    DeathTypesForbidden="SUICIDED" />
            </KeepObjectDie>
            <InitiateRepairDie
                id="ModuleTag_InitiateRepair"
                DelayTime="10s"
                Options="REPAIR_INSTANT"
                InstantRepairModelCondition="USER_1"
                InstantRepairAnimDuration="1.5s"
                MasterDeadDieFX="FX_TEMPLarge">
                <Die
                    DeathTypes="ALL"
                    DeathTypesForbidden="SUICIDED" />
            </InitiateRepairDie>
            <SlavedUpdate
                id="ModuleTag_SlavedUpdate"
                DieOnMastersDeath="true"
                DieOnMastersDeathType="SUICIDED" />
 

wich basicly meant my turret got destroyed, showed a rubble object, then repaired itself to full like the shredder turret.

 

<AnimationState
                    ParseCondStateType="PARSE_NORMAL"
                    ConditionsYes="REPAIRING_DISABLED"
                    StateName="STATE_Rubble"
                    Flags="START_FRAME_LAST">
                    <Animation
                        AnimationName="NBLsrCann_D3AN"
                        AnimationMode="ONCE"
                        AnimationBlendTime="0" />
                </AnimationState>
 

Iirc this was the animation that showed the rubble/destroyed object in nods shredder turrets

 

In your case you could use this to make it look like the infantry unit died and is lying dead ontop of the tank turret (it should still be attached), then have a repair/rebuild animation happen that makes it look like a secondgunner pulls th body inside andtakes it place or such. IF you are interested ingoing that far.

Share this post


Link to post

For those reasons the attachupdate might function better, but the trick might be to get it to attach to a specific spots, stead of general geometry as it does usually. The trick might be to offset the guners position abit in 3dsmax so that when it attaches to the vehicle its mesh and bones are in the correct spot . This way you could use its own object code and ai for targeting (specialy if its a turret setup like the gunner).

 

Ps: did your slave logic setup actually work with targetign units? in my experiences the combined docking stuff needs the slavedweapon nugget of the master to target anything?

 

If you combine the attachupdate like that with the spawn module you can do pretty much the same i think.

Everything worked fine except the issue with inclines.

 

By default a spawned object will do its own targeting independent of the parent object.

Share this post


Link to post

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×