View Full Version : Airstrikes called in by laser - working!

09-01-2003, 04:08 PM

After much thought, I came up with the following way to create a 'Boris Airstrike' weapon, where a unit on the ground illuminates a building with a laser and calls in air support to obliterate it. This will be for the Tau Pathfinder (special ops guy).

Making the airstrike

This code replaces the Missile Defender Laser Targeting SpecialPower with a laser designator to call in airstrikes. The final code is this:



Object PathfinderBeacon

; *** ART Parameters ***
Draw = W3DModelDraw ModuleTag_01
Model = None

; ***DESIGN parameters ***
EditorSorting = STRUCTURE
Side = America
Conditions = None
Armor = InvulnerableArmor
DamageFX = None

; *** ENGINEERING Parameters ***
RadarPriority = NOT_ON_RADAR

Body = ActiveBody ModuleTag_02
MaxHealth = 200.0
InitialHealth = 200.0

Behavior = LifetimeUpdate ModuleTag_04
MinLifetime = 100 ; min lifetime in msec
MaxLifetime = 100 ; max lifetime in msec

Behavior = OCLUpdate ModuleTag_05 ; Context window is a reaction to this, no CommandSet
OCL = OCL_PathfinderMissileStrike
MinDelay = 60
MaxDelay = 60
CreateAtEdge = Yes ; as opposed to just creating on self

Behavior = DestroyDie ModuleTag_06

Geometry = SPHERE
GeometryMajorRadius = 10.0
GeometryIsSmall = Yes


Object PathfinderBeaconProjectile ; This is an almost copy of the InfernoTankShell. This was necesary to stop the projectile detonating against the ground if there was a hill in the way....

; *** ART Parameters ***
Draw = W3DModelDraw ModuleTag_01
Model = None

; *** AUDIO Parameters ***
SoundDie = A10StrikeAttack ; This causes the sound to play when it dies and creates the beacon.

; ***DESIGN parameters ***
DisplayName = OBJECT:TankShell
EditorSorting = SYSTEM
Armor = ProjectileArmor
VisionRange = 0.0

; *** ENGINEERING Parameters ***
Body = ActiveBody ModuleTag_02
MaxHealth = 100.0
InitialHealth = 100.0

Behavior = DestroyDie ModuleTag_03

Behavior = DumbProjectileBehavior ModuleTag_09
DetonateCallsKill = Yes
; To tweak a Bezier path, please see GS
FirstHeight = 50 ; Height of Bezier control points above highest intervening terrain
SecondHeight = 150
FirstPercentIndent = 20% ; Percentage of shot distance control points are placed
SecondPercentIndent = 90%
FlightPathAdjustDistPerSecond = 0 ; Can allow a max speed this can attempt to follow a target. Units are their velocity we can tag.

Behavior = PhysicsBehavior ModuleTag_05
Mass = 10

Behavior = HeightDieUpdate ModuleTag_06
TargetHeight = 1.0
TargetHeightIncludesStructures = Yes
OnlyWhenMovingDown = Yes
InitialDelay = 1000 ; Can't explode in the first second so we don't explode

on the pad

Behavior = FireWeaponWhenDeadBehavior ModuleTag_07
DeathWeapon = PathfinderStrikeOCL
StartsActive = Yes

Geometry = Sphere
GeometryIsSmall = Yes
GeometryMajorRadius = 1.0




Weapon PathfinderStrikeOCL ; No extra damage, just lays down a damage field
PrimaryDamage = 0.0
PrimaryDamageRadius = 1.0
AttackRange = 100.0
DamageType = EXPLOSION
DeathType = EXPLODED
WeaponSpeed = 99999.0
ProjectileObject = NONE
FireFX = WeaponFX_RangerFlashBangGrenadeDetonation
FireOCL = OCL_PathfinderBeacon
DelayBetweenShots = 0 ; time between shots, msec;
ClipSize = 1 ; how many shots in a Clip (0 == infinite)
ClipReloadTime = 1000 ; how long to reload a Clip, msec
AutoReloadsClip = No
AntiGround = Yes
DamageDealtAtSelfPosition = Yes

