Jump to content

engima

Member
  • Content Count

    417
  • Joined

  • Last visited

  • Medals

Community Reputation

160 Excellent

7 Followers

About engima

  • Rank
    Gunnery Sergeant

core_pfieldgroups_3

  • Interests
    Sports, Music, Submarines, Software Development
  • Occupation
    Computer Engineer, Developer

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. engima

    Troubles with publicVariable..

    Given alternatives reflect different needs and maybe different philosophies. publicVariable: This is how you ”set a variable value on the other machines”. You also have the possibility to take some action when the value is set, using publicVariableEventHandler. remoteExec: This is how you ”execute a function on other machines”. Personally I don’t really like this, because if you use it frequently the code tend to be hard to read. The code can make the impression that execution is ”jumping” between clients in an uncontrolled manner. Event based remote executions: The publicVariable event handling philosophy I find much better, but the syntax is somewhat obscured. So what I do is that I use remoteExec, but I only call ”On” functions all collected in one reciever file. And these ”On” functions always just reflect source machine (server or client) events, and then routes the event to the correct execution path within the target machine. It is never a direct function call. Here’s an example. I never call ”createSomeVehicle”, or ”showMyMessage” on another machine. What I do is telling what is happening on the source machine, like ”onVehicleNeeded” or ”onLocationTaken”. This way I never mix the control flow responsibilities between different machines and methods. And if you want anything more to happen than just a message being shown when a location is taken, simply add one line of code in the onLocationTaken ”event handler.”
  2. I have not tried it, but I’ve seen this, which might be what you are asking for:
  3. ”If another waypoint was added soon after the LOITER waypoint, the LOITER waypoint will act as a MOVE waypoint” According to the exclamation marked text here: https://community.bistudio.com/wiki/Waypoint_types
  4. It seems like he knows that, and actually is looking for a way to do it in a script also. Reason unknown though. I need to add that you can check the existance of a variable (or unit) with isNil: if (!isNil ”red2”) then { // red2 exists and handling it here will not generate script errors. };
  5. if (random 100 < 75) then { // With a chance of 75% deleteVehicle red2; };
  6. First of all I’d have the chopper crew and the insertion squad in two separate groups (well, you probably have already). Second, commands like disableAI is probably a little too micro managing. Instead, look at commands like moveout and unassignVehicle. The problem I guess is that the units are still assigned to the chopper, and the natural behavior for AI is to try to enter the vehicle they are assigned to.
  7. Since one of the recent updates (I guess) the black script error screen in game only shows me a shortened (...) file name, so I always now have really hard to find in which file the script error occurred. Even in the .rpt file the file name is shortened. Anyone seen this, or know anything about it?
  8. That’s possible. But what about the other commands? A good practice I would say, is to always deal with the player on its local machine. So I would still go for locality.
  9. I think it is a locality issue. The last piece of code that has the units do the jump out I’d guess need to be executed on each player’s machines. I’m not sure exactly which of the commands, but moveOut and addBackpack (and maybe more of them). Create a function for the jump out that takes a player unit as an argument, and make sure it is called on each player’s machine respectively.
  10. In SP or MP? If MP, then you should use the alternative syntax of setVariable to broadcast the variable to all other machines. unit setVariable [var, value, true]; https://community.bistudio.com/wiki/setVariable
  11. New version. Version 0.67 -Added feature to create and deploy a PBO file directly from the TypeSqf editor to Arma's Missions or MPMissions (or a custom) folder. -Added support for all script commands up until Arma 3 version 1.94 (into ScriptCommands.xml). -Updated the file templates so that all methods now include parameters in the method header. -Minor fixes and improvements. -SQX: Added true inheritance. -SQX: Class properties can now be protected (and not only public like earlier), and have a protected setter. -SQX: Class methods can now be protected (and not only public or private like earlier). -SQX: Added the "return" statement. -SQX: Extended the method log tool to include return values (and not only calls like earlier). -SQX: Updated color themes - Go to Tools and reset the color themes for the changes to take effect. -SQX: Minor fixes and improvements.
  12. I had a similar problem a while ago. I had it happen when I spawned vehicles out in the terrain, but it worked when spawning them on a road. My solution was to monitor their movement after spawn, and if they did not get moving in a minute I deleted their waypoint and created a new. That usually had them start moving. I’m not sure if I gave them different behavior for different waypoints, but I had some kind of randomizaton about that.
  13. I’d say that ZaellixA’s second while is the one to choose if you for some reason do not want the _items variable to reference a new array. I.e. using the deleteAt command.
  14. This is how I often do: private _itemsToKeep = []; { if (keep_condition) then { _itemsToKeep pushBack _x; }; } foreach _items; _items = _itemsToKeep; But ZaellixA’s solution also seems like a good one. Except I’d do the delete phase in the first loop and skipped the second. EDIT: Corrected the pseudo style code to more exact SQF code after Dedmen’s comment below. (The ”keep_condition” will still need to be replaced by an actual keep condition.)
  15. engima

    Playable unit only for Admin

    Not possible. But maybe you can set name of the group of one player to ”Admin”, and then use the ”admin” command to black fade the screen if any other than the admin use the slot. Bonus question: I don’t know.
×