NOP
  • NOP
  • 100% (Exalted)
  • Major Topic Starter
14 years ago
Hi.

I have been working on a small mod to add a few new tech buildings to zerohour.
So far I have completed a radar tower that if captured provides radar and reveals a large area around it...

Now Im working on an ECM tower. It pretty much works like a stationary ECM tank, deflecting missiles OR freezing an enemy vehicle.
However the ECM beam launches from the base of my model rather than top part.
1: How do I change the point of origin for the beam?

I also want to add an EMP defense to the ECM tower; have a command button on it that will activate an EMP spheroide around itself, disableing all nearby vehicles.
I know how to add command buttons and what not, just not sure how to add the EMP defense.

2: How do I make an EMP skill/power that fires outward from the building at the click of a command button?
Sponsor
Annihilationzh
14 years ago

1: How do I change the point of origin for the beam?



;FILE: Weapon.ini
;------------------------------------------------------------------------------
Weapon  ECMTankVehicleDisabler
  PrimaryDamage         = 24.0
  PrimaryDamageRadius   = 0.0       ; 0 primary radius means "hits only intended victim"
  AttackRange           = 200.0
  DamageType            = SUBDUAL_VEHICLE
  DeathType             = NORMAL
  WeaponSpeed           = 999999.0          ; dist/sec (huge value == effectively instant)
  LaserName             = ECMDisableStream

;-------->  LaserBoneName         = WEAPONA01 <---------------

  RadiusDamageAffects   = ALLIES ENEMIES NEUTRALS
  DelayBetweenShots     = 100               ; time between shots, msec
  ClipSize              = 0                    ; how many shots in a Clip (0 == infinite)
  ClipReloadTime        = 0              ; how long to reload a Clip, msec
  AntiAirborneVehicle   = No
  AntiAirborneInfantry  = No
  FireSound = FrequencyJammerWeaponLoop
  FireSoundLoopTime = 120                ; loop the firing sound until there's this much delay between shots 
End

2: How do I make an EMP skill/power that fires outward from the building at the click of a command button?


Copy demo general's suicide ability. Just make it fire an EMP pulse instead of suicide.
If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.
NOP
  • NOP
  • 100% (Exalted)
  • Major Topic Starter
14 years ago


I got the bone on the model and it fires correctly now. Thanks a lot!
However now I discovered a new problem! The tower will jam missiles even when destroyed!

1: Is there a way to set a condition "has to be alive to fire weapon" type thing?

The code I used:

Behavior = FireWeaponUpdate ModuleTag_23
Weapon = ECMTankMissileJammer
ExclusiveWeaponDelay = 1000
End

2: I didnt quite follow on the copy demo generals part. Can you explain in more detail?

Annihilationzh
14 years ago

1: Is there a way to set a condition "has to be alive to fire weapon" type thing?


Not an immediate one. It is possible with a workaround. You would have to delete the structure on death (any faction building deletes itself). If you have a destroyed model, you can then spawn an indestructable, unclickable building.

2: I didnt quite follow on the copy demo generals part. Can you explain in more detail?



You can observe the command button for the suicide:

CommandButton Demo_Command_TertiarySuicide
  Command                 = FIRE_WEAPON
  Upgrade                 = Demo_Upgrade_SuicideBomb
  WeaponSlot              = TERTIARY
  Options                 = OK_FOR_MULTI_SELECT NEED_UPGRADE
  TextLabel               = CONTROLBAR:SuicideAttack
  ButtonImage             = SUSuicideAttk
  ButtonBorderType        = ACTION ; Identifier for the User as to what kind of button this is
  DescriptLabel           = CONTROLBAR:ToolTipGLASuicideAttack
End
Now obviously there are parts that you don't need for what you're doing so it needs adapting. Most importantly you need to remove, "NEED_UPGRADE" and the Upgrade line.

Then we need a weapon:

Weapon EMPSpawnerWeapon
  FireOCL = OCL_EMPPulseEffectSpheroids
End

It is very important that you do not have it in the primary weapon slot. It is that very same mistake by EA that caused the scud bug.
If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.
NOP
  • NOP
  • 100% (Exalted)
  • Major Topic Starter
14 years ago
Ok.... I'll just be asking about one thing at a time from now on... Continuing with the ECM missile deflection after death problem...
So I've created a new object, the deadECMtower that is to replace the ECMtower on death...

And I've been snooping around the ini.big file looking for code that deletes objects on destruction and replace with a new object... like gla buildings spawning holes... but cant find anything useful...

1:How do I delete an object when it dies and replace it with a new one? -

I hope I'm making myself clear... I've been looking at code all day, and Im starting to feel a bit confused... 🙂
Annihilationzh
14 years ago
This is how it's done by the US command center:
  Behavior             = DestroyDie ModuleTag_15 ; deletes it.
    ;nothing
  End
  Behavior             = CreateObjectDie ModuleTag_16 ; throws some debris out.
    CreationList  = OCL_LargeStructureDebris
  End
  Behavior             = CreateObjectDie ModuleTag_17
    CreationList  = AirF_OCL_AmericanRangerDebris10 ; makes some rangers. 
    ExemptStatus  = UNDER_CONSTRUCTION
  End
  Behavior             = FXListDie ModuleTag_18
    DeathFX       = FX_StructureMediumDeath ; and a visible explosion.
  End

You can spawn the destroyed building with an OCL. You can literally just copy the ranger OCL and make it spawn the building instead.

I hope I'm making myself clear... I've been looking at code all day, and Im starting to feel a bit confused... :-)


The most important part is that you put the effort in. Unfortunately, that means the easiest people to help are often gone in seconds.
If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.
NOP
  • NOP
  • 100% (Exalted)
  • Major Topic Starter
14 years ago
Well that takes care of that! Everything works perfectly now... Thank you so much for your help, I couldnt have done it without you! I'm so glad this forum is still active!

Now I have 2 complete NEW tech buildings! :-)The models kinda suck, but oh well... I'll get better at that eventually...
Wonder what I should do next? Probably make an awesome map to play with them on...