Jump to content

FelixK44

Member
  • Content Count

    125
  • Joined

  • Last visited

  • Medals

Posts posted by FelixK44


  1. Try to change your trigger statements with this one:

    JailZone1 setTriggerStatements ["this", "{if((_x distance JailZoneArea < 10) && (animationstate _x == ""civillying01"")) then {[_x] execVM ""ArrestReward.sqf"";} else {};} foreach thisList;", ""];
    

    And forget your ArrestCheck.sqf :D

    Dude thanks! I have another problem though! I need to create another trigger so that players can't keep collecting rewards for arrested civilians. I tried doing it on my own but it doesn't work. :(

    
    sleep 5;
    JailZone2=createTrigger ["EmptyDetector",getmarkerPos "JailZone"];
    JailZone2 setPos (getMarkerPos "JailZone");
    JailZone2 setTriggerArea [50,50,0,false];
    JailZone2 setTriggerActivation ["CIV","PRESENT",true];
    JailZone2 setTriggerStatements ["this", "{if((_x distance JailZoneArea < 10) && (animationstate _x == ""civillying01"")) [b]then {deleteVehicle [_x]} else {};} foreach thisList;", ""];[/b]  <======
    
    


  2. Well yeah I understood that part, but the code you posted in Post #5 is irritating me, like is this the code you actually wrote in your activation field of the trigger or is it the content of your ArrestCheck.sqf?

    Using that code in a seperate sqf-file won't work because thisList doesn't exist in that scope.

    Try to put the foreach-loop into the activation field of your trigger, it should work the way you want it.

    Well, the trigger doesn't actually exist when the mission starts. I placed an object in the editor and place this addaction ["Turn in Criminals", "JailZone.sqf"]; in the objects init. When a player uses the action the script gets executed inside JailZone is the arrestcheck script. Both scripts are working the problem is with arrestcheck now.

    JailZone.sqf

    
    sleep 1;
    JailZone1=createTrigger ["EmptyDetector",getmarkerPos "JailZone"];
    JailZone1 setPos (getMarkerPos "JailZone");
    JailZone1 setTriggerArea [50,50,0,false];
    JailZone1 setTriggerActivation ["CIV","PRESENT",true];
    JailZone1 setTriggerStatements ["this", "{[_x] execVM ""ArrestCheck.sqf""} forEach thisList", ""];
    
    sleep 1;
    
    Hint "Jail Zone Refreshed";
    
    

    ArrestCheck.sqf

    
    sleep 1;
    
    _x = _this select 0;
    
    [b]{if((_x distance JailZoneArea < 10) && (animationstate _x == "civillying01")) then	{[_x] execVM "ArrestReward.sqf"}  else {};} foreach thislist;[/b] <---- Isn't detecting animation for some reason?
    
    


  3. I'd say you have to get rid of the double quotes around Reward.sqf as they are only used in strings to escape the quotes :D

    Normally you'd get a corresponding error message either in your .rpt-file or ingame using the -showScriptErrors parameter.

    It really helps you figure out what's wrong in your code so you should consider starting your game with the parameter while in development.

    Oh cool thanks for the suggestion about -ShowScriptErrors! In the else { } part of arrestcheck script how do I display a hint? else {Hint "Test"} doesn't work.

    
    sleep 1;
    Hint "Checking Animations 1";
    _x = _this select 0;
    Hint "Checking Animations 2";
    {if((_x distance JailZoneArea < 10) && (animationstate _x == "civillying01")) then	{[_x] execVM "ArrestReward.sqf"}  [b]else {}[/b];} foreach thislist;
    Hint "Checking Animations 3";
    
    
    
    


  4. Please keep in mind that exec is for sqs-files whereas execVM is used to execute sqf-files.

    But somehow I'm confused, what do you want again? :D

    You already posted a solution to your question, so is this script somehow throwing errors? If it does, what does it say?

    New script code, the script stops on "Checking Animations 2"

    
    Hint "Checking Animations 1";
    _x = _this select 0;
    Hint "Checking Animations 2";
    [b]if (animationState _x == "CivilLying01") then { [_x] execVM ""Reward.sqf"" };[/b] <--------- Script not processing this line of code
    Hint "Checking Animations 3";
    
    


  5. Hi, can someone help me? I'm not sure if this is correct it doesn't work so I must of messed up somewhere. I have a trigger placed near the "Jail" and it the init is [] exec "JailZone.sqf" the JailZone script displays the hint but the ArrestCheck script fails somewhere and doesn't show the hint. :confused:

    EDIT: If it's possible I would rather have the trigger created through script to instead check if the unit is "captive" and then run a script for all units in the trigger.

    "JailZone"

    sleep 15;
    JailZone1=createTrigger ["EmptyDetector",getPos _object];
    JailZone1 setPos (getMarkerPos "JailZone") 
    JailZone1 setTriggerArea [50,50,0,false];
    JailZone1 setTriggerActivation ["CIV","PRESENT",true];
    JailZone1 setTriggerStatements ["this", "{[_x] exec ""ArrestCheck.sqf""} forEach thisList", "'"];
    
    sleep 1;
    
    Hint "Jail Zone Refreshed";
    

    "ArrestCheck"

    sleep 15;
    _x = _this select 0;
    if (animationState _x == "CivilLying01") then { [_x] exec ""Reward.sqf"" };
    Hint "Checking Animations";
    


  6. I figured out what was causing the glitch. It seems if the unit who initiates the dragging/carrying is holding a pistol their frozen from moving.

    FIXED! Simple if anyone is interested go here: http://www.armaholic.com/page.php?id=2135 place the script inside PO2 folder add the fix to the top of "mps_func_clienteventhandlers.sqf" now all you have to do is "Holster" your weapon if all you have is a pistol to prevent the frozen movement bug while dragging.

    cheetah_holster_act = [] execVM "holster\gunControl.sqf";
    


  7. I'm having problems with the ACE wounds version of PO2 in Chernarus. No one on my server can heal other players, and if they attempt to drag or carry an injured unit their "frozen" unable to move. I'm not really sure how to fix this but it's very annoying has anyone had a similar issue and know how to solve it?

    EDIT: Thought I would add that loading PO2 in the editor for SP testing also disables dragging/carrying and healing for AI units. ACE Wounds works on all other missions that I try in editor/mp.


  8. I'm trying to spawn "car1" on the nearestRoad 300m from "player", I've tried (getpos NearestRoads player) and it doesn't work. :confused:

    car1 = createVehicle ["Lada1", [(getpos player) select 0,(getpos player) select 1,0], [], 575, "FORM"];
    

    ---------- Post added at 07:36 PM ---------- Previous post was at 07:14 PM ----------

    Well, once again I asked for help too soon.

    If anyone else is interested........

    CREATE MARKER IN EDITOR NAME IT roadMarker

    
    _templist = player nearRoads 50;
    if (count _templist == 0) exitwith {Hint "Spawn Failed"};
    _trk = _templist select 0;
    
    "roadMarker" setMarkerPos (getpos _trk);
    
    //Car1 can be anything, "VehicleClassName" should be name of vehicle Lada1 etc. "375" is the spawn distance from marker.
    
    Car1= createVehicle ["VehicleClassName", [(getMarkerPos "roadMarker") select 0,(getMarkerPos "roadMarker") select 1,0], [], 375, "FORM"];
    
    


  9. Anyone who's played the SWAT series will understand what I'm trying to accomplish. I'm currently creating something and the one problem I can't figure out is how to create a script that can be activated with "addaction" and plays a ArmA2:CO sound while also increasing the chances of ARMED enemies surrendering in a certain radius around the shouting player. Does anyone know if its possible to do this?


  10. Hi, I'm having trouble trying to get this to work. My init.sqf only has one line of code exec "init-shop.sqf" for some reason nothing happens when I execute guntest.sqf

    init-shop.sqf

    _unit123 setVariable ["cash", 1];
    

    guntest.sqf

    
    //this addAction[("<t color=""#660066"">" + ("Buy AK47") +"</t>"),"shop\guntest.sqf"]; <--- placed in object init
    if (cash < 250) then
    {
       Hint "You do not have enough money";
    } 
    else 
    {
        _curcash = _unit123 getVariable "cash";
       _unit123 setVariable ["cash",_curcash - 250];
       gunlocker addWeaponCargo ["AK_47_M", 1];
       gunlocker addMagazineCargo ["30Rnd_762x39_AK47", 5];
       Hint "Check your gunlocker";
    };
    
    


  11. The markers are not updated.

    The best practice way seems to be to register a joining player to the server via eventhandler

    and then have the server issue the redrawing of the map on all clients. Brute method to ensure that all players

    share the same map marker references.

    But for some reason it does not work.

    if (!isServer && isNull player) then  
    {      //JIP player
    waitUntil {!isNull player};
    
    // update map globally to synchronize
    // map and display markers for JIPs
    UNDEAD2_SERVERREDOMAP = [];
    publicvariable "UNDEAD2_SERVERREDOMAP"; 
    };
    

    Does this work? :confused:

    if (!isServer && isNull player) then 
    {
     waitUntil {!isNull player};
     CHN_markerArray= [	
           "mil_objective",
    "mil_marker",
    "mil_flag",
    "mil_ambush",
    "mil_destroy",
    "mil_start",
    "mil_end",
    "mil_pickup",
    "mil_join",
    "mil_warning",
    "mil_unknown"
    ];
     onPlayerConnected '{_x setMarkerPos (markerPos _x)} forEach CHN_markerArray';
    };


  12. Undead Mod 2 development got stuck in fixing a few issues in MP mainly related to

    Join in Progress map updates of infected locations' status not showing correctly for JIPs. Join in progress has a very peculiar implementation by BIS

    and requires special treatment. There is not much more that can be tried to fix this, because dozens of

    different approaches to handle JIP were tested.

    If there is someone out there who is an extreme ace in JIP-coding, drop me a line.

    Due to the advent of Arma3, it seems reasonable to release the undead mod2 for Arma2 before Arma3 comes out

    or it was all for nothing and besides the JIP issue it is working great ;)

    Concerning the portability to Arma3, i see no serious problems yet to do so, because i successfully managed to port TroopMon3 to Arma3

    also without too much re-coding.

    What exactly are you having a problem with? Are the zombie locations defined as markers and not being updated for JIP clients? Or is it like a task and the progress isn't updating?


  13. Ok, so the modified MSO_fnc_CQBclientloop.sqf as per my earlier posts is:

    private ["_debug","_idx","_loopcounter","_localEnemyCount","_pU"];

    _debug = _this select 0;

    if (persistentDBHeader == 1) then {

    waitUntil{!isNil "MISSIONDATA_LOADED"};

    if (pdb_locations_enabled) then {

    waituntil {!(isnil "PDB_CQB_positionsloaded")};

    sleep 5;

    };

    };

    waituntil {!(isnil "CQBpositionsReg") && !(isnil "CQBpositionsStrat")};

    CQBpositionsRegLocal = CQBpositionsReg;

    CQBpositionsStratLocal = CQBpositionsStrat;

    CQBpositionsLocal = CQBpositionsRegLocal + CQBpositionsStratLocal;

    {(_x select 0) setVariable ["reg", true, false]} foreach CQBpositionsRegLocal;

    {(_x select 0) setVariable ["strat", true, false]} foreach CQBpositionsStratLocal;

    CQBgroupsLocal = [];

    if (_debug) then {

    diag_log format["MSO-%1 CQB Population: Total positions found %2", time, count CQBpositionsLocal];

    _i = 0;

    for "_i" from 0 to ((count CQBpositionsRegLocal) - 1) do {

    _t = format["rp%1",_i];

    _m = [_t, position ((CQBpositionsRegLocal select _i) select 0), "Icon", [1,1], "TYPE:", "Dot", "COLOR:", "ColorYellow"] call CBA_fnc_createMarker;

    };

    _i = 0;

    for "_i" from 0 to ((count CQBpositionsStratLocal) - 1) do {

    _t = format["sp%1",_i];

    _m = [_t, position ((CQBpositionsStratLocal select _i) select 0), "Icon", [1,1], "TYPE:", "Dot", "COLOR:", "ColorGreen"] call CBA_fnc_createMarker;

    };

    };

    waituntil {

    sleep 2;

    _activecount = 0;

    _suspendedcount = 0;

    _clearcount = 0;

    {

    _strategic = (_x select 0) getVariable "strat";

    _regular = (_x select 0) getVariable "reg";

    _clear = (_x select 0) getVariable "c";

    _suspend = (_x select 0) getVariable "s";

    _pos = position (_x select 0);

    _activenow = 0;

    if (CQB_AUTO) then {

    _pU = {_pos distance _x < 20000} count ([] call BIS_fnc_listPlayers);

    if (_pU < 1) then {_pU = 1};

    _CQBlocCnt = 0;

    _CQBglobCnt = 0;

    {

    _CQBgr = nil; _CQBgr = (leader _x) getvariable "PM";

    if !(isnil "_cqbgr") then {

    _CQBglobCnt = _CQBglobCnt + 1;

    if (local leader _x) then {_CQBlocCnt = _CQBlocCnt + 1};

    };

    } foreach allgroups;

    _CQBavgGr = _CQBglobCnt / _pU;

    if ((_CQBlocCnt <= _CQBavgGr) && (_CQBglobCnt <= CQBmaxgrps)) then {

    CQBaicap = (count allunits / _pU);

    } else {

    CQBaicap = 0;

    };

    };

    if ((isnil "_suspend") && (isnil "_clear")) then {_activecount = _activecount + 1};

    if (!(isnil "_suspend")) then {_suspendedcount = _suspendedcount + 1};

    if (!(isnil "_clear")) then {_clearcount = _clearcount + 1};

    if ((({(local _x) && ((faction _x) in MSO_FACTIONS)} count allunits) < CQBaicap) && ({side _x == WEST} count nearestobjects [(_x select 0),["Man","Car","Tank"],1500]) >0) then {

    if (((_activenow <= 8) && _regular) && ({side _x == WEST} count nearestobjects [(_x select 0),["Man","Car","Tank"],1000]) >0) then {

    if ((isnil "_suspend") && (isnil "_clear")) then {

    _activenow = _activenow + 1;

    [(_pos),(_x select 0),1100] call MSO_fnc_CQBspawnRandomgroup;

    };

    };

    if (((_activenow <= 8) && _strategic) && ({side _x == WEST} count nearestobjects [(_x select 0),["Man","Car","Tank"],1500]) >0) then {

    if ((isnil "_suspend") && (isnil "_clear")) then {

    _activenow = _activenow + 1;

    [(_pos),(_x select 0),1600] call MSO_fnc_CQBspawnRandomgroup;

    };

    };

    };

    } foreach CQBpositionsLocal;

    {

    if (count (units _x) == 0) then {

    if (_debug) then {diag_log format["MSO-%1 CQB Population: Garbage collecter deleting Group %2...", time, _x]};

    CQBgroupsLocal = CQBgroupsLocal - [_x];

    deletegroup _x;

    };

    } foreach CQBgroupsLocal;

    if (_debug) then {

    diag_log format["MSO-%1 CQB Population: %2 total | %3 suspended |%4 cleared positions...", time, _activecount, _suspendedcount, _clearcount];

    diag_log format["MSO-%1 CQB Population: Count %2 local AI in %4 CQB-groups (%3 total AI overall)...", time, {local _x} count allUnits, count allUnits, count CQBgroupsLocal];

    };

    false;

    };

    If you want it to spawn CQB serverside on dedi server then

    in ..\enemy\modules\cqb_pop\main.sqf change last line to

    if (isDedicated) then {[_debug] spawn MSO_fnc_CQBclientloop;

    Happy to remove these posts if the MSO guys object

    So does this mean that the original CQB module thing in MSO doesn't work on a dedicated server? :confused:


  14. Well if they need to be markers, how will I be able to for example put ACE CDF Weapon Box, Launcher box, medical box if the marker ammo is ACE Radio box?

    https://dev-heaven.net/projects/mso/documents

    sorry, my previous post was a bit unhelpful.

    [this, 60] execVM "support\scripts\resupply.sqf"; <---put in crate, etc. init

    [this, 43200, 9999999] execVM "support\scripts\vehicle.sqf"; <---put in vehicle init 43200(respawn time), 99999999 (time to respawn after people get out)


  15. YO COMRADES!

    A late XMAS / early new years present!

    UPDATED RELEASE-POST!

    !! IMPROVEMENT UPDATE 4.55 !!

    - VARIOUS BUGFIXES AND PERFORMANCE IMPROVEMENTS

    - REDUCES RED CHAIN/DESYNC

    - PERF IMPROVEMENTS ON LONG TERM SESSIONS

    - MINIMIZES SCRIPT LAG

    - BETTER ENEMY CREATION & DISPERSION

    - COMPATIBILITY WITH GBL AIM (Adv. Interaction Module)

    - MANUAL PERSIST (PDB)

    - GPS GUIDED LOGISTICS-DROP

    ... and much more.

    - Also fixes the static side "east" in CQB, and furthermore made some changes to have it work with playing as side east (set independent friendly to BLUFOR)!

    - There is a new param, that allows you to choose active enemy locations which will give you more and better dispersed enemy locations, esp. on big maps!

    - No changes in PDB setup

    ENJOY!

    PS: REALLY recommended you use the update as it has many improvements

    Very nice, will test it out later! :yay:

×