Jump to content

opusfmspol

Member
  • Content Count

    719
  • Joined

  • Last visited

  • Medals

Everything posted by opusfmspol

  1. opusfmspol

    activate trigger by opening crate

    My thought would be: User Interface Event Handlers: onLoad
  2. Maybe try this: (not tested, so might need some adjusting - I note there are undefined references, so perhaps there are more to these than was posted) // initPlayerLocal.sqf: // gennorm.sqf et Al. (run only by Client p1) // start.sqf (run only by server, whether hosted or dedicated):
  3. Maybe try this, has some added Order of Operations and removes some parts not needed : this addAction [ "<t color='#00FF00'>ENTER WITH PLAYERS</t>", { { if (_x inArea triggertower) then { _x setPos [ ((getPos Obelisk1) select 0) +5, ((getPos Obelisk1) select 1) +0, ((getPos Obelisk1) select 2) +2 ]; }; } forEach (allPlayers - (entities "HeadlessClient_F")); setDate [2002, 4, 12, 23, 0]; }, nil, 1.5, true, true, "", "true", 3 ]; If your mission isn't using Headless Client, and you don't anticipate any being added, you might do away with its reference and just use (allPlayers). What is the markerType, x-axis and y-axis of the triggerTower marker? And what type object is Obelisk1?
  4. opusfmspol

    Script holding error help

    The execVM and setVariable are outside the spawn. The waitUntil runs separately in the spawn, and ends with nothing being done. Try moving the execVM and setVariable inside the spawn, after the wait.
  5. It likely works when you use the radio triggers because the triggers exist on all machines, and when you broadcast radio Alpha the server and clients all ExecVM the gennorm.sqf. But from addAction (local to client) the server does not run anything due to the locality which @pierremgi points out. Your "if (isServer)" scopes get bypassed entirely, the scripts are only running on clients.
  6. Player is different on each machine, so you either target a defined unit or use commands owner or clientOwner to identify / target a unit. Otherwise 0 will target all, 2 will target server only, -2 will target all clients excluding server. In regards to owners, server can get any unit's owner but client's can only get their own, they cannot get other owners. If you want your mission to allow clients to get other unit owners, you have to make and include a function for it. remoteExecutedOwner will identify where a remoteEx originated from.
  7. What you have here is incomplete, missing a semicolon ( ; ) and ending in a period ( . ), which shouldn't work. Should be: this addAction [ "ENTER WITH PLAYERS", { { if (isPlayer _x) then { if (_x inArea triggertower) then { _x setPos [(getPos Obelisk1 select 0) +5, (getPos Obelisk1 select 1) +0, (getPos Obelisk1 select 2) +2]; }; }; } forEach allUnits; } ]; Recommend you use (_x In allPlayers) rather than (isPlayer _x), since isPlayer can sometimes be problematic in multiplayer. Also possible that in description.ext you might have security protocol (CfgDisabledCommands) in place for setPos command, allowing server to use it, but not allowing clients to use it.
  8. If all that was done was change "player" to "_unit", that wouldn't work. To "target a _unit" means a unit has to be selected from the activated trigger's list or thisList and defined in the script as _unit. Once you have a _unit defined in the script, changing the player references to _unit should work.
  9. See if this works for dedicated: if (isServer) then { _null = this spawn { Hunt_players_fnc = { _player = objNull; _players = +(allPlayers - (entities "HeadlessClient_F")); _distance = 100000; { if (alive _x && _x distance (Leader _this) < _distance) then { _distance = _x distance (Leader _this); _player = _x; }; } foreach _players; if !(isNull _player) then { _wp = (Group _this) addWaypoint [getPos _player, (50 + (floor(random 70)))]; _wp setWaypointStatements ["true","_null = this spawn Hunt_players_fnc;"]; _wp setWaypointType "SAD"; _wp setWaypointCombatMode "RED"; _wp setWaypointSpeed "FULL"; }; }; _null = _this spawn Hunt_players_fnc; }; };
  10. _index = _sectors findIf { _x params[ "", "_sector" ]; _sectorOwner = _sector getVariable[ "owner", sideUnknown ]; _sectorOwner isEqualTo sideUnknown || _sectorOwner isEqualTo West }; //Find a flat position around the LZ marker & create an HPad there. _flatPos = [getPos ( _sectors select _index select 1 ), 0, 550, 10, 0, 0.3, 0] call BIS_fnc_findSafePos; Yeah, the _index findIf would return -1 as _index when Opfor or Independent holds all. You could test for that. If that's the case you could exit the script, if that's what you want to happen. if (_index < 0) exitWith {};
  11. Checking "Server Only" is correct. Condition breaks it on dedi because Player is objNull on a dedicated server. Try using: ({_x In thisList} count AllPlayers > 0) as condition. -- edit: Also check the script for "player", that would have to target a _unit instead on dedi.
  12. opusfmspol

    Search in array

    _owner = objNull; {if (player distance (_x select 1) < 5) then {_owner = _x select 0};} forEach _Array; 5 is just suggestive radius for "inside a house". Houses will be bigger or smaller. Or use 1 or 0 if you want player right on the spot.
  13. opusfmspol

    joinSilent on dedi server

    Try this: [_this select 0] joinSilent (Group (_this select 1));
  14. Maybe an Order of Operations issue, maybe not? If so, I would think it should occur consistently. What it means is confusion might occur over which command to run first, when multiple commands are in an expression and precedence is not conditioned ( ). Example: _flatPos = [getPos ( _sectors select _index select 1 ), 0, 550, 10, 0, 0.3, 0] call BIS_fnc_findSafePos; // Could get run as: _flatPos = [getPos ( (_sectors select _index) select 1 ), 0, 550, 10, 0, 0.3, 0] call BIS_fnc_findSafePos; // or: _flatPos = [getPos ( _sectors select (_index select 1) ), 0, 550, 10, 0, 0.3, 0] call BIS_fnc_findSafePos;
  15. opusfmspol

    AI won't shoot with rockets on vehicle target.

    addVehicle
  16. opusfmspol

    FSM variables...

    Are the set variables still available after an FSM has completed (reached end state)? I've never tested for that.
  17. opusfmspol

    FSM variables...

    Not tested, but try this: _fsm setFSMVariable ["_handle", _fsm]; _fsm setFSMVariable ["_result", false]; and inside the running _fsm: _handle setFSMVariable ["_result", true];
  18. When creating a scenario in A2's 3d Editor, two files get created, the mission.biedi and the mission.sqf. The setPlayable command can be seen used in the mission.sqf, when a unit is placed and set as playable. So maybe it's a deprecated editor-only command, or maybe it's usable only in 3DEN or 2D setup, I dunno.
  19. opusfmspol

    FSM variables...

    Have you tried to use setFSMVariable ?
  20. opusfmspol

    Whitelisting 'addAction'?

    Condition for addAction is a "string", not {code}. And for a string inside the string (i.e., "whitePlayer"), you would use 'semiquotes' (i.e., 'whitePlayer').
  21. opusfmspol

    object ignore script

    setVariable in the dead body objects, and modify the cleanup script to look for the variable. If nil or false, clean up but if found true don't clean up. Or modify the cleanup script to include an object blacklist to check, and add the bodies to the blacklist. Probably other ways also.
  22. For trigger condition, count the living units of each group to see whether at least one from each group is in the trigger list, and when count is correct the condition returns true, else false. Example (not tested): grpsPresent = []; {if ({Alive _x && _x In thisList} Count (Units _x) > 0) then {grpsPresent pushBack _x};} forEach [grpTeam1,grpTeam2,grpTeam3,grpTeam4,grpTeam5]; Count grpsPresent >= 5
  23. opusfmspol

    Keep waypoints after respawn

    1. Use a Respawn event handler. Don't use "player" for setVariable / getVariable, because the player object will change. Refer to _unit and _corpse as given in the example. 2. Waypoints are a group function, they belong to the group. When a team gets wiped out, the group is subject to getting deleted. Waypoints get deleted with the group. There are various ways to prevent this sort of thing happening. What kind of activation effects are you saying happened?
×