;but you must also change the MissileDefenderLaserGuidedMissile weapon :

Weapon MissileDefenderLaserGuidedMissileWeapon
PrimaryDamage = 1.0
PrimaryDamageRadius = 0.0
ScatterRadiusVsInfantry = 10.0 ;When this weapon is used against infantry, it can randomly

miss by as much as this distance.
AttackRange = 300.0 ;Extending this range, allows the special ability to work better.
DeathType = NORMAL
WeaponSpeed = 600
ProjectileObject = PathfinderBeaconProjectile
ScatterRadius = 0 ; This weapon will scatter somewhere within a circle of this radius,

instead of hitting someone directly
DelayBetweenShots = 500 ; time between shots, msec
ClipSize = 1 ; how many shots in a Clip (0 == infinite)
ClipReloadTime = 60000 ; how long to reload a Clip, msec
AutoReloadsClip = Yes
AntiAirborneVehicle = Yes
AntiAirborneInfantry = Yes

; note, these only apply to units that aren't the explicit target
; (ie, units that just happen to "get in the way"... projectiles
; always collide with the Designated Target, regardless of these flags
ProjectileCollidesWith = STRUCTURES


ObjectCreationList OCL_PathfinderMissileStrike

Transport = AmericaJetA10Thunderbolt
FormationSize = 3
FormationSpacing = 35.0
WeaponConvergenceFactor = 0.5
StartAtPreferredHeight = Yes
StartAtMaxSpeed = Yes

MaxAttempts = 1 ;max attempts
DropDelay = 500 ;time in between each set of items

dropped (if more than one)
DeliveryDistance = 450 ;distance from target allowed to

start/stop dropping.
VisibleItemsDroppedPerInterval = 2 ;Drops two bombs at a time
VisibleDropBoneBaseName = WeaponA ;The bombs are created and dropped at

this bone base
VisibleSubObjectBaseName = Missile ;The bombs are visible until dropped.
VisibleNumBones = 6 ;Number of bones.
VisiblePayloadTemplateName = A10ThunderboltMissile ;Created when payload is dropped.
VisiblePayloadWeaponTemplate = A10ThunderboltMissileWeapon
InheritTransportVelocity = Yes ;The bombs will start at transport

ExitPitchRate = 30 ;The bomb will pitch down.
DiveStartDistance = 500
DiveEndDistance = 300
StrafingWeaponSlot = PRIMARY ;Strafe while diving (so long target

point is within weapon range)
StrafeLength = 450
StrafeWeaponFX = FX_DamageTankStruckSmallArms


ObjectCreationList OCL_PathfinderBeacon

ObjectNames = PathfinderBeacon
Count = 1



; ----------------------------------------------
FXList WeaponFX_PathfinderStrike
Color = R:255 G:0 B:0
Radius = 30
IncreaseTime = 0
DecreaseTime = 300


AudioEvent A10StrikeAttack ; Actually just the Raptor attack sounds but slightly louder and heard by everyone......
Sounds = vrapa2a vrapa2b vrapa2c vrapa2d vrapa2e vrapa2f
Control = random
Attack = gradio1a gradio1b gradio1c gradio1d gradio1e gradio1f
Decay = gradio3a gradio3b gradio3c gradio3d gradio3e
Volume= 100
Type = world global everyone


SpecialPower SpecialAbilityMissileDefenderLaserGuidedMissiles
ReloadTime = 120000 ; every two minutes
PublicTimer = No

This code is now complete except for actually getting the laser to fire at structures instead of vehicles. Also, units will have to be upgraded individually (at a big cost eg. 800c) to actually be able to use it. You may have delete some line spaces because posting on the forums screwed up the formatting. Also, you are free to use this in your mod but please credit me ;)

09-01-2003, 04:23 PM
Make sure that the PathfinderBeacon is declared before the unit that uses it is declared. That might have something to do with it.

09-01-2003, 04:29 PM
You mean move it above the missile defender in factionunit.ini ? I'll try that now.

