Jump to content

Rect array question


Recommended Posts

Can someone help me with this please.

RunCommand ( GROUP , "Group_Ger_09" , STORM , RECT , "Attack4" )

Now, Attack4 is not a rect but an array of rects.

How does the AI goes about this?

I see that the designer did a grid of rects, 16 of them. It's not really in a sequence. 13 is in the far right and the next, 12, is in the far left.(see picture)

-

rects.jpg

-

I'd like to use more advanced techniques in my missions but I still can't figure this array of rects.

The arrays of points is fine. Just like waypoints.

Thanks

--

Link to comment
Share on other sites

Originally posted by SlapHappy:

What happens when the trigger is launched in-mission. I remember reading somewhere that the attack rect command causes the attacking unit to randomly attack some POINT inside the rect declared area......

I use the attack rect. The attacking forces attack the enemy troops inside that rect.

No problem there.

When you use an array of points there is usually a trigger to control the points so that they work as way points for the units to follow. You can control how long they stay in each point etc.

I have no problem using those.

Now for the array of rects there is no control script that I could find. That's what is intriguing me.

This is the first mission of the USSR campaign.

--

Link to comment
Share on other sites

I have found a control script for the rects:

</font><blockquote>code:</font><hr /><pre style="font-size:x-small; font-family: monospace;"> // ------------------------------------------ ForEach

LABEL ChecktArray

Delay ( 100 , 200 )

SET @rectStorm = ArrayGetElementName ( @arrayRects , @nIndex )

SetWorkArmy ( ARMY , @idPlayerArmy )

SET @nPlayerTanks = GetNUnitsInArea ( ARMY , @idPlayerArmy , HUMAN , @rectStorm , CREW )

IF ( @nPlayerTanks > 0 ) THEN

GOTO OnFindPlayer

ENDIF

ADD ( @nIndex , 1 )

IF ( @nIndex < @nLen ) THEN

GOTO ChecktArray

EndIF</pre>

Link to comment
Share on other sites

Webwing

I took a look at Rovno myself and all the attack scripts I saw look something like this:

</font><blockquote>code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">SetWorkArmy ( ARMY , 1 )

CreateRectByObject ( RECT , "Attack3" , 100 , ARMY , 1 , TANKS , 2 , NOT_EMPTY )

Delay ( 500 )

SetWorkArmy ( ARMY , 2 )

RunCommand ( GROUP , "Group_Ger_08" , STORM , RECT , "Attack3" )

</pre>

Link to comment
Share on other sites

×
×
  • Create New...