Results 1 to 1 of 1

Thread: need some help with a transport script

  1. #1

    need some help with a transport script

    I'm trying to make a script that is called from the init of the vehicle, like: null= call {[this] execvm "transport.sqf"};.
    The vehicles are given a statuscode on entering of leaving a vehicle, using the eventhandlers.
    I've put some conditions in the waypointstatements field that should move the vehicles back and forth to the markers I've put on the map.. obviously I cant get it to work and am a bit stuck atm. So some pointers are much appreciated.

    This is the script I'm working on:
    Code:
     private ["_transporter","_pickupPos1","_pickupPos2","_dropoffPos1""_dropoffPos2","_transporgrp","_transpoint0","_transpoint1","_transpoint2","_transpoint3","_transpoint4"];
    _transporter = _this select 0;
    _transportgrp = group _transporter;
    _pickupPos1 = getmarkerpos "marker1";
    _dropoffPos1 = getmarkerpos "marker2";
    _pickupPos2 = getmarkerpos "marker2";
    _dropoffPos2 = getmarkerpos "marker1";
    
    _transporter addEventHandler ["GETIN", {(_this select 0 setVariable ["status", 2, true]); hint format ["DEBUG: %1 has status %2" ,_this select 0,(_this select 0 getVariable "status")];}];
    _transporter addEventHandler ["GETOUT",{(_this select 0 setVariable ["status", 4, true]); hint format ["DEBUG: %1 has status %2",_this select 0,(_this select 0 getVariable "status")];}];
    _transporter addEventHandler ["FUEL", {hint format ["%1 is unavailable; out of fuel.",_this select 0];}];
    _transporter addEventHandler ["DAMMAGED", { this select 0 setCurrentWaypoint [this select 0, 1]; hint format ["%1 has been damaged, returning to base.",_this select 0];}];
    _transporter addEventHandler ["KILLED", {hint format["%1 KIA",_this select 0];}];
    
    _transpoint0 = _transportgrp addwaypoint[_pickupPos1, 10];
    [_transportgrp,1] setwaypointtype "LOAD";
    [_transportgrp,1] setwaypointCombatMode "BLUE";
    [_transportgrp,1] setwaypointBehaviour "SAFE";
    [_transportgrp,1] setwaypointSpeed "FULL";
    [_transportgrp,1] setwaypointStatements ["call compile format ['%1',_this] getVariable 'status' == 2","hint 'debug wp1'"];
    
    _transpoint1 = _transportgrp addwaypoint[_dropoffPos1, 10];
    [_transportgrp,2] setwaypointtype "TR UNLOAD";
    [_transportgrp,2] setwaypointTimeout [1,1,1];
    [_transportgrp,2] setwaypointStatements  ["call compile format ['%1',_this] getVariable 'status' == 4","hint 'debug wp2'"];
    
    _transpoint2 = _transportgrp addwaypoint[_pickupPos2, 10];
    [_transportgrp,3] setwaypointtype "LOAD";
    [_transportgrp,3] setwaypointTimeout [1,1,1];
    [_transportgrp,3] setwaypointStatements  ["call compile format ['%1',_this] getVariable 'status' == 2","hint 'debug wp3'"];
    
    _transpoint3 = _transportgrp addwaypoint[_dropoffPos2, 10];
    [_transportgrp,4] setwaypointtype "TR UNLOAD";
    [_transportgrp,4] setwaypointTimeout [1,1,1];
    [_transportgrp,4] setwaypointStatements  ["call compile format ['%1',_this] getVariable 'status' == 4","hint 'debug wp4'"];
    
    _transpoint4 = _transportgrp addwaypoint[_pickupPos1, 10];
    [_transportgrp,5] setwaypointtype "CYCLE";
    SOLVED: Problem was " instead of ' at the call compile format part
    Last edited by DTM2801; Sep 29 2009 at 16:31. Reason: solved

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •