Home   Help Search Login Register  

Author Topic: Trouble with Point Walk Script  (Read 544 times)

0 Members and 1 Guest are viewing this topic.

Offline sharkyjoe

  • Members
  • *
  • Have you taken a BMP out at 500 meters??
Trouble with Point Walk Script
« on: 03 May 2005, 18:43:09 »
Scripted worked fine then added somemore scripts. 3 more scripts all same style, just chaged the point-values and call names.sqs before i tested and it went to Error mode. Started over clean map and still error.
Civy name Biker1 intil feild Biker1 moveindriver cycle1 (bicycle=cycle1)
Error message: _unit = _this select 0/#/ error:type string expect array
Called by trigger Civillian
Activat: "Biker1" exec "Bikepoint.sqs"
My Script for point to point

_unit = _this select 0
#start
_unit move [10764.661133,3139.253906,0]
~60
_unit move [10785.845703,3078.884766,0]
~60
_unit move [10718.146484,3129.544922,0]
~60
GOTO "start"

Any ideas what went wrong??
Remember the 7 Ps??--- Proper Previous Planning Prevents Pathetically Poor Performance

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Trouble with Point Walk Script
« Reply #1 on: 03 May 2005, 19:06:24 »
Quote
Activat: "Biker1" exec "Bikepoint.sqs"

should be:

Code: [Select]
[Biker1] exec "Bikepoint.sqs"
:edit - explanation:

_this select 0 refers to the first element of an array, being
passed to the script within the exec statement

You are passing a string ("Biker1") to the script

Therefore the error message says: error expected array - received string

 ;)

~S~ CD
« Last Edit: 03 May 2005, 19:09:04 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

Offline sharkyjoe

  • Members
  • *
  • Have you taken a BMP out at 500 meters??
Re:Trouble with Point Walk Script
« Reply #2 on: 04 May 2005, 02:50:34 »
Gee's I knew that(the coding []). I guess that my Brain was out for Lunch!! :-[
It works Now.
Thanks Chris Death.
Remember the 7 Ps??--- Proper Previous Planning Prevents Pathetically Poor Performance