#arma3_scripting
1 messages · Page 664 of 1
what is your code so far?
Little because I don't have much idea of scripting in arma3
I tried with the MCCS mod trade but it doesn't work for me either
then maybe it is better to use an existing framework yes
and seek assistance towards its creators/community 🙂 (I unfortunately don't know MCCS)
Anything works for me, my goal is to create a trader
I'm using the translator in case you read something that doesn't make much sense haha
I got that ^^ no worries, it is all clear so far
My goal is to create a trader with personalized prices, but all the codes that I find online are either not available for download or do not finish working.
Okay got that sorted, Second question, in the fired event handler which parameter gives me where the projectile landed
because its not _projectile as that just spawns it underneath me
you cannot know where it landed, only where it started
booo damn it soo close
@still forum how can I add hashmaps to intercept? 
is it of type std::unordered_map? 
Does anyone know why i cant put 2x hintC "Press W to move forward"; right after eachother?
see example 4
if you mean by example 4 this: hintC "foo"; sleep 0.1; hintC "bar" that aint working
it's literally marked example 4 

you can't
will you?
probably no time 
but I guess I should
I have time to implement the GameDataHashMap, but not the new script commands
well it may be ugly but it works so far
if (isServer) then
{
{_x addEventHandler ["Fired",
{
_extraction = false;
_soldierName = (_this select 0);
_weaponName = (_this select 4);
_smokeProjectile =(_this select 6);
_lzSite =(getPosATL _soldierName) findEmptyPosition [0, 200, "B_Heli_Transport_01_F"];
if ((_weaponName == "SmokeShellGreen") && (_extraction != true)) then
{
_null = [_soldierName, _lzSite, _extraction] spawn
{
_extractionInbound = (_this select 2);
_mySoldierName = (_this select 0);
_myLzSite = (_this select 1);
_mySoldierName groupChat "Popping green smoke"; sleep 5; "Land_HelipadCircle_F" createVehicle _myLzSite; _extraction = true;
};
};
}];
} forEach playableUnits;
};```
_extraction != true you never compare booleans to a constant boolean.
if ((_weaponName == "SmokeShellGreen") && !_extraction) then
_extraction = true; this won't do anything.
You set a variable that you throw away right after
_null = thats nonsense, remove that
_this select just use params.
As the wiki eventhandler page shows in its example
how i do that im just going of a tut that did it this way
"how i do that" which specific thing?
params?
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Fired
yeah how does that work for calling them into my script i understand the way the tut did it
btw...killed eh which fired twice, was a bug in ACE/CBA, isnt it?
its also a engine bug
_mySoldierName = (_this select 0);
turns into
params ["_mySoldierName"];
Params takes the same order as your parameters. so all of them
[_soldierName, _lzSite, _extraction] spawn
will be like this in params:
params ["_soldierName", "_lzSite", "_extraction"];
yeah i dont get it; look i watch 1 tut on event handlers
Hey guys ! Anyone willing to help me on this, i'm trying to make an addaction resulting in healing the whole player squad if that's something doable
I know how to make a healing area with each persons in a trigger getting healed
is it sp or multi
MP on a local hosted server for me only
its doable
player addAction ["Heal", {
params ["", "_caller"];
{
_x setDamage 0;
} forEach units _caller;
}];
but in light of not making and idiot of my self im not going to attempt it
@hoary halo you can put it in initPlayerLocal.sqf
it's an instant heal script tho
like a cheat
also not compatible with ACE
Thanks a lot! perfect, gonna try it tonight, its for interacting with a doctor sort of at the FOB to get healed
and congrats on you ai commanding mod, always using it
@little raptor will you do the intercept script commands for hashmaps, once I implement the game data type?
I don't think I can get it done today, I should have more free time later this week tho 🤞
yeah sure
I'm trying to make a script where at the start of the mission, the weather is random but with preset values. (It's MP)
initServer.sqf
_weatherType = [sunny, rainy, night] selectRandomWeighted [0.5, 0.3, 0.2];
sunny = {
setDate [2020, 2, 25, 11, 0;
0 setRain 0;
0 setFog 0;
0 setOvercast 0;
0 setWind 1;
forceWeatherChange;
skipTime 24;
setTimeMultiplier 0.1;
};
rainy = {
setDate [2020, 2, 25, 18, 0;
0.6 setRain 1;
0.6 setFog 0.8;
0.8 setOvercast 1;
.2 setWind 1;
forceWeatherChange;
skipTime 24;
setTimeMultiplier 0.1;
};
night = {
setDate [2020, 2, 25, 20, 0;
0 setRain .3;
0 setFog 0.2;
0.2 setOvercast 1;
0 setWind .6;
forceWeatherChange;
skipTime 24;
setTimeMultiplier 0.1;
};
[] spawn {
_weatherType;
};```
This should work right? (I don't have access to test this in MP rn)
yes, but place it in initServer.sqf
Got it 👍
no
Should be an undefined variable 'sunny' error in the first line though, need to move the definitions up above that line.
you may not be able to test in MP, but at least give it a test in SP
oh true
initServer works in SP as well. If your code doesn't work in SP, it won't work in MP either (99% of the times; the only exception is MP-specific commands, such as netId)
undefined variable + spawn is just putting the code there
it never executes
private _sunny = {};
private _rainy = {};
private _night = {};
call ([_sunny, _rainy, _night] selectRandomWeighted [0.5, 0.3, 0.2]);
Imrpovise. Adapt. overcome.
Thanks for the help guys.
Is there some way to detect if a curator goes from player mode to zeus mode? I'd like to show who is currently in the zeus interface so they can work together. But some players may have curator access but aren't actually in zeus. Any way to get that information?
And then additionally, send out a hint only to others in zeus, not everyone in the server (I assume BIS_fnc_curatorHint would be ideal for this)
I was looking at BIS_fnc_listCuratorPlayers but that also returns those who are not currently in the zeus interface
see Zeus EHs
EHs?
ah event handlers
it doesn't seem to be in there
Unless I can use CuratorPinged in combination with isCurator
yeah dunno
I want all opfor units to share some common code/event handlers.
On the other hand, while playing zeus, some units may be added during mission time (and hence, don't have them).
Is there a way to check if a unit already has these handlers added? can I set a unit "flag" or something similar? can I addEventHandler to a SIDE (ie: every time a unit is killed for a side)?
I could use workarounds like setting variable names, but seems better to ask before reinventing the wheel
I dont think arma would like same addEventHandler invoked multiple times for the same object.
you can set a variable e.g KIWI_init to true
yep...that's the flag i was thinking of...thanks!
trg1 = createTrigger ["EmptyDetector", getMarkerPos 'hq_base'];
trg1 setTriggerArea [25, 25, 10, false];
trg1 setTriggerActivation ["CIV", "PRESENT", false];
For some magical reason this trigger, triggers even tho there is not CIV present in the area.
🤔
How to determine if two units are facing each other with a tolerance of about 30 degrees? There seems to be a number of ways to achieve this so I thought I'd ask before overcomplicating things.
Any ideas?
it's set to NOT PRESENT (it's even in caps itself 😂 )
oops, sorry i have it PRESENT i was testing it and i gave up so i put it like that here x)
Edited it
but yea it triggers and complets my task even tho there is only bluefor in that area and no civs
it's probably being triggered by empty vehicles and stuff
ah..
I think even animals can trigger a CIV trigger
that makes sense then
kinda sucks tbh ..
if i add a civ to my group (bluefor) will he become bluefor or not 🤔
blufor yes afaik
shit.
heh, otherwise you could tell him to grab a gun and mow down every enemy without being worried
x)
How can i check if a unit is in a trigger 🤔
trg1 = createTrigger ["EmptyDetector", getMarkerPos 'hq_base'];
trg1 setTriggerArea [25, 25, 0, false];
trg1 setTriggerActivation ["CIV", "PRESENT", false];
trg1 setTriggerStatements ["this"," ACTIVE CODE HERE ",""];
cuz 'civ' is not gonna cut it anymore at that point
as usual: the wiki
https://community.bistudio.com/wiki/setTriggerActivation
Side: "EAST", "WEST", "GUER", "CIV", "LOGIC", "ANY", "ANYPLAYER"
if it's only for one unit, synchronize the trigger to that unit and use "VEHICLE"
Yes they can. They inherit from Man class
but they're not civilians! 😅 (sideAmbientLife)
the trigger should use sides for detection
you can make it work with civilians
how.
magic
I'm not sure if it'll be "performance friendly" tho. a loop might be better
trg1 setTriggerStatements ["this && {thisList findIf {side _x == civilian} != -1}"," ACTIVE CODE HERE ",""];
I guess...
a trigger checks by default every 0.5s, you can change that too
oki
Would this be the place to ask if a certain type of script exists? Or would that be for a different discussion channel?
Mppff.. cant get it working..
it could be #arma3_questions, but it's cool too if you want to try and do it
I guess it won't check the condition then
Ok
i might know why, how would i check if _unit exists in thisList ?
if (_unit in thislist) ?
@heady quiver try this:
trg1 setTriggerStatements ["this && {thisList findIf {_x isKindOf 'CAManBase' && side _x == civilian} != -1}"," ACTIVE CODE HERE ",""];
turns out side _vehicle returns CIV 
I thought it was supposed to be sideUnknown
Problem might also be the CIV is added to my group then he will become bluefor no ?
yes
mmm
Is there a script that does something like KP’s Liberation, where there is a fob crate that you go and deploy to set up defenses within a certain area?
So leo, i have a unit thats _unit and only HE can trigger it.
createMissionDeliverHostage = {
params['_unit'];
Cuz i pass on a param
I don't know what you mean
but what I said here works for civilians:
#arma3_scripting message
no false positives
trg1 = createTrigger ["EmptyDetector", getMarkerPos 'hq_base'];
trg1 setTriggerArea [25, 25, 5, false];
trg1 setTriggerStatements ["_unit in thisList",
Well it doesnt have to be for civ's it has to be only for 1 unit.
_unit is not defined
and thats _unit
_unit in list myTrigger
trg1 setTriggerStatements ["this && {some_unit in thisList}", then

what about this?
Can't you just attach the trigger to that unit?
this is where _unit comes from
i just wanna see if he is in that trigger
tried both above doesnt seem do work
// Hostage join squad
[_unit] join (group player);
trg1 = createTrigger ["EmptyDetector", getMarkerPos 'hq_base'];
trg1 setTriggerArea [25, 25, 5, false];
trg1 setTriggerActivation ["WEST", "PRESENT", true]; // FIX THIS ITS NOT WORKING
trg1 setTriggerStatements ["this && {_unit in list trg1}",
"
CODE HERE
",""];
what am i doing wrong 
&& {_unit in thisList} <-- this part seems to be wrong
_unit is not defined in the triggers scope
what am i doing wrong
the trigger does not know_unit
I still think you could just attach that unit to the trigger to make it activable ONLY by that unit, making it more clear, but if it works, it works
oh ty.
@robust tiger not attach, synchronize
synchronize is not for units
yep no, mb
I is tired, I keep doing/telling/reading sh**
unscheduled code runs faster than scheduled 🙂
As long as you don't have many of these triggers, and thisList isn't too big, it'll be just fine.
Btw. countSide might be faster, as you're not looping in SQF
that's what I already told you: #arma3_scripting message
As long as you don't have many of these triggers, and thisList isn't too big, it'll be just fine.
actually, these were exactly my points of concern.
Btw. countSide might be faster, as you're not looping in SQF
I didn't know that existed! (but I guess it still won't solve the issue sinceside _emptyVehicleisCIV)
Any way to enable map markers on direct chat?
Map "drawing" is possible, but double-click markers arent'
Also unsure if this belongs here, or either #arma3_editor or #arma3_scenario
direct chat not working is news to me
will check with no mods loaded incase one of them is doing this, but doubt it
also, first syntax is wrong
yeah 
either ```sqf
private ["_var1", "_var2"];
// or
private "_var1";
private "_var2";
// or
private _var1 = "something";
private _var2 = "somethingElse";
and the latter is moar betterest
@cunning oriole also see:
https://community.bistudio.com/wiki/Code_Optimisation#private
AND its a script command execution.
is the chat channel maybe diasbled on server?
can make lines with ctrl+click, but no markers with double-click
can't place markers in disabled channel
I am in the editor, VR Map, 1 unit, no scripts
Though also shouldn't allow drawn lines then
Maybe something for @unique sundial
Can't place markers in direct chat, but can draw lines just fine ^
"Proof"
https://i.imgur.com/Y0QNwpo.png
Seems like parachutes have a visual bug with ropes. When a player's chute is the lifter end of a rope, the rope visually stays where it spawns, but works in holding a cargo. On unit switch the visuals get fixed. https://youtu.be/90EA_Vj4zTQ
while {true} do {
selectRandom hostage playMove "AmovPercMstpSnonWnonDnon_EaseIn";
};
<-- this is bad almost crashes my game (from 160 fps -> 40 in short time) and better ways to make a unit go into that stance ?
And the reason youre spamming that in a while true loop is what again?
well if i execute it once he goes into 'hands behind back' animation and then instantly out of it again.
Which one is that exactly 
You also need to disableAI move and maybe some others. Otherwise the AI will just start moving into a different anim
Check ingame animation viewer
Its probably something like AmovPercMstpSnonWnonDnon_Loop
i think i found something else:
this switchMove "AmovPercMstpSsurWnonDnon";
this setVelocity [0,0,0];
this disableAI "ANIM";
Would this work for MP aswel?
Not sure what the velocity does tho
is there a function similar to diag_log that writes to an specific file/is there a way to write lines to specific file?
No
you should report it in #arma3_feedback_tracker
Indeed. will do
I'm attempting to create a script that will fully ACE heal all players/units within a defined volume. I have very little scripting experience, though, which is producing a bit of difficulty. Does anyone have any experience with this?
theoretical question: https://i.imgur.com/hwqyoe1.png
Let's say I have a vehicle (Helicopter) that travels 200km/h and I want to reduce the speed gradually so that it reaches 10km/h but only 20m in front of the target. How do I calculate when to start the slow down? I tried to calculate that in theory it should do 55m/s but I'm not quite sure if that helps
Only thing that might be a starting point is to fiddle around with maxSpeed of the aircraft sqf (getNumber(configFile >> "CfgVehicles" >> (getDescription _aircraft select 0) >> "maxSpeed")); but I think it does not matter in this case does it?
calculus
your question doesn't have an answer, because the acceleration must be specified as well
well the helicopter is in the air and flies full speed. I'm not quite sure how I can accommodate all that into account. I couldn't find a command on the wiki that would help me in getting the acceleration part. Also I'm not that deep into math.
https://pastebin.com/AhbYcDd5
You can also set the radius of the vision cones
Now that I think of it, you might wanna switch params 2 and 3 but whatever
any ACE experts here?
im trying to make a script to basically turn a specific unit type into a ace doctor
can anyone help?
ps. i forgot to change their attributes in the editor yes yes im dumb lol
I'm running this in the initServer.sqf but it won't work and I'm not getting an error.
private _sunny = {
setDate [2020, 2, 25, 11, 0];
0 setRain 0;
0 setFog 0;
0 setOvercast 0;
setWind [(random 999), (random 999), false];
0 setGusts (selectRandom [0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1]);
forceWeatherChange;
skipTime 24;
setTimeMultiplier 0.1;
};
private _rainy = {
setDate [2020, 2, 25, 18, 0];
0.6 setRain 1;
0.6 setFog 0.8;
0.8 setOvercast 1;
setWind [(random 999), (random 999), false];
0 setGusts (selectRandom [0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1]);
forceWeatherChange;
skipTime 24;
setTimeMultiplier 0.1;
};
private _night = {
setDate [2020, 2, 25, 20, 0];
0 setRain .3;
0 setFog 0.2;
0.2 setOvercast 1;
setWind [(random 999), (random 999), false];
0 setGusts (selectRandom [0.1,0.2,0.3,0.4,0.5,0.6]);
forceWeatherChange;
skipTime 24;
setTimeMultiplier 0.1;
};
call ([_sunny, _rainy, _night] selectRandomWeighted [0.5, 0.3, 0.2]);
Hi, I want to see if it is possible to get an APC into the game minus the turret using only mission files would it be possible? I have seen it done on KOTH but I was wondering if anyone here knew of a way to make it happen. Sorry if this isn't the correct channel.
Works fine for me.
nvm
I think this is what you're searching for
https://community.bistudio.com/wiki/setVelocityTransformation
Anybody know if it's possible to change the max ACE drag/carry weight? If not, are there any scripts for moving box objects?
gonna give it a try tomorrow, thanks
question how do i get the bigger debug menu with the previous statment next statment buttons
I found the ACE_maxWeightDrag but don't know how to actually change it and reflect the change in game
CBA
ah k thanks
hmm ok then was looking for a way to spawn small bases at random positions, BIS_fnc_objectgrabber/mapper are pretty good not perfect but it will do.
I'm having trouble with getting a particular trigger to fire. This is in an MP environment.
I have an AI soldier, variable name informant. He is grouped to a small player occupied team. In short, the objective is to get that AI back to the safe zone for objective to complete.
I have 2 outcomes for this objective, using the editor modules. The first is if the informant unit dies at any point, the objective will fail. That trigger works fine. The second however, him reaching the safe zone, only works 50% of the time. In testing, if I move informant into the zone when he is alone, not grouped to anything or a player, it triggers fine. If however he is in a player group, it does not.
I have tried activiation conditions with informant being tied as the trigger owner, and him being present inside trigger area. I have also tried un-synching him as trigger owner, and simply using "informant in thisList" which again works when he is not in a player group, but not the other way around.
My guess is that something about being in a group with a player messes with this, though he has a variable name applied, shouldn't it be firing with the in list option?
Sounds like a locality issue. When the unit is in the player's group it becomes local to the player.
So that erases any sort of ownership of a trigger?
Have you ticket that "Server only" checkbox inside the trigger?
Im curious why the death trigger works and the area doesn't, as the unit has a variable name that I would assume remainds consistent no matter what group the unit is a part of
I have, you think un-ticking would work? I had it originally like that because thats exactly how I set up a similar objective before, that worked fine. Only difference was that AI unit was his own group, and an enemy so was forcefully escorted.
Yes
The death trigger works because alivecommand has global argument. It will find "informant" even if it's not local to where the command is executed
The trigger however, only being evaluated on the server, does not know the "informant" since it is local to the player's computer in whose group he is
Hm, I see. (probably). I'm not really a coder, and while Iv'e been mostly succesful with basic sqf stuff im still bad at it. I'll try out your suggestion in a bit after I eat. Thanks for the input, hoping it works.
Sure, I hope that's the issue you are having.
Hello everyone. Anyone know why the script below gets skipped when the rearm _asset is a fixed wing aircraft? VTOL/Rotary works fine as does all vehicles. I put in text pop ups to see what was going on and from what I can tell, the if statement doesn't kick off when it's fixed wing.
if (_asset isKindOf "Air") then {
[player] spawn GOM_fnc_aircraftLoadout;
} else {
private _turret = _x;
private _mags = (_asset getVariable "BIS_WL_defaultMagazines") # _forEachIndex;
{
_asset removeMagazineTurret [_x, _turret];
_asset setVehicleAmmoDef 1; //_asset addMagazineTurret [_x, _turret];
} forEach _mags;
};
Hmm, no dice. I tried splitting the informant AI from the group, and giving him a short move then join command, still nothing. I took the server only off the trigger. Its not the end of the world if it doesn't end up working, I can set up a manual method of triggering it with zeus if need be.
Edit: So, I am happy to report I got it working. I am sad that it was so simple a solution. Tying the informant unit as trigger owner, with conditions that he is present. The thing preventing it from working, was that I had the trigger going to a single change task state module, which was connected to two different tasks (one for the team that the informant is a part of, and one for the rescue QRF). Evidently the game doesn't like trying to share a change task state module between two tasks, so giving one to each, makes it work fine. I hate and love ArmA.
can i make it so that players can only respawn when the whole group is dead?
just curious, is there any fast way for me to extract loadout to use for setUnitLoadout ?
is it possible to "selectplayer" from "teamswitch next"?
the thing behind it is, i cannot script much, and this will break the game if i am the leader my self:
if !(isPlayer (leader group player)) then {
selectPLayer (leader group player);
};
if i control a squad member and get killed, i teamswitch back to the squad leader. but how can i get switched from a killed squadleader to the next appointed squadleader in the remaining team
getUnitLoadout? 
I'm not sure what you mean by fast. Typing-wise and performance-wise that is the fastest.
Apologies 😄 What I meant is, I want to extract the result from getUnitLoadout for further uses 😄 I hope that makes sense.
depends what you want to extract
this is a sample of getUnitLoadout result:
https://community.bistudio.com/wiki/Unit_Loadout_Array
well, to be specific, I wanted to extract all of that into my clipboard (???) for convenience of modification 😄
copyToClipboard str getUnitLoadout player
oh =)) ty so much 😄
Direct chat was never available for marker placement, in not Arma 3 anyway
You want me to disable line drawing in direct chat? Are lines different as you can see them whatever channel you are on radio/no radio?
another strange thing is that the direct channel is visible in that screenshot. I couldn't see it when I tested it tho.
it is greyed out means it is not available for marker placement
yeah but I don't have it at all
not even a grayed out version
it's just other channels like global, side, etc.
then maybe you don’t have all the files
files?
verify installation, make repro,I dunno
have you tried profiling?
nope
2.02?
I just tested dev. I'll try those later
please let me know, tag me
sure thing
does the ControlsShifted EH apply when a player takes control of a UAV
Can UAV have pilot and copilot?
Best way to find out is to test it with action command https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#ControlsShifted
Please excuse the format I'm on my phone.
if ( (typeOf player == "classname of unit") )
then {_unit setVariable ["ace_medical_medicclass",2, true];}
else {_unit setVariable ["ace_medical_medicclass",0, true];}```
Would this work if I put in a classname of unit and then anyone who is playing as those units will be ace Doctor otherwise they are not?
Thank you in advance
Again sorry for format
trying to make a unit sit on the sofa, but they float above it, how/can i use that setunitheight to keep the units sitting animation so that the unit actually looks as though their sitting on the sofa, not floating? please help, thanks
Because the unit is colliding with the sofa. Try attachTo the unit to an Logic
thanks polpox, as referring to this page, (https://community.bistudio.com/wiki/attachTo), how should it look? (e.g 'player1 attachTo [sofa1, [0, 0, 1]]; ?
No, not to the sofa but another object, specifically Game Logic
@sharp peak how did you make the direct chat appear there in the first place? normally it shouldn't even be there
@warm hedge how would that work sorry? havent a clue, put a mobile phone (new) and tuck it under the sofa, and have the player sit on the phone to make it look like they sitting on sofa lol
attach the unit to the logic, then adjust the logic position relative to the sofa
Place a Game Logic in Eden Editor (located in Systems (F5) -> Logic Entities), name it, attach the unit via attachTo, eg sqf unit attachTo [logic,[0,0,0]];, some effort to adjust the position, profit
where does the attachto line of code go? in the init of game logic, or init of named unit(s)?
😄
'just casually relaxing awkwardly on the sofa ready for the next firefight' lol
then 
Do it revo 🤣
bruh...
if (local this) {this attachTo [logic,[0,0,0]]; << is this right?
) then { <- insert between them
bruh you guys have got me well and truly bamboozled, as you can tell i know minimal coding, but trying to learn what i can as i go along
'if (local this) then { attachTo [logic,[0,0,0]]'; << yay or nay or cry?
if (local this) then
{
this attachTo [logic, [0, 0, 0]];
};
so do i need to name that sofa lol
no
the sofa is references in "this"
but please rename logic to something like furb_logic
furb_logic is redundant, obsolete and useless, was thinking something more along the lines of 'r3vo_logic', makes more sense than i lol
😂
it looks like you re used to object oriented programming, where you can call the classes methods
if (local this) {attachTo [logic,[0,0,0]]; //attachTo called without left param
but sqf is procedural, there are no functions that already know what object to do stuff with.
Every single function has to be told what object it should have an effect on.
thats usually the left parameter
_myObject attachto [_target,_offset];
Hi so i have this amazing mod that has died and i'm getting an error thats causing the Bonnie hats to spawn halfway down the bodies it looks like this
Embedded skeleton OFP2_ManSkeleton in 'a3\characters_f_bootcamp\common\vr_solider_f.p3d' in different p3d files.
Skleton/model 'discloseafghandata\panamah.p3d' will probably not work corectly.
any ideas?
as far as i got, brain exploded halfway through 😂 😢
https://imgur.com/a/NDJYwLV
- it's not related to #arma3_scripting . see #arma3_model
- you're not allowed to modify someone else's work without their permission
Ok sir, i understand. I wasn't trying to modify it and i thought it was some glitch with some mod. Thanks for letting me know!
it requires a lot of work to be fixed anyway (it's using deprecated skeletons), so you're better off using some other mod.
@spark turret so this '_myObject attachto [_target,_offset];' gets put into the game logic? myobject is name of object? (player1), target is player name (player1) and offset is this 0,0,0 values?
With direct chat selected, it will be grey
With a different chat selected, you won't be able to have it appear there at all
When I have direct chat selected, and double click the map - it will appear there, but greyed out
If this isn't it then I don't fully understand the question
^ Anyhow, since we have now confirmed this is not a glitch, anybody knows this?
well you cant attach a player to itself
more like "crate01" = object, "truck" = target
Guys ( @little raptor @cosmic lichen @warm hedge @spark turret) making a unit attach to a sofa is absolutely impossible for me unless its given all in one simple to understand image, cant get my head past the principles and points, and parameters, just stumped, dumbfounded, dont want to waste your time (if one of yous could help with this id greatly appreciate it very much so) 😄
this is what I have
no direct channel
Select direct channel before placing a map marker
So on the bottom left of the screen it says "direct chat"
And the try placing a map marker
Confirmed. Thanks for the info @sharp peak
and any disabled channels?
Wdym? Mission I sjust editor with nothing but 1 unit, didn't disable any channels
- create a sofa. let's say it's named
my_sofa - in the init of the unit put this:
if (local this) then
{
this attachTo [my_sofa, [0, 0, 0]];
};
but preferably don't use inits at all
if you disable any channel does it show greyed out on the list?
Nope, if I disable the channels I am not able to select them therefor can't get them on the list
(If I remember correctly atleast)
yes, disabled channels don't appear at all
and if you select disabled channel
you mean select them first, then disable them?
because they don't appear anywhere
so you can't select them
or do you mean using a command?
nope, that won't work either
tried this:
1 enableChannel false;
setCurrentChannel 1
returns false
@unique sundial yep, this makes it appear:
select them first, then disable them
but greyed out
in other words:
1 enableChannel true;
setCurrentChannel 1;
1 enableChannel false;
so working as intended then
but I discovered a new bug!
#arma3_feedback_tracker message
@little raptor how did you do that? small screenshot insert marker photo previewed in discord? please
you just take a screenshot, crop it down and upload it here 🤔
bruh my brain.exe is not responding, its a gif on my desktop 😿
Upload to imgur and post link with description
i mean can this channel preview gifs, similair to the above screenshot?
only veterans and above can do that
ok, well here it is, thanks @little raptor @warm hedge @spark turret @copper raven for your part in trying to help, achievement unlocked ^^ 😂
https://i.imgur.com/TNhY5YL.mp4
Can someone link me to the wiki that lets you skip time via trigger n get the X amount of hours screen appear?
Also anyone have the two part code to link a UAV /mini zeus cam to a tv?
And third question..is it possible to have a popup appear on ayers screens like a custom video made n inserted into arma? That the zeus can toggle on n off?
@warm hedge the situation in that gif, is me dancing being overly happy (the guy dancing on coffee table and random loadout) about something thats very normal and mundane, (the guys in suits (represents you guys) sitting on sofa are boring to look at, but they feel/are confused, bewildered and not amused) (about the dancing guy (me) learning the attachto command, which, of course isnt anything special or a feat to celebrate) 😄
good job it didn't need much explaining
sarcasm or compliment, its not too clear
lol cant do what you can do lou
@finite sail thankyou for the sarcastic compliment nonetheless, very thoughtful gesture lol
🙂
Is it possible to use ctrlSetScale with a map control? I use ctrlCommit afterwards, but it doesn't seem to have an effect.
ctrlScale returns the value it has been set to, as if it had completed it successfully.
Even if it does work I don't recommend it
scaled map controls have some bugs
also, to scale ctrls, use ctrlSetPosition
not ctrlSetScale (I'm not sure if it works tbh; I've never used it)
is it possible to get the hovering helo above a scenario to sway and move slightly? this perfect hover is runing my immersive experience lol 😂
use unit capture
good point, forgot about that 👍
I was ultimately trying to get get ctrlMapAnimAdd to work with a scaled down control. I thought it could be fixed by going with ctrlSetScale, as I had been using ctrlSetPosition before and it wasn't centering properly.
yeah that's the bug I was talking about
I'm guessing it isn't possible to have it automatically center then?
with a simple command, that is
nope
well, big sad
thanks though!
every second or so, get it a little setVelocity in a random direction
makes it look much more natural
sorry to interrupt, but i have a problem: if i have 7 tasks on the map (let's call them task1 through task7), how would i make it so that if a group completes any 4 of the 7 it's a mission complete?
either have an increased count on each task completion, or on task completion check how many of those are completed
👍
@drifting girder an example of the latter:
lets say tasks are named: task_1, task_2, ... task_7
_cnt = 0;
for "_i" from 1 to 7 do {
_task = format ["task_%1", _i];
if (_task call BIS_fnc_taskState == "SUCCEEDED") then {
_cnt = _cnt + 1;
if (_cnt >= 4) then {
["END1"] call BIS_fnc_endMission;
break
};
};
};
```but the first method that Lou suggested is more efficient.
thanks a bunch!
Hi everybody, how to launch a rocket into a helicopter or airplane, spawned script, in order to simulate a shot from a tunguska or any other anti-aircraft weapon
in other words, I need create rocket, and launch to vehicle, and make it appear on the victim's radar
_target = _this select 0;
_startPos = _this select 1;
_missileType = _this select 2;
_missileHeight = _this select 3;
//defining parameters
//the faster the target, the more checks it will need 100 is good for fast moving targets such as aircrafts
_perSecondsChecks = 100;
//actual speed of a AIM-54 Phoenix AA missile
_missileSpeed = 6174;
_pos = [0,0,0];
//if no target is found -> exit
if (isNull _target) exitWith {hintSilent "No Target Found!"};
//create missile and setting pos
_pos = [_startPos select 0, _startPos select 1, _missileHeight];
//creating missile
_missile = _missileType createVehicle _pos;
//ajusting missile pos while flying
while {alive _missile} do {
if (_missile distance _target > (_missileSpeed / 10)) then {
_dirHor = [_missile, _target] call BIS_fnc_DirTo;
_missile setDir _dirHor;
_dirVer = asin ((((getPosASL _missile) select 2) - ((getPosASL _target) select 2)) / (_target distance _missile));
_dirVer = (_dirVer * -1);
[_missile, _dirVer, 0] call BIS_fnc_setPitchBank;
_flyingTime = (_target distance _missile) / _missileSpeed;
_velocityX = (((getPosASL _target) select 0) - ((getPosASL _missile) select 0)) / _flyingTime;
_velocityY = (((getPosASL _target) select 1) - ((getPosASL _missile) select 1)) / _flyingTime;
_velocityZ = (((getPosASL _target) select 2) - ((getPosASL _missile) select 2)) / _flyingTime;
_missile setVelocity [_velocityX, _velocityY, _velocityZ];
sleep (1/ _perSecondsChecks);
};
};```
I use this code for launch rocket at target
why do some animations not play? on radio command, instead of the animation playing, the unit just goes straight to prone, pulls out a primary weapon he doesnt have and stands up, and does nout?
the game has vector commands
use those instead
can you example?
_missile = createVehicle [_missileType, _pos, [], 0, "CAN_COLLIDE"];
_missile setPosASL _pos; //note: pos must be ASL
_missile setVectorUp [0,0,1];
_missile setVectorDir (_pos vectorFromTo aimPos _target);
_missile setVelocityModelSpace [0,300,0]; //init speed: 300 m/s
_missile setMissileTarget _target;
_missile setShotParents [_firedFrom, gunner _firedFrom];
_firedFrom is the vehicle that fired the missile
_pos must be in ASL format
_missileType is the type (classname) of missile
_target must be an object
also you should probably lead the target as well
can change Gravity from 9.8m/s^2 in eden or in config?
no
no??!!
uh
I don't know what to reply to that. Should I repeat what I said or.. what is the expected reply to that?
why ask a question if you are convinced you already know the answer?
I have no clue of the answer, thats why I asked
I just never consider anything isn't possible
Dedmen, this weeks lottery numbers please
I'm sorry, I forgot to say what I'm use Arma 2
again...
There probably are functions for vector subtraction. Use those instead.
Unfortunately you can't use the engine lock mechanism, so you'll need a loop.
I recommend using setVelocityTransformation to guide the missile
So I have a piece of code that is used to populate a listbox with vehicles for the player to use. Here is the code in question:
{
_weapcount = count getArray (_x >> "weapons");
{
if (_x isKindOf [ "SmokeLauncher", configFile >> "Cfgweapons" ]) then {
_weapcount = _weapcount - 1;
};
} forEach (getArray( _x >> "weapons" ));
if (_weapcount > 0) then {
spawnvehicles pushBack configname _x;
_entry = (_Display displayCtrl _lbvehicleselect ) lbAdd gettext ( _x >> "displayname");
(_Display displayCtrl _lbvehicleselect ) lbsetpicture [ _entry, gettext ( _x >> "picture") ];
(_Display displayCtrl _lbvehicleselect) lbSetCurSel 0;
};
} forEach (("(configName(_x) isKindOf 'Air') && (getNumber(_x >> 'scope') == 2)") configClasses (configFile >> "Cfgvehicles"));
My problem is that this code excludes 3 vehicles that I would like to appear in the list.
What is the best way to fix this?
Look at which vehicles your selection logic yields and investigate why the three vehicles you want don't meet your selection logic's criteria 🤷♂️
If I remove this part of the code
if (_x isKindOf [ "SmokeLauncher", configFile >> "Cfgweapons" ]) then {
_weapcount = _weapcount - 1;
};
They will appear. But so will a lot of other vehicles
Is there a way to make an exception of for just the 3 that I want to appear?
I'm quite new to scripting so I'm not really sure how such a thing could be done
you can hardcode them into the script. have an extra check for "myClassNameOfVehcile" and then push that one back
How could I pull a value out of a config into a clipboard. IE like getting the hit value from CfgAmmo class?
How would I point it to the proper cfg though? Is their API for navigating that?
Or can I just point right to CfgAmmo?
Oh wait, nvm there is code on Rithans post lol
in debug console type
utils 2
exec
then type CfgAmmo
enter
then browse it in similar way for values
This is amazing, thank you 😄
Is there a way to get the "mute status" for VOIP from the player-list via scripts ?
I want it to affect the text chat as well. 🤔
So each player can mute other players if he wants to
I killed the tool sadly, tried to pull all the cfgs with their inherted properties as well.
is there any advice how to create a 'build menu' for an object? In the MAAS mod we just place some trailers and wire but it would be nicer for players to do this with a build menu. See https://www.youtube.com/watch?v=plOxZSJLBiU for current operations
do you have maybe a real word example of the command? I'm currently trying to build mine but I have some values I have no clues on what to put: sqf _aircraft setVelocityTransformation [ getPos _aircraft, _destination, velocityModelSpace _aircraft, [0,10,0], vectorDir _aircraft, _nextVectorDir, // idk what will be the next vectorUp _aircraft, _nextVectorUp, // // idk what will be the next 1 ];
_destination is an array of coordinates. _aircraft is the helicopter object
@hollow lantern for some example for taxiing F-18 around, check https://tetet.de/arma/arma3/nimitz/experimental/missions/ambianceTest.altis.7z
I use it there like sqf _plane setVelocityTransformation [ getPosASL _plane, _pos2, [0, 0, 0], [0, 0, 0], vectorDir _plane, vectorDir _plane, [0, 0, 1], [0, 0, 1], 0.1 ];
uuuuh, I gonna check that, THANKS. My goal is basically to let a chopper peform a hard landing. Like a real life pilot would do.
basically this was my "first" sketch describing my situation https://i.imgur.com/hwqyoe1.png
what about https://community.bistudio.com/wiki/setVelocityModelSpace for in flight path manipulation?
I used setVelocity and flyInHeight back in 2013 in some missions ... but the sqf moved forward, luckily
yeah my math isn't that advanced, which is probably the reason for my struggle. Gonna see if setVelocityTransformation or setVelocityModelSpace fits
seems like setVelocityModelSpace could be the way to go, just need to figure that command out how to make it properly usable. Your implementation of setVelocityTransformation seems to work, but not as good as I hoped. It seems more static and built for moving on the ground. But that's probably because I don't use the command to it full extend
Hi, is there any way to check how many types of an item a person has in their inventory?
so depending on the item you could something like ```sqf
if ("ItemName" in (items _unit)) then
{
// script
};```
Thanks!
ah, my bad
"how many types of an item" what do you mean by that? "an item" is always the same item thus the same type?
How can the same item be different types?
he probably meant types of items
anyway, I guess it needs an arrayIntersect (to get unique items)
then getting the types (but again, what kind of types?)
then another arrayIntersect 
Better wait on explanation of what was actually meant instead of just throwing in random maybe solutions that probably don't solve the problem
I mean how many of that item
_items = items _unit;
_uniqueItems = _items arrayIntersect _items;
_itemCnts = _uniqueItems apply {
[_x, count _items - count (_items - [_x])];
};
What exactly will this do?
A specific item?
{_x == "itemName"} count items player
but, if you use ACE mod or similar mods where you have hundreds of item in inventory, that can get very expensive very quick
returns an array of what items and how many of them the unit has
in pairs
[item, cnt]
you got count backwards 
and your count is wrong too
Thanks for your help!
it's correct
and faster 😛
your cnt will be 1
true 😄

hello all
sorry if this is stupid or maybe im jumping into fast but im having a lot of trouble with markers
_artymissions = player getVariable ["artymissions", 0];
_markername = str format ["arty_marker_%1_%2", _artymissions, _side];
player onMapSingleClick {player setVariable ["artySelected", true]; player setVariable ["artyCooldown", true]; _artymarker = createMarker [_markername, _pos, 1]; _artymarker setMarkerShape "RECTANGLE"; _artymarker setMarkerBrush "DIAGGRID"; _artymarker setMarkerColor "ColorRed"; _artymarker setMarkerSize [300, 300];};
when i actually run a systemChat it does show that the marker name has increased, but it does not create a new marker except for the first one, which tells me that _artymarker = createMarker is reading _markername as the same as before or it is not getting assigned _markername
You trying to fill the line in your text editor 😄
_markername is a undefined varaible
in your onMapSingleClick
player onMapSingleClick
thats a syntax error. onMapSingleClick doesn't take a unit on left side (okey it could, but thats nonsense)
according to the wiki it does thats why iwas using it that way lol
yes you can pass a parameter
but the parameter you are passing is nonsense
you should rather pass the _markername as parameter, because that one you actually need
ah i see that makes more sense thank you
it seems i misread the wiki in my sleepless stupor, thanks for the help mate.
Is there any way to select map objects near you that aren't like... trees? like the brush on the ground.
nearestTerrainObjects
Hey guys, leaving this here before i am going to bed:
i wanted all passengers of my helo "h1" to get unconscious upon impact. I tried using a trigger which was activated when the helo touches down and that worked, but i can't make my passengers black out.
I tried fullCrew h1 setUnconscious true, but that didnt work.
I am quiet new to this, I will look back at this when i wake up. Hope you can help me.
this is an example from my FOB script ```sqf
_terrainObjects = nearestTerrainObjects [getPos _holder, [], 40];
the [] means it searches without a filter so it grabs everything from trees, rocks, bushes, buildings, etc
if you want to just search for bushes add "BUSH" inside the []
@errant swan these are objects that don't show up with nearestTerrainObjects
I'm setting up a script to cause a specific player to explode when they die on a chance (variables are currently set to maximise possibility for testing). The player will die early but no explosive is spawned or set off like I hoped. Any idea as to why?
/*
Author: Dev
Description:
Dreadnaught Explosion on Death
Parameter(s):
*/
_unit = _this select 0;
if (isServer) then
{
_unit addMPEventHandler ["MPHit", {params ["_unit"];
if (damage _unit > 0.01 and alive _unit) then
{
_var = selectRandom [0,1];;
if (_var == 0) then
{
_pos = _unit modelToWorld [0,0,0];
_unit setCaptive false;
_claymore = "TIOW_melta_bomb_placeable" createVehicle position _unit;
_claymore spawn
{
sleep 1;
_this setDamage 1;
};
_unit allowDamage true;
_unit setDamage [1, true];
};
};
}];
};
to explode when they die
it doesn't do what you said at all
_var = selectRandom [0,1];;
if (_var == 0) then
if (random 1 >= 0.5)
createVehicle position
don't use position
This runs when they take any damage
Yes. That’s to make it happen immediately rather than after I chunk their health pool
no it doesn't.
if you want it to happen immediately after their death use "killed" event handler
Script activates upon the target taking damage in excess of 0.01
what this does is randomly spawn an explosive if the unit has taken more damage than 0.01 and they're alive
They are a modded unit so have a significantly larger health pool
It spawns it in and kills them
I changed it to work with testing, I’m focussed on getting the explosive to spawn at all
I know the kill trigger is activating not the explosive
are you sure that is the class name?
also don't forget to replace position with that _pos variable
how can enable a player to keep moving and shooting when i create a cam for them?
I'm getting a "missing ;" error now:
if (isServer) then
{
_unit addMPEventHandler ["MPHit", {params ["_unit"];
if (damage _unit > 0.01 and alive _unit) then
{
if (random 1 >=0) then
{
_pos = _unit modelToWorld [0,0,0];
_unit setCaptive false;
_claymore = "TIOW_melta_bomb_placeable" createVehicle _pos _unit;
_claymore spawn
{
sleep 1;
_this setDamage 1;
};
_unit allowDamage true;
_unit setDamage [1, true];
};
};
}];
};```
Supposedly on the _claymore = bomb line
@half spear you shouldnt use "and" in your if do this instead ((damage _unit > 0.01) && (alive _unit))
Ok I fixed that one up as well
is it working now?
Giving it a test rn
_claymore = "TIOW_melta_bomb_placeable" createVehicle _pos _unit
That line is wrong,
_pos and _unit are both variables, you only need _pos there.
"TIOW_melta_bomb_placeable" createVehicle _pos
Which means the TIOW_melta_bomb_placeable vehicle is created at the nearest empty position to _pos
I fixed that thanks to Jimbo but it still isnt working
if (isServer) then
{
_unit addMPEventHandler ["MPHit", {params ["_unit"];
if ((damage _unit > 0.01) && (alive _unit)) then
{
if (random 1 >=0) then
{
_pos = _unit modelToWorld [0,0,0];
_unit setCaptive false;
_claymore = "TIOW_melta_bomb_placeable" createVehicle _pos;
_claymore spawn
{
sleep 1;
_this setDamage 1;
};
_unit allowDamage true;
_unit setDamage [1, true];
};
};
}];
};```
do you get an error?
Nope
Does the player die?
it was correct
Make sure the classname is correct, you want to be spawning the cfgammo variant not cfgweapon or cfgmagazine
The _placeable gives it away as probably a magazine class rather then an ammo class
I'm trying to spawn the variant that is accessible from the editor, not entirely sure which one that is
That would be the magazine varient
It is under the explosive category
If you place it in the editor, then right click on it and click Find in config viewer IIRC what parent class is it under?
have a look on the right hand side and look for an ammo = line
I am creating an external camera for a few seconds for the player but i would like them to be able to keep moving and shooting while viewing the camera. how can i do this?
I'm looking to call that class name?
That's the classname you want to spawn
use animations + forceWeaponsFire (or Fire)
Thanks I'll give that a shot
somthing is wrong with this, it works if i use it in the ingame console, but if i exec it over ini, it fails with "undefined variable" for the marker_isp. its a normal elipse marker.
hqblu = [marker_isp, 500, 500, 10, 0, 0, 0] call BIS_fnc_findSafePos;
You can use switchCamera to keep key presses working for players, but it blocks mouse button inputs so you'll need to hand them yourself.
@verbal saddle @little raptor thanks
Have a look at KK's note for an example
https://community.bistudio.com/wiki/switchCamera#Notes
Still no dice 😦
if (isServer) then
{
_unit addMPEventHandler ["MPHit", {params ["_unit"];
if ((damage _unit > 0.01) && (alive _unit)) then
{
if (random 1 >=0) then
{
_pos = _unit modelToWorld [0,0,0];
_unit setCaptive false;
_claymore = "TIOW_melta_bomb_placeable_Ammo" createVehicle _pos;
_claymore spawn
{
sleep 1;
_this setDamage 1;
};
_unit allowDamage true;
_unit setDamage [1, true];
};
};
}];
};
thanks!
your classname is not valid then.
put a systemChat after you create _claymore:
systemChat str _claymore
it probably returns null
systemChat outputs to the chat box
yeah nothing came up?
if (isServer) then
{
_unit addMPEventHandler ["MPHit", {params ["_unit"];
if ((damage _unit > 0.01) && (alive _unit)) then
{
if (random 1 >=0) then
{
_pos = _unit modelToWorld [0,0,0];
_unit setCaptive false;
_claymore = "TIOW_melta_bomb_placeable_Ammo" createVehicle _pos;
systemChat str _claymore;
_claymore spawn
{
sleep 1;
_this setDamage 1;
};
_unit allowDamage true;
_unit setDamage 1;
};
};
}];
};```
if (random 1 >=0)
???
Based it off this
_pos = _unit modelToWorld [0,0,0];
???
makes the position 0,0,0 relative to the unit
I am quite sure R3vo knows what it does; the ??? is more a "why?"
I want it be to be true for testing as I'm not testing the chance I'm testing if the explosive will spawn, which it isnt
put a systemChat everywhere
are you sure your MPHIt even tirggers?
the 0,0,0 is just because I based it off another script that was for 1m ahead, looking at it now I don't need it
According to the code I'm basing it off of (TIOW Necrons) it does
if (isServer) then
{
_unit addMPEventHandler ["MPHit", {params ["_unit"];
if (damage _unit > 0.1 and alive _unit) then
{
_var = selectRandom [0,1,2,3];;
_unit setObjectMaterialGlobal [1,"TIOW_NecronWarrior\Data\TIOW_NecronWarrior_Wound.rvmat"];
_unit allowDamage false;
_unit setCaptive true;
[_unit, ("TIOW_NecronWarrior_ReanimateDown"+str(_var))] remoteExec ["switchMove", 0];
_unit disableAI "ANIM";
if (_var == 0) then
{
_unit setCaptive false;
_unit allowDamage true;
_unit setObjectMaterialGlobal [1,"TIOW_NecronWarrior\Data\TIOW_NecronWarrior_Dead.rvmat"];
_unit setDamage [1, true];
} else {
[_unit, _var] spawn
{
params ["_unit", "_var"];
sleep (5 + random 30);
[_unit, ("TIOW_NecronWarrior_ReanimateUp"+str(_var))] remoteExec ["switchMove", 0];
_unit setDamage 0;
_unit setCaptive false;
_unit enableAI "ANIM";
sleep 5;
_unit setObjectMaterialGlobal [1,"a3\data_f\lights\car_panels.rvmat"];
[_unit, "TIOW_NecronWarrior_idle_rifle"] remoteExec ["switchMove", 0];
_unit allowDamage true;
};
};
};
}];
_unit addMPEventHandler ["MPKilled", {params ["_unit"];
if (!alive _unit) then
{
_unit setObjectMaterialGlobal [1,"TIOW_NecronWarrior\Data\TIOW_NecronWarrior_Dead.rvmat"];
};
}];
};```
Necron revival script
brb
```sqf plz 👀 (see pinned message)
_unit = _this select 0;
if (isServer) then
{
_unit addMPEventHandler ["MPHit", {params ["_unit"];
if (damage _unit > 0.1 and alive _unit) then
{
_var = selectRandom [0,1,2,3];;
_unit setObjectMaterialGlobal [1,"TIOW_NecronWarrior\Data\TIOW_NecronWarrior_Wound.rvmat"];
_unit allowDamage false;
_unit setCaptive true;
[_unit, ("TIOW_NecronWarrior_ReanimateDown"+str(_var))] remoteExec ["switchMove", 0];
_unit disableAI "ANIM";
if (_var == 0) then
{
_unit setCaptive false;
_unit allowDamage true;
_unit setObjectMaterialGlobal [1,"TIOW_NecronWarrior\Data\TIOW_NecronWarrior_Dead.rvmat"];
_unit setDamage [1, true];
} else {
[_unit, _var] spawn
{
params ["_unit", "_var"];
sleep (5 + random 30);
[_unit, ("TIOW_NecronWarrior_ReanimateUp"+str(_var))] remoteExec ["switchMove", 0];
_unit setDamage 0;
_unit setCaptive false;
_unit enableAI "ANIM";
sleep 5;
_unit setObjectMaterialGlobal [1,"a3\data_f\lights\car_panels.rvmat"];
[_unit, "TIOW_NecronWarrior_idle_rifle"] remoteExec ["switchMove", 0];
_unit allowDamage true;
};
};
};
}];
_unit addMPEventHandler ["MPKilled", {params ["_unit"];
if (!alive _unit) then
{
_unit setObjectMaterialGlobal [1,"TIOW_NecronWarrior\Data\TIOW_NecronWarrior_Dead.rvmat"];
};
}];
};```
This isnt mine
This is what I'm basing it off
_unit = _this select 0;
if (isServer) then
{
_unit addMPEventHandler ["MPHit", {params ["_unit"];
if ((damage _unit > 0.01) && (alive _unit)) then
{
if (random 1 >=0) then
{
_pos = _unit modelToWorld [0,0,0];
_unit setCaptive false;
_claymore = "TIOW_melta_bomb_placeable_Ammo" createVehicle _pos;
systemChat str _claymore;
_claymore spawn
{
sleep 1;
_this setDamage 1;
};
_unit allowDamage true;
_unit setDamage 1;
};
};
}];
};```
This is mine
Anyone know the class name for an easy explosive, I'll attempt a test with that
Here's a simple version that works,
_unit addMPEventHandler ["MPHit",
{
params [["_unit", objNull, [objNull]]];
if (random 1 >= 0.8 || true) then
{
private _claymore = createVehicle ["DemoCharge_Remote_Ammo", getPosATL _unit, [], 0, "CAN_COLLIDE"];
_claymore setDamage 1;
_unit setDamage 1;
};
}];
When the unit gets hit > if the random check passes or true (for testing), then it spawns the bomb, blows it up and kills the player to make sure they are dead.
You can add to the condition to change when it triggers and you can add to when it does trigger.
Then once you have finished testing remove the || true which will mean it only runs if the rest of the condition returns true
Yes, I've tested it
This EH is clever enough to be triggered globally only once even if added on all clients or a single client that is then disconnected, EH will still trigger globally only once.
doesn't this mean it triggers only once?!
because I thought that's what it means 
yep, still not working. Has to be the unit then?
how are you even testing it?
the script is attached to the vehicle (unit) through a addon config and then I go to a virtual arsenal and shoot the bastard
the script is attached to the vehicle (unit) through a addon config
wat?
I made a mod and the vehicle references the script
how exactly?
class CfgVehicles
{
class WBK_DT_5;
class Exploding_Dreadnaught_CONS:WBK_DT_5
{
scope = 2;
scopeArsenal = 2;
scopeCurator = 2;
displayName = "CONS Dreadnought (Exploding)";
class EventHandlers
{
init = "_this execVM '\Dreadnaught_go_BOOM\Scripts\DreadnaughtExplosionScript.sqf';";
};
};
};```
Things can never be simple hahaha
Have you checked to make sure it's actually running the file?
for compatibility you have to use sub-classes
Have you checked to make sure it's actually running the file?
i have a trigger that when players enter it activates and should execute
[introplane] spawn BIS_fnc_planeEjection
but nothing happens? I looked up the wiki and im a bit confused how BIS_fnc_planeEjection even works...
I just made some sideChat checks, so lets see
Parameter(s):
_this select 0: mode (Scalar)
0: plane/object
wat?!
i dont.. know, someone said they used that to create a script that ejects players from a plane....but
idk
so like even just [] does nothing
that wat wasn't for you
i see
I mean what on earth is that?!
zero clue xd
better open the function file (or in function viewer) and see yourself
Ok so, checks say the script is loading, the if statement isnt
_unit = _this select 0;
[west, "HQ"] sideChat "Script loaded"; /* appears*/
_unit addMPEventHandler ["MPHit",
{
params [["_unit", objNull, [objNull]]];
if (random 1 >= 0.8 || true) then
{
[west, "HQ"] sideChat "Script executing"; /* Does not appear */
private _claymore = createVehicle ["DemoCharge_Remote_Ammo", getPosATL _unit, [], 0, "CAN_COLLIDE"];
_claymore setDamage 1;
_unit setDamage 1;
};
}];
(i think my best bet is to check if theres scripts in dynamic recon ops pbos, because i know that mission ejects you from a plane)
instead of _unit = _this select 0 use params ["_unit"]
perhaps not a good wording. Gonna think of a better way to say it
player setUnconscious true forEach fullCrew h1;
player setvariable ["ACE_isUnconscious", true, true] forEach Crew h1;
I was trying to get all passengers to go unconscious, thanks to you it worked, but now i want them to wake up again after, say 30s.
The passengers will be ejected right after this line.
Changed it and now both checks are failing
that doesn't even work
did you put ; after it?
Im sorry, im new to this
then why did you say:
thanks to you it worked
?
well somehow it did
yeeees
that literally means the same thing (but even more robust)
if it doesn't work the problem is somewhere else
well the passengers get unconscious, but i don't know how to make them wake up again
use this then:
_crew = crew h1;
{
_x setUnconscious true;
_x setvariable ["ACE_isUnconscious", true, true];
} forEach _crew;
_crew spawn {
sleep 30;
{
_x setUnconscious false;
_x setvariable ["ACE_isUnconscious", false, true];
} forEach _this;
};
Thank you, sorry for the inconvenience xD
"ACE_isUnconscious", false might not be enough to trigger a wakeup. If it doesn't work you might need to adjust the script
I think it did (at least in SP) 
but I don't remember very well
the statemachine transition might only be triggered by event. I fiddled with that last week
oh
["ace_medical_wakeup", player] call CBA_fnc_localEvent;
yeah I think it checked constantly before
that event alone wakes them up then?
or is there more?
also what about becoming unconscious?
that variable alone still doesn't trigger the event right?
hey, so I made a script for calling in fire support, and I want the script to hold between each action, Im not sure if Im saying it right, can anyone help me?
[west, "FireBird 2-1"] sideChat "Target aquired, going in for attack";
// wait 30 sec
[west, "FireBird 2-1"] sideChat "Rifle";
// wait 20
scriptedCharge = "2Rnd_Missile_AA_04_F" createVehicle (laserTarget jtac1);
So my question is what to add insted of the //wait for it to acutely wait.....
(sorry if my question is very dumb, Im still learning all😅 )
sleep
sleep and then like how much time? like sleep 20 ?
thx so much!
okay so i can seem to figure out how to just tell the ai to drive this plane and have players eject.. even if i dont make a script that ejects players, and i do it manually the ai says like get back in the vehicle, and then plummets down.. and i really dont wanna record the movement cuz i suck at flying xd
Have you tested this at all? I'm not sure that syntax for sideChat will work.
no luck trying to dig through DRO pbos, i cant find the script for ejecting players
and i think theres no way to do this via waypoints? all waypoints seem to tell the plane to land
do you mean with ejection seats?
no
if you just want to throw them out use moveOut
i mean like halo jump
no yet tbh....
When using the [side,"identity"] syntax, the identity string must be an identity that exists in CfgHQIdentities, and I don't think "Firebird 2-1" is one
use moveOut then
i'll try, hopefully the ai driver doesnt freak out again
it just kicks them out
it has nothing to do with the driver
its defiantly not lol.... so where can I check which ones are I can use?
yeah, but if i for example eject... like..double tapping v, the driver freaks out and starts plummeting down to get players
If the driver is in the same group as the players, make them not
the driver shouldn't be in the player's group
also use unassignVehicle
so the AI don't "call" the heli back
nvm found it
The wiki page for sideChat. You can also give it a unit instead of an HQ string, and then that unit's callsign (groupID) will be used.
ok, thx 🙂
Note the arrangement of parameters for the unit-based syntax is different, e.g. you don't need the side param. See the wiki page for details
ai is in alpha 1-3, players are in alpha 1-1
Also also, if this is a multiplayer script, you'll [Tapoz] need to make sure it's locality-safe as many of the commands you're using are local (either they only take effect on the client that executes them, or they only have an effect when executed where the target is local)
rn its for SP.....
That's fine then
Is there a way to have dynamic text on a bilboard or something? Like some kind of ingame console. I want to display some text that is dynamically set during the mission. One way could be 3D icon, but it is a bit derpy solution
You could choose from a set of premade textures with various options. I don't think you could do fully dynamic text without setting up the billboard to use the license plate system or something, and that would be a mod
I have no clue then
params ["_unitD"];
[west, "HQ"] sideChat "Script loaded";
_unitD addMPEventHandler ["MPHit",
{
params [["_unitD", objNull, [objNull]]];
if (random 1 >= 0.8 || true) then
{
[west, "HQ"] sideChat "Script executing";
private _claymore = createVehicle ["DemoCharge_Remote_Ammo", getPosATL _unitD, [], 0, "CAN_COLLIDE"];
_claymore setDamage 1;
_unitD setDamage 1;
};
}];
did you use sub-classes as I said?
I dont know how to do that
Ty
Is there a way to check the reload state of a tank gun
since the gun cant be fired when it's reloading a new round after firing
pretty sure there is no other way other than using a fired EH and taking the delta afterwards, e.g reload time - (time now - shot at) max 0, if you don't care about the reloading time, maybe try https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Reloaded
allthough im guessing that EH won't work, as you're reloading a round not the entire mag
The Reloaded EH only fires after the act and yes, it should only fire for magazines.
*ahem* may I interest you in a setWeaponReloadingTime?
https://community.bistudio.com/wiki/setWeaponReloadingTime
I believe unitReady says false when "can't fire"
Might be able to grab the reload time from the config and use that together with the Fired EH to establish at least a time span where the main gun is definitely reloading.
I have a question:
How do i set up a infantry unit as live target?
Similar to how it´s done in the VR Arsenal for the player, i would like to set up a target range with respawning infantry targets which go on alert/keep standing and respawn.
Would i need some scripting or can i do everything in the editor with some modules or ?
scripting - this is the way
(As I already told you)
;_;
?
unitReady doesnt have that behaviour
setWeaponReloadingTime doesnt work
it does nothing
Yeah, as the name suggests it sets not gets
it doesnt even set
It does
it doesnt
It does
That's not how to do use that command. It “re-sets” your rechambering time
tried that aswell
Not magazine reloading, but rechambering
i fired the weapon, set the reload to 0 as it was reloading, and nothing happened
YES
the rechambering does not get effected by it
no matter if i do it before or after i shoot
Then you might passing the argument wrongly
vehicle player setWeaponReloadingTime [player, currentMuzzle (player), 0.0];```
i'm passing that
as the gunner of the vehicle
currentMuzzle player != currentMuzzle vehicle player
vehicle has no muzzle
It has
it doesnt
the muzzle of the player is the string of the muzzle
the muzzle of the vehicle is an empty string
go figure
even the example script gets the muzzle of the gunner
_success = _vehicle setWeaponReloadingTime [gunner (vehicle player), currentMuzzle (gunner (vehicle player)), 0.5];
not the muzzle of the vehicle
using the "muzzle of the vehicle" fails the command, returning false
the command im using returns true
but has no effect
Ah sorry I'm remembering wrong indeed
Aaaand... I guess the _vehicle is not defined on your end so it's not working? Otherwise it's working correctly
^
check the command
^
that is the example script
wha?
read the script i sent that im using
this here is the script that im using^
the one youre quoting is the example script
Couldn't see where's the difference between yours?
read the context
vehicle player not _vehicle
vehicle player returns the vehicle the player is in
vehicle player setWeaponReloadingTime [gunner (vehicle player), currentMuzzle (gunner vehicle player), 0];```
New stuff for HashMaps, feedback please
createHashMapFromArray [[key,value],[key,value],...] already existed.
[key, key, ...] createHashMapFromArray [value, value, ...] new alt syntax.
in alt syntax, both keys and values arrays need to be same size. Otherwise it will return empty hashmap.
New
toArray hashMap returns [[key, key, ...],[value, value, ...]]
hashMap toArray true returns [[key, key, ...],[value, value, ...]] (its just an alias and internally just calls toArray hashMap
hashMap toArray false returns [[key,value],[key,value],...] (This is performance wise inefficient, as engine needs to create tons of small arrays
Example
toArray hashMap params ["_keys", "_values"]
Current code
hashMap insert [[key,value],[key,value],...]
New alt syntax
hashMap insert [true, [key, key, ...],[value, value, ...]]
hashMap insert [false, [key,value],[key,value],...] (alias to current insert command)
More info: #community_wiki message
I'm still writing the code so now's the time for feedback. But I think this is the best solution
what vehicle, weapon and seat are you trying to set?
@still forum i used it in my scripts, rly good thing - didn't find errors yet 👍
interesting thing - u can use it like JSON - something like map in map, works good
will be nice to have syntax (analog for get command - map.key or map.[key,defaultValue]) - something like work objects in js
would be potentially nice, but won't do
it would be map."key" though right? 😄
yep
map.(configFile >> "cfgVehicles") map.{hint "hi";} how weird does that look xD
myMap.get(configFile >> "CfgVehicles"); // Java
myMap[configFile >> "CfgVehicles"]; // PHP

HAI 1.2
CAN HAS ARMA?
I HAS A HASHMAPZ ITZ MAPZ configFile >> "CfgVehicles"
KTHXBYE
LOLCODE anyone? 🤣
😒
hey guys, i've created a "missionScore" variable in my mission's init but i'm not exactly sure how to make it so that it goes up when an objective is completed
i know it's missionScore = missionScore + 1 but i'm not exactly sure where to put it
@drifting girder give this a read to help you understand how to understand how they work.
https://community.bistudio.com/wiki/Variables
You would change the variable in a trigger or in your code that gets fired when the objective is complete.
I created a cam using camCreate that orbits the player for a few seconds. issue is that it looks choppy when player is moving or in vehicle moving. Even though im getting 70 FPS. camera shake is off but it still looks glitchy. is there something i can do to smooth it out?
Nope, unless we see an issue with your code
v_feature_144_cam = "camera" camCreate _destination;
v_feature_144_cam camSetPos _destination;
v_feature_144_cam camSetTarget _player_object;
v_feature_144_cam cameraEffect ["External", "FRONT"];
v_feature_142_cam camSetFocus [-1, -1];
v_feature_144_cam camCommit 0;
v_feature_144_cam switchCamera "Internal";
showCinemaBorder false;
private _degree = 0;
while {!(v_feature_144_cancel)} do
{
if (_degree >= 360) then
{
_degree = 0;
};
_destination = _player_object getRelPos [_maxLength, _degree];
_destination = [_destination select 0, _destination select 1, ((getPosASL _player_object select 2) + (_maxHeight + 5))];
v_feature_144_cam camSetPos _destination;
v_feature_144_cam camSetTarget _player_object;
v_feature_144_cam camCommit 0;
_degree = _degree + 0.5;
sleep (accTime / (diag_fps * 2));
};
@exotic tinsel
- Try setting camCommit after camSetTarget to 0.01 or 0.005 based on ur preference.
- getPosVisual _player_object instead of _player_object might help.
Out of topic: Is there a reason why among 144s , there is a 142 there on camSetFocus line?
sleep (accTime / (diag_fps * 2)); -> sleep 0.001;
_degree = _degree + 0.5; -> _degree = _degree + 0.5 * accTime;
Hello guys, i am trying to create a "railguard" for a bridges made from Airstrip platform
i want it to be spawned from script to reduce size mission file. Any idea how to do it?
i tried this but this is probably not the way...
private ["_bridge","_most","_pos","_guard1", "_guard2","_guard3"];
{
_bridge = [];
{
_most = {getPos _x } forEach (nearestObjects [[9000,9000,0], ["Land_AirstripPlatform_01_F"], 999999]);
_bridge pushBack _most;
};
{
_guard1 = createVehicle ["Land_Concrete_SmallWall_8m_F", _bridge, [], 0, "NONE"];
_guard2 = createVehicle ["Land_Concrete_SmallWall_8m_F", _bridge, [], 0, "NONE"];
_guard3 =createVehicle ["Land_Concrete_SmallWall_8m_F", _bridge, [], 0, "NONE"];
} forEach _bridge;
};
and i want those railguards in relative position for each object. so it wont take surface level and will be parallel to that object surface
@gleaming imp Check the pinned message for code formatting.
@crude vigil
thank you and 144 is for the feature this code belongs to.
@winged wing thank you
Can you explain how this code is intended to work, i.e. what steps it takes to achieve the goal?
@crude vigil @winged wing
I applied both of your suggestions but unfortunately it did not help. Here is a vid of what is happening.
https://imgur.com/a/vdsq31U
the camera is till glitchy even though the fps is high.
Probably because of camCommit 0.
You keep teleporting the camera instead of letting it smoothly glide to the next position.
i have in eden created bridge like xxx same textures
I want to create on each of those platforms something like a roadguard.
i want to create it for one object and repeat it for every object "platform" on map
like using "attachTo"
https://gyazo.com/27775ad4fedeeadbdc83ac79fa6aa79a
link for what i am trying to create
Okay, now, what is _most used for?
Hey guys can anybody help me with this? I would like to have this work with a trigger defining the area instead of a area marker .. But simply changing the area marker to a trigger doesnt work :/
private _myWhiteList = ["782485734"];
while {true} do
{
{
if (!(getPlayerUID _x in _myWhiteList) && (_x inArea "zoneA")) then
{
_x setPos getMarkerPos "zoneTP";// or getPos "zoneB", depending on what the zones are
};
} count allPlayers;
sleep 0;
};```
P.s. I read inArea on the BIKI but couldnt quite figure it out
_x inArea MyTrigger
```Should work though, provided your trigger is referenced by `MyTrigger`. What did you try?
he has a string in there leftover from a marker
thats probably why
_x inArea "zoneA"
_x inArea zoneA
posted a link what i am trying to do
_most should have gather locations of objects "Land_AirstripPlatform_01_F" from center (almost center) of map within 999999 radius
Does your bridge span two million meters? 🤨
its just for testing 😄
The first problem is that you don't modify anything in the first forEach loop. Have a look at https://community.bistudio.com/wiki/apply instead.
Will give that a go @willow hound & @copper raven thanks 🙂
@exotic tinsel isnt camSetTarget always targeting player, why is it inside while? If you remove it , it will be fixed most likely. This issue is happening because you are spamming camSetPos and camSetTarget together.
@copper raven @willow hound yeah fixed it, cheers guys! Needed the " " removing! 😄
@crude vigil still not fixing it. here is the code in its entirety with the change suggestions by you and others.
https://pastebin.com/ZeKsWEqL
its because cam target is the person and not the tank iirc
@copper raven its the tank.
ah didn't read the pastebin, _player_object 😄
yeah i just fixed the naming to be be _object so its not miss leading.
https://pastebin.com/nC1RGWAb
{
private _platform = _x;
private _platformDirAndUp = [vectorDir _platform, vectorUp _platform];
{
private _wall = createVehicle ["Land_Concrete_SmallWall_8m_F", [0, 0, 0], [], 0, "CAN_COLLIDE"];
_wall setVectorDirAndUp _platformDirAndUp;
_wall setPosASL AGLtoASL (_platform modelToWorld _x);
} forEach [[5, -5.8081055, 13.806], [-5, -5.8081055, 13.806], [-5, 5.8081055, 13.806], [5, 5.8081055, 13.806]];
} forEach allMissionObjects "Land_AirstripPlatform_01_F";
try camCommitting the same time you sleep? @exotic tinsel
@copper raven uh thats not a function. i do use camCommit in the while before the sleep.
i meant the exact same delay as your sleep, you commit for 0.01, but sleep for a different amount, whatever that is, doesn't make sense
testing now
no improvement unfortunately. i have to be doing something fundamentally wrong.
yeah, i'd go unscheduled, and move a degree per frame, committing the delay i want, then doing the same thing some frame in the future when the camera has committed (https://community.bistudio.com/wiki/camCommitted)
@exotic tinsel It works fine if you set camCommit to higher value...
tried with 0.5, 0.25,0.1
what degrees?
didnt change it
sleep time and camCommit do not need to be same. You can camCommit a new camera position before previous camCommit is done, that is how you achieve smoothness, otherwise you would just be waiting for it to finish and then be changing position which would have some sort of tick-tocking effect of a clock hanged on a wall.
Is it possible to prevent a player changing weapon attachments in the vanilla inventory but still allowing the likes of the ACE3 interaction menu to change attachments? If so would it be done using an eventhandler of some sort? 🤔
@exotic tinsel Be careful though, if you change timeAcceleration to interesting values, it may be obvious it is not exactly drawing a perfect circle around it (cos vehicle is moving so the rotation effect becomes a bit imperfect. To perfect it , you would need another while loop that camCommit spamming the new value from max value you define to as closest to 0. But I wouldnt suggest it as it is unnecessarily too much computation there.
Just make sure you test any potential timeAcc value you can have in your mission. Just saying because for some reason u bound your values to timeAcc...
Hi guys i've finally tested my mission today with a friend and came a cross a couple of bugs but one of them was weird, i couldn't hear my friend shooting and he couldnt hear me shooting. any one knows why this is 🤔
Did you set the volume to 0? 🤣
it was a joke
i know
he he
Sound was fine, i heard the bullet impact just not the shooting lol.
if I have 10 units all on the blufor side, if I do
blufor setFriend [blufor, 0];
will it make it so that
a) when a blufor kills a blufor, it wont be deemed "friendly fire"
b) players cannot see each other on the map, nor can they see blufor vehicles
a) probably will be counted as friendly fire (AI saying hold fire)
b) probably visible on map too.
damn
i will test it out to know for sure
but here is my current dilemma
a) I need to make it so that when players kill each other it is not considered friendly fire
b) players cannot see blufor vehicles on the map
c) players can open all crates (which are on the civilian side)
currently I have all players on the civilian team
any ideas?
@past wagon setRating -10000 ? ^^
wouldnt that be the same thing as
civilian setFriend [civilian, 0];
?
I know even if u setFriend 0 a civilian, no one will attack them, altho I never tried civilian to civilian, maybe it is a different scenario...
so probably no.
setRating below a level puts those now sinners into a faction called sideEnemy
ok
also this isnt for AI
this is for multiplayer
@crude vigil if I put
player addRating -10000;
in initServer.sqf, will that set the rating for all players who join the game?
initPlayerLocal.sqf or something like that...
@crude vigil am i supposed to be creating a new camera over and over?
@exotic tinsel No?
@crude vigil I still can not get a smooth ride even with the suggestions. its really bad if im flying.
the faster the vehicle is , that issue will occur more severly so you ll need to give more time. Alternatively, if you change your method of calculation, you may use getPosVisual instead of getPosWhateverYouUse, which I believe could smoothen that.
But still will not solve your issue 100%
//ADD NEGATIVE RATING
player addRating -10000;
//PLAYER SPAWN RANDOMIZATION
_randomPlayerSpawn = [nil, ["water", "EndZone"]] call BIS_fnc_randomPos;
_playerSpawnX = _randomPlayerSpawn select 0;
_playerSpawnY = _randomPlayerSpawn select 1;
player setPos [_playerSpawnX, _playerSpawnY, 500];
this is all that i have in initPlayerLocal.sqf and it works fine except when players join the mission in progress. Their position does not get set to a random point. they just stay where they are
It is probably because the code executes before player becomes an entity.
meaning.. you need to wait till player actually becomes player. which can be checked with isNull player iirc.
Why does killing a OPFOR operator return CIV?
addMissionEventHandler ["EntityKilled", {
params ["_unit", "_killer", "_instigator", "_useEffects"];
systemChat format['%1', side _unit] ;
}];
Because all dead people become civilians.
oh.
welp his day is ruined
maybe for each unit, set their side to a variable, and when they die, check the variable?
handleDamage, see if calculated damage sets it to 1
@crude vigil i agree the getpos method seems to be the problem. Im using getRelPos which enables me to get a position x meters and x degrees away from object. Do you know the maths for calculating a 10m and 20degrees from a an asl pos? or a link to such maths
My support here does not involve math 
lol rgr
Otherwise I tried it on your code without putting too much time on it.
but lost consistency so I gave up.
but it only happens when a player joins the mission when it is already in progress. same answer?
Wouldnt hurt trying right? I dont see any other answer given that you could try.
I have a guess why it could be happening only to JIP but I am not a mission maker.
ok
remoteExec [systemChat "asdfasdfasdfasdfasdf"];
would that show the message for all players?
"asdfasdfasdfasdfasdf" remoteExec ["systemChat"];
okay, so would I do it like this:
if !(isNull player) then {
_randomPlayerSpawn = [nil, ["water", "EndZone"]] call BIS_fnc_randomPos;
_playerSpawnX = _randomPlayerSpawn select 0;
_playerSpawnY = _randomPlayerSpawn select 1;
player setPos [_playerSpawnX, _playerSpawnY, 500];
}
else {
???
};
I dont know what to put for the else statement
i would need it to return to line 1
waitUntil {!isnull player};
//ADD NEGATIVE RATING
player addRating -10000;
//PLAYER SPAWN RANDOMIZATION
_randomPlayerSpawn = [nil, ["water", "EndZone"]] call BIS_fnc_randomPos;
_playerSpawnX = _randomPlayerSpawn select 0;
_playerSpawnY = _randomPlayerSpawn select 1;
player setPos [_playerSpawnX, _playerSpawnY, 500];
actually you need to do it at the very beginning (code edited)
@past wagon If it still doesnt work, go to #arma3_scenario as it is a problem about it.
Does anybody here have a simple example of setVelocityTransformation? The ones on BIki are a bit complicated and my google-fu didn't yeld any satisfying results. I think what I have problems with is getting the interval.
I want to smoothly move object from one place to another, nothing fancy.
For vertical crashes I would use something like this
https://pastebin.com/qQsMY0MQ
It basically slows down the helicopter gradually in z axis so it looks natural
However, if your helicopter is moving forward very fast, it would still crash, so you would need to gradually slow down the x and y axes as well
hey guys can i tweak this script so when a building gets to a specific damage level it will auto repair?
_vehicle = (_this select 0);
_h = [_vehicle]spawn
{while {true} do
{ if ((getDammage (_this select 0)) < 0.15) then
{ (_this select 0) setDammage 0;};
sleep 120;};};```
```sqf
_x allowDamage false;
} foreach (nearestObjects [[15023.9,17600.6,0], ["house"],10000,true]);```
long story short we are having the issue of not being able to shoot out of building windows
To its most basic form, setVelocityTransformation is supposed to be used like this (I hope):
private _interval = 0;
private _increment = 1e-2;
private _refreshTime = 0.01;
while{_interval<1}do
{
_object setVelocityTransformation
[
_startingASL,
_endASL,
_startingVel,
_endVel,
_startingDirV,
_endDirV,
_startingUpV,
_endUpV,
_interval
];
_interval = _interval+_increment;
sleep _refreshTime;
};
Then you play around with _refreshTime and _increment to change the speed with which the transformation is performed
Is there a way to keep custom loadout on death ?
sleep 1085;
while { true } do {
waitUntil { sleep 1; alive player };
systemChat "You are taking heavy damage because you are not inside the safe zone!";
if !(player inArea "SafeZone") then {
player setDamage (damage player + 0.05);
};
};
will this only notify the player who is taking damage? (this is on multiplayer)
don't use loops 
more specifically: use eventhandlers. they react instantly and are far less costly for performance
Thank you
Is there a way in arma to have strike-through text?(like ~~this ~~) I'm thinking of having a hint/task description along the lines of "help st. Patrick clear Ireland altis of snakes
how can I make a piece of code repeat a certain amount of times
With a for loop: https://community.bistudio.com/wiki/for
I have addMissionEventHandler ["EntityKilled", ... in initServer.sqf where I am checking isPlayer _instigator but due locality sometimes I get false "isPlayer" result
what should be the alternative ? _instigator in allPlayers maybe ?
thanks
you have to use side group _unit for that event handler to grab the side of the dead unit
isPlayer has errors naturally if you check the wiki page which you can't really avoid.
Yes your alternative should work.
In some cases, the identity of certain player units might fail to propagate to other clients and the server, which causes isPlayer and getPlayerUID to incorrectly return false and "", respectively, where the affected units are not local.[1] Therefore, beware of false negatives.
do I need to use remoteExec if I want to play a sound globally? (playSound)
yes
["FD_Finish_F"] remoteExec ["playSound", 0]; // Clients and server (global)
["FD_Finish_F"] remoteExec ["playSound", allPlayers]; //All player clients
["FD_Finish_F"] remoteExec ["playSound", group unit]; //All units in a particular squad
ect ect
but if I dont even put a 0 at the end, it will be 0 by default, right?
always think
A command B //normal
[A, B] remoteExec ["command", whereExecuted] //remoteExec
yes, it will default 0 and global if you leave out that value
I always write it out though
wait if it is all clients AND server, then will the sound play twice for everyone?
depends where its executed in the first place
initServer.sqf
then no, it won't play twice. it simply cannot play on the server cause it has no interface
but if you want, you can use -2 for every client but server
nah thats fine
but then its harder to test cause you won't hear anything in singleplayer since you are the server
now if you were in local space, say init.sqf and you did the same thing, then the sound would play for everyone, every time a client logged in, for however many players
is selectRandom broken?
should not be
I also tried BIS_fnc_selectRandom with the following code:
_unit = cursorTarget;
_dismissive = ["I don't wish to talk to you.","I don't know anything.","Go Away!"];
if ((player == h1) or (player == h2)) then {
_line = [name _unit, [_dismissive] call BIS_fnc_selectRandom];
systemChat str _line;
[[_line],"SIDE",0.15,true] spawn Revo_fnc_simpleConv;
};```
but the systemChat shows ``[Ed Snowe, ["I don't wish to talk to you.","I don't know anything.","Go Away!"]]``
Instead of the random element. ``selectRandom`` yielded the same result.
LOVE
ROCK N ROLL!
shouldnt it be _dismissive call BIS_fnc_selectRandom?
same as selectRandom _dismissive
ah, yeah you're right
is there a way to get mouse delta?
onMouseMoving is a tad bit unreliable
as it can get stuck to some value despite the mouse not moving at all
I think the crux of your issue is the fact that the variable you're saving the mouse deltas to, does not get updated with zeroes when the mouse is static.
There's a complementary event handler "onMouseHolding" whose x and y values are always zero so you should use that to update your variable.
I might be wrong though 🙃
that is a good point
ofcourse the event handler would not be triggering when the mouse is not moving
😅
i like to remove weapons from all units in the group indigroup. i don't know why this is wrong:
{
removeAllWeapons this;
} forEach units IndiGroup;
use _x instead of this
thats it. thx
ok
another thing i have wrong:
if (({alive _x} count units IndiGroup) < 1) then {nul = [] execVM "myscript.sqf";);
if ({alive _x} count units IndiGroup < 1) then {
[] execVM "myscript.sqf";
};
if ( units IndiGroup findIf { alive _x } == -1 ) then {
[] execVM "scripts.sqf";
};
//Runs faster if you just want to check if everyone is dead
thx
is there a way to set a magazine directly into a turret of a vehicle?
currently im using loadMagazine
but that has the issue that setWeaponReloadingTime doesnt work on it
I have an issue with this code.
[missionNamespace,"OnGameInterrupt", {
params ["_display"];
_btn3 = ((findDisplay 49) displayCtrl 120) ctrlSetText "Enemy insurgents have invaded Aghanistan. Destroy their assets and remove all enemies to free this suffering nation. This must be carried out in a humanitarian way, minimising damage to civilian assets.";
hint "me";
}] call BIS_fnc_addScriptedEventHandler;
The hint shows when I press ESC, but the control text will not show. I wish to use the onGameInterrupt event handler, but I think I am missing one small thing.
I just want to know how to get started with this.
what is the end goal? to have a reload time? to not? to have some?
Im making a mission and i need a script to loop and check if there's any disembarked crew and to kill them off if there is
Here and there i got a script from someone, which is the only one that does not show any errors, but it still doesn't actually kill off any disembarked infantry
while {_unitCheckLoop} do {
{
if (vehicle _x == _x) then
{
deleteVehicle _x;
};
sleep 60;
} foreach (units blufor);
};```
i don't think that sleep is supposed to be ran inside the forEach, move it into while scope
you sleep 60 seconds for every iteration of the forEach, so if you have 10 units, it's going to take approximately 600 seconds to loop through all of them
i am not that smart to actually change the script to fit into what you are saying
move your sleep 60; a line below
while {_unitCheckLoop} do {
{
if (vehicle _x == _x) then
{
deleteVehicle _x;
};
} foreach (units blufor);
sleep 60;
};```
llike this?
the command only works when changing reload time between rounds in a magazine, it doesn't work when you want to change the reload time of a magazine
yes
Thanks, it worked
minor issue is that with the respawn script im using it seemed to prevent a couple of groups from respawning
changing deletevehicle to setdamage worked, thanks still
[missionNamespace,"OnGameInterrupt", {
_this spawn {
params ["_display"];
_display displayCtrl 120 ctrlSetText "Enemy insurgents have invaded Aghanistan. Destroy their assets and remove all enemies to free this suffering nation. This must be carried out in a humanitarian way, minimising damage to civilian assets.";
};
}] call BIS_fnc_addScriptedEventHandler;
Oh, OK thank you. Now I understand.
But hints are a great way to test scripting though.
What's happened to community.bistudio.com?
What?
I can't access it
You can #community_wiki
Nvm it's fixed now
I'm having an issue with the mod I've made where the signing tool recognizes it as signed but when joining my server it still boots me for it being an recognized mod. I can't for the life of me figure out why.
Did you packed your MOD with PboManager?
Yes
That's the issue
ah, ok, what am i supposed to use?
At least Addon Builder from Arma 3 Tools
Probably me being a derp, I think i remember this now, Thanks!
how can i make it so the module 'edit terrain object' upon a trigger activation, opens 'door 1' please (https://imgur.com/0KPna3X)
Probably by syncing the module to the trigger.
I don't know how work with setText? How to change name of City for example? How get Location by city name
I think you cannot change built-in locations
but on server I saw what Chernogorsk was named differently
I check stringtable.cvs, but name of location changed from string: dn_chernogorsk
maybe terrain locations can be hidden and a new one edited
anyway, how do you use it?
Idk how to hide current default map location
I can create new location, when I create Location logic and set him text
on map it shown
But I can't remove for example Chernogorsk name
grab it by https://community.bistudio.com/wiki/nearestLocation and use other location commands found here https://community.bistudio.com/wiki/Category:Command_Group:_Locations 😉
is it possible to change the reload time of a magazine?
No reload time at all
I'm going to script logic for the reload time myself
you can try removing magazines and the weapon, adding magazines back and the weapon afterwards, that will get rid off the reload time for the magazine
