Jump to content

Search the Community

Showing results for tags 'Scripting'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • BOHEMIA INTERACTIVE
    • BOHEMIA INTERACTIVE - NEWS
    • BOHEMIA INTERACTIVE - JOBS
    • BOHEMIA INTERACTIVE - GENERAL
  • FEATURED GAMES
    • Vigor
    • DAYZ
    • ARMA 3
    • ARMA 2
    • YLANDS
  • MOBILE GAMES
    • ARMA MOBILE OPS
    • MINIDAYZ
    • ARMA TACTICS
    • ARMA 2 FIRING RANGE
  • BI MILITARY GAMES FORUMS
  • BOHEMIA INCUBATOR
    • PROJECT LUCIE
  • OTHER BOHEMIA GAMES
    • ARGO
    • TAKE ON MARS
    • TAKE ON HELICOPTERS
    • CARRIER COMMAND: GAEA MISSION
    • ARMA: ARMED ASSAULT / COMBAT OPERATIONS
    • ARMA: COLD WAR ASSAULT / OPERATION FLASHPOINT
    • IRON FRONT: LIBERATION 1944
    • BACK CATALOGUE
  • OFFTOPIC
    • OFFTOPIC
  • Die Hard OFP Lovers' Club's Topics
  • ArmA Toolmakers's Releases
  • ArmA Toolmakers's General
  • Japan in Arma's Topics
  • Arma 3 Photography Club's Discussions
  • The Order Of the Wolfs- Unit's Topics
  • 4th Infantry Brigade's Recruitment
  • 11th Marine Expeditionary Unit OFFICIAL | 11th MEU(SOC)'s 11th MEU(SOC) Recruitment Status - OPEN
  • Legion latina semper fi's New Server Legion latina next wick
  • Legion latina semper fi's https://www.facebook.com/groups/legionlatinasemperfidelis/
  • Legion latina semper fi's Server VPN LEGION LATINA SEMPER FI
  • Team Nederland's Welkom bij ons club
  • Team Nederland's Facebook
  • [H.S.O.] Hellenic Special Operations's Infos
  • BI Forum Ravage Club's Forum Topics

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Yahoo


Jabber (xmpp)


Skype


Biography


Twitter


Google+


Youtube


Vimeo


Xfire


Steam url id


Raptr


MySpace


Linkedin


Tumblr


Flickr


XBOX Live


PlayStation PSN


Origin


PlayFire


SoundCloud


Pinterest


Reddit


Twitch.Tv


Ustream.Tv


Duxter


Instagram


Location


Interests


Interests


Occupation