EDIT: Nope. Doesn't work :(

EDIT 2: I think it might be because the missile projectile doesn't actually die. I just tried giving it the toxin field creation weapon firewhendead and that didn't work either.

09-02-2003, 09:04 AM
Errr...guys? Problem.....

09-02-2003, 10:45 AM
That looks familair...

09-02-2003, 10:48 AM
So how did you fix it then?

09-02-2003, 12:08 PM
WOAH.... that looks like it might hurt.

09-02-2003, 12:17 PM
change the reload time for the laser

09-02-2003, 12:22 PM
I see your problem.

The unit targeting the area is hitting it over and over instead of using 1 constant shot you have him repeating it hence you have 20,000 A10's.

You need to change your code a little so he only fire's once every so often (Like Boris did was every 2 mins) Or you will get this problem over and over again...

CH... :D :cool: :D

09-02-2003, 12:23 PM
AHHH! lotsa planes.

yup reload timer should help that out alot ;)

give it a ammo of 1 and a long reload time

09-02-2003, 12:59 PM
I think I have found the problem...and its not what any of you said.....

The PathfinderBeacon object which actually calls in the A10s doesn't die after its alloted 100msecs. This means that it keeps on calling in a10s every 60msecs.....

So how do I make it actually DIE?

09-02-2003, 01:44 PM
not exactly sure, but what about giving it a suicide wepon?

so that it dies once it calls the strike (the weapon not the unit)

that should work but not exactly sure

09-02-2003, 01:50 PM
The lifetime update moduletag should kill it but it doesn't for some reason.

09-02-2003, 01:57 PM
maybe its possible that because of the ImmortalBody that it wont die?

not sure never messed with anything like that for coding so I dont if it'll work or not. just spewing ideas out that might work

09-02-2003, 01:58 PM
Thank you! It works!

Now for the next step: Getting it to only target buildings instead of vehicles.....any ideas for that?

09-02-2003, 03:31 PM
if you look at the code for the paladin defense laser you can see the
"primairytarget = VEHICLE STRUCKTURE
secondairytarget = INFANTRY"
I think you might be able to use that ...
but I think this is only for the AI maybe ...
ehm, take a look at the black lotus cashhack ability ?

09-02-2003, 05:53 PM
Hmm....looks like thats just for a PD laser. It's the PointDefenseLaserUpdate ModuleTag bit that gives it away ;)

I tried giving the missile defender person PreferredAgainst = SECONDARY STRUCTURE but this didn't work :(

09-02-2003, 07:01 PM
this should work...

the unit that has the weapon give

PreferredAgainst = PRIMARY STRUCTURE

put that at the end of the wepon set, you can change primary to whatever weapon the "A10 gun" uses (primary secondary...)

should look something like

Conditions = None
Weapon = PRIMARY A10Gun
Weapon = SECONDARY somethingthatshoots
PreferredAgainst = PRIMARY STRUCTURE

that should fix it all up ;)

09-02-2003, 07:36 PM
So what's the final code? :-p

The End 007
09-02-2003, 08:50 PM
Errr...guys? Problem.....

:lol: :lol:

It's when the guy on the reciving end of that gets out of his car and says "all I did was jump a red light" that you pi$$ yourself laughing. :lol: :lol:

09-02-2003, 10:21 PM
Yeah, can we get the full working code please?

09-03-2003, 02:05 AM
this should work...

the unit that has the weapon give

PreferredAgainst = PRIMARY STRUCTURE

put that at the end of the wepon set, you can change primary to whatever weapon the "A10 gun" uses (primary secondary...)

should look something like

Conditions = None
Weapon = PRIMARY A10Gun
Weapon = SECONDARY somethingthatshoots
PreferredAgainst = PRIMARY STRUCTURE

that should fix it all up ;)

That also wouldn't work due to the way the superweapon actually works. The A10s attack the place where the PathfinderBeacon object was created, they don't target anything themselves. I will post the full code once I am actually finished. ;) There are still several problems, eg. with the projectile sometimes hitting the ground between the target and the guy firing it. I also need to sort out all the different FX.

