Project Perfect Mod Forums
:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::


The time now is Fri Apr 19, 2024 7:03 pm
All times are UTC + 0
Demo Trucks! (And weapon drawing)
Moderators: Global Moderators
Post new topic   Reply to topic Page 1 of 1 [5 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
Elysha
Guest




PostPosted: Sat Feb 02, 2008 5:55 am    Post subject:  Demo Trucks! (And weapon drawing)
Subject description: Some C&C3 modding questions.
Reply with quote  Mark this post and the followings unread

Hey,

I was trying to code in a suicide vehicle like the Demo Truck from RA2 into C&C3. To do this I've tried to copy the Nod Fanatic's weapon logic (the range finder, the self kill weapon, and the actual deathbomb) yet all my efforts applying this to a vehicle don't work at all. It doesn't even explode when blown up, and it does nothing when I tell it to attack an enemy.

Additionally I was having some strange graphical issues with weapons. I wanted to give another vehicle a very similar weapon to the GDI Watch Tower with the nice bullet trace effect, but it consistently shows up as invisible.

Laser draw effects work for me, but also include bullets so it looks like a double bullet/laser effect which is fairly weird.

Some assistance in any or all of my issues would be appreciated.

Back to top
Dutchygamer
President


Joined: 18 Jun 2005
Location: Dordrecht, the Netherlands

PostPosted: Sat Feb 02, 2008 11:27 am    Post subject: Reply with quote  Mark this post and the followings unread

Perhaps sharing your codes could be usefull Wink

Back to top
View user's profile Send private message Send e-mail Skype Account
Elysha
Guest




PostPosted: Sat Feb 02, 2008 11:38 am    Post subject: Reply with quote  Mark this post and the followings unread

Sure, that's probably a good idea Embarassed

My Demotruck style vehicle is as follows:

Code:
<?xml version="1.0" encoding="utf-8"?>
<AssetDeclaration xmlns="uri:ea.com:eala:asset" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xi="http://www.w3.org/2001/XInclude">
   <Tags></Tags>
   <Includes>

      <!-- Base Object -->
      <Include
         type="instance"
         source="DATA:BaseObjects/BaseVehicle.xml" />
   </Includes>
   <GameObject
      id="SNDemoBot"
      inheritFrom="BaseVehicle"
      SelectPortrait="Portrait_ALIENExplorer"
      ButtonImage="Portrait_ALIENExplorer"
      Side="Shadownet"
      EditorSorting="UNIT"
      TransportSlotCount="1"
      BuildCost="2500"
      BuildTime="15"
      CommandSet="NODFanaticCommandSet"
      KindOf="PRELOAD SELECTABLE CAN_ATTACK ATTACK_NEEDS_LINE_OF_SIGHT CAN_CAST_REFLECTIONS SCORE VEHICLE CAN_REVERSE_MOVE CAN_BE_FAVORITE_UNIT"
      ProductionQueueType="VEHICLE"
      UnitCategory="VEHICLE"
      WeaponCategory="BLAST"
      RadarPriority="UNIT"
      VoicePriority="40"
      EditorName="SNDemoBot"
      Description="Desc:SNDemoBot"
      TypeDescription="Type:SNDemoBot">
      <DisplayName
         xai:joinAction="Replace" xmlns:xai="uri:ea.com:eala:asset:instance">NAME:SNDemoBot</DisplayName>
      <GameDependency>
         <RequiredObject>SNDataCell</RequiredObject>
      </GameDependency>
      <ArmorSet
         Armor="AlienExplorerArmor"
         DamageFX="VehicleDamageFX" />
      <LocomotorSet
         Locomotor="AlienExplorerLocomotor"
         Condition="NORMAL"
         Speed="60.0" />
      <SkirmishAIInformation
         UnitBuilderStandardCombatUnit="true" />
      <Draws>
         <ScriptedModelDraw
            id="ModuleTag_Draw"
            OkToChangeModelColor="true">
            <ModelConditionState
               ParseCondStateType="PARSE_DEFAULT">
               <Model
                  Name="AUSurvyrX_SKN" />
            </ModelConditionState>
            <ModelConditionState
               ParseCondStateType="PARSE_NORMAL"
               ConditionsYes="FORMATION_PREVIEW">
               <Model
                  Name="AUSurvyr_FP" />
            </ModelConditionState>            
            <ModelConditionState
               ParseCondStateType="PARSE_NORMAL"
               ConditionsYes="DYING">
               <Model
                  Name="AUSurvyrR_SKN" />
               <ParticleSysBone
                  BoneName="Head"
                  FXParticleSystemTemplate="AlienDamageFire01"
                  FollowBone="true" />
               <ParticleSysBone
                  BoneName="Head"
                  FXParticleSystemTemplate="AlienDamageFireGlow01"
                  FollowBone="true" />
               <ParticleSysBone
                  BoneName="Head"
                  FXParticleSystemTemplate="AlienDamageFireGlow02"
                  FollowBone="true" />
            </ModelConditionState>
            <ModelConditionState
               ParseCondStateType="PARSE_NORMAL"
               ConditionsYes="REALLYDAMAGED">
               <Model
                  Name="AUSurvyrX_SKN" />
               <Texture
                  Original="AUSurvyr"
                  New="AUSurvyr_d" />
               <ParticleSysBone
                  BoneName="Head"
                  FXParticleSystemTemplate="AlienDamageFire01"
                  FollowBone="true" />
               <ParticleSysBone
                  BoneName="Head"
                  FXParticleSystemTemplate="AlienDamageFireGlow01"
                  FollowBone="true" />
               <ParticleSysBone
                  BoneName="Head"
                  FXParticleSystemTemplate="AlienDamageFireGlow02"
                  FollowBone="true" />
            </ModelConditionState>
            <ModelConditionState
               ParseCondStateType="PARSE_NORMAL"
               ConditionsYes="DAMAGED">
               <Model
                  Name="AUSurvyrX_SKN" />
               <Texture
                  Original="AUSurvyr"
                  New="AUSurvyr_d" />
            </ModelConditionState>
            <AnimationState
               ParseCondStateType="PARSE_DEFAULT">
               <Animation
                  AnimationName="AUSurvyr_MOVA" />
            </AnimationState>
            <AnimationState
               ParseCondStateType="PARSE_NORMAL"
               ConditionsYes="DYING"
               Flags="START_FRAME_FIRST">
               <Animation
                  AnimationName="AUSurvyrR_DIEA"
                  AnimationMode="ONCE" />
            </AnimationState>
         </ScriptedModelDraw>
      </Draws>
      <Behaviors>
      <WeaponSetUpdate
            id="ModuleTag_WeaponSetUpdate">
            <WeaponSlotHardpoint
               ID="1"
               AllowInterleavedFiring="false"
               InterleavedStyle="INTERLEAVE_FIRST_AVAILABLE"
               WeaponChoiceCriteria="PREFER_MOST_DAMAGE">
               <!-- This weapon is here to allow the horde to attack victims. It's not used by the fanatic directly. -->
               <Weapon
                  Ordering="PRIMARY_WEAPON"
                  Template="SNDemoBotRangeFinder" />
               <Weapon
                  Ordering="SECONDARY_WEAPON"
                  Template="SNDemoBotBomb" />
            </WeaponSlotHardpoint>
         </WeaponSetUpdate>
            
         <FireWeaponWhenDead
            id="ModuleTag_FireWeaponWhenDead"
            InitiallyActive="true"
            DeathWeapon="SNDemoBotBombExplosion">
            <DieMuxData
               DeathTypes="DETONATED EXPLODED BURNED LASERED" />
            <WeaponFireProbability
               DeathType="BURNED"
               ChancePercentage="80" />
            <WeaponFireProbability
               DeathType="EXPLODED"
               ChancePercentage="100" />
            <WeaponFireProbability
               DeathType="LASERED"
               ChancePercentage="20" />
            <!-- always fire from a detonation -->
            <WeaponFireProbability
               DeathType="DETONATED"
               ChancePercentage="100" />
         </FireWeaponWhenDead>
         
         <SlowDeath
            id="ModuleTag_Vaporise"
            SinkDelay="0s"
            SinkRate="0.0"
            DeathFlags="DEATH_2"
            Fade="true"
            FadeDelay="1.75s"
            FadeTime="0.45s"
            DestructionDelay="2.25s">
            <DieMuxData
               DeathTypes="DETONATED"/>
         </SlowDeath>
         
         <ProductionUpdate
            id="ModuleTag_ProductionUpdate" />
         <Physics
            id="ModuleTag_Physics" />
         <SlowDeath
            id="ModuleTag_Death"
            SinkDelay="8s"
            SinkRate="1.0"
            DestructionDelay="15s">
            <OCL
               Type="INITIAL">
               <OCL>OCL_ALIENSurveyorDebris</OCL>
            </OCL>
            <DieMuxData
               DeathTypes="ALL"
               DeathTypesForbidden="TOPPLED" />
         </SlowDeath>
         <FXListBehavior
            id="ModuleTag_FXList">
            <DieMuxData
               DeathTypes="ALL" />
            <Event
               Index="onDeath"
               FX="FX_ALIENVehicleExplode" />
         </FXListBehavior>


      </Behaviors>
      <AI>
         <AIUpdate
            id="ModuleTag_AI" />
      </AI>
      <Body>
         <ActiveBody
            id="ModuleTag_Body"
            MaxHealth="2000.0" />
      </Body>
      <Geometry
         IsSmall="true">
         <Shape
            Type="CYLINDER"
            MajorRadius="10.0"            
            Height="55.0"></Shape>
      </Geometry>
      <AudioArrayVoice>
         <AudioEntry
            Sound="ALI_Explorer_SoundCreate"
            AudioType="voiceCreated" />
         <AudioEntry
            Sound="ALI_Explorer_SoundMove"
            AudioType="voiceMove" />
         <AudioEntry
            Sound="ALI_Explorer_SoundSelectMS"
            AudioType="voiceSelect" />
      </AudioArrayVoice>
      <!-- ALI_Explorer_SoundSpecial -->
      <AudioArraySound>
         <AudioEntry
            Sound="ALI_Explorer_IdleLoop"
            AudioType="soundAmbient" />
         <AudioEntry
            Sound="ALI_Explorer_MoveStart"
            AudioType="soundMoveStart" />
      </AudioArraySound>
      <ShadowInfo
         Type="VOLUME" />
      <VisionInfo
         VisionRange="150"
         ShroudClearingRange="320" />
      <CrusherInfo
         CrusherLevel="0"
         CrushEqualLevelProps="true"
         CrushableLevel="2" />
   </GameObject>
</AssetDeclaration>


The weapons are:

Code:
<WeaponTemplate
      id="SNDemoBotRangeFinder"
      Name="SNDemoBotRangeFinder"
      AttackRange="1"
      LeechRangeWeapon="true"
      AcceptableAimDelta="45d"
      CanFireWhileMoving="true"
      MeleeWeapon="true"
      ChaseWeapon="true"
      FinishAttackOnceStarted="false" >
      <FiringDuration
         MinSeconds="0.1s"
         MaxSeconds="0.1s" />
      <SurpriseAttackObjectFilter
         Rule="ANY"
         Include="VEHICLE"
         Relationship="ENEMIES"/>
   </WeaponTemplate>
   
   <WeaponTemplate
      id="SNDemoBotBomb"
      Name="SNDemoBotBomb"
      AttackRange="20.0"
      AcceptableAimDelta="180d"
      RadiusDamageAffects="ALLIES ENEMIES NEUTRALS SELF"
      ClipSize="1"
      MeleeWeapon="true"
      ChaseWeapon="true"
      CanFireWhileMoving="true">

      <!--Do enough damage to kill ourselves but ourselves ONLY. Then the fanatic will fire a weapon on die that
            does the chain reaction damage -->
      <Nuggets>
         <DamageNugget
            OnlyKillOwnerWhenTriggered="true"
            Damage="100000.0"
            Radius="0.0"
            DelayTimeSeconds="0.0s"
            DamageType="GRENADE"
            DamageFXType="NOD_GRENADE"      
            DeathType="DETONATED" />
      </Nuggets>
   </WeaponTemplate>
   
   <WeaponTemplate
      id="SNDemoBotBombExplosion"
      Name="SNDemoBotBombExplosion"
      AttackRange="99999.0"
      FireFX="FX_GDI_Comamndo_SatchelChargeExplosion"
      RadiusDamageAffects="ALLIES ENEMIES NEUTRALS SELF"
      ClipSize="1">
      <FiringDuration
         MinSeconds="0.1s"
         MaxSeconds="0.1s" />
      <Nuggets>
         <DamageNugget
            Damage="3500.0"
            Radius="200"
            DelayTimeSeconds="0.1s"
            DamageType="CANNON"
            DamageFXType="NOD_GRENADE"
            DeathType="DETONATED">
            <DamageScalarDetails
               Scalar= "1%">
               <Filter
                  Relationship="ALLIES">
                  <IncludeThing>SNDemoBot</IncludeThing>
               </Filter>
            </DamageScalarDetails>
         </DamageNugget>
      </Nuggets>
   </WeaponTemplate>


I've actually figured out the weapon draw thing, so this is my only problem now.

Back to top
Stygs
Cyborg Cannon


Joined: 27 Nov 2005
Location: Germany

PostPosted: Sat Feb 02, 2008 12:34 pm    Post subject: Reply with quote  Mark this post and the followings unread

Remove the RangeFinder weapon. They are only important for squads, single units dont need them.

_________________

Back to top
View user's profile Send private message Skype Account
Elysha
Guest




PostPosted: Sat Feb 02, 2008 11:52 pm    Post subject: Reply with quote  Mark this post and the followings unread

Stygs wrote:
Remove the RangeFinder weapon. They are only important for squads, single units dont need them.


This helped - the unit explodes on death now, at least. However, it still will not actively go up to a targetted unit and detonate itself.

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [5 Posts] Mark the topic unread ::  View previous topic :: View next topic
 
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
Quick Reply
Username:


If you are visually impaired or cannot otherwise answer the challenges below please contact the Administrator for help.


Write only two of the following words separated by a sharp: Brotherhood, unity, peace! 

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © phpBB Group

[ Time: 0.1840s ][ Queries: 11 (0.0076s) ][ Debug on ]