Home   Help Search Login Register  

Author Topic: Scripted Waypoints?  (Read 624 times)

0 Members and 1 Guest are viewing this topic.

_Ross_

  • Guest
Scripted Waypoints?
« on: 16 Jun 2003, 07:38:08 »
With a scripted waypoint, does the script happen when the unit is on the way, or when he reaches it, or what?

thanks ;D

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Scripted Waypoints?
« Reply #1 on: 16 Jun 2003, 10:47:02 »
You can move a unit pretty much any way you want to with a script. For example

unit move getpos gamelogic1

@ unit distance gamelogic1 < 100: unit move getpos gamelogic2

would make a unit go to a game logic object and when he's within 100 meters of it he'd start moving to game logic object number 2.


unit move getpos gamelogic1

@ unitready unit: unit move gamelogic2

would make a unit go to a mage logic and when he's there he'd start going to game logic 2
Not all is lost.

Ace

  • Guest
Re:Scripted Waypoints?
« Reply #2 on: 16 Jun 2003, 11:04:04 »
what he means is the script box found in a WP.

I believe it only activiates when a unit has reached the WP

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Scripted Waypoints?
« Reply #3 on: 16 Jun 2003, 12:40:42 »
Script box will activate when the unit has reached the
waypoint before the waypoint "scripted".

Waypoint is finished, when the script has ended.

entering a scriptname (without the exec command) into the
script box will execute the script and automatically pass a few
parameters with.

Best you use a hint format to figure out all the parameters

All you need to do inside the script is:

hint format ["%1",_this]

and you'll see what's been passed to the script.

AFAIK it's groupname (owner of waypoint), position, target/destination


sample:

create 2 units
unit1
unit2

group them together (F2 drag line)

waypoint1: move

waypoint2: scripted
script: test.sqs

waypoint3: move

<<test.sqs>>

hint "script is running"

@!(alive unit2)

hint "script is over"

exit


Now what happens?

group reaches waypoint1,

hint shows up "script is running"

group will wait at waypoint1 until unit2 is dead.

*player shoots unit2*

hint shows up "script is over"

unit1 starts moving to waypoint3

:note - waypoint2 (the scripted one) will be skipped when it
comes to movement.

Group waits at waypoint1, until wayoint2's condition do match
condition of waypoint2 do match when script has been finished
after script has been finished, the group moves directly from
waypoint1 to waypoint3.

hope this helps


:edit - btw for all those who want to use scripts for moving
units inside the group, but still want to use waypoints aswell,
this is the perfect thingy for you


~S~ CD
« Last Edit: 16 Jun 2003, 12:43:13 by Chris Death »
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

_Ross_

  • Guest
Re:Scripted Waypoints?
« Reply #4 on: 16 Jun 2003, 22:03:04 »
thanks i get it now  ;D