Jump to content

Coda

Member
  • Posts

    13
  • Joined

  • Last visited

Posts posted by Coda

  1. Ok, so...unique issues...

     

    While in god mode I ran up to the mission, at about 100 meters from the actual Ural Wreck spawned by this script. (Minor Mission 6?) The mission completed it's self. In the config it's set to complete after killing 100% of the bandits. I didn't fire a single shot and maybe two or three died to friendly fire. The ones that were alive continued to fire at me until they de spawned. -edit- I derped. [fixed = forgot to upload the correct file to server]

     

    Also, reports of AI roaming more or less alone, far from the actual mission and not firing on players. (have not seen it myself yet)

     

    This, modified DZMS is the only script spawning AI.

     

    -edit 2-

    Just seen a group of bandits from a Medical Supply mission walking around a town about 2km out of their spawn area carrying stingers. (RPGs turned off) Only thing different is using this script over normal DZMS, and using the _CU flag, on the new infistar.

  2. Untested.

     

    Change Bank Dialog to....

    if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_10") , "PLAIN DOWN"]; };
    DZE_ActionInProgress = true;
    player setVariable["TrBsy",true,0];
    
    private ["_dialog"];
    ZSC_CurrentStorage = _this select 3;
    _dialog = createDialog "BankDialog";
    call BankDialogUpdateAmounts;
    
    DZE_ActionInProgress = false;
    uiSleep 3;
    player setVariable["TrBsy",false,0];
    

    and give_Player to....

    private ["_dialog"];
    player setVariable["TrBsy",true,0];
    uiSleep 1;
    ZSC_GiveMoneyTarget = cursorTarget;
    if( isPlayer ZSC_GiveMoneyTarget)then{
    _dialog = createdialog "GivePlayerDialog";
    call GivePlayerDialogAmounts;
    }else{
    systemChat format["You are not looking correctly at a player"];
    };
    uiSleep 3;
    player setVariable["TrBsy",false,0];
    
  3. What if you tried....

    GivePlayerAmount = {
    
        private ["_amount","_target","_wealth"];
    
        player setVariable ["TrBsy",true,0];
    
        _InTrd = _target getVariable ["TrBsy",0];
    
        _amount = parseNumber (_this select 0);
    
        _target = cursorTarget;
    
        _wealth = player getVariable["cashMoney",0];
    
        _twealth = _target getVariable["cashMoney",0];
    
        _isMan = _target isKindOf "Man";
    
        if (_amount < 1 or _amount > _wealth) exitWith {
    
            cutText ["You can not give more than you currently have.", "PLAIN DOWN"];
    
        };
    
        if (!_isMan) exitWith {
    
            cutText ["You are not facing anyone.", "PLAIN DOWN"];
    
        };
    
        if (_wealth == _twealth) exitWith {
    
            cutText ["FAILED : Both Targets have same amount of money.", "PLAIN DOWN"];
    
        };
    
        if (_InTrd) exitWith {
    
            cutText ["Player is busy, please wait.", "PLAIN DOWN"];
    
        };
    
        PVDZE_account_Doublecheck = [player];
    
        publicVariableServer "PVDZE_account_Doublecheck";
    
        player setVariable["cashMoney",_wealth - _amount, true];
       
        _target setVariable["cashMoney",_twealth + _amount, true];
    
    
    
        PVDZE_plr_Save = [player,(magazines player),true,true] ;
    
        publicVariableServer "PVDZE_plr_Save";
    
        PVDZE_plr_Save = [_target,(magazines _target),true,true] ;
    
        publicVariableServer "PVDZE_plr_Save";
    
    
    
        cutText [format["You gave %1 %2.", _amount, CurrencyName], "PLAIN DOWN"];
    
        uiSleep 3;
    
        player setVariable ["TrBsy",false,0];
    
    };
    

     

    Haven't tested it yet.

     

    -edit-

    Most likely wont work, but what I was thinking was, setting a variable to the player when they open the give money dialog, and remove it a few seconds after it closes. If the variable is true, then it prevents the other person from trading with them until the dialog is closed.

     

    -edit 2-

    You might try changing... give_player_dialog.sqf to look like...

     

     
    private ["_dialog"];
     
    player setVariable ["TrBsy",true,0];
    _dialog = createdialog "GivePlayerDialog";
    
    call GivePlayerDialogAmounts;
    waitUntil { !dialog };
    uiSleep3;
    player setVariable ["TrBsy",false,0];
    

     

    then remove... both >>player setVariable ["TrBsy",true,0];<< and >>player setVariable ["TrBsy",false,0];<< from the previous script in this reply

     

    Will try testing it when I can.

  4. _cursorTarget is being called inside the code of....

    if (!isNull cursorTarget && !_inVehicle && !_isPZombie && (player distance cursorTarget < _allowedDistance) && _canDo) then {  
    

    After that code finishes after the " }; " it frees the variable _cursorTarget. Any variable defined with an _ prefix is considered local only to the block of code that it is being ran in.

    So instead of increasing the size of the block of code by re adding the _cursorTarget variable and definition... I shrunk it down so that it performs the same function with cursorTarget (which is a global define, (lacks "_")).

     

    I have it running smoothly for the most part other than getting the error....

    Error Undefined variable in expression: s_bank_dialog3
    File mpmissions\__CUR_MP.chernarus\Scripts\Fn_SelfActions\fn_selfActions.sqf, line 880
    

    I'm thinking that's because I set the changed bottom to dialog3, instead of like dialog4 or something else I did foolishly.

    (But otherwise the code works flawlessly)

     

    -edit-

    The issue Im thinking, is with adding the code to the bottom then having step 3( B ) add the extra >> s_bank_dialog3 = -1; << above it. So moving the block I supplied to say above...

    if(_cursorTarget isKindOf "Generator_DZ") then {
    

    Should probably work.

     

    -edit2-

    Just realized the _cursorTarget should be defined for the original script as it falls inside the block where it's defined, still a little odd. Might have to look into that some more.

    -edit 3-

    More derp-ness, if you put the code block at the bottom it isn't included with _cursorTarget. (The code that defines _cursorTarget ends about 3 lines after the first >>> s_player_followdog = -1; <<<

  5. +1 this

    Currently trying to get this to work with Soul Coins 2.0 as well. Looks like Bankerbot variable is undefined.

     

    Do your bankers have the variable set?

     

    -edit-

     

    Found the problem. _cursorTarget is the unset variable not an action.... What the code should look like.... [For Soul's 2.0]

    if((cursorTarget getVariable ["BankerBot",0] == 1) and (player distance cursorTarget < 3)) then {          
            if (s_bank_dialog3 < 0) then {
                s_bank_dialog3 = player addAction ["your bank here", "Scripts\Gold_Coin_system\Bank_Dialog\bank_dialog.sqf", cursorTarget, 3, true, true, "", ""];
            };            
        } else {        
            player removeAction s_bank_dialog3;
            s_bank_dialog3 = -1;
        };
    

  6. Ok sorry I may have typed that wrong.

    What I meant to say is that "No spheres are spawning, at all. Except when I ran the first script, the last sphere spawned. The one that was labeled as (_thisGZ01)"

     

    When I ran the second script none of them spawned. I looked at every trader and the airfield.

     

    Im currently fine tuning this script, which I hope will work without using "forEach"

     

    _mkrsp = [
    //blah blah blah
    ];
    if (isServer) then
    {
        _cntmkr = count _mkrsp;
        for "_i" from 0 to _cntmkr do
        {
        _posmkr =_mkrsp select (_i);
        diag_log (_posmkr);
        _mkrspA = _posmkr select 0;
        diag_log (_mkrspA);
        _mkrspB = _posmkr select 1;
        diag_log (_mkrspB);
        _posmkrB = [_mkrspA, _mkrspB, 0.25];
        diag_log (_posmkrB);
        _thismkr = ((_mkrspA / 2) + (_mkrspB / 2));
        diag_log (_thismkr);
        _thismkr = createVehicle ["Sign_sphere100cm_EP1", _posmkrB, [], 0, "CAN_COLLIDE"];
        _thismkr setPos _posmkrB;
        diag_log (_thismkr);
        };
    };
    

     

    Im hoping this scipt will work correctly with the usage of (_i), if I can get the spheres to spawn then I can try to use part of the previous script to set an array I hope, where this bit of code here can pull from the recently filled array.

     

    -edit-

     

    Tried running...

    _mkrsp=[
    //  format: [X,Y],[X,Y], ....
    ];
    if (isServer) then
    {
        _cntmkrA = count _mkrsp;
        _cntmkrB = (_cntmkrA - 1);
        for "_i" from 0 to _cntmkrB do
        {
        _posmkr =_mkrsp select (_i);
        diag_log (_posmkr);
        _mkrspA = _posmkr select 0;
        diag_log (_mkrspA);
        _mkrspB = _posmkr select 1;
        diag_log (_mkrspB);
        _posmkrB = [_mkrspA, _mkrspB, 0.25];
        diag_log (_posmkrB);
        _thismkr = ((_mkrspA / 2) + (_mkrspB / 2));
        diag_log (_thismkr);
        _thismkr = createVehicle ["Sign_sphere100cm_EP1", _posmkrB, [], 0, "CAN_COLLIDE"];
        _thismkr setPos _posmkrB;
        diag_log (_thismkr);
        };
        diag_log ("Marker Task Finished")
    };
    

     

    Shows the diag logs, everything is fine. Even the "Marker Task Finished"

    Still, no spheres will show up around any safe zone. Zero spheres. None.

     

    I don't know what else I can do but set each position to create it's own vehicle and spam thousands of lines of near identical code.

     

    -edit 2-

    After finding the spheres around the hero trader I realized what the problem was and....

    SOLVED!!!!!!!!

    SchwEde, thank you for your time and effort. I found the error and am very ashamed of it. There was a reason I didn't find the locations...

    [
            [[11463.747,317.3078,11349.89],150],        //klen
            [[4053.8501,364.76645,11668.645],150],        //bash
            [[6325.6772,304.99033,7807.7412],150],        //stary
            [[1606.6443,289.70795,7803.5156],150],        //bandit
            [[12944.227,12766.889,12766.889],150],        //hero
            [[12060.471,158.85699,12638.533],100]        //aircraft
    ];
    

     

    I was using select 1 for the Y pos. If you look at those, they are ordered x,z,y, except hero which is x,y,y...

     

    so much shame.

  7. Sorry for bumping, but after four edits to my last post I felt that I needed to create a new one.

     

    After running this script:

    // SETTINGS:
    _zonegz =
    [
            [[11463.747,317.3078,11349.89],150],        //klen
            [[4053.8501,364.76645,11668.645],150],        //bash
            [[6325.6772,304.99033,7807.7412],150],        //stary
            [[1606.6443,289.70795,7803.5156],150],        //bandit
            [[12944.227,12766.889,12766.889],150],        //hero
            [[12060.471,158.85699,12638.533],100]        //aircraft
    ];
    if (isServer) then {
    {
    _ctrgz01 = _x select 0;
    _rdigz01 = _x select 1;    
    //_cntgz01 = _rdigz01;
    _cntgz01 = round((2 * 3.14592653589793 * _rdigz01) / 2);
    _angz01 = 0;
    for "_i" from 0 to _cntgz01 do {
        _pos01 = [(_ctrgz01 select 0) + (sin(_angz01)*_rdigz01), (_ctrgz01 select 1) + (cos(_angz01)*_rdigz01), 0.5];
        diag_log ( "get Pos A left to right of _pos01" );
        diag_log ( _agz01 );
        diag_log ( "get Pos B bottom to top of _pos01" );
        diag_log ( _bgz01 );
        diag_log ( "getPos A [A,B,0.5]" );
        diag_log (_pos01);
        _objtGZ01 = createVehicle ["Sign_sphere100cm_EP1", _pos01, [], 0, "CAN_COLLIDE"];
        _objtGZ01 setPos _pos01;
        _angz01 = _angz01 + (360/_cntgz01);
        diag_log ( "get Pos B which should match A" );
        diag_log (getPos _objtGZ01);
        diag_log ( "get _objt Class" );
        diag_log ( _objtGZ01 );
        diag_log ( "get angle, should change" );
        diag_log (_angz01);
        };
    } forEach _zonegz;
        _thisGZ01 = createVehicle ["Sign_sphere100cm_EP1", [11345.555, 11428.116, 1], [], 0, "CAN_COLLIDE"];
        _thisGZ01 setPos [11345.555, 11428.116, 1];
        diag_log ( "get Pos of Test Item" );  
        diag_log (getPos _thisGZ01 );
    };
    

     

    Of course, this didn't work for me (This script should run PERFECTLY, just remove diag_log lines to shave off the size.)

    So I thought maybe it's something to do with "for (_i) to (_blah) do" or maybe _objtGZ01 is being re used for the variable, so that the last position created by "forEach" is where all the red spheres should be.

     

    So I ran the following...

     

    _mkrsp =
    [
    //long list of coords formatted as [_x,_y]
    ];
    if (isServer) then
    {
        {
        _mkrspA = _x select 0;
        _mkrspB = _x select 1;
        _thismkr = (_mkrspA + _mkrspB);
        diag_log (_thismkr);
        _thismkr = createVehicle ["Sign_sphere100cm_EP1", [_mkrspA, _mkrspB, 0], [], 0, "CAN_COLLIDE"];
        _thismkr setPos [_mkrspA, _mkrspB, 0.25];
        diag_log (getPos _thismkr);
        } forEach _mkrsp;
    };
    

     

    I was able to rule out:

    1) Something interfering with the script - I was able to get the "Test Item" from the first script to spawn after the "forEach" completed. No errors in RPT.

    2) Items spawning in the same spot (Issue with _thisGZ01 being re-used) - Checked all areas of the safe zones, not a single red sphere.
     

    The only problem I can guess is there's something I'm doing wrong with forEach?

  8. At one point I was running...

    // SETTINGS:
    _zonegz =
    [
            [[11463.747,317.3078,11349.89],150],        //klen
            [[4053.8501,364.76645,11668.645],150],        //bash
            [[6325.6772,304.99033,7807.7412],150],        //stary
            [[1606.6443,289.70795,7803.5156],150],        //bandit
            [[12944.227,12766.889,12766.889],150],        //hero
            [[12060.471,158.85699,12638.533],100]        //aircraft
    ];
    if (isServer) then {
    {
    _ctrgz01 = _x select 0;
    _rdigz01 = _x select 1;    
    //_cntgz01 = _rdigz01;
    _cntgz01 = round((2 * 3.14592653589793 * _rdigz01) / 2);
    _angz01 = 0;
    for "_i" from 0 to _cntgz01 do {
        _pos01 = [(_ctrgz01 select 0) + (sin(_angz01)*_rdigz01), (_ctrgz01 select 1) + (cos(_angz01)*_rdigz01), 0.5];
        diag_log ( "get Pos A left to right of _pos01" );
        diag_log ( _agz01 );
        diag_log ( "get Pos B bottom to top of _pos01" );
        diag_log ( _bgz01 );
        diag_log ( "getPos A [A,B,0.5]" );
        diag_log (_pos01);
        _objtGZ01 = createVehicle ["Sign_sphere100cm_EP1", _pos01, [], 0, "CAN_COLLIDE"];
        _objtGZ01 setPos _pos01;
        _angz01 = _angz01 + (360/_cntgz01);
        diag_log ( "get Pos B which should match A" );
        diag_log (getPos _objtGZ01);
        diag_log ( "get _objt Class" );
        diag_log ( _objtGZ01 );
        diag_log ( "get angle, should change" );
        diag_log (_angz01);
        };
    } forEach _zonegz;
        _thisGZ01 = createVehicle ["Sign_sphere100cm_EP1", [11345.555, 11428.116, 1], [], 0, "CAN_COLLIDE"];
        _thisGZ01 setPos [11345.555, 11428.116, 1];
        diag_log ( "get Pos of Test Item" );  
        diag_log (getPos _thisGZ01 );
    };
    

     

    All diag_logs were posting to .RPT

     

    currently trying....

     

    mkrsp =
    [
    //the long list of positions reported by the previous scripts >> diag_log (getPos _objtGZ01); in format of [" _pos A"," _pos B"]...
    ];
    if (isServer) then {
    _mkrspA = _x select 0;
    _this = createVehicle ["Sign_sphere100cm_EP1", [_mkrspA select 0, _mkrspA select 1, 0.25], [], 0, "CAN_COLLIDE"];
    diag_log (_mkrspA);
    } forEach _mkrsp;
    

     

    -edit- noticed the horrible errors in the second script and hopefully fixed them.

     

    -edit 2-

    Noticed I had an extra }; at the end of the second script and snipped it off

    -edit 3-

    that last bit of code is all junk working on getting something else to work. I feel like it's an issue with the whole for "_i" from 0... part.

    -edit 4-

    changed the code to...

    _mkrsp =
    [
    //[123,456],[234,567].....
    ];
    if (isServer) then
    {
        {
        _mkrspA = _x select 0;
        _mkrspB = _x select 1;
        _thismkr = createVehicle ["Sign_sphere100cm_EP1", [_mkrspA, _mkrspB, 0.25], [], 0, "CAN_COLLIDE"];
        _thismkr setPos [_mkrspA, _mkrspB, 0.25];
        diag_log (getPos _thismkr);
        } forEach _mkrsp;
    };
    

     

    And a little bit of my RPT log shows....

     4:27:29 [11368.1,201.731,0.25]
     4:27:29 [11375.6,195.955,0.25]
     4:27:29 [11383.4,190.658,0.25]
     4:27:29 [11391.5,185.862,0.25]
     4:27:29 [11399.9,181.584,0.25]
     4:27:29 [11408.5,177.841,0.25]
     4:27:29 [11417.4,174.649,0.25]
     4:27:29 [11426.4,172.02,0.25]
     4:27:29 [11435.6,169.965,0.25]
     4:27:29 [11444.9,168.491,0.25]
     4:27:29 [11454.3,167.604,0.25]
     4:27:29 [11463.7,167.308,0.25]
     4:27:29 [11473.2,167.604,0.25]
     4:27:29 [11482.5,168.491,0.25]
     4:27:29 [11491.9,169.965,0.25]

     

    The only thing I can think of is for some reason using the forEach causes them not to spawn?

  9. So, I have done practically everything I can think of to get this script to work, it's modified off of the infistar safe zones. I use CAGN (mostly for the tag friendly back pack stuff). So I tried using the following script...

     

    // SETTINGS:
    _zonegz =
    [
            [[11463.747,317.3078,11349.89],150],        //klen
            [[4053.8501,364.76645,11668.645],150],        //bash
            [[6325.6772,304.99033,7807.7412],150],        //stary
            [[1606.6443,289.70795,7803.5156],150],        //bandit
            [[12944.227,12766.889,12766.889],150],        //hero
            [[12060.471,158.85699,12638.533],100]        //aircraft
    ];
    {
    _ctrgz01 = _x select 0;
    _rdigz01 = _x select 1;    
    _cntgz01 = round((2 * 3.14592653589793 * _rdigz01) / 2);
    _angz01 = 0;
    for "_i" from 0 to _cntgz01 do {
        _ag = (_ctrgz01 select 0) + (sin(_angz01)*_rdigz01);
        _bg = (_ctrgz01 select 1) + (cos(_angz01)*_rdigz01);
        _pos01 = [_ag, _bg, 1];
        _dirp01 = ((_ctrgz01 select 0) - (_ag)) atan2 ((_ctrgz01 select 1) - (_bg));
        _objt = createVehicle ["Sign_sphere100cm_EP1", _pos01, [], 0, "CAN_COLLIDE"];
        _objt setDir _dirp01;
        _angz01 = _angz01 + (360/_cntgz01);
        diag_log ( "getPos" );
        diag_log (getPos _objt);
        };
    } forEach _zonegz;
    

    And have it activated in the server_functions with the typical

    execVM "\z\addons\dayz_server\path\file.sqf"

     

    with diag_log, it shows the positions of everything in the RPT log. I even tossed in >> diag_log (_objt) and it shows the vehicle. But when I log into the server....I can't see any of the spheres around safe zones.

    No errors in server RPT, when I had it running client side, no errors in client RPT.

     

    Still, no luck with it actually spawning any of the "Sign_sphere100cm_EP1" vehicles.

     

    -edit-

    in the RPT it shows the third position at about -130 (When I check it against other structures I see a third position of 0.3 - .0.8)

     

    -edit 2-

    Ok so I modified the script to the following

    // SETTINGS:
    _zonegz =
    [
            [[11463.747,317.3078,11349.89],150],        //klen
            [[4053.8501,364.76645,11668.645],150],        //bash
            [[6325.6772,304.99033,7807.7412],150],        //stary
            [[1606.6443,289.70795,7803.5156],150],        //bandit
            [[12944.227,12766.889,12766.889],150],        //hero
            [[12060.471,158.85699,12638.533],100]        //aircraft
    ];
    if (isServer) then {
    {
    _ctrgz01 = _x select 0;
    _rdigz01 = _x select 1;    
    _cntgz01 = 90;
    //_cntgz01 = round((2 * 3.14592653589793 * _rdigz01) / 2);
    _angz01 = 0;
    for "_i" from 0 to _cntgz01 do {
        _agz01 = (_ctrgz01 select 0) + (sin(_angz01)*_rdigz01);
        _bgz01 = (_ctrgz01 select 1) + (cos(_angz01)*_rdigz01);
        _pos01 = [_agz01, _bgz01, 0.5];
        diag_log ( "getPos A" );
        diag_log (_pos01);
        _dirp01 = ((_ctrgz01 select 0) - (_agz01)) atan2 ((_ctrgz01 select 1) - (_bgz01));
        _objt = createVehicle ["Sign_sphere100cm_EP1", _pos01, [], 0, "CAN_COLLIDE"];
        _objt setPos _pos01;
        _objt setDir _dirp01;
        _angz01 = _angz01 + (360/_cntgz01);
        diag_log ( "getPos B" );
        diag_log (getPos _objt);
        };
    } forEach _zonegz;
      _thisGZ01 = createVehicle ["Sign_sphere100cm_EP1", [11345.555, 11428.116, 1], [], 0, "CAN_COLLIDE"];
      _thisGZ01 setPos [11345.555, 11428.116, 1];
    };
    

     

    All I get is _thisGZ01 to spawn, all the _objt wont.

×
×
  • Create New...