Jump to content

JB47394

Member
  • Content Count

    105
  • Joined

  • Last visited

  • Medals

Everything posted by JB47394

  1. Can I control the way keyboard and mouse events pass through my dialog to ARMA, or will they always be blocked? ARMA seems to let a couple keys through custom dialogs ("/" and "U"), but I can't find anything that lets me selectively pass key and mouse events. I'm trying to make sure that players can continue to use game VOIP while looking at my dialogs. Unfortunately, both keyboard and mouse buttons are being blocked. So while they have a dialog up, they're unable to speak, which is unacceptable for a multiplayer mission. I notice that the inventory interface uses some keys for inventory functions while letting others through (e.g. movement with the keyboard - and VOIP). Can I do something to my dialogs to duplicate that behavior?
  2. [Edit: Crap. Wrong forum.] If I have a satellite phone that I want players to be able to disable, I can put an action on it. They walk up, trigger the action and it's disabled. No muss, no fuss. But my players are equipped with all manner of weapons. Rifles, bombs, grenades, explosives, etc. I want them to be able to destroy that phone. I can't figure out a way to do it. It doesn't take any damage. I've tried enableSimulation and allowDamage. It doesn't take any event handlers that would allow me to detect impacts. I've tried Hit and HandleDamage. The only thing that occurs to me now is to attach some kind of proxy object to the phone (or attach the phone to it) so that when it gets destroyed, I can detect that. But I don't know of any innocuous or special objects where hits or destruction can be damaged. Or am I missing some other technique that turns these objects into something that can be damaged?
  3. 1. How does one draw a horizontal line with RscLine? As my lines approach horizontal, they change color. I'm guessing that it's the background color, but I can't be sure. White goes to gray and red goes to black. I threw ctrlSetPixelPrecision 2 at the lines, which improved their quality, but there's still a range near horizontal that simply will not display in the correct color. 2. Can RscLine be used to draw wider lines? 3. Can RscLines be subclassed? I've tried while attempting to sort out the above,, but when I create my subclass, they don't draw. I'm guessing that ARMA looks for "RscLine" and not "isKindOf RscLine
  4. Consider the following code. It calls a function remotely, which reports the value of remoteExecutedOwner at the remote location, then calls back to a function which again reports the value of remoteExecutedOwner at the local location. LocalFunction = { systemchat format ["Response from %1", remoteExecutedOwner]; }; private _remoteFunction = { systemchat format ["Receive from %1", remoteExecutedOwner]; [] remoteExec ["LocalFunction", remoteExecutedOwner]; }; [[], _remoteFunction] remoteExec ["call", 2]; As shown, it calls to the server (2). If this code is run with the target machine being the server or another client, remoteExecutedOwner produces the expected values. For example, if I call client 4 from client 3, client 4 will show "Receive from 3", and client 3 will show "Response from 4". If this code is run with the target machine being a headless client, when the sequence returns to the original caller, remoteExecutedOwner always reports 0. If client 4 is a headless client, client 4 will show "Receive from 3", and client 3 will show "Response from 0". This looks like a bug to me, but I wanted to see if anyone could point out a reason why this should work this way. Note that I'm not looking for workarounds.
  5. Reported as a bug https://feedback.bistudio.com/T128522
  6. Stop wondering and go find out. Set up a dedicated server using TADST. Connect to it with a client. In the debug console, run the above code. Find out what you get.
  7. When the server calls back, remoteExecutedOwner will be 2. You should have tested this yourself with a short code snippet run from the debug console: LocalFunction = { systemchat format ["Response: %1", remoteExecutedOwner]; }; private _remoteFunction = { [] remoteExec ["LocalFunction", remoteExecutedOwner]; }; [[], _remoteFunction] remoteExec ["call", 2]; That will remoteExec a function on the server that will call back to the client and report the value of remoteExecutedOwner.
  8. I worked around this by spotting that the netID of the projectile was "0:0" on the firing client. I then created an invisible proxy object that I manually positioned at the location of the projectile, giving me a reference for the location of the projectile. The position gets updated in a loop that ends when the original projectile is no longer alive. The only flaw in it is that remote clients refuse to put the proxy object at the exact position of the projectile. It's off to the side. The originating client sees it as it should be.
  9. If I set up a FiredMan handler on a player that fires a mortar, I get a mortar projectile object, but its netID is 0:0. If I set up a FiredMan handler on a remote player that fires a mortar, I get an objNull mortar projectile. This is a vanilla Mk82 mortar. No mods loaded. Trying the same thing with grenadier rounds gives me a good netID and object for each grenade. Is this a bug? I see that bullets also don't get a netID. Is there no way to have a remote client react to the rounds being fired unless they are grenades?
  10. JB47394

    [RELEASE] No Mine Markers

    I have been unable to get the difficulty setting to take effect in 1.80 in either the editor or a dedicated server. Instead, I put bis_fnc_drawminefields_active = true; in my initServer. That fools the function into thinking that it's already running, so the whole process is short-circuited. I assume that's what the difficulty configuration thing is supposed to do.
  11. JB47394

    Making AI avoid mines

    Edit: Disregard this. This only seems to apply in the editor. I was unable to reproduce this behavior on a dedicated server. With the bug that wheeled vehicles will drive over known AT mines while traveling on a road and there is no waypoint within 100m of the mine field. So if you're sending a wheeled vehicle between two points and just want to leave pathfinding to ARMA, the vehicles will drive over any road AT mines along the way. Tracked vehicles don't do this. They're apparently always checking for nearby known mines. https://feedback.bistudio.com/T127682 At a guess, somebody put the mine check in the wrong part of a loop.
  12. There is a comment by Killzone Kid on the createDisplay function that describes the underlying problem: So if you use createDisplay, you're going to be left with a display that allows your players to interact with the game without your display event handlers firing. I use display event handlers to enforce certain behavior in my mission system, so this is a real problem. You'd think that I could just avoid using createDisplay and my problems would be over. Unfortunately, ARMA's dynamic groups interface is a display, meaning that anyone can circumvent certain mission restrictions any time they want by bringing up the groups interface. Does anyone know if there is a workaround to this, if Bohemia considers this behavior a bug, and if they're planning on doing anything about it? If the game reacts to a display event, then I expect the display event handlers to fire. Similarly, if the game isn't going to react to a display event, then I expect the display event handlers to NOT fire. Incredibly, Bohemia implemented this exactly backwards, where displays cause the game to react to the events without firing handlers while dialogs don't cause the game to react to the events yet fire the handlers.
  13. What format version of .arma3profile files is TADST using? There is an old dedicated server that I support that has a version 1 file, which uses one set of class names, the Bohemia wiki shows a version 2 example, which uses another set of class names, and then there are the files created by TADST which use a third set of class names. Are class names in some way not significant? I ask this because the version 1 profile files are apparently being ignored by ARMA. We'll try moving them to the TADST format, but the question stands. Also, if the format that TADST is using is actually a version 3, then it should be stating that in the profile files so that when Bohemia comes out with version 4, the older TADST files will still work. Lastly, for those who are constantly struggling to find files related to ARMA, I suggest the Windows program called Everything. I couldn't deal with ARMA without it.
  14. I have a repair script that works off getAllHitPointsDamage. With it, players can repair vehicle systems one at a time. I use setHitIndex to incrementally remove the damage over time, relying on the indices provided by getAllHitPointsDamage. It all works marvelously well, with wheels reappearing, lights turning on, turrets reactivating and all that sort of thing. A problem that I've seen is that vehicles will occasionally be completely repaired, but the vehicle itself will show damage and the trouble board on the vehicle will show problems as well. At the data level, damage is non-zero while getAllHitPointsDamage will show zeroes for all systems. One particularly-badly-damaged vehicle (A Slammer, if I recall correctly) was restored to all zeroes, but damage reported 0.93 and the vehicle showed orange for all systems on the crew display with the hull using the damage texture. Does anyone see anything wrong with my approach? What do I need to do other than setHitIndex to clear damage? This is without mods, but with custom scripts.
  15. Thanks. That's the sort of thing I was looking for. It turns out that it's not analogous to "damaged tissue between the organs" but simply a case of Bohemia being their usual bizarre selves. If you set the damage of a hit point, you don't affect the global damage value for the vehicle. You must manage that manually. It's complicated by the fact that doing a setDamage will set the value of every hit point. So, after you do the setDamage, you have to setHitIndex (or one of its equivalents) to get all the hit point values where they should be. Once I figured that out, I looked at the ACE code you highlighted, but it didn't make sense. Then I noticed that they straighten out the hit point damage values right after the section you highlighted. So the algorithm is: 1. Save the hit point damage values 2. Compute a global damage value representative of the hit points (ACE excludes glass and hit points that are aggregates of other hit points ("depends=1")) 3. setDamage with that global damage value 4. Set all the hit point damage values from the saved values The reason that you must manage the global damage value is that the vehicle explodes when that value crosses the 0.90 threshold, and new damage only increases the global damage value. So do 0.80 damage to a vehicle and the global value is 0.8. Set all the hit points back down to 0.0 and the global value stays at 0.80. Do another 0.11 damage to the vehicle and the hit points will go to various representative values around 0.11 or so - but the global value will jump to 0.91 and the vehicle will go boom.
  16. Posting the 400 lines of script for the system probably wouldn't result in a very productive discussion. It's not pertinent anyway. The question is this: why would a vehicle show zeroes for all systems via getAllHitPointsDamage when I can get a non-zero value from damage?
  17. It's just a straight join. No magic. It worked out that the problem was that groups, like vehicles, are owned by various machines. So I had to remoteExec the join on the groupOwner's machine - which is a client. Limited testing suggests that it works just fine. [_unit] join _group became* [[_unit], _group] remoteExec ["join", groupOwner _group] Note that if you're working with groups of AI on the server, there's no need to worry about this because the server owns all those groups. Everything is local to the server, and no remoting is necessary. *Not verified for accuracy. I remoteExec a short script instead of the join directly.
  18. I can't seem to get this to work reliably. I have an EAST or CIV faction AI, sometimes grouped, sometimes not, which is joined to the player's group. The join takes place on the server with AI that are controlled by the server. When run in an editor server session, I can reliably get this to work even when I'm using multiple clients. It is when the scripts hit the public, dedicated server that I see problems. Sometimes the AI enter the player group correctly. Sometimes they don't, but the players can transfer player group leadership to another player already in the group and the AI will show up. Sometimes they don't, and the leadership transfer workaround doesn't workaround. Is this likely some kind of AI ownership problem? A timing problem? I haven't been experimenting much with changing things around because I can't duplicate the problem locally. I was hoping that somebody else had already gone through this. Thanks for any help or insights.
  19. Would that it was that easy. Dialogs are modal, interpreting inputs with a different set of bindings. Those bindings are structured to permit navigation of the dialog's contents and nothing else - except as I noted above. In contrast, Displays are not modal and so there's no change in bindings and VOIP works perfectly well. Mostly, Bohemia just needs to correct this oversight as VOIP has nothing to do with the modality of an interface element.
  20. Absolutely. On the server, player is defined as objNull. Think of each of the clients and the server as separate boxes. There is information in each of those boxes, and when you want to run a script in a given box, you can only use the information in that box. Learning what information is available in each box, at what times, and under what circumstances is a critical part of writing multiplayer script for ARMA. When you start a session through the editor, you get a client and a server running in the same box. The client sets the value of player, so you can use it in your server code because they're in the same box. But that single box structure is not something you want to get used to because it's not how client/server applications work. It's cheating. When you start a session through a dedicated server, you get a server box. There is no client box, so nobody sets the value of player. Any server code that you run in the server box will look for player and get an objNull value. That said, the server keeps track of all the players in a list called allPlayers. You can use that to see which player objects have been created by various clients. When nobody has connected, that variable has zero elements. But it could have 1, 2, 10 or 100 elements, depending on how many clients are connected. So the server doesn't think in terms of "the current player". When you write script for the server that operates on a specific player, you have to somehow decide which player you want to operate on. You could perform an action on all of the players by just going through every player in the allPlayers list. You could also have a client tell your server to do something for its player via remoteExec. You can spot a player by virtue of something that it does. For example, activate a trigger. Then you'd have the player that activated the trigger and you could operate on that player. You can spot a player through various events as well by setting up event handlers on the server (addEventHandler) on each player and acting when those events take place. Make sure you understand the split between clients and server before attempting any multiplayer scripting. It'll be a nightmare until you do.
  21. If I have a satellite phone that I want players to be able to disable, I can put an action on it. They walk up, trigger the action and it's disabled. No muss, no fuss. But my players are equipped with all manner of weapons. Rifles, bombs, grenades, explosives, etc. I want them to be able to destroy that phone. I can't figure out a way to make that happen, or even to respond as if it was happening. It doesn't take any damage. I've tried enableSimulation and allowDamage. It doesn't take any event handlers that would allow me to detect impacts. I've tried Hit and HandleDamage. The only thing that occurs to me now is to attach some kind of proxy object to the phone (or attach the phone to it) so that when it gets destroyed, I can detect that. But I don't know of any innocuous or special objects where hits or destruction can be damaged. Or am I missing some other technique that turns these objects into something that can be damaged?
  22. If you read the base post, you'll notice that the object cannot take damage. Also, I could find no small, damaged objects. In general, things like this are just considered background props and aren't intended to be manipulated. I certainly greatly prefer events over polling loops. However, that's ultimately the same solution that @johnnyboy presented; detect a large enough force. If the only thing I was doing was detecting the hit, I'd go with the event. As it turns out, I have a loop that manages playing sound through the satellite phone, so I'm going to stick with what I have - which is @johnnyboy's approach. Reduce the mass of the phone by half, and watch for movement in a polling loop (or a significant force via the event handler). When I see movement, I turn off the sounds, throw some particle effects on the phone, and it's clear that it's not going to work anymore. The only question now is whether the technique will survive contact with a full server of players.
  23. Thanks, that's certainly not something that would have occurred to me. Unfortunately, it's a little too delicate a solution, so I'll just have to use other means that ARMA can handle a bit more robustly.
  24. ARMA 3 version 1.74.142559 Create a Blackfoot attack helicopter and execute the following script against it, where "_vehicle" is the Blackfoot. { _vehicle setPylonLoadOut [_forEachIndex + 1, _x] } forEach getPylonMagazines _vehicle; Get into the helicopter as pilot in first person and start the engine. Client crash. This doesn't happen if the engine stays off while the pilot is in first person or if the engine is on while in third person, so it looks like the instrument displays are causing the crash. I haven't tried this on any other dynamic loadout vehicle.
  25. This is a pretty simple problem which I'm able to duplicate in a vanilla mission. Scripts, but no mods. No calls to setCurrentChannel. Call channelEnabled on a disabled channel number and you'll find that the current channel changes. 4 enableChannel false; channelEnabled 4; channelEnabled 4; That will change the current channel twice. Keep throwing channelEnabled at it and it'll keep changing the channel. 4 enableChannel true; channelEnabled 4; channelEnabled 4; This will not change the channel because the channel being tested is enabled. This works whether the channel is disabled via either of the two available notations: 4 channelEnabled false; 4 channelEnabled [false, false]; Note that both voice and text must be disabled. If either is enabled, channelEnabled will not change channels.
×