Jump to content

opusfmspol

Member
  • Content Count

    719
  • Joined

  • Last visited

  • Medals

Everything posted by opusfmspol

  1. Look through the mission's triggers. There is a LOSE trigger which triggers the ending when a team member dies.
  2. opusfmspol

    execVM return value

    He was using a trigger, and a trigger's expression code on activation has to return nothing at the end. To satisfy the trigger, the execVM handle had to be captured in a variable so that nothing would be returned. There might be some other instances where a return must be captured, I can't recall right now, but that's what I observe from the given post. someParam execVM "someScript.sqf"; // Handle is returned. null = someParam execVM "someScript.sqf"; // Nothing is returned, variable "null" holds the handle.
  3. You might try using BIS_fnc_locations. Example, to find locations of type "NameCity": ["NameCity",[[0,0,0],1000000],true] Call BIS_fnc_locations; Classname types you might check for: "NameCityCapital" "NameCity" "NameLocal" "NameVillage" "NameMarine" "Hill"
  4. If a vehicle (or other object) has ammo stored in its gear, move your units there and then one by one, highlight one, select "action", and order them to rearm from it, same as you would have them rearm from a dead body or crate. Has to be done individually. When they're done, you might have to order them to report status to change a unit's icon from orange back to green. But the right ammo has to be there for them to rearm with. When around a purchase point (factory, depot or camp), selecting the units might provide them with a "buy weapons" or "buy ammo" option, but I can't recall if that works, I think only a team leader can purchase anything, team members don't have access to the team funds. Basically, purchase gear for their rearm and store it, either in your team vehicle, or another vehicle on hand, and have them rearm from there; or have them rearm at an ammo truck, or rearm them from bodies of dead friendlies, stuff like that.
  5. opusfmspol

    Create Airports in Warfare

    In Warfare (WF) missions, Airports are captured in the same manner as towns, they don't get created or purchased during gameplay. They get placed in the map when the mission is created in editor by the person making the mission; so a mission will either have airports or it won't. An airport is a fixed structure which serves as a factory, not a factory a commander can build. In the same manner captured town depots provide a menu to heal, rearm, refuel, etc., or captured camps provide a menu for static defenses and gear, an airport structure gets captured, then provides a menu for buying fixed-wing aircraft. - In Arma2 (A2), I'm aware of two WF missions that have capturable Airports set up in them; Bear Rising, and Superpowers. The other missions (as I recall) don't. - In Op Arrowhead (OA) the WF missions have no capturable airports set up (likely because in OA standalone, the hangar used by Warfare is not available in editor). - But when playing Combined Ops (A2 + OA combined), the A2 hangar becomes present in the editor, so a mission maker can use it to make capturable WF airports on the OA maps. As far as the menu you mention that opens up, you are likely seeing the icon for a fixed-wing aircraft. It's for purchasing an airplane, and is always greyed out unless you are at an airport your side has captured. When there, you will see a list of fixed-wing aircraft you can buy. Unless however, you play side Resistance; in the base game (no mods used), Resistance have no fixed-wing aircraft configured as available to them, and their list is empty. So in short summary, there are two scenario missions from A2 that have capturable airports set up for buying fixed-wing aircraft, otherwise you have to make a mission from scratch and set up any airports you desire. Hope this helps.
  6. Move the if-then inside the addAction code.
  7. opusfmspol

    Random Town name in task

    _TownName is the returned location itself. If the name text of the location is what you want, use: Text _TownName Also, nearestLocations will search multiple location types ("NameCity", "NameVillage", etc.) and the locations it returns are sorted by distance.
  8. opusfmspol

    Troubles with enableAI "Move"

    The likely reason enableAI did not work on dedicated is that the command has to be run where the unit is local. addAction runs local to the client (player). When AI is a one-man group (i.e., leader of his own group) the AI is local to the server. In singleplayer and MP hosted, the host client is also the server, and the command run in addAction will work there. With dedicated server they are not local to client, so the command fails, it has to be run by server. But in the event locality of the unit is in question, best to just remoteex using the _unit as the target, then the enableAI command will run wherever the unit is local, whether server or client. Multiplayer Scripting remoteExec remoteExecCall
  9. Waypoints are a group function. It sounds like you have the target and pilots in the same group. The target and pilots need to be in separate groups which have their own waypoints.
  10. missionConfigFile can get description.ext entries for comparison. But I thought client received mission from the server when connecting... how would they run different versions?
  11. Maybe I'm misunderstanding the scenario and the {false} should instead be {true} for trigger condition. Certain MP behavior with Units and Group commands may also need to be considered, see Kronzky's note at the bottom of the Units biki page. The alternate detection might need to be: if (isNull playersGroup || {{Alive _x} Count (Units playersGroup) < 1}). What exactly is the extract setup/scenario using the trigger? Are all the player/playable units in one group (playersGroup), or are there multiple groups with playable units being extracted? What respawn type is used (Instant, base, group, etc)? < 1 is same as == 0, meaning no Units are detected in a group. Reversing that would be > 0 Units, meaning Units are still detected in a group.
  12. Check to see if the respawned unit belongs to a different group. If that's the case, use respawn event handler to have him joinSilent the playersGroup, so long as the group still exists. Or redefine playersGroup as the respawn unit's group if it no longer exists.
  13. Try this: (if (isNull playersGroup || {Count (Units playersGroup) < 1}) then {false} else {{_x in heli_1} Count (Units playersGroup) == {Alive _x} Count (Units playersGroup)})
  14. Not to my knowledge. Player is a command (I would say a local command though wiki has no indicator for it), and the return is different on each machine. Dedicated server has no user. The command's use has to be reviewed in each 'composition' you have, with an eye toward the objNull returned by dedicated server. Multiplayer Scripting
  15. Only to one unit in the group. With dedicated server you have to use direct unit references instead of Player, and group references from some unit rather than relying on (Group Player ). Unit reference is as simple as naming units in editor. @dreadpirate provides example above of setting a group reference and using it.
  16. opusfmspol

    Counting variable in MP

    Should be: "_this distance _target < 3", "_caller distance _target < 3", Means "not the server". Will execute on all connected clients, but the server itself will be excluded. It's commonly used to keep a dedicated server from executing Player and hasInterface related stuff where it might result in errors, since Player is objNull on dedicated server and it has no interface.
  17. opusfmspol

    Counting variable in MP

    Yes, please. What you have is this: [ puitdevin, "<t color='#00FF00'>SEARCH</t>", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_requestleadership_ca.paa", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_requestleadership_ca.paa", "_this distance _target < 3", "_this distance _target < 3", {}, {}, { [_this select 1] execVM "randompuits.sqf"; [(_this select 0),(_this select 2)] remoteExec ["bis_fnc_holdActionRemove",[0,-2] select isDedicated,true]; }, {}, [], 2, 0, true, false ] call BIS_fnc_holdActionAdd; Try changing array select 5 to: "_caller distance _target < 3".
  18. If its an unchanging value, as the items list here appears to be, best practice is definitely to predefine the value in an init script. Maintain it in a separate process, if necessary. Sometimes running code ahead of evaluating condition is needed and helpful for getting condition values. In this case, trying to find what works, it's helpful. But you've got it right, whenever possible best practice is to use condition alone. Array should be predefined elsewhere and trigger should just run the condition check.
  19. Not sure these are the issue, but: _script is undefined in the expression. Spawn uses function, not script. execVM uses script. Trigger activation must return nothing, and spawn or execVM returns a handle, so might try "nul = [%1] spawn function;" or "nul = [%1] execVM 'folder\script';". Also might try formatting the statement first, then set triggerStatement: _expression = format ["nul = [%1] spawn function;", _variable]; _trigger setTriggerStatements ["this", _expression, ""];
  20. You can, a = true; b = false; a || b works a = 2; b = 1; a >= b also works I was in error thinking triggers would list empty objects. Apparently they don't. Also, pushBack gets me every time, would have been pushback _x instead of pushback [_x] if had been used correctly. I'm always stuck with array = array + [_x] in my head. @Harzach has it right. Tested and this appears to work in condition field: ItemsTotal = [o1, o2, o3, o4]; ({_x inArea thisTrigger} Count ItemsTotal) >= ((Count itemsTotal) * 0.75)
  21. Crawl, then walk, then run. Untested, but try this in trigger condition: ItemsTotal = [o1, o2, o3, o4]; ItemsInArea = []; {if (_x In thisList) then {ItemsInArea pushBack [_x]};} Count ItemsTotal; Count itemsInArea >= ((Count itemsTotal) * 0.75) Should trigger when 3+ items are in trigger area. But as said, counting cargo items will need more.
  22. Beginners Guide on Arrays A3 Script Commands Because _itemsInArea is undefined (also see note). - Define the array of all items, either as ItemsTotal or _itemsTotal (note: editor triggers don't allow the "_local" variable type in primary scope, but triggers created by scripts do). ItemsTotal = [item_1, item_2, item_3, item_4]; - Build an array of the items that are in the area: either as ItemsInArea or _itemsInArea: ItemsInArea = []; {if (_x In thisList) then {ItemsInArea pushBack [_x]};} Count ItemsTotal; - Then determine if number in area meets the desired percentage: Count itemsInArea >= ((Count itemsTotal) * 0.75) That should count the editor placed items, but counting the cargo items in objects needs more.
  23. Moving to a separate script would be proper since remoteExec the addactions doesn't return the handles for storing and removing them later.
  24. // 75% or more in area. Count _itemsInArea >= ((Count _itemsTotal) * 0.75)
×