Results 1 to 3 of 3

Thread: Training map NEED YOUR HELP pls

  1. #1

    Talking Training map NEED YOUR HELP pls

    Hello,

    here I am trying to finish a training mission for the infantry and I wish I could using a script or trigger, can make this move as infantry targets in traning bis but on a server.
    I wonder if the target moves from left to right 10m and 10m right to left.
    and if it is possible once the target is what is touching the ground and when to exercise this right is over I can restart the targets.

    thank you

  2. #2
    There are a couple of answers to moving targets here although I didn't get either to work for me.

    http://forums.bistudio.com/showthrea...=moving+target

    I did get this bit of script working.

    Calling it with
    null=[targets,direction,angle,distance] execvm "targetmove.sqf"
    wroks but it should be a function call really.

    Code:
    /*
    	File: targetMove.sqf
    	Author: Joris-Jan van 't Land
    
    	Description:
    	Make a moving target move.
    	
    	Parameter(s):
    null=[target,direction,angle,distance] execvm "targetmove.sqf"
    */
    
    private ["_tgt", "_dir", "_angle", "_dist", "_startPos"];
    _tgt = _this select 0;
    _dir = _this select 1;
    _angle = _this select 2;
    _dist = _this select 3;
    _startPos = position _tgt;
    
    private ["_targetPos", "_dist", "_dX", "_dY", "_duration", "_ticks"];
    if (_dir == 0) then {_dist = -_dist};
    _targetPos = [_startPos, _dist, _angle - 90] call BIS_fnc_relPos;
    
    _duration = 1 + round(((_tgt distance player) / 50));
    _ticks = _duration * 100;
    _dX = ((_targetPos select 0) - (_startPos select 0)) / _ticks;
    _dY = ((_targetPos select 1) - (_startPos select 1)) / _ticks;
    
    for "_tick" from 0 to (_ticks - 1) do 
    {
    	if (!LIB_abortChallenges) exitWith {};
    	
    	_tgt setPos [((position _tgt) select 0) + _dX, ((position _tgt) select 1) + _dY, 0];
    	sleep 0.1;
    };
    
    LIB_targetMoved = true;
    
    true

  3. #3
    Gunnery Sergeant Ei8ght's Avatar
    Join Date
    Feb 24 2010
    Location
    France
    Posts
    489
    Author of the Thread
    thx man!!

Posting Permissions

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