Jump to content
iben

[RELEASE] IWAC - Autoclaim addon for WAI [v1.3.1]

Recommended Posts

I'm using my own function for mission claim in static missions.
This function is for Mission claiming (show marker and announce), and warn other players who are breaking into the mission. It doesn't check a double claiming.

Spoiler

AIcity_claimMark = { //[markername,[position],text,distance] spawn AIcity_claimMark;
    private ["_title","_pos","_text","_dist","_claimed","_claimids","_mark","_in"];
    _title = _this select 0;
    _pos = _this select 1;
    _text = _this select 2;
    _dist = _this select 3;
    _claimed = false;
    _claimids = [];
    while {true} do {
        //set who claim 
        if (!_claimed) then {
            //range circle
            _mark = createMarker [_title+"_range",_pos];
            _mark setMarkerShape "ELLIPSE";
            _mark setMarkerBrush "Border";
            _mark setMarkerColor "ColorRed";
            _mark setMarkerSize [_dist,_dist];
            //check someone now in range
            sleep 10;
            _in = false;
            {
                //warn claiming
                if((alive _x) && (_x distance _pos <= _dist )) then {
                    _in = true;
                    RemoteMessage = ["IWAC", [getPlayerUID _x,"You are in claiming zone."]];
                    publicVariable "RemoteMessage";
                    diag_log format["[AI city]: %1 in %2 zone",name _x,_text];
                };
            } forEach playableUnits;
            if (_in) exitWith {
                sleep 30;
                {
                    if((alive _x) && (_x distance _pos <= _dist )) exitWith {
                        _claimed = true;
                        {
                            _claimids set [count _claimids,getPlayerUID _x];
                            RemoteMessage = ["IWAC", [getPlayerUID _x,"Your team have claimed the mission."]];
                            publicVariable "RemoteMessage";
                        } forEach (units group _x);
                        if (wai_radio_announce) then {
                            RemoteMessage = ["radio","[RADIO] Someone has claimed an AI city."];
                            publicVariable "RemoteMessage";
                        };
                        diag_log format["[AI city]: %1 has claimed %2",name _x,_text];
                    };
                } forEach playableUnits;
            };
        };
        //check players. in the claiming group or not, or claimed one not in group.
        if (_claimed) then {
            //claim marker
            _mark = createMarker [_title+"_claim",[(_pos select 0) + _dist/2,(_pos select 1) + _dist/2]];
            _mark setMarkerShape "ICON";
            _mark setMarkerText (_text + " Claimed");
            _mark setMarkerType "hd_flag";
            _mark setMarkerColor "ColorBlue";
            _mark setMarkerSize [1, 1];
            
            //player in range in the claiming group or not
            {
                if(!((getPlayerUID _x) in _claimids) && (_x distance _pos <= _dist )) then {
                    //warn
                    RemoteMessage = ["IWAC", [getPlayerUID _x,"You are in an already claimed mission. Ask for permission!"]];
                    publicVariable "RemoteMessage";
                    diag_log format["[AI city]: %1, not in claiming list, is in %2",name _x,_text];
                    sleep 5;
                };
            } forEach playableUnits;
            //player in claiming group in range or not
            _count = {(alive _x) && (_x distance _pos <= _dist ) && ((getPlayerUID _x) in _claimids)} count playableUnits;
            if (_count < 1) then {
                diag_log format["[AI city]: None in %1 now",_text];
                //warn
                {
                    if((alive _x) && ((getPlayerUID _x) in _claimids)) then {
                        RemoteMessage = ["IWAC", [getPlayerUID _x,"You are out of the mission"]];
                        publicVariable "RemoteMessage";
                    };
                } forEach playableUnits;
                //wait
                sleep 100;
                //check
                _count = {(alive _x) && (_x distance _pos <= _dist ) && ((getPlayerUID _x) in _claimids)} count playableUnits;
                if (_count < 1) then {
                    if (wai_radio_announce) then {
                        RemoteMessage = ["radio","[RADIO] The AI city is in peace."];
                        publicVariable "RemoteMessage";
                    };
                    //delete
                    _claimed = false;
                    _claimids = [];
                    diag_log format["[AI city]: %1 has been unclaimed",_text];
                };
            };
            sleep 5;
        };
        deleteMarker _mark;
    };
};

