Jump to content

RimBlock

Member
  • Posts

    1140
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by RimBlock

  1. Whilst it is tempting (I am also doing a A3 total conversion mod with Raymix) ... there are a number of advantages with ArmA 3;

    • A simple (if flawed) farily easy to pickup and use scripting language
    • The fact that BIS provide a wealth of in game assets which alone would take a long time to build. 

     

    Sure there is Unreal marketplace but I would be surprised if you would be able to pickup the assets players would expect to see in a Epoch SA game just from there.

  2. How about...

    _globalGroups = allGroups;
    
    {
    	_groupLeader = leader _x;
    	if !(isplayer _groupLeader) then {
    		_groupLeaderArray set [(count _groupLeaderArray), [_x, _groupLeader];
    	}; // create array of AI groups with their leader.
    } count _globalGroups;
    
    // Now you have an array of AI groups and their leaders.
    
    {
    	_playerNearby = false;
    	_groupLeader = _x select 1;
    	_AIState = _x getvariable ["Frozen",false];
    	_nearbyPlayers = _groupLeader nearEntities ["CAManBase",1250]; 
    	}
    	        if (isplayer _x) exitwith {_playerNearby = true};
    	} count _nearbyPlayers; // Check if near units are players.
    	
    	if (_playerNearby) then{
    		if !(_AIState) then {[_x select 0] call fnc_freeze};  // No player close so freeze or unfreeze
            }else{
            	if (_AIState) then {[_x select 0] call fnc_unFreeze};  // Player close so unfreeze
            };
    } count _groupLeaderArray;
    

    A few notes

    • The fnc_freeze / fnc_unfreeze functions need to be added.
    • You will need to add setvariable ["Frozen",true or false]; depending on the freeze or unfreeze in the fnc_freeze / fnc_unFreeze functions.
    • Wrap it up in a loop (while (true) do {} ;) with a uisleep to set how often it would run and spawn it on server start (server_monitor.sqf or init.sqf should work).
    • I would also add a bit of randomness in to their location when unfreezing or it will look like they were frozen having never moved from their last spotted location.
    • Whilst the AI are presumed to be local to the server, if you are running something like a headless client you would need to setup Public Variables to kick off the freeze / unfreeze scripts off on the AI Owner client machine.

    What the code 'should' do (not tested so probably has a few typos / bugs).

    • Collect a list of groups on the server.
    • Get the leader of each group
    • Check to see if the leader is a player and add the group and leader details to an array if not a player.
    • Check each leader to see if any players are within range.
    • Players in range then check if frozen and if not then unfreeze.
    • Players not in range the check frozen and if not then freeze.
  3. Clearly this is the dev teams own fault.....

     

    They should have created a sub-forum under the A3 Epoch forum called "Please change back to MySQL" and then moved all the many threads asking for this in there :) .  At least that way, anyone wanting to post another one will see the many that have gone and been ignored before :D .

  4. Looks like it could be an isue with player_build_getConfig or, more likely as it works most of the time, the actual object cfg file record.  The cfg files get all rolled up in to the config.bin.

     

    You will need to work out what you are building when it happens and then look for the config entry on the Epoch Git to see what details are provided.  You can then see what items are being searched for in that .sqf file and see if the config has all the entries.

     

    Unfortunately, modular_build is not written by myself and i have no control over the cfg file entries.

     

    Cfg files can be found on the Epoch Git here.  Most of the Epoch items are in here.

     

    Does the error actually break anything ?.

  5. Nice to see others willing to share this often elusive information.

     

    One small suggestion, now we are in ArmA 3 you may wish to look at changing to CompileFinal as it offers a lot better security by locking the functions so they cannot be overwritten by people with injectors. 

     

    One caveat is that each resulting function variable needs to be compileFinal(ed) as the command locks the variable not the contents of a .sqf file. 

     

    For example... if you have four functions in a SQF, you will have to split them in to seperate .sqf files or compileFinal them each in the single .sqf file.

     

    Nice job spreading the knowledge.

  6. It is fine but you have to PV the changed variable as it is only changed locally on the server.  The PV sends that change to the clients.
     
    //Siren publicVariable is Changed.
    DZE_siren = true; 
     
    should be 
     
    //Siren publicVariable is Changed.
    DZE_siren = true; 
    publicVariable "DCV_siren"; // Send changed variable to the clients
  7. Another question from me :) .  Will you be adding the functionality to parse classes as well (cfgmusic / cfgVehicles etc) from config.cpp / XXXXX.hpp and possibly even config.bin files (presumabily after de bin'ing them with cfgconvert in the background) ?.

     

    That would be pretty helpful as class defs are not as well known as common sqf script commands.

  8. Hi,

     

    Firstly it would be good to get your head around the Client / Server nature of multiplayer games.

     

    The Server interaction with the Clients (for scripting purposed) is generally through PublicVariables (PV) and Event Handlers.  The Server would generally use either PVC (Public Variable Client) to communicate with a single client or PV (Public Variable) to communicate with all Clients connected.  There is also a PVS (Pbulic Variable Server) for talking to the Server from a Client.  The PV is just a variable that is defined and sent.  The variables contents are the payload between the Server and the Client.

     

    On the other side, the Clients have to have an Event Handler (EH) running which Listens for a defined PV change and then performs an action (ie. call a script).  The EH can also send the variable to the called script as a script parameter.

     

    So that is the basics of Server to Client comms in scripting.  HamBeast wrote a great guide if you want more info.  Just have a quick search for it here.

     

    Back to your issue.

     

    I would setup a PV from the Server to tell the Clients to start a script which plays the sound.

     

    [server]

    • Mission start
    • Send PV to Clients

     

    [Client]

    • EH picks up change in PV
    • Start 'MissionPlaySound" script
    • Play sound.

    Now the only thing of note is that PVs are priority traffic and so using them alot could bog down other data being sent from the server to clients like object updates (positions etc) so use sparingly with small bits of data where possible.

  9.  

    Replace 

    playMusic [_nextSong, 1];

    with

    playMusic _nextSong;

     

    Shouldn't make a difference to the current issue.  It just controls the point in the track to start from (1 sec in in this case unless the track is only 1 sec long) :) .  It is not needed though unless the song should start 1 sec in (to cut out a long intro or somthing like that).

     

    @unerground2

     

    I believe the issue is that it cannot find the music tracks (as stated in the error messages).  What prefix does your pbo file have ?.  You need to use that prefix + path in the PBO file to reference the song.

     

    i.e.

     

    If your PBO has a prefix of '\music' and the files are in a music_file directory in the PBO then the reference would be '\music\music_files\song1.ogg'.

     

    What tool are you using to create the pbo file ?.

  10. Client side report is located at C:\Users\[YOUR WINDOWS LOGIN ID]\AppData\Local\Arma 3

     

    For 20 tracks, make 20 class entries like you have for sound1 etc.

     

    Then put the config entry names in to an array.

    _jukeBox = ["song1","song2"];  // etc for all 20 song names

    To select a random song

    _nextSong = _jukeBox call BIS_fnc_selectRandom; 
    playMusic [_nextSong, 1];
    

    Make sure you define the variables in a private line at the top of any scripts those variables are used in.

    Private ["_jukeBox","_nextSong"]; // include all variables you are using in the script
    
  11. Music requires a special config entry called CfgMusic.  This can be defined in the Description.ext or a config.cpp / and included .hpp file.

     

    This entry defines what name the music will be referenced as in the SQF code and where the music track is located (the track must be .ogg).

     

    You can then use the playMusic command in SQF files to play the music defined in the CfgMusic class.

     

    You could also look at the addMusicEventHandler which can be set to fire on music stop so you could have it then select another track to play.

     

    The .ogg files need to be on any client that is asked to play the as ARMA does not stream the music over the network.

  12. .

    For the record A3 Epoch Extension does has some advantages.

    ....

    My main point of contention is all the people pointing out Trader Menu is faster with Redis.

    That is because the A2 Epoch Trader Code was constantly checking the Database, while A3 Epoch Trader only checks the Database @ startup + keeps info in arma variables.

     

     

     

    Again, no-one has provided any info to show the DB (rather than the DB and then network combination) was causing the issue. Having the trader data loaded and managed locally takes out both and removed the 'world' scope of traders.

     

    Maybe the sqf and DB code sould have been improved so it was loading the deltas then rather than trying to reload the entire trader inventory when people opened the trader menu ;) .  Less data to load and less to transmit.  Maybe a trigger could have refreshed the data when a player entered the trading area (max once / minute) and only transmit changed values to clients of players in the area.  I am sure there are a number of ways it could have been inproved with a bit of focus.

     

    Apparently the Server Code is getting unobfuscated in version 0.3->0.5.

    So you could always wait + alter the server code to use MySQL Backend (Its technical not against A3 Epoch License aslong as you don't redistribute the Server Code).

    It would be nice for the license get changed to something more open-source where people would be allowed to fork the servercode on a public github for different backends.

     

     

    Some hope for people wanting to make the change then.  Presumabily distributing the code is not allowed but distributing a patch with instructions on how to apply wouldn't be ?.  Don't know and have not really got time to do anything on this anyhow.

     

    But there are some other mods in the works, some well known + some not (that may or may not get finished / released).

    With some luck Epoch Devs might get some friendly competition in the near future.

     

    Yeah, ours is moving on ... slowly.  After doing the PoC on trader guard hostility against 'naughty' players I will be looking at getting a trader market working with the DB backend.  Will see how doable it is at that point.  I have a number of ways to explore and with extDBs MySQL and ReDis ability, the two combined may work very well for this with ReDis doing what it is designed for (caching) between DB refreshes.  Probably a discussion for another time, in another thread, probably on some other forum ;) .

     

    For those reading and who may not be aware, TornDeco is the person behind extDB (*why are there still no thumbsup icons*) :D .

  13. Redis is a cache rather than a DB.  Fast in and out but less functionality as it is not needed for the job it was designed to perform.

     

    The devs decision to use ReDIs is theirs to make although using it because MySQL was not fast enough does not seem to be particularly valid especially as no one has been able / willing to show the MySQL DB backend was causing problems with A2 Epoch, for example.  Some people have provided some evidence from their experiences showing that MySQL was not a bottleneck (search for MySQL and you will find a number of threads on the subject).

     

    Now extDB supports both ReDis and MySQL, the devs could move over to using it and allow the server owners / mod makers to build up the SQL calls to enable MySQL usage.

     

    I don't expect this to happen as;

    1. It would be another level of control given over to the users rather than fixing the core of A3 Epoch as a 'Standard build' as the Dev team have stated they wanted to do.
    2. It would not add much to the end user, only make some server owners happier (easier for them to maintain with current skill sets).
    3. The Dev team have been very resistant in the past in making changes to backend storage connectivity (ie. Hiveext.dll in A2 EPoch).
    4. The mod is still in Alpha and they want to test new features rather than re-engineer the backend storage.

    Personally I feel some of these points are very valid but extDB does not open up the possibility for the ReDis and MySQL backends to be used if the Dev team wanted to take a look.

     

  14. Hi,

     

    A Plot for life does not save the ownership in the objects inventory field, it uses the Worldspace field in the DB.  I have not used any single currency mods so I am not aware of where the money is stored for that.

     

    For loading the object records and getting the ownership info you need to check the server_monitor.sqf file.  A Plot for Life is a fairly simple mod but touches lots of files.  v2.5 should be simpler to integrate as it assumes if you install it then you do not want to turn it off (ie. no 'turned on or off' checks needed) but it does not use the player_build.sqf file at all but uses the modular build system instead.  If another mod changes the saving of objects back to using the player_build.sqf file then you will need to redirect the calls to player_build.sqf over the modular_build.sqf and the sub files it calls.  The subfiles when combined together more or less make up the player_build.sqf but they have just been chopped up for faster code execution (smaller files = faster execution if the code is the same) and for ease of changing one small part and not having to redistribute the entire player_build file.

     

    They are the two things I would checkout first.

     

    Regards

  15. Zupa didn't write A Plot for Life  ;).

     

    The only changes made for A Plot for Life in player_updateGUI.sqf are right at the end to determine if the unit under the cursor is friendly to the player or not.

     

    I would not expect it to interfere with this status GUI replacement.

     

    Nice job on producing an easy to follow guide for people to use in changing the stock GUI. 

  16. Yep, these are related as well

     

    https://github.com/vbawol/DayZ-Epoch/issues/1623

     

    If people want ot help with testing then it is fairly easy to setup a server and to build the test pbo files.

     

    Current progress on the dev team side seems to be nothing for a month, someone rattles the cage then a handful of pull requests get merged then nothing for another month.

     

    Personally I am not inclined to spend much more time on Epoch 1.0.6 either doing general testing or merging in A Plot for Life as there is no real communication from the dev team.  I did it once last year for 1.0.5.2 and that went nowhere.  After recoding my mod again for 1.0.6 and fixing a number of other qwerks with some Epoch code within the building system it seems to have gone the same way.

     

    A3 Epoch is the next big thing and even a large percentage of the modders have moved over to it now with the A2 mods left as they stand.  Even the DayZEvolved splinter mod seems dead (website / forums inacessable, Git not updated since Dec).

     

    TL:Dnr - If it appears it will be a massive shock to the community ;) .

  17. Doesn't count only give a number, where as foreach allows code to be run on each?

     

    Nope.

     

    Both iterate through an array and use _x as the current array element inside the loop.

     

    forEach allows a second special variable called _forEachIndex which contains the index of the current array element in the loop.  Count does not have this special vairiable but runs faster.  If you do not use this second special variable then they are both interchangable.

  18. Looks promising.  

     

    Does it allow for auto update for files (i.e. it will continually load logfiles that are being updated) with the option to pause updating ?.  That would be good to have.  Notepad++ does it but it could be better implemented.

     

    Also, the ability to change the highlighting colours from within the program would be good.  Light green on a white background is not so tired eye friendly for example.

     

    Very interested in the additional feature so will keep a close eye on the progress.

     

    Would also be good to pick out syntax errors like a ");" on a line on its own (ie mistype of "};" ) and things like that that can take quite a while and a lot of squinting to discover.  A parse for possible syntax errors option (sorta like a spell checker) may be a nice way of doing it.  

  19. Should be pretty easy.

     

    For fuel, call update_object.sqf -> update position to save the objects fuel (via a PV).  Amend Server_monitor.sqf to read data from the fuel field on object load and if the object is of a particular class.  Just make sure the DB field is the correct Type for the data that needs to be stored.

     

    I did the same in A Plot for Life when saving the owners PlayerUID in the worldpace field of the buildable objects.

     

    Feel free to take a look at the code if it would be of any help.

×
×
  • Create New...