Jump to content


  • Content Count

  • Joined

  • Last visited

  • Medals

Community Reputation

3 Neutral

About Narsiph

  • Rank

Recent Profile Visitors

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

  1. Update to the main post: I figured out why there arent any errors. The script works just fine, yet only on the server. Means: It writes the data to the inidbi-db's, transfers and deletes the weapons. Yet: Not for all (jip) clients. So the problem is different. I am on it and trying to fix it. Stay crunchy.
  2. Heyho. I want to achieve, that the weapon unlock script does what it should do. Offline it does its work perfectly but i cant get it to work on the dedicated server (gameserver). Neither does it save it over inidbi (i think this problem is bound right to the rest of it not working) nor does it do its job correclty. Yet, it throws absolutely no errors oO I am finally out of clues. /* Weapon Check Script by Narsiph Call this script, if you want to check the main-box for weapons to unlock for the ACE-Arsenal. With "unlimited" you can change the amount of weapon needed. Its always +1. So if you type in 19, you actually need 20. The temporary chest is needed, because weapons that are not available to unlock, will be cycled through and put back in the main chest. Main ACE Arsenal Chest: "merc_arsenal_box" Temporary Chest for the 'check'-cycle: "Weapon_cache_temp" */ if (isServer or isDedicated) then { [] spawn { while {mercWhile} do { // Change the value (Default: 19) if you want to unlock Weapons faster/slower. unlimited = 1; /* Puts all the weapons in an local variable (classnames & amount) The array from "getWeaponCargo" looks like this: ["classname1", "classname2"],["14",""] */ _itemarray = getWeaponCargo merc_arsenal_box; // The local variable presented here, counts how many different weapons are in the box. _weaponnames = count (_itemarray select 0); // If there are, somehow, weapons in the temporary chest, they will get deleted with this. clearWeaponCargo weapon_cache_temp; // We need those variables for the database. _inidbi = ["new", "Merc Arsenal"] call OO_INIDBI; /* We decided to go with a 'for' instead a 'while'. With both you can actually achieve the same. The _loop local variable is set to zero and helps us not only to count but also to select the weapons and the amount from the array. It loops only as long as there are weapons in the array. Weaponamount is the amount of weapons from the getWeaponCargo in the second (0,1) array. Combined with the loop variable, we made sure it goes through all the weapons. Weaponname is exactly that. The string of the weapon class name. If the weapon is more than the variable 'unlimited' (default: 19), so, 20 and more, it will be added as a general usable weapon in the ace-arsenal. Else the weapon is put, temporarily, in another box. We save every unlimited weapon in the Merc Arsenal Database, under the Unlimited key. That for, we use a seperator that we can later use to make an weapon array. */ for [{_loop=0}, {_loop<_weaponnames}, {_loop=_loop+1}] do { _weaponamount = (_itemarray select 1) select _loop; _weaponname = (_itemarray select 0) select _loop; if (_weaponamount > unlimited) then { [merc_arsenal_box, [_weaponname]] call ace_arsenal_fnc_addVirtualItems; _seperator = ","; _readoldweapons = ["read", ["Merc Arsenal", "Unlimited"]] call _inidbi; _newmercweapons = _readoldweapons + _seperator + _weaponname; ["write", ["Merc Arsenal", "Unlimited", _newmercweapons]] call _inidbi; } else { weapon_cache_temp addWeaponCargo [_weaponname,_weaponamount]; }; }; // With this, we delete all the weapons in the main box. clearWeaponCargo merc_arsenal_box; // This is, more or less, the exact same thing as the for-loop before. // This time we put back all the weapons in the main box so they can be used by the mercs. _itemarray = getWeaponCargo weapon_cache_temp; _weaponnames = count (_itemarray select 0); for [{_loop=0}, {_loop<_weaponnames}, {_loop=_loop+1}] do { _weaponamount = (_itemarray select 1) select _loop; _weaponname = (_itemarray select 0) select _loop; merc_arsenal_box addWeaponCargo [_weaponname,_weaponamount]; }; }; }; } else { hint "YOU SHALL NOT SAVE!" }; This gets called over the initServer.sqf. My money-save-script works just fine and also writes its stuff down into the inidbi-db... So, i dont know where i went wrong. Maybe i oversaw something. Thanks in advance for your help. Stay crunchy.
  3. Hey, iam at ngz-server and i finally uploaded my mission to test. Offline with the 'Play in Multiplayer' over Eden-Editor, everything works out just perfect, exactly how i scriptet it. But as soon i put everything up on the gameserver, no database files are created. I tried to initialize it locally, globally, on the server, over the headless client. Not in a single case the database works. NGZ-Support Helper told me it should work, since the dll has all necessary rights, yet there was no developement update in over 2 years, maybe something does not work out anymore? Or do i miss something eventually? Where can i go to figure out whats wrong, where should i start? What files, eventually, you guys would like to see? I got very familliar with inidbi and i got the message from the support-helper that i should use extdb, since that works (His word like "We have multiple altis life servers hostet that use extdb, they work just fine"). Should i change or try to find the error? Looking forward to any help and thank you all in advance. Stay crunchy. Edit: Solved the problem, which was in the server-mods. Instead of "@inidbi2" there was "@inidb2". Looking for days for this little "i" ... horrible -.-" Everything works just fine now and every other problem is just my poor mp-scripting knowledge that gets better and better with every line of code i write :3
  4. Heyho. I tried it, maybe wrong, but it did not save properly, for me, as array. Even then, i have to put everything into a command for ace. The way i did it was, in the end, very easy and quick, actually. Any clue for me, how i can save a proper array in the inidbi and getting it back as one? To know something would help in the future i guess, maybe you can give me an example of the idea of saving and loading arrays please :3 Stay crunchy. Edit: Figured out how to save an array in inidbi ^^ Actually, i have to write the exact same amount of code to create/check/delete stuff, so in case of code-writing, there is no real advantage, yet its still awesome to learn things and how you can make use of so many stuff. Awesome. The Problem on my side was that i created the database beforehand as a empty string. To use arrays i have to initialize the specific database as array (or with nothing at all).
  5. Heya! I have a problem and yet not found any solution to this. Maybe i dont see something but here's the problem first: I create a database to save all the weapons, that i want/have in unlimited amount for the ace arsenal. And i write it down into the database like this: for [{_loop=0}, {_loop<_weaponnames}, {_loop=_loop+1}] do { _weaponamount = (_itemarray select 1) select _loop; _weaponname = (_itemarray select 0) select _loop; if (_weaponamount > unlimited) then { [merc_arsenal_box, [_weaponname]] call ace_arsenal_fnc_addVirtualItems; _seperator = ","; _readoldweapons = ["read", ["Merc Arsenal", "Unlimited"]] call _inidbi; _newmercweapons = _readoldweapons + _seperator + _weaponname; ["write", ["Merc Arsenal", "Unlimited", _newmercweapons]] call _inidbi; } else { weapon_cache_temp addWeaponCargo [_weaponname,_weaponamount]; }; }; In the ini file it is saved like this: [Merc Arsenal] Unlimited=""arifle_MXC_F,srifle_DMR_05_hex_F"" For ACE i need it like this: "weapon1","weapon2","weapon3" and so on. I cant figure out how i can achieve to save all the currently unlocked ace-arsenal unlocks, to make them completely permanent throughout the campaign. Any solution? Thanks in advance for your help. Narsiph. Edit: Problem solved with the splitString command i was not aware of :)
  6. Narsiph

    Loadout Script

    Beside of a ready to use script/mod, do you use the ace-arsenal to make the loadouts or the BI_Arsenal? Second Question: Do you want the players automatically have the items equipped? (from eden already?) If yes, you need within your "mission.Land" (example: awesomemission.Altis) a file thats named "description.ext" Put in the first line: respawnOnStart = -1; // Default: 0, -1 = no respawn on start So you dont respawn on mission start, and you pretty much start with exactly the eden-outfit. You can do it also with a respawn event, if you want, that players get their exact equipment when respawning. Then you need, within your mission-folder (mission.land, ex.: awesomemission.Altis) a file called "onPlayerRespawn.sqf" Within that file you can use something like this: // Prefab (Empty) // if (player isKindOf "unitclassname") then { // [player] execVM "scripts\loadouts\yourloadoutname.sqf"; // }; Example: // Asst. Autoriflemen (MG-Helfer) if (player isKindOf "B_soldier_AAR_F") then { [player] execVM "scripts\loadouts\stan_asstautorifle.sqf"; }; Depending on what export-function you use, it is used differently. For an example i would need the ace or bi-question solved ^^ Have a good time, stay crunchy. Narsiph.
  7. Solved. I had 'getITEMcargo' instead of getWeaponCargo :)
  8. Heya, strangely, in the weapon_cache_temp it returns always an empty array, but the weapon was cleary added into it. Here is the code: // First, check the inventory of the "merc_arsenal_box". If it has 20 of an Item, it should be deleted and added to the // general ace arsenal. unlimited = 2; // secure temporary weapons in the box "weapon_cache_temp" // If the array is needed _itemarray = getItemCargo merc_arsenal_box; // _itemarray = getWeaponCargo merc_arsenal_box; // multi array (haupt + sub) // array 0 (waffe0,waffe1) array 1 (feld 0: 12, feld 1: 3) // anzahlitems = count array 0 // a loop repeating 10 times // for [{_i=0}, {_i<anzahlitems}, {_i=_i+1}] do _weaponnames = count (_itemarray select 0); clearWeaponCargo weapon_cache_temp; for [{_loop=0}, {_loop<_weaponnames}, {_loop=_loop+1}] do { _weaponamount = (_itemarray select 1) select _loop; _weaponname = (_itemarray select 0) select _loop; if (_weaponamount > unlimited) then { [merc_arsenal_box, [_weaponname]] call ace_arsenal_fnc_addVirtualItems; } else { weapon_cache_temp addWeaponCargo [_weaponname,_weaponamount]; }; }; sleep 1; clearWeaponCargo merc_arsenal_box; sleep 1; _itemarray = getItemCargo weapon_cache_temp; hint str _itemarray; sleep 3; _weaponnames = count (_itemarray select 0); for [{_loop=0}, {_loop<_weaponnames}, {_loop=_loop+1}] do { _weaponamount = (_itemarray select 1) select _loop; hint str _weaponamount; sleep 3; _weaponname = (_itemarray select 0) select _loop; hint _weaponname; sleep 3; merc_arsenal_box addWeaponCargo [_weaponname,_weaponamount]; }; If anyone has any idea why it is happening that i get an empty array from my weapon_cache_temp, would be nice to know (the box has a weapon in it. It uses the same code as the main box to transfer its item).
  9. Hello, i am starting with scripting and have some ideas and a point where i want to start. The basics to multiplayer scripting are known to me and i made a couple scripts already for the purpose what i wanted to have (a personal arsenal for people). We are a merc-based group and we really liked antistasi but it has too many flaws for us so i decided to finally start our merc-based campaign. Now i started with my roadmap for the arsenal: 01: Check the amount of loot/equipment in a specific box (!) 02: Add the specific items in the box to an ace-arsenal (!) 03: Check if the amount of items in the ace-arsenal exceeds 20 (!) 04: Make items, that exceed the amount 20, unlimited. (!) 05: Save all the data so it can be restored after a server-restart/restart (!?) (!) = Figured it out (?) = Still trying to figure it out (!?) = I know where to look for this. I discussed it already with a friend of mine and we decided to go with the 'while' to keep on checking a specific inventor, a box, called "merc_arsenal_box", either with a onaction activation on the arsenal-box, or with a sleep timer of roughly 15 minutes or so. Thats practically not really hard either way. But the real problem i face now is, that i am able to put stuff int he ace arsenal without problems - unlimited already. Thats one of the basic functions i can go. Put things in the ace arsenal already unlimited available. And i dont have a clue how i can achive the same, but with a limited availability like 19 items of weapon x. Do i oversee something, a function as example? Or does the ace arsenal not have any method of having a limited amount of items in it? Please dont post any working code, just directions where i should look and specific snippets (Example: Look on ace arsenal framework, the function fnc_thisisit_lookhere [1,2,3,4];) Thank you all in advance for your help & time Narsiph.