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 Thu Apr 18, 2024 1:11 pm
All times are UTC + 0
Emp grenade special ability issue
Moderators: Global Moderators
Post new topic   Reply to topic Page 1 of 1 [6 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
Madin
Plasma Trooper


Joined: 05 Apr 2009

PostPosted: Thu Oct 07, 2010 4:41 pm    Post subject:  Emp grenade special ability issue
Subject description: General problems with 'HordeDispatchSpecialPower'
Reply with quote  Mark this post and the followings unread

So, a while ago I tried coding an 'Emp grenade' special ability, similar to the one seen in Kane's Wrath. It kind of worked, but there are still a couple of outstanding issues.
1: When the ability is used, a single grenade is thrown, and then after a small delay, the 4 grenadiers throw there grenades. So I get 5 grenades because of this unwanted 'pre-attack'.

2: The horde behaviour gets disrupted after using the ability. For example, after using the ability, one grenadier will break ranks and stand in the position of another squad member (so it looks like there are only 3 squad members). Sometimes it can seem has if you are down to 2 squad members because of this.

I know that some modders have got similar squad abilities working, I was wondering if you can share you methods.
I tried a similar special ability with a rocket squad and the results were the same!

Some code:
Special power
Code:
<SpecialPowerTemplate id="SpecialPowerEMPGrenade_Targeted" TargetType="OBJECT_OR_LOCATION" NameOfVoiceNameToUseAsInitiateIntendToDoVoice="VoiceSensorPod" ReloadTime="10s" RadiusCursorRadius="50">
    <ObjectFilter Rule="NONE" Relationship="ENEMIES" Include="VEHICLE STRUCTURE" />
  </SpecialPowerTemplate>

Weapon Template
Code:
<WeaponTemplate id="GDIGrenadeSoldierEMPGrenadeTargeted" Name="GDIGrenadeSoldierEMPGrenadeTargeted" AttackRange="260.0" WeaponSpeed="150" RadiusDamageAffects="ALLIES ENEMIES NEUTRALS" ClipSize="0" AutoReloadsClip="AUTO" AcceptableAimDelta="20d" ForbiddenFiringObjectStatus="CLONED" CanFireWhileMoving="false" ScatterRadius="50">
    <PreAttackDelay MinSeconds="1.5s" MaxSeconds="1.5s" />
    <FiringDuration MinSeconds="0.70s" MaxSeconds="0.70s" />
    <Nuggets>
      <ProjectileNugget ProjectileTemplate="GDIGrenadeSoldierGrenadeProjectile" WarheadTemplate="GDIGrenadeSoldierEMPGrenadeWarhead" />
    </Nuggets>
  </WeaponTemplate>
<WeaponTemplate id="GDIGrenadeSoldierEMPGrenadeWarhead" Name="GDIGrenadeSoldierEMPGrenadeWarhead" RadiusDamageAffects="ALLIES ENEMIES NEUTRALS" ProjectileCollidesWith="ALLIES ENEMIES NEUTRAL STRUCTURES WALLS" AntiMask="ANTI_GROUND ANTI_STRUCTURE">
    <Nuggets>
      <ParalyzeNugget Radius="30.0" DurationSeconds="10s" ParalyzeType="EMP" ParalyzeFX="FX_NODBuggyEmpHit">
        <SpecialObjectFilter Rule="ALL" Exclude="UNATTACKABLE INFANTRY CIVILIAN_BUILDING TIBERIUM TIBERIUM_FIELD" />
      </ParalyzeNugget>
    </Nuggets>
  </WeaponTemplate>

Grenade Squad
Code:
<HordeDispatchSpecialPower id="ModuleTag_HordeDispatchSpecialPower" SpecialPowerTemplate="SpecialPowerEMPGrenade_Targeted" UpdateModuleStartsAttack="true"></HordeDispatchSpecialPower>
      <WeaponFireSpecialAbilityUpdate id="ModuleTag_TargetedEMPGrenadeUpdate" SpecialPowerTemplate="SpecialPowerEMPGrenade_Targeted" SpecialWeapon="GDIGrenadeSoldierEMPGrenadeTargeted" StartAbilityRange="250.0" UnpackTime="1.5s" PackTime="1.0s" />

Grenade soldier
Code:
<AnimationState ParseCondStateType="PARSE_NORMAL" ConditionsYes="SUPPRESSED SPECIAL_WEAPON_ONE" FrameForPristineBonePositions="24" StateName="STATE_Suppressed">
          <Animation AnimationName="GUGrendr_SATA" AnimationMode="ONCE" />
        </AnimationState>
<AnimationState ParseCondStateType="PARSE_NORMAL" ConditionsYes="COVER SPECIAL_WEAPON_ONE" FrameForPristineBonePositions="22" StateName="STATE_Cover">
          <Animation AnimationName="GUGrendr_KAKA" AnimationMode="ONCE" />
        </AnimationState>
<AnimationState ParseCondStateType="PARSE_NORMAL" ConditionsYes="MOVING SPECIAL_WEAPON_ONE" FrameForPristineBonePositions="31">
          <Animation AnimationName="GUGrendr_RUNA" AnimationMode="LOOP" />
          <Script>
                  CurDrawableSetTransitionAnimState("TRANS_AttackingRunning")
               </Script>
        </AnimationState>
<AnimationState ParseCondStateType="PARSE_NORMAL" ConditionsYes="SPECIAL_WEAPON_ONE" FrameForPristineBonePositions="31">
          <Animation AnimationName="GUGrendr_ATKA" AnimationMode="ONCE" />
<SpecialPower id="ModuleTag_TargetedEMPGrenade" SpecialPowerTemplate="SpecialPowerEMPGrenade_Targeted" UpdateModuleStartsAttack="true" />
      <WeaponFireSpecialAbilityUpdate id="ModuleTag_TargetedEMPGrenadeUpdate" SpecialPowerTemplate="SpecialPowerEMPGrenade_Targeted" SpecialWeapon="GDIGrenadeSoldierEMPGrenadeTargeted" WhichSpecialWeapon="1" StartAbilityRange="250.0" UnpackTime="1.5s" PackTime="1.0s" />

Back to top
View user's profile Send private message
Stygs
Cyborg Cannon


Joined: 27 Nov 2005
Location: Germany

PostPosted: Thu Oct 07, 2010 10:11 pm    Post subject: Reply with quote  Mark this post and the followings unread

The only thing that comes to mind now: Dont use GDIGrenadeSoldierEMPGrenadeTargeted as a weapon for the squad dummy because it will fire it like a normal weapon (hence the 5. grenade).

I made some similiar weapons for TWA and they all are based on the Zone Trooper jump jets (works pretty sweet) but you need a couple of specialpowers for it to work:

1. Rangefinder - this specialpower wont do much, its whole purpose is to get the squad into range.
2. Dispatch - this SP triggers 2 other SPs, one for the squad dummy and one for the members (pretty sure you could combine that with the Rangefinder, but I never bothered testing it).
3. Squad Members - the real SP that makes each soldier fire their grenades.
4. Squad Dummy - this SP should have the same settings as 3., but it should have no Weapon in the WeaponFireSpecialAbilityUpdate. Its used to make sure that the squad dummy is busy and wont try to target enemys while the soldiers are busy using their EMPs.

_________________

Back to top
View user's profile Send private message Skype Account
Madin
Plasma Trooper


Joined: 05 Apr 2009

PostPosted: Fri Oct 08, 2010 10:17 am    Post subject: Reply with quote  Mark this post and the followings unread

I tried to follow what you said, but I now have a red cursor which means that I cannot get the special ability to fire at all.

Special Power
Code:
<SpecialPowerTemplate id="SpecialPowerEMPGrenade_Targeted" TargetType="OBJECT_OR_LOCATION" NameOfVoiceNameToUseAsInitiateIntendToDoVoice="VoiceSensorPod" ReloadTime="10s" WaypointModeTerminal="false">
    <ObjectFilter Rule="ANY" Relationship="ENEMIES" Include="VEHICLE STRUCTURE" />
  </SpecialPowerTemplate>
  <SpecialPowerTemplate id="SpecialPowerEMPGrenade_RangeFinder" TargetType="OBJECT_OR_LOCATION" NameOfVoiceNameToUseAsInitiateIntendToDoVoice="VoiceSensorPod" ReloadTime="10s" RadiusCursorRadius="50">
    <ObjectFilter Rule="ANY" Relationship="ENEMIES" Include="VEHICLE STRUCTURE" />
  </SpecialPowerTemplate>
  <SpecialPowerTemplate id="SpecialPowerEMPGrenadeDispatch" ReloadTime="10s" TargetType="LOCATION" />
  <SpecialPowerTemplate id="SpecialPowerEMPGrenadeHordeTrigger" ReloadTime="10s" TargetType="LOCATION" />

Grenade soldier
Code:
<SpecialPower id="ModuleTag_TargetedEMPGrenade" SpecialPowerTemplate="SpecialPowerEMPGrenade_Targeted" UpdateModuleStartsAttack="true" />
      <WeaponFireSpecialAbilityUpdate id="ModuleTag_TargetedEMPGrenadeUpdate" SpecialWeapon="GDIGrenadeSoldierEMPGrenadeTargeted" SpecialPowerTemplate="SpecialPowerEMPGrenade_Targeted" UnpackTime="1.5s" PackTime="1.0s" BusyForDuration="1.5s" WhichSpecialWeapon="1" />

Grenade Squad
Code:
<SpecialPower id="ModuleTag_HordeDispatchSpecialPower" SpecialPowerTemplate="SpecialPowerEMPGrenade_RangeFinder" UpdateModuleStartsAttack="true" />
      <SpecialAbilityUpdate id="ModuleTag_TargetedEMPGrenadeUpdate" SpecialPowerTemplate="SpecialPowerEMPGrenade_RangeFinder" UnpackTime="0s" PackTime="0s" StartAbilityRange="250.0" ChainedButton="Command_TargetedEMPGrenade" />
      <SpecialPowerDispatchSpecialPower id="ModuleTag_Dispatch" SpecialPowerTemplate="SpecialPowerEMPGrenadeDispatch">
        <SpecialPower SpecialPowerTemplate="SpecialPowerEMPGrenadeHordeTrigger" />
        <SpecialPower SpecialPowerTemplate="SpecialPowerEMPGrenade_Targeted" />
      </SpecialPowerDispatchSpecialPower>
      <HordeDispatchSpecialPower id="ModuleTag_HordeDispatchSpecialPower" SpecialPowerTemplate="SpecialPowerEMPGrenade_Targeted"></HordeDispatchSpecialPower>
      <SpecialPower id="ModuleTag_EMPGrenadeTrigger" SpecialPowerTemplate="SpecialPowerEMPGrenadeHordeTrigger" UpdateModuleStartsAttack="true"></SpecialPower>
      <WeaponFireSpecialAbilityUpdate id="ModuleTag_EMPGrenadeTriggerUpdate" SpecialPowerTemplate="SpecialPowerEMPGrenadeHordeTrigger" UnpackTime="1.5s" PackTime="1.0s" BusyForDuration="1.5s" WhichSpecialWeapon="1" />

Logic Command
Code:
  <LogicCommand Options="NEED_TARGET_POS" Type="SPECIAL_POWER" id="Command_TargetedEMPGrenade">
    <SpecialPower>SpecialPowerEMPGrenadeDispatch</SpecialPower>
  </LogicCommand>
  <LogicCommand Options="NEED_TARGET_POS" Type="SPECIAL_POWER" id="Command_EMPGrenadeGetToRange">
    <SpecialPower>SpecialPowerEMPGrenade_RangeFinder</SpecialPower>
  </LogicCommand>

LogicCommandSet
Code:
<LogicCommandSet id="GDIEMPGrenadeSoldierSquadCommandSet">
    <Cmd>Command_StanceDrillDown</Cmd>
    <Cmd>Command_GDICallForTransportInfantry</Cmd>
    <Cmd>Command_EMPGrenadeGetToRange</Cmd>
    <Cmd>Command_TargetedEMPGrenade</Cmd>
    <Cmd>Command_AttackMove</Cmd>
  </LogicCommandSet>

UnitAbilityButtons
Code:
<TargetedSpecialPowerButton Id="Command_EMPGrenadeGetToRange" ValidTargetCursor="Bombard" RadiusCursor="TargetingDecal03">
        <State Image="Button_EMPGrenade" Title="NAME:EMPGrenade" Description="DESCRIPTION:EMPGrenade" />
      </TargetedSpecialPowerButton>

Back to top
View user's profile Send private message
Madin
Plasma Trooper


Joined: 05 Apr 2009

PostPosted: Sun Dec 05, 2010 12:51 pm    Post subject: Reply with quote  Mark this post and the followings unread

Stygs wrote:
The only thing that comes to mind now: Dont use GDIGrenadeSoldierEMPGrenadeTargeted as a weapon for the squad dummy because it will fire it like a normal weapon (hence the 5. grenade).

I made some similiar weapons for TWA and they all are based on the Zone Trooper jump jets (works pretty sweet) but you need a couple of specialpowers for it to work:

1. Rangefinder - this specialpower wont do much, its whole purpose is to get the squad into range.
2. Dispatch - this SP triggers 2 other SPs, one for the squad dummy and one for the members (pretty sure you could combine that with the Rangefinder, but I never bothered testing it).
3. Squad Members - the real SP that makes each soldier fire their grenades.
4. Squad Dummy - this SP should have the same settings as 3., but it should have no Weapon in the WeaponFireSpecialAbilityUpdate. Its used to make sure that the squad dummy is busy and wont try to target enemys while the soldiers are busy using their EMPs.


Would it be possible to see some sample code please?
I've never been able to get this blasted thing to work! Confused

Back to top
View user's profile Send private message
Stygs
Cyborg Cannon


Joined: 27 Nov 2005
Location: Germany

PostPosted: Mon Dec 06, 2010 8:17 pm    Post subject: Reply with quote  Mark this post and the followings unread

just use the zone trooper - its exactly the same, just that the squad SP needs no weapon (the SP is only used to keep the squad object busy) and a grenade weapon for the soldiers instead of a jumpjet.

_________________

Back to top
View user's profile Send private message Skype Account
Madin
Plasma Trooper


Joined: 05 Apr 2009

PostPosted: Wed Dec 08, 2010 11:20 pm    Post subject: Reply with quote  Mark this post and the followings unread

Finally sorted it, thanks!

_________________

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [6 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.1533s ][ Queries: 11 (0.0104s) ][ Debug on ]