SDI title
 

 
  News:
  » Current News
  » Archive News

  Features:
  » Tutorials
  » Downloads

  Community:
  » Forum




  Random Tip:
12. In order to use the "Commandbutton Hunt" script command your object(s) must have the CommandButtonHuntUpdate to make the script work.
  » View All Tips



  Site:
  » Staff
  » Contact Us

  Affiliates:
  » Atomic Wiener Dog
  » CNC Reneclips
  » GenDev
  » Project Perfect Mod
  » The Finest Hour
  » Warhammer40k: DoW SDI
  » YR Argentina
 

Getting the Missile Defender to use the Laser Lock

Title: Getting the Missile Defender to use the Laser Lock
Difficulty: Novice AI Scripter
Author(s): SDI Team
Game Type: Regular Generals


First the usual routine, open up World Builder, go to Edit>Player List and click "Add Skirmish Players". Next click "Ok" and go to Edit>Scripts and click "Import Scripts". Select your SkirmishScripts.scb which should be in your Command and Conquer Generals\Data\Scripts\ folder.

Open up the "Generic Attack" folder in SkirmishAmerica. Click "New Script" and name it "USA Laser Lock". Uncheck "Deactivate upon success" and check "Script is Subroutine". Go to the Actions if true tab and replace "Null operation" with "[Team] Set to hunt using commandbutton ability". Team'???' should be replaced with 'This Team" and Ability '???' with 'Command_AmericaMissileDefenderLaserGuidedMissiles'. Click "Ok" and "Ok" again in the scripts editor then go to Edit>Teams.

Now we have to define specific teams to use the ability. Just to test this effect select "SkirmishAmerica" then scroll down till you see the "USA D5E Crusader" team and double click it. As you can see there's 1 crusader defined. Replace that one crusader with one AmericaInfantryMissileDefender. Change the team label if you want, but this is only to test if the effect works.
Go to the "Behavior" tab and in the "On Create" box find "USA Laser Lock". Now the scripting part is done. Click "Ok" and "Ok" again in the teams editor and go to Edit>Scripts again. Now export the scripts overwriting the SkirmishScripts.scb.

Because we have told the team to hunt using a commandbutton ability, the object's INI will need a module for that. Open up FactionUnit.ini, as extracted from INI.big and find "AmericaInfantryMissileDefender".

Scroll down till you see the "Physics Behavior" and after its "End" insert the following module:

Behavior = CommandButtonHuntUpdate ModuleTag_07 ; allows use of command button hunt script with this unit.
End


That's it, now save the INI file and open up a skirmish game, playing against an easy USA opponent. Send a vehicle or aircraft to his base and you'll see that you'll be hunted with the Missile Defender's Laser Lock ability once you get in its range.

You can, and please do, expand this onto other teams. Make new teams with lots of missile defenders and tell them to hunt using the laser lock ability. If you need help creating a new team consult the "Adding new units" tutorial.







SDI
SDI is part of the Revora Creative Network.
Orange Block design created by Detail © 2004 Revora Creative Network.
Content © Revora Creative Network 2004 - 2008