Found 275 results

  1. I have searched both google and the forums for this and see a couple answers to this question that do not make sense to me. I have a couple different firing ranges for my unit that are run via script. They work correctly in both hosted and on the dedi with one small exception. The rangemaster - which is a recording of one of our members played in the script - only executes on the player that activated the firing range, even though the range itself is working for every player on the server. I am 100% sure that it is a locality issue, as the addAction that calls the sqf is located in the init.sqf of the mission. I keep finding answers that have things like this: [Computadora1, ['Disparar a Barco',{<your code here>}] ] remoteExec ["addAction",0,true]; But I do not understand exactly what it all means as most people just provide a script and not an explanation of why it fixes the issues. My question is: how do I execute the addAction in game via remoteExec so that all players can both see the range and hear the rangemaster? Below is a snippet of my range code that involves the recordings - just to ensure that I haven't made a boneheaded error. init.sqf range4.sqf (partial) Thank you all in advance for the help!
  2. MGI ADVANCED MODULES Hi all, Here is an addon for mission makers. If you need to easily spawn some factions, some civilian life or just add randomized weapons loot in houses... If you want an advanced AI heal & revive, for SP or MP mission, able to heal players or bros.. If you want a transport support on any vehicle... A vehicle respawn system with crew, waypoints, loadouts, addActions, arsenal.... Friendly kill sanction... AI cannons able to fire HE shells on infantry... Some generators able to switch on/off a district... or adapt silencers to combat behavior... or perhaps a simple tool for reading all map object classes/display names/p3d model names... Other tools like tire puncture on barbed wires? ... And of course, MP compatible, favorite mods compatible... Here you are. https://steamcommunity.com/sharedfiles/filedetails/?id=1682280809 Adapt silencers to stealth/combat situation No video SP/MP compatible - all mods Advanced locations (spawning factions on areas) See video SP/MP compatible - all mods Advanced transport See video SP/MP compatible - all mods AI can respawn No video SP/MP compatible - all mods Civilian life See video SP/MP compatible - some known mods Drop vehicle instead of crate See video SP/MP compatible - all mods Enhanced Turrets No video SP/MP compatible - all mods (so far. feedback welcome) Flip overturned vehicle No video SP/MP compatible _ all mods HALO jump No video SP/MP compatible - all mods Heal & revive see video SP/MP compatible - check for mods... Modded units are not a problem. But some mods like ACE have their own scripts and could be incompatible. Furthermore, I scripted for some conditions about the presence of FirstAidKit and MediKit. This module is complex enough. I didn't grab into mods for exotic classes of items (and I will not). Of course, you can choose to skip these conditions. Kill punishment See video SP/MP compatible -all mods Loot weapons & items in houses See video SP/MP compatible - some mods (CUP UNSUNG IFA3 RHS R3F) Marker to Task See video SP/MP compatible - all mods Respawn vehicles No video (see an old one about script to have an idea) SP/MP compatible - all mods Important note: This module uses EH handleDamage. This EH doesn't work if you apply something like: testedVehicle setDamage 1 from console. The script needs some hits on parts (updating vehicle data before destruction). So, crew and waypoints will be respawned after a current kill/disabled vehicle in game. SP simple respawn No video Single Player only Switch ambient lights See video SP/MP compatible - all mods so far... Tire puncture No video SP/MP compatible - some mods Touch of class! See video SP/MP compatible - all mods Wear what you want No video SP / MP compatible - all mods (not all. Some weird mods don't have true uniforms but some skinned units... Nothing to do with that) One man tank No video SP/MP compatible - all mods with Tanks or APCs Prisoners See video SP/MP compatible (not fully tested in MP) - all mods so far Have fun! Pierre MGI
  3. Hello I was searching for documentation to ARMA 3 Editor module "Zone Protection". It is calling BIS_fnc_moduleZoneProtection I cannot find any description or use cases. If my hunch is right, it should be a functionality used to create an area where damage is not applied to objects / characters? However BI wiki is very much empty on this module or function. Using function viewer i had a look into the code of the function but i am very much a newbie on arma scripting. While i understood from the code that the module can be synced only with Locations logic entities - documentnation on Locations is equally shabby. I tried in a single player scenario to place a location entity and sync it with this module. To my understanding some area should have been displayed on map but nothing happened. It had no effect. So i would be grateful if somebody experienced could explain. Thank you very much! P.S: Sorry if a topic exists somewhere on the forum explaining it - i was unable to find it.
  4. Dear sirs, I've been slowly working on what could perhaps best be called a "bedouin simulator" for a very long time. It involves things like making tea for people, cooking, hunting, chilling with your family etc. Sometimes, for example when making tea, I have the characters moving around from the kitchen to the fire, placing the teapot, etc. So there are a lot of cut-scene like sequences. Everything is working fine in my scripts, but the only problem: the movements are very imprecise at times. I don't mind some clunkiness, but sometimes the teapot is thrown Jedi-style to the fire through walls or from over ten meters away. I use "unit domove (position exampletargetpoint);" for almost everything now. Is there any better way to get more precise results compared to domove? Domove seems to be considered the most precise, but maybe I'm missing something. There are a lot of chairs and things around, it could be some sort of collision detection that is causing the problems. It seems like there are many possibilities to test and also I'm not sure if it's even possible to get it to work much better. So if you could point me to a better type of move command for this kind of thing, or a way to deal with collision detection problems, or simply tell me "there's no way to get it better just make everyone Jedi", I would appreciate it. Here is an example of my crude code, your wife is making you some tea at your camp: detach arwa; arwa switchmove ""; arwa domove (position teapot1); sleep 20; arwa domove (position waterstock1); teapot1 attachto [arwa, [0, 0, -.2], "lefthand" ]; sleep 20; arwa domove (position fire1); sleep 20; fire1 inflame true; sleep 3; teapot1 attachto [fire1, [0, 0, .3] ]; arwa domove (position seat1); sleep 5; arwa switchMove "ActsPsitMstp_cekani2"; arwa attachTo [seat1, [0, 0, -.3] ]; arwa setdir 0; arwa dowatch fire1; sleep 60; arwa switchMove ""; detach arwa; arwa setPos (arwa modelToWorld [0, -.5, 0]); sleep 2; arwa domove (position fire1); sleep 2; teapot1 attachto [arwa, [0, 0, -.2], "lefthand" ]; teacup1 attachto [arwa, [0, 0, 0], "righthand" ]; sleep 2; arwa domove (position player); sleep 5; player switchmove "Stryker_Cargo01"; player attachTo [seat2, [0, 0, .4] ]; 0 call {player setVectorDirAndUp [[0, cos _this, sin _this], [0, 0, 1]]}; teacup1 attachTo [seat2, [.015, .31, .55] ]; sleep 2; arwa domove (position teatable1); sleep 20; teapot1 attachTo [teatable1, [-.35, 0, -.2] ]; teacup2 attachto [arwa, [0, 0, 0], "righthand" ]; sleep 1; arwa domove (position seat1); sleep 15; arwa switchMove "crew"; arwa attachTo [seat1, [0, 0, .325] ]; arwa setdir 180; seat1 attachto [fire1, [0, -1.75, .05]]; arwa dowatch player; teacup2 attachTo [seat1, [.015, -.21, .43] ]; arwahakim = arwahakim + 3;
  5. I am trying to put together a trigger which gives Zeus points every time a truck goes between two points on the map (Like a supply line). If one Zeus is playing as the OPFOR team, they must spawn a Tempest Ammo truck and tell it to Cycle between two points (Point A and Point B). If the truck is spawned at Point A, the Zeus must order it to go to Point B, once it reaches Point B it must then be ordered to turn around and go back to Point A before Zeus points are added to that team. The Zeus can have multiple trucks going back and forth to add up Zeus points more quickly. I have managed to work out how to make the triggers active when a certain Vehicle type has entered the trigger, but I am having trouble working out how to get the supply point triggers working properly.
  6. Next to already revealed an known https://community.bistudio.com/wiki/Category:Arma_3:_New_Scripting_Commands_List There are more script commands now :) + fixed http://feedback.arma3.com/view.php?id=12324 + only discussion related to new or changed Arma 3 Beta/Dev Scripting allowed
  7. Hello there! I'm working on a remake of the "East Wind" campaign where I replace every NATO unit with a Bundeswehr unit (BWMod). I'm currently working on the first mission of the campaign, now here's my problem: There's a game logic entity where MacKinnon's vehicle is supposed to lie on the side. I replaced the Hunter with an Eagle. Now when I'm starting the mission, the Eagle is stuck in the ground. Mods: BWMod Bundeswehr ReTex Pack CBA_A3 I'm not a programming god and I have no idea how to fix this issue! Any ideas? Thanks in advance! Images: Game Logic in editor: https://ibb.co/2YqB3Rm How it looks like in the mission: https://ibb.co/9y1k8wy Game logic code: https://ibb.co/YWs2tLc Vehicle code: https://ibb.co/PgFG74h PS: Sorry for my english skills...
  8. Hi everyone, I'm trying to make a script that allows you to cancel a mission by clicking on a text that says CANCEL in the description of the task. Script: _descript1 = "<execute expression=' [1] call compilefinal preprocessFileLineNumbers'DMG\functions\fn_CancelM.sqf' '>CANCEL</execute>"; And then in the task: [blufor, ["Tarea_"+_IDTarea], [_descript1,_titulo,_marker], _posicion, true, 1, true] call BIS_fnc_taskCreate; If I put it in this way the result is that nothing comes out. Thanks for your help Spyke is my first post in this forum, if I do not have to say it here please tell me. I found it here:
  9. Hi! We are a bit new to Arma scripting and could use some pointers: My friend and I are working on an Escape like mission and we are wondering: - Is it possible to write a script that for each town/village the Civilian presence and BLUFOR Site module are generated when Independent players get within e.g. 1000m of that town/village? My plan (not sure it's the right one): - In Eden set out the modules with variable name defined - make triggerSpawnScript.sqf --> write å script that applies a trigger area to each town/village that is activated when Independent is within 1000m of citycenter an executes the moduleSpawnScript.sqf below - make moduleSpawnScript.sqf --> write some code that looks like this: forEach town apply "module variable name" call ["CityCenter"] BIS_fnc_locations - Do all customFiles.sqf have to be executed via the init.sqf file? Are we on correct path? or way off? thank you
  10. Hello everyone, This is the first time I write here, so before I state the problem I would like to say a big thanks to all the people contributing and helping around here (I have found a lot of info and solved quite some issues of mine from pages here in the past). So, my issue here is that I have a simple script (see below) using an if, then, else statement. The script is: // Check if wounded mannequins exist _groupIndex = allGroups findIf { groupId _x isEqualTo "medicalTrainingWoundedGroup"; // Look for a specific group ID }; /* * At this stage _groupIndex == -1 -> This is checked */ // Check returned group index if(_groupIndex isEqualTo -1) then { hint "Creating Group..."; // Debugging _woundedGroup = createGroup[west, true]; // Create a group to assign wounded mannequins _woundedGroup setGroupId["medicalTrainingWoundedGroup"]; // Set ID of the group to reference it in the future calls of the script } else { _woundedGroup = allGroups select _groupIndex; // Use the index to get it from the list of all groups }; I have also added a comment stating that _groupIndex is equal to -1 for your convenience. So, the actual problem I have encountered is that the first branch of the 'if, then' statement is NEVER executed, which is really weird to me. As you can see I have already checked the value of _groupIndex variable and it seems to be '-1' indeed, so if nothing else the first branch of the 'if' statement should be executed. But, no, instead the second branch (after the 'else' statement) is executed. I have also tried _groupIndex == -1 as well as _groupIndex isEqualTo str -1 which I believe is wrong (but tried it nevertheless) and as isEqualTo does NOT return an error I didn't get the results I wanted but didn't get an error either. I am quite new to scripting (although I have some intermediate experience with programming in general) and I am not sure where my error could be, so any insight would be most welcome. Thank you in advance, Z.
  11. Hello there, How can I give AI a custom death animation. (from an addon) It's for my "cinematic movie" I tried to combine "IF statement" and "switchmove" for example " if _soldier1 alive false switchmove ....; But it didn't work properly. If anybody could help, I would appreciate. Thanks :)
  12. Has anyone figured out how to execute the keyframe animation via script? the only thing I can find on keyframe animation is the page explaining the modules.
  13. Alright, so currently I am developing an OPTRE Spec Ops mission, where a group of ODST soldiers start in a Pelican dropship headed towards its insertion point. I want to begin the mission with a red light within the interior of the Pelican, which I have managed to do successfully. But, I want that light to switch to green whenever the dropship is over the insertion point activated by a trigger that I have designated as (A1). It seems that the code I implement within the initialization fields of the dropship works, but only for a split second as the red light flickers, but does not change to green. Any help is greatly appreciated! This is the code that I have tried to implement: if( triggerActivated A1) then { //The following code will set the interior color to Green. light2 = "#lightpoint" createVehicleLocal [0,0,0]; light2 setLightBrightness .125; light2 setLightAmbient [1,0.2,0.2]; light2 setLightColor [0,0,255]; light2 lightAttachObject [this,[0,-2.5,-0.8]]; }; if ( !triggerActivated A1) then { //The following code will set the interior to Red. light1 = "#lightpoint" createVehicleLocal [0,0,0]; light1 setLightBrightness .125; light1 setLightAmbient [1,0.2,0.2]; light1 setLightColor [255,0,0]; light1 lightAttachObject [this,[0,-2.5,-0.8]]; pelican1 say3D ["music1", 10, 1]; };
  14. Original post: "Is there any way to make backpacks accessable only when they are on ground or by other players using 'Open Backpack' action? The goal is to make player drop the backpack to get access in its inventory and so make them more realistic." UPDATE 15th Sept. -18: An addon version made! Script provided by @pierremgi PBO provided by @HazJ Download: https://hazjohnson.com/ArmA/@realisticBackpacks.zip Addon is now signed with key and bikey.
  15. Hi, I am currently trying to find a way to check if local player is function caller in sqf file. I have civilian with addAction, which calls this script: _caller = _this select 2; if (local player == _caller) then { _handle = createdialog "Interaction"; } I need to show the GUI only to player using the action. Sorry if it's somewhere on these forums, but I was unable to find it. Thanks for your answers 🙂 WendAF
  16. I am trying to work on a small project of gathering all of the Ammo classnames for each vehicle in my ARMA3 Library. Currently I am using the below code on the init field of my soldier, it works but it is time consuming switch back and forth between my text document and ARMA3. I was wondering if there is a quicker way to gather the information once I have placed all the vehicles I want to check in EDEN. Thank You this addAction["Check Ammo","_mags = magazinesAmmo cursorObject; copyToClipboard str _mags;"];
  17. So i recently made a retexture of a uniform following a tutorial, at first i used the config that the tutorial used and then one that i found on the internet. But it doesn't work i was wondering if someone could help me out here. Note - i do not know how to make configs or how to code.
  18. So I have a script in my description.ext file for some custom voices but when I open the mission in the Eden Editor it gives me this error message: "C:\Users\User\Documents\Arma 3\missions\mission_name\description.ext, line 1: '.': '{' encountered instead of '='." I've looked through it about 10 times and still don't know what it's talking about, any ideas?
  19. Last content update: 6/13/2018 showing how to use the radius for addAction, using params instead of select, adding to arrays with various commands, altering arrays with various commands, get/setUnitLoadout Last content update: 6/10/2018 going through config files and getting details to sort what you want, using radius with addAction, params, and altering arrays with resize, pushBack, pushBackUnique, set, and append and going over to assist with resize count. Last content update: 5/27/2018 added GUI tutorial for how to make a weapon selector using cfgWeapon Last content update: 5/24/2018 added sector control tutorial Last content update: 5/21/2018 This is my arma 3 scripting tutorial series which is aimed to help both people getting into making their own scripts with fairly detailed simple tutorials as well as for the intermediate person looking to create their own features for their missions. The plans for this series is to almost fully cover everything behind the arma 3 missions that people play on a daily basis and have enough content provided in the videos where people can go off and make their own vision for their mission with the knowledge gained. Most of these videos are made on the fly at 1AM-4AM without any pretesting which should give someone the idea of what goes into finding syntax errors and narrowing down a bug that's causing your feature to not function properly. It is also an excuse for you to cut me some slack if you see mistakes :) . A lot of these tutorials are made with multiplayer in mind since I think most people want to play their missions online with their friends(which is why publicVariable has been utilized so much so new people can get a good grasp on the power those commands have). New videos are added to the playlist almost every day so if your stuck with something, maybe it has been covered in a video. If you have any requests on what you would like to see made then please suggest it here. topics covered so far Scripting tutorial playlist Database tutorials with INIDBI2 playlist GUI/Dialog tutorials playlist
  20. Hi all, Looking at making a Cold War scenario, but similar in style to the opening of BF1 in a kind of 'you are not expected to survive' kind of deal, is there a way to fade to black and give a message on screen when a player dies? This is for MP if it makes a difference. Thanks!
  21. ▶ What do you do on Vigor? I'm a Jr. Scripter working on creating / prototyping game mechanics and player interfaces. ▶ What is your contribution to the Vigor Team? I do my best to always be learning something new, both at work and in my personal life.. Whether it be the Czech language or an aspect of the Unreal Editor. For me, a day’s success is measured in the lessons learned. And from a technical perspective, my contributions are probably most visible in the Reward & Crate screens displaying cloud data to the player. ▶ What do you like about Vigor? I like the mentality of high risk, the high reward associated with the airdrop. I personally enjoy games that create this feeling of hypersensitivity and suspense that emotionally capture the player in a way that's unique or commonly connected with games like F.E.A.R. ▶ What do you want to see in Vigor? I hope to see more easter eggs. While there's already quite a few, I still feel there's room for more. It would be nice to hide some cleverly scripted actor within a level just to see how long it takes for the community to notice. 🙂 ▶ What do you do when you are not making Vigor? When I'm not working I do my best to stay creative and busy; that being said I try and balance my time among friends, goals & personal projects. ▶ Did game dev change your view on games and how? I think whenever your passion becomes your career, your mentality changes a bit. I thoroughly enjoy game-dev, but it certainly changes the way you experience games. I find myself far more analytical and taking longer to progress through the game as I’ve become overly detail-oriented. ▶ Your favorite games and why? I feel compelled to mention the Arma franchise, as I owe my career and love for game-dev to it. But growing up my favorite games were Banjo And Kazooie, Delta Force Black Hawk Down, and Stronghold Crusader. Unfortunately after joining Bohemia, I find myself playing games less in my free time. Hopefully, in the near future, I’ll be able to catch up on some of the recent releases. ▶ What's your favorite music, movie, show, book and why? This question has no short answer for me. But I love media that leaves the audience thinking. For example shows like Black Mirror, Maniac, or books like To Kill A Mockingbird. In regards to music, I was raised a metalhead, and spend a lot of time listening to thrash bands such as Kreator, Municipal Waste, DRI, & Testament. ▶ Is there something that you want to say to our community? Just that it's amazing to create content and receive feedback, so join the community discord and forum. ▶ You are an Outlander; humanity has fallen. What would you do? In reality, I think I’d find a nice shelter and only queue for encounters when I need essential resources. 🙂 Bonus Question (From Martin ) ▶ How do you enjoy living in Europe? What is the biggest difference for you? I absolutely love living in Europe. It seems every major European city is perfect for getting lost in for a weekend or so. Here in the Czech Republic, there are almost monthly festivities to keep yourself busy. It's a great place to live, I certainly recommend it to all my friends in the states considering careers abroad. After being here for a year it's rather hard to remember what the biggest difference was? The one that's reoccurring, and most frustrating in the summer, is that there is no ‘free’ water in Czech restaurants. You explicitly have to order it, in the states it's just always there. It's a terribly small thing but seems to be a reoccurring nuisance. Other then the one “pet peeve” I can't think of anything terribly different. Im sure theres a lot that I'm overlooking, but after a while, the Czech / European lifestyle just seems normal. 🙂
  22. Hello there, I have been trying to delete an ammo crate with sqf if its inventory is empty (the one I'm using is "Box_NATO_Wps_F"). But I can't seem to figure it out. Any and all help is appreciated thanks :). I have tried things such as using getWeaponCargo and counting it to see if I can check if the array is empty but it always stays at 2 even if there is nothing inside the box.
  23. guys, i tried to find help in exile mod forums but people there dont seem to be as much active as you guys are here. Im posting here to find some help cuz im stuck with this problem for more than a week. here it is: So guys, ive made a custom loot generator for DMS boxes. it runs great on arma 3 editor, but after a weak trying to make it generate loot for DMS boxes i gave up and came here. The thing is, i saw on DMS's fn_fillCrate.sqf script that i can create a custom function and make it spawn the loot for me. But the comments from Defent were not very clear, where should i put my script for dms to read? should i declare it in DMS's config.cpp like its vanila functions? how should i parse the function name in the _crate_loot_values1 variable? a string? is there a pattern for me to create my custom file for my function? Any captain out there to help me with this? I REALLY NEED HELP! ive made the hard part to program how i want the loot to be generated, i know how should i return my function to DMS's accepted pattern. I just dont know where should i put my function, and how DMS is expecting me to call it. DMS's instructions: For example, _weapons could simply be a number, in which case the given number of weapons are selected from "DMS_boxWeapons", or an array as [_wepCount,_weps], where _wepCount is the number of weapons, and _weps is an array of weapons from which the guns are randomly selected. OR: [ _customLootFunctionParams, _customLootFunction ] In this case, "_customLootFunctionParams" is passed to "_customLootFunction", and the custom loot function must return the loot in the form: [ [ weapon1, weapon2, [weapon_that_appears_twice,2], ... weaponN ], [ item1, item2, [item_that_appears_5_times,5], ... itemN ], [ backpack1, backpack2, [backpack_that_appears_3_times,3], ... backpackN ] ] this DMS instructions are located in a3_dms/scripts/fn_fillCrate.sqf ive tried to insert my function like the vanilla functions of DMS in the folder "/scripts" but i got no success, the missions wont spawn 😕 DMS error log says the mission spawned successfully with no errors (but it didnt) thank you guys!
  24. Hey Guys! I would need your help regarding a piece of script that I'm trying to write. I try to simulate the player returning several items to an AI in order to complete a task. The intended behavior of this script is: _Check for a specific numbers of Items in the player's inventory ex.: 5 x firstAidkit, 1 x ToolBox, 5 x AntiRad etc, etc... _Remove the items that have been requested to complete the task _Set the task RECOVER ITEM to SUCCEEDED _Remove the "Give Item" action (quest_22) _Save the game _Add an Item to giftbox2 This is what I came out with : _questitems1 = [["FirstAidKit",5],["rvg_antiRad",5,6],["rvg_money",1000,1],["rvg_canisterFuel",1,20],["rvg_toolkit",1,3],["rvg_purificationTablets",5,6]]; if (_questitems1 in magazines player) then { player removeMagazine _questitems1; } else { if (_questitems1 in (backpackItems player)) then { player removeItemFromBackpack _questitems1; } else { if (_questitems1 in (vestItems player)) then { player removeItemFromVest _questitems1; } else { if (_questitems1 in (uniformItems player)) then { player removeItemFromUniform _questitems1; } else { if (_questitems1 in weapons player) then { player removeWeaponGlobal _questitems1; } else { player removeItem _questitems1; }; }; }; }; }; ["RECOVER ITEM", "SUCCEEDED",true] spawn BIS_fnc_taskSetState; quest2 removeAction quest_22; sleep 3; saveGame; quest2 addAction ["Talk to Theo",{cutText ["<t size='2'>Thanks for blablabla.</t>","PLAIN", -1, true, true],nil,1,true, true,"","true",3,false}]; giftbox2 addItemCargo ["Item_B_UavTerminal", 1]; I'm missing something in my nested statements as I tried to get it work with a unique item at first and it doesn't work. I'm not sure about the use of multi-dimensional array here but I don't see/know other ways to set differrent item with different quantities under one array. Some of the relevant pages I've checked out so far: https://community.bistudio.com/wiki/Array#Multi-dimensional_arrays https://community.bistudio.com/wiki/Control_Structures https://forums.bohemia.net/forums/topic/145490-check-player-for-a-item/ http://killzonekid.com/arma-scripting-tutorials-arrays-part-1/ I've been looking at it for too long now so I could use a fresh pair of eyes. Thank you. UPDATE: The solution to my problem. { if ((_x select 0) in magazines player) then {for "_i" from 1 to (_x select 1) do { player removeMagazine (_x select 0)}; } else { if ((_x select 0) in items player) then {for "_i" from 1 to (_x select 1) do { player removeItem (_x select 0)}; } else { if ((_x select 0) in backpackItems player) then { for "_i" from 1 to (_x select 1) do { player removeItemFromBackpack (_x select 0)}; } else { if ((_x select 0) in vestItems player) then { for "_i" from 1 to (_x select 1) do { player removeItemFromVest (_x select 0)}; } else { if ((_x select 0) in uniformItems player) then {for "_i" from 1 to (_x select 1) do { player removeItemFromUniform (_x select 0)}; } else { if ((_x select 0) in weapons player) then {for "_i" from 1 to (_x select 1) do { player removeWeaponGlobal (_x select 0)}; }; }; }; }; }; }; }foreach [["FirstAidKit",5],["rvg_antiRad",5],["rvg_money",1000],["rvg_canisterFuel",1],["rvg_toolkit",1],["rvg_purificationTablets",5]]; Enjoy!
  25. So guys here is the problem, i might be taking your time for something very stupid like syntax error or something like this, since im new to scripting in Arma. But the problem is: I have a EXIlLE server, and i use a very customized DMS mission system. In most cases, its great standard config variables give me what i need to make what i want. But since im trying to do some kind of RPG in exile, i need more things that depends on players lucky. In most cases Im developing very simple systems that spawn everything with some kind of probability, like vehicles and, missions and other stuff. Now im trying to do this in the loot of DMS missions and im looking to this code for like, 2 days! ive already read all the arma wiki documentation to check, double-check, triple-check, infinite-check my logic and syntax and i cant find the error. every time that i start the sever with my script it wont spawn ANY mission. even ZCP stop spawning. im using in this case "sniper camp" mission: here is my code for dynamic loot (not using selectRandomWeighted at the moment for testing proposes): _weaponCountSG = round (random 4); if (_weaponCountSG == 0) then {_weaponCountSG = 1}; _weaponsSG = ["srifle_DMR_01_F","srifle_EBR_F","srifle_DMR_07_blk_F","srifle_DMR_07_hex_F","srifle_DMR_07_ghex_F","Exile_Weapon_DMR","Exile_Weapon_SVD","Exile_Weapon_SVDCamo","Exile_Weapon_CZ550"]; _spawnWeaponsSG = []; _spawnMagSG = []; _spawnListSG = []; for [{_sgW = 1}, {_sgW <= _weaponCountSG}, {_sgW = _sgW + 1}] do { _selectedWeaponSG = selectRandom _weaponsSG; _spawnWeaponsSG = _spawnWeaponsSG + _selectedWeaponSG; _magCountSG = round (random 3); if (_magCountSG == 0) then {_magCountSG = 1}; { _selectedMagSG = getArray (configFile >> "CfgWeapons" >> _selectedWeaponSG >> "magazines"); for "_sgM" from 1 to _magCountSG do { spawnMagSG = _spawnMagSG + _selectedMagSG; }; }forEach _spawnWeaponsSG; //other syntax that ive tried to do the same stuff /*for [{_sgM = 1}, {_sgM <= _magCountSG}, {_sgM = _sgM + 1}] do { private _selectedMagSG = getArray (configFile >> "CfgWeapons" >> _selectedWeaponSG >> "magazines"); _spawnMagSG = _spawnMagSG + _selectedMagSG; };*/ }; so the complete code for "Sniper Camp" in my server was (in case you did not saw anything wrong up there (search for "SpaceGhost" to see all my modifications): /* Sniper Camp Mission with new difficulty selection system Hardcore has persistent vehicle based on work by Defent and eraser1 easy/mod/difficult/hardcore - reworked by [CiC]red_ned http://cic-gaming.co.uk */ private ["_num", "_side", "_pos", "_OK", "_difficulty", "_AICount", "_group", "_type", "_launcher", "_staticGuns", "_crate1", "_vehicle", "_pinCode", "_class", "_veh", "_crate_loot_values1", "_missionAIUnits", "_missionObjs", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_markers", "_time", "_added", "_cleanup", "_baseObjs", "_crate_weapons", "_crate_weapon_list", "_crate_items", "_crate_item_list", "_crate_backpacks", "_PossibleDifficulty"]; // For logging purposes _num = DMS_MissionCount; // Set mission side (only "bandit" is supported for now) _side = "bandit"; // This part is unnecessary, but exists just as an example to format the parameters for "DMS_fnc_MissionParams" if you want to explicitly define the calling parameters for DMS_fnc_FindSafePos. // It also allows anybody to modify the default calling parameters easily. if ((isNil "_this") || {_this isEqualTo [] || {!(_this isEqualType [])}}) then { _this = [ [10,DMS_WaterNearBlacklist,DMS_MinSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_TerritoryNearBlacklist,DMS_ThrottleBlacklists], [ [] ], _this ]; }; // Check calling parameters for manually defined mission position. // You can define "_extraParams" to specify the vehicle classname to spawn, either as _vehClass or [_vehClass] _OK = (_this call DMS_fnc_MissionParams) params [ ["_pos",[],[[]],[3],[],[],[]], ["_extraParams",[]] ]; if !(_OK) exitWith { diag_log format ["DMS ERROR :: Called MISSION nedsnipercamp_mission.sqf with invalid parameters: %1",_this]; }; //create possible difficulty add more of one difficulty to weight it towards that _PossibleDifficulty = [ "easy" //"easy" //"moderate" //"moderate" //"difficult" //"difficult" //"difficult" //"hardcore" ]; //choose difficulty and set value _difficulty = selectRandom _PossibleDifficulty; //SpaceGhost start _weaponCountSG = round (random 4); if (_weaponCountSG == 0) then {_weaponCountSG = 1}; _weaponsSG = ["srifle_DMR_01_F","srifle_EBR_F","srifle_DMR_07_blk_F","srifle_DMR_07_hex_F","srifle_DMR_07_ghex_F","Exile_Weapon_DMR","Exile_Weapon_SVD","Exile_Weapon_SVDCamo","Exile_Weapon_CZ550"]; _spawnWeaponsSG = []; _spawnMagSG = []; _spawnListSG = []; //SpaceGhost end switch (_difficulty) do { case "easy": { _AICount = (4 + (round (random 4))); //SpaceGhost Start for [{_sgW = 1}, {_sgW <= _weaponCountSG}, {_sgW = _sgW + 1}] do { _selectedWeaponSG = selectRandom _weaponsSG; _spawnWeaponsSG = _spawnWeaponsSG + _selectedWeaponSG; _magCountSG = round (random 3); if (_magCountSG == 0) then {_magCountSG = 1}; { _selectedMagSG = getArray (configFile >> "CfgWeapons" >> _selectedWeaponSG >> "magazines"); for "_sgM" from 1 to _magCountSG do { spawnMagSG = _spawnMagSG + _selectedMagSG; }; }forEach _spawnWeaponsSG; /*for [{_sgM = 1}, {_sgM <= _magCountSG}, {_sgM = _sgM + 1}] do { private _selectedMagSG = getArray (configFile >> "CfgWeapons" >> _selectedWeaponSG >> "magazines"); _spawnMagSG = _spawnMagSG + _selectedMagSG; };*/ }; _spawnListSG = _spawnWeaponsSG + _spawnMagSG; //SpaceGhost End _crate_weapons = (4 + (round (random 2))); _crate_weapon_list = ["srifle_DMR_01_F","srifle_EBR_F","srifle_DMR_07_blk_F","srifle_DMR_07_hex_F","srifle_DMR_07_ghex_F","Exile_Weapon_DMR","Exile_Weapon_SVD","Exile_Weapon_SVDCamo","Exile_Weapon_CZ550"]; _crate_items = (8 + (round (random 3))); _crate_item_list = ["10Rnd_762x54_Mag","20Rnd_762x51_Mag","20Rnd_650x39_Cased_Mag_F","Exile_Magazine_10Rnd_762x54","Exile_Magazine_5Rnd_22LR","Exile_Magazine_20Rnd_762x51_DMR","Exile_Magazine_20Rnd_762x51_DMR_Yellow","Exile_Magazine_20Rnd_762x51_DMR_Red","Exile_Magazine_20Rnd_762x51_DMR_Green","Exile_Magazine_20Rnd_762x51_DMR_White"]; _crate_backpacks = (1 + (round (random 1))); }; //COMMENTED THIS FOR TESTING PROPOSES /*case "moderate": { _AICount = (6 + (round (random 4))); _msgStart = ['#FFFF00',"Snipers have set up a moderate training camp, go steal their rifles"]; _crate_weapons = (6 + (round (random 2))); _crate_weapon_list = ["srifle_DMR_01_F","srifle_EBR_F","srifle_DMR_07_blk_F","srifle_DMR_07_hex_F","srifle_DMR_07_ghex_F","Exile_Weapon_DMR","Exile_Weapon_SVD","Exile_Weapon_SVDCamo","Exile_Weapon_CZ550"]; _crate_items = (10 + (round (random 3))); _crate_item_list = ["10Rnd_762x54_Mag","20Rnd_762x51_Mag","20Rnd_650x39_Cased_Mag_F","Exile_Magazine_10Rnd_762x54","Exile_Magazine_5Rnd_22LR","Exile_Magazine_20Rnd_762x51_DMR","Exile_Magazine_20Rnd_762x51_DMR_Yellow","Exile_Magazine_20Rnd_762x51_DMR_Red","Exile_Magazine_20Rnd_762x51_DMR_Green","Exile_Magazine_20Rnd_762x51_DMR_White"]; _crate_backpacks = (2 + (round (random 1))); }; case "difficult": { _AICount = (8 + (round (random 4))); _msgStart = ['#FFFF00',"Snipers have set up a difficult training camp, go steal their rifles"]; _crate_weapons = (9 + (round (random 2))); _crate_weapon_list = ["srifle_DMR_01_F","srifle_EBR_F","srifle_DMR_07_blk_F","srifle_DMR_07_hex_F","srifle_DMR_07_ghex_F","Exile_Weapon_DMR","Exile_Weapon_SVD","Exile_Weapon_SVDCamo","Exile_Weapon_CZ550"]; _crate_items = (14 + (round (random 3))); _crate_item_list = ["10Rnd_762x54_Mag","20Rnd_762x51_Mag","20Rnd_650x39_Cased_Mag_F","Exile_Magazine_10Rnd_762x54","Exile_Magazine_5Rnd_22LR","Exile_Magazine_20Rnd_762x51_DMR","Exile_Magazine_20Rnd_762x51_DMR_Yellow","Exile_Magazine_20Rnd_762x51_DMR_Red","Exile_Magazine_20Rnd_762x51_DMR_Green","Exile_Magazine_20Rnd_762x51_DMR_White"]; _crate_backpacks = (3 + (round (random 1))); }; //case "hardcore": default { _AICount = (8 + (round (random 8))); _msgStart = ['#FFFF00',"Snipers have set up an advanced training camp, go steal their rifles"]; _crate_weapons = (14 + (round (random 2))); _crate_weapon_list = ["srifle_DMR_01_F","srifle_EBR_F","srifle_DMR_07_blk_F","srifle_DMR_07_hex_F","srifle_DMR_07_ghex_F","Exile_Weapon_DMR","Exile_Weapon_SVD","Exile_Weapon_SVDCamo","Exile_Weapon_CZ550"]; _crate_items = (17 + (round (random 3))); _crate_item_list = ["10Rnd_762x54_Mag","20Rnd_762x51_Mag","20Rnd_650x39_Cased_Mag_F","Exile_Magazine_10Rnd_762x54","Exile_Magazine_5Rnd_22LR","Exile_Magazine_20Rnd_762x51_DMR","Exile_Magazine_20Rnd_762x51_DMR_Yellow","Exile_Magazine_20Rnd_762x51_DMR_Red","Exile_Magazine_20Rnd_762x51_DMR_Green","Exile_Magazine_20Rnd_762x51_DMR_White"]; _crate_backpacks = (4 + (round (random 1))); };*/ }; //_msgStart = ['#FFFF00',format["Snipers have set up a %1 training camp, go steal their rifles",_difficulty]]; _msgStart = ['#FFFF00',"Snipers have set up a training camp, go steal their rifles"]; // Hardcore needs different settings for AI and message and vehicle spawning if (_difficulty isEqualTo "hardcore") then { _pinCode = (1000 +(round (random 8999))); _vehicle = ["Exile_Car_Van_Guerilla01",[(_pos select 0) +17.2, (_pos select 1) -0],_pinCode] call DMS_fnc_SpawnPersistentVehicle; _msgWIN = ['#0080ff',format ["Convicts have killed the snipers and stolen their rifles,the truck code is %1...",_pinCode]]; _group = [ [[(_pos select 0)+3,(_pos select 1)-3,0],[(_pos select 0)+(10+(random 20)),(_pos select 1)+(10+(random 20)),0]], // Position AI in tent + 2nd squad _AICount, // Number of AI _difficulty, // "random","hardcore","difficult","moderate", or "easy" "sniper", // "random","assault","MG","sniper" or "unarmed" OR [_type,_launcher] _side // "bandit","hero", etc. ] call DMS_fnc_SpawnAIGroup_MultiPos; } else { _vehicle = ["Exile_Car_Van_Guerilla01",[(_pos select 0) +17.2, (_pos select 1) -0,0],[], 0, "CAN_COLLIDE"] call DMS_fnc_SpawnNonPersistentVehicle; _msgWIN = ['#0080ff',"Convicts have killed the snipers and stolen their rifles"]; _group = [ [(_pos select 0)+3,(_pos select 1)-3,0], // Position AI in tent _AICount, // Number of AI _difficulty, // "random","hardcore","difficult","moderate", or "easy" "sniper", // "random","assault","MG","sniper" or "unarmed" OR [_type,_launcher] _side // "bandit","hero", etc. ] call DMS_fnc_SpawnAIGroup; }; // add vehicle patrol and randomise a little - same for all levels (as it uses variable) _veh = [ [ [(_pos select 0) -(75-(random 25)),(_pos select 1) +(75+(random 25)),0] ], _group, "assault", _difficulty, _side ] call DMS_fnc_SpawnAIVehicle; // add static guns - same for all levels _staticGuns = [ [ // make statically positioned relative to centre point and randomise a little [(_pos select 0) -(5-(random 1)),(_pos select 1)+(5-(random 1)),0], [(_pos select 0) +(5-(random 1)),(_pos select 1)-(5-(random 1)),0] ], _group, "assault", "static", "bandit" ] call DMS_fnc_SpawnAIStaticMG; // Create Buildings - use seperate file as found in the mercbase mission - same for all levels _baseObjs = [ "nedsnipercamp_objects", _pos ] call DMS_fnc_ImportFromM3E; // Create Crate type - same for all levels _crate1 = ["Box_NATO_Wps_F",_pos] call DMS_fnc_SpawnCrate; // setup crate iteself with items - same for all levels _crate_loot_values1 = [ _spawnListSG, // Weapons SpaceGhost [], // Items + selection list _crate_backpacks // Backpacks ]; // Define mission-spawned AI Units _missionAIUnits = [ _group // We only spawned the single group for this mission ]; // Define mission-spawned objects and loot values _missionObjs = [ _staticGuns+_baseObjs+[_veh], // armed AI vehicle, base objects, and static guns [_vehicle], //this is prize vehicle [[_crate1,_crate_loot_values1]] //this is prize crate ]; //not start message here as they are defined in random choice to make the intro message different for each // Define Mission Win message - defined in choices // Define Mission Lose message - same for all levels _msgLOSE = ['#FF0000',"The Snipers have packed up and left, no rifles for you!"]; // Define mission name (for map marker and logging) - same for all levels _missionName = "Sniper Camp"; // Create Markers - same for all levels _markers = [ _pos, _missionName, _difficulty ] call DMS_fnc_CreateMarker; // Record time here (for logging purposes, otherwise you could just put "diag_tickTime" into the "DMS_AddMissionToMonitor" parameters directly) _time = diag_tickTime; // Parse and add mission info to missions monitor _added = [ _pos, [ [ "kill", _group ], [ "playerNear", [_pos,DMS_playerNearRadius] ] ], [ _time, (DMS_MissionTimeOut select 0) + random((DMS_MissionTimeOut select 1) - (DMS_MissionTimeOut select 0)) ], _missionAIUnits, _missionObjs, [_missionName,_msgWIN,_msgLOSE], _markers, _side, _difficulty, [] ] call DMS_fnc_AddMissionToMonitor; // Check to see if it was added correctly, otherwise delete the stuff if !(_added) exitWith { diag_log format ["DMS ERROR :: Attempt to set up mission %1 with invalid parameters for DMS_AddMissionToMonitor! Deleting mission objects and resetting DMS_MissionCount.",_missionName]; // Delete AI units and the crate. I could do it in one line but I just made a little function that should work for every mission (provided you defined everything correctly) _cleanup = []; { _cleanup pushBack _x; } forEach _missionAIUnits; _cleanup pushBack ((_missionObjs select 0)+(_missionObjs select 1)); { _cleanup pushBack (_x select 0); } foreach (_missionObjs select 2); _cleanup call DMS_fnc_CleanUp; // Delete the markers directly {deleteMarker _x;} forEach _markers; // Reset the mission count DMS_MissionCount = DMS_MissionCount - 1; }; // Notify players [_missionName,_msgStart] call DMS_fnc_BroadcastMissionStatus; if (DMS_DEBUG) then { (format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog; }; In case you want to compare to the original, Here it is: /* Sniper Camp Mission with new difficulty selection system Hardcore has persistent vehicle based on work by Defent and eraser1 easy/mod/difficult/hardcore - reworked by [CiC]red_ned http://cic-gaming.co.uk */ private ["_num", "_side", "_pos", "_OK", "_difficulty", "_AICount", "_group", "_type", "_launcher", "_staticGuns", "_crate1", "_vehicle", "_pinCode", "_class", "_veh", "_crate_loot_values1", "_missionAIUnits", "_missionObjs", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_markers", "_time", "_added", "_cleanup", "_baseObjs", "_crate_weapons", "_crate_weapon_list", "_crate_items", "_crate_item_list", "_crate_backpacks", "_PossibleDifficulty"]; // For logging purposes _num = DMS_MissionCount; // Set mission side (only "bandit" is supported for now) _side = "bandit"; // This part is unnecessary, but exists just as an example to format the parameters for "DMS_fnc_MissionParams" if you want to explicitly define the calling parameters for DMS_fnc_FindSafePos. // It also allows anybody to modify the default calling parameters easily. if ((isNil "_this") || {_this isEqualTo [] || {!(_this isEqualType [])}}) then { _this = [ [10,DMS_WaterNearBlacklist,DMS_MinSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_TerritoryNearBlacklist,DMS_ThrottleBlacklists], [ [] ], _this ]; }; // Check calling parameters for manually defined mission position. // You can define "_extraParams" to specify the vehicle classname to spawn, either as _vehClass or [_vehClass] _OK = (_this call DMS_fnc_MissionParams) params [ ["_pos",[],[[]],[3],[],[],[]], ["_extraParams",[]] ]; if !(_OK) exitWith { diag_log format ["DMS ERROR :: Called MISSION nedsnipercamp_mission.sqf with invalid parameters: %1",_this]; }; //create possible difficulty add more of one difficulty to weight it towards that _PossibleDifficulty = [ "easy", "easy", "moderate", "moderate", "difficult", "difficult", "difficult", "hardcore" ]; //choose difficulty and set value _difficulty = selectRandom _PossibleDifficulty; switch (_difficulty) do { case "easy": { _AICount = (4 + (round (random 4))); _crate_weapons = (4 + (round (random 2))); _crate_weapon_list = ["srifle_DMR_01_F","srifle_EBR_F","srifle_DMR_07_blk_F","srifle_DMR_07_hex_F","srifle_DMR_07_ghex_F","Exile_Weapon_DMR","Exile_Weapon_SVD","Exile_Weapon_SVDCamo","Exile_Weapon_CZ550"]; _crate_items = (8 + (round (random 3))); _crate_item_list = ["10Rnd_762x54_Mag","20Rnd_762x51_Mag","20Rnd_650x39_Cased_Mag_F","Exile_Magazine_10Rnd_762x54","Exile_Magazine_5Rnd_22LR","Exile_Magazine_20Rnd_762x51_DMR","Exile_Magazine_20Rnd_762x51_DMR_Yellow","Exile_Magazine_20Rnd_762x51_DMR_Red","Exile_Magazine_20Rnd_762x51_DMR_Green","Exile_Magazine_20Rnd_762x51_DMR_White"]; _crate_backpacks = (1 + (round (random 1))); }; case "moderate": { _AICount = (6 + (round (random 4))); _msgStart = ['#FFFF00',"Snipers have set up a moderate training camp, go steal their rifles"]; _crate_weapons = (6 + (round (random 2))); _crate_weapon_list = ["srifle_DMR_01_F","srifle_EBR_F","srifle_DMR_07_blk_F","srifle_DMR_07_hex_F","srifle_DMR_07_ghex_F","Exile_Weapon_DMR","Exile_Weapon_SVD","Exile_Weapon_SVDCamo","Exile_Weapon_CZ550"]; _crate_items = (10 + (round (random 3))); _crate_item_list = ["10Rnd_762x54_Mag","20Rnd_762x51_Mag","20Rnd_650x39_Cased_Mag_F","Exile_Magazine_10Rnd_762x54","Exile_Magazine_5Rnd_22LR","Exile_Magazine_20Rnd_762x51_DMR","Exile_Magazine_20Rnd_762x51_DMR_Yellow","Exile_Magazine_20Rnd_762x51_DMR_Red","Exile_Magazine_20Rnd_762x51_DMR_Green","Exile_Magazine_20Rnd_762x51_DMR_White"]; _crate_backpacks = (2 + (round (random 1))); }; case "difficult": { _AICount = (8 + (round (random 4))); _msgStart = ['#FFFF00',"Snipers have set up a difficult training camp, go steal their rifles"]; _crate_weapons = (9 + (round (random 2))); _crate_weapon_list = ["srifle_DMR_01_F","srifle_EBR_F","srifle_DMR_07_blk_F","srifle_DMR_07_hex_F","srifle_DMR_07_ghex_F","Exile_Weapon_DMR","Exile_Weapon_SVD","Exile_Weapon_SVDCamo","Exile_Weapon_CZ550"]; _crate_items = (14 + (round (random 3))); _crate_item_list = ["10Rnd_762x54_Mag","20Rnd_762x51_Mag","20Rnd_650x39_Cased_Mag_F","Exile_Magazine_10Rnd_762x54","Exile_Magazine_5Rnd_22LR","Exile_Magazine_20Rnd_762x51_DMR","Exile_Magazine_20Rnd_762x51_DMR_Yellow","Exile_Magazine_20Rnd_762x51_DMR_Red","Exile_Magazine_20Rnd_762x51_DMR_Green","Exile_Magazine_20Rnd_762x51_DMR_White"]; _crate_backpacks = (3 + (round (random 1))); }; //case "hardcore": default { _AICount = (8 + (round (random 8))); _msgStart = ['#FFFF00',"Snipers have set up an advanced training camp, go steal their rifles"]; _crate_weapons = (14 + (round (random 2))); _crate_weapon_list = ["srifle_DMR_01_F","srifle_EBR_F","srifle_DMR_07_blk_F","srifle_DMR_07_hex_F","srifle_DMR_07_ghex_F","Exile_Weapon_DMR","Exile_Weapon_SVD","Exile_Weapon_SVDCamo","Exile_Weapon_CZ550"]; _crate_items = (17 + (round (random 3))); _crate_item_list = ["10Rnd_762x54_Mag","20Rnd_762x51_Mag","20Rnd_650x39_Cased_Mag_F","Exile_Magazine_10Rnd_762x54","Exile_Magazine_5Rnd_22LR","Exile_Magazine_20Rnd_762x51_DMR","Exile_Magazine_20Rnd_762x51_DMR_Yellow","Exile_Magazine_20Rnd_762x51_DMR_Red","Exile_Magazine_20Rnd_762x51_DMR_Green","Exile_Magazine_20Rnd_762x51_DMR_White"]; _crate_backpacks = (4 + (round (random 1))); }; }; //_msgStart = ['#FFFF00',format["Snipers have set up a %1 training camp, go steal their rifles",_difficulty]]; _msgStart = ['#FFFF00',"Snipers have set up a training camp, go steal their rifles"]; // Hardcore needs different settings for AI and message and vehicle spawning if (_difficulty isEqualTo "hardcore") then { _pinCode = (1000 +(round (random 8999))); _vehicle = ["Exile_Car_Van_Guerilla01",[(_pos select 0) +17.2, (_pos select 1) -0],_pinCode] call DMS_fnc_SpawnPersistentVehicle; _msgWIN = ['#0080ff',format ["Convicts have killed the snipers and stolen their rifles,the truck code is %1...",_pinCode]]; _group = [ [[(_pos select 0)+3,(_pos select 1)-3,0],[(_pos select 0)+(10+(random 20)),(_pos select 1)+(10+(random 20)),0]], // Position AI in tent + 2nd squad _AICount, // Number of AI _difficulty, // "random","hardcore","difficult","moderate", or "easy" "sniper", // "random","assault","MG","sniper" or "unarmed" OR [_type,_launcher] _side // "bandit","hero", etc. ] call DMS_fnc_SpawnAIGroup_MultiPos; } else { _vehicle = ["Exile_Car_Van_Guerilla01",[(_pos select 0) +17.2, (_pos select 1) -0,0],[], 0, "CAN_COLLIDE"] call DMS_fnc_SpawnNonPersistentVehicle; _msgWIN = ['#0080ff',"Convicts have killed the snipers and stolen their rifles"]; _group = [ [(_pos select 0)+3,(_pos select 1)-3,0], // Position AI in tent _AICount, // Number of AI _difficulty, // "random","hardcore","difficult","moderate", or "easy" "sniper", // "random","assault","MG","sniper" or "unarmed" OR [_type,_launcher] _side // "bandit","hero", etc. ] call DMS_fnc_SpawnAIGroup; }; // add vehicle patrol and randomise a little - same for all levels (as it uses variable) _veh = [ [ [(_pos select 0) -(75-(random 25)),(_pos select 1) +(75+(random 25)),0] ], _group, "assault", _difficulty, _side ] call DMS_fnc_SpawnAIVehicle; // add static guns - same for all levels _staticGuns = [ [ // make statically positioned relative to centre point and randomise a little [(_pos select 0) -(5-(random 1)),(_pos select 1)+(5-(random 1)),0], [(_pos select 0) +(5-(random 1)),(_pos select 1)-(5-(random 1)),0] ], _group, "assault", "static", "bandit" ] call DMS_fnc_SpawnAIStaticMG; // Create Buildings - use seperate file as found in the mercbase mission - same for all levels _baseObjs = [ "nedsnipercamp_objects", _pos ] call DMS_fnc_ImportFromM3E; // Create Crate type - same for all levels _crate1 = ["Box_NATO_Wps_F",_pos] call DMS_fnc_SpawnCrate; // setup crate iteself with items - same for all levels _crate_loot_values1 = [ [_crate_weapons,_crate_weapon_list], // Weapons [_crate_items,_crate_item_list], // Items + selection list _crate_backpacks // Backpacks ]; // Define mission-spawned AI Units _missionAIUnits = [ _group // We only spawned the single group for this mission ]; // Define mission-spawned objects and loot values _missionObjs = [ _staticGuns+_baseObjs+[_veh], // armed AI vehicle, base objects, and static guns [_vehicle], //this is prize vehicle [[_crate1,_crate_loot_values1]] //this is prize crate ]; //not start message here as they are defined in random choice to make the intro message different for each // Define Mission Win message - defined in choices // Define Mission Lose message - same for all levels _msgLOSE = ['#FF0000',"The Snipers have packed up and left, no rifles for you!"]; // Define mission name (for map marker and logging) - same for all levels _missionName = "Sniper Camp"; // Create Markers - same for all levels _markers = [ _pos, _missionName, _difficulty ] call DMS_fnc_CreateMarker; // Record time here (for logging purposes, otherwise you could just put "diag_tickTime" into the "DMS_AddMissionToMonitor" parameters directly) _time = diag_tickTime; // Parse and add mission info to missions monitor _added = [ _pos, [ [ "kill", _group ], [ "playerNear", [_pos,DMS_playerNearRadius] ] ], [ _time, (DMS_MissionTimeOut select 0) + random((DMS_MissionTimeOut select 1) - (DMS_MissionTimeOut select 0)) ], _missionAIUnits, _missionObjs, [_missionName,_msgWIN,_msgLOSE], _markers, _side, _difficulty, [] ] call DMS_fnc_AddMissionToMonitor; // Check to see if it was added correctly, otherwise delete the stuff if !(_added) exitWith { diag_log format ["DMS ERROR :: Attempt to set up mission %1 with invalid parameters for DMS_AddMissionToMonitor! Deleting mission objects and resetting DMS_MissionCount.",_missionName]; // Delete AI units and the crate. I could do it in one line but I just made a little function that should work for every mission (provided you defined everything correctly) _cleanup = []; { _cleanup pushBack _x; } forEach _missionAIUnits; _cleanup pushBack ((_missionObjs select 0)+(_missionObjs select 1)); { _cleanup pushBack (_x select 0); } foreach (_missionObjs select 2); _cleanup call DMS_fnc_CleanUp; // Delete the markers directly {deleteMarker _x;} forEach _markers; // Reset the mission count DMS_MissionCount = DMS_MissionCount - 1; }; // Notify players [_missionName,_msgStart] call DMS_fnc_BroadcastMissionStatus; if (DMS_DEBUG) then { (format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog; }; (I dont think that i need to do this, but just to be clear, This code is not mine, its a nedsnipercamp_mission for DMS. Im just modding it. Thanks to the original creators.) So can anyone find what i did wrong? Is it really a syntax error? Can someone help me? BTW, if someone can help me to know how can i insert this functions of code in server side to prevent from people just downloading the mission and using it pretending they made it. it would be great. thank you for the attention =D
×