Jump to content

seed

Member
  • Content Count

    26
  • Joined

  • Last visited

  • Medals

Community Reputation

11 Good

About seed

  • Rank
    Private First Class

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hello dreadentity. Yes i am still interested and i will definitely try out the Inhabited World. Due to a personal family matter currently i am unable to test "inhabited-World". But as i said i have interest and will definitely test it out. Regards Seed
  2. Thanks you very much for your explanation and help Nikander. Now it works as its supposed to work. So if i understand correctly you simply created a "variable" that stores the empty "_array" that it gets populated with the usage of "_x" that in turn passes the items from the "second function" to the created object from the "first function". Right ? I will make sure to note that for future references. Interesting to say at least the usage of functions. Again thank you all very much. For those that intersted here is the whole function. Seed_fn_Haus1 = { private "_array"; _array = []; _Haus1 = nearestObjects [getPosATL _gamelogic, ["Land_HouseV_1I4"], _radius]; { //Create objects on haustype _obj1 = createVehicle ["Land_PlasticCase_01_large_F", (_x modelToWorld [-4.5,-3,-1]), [], 0, "CAN_COLLIDE"]; _obj1 setDir (getDir _x - 180); _array pushback _obj1; _obj2 = createVehicle ["Land_Chest_EP1", (_x modelToWorld [-2,-1,-2.5]), [], 0, "CAN_COLLIDE"]; _obj2 setDir (getDir _x - 90); _array pushback _obj2; } forEach _Haus1; _array }; missionNamespace setVariable ["myobjects", call Seed_fn_Haus1]; Seed_fn_loop1 = { _lootChoiceM = _Loot_Medical call BIS_fnc_selectRandom; _lootChoiceF = _Loot_Food call BIS_fnc_selectRandom; _lootChoiceD = _Loot_Drink call BIS_fnc_selectRandom; { //defince chance for loot if ( random 100 > _Loot_Chance_Medical ) then { //Clear cargo of _obj1 clearItemCargoGlobal _x; //Add item to _obj1 _x addItemCargoGlobal [_lootChoiceM, 1]; }; if ( random 100 > _Loot_Chance_Food ) then { //Clear cargo of _obj1 clearItemCargoGlobal _x; //Add item to _obj1 _x addItemCargoGlobal [_lootChoiceF, 1]; }; if ( random 100 > _Loot_Chance_Water ) then { //Clear cargo of _obj1 clearItemCargoGlobal _x; //Add item to _obj1 _x addItemCargoGlobal [_lootChoiceD, 1]; }; } forEach _this; }; while {true} do { myobjects call Seed_fn_loop1; sleep 300; }; One problem less from my list. Regards Seed
  3. Thank you all for your help sofar. After spending some frustrating time as there was some conflicts with other stuff, i decided to split the function as suggested. Here is what i have sofar. //First Function to place the objects in building(Runs only once) Seed_fn_Haus1 = { //Search for a specific haustype on map. _Haus1 = nearestObjects [getPosATL _gamelogic, ["Land_HouseV_1I4"], _radius]; { //Create objects on haustype _obj1 = createVehicle ["Land_PlasticCase_01_large_F", (_x modelToWorld [-4.5,-3,-1]), [], 0, "CAN_COLLIDE"]; _obj1 setDir (getDir _x - 180); _obj2 = createVehicle ["Land_Chest_EP1", (_x modelToWorld [-2,-1,-2.5]), [], 0, "CAN_COLLIDE"]; _obj2 setDir (getDir _x - 90); }forEach _Haus1; //run for every haus found on map. }; call Seed_fn_Haus1; //Loop Function for adding items. Seed_fn_loop1 = { _lootChoiceM = _Loot_Medical call BIS_fnc_selectRandom; _lootChoiceF = _Loot_Food call BIS_fnc_selectRandom; _lootChoiceD = _Loot_Drink call BIS_fnc_selectRandom; //Debug Hint to check if the selection working hint format ["Objects: %1 %2 %3",_lootChoiceM, _lootChoiceF, _lootChoiceD ]; //defince chance for loot if ( random 100 > _Loot_Chance_Medical ) then { //Clear cargo of _obj1 clearItemCargoGlobal _obj1; //Add item to _obj1 _obj1 addItemCargoGlobal [_lootChoiceM, 1]; }; if ( random 100 > _Loot_Chance_Food ) then { //Clear cargo of _obj1 clearItemCargoGlobal _obj1; //Add item to _obj1 _obj1 addItemCargoGlobal [_lootChoiceF, 1]; }; if ( random 100 > _Loot_Chance_Water ) then { //Clear cargo of _obj1 clearItemCargoGlobal _obj1; //Add item to _obj1 _obj1 addItemCargoGlobal [_lootChoiceD, 1]; }; }; //Loop that refreshes every 300 seconds while{true} do { call Seed_fn_loop1; sleep 300; }; The above runs as it supposed and also displays the "Debug Hint" once at the "start" and every 300 seconds.. The problem is that it doesnt add any items at all to "_obj1". I am supposing that the problem is the "_obj1" from the second function as it does not knows where to place the objects.. If that is the case then how can i add "items" in the "_obj1" defined on the first function from the loop function. Regards Seed
  4. Hello everyone. As the title suggests need some help with a function. For my current mission that i am creating i wanted to implement a "loot" system that the "loot" refreshes every x seconds.The function that i have written works fine as been executed once at the start of the mission. _Loot_Chance_Medical = 40; //Chance for medical _Loot_Chance_Food = 45; //Chance for food _Loot_Chance_Drink = 50; //Chance for drink _gamelogic = CENTER; _radius = 15000; Seed_fn_Haus1 = { //Search for a specific haustype on map. _Haus1 = nearestObjects [getPosATL _gamelogic, ["Land_HouseV_1I4"], _radius]; { //Create objects on haustype _obj1 = createVehicle ["Land_PlasticCase_01_large_F", (_x modelToWorld [-4.5,-3,-1]), [], 0, "CAN_COLLIDE"]; _obj1 setDir (getDir _x - 180); _obj2 = createVehicle ["Land_Chest_EP1", (_x modelToWorld [-2,-1,-2.5]), [], 0, "CAN_COLLIDE"]; _obj2 setDir (getDir _x - 90); //Select Random loot from array _lootChoiceM = _Loot_Medical call BIS_fnc_selectRandom; _lootChoiceF = _Loot_Food call BIS_fnc_selectRandom; _lootChoiceD = _Loot_Drink call BIS_fnc_selectRandom; //defince chance for medical loot in object if ( random 100 > _Loot_Chance_Medical ) then { //add loot "medical" to object _obj1 addItemCargoGlobal [_lootChoiceM, 1]; }; //define chance for food loot in object if ( random 100 > _Loot_Chance_Food ) then { // add loot "food" to object _obj1 addItemCargoGlobal [_lootChoiceF, 1]; }; //define chance for drink in object if ( random 100 > _Loot_Chance_Drink ) then { //add loot "drink" to object _obj1 addItemCargoGlobal [_lootChoiceD, 1]; }; }forEach _Haus1; //run for every haus found on map. }; //calling the function call Seed_fn_Haus1; How can i insert on the above a "loop" that refreshes the "loot" every x seconds ? Regards Seed
  5. Thank you very much dreadedentity. I will try your mission when i am home. If i have any questions concerning your mission and your scripts i will ask it here. In the meantime wishing you good luck with your other project that your are busy. Regards Seed
  6. Hello everyone, i have couple of questions and i hope soemone can help me out, or point me at the right direction. 1. I am working on a mission and i simply want to fill the "buildings" with Objects so they doesn´t look empty. For my first try i used the following code : private["_gamelogic","_radius","_garageComposition","_vehArray","_class","_rack","_plasticContainer","_bench","_container","_can","_cargo"]; //Vehicle List of wrecks to be spawned _vehArray = ["Land_Wreck_Car_F","Land_Wreck_Car2_F","Land_Wreck_Car3_F","Land_Wreck_CarDismantled_F","Land_Wreck_Offroad_F","Land_Wreck_Skodovka_F","Land_Wreck_UAZ_F","Land_Wreck_Van_F"]; _gamelogic = CENTER; _radius = 10000; //Search for garage in 10000 radius from center _garageComposition = nearestObjects [getPosATL _gamelogic, ["Land_i_Garage_V1_F"], _radius]; { _class = _vehArray call BIS_fnc_selectRandom; _veh = createVehicle [_class, (_x modelToWorld [0, 0, 0]), [], 0, "CAN_COLLIDE"]; _veh setDir (getDir _x - 90); _container = createVehicle ["Land_PlasticCase_01_large_F", (_x modelToWorld [4.6,0,0]), [], 0, "CAN_COLLIDE"]; _container setDir (direction _x); _bench = createVehicle ["Land_Workbench_01_F", (_x modelToWorld [1.90198,-2.20996,0.881145]), [], 0, "CAN_COLLIDE"]; _bench setDir (getDir _x - 180); _rack = createVehicle ["Land_Metal_wooden_rack_F", (_x modelToWorld [4.5,-2.3,0.881145]), [], 0, "CAN_COLLIDE"]; _rack setDir (direction _x); _can = createVehicle ["Land_GarbageBarrel_01_F", (_x modelToWorld [-3.5,2.5,0]), [], 0, "CAN_COLLIDE"]; _can setDir (direction _x); }forEach _garageComposition; The above code does what i want, but it spawns the objects after the player been spawned. Ideally i would have it spawn the objects before the player spawns. With that in mind my question is : How can i write the above code so it will preload (if that is possible)? I have seen some people using "PreProcessfile" or something similar.. Is it possible to use the above as "PreProcess" file ? 2. I have created a composition of items inside a building. The code is the following : /* Grab data: World: Bornholm Anchor position: [1688.09, 7390.2] Area size: 10 Using orientation of objects: no */ house1 = [ ["Land_Rack_F",[-1.11157,-0.358398,-0.0249062],309.941,1,0,[],"","",true,false], ["Fridge_01_open_F",[1.59033,0.330566,-0.0249386],308.992,1,0,[],"","",true,false], ["MapBoard_altis_F",[3.41943,2.30518,-0.0272217],354.627,1,0,[],"","",true,false], ["Land_ChairWood_F",[-3.61426,3.11084,0.530003],39.7183,1,0,[],"","",true,false], ["Land_WoodenTable_large_F",[-4.04749,2.58594,-0.00531006],309.559,1,0,[],"","",true,false], ["Land_WaterCooler_01_old_F",[3.94861,-4.57568,-0.0248737],164.321,1,0,[],"","",true,false], ["Land_OfficeCabinet_01_F",[5.15283,-3.31543,-0.0249634],130.005,1,0,[],"","",true,false], ["Land_OfficeCabinet_01_F",[5.7843,-2.56689,-0.0249214],130.113,1,0,[],"","",true,false], ["OfficeTable_01_old_F",[6.67444,-1.33838,-0.025013],130.018,1,0,[],"","",true,false] ]; How can i use the ObjectGrabber items position, to place then in all the "buildings" of the same type.? The reason for asking is that because it will save me time to simply copy and paste the composition on the "buildings" of the same time. Right now i am simply spawning and despawing objects in order to find their positions. I hope that you can understand my question even though my english is not so good. Regards Seed
  7. Here are couple links that can help you out. The first link contains an actual example of a progress bar made by Ranwer135 1. https://forums.bistudio.com/topic/183514-is-custom-gui-element-creation-possible/?hl=progress#entry2896366 The second link is all about dialogs and stuff, made by Iceman77 2. https://forums.bistudio.com/topic/136734-dialog-tutorial-for-noobs-by-a-noob/ Hope those two links can help you out. Regards Seed
  8. Hello forum, As my understanding from scripting is minimal i would like to ask a help for a problem of mine. I would appreciate any kind of help or hint. (Sorry my bad English) For a MP - Mission that i am creating i decided to include a temperature influence on players. The parameters are defined on Description.ext. class Params { class Daytime { title = "Daytime"; texts[] = {"Morning","Day","Evening","Night"}; values[] = {6,12,18,0}; default = 12; function = "BIS_fnc_paramDaytime"; // (Optional) Function called when player joins, selected value is passed as an argument isGlobal = 1; // (Optional) 1 to execute script / function locally for every player who joins, 0 to do it only on server }; class ViewDistance { title = "View distance (in metres)"; values[] = {500,1000,2000,5000}; // When 'texts' are missing, values will be displayed directly instead default = 1000; //file = "setViewDistance.sqf"; // (Optional) Script called when player joins, selected value is passed as an argument }; //Start Temperature class Temperature { title = "Temperature"; values[] = {-15,-10,-5,0,5,10,15}; default = 0; }; //Defining amount of damage the player takes if its too hot of too cold. class DamageTemp { title = "Temperature Damage"; values[] = {10,5,3,1}; default = 3; }; //How many defrees/hour the temperature changes class ChangeTemp { title = "Temperature Change"; values[] = {5,4,3,2,1}; default = 3; }; }; The questions that i have is : 1. How can i make the Temperature depending from "Daytime" parameters. Would something like the Pseudocode below work ? : _var1 = Temperature; _var 2 = Daytime; switch true do { case "Morning": { _var2 = _var1 ; }; }; 2. How can i combine in a script the temperature change/ hour with "Daytime Class". Would something like the pseudocode below do ? _var1 = ChangeTemp; _var2 = Daytime; _var3 = StartTemp; switch true do { case "Minimum": { while (true) do { if (_var2) between (6 && 12) then { _var3 + _var1 sleep 3600; }; }; 3. How can i combine the damage a player takes if the temp goes above or below the threshold defined in "StartTemp". I hope i was clear enough as to what my problem is. Regards Seed
  9. Here is thread from this forum, that might help you. https://forums.bistudio.com/topic/163142-fuel-gas-station-disable/ The thema was how to disable all gas stations. Nimrod_Z provided the solution. The script below is from the linked thread. It returns all the positions of " Land_fs_feed_F" on the map. /* put function in init file then execute with: call getFuelpumps; */ getFuelpumps = { _pos = getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition"); _blds=nearestobjects [_pos,["Land_fs_feed_F"], 20000]; _ary=[]; {_ary=_ary+[getpos _x]} foreach _blds; hint str _ary; copyToClipboard str _ary; }; Regards Seed
  10. I have some questions, which i hope you can help with. I used the addaction script. At the moment is like this menu = [ //TEST [ "<t color='#000000'> PLAYER SUBMENU</t>", {}, "", -1, false, false, "", "" ], [ //TEST 0 [ "<t color='#000000'> RANKED LOADOUTS</t>", {}, "", -1, false, false, "", "" ], [ [ "<t color='#000000'> CORPORAL</t>", { hint "CORPORAL LOADOUT" }, "", -1, false, true, "", "" ], [ "<t color='#000000'> SERGEANT</t>", { hint "SERGEANT LOADOUT" }, "", -1, false, true, "", "" ], [ "<t color='#000000'> LIEUTENANT</t>", { hint "LIEUTENANT LOADOUT" }, "", -1, false, true, "", "" ], [ "<t color='#000000'> CAPTAIN</t>", { hint "CAPTAIN LOADOUT" }, "", -1, false, true, "", "" ], [ "<t color='#000000'> MAJOR</t>", { hint "MAJOR LOADOUT" }, "", -1, false, true, "", "" ], [ "<t color='#000000'> COLONEL</t>", { hint "COLONEL LOADOUT" }, "", -1, false, true, "", "" ] ] ] ]; I have made several loadouts that corresponding to the players level. The loadout script looks like this : _unit = _this select 0; // "Remove existing items"; removeAllWeapons _unit; removeAllItems _unit; removeAllAssignedItems _unit; removeUniform _unit; removeVest _unit; removeBackpack _unit; removeHeadgear _unit; removeGoggles _unit; // "Add containers"; _unit forceAddUniform "U_I_G_Story_Protagonist_F"; _unit addVest "V_PlateCarrier_Kerry"; _unit addBackpack "B_Carryall_mcamo"; _unit addItemToBackpack "FirstAidKit"; for "_i" from 1 to 5 do {_unit addItemToBackpack "30Rnd_65x39_caseless_mag";}; for "_i" from 1 to 5 do {_unit addItemToBackpack "11Rnd_45ACP_Mag";}; _unit addHeadgear "H_Watchcap_blk"; _unit addGoggles "G_Squares_Tinted"; // "Add weapons"; _unit addWeapon "arifle_MXM_Black_F"; _unit addPrimaryWeaponItem "muzzle_snds_H"; _unit addPrimaryWeaponItem "acc_flashlight"; _unit addPrimaryWeaponItem "optic_Nightstalker"; _unit addWeapon "hgun_Pistol_heavy_01_F"; _unit addHandgunItem "muzzle_snds_acp"; _unit addHandgunItem "optic_MRD"; _unit addWeapon "Binocular"; // "Add items"; _unit linkItem "ItemCompass"; _unit linkItem "ItemWatch"; _unit linkItem "ItemRadio"; _unit linkItem "ItemMap"; The player is getting their ranks based on a level they reach. if (_level == 4) then { player setRank "CORPORAL"; _msg = format ["You've been promoted to the rank of %1.", rank player]; ["promoted",["\A3\Ui_f\data\GUI\Cfg\Ranks\corporal_gs.paa", _msg]] call BIS_fnc_showNotification; }; My question is how can i make the addactions mentioned above available only if a player reaches a specific rank ?. Is it possible to make the addaction available once the player reaches a specific rank and the player can use the addaction loadout every 600 secs? Regards Seed
  11. Not sure if i understand you correctly, but you want the player to respawn only once ? If that the case then you might be looking to "BIS_fnc_respawnTickets;". Mor information here:https://community.bistudio.com/wiki/BIS_fnc_respawnTickets [west, 5] call BIS_fnc_respawnTickets; In the example mentioned above BLUFOR has 5 respawn tickets. Also you might want to look here : https://community.bistudio.com/wiki/Arma_3_Respawn and here : https://community.bistudio.com/wiki/Event_Scripts Hope that helps regards Seed
  12. I do not know much about database stuff but it breaks because the code asks for Rank "1" and you give "text". Theoretically speaking the simplest way will be to simply create a new entry on your database and try it to display it just like you display with "rank 1". The simplest way that i know of to add a text is :https://community.bistudio.com/wiki/text. So maybe something like this ? : if (_xp >= 900) then { _rank = 4; _nextrankxp = 1300; _stxt2 = text "Private 2nd Class." }else{ if (_xp >= 600) then { _rank = 3; _nextrankxp = 900; _stxt2 = text "Sergeant First Class." }else{ if (_xp >= 300) then { _rank = 2; _nextrankxp = 600; _stxt2 = text "Staff Sergeant." }else{ _rank = 1; _nextrankxp = 300; _stxt2 = text "Army Specialist." Then you can use the same method that your are using to display "Rank 1" on your screen. But yeah, hope someone else can hop in and help you out.:) Regards Seed
  13. seed

    Fast Travel Script

    You could try placing respawnOnStart = 1; on your description.ext. Taken from this link : https://community.bistudio.com/wiki/Arma_3_Respawn Hope that helps Regards Seed
  14. Thats why i posted a link on my previous post. It explains the numbers. Taken from the link here : http://www.ofpec.com/COMREF/index.php?action=read&id=231#dynamictext . Look here https://community.bistudio.com/wiki/nil Regards Seed
  15. It seems that you are using "Custom Made" ranks and pictures. In that case what i mentioned above will not work. The code that i mentioned above will work for the standard ingame ranks that your unit has. Hence the "playerSetrank" command. Here is an example how would work with the ingame ranks. it will simply display your rank icon on the bottom right corner of your screen. 1. PlayerRank.hpp class PlayerRank { idd=60000; fadeout=0; fadein=0; duration = 86400;//24h name = "PlayerRank"; onLoad = "uiNamespace setVariable ['PlayerRank', _this select 0]"; class controls { class DisplayRank: RscPicture { idc = 1200; size = "0.02 / (getResolution select 5)"; text = ""; x = 0.888667 * safezoneW + safezoneX; y = 0.848344 * safezoneH + safezoneY; w = 0.108854 * safezoneW; h = 0.15394 * safezoneH; }; }; }; 2. Make a "Hud.sqf" and place inside disableSerialization; _rscLayer = "PlayerRank" call BIS_fnc_rscLayer; _rscLayer cutRsc["PlayerRank","PLAIN", 1, false ]; While { true } do { ((uiNamespace getVariable "PlayerRank") displayCtrl 1200) ctrlSetText format ["\A3\Ui_f\data\GUI\Cfg\Ranks\%1_gs.paa", rank player]; }; 3. On you mission init.sqf place : execVM "Hud.sqf"; On you Description.ext place the following : #include "Defines.hpp" class RscTitles { #include "PlayerRank.hpp" }; The Defines.hpp in case you wondering is the "base class" definition file which includes stuff like rscpicture and so on. The code above will work only for the standard ingame ranks. Hence "playerSetrank" command. -------------------------------------------------------------------------------------------------------------------------------------------------------------------- Honestly i never made custom ranks and pictures. I have spend couple of hours trying to find a solution to yor problem as its of interest to me also since i am newbie in sqf scripting. I think we have 2 options and both will require the "onLoad" command. The first option will be to usethe "onLoad" to cycle through the pictures. For that we will need to define many classes and the location of the pictures. In the example above the PlayerRank.hpp will look like : class PlayerRank { idd=60000; fadeout=0; fadein=0; duration = 86400;//24h name = "PlayerRank"; controls[] = {"RscPicture_1200","RscPicture_1201","RscText_1000","RscText_1001","RscText_1002","RscPicture_1202","RscPicture_1203","RscPicture_1204","RscPicture_1205","RscPicture_1206"}; onLoad = "((_this select 0) displayCtrl 1200) ctrlSetText format [""Subject: %1"", PICTURELOCATION];"; class DisplayRank: RscPicture { idc = 1200; size = "0.02 / (getResolution select 5)"; text = ""; x = 0.888667 * safezoneW + safezoneX; y = 0.848344 * safezoneH + safezoneY; w = 0.108854 * safezoneW; h = 0.15394 * safezoneH; }; ...... }; PICTURELOCATION = "\FileName\picture.paa"; The second option will be to use a function with the "onLoad" onLoad = "[_this select 0] call Player_fnc_RankPic" The question will be how the function will look like with your custom rank framework? Something like this ? Player_fnc_RankPic { switch ( player ) do { case "Private 2nd Class" : { player setVariable ["player", "Private 2nd Class", true]; ((uiNamespace getVariable "PlayerRank") displayCtrl 1200) ctrlSetText format ["Private 2nd Class.paa"] }; case "Army Specialist" : { player setVariable ["player", "Army Specialist", true]; ((uiNamespace getVariable "PlayerRank") displayCtrl 1200) ctrlSetText format ["Army Specialist.paa"] }; case "Staff Sergeant" : { player setVariable ["player", "Staff Sergeant", true]; ((uiNamespace getVariable "PlayerRank") displayCtrl 1200) ctrlSetText format ["Staff Sergeant.paa"] }; }; }; I really hope some of the script gurus will jump in and help you out as its a bit too complex for me. I am sorry that i couldn´t help you. Regards Seed
×