Jump to content

Muzzleflash

Member
  • Content Count

    1001
  • Joined

  • Last visited

  • Medals

Community Reputation

111 Excellent

6 Followers

About Muzzleflash

  • Rank
    Master Gunnery Sergeant

core_pfieldgroups_3

  • Interests
    Little of everything

Recent Profile Visitors

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

  1. I use a modified version of the BIS functions. That also handles players changing their uniforms. https://forums.bohemia.net/forums/topic/226800-custom-insignia-not-found-in-virtual-arsenal-from-addon/?do=findComment&comment=3389078
  2. Muzzleflash

    remoteExec and JIP or not?

    I can see two possible reasons. First, have you actually verified that it is not an error on the wiki? That the command might be argument-local? The second is: it is the job of the server to synchronize with joining players so they are up-to-date on the world. So a joining player's machine will receive data about all vehicles among other things. And since the command earlier was run everywhere the server has modified the pylon in its "view". Aside from wasting memory to remember the "original" loadout of the vehicle, it would also be non-nonsensical to transmit it, since the server can presume its current data is the most up-to-date (it is in fact the authority on the matter). Edit: to give a guideline, you can expect most things that are under server control (local to the server) to be state sent to joining players. Whats excluded here is variable namespaces (e.g. setVariable, getVariable, that has not been synced), and some visual commands like setObjectTexture.
  3. Yes put it in some preinit file, either CfgFunctions - or just a single script that runs at preinit - to define the needed functions. I would not think of these issues in terms of latency (lag) or time (sleep). Instead think of it based on ordering - what (needs to) happen before something else? It is also the reason I see no need for all these other event scripts initPlayerLocal initPlayerServer, initServer and just use init.sqf; then I don't have to worry about any ordering issues between commands in those files.
  4. The problem with setObjectTextureGlobal and textures placed in the mission folder is that: you pass it a relative path to the texture in the mission folder; however, it will resolve to an absolute path, and then that path is attempted to be applied on other machines, which will not work since that absolute path is (likely) not valid on other machines. Instead, what I do, is apply the local version of setObjectTexture on all machines. If the billboard texture is never supposed to change, then you can get away with just doing this in the init lines: this setObjectTexture [0,"texture.paa"];
  5. It can be used in SP to use a texture placed with the mission. That is probably old stuff from before I finished converting BIS_fnc_setUnitInsignia to fully mission-MP compatible. I have removed it now since it is no longer needed.
  6. This is old stuff, from a modified BIS_fnc_setUnitInsignia, uploaded as is it with a few comments. It has been used successfully for many sessions so should work unless I made a screwup with putting it up now. It is missing the actual insignia texture used, and a mission.sqm for it to be a self-contained example. You can download the zip on the button to the right. Note my version is local by default and there is a global function too. https://gist.github.com/senevoldsen/3dd0f7171fc1080cf674a29569d1c5ee Forgot to write, this is only the script-solution part. To Virtual Arsenal to work you will probably have to do more changes to that. In that case the simplest solution is probably to make tiny addon with the insignia.
  7. I don't remember the circumstances leading to it, but I am the belief that setVariable does not work fully with that kind of objects. To the best of my memory, something about buildings/map objects not having identity the same manner as other vehicles. Buildings might be streamed in/out as you travel the map. I am guessing if you save/load the same might happen. Have you tried spawning the building instead and repeating the experiment?
  8. Muzzleflash

    Add all player UIDs to array

    You want to use 'apply' instead of 'foreach'. And you then need to switch the order.
  9. Muzzleflash

    Which Release Licence?

    While they might use BI tools "under the hood", you are not using BI tools directly, in fact you are "just" using Arma 3 via. the EULA I guess. Of course this raises the question whether you have a license to do anything with a mission file .sqm at all - I guess it enters the same category as whether you may legally sell a save game.
  10. UPDATE: You might just want to wait it out. See .kju post below. Path finding is really one of those things you want the engine to do the grunt work of. --------------------------------------------------------------------- Graph problems are a vast area with plenty of theoretical and practical considerations. For your basic problem, there are many simple algorithms to find a path between two nodes. You might be able to do all you want using just a single algorithm. Define "anywhere else". Search algorithms that work for enclosed areas are often not so good for open areas and vica versa. So I would advise the following considerations: - I assume you are running this in SQF, so you might avoid doing calculations that could be done ahead of time. - How many nodes are there? What is the typical and the max? - I am guessing these nodes are particular to a specific building model/class And regarding your bonus challenge: you may want to relax that it is the shortest, and rather just have it be one of the shorter but not necessarily the best. This depends again on how many nodes, but the problem is known as the Travelling salesman problem which is well studied. Basically for around ~30 nodes it is just not practical anymore. If you have say, at most 20 nodes, you might just want to compute the best way to get to *any* destination, e.g. where to go next. For 20 nodes you just have to fill an 20*19/2 = 190 element array (a matrix). So you are at node #5 and want to get to #17. You look up in the array for #5 and destination #17 and it says #9. You go to #9, and look up again for #17 and it says #2. You go to #2, and it says #17, you go to #17. Congratulations you have arrived at your destination. The benefits of this approach is you don't really need to "compute" in SQF, you just look up so it is much faster. Though this approach does not scale so well 30 nodes might be doable too, but 100 nodes will require almost ~5000 elements in the array (this might actually also be doable....). If you only have a few nodes you are starting/ending from, and most are just "intermediates", then you can use an even smaller array. For you bonus challenge, I humbly suggest using a minimum spanning tree instead and walking around that instead. Some time ago for fun I tried that approach to create patrolling waypoints. In this example, the outer blue circle is the area to be observed, the red circles are "subtasks" making up teh area. The black dots, which are the waypoints, are placed first in each of the red circled areas, and indicates places with decent vegetation/concealment the problem should go to and observe from. Then the green lines indicate the minimum spanning tree, to reduce travelling times. https://imgur.com/a/9CBkg
  11. Muzzleflash

    Match numbers place increase

    So the inputs are Min and Max. Say the "steps" move us along the X-axis, and on the Y-axis we have the value. Using just a linear function where the Y value is the element position in the output: "Y = StepSize * X + Min" where X is the same as Index in this case, it might take a long time (many Index) to reach Y >= Max as you already observed. So rather than that, let us use a polynomial (second-degree) and drop the step size for now and just consider this perhaps: "Y = X^1.8" (this looks like this, https://www.wolframalpha.com/input/?i=y+%3D+x^1.8+where+0+<+x+<%3D+1 ). The thing we are looking for here is whether the "curve" itself looks right. The normal linear is "Y = X^1". This one makes it rise much slower in the start and much faster in the end; notice the midpoint for X=0.5 is only about Y=0.3. So half of the values would be in the first 30%. By increasing, e.g. to ^3, half would be in lower 10% of the value. To use this we just need to map our index to 0-1 and map the output to the proper value. So how many values? Well you can easily pick that yourself: NNJ_fnc_Populate = { params ["_min", "_max", "_count", ["_pow", 1.8]]; private _result = []; // We iterate from 0 to count-1 and need to divide by count-1 anyway private _countMinusOne = _count - 1; private _maxMinDiff = _max - _min; for "_i" from 0 to _countMinusOne do { // Normalize the X value to between 0 and 1 (inclusive) private _xVal = _i / _countMinusOne; // Compute the normalized Y-value private _yVal = _xVal ^ _pow; // Map the _yVal back to the desired range private _value = _min + _maxMinDiff * _yVal; _result pushBack _value; }; _result }; // So if you want a 1000 values. private _min = 0; private _max = 5000000; private _valuesA = [_min, _max, 1000] call NNJ_fnc_Populate; // Or you want 3000 values distributed but rounded, and using ^1.2 // Note, if you round with a power too multiple elements in the beginning may be the same, e.g. zeroes and ones. private _valuesB = ([_min, _max, 1000, 1.2] call NNJ_fnc_Populate) apply {round _x};
  12. Seems like this thread went off the rails, but it can still get back on tracks.
  13. Muzzleflash

    Credits Not As Intended

    I think the problem is that valign only works in some containing box. You assume that cutText operate on the entire screen as that box, but I think it just creates the box with the top in the center and then the bottom whatever height your text have. If you look at the example here at the bottom https://community.bistudio.com/wiki/Structured_Text#SQF_Code_Examples you can see they wrap size=1 text inside size=3 to demonstrate - that way the "box" will be at least 3 units large. Though my guess is that you cannot do that since cutText will still place the "main box" center and below. So my bet is you will need to use https://community.bistudio.com/wiki/cutRsc or some other command.
  14. Have you checked what the view distance on the server is? Some mods or scripts reduce this - have often occasionally seen something like if: (isDedicated) then { setViewDistance 500; }; being run from scripts in the mission.
  15. You could go with a custom debriefing section https://community.bistudio.com/wiki/Debriefing#Custom_Sections . I have used this to show lots of miscellaneous information, like distance travelled on foot, or in vehicle, amount of time spent talking on task force radio, etc.. But I would try this first addPlayerScores if you can settle with just fixing the kill statistics.
×