Jump to content

gopgop

Member
  • Content Count

    14
  • Joined

  • Last visited

  • Medals

  • Medals

Posts posted by gopgop


  1. I'm a novice at scripting and I tried doing what the title says this is what I came up with:

    Whats wrong with it?

    if (alive Heli1) then {
       task1 = player createSimpleTask ["Get into the KA-60"];
    task1 setTaskState "Assigned";
    player setCurrentTask task1;
    
       _wp = (group group1) addWaypoint [position player, 1];
       [_wp, 1] setWPPos (position Heli1);
       [_wp, 1] setWaypointType "GETIN";
    (group group1) setCurrentWaypoint [_wp, 1];
    
    hint "|||||| MISSION ||||||\n Get into the KA-60";
    
    _time = 0;
    while(_time < 30) do {
       [_wp, 1] setWPPos (position Heli1);
       hint format["|||||| MISSION ||||||\n Get into the KA-60\n %1 : 30 seconds left",_time];
       if (player in Heli1) then {
          	hint "|||||| MISSION ||||||\n Completed Good job!";
       };
       _time = _time + 1;
       sleep 1;
    };
           if (!(player in Heli1)) then {
                 hint "|||||| MISSION ||||||\nFailed. Good luck next time!";
           };
    };
    

    Thanks for the help!


  2. You need to use player playmove "" for it to stop. Also exit is unnecessary as this does not stop an sqf script, only an sqs script. Use exitWith instead.

    Put this at the bottom of the script:

    player playMove "";
    

    The problem is that it the animation doesn't toggle so I solve that by using a while loop until I call the script again and it needs to stop it... but it doesn't.. the while loop doesn't stop. Without the while loop he would do it only for 1 second and then go back to normal...


  3. I have the following scripts:

    ins_atease.sqf:

    _player = _this select 0;
    
    if (atease == 0) then {
    atease = 1;
    hint "AtEase";
    } else {
    atease = 0;
    hint "StopAtEase";
    (_player) playmove "AmovPercMstpSlowWrflDnon";
    exit;
    };
    
    while {atease == 1} do
    {
    (_player) playmove "AmovPercMstpSnonWnonDnon_Ease";
    };
    
    exit;

    init.sqf:

    atease = 0;
    publicVariable "atease";

    What I want is when ever i call ins_atease it will toggle the at ease animation.. The first part works when ever i call it, it puts me into the at ease animation. but then when i toggle it the hint for stopatease shows up but it doesnt stop my at ease animation.. what am I doing wrong?


  4. I want to have a global variable that will be initiated to false in the init.sqf and then using an addAction it will run a script that will make the variable true.

    and then the condition for a unit to go to its waypoint is the global variable becoming true

    How would I do this?

    i tried doing this:

    init.sqf:

    startmission = false;

    flag pole object:

    _nul = this addAction["Start mission","start.sqf"];

    start.sqf:

    startmission = true;

    helicopter waypoint condition:

    startmission = true;


  5. private ["_j","_rtarget"];
    _rtarget = _this select 0;
    _j = 0;
    while {_j<=5} do {
    if (_rtarget animationPhase "terc" > 0.1) then {
    _rtarget animate["terc", 1];
    _j = _j+1;
    sleep 1;//change to whatever delay you need, this is 1 second.
    };
    };

    can someone just make this that when it is executed using a trigger then if the target goes down, then it will stay down...


  6. _rtarget = _this select 0;
    _j = 0;
    while (_j<5) {
    if (_rtarget animationPhase "terc" > 0.1) then {
    _rtarget animate["terc", 1];
    _j = _j+1;
    };};

    i have a target that initiates with this animate["terc",1];

    then when you get close to it using a trigger it calls target animate["terc",0] then calls this script

    like so: _nil = target execVM "target.sqf";

    all i want to happen is that after the target comes up when the player shoots it it will stay down. after i shoot it it goes down then back up...

    and it lags the game..

×