#arma3_scripting
1 messages · Page 470 of 1
Thank you worked 😃
❤
@still forum yeah sure, when it doesnt take four or five asks to get an answer instead of snappy complaints.
_randomUnit = (selectRandom _unit);
fnc_aiSpawn = {
_squad = ["rhs_msv_emr_sergeant", "rhsgref_cdf_b_reg_rifleman", "rhsgref_cdf_b_reg_rifleman", "rhsgref_cdf_b_reg_rifleman", "rhsgref_cdf_b_reg_rifleman", "rhsgref_cdf_b_reg_rifleman", "rhsgref_cdf_b_reg_rifleman"];
_grp = [getmarkerpos "aiSpawn", WEST, _squad,[],[],[],[],[],180] call BIS_fnc_spawnGroup;
sleep .5;
while {count units _grp > 0} do {
_grp setbehaviour "AWARE";
_grp setSpeedMode "FULL";
_wp = _grp addWaypoint [getPosATL _randomUnit, 20];
sleep 10;
if {count units _grp < 1} then {call fnc_aiSpawn};
deleteWaypoint ((waypoints _grp) select 0);
};
};```
Why does ``` if {count units _grp < 1} then {call fnc_aiSpawn};``` give generic error in expression?
Everything else works in the script but that part, and that is just meant to check if everyone in the group is dead
_wp = _grp addWaypoint [getPosATL _randomUnit, 20]; now that has generic error in expression 🤔
So there was someone who asked how to disable fall damage for ace medical, that got me thinking and i had some fun time trying to get that done
https://streamable.com/okvku
Any idea how to improve it technical wise?
[{
params["_unit"];
_unit removeAllEventHandlers "HandleDamage";
_unit addEventHandler ["HandleDamage", {
params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
private _ret = damage _unit;
// Handle falling damage
private _vehicle = vehicle _unit;
private _impactVelocity = (velocity _unit) select 2;
if ((_impactVelocity > 0) || {(_vehicle != _unit ) || {!((_source == _unit) || {isNull _source}) || {(_projectile != "")}}}) then {
_ret = _this call ace_medical_fnc_handleDamage;
systemChat format["vel %1, veh %2, src %3, proj %4",_impactVelocity,_vehicle != _unit,_source != _unit,_projectile != ""];
};
_ret
}];
},[player],1] call CBA_fnc_waitAndExecute;
Hi guys. With playSound3d I can use a mempoint for location of sound with soundPosition. Is it a hackish way of doing the same thing with say3d? Id rather use say3d cause the script is runned using execVM. With playSound3d the sound is played double
playsound3d is propageted to all machines and only should be ran once. also the sound will be staying at the same location if you play it.
say3d requires a description.ext cfgsound entry
and needs to be remote exec'd
Yes but if you remote exec playSound3d its broadcasted twice it seems. Since the function itself broadcasts on network
correct, you should never remotexec playsound3d
Yeah that why Im leaning on say3d, but the position thing is a nice feature
My script playing the sound needs to be remotely executed
say3d also has a drawback that it needs an alive object to be played on
if a unit dies the sound will stop instantly
Thats not really a problem
also playing multiple sounds at the same time on that object is not possible, it will stakc up and play after each other
I wish I could disable broadcast on playSound3d 🤔
Guess I could create an object on the location I want the sound to be played using say3d, but that seems like alot of hassle
The sound is part of a bigger code that is running remotely. It is triggered when certain conditions are met. It makes it hard to playSound from another script not runned remotely
Wait a minute.. What happens if I use exec inside of an execVM? Would that work?
Exec a script that runs playSound3d
uh. so that script is running on all machines or just one? if it is just one, then it is easy. Right now i do not really understand the whole construct you are trying to achieve.
I have creation rights to a mod on the workshop, but the Publisher tool isn't giving me an option to update it. Anyone know a fix?
Im telling each Client to animate the legs of a mech. I want to play the walking sounds from the correct positions in the legs
@tough abyss afaik only owner can update mod. Other creators can only moderate comments etc.
@digital jacinth that basically it. And the mech that is animated is a local object so I dont spam the network with animation packets. They are runned very frequently
Really? I havent been able to find that answer a anywhere. Thats a terrible system if so
@nocturne basalt how frequent? depends now if broadcasting that throught he system is worth it or not
I have another mod already that broadcasts everything and it causes desync in mp
To solve that Im using an invisible tank with a local object attached to it
Works perfectly
My only issue is the sound positions. Dont want them double and dont want them all to be played from the center of the object
best would then spawn a local object attach it to the mem point, hide it and say3d on it.
delete it with the mech itself
So far as im aware 3d sounds dont follow objects though, right?
say3d does.
I’m going to write that down then, thanks
@digital jacinth ok thanks maybe thats the way to go here
fixed now those last typo in the promise system i wrote https://gist.github.com/X39/709ecbf88c5fda594586c9b995c8c6a0
in case somebdoy ever needs it, take it
@tough abyss for real now? I just told you to stop cross-posting. And just one hour after you read it. You cross post a question that I already answered you. Cross-posting is against #rules
Next time I'll directly forward it to a moderator instead of trying to be friendly and informing you about it.
🤦
How can i get fps higher on client side by scripting
Here:
{deleteVehicle _x} forEach allUnits
What's your pc spec? and you cant magically bring more fps via scripting xD
Also I'm not sure if this is correct channel.
hmm, understand thanks
and you cant magically bring more fps via scripting That's where you're wrong kiddo
startLoadingScreen ["Increasing FPS"];
Run that. And look at your fps counter before and after
👍🏽 maybe my 1080 will finally get some work. 😄
Nah. Don't thank me
these things will 100% improve your FPS
But... They will make the game alot less fun
🤣
I also have a thingy to get your FPS onto exactly your monitors refreshrate guaranteed. But I'd have to find that in my stash somewhere..
😈
instead of making fun of him @still forum you could have told @verbal otter that such things are not possible
they are though
lower view distance is a start already and should definetly improve fps
could disableSimulation on all local objects out of view
or hideObject some less important things
but if his game is barely playable with 1000 view distance...
Makes the community as a whole Look Bad if some rookie asks such questions and gets made fun of
why though?
@still forum if you have an issue with me, you're welcome to discuss it with me privately. I've also only cross posted two things within the last few weeks, one of which was across two separate discords, so I don't think that counts. You also cross-posted, while quoting the rule against cross-posted? You did not answer my question, either, you just complained about cross-posts. I did, however, finally get my answer, which I appreciate.
You did not answer my question, either
https://s.sqf.ovh/Discord_2018-06-28_21-08-05.png
startLoadingScreen is a legit way that I too use to increase FPS.
Because scheduled scripts run faster inside loading screens
ChewDev didn't say why he wanted better FPS. So I could just guess
also params -gibFPS and -noLags /s
I guess you did, I just saw the flurry of @ notifications and the complaining, so I skipped the rest of it ¯_(ツ)_/¯
If you are seeing a flurry of complaints about you. You might be doing something wrong 😉
startLoadingScreen ["gib fps"]; // still not 120 fps ;<<
Again you're welcome to message me privately, but you're the only one complaining, and you're pretty infamous for it 😉
How many?
117 😄 (i ran it in running liberation tho)
oh i cant use debug console now. alt+f4 😄
well maybe he Is the only one complaining but rules are rules.
117 != 120.. awww comeon
0 spawn {
while {true} do {
hintSilent format ["Client FPS:%1", 120 + (random 100)];
sleep 0.025;
};
};
ez
Hax
more performant
_handle = [{addFrames (120-diag_fps);}, 0, []] call CBA_fnc_addPerFrameHandler;
I can actually legit make a Intercept SQF command that will increase your fps.. Does that count?
do it and bundle it in a command called "createFPS"
Put it in a modpack called Doawnlad Mor RAM for the cherry on top.
@meager heart that's some top notch lifer code 😄
😬
Is dis idea bad
I will remove the normal inventory
And do like battlefield 2, so you can pickup a kit from the ground by pressing g
Because inventory is cluncky
removes player choice but isn’t inherently bad.
MAGIC AURAS
As long as you dont kill the net by sending 100 strings every time someone picks up a kit
nigel, why not the "config inventory" ? i mean with templates
Yes @still forum
Well. Because I want to get into the game and shoot people and play with my squad instead of picking up magazines
Also the inventory is so slow in arma 3
I know it's to prevent duplication bugs.
But I imagine going up to a dead guy and looting him for extra ammo(hold to loot) or pressing invetroy key to take the kit
Dupe still happen though. But there is a way to change what it grabs when you hit 'rearm.' Been a loong time since I've done it though.
Have an idea how to make dupes impossible though
🤔
same as TFAR does to generate really unique radio id's without duplicates
just do the inventory replacing on the server.
hmm, yes
More traffic sure.. But still alot less than the player taking each item seperately
If I do kits, it's a lot simpler, I can just save the kit class and amount of mags(
And yea on the server is like a must. I wonder about dayz SA
How do they do it there? Duplication avoidance has to be high on their list
I'd say they generally go more into the "server is authority" direction.
instead of client does everything like in Arma
atleast they should
i've heard there is some server side "modular system" ? 🤔
What have you heard ?: D
hmm... there was some info on dev diaries or tweets or streams... friend of mine told me something like that, he just following and checks every single dayz report/dev updates info... but it could be bogus/his own version lol
@peak plover
simpler inventory sounds neat. I'm fantasizing about a version that is not quite BF2, but more restrictive than A3.
E.g. you can drop and add stuff in your inventory, but if you pick up a different weapon from somebody you must change vest as well and stuff like that.
(because my vests are basically just webbing kits with different pouches fitted to the role of the weapon in use)
I'd imagine there could be an option to restrict only friendly uniform/vest/helmet.
ex.
pick up enemy kit, get the enemy gun, but appearance of a the player faction of the picked up class
yeah, that would be neat
Is anyone familiar with the ace-style development environment? I am attempting to use it to create a retexture mod, however the build release (using make.py) still points to my local texture files. IE, it won't work for someone else.
I'm also curious how to use external objects, say if I wanted to in a config use model = "rhsusaf\something", rather than having to directly inherit from it a class.
What exactly is JIP?
Join in progress
its when a player connects after the mission started.
just tried first time to press escape, back, ok, back, close... to close the game and was error message about unusual exit...
usually i just alt f4 and then close the error message about unusual exit...
😔
Will this work in functions? Basically I want to do Test_life_fnc_function
class Mission_Modules {
tag = "Test";
class life {
tag = "life";
file = "modules/life";
function {};
};
class menu {
tag = "menu";
file = "modules/menu";
function {};
};
no, you would need to define the tag as test_life
hmm ... i'm trying to force an AI tank to turn towards a target (fairly precisely). He starts turning with
_tank sendSimpleCommand "LEFT";
when i stop him with
_tank sendSimpleCommand "STOPTURNING";
he keeps turning for a random amount (somewhere between 10-100 degrees) before he stops. Anybody got an idea how to make him stop more precisely? Is it possible to freeze the vehicle in place in some way for a short period , without resorting to setDir every frame?
doStop ?
does not work for tank that is told to turn left permanently
it just keeps spinning
also you can try move and orient that tank with setDriveOnPath
hm that seems to work once, but after i command doStop once it refuses to repeat it
or maybe i goofed somewhere...
ah yes indeed, forgot an abs()
got it now, used setDriveOnPath, and use a position behind the vehicle and then check until the right orientation is achieved. Gives me 10-15° accuracy, and with some finetuning i got within 4°
next problem: doStop works without problem if the unit is on it's own. If it's in the player's group it also works but only until the player gives the first move order. After that it no longer works. Is there a way to fix that?
no, when i give them a move command, then execute my script they ignore the doStop commands. They complete the move order until setdriveonPath is executed, which they then fully complete (which is not what i want)
https://forums.bohemia.net/forums/topic/217556-change-orientation-of-tank/?tab=comments#comment-3299624
I pick position behind vehicle (or 150° specifically, so i know which way it turns) and then use setDriveOnPath. As soon as the desired orientation is reached it is supposed to stop via dostop
if required rotation is > 120° i use simpleCommand "LEFT" a bit, to get below 100°, so i know it will turn in the right direction with setDriveOnPath, and not drive towards the position
afaik move that is almost the same as doMove waitUntil{unitReady _unit}; doStop
@austere hawk try maybe tankD stop true, that's a real stopper (AI won't turn around to shoot at an enemy)
Can anyone quickly explain the difference between ControlsBackground and Controls class inside a display class to me?
I always used ControlBackground for controls which the player can't interact with
"ControlsBackground" aka the very first one will be placed behind the "Controls"
Alright, so I was doing it right.
Take On Helicopters commands such as profileNamespace , saveProfileNamespace also used in Arma3 scripting?
https://community.bistudio.com/wiki/Category:Introduced_with_Take_On_Helicopters_version_1.00
yes.
Thx Dedmen.
https://s.sqf.ovh/firefox_2018-06-29_13-07-20.png Here. On the bottom of the profileNamespace page. On the categories you can see if a command also applies to Arma
I see, thx. 😀
@winter rose tried it, "_vehicle stop true" did nothing either (also tried "_commander stop true")
hm weird. I think i may have broken AI some way that carried over even after mission starts (was unable to command anybody) which may have influenced this - so i guess i can repeat all tests now -.-"
ok again, if a player orders his AI to Move to somewhere, doStop does nothing.
If player orders his AI to stop, it cant start moving with doMove
The only way I know is to use disableAI to turn off movement, that works but you also need to enableAI to undo the stopping to get them to move again and it is a bit of a pain keeping track of it.
for a vehicle, can i just turn off AI for the driver, or does it need to be the effective commander or the entire vehicle?
how would I make
[ this ] call BIS_fnc_initIntelObject;
play nice with an sqf file?
it say this not defined
intel.sqf
params ["_title", "_text", "_imagebool", "_imagepath"];
[ this ] call BIS_fnc_initIntelObject;
if ("imagebool" == "true") then {
this setVariable ["RscAttributeDiaryRecord_texture", _imagepath, true];
}
else {
[this,"RscAttributeDiaryRecord",[_title, _text,""]] call bis_fnc_setServerVariable;
this setVariable ["recipients", west, true]; }
this doesn't mean anything in an sqf. What do you actually want to put there?
Im having a problem thats appearing in the RTP log of my server, would anyone be able to help me out/would this be the right place to ask?
If it's script error then this is indeed the correct channel
whether anyone can help you with that I don't know.
I believe to be a script error
so instead of [ this ] call BIS_fnc_initIntelObject; it should be [ intelobject ] call BIS_fnc_initIntelObject;?
if intelobject is a variable that you previously set then yeah
12:59:41 Warning Message: '/' is not a value
12:59:41 Warning Message: No entry '.ace_gestures_warningstandlowered'.
12:59:41 Warning Message: '/' is not a value
12:59:41 Warning Message: No entry 'bin\config.bin/CfgMovesMaleSdr/Actions.'.
12:59:42 MovesType CfgMovesMaleSdr load time 4637 ms
12:59:43 Global namespace not passed during: false
12:59:43 Error in expression <false>
12:59:43 Error position: <false>
12:59:43 Error Local variable in global space
12:59:43 Global namespace not passed during: false
12:59:43 Error in expression <false>
12:59:43 Error position: <false>
12:59:43 Error Local variable in global space
12:59:43 Global namespace not passed during: false
12:59:43 Error in expression <false>
12:59:43 Error position: <false>
12:59:43 Error Local variable in global space
12:59:43 Global namespace not passed during: false
12:59:43 Error in expression <false>
12:59:43 Error position: <false>
12:59:43 Error Local variable in global space
Not sure if that means anything to anybody
Ok
I would usually ignore any error
however
the server isnt running
If I fixed the namespace do you think that might solve the issue?
Upload the full RPT somewhere
Presumably the driver but potentially the commander may work as well.
Have never used it for vehicles, mainly use it in garrison of troops in buildings
-noPause -noSound -exThreads=7 useless.
-ranking="" -par="" empty parameters make no sense
"-servermod=" empty parameters...
You are running some seriously broken mods
What mods are seriously broken?
12:59:33 Error in expression <ace\addons\fastroping\XEH_preStart.sqf"
ý|«à›ÀLËúßõø{ÿcŸz|þ#~qÿ÷ $!‹ß+>
12:59:33 Error position: <ý|«à›ÀLËúßõø{ÿcŸz|þ#~qÿ÷ $!‹ß+>
12:59:33 Error Invalid number in expression
12:59:33 File z\ace\addons\fastroping\XEH_preStart.sqf, line 1
I can probably get rid of them
The reason it has empty parameters is because it uses a command line editor https://i.imgur.com/oDNRtxk.png
Redownload your ACE
Ok
Tell the author of that thing to fix that then. Empty parameters are useless. The tool shouldn't add them
Will do, do you know if the command line has a physical location I could remove them?
no
@grave brook No need to allow 3den Enhanced on your server
@tough abyss just driver is ok. But once i enableAI again it resumes the players move command, so it can't make the AI stop. Also, if the player issues STOP command it won't react to scripted move commands it seems. The only case where i can controll the unit is, when player tells them to regroup first.
Good to know, I'll keep in mind I don't have the same level of control with AI in vehicles then
cant even commandFollow or doFollow to interrupt the move order given by player - it just keeps doing his move, and only after that will regroup
Stop given by player has same effect - ignores all commands
We had a classic on Sunday. The APC refused to move to its waypoint and one of the technicals crashed into the only tree in the area and the second technical crashed into the first technical 30 seconds later. 100% of vehicles didn't do anything past a couple of minutes of moving around. Someone at BI looked at that implementation and said "perfect, works as intended, ship it"
guess i need to take away the AI from the players group to do anything...
or teleport the driver somewhere else and replace him with AI of own group, until i'm done. Any ideas where and how to "store" the player's driver AI unit ?
setPos [0,0,0] ^^'
@still forum I reinstalled the whole of ACE, exactly the same error
Any other ideas
Thanks for the help so far by the way
something is wrong with something doing something with ace
try just launching the server with ACE and CBA
testing that now
15:37:36 InitSound ...
15:37:36 InitSound - complete
15:37:36 PhysX3 SDK Init started ...
15:37:36 PhysX3 SDK Init ended.
15:37:40 [0,24.134,0,"XEH: PreStart started."]
15:37:40 [CBA] (settings) INFO: Userconfig: Ignored.
15:37:41 Error in expression <"z\ace\addons\goggles\XEH_preStart.sqf"
�8ƣ�FI�$I� Y�MkUZI�$I2 Y�iJU�jИ>
15:37:41 Error position: <�8ƣ�FI�$I� Y�MkUZI�$I2 Y�iJU�jИ>
15:37:41 Error Invalid number in expression
15:37:41 File z\ace\addons\goggles\XEH_preStart.sqf, line 1
15:37:41 Error in expression <"z\ace\addons\goggles\XEH_preStart.sqf"
�8ƣ�FI�$I� Y�MkUZI�$I2 Y�iJU�jИ>
15:37:41 Error position: <�8ƣ�FI�$I� Y�MkUZI�$I2 Y�iJU�jИ>
15:37:41 Error Invalid number in expression
15:37:41 File z\ace\addons\goggles\XEH_preStart.sqf, line 1
15:37:46 [0,31.074,0,"XEH: PreStart finished."]
15:37:48 Warning Message: You cannot play/edit this mission; it is dependent on downloadable content that has been deleted.
a3_characters_f
Still got that broken text
and its a fresh ace and cba off armaholic
I'll be back in 40 minutes
alright
maybe that is just broken default mission on your server
tested with 2 seperate missions
one exact mission file that I have had working before
is it possible to 'warp' units from inside one vehicle to another directly?
@grave brook armaholic is not a official ACE mirror afaik.
Use the official github download
Are you hosting the server yourself or via a external hoster?
both mh... thought there was a setEventHandler
addEventHandler always stacks
Im using a external hoster, host havoc to be specific
I had to go out but ill get a official mirror once im home
If the https://github.com/acemod/ACE3/releases doesn't work. Then contact your hoster. Most likely their fault
If I have a variable is there a way to determine whether it is a string or an array?
I think I found the problem
Excellent thanks
"15:41:36 Warning Message: You cannot play/edit this mission; it is dependent on downloadable content that has been deleted.
a3_characters_f"
unrelated
a3_characters_f is a part of default arma?
happens regularly. Known bug. Doesn't many anything
Ah, I ran it without any mods though then still got that error and it wouldn't launch
Might just reset my server
Any idea how to add a helicopter wave here: https://github.com/DUWS-R-Team/DUWS-R/blob/master/source/WARCOM/WARCOM_opf_assault.sqf ?
with your favorite text editor
😃
@tough abyss the limitations for move/stop orders that apply to vehicle AI when under player move orders seem to extend to infantry as well
Rip my phone doesn’t actually have tilde. Deleting that.
And that code was terrible anyways lol.
@austere hawk ace or achillies had a zeus module that teleports with vehicles, if that doesnt work for you you can ghetto it with
log vehicles, teleport everything with a black screen, unblack, move players back in vehicles
I am on mobile and not home and not familiar with teleporting sorry
not players, just AI. But i dont want them to have visible ejection sequence and then disappear into thin air
Theyd disappear anyways if its teleporting tho right?
You know I totally missread it in the first place. Sorry.
So if you teleport a unit by the default way, it doesnt take their vehicle. So hide the unit, teleport them away, then move them into the second vehicle’s cargo, unhidr. You may be able to just force eject them then move them into the next vehicle-and skip the teleport
How do I make a custom song (which I have already ported in with classes and all) loop whilst I am in the trigger area?
and is it possible to make an ai flown helicopter fly like it's on rails?
Can you exit a loop using any scripting command or external program. while {true} do {}; note: a loop that already exits. Just asking for ah purposes
exitWith
but only from within loop code not "i want to exit this loop of that other script that i didnt write"
breakTo too (ugh)
Or breakout
I'm not asking that, the loop already exists as I said.
you've received two responses answering that, above.
has anybody had the occasion to play with optics enough to know whether or not its possible to default an optic to the rmr position instead of the bottom zoomed position ?
Anyone up for a camera challenge? Because i've got a difficult problem.
Basically i want a camera to follow a moving target like a vehicle or player with a certain offset (this can be done using code example #1), however i also want to do this whilst not having the camera follow the target's direction (which is what occurs with example#1).
I have have tried example#2, which should work logically, however this generates severe stuttering with the camera. I assume the stuttering is caused by the performance of the setPos or camSetPos command or something.
Does anyone have any suggestions to make this run more smoothly?
Example #1:
showCinemaBorder false;
sp_followingCamera = "camera" camCreate [0,0,0];
sp_followingCamera cameraEffect ["Internal", "BACK"];
sp_followingCamera camSetTarget _camTarget;
sp_followingCamera camSetFov 1;
cameraEffectEnableHUD true;
sp_followingCamera camCommit 0;
waitUntil {
if (!sp_followCam) exitWith {true};
sp_followingCamera camSetRelPos [-2,1,3];
sp_followingCamera camCommit 0;
};
Example#2:
showCinemaBorder false;
sp_followingCamera = "camera" camCreate [0,0,0];
sp_followingCamera cameraEffect ["Internal", "BACK"];
sp_followingCamera camSetTarget _camTarget;
sp_followingCamera camSetFov 1;
cameraEffectEnableHUD true;
sp_followingCamera camCommit 0;
waitUntil {
if (!sp_followCam) exitWith {true};
_targetPos = getPos _camTarget;
_camPos = [(_targetPos select 0) + xCoef,(_targetPos select 1) + yCoef,3];
sp_followingCamera camSetPos _camPos;
sp_followingCamera camCommit 0;
};
Does anyone have any suggestions to make this run more smoothly?
_camera camPreparePos _position;
_camera camCommitPrepared <delay>;
does a extension gets closed after calling ?
@meager heart Unfortunately that didn't work.
waitUntil {
if (!sp_followCam) exitWith {true};
_targetPos = getPos _camTarget;
_camPos = [(_targetPos select 0) + xCoef,(_targetPos select 1) + yCoef,3];
sp_followingCamera camPreparePos _camPos;
sp_followingCamera camCommitPrepared 0;
};
``` if this is what you meant. It is still stuttering each time the cam target moves.
Hey guys, I've got a little question, i'm trying to combine two scripts on my server, is there only one stringtable.xml? and if yes, do I just have to copy paste <project> from the first stringtable.xml to the second?
@sleek token I'm not sure what is meant by this. What extension?
using custom librarys via callExtension
sp_followingCamera camCommitPrepared 0;
-->
sp_followingCamera camCommitPrepared 0.5;
```👌
Ok, not at the moment. I'm running this as a simple, vanilla vr mission
@silk sparrow Sorry, not too sure about the use of stringtables in arma
@meager heart Ok will try this.
@meager heart Yes that works perfect. It makes sense too i guess, because it is smoothing the transition between the camera movements. Thanks for the help. you're a legend.
here is example
player spawn {
disableSerialization;
params ["_unit"];
private _camera = "camera" camCreate eyePos _unit;
_camera cameraEffect ["internal", "back"];
_camera camPrepareTarget _unit;
_camera camPrepareFOV 0.1;
_camera camCommitPrepared 0;
waitUntil {camCommitted _camera};
showCinemaBorder false;
cameraEffectEnableHUD true;
[_camera, _unit] spawn {
params ["_camera", "_unit"];
while {!isNull _camera} do {
private _position = _unit getPos [200, (_unit getDir _camera) + 0.1];
_position set [2, 100];
_camera camPreparePos _position;
_camera camCommitPrepared 0.05;
};
};
sleep 10;
_camera cameraEffect ["terminate", "back"];
camDestroy _camera;
};
```paste it into debug console ^ @limpid pewter
Wow, that's cool. i love the way you've used getPos and getDir in the loop there. I've always wondered how people do a spinning camera like that.
so yeah.. just play with that commit delay... and use camPreparePos
also check this for the getPos getDir usage, positions.... and more http://sqf.ovh/sqf math/2018/05/05/generate-a-random-position.html
@edgy halo if you store the script handle (returned by spawn/execVM) then you can terminate that script by it's handle from anywhere
@sleek token no
@still forum thx
@still forum Would it be possible for hackers to stop loops using external programs?
unless you are cool hacker too 😃
Yeah, [] spawn { while {true} do {}; diag_log "loop stopped"; };
That won't work. Atleast I would just kill the script
ending the loop and letting the code after that run is waaaay more complicated
you can as I said store the script handle
and then periodically check if the script behind that handle is still running
if it isn't then you know something is wrong
It's about 1 click for me to kill all scheduled scripts and let isTerminated (I mentioned before to check if the script is still running) still return true...
You just can't be secure on clientside
Hello !
Can someone explain why this is not correct ?
[[player, [(_vel select 0) + (sin _dir * _speed),(_vel select 1) + (cos _dir * _speed),(_vel select 2) + 10 ]],"setVelocity",nil,false] spawn BIS_fnc_MP;```
I don't know this function, i'll look it up thx
Or https://community.bistudio.com/wiki/setVelocityModelSpace so you don't need the sin/cos stuff
Okay thx
oh and it's Global aswell
thx
nah, not good for what i'm trying to do.
but that wasn't my problem
my problem is that i can't get my player to get the animation in MP
it only works in SP
found a way ! cya !
there is nothing about any animations in your code ^^
also BIS_fnc_MP > remoteExec 👍
Yes I did that instead lol
Why would I get a Generic Error on a Sleep 5; :OOOO
???
Hm I ask myself why can't i use
_obj = allmines select 0;
_obj setVariable ["EditorObjectID", "5", true];
on Mines?
It is not the first problem with Mines i also can't use AddEventhandler on them if i do i get an -1
Has anyone encounterd that problem too?
@quartz coyote Well it depends if you are working in an scheduled Enviroment or unscheduled Enviroment https://community.bistudio.com/wiki/Scheduler#Scheduled_Environment
if a code can't suspend then you can't use sleep, waitUnitl, uiSleep.
@gray thistle ooh .... thanks ...
@quartz coyote had the same problems 😄
So how did you pause your script ?
it depends on the script really. spawn, execVM and exec are the keywords. You will find all information in this article
Read under the headline "Threads"
It's a remoteExec lol ...
remoteExec spawn then
or remoteExec a script.. remoteExec'd scripts are scheduled by default I think
just don't remoteExecCall
it's a strang situation, i'm remoteExecing a script that sends a displaySetEventHandler on a keyboard press
so the script i'm trying to pause is in the _keyActivate variable
so it has nothing to do with remoteExec at all but you are trying to pause inside a eventhandler?
that would be it I guess
spawn your script inside the eventhandler then
Inception xD
i'll try it
sorry @gray thistle I smashed you asking your own question, go ahead budd
I am still investigating
afaik ACE guys also had something with Mines
could be since vanilla has some problems with it it could also hit ACE.
probably i know there is some workarounds. But i think with setVariable it will get harder. Bohemias Mine system in comparsion to vehicle and units is a big mess.
I think i will file a secound bug report for thati already have this one for the Eventhandlers https://feedback.bistudio.com/T129113
duplicate reports would be duplicates though
ähm a secound diffrent one a subtask which relates to this. If it wasn't clear what i meant ^^
The existing one is for Eventhandler and the secondary one is for the setVariable problem
I searched for other Bug reports regarding that problem with no result.
There are some terrain objects which cursorObject returns, but which can't have variables or eventhandlers
sure this is why i set one lookup on cursorobject last lookup line to be sure to have the right object in the selection
Well if someone want's to support the resolution of the mine problem he can do it on the following threads one is not from me:
https://feedback.bistudio.com/T129113 -> Addeventhandler (Killed, Deleted,Fired) on Active Mines returns -1
https://feedback.bistudio.com/T131058 -> SetVariable on Active Mines does not Work
https://feedback.bistudio.com/T83628 -> Missing event handler for detection of explosives
@still forum does arma allow a _x64.dll extension to use another 3party 32bit dll?
as reference
That wouldn't make sense
@meager heart Hey, is there a difference between camPreparePos and camSetPos. They both seem to do the same thing, is the prepare version just faster or something?
camPreparePos uses camCommitPrepared. camSetPos uses camCommit
you can have 2 set's of changes ready. And only apply one and later the other
^
So if i understand correctly, if you have two camPreparePos commands, but then only execute 1 camCommitPrepared command, the first camPreparePos called with be the position the camera will move to? and then if a second camCommitPrepared is called the second will be run even if both are called like this ```sqf
camPreparePos _pos1;
camPreparePos _pos2;
camCommitPrepare 0; //will only commit to _pos1
camCommitPrepare 0; //will only commit to _pos2
Essentially they will not over write each other?
or is it you can have 1 prepared and as many normal camSetPos and them commit to the single prepared one anytime in the future? <----Feel like it is this one after reading what you've said again
no
@queen cargo yeah c# stuff..
camPos and camPreparePos are seperate.
@sleek token reasoning should be roughly the same
guess have to build my own x64 version then?
then*
either that, or you start using the x32 version
that would lead me to use arma32bit soooo first one
also iirc with prepare/preload camera commands all textures and models around that position will be "preloaded" to avoid glitches/visual artifacts... after camera will be moved
btw there are no proper docs about "cameras things"
aren't MSIL libraries not usable by either 32or64bit? talking about c#
Did someone know a good script with a grappelling Hook and the possibilities to climb the rope?
Is there a way to test if player is performing an action like boarding cargo or other
?
You could use an animation event handler and detect the specific animation assuming it is unique enough to the action.
Hello, i try to write a function to add some Teleport points to vehicles with given Names, but it won't work. Can some one give me a hint to the right direction?
params ["_tpbase","_type"];
_obj = missionNamespace getVariable ["_tpbase", objNull];
if (_type == 1) then {
_obj addAction["BUS -> SB2", {player setPos (getMarkerPos "tp_sb2");}];
_obj addAction["BUS -> SB3", {player setPos (getMarkerPos "tp_sb3");}];
_obj addAction["BUS -> SB4", {player setPos (getMarkerPos "tp_sb4");}];
_obj addAction["BUS -> SB18", {player setPos (getMarkerPos "tp_sb18");}];
} else {
_obj addAction["BUS -> Kaserne", {player setPos (getMarkerPos "tp_kaserne");}];
_obj addAction["BUS -> Camp", {player setPos (getMarkerPos "tp_camp");}];
_obj addAction["BUS -> Flugplatz", {player setPos (getMarkerPos "tp_airfield");}];
};
_obj = missionNamespace getVariable ["_tpbase", objNull]; What is that supposed to do?
A local variable in a global namespace can work. But doesn't make much sense
Transform the String back to an Object
because when i use _tpbase it says "Error Type String, expected Object"
_tpbase should be the Object where the Actions would be attached to
so you are passing a variable as a string to that function?
why?
Why not just pass the object directly?
and you are not getting a variable by the name of what's inside _tbase. You are getting the variable "_tbase"
which is probably undefined
how can i make this? Sorry i am really new to this kind
how are you calling that script?
[Objekt,1] call my_fnc_teleport
really?
did you copy paste that from what you are actually using
or did you just type that down
i type that down
Good
you fixed your bug while typing it down
How am I supposed to find your problem. If you fix your problem while typing it down?
😃
I actually expected to now get a copy paste of what's actually being used.. But I guess the problem solved itself?
by any chance does anyone here know the particle effect class that is spawned when a tank fires its main gun?
Is it possible to kill a unit with a script, but properly "award" a kill to a different unit?
How often can you make new waypoints?
for the ai using scripts
i tried 0.01 but they just got into an endless stream of "MOVE TO POSITION X" and didnt move
ok reducing it to 1s they start moving
@thorn saffron do you mean like a kil in the chat (X killed Y) or in the debriefing like : Your Kills or do you mean score? Or the leaderboard?
@thorn saffron I believe you can create a bullet and set "parent" (origin) a specific unit
I don't have much more info though
eh, I think I will just add a simple kill with set damage. I'm making a simple ACE action that will let you kill enemies if you get close enough to actually use it. You can actually get that close, if the stars align that is, but the enemy will not sense you even if you are right behind him, he will if you bump into him though.
ta-daaa
I added some code to make markers, and now my code is broken?? (No error, code just doesnt execute)
If I remove the marker code it works
What did I do wrong that makes it stop working? heres the marker code: ( i know its ugly )
_mrk = createMarker [("Mrk" + str(_this select 0)), (groupAmbush select (_this select 0))];
("Mrk" + str(_this select 0)) setMarkerText ("GRP:" + str(_this select 0));
("Mrk" + str(_this select 0)) setMarkerShape "RECTANGLE";
("Mrk" + str(_this select 0)) setMarkerSize [1, 1];
("Mrk" + str(_this select 0)) setMarkerColor "ColorEAST;
("Mrk" + str(_this select 0)) setMarkerBrush "Cross";
("Mrk" + str(_this select 0)) setMarkerAlpha 1;
Should I rework the code?
Or just abondon the markers completely?
you should store the marker name in a variable, to be honest
try to systemChat it, and see what it returns
He is already storing the markername in a variable
just not using it
_mrk = createMarker [("Mrk" + str(_this select 0)), (groupAmbush select (_this select 0))];
_mrk setMarkerText ("GRP:" + str(_this select 0));
_mrk setMarkerShape "RECTANGLE";
_mrk setMarkerSize [1, 1];
_mrk setMarkerColor "ColorEAST;
_mrk setMarkerBrush "Cross";
_mrk setMarkerAlpha 1;
...
Well..
I guess I can see why it's not working @tough abyss
createMarker 2nd parameter not being a position?
for real?
(on mobile right now)
does highlighting not work on mobile?
nope
oh, indeed 😄
cough " _cough _
btw was digging the "right icons" in ui_f folders and found that we have commy2 special variant for the vehicleIcons - iconManCommander2 lol
ohh dedmen how did u get that syntax highlighting 😛
Real question?
oh rip I thought that was in notepadd++ oooff
oooff > oop /s
hello, is it possible to create a parsetext and put an image as background and a text above it?
it would be used for a structuredtext control
how can i make it so AI is faster and more confident in landing?
alright quick q for people using the vehicle respawn module on a plane for when it gets shot down, I have it spawn with new crew with a code in the expression box _newVeh = _this select 0; createVehicleCrew _newVeh; However it just falls ace first to the ground on respawn. Is there something I can add that will make start flying.
Fixed it if anyone else has the problem this is the new expression code _newVeh = _this select 0; createVehicleCrew _newVeh; _newVeh setVelocity [60 * (sin (getDir _newVeh)), 60 * (cos (getDir _newVeh)),50]
Hello, I´m currently working on a mission for my group. A team of divers has to go through a tunnel and cut a gate with this addaction this addAction "Gitter durchtrennen","teleport.sqf",["exit_sea"]];
When using this one on land it works fine and the player gets teleported to a marked location. But if I try to use it underwater, the addaction doesn´t pop up. I wasn´t able to find anything related to it on google. Any Ideas? Thanks in advance.
does anyone know a return value to check if you are in the editor?
@chilly surge I've never used addaction under water, but you could try adding the action to the player itself and then putting distance to the gate as a condition
@tough abyss is3DEN
thank you
@fair drum Place an invisible helipad, or several, you can also set the ai to careless
also courage high value
and i always set behaviour to 'combat' for helis or door gunners will be too shy...😃
that is under heavy fire, kinda "extremely hot lz" lol > https://gyazo.com/ca393d8a2336cae86ed9257d0230777f
combat mode "red" behaviour "combat" and "courage" close to 1 ^
and no waypoints
just commands
move, land...
is it possible to swap between to weapons via scripting without the ugly empty hands animations these days?
maybe with eh "AnimChanged" speed up the animations with setAnimSpeedCoef (never tried it, just thoughts) 🤔
selectWeapon + switchMove?
switchMove to what exactly though?
to...
to something like that > "🔫😐 or 😐🔪"
😄
well the anim you want?
you want to switch from rifle to handgun? selectWeapon should do the trick, with a clean anim
if you want an instant transition, you would have to switchMove to handgun animation adapted to your stance
afaik they're different for every gun/type of weapon...
also custom variants from addons
if you swap one rifle to another
short question about missionNameSpace, doing this
missionNamespace setVariable [_key + "activeGroups",_activeGroups,true];
is the same as
myVar = "asdasdasd";
publicVariable "myVar"
Right?
can't be
missionNamespace setVariable ["myVar", "asdasdasd",true];
That would be the same as your publicVariable
😄
Is there a way to remove VR entitys mark on the map?
Hello, I have an error on this, it's telling me it is bool and not a number...
if ((0 <= _X1 <= 1) && (0 <= _Y1 <= 1)) then```
correct.
you can't use <= to compare bool to number
That's why you should always set all the paranthesis.
if (((0 <= _X1) <= 1) && ((0 <= _Y1) <= 1)) then
This is your code
Ohhh.....
After executing the first part.
if ((bool <= 1) && (bool <= 1)) then
You can't compare bool to number.
Still not working
I want it all to be considered as Number and not Bool
I don't want bool here
I just told you like.. 2 minutes ago
not true
then I don't understand ...
So... what is the system not understanding when I say 1 is 1 and not True
how can I adapt my code ?
You understand that 0 <= _X1 returns bool right?
no... for me in maths i learnt that <= was "Smaller or equal to"
Just say out what you want to test
you want to check if _X1 is bigger or equal to 0 and that _X1 is smaller or equal to 1. Right?
Yeah
So write that down as SQF code then
You can literally one to one translate that to SQF and it'll work.
yes.
being sacastic ?
Dedmen!? Sarcastic!? Never. 😄
tss
:heavy_math;
math sucks, man... use calculator /s
What type of position is used by camSetPos
I'm doing
private _camera = "CamCurator" camCreate (eyePos player);
_camera cameraEffect ["internal", "back"];
and it opens wayy above player (~10m)
I know what type is returned by eyePos.
I want to know what type of position is used by camCreate / camSetPos as I could not find this information on wiki.
veteran29, agl afaik
ty.
btw there ^ (posted few days ago) example with camera positions, maybe that will helps somehow
Not sure if this is the right place to ask, but..
am I right about these values when talking about vehicle damage?
white = 0.00 -> 0.29
orange = 0.30 -> 0.59
red = 0.60 - > 1.00
Hey guys, how would i go about setting multiple TFR Freqs on different channels that are pre-defined in an array? I was going to do [(call TFAR_fnc_activeSwRadio), 1, "142.2"] call TFAR_fnc_SetChannelFrequency; over and over (but changing the freq and channel), but i know there's an 'easier' way to do it, is it possible to do it in a foreach (i don't know much about this, but i'd think it would go something like this) private _freq = [[1,"142.3"],[2,"142.4"],[3,"142.2"],[4,"142.5"],[5,"124.1"],[6,"52.1"]]; { [(call TFAR_fnc_activeSwRadio), _x, _x] call TFAR_fnc_SetChannelFrequency; } forEach _freq; - is it possible for anyone to help me out?
The mod is called TFAR.
private _freq = [[1,"142.3"],[2,"142.4"],[3,"142.2"],[4,"142.5"],[5,"124.1"],[6,"52.1"]];
{
[(call TFAR_fnc_activeSwRadio), _x select 0, _x select 1] call TFAR_fnc_setChannelFrequency;
} forEach _freq;
thank you
Edit: Solved. Issue was scope = 2 forces it as an ingame marker, and to the top of the list.
I have a Custom Flag that is showing up as the 'default' marker when you open the map. That is, instead of the black dot, it is the flag icon.
I am unsure why this is happening and am having trouble finding information about it, does anyone know a fix?
I implemented it this way in an addon:
class CfgMarkers
class flag_Spain;
class flag_Spagistan : flag_Spain
{
scope = 2;
name = "Spagistan";
icon = QPATHTOF(gui\Spag_Flag_Square_ca.paa);
texture = QPATHTOF(gui\Spag_Flag_ca.paa);
size = 32;
};
};
#arma3_config maybe?
probably. always forget that section exists
so whats the proper way to do more than 1 line of code in a switch block?
switch (side player) do {
case west: {
hint "West";
player addItem "Something_West";
};
case east: {
hint "East";
player addItem "Something_East";
};
};
hmm i thought you couldnt add a ; at the end of the line? thought it had to be like case "blue": { _color = "blue" };
?
The last line doesn't need a ; if you want to return something
_color = switch (side player) do {
case west: {
hint "West";
"ColorBlue"
};
case east: {
hint "East";
"ColorRed"
};
};
_color will then have either ColorBlue or ColorRed as the value
ty
this addMagazineTurret "8rnd_SPG9_HE";
alright
What exactly am I messing up about the syntax
should I use the vehicle's class instead of this
also where do I find the turretpath.
seeing as how it's the mainturrret would 0,0 suffice?
this addMagazineTurret ["8rnd_SPG9_HE",[0,0]]; doesn't seem to work
@fringe yoke the semicolon is optional but it can work with it @icy light
What exactly am I messing up about the syntax
@jagged narwhal ammoCount (Optional): Number (since Arma 3 v1.55.133817) - required ammo count > https://community.bistudio.com/wiki/addMagazineTurret
https://community.bistudio.com/wiki/assignedVehicleRole returns which turret you are in.
is there a case insensitive alternative to find?
no.
AFAIK no but you can always do apply with toUpper
Intercept CBA has findCI.
Are you searching in a string or an array?
findIf might be an option for array.
@hollow thistle to upper might work, although I hope it won't slow down my incremental seach too much
Iam not using cba
and it's a string =/
yeah. toUpper/toLower then...
depending on how long your thing is that you are searching for. you could also run many finds with all permutations of upper/lowercase 😄
but just toLower is probably the fastest/easiest approach
Uhhh... Dynamic search... @alganthe do!
ähm what?
I see 😄
Is that a Music UI thingy?
Yes
Is it possible that I can get that as Zeus Module? My group does alot with music in missions. Currently we use a modified version of the normal Zeus module UI that also has a slider for a offset of when to start the track and I keep fixing that every month cuz it keeps breaking 😄
will you release that mod?
I will o7. We use that anyway
😃
I think our mission maker/zeus will do backflips when he sees that
We have a couple GB big music pack with hundreds of titles that we play mid-mission
If you can get it to work in Zeus 😉
But actually, it should it's not bound to eden in any way
I am just using my own music pack
With music from older arma titles
Just need to add a button that remoteExec's the music. And a second slider under the volume slider to select the start offset.
Easy enough
No sorting doesn't work anymore -_-
I hate it, fix one thing, break 2 other
can you sort/search by Theme?
yes
Hello . Anyone got a quick script i can borrow to extract all weapon classnames?
I just need to be able to dump an array of all weapon classnames to the .rpt file so that i can then import then to excel for some stuff
Yeah
Yup
It would be good to sort by type if possible aswell, but just dumping all weapon classnames will be fine
i found BIS_fnc_geCfgSubclasses, but it just gives me bin\config.bin/CfgWeapons
private _weapons = [];
{
if (isClass (_x >> "WeaponSlotsInfo") && getNumber (_x >> 'type') != 4096) then {
_weapons pushBack configName _x;
}
} forEach configProperties [configFile >> "CfgWeapons", "isClass _x && {(if (isNumber (_x >> 'scopeArsenal')) then {getNumber (_x >> 'scopeArsenal')} else {getNumber (_x >> 'scope')}) == 2} && {getNumber (_x >> 'ace_arsenal_hide') != 1}", true];
gobble gobble gobble https://github.com/acemod/ACE3/blob/master/addons/arsenal/functions/fnc_scanConfig.sqf
Stupid arma
Seems like onkeyDown and onKeyUp are not properly triggered by the backspace key
it's probably sth that cannot be rebound
you mean a control?
I'm slightly sure that whenever you hit backspace
It always shows the same menu
Maybe it cant be rebound
@cosmic lichen onKeyDown and onKeyUp mite not work
but did u trey any alternatives?
I tried onChar, but that obviously doesn't fire at all for backspace since it doesn't create a character
@peak plover, the weird thing is that backspace sometimes works, and sometimes not see: https://www.youtube.com/watch?v=cOqI_ljagVg&feature=youtu.be
Alright, I know the issue.
hmm
The keyDown and up Ehs, fire before backspace deleted the character
that's why the filter is sometimes not updating
Questions is how to fix that
I didn't get it before the video
You need to update the list when the text in the box changes
But there's no event for that
one way to do it is to make a loop, which checks if the text has changed
or you can try experimenting with doing the key down EH
Then spawning the function which checks if the text has changed( on the next frame )
You can still keep it kinda loop less
That's what I was t hinking
a small delay between keyDown and returning the text from the edit control
Sometimes the solution is quite easy
If onKeyDown is too fast, then why not use onKeyUp.
Works like a charm now
Yeah, thanks alot for your help!
hmmm quick question, is it valid?
while { alive enemyTank } do
{
["myMarker", 1] call BIS_fnc_moduleFDFadeMarker;
["myMarker", 0] call BIS_fnc_moduleFDFadeMarker;
};```
call will make the code "wait" if there is a sleep in there right? :3
also, does call still accept string as parameter?
call accepts ANY as parameter
call will execute the code synchronously
it will continue when the code inside the function is done
danke schön, mein herr
btw we have setMarkerAlpha Lou 😀
oh... i see 😉 (through you're using it somewhere... question was not for the wiki examples lol)
What?
patch 1.59 there is a limit of 1044 characters to be printed, no error or crash but diag_log line will simply end at character number 1044.
ahh, darn didn't see the comment
is it possible to use while loops like while {CONDITION == 1} do {
or does it always have to be like while {CONDITION} do {
I'm quite new to coding and was just wondering how it has to be
while { ... } do { ... }; Both are blocks of code.
If the first one returns true the second one is evaluated.
So you can put almost anything here.
lovely
just realised the reason why it wasnt working was because I was doing == instead of =
too much python coding 😐
? == is correct way to compare.
Thanks!
What sectors? You mean vanilla module?
yep, but scripted... customized a bit lol there are nothing on map
there're no variables or any conditions for the notifications, it's just shows when owner changed > line:678 https://pastebin.com/5t2s43Qf
with bis_fnc_mp lol
probably better option will be..."custom sector function" from scratch, with less... crap stuff and more options...
how to unattach object after using attachTo?
wow thanks
hi if ((_container getVariable ["trunk_in_use", ""]) != "") exitWith {hint localize "STR_MISC_VehInvUse"}; ı edit this for vehicle container
just useing 1 player
but trunk_in_use this wrong
I always wondered if there was a way to immediatly know the filepath of a config file for a default arma 3 addon by just having the classname. Is this something that's possible?
@civic canyon Yes, because executing local to that player will only execute for that player.
@lean estuary how do you mean "filepath" ?
_isVehicleClass = isClass(configFile >> "CfgVehicles" >> "BlahClassName");
Hey, wondering if there is a way to extract coordinate data for buildings, ai spawns, item spawns, etc, from Arma/DayZ maps, for use in a web interactive map.
I've been Googling the hell out of it, and asking on forums, with no luck yet.
Buildingpos
@gleaming oyster if ((_container getVariable ["trunk_in_use", ""]) != "") exitWith {hint localize "STR_MISC_VehInvUse"}; this is not working
to those developing extensions for arma in here and never bother to look into #arma3_tools , yes all 3 of you, you maybe want to check my post in there so you can debug your extensions easier and without the need to start arma
Can't teach an old dog new tricks 🤣
@arctic veldt just trying to convince him to use sqf-vm to test his extension instead of arma 😛
Where in the source files of Arma can I view the code for scripts? As an arbitrary example, say, setRank.
uhm ... setRank is no script but an operator
unless you know how to reverse engineer the game, you are out of luck to know how the backend implementation works
Ahh, okay. I've found a few /scripts under the Functions and Module pbos and was wondering if there was a dump of them somewhere. Thanks
Hello, community. I desperately look for a script to make drop in helicopter in multiplayer !!?
You can use an "unload" waypoint, it's shipped with the game ;-) @robust mountain
It does not work in multiplayer on a server normally. It's already tested.
is the group leader an AI?
@tough abyss Debug console has a "function viewer" button where you can view all the functions.
Script commands you can see on the wiki. And most functions are also on the wiki
Functions are easy to find, yeah, but the source code for some script calls seems to be difficult to find or unavailable.
show example.
What script calls? You mean commands?
setRank, for example. Some functions in arma 3 use hardcoded strings for ranks, and some check CfgRanks.
Both acheive the same thing
CfgRanks you can't add more entries to use with setRank
i can't find the source code for most Pre-Arma 3 stuff in general really
the method is different, doesn't mean the effect is different. Maybe with a custom rank system it might
publicly there is no source code for the command setRank
which is the bummer part, as setRank is more of an example
I don't understand your intentions to begin with. What are you trying yo acheive??
You wouldn't be able to modify the command with the raw source as it is.
look at commands/scripts/whatever that are not explicitly labeled as functions, as sometimes, such in this case, its unclear what is modifiable and what isn't.
i'm not trying to modify the source though...
setRank is a engine command. Not a function.
@peak plover local grpNull -> false
always
You can edit setRank command if you really wanted to.. But why ^^
@tough abyss setRank supports:
PRIVATE
CORPORAL
SERGEANT
LIEUTENANT
CAPTAIN
MAJOR
COLONEL
And that's it. Just as the wiki says.
and some check CfgRanks Yeah.. CfgRanks (If you'd look at config viewer you'd see that) contains these Rank names and also icons and additional info that can be used for display purposes
So if they use CfgRanks they prooobably are doing that to get the icon
probably, yeah. just one of those things that's partially config, partially hard coded I suppose. gave the CfgRanks an addition, and setRank will only accept those hard-coded values. Which is weird as the... set Rank Module, I think it is, or another rank call, checks CfgRanks. ORBAT does too.
although it was still mostly meant as an example to find source code, it is something i was fiddling with. i'll have to do ranks manually for my group then, ripperoni.
ohh okay thanks
Interesting.. CfgRanks has GENERAL but setRank doesn't.
😑
will be "unknown enum value" ©
General rank was added with the arma 3 campaign, I think, since as far as I know only ORBAT references it. when i'm well versed enough, i'd like to submit a tweak to Ace's Nameplates about it.
speaking of the above, I'm pretty green on multiplayer scripting. What would be a clean, non-bandwidth destroying way to add a string to all player units, that can then be accessed clientside to avoid nuking bandwidth (as it will be accessed with a draw3d handler)?
Strings don't destroy bandwidth anyway
unless you update a static string every frame over the network on every client....
just generate the string clientside and keep it there.
no networking involved at all
i'll give it a go, thanks
also 🥒 < after milk 👌
wanted broccoli. But no broccoli available
:sad:

private "_param1";
_param1 = {if (_forEachIndex == 0) exitWith {_x};} forEach _this;
private "_param2";
_param2 = {if (_forEachIndex == 1) exitWith {_x};} forEach _this;
uhhh
I found a way to edit cba wait and execute que
cba_common_waitAndExecArray = cba_common_waitAndExecArray select {(str(_x select 1)) find 'advanced_fatigue' == -1}
I wanted to remove ace advanced fatigue and replace with a mission specific version of that
make sure to execute that code in unscheduled
you might crap things up big time if you do that in scheduled
Ohh , yes good point
@still forum do you think this would work ? The objective is to make the weapon spin in circle...
while {true} do
{
// Make the weapon spin
if ((0 <= _X1) && (_X1 <= 1) && (0 <= _Y1) && (_Y1 <= 1)) then
{
_w1Launcher setVectorDir [_X1, _Y1, 0];
_X1 = _X1 + 0.1;
_Y1 = _Y1 - 0.1;
};
if ((0 <= _X1) && (_X1 <= 1) && (-1 <= _Y1) && (_Y1 <= 0)) then
{
_w1Launcher setVectorDir [_X1, _Y1, 0];
_X1 = _X1 - 0.1;
_Y1 = _Y1 - 0.1;
};
if ((-1 <= _X1) && (_X1 <= 0) && (-1 <= _Y1) && (_Y1 <= 0)) then
{
_w1Launcher setVectorDir [_X1, _Y1, 0];
_X1 = _X1 - 0.1;
_Y1 = _Y1 + 0.1;
};
if ((-1 <= _X1) && (_X1 <= 0) && (0 <= _Y1) && (_Y1 <= 1)) then
{
_w1Launcher setVectorDir [_X1, _Y1, 0];
_X1 = _X1 + 0.1;
_Y1 = _Y1 + 0.1;
};
sleep 0.1;
};```
I don't know exactly what you are trying to do.. Do you just want to rotate it around it's own axis?
For one you could do
while {true} do {
// Make the weapon spin
if ((0 <= _X1) && (_X1 <= 1) && (0 <= _Y1) && (_Y1 <= 1)) then {
_X1 = _X1 + 0.1;
_Y1 = _Y1 - 0.1;
};
if ((0 <= _X1) && (_X1 <= 1) && (-1 <= _Y1) && (_Y1 <= 0)) then {
_X1 = _X1 - 0.1;
_Y1 = _Y1 - 0.1;
};
if ((-1 <= _X1) && (_X1 <= 0) && (-1 <= _Y1) && (_Y1 <= 0)) then {
_X1 = _X1 - 0.1;
_Y1 = _Y1 + 0.1;
};
if ((-1 <= _X1) && (_X1 <= 0) && (0 <= _Y1) && (_Y1 <= 1)) then {
_X1 = _X1 + 0.1;
_Y1 = _Y1 + 0.1;
};
_w1Launcher setVectorDir [_X1, _Y1, 0];
sleep 0.1;
};
you are rotating it horizontally and vertically. I would only rotate horizontally. Like on a turntable
Indeed, that would be better
And why not just use setDir?
Oh ... I hadn't thought that basic ... good point indeed
while {true} do {
_X1 = (_X1 + 0.1) % 360;
_w1Launcher setDir _X1;
sleep 0.1;
};
could you explain ?
_X1 = (_X1 + 0.1) % 360;```
The % 360 is modulus
If number is >360 then it cut's 360 off
so it goes 359.9 -> 360.0 -> 0.1
Does anyone know of an eventhandler that will allow me to tell when a vehicle is disabled (tracks or engine). I wasn't able to find one on the Wiki's EH page, but maybe there is another way to detect this?
HandleDamage
Yeah if there's no event handler for something then you must periodically poll it
Don't know how a vehicle could damage it's tracks without HandleDamage
Yeah ok, was trying to avoid handle damage. I would just get it from the hitpart parameter i assume then?
It might still work anyway, so thanks again.
what's the command to add items to containers? addCargoGlobal and addCargo won't work
trying to add a set amount of magazines and weapons into a supply box
do I need to specify in the script what box i'm going to use
How else is it supposed to know which box you want?
ok. sorry for the stupid question. thanks
how about this?
[[[],[],[],[]],[[[],[]],[[],[]],[["rhs_mag_30Rnd_556x45_M855_Stanag"],[80]],[[],[]]]]
I got it from the Ares Achilles copy clipboard, but it doesn't work if I paste it directly, any way to manipulate this so that I can directly paste it on cargo nets?
dunno what that's supposed to be
not a valid parameter for any of the commands linked above
You probably want to use addMagazine for that. SO
_box addMagazineCargoGlobal ["rhs_mag_30Rnd_556x45_M855_Stanag", 80] I guess
ohh so that's how you do it, thanks, i got confused with the first part "box" since Cargo Net [NATO] B_CargoNet_01_ammo_F wouldn't work
error: undefined variable in expression "_box"
There again is the question "How else is it supposed to know which box you want?" There are a dozen boxes with same name on the map. The game can't read your mind
where are you executing that code?
zeus, modded, noteable mods, rhs and ares achilles
trying to add the items to the CargoNet [NATO] since it has the largest capacity AFAIK
Didn't ask that question...
where are you executing that code
aka in which text box or file
"where are you executing that code?" sorry I'm stupid, what did you mean by this?
as zeus, when I double click on containers, a window pops up with execute on it, I usually just paste the scripts there
is this what you meant?
yeah..
But I don't know that thing so it's probably from a mod
you could try _this instead of _box
yeah it worked..... so now, how to add a different type of mag?
_this addMagazineCargoGlobal ["rhs_mag_30Rnd_556x45_M855_Stanag", 80],["the other mag",10]
will this work?
so I can't pile them up in a single script/ at once?
yes you can.
That's what I just told you to do ^^
_this addMagazineCargoGlobal ["rhs_mag_30Rnd_556x45_M855_Stanag", 80];
_this addMagazineCargoGlobal ["the other mag", 10];
_this addMagazineCargoGlobal ["rhs_mag_30Rnd_556x45_M855_Stanag", 80]
_this addMagazineCargoGlobal ["the other type of amg", 80]
aahh I see oooohh, and same goes for the weapons?
ye
what about uuuhhhgg
removeAllWeapons this;
removeAllItems this;
removeAllAssignedItems this;
removeUniform this;
removeVest this;
removeBackpack this;
removeHeadgear this;
removeGoggles this;
_this addMagazineCargoGlobal ["rhs_mag_30Rnd_556x45_M855_Stanag", 80];
_this addMagazineCargoGlobal ["the other mag", 10];
this won't exist
_this then
But you might be able to guess what you c... 😄
Not sure if they work. As they are for Units not boxes
Can anyone tell how to determine the maximum load unit can handle before he gets exhausted by gear? Some max value according to loadAbs?
Nvm found it explained in load
_vehicleData = _vehicle getVariable ["vehicle_info_owners",[]];
if (_vehicleData == player) exitWith {hint "Aracın Anahtarı Yok"};
they for this If the vehicles are not locked, the trunk menu should not be opened without the car's key
These are correct ?
Well that’s just going to give you a generic error if the variable is undefined
private ["_vehicle","_veh_data","_unitsnear","_vehicleData"]; @ruby breach
Doesn’t matter. Still going to give you a generic error if the vehicle_info_owners variable is undefined on the _vehicle
_vehicle = [_this,0,objNull,[objNull]] call BIS_fnc_param;
if (isNull _vehicle || !(_vehicle isKindOf "Car" || _vehicle isKindOf "Air" || _vehicle isKindOf "Ship" || _vehicle isKindOf "Box_IND_Grenades_F" || _vehicle isKindOf "B_supplyCrate_F")) exitWith {};
like this ?
@ruby breach
That has nothing to do with the potential for a generic error I mentioned
Assuming that you copy-pasted _vehicle getVariable [“vehicle_info_owners”,[]]; from somewhere that it actually works, comparing it to player is always going to return a generic error.
We can't tell you how to fix something while we don't know what it's supposed to do
Give us more details. At best all the details.
Show us your whole script. Where did oyu get "vehicle_info_owners" from.
What are you trying to do. And why are you trying to do it like you are doing it.
Hello, How can i get the nearest vehicule of an npc classname??
of a classname? really?
What if there are many npc's with the same classname? just choose a random one?
Maybe they mean in the sense of stringdiff
^^
I have my static npc (name: xyz_npc)
In a round of 10 meters around "xyz_npc" I would like to get the nearest vehicule classname
name or classname?
classname
Nop
vehicle aka Car? or.. Tank/Helicopter/Jet/Boat?
All vehicles
private _npc = allUnits param [allUnits findIf {typeOf _x == "your classname here"}, objNull];
private _nearestVehicle = nearestObject [_npc, "AllVehicles"];
private _nearestVehicleClassname = typeOf _nearestVehicle;
Thre ya go
Do you consider a house to be a vehicle? 😃
Car, planes, boats, etc....
or stuff with seats?
But some drones are vehicles but have no seats
Right but thats not a problem
Dont we have an eventhandler that triggers when vehicles are being repaired? 🤔
@still forum The first question I asked was resolved
What is the difference between: ```sqf
-defines.hpp
// Defines all players who should be promoted to zeus upon connection.
#define zeusUIDs ["xxxxxxxxxxxxxxxxx", "xxxxxxxxxxxxxxxxx"]
// Defines all modules. Each module is connected to the player in the above list.
#define zeusModules [zeus0, zeus1]``````sqf
-init.sqf
zeusUIDs = ["xxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxx"];
zeusModules = [zeus0, zeus1];```
with
#define zeusUIDs ["x","x"];
it'll replace zeusUIDs with ["x","x"];
#define zeusUIDs["x","x"];
hint format["%1",zeusUIDs]; //["x","x"];
the zeusUIDs = ["x","x"];
will be stored in memory and have the ability to be available on the pc or other pcs.
Does this have an affect on the usability of the variables zeusUID and zeusModules, either of these uses?
Nope. Not that I know of.
Do they achieve the same thing, different ways?
Sure. One is stored in memory ,one is not.
So the defines cannot be changed?
During runtime? I don't know for sure, but my guess would be no.
the x's are PlayerUID's which option do you think is best?
I think the below example would be faster. However, I don't know which would be best.
depends on where and when you need to access it I guess. iirc #define will only set the definition inside that script and nowhere else. So.
Do you think it would be effective to have a foreach for the zeusModules, so that zeusUID could be changed multiple times?
forEach for what array? why would zeusUID need to change?
Able to add more ZeusUID in-game.
Without stopping the mission, to mess with configs.
just make a fnc that acts as a setter for the _zeusUID variable. Which in this case it sounds like you may just want to use the below example you provided
Yup. I thought so.
@gleaming oyster hey i'm trying to do a reverse check on if my unit is in the vehicle. i want to do something like this if ((p1 in boat1) = false) then {true} in my condition box but idk how to get my syntax correct
!(p1 in crew boat1)
mk thanks. how would i go about pausing between lines of code in a trigger box? i can't use sleep in triggers im guessing.
like if i want playsound "Alarm" to play 3 times with 3 seconds in between when trigger condition is met
Hi, I'm new in scripting arma 3, and need one help, hoy put info to intel archive? and change the trigger how completed in the condition of the trigger? sorry my bad english my language native is spanish 😃
am, Hello?
@drowsy axle Does this have an affect on the usability of the variables zeusUID and zeusModules, either of these uses Yes.
#define is a preprocessor command. They are resolved before your script is compiled. Meaning
#define zeusUIDs ["xxxxxxxxxxxxxxxxx", "xxxxxxxxxxxxxxxxx"]
#define zeusModules [zeus0, zeus1]
zeusUIDs = ["xxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxx"];
zeusModules = [zeus0, zeus1];
will get preprocessed to
["xxxxxxxxxxxxxxxxx", "xxxxxxxxxxxxxxxxx"] = ["xxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxx"];
[zeus0, zeus1] = [zeus0, zeus1];
which obviously won't work at all.
@still forum They weren't to be used together they are separate. If I was to use one, the other won't exist.
As a beginner you shouldn't touch macros if you don't really need them
Are macros only "local" to the script scope? file scope maybe?
file
@still forum ??
Mh?
I'd say don't use macros. They make no performance difference in your case. Only thing you might wanna use them is that no one could just edit the variables. But there are also other ways around that without using macros
Quick performance question, when using setVariable and applying a value that the variable already has, does the engine already check to see if the variable needs to be updated?
No. That would take about the same time as just updating it
Alright cheers
_animDuration = 9.09091;
_animLastTick = time;
player playMoveNow "AinvPknlMstpSnonWnonDr_medic0";
while {true} do {
if ((time - _animLastTick) > _animDuration) then {
_animLastTick = time;
player playMoveNow "AinvPknlMstpSnonWnonDr_medic0";
};
};
So I'm trying to loop a CPR animation which happens to work completely fine with a smooth transition in the animation viewer through the debug console. I looked into fn_animViewer.sqf, and I've copied how they loop animations but for some reason it is working nothing like it does in the animation viewer. Any ideas?
that while true loop get some sleep
because it loops endlessly till the 3ms limit (or 10k maybe)
what does "working nothing like it does" mean?
Yeah this was just for testing it won't actually be an endless loop like that. And when I say it works nothing like it does in the animation viewer. In the animation viewer, the unit stays crouched the whole time performing the CPR animation and looping it over and over. But when I run this script, it plays the animation, then the player ends up standing up before the animation plays again a few seconds later.
Made no difference unfortunately. Could it have anything to do with the fact that I'm using playMoveNow, rather than switchMove like the animation viewer? It's just when I use switchMove, it is even more buggier and doesn't even play the animation properly.
I don't do animation stuff. Don't know.
But it should definetly make a difference if you restart the animation sooner. Maybe your loop always is too late because of scheduled. You could use AnimChanged EH instead to wait for when the unit tries to get into a different atnimation.
Can anyone send me the content of BIS_fnc_listCuratorPlayers?
OMFG.. And i was using that crap in TFAR. Thanks alot.
Rewrite for that horrible abomination of a function from @south rivet
(allCurators apply {getAssignedCuratorUnit _x} select {!isNull _x})
In case anyone else needs that.
There's a lot of BIS functions that could do with a rewrite lol
It doesn't consider duplicates in allCurators though. But I don't see how that could ever happen.
I'm running allPlayers select {isPlayer _x} does anyone know if that makes sense? There is probably some weird Arma quirk in there that needs that?
lol
allPlayers returns headless clients as well, not sure if isPlayer would filter those
Apparently, isPlayer also gives true for headless clients
So I guess that code doesn't make much sense
Did someone know a script to have more control on a map marker? (Like change the heading of the marker)
Ace do that, but i'm searching for a serveur side script
Did someone know a script to have more control on a map marker? (Like change the heading of the marker)
_marker setMarkerDir 120;
😃
Has anyone got an idea how I could create a preview of a briefing text (Custom UI) on the fly? For example a text like this ? The new MBT Kuma is equipped with an <font color='#A52A2A'>Active Protection System</font color>, short APS. It's able to detect and successfully destroy incoming missiles. However it cannot destroy all incoming projectiles and it has it's ammunition limited to <font color='#A52A2A'>10 shots</font color> per side. The system needs <font color='#A52A2A'>1.2 seconds to reload</font color> after every successfull defence.
How to change callsign?
[West,"HQ"] sideChat "Hello World!"; Chat is displayed as CROSSROAD "Hello World!"
I want to change callsign CROSSROAD into HQ: HQ "Hello World!"
identity: String - class name of one of the identities in CfgHQIdentities. Possible identities in Arma 3 are:
Short answer: can't. HQ == CROSSROAD.
Long answer: Make a mod.
Thx Dedmen.
@quasi rover maaaybe by replacing Crossroads stringtable entry in your mission's stringtable, but not sure if it still works
I wanted 'PAPA BEAR', but couldn't… I created a logic and gave an identity with the name 😃
^ other long answer alternative
Hey, it's less than 1000 chars
i have in one mission this >
private _moduleHQ = createGroup west createUnit ["ModuleHQ_F", _position, [], 10, "CAN_COLLIDE"];
missionNamespace setVariable ["BIS_HQ_WEST", _moduleHQ call bis_fnc_modulehq];
HQ ^
oh also...
to make it custom
_moduleHQ setvariable ["callsignCustom","customNameHere"]; < afaik this way, for that way ^ 😃
There is no thing to block getout from vehicle with handlers? Because i tried with GetOut, GetOutMan and Action with inGameUISetEventHandler, but nobody works...
blocking the action should definetly work
🤔
ah!
might be that exitWith in EH's doesn't work
any other code in there?
you could just
seatbelt && _this select 3 isEqualTo "GetOut" without the if
well why should they work? Wouldn't it cause unforeseen consequences if it did? Just exit like that without terminating the EH?
exitwith + eh = shouldn't work correct?
if the code inside exits would the eh exit as well or would it remain a shell?
Don't exactly know why it doesn't work
Commy said eventhandlers don't work with exitWith ^^
He wrapped them in a call {} to work around that. I didn't investigate why it happens yet
what if the return was true inside the exitWith? Wouldn't it do the same exact thing since if you have a true return inside exitWith it creates a new scope?
as I said. I don't know
something is breaking it if you try to return with exitWith
@compact maple #rules
no cross-posting.
It's either #arma3_config or #arma3_model Just give someone time to answer
Ok tnx
custom arty system (wip) in action - https://youtu.be/uKGzWkKDwdY
I tried, it brokes with exitWith, but works with then. Thank you @still forum
@austere hawk Nice job so far, thanks for the share.