Jump to content

st_dux

Member
  • Content Count

    876
  • Joined

  • Last visited

  • Medals

Posts posted by st_dux


  1. Well, the reason I changed from inline functions to functions as files, is, it looks more organized and I can add detailed functions headers.

     

    And that is perfectly reasonable, particularly for larger functions that may be reused in several different scenarios or by several different scripters. That said, I don't think it's right to say that inline function code is less efficient because it is processed in exactly the same way. 


  2.  

    OK, I kind of expected that. I disagree with the idea that this kind of function is somehow less efficient. The game processes this code in exactly the same way as it processes functions split into dedicated files. This isn't like C++ where making a function inline actually changes the way it is compiled. At the end of the day, it's all just interpreted SQF code anyway. 


  3. isNull only works if there is something that could be null. A variable that points to nothing at all is not null; it is undefined. To check if something is undefined, use isNil instead.

    if (isNil "task05") then {...}
    

    Alternatively, you could set up your task variables before actually creating all of your tasks; in this case, isNull could work. Some people will tell you that this is a better practice, although personally I don't think it makes any difference at all. Here's how you'd do that:

    task05 = taskNull;
    if (isNull task05) then {...};
    

  4. Thanks for checking out the mission, AZCoder. If you're getting a mission failed screen, then the resistance leader is indeed being killed; nothing else can cause mission failure in this scenario. My advice for avoiding this is to be more careful on approach to the compound: If you encounter a patrol, you must either eliminate it very quickly (not allowing for any return fire) or avoid it altogether. If the patrol has a chance to tell HQ that they are under fire, the resistance leader will be killed. During the actual assault, you have to be very aggressive: Moving too slowly will allow enemy soldiers at the compound to kill the resistance leader. It's not particularly easy, which is why you get a free autosave after successfully infiltrating.

    The mission is now up on Armaholic as well for those averse to Steam:

    Operation Bengal Toe


  5. gms7US

    The AAF have captured an important leader in the Altis resistance movement and are planning to execute him later today. Although the AAF are our allies, we cannot allow this execution to proceed; the potential intel that the resistance leader possesses is too great. You are to lead a small team of CSAT Special Forces soldiers on a daring dawn raid on the compound where the resistance leader is being held, capture him alive, and bring him back to headquarters for interrogation.

    This is a relatively simple but fairly challenging hostage rescue scenario that requires the player stealthily approach an enemy compound and then coordinate multiple elements in a fast-paced assault. One wrong move can result in the resistance leader being killed, which means mission failure.

    This scenario does not require any addons or mods to play. It was designed for 100% vanilla Arma 3.

    Workshop link:

    http://steamcommunity.com/sharedfiles/filedetails/?id=634796582

    Armaholic link:

    Operation Bengal Toe

    This is the first mission I've published in years, although I've been editing Arma missions for about 15 years now, and I work with VBS3 professionally. I started scripting before the Biki existed, which now that I think about it, makes me feel pretty old. Enjoy the mission, and if you find any bugs, please report them here!

    • Like 1

  6. Thanks for the multiple ideas however unfortunately the best option of using the Set Owner link and setting any group member doesn't seem to work. The purpose of the trigger is so that a couple of AI joins the group of the person in the trigger. If the trigger is simply set to BLUFOR it works, however if I set it using the Any group member filter it doesnt. Using this option only works if it's group leader that enters the trigger which doesn't make much sense and defeats the purpose of the link.

     

    Update: I've been testing it setting to a group member as trigger owner and setting the trigger to activate to group leader and it still won't trigger to anyone besides the trigger owner.

     

    That sounds like it might be a bug in Eden. Did you try the thisList option?

    • Like 1

  7. To be honest, I don't use the modules myself, so I don't know off-hand. I would assume that a task notification would display by default whenever activating the task changed module, but I'd have to take a look at the function associated with it to find out for sure, and I don't have access to that right now. You can, of course, always create a task notification manually by tapping into the notification system directly: https://community.bistudio.com/wiki/Notification


  8. I originally did make missions with tasks in the 2D editor, but it seems they were removed from the list of objects in the 3D editor. I took that as I was meant to be using waypoints instead, so that's what I started doing. Is that not the recommended way of doing it?

     

    Waypoints are for controlling the movement of groups. They are not tied to the task system in any way (although you could use the activation field of a waypoint to enact a task state change if you wanted).

     

    Based on your description, I assume you were using the task modules in the 2D editor. They are still there. You can find them under the modules/logic group (F5 shortcut) in the "Intel" category. These modules tie directly into the ArmA 3 Task Framework that davidoss  linked above; activating them via module versus via script is merely a matter of preference.  


  9. This is a classic problem that has existed in some form since OFP. The string version of a group will have a space in it, breaking everything, so you cannot "format it in" like you can with other data types. It sounds like you've already found a workaround for your particular problem, but for the benefit of others, a quick way to get around this is by using the group leader:

    format ["(group %1) call test;",leader _group] 
    

    This still winds up using the group, but because you are formatting in an object (the group leader) rather than the group itself, it doesn't break.


  10. You can pass arbitrary arguments via addAction. It is the parameter right after the path to the script (which, by the way, you can just use instead of running code that executes a script anyway). Just make the parameter equal to your money value, like this:

    [[_cash ,[("<t color=""#FF0000"">" + ("Collect Money") + "</t>"),"scripts\pickupcash.sqf",myValue,0,false,true, "",'']],"addAction",true,true,false] call BIS_fnc_MP;
    

    Note where I added "myValue" above. This is where you could put the value of the money dropped. Then, in your pickupcash.sqf:

    _money= _this select 1;
    _amount = _this select 3;
    
    • Like 1

  11.  

     I tried that with no results, the AIs remains on their mother ship doing no more action. 

     

     

    moveInCargo/Driver/Gunner/Commander will not work for a unit that is already inside of a vehicle. You will need to move them out of their current vehicle first. Using an "eject" action is usually fastest.

    myUnit action ["eject",vehicle myUnit];
    waitUntil {vehicle myUnit == myUnit};
    myUnit moveInCargo myBoat;
    

  12. @OP:

     

    There are a couple of ways to do this easily. First is as tajin said: Group the trigger with the unit or group you want to check. In Eden, this is accomplished by right-clicking on the trigger and going to Connections > Set Trigger Owner; after that, you just click on your unit and the connection is established. Now the trigger detection criteria will have options like "Owner only" and "Any group member" instead of the usual filtering by side.

     

    Alternatively, you can change the condition code of your trigger to check for specific units by variable name. As long as the unit in question meets the general detection criteria of the trigger (e.g., a "BLUFOR -- Present" trigger would require that the unit in question be on the BLUFOR side), the unit will appear in the array represented by the special variable "thisList" within that trigger's code fields (condition, activation, deactivation). If you want to check for one unit specifically, then, you could change the trigger condition from the default "this" to "myUnit in thisList". Now the trigger will only fire if myUnit meets the trigger detection criteria; anyone else will be ignored. 

    • Like 2

  13. It adds up quickly.

     

     

    Oh anyway, whats the reason to have those variables on both the HC and the server?

     

    Would probably be cleaner to handle whatever you're doing only on one or the other. Without transmitting stuff back and forth.

     

    From experience, I can tell you that with simple variables like this, it really doesn't. There is so much information being broadcast all the time just to keep the simulation running; the state of one object variable is nothing by comparison. I still recommend just broadcasting it globally using the optional third parameter of setVariable as this is definitely the most pragmatic solution.

     

    But if you really insist...

     

    You could use a public variable event handler to achieve your goal: 

     

    init.sqf:

    if (isServer || (!hasInterface && !isDedicated)) then
    {
        var_serverCode = {}; // this variable will serve as a holder for code we want run only on the server and HC
        "var_serverCode" addPublicVariableEventHandler {call (_this select 1)};
    };
    

    Now, whenever you want to change your object variable, instead of doing it normally, do this:

    _codeToPass = compile format ["%1 setVariable ['respawnable',300]",_squad];
    var_serverCode = _codeToPass;
    publicVariable "var_serverCode"; // send it to HC or server (whichever one this isn't)
    call _codeToPass; // execute code locally
    

    This is overly complicated and totally unnecessary, but there you go.

    • Like 1
×