09-03-2003, 04:28 AM
Glad to see there are people who can actually solve the problems themselves...

I toyed with these things a lot, and you can't fix the target-vehicles problem by messing around with the A-10 weapons, they are just dumb and fire at the location.

In stead, you should mess with the weapon that actually OCL's the A-10's.

09-03-2003, 05:55 AM
Well the weapon which actually creates the A10s is created by the missile defender laser lock on, but I can't find how to change that to target structures. I deleted the REQUIRE_ENEMY_TARGET in the command button ini but all that did was cause it to not fire at all. I have a nasty suspicion this may be hard-coded........

09-03-2003, 07:40 AM

09-03-2003, 01:55 PM
why use the a-10s, cant you use a simpler plane? how many planes do you use? shoudlnt it be a single plane, a single missile that commpletely destroys one building, and just that building?

09-03-2003, 02:24 PM
he'll use this for a mod and replace the a10's and the tankhunter

09-03-2003, 02:47 PM
Yeah, this is for the WH40k: Only War mod. The planes will eventually be replaced by this:

As soon as i get round to making it that is......

09-04-2003, 05:48 PM
So is the above posted code the full working code then?

09-04-2003, 07:52 PM
That also wouldn't work due to the way the superweapon actually works. The A10s attack the place where the PathfinderBeacon object was created, they don't target anything themselves. I will post the full code once I am actually finished. ;) There are still several problems, eg. with the projectile sometimes hitting the ground between the target and the guy firing it. I also need to sort out all the different FX.

that code i poted should work..
look at it this way..

that A10's are called by the beacon thing, the beacon thing is created by the lock on laser thing, if that laser can only target structures, the beacon will be placed at the structure and the A10's attack the building.

Conditions = None
Weapon = PRIMARY LaserLock (the weapon that places the beacon)
Weapon = SECONDARY somethingthatshoots (whatever other weapon that unit has)
PreferredAgainst = PRIMARY STRUCTURE

i dont see why that wouldnt work.. maybe you just misunderstood what i was saying and though that the weapons on the A10 used that code or something...

you just need to put that with the unit that fires the weapon.. (andwhatever other things you have in the weaponset for it)

if you dont understand you can send me the file to my email mikeweathers@verizon.net and i can take a look at it and possibly get it to work (i should only need the factionunit.ini and the tag for the unit)

09-04-2003, 08:15 PM
Conditions = None
Weapon = PRIMARY RegularWeapon
Weapon = SECONDARY LaserLock

That would work better.

09-04-2003, 08:35 PM
yeah that would but he may have it set like the rangers do with their grenades.. but thats not much of a problem ;)

09-05-2003, 03:40 PM
I still don't think that would work. I see what you mean but the problem is that the weapon is not fired in the conventional way. Look at the default missile defender code. The secondary weapon is fully controlled by the MissileDefender special ability. Therefore the bit which I need to change is the SpecialAbility. Changing the weapon to fire against buldings is easy, but I don't know how to change a special ability to choose different sources. I suspect this may be hardcoded though :( I don't mean to be rude but can you actually read what I've posted and check your solution before posting ;)

09-06-2003, 02:21 AM
Do you want it to autofire against buildings ?
else you can just make it a button to fire, just like jarmen kells "snipe vehicle" and I think you should be able to make only buildings valid targets, cursorwise

09-11-2003, 06:01 PM
It's not hardcoded, you just need to change the target ability in the FactionUnit.ini so it can attack buildings.

09-12-2003, 12:40 AM
Well sorry, the code you have created then is not the best way to accomplish this effect.
Setting this weapon as a regular weapon with a long laser fade time and a long reload time with a ProjectileDetonationOCL creating the beacon to call in the A10 would probably be a better way to do it, then my code would work

09-12-2003, 07:32 AM
i like that littel guy, you know the dude with the gun and sh!t.

09-12-2003, 02:20 PM
I didn't think I could use a standard projectile death OCL as the laser didn't actually die?

Also, I don't think that would allow me to have it require the weapon to be locked onto the target for a while before locking?

