Jump to content

Nebulazer

Member
  • Content Count

    38
  • Joined

  • Last visited

  • Medals

Posts posted by Nebulazer


  1. Hmm, instead of making two sqf files, why not make one and put side check within that?

    That probably would be easier for making the script easier to copy to the other side, I have already done that now though and it all works, could that be used to condense the amount of files I am using or to make variables with? Can i somehow put all of the submenus into one script instead of having them all in the different sqf files like it is now like 'menuBlu', 'MG_menu', DMR_menu'...ect.


  2. I am working on a script for changing loadouts using submenus with the scroll wheel. I have it working when called off the the box that I named 'menuBlu' with this script

    this AddAction ["<t color=""#B40404"">" +"Select Gear", "Classes\menuBlu.sqf"] call BIS_fnc_MP;

    There are a lot of different file that i had to use to make the submenus as I am still learning about coding, but hopefully someone here can give me some tips to head in the right direction with this. I need to be able to recreate it for the opposite side, but right now it looks like i will have to copy every single file and change paths and 'menuBlu' to 'menuRed' for opfor's box.

    I tried doing something like this

    _myMenu = menuBlu;
    _myMenu = 1;
    //
    //
    removeAllactions player;
    player AddAction ["<t color=""#0000FF"">" +"Machine Guns", "Classes\MachineGuns\MG_menu.sqf", "", 0, false, true, "", 'player distance (getPosATL _myMenu) < 5'];
    player AddAction ["<t color=""#298A08"">" +"DMR", "Classes\DMR\DMR_menu.sqf", "", 0, false, true, "", 'player distance (getPosATL _myMenu) < 5'];
    player AddAction ["<t color=""#088A85"">" +"Pistols", "Classes\Pistols\pistolMenu.sqf", "", 0, false, true, "", 'player distance (getPosATL _myMenu) < 5'];
    player AddAction ["<t color=""#DF7401"">" +"Attachments", "Classes\Attachments\ATT_menu.sqf", "", 0, false, true, "", 'player distance (getPosATL _myMenu) < 5'];
    player AddAction ["<t color=""#A9D0F5"">" +"Extras", "Classes\Extras\extrasMenu.sqf", "", 0, false, true, "", 'player distance (getPosATL _myMenu) < 5'];

    But it did not work the same as when I have it set up with just 'menuBlu'. I am very new to variables though, so i think i am doing that completely wrong.

    Here is the Github for the script, feel free to have a look at the rest of the mission while you are there if you like. I plan on giving full credit to any other scripts creaters if i end up running a dedicated server with this mission. I also plan on using a database and level system, but the database stuff is a bit more advanced than what i can currently do.


  3. I was not able to replicate the problem you are having with CBA.

    This is because i think it has something to do with the Server.bat file i am using. I might have to wait for an official server.bat to come out or if you have one that you know works with this maybe you can help me out. I should be getting my new Vilayer server sometime tonight, but they sent me an email saying it was postponed because BI was releasing a new Dedi Server Software for them to use. Maybe DB included because of mister Dean Hall. Fingers Crossed. I would still like to have this working to know that i got it working and because i will still be using this computer as a test server.


  4. ok. so would i have to make a new folder in mission file that would be like save.sqf, load.sqf init.sqf and then an execVM in the init or is it going to be a call compile? I am a little confused between the 2, all though i do know a call compile will run it continuously and an exec only runs it once. I had a little bit of trouble trying to get iniDB running with this though, it kept telling me it couldnt find the \iniDB\init.sqf allthough i know it was in the right place unless it wasnt supposed to go in the mission file at all. Any guidance with this will be much appreciated. Thank you.


  5. So, there are two different example missions. One for Arma3 and one for Arma2. Which version of Arma are you trying to create a mission for?

    CBA is required for both examples. A development version of CBA has been posted for Arma3 and of course, CBA is widely used in Arma2.

    As mentioned before, i am doing this for Arma 3. I downloaded the CBA here http://www.armaholic.com/page.php?id=18767 and i am certain i have installed everything properly. What is that Script_macros.hpp its asking for?

    *edit* i just tried using Play withSIX downloader to get CBA but i still got the same error. I think it might be the ARMA3SERVERWASTELANDAUTO batch file i am using, but i have extensively looked through the setting on that to make sure it was all changed to work with that mission. I even get up to the "waiting for host" part of it. Is it because I am trying to run 2 instances of Arma on my computer (one as the small server text box)? Also, i can see that CBA is running because it has its Logo on the Arma 3 Home Menu. Im pretty confused. Maybe a demo without any addons? Something that will work with Wasteland (as we all know thats what we want this for). Thank You :)


  6. when i try to run this on the dedicated server batch file, it tells me that the script_macros is missing from the CBA addon and wont start. I can run it just fine on Arma 3, but i'm not sure if i can test its functionality that way. When i run it by itself, i can go up to the box and use the loadout screen but the box is black and none of the functions are working for me.

    *Edit*

    Here is exactly what it says in the error box:

    Include file x\cba\addons\main\script_macros.hpp not found.


  7. I believe i got this to work with Arma 3, but i need an example mission or a Wasteland mission with all of the necessary .sqf's. I could start trying to write one of own but i know someone must have one working already they would like to share, and im not 100% positive this is working as i have not seen it in the game in action. I do have my "arma" database in navicat, and im pretty sure i have the Database.txt set up correctly. I am positive i have everything else set up as i followed the guide on page 9 of this forum. If you would like to help me, please message me. It has been a long day learning all these new things to get this far... time to just play some wastelands. Thank you.

    *Edit*

    I forgot to mention, I did try some of the Example files and copied them to my Wasteland script, but im not sure if the option for "Random" selection collides with the DB as its different from Dayz's random spawn (yet more like origins)


  8. i also would please like help with this, Nothing about Arma2net, Arma2netMysqlPlugin, or iniDB is easy for a beginner or even an intermediate to understand. I sat there for hours looking over the instructions for a ton of different plugins and/ or addons that are able to give you Dayz-like database saving. The easiest one i found was the PersistentDB but even that was a little unclear, plus you have to run a .exe with it and it does not look like you can edit the database with it like you can with Navicat. I wish someone would write a program for running servers on Arma 3 that behaves like Dayz Control Center to simplify a lot of this as i learn about it. I would really like to get alot deeper into a project and start making mods for Arma 3 in the future, any help with this stepping stone would be appreciated. Thank you.

    *EDIT* Hey! I thought i would come back here and share this with you since i found it, I am almost done making it work. I have my SQL Server connected, and I just need to edit my mission files now.

    http://forums.bistudio.com/showthread.php?128795-Arma2MySQL/page9&highlight=arma2mysql

    Hope this helps.


  9. Right to assist the bambies that gotten same confused as i have, This is how i got mine working in the end ;

    Init.sqf

    call compile preProcessFile "\iniDB\init.sqf";
    call compile preProcessFile "Arma3functions.sqf";
    execVM "load.sqf";
    abc_LoadplayerPos = {
       private ["_loadpos"];
       _loadpos = _this select 0;
       _Profile = format["%1", getPlayerUID _loadpos];
       _Pos = [_Profile, "playerData", "position", "ARRAY"] call iniDB_read;
       _weaponadd = [_Profile, "playerData", "weapons", "ARRAY"] call iniDB_read;
    _weaponadd1 = [_Profile, "playerData", "weapons1", "STING"] call iniDB_read;
       _itemsadd = [_Profile, "playerData", "magazines", "ARRAY"] call iniDB_read;
    _vestadd = [_Profile, "playerData", "vest", "STING"] call iniDB_read;
    _uniformadd = [_Profile, "playerData", "uniform", "STING"] call iniDB_read;
    _helmetadd = [_Profile, "playerData", "headgear", "STING"] call iniDB_read;
    _loadpos setpos _Pos;
    for "_i" from 0 to (count _itemsadd) do {_loadpos addMagazine (_itemsadd select _i)};
    for "_y" from 0 to (count _weaponadd) do {_loadpos addweapon (_weaponadd select _y)};
    _loadpos addvest _vestadd;
    _loadpos adduniform _uniformadd;
    _loadpos addheadgear _helmetadd;
    hint format["%1",_pos];
       // Code goes here!
    };
    
    
    
    if(isServer) then {
    [] execVM "save.sqf";};
    

    Load.sqf

    player addbackpack "B_Bergen_sgg";
    removeallweapons player;
    removeuniform player;
    removeheadgear player;
    removevest player;
    [player] call abc_LoadplayerPosServer;

    Save.sqf

    if(isServer) then {
    while{true} do {
    {
    	if(isPlayer _x) then {
    		sleep 5;
    _Profile = format["%1", getPlayerUID _x];
    [_Profile, "playerData", "position", position _x] call iniDB_write;
    [_Profile, "playerData", "Playername", name _x] call iniDB_write;
    [_Profile, "playerData", "magazines", magazines _x] call iniDB_write;
    [_Profile, "playerData", "weapons", Weapons _x] call iniDB_write;
    [_Profile, "playerData", "weapons1", SecondaryWeapon _x] call iniDB_write;
    [_Profile, "playerData", "vest", vest _x] call iniDB_write;
    [_Profile, "playerData", "uniform", uniform _x] call iniDB_write;
    [_Profile, "playerData", "headgear", headgear _x] call iniDB_write;
    [_Profile, "playerData", "items", items _x] call iniDB_write;
    	};
    } forEach allUnits;
    }
    };
    

    and the Arma3functions - Generated file via using ASCOM Framework

    // Do not edit this file!
    // This file may only be edited by Engima's ASCOM Editor!
    //
    // <ASCOM version="1">
    // <Prefix>abc_</Prefix>
    // <Functions>
    // <Function Name="LoadplayerPos" Params="loadpos" Ret="false" A="false" C="false" S="true" O="false" OC="false" P="false" />
    // <Function Name="LoadPlayerWeapon" Params="weapon" Ret="false" A="false" C="false" S="true" O="false" OC="false" P="false" />
    // </Functions>
    // </ASCOM>
    
    ASCOM_ClientID = 0;
    ASCOM_CallID = 0;
    ASCOM_LastCallID = 0;
    ASCOM_LockCallID = 0;
    
    "abc_LoadplayerPosEventArgs" addPublicVariableEventHandler {
       private ["_array"];
    
       _array = _this select 1;
    
       _array spawn {
           if ((_this select 0 == "A") || (_this select 0 == "C" && !isDedicated)) then {
               (_this select 1) call abc_LoadplayerPos;
           };
    
           if (_this select 0 == "S" && isServer) then {
               (_this select 1) call abc_LoadplayerPos;
           };
       };
    };
    
    abc_LoadplayerPosServer = {
       if (isNil "_this") then { _this = []; };
       if (isServer) then {
           _this call abc_LoadplayerPos;
       }
       else {
           abc_LoadplayerPosEventArgs = ["S", _this];
           publicVariable "abc_LoadplayerPosEventArgs";
           abc_LoadplayerPosEventArgs = [];
       };
    };
    
    
    "abc_LoadPlayerWeaponEventArgs" addPublicVariableEventHandler {
       private ["_array"];
    
       _array = _this select 1;
    
       _array spawn {
           if ((_this select 0 == "A") || (_this select 0 == "C" && !isDedicated)) then {
               (_this select 1) call abc_LoadPlayerWeapon;
           };
    
           if (_this select 0 == "S" && isServer) then {
               (_this select 1) call abc_LoadPlayerWeapon;
           };
       };
    };
    
    abc_LoadPlayerWeaponServer = {
       if (isNil "_this") then { _this = []; };
       if (isServer) then {
           _this call abc_LoadPlayerWeapon;
       }
       else {
           abc_LoadPlayerWeaponEventArgs = ["S", _this];
           publicVariable "abc_LoadPlayerWeaponEventArgs";
           abc_LoadPlayerWeaponEventArgs = [];
       };
    };
    
    
    
    if (isServer) then {
       "ASCOM_AskForClientID" addPublicVariableEventHandler {
           private ["_unit"];
    
           _unit = _this select 1;
           ASCOM_AskForClientID = [];
           ASCOM_LastCallID = ASCOM_LastCallID + 1;
           ASCOM_ClientIDResponse = [_unit, ASCOM_LastCallID];
           publicVariable "ASCOM_ClientIDResponse";
       };
    
       ASCOM_ServerInitialized = true;
       publicVariable "ASCOM_ServerInitialized";
       ASCOM_Initialized = true;
    }
    else {
       "ASCOM_ClientIDResponse" addPublicVariableEventHandler {
           private ["_array"];
    
           _array = _this select 1;
           ASCOM_ClientIDResponse = [];
    
           if (player == (_array select 0)) then {
               ASCOM_ClientID = _array select 1;
               ASCOM_Initialized = true;
           };
       };
    
       waitUntil {!isNull player};
       ASCOM_AskForClientID = player;
       publicVariable "ASCOM_AskForClientID";
    };
    

    This works for me and players on my server to save most gear + pos,

    First, i must say thank you to the OP as the DB is the only reason i wanted a Dayz port to A3 in the first place. Second, thank you everyone who went through the trials and tribulations to find different uses for this. I am trying to use this with my wasteland server, but when i run it and load the mission file, it tells me cannot find It cannot find iniDB/init.sqf. Then it turns me into a bird and says something like "Cannot Connect to the Positioning System". Any Ideas? I am fairly new to this but i am reading everyday learning more and more from trial/error, there is just some things i cannot learn without trying it myself though no matter how much reading i do. (eventually i am not learning anything, just looking at a page) I will take any help i can get as I REALLY would like to implement this. Thank you.

×