Jump to content

meatball

Member
  • Content Count

    734
  • Joined

  • Last visited

  • Medals

Posts posted by meatball


  1. Well, I figured it out by using the 'intrigger' function. In case anyone else is looking to do the same, simply put the following into the condition.

    {[thistrigger,_x] call bis_fnc_intrigger} count [name1,name2,name3,name4,name5] > 1;

    Where name1,name2, etc are the actual names of the trucks in the editor. I'm betting you can do the exact same thing with objects as well.

    • Like 1

  2. Awesome, thanks as always! Keep up the great work.

    Should "BTC_disable_respawn = 1;" disable the respawn button/capability for players or is it another setting? I've tried both and neither seems to actually disable players from respawning.


  3. Trying to work something out and having a bit of trouble figuring it out. Basic gist of it is this. Players are tasked with going taking over a location where there are half a dozen empty OpFor trucks. The trucks are a mix of O_Truck_02_covered_F and O_Truck_02_transport_F classes. I want the players to steal some of the trucks trucks and deliver at least two of them to another location on the map.

    I can't seem to get the end location trigger to fire when two of arrive at the end location. Any thoughts?


  4. Wanted to post my latest version of the multiplayer random weather script I'm using. _Seems_ to be working correctly player hosted or dedicated missions so far. This script will set initial weather based on a players choice in parameters (defaults to Clear), then every 15 minutes it will randomly adjust the weather a small amount and attempt to keep the server and all clients in synch. It's kludgey, but it seems to work.

    /*  
    randomWeather.sqf v 0.8
    - Multiplayer Mission Random Weather Generator
    - By Meatball
    
    Script Requirements:
    
    1) Put this code/script in a file named "randomWeather.sqf" in root mission folder.
    
    2) Create a call in init.sqf that will run for the server and all clients.
       execVM "randomWeather.sqf";
    
    3) Have the following code in the "class Params" section of your description.ext to create weather as a selectable parameter for the players.  
    
    class Params
    {
    // paramsArray[0]
       class initialWeather {
           title = "Initial Weather (Bugged/Not Working When Hosted on a Dedicated Server)";
           values[] = {1,2,3,4,5,6,7};
           texts[] = {"Clear","Overcast","Light Rain","Heavy Rain","Light Fog","Heavy Fog","Random"};
           default = 1;
       }; 
    }; 
    
    */
    
    // Initial Server Weather Setup
    
    if(isServer) then {
    
    // Set initial weather values based on parameter choice.  Make sure the # in the select below matches what # in the order of parameters (starting with 0) your initialWeather class is defined in the description.ext
    initialWeather = (paramsArray select 0);  
    switch (initialWeather) do{
       case 1: {forecastOvercast = 0;forecastRain = 0;forecastFog = 0;forecastWindE = 1;forecastWindN = 1;};            // Clear
       case 2: {forecastOvercast = .45;forecastRain = .45;forecastFog = 0;forecastWindE = 2;forecastWindN = 2;};    // Overcast
       case 3: {forecastOvercast = .70;forecastRain = .70;forecastFog = .05;forecastWindE = 3;forecastWindN = 3;};    // Light Rain
       case 4: {forecastOvercast = 1;forecastRain = 1;forecastFog = .05;forecastWindE = 4;forecastWindN = 4;};        // Heavy Rain
       case 5: {forecastOvercast = .75;forecastRain = .10;forecastFog = .30;forecastWindE = 1;forecastWindN = 1;};    // Light Fog
       case 6: {forecastOvercast = .85;forecastRain = .20;forecastFog = .50;forecastWindE = 0;forecastWindN = 0;};    // Heavy Fog
       case 7: {forecastOvercast = random(1);forecastRain = random(1);forecastFog = random(.20);forecastWindE = (random(14)-7);forecastWindN = (random(14)-7);};    // Random
    };
    
    // Set up variable to track server weather updates.
       serverWeather = 0;
    
    // Broadcast initial weather settings that were set based on parameter choice.   
       publicVariable "forecastOvercast";
       publicVariable "forecastRain";
       publicVariable "forecastFog";
       publicVariable "forecastWindE";
       publicVariable "forecastWindN";
       publicVariable "serverWeather";
    };
    
    // Server and Client weather set based on initial weather parameter values.
    
    waitUntil {!isnil "serverWeather"};
       skiptime -24;
       86400 setOvercast forecastOvercast;
       86400 setFog forecastFog;
       86400 setRain forecastRain;
       setWind [forecastWindE,forecastWindN,true];
       skipTime 24;
       simulWeatherSync;  
    
    // Debug Hint
    //hint "Initial Weather Setup";
    
    // Server Loop to create a new weather forecast every 15 minutes.    
    if(isServer) then {
       while {serverWeather >= 0} do {  // This will always be true and it will run as long as server runs.
    
    randOCorRain = random (2);  // Pick a random number between 0 and 2 to update Overcast or Rain this cycle since you can't to both.  If random value is Less than or equal to 1 Overcast will be updated this cycle, if value is greater than 1, update rain this cycle.
    
     // Configure weather settings on server to match next 15 minute weather forecast.
           900 setFog forecastFog;
           if (randOCorRain <= 1) then {
           900 setOvercast forecastOvercast;} else {
           900 setRain forecastRain;};
           sleep 900;
           setWind [forecastWindE,forecastWindN,true];
    
    // Create random numbers for next forecast.
       _randOvercast = (round((random(0.2)-0.1)*100))/100;
       _randRain = (round((random(0.2)-0.1)*100))/100;
       _randFog = (round((random(0.1)-0.05)*100))/100;
       _randWindE = (round((random(1)-0.5)*100))/100;
       _randWindN = (round((random(1)-0.5)*100))/100;
    
    // Create next random overcast level and keep it between 0 and 1
       forecastOvercast = forecastOvercast + _randOvercast;
       if (forecastOvercast > 1) then {forecastOvercast = forecastOvercast - (2*_randOvercast)};
       if (forecastOvercast < 0) then {forecastOvercast = forecastOvercast + (abs(2*_randOvercast))};
    
    // Create next random rain level and keep it between 0 and 1
       forecastRain = forecastRain + _randRain;
       if (forecastRain > 1) then {forecastRain = forecastRain - (2*_randRain)};
       if (forecastRain < 0) then {forecastRain = forecastRain + (abs(2*_randRain))};
    
    // Create next random fog level and keep between 0 and 0.5
       forecastFog = forecastFog + _randFog;
       if (forecastFog > 0.5) then {forecastFog = forecastFog - (2*_randFog)};
       if (forecastFog < 0) then {forecastFog = forecastFog + (abs(2*_randFog))};
    
    // Create next random E-W Wind level and keep between -10 and 10
       forecastWindE = forecastWindE + _randWindE;
       if (forecastWindE > 10) then {forecastWindE = forecastWindE - (2*_randWindE)};
       if (forecastWindE < -10) then {forecastWindE = forecastWindE + (abs(2*_randWindE))};
    
    // Create next random N-S Wind level and keep between -10 and 10
       forecastWindN = forecastWindN + _randWindN;
       if (forecastWindN > 10) then {forecastWindN = forecastWindN - (2*_randWindN)};
       if (forecastWindN < -10) then {forecastWindN = forecastWindN + (abs(2*_randWindN))};
    
    // Increment variable to track updates to server weather
       serverWeather = serverWeather + 1;
    
    // Debug Hint - Show Current and Forecast Overcast, Humidity, Fog and Wind Levels on the Server.
    // hint format ["Updating Server Forecast # %1 CO: %2 | CH: %3 | CR: %4 | CF: %5 |CW: %6 | FO: %7 | FH: %8 | FR: %9 | FF: %10 | FW: %11,%12 | OCorRain: %13",serverWeather,Overcast,Humidity,Rain,Fog,wind,forecastOvercast,forecastHumidity,forecastRain,forecastFog,forecastWindE,forecastWindN,randOCorRain];
    
    // Broadcast server weather forecast information to clients.
       publicVariable "forecastOvercast";
       publicVariable "forecastRain";
       publicVariable "forecastFog";
       publicVariable "forecastWindE";
       publicVariable "forecastWindN";
       publicVariable "serverWeather";
       publicVariable "randOCorRain";
       };
    };
    
    if (!isServer) then {
    // Client Weather forecast loop.
    
    // Set up counter on client to compare local client weather serverWeather counter.
       clientWeather = 0;
    
    // Run a continuous loop on the client to look for updated weather values from the server every 10 seconds.
       while {clientWeather >= 0} do {
           sleep 10;
    
        // If client Weather is older than the server weather, set client 15 minute weather forecast to match server.
           if (clientWeather < serverWeather) then {
    
        // Set clientWeather counter to match serverWeather counter so local client weather will not update until next server weather update.
           clientWeather = clientWeather + 1;
    
        // Debug Hint - Show Current and Forecast Overcast, Humidity, Fog and Wind Levels on the Client
        // hint format ["Updated Client Forecast # %1 - CO: %2 | CH: %3 | CR: %4 | CF: %5 |CW: %6 | FO: %7 | FH: %8 | FR: %9 | FF: %10 | FW: %11,%12 | OCorRain: %13",clientWeather,Overcast,Humidity,Rain,Fog,wind,forecastOvercast,forecastHumidity,forecastRain,forecastFog,forecastWindE,forecastWindN,randOCorRain];
    
        // Set 15 minute forecast for the client.
           900 setFog forecastFog;
    	if (randOCorRain <= 1) then {
           900 setOvercast forecastOvercast;} else {
           900 setRain forecastRain;};
           sleep 900;
           setWind [forecastWindE,forecastWindN,true];
           };
       };
    };  
    


  5. New Release! v 1.1

    - Steam Workshop Link: Static Loop v 1.1

    - Armaholic Link (Thanks Big!): Static Loop

    Change Log

    - Tested and working with Arma III Official v 1.04.111668

    - BI changed the amount of damage that towers can take. Instead of all towers taking 1 explosive charge to destroy, larger towers now take 3-4 explosive charges and smaller towers take 2-3 charges to knock down. Added lots of extra ammo/explosive crates to the map, so keep your eyes peeled.

    - Weather and Time of day are now set to "Random" by default. They can be changed with the Parameters available at mission start.

    - Tweaked weather script. Appears to be working correctly for both dedicated server and player hosted missions.

    - Removed SLP Spawn Script as it was no longer needed.

    Known Issues

    - None

    General Release Notes

    - If you were subscribing to the Steam Workshop version, you will need to resubscribe. Needed to change a few things, so it's been uploaded as a new mission.

    - I double checked everything with the new patch and with a few tweaks, I had no issues.

    - @Spectro, I tested a good amount, but never ran into the BodyRagdoll issue you saw. Maybe something off in DEV? Be interested to see if it's still an issue for you.

    - I will not be supporting the mission in the DEV branch since that changes so frequently and can cause a lot of issues.

    - I do have a new mission in the works :) so there will likely not be any new updates to Static Loop unless a patch comes out that breaks it.

    Enjoy, and as usual, let me know if you notice any issues!


  6. I think I figured it out. I needed to put quotation marks around the task name for some reason when it's in a trigger ON ACT. box, and when it's in script, you don't need the quotation marks.

    This works for triggers:

    nul = ["taskname","succeeded"] call SHK_Taskmaster_upd;

    Yet to test it out in MP yet though.


  7. Yeah, it is, was really just an example. Wondering what's the cleanest way to handle a mission with a lot of tasks that the players don't have to finish in any specific order.

    Can the

    [[taskname,"Succeeded"],"SHK_Taskmaster_upd",false] spawn BIS_fnc_MP;

    be called in a trigger's 'On Act." field? Seem to be having issues getting that to fire with a simple trigger watching for an object to blow up.


  8. _task = _this select 3;
    [[_task,"succeeded"],"SHK_Taskmaster_upd",false] spawn BIS_fnc_MP;
    

    The syntax appears to at least be working right as it runs and updates the task for me. I'll test it with some MP this evening. Thanks!

    ---------- Post added at 11:56 ---------- Previous post was at 11:35 ----------

    One quick followup question as well. Does anyone know if with the script or any BIS commands if there's any way to organize/format the tasks in the Briefing? For example, in a mission with 100 or so unrelated tasks, is there any way to group them together in any way so they don't all just show up in a huge list of 100 tasks? For example, Create four directional 'headings' for the tasks breaking them by what portion of the map the tasks are located. So, if there are 25 in each area when you open up the tasks you just see the four headings, N, S, E, W and then if you click on any of the headings it breaks out the tasks in that heading/area?


  9. Alright, so started using this, and I love it. Thanks a ton Shuko!

    Did have one question. If I set up a task for something simple like gathering intel and then using an object with an addaction, I'm having issues with the updating of the task. So, in my init I have the following:

        [[
         ["task_1","Search for Intel","Search for enemy intel at the small village."],
        ],[
         ["Note1","Hello West",WEST],
         ["Credits","<br />Made by: Shuko of LDD Kyllikki<br />Contact: shuko@Quakenet<br />www.kyllikki.fi"]
       ]] execvm "shk_taskmaster.sqf";
    

    Everyone sees the Task as well as the briefing info without a problem. I then drop an object at the location with the following in it's initialization field:

    this allowdamage false;this addaction ["Gather Intel","gatherIntel.sqf","task_1",1,true,true,"","_this distance _target < 3"];
    

    Everyone can see the "Gather Intel" option when they are within 3 meters of the object and can trigger it.

    Finally, I have a simple script called "gatherIntel.sqf" in my root folder that's just this:

    _task = _this select 3;
    [_task,"succeeded"] call SHK_Taskmaster_upd;
    

    Seems to work with the caveat that only the person that is the host/server seems to be able to actually run that call because the update will only happen when that person does the addaction. Any thoughts?


  10. Due to the amount of changes with the DEV version, I don't test or try to keep the mission up to date with the DEV version. My guess is it's probably something related to the BTC Revive script. When the new official patch hits later in the week I'll test the mission again and try to fix anything that has popped up.


  11. O-M-G. Thanks for the info... BTW, in your last example, does it rain initially? Because see above last example of mine, with overcast/rain set to 1 it does not rain when I use a 86400 transition...

    It does, but it won't start immediately, but it should start raining relatively quickly (depending on your overcast/rain settings)

    ---------- Post added at 20:28 ---------- Previous post was at 20:17 ----------

    in no case in my script have i required (or used) simulWeatherSync, maybe it might be useful to address some observable unsync issues i mention (raining - no cloud coverage | sun light dimmed - no cloud coverage), but i haven't tried.

    The only place I've found simulWeatherSync to help is on loading the initial weather/script. And it definitely is required. If you start a mission with the following script:

    skiptime -24;86400 setOvercast 1;skipTime 24;

    You will get a dark dark sky, little sun, but not a cloud in the sky. As soon as you add the simulWeatherSynch; under the last skiptime the sky starts dark, little sun, and loaded with clouds.


  12. Here's the main issue. When you have a mission in the editor and export it you will actually see both missions in the mission list. The white one is the export .pbo that takes all the mission files/folders and compresses them into one file, the blue one is the full mission/editor with all the individual files/folders. The problem is, when you hit 'preview' in the edit mode, for some crazy reason, it doesn't load the 'blue' full file/folder version, it loads the pbo. So you're edits are there, but you're loading the older mission from the pbo.

    I've submitted a bug report on it if you want to go vote it up. In the meantime, the only workaround is to delete the .pbo so the preview button loads the right one, or exit out of the editor and manually launch the 'blue' mission from the mission list.


  13. Figured out a few things, but still experimenting.

    First, @tortu is right and simulWeathSync seems to do the trick and fix the problem with the mission start not having the correct cloud volume to match the overcast level. This block for starting weather seems to have cleared up the issues with that for me.

    // Set up starting weather on server and all clients using initial weather values.
    waitUntil {!isnil "serverWeather"};
    skiptime -24;
    86400 setOvercast forecastOvercast;
    86400 setFog forecastFog;
    86400 setRain forecastRain;
    setWind [forecastWindE,forecastWindN,true];
    skipTime 24;
    simulWeatherSync;
    

    Second, I've figured out that the new weather still has the old restriction that you can't do a setOvercast and a setFog at the same time. Ceeeb's comment from the setOvercast biki still seems to be accurate, "Only one script command induced weather change (either setOvercast or setFog) can be happening at a time. Starting a new weather change will immediately halt the current weather change. SetRain changes are independent and can occur simultaneously to a weather change. "

    I know Enigma had that built into his old Dynamic weather script and I'll have to mess around with figuring out a better way to set server weather and push the changes to clients while not doing setOvercast and setFog changes at the same time.


  14. 1. The HINT box that pops up every 10 minutes works fine for the normal weather. But the "forecast" values were always "any". So there was never a forecast. (forecastOvercast,forecastHumidity,forecastRain,forecastFog,forecastWindE,forecastWindN)

    I think that's because you've got the parameters configured incorrectly. See my response to your third question below.

    2. Also, with the wind, you never addressed the TWO values. I'm confused on how anyone is supposed to use two values.

    I define the N/S and E/W winds in the paramsArray select and then run random values off those. You only need one value for N/S and one for E/W because the engine allows you to use positive and negative numbers. For example, a positive forecastWindN will blow to the North, where a negative forecastWindN will blow to the south. Review the setWind biki info for more details.

    3. And as for the setup. Most of us don't know what a "params" are. I copied the below exactly into the description.ext file. But, the first line is commented-out though. So can the line still work in a description.ext file? Little confused. What is the 5 for? I just set it to 7 ( // paramsArray[7] ) and then set the default also to 7 ( default = 7; ) for random weather. I'm guessing I'm still setting this up wrong maybe?

    That's not how parameters work. I may not be able to explain it well and there's probably better info out there, but in your description.ext file you code in selectable Parameters that the players can select from the unit selection screen. You set up a 'class' called 'Params' that is just an array of values. Each parameter option has values that can be chosen (and a default value) and the chosen value gets places in the Params array. Then you can grab that value for each specific parameter by selecting the correct value out of the 'paramsArray'.

    I know, confusing. But in my case, I have 6 selectable parameters in my description.ext. The first parameter's value gets stuck in the array at slot 0, the second parameter gets put in the array at slot 1, etc. My Weather parameter you listed above is actually the sixth parameter in my code block, so I have to select number 5 out of the array to get that value and pump that into the weather code.

    If you have no other parameters, that number would be 0 and you'd need the following code block in your description.ext:

    class Params
    {
    // paramsArray[0]
          class initialWeather {
             title = "Initial Weather (Work in Progress - Cloud cover not working correctly on mission start.)";
             values[] = {1,2,3,4,5,6,7};
             texts[] = {"Clear","Overcast","Light Rain","Heavy Rain","Light Fog","Heavy Fog","Random"};
             default = 1;
          }; 
    };
    

    Then in the randomWeather.sqf just change the:

    initialWeather = (paramsArray select 5);

    to

    initialWeather = (paramsArray select 0);

    That's probably why you had problem number one. randomWeather.sqf was trying to pull information from an array that either didn't exist, or didn't have enough values.

    If you don't want the players to have any options and always want the weather to be random, just don't put anything in description.ext and change the randomWeather.sqf to just set the default values to the random ones.

    Change this block:

    if(isServer) then {
    // Make sure the # in the select below matches what # in the order of parameters your initialWeather class is in the description.ext
    initialWeather = (paramsArray select 5);  
    switch (initialWeather) do{
    case 1: {forecastOvercast = 0;forecastRain = 0;forecastFog = 0;forecastWindE = 1;forecastWindN = 1;};			// Clear
    case 2: {forecastOvercast = .45;forecastRain = .45;forecastFog = 0;forecastWindE = 2;forecastWindN = 2;};	// Overcast
    case 3: {forecastOvercast = .70;forecastRain = .70;forecastFog = .05;forecastWindE = 3;forecastWindN = 3;};	// Light Rain
    case 4: {forecastOvercast = 1;forecastRain = 1;forecastFog = .05;forecastWindE = 4;forecastWindN = 4;};		// Heavy Rain
    case 5: {forecastOvercast = .75;forecastRain = .10;forecastFog = .30;forecastWindE = 1;forecastWindN = 1;};	// Light Fog
    case 6: {forecastOvercast = .85;forecastRain = .20;forecastFog = .50;forecastWindE = 0;forecastWindN = 0;};	// Heavy Fog
    case 7: {forecastOvercast = random(1);forecastRain = random(1);forecastFog = random(.20);forecastWindE = (random(14)-7);forecastWindN = (random(14)-7);};	// Random
    };
    

    To this:

    if(isServer) then {
        forecastOvercast = random(1);
        forecastRain = random(1);
        forecastFog = random(.20);
        forecastWindE = (random(14)-7);
        forecastWindN = (random(14)-7);
    };
    

    ---------- Post added at 16:34 ---------- Previous post was at 16:26 ----------

    There's so much strange things going on, I am kinda resigning. All the ideas I had do not really work. It seems the first argument in setFog etc. (the transition time) is heavily b0rked as well.

    Yep, I'm somewhat in the same place as well. At this point I don't think there is any way to fix the cloud coverage issue until BI fixes the problem or changes something with a patch.


  15. You can get around the delay for overcast using skipTime.

    skipTime -24;
    86400 setOvercast 1;
    skipTime 24;
    

    While that will boost overcast up to 1, it unfortunately still has no immediate affect on cloud cover. To me, that's not as big of a deal, as I have that in my script. The only problem I can't get around this point is forcing a set cloud level on mission start based on scripting in any way. You can do it with the intel Overcast slider, which leads me to believe there's a command hiding/function somewhere or not available to us, but you cannot do it with scripting. What really makes things more confusing is if you script a mission to start with full overcast, it'll start with overCast 1, but no clouds. Yet if you exit/save, go back out to the unit selection screen and pick another unit and come back in, you have full overcast and cloud cover.


  16. When I used Random, the forecast for all variables was "any" (unless I set it up wrong).

    Normally when you see 'any' pop up for the variable that's because it's not defined on that client/machine. Those should all be defined on both clients/servers as the mission starts but maybe the variables are getting called at some point before they're being defined/broadcast. How are you calling those variables?

×