09-14-2003, 06:55 PM
Fixed to work on buildings, to do so under the secondary weapon type:


Then it will target only structures.

09-14-2003, 08:49 PM
vanguard.. look up a few posts, it was already suggested, and from what he says it wont work that way due to the weapon he used or something :|

09-15-2003, 09:40 PM
Sorry you need to do what I did make buildings have Surrender = 1%
and make it so only the pathfinders weapon does surrender damage and make a new laser and the missile defenders laser only affects units, so that is hardcoded.

Oh and please don't ask me if I want some fries with that shake, cause you know the answer.

09-16-2003, 01:07 PM
That could work....

But I don't think the lasers in generals can have the fire weapon when dead thing? :S

09-16-2003, 10:39 PM
I just made a beacon like the ones in Renegade. It hits the building and smoke comes from it and bam airstrike.

09-17-2003, 01:04 PM
The idea is that is called in by a laser *points at topic name* :)

09-18-2003, 07:59 PM
You can't have a laser unless you knew how to hardcode (reverse engineer) it, and I know you don't know how just like the rest of us. But you can make a beacon.

09-19-2003, 12:10 AM
why not just make a new particle effect to "look" like a laser and have it as a streak behind an invisible projectile. When the projectile detonates, it creates the beacon.

09-19-2003, 04:40 AM
Behavior = FireOCLAfterWeaponCooldownUpdate ModuleTag_13
WeaponSlot = SECONDARY
ConflictsWith = Upgrade_GLAAnthraxBeta Upgrade_Veterancy_HEROIC
OCL = OCL_PoisonFieldMedium
MinShotsToCreateOCL = 4
OCLLifetimePerSecond = 10000
OCLLifetimeMaxCap = 180000

This might enable us to use "normal" weapons to spawn Airstrike after laser cool down.

09-20-2003, 11:44 AM
Hmmmm..... :D How does that code work?

09-20-2003, 08:58 PM
That what I did Henford_.

09-22-2003, 05:44 PM
okay... coming from a person who is scared by the number of ini's this is probably useless... but did you try editing the code behind the use of the laser its self? the anti tank guy can only use it on units so it could have come over into your new code???

just a thought

09-22-2003, 08:32 PM
Not possible because it is hardcoded.

09-23-2003, 05:39 AM
"Hard coded" doesn't mean that its impossible, just hard to do... :cool:

09-23-2003, 12:32 PM
No. It does mean it's impossible. Unless you want to crack the exe and that is both very hard and totally ILLEGAL :p

09-23-2003, 12:34 PM
Why change the laser why not make your COMPLETELY new laser by yourself.

09-23-2003, 12:48 PM
I don't think the FireWeaponWhenDead works with lasers. Also there would be no way of adding the 'keep on target for so many seconds before activating' thing.

Oh wait.....I'm an idiot - I forgot historic bonuses........


09-23-2003, 01:57 PM
I've been playing around with lasers a lot, the reason it will not target structures is because lasers cannot damage them, you need to open armour INI and rewrite the laser code to harm structures (and tanks if you wish), should work fine then, my laser comanche and humvee laser desginator does, although mine just uses a drone, nothing so fancy as an airstrike and a beacon.

Yell if you need help on the laser code, but I'm guessing you can handle changing 0% to something higher than 0.

Regards, Guarm

09-24-2003, 03:09 PM
Actually that can't be the reason since lasers don't damage vehicles either :P Anyway, the laser for the laser designator is created as a special object not as a weapon.

09-25-2003, 05:31 PM
You sure? I think you should check :p

09-26-2003, 12:46 PM
*Sigh* Taken straight from Armor.ini

