OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: sharkyjoe on 03 May 2005, 18:43:09

Title: Trouble with Point Walk Script
Post by: sharkyjoe 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??
Title: Re:Trouble with Point Walk Script
Post by: Chris Death 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
Title: Re:Trouble with Point Walk Script
Post by: sharkyjoe 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.