#arma3_scripting
1 messages · Page 6 of 1
well what you wrote should work most of the time
@little raptor when wouldn't it?
when the mod maker didn't bother to inherit from StaticWeapon
Do you really think someone would do that? Just go on the internet and upload a mod that doesn't follow best practices?
Anyone here with any inkling how to get rid of the in-built GPS on some vehicles that cause your position to be shown on the main map (see example: https://s12.directupload.net/images/200424/kfn367uz.png). I am not talking about the 'minimap display', that is a separate issue that I have solved.
I've tried setting the enableGPS value to false for a vehicle via config edit, but this did not remove the gps effect on the main map. Considering that not all vehicles have this in-built gps it would make sense if there is a config value that controls this. If somebody knows what I should be looking for that would be appreciated.
Alternatively if I could find the relevant control(s) in the main map display I could look into removing it /making the black lines invisible. Once again if somebody has info about which controls to look for please share.
what am I looking at?
In-built vehicle GPS draws black lines on the main map that shows the vehicle's position. I'm trying to get rid of them. I'd post a better image but no attachments allowed here so i just googled an image that illustrates the effect.
Most of vanilla air assets do that.
B_Heli_Attack_01_dynamicLoadout_F
No mods, unmodified veteran difficulty settings.
As mentioned above I believe all vanilla air assets have this. But for example the quad bike does not.
install VLC and double-click on the ogg file 🙂
ah
use the jukebox: open the debug console and type utils 4, then press Enter
(for music only)
regarding wss, where are you "seeing this"?
try playSound3D ["pathToFile", player]; then
why is the extension of the description.ext ext?
because otherwise, it would be e.g description.txt
or description.desc
why not description.cpp?
maybe to not mix it up with configs?
this is the only instance where ext is used in arma
(no idea)
Because we like consistency
🤣
😁
same with sqm no? (although sqM for Mission, I get that ^^)
Dedmen plz rename to description.sqext
well technically the mission.sqm is a config, so maybe mission.ext? then the description won't be so lonely anymore
I vote exd
mission.armedassault
.armA
.АмяА
Quick question do global script commands work like a global remoteExec?
I'm currently writing a script that will switch off a large amount of light on the map. The Server determines which lights to switch off.
Now I could use a setHit call on the Server which itself is global, or I could use switchLight, but this would be local, so I would have to use remoteExec to execute it on the clients.
Will there be a measurable difference between the two approaches?
you should use ONE function that does the on/off thing
use switchLight locally, so each client deals with their own lights
wait, they won't be turned on later, right?
Thanks. Nope they stay off.
On a similar note: Does switching lights on or off add an event/flag to the object, or does the state already exist on the object and the command simply modifies it?
Or asked simply: Could switching off lights cause some performance issues after the initial switch? Especially for larger multiplayer sessions?
no, don't sweat it.
Ok thanks a lot ^^
Oh! One question just came to mind: Is one big remoteExec call (with like 200 objects) better than smaller calls with only one object? I just want to make sure that I don't crash our server 30 minutes into the mission ^^
waaait a minute. what do you call "one big remoteExec call"
if you mean "I send a huge code line", that's not good practice
My current approach is that the server gets the lights and then just calls the switchLight via remoteExec. But I'm not sure how much traffic it would generate to parse each lamp object to the client.
Would it be better, just to get the lights on each client?
code example please.
the best thing would be:
- the server decides an array of lamps
- the server remoteExec a function to turn off these lights - with the JIP flag set to true
one network transmission per client, not one per lamp per client
If they're a pre-determined set of lights you can construct an array locally and define a function in config that will iterate through that array, so all that is sent through the network during the mission is the command to run the function
yes
So something like this?
// Pseudocode, Executed on server
_lamps = [] call hexom_lights_fnc_getLightOnServer;
[_lamps] remoteExec ["hexom_lights_fnc_turnOffLights", [0, -2] select isDedicated, true];
Is it possible to save terrain object in code? I tried that approach already, but I could not figure out how to get the real objects from the exported terrain objects.
no
like I said just run everything locally
0 network transfer
actually open question about this: if they are terrain objects will the pointers stored on init always return the same terrain objects? I.e. will house1 = <terrainObject> always return the house object with house1 if the player leaves the area and comes back? I'm not quite up to speed on how terrain is optimized
yes
thanks
To my understanding the ids for terrainObjects are static. So house that is at [x,x,x] will alway be that same house at [x,x,x]. But it could be that this changes when the map is edited.
if the lights are a deterministic random, do that locally
if (only) the server must process that, use one remoteExec towards everyone
when the terrain is streamed, too
the id won't change, but objects' references may turn null
afaik that's not how they're "streamed"
so references never become null
hopefully
but I think I know that stuff like allowDamage may be lost
Whats the best way to get an AI to launch off the carrier smoothly? They both can launch and get in the air, but they come off the actual catapult.
As in veer off before leaving the bow of the ship
well… the carrier… catapults planes out? so I am not sure I get your mind?
how do I access sounds from misisons like oldman?
e.g.
playSound3D ["a3\missions_f_oldman\data\sound\energy_hum\energy_hum_loop.wss", _v, false, [0,1,0], 5, 1, 25, 0, false];
doesnt make a sound
where _v is the player
https://community.bistudio.com/wiki/Arma_3:_Sound_Files getting from here
As in halfway through the launch, the plane veers to the right of the line before leaving the bow and leaving the surface of the bow.
lmk if i can be more descriptive
Maybe im misinterpreting how catapults work, i thought they brought you up to speed and threw you off the side in a straight line.
have you tried```sqf
playSound3D ["a3\missions_f_oldman\data\sound\energy_hum\energy_hum_loop.wss", _v];
ok I get the sentences now ^^
oh for crying out loud, ima muppet
nope you're right, it's just the script that "releases" them earlier than IRL
I would say the way to get them to fly straight would be to have a waypoint straight ahead so the AI still flies straight
…it hurts when sitting?
it hurts when I make simple scripting mistakes
😁
hey, we've all been there and will be there again at one point or another - just don't script tired/drunk! 😄
This helped some! is forceSpeed & BIS_fnc_AircraftCatapultLaunch the correct commands to fling an AI off?
forceSpeed, nay?
Correct, "_jet2 forceSpeed 1100;" is my line
1100 m/s, nice
lmao, thats what some post said on BI Forums so i went with it
I think they may have added a zero.
Yeah that assisted also a great deal, I notice both of the jets wheels are pulled to the left. Could i lock them straight?
enableSimulation but that will lock them entirely
don't stress it, unless it's for a video
oh huh putting that there made it obvious. nvm
Sanity check: Is there any way that _var in [] can be true in SQF?
Urm... context?
Never mind, was a misreport.
People thought a headless client had disconnected when in fact someone else's headless client had attempted to connect to our server and failed :P
Is there any practical difference between these two lines?
TAG_myVariable = true;
localNamespace setVariable ["TAG_myVariable", true];
When would I use localNamespace as opposed to a regular global variable? Is it only to ensure it can't ever be broadcasted?
I believe it is for the purpose of safely storing a value without any fear of modifications by other clients/server. They do have a difference if your currentNamespace is not localNamespace (it will most likely go to missionNamespace by default)
That makes sense, as another client can modify a global variable with publicVariable. Probably good practice to use localNamespace then. Thanks.
There's also compileFinal for tamper prevention
I am trying to make ai (createAgent) run in a straight line towards target position. when I use moveTo the ai only runs in the general direction and moves left and right as well. any other options/ideas?
TAG_myVariable = true; is within whatever namespace you're currently working in ... default being missionNamespace
with uinamespace do { TAG_myVariable = true; };
hint str (missionnamespace getvariable ['TAG_myVariable',false]); // false
localNamespace is nice but not necessary for most users
better to just work in missionNamespace for ease of variable propagation
if a cheater is already returning variables from server mission namespace, then local namespace wont help
missionnamespace getvariable ['mylocalvar',localnamespace getvariable 'mylocalvar',true]; // now the localnamespace var is broadcasted over network
at this stage in arma 3 lifecycle (and most other stages too), you shouldnt worry at all about cheaters until you need to. focus needs to be on creating something fun, and only if your creation gets very popular, then spend time on security
switchMove, I am trying to find a BIS_fnc that does that for you
it will be fixed in the next patch though.
How can I get a mod or expansion icon of a faction? I assume its somewhere in the config file, but I don't know where
those are usually in CfgWorlds i think
fixed, the attribute got applied to objects that i didnt edit specifically so the expression got called. added a check for that now.
wow, thanks Lou, I couldn't find this on biki (query "move" would not yield this result)
i am actually working with a2 dayz mod. just tried using the function and the zeds (createAgent) will now run in seemingly random direction. here is the new relevant bit ( from zombie_agent.fsm , which I am editing):
...
_targetPos = getPosATL _target;
[_agent, [_targetPos]] call BIS_fnc_scriptedMove;
...
_agent is zombie, _target is player (who triggered zombie aggro). the above snippet is also executed over and over every few hundred milliseconds (for re-targetting purposes, due to player movement).
Here is the original code which just uses moveTo (that leads to the zombie's zig-zagging since the ai does not move in straight line):
...
_targetPos = getPosATL _target;
_agent moveTo _targetPos;
...
maybe my issue comes from using getPosATL instead of some other means of supplying an acceptable position format for BIS_fnc_scriptedMove?
We have a script that will be called fairly often that checks a hashmap with about 1,700 keys. Currently, that hashmap is created within that script which I assume means that the map is being re-created every time the script is called. Can/should that map be created publicly during server initialization? The map is static and doesn't need to be updated.
..yes
createHashMapFromArray is pretty fast but not free. createHashMap + 1700*set is gonna be slow.
well, it measures to roughly 2ms on my machine with 1700 number/number pairs
They are string pairs that average about 15 characters each.
swings more on the meaning of "fairly often" really
2ms is pretty close to a whole server frame of script time.
as often as every couple of minutes.
Unless there's some other penalty for doing so, it makes sense to just make it public and forget about it.
getting this error in client rpt:
Error in expression <_targetPos;
[_agent, [_targetPos]] call BIS_fnc_scriptedMove;
_agent setSpeedMo>
Error position: <BIS_fnc_scriptedMove;
_agent setSpeedMo>
Error Undefined variable in expression: bis_fnc_scriptedmove
Error in expression <_targetPos;
[_agent, [_targetPos]] call BIS_fnc_scriptedMove;
_agent setSpeedMo>
Error position: <BIS_fnc_scriptedMove;
offending code portion:
...
[_agent, [_targetPos]] call BIS_fnc_scriptedMove;
...
what am I doing wrong? this is supposedly the source for BIS_fnc_scriptedMove and I think I got the args correctly https://sqfbin.com/siyuxumavocacaferovu
why do you post the function's code and not yours 😬
so you can see what the function does with the supplied arguments and see that I should be doing it correctly
i posted my code above, see:
...
[_agent, [_targetPos]] call BIS_fnc_scriptedMove;
...
happy to provide more context/code around it, just didn't want to pollute it here from the start
The error is saying that BIS_fnc_scriptedMove doesn't exist. Which is odd because it does here.
thank you, now that I read the error log it makes sense since the error position is on the function name which probably means the function itself does not exist. this is arma 2 btw. how do you check if function exists in sqf?
the source here:
https://sqfbin.com/siyuxumavocacaferovu
references BIS_scriptedMoveEnabled variable.
I am new to this arma thing, how can I drill down to the source of arma where I can find the BIS_fnc_scriptedMove function? is it some pbo somewhere or?
you need to place the Functions module in A2/A2OA
did you?
I don't know anything about Arma 2 personally. In A3 you can just type the function name into the debug console and it'll either output a code block or nil depending on whether it's defined.
no, I don't even know what that is
see https://community.bistudio.com/wiki/Arma_2:_Functions_Library for a userguide
note the Startup and Usage section 🙂
thanks @winter rose I will take a look at it. can I fork some of those functions to my mission files so they are always available like that?
and last question, what is ca\?
well, nothing really prevents you from doing so
ca\ is Arma 1 / 2 / OA data prefix
in Arma 3 it has been updated to A3\
thanks, and the actual directory where I could find those function files? (it says it's in ca\ but I don't know where that actually is in the files)
why not use the game's functions?
because moveTo does not result in straight line movement
there is no moveTo in BIS_fnc_scriptedMove
what do you mean?
can I fork some of those functions
why?
gist is i am trying to have ai run in straight line towards some position
ai being agent (createAgent)
if I use moveTo then ai wobbles left and right on their way towards target
i need something like a reverse flee. imagine a bomb going off, you want to run directly away and not casually wobble
oh, I have an idea; what about BIS_fnc_scriptedMove?
that produces that error I posted
not if you use the setup I posted
and I am trusting you on that, just want to make sure there is a way without having to adjust startup params (its multiplayer dayz mod)
eventually i mean
ah, sorry, I have confused startup with exe startup params, my bad!
what is the "function manager"?
Place Function manager on map. No additional synchronizing needed.
a module in the Editor (F7 iirc)
i am not working in the editor, i am running server and client as normal play
and you place code randomly?
i unpack pbo, edit code, repack pbo, restart server and client
the current code from above that I am editing is in zombie_agent.fsm which is responsible for the zombie ai logic like looking for targets, chasing down, etc
well, unpack pbo, open the editor, place module, save as pbo
this is the file for your reference https://github.com/DayZMod/DayZ/blob/Development/SQF/dayz_code/system/zombie_agent.fsm#L511
edit: updated with relevant line
not relevant
by editor you mean ingame editor?
never worked with that before so not sure how to open the relevant data there
plenty of help available in this Discord server
made a new mission from scratch in the ingame editor and inserted the function module there, then unpacked relevant pbo and found this in the mission.sqm
version=11;
class Mission
{
addOns[]=
{
"ca_modules_functions",
"chernarus"
};
addOnsAuto[]=
{
"ca_modules_functions",
"chernarus"
};
...
will take a look if i can just write that myself where i need it
OK
anyway that's not scripting anymore at this point.
well, seems like it is already there, see:
version=11;
class Mission
{
addOns[]=
{
"chernarus",
"map_eu",
"ca_modules_animals",
"dayz_anim",
"dayz_code",
"dayz_communityassets",
"dayz_weapons",
"dayz_equip",
"cacharacters_pmc",
"ca_modules_functions",
"zero_buildings",
"dayz_epoch",
"glt_m300t",
"pook_h13",
"csj_gyroac",
"jetskiyanahuiaddon",
"redryder",
"Anzio_20"
};
addOnsAuto[]=
{
"dayz_weapons",
"ca_modules_functions",
"chernarus"
};
you think its a bug then?
or perhaps the function module is not yet initialized when I call for a function from it? I tried the waitUntil but there was error saying it cannot be used in this context
@winter rose is there a different channel where I could ask more about this?
nobody directly edits sqm to add a module.
use the editor, and if you have questions, ask them in #arma3_editor notifying that it is in Arma 2
yea i am old school like that i guess ... code > gui
thanks for your help so far, I will try my luck in that other channel
note, that #arma3_editor channel is about editor usage, not sqm manual editing 😉
am confuse.
playSound3D ["a3\missions_f_oldman\data\sound\energy_hum\energy_hum_loop.wss", _v];
works (_v is a crate)
but
playSound3D ["a3\missions_f_oldman\data\sound\energy_hum\energy_hum_loop.wss", _v,false,getPos _v, 5,1, 25,0,false];
Doesnt seem to work, all I want to do is lower the distance it can be heard
Sound position must be ASL
ah ty
what is the point of that parameter if it just overrides the soundSource
aint Source and Position basically the same
object vs coordinates
but it could have been the same argument, I believe, yes.
btw, in BIS_fnc_scriptedMove, do you need to supply at least 2 waypoints (from=>to) or is 1 enough for the object to move from it's current position to the 1 that I supply?
inb4 server isn't OA and doesn't have scriptedMove
it exists in A2
waaaaaait, no??
tab title fixed 😬
@tough abyssArma 2 + OA?
OA of course
[_agent, _targetPos] spawn {
_agent = _this select 0;
_thisTarget = _this select 1;
waitUntil { !isNil "BIS_fnc_init" };
[_agent, [_targetPos]] call BIS_fnc_scriptedMove;
};
Error in expression <il { !isNil "BIS_fnc_init" };
[_agent, [_targetPos]] call BIS_fnc_scriptedMove;
>
Error position: <_targetPos]] call BIS_fnc_scriptedMove;
>
Error Undefined variable in expression: _targetpos
Error in expression <il { !isNil "BIS_fnc_init" };
[_agent, [_targetPos]] call BIS_fnc_scriptedMove;
>
Error position: <_targetPos]] call BIS_fnc_scriptedMove;
>
like I said, I am new to this so please point any obvious mistakes haha
ah yep
[_agent, _targetPos] spawn {
_agent = _this select 0;
_thisTarget = _this select 1;
waitUntil { !isNil "BIS_fnc_init" };
[_agent, [_thisTarget]] call BIS_fnc_scriptedMove;
};
why? is it pass by reference and I changed the var outside?
I have no idea what you mean by that, but _targetPos does not exist in the newly created scope, because it is an entirely new script, unlike call
oh sorry I see the mistake now, I put wrong var name there
thanks
fun fact, I always need to wait 2 minutes before I can verify the code is working
unless you use the editor which has a Preview option 😁
i will look into that, not sure how much of what I am using will work there
like, everything? the editor is just launching the game, without MP behaviour that is
I am editing fsm file in this case, does the editor have interface for fsm editing?
(to clarify i am using the fsm editor gui program to edit fsm files)
no, but given you extract the mission directory you can edit the fsm in it directly
no negative side to it
there is a lot of comment code for fsm syntax so its hard to read/write using regular code editor
Error in expression <nc_init" };
[_agent, [_targetPos]] call BIS_fnc_scriptedMove;
};
if ((_agr>
Error position: <BIS_fnc_scriptedMove;
};
if ((_agr>
Error Undefined variable in expression: bis_fnc_scriptedmove
Error in expression <nc_init" };
[_agent, [_targetPos]] call BIS_fnc_scriptedMove;
};
if ((_agr>
Error position: <BIS_fnc_scriptedMove;
};
[_agent, _targetPos] spawn {
_agent = _this select 0;
_targetPos = _this select 1;
waitUntil { !isNil "BIS_fnc_init" };
[_agent, [_targetPos]] call BIS_fnc_scriptedMove;
};
I personally give up
following up with some more debugging below:
systemChat str (!isNil "BIS_fnc_init");
systemChat str (!isNil "BIS_fnc_dirTo");
results in true true
but
systemChat str (!isNil "BIS_fnc_init");
systemChat str (!isNil "BIS_fnc_scriptedMove");
results in true false
strange...
I found the dirTo source code in :
Common\modules.pbo
more specifically at (after unpacking the pbo into Common\modules):
Common\modules\Functions\geometry\fn_dirTo.sqf
but there is no source file for scriptedMove to be found.
are we really sure the scriptedMove function is available in arma 2? is it supposed to be defined in some of the other pbo files or is it part of the compiled core?
it is not available in Arma 2, it is available in Arma 2 OA
I asked you earlier, you said it is OA
You need pass params in spawn?
[_agent,_targetPos] spawn {
params ["_agent","_targetPos"];
// Your code
};
arguments: Anything - arguments passed to the script, which later available in _this variable inside the script.
see example 3 on that biki page, its probably what you ask
my code used different approach, I think both approaches should work
are you having an issue yourself (with spawn) or are you trying to help me?
Just wondering why your code givin error
is it a cracked game?
no, it was kindly loaned to me by steam
(worth checking always)
try a Steam repair… and make sure OA is launched?
what does productVersion return?
tried both
in biki it says these functions can be either in modules/modules_e/modules_pmc
don't bother about these functions' location, it simply should be there (DLC or not)
and I am having trouble for example unpacking the pbos from PMC, PBO manager (1.4 beta) throws error. i tried reinstalling PMC but same issue
may or may not be related
productVersion result please
I would need to start the game, but I tried productVersion and it was 164 something something, let me know if you really need exact version and i will get it
my guess is that the server runs A2, you run A2OA
if you want to be sure, write somewhere (in any script)
getElevationOffset;
if it throws an error, there you go.
I have a batch script that kicks it all in, take a look maybe you can spot something. relevant bits:
server:
start "arma2" /min /high arma2oaserver.exe -port=2302 "-config=C:\a2\servers\epoch-chernarus\DZE_Server_Config\11_chernarus.cfg" "-cfg=C:\a2\servers\epoch-chernarus\DZE_Server_Config\basic.cfg" "-profiles=C:\a2\servers\epoch-chernarus\DZE_Server_Config" "-BEpath=C:\a2\servers\epoch-chernarus\DZE_Server_Config\BattlEye" -name=server "-mod=@DayZ_Epoch;@DayZ_Epoch_Server;
client:
set arma2oapath=C:\Program Files (x86)\Steam\steamapps\common\Arma 2 Operation Arrowhead
set arma2path=C:\Program Files (x86)\Steam\steamapps\common\Arma 2
start "" "%arma2oapath%\ArmA2OA_BE.exe" 0 0 -skipintro -noSplash -noFilePatching -world=empty -connect=%IP% -port=%PORT% "-mod=%arma2path%;Expansion;%modspath%\%mods%"
are you sure that set path without quotes around a spaces-ridden path is a good idea?
(not sure regarding batch syntax here)
yea I hate batch so no idea, but it seems to start just fine
I will try your getElevationOffset suggestion above and rewriting this batch to make sure spaces are handled
somewhere on a server script, try
diag_log "trying to output A2OA command";
diag_log "start";
diag_log call { "getElevationOffset" };
diag_log "end";
if it's confirmed (I am tempted to say "even if it's not"), it's a server setup issue - scripting has nothing to do with a missing function
tried both
on the server I hope?
hmm, let me check it all again
btw:
server rpt Version 1.64.144629
client rpt Version 1.64.144629
client rpt:
"trying to output A2OA command"
"start"
"getElevationOffset"
"end"
is that good?
somewhere on a server script, try
I need server's rpt, we try to identify what the server runs
and no, I made a mistake with this code
diag_log "trying to output A2OA command";
diag_log "start";
diag_log call compile "getElevationOffset";
diag_log "end";
use this
server:
"trying to output A2OA command"
"start"
0
"end"
client:
"trying to output A2OA command"
"start"
0
"end"
(leave the client alone!)
well, it seems to run A2OA fine then.
why the function is not there though, no idea. check your files if some is not missing.
well, if productVersion works, that's Arma 2 OA 1.62
if (isNil "BIS_fnc_infoText") then { BIS_fnc_infoText = "BIS_fnc_infoText"; };
if (isNil "BIS_fnc_sandstorm") then { BIS_fnc_sandstorm = "BIS_fnc_sandstorm"; };
if (isNil "BIS_fnc_scriptedMove") then { BIS_fnc_scriptedMove = "BIS_fnc_scriptedMove"; };
diag_log "trying to output A2OA command";
diag_log productVersion; // ok
diag_log "loading functions...";
waitUntil { !isNil "BIS_fnc_init" };
diag_log BIS_fnc_infoText;
diag_log BIS_fnc_sandstorm;
diag_log BIS_fnc_scriptedMove;
diag_log "[the end]";
```try that on the server
and otherwise, use something else 😄
"trying to output A2OA command"
["ArmA 2 OA","ArmA2OA",164,144629]
"loading functions..."
{
if (!false) then {debuglog ('Log: [Functions] BIS_fnc_infoText loaded (ca\modules_e\functions\GUI\fn_infoText.sqf)')};
BIS_fnc_infoText = compile preprocessFileLineNumbers 'ca\modules_e\functions\GUI\fn_infoText.sqf';
_this call BIS_fnc_infoText;
}
{
if (!false) then {debuglog ('Log: [Functions] BIS_fnc_sandstorm loaded (ca\modules_pmc\functions\Environment\fn_sandstorm.sqf)')};
BIS_fnc_sandstorm = compile preprocessFileLineNumbers 'ca\modules_pmc\functions\Environment\fn_sandstorm.sqf';
_this call BIS_fnc_sandstorm;
}
"BIS_fnc_scriptedMove"
"[the end]"
(from server)
ok, so -only- scriptedMove is an ass 😄
wonderful
this function doesn't exist
do you see it in the Functions Viewer (on the client obviously)?
I posted earlier that BIS_fnc_dirTo works fine for example
but that seems available from arma 2 v1.00 so probably not relevant
I will check out the functions viewer now
all these functions I listed are A2OA (>= v1.50), on purpose
yea, thats what I meant. having a hard time finding how to run commands in the editor, I am supposed to run:
call BIS_fnc_help;
ye
open the editor (😋), any terrain, place a unit, press "play", then pause - there should be a debug console
there is no play button, editor looks like this https://i.ytimg.com/vi/spn8NecYgvQ/maxresdefault.jpg
well, "Preview" then
but there is no debug console
spoiled with Arma 3
yea no debug like that there
ugh, I forgot
yes, its from https://community.bistudio.com/wiki/BIS_fnc_help but not sure how to open it
since there is no debug window
it's nil as well here - A2OA 1.64
I'm gonna be super pissed if it was removed at one point, or worse, if it was never in there in the first place
i think that could be checked by unpacking the modules pbos (3 of them), but I can only unpack 1 of them (modules.pbo) without error
ARMA 2 Operation Arrowhead\Common\modules.pbo
ARMA 2 Operation Arrowhead\Expansion\Addons\modules_e.pbo
ARMA 2 Operation Arrowhead\PMC\Addons\modules_pmc.pbo
as stated in:
https://community.bistudio.com/wiki/Arma_2:_Functions_Library
with:
ca\modules\functions
ca\modules_e\functions
ca\modules_pmc\functions
btw, little offtopic, can i have actual harddrive assigned as P: or is that gonna conflict with arma somehow?
no problem as long as you don't try and use tools
also, with a little bit of luck that function is PMC only
dont want to lose my files on a harddisk obviously
PMC seems to be listed in the Expansions when I quit the client back to the main menu. Or is there a PMC server I would need?
(confused)
no idea (#server_admins)
just to clarify, I should be able to run BIS_fnc_scriptedMove on the client as well (in single player), right?
yep, for any normal function that is
well, not in PMC either. installing BAF
yep, forget about this function then. maybe TKOH but I am not holding my breath
afaik I have all addons. TKOH is a3 i think
ah, i thought you mean the king of the hill
that would be KOTH
sry, untrained eye, never played it
can't we maybe ask some dev from BI to search their source code folder?
biki page goes back all the way to 2006 btw https://community.bistudio.com/wiki?title=BIS_fnc_scriptedMove&oldid=80624
I am a dev from BI and no, I won't 😄
and this page is from 2014, 2006 is a fake import date
thought so because BIS_fnc_exportFunctionsToWiki is arma 3
the page was created in Arma 3 era (post-2013) indeed
I will check deeper
thanks for your help Lou, should you find something, please, if possible, send me a direct message as I may not follow these channels on regular basis
Str made it "Arma 2 OA 1.00, which I filled later as 1.51 (then 1.50) but this was never confirmed
it must have been added in TKOH or something
take the function's content
make a scriptedMove.sqf in the mission's root
use [_unit, [_wp1, _wp2]] execVM "scriptedMove.sqf"
end of story
fyi i also found this https://feedback.bistudio.com/T164620
yeah that is addressed in the future 2.10 patch already
now is just my crazy me trying to figure out why and when this function appeared
I can't find the function content in my files, is it this > https://sqfbin.com/siyuxumavocacaferovu ?
so I can finally fix the biki, swear at the situation, and cry myself to sleep
seems so; where did you get it?
https://feedback.bistudio.com/T164620 guy linked it there
this line there:
_nic = [objNull, _guy, rPLAYMOVE, _walkAnim] call RE;
isn't RE another dependency or something?
yep, but it's OK - as long as Functions are loaded, it's all good
OK, this function is not even in Take On Helicopters, I quit
and I am going to message a colleague about it tomorr— today
btw, do i need 2 waypoints there or just 1 is okay?
Error in expression <i <= _animLoops && !(isPlayer _guy)) && BIS_scriptedMoveEnabled} do {
_nic = [ob>
Error position: <BIS_scriptedMoveEnabled} do {
_nic = [ob>
Error Undefined variable in expression: bis_scriptedmoveenabled
using the fork method
I will try removing that from the IF conditions
just one wp is OK
that or just set BIS_scriptedMoveEnabled = true; at the top, should fix
this function is really a mess, from start to finish xD
it runs without that error now, the animations appear rather choppy but the zombies do look and move in my direction immediately, so a huge progress 🙂
unfortunately it also disables their other features, they stopped attacking, etc so maybe just a matter of debugging the full file and fixing it and maybe it will be usable
well, that's forced straight line to you!
the function gets recalled every second or so, might be an issue too
looks like they are walking at 10FPS or so
could be something with the timing or sleep timers
I would probably get the same result if the built-in function worked, right?
and shooting the zeds tanks the actual ingame FPS down to 10 as well, that function needs some serious look 😄
normally I got 150FPS
maybe the function was cut at some point for some issues
thanks again for all your help Lou, I will find some time later to fully study that function and see if I can make it work better for my purposes
and arma crashed, out of memory error 😄
have a nice day Lou
yeah, my guess is that your FSM or whatever is going MANY TIMES PER FRAME on this condition, and you spawn a new thread every - single - time, so this is not viable
yea, good point
btw I was surprised there aren't more parameters for moveTo that would handle straight lines
that's not the command's job, it's pathfinding
try perhaps https://community.bistudio.com/wiki/setDestination ?
thought that's for air, will try it then (not today), thanks
I'm moving the driver of a vehicle (which is in my group) to a separate group, but they always dismount. Is there a way to prevent this?
This doesn't seem to happen when they are ordered to get in the vehicle while in a different group than mine
Could that be related to unit ownership? I'm testing this in the editor, in a local multiplayer server. The server should be the same as the client in this case.
Nvm I fixed it. I had to do:
_newGroup addVehicle _veh;
_driver assignAsDriver _veh;
[_driver] orderGetIn true;
i have 3 different UI's for different systems and i need check every time, when i open one of them, what other disabled.
private _displays = [2400, 2500];
if (isNull findDisplay in _displays) then {};
This part don't work, what i do wrong?
params ["_unit"];
sleep (random 5);
_unit disableAI "ANIM";
_unit switchMove format ["Acts_AidlPercMstpSloWWrflDnon_warmup_%1_loop", ceil random 5];
_unit addEventHandler ["AnimChanged",{
params ["_unit", "_anim"];
systemChat format ["Anim done! %1",_unit];
_anims = [
"Acts_AidlPercMstpSloWWrflDnon_warmup_1_loop",
"Acts_AidlPercMstpSloWWrflDnon_warmup_2_loop",
"Acts_AidlPercMstpSloWWrflDnon_warmup_3_loop",
"Acts_AidlPercMstpSloWWrflDnon_warmup_4_loop",
"Acts_AidlPercMstpSloWWrflDnon_warmup_5_loop"
];
if !(_anim in _anims) exitWith {};
_unit playMoveNow (selectRandom _anims);
}];
I doubt these animations flow together anyway, but how come the handler isn't firing when the animation is finished? The units just freeze in place and I don't see any chats
AnimChanged only fires when the AI wants to change animation (or player does, e.g. by pressing a key)
which you have disabled
animDone?
also you might want to use playMoveNow after switchMove
2:09:31 "37.977 Anim done! O Alpha 1-1:4"
2:09:31 "37.977 Anim done! O Alpha 1-2:1"
2:09:31 "37.994 Anim done! O Alpha 1-1:6"
2:09:31 "38.011 Anim done! O Alpha 1-1:7"
2:09:31 "38.011 Anim done! O Alpha 1-2:2"
2:09:31 "38.028 Anim done! O Alpha 1-1:2"
2:09:31 "38.028 Anim done! O Alpha 1-1:3"
2:09:31 "38.045 Anim done! O Alpha 1-1:1"
2:09:31 "38.045 Anim done! O Alpha 1-1:8"
2:09:31 "38.062 Anim done! O Alpha 1-1:5"

it fires but it fires too much
on each unit multiple times a second
?
they're just frozen in place, it's not starting or stopping any animations to my knowledge
As Leopard said, AnimChanged fires when entity wanys change animation, but if u disable it, it won't work
I used animDone
I think, they frozen because they try start play animation, but event handler fires and they again try start animation
why u disabling that? For what?
_unit disableAI "ANIM";
Where did you use animDone?
It works with switchMove, maybe not with playMove commands. I added it so ai wouldn't break from the animation but I removed it because it's not really necessary here
switchMove turns off any animation playing before and turns on the specified one
Send ur actual code pls
//edited for rpt/playMoveNow
params ["_unit"];
sleep (random 5);
_unit switchMove format ["Acts_AidlPercMstpSloWWrflDnon_warmup_%1_loop", ceil random 5];
_unit addEventHandler ["AnimDone",{
params ["_unit", "_anim"];
diag_log format ["%1 Anim done! %2", time, _unit];
_anims = [
"Acts_AidlPercMstpSloWWrflDnon_warmup_1_loop",
"Acts_AidlPercMstpSloWWrflDnon_warmup_2_loop",
"Acts_AidlPercMstpSloWWrflDnon_warmup_3_loop",
"Acts_AidlPercMstpSloWWrflDnon_warmup_4_loop",
"Acts_AidlPercMstpSloWWrflDnon_warmup_5_loop"
];
if !(_anim in _anims) exitWith {
diag_log format ["Finished animation: %1", _anim];
diag_log format ["Current animation: %1", animationState _unit]
};
diag_log format ["playMoveNow on %1", _unit];
_unit playMoveNow (selectRandom _anims);
}];
animDone doesn't fire if the animation doesn't actually finish
afaik an animation only finishes when the unit tries to play the next anim
this code has the above (rpt) result
also like I said use playMoveNow
AnimDone seems to fire for me with "Acts_AidlPercMstpSloWWrflDnon_warmup_2_out" and doesn't with "Acts_AidlPercMstpSloWWrflDnon_warmup_2_loop". So... the animation loops by itself?
2:24:08 "38.487 Anim done! O Alpha 1-1:4"
2:24:08 "Invalid animation."
2:24:08 "38.487 Anim done! O Alpha 1-1:6"
2:24:08 "Invalid animation."
2:24:08 "38.507 Anim done! O Alpha 1-1:8"
2:24:08 "Invalid animation."
2:24:08 "38.526 Anim done! O Alpha 1-1:5"
2:24:08 "Invalid animation."
2:24:08 "38.546 Anim done! O Alpha 1-2:2"
2:24:08 "Invalid animation."
the code exits before the next animation can start and loops like this
hold on adding animationState to the log
2:32:26 "49.509 Anim done! O Alpha 1-2:2"
2:32:26 "Finished animation: acts_aidlpercmstpslowwrfldnon_warmup_1_loop"
2:32:26 "Current animation: acts_aidlpercmstpslowwrfldnon_warmup_1_loop"
so that's the current animation state, I should've used the handler one -- edited ^
OH IT'S CASE SENSITIVE
I have surpassed the exit condition and hit the same problem with the units freezing in place
2:36:18 "playMoveNow on O Alpha 1-1:5"
2:36:18 "44.922 Anim done! O Alpha 1-1:2"
2:36:18 "playMoveNow on O Alpha 1-1:2"
2:36:18 "44.922 Anim done! O Alpha 1-1:3"
2:36:18 "playMoveNow on O Alpha 1-1:3"
2:36:18 "44.922 Anim done! O Alpha 1-1:7"
2:36:18 "playMoveNow on O Alpha 1-1:7"
2:36:18 "44.922 Anim done! O Alpha 1-1:8"
2:36:18 "playMoveNow on O Alpha 1-1:8"
Using just https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HitPart is it possible to determine what the damage might have been? or has been if that damage is already applied when this EH is called
I understand that the actual damage will be lower then hit/indirectHit from the 6th parameter
string in array is case-sensitive, string == string is not, indeed
see https://community.bistudio.com/wiki/in#Example_2 for the findIf alternative 🙂
AFAIK no, but you shouldn't need to rely only on that event if you need damage handling
see this note for why not: hit and damage values are derived from the projectile's CfgAmmo class, and do not match the actual damage inflicted, which is usually lower due to armor and other factors
I'm having a hard time trying to figure out what I'm doing wrong here:
In my Cfg_RscTitles:
onLoad = "UINamespace setVariable ['VMS_Sentence', _this select 0]";
Yet, when I'm calling via function in my test play:
cutRsc ["VMS_Message", "PLAIN"];
((uiNamespace getVariable "VMS_Message") displayCtrl 9003) ctrlSetStructuredText (parseText _message);
((uiNamespace getVariable "VMS_Message") displayCtrl 9002) ctrlSetStructuredText (parseText _speakerName);
I get the error Resource Title VMS_Message not found.
I do not understand what I'm doing wrong. 😦
oh my fucking god
i'm an idiot
I see it.
You're passing VMS_Message to cutRsc as a string, not a variable name, so it's assuming it's a classname
VMS_Message vs VMS_Sentence
_agent setDestination [_targetPos, "LEADER DIRECT", true];
seems to result in a true straight line towards target, unfortunately the ai goes straight through any walls/objects this way. any ideas before I try all possible combinations of the planningMode param?
https://community.bistudio.com/wiki/setDestination
Damn... so I just fixed the config, and made the adjustments and its still throwing out the same error. Here's what it looks like now:
onLoad = "UINamespace setVariable ['VMS_Message', _this select 0]";
Config ^
cutRsc ["VMS_Message", "PLAIN"];
((uiNamespace getVariable "VMS_Message") displayCtrl 9003) ctrlSetStructuredText (parseText _message);
((uiNamespace getVariable "VMS_Message") displayCtrl 9002) ctrlSetStructuredText (parseText _speakerName);
I think it's either you use path finding or you don't, there is no alternative but to make your own pathfinding then
lets make my own pathfinding then! 🙂
any notable functions for that or really custom?
no 😄
cutRsc ["VMS_Message", "PLAIN"];
```and is your layer shown?
Hello my fellows I have an incredibly daft question
When I'm trying to run another script after an event within a certain script, do I need to use compilescript and such?
I appreciate I could just try test it buttttt it's tfar ;-;
so mp only
two, repeat last!
basically ive got a script that detects when player is speaking with tfar
I will try making something with terrainIntersectASL, lineIntersectsObjs etc
do i just call <script path> or do i need to call (compilescript [<script path>])
execVM, for a file?
ooor make a Function
Presumably... but I'm not sure to be honest. I think the bigger issue is that I can't even seem to spawn the resource as its not recognizing the resource being attached to the variable "VMS_Message" - and I have no idea why. Config looks good to me. T_T
The name of the config class in CfgRscTitles must be VMS_Message. If it isn't, then this won't work because you're telling it to look for a config class called VMS_Message.
If you're trying to use the variable you set as VMS_Message, you need to pass it as VMS_Message and not "VMS_Message"
ah gotchu
now i just need to figure out how to make this shit run on an object ;-;
trying to make a voice activated mine
That santax doesn't look right though Nikko, per the wiki.
syntax*
I tried it for kicks though, same result.
dayz_losCheck = {
local _target = _this select 0;
local _agent = _this select 1;
local _cantSee = true;
if ((!isNull _target) && {!isNull _agent}) then {
local _los = [eyePos _target, eyePos _agent]; // [player, zombie]
_cantSee = lineIntersects _los;
if (!_cantSee) then {
_cantSee = terrainIntersectASL _los;
};
};
_cantSee
};
_cantSeePlayer = [_target,_agent] call dayz_losCheck;
if (!_cantSeePlayer) then {
_agent setDestination [_targetPos, "LEADER DIRECT", true];
} else {
_agent moveTo _targetPos;
}
this actually works pretty well!
When you use "VMS_Message" you're passing it a string containing the text VMS_Message, which would work if your RscTitles class was named VMS_Message. But what you're wanting to do (I think) is pass it the variable VMS_Message which contains the string classname. The variable name itself isn't a string and won't work if passed as one.
HOWEVER
The variable VMS_Message is not created until the rscTitle is loaded (because it's in the onLoad property) so you're aiming to create a display using a reference that doesn't exist until the display is created.
So you should use the actual name of the RscTitles class, or change the name of the RscTitles class to VMS_Message (probably best to not do that in order to avoid confusion with the variable of the same name).
Figured it out Nikko thanks man - I totally was trying to open the layer with my variable as you were probably suspecting! Once I fixed that it worked like a charm.
scripted EH yes
BIS_fnc_addScriptedEventHandler et al.
hmm, IDK, have you, perhaps, tried, heh, reading the doc? 😛
yeah except im a bit dim
it is linked there though
ok so i think ive figured it out
i want to add an EH with the code inside and then at the end of the code i want to call the EH?
congrats
christ this is confusing
an event is a concept found in many languages
1/ first, you create the code where an event can happen
e.g, "KillPlayer.sqf"
player setDamage 1;
[missionNamespace, "PlayerKilledByKillPlayerSQF", [player, time]] call BIS_fnc_callScriptedEventHandler;
2/ then you subscribe to this event by saying "hey, when this event happens, I want this code to run"
[missionNamespace, "PlayerKilledByKillPlayerSQF", {
params ["_unit", "_timeOfDeath"];
hint format ["%1 has been killed at %2", _unit, _timeOfDeath];
}] call BIS_fnc_addScriptedEventHandler;
and honestly that's just it
[ missionNamespace, "612th_VoiceDetected", {
if !((_player getVariable ["TFAR_isSpeaking", false]) isEqualTo _isSpeaking) then {
_player setVariable ["TFAR_isSpeaking", _isSpeaking];
_player setVariable ["TF_isSpeaking", _isSpeaking];//#Deprecated variable
["OnSpeak", [_player, _isSpeaking]] [missionNamespace, "612th_VoiceDetected", [_player] call BIS_fnc_callScriptedEventHandler];
};}] call BIS_fnc_addScriptedEventHandler;``` i think ive done it right?
i no longer think ive done it right
if you used
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
do you not want BIS_fnc_addScriptedEventHandler at the end of the second one or have i misunderstood
+call
fixed
I'm not entirely sure when the event "happens" in the script I'm using
if !((_player getVariable ["TFAR_isSpeaking", false]) isEqualTo _isSpeaking) then {
_player setVariable ["TFAR_isSpeaking", _isSpeaking];
_player setVariable ["TF_isSpeaking", _isSpeaking];//#Deprecated variable
["OnSpeak", [_player, _isSpeaking]] execVM "612th_Core\scripts\VoiceMine.sqf";
};``` i'd be replacing `execVM "612th_Core\scripts\VoiceMine.sqf";` with something to do with calling the EH, right?
if you don't know what you're doing, take a step back and re-assess: "what do you want to do?"
fire event handler when player is speaking
which would be when execVM is fired anyway so yes i do that
nvm it breaks tfar
what are you doing? are you editing TFAR code?
There is already a eventhandler there that you can use, you don't need to make a new one
The example for addEventHandler even is the speaking handler https://github.com/michail-nikolaev/task-force-arma-3-radio/blob/master/addons/core/functions/events/handler/fnc_addEventHandler.sqf#L19
darn, thats the only event that gives the ammo type, and fires if the target has allowDamage false, the others like handledamage and hit dont fire when invincible
Locate it in the functions viewer. Hopefully there will be comments at the top
Hi. Can you block player take specific item from invertory/ arsenal If he already have one?
Inventory, yes. Arsenal, maybe. You can add a take handler that blocks the player from picking up the item, I don't think that applies to the arsenal
!Alive jim; & !Alive mrtank; & !Alive mrtank3;
why wont this work? its in the contions of a trigger for 3 diff targets.
In my experience if you want control over inventories arsenals are more trouble than they're worth
because your syntax is entirely wrong. https://community.bistudio.com/wiki/Operators
its hooked up to a create task module ect
So If i do box with items then i could block player take another specific item? Not adding Arsenal there, only box own invertory/ cargo
remove the ; from your condition and read the link
Or is that possible if i block just player keep 2 items same time in invertory. So when he try pick up from ground or from invertory item just drop Back to ground or doenst get loaded from invertory.
Which EH i should use to load same item multiple Time from invertory?
"Take" should be a start
how do i go about searching within the radius of a player for a specific object and assign variable names to those objects so that explosions can be spawned at their position?
you shouldn't assign individual variables to those objects, you should store an array instead https://community.bistudio.com/wiki/nearEntities
See syntax 2
KJW_explosiveObjs = _player nearEntities ["classname", _radius]
_unit and _player are used interchangeably, right?
Yeah just an object
gotcha, using tfar to get the player and variable name used there is _unit so i'll stick with that
classname literally means classname, right? on the wiki its using stuff like "Car", "Motorcycle" etc which is causing some confusion for me
No you're right use the type like it says in the example
can i for example use "Alsatian_Sandblack_F"
i am NOT trying to make suicide bomber dogs
There's another command for classnames, I'll look for it later if you don't find it
is it nearestObjects
Maybe nearObjects?
nearestObjects sorts by proximity whereas nearObjects doesn't so it doesn't matter to me as I'm just hunting for one type of class
Thanks @open fractal
I'm actually curious to know if the exact classname works with the nearEntities command or if you need a parent class
so once ive done that then I want to spawn an explosion on each of their positions... so i'd spawn onto getPos KJW_explosiveObjs, right?
Don't use getPos use getPosASL or getPosATL
getPos is AGLS which is niche and takes longer
This will need to be a forEach loop
so something like
"Bo_GBU12_LGB" createVehicle (getposATL forEach KJW_explosiveObjs);?
no, read the syntax for forEach
You can also add a loop to the object that checks for nearby objects and if the nearest object ("man") is a player in your defined area, it will create a bomb at the object's location.
TFAR has an EH for this so this is the easiest way
reading foreach syntax now
Which kind, could you share syntax? Im using loop on my IED bomb nearEntities so If there is EH for this i could use that
["VoiceThingy", "OnSpeak", {
params ["_unit","_volume"];
KJW_explosiveObjs = _unit nearEntities ["Alsatian_Sandblack_F", 1]
}, player] call TFAR_fnc_addEventHandler;
thats what ive got atm let me get the github bit
its for onspeak
Thanks
making things go boom when you talk near them
"Bo_GBU12_LGB" createVehicle (getposATL forEach Objects KJW_explosiveObjs); right?
Sounds cool
go ahead and remove the KJW tag, if it starts with an _underscore it'll be treated as a local variable and deleted when the script is done
Roger doger will do once I've finished moving this crap in my house
Almost miss this one, thanks
its complaining about wonky brackets
uh
dont think ive done this right 💀
["VoiceThingy", "OnSpeak", {
params ["_unit","_volume"];
_explosiveObjs = _unit nearEntities ["Alsatian_Sandblack_F", 1];
"Bo_GBU12_LGB" createVehicle (getposATL forEach Objects _explosiveObjs);
}, player] call TFAR_fnc_addEventHandler;```
yeah my syntaxing is all messed up here i think
["VoiceThingy", "OnSpeak", {
params ["_unit","_volume"];
_explosiveObjs = _unit nearEntities ["Alsatian_Sandblack_F", 1];
{ "Bo_GBU12_LGB" createVehicle getposATL _x } forEach _explosiveObjs;
}, player] call TFAR_fnc_addEventHandler;
@sullen sigil
thanks! does _x refer to just the "current" value in an array?
Yes.
aaah gotchu now
thanks man
its not working for some reason
it worked
i dont know why
i alt tabbed out and i tabbed back in and i had exploded
Bomb might have a fuze timer.
how do i make a an array/list have "nothing" as an option?
context?
_Hat = selectRandom _HatArray;
this addHeadgear _Hat; ```
i want no hat to be an option for the array
tho i couldnt find what i'd have to do for that to work online
Example:
if (random 1 < 0.5) then {
this addHeadgear selectRandom _HatArray
};
Right I have been working on this for a while now and cant seem to fix this error (type string, expected code)
display = uiNamespace getVariable "DP";
_LB_PLAYER = _display displayCtrl 1501; //Gets the player listbox
_LB_FUNCTIONS = _display displayCtrl 1500; //Gets the function listbox
//get the selected function
_functionTreeSel = lbCurSel _LB_FUNCTIONS;
_functionStr = _LB_FUNCTIONS lbData _functionTreeSel;
_functionType = _LB_FUNCTIONS lbValue _functionTreeSel;
hint str _functionStr;
//get the selected player
_playerSelected = lbCurSel _LB_PLAYER;
_playerUIDStr = _LB_PLAYER lbData _playerSelected;
//if ((_functionStr isEqualTo "") || (_functionType isEqualTo 0) || {(_functionStr isEqualTo "-")}) exitWith {};
{
if(getPlayerUID _x == _playerUIDStr) then {
target = _x;
//diag_log getPlayerUID _x;
};
} forEach allPlayers;
//perform the function appropriately
switch (_functionType) do {
case 0: {
[ player ] call _functionStr;
};
case 1: {
[ target ] call _functionStr;
};
case 2: {
[ player ] spawn _functionStr;
};
case 3: {
[ target ] spawn _functionStr;
};
};
Am I doing something wrong?
//Values 0 = //not scheduled, not ontarget
//Values 1 = //not scheduled, ontarget
//Values 2 = //scheduled, not ontarget
//Values 3 = //scheduled, ontarget
No matter what I do it gives me an error
Paste the full error.
you can't call/spawn a string
literally the error tells you that (type string, expected code)
What sharp said then. Apparently _functionStr is a string.
wait. Would compile work in this scenario
So you'd have to do call compile, yes
I feel so dumb 😂
Well at the beginning of the script it was code.... But then I re-purposed it
so i suppose it's some global variable?
you can just get it from whatever namespace you store it in with getVariable
it's better this way anyway, you don't want to recompile it everytime you interact with the ui
now it is yeh
alternatively instead of using lbdata, you can do something like _listbox setVariable ["tag_functions", _funcs], then _listbox getVariable "tag_functions" select _cursel to get it
I didnt think of doing it that way.
Is there a script out there that will lets me create a custom ammo/supply box with a custom classname ? Currently I'm filling it with stuff once it spawns. Or would i have to create a mod with my custom box ?
if you want custom classname, then you need a mod yes
hm okay.... is there some sort of "template" mod that just adds ammoboxes so I can look how to do it myself ?
not that i know of, you can either look at some other mods' source online, or just use config viewer and adapt
https://community.bistudio.com/wiki/Arma_3:_Creating_an_Addon for addon itself, this is a good place to start
Right I'm trying to adapt the previous script (replied to) to ACE explosives now -- basically I need to fire the EH if the distance between _unit and _this (the explosive) is smaller than 1 meter
I've got _unit distance _this but that returns an array which I'm hopeless at trying to figure out how to 'decode' -- not as simple as looking for a radius of 1 meter unless I'm being dumb
What is the actual explosive object that you are referencing "_this" with?
the placed ACE explosive
What is the array returned that you mention here?
something along the lines of [x,y,z]
oh wait no im being dim
jesus christ
wiki confused me by using an array in the examples 😅
ah, so its all good then?
["VoiceMine_612th", "OnSpeak", {
params ["_unit","_volume","_this"];
if (_unit distance _this < 2) then
}, player] call TFAR_fnc_addEventHandler;
i believe that should fire the EH when talking within 2 meters?
or do i need a continue ting
That will fire if the unit is more than 2 metres away, but you need to put that distance check in brackets for it to work with the if/then
Nothing is actually in that if/then statement, hold on a moment while I find this EH, im not familiar with it
its a custom TFAR one
it fires when the player is talking
the firing of it works and such i just need to make sure that it fires when talking within 2 meters of the explosive so that it fires the EH
once it fires the EH that (should) trigger the ACE explosive
Is there a page going over the documentation of that EH? It looks like your code is out of order for what you want to happen
more or less -- https://github.com/michail-nikolaev/task-force-arma-3-radio/blob/master/addons/core/functions/events/handler/fnc_addEventHandler.sqf#L19
unsure if that'll actually be useful to you or not
im using the example
the previous version works great i just need to get the EH firing for when the unit is within the radius of the explosive
just realised i cant have _this there in the params
ya you cant
do i even need to define it anywhere as its coming from another script
my assumption is no
Where are you putting this code?
sqf file
ok then _this means nothing
the trigger is defined in the config
class ACE_Triggers {
class Voice {
isAttachable = 1;
displayName = Voice;
picture = "logo3.paa";
onSetup = _this call "612th_Core\scripts\VoiceMine.sqf";
};
};```
which is basically the same as what ACE is doing
(https://github.com/acemod/ACE3/blob/master/addons/explosives/ACE_Triggers.hpp) -- their triggers page
What is the trigger for? I thought this was between a bomb object and a player
You could just put this script in the init of the bomb object I think
wouldn't be able to defuse it in that case
Is your bomb being spawned or placed in the editor?
spawned
There has to be some way to reference the object in order to get the distance to it, either you can pull the variable from wherever its created. Or you could check all objects that are within 2 metres to see if its one of them
Is it being spawned in a different sqf or the same as this code?
different sqf
Is it in an array?
Your onSetup config code is wrong.
oh hang on i think * onSetup Parameters: * 0: Explosive <OBJECT> * 1: Magazine classname <STRING> * might help
should be
onSetup = "_this call ""612th_Core\scripts\VoiceMine.sqf""";
oh wait also
you can't just call a script like that
so actually
onSetup = "_this execVM ""612th_Core\scripts\VoiceMine.sqf""";
the ACE trigger config thing uses call though
This seems like a unreasonably confusing way of going about what I believe you're trying to do
the ACE trigger thing is also using a macro which you aren't
_this should still work
QUOTE(_this call FUNC(openTimerUI));
note they're using QUOTE and FUNC macros
QUOTE wrapping the entire thing in "s and FUNC referencing a compiled function
oh i thought that was just due to it being a HPP
nope
what I sent is the most basic equivalent of what they're doing
try it and see if it works
i still havent figured out if the EH will fire or not atm
i do i not need continue or something in it
for visibility
That should fire, based on what I just read for the TFAR eh, your if/then statement is still broken though
ya, but nothing happens
does the EH not fire
That he fires whenever the player talks
just need the EH to fire to trigger detonation afaik
Ok so the way that eh works is that when it fires, it runs the code you put into it
_this isn't going to work in your trigger code
The eh should fire whenever the player talks in your case, but the code you put to run does nothing
i'd have to make a second EH then wont i
no
You need a way to reference your explosive
if its an array thats made in a different sqf, then just make that array global
ok i think i understand
i need the EH to only fire when the distance between it and the explosive is less than 2 meters but thats a later issue
It should look something like this, but you need a way to get the "bomb"
["VoiceMine_612th", "OnSpeak", {
params ["_unit","_volume"];
if (_unit distance _this < 2) then {
bomb setDamage 1;
};
}, player] call TFAR_fnc_addEventHandler;
To do that you would have to put the EH inside the if/then check for the distance. You would have to check that often, either in a timer, or with a while loop of some sort
would it not be better optimisation-wise to only check when talking
Yes, but you just said you want the eh to only fire when you're within 2 metres
and talking
just set up the OnSpeak EH when you initially create the bomb and reference it via a global var
KJW you just said this
how are you spawning the bomb?
ACE placing
I think you misunderstand what an eh firing means
what's the actual code for it
yeah which is why i thought i'd need a second EH
let me find it on the github
here
Ok so show me your code that uses that
none does as im making a new trigger type
which will just get added to the list of trigger types in the explosives config
Ok
Then we'll do this
Your onSetup code is running 612th_Core\scripts\VoiceMine.sqf
so show me what's in there
["VoiceMine_612th", "OnSpeak", {
params ["_unit","_volume"];
if (_unit distance _this < 2) then {};
}, player] call TFAR_fnc_addEventHandler;``` thats this bit
that should start running once youve selected the trigger
Ok so that script gets a reference to the mine as _this
yes thats what i thought
if (isNil "KJW_VoiceMines") then {
KJW_VoiceMines = [_this];
} else {
KJW_VoiceMines pushBack _this;
};
if (isNil "KJW_VoiceMineEvt") then {
KJW_VoiceMineEvt = ["VoiceMines", "OnSpeak", {
params ["_unit", "_volume"];
{
if (_unit distance _x < 2) then {
_x setDamage 1;
KJW_VoiceMines = KJW_VoiceMines - [_x];
};
} forEach KJW_VoiceMines;
}, player] call TFAR_fnc_addEventHandler;
};
try that instead
roger ty
gotchu ty
lmk if it works
yeah i forgot to put quotes around the displayname so have to reload ;-;
hmmm
the trigger isnt showing up
wdym not showing up?
just not showing up on the select trigger dialog for the explosive which should have it but i think i need onPlace = "false"; as every other trigger has it
Ah I see, I made an error
not familiar with ace's trigger system so forgive me
params ["_mine"];
if (isNil "KJW_VoiceMines") then {
KJW_VoiceMines = [_mine];
} else {
KJW_VoiceMines pushBack _mine;
};
if (isNil "KJW_VoiceMineEvt") then {
KJW_VoiceMineEvt = ["VoiceMines", "OnSpeak", {
params ["_unit", "_volume"];
{
if (_unit distance _x < 2) then {
_x setDamage 1;
KJW_VoiceMines = KJW_VoiceMines - [_x];
};
} forEach KJW_VoiceMines;
}, player] call TFAR_fnc_addEventHandler;
};
this should replace the script
and yeah you might need to change onPlace
Not sure I've put it in the triggers right as Voice is coming up in config viewer with lowercase V
ah no i did put a lowercase V in where it should've been but still not working regardless
though theyre not case sensitive are they
yep i fixed that
class ACE_Triggers {
class Voice {
isAttachable = 1;
displayName = "Voice";
picture = "612th_Core\data\logo3.paa";
onPlace = "false";
onSetup = "_this execVM ""612th_Core\scripts\VoiceMine.sqf""";
};
};
class CfgMagazines {
class ATMine_Range_Mag;
class SLAMDirectionalMine_Wire_Mag: ATMine_Range_Mag
{
class ACE_Triggers
{
SupportedTriggers[]+=
{
"Voice"
};
class Voice {
fuseTime = 0.5;
};
};
};
};``` thats all the relevant bits
mmm
I'm no config master but I believe the full Voice class should be inside the ACE_Triggers inside the mine class
like I said though, not familiar with ACE's trigger system
someone else who created a new trigger did it like that so i dont believe so
So ive been working on this problem for about a month now, tried to pay someone to teach me but they took the money and ran. Its really getting to my end so help would really be appreciated you guys are my last stop before I quit.
on the right is a asset called street lamp 2 and on the left is a light point. the lamp creates only light in one direction but the lightpoint is in all directions (including walls im doing this to add light bulbs)
any idea on how to make light that can be aimed and its intensity scaled up and down
pictures are below
thanks in advance
Well I'm fairly certain I've got the script end of it working now, so if you can figure out what's up with the config I think it'll work
oh theres literally fnc_detonateExplosive for that side of it
i might be a bit daft
editing should be easy enough though i'd just replace setDamage with the function bit right
I'll look into it for you
oh bruh i might not even have to handle the range bit on the tfar side of things ;-; ignore thats just for item clackers
* Arguments:
* 0: Unit <OBJECT>
* 1: Max range (-1 to ignore) <NUMBER>
* 2: Explosive <ARRAY>
* 0: Explosive <OBJECT>
* 1: Fuse time <NUMBER>
* 3: Trigger Item Classname <STRING>```
although for optimisation its probably better for tfar side anyway right
thank you!
You can go either way, whichever you prefer
i was incorrect
Anyone have any idea why spawning an ied with createvehicle and then using "setDamage 1" just makes the object die and not blow up? But if I spawn the ied through zeus and then do setDamage it blows up...
hmm, maybe its because createvehicle treats it as an object instead of a magazine or something
Are you sure you create the ammo?
And you can't create mags with createVehicle
Also instead of setDamage try triggerAmmo
Im pretty sure im creating it wrong is all, I think im creating it as an object
You have to create it as an object
The question is which part do you try to create?
Mag or ammo?
Im creating "IEDUrbanSmall_F"
Well I have no idea what that is 
Sorry, im creating an ied object, the classname references an object in eden
Does createVehicle successfully return an object with that class?
Yes, it spawns
It also destroys successfully, the icon turns black, however there is no boom 😩
Find it in config viewer
Let me know what it is
I fixed it. The object I was using was incorrect and apparently just related to the physical object and not as something that could blow up. I logged the "typeOf" for the correct object and its class was actually "ModuleExplosive_IEDUrbanSmall_F". So I swapped it with that and it works now!
Thanks for your help Leopard :)
You could've easily told it was not an ammo simply by trying
configOf createVehicle ["classname", [0,0,0]]
In debug console
If the config was cfgAmmo it would be ammo
Ah ok, will keep that for future reference
Alright, so after consulting my config-making friend, it appears you'll need to use https://community.bistudio.com/wiki/CfgVehicles_Config_Reference#Reflectors_Class in combination with some modeling and config work to accomplish spotlights. Someone in #arma3_config or #arma3_model can probably help you with actually setting it up with all of the appropriate memorypoints and such.
OR if you only need the light without any modeling, see below
There is already a directional light
If you just want the light (no object, just light)
Is there?
Yes
Anyway if you want to help @dusk tulip with the scripting go ahead. I'm on mobile so I can't help rn
👍
I probably should've just dug through the Lights section of the BIKI as a first resort 😛
Thanks @little raptor ill look into this! i assume i can just put the script in the same blue arrow marker I used in the pictures above? how would aiming it work (like light cone aimed up or aimed down at the ground ect)
for reference
You want to aim it in the game?
Or just editor?
As for the script, yeah
yea to add the light cone into the editor to cast light downwards in a cone and the intensisty of the light can be some what controlled if possible. for reference the goal is to add lightbulbs because arma can look so dark and un natural looking for night ops
There is an example on the biki page I showed
Use that to adjust the light paramters
ok thank you ill play around with it. unfortunately just found out a family member passed so i wont be able to test it till tomorrow. ill be sure to give feedback either way thank you for your help
Then just add:
_light setVectorDirAndUp [vectorDir this, vectorUp this]
To set the light's direction
My condolences, and no problem. Test it whenever you can
someone needs to make an ai to write config on god
u mean like github copilot or tabnine?
i do not know what those words mean so i shall simply say maybe
ai assisted code auto completion
I tend to find AI code completion rapidly varies between perfect and god-awful
no in-between
god-awful cant be worse than what i write
or rather what i think i write
okay edit from earlier
["VoiceMine_612th", "OnSpeak", {
params ["_unit","_volume"];
_explosiveObjs = _unit nearEntities ["All", 2];
_612th_Voicemine = false;
if (_612th_Voicemine isEqualTo true) then {
{ "Bo_GBU12_LGB" createVehicle getposATL _x } forEach _explosiveObjs;
};
}, player] call TFAR_fnc_addEventHandler;
this is to just allow mission makers to in theory just be able to set _612th_Voicemine to be true in the init of a unit/object/whatever however I don't think I've done the variables correctly
_612th_Voicemine is a local variable since it starts with _ so you won't be able to set it externally
I would suggest maybe storing a variable on the player instead
yeah ive realised this is a bad idea im just gonna wait for help in the ace discord ;-;
easier to integrate with actual players if i stick with ace
yeah but this way people cant set their own voice mines
Do you want them to be able to?
ye
Pretty sure my code I posted earlier would've worked fine
any reason why you're not using it?
i am i just cant get the config to integrate with ace properly
im trying to look for workarounds but i think i just need to be patient
How can I serialize and deserialize a hashmap into string and back? key:value types are string:integer
How do I make a newly created agent move to a given position?
_agent moveTo (getPosATL player);
``` doesn't seem to work
There's no "standard" for serialization, so you can do it how you want, but I believe Dedmen said the game internally serializes them as an array of array pairs.
Well, the idea is to save it using fileXT and read it back in another mission
This is what I came up with:
_gearMapString = str toArray _gearMap; // save this on fileXT
// recreate the hashmap
_gearMapParsed = parseSimpleArray _gearMapString;
gearMapCraeted = (_gearMapParsed select 0) createHashMapFromArray (_gearMapParsed select 1);
Can simplify it a bit
_gearMapString = str _gearMap; // save this on fileXT
// recreate the hashmap
_gearMapParsed = parseSimpleArray _gearMapString;
gearMapCraeted = createHashMapFromArray _gearMapParsed;
oh, so that toArray was fucking me up there... I was trying to use createHashMapFromArray but because the way toArray creates the array I was forcing me to use select
thanks, that works
No problem, str generally does a pretty good job on its own
This is perhaps another stupid question, but the questioner will not get lost.
Is there possiblity to check how many files i have in folder,
i mean if have images folder and i want get count of them to script so i don't need modify script if i add more pictures to my images folder.
you disable the individual engine actions in config
that's how like Ace handles their mines
Where do i find function to this?
addonFiles command I guess
Ye, that is right one. Thanks
if you name your files the same format like name_1.jpg, name_456.jpg etc, you can work it out with fileExists by incrementing an index
Switch maybe? 
Added: Plenty of new script commands and Event Handlers
Anyway. How would you tackle choosing "random line of code to execute".
The normal way I would do it is getting a random int 0..XY then then switch for each of the options.
Because of the absence of switch, I got to use tons of ifs.
Any ideas for a better solution?
(Spawning things inside crates)
And Lou, sadly had no time since last time we spoke, so can't tell if your idea for the AI "disable" works yet. Soon hopefully
Wait, is there a switch in sqf?
Wtf, how did I miss it for so long?
Well I'll be dammed. Time to rewrite some things
switch, or call selectRandom [{ hint "A" }, { hint "B" }] 😄
selectRandom was one of the ideas I had, as the first requirement was to add a gun and two mags, so having a 2D array of gun, mag classnames and just using select 0 and select 1 as parameters for addWeaponCargoGlobal and addMagazineCargoGlobal, but that was later changed to also include random medic equipment, grenades etc, so it had to change alltogether.
Switch seems like the easiest, thanks for confirming.
you also have selectRandomWeighted, if needed 🙂
ACE discord has helped me get it setting up -- though where is the _mine param coming from? The script doesn't seem to be working, and I've tried replacing _x setDamage 1; with a hint but hint isn't coming up
is it the ACE setup thing
The ACE trigger onSetup passes the mine as the first parameter in _this
Which I extract as _mine using params
As for why it's not working, it could be any number of things due to the fact that you're using both ACE and TFAR functions
You could try just putting a raw voice event handler in that script with a hint as a sanity check
And/or a hint in the script itself to make sure the onSetup code is running to begin with
Hello, everybody
I have an idea, and I'm sure someone has already done this.
I have 5 items, and i need to spawn it in a certain zone.
Can anybody help me?
what commands / scripts are needed for this
Hi! You will need createVehicle, addItemCargoGlobal, and other info regarding the "certain zone" 🙂
What would be the best way to get an array of every empty static weapon in the mission?
eg, uncrewed HMG turrets.
Not cars) “anomaly’s”
it’s a bonfires with anomaly’s
and I want them to randomly appear so that the attack commander cannot predict where they can safely pass
everything in arma is a vehicle
I have 5 items
I thought items as binocular, loot etc
and what @open hollow said as well 🙂
@manic sigil Probably works:
vehicles select { _x isKindOf "StaticWeapon" and crew _x isEqualTo [] };
Oh, didn’t write, that I need random 
we are all objects to bohemia 
Cheers man, I always lose my mind when it comes to typeOf and kindOf T_T
Creating things and putting them in a controlled-random location isn't too hard. The complex part is going to be this "anomaly" thing. If you already have an "anomaly" object that you have in mind, this will be easier. If you don't have the "anomaly" ready to go, you should get that sorted first.
typeOf is assertive = what is the type of this object
isKindOf is asking = what kind of object is that
🙂
isKindOf isn't really guaranteed for identifying vehicle types but I've not seen a static weapon that didn't inherit StaticWeapon so far.
vehicles is local, that will work as all turrets are local to that machine, if its all on server wont be a problem, but if a player is on it, locality changes, and when it leave it... it might take a while until its tranfered again to the server.
Also when zeus place them, locality might be on zeus for a while
edit:
you can use nearestobjects, or entities to find them, like
(entities "") select { _x isKindOf "StaticWeapon" and crew _x isEqualTo [] };
Normal objects have global existence, so vehicles will pick them up. Unless you're abusing createVehicleLocal you can consider vehicles to be global.
i have an old mission with "anomaly", and i need to repair it, for us, cause author of this mission choose real life
An object's locality doesn't mean it doesn't exist for machines it isn't local to, unless it's a local only object. All objects and entities are only local to one machine at a time, but they still exist for and can be detected by other machines.
I would be very surprised if entities picked up createVehicleLocal objects either.
yea but i found a few problems when used "vehicles" command , maybe was other the problem back then, but stopped using it because of that
Okay, well...more details, then?
For your randomised position you might use BIS_fnc_randomPos. If your "anomaly" is an object, then you can use createVehicle to create it at the position you've generated. However, it seems like the anomaly is probably a heavily scripted system, and there's no way for us to know how to work with it if that's the case.
it's hard to explain, but i try
Ive been playing with it for a while and no matter how I change the code i cant make the light angle such that it is pointing straight down any thoughts?
_light = "#lightreflector" createVehicleLocal position this;
_light setLightIntensity 3000;
_light setLightAmbient [0,1,0];
_light setLightColor [0,1,0];
_light setLightConePars [45, 10, 1];
_light setVectorDirAndUp [[0,0,0], [0,0,0]]
That setVectorDirAndUp makes no sense
[0,0,0] isn't a unit vector and the dir and up need to be perpendicular
yea i made like 50 of them playing with the numbers [1,0,0], [0,0,0] [0,1,0], [0,0,0] [0,0,1], [0,0,0] [0,0,0], [1,0,0]ect ect ect
Which way is the light facing when you initially spawn it?
positive y
Try just
positive y sorry
_light setVectorDir [0,0,-1]
ok trying it now
_light = "#lightreflector" createVehicleLocal position this;
_light setLightIntensity 3000;
_light setLightAmbient [0,1,0];
_light setLightColor [0,1,0];
_light setLightConePars [45, 10, 1];
_light setVectorDir [0,0,-1]
no change unfortunately
isn't the light forward-facing, therefore its "up" should be pointing "in front" to have the light aiming down?
I'd think it'd work either way but yeah
(I am not the best regarind 3D orientation/calculation stuff so take it with a grain of salt hey :D)
yea its weird i can get it to "spin" around but not angle to the sky or the ground
Try
_light setVectorUp [0,1,0];
ill toss it in now
And if it still doesn't work we can try
_light setVectorDirAndUp [[0,0,-1], [0, 1, 0]];
got it
Could be failing to set direction with just one or the other due to gimbal lock
Though iirc the game kinda just generates a perpendicular up/dir to go with the one you set
ITS BEAUTIFUL! thanks man ive been working on this for around a month. so glad i reached out to you guys
Ay there ya go
thanks man
No problem
Yeah the dir and up were probably reversed
Just change the position of dir and up
Is there any way to add thermal capability to the turret of a given vehicle through a script, rather than needing to do it addon-side? I'm aware of disableTIEquipment, is there anything that functions as the opposite?
Unfortunately there is not, outside of wild and wacky workarounds like attaching an extra TI camera to the turret and giving the gunner an action to switch to it.
when someone execute a func with remoteExec it get logged somewhere who did it?
My fault, ACE discord helped out with this -- the onSetup is meant for UIs and such. onPlace (which I thought was the initial placing of the explosive) was what was needed, and it works now 😄
@sullen sigil Glad it's working
Yeah, thanks for the help man and sorry for leading you down a wild goose chase with onSetup 😅
No worries lel
Is there no else if in SQF?...
nope
sadge
yea, i guess its too hard to make lol
You can sort of emulate it with a combination of nested ifs and switch cases
Nasty
Thank god Reforger and 4 are moving toward something closer to C#. I have so much animosity toward SQF...
hello everyone, how can I find out which animation is currently being played by the player?
hilow, soo i wanna add a few more sounds into a description.exe
class CfgSounds
{
class coldwarb
{
name = "coldwarb";
sound[] = {"sounds\coldwarb.ogg", 0.8,1};
titles[] = {0,""};
};
class flyby
{
name = "flyby";
sound[] = {"sounds\flyby.ogg", 1,1};
titles[] = {0,""};
};
};
class CfgSounds
{
class coldwarb
{
name = "coldwarb";
sound[] = {"sounds\coldwarb.ogg", 0.8,1};
titles[] = {0,""};
};
class flyby
{
name = "flyby";
sound[] = {"sounds\flyby.ogg", 1,1};
titles[] = {0,""};
};
};
is that how one would do it?
or
class CfgSounds
{
class coldwarb
{
name = "coldwarb";
sound[] = {"sounds\coldwarb.ogg", 0.8,1};
titles[] = {0,""};
};
class flyby
{
name = "flyby";
sound[] = {"sounds\flyby.ogg", 1,1};
titles[] = {0,""};
class coldwarb
{
name = "coldwarb";
sound[] = {"sounds\coldwarb.ogg", 0.8,1};
titles[] = {0,""};
};
class flyby
{
name = "flyby";
sound[] = {"sounds\flyby.ogg", 1,1};
titles[] = {0,""};
};
};
that?
Nope and not the right channel
its scripting
welll I'd say it fits since it will be used with playSound
To actually answer your question, you just need to add more sub-classes to CfgSounds, not make multiple CfgSounds classes, so like your second example
Though you wouldn't want to have duplicate subclasses like in that example
also balance your brackets
{} () []
... {+-=} balanced
Every { must have a corresponding };. If you leave it open, stuff breaks
oh
Brackets are only optional if your stuff working is optional 😉
{
};
like that?
That's literally what I said, so yes
class CfgSounds
{
class coldwarb
{
name = "coldwarb";
sound[] = {"sounds\coldwarb.ogg", 0.8,1};
titles[] = {0,""};
};
class flyby
{
name = "flyby";
sound[] = {"sounds\flyby.ogg", 1,1};
titles[] = {0,""};
class coldwarb
};
{
name = "coldwarb";
sound[] = {"sounds\coldwarb.ogg", 0.8,1};
titles[] = {0,""};
};
class flyby
{
name = "flyby";
sound[] = {"sounds\flyby.ogg", 1,1};
titles[] = {0,""};
};
};
so that all looks good now?
- missing bracket
- duplicate classes
classes will be changed
Still the exact things we said not to have lol
.
nothing changed?
class CfgSounds
{
class coldwarb
{
name = "coldwarb";
sound[] = {"sounds\coldwarb.ogg", 0.8,1};
titles[] = {0,""};
};
class flyby
{
name = "flyby";
sound[] = {"sounds\flyby.ogg", 1,1};
titles[] = {0,""};
};
class wardrums
{
name = "wardrums";
sound[] = {"sounds\wardrums.ogg", 0.8,1};
titles[] = {0,""};
};
class gochargebritish
{
name = "gochargebritish";
sound[] = {"sounds\gochargebritish.ogg", 1,1};
titles[] = {0,""};
};
};
wala
isn't cfgSounds supposed to have a sounds[] = {}; line at the start?
No and as far as I know there's no built-in way to do so without manually adding logging code
ive used it like that for awhile now, no issues
can someone else confirm this? a veteran member maybe
what Sysroot says
I mean I may not have a blue nametag but I think I know my way around code-wise :P
hello everyone, how can I find out which animation is currently being played by the player?
thanks!
it would be terribly slow
if (cond1) then {
} elseif (cond2) then {
} elseif (cond3) then {
} else {
}
just because of how sqf works, all of those elseifs would have to evaluated regardless of which branch is true/false, then also all the conditions would have to be evaluated, unless an if <CODE> was used.
if you need to else if, just do
call {
if (cond1) exitWith {};
if (cond2) exitWith {};
if (cond3) exitWith {};
// else
}
Or make a horrifyingly ugly macro for it /s
macros and code are hell, mainly because you need to handle commas with another macro properly
@tough abyss so good news it works great! last step the "flares" are not at the same place as the light source. i need to move to flare up about 1/2 a meter any thoughts?
_light = "#lightreflector" createVehicleLocal position this;
_light setLightIntensity 300;
_light setLightAmbient [1,1,.6];
_light setLightColor [1,1,.6];
_light setLightConePars [300, 0, 1];
_light setVectorDirAndUp [[0,0,-1], [0, 1, 0]];
_light setLightDayLight true;
_light setLightUseFlare true;
_light setLightFlareSize .5;
_light setLightFlareMaxDistance 30
use
```sqf
<code>
```
try
_light = "#lightreflector" createVehicleLocal ASLToAGL getPosASL this;
instead
^
ok ill give it a shot
so i just straight up yeeted that into my code and it worked. no idea why but you guys are smart haha
tl;dr position/getPos are bad and generally incompatible with most commands that take positions
So all that was changed was making sure the correct positioning coordinates for createVehicleLocal (posAGL) are used
sound[] = {"sounds\coldwarb.ogg", 0.8,1};
ep which one is the volum?
array format is: filename, volume, pitch, distance (optional)
thanks