put the code above in the bottom of server_functions.sqf or somewhere, and call it in each mission sqf like:
["sectorC",[2197.9333, 11942.657, 77.671524],"Bandit Sector C",1500] spawn AIcity_claimMark;
https://imgur.com/0KLdgZJ

I haven't tested, but maybe you can use it in mission systems like DZMS or WAI with terminate command like:

Spoiler

//Claim system start
_handle = ["DZMSMajClaim",_coords,_missName,1500] spawn AIcity_claimMark;

//Wait until the player is within 30 meters and also meets the kill req
[_coords,"DZMSUnitsMajor"] call DZMSWaitMissionComp;

//~~~ mission end ~~//

//Finish Claim system
terminate _handle;

//Let the timer know the mission is over
DZMSMajDone = true;

if this one is not working, you'll still be able to use this function by replacing "while {true}" with "while {!DZMSMajDone}" or such.

Share this post


Link to post
Share on other sites
49 minutes ago, Petite said:

Is there a way for other players to get a message mission was claimed by X? 

I put 
              if (wai_radio_announce) then {
                RemoteMessage = ["radio",format["[RADIO] %1 has claimed a mission.",(name _ccl)]];
                publicVariable "RemoteMessage";
              };

under 
              RMSG(CML(_cls,1),FSTR2(STRLO("STR_IWAC_CLAIMED"),ACSTR,CMNAME(_mission)));
around line 222 of mission_winorfail.sqf

 

btw, I also wrote
    [nil,_crate,rSAY,"alarm",2000] call RE;
below the same line to call alarm when one claims the mission

Share this post


Link to post
Share on other sites
On 12/12/2017 at 10:22 PM, Schalldampfer said:

I put 
              if (wai_radio_announce) then {
                RemoteMessage = ["radio",format["[RADIO] %1 has claimed a mission.",(name _ccl)]];
                publicVariable "RemoteMessage";
              };

under 
              RMSG(CML(_cls,1),FSTR2(STRLO("STR_IWAC_CLAIMED"),ACSTR,CMNAME(_mission)));
around line 222 of mission_winorfail.sqf

 

btw, I also wrote
    [nil,_crate,rSAY,"alarm",2000] call RE;
below the same line to call alarm when one claims the mission

Awesome I will try thanks.

 

 

 

Share this post


Link to post
Share on other sites

getting this error. i don´t change something in mission_init.sqf

 

