Home   Help Search Login Register  

Author Topic: Waypoint type: scripted  (Read 1163 times)

0 Members and 1 Guest are viewing this topic.

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Waypoint type: scripted
« on: 23 Jun 2003, 08:22:17 »
A few weeks ago i've replied to a thread about waypoint
type: scripted.

This thread was marked as solve soon after that, so it
disapeared very quickly off page 1 here.

I can't remember having seen other posts explaining how
this waypoint works, so i'm goin to start this thread here,
as i want to show you a really powerful waypoint for scripters
and mission makers.

Code: [Select]
If you'd like to use waypoints and scripted movements in a combined way, i'd suggest you to use the waypoint type: SCRIPTED.

Waypoint type scripted can be used to start a script by entering only the scriptname into the scripted field (the box at
the bottom of the wayoint's menu).
The following parameters will be automatically passed to the
script: [group (owner of waypoint),position (coordinates),target (object where the waypoint is placed onto)]

can be shown in the script by:

hint format ["%1",_this]

If the group reaches the waypoint before the waypoint type:
scripted, the script starts and the group will wait at the waypoint before the scripted waypoint. When the script is
finished, the units will move to the waypoint after the waypoint type scripted.


e.g:

waypoint 1: move

waypoint 2: scripted
scripted: scriptname.sqs

waypoint 3: move


What happens?
group moves to waypoint 1
script starts/group stays at waypoint 1
script ends
group starts moving to waypoint 3

Now if you use any move script for the units, they will do
all what you tell them to do without moving to waypoint 3,
until the script ends.
You can use the domove command to let them move to
individual positions, and you can end the script at a certain
time to let them move on to wp 3.


Also an interesting feature is to use the waypoint itself as
a reference to an object (_this select 2) represents the object,
where the waypoint is placed onto.
This means that you can add any object that you want to
be passed to the script.

e.g: place the waypoint exactly onto an enemy unit, and
you can access this unit for what you want from inside the
script.

_target = _this select 2


If there's the need, i may upload a little tutorial including
1 or 2 sample missions to the editor's depot.

~S~ CD

« Last Edit: 23 Jun 2003, 08:22:53 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

Knut Erik

  • Guest
Re:Waypoint type: scripted
« Reply #1 on: 23 Jun 2003, 13:03:34 »
uuuupload!!! I realy need to learn about scripted Wp's. It looooks sooooo coool!!!!  :o ;D :) ;) :D ;) :) ;D :o

Please upLoad some exsample missions. Please, please, please!!!  :-* :-* :-*
*Erik falls down on his knees and kisses Chris Death's shoes*

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Waypoint type: scripted
« Reply #2 on: 23 Jun 2003, 13:12:13 »
lol *Chris pulls a handkerchief out of his pockets and says:
"oh it's a fea", then he wipes over his shoes*  ;D

OK, gonna do that when i'm back home from work in a few
hours  ;)

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Waypoint type: scripted
« Reply #3 on: 23 Jun 2003, 22:31:42 »
Well, as i promissed above, here's an example mission,
showing you "some" of the possibilities when using waypoint
type scripted.

As explanation of the example i'll post the readme file.
There's also an ingame-explanation by hints, which can
be enabled/disabled ingame by action-menu, or by a
parameter within init.sqs.

Code: [Select]
Scripted waypoints example_01
by Chris Death [BF]

This is a self explaining example mission to show
you how powerfull the waypoint type: scripted is.

The missions consists of:

1 - 8men group (west)

1 - M113 (west) - manned

1 - script for the waypoint type scripted - getin.sqs

1 - script to be activated by action button (bottom right menu)



The 8men group has 3 waypoints:

waypoint 1: type move

waypoint 2: type scripted - the waypoint itself is placed exactly onto
the M113
scripted box: getin.sqs

waypoint 3: type move


Now as soon as the group has reached the waypoint before the waypoint
type scripted, the script in the scripted box starts executing.
The group will act like there were no waypoints, until the script
exits running.
Once the script has ended, the group will start moving to the waypoint
after waypoint type scripted (in this case waypoint 3).


All actions like movement/boarding/disembarking/behaviour setting
were done by using the parameters, which get automatically passed
from waypoint type scripted to the script.

[owner_of_waypoint,position_of_waypoint,target/object_at_waypoint]

 - owner_of_waypoint = group which owns the waypoint
 - position_of_waypoint = 2-3D array (coordinates of waypoint scripted)
 - target/object_at_waypoint = object where the waypoint is placed
   onto - will be NULL-OBJECT, if the waypoint is placed into open
   grounds.

The variables being used inside the script were all built out of
the three parameters.


Bonus feature:

The script features hint messages, which can be toggle on/off during
the mission by using the right-bottom action menu ingame.
By default the hints are set to on = hints will be shown.
If you want to disable the hints right from the start, just change
the following line in the file: init.sqs

no_hints = false

to disable hints, just change false to true

no_hints = true


These hints were made using hintC, and will show you the most important
keywords/variables/steps, being used while the script is running.
I've used hintC, so that you have to click continue or press enter
when finished reading the message.

These hints also explain, how the whole thing works.


~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Waypoint type: scripted
« Reply #4 on: 24 Jun 2003, 15:43:30 »
btw - i forgot to mention that the example mission in the
previous post works only on OFP 1.91, as i was using the
typeof command

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline toadlife

  • OFPEC Old Skool
  • Former Staff
  • ****
  • Official OFP Editing Center Toad
    • toadlife.net
Re:Waypoint type: scripted
« Reply #5 on: 25 Jun 2003, 19:05:08 »
THats very interesting. Never knew what scripted waypoings meant.
"Whenever you want information on the 'net, don't ask a question; just post a wrong answer." -- Cancer Omega.