Jump to content


Valmont

Member Since 25 Dec 2004
Offline Last Active Private

Topics I've Started

ZH - moving infantry, script how to.

25 December 2004 - 09:42 PM

Hello everybody. I was redirected by the Deezire forums for my questions about ZH scripting. It's an honor.

I've recently started re-writing the AI script (skirmishscripts.scb) for the Air Force General. I have everything deleted. The script up to now builds a power, barracks, a supplycenter and a pat battery. Funny how the AI pumps out TWO chinooks instead of one. I never scripted that. But ok, my question has nothing to do with this. Just an intro to my activities.

Ok, time to script the upgrade "capture building". But first I want tol send three infantry men (a team) to the the neares techbuilding. But he code I've implemented doesn't make the rangers move at all. The code follows below. Can anyone assist me in moving out the infantry? Their prio's have been set for tech buildings by the way.

[b]Script, No Subroutine, Deactivates[/b]
*** IF ***
     Player '<This Player>' has a tech building within 5000.00 of  area '[Skirmish]MyInnerPerimeter'
    *AND*  Player '<This Player>' has Greater Than or Equal To  1  unit or structure of type 'AirF_AmericaBarracks'
    *AND*  Team 'InitCaptureInfantry' has been created.
*** THEN ***
  Show debug string and pause: String: '*TECH BUILDING DETECTED*'
  Run Subroutine 'Tech Capture Upgrade'.


[b]Subroutine 'Tech Capture Upgrade', called by previous script[/b]
*** IF ***
    True.
*** THEN ***
  Show debug string and pause: String: '*RUNNING SUB Infantry moving*'
   Team 'InitCaptureInfantry' will move towards the nearest 'Tech Buildings' within  area 'skirmishworld'

And why does the debugger say that it can't recognize waipoints "combatzone" and "skirmishworld" by the way?
Any way, how can I make my ranger team move out? I want them to fight for the tech building in case enemy infantry arrives there as well. My team needs to move out before the upgrade "Building Capture" is executed.

Thank your for your efforts, and a merry Christmas to you all!
- Val -