#arma3_scripting
1 messages · Page 527 of 1
FFS 😠
@still forum Which extension do you use for sqf?
SQFLint from SkaceKachna
and SQF Language from Armitxes
Ah I see, didn't know I can have both
how you do it in notepad++?
I use some SQF highlighting thing in N++. But for anything where I'm writing more than just a few quick lines I use VSC now
@tough abyss by going to https://notepad-plus-plus.org/contribute/plugin-howto.html and then digging through the way how arma.studio rewrite is doing it
https://github.com/SQFvm/ClrBridge
https://github.com/ArmA-Studio/Arma.Studio/blob/Rewrite/Arma.Studio.SqfEditor/SqfEditor.cs
hint the SQF-VM part is the easy one
yes
it is not even that complicated
just that one needs to dig through the documentation of Notepad++ plugin API once ...
will look into it more indepth at lunchbreak
maybe some SQF support for notepad++ will come out in the end 🤷
so SQF-VM could be a N++ plugin? ^^
press F5 → error on line 33, provided Number, expected String
billw already did a nice job with his task stuff
Then we have another proprietary implementation instead of going with a standard language-server approach that can easily be embedded into many IDE's instead of just one specific one.
Which btw is currently also being worked on
well ... it is more a "quickNDirty" method then anything else 😄
https://github.com/Predelnik/DSpellCheck/blob/master/src/Plugin.cpp and this is essentially how it could be done 🤔
abusing spell checking for linting 😄
@daring pawn you can check behaviour of unit. If anyone in a group knows about an enemy unit, the whole group switches behaviour to "COMBAT"
Does anybody here know how to disable the randomization on 3CB Faction Vehicles? I tried it with the module but the Lada 1500 still changes the paintjob.
could one please quickly check what the outcome of 1 != "" is?
talking about: wether or not there is an error message here
or if it just returns false
Error Generic error in expression Returns nothing
👍
Comparison of different types via ==/!= should always error out afaik.
@fallow coyote did you try disabling BIS randomisation?
_vehicle setVariable ["BIS_fnc_initVehicle_customization", false, true];```
Yea, didn't work
@hollow thistle he wanted to know if they are implemented as seperate commands, or built into one command.
But they are seperate
what do you mean? Like OBJECT == OBJECT and NUMBER == NUMBER are different commands?
bool == bool doesn't exist in SQF
whatever, you know what I meant. (edited)
yes
they are different commands
unlike isEqualTo
which is just one ANY isEqualTo ANY command
https://github.com/acemod/ACE3/blob/16ed2a82c2d3b743da83dc0455c1f56f1837ff76/addons/medical_treatment/functions/fnc_actionPlaceInBodyBag.sqf
This is not Arma 3 vanila related but if anyone knows, I did not managed to make this function work, any Idea?
What did you try?
Place a dead unit on a bodybag
Used [player, cursorTarget] call ace_medical_treatment_fnc_actionPlaceInBodyBag looking at a dead unit
returns nothing
Try cursorObject
and isNil "ace_medical_treatment_fnc_actionPlaceInBodyBag" is returning true, and already tried cursorObject
Rip, any other way or I do have to make the body bag manualy?
Just take the code from the function and run it =D
there is some commands that does not work like TRACE_2 and QGVAR that I guess is some deep scripting stuff that I dont know.
QGVAR(varname) is just `"ace_addonname_varname"'
"Just take the code from the function and run it =D" doesn't work
Look up how it was called in the old ace version
Sure it won't be fully integrated, but just to replace a body with a bodybag L33-L47 will get it done.
Does anyone here know how to kill a sound being generated by a vehicle after simulation has been disabled on the vehicle? I've looked for #soundonvehicle, mission objects, near objects, you name it objects and I can't find anything to kill off.
Like the engine running sound?
You could just set fuel to 0 to kill the engine maybe?
(or turn the engine off by script)
It's a little more challenging than that. It's the sound of water lapping the side of a boat.
If you're near a boat in the water and you turn simulation off on the boat, you'll be forever stuck with the sound of the boat in the water.
lol
any particular reason to disable simulation on the boat?
are there so many of them that it matters?
Let's assume that there are thousands of them so that we don't have to second guess the motivation behind the technical request.
just making sure its a needed feature, not just over optimizing
off the top of my head I cant recall anything to stop a sound playing though
if its some sort of simulation type tied sound or envrionmental sound theres not script access to those
Just put down a few boats on dev , no splashing sound
waitUntil {{{alive _x}count units _x == 0}forEach _activeGroups};
I have 4 Groups Bravo 1-1, Bravo 1-2, Bravo 1-3, Bravo 1-4 that get created by a script and put into an array _activeGroups.
If Bravo 1-4 is all dead, the waitUntil fires as true pre-maturely but if Bravo 1-1,1-2,1-3 all die nothing happens until 1-4 is dead.
Does anyone know why this is?
because foreach returns the result of the last iteration
something like this might work 🤷
waitUntil {
({alive _x}count units _x == 0} count _activeGroups) == count _activeGroups
};
Ah no shit, is there an equally condensed way I can do that to make sure all the groups have nobody alive in it?
beat me to it
I'll give it a spin
Is there anyway to view/modify the players sound settings by using profileNameSpace, seeming settings are saved to the profile? I'm trying to detect if the players music volume is muted, if so then unmute it. I've tried using musicVolume, however that only detects the musics faded value from fadeMusic.
@robust hollow https://i.imgur.com/GXQfpDO.png unfortunately
oops.
waitUntil {
({{alive _x}count units _x == 0} count _activeGroups) == count _activeGroups
};
I googled now a while and since my eyesight isnt the best, fiddling around with the objects to put into boxes isnt too viable to create my lists.
is there a way i can extract from the config files what i need? But the informations to such things are extremely cluttered. I wanted to get magazines with or without magazine sizes. Scopes, Laers, supressors and so on.
Is there a source that shows examples of all that except just weapons, or just vehicles? Because that way i would get the mod stuff too. The config lists on the wiki are only for arma
is there a command to get always a positive value? Like i give it -10 and get 10 back but then i give it 5 it gives 5 back?
Yes, in the science of Maths it is called 'the absolute value': https://en.wikipedia.org/wiki/Absolute_value
In sqf it is achieved by this command: https://community.bistudio.com/wiki/abs
Thanks. I know it in match science. But the right translation was missing. My bad.
would this be correct?
if(!((_name in _list1) && (_name in _list2))) then {awesome};
Found out (run arma to test ^^ is there a offline tool?) - Correct would be:
if(!(_testname in _list1) && !(_testname in _list2) then { was not found};
For that i can check through all my lists if a item was not found. Because so i can go around an error if i have something not in my lists and the script runs through fine anyways but tells me that an item was not found instead of throwing an error and discontinuing to work
you could all list to one firstly and then test for it. Just in case you wanna have more then 3 list
Already did. I put all my lists into one array and checked that ^^
forgot that i can do that.
I want to use this function:
hint _bluGrp1Hint;
bluGrp1 = [newBlu1Pos, WEST, ["B_Patrol_Soldier_AR_F", "B_Patrol_Soldier_MG_F", "B_Patrol_HeavyGunner_F"]] call BIS_fnc_spawnGroup;
bluWP1 = bluGrp1 addWaypoint [CenterMrkr, 0];
bluWP1 setWaypointType "SAD";
};```
but this doesn't work:
```waitUntil {{ alive _x } count units bluGrp1 == 0};
Respawn_BluGrp1;```
@glass frigate ```SQF
Respawn_bluGrp1 = {
hint _bluGrp1Hint;
bluGrp1 = [newBlu1Pos, WEST, ["B_Patrol_Soldier_AR_F", "B_Patrol_Soldier_MG_F", "B_Patrol_HeavyGunner_F"]] call BIS_fnc_spawnGroup;
bluWP1 = bluGrp1 addWaypoint [CenterMrkr, 0];
bluWP1 setWaypointType "SAD";
};
[] spawn {
waitUntil {{ alive _x } count units bluGrp1 == 0};
[] call Respawn_BluGrp1;
};```
@modern sand It didn't work. it never fires off the [] call Respawn_BluGrp1;
Well then it's to do with your waitUntil condition
how to make use a respawn areas work regardless of the terrain layout (ie possible water below)? like if you want to dynamically generate offmap respawn locations
would you move respawned units to [-10000,-10000,10] and apply local enableSimulation false on all network entities, or different? also is this safe with JIP and players disconnecting?
@modern sand what about undefined _bluGrp1Hint, you don’t think this has anything to do with function not working?
Why do you need to move units off map, you can hold units from spawning by adjusting respawn time on the fly @velvet merlin
question about "waitUntil". If I have multiple "waituntil" does the first one hinder the execution of the ones below? or do they run parallel?
waitUntil {{ alive _x } count units bluGrp1 == 0};
hint _bluGrp1Hint;
bluGrp1 = [newBlu1Pos, WEST, ["B_Patrol_Soldier_AR_F", "B_Patrol_Soldier_MG_F", "B_Patrol_HeavyGunner_F"]] call BIS_fnc_spawnGroup;
waitUntil {{ alive _x } count units bluGrp2 == 0};
hint _bluGrp2Hint;
bluGrp2 = [newBlu2Pos, WEST, ["B_recon_F", "B_Recon_Sharpshooter_F", "B_recon_M_F"]] call BIS_fnc_spawnGroup;
waitUntil {{ alive _x } count units opGrp1 == 0};
hint _opGrp1Hint;
opGrp1 = [newRed1Pos, EAST, ["O_soldierU_F", "O_SoldierU_GL_F", "O_Urban_Sharpshooter_F"]] call BIS_fnc_spawnGroup;
waitUntil {{ alive _x } count units opGrp2 == 0};
hint _opGrp2Hint;
opGrp2 = [newRed2Pos, EAST, ["O_recon_M_F", "O_recon_F", "O_recon_medic_F"]] call BIS_fnc_spawnGroup;```
script stops at every one of them
so hinders execution of the following until its Condition is true
you would be better off with a loop to check the conditions with a 1-5s sleep depending on your need for accuracy
@mortal yoke Thanks I will try that.👍
(to clarify : one loop, not multiple 😄 )
you could also use CBA waituntilandexecute if you use CBA, then formatting would be very close to waituntil but wouldnt hinder following expressions
alright, shop script is now completely update proof if anyone, arma or 3rd parties add ne equipment in. Sweet sweet.
@tough abyss sorry missed your response. players can be revived - i dont like to hack the old respawn mechanic
👋
any suggestions how to handle offmap playable units to not fall into water, and not be possible to interact with while waiting for getting into the game?
whats 'offmap' in that context?
Hmm, maybe make them invisible and disable simulation during the init phase.
The unit's init line is probably the safest cause, considering the init*.sqf's are in scheduled env.
I'm trying to make Vcom and acex HC ignore all uavs. Is unitIsUAV the only way to check for them?
put them on a platform 10km in the sky
good idea. is there anything from to use or make a custom one?
enableSimulation false, no? if they are not players but only playable
Else you have concrete blocks and ramps that could do (or a carrier 😄)
well... make a 72x72 box in OB with roadway and export...
30sec job
apply transparency so you cant see it so easily in the distance
well the game mode should be mod free
for IFA3 we could add it, but otherwise its bad
lord, i remember having to try and conceal a platoon of playable units on the little islands off utes. thought there must surely be a better way (and that you'd have found it for BK).
as crew in boats?
@velvet merlin you may want to go for VR blocks
yeah one per person probably works
will do some experiments and report back tomorrow/coming days
you can also add invisible walls for them not to fall off… or not, depending on how cruel you want to be 😄
Is there any way to non intrusively handle the result of a function even if it is nothing? i.e.
_fn = { private _a = 0 };
private _val = call _fn;
I guess not, I just make sure that I return nil in some of my functions that must return a value to comply with framework
yeah I noticed that in a few places :/
that will be very helpful!
can't find it :U
Commy found it for me https://github.com/CBATeam/CBA_A3/blob/master/addons/common/fnc_directCall.sqf#L31
oh nice thanks!
lol
Might aswell just fix that bug.. 🤔
oh wait is the isNil that wraps the call a critical part of that?
it would make the entire block an atomic operation wouldn't it?
yes but this function calls code unscheduled 🤔
actually I don't understand how it works
I guess it passed arguments through _this
then what is _x ...
good okay thanks
apply is array apply code, and as the array it gets [_x], where is [_x] define?
i still don't quite understand it in that context though, where is _x coming from?
nowhere
doesn't need to come from anywhere
just need to have one value in the array
whether it's nil doesn't matter
I guess we can just do [nil] apply {} then
[1] would be faster probably
I mean it can be potentially getting _x from some upper scope
hmm okay i was going to do [_args] apply { _x call fn }
I guess it isn't necessary though
and misleading as to the real spooky intent
private _result = ([0] apply { _this call _fn}) select 0; is working for me
you can use param instead of select to give it default value if you want
thanks but nil works fine for me
no need to pass _this manually
oh true thanks
although actually, unless there is a downside i think it is probably clearer in the intent, i.e. this is a pass through function
very slight performance maybe
is checkVisibility broken somehow? I cannot for the life of me to get it to return anything other than 1
while{alive player} do {
_nearMen = (player nearEntities["Man",25]) - [player];
{
_canSee = [objNull,"VIEW"] checkVisibility[eyePos _x,eyePos player];
if(_canSee > 0) then {
hintSilent parseText format["I've been seen: <br/> %1 <br/> %2",_canSee,_nearMen];
sleep 1;
};
} forEach _nearMen;
};
Reserve any comment about quality, I just don't see why this doesn't work
even when there is a giant wall between the two
I know that checkVisibility does work at longer ranges because I use identical code for ray checks in CF_BAI/detect routines and have successfully tested all parts of that algorithm. But I don't bother checking below the AIs default instant vision point (200-325m dependent on skill) since there is no point.
One thing I did notice was in checking to see how the routine interacted with vehicles I found crew of everything could see targets with this check, which is obviously wrong since many are inside a vehicle with no vision out. So there is definitely some funky behaviour going on that I have seen and given what we have seen the AI do in close quarters I suspect they just see through walls nowadays and this function being broken in this way would explain why.
perhaps you need to be changing lod filter for vehicles. I wonder if the view geometry is wacked
anyways, yeah I don't see any work around for this
too low level
Another to waste time putting on the tracker? Who am I kidding it has probably been on there for years already.
Actually, this one might not be
@tough abyss if you were tracing from vehicle out then it is expected as the surfaces of vehicle polygons face outward. Try maybe trace from outside to inside of vehicle
TheObject = "test_EmptyObjectForFireBig" createVehicle position this;
TheObject attachTo[this,[0,1.5,-1]];
this setHit ["hithull", 0.95];
this setHit ["hitengine1", 1];
this setHit ["hitengine2", 1];
this setHit ["hitvrotor", 1];
this setHit ["hithrotor", 1];
this setHit ["hithrotor", 1];
this setHit ["hitfuel", 0.95];
this setHit ["hitglass1", 0.95];
this setHit ["hitglass2", 0.95];
this setHit ["hitglass3", 0.95];
this setHit ["hitglass4", 0.95];
this setHit ["hitglass5", 0.95];
this setHit ["hitglass6", 0.95];
this setHit ["hitglass7", 0.95];
this setHit ["hitglass8", 0.95];
this setHit ["hitglass9", 0.95];
this setHit ["hitglass10", 0.95];
this setHit ["hitglass11", 0.95];
this setHit ["hitglass12", 0.95];
this setHit ["hitglass13", 0.95];
this setHit ["hitglass14", 0.95];
this allowDamage false;
sleep 20;
this allowDamage true;
Dosen't give the setHits, this is vehicle init, don't judge lol, first script I've ever tried to make.
you cant sleep in init
Seems to work?
seems
I can crash the heli right down and it won't take damage
but if I do it later it explodes
soo
magic probably. you cannot sleep in init
ok whatever
don't need help anymore, fixed it.
@winter rose are the (invisible) walls/surfaces to use?
@winter rose tx
How am I supposed to understand this condition in ACE ?
{1 == getNumber (configFile >> "CfgVehicles" >> (backpack unit) >> QGVAR(hasWirecutter))}
It looks like it is true when the backpack has ace_logistics_wirecutter_hasWirecutter = 1 in its config. Am I right ? And is there a specific reason to use 1 == blahblah instead of the more common condition shape of blahblah == 1 ? Is it strictly the same thing ?
order doesn't matter
One guy is specifically doing that. while every other dev does it the other way around
but we have no style rule about that so everyone do as he pleases ¯_(ツ)_/¯
{((ɹǝʇʇnɔǝɹᴉMsɐɥ)ɹ∀ΛפQ << (ʇᴉun ʞɔɐdʞɔɐq) << ,,sǝlɔᴉɥǝΛƃɟƆ,, << ǝlᴉℲƃᴉɟuoɔ) ɹǝqɯnNʇǝƃ == Ɩ}
Lucky you dont have upside down guy
Are map markers supposed to slow down the game even if they have been removed?
I had 3k markers placed by script and deleted them. The FPS didn't go back to normal.
They should free the resources (in theory)
Did you do anything in between or did you just create and remove them instantly?
I might know what happened. Gonna test that and see if the fps go up again.
So what happened @cosmic lichen ?
Can't say, I am not at home currently 😉
But I think it was not caused by the markers.
@tough abyss you'd be surprised how much drawXXXX stuff map can take
its a map, the game doesnt need to render persons view so there is more power to map drawing
I cant say for draw icon or ellipse but drawTriangle can easily draw thousands of them
not commands, triangles
the call to command is costly not the call to draw
how it works? ```
Added: New scripting commands for simple graphs: getGraphValues, decayGraphValues, ctrlSetPositionX, ctrlSetPositionY, ctrlSetPositionW, ctrlSetPositionH, bezierInterpolation
from lastest update
The wiki doesn't know, so I assume noone here knows either 😄
😄
in-game autocomplete or F1 press may help you in the meantime
uuh beszierInterpolations sounds interesting
maybe they are plotting something?
Well it's a wild assumption!
😆
I love the new customWaypointPosition scripting command. It's amazing!
CtrlSetPositionX is ctrlSetPosition for single value
All those commands were on dev for ages now, you people act like you have seen Santa Claus
I have his phone number if that counts for anything :)
So your parents never told you?
Told me what??
He is not real?
Has anyone tried to use calculatePath after the update? For some reason, the game doesn't even know about this command
Because it is not in stable?
Yeah... So what?
What am I looking at?
fuck, really on 1.93 lol
You are looking at a changelog that says nothing about calculatePath
ye ye, my mistake
1.92 has been ready for about a month already. The new commands came.. 2 weeks ago?
Some were there for quite awhile
I'm updating some arsenal restrictions in a mission, anybody happen to know an easy way to get the classnames of all magazines one could use in, for example, a regular MX?
magazine wells!
Got this problem with helis. If I spawn in a basic Heli and give it move waypoints in the editor it is fine, but as soon as I add scripts to it and give it a Variable Name it only flies straight up and ignores any order. Tried flyInHeight but to no avail
@wispy cave do you have CBA?
Yes
CBA_fnc_compatibleMagazines then
https://github.com/CBATeam/CBA_A3/blob/master/addons/common/fnc_compatibleMagazines.sqf
["arifle_MX_SW_F"] call CBA_fnc_compatibleMagazines
tnx
exitWith inside of an if statement that is inside some code (squiggly brackets) returns from the code not the if statement right?
should return from if statement
if you need to exit upper scopes, use breakOut or breakTo commands
it will exit that else statement
ah
I have another question sorry is there a way to test if the classname for something is a mortar vehicle or static mortar that would hopefully work with mods?
getNumber (_vehicleCfg >> "artilleryScanner") should work
Can someone point me in the right direction for replacing the default 'bullet hole' texture that is created when a round strikes the ground?
Specifically in the VR map, if that matters. Plz @ me if you have any ideas. Thanks!
Hmmm, is switchMove executed globally, I see it changes on the wiki on 20 Oct 18 but I'm not sure whether I trust it :/
@craggy adder might be hardcoded in the surface material, in which case you can't reaaaally change it besides fully replacing some Arma pbo's
Aw. Thanks anyway
Making a little paintball game and I can easily create little dots on the objects I place, just can't do the ground.
Question for optimization - lets say I end up with 5,000 'paintball splats' on the objects. I'm currently just using createVehicle with the yellow sphere class. If I used a custom texture file for more realistic splats would that be crazy hard on the rendering engine?
I'm guessing no from what I know about instanced rendering
simple object instead of createVehicle
if it's a simple model with a texture with a simple shader, it supports instancing which makes it really cheap
Not sure which shaders support instancing though. Afaik Super shader doesn't
That's something I'm unfamiliar with. How do I know which shader a particular model/texture is using?
I would 100% find a premade model to use
I'd say make your own model. Just a simple two triangle plane
if possible
ACE has a tagging system. Spray painting onto things. I think they might use a vanilla model
there are some plane models which are just a 2x2m quad
I tried getNumber (_vehicleCfg >> "artilleryScanner") == 1 with _vehicleCfg replaced with my classname but it gave me a generic script error
nevermind I fixed it
~~My code that I wrote to change zeus unit costs isn't working and I can't figure out why
The code: https://pastebin.com/biXE4jJi~~
I'm trying to get it to only show some blufor units, the sandbag barriers, some modules and hide everything else but it shows everything
nvm I fixed it
sqf functions don't do any kind of closure right? i.e. capturing environment where they are defined. They only inherit the environment where they are executed?
e.g.:
private _v = 5;
private _fn = { diag_log _v; }
If I then pass _fn off somewhere else, maybe into a spawned script or something it will have an error because _v isn't defined? Or it will capture _v from where it is defined here?
error if a _v var doesn't exist where you execute the code
you should use "private" keyword to ensure _v is not used from outside the script
that isn't the issue, I'm just trying to work out if i can do something like closures
{} is not evaluated unless you call it spawn it do it then it else it while it or whatever. So you can toss it around like a hot potato, it wont capture shit @ebon ridge
scripted. It is the same as onPauseScript, only it is unscheduled and can be stacked
scripted
[missionNamespace, "onGameInterrupt", {player setdamage 1}] call BIS_fnc_addScriptedEventHandler;
press Esc after you added
Hi all, just looking for a little help. Is there anyway to pass code when a addAction is used? Example is:
When a player uses a addAction, it executes the script (duh) But also runs something along the lines of -
removeAllActions this;
I hope that makes sense?
{ 123 call alsoCallThisPlz; 456 call theMainThingIWantedToCall;}
Something like this?
In the script field of addAction
Or you want to attach your code to addAction added by some other addon/script?
My main problem is, the addAction is attached to a laptop. There will be multiple laptops. All of them executing the same script. The problem is that I want to only be able to hit each one once. The amount of laptops placed is randomly generated.
So I cant just set a variable to each addaction, because they all execute the same script so removing one specifically seems impossible.
I am not great at explaining over text, hopefully what I wrote made sense.
just store the array with all notebooks in some global variable
then iterate through them and remove all actions from each of them
oh wait, I read you wrong
well addAction has a parameter 'arguments' (3rd one), you just pass the laptop object to the action
then retrieve it inside the action handler
The object to which action is attached is already passed as argument to the action code, no need to pass it inside custom argument as well
Oh yeah, you are right, my bad :D
Carefully reading the addAction wiki page answers all his questions actually
How can I force the player (while in first person) to look in a certain direction inside of a vehicle?
No can do, but you could either disable the mouse with a UI trick, or create a camera and set it in lieu of his head
Mhmmm, thanks for the reply. Seeming I'm trying to create a cutscene and once the cutscene finishes the player is put inside of a vehicle and is set into first person. However, each time the player is looking in a random direction inside of the vehicle (like at the roof of the vehicle). But I want them to be looking straight forward
How do you put player inside the vehicle?
player moveInCargo _vehicle;
What vehicle is it?
The normal civilian Caesar BTT, not the racing one.*
Yes
It resets look when in
You're changing the camera to internal view before moving into the vehicle correct?
or after?
After moveincargo
Even before doesn’t make a difference
Yeah
Sometimes it works and sets the players view direction straight forward, majority of the time it's random.
Always look at the seat in front
1.92.145649 new PROFILING branch in #perf_prof_branch with more fixes/goodies
Just had one of those "WTF did i do" moments
#justprogrammerthings
Hey, @pure raptordmen, you've asserted a couple times on the forums that event handlers are recompiled each time they're fired. Can you confirm that? It makes zero sense to me, but if it's true, then I need to rework some code.
Hmm. Trying to flag down @still forum again.
if I setSkill a truck with people in it will it set the skill of everyone inside?
@still forum , does that apply anywhere else that you know of?
@dusky drift unsure, but you could use forEach and crew commands
Else give it a try in Eden
And to be sure I'm clear, if I add a big AnimChanged handler, then it's going to be reprocessed every time the handler fires? Do you have any idea why Bohemia would do it that way? I can't think of any reason to have a late-bound handler like that.
Leftover from SQS where compiled code didn't exist
Okay. Thanks a bunch. I'm doing performance work on my mission and this could well be a big bottleneck.
just do it like this:
addEventHandler [..., "_this call actual_handler_fnc"]
and you will be fine
Anybody happen to know of any script (or mod but preferably a script) that spawns smoke that could pass for a gas (as in mustard gas for example) attack?
Where can I find, in ACE3 the function for moving FAK's to medical supplies?
I wish to update this, for the DLC, as the new DLC doesn't have the vanilla FAK's
Any idea how i can get the height of a object? Like a table the surface height or a way better the direct position of a line intersect between the player eyes and a relative position with player getRelPos?
I know this might have been already discussed but i can't Seem to find an answer to this.... Is there a way to Setup a "Garage" where you can customize your current vehicle Like a Zeus can do with ares/Achilles ? Im not that good at coding/Scripting to do it on my own so is there any Mod/script that has this function and If Not is there someone that has an idea on how to achive this ?
I want to spawn a bunch of smoke grenades a bit above the ground and have them fan out in a similar way to how the cluster bombs deploy their little bomblets. For now I've got this:
onMapSingleClick {
private _newPos = [_pos # 0 - 40, _pos # 1, 100];
for "_i" from 1 to 15 do {
private _smoke = "SmokeShellGreen" createVehicle _newPos;
_vel = [5 + random 10, -5 + random 10, 0];
_smoke setVelocity _vel;
[_smoke] spawn {
params["_smoke"];
waitUntil {((getPosATL _smoke) select 2) < 0.5};
_smoke setVelocity [0,0,0];
};
};
[_newPos] spawn {
params ["_newPos"];
sleep 1;
"SmallSecondary" createVehicle _newPos;
};
};```
But now most smokes land pretty close to each other with one or 2 a bit away
Anyone know how to fix that?
log the velocities and see if they are what you're expecting
@digital hollow this doesnt realy help as there are not many exampels in how to use it and make it MP/Dedicated compatible. The few Scripts that are out there let you Spawn any vehicle you want everywhere you want... All I'm looking for is a way to customize a already spawned vehicle... I already looked at the code thats used in the Ares/Achilles mod and thats way Out of my League. I was hoping there ist a Mod/Script that already makes it possible to create a "Paint&spray" Style Garage for MP, but thanks anyways
I created a script that takes 40ms to compile, but which has an immediate exitWith at the beginning. So it has a large compile time, but a negligible run time. Installing that as a mission "EachFrame" handler added roughly 1ms to each frame. Installing a little snippet that calls that huge script doesn't add anything observable. So while a big handler can slow things down, ARMA doesn't appear to be performing a straight compile of the handler each time it's called. At least, not for "EachFrame".
It looks to me like ARMA stores the compiled form. It'll report errors each time the script is run, which may well be the code stored for a failed compilation (run the script, report the error). Repeatedly compiling an unchanging script just makes no sense
I'll add that the real win to making an event handler call a named function is that the named function can be replaced at runtime for testing and debugging purposes. I've found that to be invaluable through the years.
The short answer is that it depends @hazy trail
safest bet is that you always just use a global variable and eat the neglectable overhead
What does it depend on?
on the command
Do you know which commands compile every call and which do not? Or are you assuming that some do and some do not?
i know for sure that it depends on the command
though ... cannot really remember wich ones compiled and wich ones did not
iirc, it even depended on the event sometimes
Until you can provide me with an example of an event that demonstrably recompiles each invocation, I'm going to continue to assume that they don't recompile - because only the worst developer on the face of the planet repeats a heavy calculation needlessly.
Oneachframe does and dedmen has demonstrated it very well
Search for this issue on the issue tracker
do what you have to
but use [] call XYZ instead of putting your code directly into there
and avoid the hazzle of being greeted with useless compilation spam
I'll take a look in the issue tracker because that's the very event that I was testing with.
There was cache for compiled scripts before, so the time of recompilation was reduced, at the cost of a perpetual memory leak in scripts that used compile format with constantly changing data
But this cache is gone for a few months already
Well something changed in the last two years because I just ran Dedmen's sample script from his report. My base frame time was 12.5ms. Put in the 1000 'fast' handlers and I get 14.9ms. Put in the 1000 'slow' handlers and I get 17.2ms.
"ARMA doesn't appear to be performing a straight compile of the handler each time it's called" it does
"It looks to me like ARMA stores the compiled form" nope. They did that for a while but they removed it because it caused a memory leak.
"I created a script that takes 40ms to compile" measured how?
" Repeatedly compiling an unchanging script just makes no sense" correct
" I'm going to continue to assume that they don't recompile" okey then feel free to just not accept known facts
The 40ms compile was by using the debug console. compile 'lots of text' with a performance run.
Hey, don't get your nose out of joint. I'm testing and things are matching up with those established facts.
(are not matching up)
1.92 or 1.90? Perf/prof branch?
1.92 released
There was nothing in the changelogs about any improvements
I certainly didn't see anything.
I'm sure you've been accepting this as "the way of things" for the last two years. When was the last time this scenario was tested?
It may have been changed a year ago and nobody said anything about it. Perhaps the change was even a side effect of other work.
hint hint
it was not
"I'm sure you've been accepting this as "the way of things" for the last two years."
no. Because BI fixed it
but they had to unfix it because it was terrible
Well, I can only report what I've seen in my testing. Your test case was quick and easy to run. Thanks a bunch for that.
They added a compile cache which "fixed" it.
I got them to remove it again, and confirmed that the cache is really gone.
But didn't retest the performance.
Yes, I recall the notes on the compile cache.
Is there any recommended reading on localization in MP scenarios? Best practices, etc. I've seen the multiplayer scripting page on the wiki but wondering if there are any community favorites outside of that
Hi, could someone tell me how to set animations in the config? Also, i would like to make the animation loop (going over and over again). Tnx for the help.
#arma3_animation maybe 😛
Ah
@craggy adder just follow common sense, if some object (AI Unit for instance) is being simulated by one computer, it makes sense to control this object from the same computer
It also makes sense to do it this way because some properties of this object are not always broadcasted across network to other clients
So I'm setting costs for a zeus and using getNumber (configFile >> "CfgVehicles" >> _x >> "side") == 0 is true for opfor vehicles, but when I try to equate it to my argument _mySide (which is 0) like this: getNumber (configFile >> "CfgVehicles" >> _x >> "side") == _mySide (and I can verify that _mySide is 0 using hint), it's never true and I have no clue why
This is how I'm calling it: private _handle = [this, 0] execVM "S_CuratorInit.sqf";(inside a game master module)
is _mySide defined in the S_CuratorInit.sqf?
Any update on bis_disabled_door_x working for bargates, even the user action text says "Open Door", pretty annoying
hello, I am maintaining a mission against the KP Liberation scripts. neither here nor there as far as this channel is concerned. however, I do have a question re: asset class name evaluation. I have many structure asset class names which I want to verify given their names Land_House_L_1_EP1. obviously in this case it is a house, at least given the name, but I want to look it up and verify that somehow. is it possible?
yes, but from an Eden Editor POV?
this is scripting channel, perhaps #arma3_editor is a better forum?
Does this look syntactically correct for remote executing a script on each client from the server?
[["Times up!"], "scripts\end_round.sqf"] remoteExec ["BIS_fnc_execVM", -2, false];
Guys. Who understands mysql? 😃
Would understanding of mysqf do?
@tough abyss SELECT players.*, (SELECT fraction.gear, fraction.level, fraction.gang_id, fraction.vacation, fraction.exit, fraction.insert, fraction.last, fraction.allhours FROM fraction WHERE fraction.pid = playerid) asFraction FROM players WHERE players.playerid=76561198052735230;
my request
don't work(
Works only so
SELECT players.*, (SELECT fraction.gear FROM fraction WHERE fraction.pid = playerid) asFraction FROM players WHERE players.playerid=76561198052735230;
It does not allow you to select more than 1 item for the second selection
you sure asFraction is not actually as Fraction?
I think this may be a scripting thing
A touch of help
How do I make the use the AutoFire feature on infantry's M14(RIS)
_unit forceWeaponFire ["m14(RIS)", "FullAuto"];
Doesnt work :/
They have an M14 which has an automatic fire mode however they never use it
Cheers
I dont know what to try
yeah it probably fires in full auto only forceWeaponFire == 1 trigger pull and release
so it fires 1 round per command
wait so..........
what?
do i have to change anything to the code?
I have the same gun and its automatic
put it in a loop
how exactly?
_unit forceWeaponFire ["m14(RIS)", "FullAuto", "loop"]; --> I have no idea
[] spawn {for "_i" from 0 to _Nrounds do {_unit forceWeaponFire ["m14(RIS)", "FullAuto"]; sleep _fullAutoDelay}}
Dont think so it is a template for you to fill with own values
i suck even with a template
I just have an infantry which i want him to use the automatic fire feature
just hit me with the code and ill slap it ingame now
plz...
i dont have that mod with m14
obviously it does, you want working code, how am I suppose to give it to you if I dont have the weapon you are using
isnt it 1 variable which changes from gun to gun?
give me vanilla weapon I will give you code
it is not vanilla
okay use this gun
Put a Combat Life Saver for example, call him bob then execute in debug console
[] spawn {for "_i" from 1 to 10 do {bob forceWeaponFire ["arifle_MX_pointer_F", "FullAuto"]; sleep 0.1}}
will fire 10 rounds
MXM 6.5mm (Black)
cheers ill test it out
hold up...
do i have to manually execute this each time?
I was planning on mass using this code on squads
I can change bob to bob1 bob2 etc
No idea
What is this for @main jay ?
private _weaponState = weaponState _unit;
_unit setAmmo [_weaponState # 1, 100];
_unit forceWeaponFire [_weaponState # 1, _weaponState # 2];
I just ran this in a per frame handler and the dude fired full auto
I made a suppression script for a cinematic moment in a mission once
If you're doing a similar thing I might be able to help
Guys, I can't do the distance display for the tag. My config:
{
class Mission_1
{
template = "Mission.Altis";
difficulty = "custom";
};
}; ```
Administrator.Arma3Profile
{
class CustomDifficulty
{
class Options
{
3rdPersonView=1;
reducedDamage=0;
groupIndicators=0;
friendlyTags=0;
enemyTags=0;
detectedMines=1;
commands=0;
waypoints=2;
weaponInfo=1;
stanceIndicator=0;
staminaBar=0;
weaponCrosshair=0;
visionAid=0;
thirdPersonView=1;
cameraShake=1;
scoreTable=0;
deathMessages=0;
vonID=1;
mapContent=0;
autoReport=0;
AutoSpot=0;
HUD=1;
HUDWp=1;
HUDWpPerm=1;
HUDGroupInfo=1;
};
};
};
singleVoice=0;
maxSamplesPlayed=96;
getTerrainGrid=50;
setTerrainGrid=50;
sceneComplexity=1000000;
shadowZDistance=100;
viewDistance=5000;
preferredObjectViewDistance=3000;
terrainGrid=50;
volumeCD=10;
volumeFX=10;
volumeSpeech=10;
volumeVoN=10;
vonRecThreshold=0.029999999;
I'm trying to make this work with a vehicle that is in a specific zone/trigger BIS_fnc_garage_center = CursorTarget; uinamespace setVariable ["bis_fnc_garage_defaultclass", typeof cursorTarget]; ["Open",true] call BIS_fnc_garage; any suggestions
BIS_fnc_garage_center is a custom function u making right?
it works with the cursor but i cant seem to make it work within a specific area.... I tried playing around with nearest object
if so I wouldnt recommend the BIS part of it as it might cause some problems if BI create a funciton of the same name further down the line
BIS_fnc_garage_center is mentioned in https://community.bistudio.com/wiki/BIS_fnc_garage
also I've seen some guys using it while testing the possibilities of the Virtual Garage.... cant find the post right now
fair enough, when I first tried scripting/ modding someone told me to try to avoid using other people's tag's(?) in my own code as it can cause confusion for others
for example, when i turn scripts into mods, I use the tag FMODS_
I think the word is 'tag' is correct anyway
Is there a command for checking which map/terrain is used?
Thanks @daring pawn 😉
Appreciate that will, but it's ironic that I was helping you yesterday 😃
Is it possible to switch the artillery computer to a white map? Unlike the other maps, there doesn't seem to be a button, hidden or otherwise, that will flip the textures off.
🤷 what would be alternative to it?
Hey guys, can you have a glance at this onInit EH script?
The while loop doesn't work, I wonder if I made some syntax errors
There is no onInit EH afaik
it's a config-only event, not a scripted one
Which config?
The unit's config
A drone that is supposed to fly at lower attitude than 100m
And the idea is to make it avoid obstacles
You sure it is called onInit?
{
init = "_this execVM '\40k_tau\Drones\scripts\init_drone_2m.sqf';";
};```
It's init, i stand corrected
Hi, everybody. Anybody used this script for A2 http://www.armaholic.com/page.php?id=14961 , maybe someone remaked it for A3? It works in A3, but some problem with menu.
can one disable inventory action for ammo crates via sqf?
best to hide the action itself (otherwise inventoryOpen EH is probably the only way)
scripting is an absolute pain in the ass.
what are some of the tools you all use to help simplify it so its not a hand-eye-mind grind?
notepad++ and the wiki, that's about it
I've been using powershell to tail log files since I don't have tail on windows 😦
that's a helpful addition
an SQF syntax highlighting package for the editor helps a lot
An in-IDE linter would help a lot but I haven't played with one yet
Might have to switch to VSC....syntax error highlighting would help a ton. Been using Sublime for SQF forever for a reason I can't recall.
I do love VSC though so no big deal switching
@tough abyss compile cache doesn't exist. so no, the syntax doen't exist
wiki is @ https://community.bistudio.com/wiki @hoary mural
bisimulations is for VBS, I guess
LMFAO! 😂
@hoary mural https://community.bistudio.com/wiki/createVehicle
private _jeep = "Jeep" createVehicle position player;
You know what VBS don’t have? params
With all their fancy shit million and one commands they still do _this select mydick
^ obviously not the main arma wiki however was wondering if that second syntax was in arma as well
vbs doesn't have params?
I guess they can just replace that with a function
many things missing from the arma wiki but ok
hello
i broke the new setpos protection stuff (which i would like to state is beyond useless).
player setPosASL [-500000, -500000, -500000];
instant crash. enjoy.
😮
i can probably find a couple more of those. is there a bug bounty program?
your bounty reward is brownie points.
feedback.bistudio.com
i think if i post it here it might actually get some attention
But all the devs can see the tickets on the phab?
and then happily ignore it Ü
🤔
I am having some troubles though reducing incoming damage by half,
all I do is take the received damage in a handleDamage event handler and half it. So for example 0.7 / 2 = 0.35.
0.35 is taken, but then for some reason it keeps getting lower as damage is taken again and again ( I understand that sometimes it can be triggered twice ) .
But eventually it gets so low to the point where it gets infinitely lower
and makes it impossible to kill the player without getting a killshot like a headshot
which wouldn't make sense if the event handler was altering received damage? should be 0.5 if 1 for headshot from hitpoint
playerRole = player call rpga_fnc_getRole;
damageReduction = getNumber(missionConfigFile >> "CfgRPGARoles" >> playerRole >> "damageReduction");
player addEventHandler["HandleDamage",
{
params["_unit","","_dmg","_source"];
_finalDmg = _dmg;
_role = _unit call rpga_fnc_getRole;
if(_role isEqualTo "RPGA_TANK") then {
_finalDmg = _dmg / damageReduction;
diag_log format["[RPGA]: Role with TANK recieved reduced damage %1",_finalDmg];
};
_finalDmg;
}];
13:57:01 "[RPGA]: Role with TANK recieved reduced damage 0.579494"
13:57:01 "[RPGA]: Role with TANK recieved reduced damage 0.281817"
13:57:01 "[RPGA]: Role with TANK recieved reduced damage 0.505476"
13:57:01 "[RPGA]: Role with TANK recieved reduced damage 0.0639294"
13:57:01 "[RPGA]: Role with TANK recieved reduced damage 0.487794"
13:57:01 "[RPGA]: Role with TANK recieved reduced damage 0.0451219"
13:57:01 "[RPGA]: Role with TANK recieved reduced damage 0.0600815"
13:57:01 "[RPGA]: Role with TANK recieved reduced damage 0.500741"
The last one is actually from a headshot from AI. But it was an instant death. wtf?
class CfgRPGARoles {
class RPGA_TANK {
roleInit = "call rpga_fnc_roleTank";
damageReduction = 2;
};
class RPGA_DPS {
roleInit = "call rpga_fnc_roleDps";
penetrationCoef = 1.5;
};
};
This is mission config for it
Try removing the semicolon after _finalDmg @high marsh
Wouldn't matter.
Either way. Same wacky results:
14:06:44 "[RPGA]: Role with TANK recieved reduced damage 0.00740967"
14:06:44 "[RPGA]: Role with TANK recieved reduced damage 0.375936"
14:06:44 "[RPGA]: Role with TANK recieved reduced damage 0.284255"
14:06:44 "[RPGA]: Role with TANK recieved reduced damage 0.316371"
14:06:44 "[RPGA]: Role with TANK recieved reduced damage 0.500712"
14:06:44 "[RPGA]: Role with TANK recieved reduced damage 0.5"
14:06:44 "[RPGA]: Role with TANK recieved reduced damage 0.206556"
14:06:44 "[RPGA]: Role with TANK recieved reduced damage 0.30258"
14:06:44 "[RPGA]: Role with TANK recieved reduced damage 0.414883"
14:06:44 "[RPGA]: Role with TANK recieved reduced damage 0.280293"
14:06:44 "[RPGA]: Role with TANK recieved reduced damage 0.829765"
14:06:44 "[RPGA]: Role with TANK recieved reduced damage 0.50042"
@high marsh
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HandleDamage
"damage: Number - Resulting level of damage for the selection."
the damage you think you take is not the damage a shot caused. It is the resulting damage level.
Oh. Duh
made the same mistake a while ago 😄
😄
yes, ingame (cfgviewer launch from eden or from dev console)
or offlione - download full config
https://forums.bohemia.net/forums/topic/191737-updated-all-in-one-config-dumps/?do=findComment&comment=3328016
Has anyone got experience with https://community.bistudio.com/wiki/Military_Symbols ? Does the code need to be executed for every client or server only?
This code executes on a dedicated server, any idea why I don't see a subtitle on the connected clients?
["", _message] remoteExec ["spawn BIS_fnc_showSubtitle", -2, false];
"spawn BIS_fnc_showSubtitle" -> "BIS_fnc_showSubtitle"
remoteExec starts the function in a scheduled environment for you, and remoteExecCall starts in an unscheduled environment.
Guess I need to read more about scheduled vs unscheduled
Nah I'd say you need to read more of the remoteExec wiki ^^
@peak plover http://tikka.ws/class/index.php
Is there a way to retrieve where an arty or mortars rounds will impact?
does worldSize only return the config value or does it compute the size itself?
https://community.bistudio.com/wiki/worldSize
Returns config size of the current world. Equivalent to worldName call BIS_fnc_mapSize
@radiant needle https://community.bistudio.com/wiki/getArtilleryETA
@tough abyss Thanks!
ETA returns how long rounds will take to impact
@still forum thats why i am asking. the config value can be anything/faulty
quick question as I can't currently test this: can I use underscores in variablenames of stuff that's going to be saved in profilenamespace?
you know what, I'm gonna use an emoji in it, just because I can 😃
What's actually going on after 1.92? Signatures failure, even CBA is now out of order.
@winter rose only works in strings. so need to use getVariable to get values
oh I thought you could do something along private _👍 = 5;
Actually not sure if setting/getting are different.
You can set 0 afterall. So emoji might work too
I tested it once and found that either setting or getting by just writing emoji doesn't work
123 = 456; missionNamespace getVariable "123"
KNEEEEEEEL!
Usually I'm not the one who kneels
anyone know where the ace interaction parents are? I only know about the shouldertap. Nothin else listed in the interaction framework. A list of some kind would be neat
oof, thank you dedmen!
_action = ["endMission","End Mission","",{[narTrans_fnc_missionEnd] remoteExec ["call", 2];},{true},{},[parameters], [0,0,0], 100] call ace_interact_menu_fnc_createAction;
[_npc, 0, ["ACE_MainActions"], _action] call ace_interact_menu_fnc_addActionToObject;
I have two params. private _npc (the npc) and private _pos (position of the npc). But somehow, no matter what i tried so far, i did not get the params over...
you are not passing the parameters at all
also you are doing call [narTrans_fnc_missionEnd]
call doesn't take array
currently not, because i deleted everything again so the action works for now. Where do i have to put in my params? Or how do i write it, because currently i cant see how.
i get:
[any,any] ...
params call function
left command right -> [left, right] remoteExec ["command"]
thus
[params, function] remoteExec ["command"]
But remoteExec'ing call is nonsense
you can just give remoteExec a function name
it read that i only can execute functions that are already existing, like bohemia stuff only? Or did i misunderstand that?
like [_pa1, pa2] remoteExec ["myFunction", 2];?
well, it does, but i thought with 'exist' it means that what BI made like 'call' and 'spawn' and stuff
BI used CfgFunctions
like you should also be doing.
call and spawn are commands, not functions
_action = ["endMission","End Mission","",{[_npc, _rng] remoteExec ["narTrans_fnc_missionEnd", 2];},{true},{},[parameters], [0,0,0], 100] call ace_interact_menu_fnc_createAction;
I receive [any, any] 😦
i am kind of near to giving up and using addAction -.-
It's a placeholder
you need to pass the parameters into there
Also you don't need to pass _npc as you have it already
https://ace3mod.com/wiki/framework/interactionMenu-framework.html
right on top.
The code to these are passed [_target, _player, _actionParams]
You get target, player and parameters that you pass in in _this.
pull them out again using params
i dont understand it. Could you please write an example for me please? Just with the _rng position so i finally could understand it :/ going crazy here
because [parameter] i edited it and put [_myVar] in it and it didnt work
i edited it and put [_myVar] in it and it didnt work it should
_action = ["endMission","End Mission","",{
params ["_target","_player","_actionParams"];
//_parameters now contains what you supplied as parameters below ([_rng]) just need to pull it out of array now.
_actionParams params ["_rng"];
[_target, _rng] remoteExec ["narTrans_fnc_missionEnd", 2];
},{true},{},[_rng], [0,0,0], 100] call ace_interact_menu_fnc_createAction;
I assume you didn't use params correctly to get _myVar out of the array
ah, i understand now, thank you a lot dedmen.
I assume _target and _player are always 'magically' defined? (just to be super mega sure for me)
It's written that they are defined on the ace wiki
so.
They are not magically defined.
It's right there. params. params pulls them out of _this and sets them
Can i actually ignore those params and just put in my own? like, when i dont need target and player or are they mandatory?
ughhh
params. Pulls elements out of an array.
_this by default
_this contains 3 values. target, player and your parameters
If you just say "I want the first element to be some guy over there now" that won't happen. First value is target. You cannot just say "I want this to be something else now"
aye, thanksies. That i wanted to know :3
You can just not use _target and _player and pass everything in actionParams
But you cannot make target and player go away
Without modifying ACE itself and breaking every other interaction in existance
thought so, finally understood it. Thank you alot! Such an Example would be neat if that would've been there i could've learned it by myself.
How can I retrieve the side of a faction?
If I get the faction with https://community.bistudio.com/wiki/faction
The config mentioned has the side.
Yeah, I get that. But how do I access the config? Not familiar with the config commands
getNumber(configFile >> "class" >> "class" >> "side")
class are placeholders that you need to replace by the proper path
That works, thanks 👍
SetPos one?
yes
You want it reverted?
He was already poked
okay
and fix is already on the way
what a shame.
no money for you! Internet points for the win
limit to -50km on the negative xy. -5km on negative z and keep the +500km on xy
Why not revert it to no limits? It seems that there is no appreciation for BI trying to tackle the problem which existed like always
You damned if you do you damned if you don’t
If the result is the same the most logical action is inaction
I think you missunderstand
the limits don't cause crashes
the limits were added to prevent crashing by teleporting to far away, the limits are just not strict enough
I understand that limits were not tested properly, and that it is not like they suddenly appeared of nowhere and made the game worse. It half fixed the problem already just need another adjustment on negative side why the fucking drama? Anyone could have tested them on dev before to make sure, no one did.
Hello, I have a question regarding BIS_fnc_taskCreate and calling/spawning it through a trigger in a MP scenario.
I'm veeeeeeeeery unfamiliar with discord and just joined this one, if I need to ask that in another channel I will obviously
Just ask please
Ok. For my trigger condition I have {_x in truck1} count playableUnits >= 2;
why are you using playableUnits and not allPlayers?
The trucks waypoint is synchronized to this trigger and the truck leaves once enough players are in without fail. however, in the On Act. field, I have _null = [true, [t1, p1], ["name1", "name2"], objNull, true, 1, false] spawn BIS_fnc_taskCreate;
I'm using playableUnits because not all players have access to the vehicle
Anyways, once the needed number of players are in the vehicle, the truck drives off and does it what it needs to do, but the task isn't assigned to any player.
You are sure that your trigger is set upped correctly?
Anyone could have tested them on dev before to make sure, no one did. they weren't on dev nor RC. Was a last minute thing
It works as far as once the correct number of units are in the vehicle, its move waypoint is activated. Its the taskCreate in the On Act. that is giving me trouble
I just went back and put a hint after the taskCreate, and it appeared on screen once loaded into the vehicle
just to double check for your question
Try to call it
Still no luck unfortunately
For creating a local sound source in MP and have all the players hear the same thing is there anything better than playSound3D?
ie. is there anything JIP compatible?
they weren't on dev nor RC. Was a last minute thing I've missed most of this discussion, but there should have been some form of protection added for that since mid-2017 (as I reported it and received a response back then).
https://s.sqf.ovh/firefox_2019-05-02_15-17-37.png
I'm sorry holy god of biki. I betrayed you.
!purgeban @dapper cairn 140d spamming
*fires them railguns at @dapper cairn* Ò_Ó
guys. I have image.
Taking her out in RscStructuredText
_ctrlText ctrlSetStructuredText parseText "<br/><t size='10' align='center'><img image='image\police.paa'/></t>";
And my image is all black
What am I doing wrong?
[3:06 PM] Dedmen: limit to -50km on the negative xy. -5km on negative z and keep the +500km on xy
-50k is enough for all 3 axis to make it simple
my system can easily handle -65.5k but some weaker systems get performance drop beyond 50k and nobody can survive beyond negative 200k
Don't need to care about weak systems having low fps, they have that anyway 😄
well it's more about consistency, negative 50 is sort of easier to remember than negative 65.5k 😉
ofcourse it could be x,y negative 50k and then z negative 5k but ... i would take anything what is fixed enough
do you guys have any suggestions?
@random crescent you can blame me later that i didn't forsee the crashing happens with different negative values than positive
I have the entire picture is filled with black
@fleet hazel have you checked RPT for errors yet?
they're not.
@still forum my image in game
http://skrinshoter.ru/i/020519/h1o2bq5v.png
where did you find how the img tag should look like?
Is you image multiples of 2 in size? 256x256 512x512 1024x1024 and so on?
@lavish ocean i had different kinds of crashes with different values (0x0000DEAD and one out of memory), but i suppose with a limit it doesn't really matter.
i'm quite sure there are other commands which are missing any ceiling or boundaries
you know the sandbox w/o limits argument first then bugfixes eons later 😉
i tried it with attachTo into out of bounds but that apparently is safe or i didnt try hard enough yet. causes some good glitching though.
ye this was whole group of positional commands (like several dozen)
Does setVelocity have a limit?
grins at @verbal saddle try guesss ...
setVelocity needs local args, too, so it would need to be remote exec'd first.
has list of things he wishes were limited in history long time ago in Arma galaxy
like a limit on how long the RV engine should be used :kappa:
even local is problem, if you know how abuse it (yay locality hell)
my current goal is to crash a server through 5 or less commands. i'm sure i can do it.
five ? make it one (two with the trigger of payload)
well, wait i can do it with one too, nvm
clientside only though?
🤔 somehow I have broken setVelocity
small values do nothing and anything over about 10 just kills the player
you need to accept that Arma 3 will be only secure as 'much' still it's miles ahead of what was A2OA, lightyears of A1
aaasuy you need to levitate the player first.
Even for a velocity directly up?
yes
Ah yes
oh thats neat
guys)) How to make a colored string?
dont work
"<t size='1' color='#0a2624' align='left'>Activ:</t>" + "<t color='#0a2624' text</t>"
@random crescent 0xDEAD means forced crash. And usually game first tells you why it's gonna kill itself now.
@fleet hazel missing >
@tough abyss Oh God. I'm stupid. Thanks
0xDEDMEN
Anyone know how to script snow
particle effects
What I just type in particle effects
no
its very complex thing
and often winter maps change the actual rain effects to look like snow
instead of particle effects that can kill your fps
but if you want to make it with particle effects you got to look up how they work first
Well I assume editing a map config is too hard
only scripted way is particle effects and this is #arma3_scripting
I think it will be beyond me
but.. why do you even want to script it? There are dozens of snow particle scripts already
I just want it to snow 😂 I have no idea how to do it scripting or not
Thank you
Hi everyone! Where i can find information about map in Arma 3? If i got it right, map opened on "M" button is GUI: https://community.bistudio.com/wiki/Dialog_Control_Map
So how Arma add objects from world to map GUI? BIS function or something else? And can i match map object to control in map GUI?
So i can't add my personal controls on map GUI?
you can
ACE does it for marker creation and stuff
Just adding controls to the config I assume
or spawning dialogs with script
In some missions i hide some buildings and create my own buildings (like creating outpost on the road). I want that players know about that objects, but creating markers on that objects looks awful.
So i have idea: create on map GUI controls for list of buildings, that created in editor and hide controls of objects that hided by hideObject command.
"and hide controls of objects" can't
and creating a GUI overlay and trying to place it correctly is a F-load of work
So it's impossible, @still forum ?
Well I don't know any way
and have never seen someone remove them
I think the building icons on the map aren't even controls, they are burned into the image
building icons on the map aren't even controls, they are burned into the image
No, buildings are not parts of map picture. But how they are drawn on the map - it's a big mystery for me 😫
AFAIK map is a fully rendered control, all is drawn as actual 2D graphics, I think terrain is also drawn according to terrain type and alpha channel value. That's why It might become sloppy sometimes when you zoom in.
When I once failed to create inheritance chain in some of the map controls, the control appeared to be blank white, that's what basically happens when render fails in Arma.
Quick question, is there a way to use copyToClipboard to copy something into a clients clipboard on a dedicated server?
What does the wiki say? https://community.bistudio.com/wiki/copyToClipboard
well I've got a guy complaining about it not working claiming it's somehow possible
I've read what the wiki says
If it were somehow possible he wouldn't have to complain about it not working, now would he?
Graphs is still not working?
But how they are drawn on the map - it's a big mystery for me the engine draws them. They are not scripted nor configured in config- all hardcoded.
@wispy cave not possible. Do you have ACE? ACE has a extension that can do it
@dusky pier what is "graphs" supposed to be?
no, vanilla server
then not possible
@still forum new scripting command from 1.92 update. That was with ctrlSetPositionX, as i understand they add graphs to UI
but i can't find more info about it
there are new graph commands. But they don't do anything with controls
and ctrlSetPositionX -> https://discordapp.com/channels/105462288051380224/105462984087728128/572449595586773009
There are setPosition commands for X,Y,W,H has nothing to do with graphs
understand 😦
Is there a best practices way to make a player impervious to damage in a multiplayer setting?
allowDamage doesn't seem to do anything. I've had mixed luck using different event handlers to just ignore incoming damage.
add handledamage eventhandler and return 0
I was using this: _player AddEventHandler ["HandleDamage",{false}]; with mixed luck
Seems to work sometimes but not others
doesnt work for when hes sitting in a vehicle and that goes capoof however
false? you should return 0
I'm going to correct what I think are some locality issues, and change that to 0
thanks
Is there a script command to control/prevent blood loss when being shot? I don't want blood splatters if possible.
cursory search didn't find anything
When do you execute allowdamage? @craggy adder
@tough abyss I got it working with the HandleDamage EH, thanks though. Don't even remember, that was an older approach. Odds are good I wasn't properly observing locality when using it
HandleDamage works until someone adds another HandleDamage EH then it doesn’t
Allowdamage should be safer
This is a pretty closed scenario so it should be safe, but I'll keep that in mind if it stops working right. Going to do MP testing this weekend with some friends.
Or maybe I'll just go ahead and add that too.
Currently having an issue where using player hideObjectGlobal false; after having set it to true isn't showing the model, or re-enabling collisions.
Does anyoen know of a way to make a shell go off in mid air? I tried calling the bullet and doing setdamage = 1 but that doesn't seem to work on projectiles
true will hide object obviously @craggy adder
Right and false should show it again, no?
...not working
I've got this right, correct? this addeventhandler ["fired", {_bullet = (_this select 6); triggerAmmo _bullet;}];
What kind of bullet?
35mm HE right now
Does it have like charging distance?
What is it underbarrel grenade?
You can delete it and create an explosion in its place otherwise it has to hit something, invisible barrier maybe?
I can try that
Or create another projectile going in opposite direction in front of the first one, will get double bang if they collide
Projectiles will detonate on collision? I didnt know this
I found a solution for the moment this addeventhandler ["fired", {_bullet = (_this select 6); _shell = "Bo_Mk82" createVehicle [(getPos _bullet select 0), (getPos _bullet select 1), (getPos _bullet select 2)]; _shell attachto [_bullet,[0,10,0]]; _shell hideObject true; triggerAmmo _shell;}];
If they’re explosive yeah
Need to figure out how to TIME the detonation however
which will suck since its local
and I cant spawn a trigger with a local variable on it
Don’t think you can attach to bullet
Oh ho ho on contrar, you can indeed attachto bullet
in fact you can attach ANYTHING to bullet
even cars if you're up to see something truly stupid
even PEOPLE
Interesting, something must have changed
it has been like such for at least a year
Yeah there was some tweaking around ammo a year or more back
...hmmmm...
now how do I time this... or preferably proxy trigger it
without an SQF is the trick...
Hmmmmmmmm
Yea still dont have it. Gotta use an SQF
...can someone explain why this is Type : Object, expected array, string, config entry on the first line? _warhead = _this select 0;
Nevermind, its how I was calling it. Dont forget your brackets kids
attachto bullet? oh my
Yes you can do a bulletcam or... bulletperson
Grrrr
Triggerammo does not appear to work in an SQF for some reason
It literally refuses to work under any circumstances in an SQF, but it works fine in an init
it doesn't error, it just doesn't fire
What does select return if the indicated index doesn't exist in the array?
and how do you check for that
isNil?
or
_unitsSelected = allUnits select {alive _x};
if((count _unitsSelected) > 0) then {
};
count [0, 1, 2] will return the amount of items in the array
wait a sec
are you sure we're not talking about find ?
_indexOfEntry = allUnints find "Bob";
if(_indexOfEntry != -1) then {
hint format["Bob is at index %1 of allUnits",_indexOfEntry];
};
So the question by @craggy adder was 'and how do you check that specific index exists in the array', and the answer is, you use the count command ( https://community.bistudio.com/wiki/count ) to get the amount of elements in the array, and obviously don't do array select index if the index is >= than count array. I'm not quite sure why we need find or findIf for that
I think if your array has size N and you use array select N, it will return nil, but if you use array select (N+3) SQF will error, but you better check it in the debug console
Also there is an alternative to array select index which is the new # operator
can someone help me out with the GF cargo airdrop script?
i'm trying to figure out how to get the airdrops to drop onto certain markers i have placed but as of now they drop wherever
i'm new to this and having a hard time figuring scripts out
In case noone knows here, ask GF at forum
anyone knows how to make the BI observer mode select the first/any unit by default (or whats the function to do that) and how to force first person view?
Force fpp can be done in server profile iirc
how can i force 1 minute of invincibility at game start?
i found some posts on making a safe zone but i don't want that
i just need at game start for all players to be invincible for 1 minute then it goes away
@craggy adder
"What does select return if the indicated index doesn't exist in the array?" nil, or script error. Most likely script error if you are out of bounds.
Just use param if you expect the element to maybe not be there.
Hi! I am a computer since student and I would like to try using Arma 3 drones to generate data for my ML project. Now the problem is that the original drone view has a lot of "noise". Here's an example (https://imgur.com/gallery/N5vsVsE). Can I get some pointers on how to do get rid of it?
HUD elements can be disabled, in the options there are layout settings where you can move/resize them, could just move them to one corner.
Or load a mod to disable them
Those are only the top 3 though.
Mod sounds like the easiest solution. But I can't seem to find one...
ACE can disable hud elements, but again only the top 3
Maybe try (in the console); https://community.bistudio.com/wiki/showHUD
Can also be set for the mission; https://community.bistudio.com/wiki/Description.ext#showHUD
Not sure if it will disable all possible HUD elements.
The top 3 a the least problematic tho
Failing that you'd have to patch the drone camera display resource. Doubt you'll find such a thing already made.
Uffff
Okay. It's just a never had experience in scripting for arma
So that will be fun XD
or, if you just need a top camera, you can use the Splendid™ Camera script and get your aerial shots
can one check what {1+1} isEqualTo {1+1} returns?
private _code = {1+1};
_code isEqualTo _code```
Should return true
i do not want to know what it should :P
need to know exactly 100% sure & tested what it returns
@idle obsidian patching UI's is not scripting. it's config editing and mod making
Hi!
does anyone have a easy way of removeing a specific classname
ex. when a player enters a area all object of typeof "something" will be removed.
something like
if (_x typeOf "Land_InvisibleBarrier_F") then {
deleteVehicle _x;
};
forEach nearestObjects [player, ["All"], 200];
aah, gonna give it a try
GL!
if (_x typeOf == "Land_InvisibleBarrier_F") then {
deleteVehicle _x;
};
forEach nearestObjects [player, ["All"], 200];
Keep getting error missing ). Have no clue why
Figured it out now 😃
haha yeah the typeof _x was a problem but foreach required it all to be within {}
{
if (typeOf _x == "Land_InvisibleBarrier_F") then {
deleteVehicle _x;
};
}
forEach nearestObjects [player, ["All"], 200];
This works. Thanks alot ❤
anytime ❤
Hello everyone,
I'm having trouble displaying my icon. The text is correctly displaying but not the picture.
addMissionEventHandler ["Draw3D", {
{
if (side _x isEqualTo side player && {alive _x} && ([objNull, "VIEW"] checkVisibility [eyePos player, eyePos _x]) > 0.9) then
{
drawIcon3D
[
format ["Images\nt_icons\%1.paa", side _x],
[1,1,1,1],
[
visiblePosition _x select 0,
visiblePosition _x select 1,
(visiblePosition _x select 2) +
((_x modelToWorld (
_x selectionPosition 'head'
)) select 2) + 0.4 + ((player distance _x) / 15) / 1.5
],
1,
1,
0,
name _x,
2,
0.03,
'PuristaBold'
];
};
} count allUnits - [player];
}];```
Can anyone find the cause ?
does it work if you replace side _x with "west", for example?
but not the picture
what does it mean?
No it doesn't work @winter rose
EAST.paa
WEST.paa
Case sensitive maybe
if you display the path as a string, you'll see that side _x gives you WEST in uppercase so no already done
Try with the path starting with \
👍 hope you find the issue
had the same problem with playSound3D
yeah, seems these commands require an "absolute" path
👍🏼
Does anyone know how I can remote execute the playmove in this script?
{
_x addEventHandler ["FiredNear",{
params ["_unit"];
if (alive _unit) then {
_unit playMove (selectRandom ["ApanPknlMstpSnonWnonDnon_G01", "ApanPknlMstpSnonWnonDnon_G02", "ApanPknlMstpSnonWnonDnon_G03", "ApanPpneMstpSnonWnonDnon_G01", "ApanPpneMstpSnonWnonDnon_G02", "ApanPpneMstpSnonWnonDnon_G03"]);
};
}];
} forEach (allUnits select {(side _x) == CIVILIAN});
Basicly need to make sure it works both for Dedi and JIP. 😃
The EH will only fire on the computer that the AI is local to anyways, so no need to remoteExec.
You do however need to add the EH on every computer that might own the AI group
I see. better work on a other solution I suppose.
Or would it be enough to simply just run the script from initplayerlocal?
The animations would still not be seen by other players right?
You can add it to init.sqf to be extra sure. initServer should be ok.
Thanks 😃
you can use if () then {} in activation of a trigger right?
yes
if you return correct value in the end
oh wait. no, onActivation doesn't return. So you don't need to return a value
so i can use that to narrow down an array after a trigger fires yea?
I guess so yeah
ok, just checking
Enable channel should work
["Dog Scrips", "Attack Dog Blu",
{
params ["_pos","_unit"];
_grp = createGroup WEST;
_dog = _grp createUnit ["Fin_random_F", _pos, [], 0, "CAN_COLLIDE"];
_dogNearestEnemy = nil;
while {true} do {
if isNil _dogNearestEnemy {
_closestDogEnemyHandle = [{
params["_dogNearestEnemy"];
_dogNearestEnemy = _dog findNearestEnemy _dog;
if not isNil _dogNearestEnemy then {
[_closestDogEnemyHandle] call CBA_fnc_removePerFrameHandler;
};
}, 1, [_dogNearestEnemy]] call CBA_fnc_addPerFrameHandler;
} else
{
_moveToDogEnemyHandle = [{
params["_dogNearestEnemy"];
_dog moveTo _dogNearestEnemy;
if _dog distance _dogNearestEnemy <1 then {
[_moveToDogEnemyHandle] call CBA_fnc_removePerFrameHandler;
[_dogNearestEnemy, 0.1, selectRandom ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"], selectRandom ["stab", "punch"]] call ace_medical_fnc_addDamageToUnit;
};
}, 10, [_dogNearestEnemy]] call CBA_fnc_addPerFrameHandler;
};
};
}] call Ares_fnc_RegisterCustomModule;
18:00:29 Error in expression <rue} do {
if isNil _dogNearestEnemy {
_closestDogEnemyHandle = [{
>
18:00:29 Error position: <{
_closestDogEnemyHandle = [{
>
18:00:29 Error Missing ;
18:00:29 Error in expression <rue} do {
if isNil _dogNearestEnemy {
_closestDogEnemyHandle = [{
>
18:00:29 Error position: <{
_closestDogEnemyHandle = [{
>
18:00:29 Error Missing ;```
im feeling really dumb as I dont know why im getting those errors
I can't see where I've missed semicolons or bracked
the ()?
Guys what should I use?
BIS_fnc_saveInventory
BIS_fnc_loadInventory
or
getUnitLoadout
setUnitLoadout
the latter
always prefer engine commands over script functions
@still forum @random crescent I understand correctly, option number 2?
get/setUnitLoadout, yes
@random crescent @still forum Thank You
please stop tagging me for every reply, thanks
...
😂
joke's on you, you we're already on my ignore list
Something you should not do if you have questions sqf related darling 😘😘
Error in expression <["_dogNearestEnemy","_dog"];
_dog moveTo _dogNearestEnemy;
if (_dog >
18:28:03 Error position: <moveTo _dogNearestEnemy;
if (_dog >
18:28:03 Error moveto: Type Number, expected Object
18:28:03 Error in expression <["_dogNearestEnemy","_dog"];
_dog moveTo _dogNearestEnemy;
if (_dog >
18:28:03 Error position: <moveTo _dogNearestEnemy;
if (_dog >
18:28:03 Error Generic error in expression
["Dog Scrips", "Attack Dog Blu",
{
params ["_pos","_unit"];
_grp = createGroup WEST;
_dog = _grp createUnit ["Fin_random_F", _pos, [], 0, "CAN_COLLIDE"];
_dogNearestEnemy = "";
if (isNil _dogNearestEnemy) then
{
hint "empty, start";
};
while {true} do {
if (isNil "_dogNearestEnemy") then
{
_closestDogEnemyHandle = [{
params["_dogNearestEnemy","_dog"];
_dogNearestEnemy = _dog findNearestEnemy _dog;
if (isNil _dogNearestEnemy) then {
hint "";
} else
{
[_closestDogEnemyHandle] call CBA_fnc_removePerFrameHandler;
};
}, 1, [_dogNearestEnemy,_dog]] call CBA_fnc_addPerFrameHandler;
} else
{
_moveToDogEnemyHandle = [{
params["_dogNearestEnemy","_dog"];
_dog moveTo _dogNearestEnemy;
if (_dog distance _dogNearestEnemy <1) then {
[_moveToDogEnemyHandle] call CBA_fnc_removePerFrameHandler;
[_dogNearestEnemy, 0.1, selectRandom ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"], selectRandom ["stab", "punch"]] call ace_medical_fnc_addDamageToUnit;
};
}, 10, [_dogNearestEnemy,_dog]] call CBA_fnc_addPerFrameHandler;
};
};
}] call Ares_fnc_RegisterCustomModule;```
what is error position?
god damn it. i need to learn how to read
Does the < > tell me which part of the code is broken?
also your params is wrong
(this select 0) params ...
so does params look like:
params[["_dogNearestEnemy","_dog"],"_closestDogEnemyHandle"];?
im just getting a little confused
that's not how params works
params ["_args", "_handle"];
_args params ["_dogNearestEnemy","_dog"];
that would be one way.
ahhhhhh
I was wondering if I had to do _args somewhere as a while ago I did something similiar
but I couldn't remember
now that I think of it... That other time was me attempting the thing im doing now
😄