#arma3_scripting
1 messages ยท Page 322 of 1
Wait what did you say it was working fine in
Debug console
so execVM is a command that basically runs a script that you designate, it isn't its own file, so i don't understand what you mean by "in the execVM"
Add top of initPlayerLocal add this:
waitUntil {!(isNull player) && (player isEqualTo player)};
๐
@vapid frigate @limpid pewter Since nothing works, I'll just enable UAVHacker and use the fancy animation for something else.
ok
Or I might rename the action "to prepare hacking" and then you can go up to the drone and actually hack it.
yeah sure
Or I have an even better Idea that fits the scene
you should still try to look for a comman/function that selects an action of "action name" just to make ssure you can't select the action using a script
Well, for the action to be shown in the action menu, it needs to be available. If it's available it's kinda pointless right?
But where can I find proper sources in the Arma files? Maybe I can copy the code from the "Hack drone" into my mission.
you can hide action so that the player can't see it, but the script can
actually yes, taht sounds like something to investigate, find the Hack Drone script see how it works, and try to use that
sounds like the best option
+when you search for a Function in the A3-Folder:
bis_fnc_FunctionName -> search for "fn_FunctionName.sqf" (via "search" in the Browser)
I wish there was a function for that in the first place.
I need to copy the source code from Arma for the UAV-Hacking Action.
Notepad++ is approximatley 10% done.
Thats why i told you the stuff before
I aborted it, I will use this for something else and let the UAV-Operator just hack the drone as usual.
should take you about 30 seconds to test it and tell us?
Well on my end no. Just wondering if it's my issue :P
what's your script?
i'm not at my pc but surely this should test it
_tank = createSimpleObject ["a3\armor_f_beta\apc_tracked_01\apc_tracked_01_rcws_f.p3d", [0,0,0]];
_isSimple = isSimpleObject _tank;
diag_log format["should be true: %1", _isSimple];
-diag_Log
+systemchat
oO Why is everyone using diag_Log, when Quick-checking someting? Strange.
i always run the game windowed, habit
notepad++ takes up more screen space when i play than the actual game does ๐ ๐ฟ
Same, Windowed Mode (hell, i couldn't imagine anymore to test/do stuff in Fullscreen^^)
As long as you just check -> Systemchat.
If you wanna copy stuff out of it -> Diag_Log ๐ (or even better: copyToClipboard)
i feel so uncomfortable when i run arma 3 fullscreen, and not just cos the fps is lower
Also takes "ages" (~1-2s) to switch out, switch in, switch out, switch in... annoying ๐
all my profiles are named by the size of the window, so whenever i join a server in MP (rarely) my dude is called "window-small" or "window-medium" or something
people must think i'm so cool
Lower Res = More FPS?!
_test = _object setPos (position _object); if (isnil "_test") then {_test = false};
_test2 = _object playMove ""; if (isnil "_test2") then {_test2 = false};
if (_test || _test2) then {0 call (compile (preprocessFileLineNumbers "a3\functions_f\misc\fn_initCounter.sqf"))};
Here you see some beautiful Bohemia Interactive SQF code. Isn't it wonderful?
initCounter creates a Arma copyright splashscreen, plays music and creates a Distortion ppEffect.
I mentioned it earlier, I assume this was in there for dev builds
Dev builds? Playing music with a distortion ppEffect?
There is another "system" in initCounter. Which waits a random amount of seconds, then plays music. Forces the player into a dancing animation and makes him smile. And tells all nearby AI's to watch him dance
dev builds in like, early alpha builds or builds for events
It's called fade protection test https://en.wikipedia.org/wiki/FADE It's a copy protection thing
i'm surprised they're still relying on something made by codemasters after all these years
They are not. Atleast in the Steam version FADE is completly disabled
They just didn't clean up the leftovers
legacy code? in a bohemia game? that doesn't sound right
@still forum how did you do that
I mean, whats the code for that
SQF?
_test = "test" createVehicle [0,0,0];
ui
noice
Hi chaps, it was recommended I ask here: has anyone been able to get getCompatiblePylonMagazines to work, or know if it's actually real? It is only mentioned in passing as part of the 1.70 Vehicle Loadouts article and nowhere else in the wiki or the forums, and I can't seem to get it to work with any combination I try. It's the final piece in the jigsaw of me getting my servicing functionality to support 1.70
How did I do what?
the thing
What thing? ^^
How can i save something to the server's profile? I know i can save to each player's personal profile, but i want to save something serverside
just use that in init.sqf?
or initServer.sqf?
Follow-up, where does missionnamespace save things to? And is it persistent across sessions
It's not saved anywhere on the disk, after disconnecting you lose the set variables.
On client of course
Alright, thanks
of course profileNamespace can be 'persistent', as the "documentation" shows
By default the variables set in this namespace will exist while the game is running. In order to make variables save permanently, use saveProfileNamespace before the game is over.
but if you want things to be persistent extDB is your friend
I tried extDB but i couldn't understand how to use it as i was not familiar with databases what so ever and nobody wanted to explain this shite to me. I have a lot more experience now though @simple solstice
@sharp jay initServer.sqf executes on the server (as the name says) sio in there profileNamespace will be the servers profile
well, first you need to know what do you need.
Alright
create all the tables in MySQL first that you think you will need
just use iniDBI and move to an SQL solution later if you need to
or you can do as @rancid ruin says. but if you would like to learn how extDB works, then just check out the altis life github. i don't think there's a simpler solution.
running an SQL database is just total overkill for small missions in my opinion
and if he's making missions for large groups then he'd already know how to use extDB and SQL
Thing is i'm somewhere in between
yeah it is, but its an option. it's easier to manage a mysql database than INI files imo.
i am at the stage where i need to learn how to use sql and i dont really know where to start
mysql just opens MAANY ways you could use the data from arma
well there is about 20 million SQL tutorials on the internet, what with half the internet running on SQL
the one I used to learn from (and still visit if i don't know something)
but I just recommend you using a GUI based editor for MySQL (eg. Navicat)
I currently have a headless server. Could i access a database remotely with Navicat?
On the same LAN
Sure
Oh, neat
If you need some help/have questions about MySQL and ArmA feel free to PM me, as this is not really related to #arma3_scripting
to be fair, if you're gonna run him through setting up extDB then you should copy/paste the basic setup of it in here because quite a few people ask how to get going with it
Hi! I have a question! Is texture tiling for interfaces something that can be done in Arma 3? I haven't seen anything about it anywhere. My idea was to pack a few UI element in the same image, or maybe make an UI animation with a tiled PNG image. Thanks in advance!
I want to try to do a stacked OnEachFrame that updates an RscImage changind it's frame... But I fear of the IO lags
tiling as in repeating a texture, or like an atlas where there is multiple sprites within one image?
Atlas
not possible as far as i know. i don't think there's any way to mask an image
As far as I know of, I can't set UV pos for a RscImage
but i reckon you could animate fine with oneachframe - it's all client side, should be fine
But maybe there's a hack for it
i wanted to test that idea a while ago but never got round to it
@rancid ruin well extDB setup is fairly easy, but the trick is how to use it. read/update/insert the DB
Well, @rancid ruin, I will try to do it with a pure stackedOnEachFrame
Will try it
But each time it loads any image from HDD the game usually freezes from IO
Oh! Just readed the topic on hand!
load them all up on screen at like +9999,+9999 position, then just reposition them when needed. that's the method i would try
people have done crazier shit in this game than animate an image, that's for sure
@rancid ruin Oh!, Nice one! Didn't though of that one
also, you could always just use a video. that's a pretty good solution if you want moving pictures generally
only disadvantage would be no alpha channel
@rancid ruin but transparent video in RV is not a thing ๐ฆ
yeah exactly
Will try the offscreen loading
report back with how well it works pls
okay
Another thing I'm working on: Anyone is interested in making a clientside .dll that connects with a remote NodeJS server?
I'm still looking into it, but I wanted to do an extDB like extension, but client side that opens a session with a remove server and queries directly through https
As extDB puts lots of stress in the A3 server
I'm looking into micovery's code and he did achieve connecting to a nodejs server locally
ah yea i was about to link you that
yeah, i am still analizing his code
But it want to take the ticketing system idea from extBD2 and make a https client for clientside
I would drastrically improve the current extDB-missions servers, as all the load would be distributed to each client
it*
Anyone interested? ๐
Whitelisting might be a pain
I mean BE
Could also rewrite extDB using Intercept. And use that to take a lot of load from the server :u
๐ค
with no offscreen? ๐
LUL
Well. This is neat.
Just loading the images on the go, a single control with no need of puting eachframe out of the screen
nice, that's about 4FPS though. wanna try it at 60?
Hmm
Do you have that big enough of a tileset?
I wanna try that lol
i+m going to try find one that big
or just decompose a video or something
just copy/paste the same ones 60 times? the content doesn't really matter if you're just testing
hmm
yeah
will color the image each time it repeats itself
so we can tell when it repeats
you can export gifs to separate frames in software like imageready
or probably some free tool online
photoshop does that too
success!
A total of 212 frames playing 60 FPS (no FPS compensation cos I'm lazy), each is PNG-24 1024x1024 (11MB total, 75kb frame)
Not real 60 FPS, but close enought
UI animations are real!
nicely done, i had a feeling it'd work just fine
nice work
knowing arma, displaying the hints probably uses more processing power than displaying the images
hahaha
true that
Maybe I refine the code a bit and publish it in the forums or whatever
But I am usually too lazy
Combine that with heavy load of other scripts runnign amok for some stress testing!
Hmm
Don't have anything like that
Bah, will just spawn tons of AI and let them fight over
Well, having 80 soldiers fighting each other does some rubberbanging in the animation if set at 60 FPS, but can be corrected with a good motion blur in the frameprocessing and dropping the frames to 24 FPS
or even a frame compesation algorithm, but im too lazy for that
wasn't this some sort of sprite compilation though? like 4 images that played on aloop?
@vapid frigate no alpha channel on videos ๐ฆ
ah ok, just saw your example and thought a video would make more sense
but i guess that's just a test
@subtle ore Each frame is a single PNG, works well ๐
yeah, it was a test, but it could be used to make somewhat more interactive interfaces or screen effects
just learning new stuff everyday
That works
The test has 212 individual frames at 60fps
hi. I dont know if this is the right place to ask this. Is it possible to make a more dynamic damage system to where damage is shown on a vehicle? I think it looks bad that the whole vehicle is suddenly full of bulletholes
can I add bulletholes directly to where Im firing?
it's probably possible, but not really feasible
ok. maybe feasible to cut out smaller parts and only apply damage texture there?
that's the only way i could think of doing it.. having lots of models or maybe modular parts or something
still wouldn't be very accurate without a crazy number of models though
and would likely hurt performance
yeah. wouldnt be worth all the trouble I guess
I dont expect to see BI add a similar system like that of GTA V in Arma ^^
yeah i sorta think you've got better chances of Rockstar making a milsim game
(not that they're very good still)
Hey, im trying to createDialog a menu as soon as a player spawns into the server. To do this i run a script called menuInit.sqf which calls the necessary functions. When i put nul = execVM "menuInit.sqf"; and a respawn EH to run same script on respawn, it doesn't bring up menu until i run the script through debug or the player respawns. Why might this be?
Btw i have tried putting it into the initPlayerLocal.sqf and it still didn't work
I am thinking that it is trying to run the script before the player's unit has spawned into the world, hence why the script doesn't do what it is supposed to.
ok, so instead of putting the execVM in the unit's init, i should have an event hanlder and then run script from that?
you can also do stuff like waitUntil {sleep 0.1; player == player }; or waitUntil { sleep 0.1; !isNull (findDisplay 46) };
yeah, if you add the event handler in initPlayerLocal (or any init/preinit), it should work
ok cool thanks dude
its weird tho coz it was working fine a little while ago from tthe uni
t's init, but then now it failed
yeah it might depend on timing
what other scripts are running, what AI is loading, etc
and your PC speed
no ai, all players on server, and that's the first script running
anyway that EH will work
thanks
np
it's a bit later than i'd like
would be good if it ran the instant the loading screen faded (for like a splash screen)
yeah that may be a problem, will look into it
I have an array _spawnpoints = [ [[13772.8,18906.2,7],nato_base_camtarg,[13774.1,18931.3],"Base"], [[14242,18298.2,5],aflag_camtarg,[14270.6,18284.8],"A-Petrol Station", [[14016.8,18499.9,7.59484],bflag_camtarg,[13988,18442.4],"B-Playground"], [[14029.7,18626.7,8.86074],cflag_camtarg,[14053.4,18605.5],"C-Church"], [[13977.4,18907.4,10.6956],dflag_camtarg,[13996.9,18807.9],"D-Contrustion Site"], [[14436.6,18639.3,10.0369],eflag_camtarg,[14404.7,18632.4],"E-Cemetry"], [[14373.4,18916.9,11.9863],fflag_camtarg,[14384.8,18879.6],"F-Industrial Area"] ];
i need to take the spawn name from each index of the array,
spawn name is the fourth index of each array
will this script grab that spawn name from each array and put it into an array called _spawnNames {_spawnNames = _x select 3;} forEach _splist;
?
_spawnNames = _spawnPoints apply { _x select 3; };
or that ๐
ok thanks, idk why, but working with arrays confuse me
unfortunately you're gonna have to get very used to it for SQF
@limpid pewter if you ever worked with PHP, all you can think of are arrays and SQF is in some parts similar unfortunately.
I always liked advanced Data structures such as HashMaps as you can find them in Java.
In JavaScript you can make an Object on-the-fly and put those in an array, that's even better.
But SQF doesn't have such a thing as far as I know.
Hi! What's brewing here?
Is there a way to make a script online one time executable? I added some menus to ace and put an exec command in my init.sqf.. but when a player dies or even respawned the init.sqf will be executed again and i have every menu point twice in my ace....
nothing ๐
Okay hahaha
init.sqf does not run on respawn
you have a script that runs init.sqf on respawn? ๐
But wait, you want it to execute once in mission load or you want to execute it for each player once? or how does it work?
@scarlet temple but to answer your initial question: You can alwyas set a boolean at the end of a function and check for the boolean on startup.
That way it can only execute once
But when i set a request for that on the beginning like "If (_executed) exitwith ()" it calls "unknown expression in variable"... so i had to add _executed = false in front.. what make this wothless ^^
use setVariable
_executed is a local variable. And you expect a local variable to be global? ^^
i know.. it was just a example...
you should use isNil to check if the variable is undefined
if (!isNil "executed") exitWith {}
And after your code just executed = true;
thx.. i ll give it a try... i forgot !isNil
Anyone know a workaround for camera glitches when using switchMove. Ive got a jump script which uses the AovrPercMrunSrasWrflDf animation and setVelocity to mimic a jump, but the camera jitters slightly when this is done
quick question, is _spawn a reserved var?
@limpid pewter no. I'm not aware that there is any reserved local variable
ok thanks, just having alot of trouble with something that should be simple : (
shall i explain, or is someone else asking quesiton?
Well. This channel is for scripting help so. ask away
kk
new to arma modding/scripting - want to add antiafk script as a server mod that runs on client machines - is this possible?. I tried hooking postInit but my code never ran. PBO here if anyone has time to tell me how I fucked up https://drive.google.com/open?id=0BwOZAGrULN5neExWVnM4YUZES1k
nvm Wallop u go
nah you first ๐
@frosty cave Can't download.
sec
And.. It's not like multitasking is a thing.. right?
k updated perms
You are using CBA-like headers. But without CBA? Interesting.
I don't see any problem here. Maybe setting the file parameter in your function entry to point directly to the script file would do it
how i insert script properly into a discrod msg? i have been using triple back tick
Ok I'll try that next thanks. And yeah, borrowed the idea in case anything needed preprocessing (which it doesn't, but wanted to get a mod folder skeleton set up for future projects)
triple backtick followed by sqf highlights it
```sqf
code
```
Just do it like I wrote
hint "does did work ";
cool thanks
Ok so i am trying to pul the forth element from every element in an array (Code Below) ```sqf
_spawnpoints = [
[[14335,18046.7,13],csat_base_camtarg,[14334.2,18070.2],"Base"],
[[14242,18298.2,5],aflag_camtarg,[14270.6,18284.8],"A-Petrol Station"],
[[14016.8,18499.9,7.59484],bflag_camtarg,[13988,18442.4],"B-Playground"],
[[14029.7,18626.7,8.86074],cflag_camtarg,[14053.4,18605.5],"C-Church"],
[[13977.4,18907.4,10.6956],dflag_camtarg,[13996.9,18807.9],"D-Contrustion Site"],
[[14436.6,18639.3,10.0369],eflag_camtarg,[14404.7,18632.4],"E-Cemetry"],
[[14373.4,18916.9,11.9863],fflag_camtarg,[14384.8,18879.6],"F-Industrial Area"]
];
_spawnpoints;
and i use the code below to create a menu and then populate with the 4th element from each array. ```sqf
menuOpen = true;
createDialog "mainSpawnMenu";
waitUntil {!isNull (findDisplay 12034)};
if ((side player) == east) then {
_splist = [] call mld_fnc_listCsatSpawnPoints.sqf;
{spawnNames pushBack (_x select 3);} forEach _splist;
} else {
_splist = [] call mld_fnc_listNatoSpawnPoints.sqf;
{spawnNames pushBack (_x select 3);} forEach _splist;
};
_ctrl = (findDisplay 12034) displayCtrl 1500;
lbClear _ctrl; // may need to comment this out
{_ctrl lbAdd _x;} forEach spawnNames;
lbSetCurSel [1500,0];
_ctrl ctrlAddEventHandler ["LBSelChanged", {call mld_fnc_moveMenuCamera}];
For some reason i doesn't want to work : (
it seems to get errors for the calling of the functions even tho the functions are a simple array return
What errors
1 sec
undefined variables
_splist = [] call mld_fnc_listCsatSpawnPoints.sqf; invalid
ok how?
is that a function or a sqf file?
lol
nvm
just figured out ffs
after 2 hours of troubleshooting haha ffs
i need sleep haha thanks for patience
oh yeah, while i have got you guys there, is there any other rreason as to why the script wouldn't put 4 element of each array into the var called "spawnNames" that you can see?
or that is do you think it will work?
_spawnpoints select {_x select 3} returns array of every 4th element of spawnpoints
your code does the same though
no it's not.
okey yeah.. select might not work..
_spawnpoints apply {_x select 3}
there. Applies statement to each element in array and returns resulting array
no
oh?
you can use it everywhere you want
It will just get overwritten when you use forEach
so if im selecting 3 of array _x, where is _x defined?
Not even sure if forEach would overwrite it.. I don't think so. It will just be different inside the forEach code
_x is the element of the array
just like forEach
apply works like forEach. But returns an array of what you return in the apply statements
ok so that makes sense, because im using multi-dimensional arrays. _x is an array
thanks, i think i may be able to work with this
DUUDE @still forum you're legend mate, fixed my code and taught me stuff about var
Ok.. Take a ๐ช
ok @still forum I misunderstood how the CfgPatch attrs work. now have my servermod running but throwing errors
diag_log format ["antiAFK starting"];
_name = name player;
while { hasInterface } do {
_lastpos = getPosATL player;
_c = 0;
sleep 60;
while { (getPosATL player) isEqualTo _lastpos } do {
_c = _c + 1;
switch _c do
{
case 5:
{
player systemChat (_name + " you have not moved for 5 minutes and will be kicked if stationary for another 10.");
};
case 10:
{
player systemChat (_name + " you have not moved for 10 minutes and will be kicked if stationary for another 5.");
};
case 14:
{
player systemChat (_name + " you have not moved for 14 minutes and will be kicked if stationary for another 1.");
};
case 15:
{
player systemChat (_name + " you have not moved for 15 minutes and are being kicked.");
sleep 5;
("#kick " + profileName) remoteExec ["serverCommand", 2];
};
};
sleep 60;
};
};
yields
15:40:54 Error in expression <_c + 1;
switch _c do
{
case 5:
{
player systemChat (_name + " you have not moved>
15:40:54 Error position: <systemChat (_name + " you have not moved>
15:40:54 Error Missing ;
15:40:54 File \WALOP\functions\events\fn_antiafk.sqf [Wallopafk_fnc_antiafk], line 14
systemChat only accepts one argument
ah i assumed it would concat those into a string, very very new to arma scripting
it would
you are giving systemChat player and a string as argument
but it only takes one argument on the right side
ah ty
it runs, log happens, but no systemChat fired. am I missing the init order of things? is it possible this isn't being run on the client since loaded as servermod?
LOL. i got the impression that servermod code could run on client (dudas rapelling mods etc)
Those usually have some specific way of sending the require code to the cilent
ah ok that makes sense
you can remote exec the function on all players
if you set the remoteExec JIP thingy you only have to remote exec once on all clients
and it will get added to the JIP queue
hits the books
I have extDB3 on my server connected to a database, but how do i actually use it?
So, i wanna have persistent player inventories, and i already have a script that gets the inventory data from the players, but how do i add that to the database
After setting an AI to green combat mode, how can I keep it from just switching back to yellow?
(because it actually does that)
Hi chaps, tried asking this yesterday but no reply: has anyone been able to get getCompatiblePylonMagazines to work, or know if it's actually real? It is only mentioned in passing as part of the 1.70 Vehicle Loadouts article and nowhere else in the wiki or the forums, and I can't seem to get it to work with any combination I try. It's the final piece in the jigsaw of me getting my servicing functionality to support 1.70
Aaaand disregard, just seen my thread got replied to. Ta anyway! ๐
Is there really no command to check if a unit can see another? or am I just too stupid to find it?
@loud python This might be helpful:
https://community.bistudio.com/wiki/lineIntersects
Okay: anybody willing to lend me hand/some time with the VectorStuff?
Me... again ... i try to check if value in a variable is a number or not.. IsNumber is something else and IsNil can work only with strings.. any idea?
If(_variable isequaltype1) Then ??
Why would you ever get to the Idea to use isNil to check what type something is?
No.
if (_variable isEqualType 1) then
spaces are important
And making everything lowercase is bad for readability
<--- linux idiot... ^^ all in lower cases
but k ๐ I'll give it a try.. thx for the hint
Still struggling with this problem, how can I keep AI from just changing its own combat mode back to whatever it wants?
Greetings! Help me out here. I want to export some asset previews, although the screenshot command is not working at all. It does create the folder structure, but it does not save the actual screenshot. Any known issue about the screenshot command? Now I'm trying with the "normal" profile (arma 3 folder instead of Arma 3 - Other Profiles) but I get the same issue.
@loud python https://community.bistudio.com/wiki/disableAI
"AUTOCOMBAT" - disables autonomous switching to COMBAT when in danger Available only since Arma 3 v1.56.
you still can switch to combat mode
you just have to do it yourself
not that combat mode, the other one
why does BIS_fnc_findSafePos return a number instead of an array sometimes?
setCombatMode not setBehaviour
I'm running that command and sometimes it spits out an array, sometimes a number
but it should never be a number
hm just had to increase the range
@sharp jay presuming you have the database configured and a table made ... and your mission is configured to properly initialize and use it ... just write the code you need to send whatever you want to the database.
Check out Exile or Alive mods if you want to see how they use extdb3 in practice.
There's also some example files on Torndeco's bitbucket https://bitbucket.org/torndeco/extdb3/wiki/browse/
@tough abyss @tough abyss regarding the ai balancing tool. shame that network costs eat up the benefits.. it is 'released' as a part of this mission: http://steamcommunity.com/sharedfiles/filedetails/?id=926135666 if I work on it some more, learn how to make a ui properly with more options, I'll put it out standalone.
@tough abyss thanks will try it out ๐
@tough abyss that's still pretty cool, means there's less of a 'hard limit' on performance of servers, as one could theoretically get a much faster connection than a more powerful server
I probably missed it, but did the latest 1.72 patch / RC change the way that aiming precision is handled? (in wind or any other situation) I'm noticing a lot of randomization in aiming through optics with x,y as the mouse is moved.
Not sure ;\
Hey if anyone knows, how would i go about making displays that stay on the screen. Kinda like the ones found in KOTH or Life for the money, score, etc...
I could create dialogs for it, but i have a feeling thats not the best way to do it
i want these dispays to show the score at the top of the screen, player
player's health %, etc...
very similar.. https://community.bistudio.com/wiki/createDisplay
ok, but will this display be interactable? because that would defeat the purpose
ok
cool,
i really didn't want the display to go away when a player presses esc.
thanks
also, what is display 46? i know its used for keydown EHs, is it just a generic player display?
yeah that's where your ammo, etc are
so it's kinda like the over arching display for the whole UI in arma yeah or no?
for the ingame HUD
I know at this point my endless questions are probably starting to get annoying, but does anyone know of way to dis allow calibers smaller than .338 from damaging the tyres of a vehicle like a marid?
@limpid pewter use cutRsc and a script that updates the text controls of the display to reflect a change in score
Also, feel free to ask questions - that's what we're here for
haha ok will do then
I'd read up on the handleDamage EH for your marid case
I personally don't have a ton of experience with it
ok
But you should be able to implement a check that detects the class of the ammo hitting it, and denying ammos smaller than .338
i was thinkin there may be a what to use the vehicle cfg to change the damage recieve for te wheels
aahh
thats sounds like the way to go, nice an simple
That would be the best way to do it if you're modding, but the EH is pretty performance light
- you only need to apply it to marids
ok thanks
And the scriptโ will only be an if () then statement so you'll be fine
Making a mp gamemode?
yeah, a little battefield like gamemode for my bf3 friends to come try, hopefully it will convince them to play arma ๐
thanks for the help anyway
will look into it
No worries, keep a look out for sample Configs too
is this a valid cFg functions? ```sqf
class mld
{
tag = "mld";
class spawnSystem
{
file = "functions\spawnSystem";
class spawnMenuCamera {};
class selectCamPosition {};
class listNatoSpawnPoints {};
class listCsatSpawnPoints {};
class spawnPlayer {};
class moveMenuCamera {};
class createSpawnMenu {};
};
class kitSelection
{
file = "functions\kitSelection";
};
};
hey quiick question, what is the muzzle name of a weapon, and what is it's significance?
Muzzle is the munition fired I think
ok thanks
https://community.bistudio.com/wiki/BIS_fnc_addWeapon Would this function work for grenades?
so how would i add to unit
ok, i only wanted to use addWeapon, coz larrow on the forrums said it would work, addWeapon Command not function btw
They are magazines
ok thanks, if i know that they are magazines, i can add magazine
or start there atleast
So I just learnt I should be using this setVariable ["Ace_medical_medicClass", 1]; in a units init rather than listing names in the module due to JIP issues.
Doe s anyone know where exactly I can find a list of these ACE variables? Because I would like to find out what the engineer one is as well. I had a look on their wiki but it's not obvious there
easiest to look at their code https://github.com/acemod/ACE3/blob/master/addons/repair/functions/fnc_isEngineer.sqf
(ACE_IsEngineer)
Ok that doesn't quite fit the same format, but I guess I can dig around now you've pointed me in the right direction thanks
yeah, it's in that function.. usually they use GVAR in which case it'd be ace_repair_isEngineer.. but i guess it's legacy code from before they did that or something
All this time I've been wondering why I've had to use Zeus to actually make my medics medics. Frustrating when there's modules in the editor and they just don't work (which as I understand it is no fault of the ACE team)
Ok so it seems while this setVariable ["Ace_medical_medicClass", 1]; is correct, this setVariable ["Ace_repair_engineerClass", 1]; is not
Well yes if you read the code on that Github page the variable is called "ACE_IsEngineer"
Yes but the code to check a medic is [player] call ace_medical_fnc_isMedic
It just doesn't seem consistant
The names might not be internally consistent, especially if the components were coded by different people
That's my point, while I โค the ACE guys sometime it gets a little frustrating. But that's ARMA too I guess, always feels like it's fighting you
Feel free to shoot them a pull request and fix it i guess
Oh and the code I ended up using in case anyone else is reading this and wondering
this setVariable ["ACE_isEngineer", 2, true];
Oh if I had the knowledge I most certainly would. That's probably why it's frustrating. when you only know enough code to "get by" things like this make it that much harder
Oh and just to be clear, I am in NO way ragging on ACE or the guys that work on it. The game just wouldn't be the same without them and the work they put in for free. This is more just me venting my frustration at my lack of knowledge more than anything I guess
problem is if they fix it, it'd mess with people like yourself who are now using it
the 'allVariables' command is good for working out what they use too
AFAIK you should be able to just set a checkbox in the Eden Attributes of a unit to make them Engineer or Medic.
They probably won't accept a pullRequest that changes that variable name because many people already use it like that.
Yeah I'm not going to request anything like that, I was just venting.
I've had hit and miss experiences changing the eden attributes which is why we switched to naming the units and putting the names in the modules. Now apparently that's unreliable too, I assume due to the start up of the mission (ALiVE can take forever first server start)
hey, is there a way to make a player climb ladders faster?
setAnimSpeedCoef whilst the player is climbing?
Hey guys , i have problem on our server. Some People connecting on our Server, hanging in a deathloop. On this Server you can change sth in the Database over mySQL. I Type this to fix the Problem :CREATE EVENT Spawn_Bug_Fix
ON SCHEDULE Every 300 second
Enable
Do
DELETE FROM player WHERE damage = 1 Ialso reboot the Server to put the scheduler ON. I need help pls . Greetz Evil
๐
Uhm. Okey.
Hey, anyone wanna help me fix an infinite loop?
if (true) exitWith {} Put that inside your loop (Obviously trolling)
i am making a jump script, that makes the unit jump when space is pressed. The function is initialised with this code in the file initPlayerLocal.sqf ```sqf
waitUntil {!(IsNull (findDisplay 46))};
keyd = (findDisplay 46) displayAddEventHandler ["KeyDown", "(if (_this select 1 == 57) then {[] spawn mld_fnc_jumpOnSpace;});"];
The jumpOnSpace fnc is this ```sqf
_pSpdKH = speed player;
_pDir = getDir player;
_pSpdMs = (_pSpdKH*1000)/3600;
_Zvel = 5;
player setVelocity [sin _pDir * _pSpdMs ,cos _pDir * _pSpdMs,_Zvel];
(findDisplay 46) displayRemoveEventHandler ["KeyDown", keyd];
sleep (2);
keyd = (findDisplay 46) displayAddEventHandler ["KeyDown", "(if (_this select 1 == 57) then {[] spawn mld_fnc_jumpOnSpace;});"];
Why...
Why readd the eventhandler?
Just to have it disabled for 2 seconds?
These variable Names hurt
lol
How does it loop? You keep jumping?
i want it to allow a player to jump, then for two seconds disable the jump, then jump and so on
yeah
also keyd is a bad variable name. Any mod could overwrite that. mld_jumpKeyHandler would probably be better
this was my orignial effort ```sqf
_pSpdKH = speed player;
_pDir = getDir player;
_pSpdMs = (_pSpdKH*1000)/3600;
_Zvel = 5;
player setVelocity [sin _pDir * _pSpdMs ,cos _pDir * _pSpdMs,_Zvel];
sleep (2);
ok, sorrry for my shitty var names, but it doesn't really matter too much
I don't see how that could loop. Besides the player just spamming spacebar
so the last bit of code i posted didn't loop, the first did. The only reason i tried to use the first, was because i wanted to make it so the player could only jump every two seconds
I don't see a reason for any of them to loop :x
me niether, i thought that once the space key was pressed, the player would jump, the Eh will be removed (so player can't press space) then after 2 seconds, the EH created againb
is my logic wrong or?
looks completly fine to me
No. As I said I don't see any reason why that could loop
ok thanks anyway
The only way that would get called again would be if the KeyDown eventhandler fires again
You can try putting some logging into your KeyDown eventhandler. Then you know if that's causing it
If the eventhandler is not triggering and your function still executes then it's something completly different
can someone please upload a .sql file for arma 3 lakeside the sql file im trying to execute for my DB is failing
can someone answer why my sql files aint working to execute them for the DB>
@vestal mortar #server_admins or #arma3_tools for extDB
@limpid pewter Set a variable like mld_jumping and check it before calling your jump script and then within the jump script [] spawn {sleep 2; mld_jumping = false;} or something
wow yeah, i was thinking i could do something like that, wasn;t sure how, that might jsut work,
i will try and get back
@warm gorge As usuall, you are a great help, thanks
it worked well
Sweet
Hi, just a question. How do I remove the Actions from an item lying on the ground. I want to add an Action instead of the ability to pick it up.
k
getCameraPosition ?
No.. How is that thing called.
positionCameraToWorld [0,0,0] https://community.bistudio.com/wiki/positionCameraToWorld See note by Kronzky @hasty violet
hey does anyone know the idd for the AI control/Radio menu?
I forked a mod and want to sign it for testing MP. when I pbo, and start server I get errors like \xz\foo\bla not found where xz is the previous prefix. I have tried setting the prefix to xz, and my own 'WALOP'. What am I missing?
@frosty cave What packer did you use to pack that pbo?
tried pbomanager and armatools
Both don't read PBOPREFIX files afaik. I think Arma 3 AddonBuilder has a setting for the prefix. PBO manager I dunno
hm ok I'll try again tonight - tried both prefixes in Arma 3 AddonBuilder options afaik
You can open the pbo in a hex editor or in notepad++. Right at the beginning it should say prefix and after that the actual prefix that the file has
you can compare that to the original pbo
awesome. as usual, thanks for the help @still forum - edit - confirmed it had my prefix and not the proper one, thanks for hex tip
Does getUnitLoadout and setUnitLoadout work for crates and shit?
Is While {true} do { Whatever }; Valid?
yes
thats different from trying to save and restore contents, though
Exactly
getUnitLoadout = Unit, not crate
well, a crate is an empty unit so
i dont know how i could go about saving crates then
read through it, couldn't find anything
youll jsut have to script more
getItemCargo etc
save that and readd it
that example is overkill but saves vehicles with ammo and damage
didnt think about search term cargo
Anything else?
...
Read that Page, click around any Commands. Read some example. Below those, are mostly the couterparts of it linked (e.g. getPos has setPos, setPosWorld etc linked below)
75% of the time, you will end up in the editor, testing around Scripts.
How can I get an addaction or a holdactionadd to be global? Or atleast be local then the removeaction to be global so it can only be activated once
I've tried this
[laptop1,"Upload Proteus Coordinates","","","_this distance _target < 3","_caller distance _target < 3",{},{},{hint "test"},{},[],4,0,true,false] remoteExec ["BIS_fnc_holdActionAdd", [0,-2] select isDedicated, true];
But that creates an interaction option for the amount of clients connected, had a headless client connect and a friend so the option appeared three times in the scroll bar
Also tried
[laptop1,"Upload Proteus Coordinates","","","true","true",{},{},{"scripts\arty.sqf" remoteExec ["execVM"]},{},[],5,nil,true,false] Call BIS_fnc_holdActionAdd;
In cfgRemoteExec, does anyone know what headless client would be for a number? Or would it just be either 2 or whatever the variable name is?
How can I make a script that will execute functions only on the first join?
The first time someone joinsd
Well, just monitor theirs connections
And only execute something on their first
Use the server to handle it
Had a couple questions that i have been trying to solve on my own but my arma knowledge hasn't allowed me to figure out and was hoping someone on here could point me in the right direction. This is on a dedicated MP server, and im using a addaction to allow a player to spawn a vehicle on a invisible helipad. MenuObject addAction ["<t color='#FF0000'>UH1Y FFAR/MG</t>", {createVehicle [(_this select 3), (getPosATL chopper), [], 1, "NONE"];}, "RHS_UH1Y"];
The issue i am running into is it always spawns facing north and i cant figure out where or how to change this
My next question is i have tried to find a way to make the time either not change so as it always stays daylight, or a way for a member to be able to go to a addaction to advance time, this is for use on a training server also dedicated, and it uses ACE. I have tried several things but it only seems to take effect for a few moments then switches back, it does however work when testing off of the dedicated server.
Just try adding a setDir command after the huey is spawned
Try a script that checks if the ingame time is past say, 17:00
if (_time > 1700) then {setDate 09:00)
ofc that's not real code so don't use it
but that line of programming is a good way to approach it
ah so use set date instead of set time thats probably where i was going wrong
pretty sure setDate isn't a real command :p
On the setdir im just putting this info into the init line of the sign with the setdir still work
if it is, I got the syntax wrong
Call a function that creates the huey and then sets it's direction
cleaner init box too that wat
way*
and it'll stop duplication of vehicle in mp environment
ah ok i will have to go do some more learning havn't got into the functions yet
thanks for the help, will go do some more research
no worries
_marker = _this select 0;
_selectedVehicle = "RHS_UH1Y" createVehicle [0,0,0];
_selectedVehicle setDir (getDir _marker);
_selectedVehicle setPosASL (getPosASL _marker);
};```
something like that would work
k i can backwards engineer it from that after i look up functions thanks for the help
where the function is called by [helipadname] call fnc_spwn_huey;
looks like it will clean it up alot because just one sign has 3 differnt versions of the one huey so this could make it look alot better and im guess will work alot more efficient
you can also pass the classname of the vehicle you want to spawn to the function too, so the function works for all vehicles; but I'll let you figure that one out
sounds good won't ever get no where if I don't figure it out just needed a nudge in the right direction
So far ive just been taking other scripts and trying to understand them and making small changes to get to understand them been working decent but when it comes to something i cant find that makes it impossible to figure out, guess the addage that cheating will get you no where is true
Alright back off to the editor, thanks again
remember biki and copying/adapting other people's scripts isn't cheating, it's just how you learn
cya
Hey is there any reason why this would only add 1 grenade instead of two (yes the player has plenty of space in vest) ```sqf
player addMagazine ["HandGrenade",2];
Anyone got an idea of how to find the impact point of an artillery strike before it's hit?
Trying to detect player ordered strikes too so I can't just pass the location that was ordered to strike
Nvm I'll just capture placed 'fire mission' waypoints ordered by zeus
@limpid pewter https://community.bistudio.com/wiki/addMagazines mind the s
Oh ffs haha sorry
thanks for tah
@nocturne iron If you still want to do want you said, you can use some fancy projectile motion equations, where you will need the muzzle velocity, the weight of the project, the game simulated gravity, etc...
with that you can figure out the range, and from the direction you can figure out the hit point
I thought so, but MLRS rounds sort of ruin that
- 2D co-ordinates suck for that on non-cardinal trajectories
_box1s = profileNamespace getvariable "box1";
box1 addItemCargo [_box1s];
_box2s = profileNamespace getvariable "box2";
box2 addItemCargo [_box2s];
while {true} do {
_box1 = getItemCargo box1;
_box2 = getItemCargo box2;
profileNamespace setvariable ["box1",_box1];
profileNamespace setvariable ["box2",_box2];
saveprofileNamespace;
sleep 60;
};```
Anyobdy see what is wrong with this? It is in initServer.sqf
don't think object references could be saved to the profile namespace like that
you're trying to store the contents of boxes?
Yes
oh
i knew i messed up somewhere
thanks
Wait, no
_box1 is the contents of box
and i am trying to save that to profilenamespace
ah ok, misread sorry, that should work afaik
It is not working though :/
itemcargo is only items.. you're not testing with a gun or something?
i put several items in the boxes
but it was not saving
Wait, so itemcargo doesnt save, say magazines?
Hey, does anyone know how to make a trigger activate seperately/idependently for each player in a MP mission?
So if a player enters the trigger, it will run the code in the statment for that player only, and then if another player enter, it will run it again, but only for that other player
it would be good if anyone knew of a createTriggerLocal command type thing
Hello i have a huge problem... i am using game logic markers on the map to delete buildings it works perfectly in the editor however when i move the sqm to the live server and spawn in the buildings are there... this is the code used within the game logic inside the init if anybody has any idea i would really appreciate it
{ _x hideObjectGlobal true } foreach (nearestTerrainObjects [this,[],10])
It prompts a warning init: local variable in global space.
assuming that is ok to dismiss?
Ah dose not allow me to dismiss @nocturne iron
I don't have anything within the Variable Name i just placed the code required in the init maybe its that?
It just shows "***** HIDE OBJECT GLOBAL * SERVER *****" @tough abyss nothing below it
Just replaced it with the line you sent and now im getting
16:02:31 """Logic"""```
And using a file how would i go about that assuming i would need to use the map location of the house? would it work to use a uiSleep 60;
And thank you so much for the help @tough abyss this is the most i have got anywhere so far haha
I'll give that ago thank you haha :p
Ugh! its not working ill email bohemia maybe they will reply around 2020 asked a ton of people nobody could get it working spending too much time on it.
hideObjectGlobal seems broken on a dedicated server
remoteExec hideObject to all clients instead
or just put hideObject in the init box
sleep 60;
{
_x hideObject true;
} foreach (nearestTerrainObjects [_this,[],10]);
};```
(O)_(O) It works!
Hahahaha thank you so much!! and to you too @tough abyss
Know anything about my problem in #arma3_ai ?
Stable
on dedicated MP?
I can't but thats an interesting fact
i mean i might
but not at pc atm
aight, i'll take a look into it then
Hey guys, if I want to create a child display from a parent display, yet I still want it overlapping the other display, so I then see both displays. Is this possible through createDisplay somehow? Is putting everything in a controlsGroup the only option maybe?
Hey guys, I want to get the specific vehicle part under cursor(a.e. "wheel_2_1_damper"). Is there a other option as getCursorObjectParams ? ( https://community.bistudio.com/wiki/getCursorObjectParams )
selectionPositions cursorTarget maybe? @serene vector
@rotund cypress cheers
Did that do the job? ^
yes thank you ๐
โค
2x Inch? Erm...
Ye ikr ๐
You means 5,08 centimeters ๐ ๐
You should consider renaming (check "@Veterans" Userlist)
Hey guys, if I want to create a child display from a parent display, yet I still want it overlapping the other display, so I then see both displays. Is this possible through createDisplay somehow? Is putting everything in a controlsGroup the only option maybe?Anyone know ^? I know in 3DEN they do not close the other display when opening the other one, and they seem to use createDisplay without controlsGroup, but I cannot see how they are not hiding the parent display.
@hasty violet https://community.bistudio.com/wiki/roleDescription
No no no, that is a hardcoded config entry for that unit. entry is named "displayName" i believe under the CfgVehicles entry.
ex: displayName = "Little billy bob joe";
Thes aren'tchangeable via any script or mission modification keep that in mind.
shakes head , that was a confusing approach. It'd be nice to know you were trying to pull from a config lol.
hey, how would i go about re-edting a dialog with the GUI editor? I have the exported the gui in the form of control classes, how would i use that as a starting point to re-edit it?
I'm fairly certain you can put the config in your clipboard and there's a keyboard shortcut to load the gui back in
e.g.:
configFile >> "RscDisplayInventory"
OR
MissionConfigFile >> "RscDisplayInventory"
ok, so if i have an allready made GUI using the control classes, i can just say what you have said to re-edit it?
or is that how i would find the path name for my gui?
im still not quite, sure but i will try to fumble my way arround for a bit, see how i go
Just to make it clear: You can only move stuff around in there. It WILL NOT be saved! You have to add it to your files by hand!
yeah, but i can still export to clipboard once done right?
ok, so if i press ctrl +i to import from config, if i type missionConfigFile/diaglogname will that bring up my dialog or not?
missionConfigFile <- e.g. when you have that stuff loaded in the Editor/On a Server
configFile <- when inside an Addon
ok, i think i get it thanks
rgr
ok i got it tanks, it was missionConfigFile >> "dialogname"
yep
he's posting it in every channel
a ban would remove all of them in one go, just saying
@lavish ocean
@meager ember or @drowsy skiff sorry to tag all of you but trying to end that spread
Yep he posted it in every single channel
Any idea why setObjectTextureGlobal on players for clothing textures only works when used with remoteExec globally? I thought its meant to be synced for everyone, including JIPs
it should be, but i don't think it works very well on uniforms
taking off the uniform/putting it back on will reset the texture
And no one tagged me... Banned
hey, how would i get all classnames of all sights, muzzle attachments and other attachments, and put them into an array?
@open vigil there you go, i tagged you ๐
I miss all the fun!
@limpid pewter i thnk it'd be SQF _attachments = "getNumber (_x >> 'itemInfo' >> 'type') in [101,201,301,302]" configClasses (configFile >> "CfgWeapons")
err that returns an array of configs, so then
_attachmentClassNames = _attachments apply { configName _x };```
ok
so this would return all attachments, but then i would have to seperate into muzzle, sight, and other afterwards yes?
\
which is fine
yeah, or you could just get those numbers individually
ok?
ie SQF _scopes = "getNumber (_x >> 'itemInfo' >> 'type') == 201" configClasses (configFile >> "CfgWeapons")
#define IIT_SCOPE 201
#define IIT_RAIL 301
#define IIT_BIPOD 302```
just wat im looking for, thanks
you probably also want to check the scope = 2 depending on what you're doing
like ```SQF
_scopes = "getNumber (_x >> 'scope') == 2 && getNumber (_x >> 'itemInfo' >> 'type') == 201" configClasses (configFile >> "CfgWeapons")
im just putting all scopes class names, and putting them into an array, so that i can list them ina GUI
yeah for that, you'll probably want to include that first bit to check scope == 2
ok thanks a bunch
sorry, but i have another question. I am trying to save two loadouts to profileNamespace, one for each team. Each loadout is set out like this : sqf _csatLoadoutProfile = [_medicLoadout,_supportLoadout,_sniperLoadout,_engineerLoadout]; _natoLoadoutProfile = [_medicLoadout,_supportLoadout,_sniperLoadout,_engineerLoadout]; Then i am saving it to profileNamespace like this sqf profileNamespace setVariable [_natoLoadoutProfile, _csatLoadoutProfile]; How would i go about geting certain elements from each array, i thought it would be something like this for the _medicloadout ```sqf
_csatLoadout = profileNamespace getVariable "_csatLoadoutProfile";
_medicLoadout = _csatLoadout select 0;
You're not defining these variables correctly. You can do it through either of the following options. Just make sure if you use the first one the _medicLoadout/_supportLoadout etc are in the correct scope to be accessed.
with profileNamespace do {
_csatLoadoutProfile = [_medicLoadout,_supportLoadout,_sniperLoadout,_engineerLoadout];
_natoLoadoutProfile = [_medicLoadout,_supportLoadout,_sniperLoadout,_engineerLoadout];
};
OR
_csatLoadoutProfile = [_medicLoadout,_supportLoadout,_sniperLoadout,_engineerLoadout];
_natoLoadoutProfile = [_medicLoadout,_supportLoadout,_sniperLoadout,_engineerLoadout];
profileNamespace setVariable ["_natoLoadoutProfile", _natoLoadoutProfile];
profileNamespace setVariable ["_csatLoadoutProfile", _csatLoadoutProfile];
@limpid pewter
The first option executes the code within {} in that namespace, so those variables would be declared in profileNamespace and could be accessed through getVariable
Either should work fine
i like the second one, but will i still be able to access with the way i have shown above?
As long as you retrieve the variable through the correct name with getVariable, yes. Give it a go and let me know if you have any issues
ok thanks man, will try soon
I dont think you can store local variables in the main Namespaces
Save them as a global var
ok yeah, that would make sense, but i am going to try this way first, just to maybe save some time
thanks for the heads up tho, will try if other fails
@indigo snow would you know if there would be any issues with storing things in profile namespace when im the one hosting a game with two people in it?
Just keep in mind on whose profiles they actually get saved I guess
You cant directly get variables from someone elses profile
is it automatic, will arma automatically know that i want a specific players namespace if i use getVariable in a local script on the player's pc?
You can only directly acces your own (profile)Namespaces
ok, but if the server wants to retrieve a variable from a specific player's profileNamespace, then will it automatically know which player i want the variable to be taken from? Like if i try to getVariable from withing a locally run script?
or have i misun understood the whoole profilenamespace thing?
I just told you in two different ways you cant directly access namespaces on someone elses machine
Youll need to set up functions to request them and send them
ok, so if i run a function to request var, that runs loacally on the users PC, then send that var to the server, will that work?
to a sever = to annother function
Yes
ok thanks, and sorry fo being slow ๐
No worries, its sunday after all
haha yeah
my questions just seem to keep coming, i was just wondering what the correct syntax is for spawning/calling a function in the action property of a GUI's button. Here is what i have got,
action = "kitSel = 0; spawn mld_fnc_kitSetup;";
i do have to set kitsel to 0 there if possible
did you try onButtonClick instead of action?
spawn requires arguments too ([] spawn mld_whatever)
ok
isn't onButtionClick an eh tho?
so i would have to put that somewhere in initalisation?
can you put up an example so my slow mind will understand
onButtonClick = "kitSel = 0; spawn mld_fnc_kitSetup;";
so it is that simple>?
yeah
ok wow thanks, that helps
ok so all these can go straight into the config?
sorry, into the config for each control
ok will do
So any way of saving something on a server without using extDB3 or iniDB?
could use profileNamespace
Doesnt work on server though ๐ฆ @vapid frigate
hmm ok.. i assumed it would since servers also have profiles
haven't tested though
should be easy enough to test with debug console
Gonna test it in a couple of minutes
if it's important stuff to save, you would be better to use iniDB or extDB3 (or some other database) though
assuming the server profiles die as often as client ones do
Is there a way to make a dialog less ugly?
can make it look however you want
what
it's a bit like saying 'is there a way to make paintings not look crap?'
okay
you can change fonts, colours, backgrounds and sounds.. so if you can draw it in photoshop you can build it as a UI
oh okay
hey, i am getting this error "error zero divisor" yet i am not using any arithmatic at all in the script on a variable, what could that mean?
@limpid pewter Show the code where this is arising from please
@vapid frigate Profilenamespace on server works
sweet
ok, it from that code we were talking about before, i have two arrays that i am trying to store into profileNamespace, but i get a "zero divisor error" for natoLoadoutProfile, and i assume for csat as well, here is the code and its long, sorry ๐ซ ```sqf
csatLoadoutProfile = [_medicLoadout,_supportLoadout,_sniperLoadout,_engineerLoadout];
^thats the first array
natoLoadoutProfile = [_medicLoadout,_supportLoadout,_sniperLoadout,_engineerLoadout];
^second array
this is were the error occurs
profileNamespace setVariable ["natoLoadoutProfile",natoLoadoutProfile];
profileNamespace setVariable ["csatLoadoutProfile",csatLoadoutProfile];
@warm gorge
also here is how one of the elements are entered into array ```sqf
if (kitSel == 2) then {
if (!isNil "loadoutarray") then {
_primary = ((loadoutarray select 0) select _primSel) select 2;
_secondary = ((loadoutarray select 0) select _secSel) select 2;
_gadget = ((loadoutarray select 0) select _gadgSel) select 2;
_perk = ((loadoutarray select 0) select _perkSel) select 2;
_sniperLoadout = [_primary,_secondary,_gadget,_perk];
};
that error generally means you're trying to select something from an array that's not big enough
like [] select 0
ahh ok that would make sense
for the global array called loadoutarray, i haven't populated all the arrays yet, so thats proabaly why they don't work haha thanks
will have to fill array then will try
can https://community.bistudio.com/wiki/addItemCargo only add one item at a time?
Because i am trying to get the cargo of a crate with getItemCargo and re-add ut with addItemCargo, but it doesnt work
Yes, but getItemCargo returns an array of arrays. I can't use that to add the items @vapid frigate
Are you trying to spawn a box with items inside?
Yes
Well, i am trying to get the contents of the box from profilenamespace and adding it back
_box allowDamage false;
_box addItemCargoGlobal ["arifle_AKM_FL_F",10];
_box addItemCargoGlobal ["30Rnd_762x54_Mag",10];
_box addItemCargoGlobal ["srifle_EBR_MRCO_pointer_F",10];
_box addItemCargoGlobal ["20Rnd_762x51_Mag",10];
_box addItemCargoGlobal ["LMG_Zafir_pointer_F",10];
_box addItemCargoGlobal ["150Rnd_762x54_Box",10];
_box addItemCargoGlobal ["arifle_Katiba_ARCO_pointer_snds_F",10];
_box addItemCargoGlobal ["arifle_MX_Holo_pointer_F",10];
_box addItemCargoGlobal ["arifle_MXC_Holo_pointer_snds_F",10];
_box addItemCargoGlobal ["30Rnd_65x39_caseless_mag",10];
_box addItemCargoGlobal ["30Rnd_9x21_Mag",10];
_box addItemCargoGlobal ["10Rnd_762x54_Mag",10];
_box addItemCargoGlobal ["launch_RPG32_F",10];
_box addItemCargoGlobal ["RPG32_F",10];
_box addItemCargoGlobal ["srifle_LRR_LRPS_F",10];
_box addItemCargoGlobal ["7Rnd_408_Mag",10];
_box addItemCargoGlobal ["LMG_Mk200_MRCO_F",10];
_box addItemCargoGlobal ["SatchelCharge_Remote_Mag",4];```
I created this to attatch an ammobox to a player so you can place it
_box allowDamage false;
_box addItemCargoGlobal ["arifle_AKM_FL_F",10];
_box addItemCargoGlobal ["30Rnd_762x54_Mag",10];
_box addItemCargoGlobal ["srifle_EBR_MRCO_pointer_F",10];
_box addItemCargoGlobal ["20Rnd_762x51_Mag",10];
_box addItemCargoGlobal ["LMG_Zafir_pointer_F",10];
_box addItemCargoGlobal ["150Rnd_762x54_Box",10];
_box addItemCargoGlobal ["arifle_Katiba_ARCO_pointer_snds_F",10];
_box addItemCargoGlobal ["arifle_MX_Holo_pointer_F",10];
_box addItemCargoGlobal ["arifle_MXC_Holo_pointer_snds_F",10];
_box addItemCargoGlobal ["30Rnd_65x39_caseless_mag",10];
_box addItemCargoGlobal ["30Rnd_9x21_Mag",10];
_box addItemCargoGlobal ["10Rnd_762x54_Mag",10];
_box addItemCargoGlobal ["launch_RPG32_F",10];
_box addItemCargoGlobal ["RPG32_F",10];
_box addItemCargoGlobal ["srifle_LRR_LRPS_F",10];
_box addItemCargoGlobal ["7Rnd_408_Mag",10];
_box addItemCargoGlobal ["LMG_Mk200_MRCO_F",10];
_box addItemCargoGlobal ["SatchelCharge_Remote_Mag",4];
_box attachTo [player, [1, 1, 1]];```
Sorry thats the full script, ill create you one for ur needs.
It is supposed to be persistent storage so if a player adds an item to the box and the server restarts i want it to still be there
Ohhh
I have been at this on and off for several months and it is starting to piss me off now
need to save the data in a persistent storage, could be the profil of the server or even a datatable like in a database
How do i add the items again
Yeah i was just thinking i think you would need to create a table in the database to store the items.
just write a script to iterate over the whole stack of items. In any case you need a reference to the container
Use a call fnc
_crate addItemCargoGlobal [_x, 2];
_crate addItemCargoGlobal [_ammo, 5];```
I did a similar thing
So getItemCargo returns [[item1,item2,item3][amount1,amount2,amount3]] but addItemCargo can only add one item at a time
_cargo = getItemCargo box;
for [{_i = 0}, {_i < count (_cargo select 0)}, {_i = _i + 1}] do {
box addItemCargo [_cargo select 0 select _i, _cargo select 1 select _i];
};```
box addItemCargoGlobal [item, count] (https://community.bistudio.com/wiki/addItemCargoGlobal)
@vapid frigate What does that do?
first line gets the item cargo from a box
next 3 lines loop through them and add them back
err hang on
now it does
Okay so if i do ```
_cargo = profileNameSpace getVariable "box1";
for [{_i = 0}, {_i < count (_cargo select 0)}, {_i = _i + 1}] do {
box addItemCargo [_cargo select 0 select _i, _cargo select 1 select _i];
};```
that would work?
assuming cargo is an array like you said above
yeh, should work then
you might wanna add a default for if it's not saved though
_cargo = profileNameSpace getVariable ["box1", [[],[]]];
Im probably gonna need to add four of these for ItemCargo WeaponCargo, magazineCargo and backpackCargo too, right?
That only works for units, not boxes
well, does a box have a magazineCargo o.O
so yes, you have to to all 4
nvm
Why use for... if there's forEach
Which comes to my mind first if you want to pass all arguments from an array
it's sorta clearer with for in this case because there's 2 arrays [[item1,item2], [count1,count2]]
you could use foreach but it'd be uglier/harder to understand i think
@vapid frigate Holy Shit!!! It finally worked! I dont even know how to thank you. If you want free server hosting HMU
no worries
if (isnil "_inv") then
{
execVM "functions\basic.sqf";
}
else {
execVM "functions\load.sqf";
};``` this never goes to else, it always goes to basic.sqf
Hey, quick question. In the editor, you can give a waypoint a name, when trying to access that waypoint within a script as any other normal global variable the function is unable to find that waypoint name. Any tips on how to get that waypoint name to be used in a function?
Waypoints domt really get stored that way
Youd need to pass the unit they belong to and use iirc the waypoints command on them
hey, does anyone see any issue with this, ```sqf
_primary = ((loadoutarray select 0) select _primSel) select 2;
loadout array looks something like this,sqf
loadoutarray = [
[
[].[],[],[],[]
],
[
]
];
oh yeah, primSel is a value set but a lbCurSel (i have tested it is returning correct values)
There's a dot (.) where a comma (,) should be.
yeah, that isn't the case in the reall code
that was just mee showing the format of the array
Did you try isNull @sharp jay
@simple solstice Nope, will try it out tomorrow though
@limpid pewter I think you're going 1 level too deep
or your example array is the shittiest example ever ๐
@marceldev89#4565 ok i will format better with descriptibve text ๐
array should be structured like this: ```sqf
loudoutarray [
[ Within each array there are many small arrays with 2 elements, like this ["",""] ], //array of all primary weapons
[ ], //array of all secondary weapons
[ ], //array of all gadgets
[ ] //arrary of all perks
];
and lets say i want to get the 2nd primary weapon in array, i thought i would use this ```sqf
_primary = ((loadoutarray select 0) select 2) select 2;
nvm just fixed it XD
i put blahblahlblah select 2; instead of blah blah blah select 1;
need a bit of help
working on an addon rejection script for the public server but its not working
if (isServer) exitWith {};
player sidechat "INITIALIZING";
addonclear = false;
naughty = false;
da_arsenal = isClass(configFile >> "CfgPatches" >> "A3_Anims_F_Config_Sdr" >> "PA_arsenal");
sleep 0.5;
while {!addonclear} do
{
if (da_arsenal) then {
hintc "***ADDON DISALLOWED***\n\nPersonal Arsenal\n\nPlease disable this if you wish to play here.\n\nREASON: Equipment Exploiting";
player sidechat "***ADDON DISALLOWED*** Personal Arsenal Please disable this if you wish to play here. REASON: Equipment Exploiting";
naughty = true;
};
sleep 0.25;
if (naughty) then
{
player sidechat "YOU WILL NOW BE DISCONNECTED";
player action ["eject", vehicle player];
removeallweapons player;
removeallitems player;
player setPos (getmarkerpos "jail");
sleep 5;
endmission "end3";
};
if (!naughty) exitWith
{
addonclear = true;
player sidechat "INITIALIZATION COMPLETE";
//nul= [player] execVM "scripts\tkcheck.sqf";
hint "Remember to check the ''Mission Information, and Server Rules'' section in your briefing notes for information on unique features and Server Rules.";
player sidechat "Remember to check the ''Mission Information, and Server Rules'' section in your briefing notes for information on unique features and Server Rules.";
};
sleep 0.5;
};
this script worked for me back in arma 2 but im not sure why its not working in arma 3. i can only think that something has changed ware you cant look at what addons players have loaded anymore
it only sets da_arsenal at the start, not during the loop (so there's no point havng the while loop)
i don't think you can add config entries after it starts anyway
you can check that isClass thing in A3 fine.. when you say it doesn't work, what happens?
its still letting me stay in the server and it seems to clear
if the addon is loaded it should set naughty to tru and kick the player from the server
so you're not getting any of the hints?
i get the hints for the addon check clearing
class CfgPatches
{
class A3_Anims_F_Config_Sdr
{
units[] = {};
weapons[] = {};
requiredVersion = 0.1;
requiredAddons[] = {"A3_Anims_F"};
};
class PA_arsenal
{
units[] = {};
weapons[] = {};
requiredAddons[] = {};
author[] = {"Drakeziel"};
};
};
ah there you go.. PA_arsenal isn't inside A3_Anims_...
so just da_arsenal = isClass(configFile >> "CfgPatches" >> "PA_arsenal");
ill try that
or da_arsenal = isClass(configFile >> "CfgPatches" >> "A3_Anims_F_Config_Sdr");
guessing you don't wanna ban that one though
you would have to list every possible cfgpatches though?
just for the mods i dont want people loading
now if they repack the mod and change the cfgpatch name that im checking for they would be able to bypass it
but i figure if someone is going to go that far then they will just hack the server if they really wanted to
yeh or make their own mod that just has player allowdamage false in init
yep
but yeah depends what it's for
we don't use any anti hack for our closed community
well this is to stop people from using this mod on unit missions lol
and none of them really know how to mod
hey, if i had an array that lists a whole bunch of weapon class names, and i wanted to find all the ones that start with launch, how would i do that? ```sqf
i was thinking i would do something like this,
alllaunchers = array find "launch*";
you want to find all launchers, or all items with names that start with launch?
alllaunchers = array select { getNumber (configFile >> "CfgWeapons" >> _x >> "Type") == 4 };
or
alllaunchers = array select { (_x select [0, 5]) == "launch" };
respectively
thanks @vapid frigate that was my issue ๐
np
may have to use this on the public server to help cut out some of the addons that spam RPT
yeh i dunno.. if i was running a pub server i'd probably want to use keys to stop people using random crap
iv never been able to get keys to work correctly when downloading mods from workshop
Carrier based Alive mission on Tanoa
i've never really tried
@vapid frigate yeah that looks good, i will try what you have written thanks
Why do some people call a waitUntil {!isNil "_vehicle"} after spawning a vehicle with createVehicle. Is that even needed lol?
i think it is with one of the syntaxs
the one that has an init script
err nvm that's units
lol yeah was just wondering because I dont see any point in it, as soon as its made a variable it shouldnt be nil
is there a way to force AI units to fire at a given direction?
doSuppresiveFire
okay
will they fire even if friendlys are in the way ?
or the position is behind a building?
i think they need LoS when i tested it earlier
hey, is there an issue with trying to put a sleep command into the code part of a "Fired" EH?
@cedar kindle mmh, is there a way to force an AI to look at an position / aiming there?
afterall I could just force them to shoot then
No, suspending is not allowed then. Youll need to spawn whatever code you need.
@dry egret why don't you just use battleye filters?
@simple solstice battleye doesnt like ACE mod and stops parts of it from loading
not when they update its not
it you have a public server it's not a good idea to disable battleye
also you could just use an older version that's whitelisted.
or you know, just use signatures check and it won't allow people to join with mods other than yours
well the signature check tends to time out
not running signature check on a public server is asking for "cheaters"
yep, and keys dont work worth a damn when workshop doesnt put the key in the correct folder or people who are using armasync dont want to take the time to put keys in the correct folder
players don't have to put keys
only server needs them
all they need is bisign to every pbo
hey, is there an issue with trying to put a sleep command into the code part of a "Fired" EH?
something like this ```sqf
this addEventHandler ["Fired", {
sleep (3);
Do something;
} ];
No, suspending is not allowed then. Youll need to spawn whatever code you need.
EH code "needs" to finish in the same frame
@indigo snow so does that mean, my only option is to write another script, and spawn that script from EH?
Yes or just put it in there together with your spawn
Definitively less messy to make it a separate function in my opinion both both works
so i could put somthing like this ```sqf
this addEventHandler ["Fired", {[] spawn {
sleep (3);
Do something;
};}];
@indigo snow
Might complain because of the spawn return value but overall yea
okie dokie thanks
Anyone know how exactly I can spawn these in the editor?
https://puu.sh/whRKZ/2cefb1f2ee.png
I saw them in the jets trailer but so far I can't find anything on them
So, i've just done some testing for a project im doing and just want to confirm something. What is the max size on an array? I've just done 2 tests and both tests crash when reaching 5 million elements in the array.
Is this correct? as the wiki states 9,999,999 elements in the array
is there a way to change the time a target is surpressed?
@coarse ocean the problem with that size is, it is just the hard limit
there are other limits too
eg. memory consumtion
wich probably is the reason why your arma crashes
@queen cargo I understand that but the RAM or VRAM usage wasnt hitting the limit. The only thing im asking is is the limit 5 Million or one less than 10 Million?
what was the crash reason?
limit should be 10mio
Just loop filling an array
RPT will tell you when it's finished
Or just systemChat the count etc
The game kept crashing at 5 Mil for me
game should never crash
Can some one help me? i was 23+ lvl. and now 1 agayne/
how can i fix this
Hey guys, if I want to create a child display from a parent display, yet I still want it overlapping the other display, so I then see both displays. Is this possible through createDisplay somehow? Is putting everything in a controlsGroup the only option maybe?
display & dialog are pretty much the same
you have to "merge" those displays to have them both displayed at the same time (HUD displays is a different thing)
Anyone has experience with ACE Scripting?
It's SQF. Like any other SQF.
Obviously.
But I have this piece and nothing happens:
_pickup_ams = ["pickup_ams", "AMS (Sandfarben) nehmen", "\a3\weapons_f_mark\Data\UI\gear_acco_ams_snd_CA.paa", {}, {true}] call ace_interact_menu_fnc_createAction;
[scope_ams, 0, ["ACE_MainActions"], _pickup_ams] call ace_interact_menu_fnc_addActionToObject;```