while {_running} do {

if (ai_show_remaining) then {
_airemain = (w>
  Error position: <ai_show_remaining) then {
_airemain = (w>
  Error Undefined variable in expression: ai_show_remaining
File z\addons\dayz_server\WAI\addons\IWAC\mission_init.sqf, line 77
Error in expression <ing = true;

while {_running} do {

if (ai_show_remaining) then {
_airemain = (w>
  Error position: <ai_show_remaining) then {
_airemain = (w>
  Error Undefined variable in expression: ai_show_remaining
File z\addons\dayz_server\WAI\addons\IWAC\mission_init.sqf, line 77
Error in expression <ing = true;

while {_running} do {

if (ai_show_remaining) then {
_airemain = (w>
  Error position: <ai_show_remaining) then {
_airemain = (w>
  Error Undefined variable in expression: ai_show_remaining
File z\addons\dayz_server\WAI\addons\IWAC\mission_init.sqf, line 77
Error in expression <ing = true;

while {_running} do {

Share this post


Link to post
Share on other sites

@Kimarik

This is where IWAC checks for the variable:
https://github.com/damnrelentless/IWAC/blob/d41ae31c610f38383463aee31c845eccf7d3b8a5/%40DayZ_Epoch_Server/addons/dayz_server/WAI/addons/IWAC/mission_init.sqf#L77-L80

It's normally set in the WAI config. Make sure it's in there:
https://github.com/worldwidesorrow/Wicked-Ai-Overpoch/blob/9ae40cfeb2d240423d0093155d1cfe83567d9561/WAI/config.sqf#L20

I guess this was added to WAI pretty late so your problem might just be that you don't have the latest version of WAI installed.

Share this post


Link to post
Share on other sites
2018/01/11, 18:14:09 "WAI: [Mission:[Hero] Hippy Commune]: Starting... [10306.5,8514.39,0]"
2018/01/11, 18:14:09 Error in expression <sion); 
_car = (_mar select 4);
_cia = (_car select 1);

_type = (_mar select 1)>
2018/01/11, 18:14:09   Error position: <_car select 1);

_type = (_mar select 1)>
2018/01/11, 18:14:09   Error Undefined variable in expression: _car
2018/01/11, 18:14:09 File z\addons\dayz_server\WAI\addons\IWAC\mission_init.sqf, line 85

Getting this error that is spamming-

Thoughts? or how to fix?\

 

 

Also, is there a way to add static missions having this to warn players when others are going to ai compounds

Share this post


Link to post
Share on other sites
1 hour ago, DieTanx said:
2018/01/11, 18:14:09 "WAI: [Mission:[Hero] Hippy Commune]: Starting... [10306.5,8514.39,0]"
2018/01/11, 18:14:09 Error in expression <sion); 
_car = (_mar select 4);
_cia = (_car select 1);

_type = (_mar select 1)>
2018/01/11, 18:14:09   Error position: <_car select 1);

_type = (_mar select 1)>
2018/01/11, 18:14:09   Error Undefined variable in expression: _car
2018/01/11, 18:14:09 File z\addons\dayz_server\WAI\addons\IWAC\mission_init.sqf, line 85

Getting this error that is spamming-

Thoughts? or how to fix?\

 

 

Also, is there a way to add static missions having this to warn players when others are going to ai compounds

This was due to my infistar spawning missions- not related to the script-

 

Thanks iben for the help

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Similar Content

    • By Hooty
      yRun DayZ StandAlone
      Absolutely No Racism, Homophobic Words, Or Any Other Types Of Hate Speech In In Game, Discord, Or Our Website! yRun Is A Community For Everyone! 
                
                            Website: https://yrungaming.enjin.com/
                          Discord: https://discord.gg/EaSgghZ
       
                          Server Ip Address: 51.222.245.208:2302
       
      Be Sure To Read Our Servers Rules Before Joining!!!
      You Agree To the Rules In the Link Below When Joining Our Servers!!!
      https://yrungaming.enjin.com/rules/m/36515233/viewthread/32549968-dayz-sa-rules
      We Share Bans With Over A Dozen Other Top Servers To Help Keep The Cheaters Out!!! 
       
       Servers Information
      Custom spawn selection spawn points "NWAF, SWAF, and NEAF included"
       
      Custom Loot Tables unlike anywhere else.  

      High Loot.

      Custom Zombie Loot.

      Weapons spawn with mags and ammo .

      Custom map edits "SWAF, NEAF, NWAF, Traders, and more"

      Custom reduce rate of food and thirst.
       
      Custom Weather No Fog or Rain.
       
      Short  Nights.
       
      Better sale of meat to increase hunting.

      Random starting loadouts.
       
      Traders with and without safe zones.

      Key Cards.

      Helis Cars and Trucks.

      Virtual Garage for ALL Vehicles.

      Custom Missions only found on yRun.

      Care Packages.

      King of the Hill.
       
      Global Chat.
       
      Kill Feed.
       
      Compass Hud.
       
      Interactive Player Map.
       
      Party System.
       
      Auto Run.
       
      More Inventory Slots.
       
      Modified Item Sizes.
       
      Ammo stacks up to 4x more.
       
      Unlimited Stamina.
       
      No Collision On Building.

      Custom Mining.

      Mystery Box
       
      Base Building Plus.
       
      Code Locks.
       
      Breaching Charges.

      Door Only Raid.

      Raid Only on Weekends.

      No Wetness.

      Weed.

      Modded Zeds and ArmA 2 Hookers.
       
      More Camos and Gear.
       
      Jogging  Zombies.
       
      No Bare Foot Bleeding.
       
      No Bleeding Hands From Ladders.
       
      No Shoe Damage.
       
      No Glove Damage.

      No Breaking Legs.

      Reduced Weapon Sway.

      Warmer Temps.

      Custom Scopes and Suppressors that fit MOST GUNS.
       
      Custom yRun Mods.
      "Dupe Fixes, Troll Fixes, Safe Zone Fixes, Custom Clothing, Custom Base Raiding,  Suppressors are quieter & more durable, Plus More Unique Features & More To Come"


      Server Mods List
      https://dayzsalauncher.com/#/servercheck/51.222.245.208:27016
       
      We are not pay2win! We are thankful for all donations as they are what keep yRun up and running. Sorry no donation perks can be handed out no exceptions!
       
    • By Harkness
      Please consider joining our custom Epoch | DayZ | Expansion | Namalsk or Takistan servers, we have 2 long term Admins on both UK/US continents and run our servers completely for charity and from 100% clean and renewable energy too!
      Click here to join our Discord for more information
      DayZSA Expansion Namalsk     |     DayZSA Expansion Takistan     |     A2 DayZ Epoch Namalsk
      86.10.6.13:2402            |     86.10.6.13:2602             |          86.10.6.13:2302
      Custom Content:

      - Armed Roaming / Dynamic AI Bandit Patrols
      - Custom Land and Air Trader Camps
      - Banking and Wallets
      - Customization Land Rovers
      - Advanced Weaponry
      - No Vehicle Crash Damage & Fix Vehicle Positions
      - More weapons packs, loot+, vehicles+, custom clothing & backpacks
      - Bounty Hunting
      - Unlimited Stamina
      - PvP & Raiding
      - Modular Vests
      - Igloo Crafting
      Thanks we hope to see you there!
      CPU: Xeon-X5690 @ 3.46GHz
      RAM: 16GB
      Storage: SSD
      Additional Features:
      ATM Banking | More Weapons | More Cars | More Loot | Namalsk Igloo | Light Saber Mod | No-Vehicle-Crash-Damage | Trader Wallet - Money/Item Storage | Custom Namalsk Spawn Selection | Custom Trader Cities | All items added to traders |Namalsk Airdrops | | Notification System | Territories System | Auto-run System | No Stamina System | Safezone System | Mission System | Skin System | Map UI and 2D/3D Markers System | KillFeed System | Towing System | Player Attachment | Custom lighting | Custom interiors | Custom ocean | Working Street lights | Builderitems | Gravecross | KillFeed | Notifications | Gravecross | Horn | Autorun | No stamina | MoreGuns | Street lights | Car Keys | CodeLock | Map UI and 2D/3D Markers | Global/Transport/Party Chat | Book (Server Info, Rules, player stats | party management | territory management) System
    • By Voltan
      Hey guys, (@salival hoping you can assist here buddy)
      I will preface this by saying that I am using Epoch 1.0.5.1 and server files provided by @Ultima_weapon
      I am getting this error in my console from WAI:
      I found something related here on page 7 here:
      https://epochmod.com/forum/topic/43666-release-wicked-ai-223-106/page/7/
      But this did not fix my issue.
      Here is the spawn_group.sqf:
      and the spawn_static.sqf:
      Anyone know what could cause this?
    • By heiko33
      Downlod        
      https://ln.sync.com/dl/043e1b3c0/wkrywtzv-idjkp722-wzfqg9g6-53b7xfyj
       
       
       
    • By FG_Trap
      Made a quick static ai mission that spawns on restart. 
      12 ai patrol the compound 
      4 Static m2's
      1 Heli Patrolling the compound 
      Crate for who ever clears all the ai.
      Some screenshots of the compound 


       
      https://github.com/Trapxxgods/Wai-Static-Mission 
  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...