Jump to content

Scripting Q - flying actor to region, waiting for CC, then attacking


Joaquin
 Share

Recommended Posts

Hi,

I am trying to get my actor to attack the CC after the actor jumps to a region and is set on patrol. Why patrol? Well I tried jumping to a jump point and waiting until the CC showed, but the actor would not react. It appears the same thing happens if I place the actor in patrol mode. The actor is Gammulan. The actor is a recurring enemy in the mission.

I thought I remembered that giving the patrol command without a region cancelled the patrol. This is the piece of code I tried.

!detect bc

patrol

cloak on

attack bc

reenable,9

It doesn't work. The actor will detect the CC if the CC is at the same jump point in the region and will target for a few seconds then it continues on patrol. If the CC is not at the same jump point the actor ignores the CC completely. Any of you seasoned script writers have a suggestion?

Thanks

Joaquin

Link to comment
Share on other sites

Different craft have different detection ranges. A carrier will detect almost any object if it is in space and in the same zone whereas a transport won't detect an object until it is much closer.

e.g.

code:

[dynamic]

terran diplomat,,dipt1,lrt10.3d,DIP-001

[ai]

dipt1,100,100,100,100,100,100,0

start inactive near genesis 100 jmp-10

stop

events 102

!begin_tod1m2

activate this

!detect player

escort player ON

endevents

If the player enters earth zone from any of the normal gates or launches from GalCom HQ, the "activated" LRT-10 will ignore the "escort" command. Not until the player jumps toward Genesis will "escort" be activated. Also, if you use random AI (like in the example), you're less likely to get the behavior you expect.

Note: for more precise control over your NPCs, make good use of the "!tod*m*tick" command.

Edit:

quote:

Originally posted by Joaquin:

!detect bc

patrol

cloak on

attack bc

reenable,9


Also, even if your NPC is within detection range, your script probably has conflicting commands. Try putting the "patrol" command under "!begin_..." to have it start out patrolling the area. Or, if it enters the area from another zone, try putting it under the "!arrived..." command.

That way, it shouldn't revert back to patrolling, even if it loses contact with the player. If anything, it will simply remain on station after the player jumps out of detection range.

EDITED: For clarity

[ 10-31-2004, 07:43 AM: Message edited by: Supreme Cmdr ]

Link to comment
Share on other sites

quote:


Originally posted by Joaquin:

This is the piece of code I tried.


Next time, you need to post the entire script. Here is a GBS-III sample script that gives you an idea of how to do it. Though its for UC, you can adapt it for BCMG.

[ 10-31-2004, 07:42 AM: Message edited by: Supreme Cmdr ]

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...