#arma3_scripting
1 messages · Page 614 of 1
you could just store a timestamp in global variable and compare it with current time to see how much time has passed since you last update the timestamp
What would be the best way to do that from a script which is constantly called from a kill event handler? I tried one with a while loop and it started consuming resources due to it firing off the while loop repeatedly.
what do you mean constantly called from a handler? if you update the timestamp in the kill handler you can find out when's the last time a kill event happened
So I got the kill handler in another file, it executes this script when the player gets a kill: https://discordapp.com/channels/105462288051380224/105462984087728128/748429884677685300
Which has multiple things that it does, it stacks a variable and what I'm trying to do is make it so that somehow a timer is started which executes code when a timer of some sort is expired, currently demonstrated by the sleep 15; in my script above, but I'd like to add time to it, I think I could probably use BIS_fnc_countdown in some way, but I'm not sure how to do so without making a while loop check if the BIS_fnc_countdown is finished. I'm very very tired rn so I'm trying hard to explain it clearly
do -not- code while tired. rest on it, then come back
using sleep is unnecessary. my idea
pseudo code:
if isNil "expire" then { expire = time + 15 };
if (time > expire) then {
// do timer expired stuff
};
if <want to add 15 seconds> then {
expire = time + 15; // or expire = expire + 15 depending on your requirements
};
that way your script can decide if it's time to expire or it should extend the expiration date
The sleep timer needs replaced with something better, I'm trying to find a method I can interrupt and add to it to extend. I have the sleep in currently for demo purpose but it does work, but it stacks that entire if statement then eventually you have it setting your killstreak count to 0 multiple times overwriting kills, everytime you get a kill. I'll see if I can't use that tomorrow after some rest. :p
I was doing some more research. Is holdActionAdd more MP friendly than addAction?
no
Aight.
I tried following Hypoxic's advice and use remoteExec on say3d inside an addaction and have been bashing my head trying to figure it why it wouldn't work. I also can seem to find much on making addaction MP friendly.
Also should I avoid putting stuff inside an obj init and use execVM to preload stuff from an sqf or is that bad practice/may have issues.
avoid init fields like the pest yeah
they get executed for server + every client, and connecting ones
if you only use one script once, execVM is fine
otherwise, make a function - it gets loaded in RAM once
So for one time addactions n such execvm is fine got it.
execVM reads from HDD/SSD, preprocesses, compiles, then run every time
CfgFunctions does reads from HDD/SSD, preprocesses, compiles and keep in RAM -once-, then you can call the code anytime
I have put up 4 markers on Stratis, do anyone know how I can make players spawn randomly in the area inbetween the 4 markers? I know I got to use setPos, but not how to designate the area between the markers or how to make the setPos randomly apply to that area.
unfortunately I can't post pictures here but I have an example picture.
you can post a link to the picture (with a description), but I think we figure your situation well with this description 😉
There we go 🙂 (Trying to make players randomly spawn anywhere within the blue lines)
oh, that's not the same as what I had in mind indeed - that's spawning in-between the markers yes, as you stated
you can use a random position with inPolygon (see https://community.bistudio.com/wiki/inPolygon)
Hell yeah, thank you!
Do I understand it correctly that you can have more or less "infinite" number of positions in the polygon?
at least thats how I understand this array of Position3D positions in format: [position1, position2...., positionN]
=) my pleasure
Do you know what the first parameter is for? The Position3D format that is before "inPolygon"?
the position to check?
Yeah
private _markerNames = ["marker_1", "marker_2", "marker_3"];
private _markerPositions = _markerNames apply { getMarkerPos _x };
private _pos = [0,0,0];
while { !(_pos inPolygon _markerPositions) } do
{
_pos = [random worldSize, random worldSize, 0];
};
a *bit* raw, but it works
Ah nice, I see what it does, pretty much exactly what I'm looking for!
free of charge
Thanks, I'll use it then! 😄
what the hell with setDir command? :D It works from time to time correctly, but sometimes it doesn't work. Object returns to default direction... sometimes :D
setDir then setPos?
Without setPos
@rustic plover result?
thank you, Lou <3 yeah, setPos does correct synchronization!
Is is possible to play a sound (like with playSound3D) but make it possible to stop it mid way though?
What I am basically going for is to enable players to emmit a sound (like music for example) from there vehicle via an action in the "mouse wheel menu" but I also want them to have the ability to stop the sound even midway through the sound file.
Is that doable in any way?
kind of, yes
next patch will bring us reference to the soundsource, but before that you can grab it with a nearestObject command "#soundsource" - then delete it when you want
I found the createSoundSource-command in the community wiki but it appears that it can only play certain predefined sounds...
I don't want patches, I want my completely revamped Engine, Arma 4 >:(
Wait were they revamping it or were they making/using a new engine, I already forgot.
new one - Enfusion
This says it's similiar to C# being an Object-Oriented Scripting Language.
If it's closer to C# I will have a much better time writing and making scripts.
Ahh, it is similiar to C# purrrfect.
Me too, used to code plugins for another game in C#...
I straight up made games in C#, making Command Line Games and UI Games.
Though my Command line games were more fun and better made, I suck at UI :D
I'm not a programmer so I have to start from the beginning.
well... this looks complicated
@fair drum 90% is trial and error... 😉
Python and C# are languages I would recommend to new programmers or beginning programmers.
Python to learn Syntax, because it's a very nice language and really easy, first language I learned.
ive started hyperskill on jetbrains for python
Python, a nice language... 🤣
C# on the other hand... 😌
@fair drum I would advise you to start with higher, Object-Oriented languages because in my opinion it is easier to understand in and of themselves but also because they are a bit closer to the real world.
They also alot more readable than C, Python etc.
there a good learning platform like how python has jetbrains/hyperskill?
Hey all, I was hoping someone could help with this confusing issue I am having. I am working with ACE interaction framework and scripting in the actions to work with Booleans so far it works fine. But when I get the object to attach to another using attach the object for some reason resets and then shows all the actions again and if I activate the same action to attach the object it then has all the other actions disappear. I've been trying to think why this is happening, does anyone have an idea?
Can you give an example of what/how you're doing it? Because that one sentence explanation is also confusing
_iedHide= ["EODS_Hide_IED","Hide IED in Object","Icon",
{
private ["_ied","_object","_newObject"];
_ied = cursorTarget;
_newObject = nearestObjects [player, EODS_IEDS_PCU_OBJETOS_ESCONDER, 3];
_object = _newObject select 0;
_ied setVariable ["EODS_IED_Hide",false];
_ied attachTo [_object,[0,0,-1]];
},{(cursorTarget getVariable ["EODS_IED_Hide",true])},{},[], [0,0,0], 100] call ace_interact_menu_fnc_createAction;
So I am using Ace Interaction and according to certain actions being completed it will show certain actions. Simply when this is true off the start it will show and when its the action is selected and then the object is attached it should hide itself again. Simply it works but for some reason all the actions re appear on the object if that makes sense. In note, when the objects are not attached it works fine but when they are are the variable becomes true again
I hope that makes a bit more sense
what can I add to help get voiceovers while riding in helis more clear? there a way to decrease the sound of vehicles?
I suggest the fadeSound command.
will that affect a playSound command?
like lower it as well?
i guess it wouldn't if i send the voiceover through a radio channel
Don't know, you'll have to try.
it appears that fadeSound does nothing. I set it to 0 expecting to mute which it didn't, and then soundVolume returned the standard unchanged "1"
@crisp cairn I'm not quite sure, but I believe that it is possible that cursorTarget might return the object that your IED has been attached to (_object in your code). If that is the case, then cursorTarget getVariable ["EODS_IED_Hide", true] can't find your variable ("EODS_IED_Hide") in _object's namespace, so it returns the given default value, true, and the action is shown.
@fair drum Did you use the correct syntax time fadeSound volume?
update: looks like ACE handles sound volume so you might have to disable their handler...
ace_hearing_disableVolumeUpdate = true
so all in all...
ace_hearing_disableVolumeUpdate = true;
5 fadeSound 0.3;
sleep 5;
playSound "blah";```
this works^
@winter rose is this worth a wiki mention considering a large amount of the community uses ACE? otherwise fadeSound will not work.
@willow hound Ye I think I understand, so what do you suggest?
@fair drum no, it should be on the ACE wiki
@crisp cairn You could try changing the condition to cursorTarget getVariable ["EODS_IED_Hide", false].
How can I turn off or disable the landing autopilot on a vehicle? The problem is that whenever you release UAV controls it autometically turns on the landing autopilot causing it to move to the next landing site.
You can disable a UAVs autonomy @vague geode
but that disables all autonomous movements
@oblique arrow Even that doesn't work.
Hm odd
How do I stop onMapSingleClick?
https://community.bistudio.com/wiki/onMapSingleClick
When I do the below the onMapSingleClick that has my code doesn't run.
this addAction ["<t color='#FF0000'>Send to</t>",
{
onMapSingleClick '
MyCode;
true';
onMapSingleClick '';
}];
well, you define onMapSingleClick then remove it immediately
it is also recommended to use BIS_fnc_addStackedEventHandler instead
(see https://community.bistudio.com/wiki/onMapSingleClick)
So I need to wait until my script reaches the result I want then run the empty one?
Running this in an objects Init.
onMapSingleClick {
hint "yay!";
onMapSingleClick {};
};
That worked, thank you Lou. I promise I will make the jump to .sqf at some point.
it's not just that, it's that another script or mod can override the one-instance onMapSingleClick
Having some difficulty, I'm wanting to add an action to a player when they step inside a trigger and remove it when they step out of it, but its not working. Tried removing it from them in the "On Activation" box, but there isn't a thisList variable to get a list of people inside the trigger
add the action once forever, and set its condition to be "player inArea myTrigger" @ornate marsh
ah right, so in the init.sqf, or initPlayerLocal.sqf?
initPlayerLocal I suppose
@warm hedge @fair drum
sorry didnt see the responses.
ABDDN_SERVER_MILITARYRIFLELOOT = ("true" configClasses (configfile >> "CfgWeapons") select {(getText(_x >> "cursor") == "arifle") && (getText(_x >> "DLC") == "")} apply {configName _x});
appreciate the addition comments regarding the DLC requirements. still brain storming how to make it more modular to accept other mods/DLCs if the server allows. always something 🙂
that still needs some additional filtering, because it's spawning rifles that aren't actual objects. not sure what thats about yet. can share once i get that squared away
IIRC, you may need to spawn the weapon holder instead of the weapon itself
Hi how do i make an ai character leave the squad with a trigger?
[unit] join grpNull;
is there a way to reference high command units instead of group variable names? like if I want the first 3 high command units to do something without relying on the same groups from spawn being there
Also isn't your pfp enough to be 🔨 ed?
I believe the rules don’t mention pfps, simply derogatory behavior
I knew one who kicked from the server because of “illegal symbols,” anyway better to discuss further in #offtopic_arma
However I would understand if a mod took issue because of the rules wording, “zero tolerance policy”
e.g a nazi flag would be a big no, a finger… iiiiiideally it would be changed, but imo not kick-worthy. Anyway, #arma3_scripting 😉 (#discord_server to discuss about #rules)
My original question pertained to an EMP script by ALIAS. I encountered an issue where a variable wasn't being defined and I was hoping to get some help from somebody whether to attempt to locate the issue or suggest a new script. I'm just looking to have an EMP go off and remove/disable a few items such as GPS devices, TFAR radios, flashlights, night vision devices, helicopters/tanks. Whether the script has visual effects isn't important, just the effect. I appreciate any assistance!
Removing, would probably be the easiest solution here, as TFAR disabling has been buggy as of late.
I've got a smidget of code to simply modify the range of radios which works just fine
Problem is, can't remove ILBE radio backpacks without disappearing other items
Well believe it or not, the 152 is meant to be able to withstand nuclear fallout and EMPs
You could scramble the LR frequencies, every few seconds.
I had figured the circuits were hardened, though for the sake of the experience I'd be willing to look past it.
What do you mean scramble?
So, every idk 1 second, set their frequency to a random integer between 1-80
So you're scrambling their frequencies, so they can't be used.
Alright, thats actually a great idea. Only a handful of people carry 152s, most carry 7800s. how would I go about scrambling long range radios?
I don't have anything on hand as I'm on my phone, but you'll want to look for the framework for TFARs frequencies then how you can script set them
I'm not 100% off the top of my head and writing pseudo code on the phone is awful.
Yeah, no worries. How difficult is it to remove items from inventories?
My end goal is to place an asset, have it become the center of the EMP, range the emp spherically, and be able to set it off during a mission
messing with radios, dropping helicopter systems, messing with tanks, and removing some items from inventories
Not that hard, you just need to know the items name or ID
If you have ACE Arsenal, just hover over the item and throw bottom name with _ is the item name.
Yep! I've actually already got them
Yeah, then you'll just be doing a check to see if the player has it.
Honestly I would make an array with all the items you want removed from inventories, then have it check through the array for a matching name.
Save you a lot of lines in your code.
That's what I've got so far, I copied in assets I wanted into the other script I found
forEach*
{
private _soldier = _x;
{
_soldier unassignItem _x;
_soldier removeItem _x;
} forEach ["obj1", "obj2", "obj3"];
} forEach _soldiers;
```@unborn drum
yep, to replace the _x so you can have two forEach
basically _x is for each obj removed
_solider for each player
gotcha
To be sure, I'm to make an .sqf file that contains that bit of code as well as the TFAR long-range scuffling, and simply execute it from zeus using an Achilles module? How would I go about limiting the range of the effect to a sphere around an asset?
Use Zeus Enhanced, Achillies is outdated.
I use both
They're the same but, I believe if I'm not mistaken its radius you choose by default will be spherical.
There are differences between the two and I like elements from each. As for the radius, could you point me toward how to select the location to which the range emanates from and how to define the range?
That is where I will blank, as I'm not sure how to make a custom radius deal.
Haha, alright. I really appreciate the assistance!
is it possible to rebind or disable an inputAction?
you can "intercept" it with UI event handlers yes
i want to use shift p but it is already bound to something, and theres an action for this. just to check this would be the correct way to go about this right
Shift+P is DLC menu shortcut iirc
yeah
so if i use a display event handler on on key down, filter out the necessary keys then what?
then that's it
So I seem to have a performance issue in my mission.
Currently I have this in my "init.sqf":
// Mission Init
[] execVM "scripts\missionIntro.sqf";
[] execVM "scripts\missionParams.sqf";
[] execVM "scripts\objectClasses.sqf";
[] execVM "scripts\mainTask.sqf";
[] execVM "scripts\playerSpawn.sqf";
[] execVM "scripts\vehicleSpawn.sqf";
[] execVM "scripts\minefieldSpawn.sqf";
[] execVM "scripts\airdropSpawn.sqf";
How would I go about making it better? Because currently one of the scripts gets an error, unless I comment another one out. (Even though they're not related and doesn't share any variables)
So it would seem there are 1 scripts too many getting execVM'd.
I've read that you can precompile and that using execVM the way I use it shouldn't be practiced.
An example on how I should rewrite that "init.sqf" would be appreciated.
"AirdropSpawn.sqf" will be run several times throughout the mission, but the others will not. The mission will have no JIP.
@brittle dock the issue is not the amount of execVMs, the issue is what is in them
if you have code that will be run multiple times, better make it a function yes (to prevent reading from the disk multiple times)
Ah I see, yeah I use for "_i" from 1 to 100 do for the minefield script to spawn them randomly, same for vehicles but to a lesser amount.
I'll check up on functions.
Btw, I've seen examples like [4] execVM what does the number 4 do?
it simply passes it as a parameter to the script @brittle dock
[1, "two", true] execVM "myFile.sqf";
// myFile.sqf
_this; // [1, "two", true]
params ["_param1", "_param2", "_param3"];
_param1; // 1
_param2; // "two"
_param3; // true
Ah okay, thanks
trying to intercept the shift + p bind via event handlers, not working though. is it displayAddEventHandler I need to use or something else?
findDisplay 46 displayAddEventHandler["KeyDown", {
_isShift = _this select 2;
if (_keyCode isEqualTo 25 && _isShift) exitWith {
// shift p
diag_log "disabled shift + p";
};
}];```
@winter rose can you help? ive got no clue whats going wrong
oh thanks, i thought it said it didnt return anything
yeah its not even printing the debug text. do i need to put it anywhere else apart from the init.sqf?
it's a UI event handler
look at your first message
findDisplay 46
this is your main display, you're adding the handler "keydown" to it. Which fires when a key is PRESSED
if your code returns TRUE then it overrides DEFAULT behavior
got it, but im pretty sure the if statement isnt passing
? , doesn't matter where.
it's literally whatever the last condition was
(findDisplay 46) displayAddEventHandler["KeyDown",{
(primaryWeapon player != "") //this would either return true or false, override or not.
}];
yeah i see, ima try that, thanks
yeah its not working in my init.sqf
like, a diag_log isnt even getting printed
waitUntil{!isNull (findDisplay 46)};
if(local player) then {
(findDisplay 46) displayAddEventHandler["KeyDown",{
diag_log format["Key Pressed: %1",_this # 1];
}];
};
thanks :)
👍
Can I put code into the a waypoints completion condition followed but some code that checks is the execution was successful and then returns a boolean?
E.g. waypoint setWaypointStatements ["(vehicle this) setFuel 1; waitUntil { fuel (vehicle this) == 1 }; true;", "systemChat format ['The vehicle of %1 has been refueled.', name this];"];
Can I put code into the a waypoints completion condition followed but some code that checks is the execution was successful and then returns a boolean?
E.g.
waypoint setWaypointStatements ["(vehicle this) setFuel 1; waitUntil { fuel (vehicle this) == 1 }; true;", "systemChat format ['The vehicle of %1 has been refueled.', name this];"];
Ok, the answer is yes, but not as shown above.
What you can do is: waypoint setWaypointStatements ["(vehicle this) setFuel 1; (fuel (vehicle this)) == 1;", "systemChat format ['The vehicle of %1 has been refueled.', name this];"];
can i use spawn inside of a function to spawn another function?
doesnt seem to be working
_testFunc = {
diag_log "test";
titleText["test", "PLAIN"];
sleep 2;
titleFadeOut 0.5;
};
waitUntil{!isNull (findDisplay 46)};
if(local player) then {
(findDisplay 46) displayAddEventHandler["KeyDown",{
_keyCode = _this select 1;
_isShift = _this select 2;
_isCtrl = _this select 3;
_pDown = _keyCode isEqualTo 25;
_thingOne = _isShift && !_isCtrl && _pDown;
_thingTwo = _isShift && _isCtrl && _pDown;
diag_log "key pressed";
if (_thingOne) then {
diag_log "a";
[20] spawn _testFunc;
};
if (_thingTwo) then {
diag_log "t";
[100] spawn _testFunc;
};
(_keyCode isEqualTo 25 && _isShift);
}];
};
What you can do is:
waypoint setWaypointStatements ["(vehicle this) setFuel 1; (fuel (vehicle this)) == 1; true;", "systemChat format ['The vehicle of %1 has been refueled.', name this];"];
(fuel (vehicle this)) == 1; true;
(fuel (vehicle this)) == 1this does nothing,trueis left on the stack
_testFunc is not defined when you call it inside the eh
local variables carry over into lower scopes, but not into completely new scripts
@onyx sonnet
@copper raven Oh, yeah forgot to remove that. I did test it without it.
it's not called in the same context as where you define it, "but not into completely new scripts"
okay so should i just define the function in the event handler func?
alright, thanks
I will risk the public shame. Why is this code bad ?`😅
waitUntil {
waitUntil {sleep 2.75; !alive player};
0 fadeSound 0;
cutText ["","BLACK FADED",0];
waitUntil {sleep 1; alive player};
0 fadeSound 1;
false;
};
};```
use killed and respawned event handlers instead
it causes the whole server to stall and causes a ton of problems (pending messages, mass kick etc) and i spent 100 hours to debug 500+ server files :D
even tho it just runs client side 🤷♂️
it is bad because it does not read as what it does
it is also bad because it makes it run billions of times
you "wait until" nothing after all.
[] spawn {
while { true } do {
waitUntil { sleep 2.75; not alive player };
0 fadeSound 0;
cutText ["","BLACK FADED",0];
waitUntil { sleep 1; alive player };
0 fadeSound 1;
};
};
@sharp grotto ↑
Thanks alot, i guess iam stupid 😄
case 0.8: {
fadeSound 1;
_vol = 1;```
```sqf
_vol = 0.8;
switch (soundVolume) do {
case 0.8: {
fadeSound 1;
_vol = 1;
};
default: {
fadeSound 0.8;
};
};
anyone know whats wrong here
remove colon after default
ty
any know of a way to turn off the light on the Assembled Device? tried this _device setHit ["light_1_hit", 1]; but to no avail
setHitPointDamage perhaps
switchLamp worked
huh, good to hear. Didnt think that would work
@copper raven new error
Error in expression <soundVolume) do {
case 0.8: {
fadeSound 1;
_vol = 1;
};
default {
fadeSound 0.8;>
17:23:50 Error position: <1;
_vol = 1;
};
default {
fadeSound 0.8;>
17:23:50 Error Missing ;
17:23:50 File mpmissions\__CUR_MP.Altis\initPlayerLocal.sqf..., line 25
17:23:50 Error in expression <soundVolume) do {
case 0.8: {
fadeSound 1;
_vol = 1;
};
default {
fadeSound 0.8;>
17:23:50 Error position: <1;
_vol = 1;
};
default {
fadeSound 0.8;> ```
fadeSound takes a left-hand parameter
fadeSound 1 // wrong
0 fadeSound 1 // correct
@onyx sonnet ↑
thank you
How could I spawn random units in an area when triggering a laptop or object with a trigger?
my bad
think this is relevent here, How does one create a live camera feed that displays on a target screen?
thanks, ill have a look.
Hello lads, i have a question:
I have a little animation on a script that is supposed to move a part of a vehicle. I'd like for a sound to be played around the vehicle when the animation is complete.
this is the line i have put in the SQF:
_tonko = _this select 0;
_dis = 200;
playSound3D ["A3\sounds_f\sfx\doors\RollDoors\RollDoorsSlam_2.wss", _tonko, false, (getPos _tonko), 5, 0.6, _dis];
When testing, it does the animation and nothing happens. Bigg sad, anyone know what i'm doing wrong?
So far what i think i'm doing wrong is either: Not defining the sound correctly or rolldoorsslam_2.wss is not a sound that exists.
have you got your description.ext setup?
I think so yea. Thats what I did when I done something similar
Is there any empty object in Arma 3 that I can use as a point of reference, or do I have to use something like an invisible helipad? I want a point in space that has a position and direction, on which I can attach other objects to.
EDIT: Perhaps a game logic?
whats the command for making a unit game master? since modules are only loaded as mission start, if a groups zeus gets d/c'd they lose the zeus ability. if I put it in the init for the unit, it should load whenever the unit spawn.
not 100% sure what your saying, however If you create a respawn position for the unit side and place down a playable slot, then set the slots variable name as say 'Z1'. place down the Game master module in Eden and set the owner as 'Z1'. This should work for you.
hi, i have a question ? someone now how to convert a distance (9685 meters) to 9.7 km ?
_meters / 1000 toFixed 1 i guess
@faint oasis https://community.bistudio.com/wiki/toFixed
@fair drum You can also set the owner as their SteamID 64 which in turn any time they log in or log out, they will have Zeus, and you can set down multiple.
@copper raven@crude vigil thx it work
you might want to check if distance is <1000, you can just display the number then (if you don't want to show 0.5km etc)
ok
When should isServer be used when it comes to scripts? Why is isServer used at all?
Let's say I have a script that spawns vehicles at the start of a mission, should that script be isServer? If so, then why?
any idea why instead of saying 10% it says this https://i.imgur.com/8ER7Mfx.jpg ? I'm doing 1-soundVolume and then multiplying by 100 ( https://pastebin.com/3s4ufgKd )
then on 0% it says this https://i.imgur.com/n3AvLhH.jpg
@brittle dock if you don't use isServer (the "game referee") and create vehicles in init.sqf, you will have the vehicles × number of players + 1
Ah okay, that goes for scripts that is execVM'd through init.sqf as well then?
@spark sun hey sorry to bother you i would have DM'ed but its off, was hoping you could give us a hand with porting the H&M you worked on, we followed the guide but its breaking the scripts we think.
@tough abyss @open star Maybe I didn't explain well enough. Lets look at a different module, the support requester module. All of the support modules are initialized on mission start to the things they are sync'd to as well. This means that if you have the requester tied to two different units but 1 person is late to the game, it will not sync with them. Therefore you must place BIS_fnc_addSupportLink in their unit's init so that when they spawn, it will run. This seems to be happening in a similar way with the game master. It is initialized with the player's unit at start. How ever, if the player locks up and has to force quit and rejoin, that unit loses its zeus and I have to manually add it as a logged in admin via ACE. What I am asking, is what is the function that adds gamemaster functionality just like how BIS_fnc_addSupportLink does supports.
'BIS_fnc_moduleCurator' this is the function that creates a 'zeus'. I believe I ha e the same issue within my unit, however when we respawn our player the module fixes itself.
How do you link the curator module to the player?
via owner and sync apparently
give unit a variable name, set "owner" to variable name
sync has never worked for me though 🤔
i had both a zcur unit with owner = zcur and it is also synced
I guess its worth mentioning that it is ZEN. which if its a bug with them, then I need the script function anyways lol.
Sorry, whats ZEN? 😂
looks like BIS_fnc_moduleCurator has no documentation on the wiki... time to go diving.
ZEN - Zeus Enhanced
next iteration of Ares/Achilles
I presume this happens on a dedicated server?
Because I know there's a bug where on respawn of a unit the zeus module doesn't assign itself to the respawned unit and sits unasigned. To fix you just need to respawn again.
Shouldn't this work fine in InitPlayerLocal.sqf for multiplayer?
player createDiaryRecord ["Diary",["SITUATION","Here's the situation."]];
Right now when I try that, my briefing stays blank.
do you have
waitUntil {!isNull player && isPlayer player};
Before running that line? Because it might be possible that the player doesn't exist yet
I'll try that.
Try this sqf Player createDiaryRecord ["Diary", ["situation", "here's the situation"], taskNull, "", false];
Looks like the waitUntil did it.
Or not. That's weird. As soon as I put the actual text in it, it stops working.
Apparently it doesn't support line breaks
player createDiaryRecord [
"Diary",
[
"RULES OF ENGAGEMENT",
"
ALL ENEMY MILITARY PERSONNEL AND VEHICLES TRANSPORTING THE ENEMY OR THEIR SUPPLIES MAY BE ENGAGED SUBJECT TO THE FOLLOWING RESTRICTIONS:<br/><br/><br/>
A. WHEN POSSIBLE; THE ENEMY WILL BE WARNED FIRST AND ASKED TO SURRENDER.<br/><br/>
"
],
taskNull,
""
];
works perfectly fine
just make sure you escape your quotes 😉
Aha. <br/>, I had <br>
having some problems, wanting to remove a string from an array, but I just cant seem to do it, tried -, tried filtering it, unsure what to do. Here's the code:
_filterLocation = _randomLocation select {_x != _nameOfLocation};
basically want to remove _nameOfLocation string from array _randomLocation
so should do:
_randomLocation = _randomLocation - _filterLocation;
after that?
["loc1", "loc2", "loc3", "loc3", "loc4"] - ["loc3"] = ["loc1", "loc2", "loc4"]```
_locationsArray = ["boxPosition1","boxPosition2","boxPosition3","boxPosition4","boxPosition5"];
_randomLocation = selectRandom _locationsArray;
_currentLocation = nearestObject [getPos MysteryBox,"Land_HelipadEmpty_F"];
_nameOfLocation = vehicleVarName _currentLocation;
_filterLocation = _randomLocation select {_x != _nameOfLocation};
here's the code, whereabouts should it go
huh 🤔
_randomLocation select {_x != _nameOfLocation};
won't work, _randomLocation is a string, not an array
did you mean _locationsArray select... ?
basically, want to pick a random location from the array, but if it happens to be the same location it should just remove it from the array and carry on
wait, think I may have fixed it, lemme just check
why not remove the currentLocation from array first
before you select a random new location?
I think thats easier, if you're grabbing _currentLocation anyway
_locationsArray = ["boxPosition1","boxPosition2","boxPosition3","boxPosition4","boxPosition5"] - vehicleVarName _currentLocation;
ah yea, thats better actually, cause then that eliminates another problem I was having
yea that didnt work, expects an array not a string
should probably put it into an array before that
I'm discovering that createDiaryRecord is apparently a broken mess.
Doesn't work with 3 paragraphs but works with two, but I can't find anything about a character limit in the wikis.
there is none
note that createDiaryRecord does not take Structured Text syntax, but its own format.
Yeah, that's why I'm so frustrated. I'm just typing some plain text into notepad++
Added <br /> for line breaks. 2 paragraphs works, 3 paragraphs makes all entries stop working.
something is wrong within your text then
Banned words?
That's almost more frustrating.
any mods perhaps?
One or two that might affect it. And a bunch of scripts that mess with adding and removing subjects from that list. I'll have to start eliminating them and testing
either run vanilla (if possible) or run without your scripts
you will then figure out in which category the issue is
Yeah. I'll have to spend some time on it. Thanks for trying it out.
so i have a question
can anyone help me make sense of the whole boolean thing like im dead confused im trying to use a script for my mission and to enable or disable certain parts it just says "boolean"
@tough abyss what exactly are you trying to do? And remove profanity from your message (see #rules)
delay_eruptions - number, delay in seconds between eruptions,if the delay is smaller than 0 erruptions will be disabled
enable_crater_lava - boolean, if true SFX for caldera will be generated
enable_lightning - boolean, if true lightning bolts will randomly show up in the smoke cloud
enable_lava_flow - boolean, WIP
lethal - 0,
protective_gear - array containing the class name if the items you wanna be used as protective gear near crater
delay_eruptions - number, delay in seconds between eruptions,if the delay is smaller than 0 erruptions will be disabled
enable_crater_lava - boolean, if true SFX for caldera will be generated
enable_lightning - boolean, if true lightning bolts will randomly show up in the smoke cloud
enable_lava_flow - boolean, WIP
lethal - 0,
protective_gear - array containing the class name if the items you wanna be used as protective gear near crater
just trying to disable certain things like lethality
Well a boolean is just true or false (https://community.bistudio.com/wiki/Boolean)
Is it stringed? ( "true") if so = Not boolean
The server calls the sound to the playSound3D player. But there is no sound. If it repeats, the sound is there. What's the problem?
player is null?
How can I with a trigger spawn ramdom units in a defined area?
@unique sundial not
maybe someone has some insights on why some Arma 3 scripting commands / functions are not named properly so you know their purpose immediately from the name?
like this one: https://community.bistudio.com/wiki/configOf
this could easily be named "getObjectConfigPath" instead of just "configOf" which's meaning changes drastically when you read its description in the wiki page 🙂
how can we communicate this to the developers themselves, for improving readability / explicicity of this maybe?
Somehow #community_wiki is the best place to discuss Dev-Branch commands about their implementation. I don't think the name will be changed in the future though
99.9% sure no name changes will be done
As that would either mean need of 2 same commands or breaking everything that uses the current command
I guess the implementation undergoes an internal code review and when it's merged into dev branch, unless the function is not used much in the actual game code, it's not gonna be renamed at all in the future?
yeah, but while stuff is in dev branch, should the devs worry about backwards-compatibility? i mean that's what the dev branch is for, tbh.
to shape things up until they're ready for "prod"

That actually is the point though, I still don't see a big point to do
@timber ridge what did you expect configOf to provide? (the whole tree?)
that's the point, it could've been anything.
Dunno I had not seen the command before and I expected it to do what the description said.
maybe that's your intuition in the play if you've worked with this for a long time? I've gone back to a3 scripting a ~month ago, still not as intuitive as you'd like it to be 😄
did you already forget the wonderful modelToWorldVisualWorld
😄 alright alright, I give up now
I am trying to add a different dynamic loadout to a BlackWasp (Cluster) but I always get the following error: No Entry 'bin\config.bin/CfgWeapons.'. (BTW I did not misplace those slashes. The first one is a backslash and the second a normal one)
This is the code I am using:
private _vehicle = /* the vehicle of the unit */;
private _pylons = ["PylonRack_Missile_AMRAAM_D_x2","PylonRack_Missile_AMRAAM_D_x2","PylonRack_2Rnd_BombCluster_01_F","PylonRack_2Rnd_BombCluster_01_F","PylonMissile_Missile_BIM9X_x1","PylonMissile_Missile_BIM9X_x1","PylonMissile_Missile_AMRAAM_D_INT_x1","PylonMissile_Missile_AMRAAM_D_INT_x1","PylonRack_Bomb_SDB_x4","PylonRack_Bomb_SDB_x4","PylonMissile_1Rnd_BombCluster_01_F","PylonMissile_1Rnd_BombCluster_01_F"];
private _pylonPaths = (configProperties [configFile >> "CfgVehicles" >> typeOf _vehicle >> "Components" >> "TransportPylonsComponent" >> "Pylons", "isClass _x"]) apply {getArray (_x >> "turret")};
{ _vehicle removeWeaponGlobal getText (configFile >> "CfgMagazines" >> _x >> "pylonWeapon") } forEach getPylonMagazines _vehicle;
{ _vehicle setPylonLoadout [_forEachIndex + 1, _x, true, _pylonPaths select _forEachIndex] } forEach _pylons;
…but there is no CfgWeapons in your code D:
setPlyonLoadout adds an weapon if there's no weapon related to the magazine IIRC
So it would?
I don't know. It does work it just throws that error the first time it is executed but I copied that code from the Community wiki so you tell me. 😉
Actually pylon related commands are REALLY weird
But the only way to get a different loadout onto all BlackWasp (Cluster)s...
I know. But still... something's wicked
_radioCheck =
[
{
params ["_args","_handle"];
if (BEN_songcheck == 3) then {
[radio, false] remoteExec ["hideObjectGlobal", 2];
"Songs can now be played near the teleporter" remoteExec ["systemChat",0,true];
["115"] remoteExec ["playSound",0,true];
[_handle] call CBA_fnc_removePerFrameHandler;
};
},
3,
[""]
] call CBA_fnc_addPerFrameHandler;
Regarding this code, I'm wanting to check a variable constantly, then when the condition is true, I want the code to only execute once, however it doesn't seem to remove the Frame Handler
nvm fixed it
added a params line
Im having an issue with an addAction.
In obj. init:
this addAction ["Turn On Generator", [true] execVM "scripts\ToggleLightsBase.sqf"];
ToggleLightsBase.sqf:
params ["_state"];
if (_state) then {
{_x setdamage 0; sleep 0.1;} foreach [g1,g2,g3,g4,g5,g6,g7,g8,g9,g10,g11];
} else {
{_x setdamage 0.95; sleep 0.1;} foreach [g1,g2,g3,g4,g5,g6,g7,g8,g9,g10,g11];
};
What exactly am I doing wrong?
@tough abyss
this addAction ["Turn On Generator", [true] execVM "scripts\ToggleLightsBase.sqf"];
```↓```sqf
this addAction ["Turn On Generator", { [true] execVM "scripts\ToggleLightsBase.sqf" }];
for checking little errors like that
dedmen (not tagging him as this is just crediting him)
is excellent for finding that missed semicolon, that misspelled command, this missing bracket, that fat, beery miss of the shift key
there are vscode extensions for that too
yes, but they are all out of date
nope
sqf-vm one is not
but not feature complete yet
still, sqf-vm is what dedmen's page uses too 🤷
also got some very ... special ... language ... for you
just in case you are interested 😏😏
is it norty 🙂
see #arma3_tools
ah yes
i read it occasionaly
but the webpaage is useful for non vs code users
sparker makes that extension, yes i know him
credits say the vm is yours.... now im confused
Hello guys. Anyone have in mind classname of some invisible non-collidable object i can add ace action to?
turn show model off
you mean hideobjectglobal? Yea thats a way
also, i had error in script
GroundWeaponHolder_Scripted works fine
i thought that it is removeing because it had no content
@calm bloom you could use a trigger maybe? not sure about a invisible object in that case.
no, GroundWeaponHolder_Scripted is just what i need, thanks for help
Hey peeps how would I figure out what player is in the driver position of a vehicle?
As in if I have the truck x that I want to get the driver of
oh wait

👏
@timber ridge
this could easily be named "getObjectConfigPath" instead of just "configOf"
configOf is a command from VBS, and has the same usage in Arma as in VBS.
"getObjectConfigPath"
but that's wrong, it doesn't return the configPath, it returns the config. getObjectConfig, or configOf is no difference to me, besides that one is longer and sounds more complicated, configOf, returns the config, of ...
how can we communicate this to the developers themselves, for improving readability / explicicity of this maybe?
you can't
is there anyone who can help me with a mission im working on? i need a couple of short scripts.
i just have a few questions to ask
Instead of asking if someone can help, ask your question.
yeah, but while stuff is in dev branch, should the devs worry about backwards-compatibility?
we do to where its reasonable. Renaming or changing a command is fine as long as its communicated properly
(No, not an offer to DM me 🙂 )
that's the point, it could've been anything.
you need to read the wiki for basically all commands anyway, so I don't see a problem that you have to look at the wiki to see what exactly this command does and how to use it
ok
well i have my mission built on the island in pyrgos gulf, and i want the mission to be isolated. i would like anyone who goes outside of a certain area (who is not in a vehicle) to instantly die.
what is the easiest way to do that?
kill them in zues
build a giant wall in the editor
im not doing a wall
shouldnt it be easy enough to just kill anyone who enters/leaves a certain area?
you want to kill them the moment they leave the island
create a Marker in the Mission Editor, which is the "area"
->
https://community.bistudio.com/wiki/inArea
+
https://community.bistudio.com/wiki/while
+
https://community.bistudio.com/wiki/allPlayers
+
https://community.bistudio.com/wiki/setDamage
as scripted Version.
{
if (surfaceiswater getpos _x) then {_x setdamage 1};
} foreach allplayers
as starting point (init):
if isServer then
{
while{true}do
{
uisleep 1;
{
//DoYourChecksHere
} foreach allplayers;
};
};
(there is not much to add up there. Just check the commands and read their descriptions)
can anyone whip up a short script where i can just substitute something for the ellipse?
i know its kinda a lot to ask
the easiest way would be to kill them when they got a certain distance from the centre of your ellipse
well its not a circle, its an oval
provided it's circular
i dont have any scripting knowledge
thats the core of what you want to do
yea
but i dont really understand the details
that doesnt really help
if player is outside [ellipse] and not in a vehicle, then kill player.
can someone translate that into a script?
@past wagon do research my man before asking 😉 google is a great help.
the easiest way I know how to do it is this:
- Put a trigger arround the area you want players to stay within.
- In eden place down a Zone Restirction Module. configure it to how you want.
- place an Area logic down and sync the logic to the trigger and the zone restriction module.
If im not mistaken this should get the outcome you want.
Try this, if it doesn't work ill help you code it.
Mate, I doubt anyone is going to write it for you
you need to show you've done more than the idea work
ok i will try it
@finite sail im not a scripter, i dont know any programming languages. i was just coming here to see if anyone was willing to code something for me if it was easy enough. i have watched many videos online, but they dont seem to work.
ok, question 1, you are doing this in the 3den editor?
yes
is it going to be multiplayer or single player
multiplayer
also @tough abyss i have done a lot of research online, but i cant really find anything that does what i want it to. also what should i put for "custom punishment" in the zone restriction module?
sorry pinged wrong person
ive never used it, im checking it now
custom punishment would be
player setdamage 1
or similar,ive never used that
ah wait
thats a2
not a3
yes, could well be
no
_this is used for this as in the place it is coming from, you would want to use player
says you must link the module to a trigger you've already made
Do research, google is your best friend, the same with the wiki. I dont do alot of scripting. but i know as a fact anything ive wanted to do has somthing on the bohemia wiki.
listen
i dont know how to script
ive done research, and looked for tutorials, but none of them do exactly what im looking for. the bohemia wiki doesnt seem to be for people who dont know how to script
make triggers north, south, east, west
set them to trigger ANY, and in the activation field:sqf { _x setDamage 1 } forEach thislist
triggers*
oh
but the area is an ellipse
is there a way to make a trigger in the area, and make it reversed?
if your area is defined by a marker named "markerName":
in init.sqf:```sqf
if (hasInterface) then
{
[] spawn {
while { true } do
{
waitUntil { sleep 1; alive player };
if (not player inArea "markerName") then
{
player setDamage 1;
};
};
};
};
a file you create at the root of the mission
where do i find it?
%userprofile%\Documents\Arma 3 *
"Arma 3 Other Profiles" perhaps
find your mission directory…?
a file you create at the root of the mission
so, not to sound condescending, but… 😁
ok got it
i tried to rename the mission file folder, now it wont show up in the editor
you can rename it, but keep the .islandname at the end (e.g .Altis)
Ctrl+Z in Windows should dename it
if i name it something.Altis that should work, right?
yes.
kk thanks
only if its on the altis map
else your gonna have a problem when loading the mission lmao.
can you share the error?
You can upload the image to a website like imgur and then post the link here
kk
_randomLocation = selectRandom _locationsArray;
switch (_randomLocation) do
{
case "boxPosition1":
{
_newLocation = boxPosition1;
{
[_x,true] remoteExec ["hideObjectGlobal",2];
} forEach nearestObjects [getPos _newLocation, ["plpBase_ct_Static_Cases"],5,true];
_newPosition = getPos _newLocation;
_newRotation = getDir boxPosition1;
MysteryBox setPos _newPosition;
sleep 25;
_lightning = createVehicle ["Lightning1_F",_newPosition,[], 0, "CAN_COLLIDE"];
[MysteryBox, ["poof",500]] remoteExec ["say3D",0,true];
sleep 5;
deleteVehicle _lightning;
[MysteryBox,false] remoteExec ["hideObjectGlobal",2];
MysteryBox setDir _newRotation;
{
[_x,false] remoteExec ["hideObjectGlobal",2];
} forEach nearestObjects [getPos _newLocation,["plp_cts_RecycleBinGreenOpenEmpty"],5,true];
};
having a problem right at the end of this code. Everything works perfectly fine, but when i do the setDir, it'll do it for about 5 secs, then the rotation resets to what it was before. This is on dedicated server, not single player
@ornate marsh try setDir before setPos
ok, will do
@past wagon
replace if (not player inArea "markerName") by if !(player inArea "markerName")
ok
🤔🤔
Who would like to have something similar toawait [...] call fnc
you mean await spawn
Kinda
More like, literally, awaitable calls
if (hasInterface) then
{
[] spawn {
while { true } do
{
waitUntil { sleep 1; alive player };
if !(player inArea "Zone1") then
{
player setDamage 1;
};
};
};
};
does this look good @winter rose ?
does it work?
hehe
As I got my SQC parser for sqf-vm working now, I can do it without engine Support and thus literally mean:
await fncasync(...) ; or private promise = fncasync()
@past wagon nope
Getting some basic await idom done in sqf is rather simple, thanks to arrays being passed by reference
@winter rose it works, but is there an easy way for me to exclude air vehicles?
will players use air vehicles or just AI?
also, it is better if you state all the situation before
if (hasInterface) then
{
[] spawn {
while { true } do
{
waitUntil { sleep 1; alive player };
if (vehicle player == player && !(player inArea "Zone1")) then
{
player setDamage 1;
};
};
};
};
```will kill only on-foot units
yes.
btw all you fancy peeps with your smart looking projects and I cant even figure out how to create a mine every x seconds at a certain position 
I can even figure out
good for you 👀
no booli
@winter rose do you just want me to replace it in the init.sqf file?
kk
@winter rose thank you so much, man. this has really helped me. for the past few days i was wondering how the hell i would get this done, since i dont know anything about scripting. thanks a lot
// promise idom
private _promise = [nil /* scriptHandle */, nil /* result */, [/* args */]];
_promise spawn {
// header
_this set [0, _thisScript];
private _result = nil;
scopeName "____function_scope";
(_this select 2) params [/* variable names */];
// actual code
// private _result = ...
// ...
_this set [1, _result];
};
// promise done ?
scriptDone (_promise select 0);
```using SQC, i could boil this down to:
```ts
private promise = async function(/* args */) { /* actual code */ };
isDone(promise)
```sooo many fancy things i can do now just thanks to SQC (and SQF-VM) :3
though ... doubt anyone ever will use SQC anyways ...
Here's how far I've gotten with the code btw
layMines=false;
delay=30;
truck addAction
[
"Activate minelayer",
{
layMines = true;
},nil,1.5,true,true,"","(alive truck) && (!layMines)",10,false,"",""
];
truck addAction
[
"Deactivate minelayer",
{
layMines = false;
},nil,1.5,true,true,"","(alive truck) && (layMines)",10,false,"",""
];
truck addAction
[
"Set mine laying timer to 5 seconds",
{
delay = 5;
},nil,1.5,true,true,"","alive truck",10,false,"",""
];
[insert a bunch of other addActions here]
truck addAction
[
"Set mine laying timer to 30 seconds",
{
delay = 30;
},nil,1.5,true,true,"","alive truck",10,false,"",""
];
while {true} do {
while {layMines} do {
createMine ["APERSMine", position truck, [], 0];
sleep delay;
};
sleep 5;
};
The addActions all seem to work fine but it wont spawn the mine
, also ignore that it just uses the truck position I havent implemented adding a bit of distance behind the truck yet

Ooooh yeah I was trying it in debug
and the [code here] thing isnt in the real code, I just didnt want to fill up a bunch of chat space with another 5 or so addActions
oki
and then try that in debug?
oki I'll try that in a few minutes
Thank you
Then I'll just have to figure out how to set up the execVM correctly so I dont need to start it through the debug console
Oki
it works, thank you a lot @tough abyss
now i gotta implement the vectorAdd thing
the list of the numbers for a vector is [x,y,z], no?
afaik, next patch will be [n,n] too
If anyone can help, I'm trying to make a heli insert radio call (get a position from mapSingleClick, make a waypoint, set waypoint to TR unload, and then RTB) but the waypoint created never seems to get set to TR UNLOAD any advice?
Can SOMEONE please tell me why this script works on my test server but NOT the real server
ive implemented it correctly
the commands are whitelisted
show me silly boy
// author: Infamous
// Description: does some things to create a betting system
// closes last dialog
closeDialog 0;
// define variables
playerListArray = [];
_display = findDisplay 126500;
_start = _display displayCtrl 12402;
_localPlayer = "";
// creates bet dialog
createDialog "send_bet";
{
if (!(name player == name _x)) then {
playerlistArray pushBack _x;
_name = name _x;
lbAdd [91831, _name];
};
}forEach allPlayers;
_start ctrlAddEventHandler ["ButtonClick", {
}];
buttonSetAction [12402, "
if ((lbCurSel 91831) isEqualTo -1) exitWith {hint ""Select a player""};
_unit = playerListArray select (lbCurSel 91831);
_value = ctrlText 11400;
_value = parseNumber _value;
if (_value == 0) exitwith {hint ""You can't bet 0 Dollars""};
if (isNull _unit) exitWith {};
if (life_atmBank < _value) exitWith {
hint ""You dont have enough money"";
};
closeDialog 0;
[_unit, name player, _value, clientOwner] remoteExecCall ['life_fnc_acceptBet', _unit];
"];
it works on my test sever
ive tested it with another player
yes
i asked pizza boy too and he couldnt help so
I have time just give me a sec
@winter rose earlier today you made a bit of code for the init.sqf file that instantly kills any player outside of a certain zone. If i wanted there to be more than one zones, can i just duplicate the code in the init.sqf file, so it appears twice, once for the first zone, and another for the second?
i want players to have 5 minutes from the start of the game to get to the second zone. Is there a way for there to be multiple init.sqf files so the two pieces of code can run simultaneously?
How can I put targets (shoot it) and with a trigger later of cqb, up every targets?
Anyone know of a script way to check if aircraft gear is up/down? Besides checking animation source that is?
Answer: https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Gear
- https://community.bistudio.com/wiki/Model_Config#Animation_sources gear animation source with animationSourcePhase
@past wagon you would have to use inAreaArray
@past wagon you could spawn a script. I believe spawn runs given commands in another thread so code can run simultaneously
Alright so how hard would it be to place 2 static signals on map (multiplayer) and have players try to find them using the spectrum device like a compass.
and would it still work if the signal is 10k away ?
hey guys im trying to get into scripting but i dont where to write the code and for it to work
Ok thx
@potent dirge in this case, the deadly areas would then overlap and the player wouldn't be fine anywhere, killing everywhere
Could also check for inArea and use the OR operator
player inArea "areaOne" || player inArea "areaTwo""
Anybode knows why this stuttering happens when using setVectorDirAndUp together with setPos? https://www.youtube.com/watch?v=ZLQu1nCTXYo
Here's the code that the cube is runnig (every frame):
_vForward = [0, 0.961524, 0.274721];
_vUp = [0, -0.274721, 0.961524];
cube setPos _position;
cube setVectorDirAndUp [_vForward, _vUp];
are you running that in a loop?
Yes.
Anyone knows how to use the strigoi script from alias?
[] spawn {
while {true] do {
_vForward = [0, 0.961524, 0.274721];
_vUp = [0, -0.274721, 0.961524];
cube setPos _position;
cube setVectorDirAndUp [_vForward, _vUp];
}
}
👆🏼 basically like that.
@worthy spade setPos resets vectorDirAndUp, so sometimes the reset will be visible
Shouldn't it always end in the correct rotation regardless, since setVectorDirAndUp runs later?
_position is just getPos cube, initialized once.
yeah spawn
Probably spawn is why
so its probably suspending
easy fix
cube setPos _position; cube setVectorDirAndUp [_vForward, _vUp];
->
isNil {
cube setPos _position;
cube setVectorDirAndUp [_vForward, _vUp];
};
i watched his tutorial, i know how the parameters works but i don't know where to place that stuff
like in a unit, marker or trigger
That worked, but such an odd fix. What does isNil do that keeps it from suspending?
Is it just seen as one statement by the scheduler?
it runs unscheduled
i think im missing something, when launched it cannot find "AL_strigoi/strigoi.sqf"
forcing open doors, but you are missing the "AL_strigoi\strigoi.sqf" file!
then, the demo mission is wrong or something else happened ^^
mmmh, the mission worked, i think im doing something wrong
this is what i should put somewhere ["strigoi_1",300,true,0.1,50] execvm "AL_strigoi\strigoi.sqf";
That worked, but such an odd fix.
not really, scheduler can always suspend in scheduled code. It has its 3ms time limit and once it received it it stops.
What does isNil do that keeps it from suspending?
isNil executes its code in unscheduled, freezing the game while it does it, ignoring the schedulers 3ms limit
@worthy spade
oh god im so stupid...i misspelled the name of the mission, sorry for the unnecessary messages
Yeah, that makes sense to me. What's odd is just that isNil seems lika such an arbitrary choice based on its definition, rather than having a more intentional approach, e.g. noSuspend or something. Very useful nonetheless. Thanks for the help.
it is a workaround, it is not the command's first purpose… but as usual, "life found a way"
does the code within isNil {} add to that 3ms limit? (I'm assuming it would)
I would say perhaps 🐮 (I think too)
3ms limit?
scheduler's 3ms per script limit
scripting-wise, is there a way to see if something is not a vanilla assets such as a mod? (not DLCs)
my only idea right now is to check "author" to see if it is not BI or Bravo One…
@warm hedge perhaps? You have XP here
Bit please
I mean, yeah. I've currently working on something related to DLCs and MODs
Would inherited things (like just a retextured vanilla vehicles/weapons) return as MOD contents?
wait, you're already on it? 😅 I didn't expect such a QRF!
hm no, only new "models"/"classes"
So if the models aren't from vanilla, will say it's a MOD?
oooh I see where you're headed, a filter by model?
my ideal thing would be "anything non-vanilla/DLC/CDLC"
I am trying to grab all air assets
if there is no easy way, I can use a workaround (or rethink the idea), don't dig too much on this really 🙂
much appreciated if you help me think already ^^
Been thought if is possible to do. Is there any way to check a MOD is a vanilla/DLC/(CDLC)? I've kinda no clue, looks my brain's deadly tired
is it possible to 'turn off' a trigger via script? what I have is a auto opening gate way for a checkpoint, However i want the auto open/close to be togglable?
you should be able to have a trigger with a small radius around the gate, in the on activation field have it open, and on deactivation have it close
enableSimulation true/false on the trigger works too
with blufor present or something as the trigger
@strange seal Hu? please read my entire question before giving advice ;)
@winter rose ```sqf
if (_state) then {
{_x enableSimulation 0; sleep 0.1;} foreach [t1,t2];
} else {
{_x enableSimulation 1; sleep 0.1;} foreach [t1,t2];
};
i got this whipped up. but stuck with the _x, I know _x means any player on server, but im not sure how to convert it to work for triggers.
_x means any player on server
no
_x means "current iterated item in the forEach"
also, enableSimulation doesn't take a number, but a boolean
Rightttt. So, in theory that should work with the number changed to boolean?
_x enableSimulation _state
Is there any way I can change the sunrise and sunset time?
changing the date only
This may be an odd request, but is there a way to run getArray for every class defined under CfgVehicles?
I realize this may is inneficient, but I'm looking to throw an error at the player if a class is missing a value, and I can't predict what other addons may be loaded
Specifically, I want to check every uniform class to see if they have a hitpoint, in case they didn't inherit from one of the base classes.
If a class is missing a variable it will either show an error anyway (unless errors are disabled).
And the server SHOULD ensure no weird/broken mods are present, so it should never be the case that an object doesn't have a value (or 0 value) if you don't want to
I've figured out a (dirtier) way to do it, nevermind, thanks.
Hm okay peeps I need some help again, I'm trying to add the ability to change between mine types to my minelayer but the _selectedMine variable isnt working
I have (in a shortened form with just the relevant bits):
layMines=false;
delay=30;
driverside = side driver truck;
_selectedMine = APMines;
APMines = 100; //Number of AP Mine
ATMines = 100; //Number of AT Mines
truck addAction
[ "Select AP mines",{
selectedMine = APMines;
},nil,1.5,true,true,"","(alive truck) && (_selectedMine != APMines)",10,false,"",""
];
truck addAction
[ "Select AT mines",{
selectedMine = ATMines;
},nil,1.5,true,true,"","(alive truck) && (_selectedMine != ATMines)",10,false,"",""
];
[] spawn {
while {true} do {
while {layMines} do {
_relpos = truck getRelPos [5, 180];
if(_selectedMine == APMines) do {
createMine ["APERSMine", _relpos, [], 0];
APMines = APMines - 1;
hint "AP mine";
};
if(_selectedMine == ATMines) do {
createMine ["ATMine", _relpos, [], 0];
ATMines = ATMines - 1;
hint "AT mine";
};
sleep delay;
};
sleep 5;
};
};
remove the underscore from selectedMine?
the addAction is pointing to a different variable, too
But when I test it the two addActions dont show up since the condition with the selectedMine isnt fulfilled and when I start laying mines I get an error that the variable selectedMine isnt fulfilled
oh ye I forgot to add the _ to the addActions
afaik _ implies a local variable - but I always prefix local vars with private, so I'm not sure if that's true or not
try without the _
Nop no worky
well
selectedMine only holds the count of mines, not the type of mine
it reads like it would create one of each mine and then stop
selectedMine only holds the count of mines, not the type of mine
does it? it should hold either APMines or ATMines
it just copies the number
am confused now
try using selectedMine = "APERSMine", etc instead, and have the 100 count in a different variable
APMines = 100; //Number of AP Mine
ATMines = 100; //Number of AT Mines
selectedMine = 0; //Value is 0
selectedMine = APMines; //Value is 100
selectedMine = ATMines; //Value is 100
yeah, you're most of the way there, you just need to split them into two variables and you'll be sorted
Yep
can anyone confirm that ```sqf
setMousePosition [safeZoneX + safezoneW, safeZoneY + safezoneH];
OK, I run the game interface @ 4K but render 50% (1920×1080)
sooo there may be a bug to be sorted here 🙂
thanks!
Oof. Hit the green gangs!
Wait, you're not on Dev-Branch Lou?
I was, but went back to release to play w/ friends :<
Just tested and fixed on the latest for sure
I guess you need my special two weeks ahead dev-branch with version 1.98 written on it build
maximum perf, with all the multiplayer security features disabled
hahaha I could use that to dev missions actually 😄 if it's an exe swap
yeah it is, but I guess you need to join my unit for that
…BI?
I had a problem with setMousePosition if you called it after creating a dialog - it would snap some other position and ignore what you gave it
I was using it to put the mouse position back where it last was, in the end I didn't find any decent way to do it - making it apply the next frame meant you'd get one frame of the mouse being in the wrong position
Anyone know why this happens? I run this code whilst in one of the listed vehicles
_blockedAir = ["CUP_O_Ka50_SLA","CUP_B_AH1_DL_BAF","CUP_B_AH1Z_DYNAMIC_USMC","CUP_B_AH64D_DL_USA","O_Heli_Attack_02_F","CUP_B_Mi35_Dynamic_CZ_Ram","CUP_O_Mi24_P_RU","I_Plane_Fighter_04_F","B_Plane_Fighter_01_Stealth_F","B_Plane_Fighter_01_F","O_Plane_Fighter_02_F","O_Plane_Fighter_02_Stealth_F","CUP_B_AV8B_Empty","CUP_O_SU34_CSAT","O_T_VTOL_02_infantry_F","O_T_VTOL_02_vehicle_F","CUP_B_F35B_Stealth_USMC","CUP_B_F35B_USMC","O_Plane_CAS_02_F","CUP_O_Ka52_RU","CUP_O_Ka52_GreyCamo_RU","CUP_O_Ka52_Blk_RU"];
if ((typeOf vehicle player) in _blockedAir) then
{
systemChat typeOf vehicle player;
systemChat "is blocked";
};```
When in a **CUP_B_F35B_Stealth_USMC** etc works fine and shows the systemChat
When in a **CUP_B_AH1Z_DYNAMIC_USMC** for example doesn't work
But if i'm pilot or gunner in **CUP_B_AH1Z_DYNAMIC_USMC** and run `systemChat typeOf vehicle player; ` in console it shows correct output `CUP_B_AH1Z_DYNAMIC_USMC`
or running this whilst in the vehicle
```sqf
if ((typeOf vehicle player) == "CUP_B_AH1Z_DYNAMIC_USMC") then
{
systemChat typeOf vehicle player;
};```
Returns correct and shows system chat
yea a simple google search with CUP_B_AH1Z_DYNAMIC_USMC shows that there are some casing mismatches, in string comparisons are case sensitive
Thank you
Simply use toUpper on both sides of the equation to "fix" that problem
toLowerANSI (or toUpperANSI yes
)
(finds & replaces all toUpper/toLower with ANSI versions)
Hello everyone! Have anyone encountered this?
20:04:26 Failed attempt to execute serverCommand '#monitorDS 5' by server.```
i dont really get what is wrong, server password is directly copied from the script
mean server admin password
are there any whitelist configs?
did you log in to the server?
i just know #monitor N 🤔
#monitorDS does the monitor on the console of the server itself. you have access to the box?
cause if you want to zeus or play, its probably better to log in to admin and just use #monitor
i use
"password" serverCommand "#monitorDS 5";```
i execute that on server script
i dont see if i am missing anything from this page https://community.bistudio.com/wiki/serverCommand
Yeah
thank you
whats a good way to make a AI turret rotate at a constant speed?
model config
you mean that its server.cfg parameter, right?
@calm bloom Tested locally, worked for me. All fine on your side?
Yep, thank you again for the tip
i was using wrong parameter
didnt know that servercommandpasword exist
me neither, until i read it on the page
i mean without modding the configs.
like i know there is lookAt but didn't know if there was a "rotate by x degrees" command
Is there really any difference between the class configs of units other than their loadouts (with the exception of traits like Medic, Engineer, Demo)
depends, some mods add extra stuff. Like OPTRE adds the ability to fall large distances with their "Bulldog" class.
Bulldog class? What's that?
its their jet pack class
Oh wow, I never really messed with the jetpack in OPTRE because I couldn't get it to work without dying
Are the militia armors still OP?
idk haven't played with in a long time
it frustrated me with how broken the maps were
ai shooting through walls and stuff
@winter rose i have figured out how im gonna have a second zone that waits 5 minutes from the start of the game before killing all players outside
i just need one zone active at a time
not both
so i need the first part of the code to repeat on loop 300 times, since there is a sleep 1 in the code, repeating it 300 times will last 5 minutes. then it moves on to the second part of the code, which loops indefinately
First part:
if (hasInterface) then
{
[] spawn {
while { true } do
{
waitUntil { sleep 1; alive player };
if (vehicle player == player && !(player inArea "Zone1")) then
{
player setDamage 1;
};
};
};
};
Second part:
if (hasInterface) then
{
[] spawn {
while { true } do
{
waitUntil { sleep 1; alive player };
if (vehicle player == player && !(player inArea "Zone2")) then
{
player setDamage 1;
};
};
};
};
how would i go about creating these loops?
also the two pieces of code are identical except for "Zone1" and "Zone2"
waitUntil { sleep 1; alive player }; will not execute
if (hasInterface) then {
[] spawn {
waitUntil {vehicle player == player && !(player inArea "Zone2")};
player setDamage 1;
};
};
Sorry for large tab formatting
@potent dirge Why should it not execute?
Doesn't waitUntil only take conditional statements?
It takes code that must return a boolean, and the given code does return a boolean - after suspension.
It does work, just tested it to make sure 😄
I stand corrected then
But your code is of course the better approach nonetheless.
@past wagon why not use triggers? Just set them to activate when a player walks in. You can do the time thing by running time >= 300 for 5 minutes from mission start, you can use that for your conditional
And make it repeatable unlike my code above which will only run once
missionNamespace or publicVariable? for broadcasting variables to all clients, executed server side
@potent dirge the reason i am not using triggers is because the area is a circle, and everywhere outside of the circle is a death zone, so there is no way to put triggers all around the area really.
the code already works for the first zone
i just need it to run the first piece of code 300 times, then move to the next piece of code and run it indefinately
i have no knowledge of scripting
i just need someone to explain how to create a loop
If you really want a script try this untested quick function I made
/*
Usage: [_area, _time] spawn fn_deadZone
_area = Area you're working with
_time = time from mission start in seconds you want zone to be active
*/
params ["_zone", "_wait"];
if !(hasInterface) exitWith {};
waitUntil {!(player inArea "_zone") && time >= _wait};
player setDamage 1;
listen
i dont need new code
i just need to put the code that i have into a loop
into 2 loops actually
@robust brook publicVariable, I'm pretty sure missionNamespace is local to each machine.
@past wagon are you wanting to call it in a trigger?
@past wagon Can players join your mission in progress?
@willow hound missionNamespace = Returns the global namespace attached to mission.
Okay sorry if you've done this before but can you outline what you're trying to achieve with your script please
@robust brook Yes, but global as in global variables such as MyVar = 0;, not multiplayer global.
I think at least.
HERE IS WHAT I NEED
Loop 300 times:
if (hasInterface) then
{
[] spawn {
while { true } do
{
waitUntil { sleep 1; alive player };
if (vehicle player == player && !(player inArea "Zone1")) then
{
player setDamage 1;
};
};
};
};
Loop forever:
if (hasInterface) then
{
[] spawn {
while { true } do
{
waitUntil { sleep 1; alive player };
if (vehicle player == player && !(player inArea "Zone2")) then
{
player setDamage 1;
};
};
};
};
can anyone help me understand how to do this?
_loop = 0;
while (_loop < 300) do {
// YOUR CODE
_loop = _loop + 1
};
Simplest way I can think of to loop 300 times, although I would suggest restructuring your code instead of looping 300 times
Oh and put it into a separate script don't jumble everything in your init.sqf
i dont know how to script
im just working with the code i have
also why cant i just put it in the init.sqf file?
//Loop 300 times
[] spawn {
if !(hasInterface) exitWith {};
for "_i" from 1 to 300 do {
if (vehicle player isEqualTo player && !(player inArea "Zone1")) then {
player setDamage 1;
};
};
};
//Loop Forever
[] spawn {
if !(hasInterface) exitWith {};
for "_i" from 0 to 1 step 0 do {
if (vehicle player isEqualTo player && !(player inArea "Zone1")) then {
player setDamage 1;
};
};
};
@past wagon
Just make a new file name it whatever you want ending with .sqf e.g. zone.sqf. Then paste [] execVM "zone.sqf" in your init.sqf
yo
im gonna try that
so this will just instantly kill anyone outside of those zones?
but wait
//loop 300 times and //loop forever arent actually parts of the code, are they?
i dont know how to code
i literally have no idea how to loop something
// is a comment in the code.
yea
anyone in the area will die basically
I gave you the example
if (hasInterface) then
{
[] spawn {
while { true } do
{
waitUntil { sleep 1; alive player };
if (vehicle player == player && !(player inArea "Zone1")) then
{
player setDamage 1;
};
};
};
};
this code does exactly what i want, i just need someone to put it into a loop
it is already in a loop?
you got cba installed?
well
or just vanilla
What @robust brook has given you is exactly what you want.
Well, what you requested at least.
@robust brook i am going to put the code twice, first with "Zone1" and then with "Zone2"
@past wagon Why do you want it looped again, sorry if you've explained
^^^
i want it to loop the code for zone1 300 times, then move on to zone two, where it will loop for the rest of the mission
zone2 is inside zone1
300 times for 5 minutes?
//Loops Forever
while { true } do {
//Anything in here will get repeated forever
};
//Another way to loop forever
for "_i" from 0 to 1 step 0 do {
//Anything in here will get repeated forever
};
5 × 60 = 300
woah
You can just use the function I made you earlier then, it does exactly that
ok let me look
sleep 1; looped 300 times is most likely not going to be five minutes though.
I used time
he showed how to loop 300x
but is there a way i can loop the code i already have without changing it
?
like what @robust brook showed me but for 300 times instead of indefinately
i want someone that i can just put around my code
you can
just move the brackets
_loop = 0;
while (_loop < 300) do {
//YOUR CODE HERE
_loop = _loop + 1
};
Same code I showed you earlier or you can use @robust brook method both will work
ok thanks nash
while { true } do {
if (hasInterface) then
{
[] spawn {
while { true } do
{
waitUntil { sleep 1; alive player };
if (vehicle player == player && !(player inArea "Zone1")) then
{
player setDamage 1;
};
};
};
};
};
does this look good for the infinite loop?
bro just run what I gave you without the comments
So long as while (true) is there at the top it will loop indefinitely
ok but do i need to indent the brackets at all?
do i need to indent the loop code lines?
no
No but it makes your code look nicer for others and makes it easier to read
ok
makes look nice
lol
teset it
ok
In my opinion you might need to restructure, but it's your code and if it works for you, it works
@past wagon That code you posted will not work.
It will spawn new endless loops forever.
why not?
ughhhh
maybe you guys dont understand what i want
i will try my best to explain it again
Yes please do
loop [MY CODE] 300 times then loop [MY CODE] forever
well the two parts of my code are different
Looks like a "if player outside of area, kill it" script, just terribly written 🤷♂️
Again I will suggest restructuring your code, you don't need to stick to the one you've written there are better ways
i dont know how to code
What are you trying to achieve?
^^^
This is great entertainment.
i need to work with the code i have, because i dont know how to script
i have zero scripting knowledge, but if people help me, i can figure out how to make it work
We can help you with your code if we know what you want...
Not again...
comedy
I think he wants to kill any players that are outside a safe zone, after 5 minutes from mission start
Right?
There are 2 zones, "Zone1" and "Zone2". "Zone1" is the bigger zone and "Zone2" is inside of it. I want players to die as soon as they leave "Zone1". After 5 minutes from the start of the mission, i also want players to die as soon as they leave "Zone2". Players have 5 minutes from the start of the game to enter "Zone2" (which is inside of zone1)
its like a battle royale, where the zone restrictions get stricter
and you need to move in closer
I made a function for you that works with as many zones as you want
Easiest is to have a single "kill script" and just make the area smaller
well
i dont know how to do that
i need to work with what i know how to do
i am kinda knew to arma 3 editing
Well this is an opportunity to learn and improve
yea
after zone2 restriction is active, i dont need the zone1 restriction anymore, since zone2 is inside of zone1
I want the zone1 restriction to last 5 minutes, and then it stops restricting zone1 and starts restricting zone2 forever
so you don't want this to loop 300 times, you want this to last 300 seconds
yea, but within the code there is "sleep 1" which means that if i loop it 300 times, it will last 300 seconds
https://discordapp.com/channels/105462288051380224/105462984087728128/749733789885923421
My take on your issue still stands. A lot simpler than infinite loops.
(missing a sleep)
@winter rose is there a better way to make it last 300 seconds than to loop it?
Looping sleep 1; 300 times means it is going to last at least 300 seconds.
why?
is there a better way
no (and no need to tag me every time, I read the channel; also, plenty of people can answer here)
but i dont think there is much other code around the "sleep 1" so it wont last much more than 300 seconds
ok
private _endTime = time + 300;
while { sleep 1; time < _endTime } do
{
// ...
};
ok let me put that into my code...
@willow hound you didn't see anything 👀
Nope
is this good?
private _endTime = time + 300;
while { time < _endTime } do
{
if (hasInterface) then
{
[] spawn {
while { true } do
{
waitUntil { sleep 1; alive player };
if (vehicle player == player && !(player inArea "Zone1")) then
{
player setDamage 1;
};
};
};
};
};
lol
bruh
what
Almost, you're getting there.

what is it?
for 300s, you are spawning eternal (while true) loops
throw it away
fr
The code you wrote earlier with all the while trues, throw it away
if I do
[] spawn { while { blah } do { blah } };
if (blah) then { blah };
will my code move to the if then statement while the while loop is running?
the code i have was written by Lou Montana
@past wagon time to learn 😉 or #creators_recruiting an SQF dev
