#arma3_scripting
1 messages ยท Page 570 of 1
no
no
operator precedence
what you wrote will run like this:
(diag_log _drawUp) vectorMultiply -1;
will do, thanks!
I meant more like
diag_log ["_drawDown", _drawDown];
so you still know in log which is which
yes, and so on and so forth for the others
those are the problematic ones, the ones where I would set the offset for the above line and below line.. the middle one works
ok will test tomorrow, hopefully I get out of this alive eheh, the rest kinda works so far
thanks again!
Hey folks. Im currently working on trying to get a rifle to take on a launcher slot. I have it on my back in the launcher slot, but I am not able to switch to it or shoot it. Any thoughts?
Hm any chance that anyone knows if theres a way to check if a player is currently being flashbanged by an rhs flashbang?
Hey guys, im hoping to make an effect inside CUP's static C-130 where a trigger activates cam shake to make the feel more realistic
At the moment ive got a trigger set inside the plane (any player, present) with the following
condition : this
OnActivation :
enableCamShake true;
addCamShake [1, 99999, 25];
OnDeactivation :
resetCamShake;
At the moment the camera continues to shake even once you have left the trigger area? Any suggestions?
Only post the question in one chat please
@gloomy aspen
Sorry, wasnt sure which one was the right place ... My apologies ๐
No worries, just delete it in the other chat
so im calculating the distance from the center of a square to the border for a random angle
#define mapSize 15360
local _angle = random 360;
local _halfMapSize = mapSize / 2;
local _center = [_halfMapSize, _halfMapSize, 0];
local _n = Vector_FromDir(_angle);
private "_centerToBorder";
if (_angle in [0, 90, 180, 270]) then {
_centerToBorder = _halfMapSize;
} else {
_centerToBorder = abs (_halfMapSize / cos _angle) min abs (_halfMapSize / sin _angle);
};
im catching the special cases where either sin or cos can get zero (to avoid division by zero) seperately
however this still throws me division by zero errors every now and then
throw in a try to catch the occasional div0 and let it pass your vars so you know whats going on at that point?
other possiblity is 0 == 360 in terms of rotation. 'maybe' your random 360 is actually picking up a 0 in there?
Sqf try catch will not catch Script errors
yeah sorry too much cross language bleed thru. hmmm well likely Im guessing its the random or _angle in [...] what is the max decimal length that is tracked for this stuff?
@velvet kernel Not sure why that happens. But you don't need to resort to trigonometry to solve this:
private _outside = _center getPos [mapSize * 2, random 360];
private _borderX = 0 max (mapSize min (_outside select 0));
private _borderY = 0 max (mapSize min (_outside select 1));
private _centerToBorder = _center distance [_borderX, _borderY, 0];```
what you are doing is for arma 3, im on arma 2
Ahh okay... But I think the only issue with that is you do not have the getPos variant.. AFAIK everything else is permissible (of course the private would have to use the command before instead).
So something like this (unless I missed another command)
private ["_halfMapSize", "_center", "_angle", "_outsideX", "_outsideY", "_borderX", "_borderY", "_centerToBorder"];
_halfMapSize = mapSize / 2;
_center = [_halfMapSize, _halfMapSize, 0];
_angle = random 360;
_outsideX = (_center select 0) + (sin _angle * mapSize * 2);
_outsideY = (_center select 1) + (cos _angle * mapSize * 2);
_borderX = 0 max (mapSize min _outsideX);
_borderY = 0 max (mapSize min _outsideY);
_centerToBorder = _center distance [_borderX, _borderY, 0];```
i can just round _angle to int to avoid numbers close to 0, 90, 180, 270
hey @still forum , you remember yesterday I was banging on about buildings and objects that werent taking damage?
it turns out, a lot of things that aren't tanks don't take damage from APFSDS.. the round just flies straight through
oh o/ @finite sail hallow
hi reezo!
once i switched to any HE round, jon done. the geodesic domes at teros fell
ah AP round...
its always fun when something you think is a bug actually turns out to be the engine doing its job way better than expected lol
yes, discard sabot round, to be exact
How do you execute scripts on the fly on a dedicated server? In headless I had a panel when I pressed escape
if youre logged in, you can get the debug menu with escape
other than that, you need a debug/tools addon
So, I need a debug addon to get the debug menu?
is there no other way?
is the server yours?
Yes but we cannot restart the server now
why not?
Operation ongoing
I need to execute a script on the fly
I did it in headless without mods
I thought I could do it in there too
can you log in as admin when you're playing?
and when you're logged in, does the escape menu have the debug tools?
It doesn't unfortunately
ok, is the server running sig checking?
Hello. Could you tell me where to start, to create invisible anomalies on the stalker server. Where should I start?
@tough abyss Do you have the achilles mod activated?
yes
iirc achilles lets you execute code through a module
really? I'll check
@finite sail No, there's no sig checking
Just checked and the module is called 'Execute Code Module' under 'Development Tools' @tough abyss
I checked it, it works great! Thank you!

