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
    • Arma Reforger
    • 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
  • Exilemod (Unofficial)'s General Discussion
  • Exilemod (Unofficial)'s Scripts
  • Exilemod (Unofficial)'s Addons
  • Exilemod (Unofficial)'s Problems & Bugs
  • Exilemod (Unofficial)'s Exilemod Tweaks
  • Exilemod (Unofficial)'s Promotion
  • Exilemod (Unofficial)'s Maps - Mission Files
  • TKO's Weferlingen
  • TKO's Green Sea
  • TKO's Rules
  • TKO's Changelog
  • TKO's Help
  • TKO's What we Need
  • TKO's Cam Lao Nam
  • MSOF A3 Wasteland's Server Game Play Features
  • MSOF A3 Wasteland's Problems & Bugs
  • MSOF A3 Wasteland's Maps in Rotation
  • SOS GAMING's Server
  • SOS GAMING's News on Server
  • SOS GAMING's Regeln / Rules
  • SOS GAMING's Ghost-Town-Team
  • SOS GAMING's Steuerung / Keys
  • SOS GAMING's Div. Infos
  • SOS GAMING's Small Talk
  • NAMC's Topics
  • NTC's New Members
  • NTC's Enlisted Members
  • The STATE's Topics
  • CREATEANDGENERATION's Intoduction
  • CREATEANDGENERATION's HAVEN EMPIRE (NEW CREATORS COMMUNITY)
  • HavenEmpire Gaming community's HavenEmpire Gaming community
  • Polska_Rodzina's Polska_Rodzina-ARGO
  • Carrier command tips and tricks's Tips and tricks
  • Carrier command tips and tricks's Talk about carrier command
  • ItzChaos's Community's Socials
  • Photography club of Arma 3's Epic photos
  • Photography club of Arma 3's Team pics
  • Photography club of Arma 3's Vehicle pics
  • Photography club of Arma 3's Other
  • Spartan Gamers DayZ's Baneados del Servidor
  • Warriors Waging War's Vigor
  • Tales of the Republic's Republic News
  • Operazioni Arma Italia's CHI SIAMO
  • [GER] HUSKY-GAMING.CC / Roleplay at its best!'s Starte deine Reise noch heute!
  • empire brotherhood occult +2349082603448's empire money +2349082603448
  • NET88's Twitter
  • DayZ Italia's Lista Server
  • DayZ Italia's Forum Generale

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 513 results

  1. I'm trying to make an arma 3 Life admin scroll menu and i'm stuck at trying to spawn in the virtual items. Instead of having 128 block of code to spawn in 64 items I would rather cut that down if there is a way to edit variables with addActions. This is the layout of the admin menu: AdminMenu_19 = player addAction["<t size=""1.1"" font=""TahomaB"" color=""#FFFFFF"">500k Cash</t>", AdminMenu_LifeCash500k, nil,1.5, true, false]; ^ that will call the function AdminMenu_LifeCash500k AdminMenu_LifeCash500k = { _code = { if (!isNil "life_no_injection") then { life_no_injection = true; }; life_cash = life_cash + 542940; if (!isNil "life_no_injection") then { life_no_injection = false; }; }; call _code; hint "$500,000 given"; }; command to add virtual items: [true,"ITEM",AMOUNT OF ITEM] call life_fnc_handleInv; If this could also be done with the amount of item as well that will really help, I have that done now with: AdminMenu_23 = player addAction["<t size=""1.1"" font=""TahomaB"" color=""#FFFFFF"">1</t>",AdminMenu_amount1,nil,1.5, true, false]; AdminMenu_amount1 = { _code = { amount = 1; }; call _code; hint format["%1 has been selected",amount]; }; I need 2 variables called in the addAction, amount and Item.
  2. sync <code> SQF makes it very easy to achieve asynchrony, while at the same time offering no means of synchronization. Some people seem to think that race conditions aren't a thing in SQF. This is of course wrong, as the scheduler is free to pause execution almost anywhere. A simple example: if (player hasWeapon _someWeapon) then { player removeWeapon _someWeapon; player addWeapon _someOtherWeapon; }; Here it is entirely possible (though admittedly unlikely) for the scheduler to pause between the condition and the effect, and consequently for the player to drop the weapon, keeping it, while also receiving the new one. I have personally witnessed a similar situation occurring in a real game under very heavy lag. Using certain hacky solutions it is possible to get around these issues. Relating to the previous example, it is for example possible to create an atomic function which at the same time attempts to remove the weapon, and returns a boolean indicating whether it was. It is also of course possible to create simple mutexes and consequently spinlocks. Neither solution is very pretty however. As such i suggest the following, very simple, script command: sync { /* some critical section */ } This command should execute the right hand argument synchronously, without the possibility of interruption by the scheduler. Use of any scheduler-only commands such as sleep and waitUntil should generate errors, just as they do in the unscheduled environment. If used in the unscheduled environment the command would have no special effect of course, behaving instead similarly to call. [<string>,...] preprocessFileLineNumbers <string> Many mod developers make clever use of macros for conditional compilation, for instance in order to enable or disable debugging features such as logging, argument validation, call stack tracing, et cetera. This is often done using macro constants defined either in each code file, or in a central header file. Unfortunately it doesn't seem to be possible to include files from the mission in an addon, as it is vice versa. This means in order to enable or disable the aforementioned features, one has to rebuild the mod, or a part of it while defining different macro constants. To ease this, and undoubtedly many other tasks, i suggest the extension of the preprocessFileLineNumbers command with a variant accepting, as the left hand argument, an array of strings representing macro constants to be defined during preprocessing. For example: ["MY_MACRO", "DO_THE_DEBUG"] preprocessFileLineNumbers "myScript.sqf" Would be equivalent to defining these macros at the top of the myScript.sqf file, like so: #define MY_MACRO #define DO_THE_DEBUG // ... compileFinal <code> We can all agree that the compileFinal command, as well as the underlying concept, are great additions to SQF. However they seem to necessitate placing each function, no matter how small, into its own code file. I would often prefer to place related functions, such as class member functions, next to each other in the same code file. For instance: //map.sqf my_fnc_map_add = { // add key value pair to the map }; my_fnc_map_get = { // retrieve value from the map using the specified key }; my_fnc_map_remove = { // remove the specified key from the map }; my_fnc_map_hasKey = { // determine whether the map contains the specified key }; Now all of these functions end up being non-final, and editable. For a dirty workaround something like this might be used: my_fnc = compileFinal str {...} However extending the compileFinal command with a variant accepting code as the right hand argument seems like it would be very simple to implement. serializeObject <object> / deserializeObject [...] Persistence across sessions is nothing new. Implementing it however ranges from arduous to downright impossible (at least without hacking memory via extensions), depending on the desired fidelity. Correctly saving and loading the attachments on a weapon inside a backpack inside a vehicle for instance isn't exactly simple. What i'm suggesting is two new simple commands to streamline this process. The proposed serializeObject command, given a right hand argument of type object, might return an array containing enough information to recreate the object with high precision. Properties such as type, position, orientation, velocity, damage to each part, and the entire inventory tree should be included. The counterpart, deserializeObject, could then be used to bring this array representation back to life. This would simplify immensely the task of persistence seen in many missions and mods, as well as offer a performance boost by moving a significant portion of SQF code over to a native implementation. Please share your thoughts, or any other suggestions you might have. If any (or all) of these have been suggested before, i apologize.
  3. So I've been trying to follow the various threads on this topic, but I'm not the greatest at figuring out just where I messed up in my script. I am trying to have my players be able to set the mission time / weather parameters before beginning. Could someone take a look and tell me how to repair it? I get weather parameter working, but the time one won't kick in. Then I can get time working, but weather won't kick in. This is the description.ext class Params { class initialWeatherParam { title = "Starting Weather"; values[] = {0,1,2,3,4}; texts[] = {"Clear","Overcast","Rain","Fog","Random"}; default = 4; }; class TimeOfDay { title = "Time of Day"; values[] = {-6, 0, 8, 13}; texts[] = {"Morning", "Clear day", "Sundown", "Night"}; default = 0; }; }; Here is my init. I think this is where I am lost? weather = paramsarray select 0; timeofday = paramsarray select 1; execVM "briefing.sqf"; execVM "randomWeather2.sqf"; I'm using the RandomWeather2.sqf script from here - http://www.armaholic.com/page.php?id=24614 Any help would be appreciated.
  4. beama2005

    New mod idea "The 100"

    hi guys have been thinking about this for while now and wondered what people think? ive been watching the tv series The 100 and i think it might be a cool idea for a mod. it will be similar to dayz/exile but will not have zombies. Plot: 97 years after a devastating nuclear war wiped out almost all life on Earth, humankind is living in space, residing in twelve space stations. The space stations banded together to form a single massive station named "The Ark", where about 2,400 people live. Resources are scarce and all crimes no matter their nature or severity are punishable by death ("floating") unless the perpetrator is under 18 years of age. After the Ark's life support systems are found to be critically failing, one hundred juvenile prisoners are declared "expendable" and sent to the surface in a last ditch attempt to determine if Earth is habitable again. The teens arrive on a beautiful planet they've only seen from space. Confronting the dangers of this rugged new world, they struggle to form a tentative community. However they discover that not all humanity was wiped out. There are people on Earth who survived the war, called "grounders" by the 100. The teens quickly discover they are not welcome by the hostile grounders and must band together in order to survive. here is what i had in mind: "the 100" are playable and sole mission is to survive/scavange/kill there will be ai clans (the grounders,mount weather troops) high radiation zones around the map that need gas masks to enter survival system like dayz. food, drink and radiation levels base building? crafting missions? its a very loose idea but i think it would be so much fun to build and play. is there any pro that will help me get this project going? or anyone with cool ideas that want to help? everyone is welcome what do you think? thanks beama2005
  5. Hello! I need some advice on how to populate empty turrets in a custom vehicle I have. The turret indexes are [0,0] [0,1] [0,2] [0,3] and Ive tried creating new units and moving them into the vehicle with moveInTurret command in dev console and via useraction executed .sqf but have not managed to get it to work. The turret gunner seats seem to work ok when units are placed in them in Eden but moveInTurret does not seem to work. :confused: :confused: I've got code as follows: //_veh = vehicle player; _veh = _this select 0; _gunnerL1 = "B_Pilot_F" createvehicle position _veh; _gunnerL2 = "B_Pilot_F" createvehicle position _veh; _gunnerR1 = "B_Pilot_F" createvehicle position _veh; _gunnerR2 = "B_Pilot_F" createvehicle position _veh; //creating the units, B_Pilot_F used for testing.. (short classname :9) //units appear around the vehicle as they should //Not sure if this is even needed, but saw it in one example and tried it.. _gunnerL1 assignAsTurret [_veh, [0,0]]; _gunnerL2 assignAsTurret [_veh, [0,1]]; _gunnerR1 assignAsTurret [_veh, [0,2]]; _gunnerR2 assignAsTurret [_veh, [0,3]]; //Moving the wannabe gunners into the right turrets.. _gunnerL1 moveinturret [_veh, [0,0]]; _gunnerL2 moveinturret [_veh, [0,1]]; _gunnerR1 moveinturret [_veh, [0,2]]; _gunnerR2 moveinturret [_veh, [0,3]]; //But it seems to do nothing :o _crew = fullcrew [_veh,"",true]; hint format ["%1",_crew]; //script runs to the end and hint shows none of the units enter the vehicle. Tried this with vanilla vehicles too and with other crew positions but just don't know what Im missing. Any advice?
  6. Hello lads! I'm currently making / modifying a coop mission in ArmA 3, most stuff works so far, managed to find most stuff i needed in the Forums already. Now i have a little problem, it has been explained a few times already, but i just can't seem to understand it somehow :P How can i manage to make stuff sync between all connected users ? e.g. i have some "addaction" stuff used in my mission, but some of these actions are only executed on the local client side, and not globally for all of the players. As far as i know, i will have to somehow send information (for ex. briefcase collected, which would be a addaction) to the server in which i set a server variable (for ex. briefcase_collected) to a specific value, in this case 1 / true. Then the server would share this information with all collected clients, and by changing the value of the variable, the clients would know that this task has been completed, and it would show the next. I just have no idea how i do this in arma, i am trying for quite some hours now but just can seem to get it right. I thank all of those that give me some hints in advance! B) - PsychOrange
  7. I have a problem with the "restartwarnings.sqf" When the mission ends this script doesn't reset the timer it still thinks it's at 0 and mission ends which is a loop. I'm thinking its something to do with []spawn maybe there's a way to re-spawn the timer. restartwarnings.sqf restartWarningTxt = "== WARNING =="; warningSchedule = [60,30,20,15,10,5,3,2,1]; END_TIME = 400; if (isServer) then { [] spawn { ELAPSED_TIME = 0; START_TIME = diag_tickTime; while {ELAPSED_TIME < END_TIME} do { ELAPSED_TIME = diag_tickTime - START_TIME; publicVariable "ELAPSED_TIME"; sleep 1; }; }; }; if!(isDedicated) then { [] spawn { while{ELAPSED_TIME < END_TIME } do { timey = floor(END_TIME - ELAPSED_TIME); finish_time_minutes = floor(timey / 60); finish_time_seconds = floor(timey) - (60 * finish_time_minutes); finish_time_hours = floor(timey / 3600); if(finish_time_seconds < 10) then { finish_time_seconds = format ["0%1", finish_time_seconds]; }; if(finish_time_minutes < 10) then { finish_time_minutes = format ["0%1", finish_time_minutes]; }; formatted_time = format ["%1:%2", finish_time_hours, finish_time_minutes]; }; }; }; givewarning = compileFinal preprocessFileLineNumbers "addons\restart_warnings\givewarning.sqf"; timecheck = compileFinal preprocessFileLineNumbers "addons\restart_warnings\timecheck.sqf"; [warningSchedule] spawn timecheck; timecheck.sqf _END = 99; //_END = count warningSchedule; while { _END == 99 } do { if (timey == 60) then { playMusic "1min"; sleep 2; }; if (timey == 120) then { playMusic "2min"; sleep 2; }; if (timey == 180) then { playMusic "3min"; sleep 2; }; if (timey == 300) then { playMusic "5min"; sleep 2; }; if (timey == 30) then { playMusic "30sec"; sleep 2; }; if (timey == 10) then { playMusic "10sec"; sleep 2; }; if (timey <= 0) then { endMission "END1"; _END = 98; }; _find = warningSchedule find finish_time_minutes; if (_find > -1) then { [warningSchedule select _find, restartWarningTxt] spawn givewarning; warningSchedule = warningSchedule - [warningSchedule select _find]; //timey = timey -1 }; }; pawn BIS_fnc_typeText; givewarning.sqf _minutesLeft = _this select 0; _minuteOrMinutes = "s"; if(_minutesLeft == 1) then { _minuteOrMinutes = ""; }; _notif = [ [ [format["%1", restartWarningTxt],"<t align = 'center' shadow = '1' size = '1' color ='#E44646' font='PuristaBold'>%1</t><br />"], [format["Next restart in %1 minute%2....", _minutesLeft, _minuteOrMinutes],"<t align = 'center' shadow = '1' size = '0.8'>%1</t><br/>"] ] ] spawn BIS_fnc_typeText;
  8. Hi, I'm trying to get a trigger condition that allows my player character to remain undercover per-se, in the sense that unless he uses a weapon or otherwise acts aggressive, bad guys won't shoot at him. I'm making a 007 campaign and it takes place on Altis/Stratis/other maps. Good secret agents should be able to operate right under the enemy's nose without detecting. Is there a trigger condition that can enable the OPFOR to attack my character if I violate it? (the condition). Such as sending a truckload of thugs? This kind of ties into part two: A good villain will eventually identify his target and to be initially discreet, send a plainclothes hitman after him. I need a script/trigger that will assign a civilian a holstered pistol, then send him to to the player and only pulling the weapon out to engage when danger close. (AKA two-three meters.) Somebody please help me, I don't want to lose my spark of creative energy. It's derailed all of my previous campaigns. (is this in the wrong section?)
  9. I reskinned Carrier Rig (Green) V_PlateCarrier2_rgr but I do need to define picture / model and armor value myself I want to use all the base value of the Carrier Rig I used just changing the texture I have tried changed Vest_Camo_Base on line 20 to V_PlateCarrier2_rgr and got an error "Undefined base class" how do I fix it? config.cpp #define true 1 #define false 0 class CfgPatches { class RTAF_Vest { units[] = {RTAF_Vest}; weapons[] = {}; requiredAddons[] = {}; }; }; class cfgWeapons { class ItemCore; class Vest_Camo_Base: ItemCore { class ItemInfo; }; class RTAF_PlateCarrier_wdl: Vest_Camo_Base { author = "Splendid Modder"; scope = 2; displayName = "RTAF Carrier Rig (Digital Woodland)"; picture = "\A3\characters_f\Data\UI\icon_V_plate_carrier_2_CA.paa"; model = "\A3\Characters_F\BLUFOR\equip_b_vest02.p3d"; hiddenSelectionsTextures[] = {"\RTAF\data\RTAF_PlateCarrier_digiwdl_f.paa"}; class ItemInfo: ItemInfo { uniformModel = "\A3\Characters_F\BLUFOR\equip_b_vest02"; containerClass = Supply80; mass = 15; armor = 0; passThrough = 1; }; }; }; config.cpp I use as template https://community.bistudio.com/wiki/Arma_3_Characters_And_Gear_Encoding_Guide#Vest_configuration class cfgWeapons { class ItemCore; class Vest_Camo_Base: ItemCore { class ItemInfo; }; class V_vest_new: Vest_Camo_Base { author = "Splendid Modder"; scope = 2; displayName = "New Vest"; picture = "\A3\characters_f\Data\UI\icon_V_BandollierB_CA.paa"; model = "\A3\Characters_F\BLUFOR\equip_b_bandolier"; hiddenSelectionsTextures[] = {"\A3\Characters_F\BLUFOR\Data\vests_khk_co.paa"}; class ItemInfo: ItemInfo { uniformModel = "\A3\Characters_F\BLUFOR\equip_b_bandolier"; containerClass = Supply80; mass = 15; armor = 0; passThrough = 1; }; }; };
  10. Here's list of error I got Config : some input after EndOfFile The exception unknown software exception (0x000dead) occurred in the application at location 0x000000007441DAD8 Exit code: 0x0000DEAD- .rpt file config.cpp #define true 1 #define false 0 class CfgPatches { class RTAF_plane_cas_01_f { units[] = {RTAF_plane_cas_01_f}; weapons[] = {}; requiredAddons[] = {}; }; }; class cfgVehicles { class B_Plane_CAS_01_F {}; //External Class Reference class RTAF_Plane_CAS_01_F : B_Plane_CAS_01_F { _generalMacro = "Plane_CAS_01_base_F"; scope = 0; displayName = "RTAF A-164 Wipeout (CAS)"; faction = "BLU_F"; author = "Unknown"; vehicleClass = "Air"; Side = 4; crew = "B_pilot_f"; typicalCargo[] = {"Soldier"}; hiddenSelections = {"Camo_1","Camo_2"}; hiddenSelectionsTextures = {"\RTAF_10\data\RTAF_plane_cas_skin_00_f.paa","\RTAF_10\data\RTAF_plane_cas_skin_01_f.paa"}; class Library { libTextDesc = "RTAF_A164"; }; }; }; This code works well on wheeled vehicle but I cannot use it on Air vehicle I don't know how to fix this problem This is code I use as template (The one that I says it's works well) #define true 1 #define false 0 class CfgPatches { class B_MRAP_03_F { units[] = {B_MRAP_03_F}; weapons[] = {}; requiredAddons[] = {}; }; }; class cfgVehicles { class I_MRAP_03_F {}; //External Class Reference class B_MRAP_03_F : I_MRAP_03_F { scope = 2; displayName = "Strider"; faction = "OPF_F"; author = "Tactical Light"; vehicleClass = "Car"; Side = 0; crew = "O_soldier_F"; hiddenselectionstextures[] = {"\csat_strider\mrap_03_csat_ext_co.paa"}; class Library { libTextDesc = "Strider"; }; }; };
  11. Hello, I'm developing an airborne mission for my group, basically the guys (Two fire-team consisting of four members each, named A1, A2, A3, A4, B1, B2, B3, B4) spawn in an C-130 and parachute into the A.O. The problem is, I need them to have their backpacks when they land, so they have enough ammo and equipment to complete the mission, so I came up with this Idea, a trigger executing a script for each unit, the script will wait until they land and then add backpacks and equipment into it. The C-130 will enter the trigger area with the team onboard. These are the trigger's specs: ACTIVATION: BLUFOR ACTIVATION TYPE: PRESENT CONDITION: this && isServer ON ACT: para1 = [] execvm "scripts\backpack\A1.sqf"; para2 = [] execvm "scripts\backpack\A2.sqf"; para3 = [] execvm "scripts\backpack\A3.sqf"; para4 = [] execvm "scripts\backpack\A4.sqf"; para5 = [] execvm "scripts\backpack\B1.sqf"; para6 = [] execvm "scripts\backpack\B2.sqf"; para7 = [] execvm "scripts\backpack\B3.sqf"; para8 = [] execvm "scripts\backpack\B4.sqf"; Now this is the A1.sqf script: I tested it and it worked great, except when I tested it in a multiplayer server (I hosted it locally), I got in as unit A1. When I landed, the script worked and the parachute got replaced by the backpack and the defined contents, however it didn't work for the other player, their parachutes didn't get replaced by the intended backpacks, At first I thought I could've screwed the script for their units, so I restarted the mission and got in as another unit (A2), as some of you guys may imagine, I got my backpack just fine, but the other players didn't, not even the unit I just tested (A1). I tested all the other units and it worked great when I was playing as them, but no one else got their backpacks. As you guys probably know, I think I fucked up the locality of the script execution, not sure how, could any of you guys enlighten me as how to make this thing work? We usually use conventional hosting (through the game Multiplayer menu) and Dedicated hosting, so it would need to be something that works for both. Thanks in advance!
  12. Currently i'm working on my custom faction mod. I have different soldiers wearing same uniform variant. I have created three insignias and they work in the game (all of them are visible and usable in virtual arsenal). First insignia is used with my woodland uniform, second insignia used with desert uniform - they appear in-game when soldiers are placed through the editor. But when I try to assign my third insignia, which is again used with woodland uniform, game loads first insignia instead of third. Insignias script looks like this: class CfgUnitInsignia { class LITHSOF_insignia1 { displayName = "LITHSOF Woodland Insignia"; author = "Karolus"; texture = "\LAF\data\LITHSOF_woodland_insignia2.paa"; textureVehicle = ""; }; class LITHSOF_insignia2 { displayName = "LITHSOF Desert Insignia"; author = "Karolus"; texture = "\LAF\data\LITHSOF_desert_insignia.paa"; textureVehicle = ""; }; class LITHSOF_insignia3 { displayName = "Zaliukas"; author = "Karolus"; texture = "\LAF\data\YPT_Zaliukas_Insignia_co.paa"; textureVehicle = ""; }; }; Uniform script looks like this: class LITHSOF_Woodland_Uniform: Uniform_Base { scope = 2; displayName = "LITHSOF Woodland Uniform"; picture = "\A3\characters_f_epa\data\ui\icon_U_B_CTRG_uniform_ca.paa"; model = "\A3\Characters_F\Common\Suitpacks\suitpack_blufor_diver"; hiddenSelections[] = {"Camo", "Insignia"}; hiddenSelectionsTextures[] = {"LAF\data\LITHSOF_Woodland_co.paa"}; class ItemInfo: UniformItem { uniformModel = "-"; uniformClass = "LITHSOF1_Operator"; containerClass = "Supply50"; mass = 40; //Weight hiddenSelections[] = {"camo", "Insignia"}; }; }; My first soldier has these: uniformClass = "LITHSOF_Woodland_Uniform"; hiddenSelections[] = {"camo","insignia"}; HiddenSelectionsTextures[] = {"LAF\data\LITHSOF_Woodland_co.paa","\LAF\data\LITHSOF_woodland_insignia2.paa"}; My second soldier has these: uniformClass = "LITHSOF_Woodland_Uniform"; hiddenSelections[] = {"camo","Insignia"}; HiddenSelectionsTextures[] = {"LAF\data\LITHSOF_Woodland_co.paa","\LAF\data\YPT_Zaliukas_Insignia_co.paa"}; Anyone have ideas how to fix this?
  13. I'm currently working on my custom faction. For immersion I want that AI soldiers in-game name would be Lithuanian (like Jonas, Petras, etc.) istead of default names (like John, Peter, etc.). I heard that this is possible, because some people already did this, but I couldn't find a way to do it. First I thought that it is possible changing it through soldiers identityTypes[] but it looks that this script command is used for assigning only faces and voice, but not in-game names. I guess in-game names has something to do with classes, like I_soldier_F, B_Soldier_base_F, etc. So my questions are: 1. How can i achieve this? 2. Also is it possible to randomize these names so that placed AI would have random name from the list?
  14. I'm working on an arma 3 life server. I'm trying to change the respawn time so when there is no ems the revive timer is 1min and if there is, its 10min. All i need to get this to work is the command to test for active players on independent. code for revive time: life_respawn_timer = 1;//number goes by min
  15. I'm trying to replace an object that I've played in the Eden Editor through a script, but I've changed the XYZ rotation of the object. I have managed to give the new object the XYZ position values of the old object, but I'm struggling to figure out how to change it's rotation. Is there an easy way of doing this? I've already tried setVectorUp, but it doesn't seem to accept the above XYZ rotation values from the Eden editor. Edit: Woops, looks like I posted this in the wrong subforum.
  16. I will start with putting function code because it's quite small, and for reference (starting description comment omitted). /// --- validate general input #include "..\paramsCheck.inc" paramsCheck(_this,isEqualType,[]) private _cnt = count _this; for "_i" from 1 to _cnt do { _this pushBack (_this deleteAt floor random _cnt); }; _this According to BIS_fnc_arrayShuffle: Now, what's wrong. As you can see, no new array is created, and instead passed array is shuffled in-place. Function itself fails to shuffle (at least for what I think shuffle is). What I think shuffle is: all elements of input array get fairly equal chances to appear in any position in output array. What we have in function? TL;DR. First elements are less likely to be shuffled than last ones. Let's say we have array of N elements numbered 0, 1, ... N-1. Fair probability for any element to take any position is 1/N. Line 24 removes element with random index M (all consequent elements moved one element towards the array front) and pushes it to array's back. Operation affects positions of elements in range [M, ... N-1] unless M == N-1 (in which case nothing is changed, but delete and insertion performed!). Position of M elements (numbered 0..M-1) is unchanged. For arbitrary M in [0, 1, ..., N-1] you have the probability (N-M-1)/N that first M elements will remain on their positions after this iteration. Entire loop lasts N iterations. So the probability of element not being picked up and not moved in entire loop is ((N-M-1)/N)N. Full probability of element to stay on its initial place also includes the cases when element goes to back and after some iterations shifts to its initial place. For 0th element probability of shifting back to 0th position is 1/N * (N-1)/N * (N-2)/N * ... * 1/N = (N-1)!/(NN). For the last exactly 1/N (simply probability of picking specific element; fair for this position, still not fair for others) -- if last element moved to array's back in last iteration. Assuming that , probability of 0th element staying in 0th position first falls and has minimum in N=5, then grows and asymptotically strives for 1/e, i.e. ~0.367879441, no matter what size array is. When in fact it should be exactly 1/N for any N. That is, having array of 10 elements, for first element (M=0) you will have probability (10-0-1)/10 = 0.9 (90%) that it stays on its place after first iteration. Probability 0.8 (80%) of that two first elements are not shuffled after first iteration (quite obvious). Probability of first element staying in first position after entire loop is 0.348714728 (~34.8%) when it should be 10%. Sorry, did not do the maths for other elements, but I think it's enough already to state that shuffle fails. The easiest way to fix the loop is to rewrite it like this: for "_i" from 1 to _cnt do { _this pushBack (_this deleteAt floor random (_cnt+1-_i)); }; Thus not picking any element second time and providing fair 1/N probability for all elements. However, I don't like this approach because of too many (unnecessary) deletes, causing multiple elements to shift towards array front, meaning worst case complexity of O(n2) (if random always returns 0). I don't know how arrays work inside. If shifting elements of arbitrary types is quite costly operation (very likely for vector-like containers filled with data structures itself, not pointers), it's better shift numbers (indexes of elements). Here's my implementation of function, fixing both issues: /// --- validate general input #include "..\paramsCheck.inc" paramsCheck(_this,isEqualType,[]) private ["_cnt", "_result"]; _cnt = count _this; _result = []; if (_cnt > 0) then { private ["_i", "_idxs"]; _idxs = []; _idxs resize _cnt; for [{_i = 0}, {_i < _cnt}, {_i = _i + 1}] do { _idxs set [_i, _i]; }; _result resize _cnt; for [{_i = 0}, {_i < (_cnt-1)}, {_i = _i + 1}] do { _result set [_i, _this select (_idxs deleteAt floor random (_cnt-_i))]; }; _result set [_cnt-1, _this select (_idxs select 0)]; }; _result It does multiple deletes from array too, but at least elements are always numbers. Whoever wants a fair shuffle, feel free to use. Having BIS_fnc_sortBy function discovered broken recently, I think there should be some review in arrays functions code. And I'll be digging too, hehe :icon_twisted: I see what you did there, KK There's hotfix coming soon, I wonder if BIS could fix this function too. Best regards.
  17. alright , I'm so close to having my mission working 100% including ai commanders .. but my lack of real scripting/coding has put a big hold on me finishing this mission as sqs , to later then start porting it from sqs to sqf .. issues are variables and defines in two different scripts ... not a lot of errors but ive tried everything I know from _myvar = objnull, _myvar = [], _myvar = true, faults ,this select... it goes on and on... and is why I'm asking anyone that know how this stuff is done .. I NEED HELP. and before I hear again "just rewite it in sqf", this is not the point, I need it working as it was made fully before I cant start to do any sqf to the existing sqs scripts... ive been partly down this road and things get worse.. thank you if anyone is up to it.. might only take a good scripter/coder 10 min? for me its all guessing ... pm me here of steam Dr Death JM
  18. Hi everyone! Little weird behaviour for support modules: A simple work, but very hard to do: how to synchronize / desync the support(s) modules along with conditions? Say for instance: get the support modules if you reach a trigger area, loose these supports if out of the area? for each player ! Yes, I know, you're saying use synchronizeObjectsAdd and synchronizeObjectsRemove. Let an "open" (no) sync on editor, normally between player/playable unit and the module requester, then sync/desync on demand the player and the module requester. At ease! And you'll right for SP,... for the 1st instance! But continue tests. sync/desync/sync/desync... Right? Now, consider this in MP, JIP. These commands are supposed to be AG EG, and they are! But what for if the modules FSMs and scripts (a bunch of them!) are not "updated" with the sync state? I never had the intended behaviors for players in MP. The player on host PC (if not dedicated) loose the supports after the 2nd sync, The other ones have disabled supports (grayed in menu, even if no sync?!,) and/or duplication of supports. 3 artillery modules, 2 drops in icons menu... regardless of the rounds limitations which is another problem). I think there is something to do with (supports) modules "on demand" synchronization, because it could be fine to add/remove these supports along with scripts, and for units (players) we want.
  19. Would it be possible to manipulate certain entities directly in the new 3D editor instead of with the init field, i.e. turning on the lights of a vehicle, sling loading a vehicle to a helicopter or adjusting the stance and behaviour of a unit etc?
  20. I know the way around destroying buildings / veg with https://community.bistudio.com/wiki/nearestObject ; However, populating an annihilated town on Altis is an issue because I haven't found a way to destroy building / veg in Eden. A workflow of destruction scripts + Zeus for object placement, export to script and then spawning after the said destruction script is known and working. But I'm looking for something Eden related because it's so much better (the dynamic item search, yeah!) than Zeus.
  21. Hi all, I am a Linux user who is new to the ARMA franchise. I have been having a crack at putting together a simple, vanilla mission whilst waiting for the game to be updated from version 1.42 to 1.54 and am wondering if someone could help me sort out a few issues I have encountered during testing. 1. I found that 2 missiles from a chopper will take down a Military Cargo Tower. I can't have that and am wondering if there is a script to make a building indestructible? 2. Is it possible to restrict the use of artillery, so the Scorcher, Sandstorm and mortars are not available? 3. AA units that I have placed on the side of a mountain do not change weapon and fire when an enemy chopper flies past. Is there a script that forces them to use the AA missile launcher as their primary weapon AND actually fire it when an enemy air unit flies into range? 4. I have a speedboat on patrol and would like it to refuel/re-arm when the patrol is complete. I am having difficulty in getting the boat to manouver alongside the pier where I have a Taru fuel pod and 2 boxes of vehicle ammo stationed using the "move" waypoint. ( I could probably get it so that it works with more tweaking and previewing but am hoping that there is an easier way or some kind of "refuel" option). 5. Finally, could someone please tell me if the mission I am creating using version 1.42 is going to transfer successfully to version 1.54 when my version of the game is updated? Thanks for any assistance that can be provided.
  22. Hello BIS Forums, I am working on a mission which involves a cool chase scene, and to put in a "randomness" factor, I have recorded 3 different paths the AI can take. The paths work, but for some reason, the script I am using to choose the random path isn't really working. Here it is: _poi = _this select 0; _randomMovement = ["pursuitPath1","pursuitPath2","pursuitPath3"]; _dataPath = _randomMovement call BIS_fnc_selectRandom; hint format ["The path will be: %1",_dataPath]; sleep 0.5; // The script works up until here.. if (_dataPath == pursuitPath1) then { hint "good"; _pursuit1 = [_poi] execVM "path\play.sqf"; // play, play3 and play4 are the files that make the AI follow the path, they all work when I execute them through the debug console or by trigger. waitUntil {scriptDone _pursuit1}; terminate _pursuit1; }; if (_dataPath == pursuitPath2) then { hint "bueno"; _pursuit2 = [_poi] execVM "path\play3.sqf"; waitUntil {scriptDone _pursuit2}; terminate _pursuit2; }; if (_dataPath == pursuitPath3) then { hint "gut"; _pursuit3 = [_poi] execVM "path\play4.sqf"; waitUntil {scriptDone _pursuit3}; terminate _pursuit3; }; I am still learning the basics and everything there is to scripting, so bear with me if I made a simple error. I believe it has to do with the condition with the if statement, however, I am not sure what to do and google has failed me in this endeavor. If there is any help you all can offer it will be greatly appreciated! Thanks all : )
  23. Hello all, So I have been working on this mission for some time now, and at one point, I want this hint to come up and tell the player information regarding the objective. The player essentially has to chase a POI for a period of time. If the player gets a certain distance away from the POI, the mission fails (this part is already working). I would like to notify the player that they must keep within 50 meters, thus needing to use the hint. I looked up how to use the function BIS_fnc_advHint and found some good posts regarding the topic, such as this one. So I copied and pasted the example that darkdruid had confirmed to work and pasted this into my description.ext on an empty mission: class CfgHints { class test1 { displayName = "thisisatest"; class test2 { arguments[] = {}; description = "test Information text"; displayName = "test Information"; tip = "test test test"; }; }; }; and then this into a radio trigger: [["test1", "test2"]] call BIS_fnc_advHint; However, I am getting the error "Hint 'CfgHints >> test1 >> test2' does not exist Does anyone have any idea why this could be the case? It should work as I directly copied and pasted it into the description.ext (to remove risk of incorrectly typing something). Another question. Is there a way to display this hint only if the player fails when chasing the target for the first time? I.e. when the chase starts, the player gets more than 50 meters away from the POI, resulting in a mission failure. They restart to their last save (it autosaves right before the chase), and then the hint will display. Thanks for any assistance you guys can offer. EDIT: Alright, I have no idea why, but it is working now. Disregard this post as I figure out how to delete this.
×