Jump to content

opusfmspol

Member
  • Content Count

    719
  • Joined

  • Last visited

  • Medals

Everything posted by opusfmspol

  1. Maybe try: ({if (isNull _x) then {true} else {if (_x In AllPlayers) then {_x In heli1} else {false}}} count [test,p1,p2,p3,p4,p5,p6,p7,p8] == count [test,p1,p2,p3,p4,p5,p6,p7,p8]) I'm grasping for straws now. Does a Zeus unit appear in allPlayers? I know very little about Zeus function, tried to use it to emulate Construction Manager from A2 once (failed) and that was about it.
  2. "test" in your array, is that you as a player, or . . . ?
  3. Maybe an isNull check included in the condition? ({if (isNull _x) then {true} else {(!(_x In AllPlayers)) || _x In heli1}} count [p1,p2,p3,p4,p5,p6,p7,p8] == count [p1,p2,p3,p4,p5,p6,p7,p8])
  4. The load waypoint condition is "true", so waypoint is connected with a trigger checking that enemy are dead and that tells when to move (I presume)? I've had MP locality issues with "LOAD" waypoints in the past, works fine in SP but problems occur in MP. Seems as though it uses unitReady command to check status of units loading. I tested unitReady command in multiplayer some time back and found it only gives an accurate return on the machine where the unit being checked is local. Where the unit is not local, it always returns true whether the unit is busy or not. And testing a synced "LOAD" waypoint very much indicated it was checking the unitReady status of the units boarding. And in your case it seems you have mixed locality. The heli group (local to server) may not be local to same machine as the group of 8 (players are in the group). So you might not be able to use the "LOAD" waypoint if it won't get an accurate return. That kind of mixed locality is likely why many choose to script a chopper extract rather than do it in editor. - Change waypoint 1 type to "MOVE". - Move waypoint 2 to the LZ position (where the heli lands at). - Add a "MOVE" waypoint at current waypoint 2 position (the destination). Test and see what that will do.
  5. I did this in editor: - placed a player crewman, named p1. - placed a crewman, named p2. - placed a crewman, named p3. - in p3 init field was put: myArray = [p1,p2,p3]; - placed a helicopter, named heli1. - gave heli1 two "MOVE" waypoints, one at heli1 position and another several hundred meters away. - in first waypoint condition was put: ({(!(_x In AllPlayers)) || _x In heli1} count myArray == count myArray) - launched mission in editor (SP) to test. - heli1 remained grounded while player was on foot. - in debug console, code was checked to see what the waypoint condition would be reading, hint str ({(!(_x In AllPlayers)) || _x In heli1} count myArray == count myArray) - went to the heli1 and player boarded. - heli1 spooled up and took off. while on foot, debug console check returned false. After boarding, debug console check returned true. The condition works, so some questions: Are the 8 units all in one group, or are they split across groups, or are they individual units (each is its own group)? Is the heli pilot part of the 8 playable units? I notice the first waypoint (load) has in it's onActivation field: heli1 land "LAND"; so how does the setup look in editor? Heli1 is flying in at mission start?
  6. Did you check to see that the load waypoint had completed? I didn't use a load waypoint at all.
  7. just tested in editor SP, no such error and heli took off when I boarded. But didn't use publicVariable, I instead set the array in a unit's init field: myArray = [p1,p2,p3]; (used only three units, when tested 1 was player and 2 AI) Variable has to be defined at mission start if going into an editor waypoint condition. So maybe do away with the variable altogether and just use: ({(!(_x In AllPlayers)) || _x In heli1} count [p1,p2,p3,p4,p5,p6,p7,p8] == count [p1,p2,p3,p4,p5,p6,p7,p8])
  8. Make a public variable with array, i.e. myArray = [p1,p2,p3,p4,p5,p6,p7,p8]; publicVariable "myArray"; public variable because locality will change with the players joining. They all need to have it. waypoint condition: ({(!(_x In AllPlayers)) || _x In heli1} count myArray == count myArray)
  9. isPlayer can sometimes be problematic, so might check whether the unit is found listed in allPlayers array instead.
  10. Could try using: <condition> count <array>, or <array> apply <code>, and if becomes too complicated then easiest method is, in a waypoint's condition field you can run some code beforehand to help determine what you want, before finally returning Boolean. example: <code>; <code>; <code>; <code>; <Boolean> a = false; b = false; if (<condition1>) then {a = true}; if (<condition2>) then {b = true}; (a & b) //returns condition true only when a and b are both true.
  11. opusfmspol

    Helo trigger activation

    Taking what you described, recreation works in singleplayer. In editor: - Placed a player unit. - Placed a helo unit named: heli. - In heli init field, put: this disableAI "MOVE"; - (Note Using heli disableAI "MOVE" gave the same result). - Gave heli two Move waypoints, one at heli position and another a few hundred meters away (air units complete their waypoints in a large radius). - Placed an Any Player Present trigger in front of the player. - In trigger OnActivation field, put: heli enableAI "MOVE"; - Launched mission in editor (SP): The heli remained grounded, didn't fire up engines. - Moved player into the trigger and the heli flew away. So this works in singleplayer, but is your mission MP hosted or dedicated? in that case locality may be the issue. Which machine(s) the trigger exists on is important, because the enableAI command has to be run where the unit is local. But I was also saying, you might do away with the disable/enable AI by using the heli's first waypoint's condition field to detect that the trigger activated: - Place a player unit. - Place a helo unit named: heli. - Give heli two Move waypoints, one near to heli position and another a few hundred meters away. - In the first waypoint's condition field, put: triggerActivated trig - Move the first waypoint to the heli position. - Place an Any Player Present trigger in front of the player. - In trigger Variable Name field, put: trig - Launch mission in editor (SP): The heli remains grounded, doesn't fire up engines. - Move player into the trigger and the heli flies away. Two ways of achieving the same result. One uses disable/enable AI, the other doesn't. But in both instances, where the trigger exists is important in multiplayer environment: - enableAI / disableAI commands have to be run where the unit is local. The trigger doing 'enableAI' has to exist on the machine where the unit is local. - Waypoint condition only gets checked where the group is local. The trigger getting checked for activation must exist on the machine where the group is local. Locality can be reviewed here. Hope that's a little bit more clear. In your mission, are units, waypoints and triggers all placed in editor, or are any being generated by script?
  12. opusfmspol

    Diseases, Plagues, Viruses, & today we actually have one!

    Media-induced hysteria ensues. Government overreaches beyond duty, responsibility and authority. ACLU and other so-called abuse watchdogs are silent.
  13. opusfmspol

    Syntax Question

    Use forEach to repeat the same code for the units in an array. You still want to compile the function as gc8 suggests, as using execVM would repetitively compile the script in each cycle of the forEach. By defining the function beforehand, it compiles once. HousePat = Compile preprocessFileLineNumbers "HousePatrol.sqf"; {guard = [_x] call HousePat;} forEach [op1,op2,op3];
  14. opusfmspol

    liveFeed screens dedicate server

    You're running it on server? It seems a script to be run by client. Uses 'player' command in a few places. Player is objNull on dedicated server.
  15. opusfmspol

    Helo trigger activation

    Placing units, waypoints and trigger as described seems to work (in editor, SP), so there may be something more not mentioned. EnableAI and disableAI use local arguments (units). So question becomes, does the trigger exist on the machine(s) where the pilots are local? Also, might try using waypoint condition to detect the trigger true, you then might be able to do away with using enableAI/disableAI.
  16. If you are not using the -showscripterrors startup param, use it. It will flash errors on screen as they occur. It helps you to identify exactly when an error occurs in a mission. Just be aware that with singlePlayer and MP hosted, it flashes on the host both server and client errors, but using dedicated server it only flashes errors as they occur on client, not errors as they occur on server. If you are using the -nologs startup param, don't use it. -nologs prevents errors from being logged in .rpt for review. When playing missions you might want to disable logging, but when debugging you want to review the .rpt logs for errors. With singlePlayer and MP hosted, the host .rpt will log both server and client errors. With a dedicated server the .rpt log for server and client are usually found separate. The client .rpt logs the client errors and the server .rpt logs the server errors. For others who may wish to help with your problem, I reformatted your script above for better readability here: My first observation, is that you say the trigger is not server-side, yet the script the trigger calls has two server-only blocks. In singlePlayer and MP hosted, those blocks of script will run for the host. But on dedicated server the trigger does not exist, and the script is run on clients, so those blocks in the script will not get run at all. - edit: I should say "scopes" instead of "blocks". They're properly called scopes. But I'm a blockhead.
  17. Do you have a functions module placed on the map? In A2 & OA you have to place the module on the map. If you do have it placed and the error is occurring, you may be calling the function before the module's init has finished. Check that BIS_fnc_init has been defined before calling BIS_fnc_returnParents.
  18. addVehicle to a group, then it will be targeted by the opposing side even when empty.
  19. You're getting the hint because the trigger is firing on client. But the waypoint is not releasing because the trigger is not firing on server. Server has control of the AI leader's waypoint condition check. The waypoint condition is not fulfilled until the trigger fires on server. If you want to know that the dedicated server's trigger has fired, try: if (isServer) then {"Transport helicopter will take off in 30 seconds. To abort - leave the helicopter." remoteExec ["hint", (if (isDedicated) then {-2} else {0})]}; and, if (isServer) then {"Helicopter taking off!" remoteExec ["hint", (if (isDedicated) then {-2} else {0})]}; -2 for dedicated server since it has no interface for hints. For SP and hosted MP, using 0 has the hint run for all. No. - allPlayers is an array of all players + headless clients in the mission. AI units are excluded. It's a better check than isPlayer which sometimes gives a bad return. - _x is the element of the counted array, in this case the array counted is everybody in the helicopter (heli crew). - In checks whether the inspected element _x is found within the AllPlayers array. It counts the heli crew, and returns number of crewmembers who are players, not AI. So if one or more of the heli crew is a player, the condition returns true. (Heli1 In thisList && isTouchingGround (vehicle Heli1) && {_x In AllPlayers} count (crew Heli1) > 0) The condition is: (heli in the trigger + heli on the ground + one or more of the heli crew is a player).
  20. In SP and hosted, (vehicle player) will return a player's vehicle. On dedicated server (vehicle player) is the same as (vehicle objNull). As trigger condition(s) maybe try: (Heli1 In thisList && isTouchingGround (vehicle Heli1) && {_x In AllPlayers} count (crew Heli1) > 0) I never use semicolons ( ; ) at end of trigger conditions, don't know if it effects anything though.
  21. If this trigger is on the dedicated server, you also need to change its condition. Player is objNull on a dedi. Need to somehow identify the specific unit or group to count units from.
  22. As Harzach said, it's typically a locality issue. In this particular case your heli is AI, which usually means local to server (but maybe not). If your trigger is marked server only, it exists only on the dedi server. Otherwise it exists on server and each client. Waypoint conditions are only checked on the group owner machine (if AI local to server, the dedi machine) addAction is local effect, its code runs on a client. Thus the trigger may not be picking up addAction setting the TakeOff variable to 1, because it only sets to 1 on a client, not the server. Which is why I suggest add PublicVariable, so the server detects the change to 1, and the client detects the change back to 0.
  23. In addAction try: {TakeOff = 1; PublicVariable "TakeOff";} and in trigger activation: Hint "Heli-Taxi Trigger Fired"; TakeOff = 0; PublicVariable "TakeOff";
  24. opusfmspol

    Waypoint Script Problem

    Is the currentWaypoint completed? Maybe check the index against the waypoints count? currentWaypoint: If currentWaypoint is greater than waypoints count, you might try setCurrentWaypoint to (currentWaypoint - 1).
  25. opusfmspol

    disableSerialization (or lack thereof)

    Not using disableSerialization, my experience is, if you're storing UI elements in variables contained in a loop they work until you save, exit out and reload the saved game. You load the saved game and the UI variables come back nil. Causes errors. If defined within a script being called, spawned, etc. (not part of a loop), they may work. But sometimes not. Using disableSerialization prevents the script from saving, and therefore it won't run when the loaded save is played (prevents errors). It's something about, you can define (store) a UI element in a variable, but you cannot save a UI element in a variable. They're not persistent in a reloaded saved game. But I don't fully understand disableSerialization myself and look forward to hearing from others with knowledge. I'm just starting to delve into UI namespace. Some UI's I'd like to keep up after reloading a save, and I find disableSerialization in their scripts.
×