Armor TankArmor
Armor = CRUSH 50% ;tanks are extra-hard to crush
Armor = SMALL_ARMS 25%
Armor = GATTLING 10% ;resistant to gattling tank
Armor = FLAME 25%
Armor = RADIATION 50% ;Radiation does less damage to tanks.
Armor = POISON 25% ;Poison does a little damage, just for balance reasons.
Armor = SNIPER 1%
Armor = FLESHY_SNIPER 0% ; does zero damage to vehicles (not just "a little")
Armor = MELEE 0% ;tanks don't generally take much damage other than paint damage from MELEE weapons
Armor = LASER 0% ;lasers are anti-personel and anti-projectile only (for point defense laser)
Armor = HAZARD_CLEANUP 0% ;Not harmed by cleaning weapons
Armor = PARTICLE_BEAM 100% ;
Armor = KILL_PILOT 100% ;Jarmen Kell uses against vehicles only.
Armor = SURRENDER 0% ;Capture type weapons are effective only against infantry.

09-27-2003, 09:07 AM
k, well I tried

09-27-2003, 09:21 AM
just wait for zero hour. the base defence laser code can have the dammage deducted and airstrike added... possibly

10-02-2003, 11:16 AM
I was wondering if i could get some help in making a tank use it (not for an airstrike). I want to make it fire a weapon on impact. I converted all i thought was needed but the laser part wont show up. I will see if i can get it to work some more and will reply if i do get it working.

10-02-2003, 12:50 PM
I have had tons of h/work recently so I haven't been able to do any coding (playing HW2 also reduces productivity ;) ) but I sorta know how I can do this now:

Make a weapon which looks like a laser and can only hit buildings (or maybe tanks as well). Give it a historic weapon thing that causes the air strike weapon to fire after the target has been hit so many times by this laser. This would also allow you to have two laser people light up the target and halve the time required to get a lock (not call in two air strikes).

10-09-2003, 02:28 PM
so is the laser painting working now??

10-09-2003, 04:07 PM
how do historic weapon things work?

10-10-2003, 01:23 PM
Historic weapons are the thing which is used to create the firestorm when 8 MiG napalm missiles hit near the same place. eg.

HistoricBonusTime = 3000 ; this is the time period in which all the shots must hit the target
HistoricBonusCount = 6 ; this is how many shots are required
HistoricBonusRadius = 20 ; this is the radius i which they all must hit
HistoricBonusWeapon = FirestormSmallCreationWeapon ;this is the weapon fired when all the above conditions are met

01-09-2004, 05:05 AM
I thought Id share my method, which makes it so the laser has to keep shooting at the target untill the airstrike is within firing range, or else the planes dont shoot.I wont go into complete detail, but Ill describe basically whats happening.

Firstly I use the HistoricBonus on the laser designator to create an object which calls the airstrike.The laser also does "heal" dammage to the object, the reason for which Ill explain next.

This object uses the FireWeapon update to shoot two weapons at itself continuously.The first weapon does a small amount of dammage, which is enough to kill it quickly if the laser stops shooting at it.The second weapon is more powerful and is there to destroy any subsequent objects that get created from the HistoricBonus, in order to ensure only 1 airstrike OCL is called.

The object has two Update OCLs, the first being the airstrike, which happens after a fairly long delay.The second calls a field of salvage crates which are only able to be picked up by the aircraft from the airstrike.The crates are spawned regually at short intervals and have a lifespan of the same length (eg every second) so that if the host object dies, the crates dissapear quickly.

The airstrike aircraft have no weapons in the weaponset until they get a crate upgrade, so even if the OCL has been called the laser guy still has to keep shooting at the target untill the planes fire, or else they just fly on by overhead :)

01-09-2004, 03:24 PM
Very clever :)

01-10-2004, 12:47 PM
so does anyone have it working yet? like screens or vids?

01-10-2004, 06:04 PM
Yes I have it working, but I dont have screens or vids.I havent spent any time working on the art, just the functionality.Just imagine guy with laser, and planes =P

01-10-2004, 06:25 PM
"Boris has arrived!"

Sorry, I just had to say it.

01-10-2004, 11:37 PM
Thank you! It works!

Now for the next step: Getting it to only target buildings instead of vehicles.....any ideas for that?

Use C-4 logic?

01-11-2004, 03:04 PM
I can't, because I need the SpecialPower which fires a weapon after finishing - the LaserGuidedMissile ability