-
Content Count
641 -
Joined
-
Last visited
-
Medals
Everything posted by mrcurry
-
Delete allmissionobject with an exception area
mrcurry replied to damsous's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Like this? allMissionObjects "All" apply { if !(_x inArea "markername") then { deleteVehicle _x; } ; } ; -
Script causing FPS drop after warlords update
mrcurry replied to frozenMan's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Relevant Code and a few answers please. 1. Have you tried isolating the issue by disabling parts of the code systematically? 2. How many icons are we talking? 3. How many calls to cursorObject are we talking? 4. Have you managed to replicate this in an empty mission? Edit: Based on your edit I would guess that's its something to do with error handling but that's a big maybe. Have you checked the log? Edit 2: 100 fps, yikes, and I'm used to 30. Man I need an upgrade...- 1 reply
-
- 3
-
How to make kill mission not be assigned at the start
mrcurry replied to Jubal Savid's topic in ARMA 3 - MISSION EDITING & SCRIPTING
1. Create your create task module 2. Create your trigger and configure it 3. Sync the two (right click > sync with) If you done it right the task should only appear when the trigger fires. Also please do a proper search before asking a question. This question is something that has been answered many times before. Please don't be wasteful of your own and other's time. -
Triggering a BIS Revive through script
mrcurry replied to mrcurry's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Yep, that did the trick. I remember looking at that too but tired eyes are blind eyes. Cheers! -
Triggering a BIS Revive through script
mrcurry posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hey guys, I've spent the last hour pouring over the vanilla revive systems functions and .inc files trying (and failing) to figure out how to trigger a revive through a function call instead of the boring old hold action. What I'm looking for is something akin to this player call fnc_reviveUnit which I can call or remoteExec from the server and/or client (I'm not picky) and it will handle all player states "automagically". The problem here being of course the contents of fnc_reviveUnit and that it needs to play nicely with the rest of the revive system. I haven't found any inbuilt functionality and I'm too tired to wrap my head around the rest of it tonight. If someone has some tips or something similar already set up I'd cherish your help. Otherwise I will give it another crack when my brain consists of something other than mush. P.S. Yes, I'm aware there are other revive scripts out there that can do this. No, I'm not changing to one of those. Why? Polish, consistency, ease-of-use, I'm grumpy and stubborn... take your pick. -
First, I assume you have narrowed it down to your mission by testing other missions on this server of yours. If yes I would start looking in code called on the server during init for intensive loops and also check the servers .rpt if there's any major spam going on. If all else fails show code!
-
multiplayer Multiplayer support system
mrcurry replied to Ry4nD's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Maybe it's just me but isn't this line a bit nonsensical? Or are we just talking pseudocode here? if (typeOf (_this select 0) isEqualTo "player") then { (_this select 0) returns the player object, typeOf always returns the config name of the unit's class, such as but not limited to "B_recon_JTAC_F". Therefore the typeOf (_this select 0) will never be equal to "player" and the if will never execute. This pseudocode should get the ball rolling: On mission start Add link between requester and supportprovider(s), can be done using sync in eden. On mission start and player gear updated Check : Player has valid radio? If yes : add requesters using BIS_fnc_addSupportLink. Which provider you pass to it doesnt matter, in theory you only need to establish a link between the player and the requester. If no : remove the link between player and requester using BIS_fnc_removeSupportLink The tricky part is checking for gear updates. Put and Take eventhandlers should be fine for a non-arsenal missions but for a mission with Arsenal access you need to hook into the arsenal closing, take a look at Larrow's post here for a reference on how to do that. -
Have you tried doing the fade in steps like so (pseudo): ctrlSetFade 0.5 ctrlSetPos x, y ctrlCommit 5 Wait until ctrlCommited ctrlSetFade 0 ctrlCommit 5 Of course you'd have find the appropriate value for the first fade but linearConversion can help with that.
-
Error in problem description. Data received is inadequate. What is start lens? Awaiting further instructions.
-
Variables from description.ext
mrcurry replied to pierremgi's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Really depends on when you expect the data to be used. I just chose pre-init cause it guarantees execution before most if not all other scopes. -
Variables from description.ext
mrcurry replied to pierremgi's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Silly me, myVar[] = is a array declaration and requires { } around the array not [ ], the array declaration also seems to be processed before the __EVAL since the error thrown is for _ not [ or ". We also need to remember that configs only support simple data types like scalar, string and nD-arrays consisting of scalar(s) and/or string(s). If you really need to return an array of CONFIG types see the "if all else fails" at the bottom. So I finally popped on my main PC and did some tests of my own. Array as config entry This is the best I've managed to come up with so far that is along your original line of thought. Keep in mind we have to convert the configs into simple data types if you want to store it in description.ext or any other config file: //description.ext myVar = __EVAL ( "getText (_x >> 'DLC') == 'CUP_Weapons' && getnumber (_x >> 'scope') >= 2 && (getNumber (_x >> 'type') in [1,2,4])" configClasses (configfile >> "CfgWeapons") apply compile "configName _x" ); //runtime call private _classes = parseSimpleArray getMissionConfig "myVar"; //or private _classes = call compile getMissionConfig "myVar"; Yes that "apply compile" is required, __EVAL does not take kindly to the } bracket and makes the preprocessor interpret it as eof for some reason. Now I haven't tested if the "call compile getMissionConfig" is faster than the just straight up calling the configClasses and apply during runtime but it does achieve the "array as config constant" criteria. Pros: Mod version independent, pretty much no upkeep. Cons: Requires a call to parseSimpleArray, a runtime compile or similiar action. For big arrays this might be a big no no. Optimisation A possible optimisation, that might be impossible, is to somehow convert the value from the above __EVAL to an array-type config entry similiar to this: myVar[] = {"class1", "class2", ... , "classN"}; The problem is I have yet to figure out a way to do this using the preprocessor. I suppose treating the returned array like a string and doing a find & replace might work but that's a big maybe. You still have to get around the fact that myVar[] = expects to be followed by a {} pair. The easy way Another option is to just straight up define the array with classnames like below, this method does make mission upkeep a bit more involved since every update to the mod or vanilla might mean you need to update the list. The runtime call should be fast though which is nice. //1. Get the array using configClasses apply {configName _x} in the debug console. //2. Copy the result to your favorite text editor. //3. Replace the first [ and last ] with { and } //4. Paste the into the config like so: //description.ext cup_weaponClasses[] = {"class1", "class2", ... "classN"}; //runtime call getMissionConfig "cup_weaponClasses" //Returns an array of classnames If all else fails A global variable computed during pre-Init has never hurt anyone right? ^^ The goal is to get the array-assembly out of runtime code so it doesn't have to run multiple times to regenerate what is essentially a static data set, correct? If so setting up a pre-init function to compute the array contents is probably the best bet. You'll have full access to all SQF data types and don't have to pull your hair over config syntax. -
Variables from description.ext
mrcurry replied to pierremgi's topic in ARMA 3 - MISSION EDITING & SCRIPTING
The output of your _EVAL is interpreted as a string, try myVar[] = _EVAL(... Note the brackets -
Variables from description.ext
mrcurry replied to pierremgi's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I feel this part of the code optimization page might be relevant to the discussion: https://community.bistudio.com/wiki/Code_Optimisation#Constants_2 @Dedmen is correct though, #define DUDE 1 does not declare a variable DUDE which is equal to 1, it merely let's the preprocessor know to replace DUDE with 1 when preprocessing the current file. Writing if( DUDE == 1 ) would in runtime execute as if( 1 == 1 ) -
setVectorDir with slow speed
mrcurry replied to Barba-negra's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Do it incrementally, say once per frame. Pseudocode: dir = 0 step = 1 On each frame dir = dir + step object setDir dir This is of course simplified. Since your working with setVectorDir the exact math depends on how you want rotate it. For a 2D rotation around the Z-axis it is easier to use setDir with BIS_fnc_setPitchBank instead. If you want full 3D rotation look into Axis-angle rotations but beware that working with 3D vectors can be tricky. -
Getting into an occupied enemy vehicle.
mrcurry replied to Twiznak's topic in ARMA 3 - MISSION EDITING & SCRIPTING
To reiterate a previous question: do you have to have 3 sides as AI and the player as renegade (essentially simulating 4 sides) to achieve what you are looking for and why is that? Cause if you can avoid it you are going to save yourself a metric ****-ton of headaches. -
How to setPos a set distance/direction from object?
mrcurry replied to pappagoat's topic in ARMA 3 - MISSION EDITING & SCRIPTING
private _start = _dz getPos [5000, 90]; private _end = _dz getPos [5000, 270]; Assuming of course that _dz contains the position of the mapclick. -
Voronoi Diagram using Fortune's Algorithm
mrcurry replied to mrcurry's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Yes, see further down. Sorry! The Wiki page is quite heavy, my bad, and Voronoi diagrams are pretty abstract as is. Took me a few weeks to wrap my head around them well enough to implement it. Totally worth it though. :) Below are some example use cases but first a few things to keep in mind: - All the points passed into VOR_fnc_getEdges are in the examples referred to as "sites". - Any given voronoi edge will always be halfway between it's left site and right site. That means any point along that edge will always be the same distance from both of those sites. - Any given voronoi vertex (where 3 edges start or end) is always the same distance from the 3 nearby sites and thereby at the center of the circle whose circumference coincides with those sites. 1. Largest empty circle queries Imagine you're deploying AA positions and need to find a location to place the next one that minimises overlap with other AA positions. You can generate a voronoi diagram with the already existing AA positions as sites. By placing the new AA position at the vertex which is furthest from it's site(s) you will ensure maximum coverage using the minimum amount of AA positions. 2. Collision-avoidance Credit for this idea goes to @Ed! and his post over here: https://forums.bohemia.net/forums/topic/190653-voronoi-diagram-fortunes-algorithm/ Using obstacles' positions as sites you can generate a voronoi diagram where objects placed at the edges of the diagram will have a low likelihood of colliding with those obstacles. Useful when placing a large number of objects. 3. Pathfinding From a voronoi diagram you can construct a graph that a scripted AI can use to find it's way along the sites. This is the main use I have for it with my current project where I can generate waypoints in such a way that AI units avoid areas controlled by the enemy. 4. Organic-looking structures A voronoi diagram and it's cells may be a good way to represent areas of control or the result of linear growth. For example if the sites represents things like military bases and FOBs the cell belonging to that site can be thought of as the area that particular base would reasonably control. This in turn could create a believable division of an AO with little manual input. Hope that helps a bit. -
Voronoi Diagram & Fortune's Algorithm
mrcurry replied to Ed!'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
This is a gonna be a bit of a necro and but hey, this might be what you're looking for. -
Ah yes sorry... reading helps. :) If you got an example (position) of the trees in question and I can try giving it a replicate tonight.
-
Check the config which script the module runs on and use that, unPBO it if you need more details.
-
Marking player position on death in the map
mrcurry replied to Rawshark's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I believe it's by design George, the code makes each client manage it's own set of local markers. It's a good way to keep network traffic low since each update needs to be broadcast otherwise. I am a bit confused as to why the "setMarkerXXX" aren't using the local variant though since AFAIK they would make the local marker go global. @pierremgi Can you clarify? -
Location location?
mrcurry replied to NumbNutsJunior's topic in ARMA 3 - MISSION EDITING & SCRIPTING
It works, really, though add an "s" to nearestLocation so it becomes nearestLocations. Alternatively if you want just one location use nearestLocation: _loc = nearestLocation [getPos player, "nameCity"]; nameCity might need to be changed to nameCapital, NameVillage or one of the other classes in CfgLocationTypes. A third option is just to get away with locations all together and just place a game logic where you want it, name it and use getPos. -
How do I set a camera straight downwards or tilt it a few degrees?
mrcurry replied to Purzel's topic in ARMA 3 - MISSION EDITING & SCRIPTING
It's probably being overridden by something, show the updated code. -
Is it better to have multiple functions or 1 big function ?
mrcurry replied to xjoker_'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
Dito. In general I'm all over the functions library however I do like using the single-file approach to get some "data-encapsulation"-like behaviour. I find single-file to be perfect for standalone modules that are ported a lot, but man you better comment those bad boys and do so well. -
Point out a building to players at distance through optics
mrcurry replied to Tankbuster's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hehe, you might think so but do not underestimate the value of simple work. It was a great opportunity to recharge from working on this. ;)