#arma3_scripting
1 messages Β· Page 537 of 1
"and preusmably if it's in a UI thread sleeping pauses it as well" there are no "threads"
"so the animation to load in the configure options can't happen" I don't think that's related to that.
"you need to call or something" need a spawn
Yeah, got that sleep in there
Right
I'll just make the template tool add it to mission init via a spawn
Yeah I know, but it wouldn't be in a scheduled environment so it wouldn't work right
Hi guys! Where can I get some info on the locality of the addAction command?
@dull drum https://community.bistudio.com/wiki/addAction is here for you!
@winter rose , thanks but the only locality explanation I had there was Commands with local effects at the page footer %)
@astral dawn thanks.
Yep so although it can be run on any object, the action only shows for the player whose machine runs it
Hello there.
Is there a way to increase weapon sway with ACE? i fooled around with the ace fatigue stuff, but seem to dumb to get that to work and the vanilla function "setCustomAimCoef" doesnt seem to have an effect when i change it manually, also it returns values up to 2.8, while the website says is supposed to go from 0 to 1.
ATM im using setUnitRecoilCoefficient which kind of does the job, but quite badly
any way to get setCustomAimCoef to work or an ACE pendant?
fyi i want to increase the weapon sway for players on a dedicated server
@dull drum these icons are the information you are looking for:
Argument Global (a.k.a any object can be used),
Effect Local (only the machine where the action has been called will see the result)
@plush oriole in my mission I have an event of getting an item for the player. If he has it - he can go, press a button and win. But when everything is local how to prevent cheating and injections?
@winter rose HOLY MOTHER OF ALL
Thank you for that dear sir!
π with pleasure!
additional gift, free of charge: https://community.bistudio.com/wiki/Multiplayer_Scripting#Locality
I dug there but it didn't really help me to realize how to deal with MP scripting, Yet, I hope. But thanks again!
anytime! this channel is here for that
Really depends on task
Typically you do important things on the server (mission flow,etc).
Study remoteExec(Call) JIP functionality to synchronize stuff for joining clients.
Prefer remoteExecCall for broadcasting data instead of publicVariable if that data is not read-only or it needs to be synchronized somehow
i'm curious to know how many people actually implement CfgRemoteExec security
i.e. allowing only certain commands
π
["VulcanPinch","Vulcan Pinch","",{_target setDamage 1;},{true},{},[parameters], [0,0,0], 100] call ace_interact_menu_fnc_createAction;
how ar the parameters supposed to be written? i need to pass them to a script i execute with this ace action, but cant seem to pass the params.
is is supposed to look like this
[_var1,_var2]
?
["Execute script","Execute script","",{_var1 execVM "script.sqf";},{true},{},[_var1], [0,0,0], 100] call ace_interact_menu_fnc_createAction;
along these lines is the goal.
the problem is the variables dont get passed into the script. it just says _this = any
@spark turret
https://ace3mod.com/wiki/framework/interactionMenu-framework.html#36-advanced-example
The advanced example uses
params ["_target", "_player", "_params"];
diag_log format ["_statement [%1, %2, %3]", _target, _player, _params];
to get the parameters passed to it.
Have you tried adding that and seeing what it returns?
thank you i will try that. i fugred out by now how to pass target and caller, will now try to get custom params
ahhh awesome it works now. Blessed be the gods of scripting and @verbal saddle
someone said something about a blessing?
Documentation :tapshead:
Aint no grave can hold our bodies down, @plush oriole !
Still messing up with goddamn (hi again, Jesus) add Action. Still no good on dedicated.
What is going so wrong here, any thoughts?
endBox is a global, object's variable name from Eden
Arguments are global, effects are local, sky is blue, rokunin is a retard
initServer
also although targets is optional, if you specify JIP (with true) you need to specify targets
well the players won't be in when the server inits
Oh
Why is there a system chat in the middle of the add action command?
debugging i assume
it breaks it.
Move it down a line.
Oh, damn. That's an artifact, she was not a function when she was young!
Also have you confirmed that true is the correct target?
Wiki says to use a number, object, string, side, group or array for the target.
true/false is for the JIP optional parameter
I fixed that
well the players won't be in when the server inits
this scares me
I have a persistent mission where server should set up a button for winning a game (if conditions are met)
What is the correct scheduling for this situation?
In a perfect world server should set up a button and then just send it to the local machines (existing and the newcomers) for everyone to get this button
yeah so
And I like smashed my face to the MP Scripting article
so endBox remoteExec ["bfEndAction", true]; I think should be endBox remoteExec ["bfEndAction", 0, true];
that is already done
although the targets parameter is optional, if you specify JIP as true then you need to specify targets
ok
Here is a remoteexeccall using addaction.
[_unit,
["Create the Antidote",
{
params ["_target", "_caller"];
if ("RyanZombiesAntiVirusCure_Item" in (vestItems _caller + uniformItems _caller + backpackItems _caller + assignedItems _caller)) then
{
"End2" call BIS_fnc_endMissionServer;
}
else
{
hint format ["You don't have the Antidote!", _caller];
};
},
[], 2, true, true, "", "", 3, false, "", ""]
] remoteExecCall ["addAction", _unit];
oh god the formating
looks fancy! I'll try that, thanks
you could change end line to remoteExecCall ["addAction", _unit, _unit];
oh nvmnd you I guess in your case the action is added to some "player" unit?
That would cover the player leaving and joining correct?
But in general when adding global action to some object via RE it's better to use:
_args remoteExecCall ["addAction", _unit, _unit];
instead of
_args remoteExecCall ["addAction", _unit, true];
if you use <object> instead of true in RE 3rd right param this will be in jip queue as long as object exists. If it gets deleted then it's removed from JIP queue.
it is actually an empty blood bag object π
object exists forever it's indestructible
Is it bad if I use _arg remoteExecCall ["myFuncWithAddAction", _unit, true] instead of _arg remoteExecCall ["addAction", _unit, true];?
Problem with _args remoteExecCall ["addAction", _unit, _unit]; is that you can use _unit only once in the JIP queue as a JIP ID π¦ so there can't be more than one JIP function calls attached to _unit
I think it's preferable to call your custom scripted function instead of addAction directly, better for security and you can run extra code on that obect as well
It's prefered if you have translations etc. as you can translate client side then.
So I got completely confused at last.
In my understanding it was possible to use remoteExec(Call) in a same way as simple call does. Like in myGlobalVar call myFunc with myGlobalVar becoming a _this of the myFunc. I thought that it's the same for myGlobalVar remoteExec ["myFunc", -2, true] so myGlobalVar will be _this for myFunc. Is there a difference?
ok, probably not _this but _this select 0 as I've tried both
myGlobalVar remoteExec ["myFunc", -2, true] this is valid, it will execute code stored in global myFunc everywhere but on server.
The value of _this for executed code will be same as myGlobalVar at the time you've done remoteExec
have in mind remoteExec = spawn, remoteExecCall = call
I've got the difference I think, thanks
That matters. And that brings me to the scheduling of all.
Persistent mission, server needs to apply addActionto the Mission Win Button. And then send it to everybody newcomers included. What is the best place to call it schedule-wise? Init? initServer?
Is there a way to convert the selections from hitPart EH to something I can use in setHitPointDamage?
@dull drum somewhere around server initialization
well I think you can also put it into init field of the object itself, I am not sure if it's run on each client when he joins or only at the server
That's a good question
Is there a way to cancel reload animation?
And to interrupt or to exclude completely?
@peak plover _selection param should contain something that looks like a HitPoint
you can but they'll lose a magazine
Sure, its intended
You want to steal from them as they press "R"? π
that'll interupt it, I cant remember if it takes away their current magazine or the one they're reloading to
Mmm! I smell some Slavic language here!
getAllHitPointsDamage doesn't have a match as well
mala vrtule flashbacks
I could just manually translate it and then try to do that for EVERY part
but god damn
'little propeller'
I need a easier way
are you translating from the old to the new hitpoint system
no clue
didn't even know there is a new one
I just know that one is for the turret
Probably a HandleDamage EH will be more of a help?
I can't use handledamage
Because the selection there is ""
So I wouldn't even know what part was hit at all
this one at least tells me that a turret was hit, but in czech
@ivory lake Thanks, just tested and it loses the magazine it was about to reload and the original magazine still on the gun but not in the model.
magazine proxies might bug it out
I feel that I saw a table of Czech terminology of the hit points on the Biki
you can probably remove the magazine and readd it to fix that
https://community.bistudio.com/wiki/ArmA:_Selection_Translations all hail the OtocVez!
Good ol'times of thinking HitPoints as of a usual health bar
and then BANG otocvez!
It feels bad to be russian and suck in understanding Czech completely
@ivory lake how do you add the magazine into the gun and not the player?
support magazines now
'now', was added awhile back
so yeah you'd just get the magazine type, and their current ammo, remove thecurrent mag, readd it with those, setAmmo etc
So the Tracers module appears t obe a zeus-style one
as in when created it makes a few tracers, then disappears
is there a scripting solution to make a nice looking battle with tracers flying back and forth
I see that I will have to use setAmmo later to add preveous amout of ammo on the magazine
Can disableAI be run on a vehicle or do I have to loop through the vehicle's crew?
I would say crew
yeah that seems to be it
isn't the vehicle sim inherited though?
did you mean fsm
hmm
well it's only called on init anyway so no performance hit either way for me
Is there a way to expecificly select and remove/add ammo to a magazine? I would like to select the magazine that has the lower amout of ammo and remove/add ammo from it or either delete it, since removeMagazine randonly removes an magazine with no other option.
no there is no command to remove specific mag
collect all mags and ammocounts of type, remove all of them. And re-add according to your list
How do I get the amout that the magazine can carry?
config
configFile >> CfgMagazines >> magazine classname >> something
I think the entry is "count" or similar
yeah that
private _allMagazinesUnit = magazinesAmmoFull _unit;
_allMagazinesUnit sort true;
will make it so the first mags are the most empty iirc
in that array
What about this? is it reliable to know the magazine limit?
_cmd = currentMagazineDetail player;
_cmd = _cmd splitString "([ ]/:)";
_MagazineLimit = _cmd select 4;
_MagazineLimit; //return 5
that's much slower than just doing
private _fullMagNum = getNumber (configFile >> "CfgMagazines" >> _rifleMag >> "count");
"is it reliable to know the magazine limit" no not at all
and can potentially fuck up
magazine name might contain any of the split characters
yeah
Good call.
I wish that command got turned into something a bit more useful
because it's got access to stuff no other command gets (magazine ids)
and I had to do something similar and yeah... if the name is something weird it'll break everything
Would be useful if they completed implementing the magazine/weapon id stuff
which they didn't
aye
atleast you can use the magazine ids with that though to force a particular magazine to be loaded
Also, why the heavly use of "private" in your scripts? I only remember using when I dont want other scopes to have that local variables.
I guess im missing something important
yeah i've never used it
You should always use private
If it's possible that anyone else ever sees your script and might copy parts of it, use private
If you still wouldn't. Private also makes your script faster
yeah it's a good practice
You mean, if some one wants to copy my script private can help?
private always helps
If someone copies your script, you might screw him over with undebuggable and extremely hard to find and unexplainable errors.
If you don't use it your script will be slower than if you'd use it
It also improves readability as it shows you where a variable is first set
so what's the difference between _ and private
does it prevent inheritance of the scope
yes it prevents inheritance
I hate to ask twice, but I want to double check before reinventing the wheel. Has anyone come across a function to check a group and determine it in general terms as "Infantry," "Mechanized," etc? Simple mechanics for a function
It would just be tiered checks for assigned vehicles, group count, type of vehicles etc...
none built in
I am currently trying to hide the GPS coords on the HuntIR (from ACE3)
For this I tried to overwrite the function ACE_huntir_fnc_cam and modifying line 152 (https://github.com/acemod/ACE3/blob/e2ac18a05d5f646bc7cbc043bcc148fde4c0f5dd/addons/huntir/functions/fnc_cam.sqf#L152)
For some reason I can't override the function, anybody has an idea why not? (Is it compiled with compileFinal or what could cause this behaviour?)
yes compilefinal/defined in cfgFunctions would be why
"Is it compiled with compileFinal" yes
overriding ace stuff is actually quite complicated.
easiest way is to replace their preStart/preInit in config and redirect the compiliation for your one function
that would require an addon and can't be done in the mission file or am I wrong?
if all you want to do is hide the GPS coordinates
i'd just make a 'hook' function that hides the control
backup plan is findDisplay in an endless loop and hide the control, although i am worried that it might kill performance?
it'd affect it but probably not as much as you'd think...
"that would require an addon and can't be done in the mission file" yes
there may be a way to have it only launch the loop when it's needed though
@ivory lake Any tips how to hook without writing an addon, that is the current limitation I have
"backup plan is findDisplay in an endless loop" display creation eventhandler from CBA
Then just hide once when the display is opened
I forgot cba had that
ah nice didn't know that CBA had that
ace only sets the text so you can just hide it once the display opens
so no need for loops etc
Thank you, will try it out
https://github.com/michail-nikolaev/task-force-arma-3-radio/blob/master/addons/core/CfgEventHandlers.hpp#L21
I guess you can do that in description.ext. But there should also be a scripted way to add these
https://github.com/CBATeam/CBA_A3/blob/master/addons/xeh/fnc_initDisplay.sqf#L18 okey mission config aka descirption.ext only
^ no
That is the only displayHandler Stuff I can find in CBA?
what mean
description.ext it is then
@still forum , have you seen anyone script armor damage here?
dunno
π¦
Why?
Cuz i say so
What you have against KK?
Where did he mentioned that?
4 posts up?
no I didn't
He meant #
It's useless as it's basically a copy of select with another name, and also only some of the syntax'es of select, and it can cause preprocessor problems
I agree
[[1]]#0#0
vs
[[1]] select 0 select 0
or other fuckeroo
So no, i fully disagree with you on that.
Is not faster
Who said it was faster?
it's probably more about 'readability'
Yep
but the preprocessor problems is a valid issue
shorter readings
Readability is worse
If you think so
i never use it personally but I only realized it exists a few months ago
No one knows what the fuck this # means, people are confused
Even more confused when they found out
Not rly, but okay.
Yep, never use pushback for example
or params
beacuse nobody knows what it means or get confused by it
if you want more readability, you use params and give it readable names
That not a real argument, tho
is not replace for select only for 1 particular select syntax which makes it inconsistent
why use params, when you don't need it for a var?
e.g. if you want something from getPos?
Params is faster. End of.
M242 ... π€¦
"e.g. if you want something from getPos?" params is faster if you want more than a single value
Most new commands either bring unavailable before functionality or improve speed
especially for splitting a position it's very nice
is neither
How much faster? 1-2ms?
what about for nested arrays like the whole select 0 select 0 example earlier
No # is the same as select no difference speed wise
It has, but okay.
since you edited yours:
*speedwise, probably.
And? That wasn't the point.
It has what?
It's subjective whether you like it, but objectively it's bad
much better, sooo furry, lets continue
potentially can interfere with preprocessor select canβt
I like that it's doesn't have those goddamn long lines of text anymore, when selecting SubArrs
Just like some people prefer to launch their arma with -cpuCount and -maxVRAM
It's retarded and makes no sense. But some people are just... subjectively not that brain gifted
I saw people using it inside () which defeats the purpose it was added
Because they just like the look
It does not fire in the frist time when the key is pressed, it only happens the second time when the animation starts
player addAction
[
"",
{
params ["_target", "_caller", "_actionId", "_arguments"];
systemChat "reloading!!!1";
},
[],
1.5,
true,
true,
"reloadMagazine",
"true",
50,
false,
"",
""
];
Any fix for that?
what the what are you doing?
check when the player press the reload button
π€
Yeah... about that
since the reloaded event handle only fires when it finished, I need to check at the moment when the player press the reload button.
We have a reload eventhandler, but that's config only -.-
related to this, was there ever a workaround for inputAction problem?
no
damn
What problem?
I have one in the pipeline, that returns better keycodes
heh
stop writing!
Cuz you aren't giving money to me on patreon
Gimme moneyz first!
Wait! Dude!
Let's open up a life Server!!!!111
Many π΅ π΅ π΅ π΅
Nah, i have a Gewissen *conscience
I said smart, not good
So, other perfomacy friendly option for checking if the player is reloading?
use inputaction for the reload check instead @astral tendon
if (inputAction "reloadMagazine" > 0) then {
Darn, I will have to loop it.
yeah - it's that or reload config EH
But keep in mind that it might break for anyone who rebinds their reload key
i think inputAction is a bit more reliable when it comes to weird keybinds isn't it?
the opposite
really? hmm
You keep saying there is a problem but not saying what problem
float
input + input + input + modifiers = dies
InputAction works outside of it
Maybe we are mixing it up with actionKeys?
Yep most likely
oh yeah we are lol
actionKeys is the important one for overriding bindings though, cant do that with an inputaction
If binding is mouse you canβt override it
Yeah, actionKeys beeing fixed would be nice to have.
Canβt fix needs new variants returning string
What do you use for string replace?
inputAction also does not check when player reloads from the inventory by draging an magazine to the weapon, is there other way to check if the player is reloading?
What u mean? @tough abyss
How you do it c++ side
Dunno yet, haven't looked into it
probably copy string, find match, replace match with target, return copy (not actually, more optimized)
I think you'll need to use reload EH then roque
checking if they use the action menu is possible (but shitty and wouldnt advise it) and maybe the UI too but uhhhh
like iirc for action menu you'd need to use:
https://community.bistudio.com/wiki/inGameUISetEventHandler
which cant be stacked, and i think you'd have to compare a string to determine if its a magazine one
there could be better ways though but im not aware of them...
I already tried with it, it only checks if the action from the action menu was used.
Yeah, you'd need to basically have 3 checks, one for the key press, one for action menu, one for UI (not sure how you'd do the UI)
Add EH to UI elements
https://community.bistudio.com/wiki/addAction
Can I use combination with two shortcuts? like reloadMagazine+moveForward
Is there any way to equip a backpack in the world (similar to literally just picking it up) that can be done through code?
Perfect, thank you!
In eden scenario attributes, what description.ext property is the 'init' field
i.e. is it run on server start, on client join etc?
do you mean the expression for each of the scenario values?
possibly
eden editor > attributes (at the top) > general > Init
yeah it would make sense for it to be init.sqf
yeah, scenario start serverside
ok thanks
has anyone built a syntax highlighitng package for VS Code or anything like that
oh never mind i found one
enable snippets
is that how i get it to work after installing
ah nevermind
a restart worked
oh my god proper syntax highlighting
my eyes are blessed
there are also linters and stuff
notepad++ syntax for arma wew
i have a very annoying bug with np++
sometimes when i save it tries to save every open file
and save all is ctrl shift s
which i don't think i'm accidentally pressing
Can i share here the code i did to avoid dead players and dead players weapons to goes underground? You need to put the code in init.sqf
it have 47 lines
I would love to post here
Why would you share it here?
So that others can see and use it?
It will be pushed out of view in a few hours and noone will see it anymore
Here is the code i did to avoid player corpse and weapons from going underground: https://pastebin.com/u5ztKuTk
thanks for all the hands claps!
Hi ppl! Long story short, I need to get coordinates of all existing objects on the map. Does anyone know how to do it?
is there a way to get a player object using the players UID?
iterate through all players and find the one that has same uid
alright just checking
There is one problem, getPlayerUID can fail when the player is not local.
What i do is store the UID in player namespace withplayer setVariable ["x_uid",getPlayerUID player,true]
And when i need a player UID i use that:_player getVariable "x_uid"
Hey, guys, did someone try to add RHS universal afterburner script to another plane?
for some reason addforce does nothing for cup su-34 plane
How to get the weapon reload time?
thats the tough question
the best is to use the brand new reload weapon eventhandler from config
you can estimate the reloading time by checking animation speed and multiplying it by animation coeficent, but it is really tricky thing
how to find that?
get reload animation speed value and get customanimcoeficent of player
how?
well unfourtunately i have removed that code from script
so i dont have copypaste right now
Does the info in this forum post still work? https://forums.bohemia.net/forums/topic/216436-getting-weapons-reload-time-and-magazine-size/?do=findComment&comment=3287546
i think it doesent
Worth a try though
I think it's a bug that "Deleted" event handler is being called when a unit enters a vehicle? I can perfectly reproduce it in an empty mission with just player's unit and a car
Please @ me because I think I'm going to create a feedback tracker issue if you guys also think it's a bug
What object is it being called for and what is the effect in game cause I get in and out of vehicles all the time...
@astral dawn
the Deleted event handler is called when a unit enters or leaves a vheicle graahme
that's the supposed bug, and it seems to be an actual issue
On what entity?
the unit i assume
possibly something to do with the fact it gets teleported inside the vehicle so its model moves
cause there's some weird renderlayer stuff going on in vehicles
like th evehicle always renders in front of terrain even if you're sunk into the ground
Not seen an in game effect... cause I get in and out of vics in ARMA several dozen times a day... Oh, that makes sense... deletes your player object and recreates it in the vic? Trying to work out what the "bug" is that is being reported
no
the scripting event
i.e. if you add an event handler to listen for the 'delete' event happening
it triggers
doesn't mean your unit is necessarily deleted
just that some bit of Arma thinks it has enough to tell your script it has
bug is that I have never heard of unit's object being deleted when he enters/leaves a vehicle, so "Deleted" event handler should not get triggered in my opinion
Oh... okay... don't use the delete EH thankfully
hmm
put it on the feedback tracker if it's not already there
it may be intended in which case it should really be documented
it may be intended in which case it should really be documented that's a quote I'd like to see at the top of biki π
Biki is community maintained
'may' and 'should' words highlight that it is community maintained π
Ask Dedmen Jesus
i mean intended is actually quite subjective
one person may have intended it and no one else knows
in arma there is no such thing as a bug, only an undocumented feature
oh yeah me too, in fact Dwarden has responded to me like half a year later asking if I still wanted the account, I said 'yes why not', then he never answered again π I already forgot what I wanted to write there anyway
Ask Dedmen Jesus
He seems to have some say over the Biki... worth a try
As long as you get him in a good mood π
BI obviously has documented their own SQF functions and their functionality for themselves
Don't bet on it π
so... upload that to biki and problem solved, right?
They use BIKI
π€£
mental documentation
so, guys, did anyone experience problems with addforce?
i dont understand the math behind it, i just use couple of plane afterburner scripts and it does nothing on the CUP su-34 plane
tried the RHS and John's Spartan Su-35 afterburner
i think i've used addforce before
to simulate wind conditions when flying helicopters
since i think they don't automatically push the helicopter
have you tested addForce directly?
addForce gives impulse, not constantly added force
ye
Newton's law
F=dp/dt
what I want to say, addForce is not the right name for that function π€£ although it's called the same in physx :/
well, that scripts i have used they do "onEachFrame" BIS_fnc_addStackedEventHandler
and built in limiters
i have copied them almost directly, i see that addforce function parameters are altered by scripts, but plane does not accelerate
i was trying to multiply force and coordinates of model
everything looks ok and working, but plane does not fly faster, thats all
better than being called
hang on
pΕidatSΓlu
just test addForce on its own if possible
i was trying to do
velocity _vehicle addForce [( _velocityNew) vectorMultiply 100000,[0,0,0]];
sqf is somewhat not working bbcode tag
ok i messed up a bit
private _velocity = velocity _vehicle;
_vehicle addForce [(_velocity) vectorMultiply 100000,[0,0,0]];
i did this
in the loop
try [0,-1,0]
Since a couple years, yeah
i think i tried different offsets, ill make sure to check again tomorrow
thanks for the tips
pushme = vehicle player; onEachFrame {pushme addForce [pushme vectorModelToWorld [0,500000,0],getCenterOfMass pushme];}
I didn't look through your code though
but what I have posted pushes my plane very well π
25000 km/h feels very nice
Found some pretty old stuff:
CruiseControl =
{
_Veh = vehicle player;
_Speed = (speed _Veh);
_Mass = (getMass _Veh);
_MaxSpeed = 60;
if(_Speed <= _MaxSpeed)then
{
_Newt = (((_MaxSpeed+3) / 3.6) * _Mass) / 100;
_LinConv = linearConversion [0,_MaxSpeed,_Speed,_Newt,0,true];
_Force = _Veh vectorModelToWorld [0,_LinConv,0];
_Veh addForce [_Force, [0,-5,0]];
};
if(_Speed > _MaxSpeed)then
{
_Newt = (((_MaxSpeed-3) / 3.6) * _Mass) / 100;
_LinConv = linearConversion [0,_MaxSpeed,_Speed,0,_Newt,false];
_Force = _Veh vectorModelToWorld [0,- _LinConv,0];
_Veh addForce [_Force, [0,-5,0]];
};
};```
oh boy, from june 2017
hmm
You know, exact your code does not help
i have cup su-34 with lightly changed pylons
may be addforce requires like planex simulation and cup is on old plane?
to avoid pitch/yaw torque from addforce, you should add force to the center of mass ideally
pushme does nothing(
π’
simulation = "Airplane";
simulation = "airplaneX";
yes i think that could be reason
x could stand for physX
addForce is a physX related command
seems to be the case π¦
so the older command is removed
yes x is physx
ok there are older scripts with velocity command or so
anyways thanks for your help!
Ah right
good night)
Iβm not good with scripting, and hell I donβt even know if this is the right channel but what script would you use to get the showers to move that came with the new contact pack?
they should be placeable from the editor
aren't they
without scripting
or do you need to bc it's from the compatability addon
You mean animate them?
So you should be able to place them down, walk up to them ingame and turn them on?
Yeah
Like how it was in the trailer
well i imagine it's just a water particle spawner at each spray nozzle
although the spray nozzles moe
omve
move
hmm
Maybe they do turn on
you'll still have to write it i imagine, although I haven't experimented with this at all
Maybe they pulled a sneaky on us, and yeah
Look at the valve... should be an action menu option then per Reyhard after they were added to dev branch
Iβll try that, cheers
ah nice
so i'm wondering if anyone knows of a script where you can switch your pistol with something one that's in your vest, clothing or packpack to your pistol slot. so an example would be Glock (in vest) PO7 (in hands) to PO7 (in vest) Glock (in hands) without going into your inventory and dragging it?
Anyone know who made xsspawns?
Having problem with custom map not panning correctly see lots of black
Black Sky?
Keep getting this error. Didnt have it earlier idk. Using lythium custom map
And just trying to get the map menu to pan zoomed in so it doesent start off black
You need to add widthRailWayο»Ώ = 1;to the RscMapControl ο»Ώο»Ώarray ο»Ώο»Ώin the dialog definition giving that error... Was a change in 1.90
Doesent seem to work
Keeps hanging on loading screen I added it to where the error was but nooby to scripting so... Il try more
I tried to read the error but it says description.ext though
fixed it. Now just trying to get it so map doesent pan all the way to the left with just black you have to move your cursor and pan the map so its in your view
thanks @restive leaf thanks alot π
text = "";
x = 0.066875 * safezoneW + safezoneX;
y = 0.332 * safezoneH + safezoneY;
w = 0.49875 * safezoneW;
h = 0.602 * safezoneH;
moveOnEdges = 0;
maxSatelliteAlpha = 0.75;
alphaFadeStartScale = 1.15;
alphaFadeEndScale = 1.29;
colorOutside[] = {0.0,0.0,0.0,1.0};
widthRailWay = 1;
};```
Someone mentioned that issue today in discord... may be worth a search for it... the black thing
Is this something to do with what I am trying to do
Just needs panning abit
If thats the correct word
I can't help with that... Long time UNIX Engineer but I hated X Windows work... hate damned windows on a computer
Scripting, OSes, networks, storage, networked storage... then I am your man
Sat Mask: 10240x10240
Satelital Image resolution: 20480x20480
I am confused as to which ones the actual size. This maps a lot smaller well slightly smaller than other maps
I am blind but thanks for the help. Was going nuts with that error
From my very limited experience the satellite image is generally 1px = 1m, sat mask is not. So I would guess that the map is 20km x 20km but I might be completely wrong
ye its because this is smaller than other maps so where its zoomed out would be where locations would be on say altis
I'm not sure if this is the place to ask but i cant seem to get the script to add images on computers correct on this mission, it tells me the image cannot be found when im looking at the image its self
im having an issue with my chat commands feature on my server. there is a player who no mater what i do cant use the chat commands. Below is the code i send to the client to run and detect chat commands. I send this to the client on creation of the player object. I have confirmed that it is successfully being sent to their client but i have no idea what happens after that because i don't have access to their system. CAN anyone spot reasons why this would not be working for a client. out of 70 other players i have had no complaints except this one player. and yes it is for sure not working on their end.
https://pastebin.com/X3tn2ttt
@astral dawn if your deleted EH bug is real, it will break ACE. So if you can reproduce it then please report and maybe tell Dwarden too :U
@restive leaf since the new account system I don't create Biki accounts anymore. I guess i could but I don't know what other stuff is connected with that in the backend that I might accidentally break.
@exotic tinsel
if (_uid == _temp_uid) then
{
_player = _x;
_goodtogo = true;
};
just use findIf.
//if player found then do stuff but.. why? the whileloop waits endlessly until it finds a player.
(true) && does nothing π€
(_this select 1) != 28 maybe that player isn't using that exact key to send chat messages?
_chatArr = toArray utility_8_chatString;
//_chatArr resize 1;
if ((_chatArr select 0) isEqualTo ((toArray "!") select 0))
Why so complicated?
if ((utility_8_chatString select [0,1]) == "!")
Is the player never executing the utility_8_fnc_state_2_apply on the server?
in your waitUntil at L60 you could just store whether it should exit in a variable, instead of messing with exitWith
Also in the waitUntil you are executing findDisplay 24 3 times. And displayCtrl 101 twice, just store it in a variable.
@still forum thanks for the code improvments. i have made them. So, if the player does not have the key bound to 28 then it wont work. what could i do to get around that issue?
Maybe there is a inputAction name for the chat send key
Hi ppl! Long story short, I need to get coordinates of all existing objects on the map. Does anyone know how to do it?
use, nearestobjects, a foreach, and postion. google each of those terms and put it together.
https://community.bistudio.com/wiki/allMissionObjects if all you want is mission ones and not island/map ones
or better yet https://community.bistudio.com/wiki/entities
Looks like there is input actions for channel switching, chat, ptt, von and then specific channels.
https://community.bistudio.com/wiki/inputAction/actions#Multiplayer
@still forum You were right. i can not believe it but the dude types a message and every time, hits the num pad enter key instead of the enter key. some odd habit he formed. lol.
How can the "deleted" event handler bug break ace if it didn't break it yet?
because we use deleted eh in next version
Ah ok
Well since I add the deleted handler to killed units, I just check if the unit is not alive in the eh code
A temp fix for now
Can infantry send Datalink targets or only vehicles? kinda confused bc the BI example is this vehicleReportRemoteTargets (vehicle player);
all OPFOR infantry is set to send datalink and an SU-24 Frogfoot CAS plane is set to receive but doesnt seem to get the targets when i check with targetsQuery
yos has
or does the data link even ahve any effect on AI units? i feel like its just made for players.
data link does work
hang on do you have it enabled in the unit's settings
in eden
afaik infantry have it disabled by default
Does anyone know where I can edit the pan of the map to fix this
Cant post screenies damn
hey, trying to binarize my addon but I'm getting this
2019-06-26 10:12:58,740 [ INFO] 9: Binarizing ...
2019-06-26 10:13:07,005 [ERROR] 9: Process ended with non-zero code. Exit code: -1073741819
2019-06-26 10:13:07,009 [ERROR] 9: !>
2019-06-26 10:13:07,011 [ INFO] 9: Done.
2019-06-26 10:13:07,013 [ERROR] 9: Build failed
it successfully converted the configs
but right after, gives me that
@desert lava Do you mean that it goes to coordinate (0,0), which looks ugly
you could add some rectangular markers to disguise it
I have been doing DayZ but isnt there easier ways to edit minimap and stuff using editor. Or does it have to be scripted?
no I think you'll have to script
I don't think any of this is built into the editor
@tough abyss what tool are you using for packing?
@still forum fixed it, had an binarized model
so im still tinkering with information the AI collects about their enemies. With targetsquery i get an array for enemy inf, tanks etc that looks liek this:
´´´[1,B Alpha 2-3:9,WEST,""CUP_B_Challenger2_Desert_BAF"",[3132.97,4950.85],60.495]´´´
now, the problem is that the class name is double stringed (notice the 2 " before and after, and that fucks up when i want to do further stuff with the name. how do i take the name and take away one "?
Same for vanilla vehicles?
good question, et me test
slice the string, although they may not always have the double string
please explain
hmm arma has no slicing
basically chop the first and last characters off
to remove the quotes
heres the rusult with vanilla vehicles
[1,B Alpha 2-4:8,WEST,""B_Truck_01_mover_F"",[2889.33,4987.01],2.85]]
altough te double string might be bc i log it with diag_log format
_targets = _unit targetsQuery [objNull, WEST, "", [], 600];
{ _TargetX = _x;
_Target_Class = _TargetX select 3; //get Classname of target
{
if (_Target_Class isKindOf _x) then {
_Target_Type = _x;
}else {
_Target_Type = "unknown";
}; //gets type of Target (infantry, heli, car, tank etc)
} forEach ["Car","Tank","Man","Plane","Helicopter"];
_tpyeInfo = [_target_Type,_Target_Class];
}forEach _targets;
_targets is array of arrays so _x is array
What are you trying to achieve passing it to isKindOf
I mean there is syntax of isKindOf that takes array but not this kind of array
its probably not the most effective, i wanna check what kind the target is: is it a tank, car, heli etc
any better way to do that?
Effective? At the moment your code makes 0 sense
yeah i think i fixed the double string thing
Ah wait there is another foreach
okay fixed the double string. now how do i get info from a class name about what kind of vehicle it is?
ahhhhhhhhhh
yeah that might be the problem. i use it later on in my averall info output but its retricted to inside the foreach.
_Target_Type is first defined inside the scope of if? Then it will be undefined in that tpyeInfo array
yeah that was the problem
damn its always the obvious little things lol
anyways, now i get a correct classname but it outputs type "unknow" for the vanilla HEMTT truck, which is a "car" in the config parents
ah bc it wants an object, not a classname
Because you do not exit and it carries on comparing it to other classes, until it compares it to helicopter then exits. But it is not a helicopter so the last assigned value is "unknown"
Nothing to do with object or not
Put the car last and it will comeback with car
so delete the else {_Target_Type = "unknown";}?
Why?
well, then it will only change the target type once, when it matches
i gotta be honest, i dont know how to do that lol
I gotta be honest as well, Iβm on mobile and it is quite awkward viewing or typing code. Maybe someone can correct it for you
You can try delete that else ... and instead of then use exitWith
yesssssssss it works
Literally replace word then with exitWith after you deleted else expression
thanks @tough abyss
I am attempting to use an old C-RAM script (Shoot down Misses & Mortars using the Praetorian) , the script works but the issue is that weapon is too accurate and shoots one round to take out a mortar... any idea where I may change the accuracy?
at line 23
that's where it fires
so maybe insert a line which adds some random rotation to the turret
Does anyone know if attachTo causes inheritance of the Simulated property?
It doesnβt shoot anything, it deletes target and creates explosion in place, it is a lousy cheat shit @dry owl
For effect
huh
in my experience fireAtTarget doesn't even move the barrel
oh i see it makes the bullets for effect
dont use Forecweaponfire, it overwrties ammo in the mag.
use this instead:
_currentWeapon = currentWeapon _unit;
_weaponModes = getArray (configFile/"CfgWeapons"/_currentWeapon/"modes");
_desiredWeapon = _weaponModes select 0;
[_unit, _currentWeapon ] call BIS_fnc_fire;
Why does this dont work? https://pastebin.com/TdaY3V8R
bc spelling mistake "Deutschtes Kennzeichen"
this is not the error
then i dont know Β―_(γ)_/Β―
rip π¦
that's not #arma3_scripting , that's #arma3_config π
the customization dont show up in the init menu
Okay Thx
Does anyone know a possible way I could fix this https://cdn.discordapp.com/attachments/590703804668706816/593247326097768458/unknown.png
Ccheers
@desert lava looks like an issue with a mod, ask the creator
I dont think it is. I think its because the map is a lot smaller than other arma maps so wheres theres black would be part of the map
Il mess around. see what I can do.
If anyone could help or give me an idea of what to edit or if I need to make a new script what to override
Would it be in that specific mission?
Hi guys.
Could you advise me on why string 49 does not shoot even in hosted MP?
https://pastebin.com/eAtctFVV
everything is run from initPlayerLocal
The .rpt file shows no errors or other info messages it just does not work.
"string 49"?
"doesn't shoot"?
Well, the calling function under it π
Yup
have you tried adding diag_log's around it to see where it strops executing things?
(findDisplay 46) maybe the display doesn't exist yet
I'm trying to systemChat it
Yup, it shoots actually. Just missed the message from SysChat it was on the map screen.
It's very possible then, that display is indeed absent. How should I wait for it to be set up?
waitUntil
waitUntil { !isNull findDisplay 46 }; should be of a help here I thin...
Yes
π
Thank you
Btw "shoot" has a very different meaning from "execute" which is what you actually mean
The order of things is still very hard to me to understand. Especially when it comes to MP scripting.
Yup, I meant executed
where is it being run
actually yes if this is being run first then the displays won't exist
I have a riddle-like question. Everything I wanted to work is working, but I don't really got why π
so did you add the part which waits until display 46 exists?
Yeah, sure. And it worked neatly.
So here is the complete riddle to me
Question is in the string 16, problem is in string 5
Why doing a remote exec for the function, some script commands should be applied directly and others - through the additional remoteExec?
Because, for example, setUnitLoadout is both Global in args and Effect?
Would somebody point out to me what's wrong with my breaching script, whenever I press ok it comes up with Activation on: as an error message. Yes im new to this https://pastebin.com/8GxsQWPM
Im using a trigger to activate it
what's the error message
is that it?
Yeah
do you actually have units named 'flashbang', 'guard', 'doorman' etc
Yeah
I just put it into a trigger
can you grab screenshot of trigger UI?
Yeah lemme get one
Is that it?
https://imgur.com/Xktbdox This is the error message
Just as it is? like that?
nope condition "this" is correct :/
Thanks for useful error messages Arma
did you write code yourself or copy from BI Forum?
hang on where's the flashbang
does it work if you only use one line? the firt setPos maybe
ye but where's the flashbang
Where?
there's no object called 'flashbang' at the moment
Nonono thats the name of the unit
I think your quotes are not real quotes
"?
Yep they are
those ones?
Guard switchmove βActs_Breaching_Threeβ;
Doorman switchmove βActs_Breaching_Four";
Deadman switchmove "Acts_Breaching_One";
β vs "
Didnt even know there was such thing as a fake quote
I don't know real name. Maybe "stylized quote". Office programs really like to just replace your quotes with that
THank
omG
π
Now to position them properly
Actually also quick question, is there a script that opens the doors at a certain time in?
Of a building
yep you can open building doors by script
Ah righto
Would you happen to know the classname for one of the apex doors, its from the brick villa
Or is there like a list of door classnames, or am i just looking in the wrong area
So like when they open the door in the breaching, the door opens
Does addCuratorPoints have any connection to Manage Resources Module for Zeus?
i assume it's the same thing
"Points can be adjusted by addCuratorPoints and returned using curatorPoints, or you can use Manage Resources module."
I've used BIS_fnc_curatorObjectRegisteredTable instead of the handler there
what
Yeah, they have it π And it actually works.
But [z1, 1] remoteExecCall ["addCuratorPoints", 0, true]; does not π¦
needs to be run on the server
Oh my god
The UI for that is the green progress bar, holey guacamoley!
I never wanted to kick my own croach this bad for months
oh so was it working
It was indeed
luckily most people aren't that flexible
@plush oriole @tough abyss
could
you
please
make an effort in writing in less messages please!
We're having a conversation though
you are having a conversation this time yes;
yet 6 consecutive messages from one single person is not a conversation and could be shortened.
I don't want to be the party-pooper, but please
Imagine having a discord this large unmuted
How does them having thoughts come to them and pressing enter a few times apart change anything
I think he does have it muted
@winter rose sorry i have a habit of that, I tend to forget and remember a lot
Can someone help me add a Target Lead Indicator to a Hunter HMG?
I need some input if you guys will. I would like to setup Exile mod on the latest map that is coming out with Contact but that is only available on the dev branch at this moment. I do not want to re-download everything i have downloaded up until now. What is the correct way to approach this?
My current thinking is :
1 - Backup
2 - Change to dev branch
3 - Change to master branch
4 - Restore backup
Do mods get affected by switching branches ?
What about use the Arma tools to have both?
Hmm Can you launch the game from Arma tools ? I always taught of arma tools as my server files never tried running the game from there
probably the wrong channel as that is not connected to scripting at all
@fierce oyster what exactly do you wanna do? have a target indicator where you need to shoot to hit a moving vehicle or what?
it's in the weapon config i believe
I found it in the CfgWeapons
"ballisticsComputer"
Tigris has the value "2+4"
i made my own Cfg replacing the original value with 2+4 and packed it into a .pbo and ran it as a mod
no change
yeah thats also the wrong channel lol. might wann check config editing
well,i dunno if there is a script for it
i got an actual related question. My Ai recon script runs fine now, i have AI spotters paste into a global array what the spot of the enemy and then mark that automatically on the map. I get targetsquery from each spotter and then start sorting the info etc. One info passed is the position of the target and when it was spotted. Now, especially with spotted infantry, the time sometimes gets fucked up, returning values like "-2.4 e6". any idea why that is?
its a minor inconvinience bc then my map markers display something like "spotted 35 000 minutes ago"
debug it when it's added
me?
i assume so
yes
Just systemChat/diag_log the value as soon as you find it
Or wait
I assume the command returns the wrong value?
yeah i just reread and i think that's the issue
might be better to handle the timings in your script
i.e. record when the script first detects the detection
ah so replace the wrong value with the actual time
yeah you re right, the command returns a non sense value, usually when first contact is made
hmm
Hello you fine people, is it possible to increase the backpack size? Basically what I want to do it fit. Sniper rifle and assault rifle in so I can easily switch between the 2 or can we equip both at the same time like you would with a launcher etc
there's an addon for multiple primaries
but i think larger backpacks could hold two full sized weapons
Does BIS_fnc_randomPos allow for locations as input or not? https://community.bistudio.com/wiki/BIS_fnc_randomPos Wiki says yes, but when I execute this code in game, it errors out:
[_location, [], {isOnRoad _this}] call BIS_fnc_randomPos;```
[BIS_fnc_randomPos] Error: type LOCATION, expected ARRAY, on index 0, in [Location Mount 2864, 6084,[],{isOnRoad _this}]
It seems to work now, but executing it in Agia Marina on Stratis occasionally puts it at [0,0]
[0,0] if position cannot be found
Dang, I'd hoped it would check until it found one.
You can just get a random pos and get the nearest road to that post
and redo if no road found
There is no guarantee there is a road at all 'tho
Is there any way to force a localization when running scripts involving the configFile as a client? I assume people having their language set to something else is resulting in non-English strings.
you mean things like displayName?
Yeah
They are localized when the config is loaded, you can't find out what stringtable name they use and also can't translate to other language
Hi all !
The following is working fine in Local host, but is extremly slow or not working on dedicated π¦ some help
waitUntil {{alive _x} count (allUnits select {isPlayer _x}) isEqualTo count (allUnits + allDeadMen)};```
{alive _x} count (allUnits select {isPlayer _x}) why not combine both in a single count
also why not use allPlayers if you want only players?
because allPlayers has proven to have huge issues...
and sometimes, in some situations, it doesn't hold the correct number of players
(allUnits + allDeadMen) on the other hand will always
Hi guys. Is there any other way to check if Sector is being conquered by Side except just placing a trigger area with onPresent nearby?
@still forum would this be faster ? maybe the waitUntil is the issue ?
while {!(({alive _x && isPlayer _x} count allUnits) isEqualTo (count (allUnits + allDeadMen)))} do
{
uisleep 0.1;
};```
dunno
this just looked more complicated, while doing basically the same thing
what do you mean by "extremely slow" and "not working" exactly?
on dedicated:
if i'm alone on server, it will work but will take 10s to turn true
if there are player with me, it will never turn true
"but will take 10s to turn true" that might just be caused by how scheduled works
"it will never turn true" have you tried executing parts of the stuff manually in debug console and seeing what the returned values are and if they are what you expect?
Allplayers broken
word
I had issue with allPlayers as well
A long time ago
Don't really use it that much anymore
yes. If it was only my experience, I would doubt myself but BI devs confirmed it to me π¦
What does your code do?
the one i'm trying to debug ?
Yes, the slow one
well {alive _x && isPlayer _x} count allUnits
if allPlayers was working i'd do a {alive _x} forEach allPlayers
why +allDeadMen
Actually...
That can never be true
As soon as you have a single non player unit that won't work anymore
i'd do a {alive _x} forEach allPlayers that would only return the alive state of the last player in the list
oh indeed. maybe that's why it's not working π
private _allPlayers = (allUnits + allDeadMen) select {isPlayer _x};
private _allPlayersAlive = _allPlayers select {isAlive _x};
private _isAllPlayersAlive = (count _allPlayers) isEqualTo (count _allPlayersAlive);
you are comparing the number of alive players against all units and wait for them to be equal
what if you have 5 AI's and one player
is this what you mean?
i'd do a {alive _x} forEach allPlayers that would only return the alive state of the last player in the list YES TRUE SORRY
even if all players are alive, you are waiting till 1 == 6, which will never happen
@peak plover findIf
first non alive player -> boom
@still forum sorry should have mentionned, I have ZERO AI, and never will have
modules ?
checkin
editor modules, logics
Are HC's alive and isPlayer π
Well @peak plover's code works. just need to optimize with findIf
Zeus must be a module?
ye
Are Triggers also units?
They are Detector's which might also count into logics
private _allPlayers = (allUnits + allDeadMen) findIf {isPlayer _x};
private _allPlayersAlive = _allPlayers findIf {isAlive _x};
private _isAllPlayersAlive = (count _allPlayers) isEqualTo (count _allPlayersAlive);``` ?
@still forum ```sqf
private _isAPlayerDead = ((allDeadMen) findIf {
isPlayer _x
}) != -1;
What do you think?
Yes I do have spectators
ah yes that would work. I had missed example 2
okay
but I have spectator slots in lobby (game logics)
When a while { true } do {stuff;} won't overload the RAM? Should I use some sleep timeout to last it forever (well, until the game loop exits) but without too much spam with stuff?
@peak plover don't go complicated, @dull drum ANSWER IS YES.
"Should I use some sleep timeout to last it forever" what?
arr = [];
while {true} do {
_arr pushback (random 100);
};
No it won't overload RAM.
And using a sleep won't make it "last forever"
Because of the infinite loop? I did it couple of times