Jump to content

Rosso777

Member
  • Content Count

    130
  • Joined

  • Last visited

  • Medals

Posts posted by Rosso777


  1. Two years late to the party but I just wanted to say that I *thoroughly* enjoyed this thread.
     

    Achilles, your comprehension articulation is a breath of fresh air; watching someone like you (who is light years ahead of me scriptually) breakdown the issues and try to piece is it together.

     

    The whole thread for me was like watching a meeting of the minds happen; names like Killzone, Dedmen, Larrow, and more are legendary in my book. You guys have managed to make Arma what it is with your own hands. The creativity that comes out through the code is so fascinating to watch; even more exciting when we’re able to experience it through the immersion that is the actual gameplay.


    Bravo and thank you all for your efforts and knowledge over the years.

    • Like 3

  2. Update: Some slight progress:

     

    Using the command "unassignItem" I have been able to remove the item from the toolbelt, but it goes straight into the player's inventory. Now I just need to figure out how to remove the item completely.

     

    [] spawn {
      while {"ItemRadio" in assignedItems player} do {

            dropRadioChance = random 1;
            if (dropRadioChance > 0.75) then {

                _unit unassignItem "ItemRadio";
                hint "You just realized you dropped your radio somewhere..."
            }

          waitUntil {
                sleep 60;
            };
        }
    };


  3. I am trying to simply create a script that allows the player to use/read SideChat ONLY when they have a radio in their inventory. I have tried this a few different ways and have had no luck yet; side chat is ALWAYS available and I cannot figure out why. Any help from the veterans is appreciated.

     

    (script placed in initPlayerLocal.sqf on a dedi server)

     

    [] spawn {
      while {true} do {

        waitUntil {"ItemRadio" in assigneditems player};
        1 enableChannel true;

        waitUntil !{"ItemRadio" in assigneditems player};
        1 enableChannel false;

      }
    };

     

     

    SOLVED: (Although this works, I know there is a more efficient way to do it with either "Take" or "Put" EventHandlers, or perhaps a function in some way. Working on that now and I will update this post once complete and tested.)

     

    (script placed in initPlayerLocal.sqf on a dedi server)

    [] spawn {
    while {true} do {
            sleep 1;
            if ("ItemRadio" in assignedItems player) then {
                1 enableChannel true;
            }
            else {
                1 enableChannel false;
            };
        };
    };

     

     


  4. SOLVED!

     

    Every 60 seconds, there is a chance for player to drop their radio (and lose it):

     

    Place this script inside the initPlayerLocal.sqf file: (tested on dedicated server)

     

    [] spawn {
      while {"ItemRadio" in assignedItems player} do {

            dropRadioChance = random 1;
            if (dropRadioChance > 0.01) then {

                player unlinkItem "ItemRadio";
            };
        };
        sleep 60;
    };

     

     

    // ORIGINAL POST //

     

    In my quest for scripting greatness, I am trying to setup a very simple script that creates a random occurrence-- the player drops their radio (for testing purposes, it's a 25% chance every 60 seconds). This is the most sensical way I could put it together, but it won't activate for some reason (No hint, no radio removal). Can anyone see why this won't go?

     

    (This script is in initPlayerLocal.sqf on a dedi server)

     


    [] spawn {
      while {"ItemRadio" in assignedItems player} do {

            dropRadioChance = random 1;
            if (dropRadioChance > 0.75) then {

                _unit removeItem "ItemRadio";
                hint "You just realized you dropped your radio somewhere..."
            }

          waitUntil {
                sleep 60;
            };
        }
    };

     

     


  5. Dedicated Private Server. I have a list of scripts run from initServer.sqf:

     

    //Server Side
    [] execVM "\server\scripts\RayakBuildings.sqf";
    [] execVM "\server\scripts\GuerBarracks.sqf";
    [] execVM "\server\scripts\persistent.sqf";

     

    The files are on run directly from the server as you can see, but I am noticing that they are "timing out". One file, for example, is used only for Hiding Objects, and after an hour or so of playtime, the script just STOPS running and I am not sure why.

     

    Has anyone else encountered this?

     


  6. 4 minutes ago, Thomas TKO said:

    why should you need a separate file? 

     


    I just have SO MANY uniforms for each type and I’d like to keep the main config file clean. 


  7. In the A3XAI (just an example) config, here is how the AI gear is listed:

     

    uniformTypes0[] = { “Exile_Uniform_BambiOverall”, “U_C_HunterBody_grn” };

     

    uniformTypes1[]= { “U_C_WorkerOveralls”, “U_C_Commoner2_2” };

     

    And each type is listed 0-3 to allow for 4 different sets of uniforms/weapons/vests, etc. 

     

    my question is: instead of listing all the items inside the brackets for each level/type, is there a way to redirect to an external file containing the information? For example:

     

    uniformTypes0[] = {

    #include “Level0Uniforms.sqf”

     };

     

    uniformTypes1[] = { 

    #include “Level1Uniforms.sqf”

     };

     

     


  8. On 7/12/2021 at 1:51 PM, omri2050 said:

    Was kind of afraid to get into this framework, but once you try it and see how versatile it is and how easy is to make things work, you just don't need anything else, really. AND it keeps improving all the time.

    Awesome work!

     

    Same. I've tried several times to dig into this, but I get overwhelmed because instead of using it to MAKE a mission, I am trying to engineer it to work with my already-made mission. It has intimidated the hell out of me every time. I am going to take your advice, though, and keep trying.

     

    @wogz187 Brother,  I cannot tell you enough how AMAZING the stuff you are doing is. SO IMPRESSIVE. Keep up the great work, man!

    • Thanks 1

  9. 2 minutes ago, pierremgi said:

     

    Just think about what you are doing and what you want! In your code, you are scripting for player and _unit...  which seems weird. We don't know (as most of cases on forum) if you script for single player or multiplayer. We don't know if this script should work at start (probably) or during game...

     

    I scripted for a generic unit with a local variable _unit. It was an example for someone able to script with local variable as you already tested something with it. I thought you were not newbie on forum and your experience allowed you to understand what a local variable is.

    onPlayerRespawn.sqf  is not the best solution, as miracle for embedded variables, especially if you are scripting for single player, or if you don't respawn at start in MP. And that doesn't help at all if you are scripting for all player's units.

     

    If you are scripting for player(s) only (where player command is working), you can stay on   initPlayerLocal.sqf   and use player or (any declared local variable as 1st parameter)

    So, just try player instead of _unit. You can also script in init.sqf but you need to wait for player to be in game:   [] spawn {waitUntil {!isNull player}; <code with player command>};

     

    Looking back I can understand why my post may be frustrating for you guys; after spending hours and hours scouring this and other forums (and yes, the biki) I understand some pieces but not all. Every time I do something new I learn more and more and I enjoy the process.

     

    I will keep tinkering with it until I can figure out how to put it all together. 

     

    Sorry guys.


  10. On 8/12/2021 at 11:37 PM, pierremgi said:
    
    if (["Repair","Medic","Exp","Eng","Ammo","AA","Mine"] findIf {_x in backpack _unit}  >-1) then {
      private _array = backpack _unit splitString "_";
      _array deleteAt (count _array -1);
      private _bpk = _array joinString "_";
      removeBackpack _unit;
      _unit addBackPack _bpk;
    };

     

     


    Unfortunately, I didn’t have any luck with this. I tried it in both init and initPlayerLocal. Would either of those locations not be the proper place?


  11. I am trying to create a script that will automatically replace certain backpacks (_eng, _exp, _medic, etc.) with the same empty versions. I was going to try something like this:

     

    if (unitBackpack Player isKindof "B_Carryall_mcamo_AAA") then {
                          _unit removeItem "B_Carryall_mcamo_AAA";
                          _unit addItem "B_Carryall_oli";
                        };

     

    But I would need to do the same thing for every single backpack that has these suffixes. I am wondering if there is an eaiser way to accomplish this? I considered the idea of:

     

    if (unitBackpack Player isKindof "B_Carryall_mcamo_AAA" || "B_Carryall_mcamo_AAT" || "B_Carryall_ocamo_Eng") then {...

     

    But when it comes to the removeItem, I am not sure how to accomplish that without doing each individually. 

     

    Am I in over my head with this one, or on the right track?

     


  12. On 2/15/2021 at 4:12 PM, 0Y0 said:

     

    This is done at the config level. It will not work just to make a setting in the options. For this no. But, you can use mod for no idl animation.

     

    It works fine and disables them only for the player.

    https://steamcommunity.com/sharedfiles/filedetails/?id=1174806256&amp;searchtext=no+idle

     

    So does this mean there is no way to disable the animation that makes you juke when you run/turn?


  13. Thoughts on this? Do I even need to add the standard players to this if their damage is "normal" (set to damage * 1)?

     

    nul = [] spawn {
        sleep 1;
        switch (getPlayerUID player) do {
            
            case "3168468746512": {                                        // noob player
                player addEventhandler ["HandleDamage",{
                    params ["_unit","_selection","_damage"];
                    _damage * 0.5;
                }];
            
            case "5413546843212": {                                        // veteran player 1
                player addEventhandler ["HandleDamage",{
                    params ["_unit","_selection","_damage"];
                    _damage * 1;
                }];        
            
            case "6544164161261":                                         // veteran player 2
                player addEventhandler ["HandleDamage",{
                    params ["_unit","_selection","_damage"];
                    _damage * 1;
                }];        
            
            default {};
                };
            };
        };
    };


  14. Small private dedi server. Three players. One player very new and becoming frustrated with the difficult AI that lend a challenge to the other two but are a bit -too- difficult for the newbie. 
     

    is there a way, using Steam ID/UID/playername, to provide a handicap to the new player? Perhaps decreased damage or something like that?

×