Jump to content


Photo

ZH - moving infantry, script how to.


  • Please log in to reply
6 replies to this topic

#1 Valmont

Valmont
  • New Members
  • 5 posts

Posted 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 -

#2 Mithril

Mithril

    496

  • Hosted
  • 1,386 posts
  • Location:UK
  • Projects:Heh! You're not going to ask me that question.

Posted 28 December 2004 - 03:53 PM

Sorry for the late reply.

And why does the debugger say that it can't recognize waipoints "combatzone" and "skirmishworld" by the way?


That is most likely because the map you are playing on has no "skirmishworld" waypoint - it is unlikely that it has no "combatzone" waypoint though..

To get a team of infantry to capture a tech building you cannot use the "move towards nearest '???'" script - instead you have to use the

[Team][Hunt]Set to hunt using commandbutton ability

and select the relevant capture building ability.
For this to work the infantry that is to capture the building must have the CommandbuttonHuntUpdate defined in the object's INI.

I hope this clears it up :blink:
Command & Conquer: Red Alert - ReGeneration

"Not the faintest clue =\"

-ComradeJ

#3 Valmont

Valmont
  • New Members
  • 5 posts

Posted 28 December 2004 - 06:42 PM

I don't want to capture yet. I just want my standard ranger to move out to towards the tech building first. To fight for it if needed.

Now this bloody editor is weird. I've loaded the original script that came with the game, and inserted a "message/pause" to see if the rangers move out first in the original game. But when I start up the game, I receive 5 seconds later "you have been defeated". And the Skirmish enemy has been defeated too!

This CNC ZH editing seems whack to me. Jolly frustrating.

#4 Valmont

Valmont
  • New Members
  • 5 posts

Posted 28 December 2004 - 07:11 PM

Oh man.
All I did was modifying
[USA Tech Buildings]Tech Building Capture Orders
from this:
*** IF ***
    True.
*** THEN ***
  Have Team '<This Team>' use Attack priority set 'USA Tech Building Priority'.
   Team '<This Team>' will move towards the nearest 'Tech Buildings' within  area 'CombatZone'
   Player '<This Player>' 's Team '<This Team>' all wait until Ability 'Command_AmericaRangerCaptureBuilding' is ready.
   Team '<This Team>' begins hunting using Ability 'Command_AmericaRangerCaptureBuilding'.
to this:
*** IF ***
    True.
*** THEN ***
  Have Team '<This Team>' use Attack priority set 'USA Tech Building Priority'.
  Show debug string and pause: String: 'Rangers moving now!'
  [???] Team '<This Team>' will move towards the nearest 'Tech Buildings' within  area 'CombatZone'
   Player '<This Player>' 's Team '<This Team>' all wait until Ability 'Command_AmericaRangerCaptureBuilding' is ready.
   Team '<This Team>' begins hunting using Ability 'Command_AmericaRangerCaptureBuilding'.
So I only inserted the pause/message command. Nothng more.
And saving, and running the game. Both me and the skirmish team has been defeated after 5 seconds.
What's going on?

*** EDIT ***
Found it. Importing script messes stuff up. I've downloaded a fixed script from somwhere.

Edited by Valmont, 28 December 2004 - 07:27 PM.


#5 Valmont

Valmont
  • New Members
  • 5 posts

Posted 29 December 2004 - 07:44 AM

However, the "SkirmishWorld" and "CombatZone" issue remains.
Is there a way of "saving a modified/new script the WRONG way"?

#6 Valmont

Valmont
  • New Members
  • 5 posts

Posted 29 December 2004 - 11:01 AM

I found out why they were not moving out.
You can't execute per second for some reason. Only per frame.
I don't know why.
I tested if the team existed, and if it did, it moved out as an advanced party. But the script *has* to evaluate per frame. Not per second.

#7 Mithril

Mithril

    496

  • Hosted
  • 1,386 posts
  • Location:UK
  • Projects:Heh! You're not going to ask me that question.

Posted 02 January 2005 - 10:36 PM

Have you used the fixed SkirmishScripts.scb ?

The 1.02 "patch" from EA has screwed up the WB import function.

Edited by Mithril, 02 January 2005 - 10:36 PM.

Command & Conquer: Red Alert - ReGeneration

"Not the faintest clue =\"

-ComradeJ




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users