Can anyone please help me with scripting advice in arma 3?
Btw remember to delete the question in #server_admins since crossposting is against the rules @tough abyss
Mmh I recommend asking the people on the stalker server, they propably know how their server works the best @jovial whale
The problem is that such servers are a closed community that does not share information about their scripts. I myself am a member of such a community and they do not give me any information about this.
For earlier, I apologize for bad English, not my native language.
And so I decided to learn scripting. As the saying goes, "Do you want to learn something, learn from the best." And everyone knows that the English-speaking community is still the leader in scripting for Arma.
And it became somehow very quiet
i think it's more that these server owners don't share
and most chaps in here are not very surprised by that
I understand all this very well, and I do not ask you to provide me with ready-made scripts. I ask only to show where I should start and who can help me with advice. That's basically all that I would like to know.
do you know that what you want to do is not trivial or simple
The start could be the BI wiki
https://community.bistudio.com/wiki/Main_Page
yep, it may not be a helpful answer, but it's the way to go
For me killzonekid's tutorials were helpulf in getting started with scripting. From there I've just experimented a lot
i didnt mean to suggest you are unhelpful, @young current , just that he needs to understand what he wants to do is probably reall hard
heres the pages i open in my browser..
oh... tinys.. but thats a good starting place
fixed
This channel? https://www.youtube.com/user/killzonekidtv/videos
Not the channel but his site that had written tutorials. Not 100% sure if it's online anymore though.
I see.
Seems like it is.
Now you will need to experiment with this stuff a lot to start u derstanding how different commands work alone and together.
ths
@jovial whale It's quite a topic that can easily explode especially in my own hands, my way of writing and the misunderstanding of text-messaging. I'll just say I get what you mean and part of it is endemically natural to the environment and the resources involved in all this
Always try and be the least dependent on time-based resources, meaning answers from people, help from people, anything real time.. Use the internet and what is already written to go well beyond what anyone - even chained at a chair - would be able to give you because. in theory the best ones can help you a lot but in practice ain't anybody got time to carry weight, right
and by that I mean, a lot of things take priority for those "helpers". Even kids alone can be such higher priority. It's only natural we learn through what's materially available and inanimate, as it's 100% always there. End of my contribution.
typed, then deleted a minor rant about lack of community spirit in newer server operators
generalisation, I know, but there ya go ๐
Cannot disagree with any of the above..
Artists steal, but you'll stay dependent if you don't grow up and make things from scratch.
On that note: I am trying to program an EventHandler that has probably been done many times before.
I want to execute code (some sort of punishment) whenever a player kills a friendly unit. This is what I came up with:
addMissionEventHandler ["EntityKilled", {
params ["_victim","_killer","_instigator"];
if (side _instigator != sideEnemy) then {
hint "you killed a friendly";
};
}];
However, this code will ALWAYS fire whenever an entity is killed, enemy or not. What am I missing?
I think
because deads are always civilian
hang on, ive doen this before
Instead of the side command
oh wait
you wrote sideenemy, thats wrong
units are made sideenemy only after a teamkilling spree
Ohhh
Thanks. So I am reading your link:
" (i.e. not affected by dynamic changing like rating)"
Is that what you mean with dead units being civilian (and this function ignoring that) ?
yes
Will try this. Brb
gl
It works! I even managed to narrow it down to civilians! Thanks!
๐
Here's the code for anybody who is enjoying a lazy Sunday:
addMissionEventHandler ["EntityKilled", {
params ["_victim","_killer","_instigator"];
if ([_victim, true] call BIS_fnc_objectSide == civilian) then {
hint "you killed a civilian!";
};
}];
hehe
isequalto
rather than ==
slightly faster
if ([_victim, true] call BIS_fnc_objectSide in [civilian, playerSide]) then {
hint "you killed a freindly!";
NB, the above might not work properly on a DS.. playerSide probably doesn't work on a server
Senpai ๐ฉโ๐ , I eh, not getting the example:
- if ([_victim, true] call BIS_fnc_objectSide in [civilian, playerSide]) then { *
The in [civilian, playerSide]) is part of the BIS_fnc_objectSide syntax?
its the in array syntax.. more or less the same as result == a or b
result in [a,b]
Wait, what is producing this array ( Or, why are we writing out this array) ?
you don't have to, i was just expanding your example
the code you posted ref lazy sunday is more than good enough
just replace the == with isequalto
Also for DS (dedicated server) ? It happens I am running my coop mission from there(!), so good you mention it.
Thank you ๐ฉโ๐
bear in mind that if your players do kill civs, more than 3 or 4, they will become sideenemy
and that's tricky, other players wont be able toget in their vehicles for example
civs will run away from sideenemy players too
lol. Well there aren't any friendly AI in the mission. So that's not so bad.
I am coding this to keep the mortar players on their toes.
ah right, yes
wow, ive helped someone and dedmen hasn't come in saying "Tankuster, you're talking bollocks" and had to clear up my mess
im sure he's as chuffed as i am
never underestimate the ability of players to break your lovely mission
Also cannot argue with this. But that is why we agree that the mission author plays as a Zeus.
good call
Back to my script: where's a good place to put the EventHandler? initPlayerLocal.sqf?
no, that has to go on the server
its a missioneventhandler
so, init.sqf or initserver.sqf
ah yes, initserver.sqf is best
if you put it in init.sqf, it will run on clients unless you put it in a isServer block
Ive seen a Zeus go rogue, spawning predator sound fx behind players in dark jungles, and nearmissing them with lightning bolts
you are using format, I don't understand why you would do this
if you do format ["%1", player] it will stringify it to bob if you named the player "bob" in the editor, or "Alpha 1:1" if you didn't
if you don't use call compile format, yes
I am this close, thanks for confirming this the format idea yes
ha!
It's the call compile format that is a problem
how could I not see that lol I guess...
I would not like to give a name to vehicles that have no name as it could screw up missions where names are assigned later..
good, because you don't have to
I guess I don't really need call compile format indeed
it almost just created a lot of issues and this is a UI mod so no need - usually - to broadcast what the player sees on screen
and even then there will be ways to let some variables out in the public to have the headsets dialogue, but not a priority
nice, I will get rid of call compile as it's - also noticed - not something I do need
I am compileFinal the fnc_ you saw in the init, I don't think it matters whether it's call compile or not
yay ok be back later, @winter rose thanks a lot!
Back from ๐ถโโ๏ธ๐ถโโ๏ธ
@winter rose it seems not using a compile call format is even worse
I'll try with just format without call compile, but so far I am having the same issue.. units with no variable name cannot get the eventhandler
_unit comes from an array of NearEntities that is in another script.. basically it works perfectly AS LONG AS _unit has a variable name
(Disregard the various colors and things which I am experimenting on)
whether I use %1 or %2 (in case of %2 I gotta get the object name from the NetID) it all works - AS LONG AS - the _unit has a variable name.
Whenever they are something like "C Alpha 1-1" it all goes to sh.
stop. with. your. call. compile. string.
everywhere
this is because Draw3D EH code is a new scope; you would have to reference a global array with your units inside it
and use a forEach
myGlobalArray = [player, otherUnit1, otherUnit2];
private _index = addMissionEventHandler ["Draw3D", {
{
// drawIcon3D _x stuff
} forEach myGlobalArray;
}];
nice, that was my second question which you already answered... "where to do the forEach". Inside the EH makes sense
I don't want ForEach many EHs.
yes, one EH, multiple units (not the other way around)
the less "processes" the better
fantastic. true true
I am gonna shoot it in notepad and report back in 1 sec. It is gonna work I can feel it lol
thanks and ๐ฎ to celebrate if it works
if ๐
do everyone get a ๐ฎ ?
yes, it's a fish taco, got a truck nearby, hope it's ok
Thats ok. theres just about 20k ppl on this channel.
the truck owners gonna love you
sodas are on the other side, there's a small fridge with plenty of stuff
that's gonna cost
ouch I might have underestimated the capabilities of the taco truck
as usual prices on the internet are always log10(real price) just so we all feel more frustrated lol
๐ฎ == ๐ฐ == LIE ๐ฟ
Tacos for everyone! It works.
BUT... suspenceful music plays
no maybe no buts, hold on lol
no buts, it workz
yay, thanks, I can ~~not ~~now focus on other ways to break everything lol
๐๐
w00t w00t!
you can again do another global array and pushBack the display, if needed
it creates a _display for everyone in the forEach
wait, no
oh
well you can always add "if !(worldToScreen _x isEqualTo []) then"
you can still do all that, just have to change your code organisation
if I addPublicVariableEventHandler for JIP players sometime after they've initialized, will it still fire for publicVariables they received at init?
the eventhandler only fires if the variable was received after the handler was added
so in order to make it work for JIP, I need to make sure it is created at preInit?
for public vars received at JIP that is
ye
What is difference between $PBOPREFIX$ and $PREFIX$ files?
ACE use just $PREFIX$, but wiki has no information about it, only about $PBOPREFIX$
RHS uses it too
its a thing big projects often use
it is not something that is absolutely required
its also not scripting related but belongs to #arma3_config
for RHS and ACE they are particular for their automated build systems I believe
Oh, my mistake. Sry
compare with side, or check sideEnemy which checks if someone has a negative rating (too much TK's)
technically any .paa or .jpg should work
don't think there's a list of all images in Arma somewhere
getMissionPath could help to get the correct path to the mission ๐
most images are in "/a3/ui_f" but it's all over the place, depending on what you need/want
Root of the mission should pick up though?
I am trying to set up something simple here;https://media.discordapp.net/attachments/673122774755180544/678760009730883613/107410_20200216192932_1.png?width=1202&height=677
basically what i am looking for is an input in a player activated trigger, to join units into the players high command ability
basically player has control of unit A and B, walks to new area, get control of C
a friend recommended synchronizeObjectsAdd, and i have been playing with it but i dont know enough of what exactly i should be trying to sync up
like i assume its something like "sync (new units)--->highcom subordinate module" but i dont know how to phrase that really
Anyone with Notepad++ happen to get an issue that resets the file's language, forcing you to Select All, click Language, and select SQF to set the file's language to SQF again?
I dont think you have to select anything to set the language
but I dont think it remembers what language you set a file in
you have to set it to use certain language highlighting per file type
I noticed that SQF isn't a language that can be selected as a default language either, wonder if that's part of the issue
File Association doesn't list SQF anywhere either
AND its not available in Style Configurator
since SQF isn't a language used by anything else than Arma and not well known in the programming world you'll need to install a custom API which can be downloaded here: http://www.armaholic.com/page.php?id=8680
Yeah I've used that for years, but ever since a few months ago, I let Notepad++ apply an update which caused issues
#neverAgain
well, I've been using Atom for years now with working SQF support (which also requires a plugin to be installed)
D:
I think I found the problem
In settings, auto-completion, and then I set "Function completion" instead of "Function and word completion"
So far it feels like that fixed it
Nope, didn't fix it
Hello. I am a bit of a script kiddie (i.e. an idiot with some scripting experience, but it doesn't go far at all), and I've a question. I am trying to re-tex a Strider, and I want to add the Strider's texture into one of my scenarios and make it JIP friendly.
If I was to add the command setObjectTextureGlobal, there may be issues with JIP as far as I have read. What should be done in it's place? Should I name all Striders on the map with variables and write some .sqf or script in the init.sqf file that sets the Strider's texture?
is there any kind of method to dump an objects settings that has been changed from default, like pos, rot, etc given so many objects have different settings hoping there something that allows us to check anything that isnt equal to anything inherited and defined by the objects class.
basically a compare of a parent with inheritences vs a child object?
not really, what is the use case?
anything... basically need to dump a complete setting for a object so I can spawn a whole layout of something via script with all flags, pos/rot all that set even init scripts etc.
ie. without a compare or dumpAllnonDefault fnc... not sure its possible given how many different types of objects there are
unless there a way I can spawn a composition with position and all that jazz aligned, but dealing with the root object makes me wanna use a spawner that will just by called by the editterrainobject init and use that as a root point to place it as I can get the buildings placement from that
unless Im just not able to find it, this would be simple if I could just output to an array a dump of an object of anything that is defined differently from the parent an object is created from.
https://steamcommunity.com/sharedfiles/filedetails/?id=2000034600 << would be a example of a usage case and trying to put that all down in a building somewhere else/different terrain map.
good example that is 'almost but very lacking' would be Ares's save2sqf function if you familiar with it. problem is flags and code and such
@bright flume if it is in 3den,you have compositions. If it is in mission you have scripted compositions.
yeah my concern is a eden maybe if possible zeus? comp placing that photo into that specific building type 'easily'.
so I was leaning on script spawned. this way I can use the edit terrain object as a way to create a root point for spawning it
@violet gull Is your IED script (http://www.armaholic.com/page.php?id=32348#comments) still supported by ArmA? I'm asking as I can get the IED's to spawn but cannot disarm them as i have no option to in the scroll wheel. Thanks
@Striker It should still work and I'm planning on updating it soon. People using ACE report it isn't compatible; I made it for my vanilla mission/server. The IEDs are actual mines, so if you are an explosive specialist with a toolkit, you should be able to disarm it like a mine. Just approach is via slow crawl to avoid triggering it.
Hey, is there any way to get a "performacne index" (hardware) of the player? Like https://community.bistudio.com/wiki/benchmark does but it doesn't work anymore ๐
I am doing that with a mine detector and toolkit but no action comes up at all, i have tried Explosive spec, Demolitions, EOD Tech from RHS, Mine Specialist. none of these have the option
@visual quarry try in vanilla?
I shall try again
@winter rose @violet gull It does not work in Vanilla either, I also tried the example mission and it does not work in that either
Anyone see why Im not seeing numbered text appear when iterating thru a list? drawIcon3D ["", [1,1,1,1], [(_x select 0),(_x select 1), ((_x select 2) + 1.0)] , 0, 0, 0, str _forEachIndex, 2, 1, "PuristaMedium"];
list being [[x,y,z],[..]] just a list of AGL coords
https://community.bistudio.com/wiki/drawIcon3D
Command has to be executed each frame
bah okay that explains why seeing EH's examples was hoping just to make a static # over each object spawned without having to go that far as its purely for testing
thanks Lou is there any other option given what I need?
ah okay so just ecapsulate it in the EH like the example place it just as in the iteration, thanks trying now
do or do not - there is no try
heh its only try when you do something and expect it to likely not work. ie. never count on it. and nope it dont like addMissionEventHandler ["Draw3D", { drawIcon3D ["", [1,1,1,1], [(_x select 0),(_x select 1), ((_x select 2) + 1.0)] , 0, 0, 0, (str _forEachIndex) , 2, 0.75, "PuristaMedium"]; }];
You don't have a forEach in there so you cannot use _forEachIndex
yes I do its not listed.. again its an coord array as stated and stated Im iterating thru it
lemme just drop the whole block...
Yeah but no, the code in the EH is not aware of whats exists outside of it's brackets
AH. okay that explains more.
but thats okay I can adjust cuz Im storing the array in a global
Thanks Heyoxe thought local's worked a bit different in a code 'block'
cuz the EH add is in the forEach..
You should put the forEach in the EH ^^
I dont think a create vehicle in that would be pretty.
I meant for the icons
createVehicle is in the forEach, so guess make a second one.
systemChat str _x;
createVehicle ["Sign_Arrow_F", _x, [], 0, "CAN_COLLIDE"];
addMissionEventHandler ["Draw3D", {
drawIcon3D ["", [1,1,1,1], [(_x select 0),(_x select 1), ((_x select 2) + 1.0)] , 0, 0, 0, (str _forEachIndex) , 2, 0.75, "PuristaMedium"];
}];
} forEach (_this buildingPos -1); ```
thats what Im trying to do
okies it works for what I need still get a error but icons there so now I know what the positions are. thanks all for the help
@violet gull I fixed it it was another script the mission was running that was modifying the toolkit, my bad dude. Though in the new version have you thought about having a chance to fail the defusal? Maybe with a 10 second timer to run away?
Okay here's the millon dollar quesiton is there a Eden version of drawIcon3D? as thats where I would prefer to be able to view it, maybe make this into a module expanding on the edit terrain object module
you can run the code in Eden, now gib million $
okies. I know the spawning part I can, doing that for the crater in livonia, wasnt sure about hover text. as there no building its referencing but okies thanks
any way to disable ai going prone only im playing on a partialy flooded map and the ai looks stupid going prone but i dont want to lock them only to crouch or standing stance
try #arma3_ai sounds more like a FSM edit if there isnt a check to see if an AI has UW gear on, shouldnt go prone in water above (x) ?
On arsenal exporting is it possible to use setunittrait medic to assign a medic to such loadout when loaded?
not that I know, nope
damn, is there any way that the trait can be set outside of the unit init?
you can set it with any script anywhere
So I could attach it to a box for example?
you could use an action that setUnitTrait to the player using that action yes
Mega
โฆDeth?
...Destruction?
Okay stupid question since I've never done anything with variables, if I wanted to know if a player is currently ace unconscious would this
_player getVariable ["ACE_isUnconscious", true]
return true when they player is unconscious or conscious?
I'm not sure if it should be true or false at the end
return true when they player is unconscious
variable isisUnconscious
true means "yes"
so if he is uncon, it returns yes/true
second value is just default if variable is undefined, it will rarely be undefined, if ever. But "false" as default might be more sensible
Ahh okay thanks for the explanation, and
second value is just default if variable is undefined, it will rarely be undefined, if ever. But "false" as default might be more sensible
So if ace wasnt installed at all it would in that case I posted return true anyways?
yes
Oky thanks 
Does anyone know of a relatively simple way to get high command to be given to whichever player is a group leader?
Alternatively, it could just be any radio command menu option that a player could use to take command of any allied AI groups. Whatever is the easiest way to have drop in, drop out, JIP high command.
Okay I have another question, I have
if (WHA_NAMETAGS_MOD_ACE && _player getVariable ["ACE_isUnconscious", false])
then {exitWith{};};
and its giving me a 'Missing ;' error at the second line of that but I cant see where its missing and its propably something really stupid
if (WHA_NAMETAGS_MOD_ACE && _player getVariable ["ACE_isUnconscious", false])
exitWith {};
@oblique arrow ^
Yep seen it, testing it at the moment
It works the way I want it to, thanks @distant oyster
np
Weird thing, player addaction gets removed when the player dies, how do I avoid this?
@warm iris actually - it doesn't - what's happening is the game is spawning a new unit and putting the player in it, so the action is attached to the previous "body". If there's a corpse lying around, depending on the condition you've set up, you'll still have access to the action
So whats happening, is the unit dies, body despawns on death, but the action is no longer in the scroll menu for the player
Well body doesn't necessarily despawn on death, but that's beside the point for your problem ๐
Set up your actions in onPlayerRespawn.sqf
So the addaction should exist in onPlayerRespawn?
That depends on whether your mission uses it
In description.ext the flag respawnOnStart determines whether the onPlayerRespawn.sqf script gets called as well as whether the player is considered to have respawned)
Sounds like you'll want to use case 0 where the player isn't considered to have respawned, but you'll run the onPlayerRespawn script anyway
Hey any chance anyone can point me in the direction of the right way to check if a unit is an actual player or a headless client/virtual unit (game master as an example)
hasInterface iirc
(!hasInterface && !isDedicated)
hm oki thanks
how often can you use setParticleParams on a smoke for updating it? because for me it despawns after calling it twice
arma 2 btw
it should be "as much as you want" @velvet kernel
thats what i thought
is there a parameter that sets the duration the smoking is "smoking" for
because i might have gotten that one wrong, but i checked for at least 30 mins with the wiki and i think i got it right
I suppose you only delete the particleSource
you can set for how long the smoke drop will "live", but not for how long the source will emit iirc
we might need to see your codeโฆ
also, be sure to code with the -showScriptErrors flag
local _heli = _this select 0;
local _heliPos = getPos _heli;
_smoke = "#particlesource" createVehicleLocal _heliPos;
_smoke setDropInterval (0.015);
local _smokeLevel = _heli getVariable "smokeLevel";
private ["_lifetime", "_color", "_scale", "_moveVelocity"];
switch (_smokeLevel) do {
case 1: {
_lifetime = 1;
_moveVelocity = 0.25;
_scale = [1, 3, 5];
_color = [
[0.2, 0.2, 0.2, 0.6],
[0.4, 0.4, 0.4, 0.5],
[0.7, 0.7, 0.7, 0]
]
};
case 2: {
_lifetime = 4;
_moveVelocity = 0.5;
_scale = [2, 6, 10];
_color = [
[0.15, 0.15, 0.15, 0.7],
[0.3, 0.3, 0.3, 0.4],
[0.6, 0.6, 0.6, 0]
]
};
case 3: {
_lifetime = 7;
_moveVelocity = 1;
_scale = [4, 12, 20];
_color = [
[0.1, 0.1, 0.1, 0.8],
[0.25, 0.25, 0.25, 0.5],
[0.5, 0.5, 0.5, 0]
]
};
};
local _attachToOffset = [0, 0, 0];
_smoke setParticleParams [
["\Ca\Data\ParticleEffects\Universal\Universal", 16, 7, 48], // File, Ntieth, Index, Count, Loop
"", // Animation
"Billboard", // Type
1, // TimerPer
_lifetime, // Lifetime
_attachToOffset, // Position
[0, 0, _moveVelocity],
0, 0.05, 0.04, 0.05, // rotationVel, weight, volume, rubbing
_scale,
_color,
[0.125], // AnimSpeed
1, // RandDirPeriod
0, // RandDirIntensity
"", "", // Scrips
_heli // Follow
];
_smoke setParticleRandom [2, [0.5, 0.5, 0], [0.2, 0.2, 0], 0, 0.3, [0, 0, 0, 0.1], 0, 0];
the script is much longer, tried to only copy out the important parts
basically there is a variable "smokeLevel" attached to a heli, and the server calls this script on every client once that changes
so everytime, you create another smoke emitterโฆ?
no i can try this in singleplayer too
just create a smoke attached to a vehicle
with the params i posted
and it stops smoking after about 1-2 minutes
not even calling setParticleParams again
so if I go to Arma 2 editor, run this code, it will stop after 60-120s ?
correct
A2, A2OA?
OA
the way i understood this is that the smoke never stops, unless you delete the object
from what I know, yep
hmmm
ok another find i just made, it appears that it only stops smoking if the vehicle it is attached to is moving
so e.g a driving car?
im trying with helicopters
i can give you a minimal working script if you want to test
I got the "no smoke" thing
hmmm
but I do think it's because the helicopter is leaving the map area.
no in the full version of the script it picks waypoints that are only inside the map area
and it happens there too
you can try by adding more waypoints inside
yep just tried again, it happens without ever leaving the map area too
could this be something to do with garbage collection
it should not be active by default in A2OA
indeed still in the map; going deeperโฆ
the object is still here, not deletedโฆ
i think it has to do with the distance from the position of which it was created
that's an interesting one indeed
because if i dont add any waypoints and the heli just hovers it does not disappear
where it was "attached" I think
yes
you can test this very easy
set yourself in heli
and teleport away
and its instantly gone
I just noticed, helicopter distance smokeSource is increasing
you didn't attach the smoke source to the helicopter?
set the origin to [0,0,0] and attach the smoke source to the helicopter, shouldn't be any more of an issue ๐
of course!
thank you so much
;-p
you're welcome, that was a fun one ๐
wow i didnt even think of that
Guys, who know how convert vectors dir and up to [x,y,z] rotation format?
the easy answer? math
the hard one?
https://www.google.com/search?q=radians+from+vector+up+forward&oq=radians+from+vector+up+forward
something here
there might also be some operator for that already
but ... not sure about that one
Oh... love math. I searching for function which can transform :D
hi guys - I am trying to return if the primaryweapon's pointer-slot of a unit has a flashlight, IR-Pointer or even a switchable attachment with both equipped. Does anybody know how these are distinguished? I can't find any clear differences in CfgWeapons except the _generalMacro entry. And for the RHS-attachments that have pointer and flashlight, that will always be 'acc_pointer_ir`
Oh, no. I asked for wrong thing... Sry, I found solution:
- set vectors to object
- get directions from object
:D
@burnt cobalt https://community.bistudio.com/wiki/primaryWeaponItems
if ("acc_pointer_IR" in primaryWeaponItems player) then {
hint "yay, I haz the lazorzzz!!1! :3";
};
Are there any best practices for what functions should be defined on server vs what should be global? I'm putting everything in CfgFunctions right now, is that the "correct way"? Does it even matter for an 8-man coop?
It probably doesn't matter for an 8-man coop.
For what goes on the server only vs everyone, if the client use it --> everyone, if not --> server only. And that's rarely needed
Yeah, that I do know. I register everything in CfgFunctions though, so it's available everywhere even though clients don't use much of it. I was wondering if this is a bad habit and what implications there are besides using slightly more memory than necessary
Not really, it only matters (and even at that point I'm not sure how effective it is) for big missions/framework/servers, like KoTH, L*ife and so on. But it goes far beyond does the client uses it or not
thank you @winter rose ! I also found this for addon attachments (hate how i seek for ages and then when i finally ask it falls in my lap) ```sqf
getNumber (configfile >> "CfgWeapons" >> _itemName >> "ItemInfo" >> "FlashLight" >> "intensity") != 0 //-- Item is flashlight
getNumber (configfile >> "CfgWeapons" >> _itemName >> "ItemInfo" >> "Pointer" >> "irDistance") != 0 //-- Item is Laser Pointer
@cunning crown L*fe
Oops, I did it again ๐ต
hello, on mp, how do i make all friendly units playable via unit switch? i have set respawn = 5; . i was able to enable the switch window via enableTeamSwitch true; .
ye but there are no units in the list, @winter rose
i need some how to addSwitchableUnit "all friendly"
oh, you need to set the units as "playable" in Eden @sacred slate
well yeah. i got some sp missions i can only start in mp, cause they are designed that way. in a older sp equivalent you could easy switch, noch i play it in lan, and its all gone ๐
so double-click -> playable (under the "player" checkbox)
So, using setpos to spawn players in the sky makes them fall in the standing animation, unable to move. Any idea how to fix it?
Why not?
good question
i play this thing. https://steamcommunity.com/sharedfiles/filedetails/?id=1510350822
oh, so not your mission. how could you edit Description.ext then?
Can't indeed.
Does that also mean respawn can't be set from CfgParams?
Yes it can.
setPlayerRespawn as a command exists as well.
I believe the confusion was between setPlayableUnit and addSwitchableUnit which I believe the unit switching menu only exists in SP to move between AI after you have died.
using selectPlayer might be a effective solution tho.
Still would need existing playable units to match the player count.
So, I put setpos in onPlayerRespawn.sqf, but it doesn't trigger in multiplayer when players are allowed to choose their spawn location. Any alternatives?
Can u post the code.
_pos = getPos player;
player setPos [_pos select 0, _pos select 1, 2000];```
That's the whole code
If I put it in initPlayerLocal it works, but then the player is stuck in the standing animation until popping the parachute
Should be a simple thing, but it's driving ne nuts
setPlayerRespawn as a command exists as well.
@high marsh
I don't see such a command in the biki
there's one for player respawn time
*time
ah, I was hoping there was some straightforward way to select respawn templates
from outside description.ext
Switching them during runtime?
@vernal venture Thats because the script is waiting for respawn. initPlayerLocal will initialize with player.
this is just me musing though, I haven't dug too deeply into this
Could always just initialize the UI manually.
yeah, I was hoping to avoid that ๐
The dialog config has code to populate the loadouts and respawn points.
@high marsh Yeah. The script isn't working even after (re)spawning.
Initplayerlocal trips even before spawning, I had to add a sleep
why is this not working in devel console? Kelly setUnitPos "DOWN";
i dont get this.
_aiDude = Joseph;
_aiDude playAction "Salute"
dosn't work.
but
_aiDude = player;
_aiDude playAction "Salute"
do work.
i think its not my syntax fault
In a userAction I'm trying to only allow the driver of a vehicle to see the option to use the userAction.
What would one use in this case?
thx
can i set disableAI stuff to the real player, and it will stay, when i switch units?
DisableAI is object specific
So you would need to use it on both the player and the unit you are switching too
hm. i have a problem where lambs force move all units 1 meter ahead. it happens when i am switched to a other unit, without leader control switch. when i switch back to leader, it still happens. all units get moved ahead, with voice command. looks like disableAI "RADIOPROTOCOL"; wont help ๐ is there anything i can do?
doesn't moduleRespawnVehicle already take care of despawning the wreck?
SOrry, Deleted
Thanks!
yes if too many are used
not really. different things probably affect different amount
but if you are building like a city with editor objects that will poop on your shoes quite likely
also object density is a big thing
dont think so
missions are not meant for terrain building
not that high density terrains work much better either
it is quite delicate balance
if they are all in same area then possibly
is there a faster alternative to createVehicleCrew or bis_fnc_spawnvehicle
faster?
Probably should just explain the premise... I'm spawning in a UAV with crew currently and noticed that when the script runs there's a hitch. When I remove the createVehicleCrew portion of the script, there's no hitch when it's called.
I tried the same with bis_fnc_spawnVehicle and there's still a small hitch when the script is called..
hitch, as in stutter? well, one has to create AIs so the stutter will remain unless you create AIs first, then the vehicle, then AI in vehicle
but just the time to load the model itself would take a bit of time anyway
I found when spawning in a bunch of units for a mission that hitching is usually a dead giveaway for the players, so much so I essentially re-created the BIS_fnc_spawnGroup function just to add some sleep statements to it, evens out the stutter
Gotcha. So it's just going to be one of those things then. If there'll be small stutter when the AI is created regardless, I'll have to live with it.
irreducible cost I am afraid
though you could create a "pool" of AIs/drones and pick from it from time to time
disabling their simulation so they cost nothing in the meantime
Good idea, can try dealing with it on the missions init so it's done once and just use from that pool.
Alternatively, what I'm doing is spawning these drones to create a target for a Phalanx. If there's a way to force a Phalanx to target an empty vehicle, that would make this easier - but I haven't found a way to do that yet.
doFire, commandFire, and forceWeaponFire don't seem to work unless the vehicle is controlled by enemy AI.
yeah no, forcing fire is not as easy as before now
maybe creating a laser target on itโฆ
i'll try that. I was about to look and see if I can reuse the AI that is spawned in the drown in some way rather than creating and deleting it over and over. Thanks for the info!
i am not into scripting yet, but can some one translate this to remove all non friendly units from the unit switch window?
{
addSwitchableUnit _x;
} forEach (allUnits select {playerSide isEqualTo side _x});
what side are your friendlies?
right now rhs usa. could it be possible to identify the own faction first?
while in the script is "playerside" some scenarios have it just pre made.
ha maybe i have to tweak some ace unit switch settings, with the script i wont need it anymore.
nope didn't fixed it. i disabled ace unitswitch, but in the scenario the list still explodes.
{ addSwitchableUnit _x;
} forEach (allUnits select {side _x == west});```
assuming your rhs usa is side west
Oh wait ick
Better
thx! ๐
the thing is, in some missions i want this to make units playable, but how can i remove all non west units with that?
will take me a week to google this syntax :>
Well right now what the code I've written does is it only adds units to be switchable if they are side west, so by its nature it is excluding all non-west units
Maybe this could work:
{
addSwitchableUnit _x;
} forEach (allUnits select {side _x isEqualTo playerSide});
That's exactly the same thing as he posted but you reversed it ๐
Though from what I see, I don't know why that wouldn't remove non-friendlies
cause the list is huge and i cant switch fast enough ๐
I don't understand. What units are you seeing in your unit switch window? From this code, should only be units that are the same side as the player.
And the friendly too or not?
they are there ye, but not in all scenarios
how are the hostiles generated?
Ie., if someone is just spamming B_soldier_F and then re-costuming them and re-arming them, then they're gonna be considered western units
Removes all the units then adds the firendlies
{
removeSwitchableUnit _x;
} forEach allUnits;
{
addSwitchableUnit _x;
} forEach (allUnits select { (side _x) isEqualTo playerSide });
epic
lets try
ha that worked
so nice
thx!
will this break if there are no units to remove in the first place?
No, it shouldn't
is it possible to add hotkey binds to menu actions like "1 - 6 stop"?
some times i want to set stances quickly for single units. all i found has a menu where you first have to navigate. for all units at once i got stuff
Check out C2 on steam workshop, command & control mod for AI
yeah i did. it will get a update soonish i hope. but its too clunky for my taste
okay super noob question id imagine but i have to scripts 1st will attach a vic ammo box to a flatbed(taken care of) the 2nd will
give the ammo box infinite ammo or resupply every say 10mins but i cant seam to get them to work together in the in field
this addEventHandler ["Fired",{(_this select 0) setVehicleAmmo 1}] vicammo1 attachto [flatbed1,[0,-3.5,0]]
; between both statements @full tartan
thank you
how can i add a hotkey to a small code snippet? do i have to write a txt file for that?
Removes all the units then adds the firendlies
{ removeSwitchableUnit _x; } forEach allUnits; { addSwitchableUnit _x; } forEach (allUnits select { (side _x) isEqualTo playerSide });
@cunning crown
i just want to bind this to a hotkey ๐
Does someone know a way to (or has a script for it) to identify if a unit is for example walking, running or sprinting based on their current animation?
I know about animationState, but trying to figure out all states manually would be a pain in the ... (see https://community.bistudio.com/wiki/Arma_3_Moves#States).
So if someone has a way to read out those states (format A...P...M...S...W...D[_A...P...M...S...W...D][_Comment]) and make them into something useful, than I would be very grateful ๐
Mrun = Movement run (wlk = walk, stp = stop, etc) @exotic flax
add another filter with Dnon (direction = none = not moving) and you should be good
I know, but I want to be able to have functions like isRunning, isWalking, isCarrying
so I need a way to figure out if an unit is doing <any>, independent of the current animation
"mrun" in toLowerANSI anim && !("dnon" in toLowerANSI anim) or something?
At the moment I'm writing a script which dissects the string into readable array.
eg. AmovPercMstpSlowWrflDnon becomes ["move","standing","stop","lowered","rifle","non"]
and from there I'll make simply if...else statements to check if someone is walking/running/reloading/swimming/dying/etc
Because in some cases the action (A part) defines what something else means.
And the only documentation available is https://community.bistudio.com/wiki/AnimationTitles, which doesn't seem to be complete
I guess it is for Arma 2, but not Arma 3 (eg. Aadj exists, which I believe means "Action -> adjust")
missing some yes
if you could list themโฆ we could add them
that will be a pain to do, but will try and post in #community_wiki ๐
maybe I could do a CfgAnims parser that would split and pushBackUnique subentries
would be faster!
you actually would need to parse CfgMovesBasic (and child classes)
I will find it, don't worry
what is the problem with the script you want to develop for animationState?
if debugging is the main issue, then you could use SQF-VM with Arma.Studio integration to develop & test it ๐
Only thing is: animationState is not supported so you need to pass your state yourself to the method
already using SQF-VM for testing by manually setting a state, so I've got that going for me... which is nice
Arma.Studio crashed on me, so need will test that later on ๐
Arma.Studio crashed on me
better add automatic crash logging, it does wonders. For my .NET projects I use Sentry.io @queen cargo
yeah ... it is on the todo list ๐
the crash problem can be fixed with a version already online, that just catches all unhandled exceptions (still indev version though ... but with fancy features)
https://discord.gg/z9dd4P available in here
so it "should" no longer crash, but throw errors around like a madman if something moves wrong
there some script/setting Im not seeing that lets you set the grid size in eden. really getting annoyed the grid isnt a Div10 grid
well there is the command set3DENGrid: https://community.bistudio.com/wiki/set3DENGrid
@bright flume
thats for snapping I thought? talking the grid on the ground like you see in VR, guess maybe its the terrain map itself.
๐ฆ was hoping it was virtually drawn in there. always throws off my sense of scale
each square is 32m if i remember correctly
You were right 32m, 16 2m blocks.
question regarding remoteExecCall
in Biki it states that
remoteExecCall ["func1"]; call func2; // func2 can be executed sooner than func1
i need to to find group owner client in a small function that otherwise needs to run where unit/group is local
the biki note makes me think the following would not work? Is that correct?
private ["_grpOwner"];
if NOT(isServer) then {
_grpOwner = _grp remoteExecCall ["groupOwner _this", 2, false];
} else {
_grpOwner = 2;
};
... rest of function...
you don't need the note for that
"groupOwner _this"
syntax error. And if it were not a syntax error and it worked like you think it does, it would be undefined variable error and still not work like you think
what would be the correct syntax? / is this method the correct one?
remoteExecCall array first argument is the name of the script command or script function to be executed
oh, so just "groupOwner"
is this method the correct one?
remoteExecCall never returns any results, so _grpOwner will never be what groupOwner returned on the other machine
i see, so its not actually like a normal call
correct
https://community.bistudio.com/wiki/groupOwner
groupOwner would only work on the server, so you can use it there with no problem
so the only way to get the owner "right there" on a client is with clientOwner on one of the units of that group (that is not a player) - i guess?
the question would be "why do you need the group owner"?
i want to reorganize the positions (index) of the units inside the group
So my plan was to remove all units from the group ( except the leader) to another group and back with a specific ID via joinAs. I dont want to transfer ownership of all units first to another server/client and then back again.
so i want that new group to have same owner as the original group owner
setGroupOwner being server-side only, you are kind of forced to do all that server-side?
try brute joinAsSilent and join them to 100+ ids, then sort them back? it might not need to leave group beforehand @austere hawk
hm hadnt thought of that, thanks, i'll try that
it works, that will make things easier...
w00t!
is it a relevant optimization to use "remoteExec -2" (send to all but server) when you know there is a dedicated server? (instead of 0/to all and have isDedicated check)
that I am curious to know! (emphasis on the relevant optimisation)
It's always sent to dedicated anyway. So you're not saving traffic. If you don't want to execute there, then ofc its a optimization, you spare a useless execution
So -2 excludes player-operated server, but -2 doesn't exclude dedicated server? Might be worth updating the wiki to reflect that.
How can I most reliably set the full rotation of an object? Ideally I would like to set the rotation matrix directly, but whatever is the closest to this would be acceptable. I assumed it was setVectorDirAndUp yet the comments indicate this doesn't do close to what it claims, completely ignoring actual direction and only effecting pitch and roll...
setDir before that?
You could also look at https://community.bistudio.com/wiki/BIS_fnc_setPitchBank
On Arma weather: some commands are global and run by the server, others are local. https://community.bistudio.com/wiki/setLightnings doesn't indicate either way. Anyone know for sure?
is it possible to interrupt and exit a while loop even if there is still stuff to be executed? surely there's a smarter way other than exitWith after everything
exitWith, or breakTo
but wouldn't that only exit once it hits it?
maybe spawn the while code and use "terminate"?
make it sqs and use exit
Are there built in A3 thunder sounds we can use? If so, what are they? And/or how might we discover them? Thanks!
Q: https://community.bistudio.com/wiki/setLightBrightness / on a scale of what? what is considered "bright"? or "dim" for that matter. thanks...
Q: https://community.bistudio.com/wiki/setLightColor / on what scale? i.e. [0.5, 0, 0] is red, right? what would [1, 1, 2] produce? thanks...
For thunder, check here... "A3\Sounds_F\ambient\thunder\thunder_06.wss" (there are 6 sounds in total, 01-06)
roger that @worn forge thank you.
Can someone tell me, how are the profileNameSpace variables actually stored? The BI Wiki says it creates a Vars file inside your A3 profile. However I have searched around on two different machines and can not find these var files anywhere.
Are they hidden?
They are in Documents\Arma 3 - Other Profiles\[PROFILE_NAME]\[PROFILE_NAME].vars.Arma3Profile
So its not
myUsername.vars.GAMENAME
As the wiki states?
visibly not ๐
Okay, that would be why I couldn't find it!
Follow up question, the file appears to be obfuscated. Is there anyway I can view what's been saved without having to individually check the return on stored vars?
allVariables profileNamespace is probably the only easy way to get at it unless you know how to decrypt that file
it's not obfuscated, it's just binarized
you can debinarize it with derap (? I think), armake, armake2 etc.
Yeah I was able to use derap on it before you sent that. Thanks though. Cheers.
Just trying to make acex fortify persistent. Was just needing to double check on if that data was being stored.
Should be fairly close to having it work.
Q: when dealing with particle effects, what's the difference between \A3\data_f\cl_basic and \A3\data_f\cl_basic.p3d? is there any?
none I think
If i remember correctly it's almost none, just saves the server some micro seconds to search for the p3d if you provide the full file
hi. i asked that yesterday allready, but i try again, cause no help so far. is there a way for binding a hotkey to set the stance of a individual unit?
the menu navigation, even if there are only two buttons is to long for my play style.
Either with https://community.bistudio.com/wiki/displayAddEventHandler and the keyDown Event Handler, or with https://community.bistudio.com/wiki/inputAction and use the Custom User Action XX
thx!
addEventHandlers do not persist after respawn, correct?
https://community.bistudio.com/wiki/addEventHandler#Description
Some event handlers are persistent (i.e. they stay attached to a unit, even after it dies and respawns).
Thanks!
Hi. I would like to change the flag icons, how do I do this?
https://wogames.info/uploads/monthly_2020_02/1330145817_.thumb.jpg.6d72b2ac31d17441af53f74553f8be8d.jpg
That would require editting the gamemode files. I would wager it might be quite complicated
are you sure you need to change them?
Yes, I need to change them. The fact is that these icons from the flags are taken from the unit, if you change the unit, the flag icon also changes.
I would like to display my flag.
that would require a new version of the whole gamemode. or change the flag of your unit.
How to change the flag of your unit? Have a script?
I have already tried to change the insignia through the init unit, but he does not take the icon of the flag from there.
hello, trying to model a tornado using the particle effects. I think ["\Ca\Data\ParticleEffects\Universal\Universal", 16, 12, 14, 0] might be an interesting place to start with, but I wonder how to gain control over 3D size? For instance, modeling from an F1 through an F5+, making it wider, taller, etc, etc.
where are you using cursorTarget?
are you running some heavy scripts in the background?
ยฏ_(ใ)_/ยฏ
Up
How can I make sure that information from the respawn tickets module is displayed in this script?
{
colorText[] = {1,1,1,1};
font = "EtelkaNarrowMediumPro";
y = safeZoneY + .01;
h = 0.06;
w = 0.06;
};
class NoText : ScoreBox
{
colorBackground[] = {0,0,0,1};
sizeEx = 0.0;
};
class ScoreFlag : NoText
{
idc = -1;
type = 0;
style = 48;
};
class ScoreTxt : ScoreBox
{
type = 0;
style = 2;
sizeEx = 0.03;
colorBackground[] = {0,0,0,.3};
text = "999";
shadow = 2;
};
class RscTitles
{
class scoreboard
{
idd = 29290;
enableDisplay = 1;
duration = 9999;
fadein = 0;
fadeout = 0;
onLoad = "uiNamespace setVariable [""ui_scoreboard"", _this select 0]";
class controls
{
class score_backdrop : NoText
{
idc = -1;
type = 0;
style = 96;
x = .355;
y = safeZoneY;
h = 0.08;
w = 0.29;
text = "";
};
class flg_blufor : ScoreFlag
{
x = .365;
text = "\A3\Data_F\Flags\Flag_nato_CO.paa";
};
class flg_opfor : ScoreFlag
{
x = .435;
text = "\A3\Data_F\Flags\Flag_CSAT_CO.paa";
};
class flg_independent : ScoreFlag
{
x = .505;
text = "\A3\Data_F\Flags\Flag_AAF_CO.paa";
};
{
x = .575;
text = "\A3\Data_F\Flags\Flag_FIA_CO.paa";
};
class score_blufor : ScoreTxt
{
idc = 29295;
x = .365;
};
class score_opfor : ScoreTxt
{
idc = 29296;
x = .435;
};
class score_independent : ScoreTxt
{
idc = 29297;
x = .505;
};
class score_civilian : ScoreTxt
{
idc = 29298;
x = .575;
};
};
};
};```
This script displays tickets on top
I would like to give information from the respawn ticket module
How can I filter out animals during a NearEntities search? "Man" brings in animals as well
hastebin.com ftw
@coral owl , nearentities can accept an array
so player nearEntities [["SoldierWB", "SoldierEB"], 100]
would not get animals
cant remember the parent classname for civs
"Civilian"
but I think "CAManBase" won't return animals
yes, confirmed, CAManBase will only get men
"animal" is a child class of "Man", which is why you're seeing your results
ah sorry Tank, solved it!
thanks, exactly here's how I did it in case anyone's interested
๐
if !((_x call BIS_fnc_objectType) select 1 in ["Animal","UnknownObject","Thing","Seagull","Effect","Logic","Module","Mine","VASI","Camera"])) then { hint "remove dat thing" };
I even expanded on it to make sure I am filtering out all the things I don't need PLUS animals
iskindof is way quicker
definitely yes
than fnc_objecttype
will this work?
_x isKindof ["Animal","UnknownObject","Thing","Seagull","Effect","Logic","Module","Mine","VASI","Camera"]
there ya go ๐
meaning, can I copy straight up those names? I think so but ๐
no, iskindof willonly accept a single entry
so yes, objecttype is the way for you
or some trick with select
I mainly want to get rid of animals but I wouldn't mind making sure stuff like the above is cleared out
CAManbase will get only men, guaranteed
yes
trying out
np mste
mate
what with the demise of the much loved six config browser, surfing the hierarchy isn't nearly as easy as it uses to be
cool
CAManbase seems to return a cleaner array from da start
yes
it was nice to scan the animals but oh well not what I needed
"Animal" will give just the animals, if it's relevant
although, i don't think animal returns insects
also, animals are locally rendered, so in MP, player a will see a snake/rabbit which other players wont see
no prob it was still a local matter, not MP so that's ok
xlent
This thread https://forums.bohemia.net/forums/topic/181226-disable-ambient-animals/ discusses removing ambient animals.
Kind of a noob question; but who has access to a side's command chat? Just players with the colonel rank?
@austere sentinel command is, if Im not mistaken, given when you are the group leader.
Makes sense. Thanks ๐
how and where that is handled, honestly would be nice to know I been looking but havent seen nothing specific for auto assignment/joining channels based on role. likely somewhere hiding in cfg's for IG vanilla roles
@echo yew
cursortarget return objnull for like 4/5 secondes
Correct, did you not read the wiki page for cursorTarget? It needs a while for the player to detect the object.
you could use cursorObject too probably.
changing a formation leader would let the TL send a group in formation out on a route etc without the TL following them correct?
am i stupid?
i put this in unit init field in Eden
[this] execVM "ObservationQuerryTest.sqf";
and get error
"Init: Type Script, expected Nothing" ???
init boxes don't allow statements with return value
put 0 = before
so you should assign the return value to something^
we never knew why, but here we are ยฏ_(ใ)_/ยฏ
okay before I take a stab. is that line run and keep going or does it wait for execute completion?
sorry, what?
execVM is it run and done keep moving, or do you wait for its completion before the executing script keeps moving.
execVM is spawn
nvm, was !?...
Quick question: is there an equivalent command to enablesimulation that works for an entire group? Would save a lot of naming and typing ...
You could just do a forEach ^^
D'oh! Cheers.
Can anyone elaborate on targetsQuery command? wiki says the result is sorted.
Does that mean, that if I query known enemies, the 1st item - is the enemy unit will attack with the highest chance?
it seems that targetsQuery gets sorted by accuracy @quartz pebble
@winter rose what means accuracy in that context?
see the wiki:
https://community.bistudio.com/wiki/targetsQuery
Return Value: (...) accuracy: Number - a coefficient, which reflects how close the returned result to the query filter. Range: 0 - 1 (1 - best match)
given the description it might be which target is the "best" to attack
I don't know if it takes into account target priority as well
where the accuracy coefficient reflects how close the result matches the query
So my guess is that if you pass "Man" as a target type, it will be higher than a "Tank" despiste the tank being a more *dangerous" target?
where the accuracy coefficient reflects how close the result matches the query
That's the question: What means "matches the query"? If there is a bunch of different enemies in front of AI, which one will have the highestaccuracy?
I think it's in the same order as the parameters so
1st Every unit of the same side, then it will take into account the type of each unit (for each side individually?), then the position, the closest, the higher it's placed, and finally the age if multiple units are at the same distance?
https://community.bistudio.com/wiki/Title_Effect_Type
"PLAIN DOWN" Displays the text, object, or resource given. Plain text is vertically aligned to 25% from the bottom of the screen.
Is this meant to display text 25% up from the bottom of a player's screen? It's barely any different than PLAIN being in the center of the screen still. Used titleText and cutText
cutText ["This is a test text position", "PLAIN DOWN"];
titleText ["This is a test text position", "PLAIN"];```
https://i.imgur.com/2D9FbIc.jpg
it must depend on your display size and some HUD position too
How do I change the unit's faction via the script?
I try: a1 = ["faction", "IND_F"]; - it doesn't work.
In the unit's init: _faction = "mas_usl_ewint"; - does not work.
What am I doing wrong?
Sorry, there are two different factions.
But still, how to change the faction through the script?
With setSide command https://community.bistudio.com/wiki/setSide
a1 = ["faction", "IND_F"]; I don't know how you would except this to work but that does asign ["faction", "IND_F"] to the global variable a1 and this is not an "object" (like you see in Javascript, so you wouldn't be able to do a1.faction)
And _faction = "mas_usl_ewint"; well it assigns "mas_usl_ewint" to the _faction local variable but this doesn't mean anything to the engine
I understand, but I need to change not the side of the unit, but the faction, since it contains the flag icon that is displayed on the right in Respawn Tickets
Here is a topic on the forum, but I don't know how to make it work.
Well you can put that in the init.sqf and change the values by what you want
addMissionEventHandler[ "EachFrame", {
uiNamespace getVariable "RscMissionStatus" displayCtrl 15283 controlsGroupCtrl 14183 ctrlSetText "#(rgb,8,8,3)color(1,1,0,1)"
}];
/*
uiNamespace getVariable "RscMissionStatus" displayCtrl 15283 controlsGroupCtrl 14183 ctrlSetText "#(rgb,8,8,3)color(1,1,0,1)"
^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^
Slot Path to icon
*/
Unfortunately, the icon blinks.
And if you only put uiNamespace getVariable "RscMissionStatus" displayCtrl 15283 controlsGroupCtrl 14183 ctrlSetText "#(rgb,8,8,3)color(1,1,0,1)" }]; ?
I put only this.
What a pity.
I'm tired of looking for a solution. We are making a project in Arma 3 on the type of game Squad, only with increased hardcore. I would like to implement this, but I don't work very well with scripts myself. I have an example of a mission where there are tickets and I would like to add them to my mission, but I do not know how to do it correctly, the script always gives an error.
It looks something like this: https://wogames.info/uploads/monthly_2020_02/97906741_2.jpg.af35b97a94052ebe1d07525e30513fd2.jpg
@lapis ivy if you want something that's close... youll need to know what you're doing
There's a ton of mechanics you'd need to handle
@austere granite
I agree with you. I'm working on a project alone.
All the most basic things are already in the game, we don't use rally points and hub, respawn only on main, it's all ready.
Maybe check out AAW
That's basically PR
Or Frontline, but the code isn't open and project is basically shut down ๐
class CfgFactionClasses { class rhs_faction_usmc_d { displayname = "ะกะจะ (ะะะ - ะััััะฝะฝัะน)"; icon = "\mas_usa_lite\cfgfaction_mas_usa_blu_ca.paa"; priority = -3; side = 1; }; };
Can I change the icon in the unit class this way?
am i able to make independent objects into opfor with a script?
@cyan pendant ```sqf
_units joinSilent (createGroup [east,true]);
thank you
i've got a SQF file where i'm having a smoke and chemlight spawn on a air dropped supply crate but it keeps spawning the smoke evcerytime the other one ends. also spawns in the air instead of when it hits the ground. Anyone have any idea what i can add to this to help?
for "_x" from 1 to 10 do
{
_supplyLight = "Chemlight_green" createVehicle (position _supplybox);
_supplyLight attachTo [_supplybox, [0,0,0]];
_supplySmoke = "SmokeShellGreen" createVehicle (position _supplybox);
_supplySmoke attachTo [_supplybox, [0,0,0]];
sleep 30;
};```
@zinc sorrel remove the for loop and you are fine
ok thanks ๐ will that have it spawn the grenade once the crate hits the ground?
Nope. You're going to need a waitUntil check before the above
waitUntil {speed _supplybox != 0} do
{
_supplyLight = "Chemlight_green" createVehicle (position _supplybox);
_supplyLight attachTo [_supplybox, [0,0,0]];
_supplySmoke = "SmokeShellGreen" createVehicle (position _supplybox);
_supplySmoke attachTo [_supplybox, [0,0,0]];
sleep 30;
};```
something like that? Sorry, still trying to learn all this sqf stuff
Is there a command/function which will return the relative position of one object to another? Something that would help with getting the cords off an object for a command like attachTo or modelToWorld? Ex: object A is at [1,1,0] and object B is at [0,0,0] and a command would return something like [-1,-1,0]
@tame lion You need/want the Vector?
https://community.bistudio.com/wiki/vectorFromTo
I will need it too actually
I'm making a FOB system that will allow players to save/load templates of the items they have built
Thanks guys
Then worldToModel is prolly better suited, for that task.
Agreed
alternatively:
getDir / getRelPos
Yeah that will get me the pos of objects. Now to make sure i get the proper vector in relation to the central vehicle that will be the reference point
Is there a way to give a player NVG only when they're a pilot in a helo and remove them on exiting the helo?
Trying to enforce flashlights & night fighting but flying is not fun without nvg
Some hints:
addItem, vehicle player, removeItem, unlinkItem
unlinkItem Thats probably the one I was missing
prolly
@hasty violet For my addons that work as both script and mod I created them as a script and used a .bat script to pack them as both a script and mod addon.
Use the getinman eventhandler to linkitem and then getoutman to unlinkitem
๐ so much of this stuff is buried for noobs
how to i run a line of code when a variable is True?
the only place i know of to put the script is under init
is there an option for a while loop?
Hello everyone! I try to make some magic with TFAR and now i have a question. How does this code affect on
performance in MP if it called once per second?
_radioArray = ["163.1", "34.2", "0.0"]; //this array creates by another function, not necessary for now
_unit setVarialble ["SVT_currentFrequencies", _radioArray, true];
@cyan pendant You'd want to put the code for the loop in it's own file (say scriptname.sqf), and spawn it in init.sqf or initServer.sqf . If you just use a while loop in init it will block other code from being run if I'm not mistaken.
Granted, I'm a noob so someone with more experience is most welcome to correct me.
{
while {1 == 1} do
{
private _combatphase = car getVariable "combatphase";
if (_combatphase == true) then
{
this fireAtTarget [car, "RPG-7"];
};
};
};
this is the code im using in init to try and get a dude to blow up a car
wrap that in a spawn call. (see https://community.bistudio.com/wiki/spawn)
At least I think lol
@hasty violet i dont think ive shared it anywhere. it isn't special anyway, basically just copy files from the git repo to a temporary directory and then packs the directory into a pbo.
Someone knows if theres way to stop auto assigning task when current is done??? I have task which i dont want to have current. And one which is current and after current is done the first one is assigned by system. Is there way to stop it???
https://community.bistudio.com/wiki/BIS_fnc_taskCreate check priority description......... Description sucks...
Ok. -1 do the job!
BI sucks yet you used the wiki (mostly edited by the community) and you managed to do what you wanted within the gameโฆ ๐ค
Bad description, thats the point. whatever.....
@lucid junco I updated the description of priority https://community.bistudio.com/wiki/BIS_fnc_taskCreate I hope it's clearer now.
great! ๐
"with the largest priority >= 0" , I (honestly, not trolling) don't get what was unclear to you? Phrasing?
of course its clear. I got it with second run. Its just more clear when mentioned. ๐ Im counting my free time for minutes not hours so i go really fast. Technically my fault, yes ๐
" the system selects the one with the largest priority >= 0" think i got missed by this. From my point when you read it, its 50/50 chance if you can go to negative numbers and what this could do. Just depends if it come up to your mind to try or not. I just catched it for second read..
Wondering if there is a way to modify armor values for a vest during runtime? Everyone on a team will be using the same vest (colored deck crew vests for easy team identification), but I'd like to implement an upgrade system. Do I just have to duplicate & tweak the deck vest for each upgrade on initialization? If so, any info on copying&tweaking would be helpful
You can't change config values on runtime, so you either need to create a config for each upgrade (and switch out the vest), or modify the damage event handler which decreases the amount of damage received based on the current upgrade.
Yeah I figured cfg was immutable, didn't see anything confirming though. I'll have to dig for how to copy an item and just use it's model. Thanks!
good place to start with gear configs is this wiki page: https://community.bistudio.com/wiki/Arma_3_Characters_And_Gear_Encoding_Guide#Vest_configuration
Exactly what I needed, tyvm ๐
@lucid junco thank you for the explanation! :+1:
Anyone happen to know what causing this? https://steamuserimages-a.akamaihd.net/ugc/781875421825775317/0D099C2A9DABDA6FE1463235F2F39509EEBE1BDD/
Here is the initSettings.sqf file causing it: https://pastebin.com/6Zxh4TXe
Its for CBA Settings if you havent already gathered from images. Im not sure whats causing it as im pretty sure im folowing the correct syntax
Error appears every time addon options is opened
yeah got that much XD
(unfortunately)
im just not sure where
I guess _debugValues can't contain booleans, but need to be integers or strings
hmm that may be it
though it does have booleans in the example in their documentation: https://github.com/CBATeam/CBA_A3/wiki/CBA-Settings-System#setting-type-specific-arguments-_valueinfo
best is to comment what you suppose is "OK" then little by little, find the guilty one(s)
CBA wiki is far from useable in my experience ๐
yeah it tends to be out of date quite a bit.
and yeah it seems it is that list
welp time to rewrite my checks
Thanks for the help
that's what this Discord is for ๐
wait, it is?
and to make Lou work
yup though the headless client section is bad as there arent many people with experience
and people dont really check it
Anyone has some ideas on the formula that calculates the "mass" bar in the inventory?
Specifically the contribution of items stored inside backpacks, since they contribute more to used mass than their counterparts not in a backpack.
all items should have a mass value if thats what your looking for
Im aware of those. I can get the mass of items in a container to match up with the maximumLoad fine when the items are sat straight in the container
The issue im running into is to account for items that are inside something like a backpack or vest. They contribute more than if they were "unpacked" inside the container
I'm trying to get a calculation that works on the same prinicpals as vanilla arma's inventory
you mean how much space it takes in a vest?
got an image of that bar your specifically asking about?
1s
you cant post images directly in here btw you will need to provide a link
Example:
If you put an empty backpack and 5 mags inside a container (the mags are not in the backpack) it will use up say 5%
If you pack the same mags inside the backpack the total amount used will increase by a certain factor.
Its that factor im trying to figure out.
It doesn't seem to be linear from my experiments and it's hard to tell what parameter it's based on.
I just thought I'd ask here before I spend a ton of time on function fitting.
I didnt even know arma did this until today... 5k hours in...
Pictures: https://www.dropbox.com/s/m04d4d0xo31dkuk/ex1.PNG?dl=0
https://www.dropbox.com/s/vdc18f9i02y81t0/ex2.PNG?dl=0
https://www.dropbox.com/s/z7k0noo4yb2b5ia/ex3.PNG?dl=0
Hmm, yeah didnt know it increased it by that much. Maybe if it has anything in it it uses the maximumLoad value? does it stay the same size with only one mag in it?
oh wait, the bar is not -just- weight, isn't it also -volume-?
uniform/vest/backpack/vehicle have a maximumLoad, and items have a mass.
So it's maximumLoad / 100 * (mass * n)
I am talking "volume" as in 3D "size"
maybe an empty backpack = "folded backpack",
and a backpack with one single napkin in it = "full-sized backpack"
Arma doesn't really have a volume for regular items, only with the Vehicle-in-Vehicle stuff it takes the bounding box (and mass)
the question is if it changes "size" depended on the amount of items inside. If it doesnt then there is no dynamic formula
it's the percentage of the bar shown; since maximumLoad is 100%, and mass * n (or mass + mass + mass + mass ...) is the number within the 100% (Math 101)
and afaik does the weight of an object itself not change when items are put in, however scripts which need to know the weight simply calculate that
btw... Arma 3 has some nice functions for all of this:
https://community.bistudio.com/wiki/loadAbs
https://community.bistudio.com/wiki/loadUniform
https://community.bistudio.com/wiki/loadVest
https://community.bistudio.com/wiki/loadBackpack
ye it really is too bad none of them work on non-unit containers
sorry, i wasn't clear in my question about the formula... what i mean is that the % of the entire container or just the backpack? And what does n actually represent? the number of magazines in the example? or all items? cause i cant get those numbers to add upp
just so we're clear, the setup is Box > Backpack > Mags
I need the how much the Backpack (including the mags in it) take up of the box's maximumLoad
when they are packed
on the right (large bar) is total "weight" carried by unit, where maxSoldierLoad is 100%
under the containers is the "weight" of all the items inside the container, where maximumLoad is 100%
on the right is will show the maximumLoad of the container you are accessing (eg. crate)
Testing in dedicated server with debug console. Why does this created _unit not change its side from BLUFOR to OPFOR?
_tempGrp = createGroup east;
_unit = _tempGrp createUnit ["B_Soldier_F", position player, [], 0, "NONE"];
IIRC, @forest ore , _unit will take the side of the leader of the group
its possible _unit IS the leader of that group
you might need to create another unit, an opfor one and make him the group leader first
Tankbuster, at least _tempGrp should be empty since I create it just before creating _unit. But ok, apparently a created unit doesn't take the side of a created group ๐ค
Just to continue on that: shouldn't a created unit join a group with join or joinSilent?
Any idea why that does not happen with this:
_tempGrp = createGroup east;
_unit = _tempGrp createUnit ["B_Soldier_F", position player, [], 0, "NONE"];
_unit join (group player);
No the unit takes the side of the group leader
yes, join takes an array of units
@exotic flax i've done the numbers for what you've explained and man it still doesn't add up. Maybe I'm just thick but
Backpack is mass = 60,
mags are mass=10 each,
there's 20 mags in the backpack,
the box in this case is the inventory of a ATV with a maximumLoad = 600
600 / 100 * (20 * 10 + 60) = 0.0299..=> 3%, that doesn't make sense, the increase in weight is not 3%, the total is sure as hell not 3% (more like 80%) as seen in the first picture i linked
[_unit] join (group player);
oho, wololooo. Lou to the rescue! ๐๐ผ
I was reading https://community.bistudio.com/wiki/join and thought that it does not need an array if there's only one unit ๐
And just to confirm the created unit now joins player when using [_unit]
๐
hehe
well gahd damn! ๐
couldn't resist :p
what about where I said the group needs a leader before you join the unit to it? was I right?
It would seem so yes ๐
cool
if in the editor, I think the usual practice is to give the group leader a zero probability of presence. Not sure how you'd do that in script
createUnit, deleteVehicle
*checks own scripts
yep, thank you @winter rose
lol
in a similar vein, I have a mission where I create opfor units, but forceadduniform civvy clothes on them
might be an option, depending on @forest ore use case
For some reason I can't get the player to force eject. I get the hint so I know I'm reaching this bit of code at least (this is in a "GetInMan" EH if that matters)
hint "You may not pilot this vehicle. Choose another seat.";
_nul = [] spawn {
sleep 1;
if ( vehicle player != player ) then { player action [ "Eject", (vehicle player) ]; };
};
Nevermind, figured it out.
player action [ "Eject", (vehicle player) ];
needed to be
player action [ "getOut", (vehicle player) ];
blufor_box_backpack addBackpackCargoGlobal ["B_mas_usl_Kitbag_w", 56];
Hey. I'm trying to add a backpack to a drawer, but this backpack comes right away with the item in the backpack. How can I remove all items from an added backpack in a drawer?
Strange remote exec. Would need to remote exec join but that wasn't it --> ```sqf
[(group _eastGroup), [_unit]] remoteExecCall ["join"];
but how?
Looks like your params are backward
This seemed to be the case Gnashes. So like so:
[[_unit], (group _eastGroup)] remoteExecCall ["join"];
```The thing that mostly bothers me with this remote exec stuff that I never seem to get a hold of how stuff is supposed to go with it. There's always something the "wrong way" ๐
It's just the exact same way as if you'd used the command without remoteExec
[_unit] join (group _eastGroup) > [_unit] (group _eastGroup) remoteExec ["join"] > > [[_unit], (group _eastGroup)] remoteExec ["join"]
Hmm, true true indeed. Well maybe some day even I'll understand. And that shouldn't even be a difficult combo to remote exec ๐คท๐ผโโ๏ธ ๐
@forest ore I usually find abstracting it a bit helps:
Regular call:
arg1 command arg2;
RemoteExec:
[arg1, arg2] remoteExec ["command"];
In your case:
arg1 = [_unit]
arg2 = (group _eastGroup)
command = join
Will keep that in mind @dusk shadow thanks ๐๐ผ
Hello everyone! I need some help here. So, I'm trying to use UnitCapture and UnitPlay to get two Ghosthawks to move to an LZ and move back to their ships. I've got all the recording from UnitCapture and set it up to be triggered with a radio call, and everything is working fine. HOWEVER, when I trigger the radio call on the helicopters, they instantly move an inch forward and then stop. How can I fix this?
2020: Still dreaming about managing non-unit cargos without fully clearing them.
๐ฆ
hmmm, am nearly ready to release update of mission... checks to see if I'll be buried by an ACE, RHS or CUP release like has happened the last few times
or I could break the habit of a lifetime and release midweek
How can I prevent third-party mods from being used on my server?
Use the mod signature/key system @lapis ivy
The keys are added to the server in the /myserver/keys folder, but players can still log in by connecting a third-party mod.
Maybe there is some config that I need to configure?
make sure that signatures are turned on in the server.cfg
How do I do this?
I use the TADST server launcher
And one more question...
I'm trying to add a backpack to a drawer, but this backpack comes right away with the item in the backpack. How can I remove all items from an added backpack in a drawer?
blufor_box_backpack addBackpackCargoGlobal ["B_mas_usl_Kitbag_w", 56];
is there a particular reason you're using TADST?
@finite sail
Yes, I had a problem with plug-in mods. The launcher made it easier for me.
What's a plug-in mod?
I connected the RHS, ACE mod, CBA...
erm... connected?
is English your first language m5?
because you're using terminology I'm not familiar with
No, I'm from Russia, I use a translator. He doesn't always translate correctly, sorry.
its ok, i need to have a think about what you're saying ๐
๐
ok, so you are using RHS, ACE, CBA mods
yes, this means signature checking isn't working
I want to be able to connect only using server mods.
The server is currently disabled. I can turn it on.
please do
Okay, wait 1 minute.
Do know that this is for scripting and not #server_admins
Sorry.
sorted via messaging.. hopefully got him to move to FAST2 too
wondering if anyone has a workaround or something for the following:
i have 4 units in a vehicle that say a line via kbTell all at the same time (simultaneous cheering)
other kbTells in this scene use the VEHICLE radio channel so as to speak over the sound of the vehicle
this does mean however that only one unit can use the channel at a time
in order to get multiple units speaking at the same time, i need to set kbTell to use the DIRECT radio channel
script wise, everything works however i'm unable to actually hear them over the sound of the vehicle 
tl;dr - how i make vehicle quiet while preserving speech volume; fadeSpeech does not affect speech from kbTell, already tried that
โ A3 bug โ
What would be a good way to take an object and make its vector match the ground below it? I'm sure it involves surfaceNormal but not sure of how to use the math there
setVectorDirAndUp perhaps
would the up array be the surfaceNormal
Does the UIEventhandler "ButtonDblClick" not work anymore? I've been trying to make a button have 2 different functions based on single vs double click
hi all, is there any way to have a custom engine sound from a spaceship to play on a static object .the idea is to have a spaceship that flys with the custom engine sound and have it play on the interior of that ship which is a separate model. it needs to have the same frequency and volume as the flying ship.Any help would be great thanks
would playsound3D command work?
Just like when you're in a helicopter and you start to fly the engine sound changes . Thats what im trying to accomplish. Playsound would just play the sound not change the volume or frequency . When you're in the interior you want to be able to hear that the ship has started to take off as the engine sound will be changing . Hope you get what I mean, thanks
