#arma3_scripting
1 messages Β· Page 561 of 1
@unique sundial "Tried BIS_fnc_fire?" - works in local game, doesn't work for dedicated at all.
It is global, it should work in any game. Must be doing something wrong
No, I've tried many things, and only two works for it: fire and action ("useWeapon") - and in the last case it fires the pistol muzzle with the flaregun. But I've got it π I've tracked the soldiers' behaviour with Zeus, adn the problem was that the enableAI/disableAI, doTarget and dowatch commands are local, so I've changed it to remotexec and it works. Thanks.
do someone know if theres offline versions of Bi wiki?
i just need to download entire wiki to have it without connection to net
once upon a time existed the comref, but it goes up to OFP v1. ... 81? 96?
@lucid junco maybe you could use an "offline website" like HTTrack to get everything from it, or at least the Main namespace
how do i deafen or prevent players from hearing voice chat on command channel. only infantry squad leaders can use it, but some how others who cant use it can still hear it. all i can find in the wiki so far is how to disable text and voice usage in the description.ext and on the local player. i have done both. but it doesn't prevent them from hearing it.
@exotic tinsel isn't it the leader himself speaking (like direct sound)?
so alpha and bravo squadleaders are speaking in command channel. a non infantry squad like CAS Jets can hear them.
That's because they are group leaders (being alone in the group)
right but CAS Jets doesnt need command channel in this instance. how can i make it so the SL of CAS Jets cant hear the infantry squad leaders?
they dont want it because too much chatter.
Either give them a leader, or I think there might be an enableRadioChannel something somewhere
@exotic tinsel enableChannel
yes, that just prevents the user from sending text and voice. not receiving it. i have that implemented so CAS Jets cant use command.
Then there is no way afaik
crap. ok thx mate.
(besides adding an AI leader)
na wont help. make things worse else where. im just gonna create a custome channel like command and hide command from all and be done with it. yay
Sounds like the cleanest way!
Stuck at other thing on dedicated... The logic: 1. FiredMan EH on player launches a script that finds one of the enemy soldiers (REMOTE), which fires the flare and 2. Adds to this soldier FiredMan EH, which inside has a code that waits for 5 second (CBA_fnc_waitAndExecute, needs for flare projectile to gain maximum height) and do something, The problem is that the coords of projectile that passes to CBA_fnc_waitAndExecute code part is [0,0,0]. As I understand, the projectile and the code, which gets it coords, have a different locality? But I don't understand what I should do...
Probably not the room, but its scripting related
Has anyone got any experience with inidbi2 and making the scripts work for it? I've got some issues and support if people know of ways to fix them would be appreciated
is there a way to disable load and save arsenal feature in the innit of a virtaul arsenal box?
tried this script couldnt get it to work https://forums.bohemia.net/forums/topic/201814-parameter-in-descriptionext/
your code?
Only testing in the editor ATM: if a vehicle is created and then publicVariable'd from initServer.sqf like so _veh = "C_Hatchback_01_F" createVehicle [1244,1306,0]; publicVariable "_veh";
shouldn't I be able to for example delete the vehicle with deleteVehicle _veh just from the debug console?
Hello Lou. What's with the TAG?
https://community.bistudio.com/wiki/Variables#Scopes see this for further explanation
TAG is just your own tag in order not to "collide" with another script's variable name
Could I just use veh instead of _veh
(could have tested that first for sure ππΌ )
yes sure
Hm any chance that you peeps can point me into the direction of info on having Intel placed in the editor use the icon with the circle that fills up when taking it?
I've looked at https://community.bistudio.com/wiki/BIS_fnc_initIntelObject and that works but that only shows a standard action for me and not the circle
oh, long time no see π
BIS_fnc_holdActionAdd may be what you want @oblique arrow
Oky thank you I'll take a look at that
And yeah I've been more active on the TFAR discord than here recently 
you are forgiven⦠this time.

Btw @winter rose BIS_fnc_holdActionAdd does work for what I want
Now I just need to figure out how to have the diary entry pop up the same way that it does with BIS_fnc_initIntelObject
Oky I have another question, if I want a trigger to activate when the total number of players is inside the trigger is this the correct code?
(count thisList) = (count allPlayers);
use == instead of =
I would say yes (and what Katalam said), if the trigger triggers only on players of course
with = it will fail
@oblique arrow be sure to remove headless clients from this allPlayers list
_allHCs = entities "HeadlessClient_F";
_allHumanPlayerss = allPlayers - _allHCs;
found something weird. when attaching 2 objects(concrete blocks in my case), and moving the one the other is attached to (using setpos) doesn't move the other block. does anyone know why?
Thanks, and the server doesnt use HC's so I dont need to do that in this case but thank you for mentioning it
@spice axle and I'll make sure to check that Lou
@jade abyss doesn't work sadly
got
test2 attachTo [test1];
getPos test1;
test1 setPos [2387.52,13430.1,0.550002];
test2 attachTo [test1];
π€
attachTo (also) takes a (relative) position as 2nd param
(I know)
but just using attachTo won't place it back to where it (relatively) was before setPos
attachTo (also) takes a (relative) position as 2nd param
*modelToWorldposition
Hu? No Lou
does anyone know why?
Not everything can be attached and moved
it's only simulated objects?
so.. It's just not a thing for blocks then? π¦
Wich "blocks"?
Without context this is waste of time. Show the script.
@unique sundial this is all I'm doing
getPos test1;
test1 setPos [2387.52,13430.1,0.550002];
test2 attachTo [test1];
@jade abyss ConcreteBlock_F
getPos test1; <- ?
so I could get the current position and put it into setPos (to move it to the side a bit for testing)
use the 2nd parameter
basically: he wants to have a setup of objects that he can move around by moving only one piece.
It's the position, relative to the test1* object
e.g.
test2 attachTo [test1, [0,5,0]];```
so I need to figure out what it's relative to now and put that in the second parameter of attachTo?
I thought not putting that in would preserve the relative location, which is what I want
and yes, that's correct @winter rose
Hu? I am confused:
Just created both blocks, executed
test2 attachTo [test1,[0,5,0]];
player setPos [2382.52,13430.1,0.550002];
test1 setPos [2387.52,13430.1,0.550002];
test2 attachTo [test1,[0,5,0]];```
blocks are not visible oO (Geo/FireGeo still intact)
That's something new π€
they don't dissapear for me..
@unique sundial ever had that one before?
https://gyazo.com/a32d56d6a59704397bff500bbed3e916
Object is there
https://gyazo.com/b37149cbb50d45ac165dc1522cf684f7
I'm doing this on tanoa if that matters
just tested with VR-Block too. Same
You are inside the block?
Nah, even ran outside
Position is from standing ON the thing
VR-Blocks the same
Testing now with something, that worked 2 weeks ago. (setPos, then attachTo)
Make a complete repro with created objects
Seems to work with attachTo + all params (MemPoint)
same result
Okay
[ 2387, 13430,1.5] <- doesn't work
Obj shows up when removing the 1
[2387,3430,1.5] <- works
Itβs a slow update object maybe just not updated yet
ehm. I have no idea why.. but now
test2 attachTo [test1];
test1 setPos [2387.52,13435.1,0.550002];
suddenly does move test2 with test1
test1 setPos [2387,8447,0.5]; yep
test1 setPos [2387,8448,0.5]; nope
@unique sundial π€ Even on local?
It's getting worse oO, one sec
You are moving it too far
I have no idea what changed.. but this the expected behaviour, so.. discontented yay?
Pos in VR: [2390.75,8447.13,0]
https://gyazo.com/fe75e2db6a0a9cdcc9c545b4b80f90cc
_test1 = "Land_VR_Shape_01_cube_1m_F" createVehicle [0,0,0];
_test2 = "Land_VR_Shape_01_cube_1m_F" createVehicle [0,0,0];
_test1 setPos [2387,8448,0.5];
_test2 setPos [2387,8447,0.5];
player setPos [2384,8446,1.5];```
seems to be happing to non-physX objects only
is there a vehicle equivalent to getunitloadout? im trying to find an easy way to export whats in the vehicle inventory in to a crate. im aware of all the getMagazineCargo, getWeaponCargo, etc.. trying to find a simpler way before i put the time in.
so if i have a backpack in the vehicle inventory and the backpack has stuff. how do i move the back pack to crate. do i latterly have to re add the items to the back pack in the crate??
that's a different topic
nvm thx for the help
okay, deleting the list then Β―_(γ)_/Β―
Any chance BIS_fnc_UnitCapture could get some optimization love?
Or rather does anyone know of a light-weight way of forcing AI to do things with doMove and disableAI?
Do you have #350?
What?
jk
Is there an easy way to check the truth of an array full of booleans?
ex: private _myArray = [True, False]
Is there a function or something to check if the list is completely true or false?
I see. Thank you.
π
Heello!
Is there any way to set the music volume to a specific level in player options vΓa script?
negative, that's player settings
you wouldn't want to have your key binds changed by script, would you π
I have some cinematics in my server and players without music volume dont hear anything
But I couldnt fade it π¦
fade the music file itself
I can't
you could also use an invisible object that "say" the music, then get it away slowly to mimic fading
The cinematic has music and when the player ends it, y fadeout the music
It depends on the player how long does it take to fade
The invisible object could do it but having the "Big Opening" today, its not good hahaha
you have fadeSound, fadeRadio and fadeSpeech
besides that, I don't see any other options!
just tell your players to have music on - it's better than any script π
I did that
but as I know them, they will enter without sound and will not hear the dialog XD
Getting Error missing ] with invKeyDown = (findDisplay 46) displayAddEventHandler ["KeyDown", "if (inputAction 'gear' == 1) then { hint parseText format ['<br/><t color='#f00000ff' size='1.5'>Test text</t>']; };"];
I'm here thinking that I got the quotation marks covered but either I don't and also I can't see what's the issue then
clearer with ```sqf
invKeyDown = (findDisplay 46) displayAddEventHandler ["KeyDown", "if (inputAction 'gear' == 1) then {
hint parseText format ['<br/><t color='#f00000ff' size='1.5'>Test text</t>'];
};"];
if (inputAction 'gear' == 1) then {
hint parseText format ['<br/><t color='#f00000ff' size='1.5'>Test text</t>'];
};
single quotes everywhere
either use ```sqf
format ["<t color='#f00000ff'>test</t>", %1];
// or
format ['<t color='#f00000ff'>test</t>', %1];
@forest ore
(well, escaped quotes since you are in a string already)
What sort of bothers me is the %1 in the end. Is that mandatory when using formatted text (with format)? Does the %1 not need to point anywhere?
Also I was already using single quotes in my example so I can't see where the issue lies
escaped single quotes
you absolutely don't need format, here
@forest ore
well, forget about my previous examples with %1 (it would throw an error anyway I think)
SO! From
invKeyDown = (findDisplay 46) displayAddEventHandler ["KeyDown", "if (inputAction 'gear' == 1) then {
hint parseText format ['<br/><t color='#f00000ff' size='1.5'>Test text</t>'];
};"];
``` to ```sqf
invKeyDown = (findDisplay 46) displayAddEventHandler ["KeyDown", "if (inputAction 'gear' == 1) then {
hint parseText '<br/><t color=\'#f00000ff\' size='1.5'>Test text</t>';
};"];
``` @forest ore
or stop it with the dang quotes and use {}
moduleName_keyDownEHId = findDisplay 46 displayAddEventHandler ["KeyDown", {hint str _this}];
ah yes, displayAddEventHandler can take code too π
yeah and it was a great day wehn that was implemented
oooh yeah.
even easier/fixable:
myFunc = {hint str _this;};
moduleName_keyDownEHId = findDisplay 46 displayAddEventHandler ["KeyDown", {_this call myFunc;}];```
You can adjust the current code, while not needing to delete and readd the EH.
needs a global var, and global var code is bad practice
(potential security issue, unless compileFinal'd)
Actually it's good practice in Eventhandlers Like that
for testing, yes, not release
Sorry @jade abyss , I realised only (way) after I wrote the message
π
Looking at Kerc's version I'm unable to get past {hint str _this}
Where did the rest of the stuff go OR more like I'm at a loss where should I put the stuff I had prepared? With "stuff" I mean
hint parseText '<br/><t color=\'#f00000ff\' size='1.5'>Test text</t>';
};"```
try the example i posted above.
Dscha, I could build a function out of it..but would also need to make it final someday
Yes?
Was referencing to the discussion about global variables and potential security issues π
put that function in CfgFunctions and done
uhm, functions are basicaly just globalVariables
non-overridable*
for testing, yes, not release
Yes for release
wut? what about publicVariable exploit?
global, not public
Eventhandlers recompilation bug
no no, it's quite linked
see https://community.bistudio.com/wiki/compileFinal
Eventhandlers get recompiled before execution. Thus you want them to be as short as possible.
Which
call globalFunc
Is
I believe Dedy is talking about zusing {call}, instead "code"
Yeah, we are way past that Ded π
so we are kinda agreeing then? π
Lou said that's bad practice, it's not.
and wrote below that he was wrong forgot compileFinal*
I said about just a myFunc = { }
Cookies
CfgFunctions / compileFinal protects it from publicVariable, right?
Yes
I have another question
, whats the correct condition to be set in a trigger for it to activate after 5 seconds (from mission start) ? I've looked at https://community.bistudio.com/wiki/BIS_fnc_countdown and that looks like the right thing but I'm not quite sure how to adapt that to a trigger condition
CfgFunctions is the same as call compileFinal
CfgFunctions / compileFinal protects it from publicVariable, right?
Not necessarily.. but you don't wanna know that.
@jade abyss πͺ
@still forum πͺ
@forest ore πͺ
@ me πͺ
@oblique arrow πͺ (you happened to be here)
I'll take a cookie, cookies are always good
You confused US
hmm low eyesight, bad memoryβ¦ π€ careful, Dedmen! π
leaves again
slowly
publishVariable
@oblique arrow Since I'm (too) here: will there be someone to activate the trigger right after mission start? Can you just use timeout with the trigger (instead of countdown which is the default)
Do you mean a player/AI in the trigger area to activate it? @forest ore
player or AI or whatever you would like to have really. But what have you then?
@oblique arrow time >= 5 in the trigger condition would work fine.
https://community.bistudio.com/wiki/time
Ooh neat that looks like what I want, thanks 
//I'M JUST TRYING TO MAKE A KILL REWARD FOR ALL PLAYER "MP" SO WHENEVER, A PLAYER GETS A KILLSTREAK OF 2 KILLS HIS LOCATION WILL BE MARKED ON THE MAP...I GOT EVERYTHING WORKING EXPECT FOR THE KILL STREAK WHICH IN IT DOES WORK ON MY "HOSTED PC" BUT NOT FOR OTHER PLAYERS.
//initserver.sqf
Kills = 0;
addMissionEventHandler ["EntityKilled", {
if (_killed != _instigator && _instigator ==Player && side group _killed != side group _instigator) then
{
Kills = Kills + 1;
//player setVariable ["kills", 0]; /////////////////////////////////
//_new = _newkill + 1; IM NOT SURE WHERE TO PUT THESE
// player setVariable ["kills", _new, true]; /////////////////////////////////
if (Kills >= 1) then {[] execVM "killstreak.sqf";};
};
//killstreak.sqf
DELAY = 15;
REFRESH = 5;
_HvT = 1;
_lastHintTime = -DELAY;
_lastMarkerTime = -REFRESH;
_markerTarget = objNull;
_hasMarker = false;
_markerName = "";
private ["_exitloop"];
_exitloop=false;
while {!_exitloop} do
{
//_isHvT = player getVariable ["kills",0] >= HVT ///////////////// THIS DOESN'T WORK///////////////////////////
_isHvT = Kills >= _HvT && alive player; ///////////////////THIS WORKS FINE/////////////
if (_isHvT && diag_tickTime - _lastHintTime >= DELAY) then
{
hint parseText ([
"<t color='#FF0000' size='1.5' align='center'>High Value Target</t>",
"<t color='#FFFFFF' shadow='1' shadowColor='#000000' align='center'>You have been <t size='1' color='#FF0000'>spotted</t> for killing too many ai's, now your location has been marked on the map!</t>"
] joinString "<br/>");
_lastHintTime = diag_tickTime;
};
};
sorry if i interrupted you guys π
sees private array π walks away
after some tinkering stuff works the way I want it to now, thanks peeps
And back with another problem, so I want a Task to complete once all the players have left the trigger area but only if another trigger has fired, but I've tried using
(triggerActivated Trigger1) and ((count thisList) == 0)
and that doesnt work and just fires the trigger att he same time as the first one
18:54:48 Mission id: dead5101f5e1c425a3a75468060611def9982f8a
coincidence or a joke from BI programmer?
The truth is out there π
Hi, looking to add an action that execs a sqf file, currently I have this
_player addAction ["SaveData", "Save_Profile.sqf"]
Unsure of where to go, not too knowlegeable on addactions and the wiki didnt aide much
You can look it up here: https://community.bistudio.com/wiki/addAction
Yours looks about right
Thats what I'm thinking, having a look through my script to make sure its not breaking in other places
You getting some error or is it just not appearing?
Just not appearing
and _player is defined and the correct object?
_player = a player, no?
player = player
player addAction ["SaveData", "Save_Profile.sqf"]
_player would be a private variable, eg private _player = player; _player addAction ["SaveData", "Save_Profile.sqf"]
Ohh, one question I do have, does an addaction not work in initplayerlocal?
cool, I'll give it a slot into my init and I'll see what happens!
Woo it works! That's good. How to research if I can make an sqf trigger upon opening inventory
player addEventHandler ["InventoryOpened", {
params ["_unit", "_container"];
}];
Oh, coolio, thanks ^^
having a look I cant figure out how to get it to exec a sqf like the addaction does π€
if you have defined cfgfunctions then call the function, if not: [] execVM "filename";
how do
I can link wiki pages and stuff, but i'm not writing your mission for you. Put the exevm code inside the code brackets for the eventhandler
After a re-read:
player addEventHandler ["InventoryOpened", {
params [] execVM "Save_Profile.sqf";
}];
``` works, thanks for helping!
Hey fellas! I'm trying to get a zone shrinker script paired with a death zone if leaving the trigger working. I found a few things online, tested them out rigorously with some people who know how to code, but are not familiar with SQF. We haven't been able to get the script to work properly, while one of my other friends has had better results with the same exact code. Even with everything being the exact same we aren't getting the same results. It seems as if the marker is set to the zones position and size properly, and begins to shrink on the map, but the trigger stays the same size and does not scale correctly.
_triggerArea = triggerArea zoneTrg;
_triggerPos = getPos zoneTrg;
_trgX = (_triggerArea select 0);
_trgY = (_triggerArea select 1);
_rate = 0.1;
_randomNum = selectRandom [800, 700, 650];
"zoneMarker" setMarkerSize [_trgX, _trgY];
"zoneMarker" setMarkerPos _triggerPos;
for [{_i = _randomNum}, {_i >= 0}, {_i = _i - 1}] do
{
if (_trgX <= 4 || _trgY <= 4) exitWith{};
_trgX = _trgX - _rate;
_trgY = _trgY - _rate;
zoneTrg setTriggerArea [_trgX, _trgY, 0, false]; // this line is not working
"zoneMarker" setMarkerSize [_trgX, _trgY];
sleep 0.1;
};
is the shrinkZone script, there's a seperate one to deal damage for players out of the zone, which seems to work fine for me, except that it does not affect the host of the server but my friend debugging with me is affected properly, this is an entirely different problem.
@warm iris without the params...
You are doing very weird stuff there without knowing :D
Why know when you can experiment? :D
(params []) returns a number. Then you pass the number to execVM
nobody? if anyone's willing to help/debug feel free to send me a pm
have you tested each individual command you use through debug console
perhaps you are missing something you define
you could also add debug hint messages that type out different parameters you work with to see if any of them is empty or targets wrong thing
I'll try that
But the odd thing is, the same exact script works for my friend on his computer/server. But the same mission file he used, on my computer has the same problem.
when I try to send this through the debug consoloe
zoneTrg setTriggerArea [_trgX, _trgY, 0, false];
it refuses to work
Cannot quite wrap my head around param, if you are setting _var = param[0,""]; the default value has to be declared in another function or?
No, the default value there is the 2nd element in the param array
So take for example if I am looking for vehicle classes, how does _class = param[0,""]; find the vehicle class I am requesting for
I don't understand
Well you need to run the function by call/spawn/execVM or the like, and youβd pass the vehicle class through that
Hi all.. I would like to avoid the standard garbage collection for dead units, and instead apply disableSimulation to each unit (on MPKilled). Is this do-able, or is this just a bad idea overall? To clarify, I would have a big cleanup operation after each conflict, but would like to retain dead bodies as the defend mission progresses, and just delete everything after each wave. Cheers..
doable, yes, bad idea, idk - need performance test
also, disableSim'ed bodies cannot be used as crates, iirc
thank you @winter rose .. would I place this instruction in initServer.sqf?
also, disableSim'ed bodies cannot be used as crates, iirc I think I heard this also..
you could do this in initServer, but keep in mind that you would have to wait for the body not to move anymore ; don't disable its simulation on death
lol, good tip,. thank you π that would have been a bit of an immersion breaker haha
I am trying to use a cell system to determine terrain types, features, etc. I want to be able to evaluate paths to waypoint, so a virtual line, and see if they intersect these cells. The cells are simply a coordinate system based on a common scale and naming scheme, X_Y, in a cba hash db. Any ideas?
https://community.bistudio.com/wiki/BIS_fnc_nearestPoint and then an inArea command with the triggerArea/rectangular Area syntax?
image for reference: https://image.prntscr.com/image/UrWpthKOTSGjOmepqGljAw.png
I understand what you want, but I don't understand the exact question...
Which part of your code is not working, or not known (yet)?
@still forum doesn't params return bool ?
Yes
@wary vine maybe. Probably. Don't have bikini on phone
@astral dawn I throw a bunch more info into that hash than just the coords so I wanted to keep it organized. the BI db or CBA hash seem the best option
So what info have you got? x,y, what else?
I've added a p3d in my mission and some players get kicked for wrong signature, any ideas how i can fix this?
I don't think that you can add models into missions
Yes with createSimpleObject
yes its work but some players get kicked
@astral dawn pos, terrain type, elevation, building count, roads present/count, etc
mix of numbers, strings, arrays
I don't get it... so does the string for building count at cell [1235, 5678] look like "1235_5678_buildingCount" ?
no, the cba hash key is the cell x_y in string form
all data is within that
private _nodeData = [Map_GridData, _nodeString] call CBA_fnc_hashGet;
private _terrain = [_nodeData, "terrain"] call CBA_fnc_hashGet;``` etc
not all nodes have the same indexes required so hashGets are nice
ah wait, you are using CBA hash! I thought you use namespace getVariable. Isn't CBA hash too slow for you?
slow part is the string handling right? wouldnt formatting lots to getvariable be worse?
For huge map find would have to go through... how many, ~40000 strings in worst case, if your world size is 20km and your grid is 100 meters?
Aren't you converting float xpos, floay ypos to string version anyway?
Yeah I have just tested...
Init code:
_a = [];
_a resize 40000;
_a = _a apply {str random 1000000};
testArray = _a;
Code performance test code:
testArray find "123123"
600 microseconds, with my 8600k CPU... for your AI planning code you will need to do hash gets lots of time I assume
so what's your key then? just array [_x, _y]?
yes
Ok let me see how slow it is...
formatting to the X_Y string would only be needed if I was using getvar
but yes I see the point at some level of map size the formatting is probably faster since it doesnt require a find/in
1.5 milliseconds for [number, number] array
getVariable in arma is fast AF (less than a microsecond !!) and would improve your planning speed very much
Even at the cost of converting to strings (around a few microseconds I assume)
depending on the use case you could also store the data in a sqf file, and only do it dynamically when the terrain is unknown
similar to how ACRE has mapped their terrains
I am doing this yes, parsing it and storing it in the addon
although in that case a plain array would be the fastest
That too βοΈ , I don't understand why you don't want to use plain 2D array...
What am I missing/not understanding with this one:
"EntityKilled" MissionEventHandler works as expected when run directly from initServer.sqf but not when calling that exactly same MissionEH from a function I have declared in cfgFunctions?
So
if (isServer) then {addMissionEventHandler ["EntityKilled", blabla works
but
if (isServer) then {[] call Asm_fnc_entityKilledMissionEH;}; does not work.
For example am I working on an improved GPS Navigation system with full support of off-road movement (and can be used by AI as well with some modifications). And I have a very simple array stored in a sqf file for "supported" terrains, but can get data on the fly when needed (or call the function to generate data for new terrains).
This array is as simple as:
// [ x, y ], [ drive, walk, cover, object ]
_data = [
[123, 456], [0.6, 0.8, 0.1, 0.1],
[124, 456], [0.5, 0.8, 0.2, 0.3],
// etc
];
@forest ore does the function require parameters?
Ah, oh, you mean I should do the call with something else than just [] call ?
... was reading wrong...
so the function, which includes the eventhandler is not working, but it does work directly?
Correct
@exotic flax Are you keeping to #s in your array for speed, then having your functions interpret it as scales for movement preference, determining viabilities of paths, etc?
It's to calculate a score where higher means better, depending on the given transportation, action and state.
eg. infantry on foot who need to move from A to B, while in combat mode, will prefer a walkable area with cover.
While a truck who just needs to drive without contact will prefer drivable without objects.
@forest ore is the function called at all (and visible in the Functions Viewer)? Because it sounds like the problem is there, since EH's will be set no matter how
@exotic flax After the I start the mission from the editor I see the function in the Functions Viewer.. soo does that mean that it should be called as well if it's shown in the viewer?
it means it exists and can be called
Ahh, problem solved. I had lost an all important } while doing testing and moving the missionEH (along with accompanying scripts) from initServer.sqf and into the function I created. With the } missing the game did not output any visible error
what am I doing wrong here?
block = testblock_3; // a concrete block
block attachTo [testtruck, [0, -3.5, 0.4]];
vehdir = getDir testtruck;
block setDir vehdir;
blockdir = getDir block;
dirdict = [vehdir, blockdir];
hint str dirdict;
gives a hint with differing values, even though they should be the same(and of course the directions in game aren't the same either).
this only happens when block is attached to a vehicle, why is that?
what is testblock_3?
woops, typo. fixed
many different items
there
if you attach an object, a setDir on it is relative to the object it is attached to
oh wow
so setDir 90 would turn the object to the right of the "attached to" object
thanks!
should I just have figured that out by not being an idiot or can I read it somewhere
you could also setDir then attachTo
It is written on the attachTo wiki page iirc
I went to the wiki pages for all kinds of direction and spend some time on attachTo as well..
yes it does.. stupid me
ugh I wasted so much time! well, thanks!
np!
π€ I think it'd make more sense to put that note on the setDir page.. or use one of those warning boxes. ah well
(edit: attachTo to setDir)
yep maybe, I was reviewing that as well
(oops, typo. meant the setDir page of course)
I am editing attachTo , setDir shouldn't really be concerned about this
attachTo updated @steady terrace
awesome! @winter rose
@tough abyss can't fix. We talked about that a couple weeks ago in another channel.
@Dedmen what can't be fix?
The signature problem with p3d in mission
@still forum Are you sure because i remember a script using a .p3d in mission without kick? (speed camera maverick)
Well you can disable sig verif
Yes i've disabled sig check but already got guys with some modified .pboπ
I think BI might look into mission p3ds but can't guarantee anything
@still forum it's a new issue since update of sig verif i'm right?
Think so. Either last or second last updoot
Ok thanks for your information @still forum.
Actually. I wonder if same happens with music/sounds in mission. That would be worse and would be a bigger incentive to fix it
I'm trying to set a variable inside a init file.
'''macro_fnc_name(init) = {
//Variable to prevent muiltiple actions added to the menu
bool menuCountRn=false;
...'''
any idea why this won't?
ahh I see. thanks
also macro_fnc_name(init) = { that's not how you define functions
https://community.bistudio.com/wiki/Function
right but I will need it for the unit that I've created.
I'm just trying to make the custom action I've made only appear once in the action menu, rather than once for every instance of the unit spawn/existing.
I'm trying to make it so the addAction process only runs once. by using a variable controlled if statement
== isn't a thing here either.
what would I use in its place?
hmm... must be something else
thanks for wanting to help Dedmen. just one sec...I'll pull it up
looks like the error occurs here:
...
};
if(_menuCountRn==false)then{
macro_fnc_name(add_enter_action) = {
params [
["_unit",objNull,[player]]
];
...
Uh
I assume you are already a programmer?
Then you know that bool == false is the same as !bool
I'm very new to arma scripting
And you were already told, that's not how you define functions. Functions have no arguments
If you are very new, why are you trying to apply things from other languages onto SQF and just hope it works?
Look at wiki you were linked above
"...why are you trying..." I'm hoping to learn, even if it means I fail.
I didn't define the variable there. It was already defined above at the start of the function. Sorry about the brevity of the code being shown but not all of it is my work.
but i'll keep looking at the wiki as if it were holy script
If you learning another programming language (like SQF), forget everything about the previous one and start from scratch, it will be easier π
@cunning crown Thanks for the advice. Will do
@bold kiln check the last 2 pinned messages in this channel.
Actually. I wonder if same happens with music/sounds in mission. That would be worse and would be a bigger incentive to fix it I still use music/sounds from my mission PBO on one of my public servers with no issue @still forum
In dayz there is a network bubble which means only objects x distance from you will be calculated but in arma i believe all objects on the map (or within view/render distance) will be sent to the client, have a look on here: https://community.bistudio.com/wiki/Mission_Optimisation
_counr = count entities ""
?
Hey guys (hope this is the right place):
Does anyone knows how to disable Voice chat and Text chat in the in-game channels but still keep them for marking?
If I have an array called _guns and have 3 or 4 classnames in there and then do
{
_gun = selectRandom _guns;
[_x, _gun, 6] call BIS_fnc_addWeapon;
[_x] joinSilent _ambush;
_x setVariable ['dangerAIEnabled', true];
} foreach _badguys;```
Why do all 4 _badGuys get the same weapon? foreach works as a loop doesn't it?
Ok well either it was just incredible luck or it needed a sleep in there because I put a 0.2 sleep in and now they have different weapons.
that makes no sense, selectRandom doesnt care about your sleep
how many guns do you have in _guns?
Ok so it was just dumb luck that all 4 guys ended up with the same weapon from a 5 weapon array π I can live with that
yes that can happen thats why you should run it several times to be sure
random means random
Yeah I know, just seemed like the odds of them all getting the same weapon was ridiculous. I should have tested more
you can make sure that weapon pulled out of array is not given to anyone else
shuffle the array then take weapon by index
Yeah sweet, thanks for confirming my lack of testing :)
It's not super important, it just didn't make sense to me (due to my own lack of testing)
What's the best way to detect nearby enemy units? I tried 'findNearestEnemy', but that only returns the enemy unit once it fired.
^ the enemy the unit knows, yes
Oh I found the issue.
unit disableAI "all" doesn't help with detecting enemy units π
Hi there, how can I add refract particle effect using script? Code below doesnt work:
_pos = q1 modelToWorld (q1 selectionPosition "exh_leng_pos");
ps2 = "#particlesource" createVehicleLocal _pos;
ps2 setParticleClass "ExhaustSmokeRefractHeli";
ps2 attachTo [q1,[0,0,0], "muzzle_1"];
No particle effects at all?
Is it not documented anywhere?
I don't understand how private keyword and general _privateVariable without private keyword behave inside FSM
Test?
Yes but I am trying to find biki references to be sure
Is this correct syntax eg. for retrieving the second parameter of the calling function only?
params ["",["_packet",[],[]]];
Or should it just be
params [["_packet",[],[]]];
The first one is the correct syntax, you should either remove the 3rd element of the 2nd array or put direct data type in it otherwise it's useless
@still forum nope, other effects like smoke , explosion work fine, but refract doesnt show at all
Maybe that specific effect is too mild
Tried all refract effects :/
@cunning crown Thanks! π
@astral dawn FSM _vars can be accessed from all "blocks" as long as they have been defined (e.g in the "start" block) of course
in the whole FSM I think
is there a cleaner way to remove a certain amount of a certain item from a player than just spamming removeitem
GetUnitLoadout, change count setsunitloadout. But thats stoop :D
oof
@astral dawn whole fsm can access private & local vars
Even if I define them in some call scope?
like...
0 call {
_myvar = 123;
};
Can whole fsm access it afterwards?
I have just tested... in scope I can overwrite _myVar which is global for whole FSM if it has been defined before
But can't initialize it there
Yeah thx!
FSM is scheduled, it was explained on execFSM page until you edited it
then it should be explained on the FSM page, not execFSM
ah yes, I always mix up between being able to waitUntil and scheduled stuff
FSM conditions are unscheduled @astral dawn
Well I know that it just executes one state per frame
I can't sleep in it
I understand
Thanks guys
But FSM itself is running in the scheduler as I recall
Doesn't mean that code itself is scheduled environment
ask KK, he is way more aware of this than I am
@astral dawn from what I read, FSM is scheduled, but suspension is not allowed (canSuspend returns false)
Only FSM conditions are unscheduled.
It's scheduled in a sense that it occupies scheduler's time, yeah
and yes, it is explained on the FSM page @unique sundial
I will do another pass on both pages to split things cleaner
How do I encapsulate a string created with format with quotation marks? Do I need an escape character?
private _myString = "I said ""yes!""";
So it's just double quotation marks?
or ```sqf
private _myString = 'I said "yes!"';
that would return "stuff, [stuff, stuff]" yes
Nice! Thanks mate π
Or Pass result through str
What is the command to check if a "classname" is in a predefined array
in ?
thanks
Does it matter in which order you use param or params, aslong as the variable name is the same it is okay, right?
?
_a = [0,1,2];
_a params["_two","_zero","_one"];
hint str _two; //0
hint str _zero; //1
hint str _one; //2
You mean that?
@mortal nacelle the order matters in the way @jade abyss mentioned it; but the order itself is not important to their values at all - they are just passed
Yeah, that is what I ment. Thanks
If im hosting a server doing Escape, how do i change the time of day?
scripting wise, setDate or skipTime @fleet comet
@winter rose okay, what if i wanner turn of stamina?
is there something i can put in chat?
π
https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3
βοΈ
also
π ctrl+F for the (Browser-)searchfunction π
βοΈβ¦ π π
Have people replicated the map parsing to terrain type for the map in script form? I can't see an exposed function that uses the map config values for trees and rocks and such
just a combination of https://community.bistudio.com/wiki/selectBestPlaces?
And donβt forget utils 5 gives you searchable interface to every command in game
Searching biki easier tho? :U
Does utils show you dedmen on addWeaponWithAttachments?
output:
So no more info than that?
no more info than that.
Searching biki easier tho? :U
Not really, it has missing commands and it is often down plus you need internet. Good for checking commands after you found what youβve been looking for
it is often down
wrong. but yes, you need internet
I guess you donβt use it often
almost never!
If I had a dollar for each time I wrote to Dwarden about it...
I don't know, I really only had issues when the wiki was down for long; I think it occured twice this year
it may go down frequently and I don't notice, but it's never down for too long, at least from what I could see
(also maybe different timezones too)
but it's never down for too long
Maybe I should stop nagging Dwarden then
hahaha - then maybe you're the reason for it to be up quickly, and in that case thank you
I just wanted to jump on the
it is often down
because whenever I go to the wiki, I am not "oooh, it is down again"
maybe thanks to your reactivity, but it is not down "most of the time" for common peeps
It is down quite often. And it's always down when you really need its information π
yeah, same as red lights when you are in a hurry π
well, guess I'm lucky then! π
True π
is there the way how to manage (have control) head movement for AI?
@lucid junco not exactly head control, but direction watching
what are you trying to achieve?
I need to force AI to look specific direction (during the dialog)
lookAt, glanceAt, doWatch can help then
these are not enough π
i never saw what actually glanceat do. For me it does literally nothing at all π
I think it is less "strict" than "look at", as in "from the corner of the eye"
but I can totally be wrong on this one
i need something definately more "strict" then lookat π
god bless "randomization" of everything π
i think i need custom animation for the cutscene haha
π
thats what im looking for
ah well, then scripting cannot help :p
check the anim viewer in Eden, it may help!
yea i already had few long nights with anim viewer hah
rawr
i need mocap
or better someone skilled with mocap and skilled porting animations to the arma
the game has plenty of anims, which are the ones you want specifically?
I just googled if there are any cheap-ish mocaps anywhere near me, cuz i need some custom anims
There seems to be a community driven free one in the same building as me
hah!
How does the game store your score on a server internally? (eg. if you disconnect and reconnect)
Let's say you have 500 points, and then you disconnect and reconnect. Then I kill an enemy unit and get 1 point. Should I tell the server to update the score to 501 or 1 to have the correct number of points (=501) shown in stats?
(Note: Arma 2)
@tender fossil it depends on the server itself
by default the game doesn't store anything
technically:
the client should not say anything to the server,
the server should know the score and do a "+1". then, the db with your playerUID and the operation should deduce the new score
I mean:
- on player connection: getPlayerDbScore
- on player score: +1 β saveDb
"B_Mortar_01_support_F",
"B_Mortar_01_weapon_F",
"B_Mortar_01_support_grn_F",
"B_Mortar_01_Weapon_grn_F",
"I_Mortar_01_support_F",
"I_Mortar_01_weapon_F",
"I_E_Mortar_01_support_F",
"I_E_Mortar_01_weapon_F",
"O_Mortar_01_support_F",
"O_Mortar_01_weapon_F",
"B_Respawn_Sleeping_bag_blue_F",
"B_Respawn_Sleeping_bag_brown_F",
"B_Respawn_TentDome_F",
"B_Patrol_Respawn_bag_F",
"B_Respawn_Sleeping_bag_F",
"B_Respawn_TentA_F",
"C_IDAP_UGV_02_Demining_backpack_F",
"I_UGV_02_Demining_backpack_F",
"O_UGV_02_Demining_backpack_F",
"I_E_UGV_02_Demining_backpack_F",
"B_UGV_02_Demining_backpack_F",
"I_UGV_02_Science_backpack_F",
"O_UGV_02_Science_backpack_F",
"I_E_UGV_02_Science_backpack_F",
"B_UGV_02_Science_backpack_F",
"I_E_Mortar_01_Weapon_F"
"RHS_Podnos_Bipod_Bag"
"RHS_Podnos_Gun_Bag"
"rhs_M252_Bipod_Bag"
"rhs_M252_Gun_Bag"
];
if (BIS_WL_arsenalEnabled == 1) then {
BIS_fnc_arsenal_data set [3, BIS_WL_factionAppropriateUniforms];
BIS_fnc_arsenal_data set [5, (BIS_fnc_arsenal_data select 5) - BIS_WL_mortarBackpacks];
BIS_fnc_arsenal_data set [23, (BIS_fnc_arsenal_data select 23) - ["APERSMineDispenser_Mag"]];
BIS_WL_arsenalSetupDone = TRUE;
};``` this dosnt work im guessing i need to pull more scripts from the warlord pbo file?
. . . maybe?
Hey peeps any chance you guys know of a way/could give me a pointer to a way to open the strategic map using an add action / hold action
? I took a look at https://community.bistudio.com/wiki/BIS_fnc_StrategicMapOpen but it seems like that'd always create a new strategic map instead of opening the already existing one
is there a way to reopen a map though
@tough abyss ,,,,,, <-- missing in the list
@jade abyss thanks for the catch but its still showing up the RHS mortars in arsenal
did you start your game with the parameter showScriptErrors?
no, how do i do this?
@jade abyss turned it on but getting an error for something unrelated im aware of already
I think i structured the script wrong as i feel its just not being detected at all
Fix that, it could be a followup error
Check your .rpt's, fix the first error in that list. Restart the it, repeat
one by one, not all at once. Some stuff could just be an error, because something broke before.
I dont know how to fix that specific error its been there since i Added rhs to the mission and hasnt affected anything. It gived me an error in my a3 wlparseassetlist.sqf file
_bPacksCnt = (count _transportBPacks);
for [{_i = 0}, {_i < _bPacksCnt}, {_i = _i + 1}] do {
_item = getText ((_transportBPacks select _i) >> "backpack");
_text = _text + format ["%3%2x %1", getText (BIS_WL_cfgVehs >> _item >> "displayName"), getNumber ((_transportMags select _i) >> "count"), if (_text == "") then {""} else {", "}];
};```
```sqf
/* your code */
```
you can use ```sqf to colour your code
e.g ```sqf
_transportBPacks = (BIS_WL_cfgVehs >> _entryClass >> "TransportBackpacks");
_bPacksCnt = (count _transportBPacks);
for [{_i = 0}, {_i < _bPacksCnt}, {_i = _i + 1}] do {
_item = getText ((_transportBPacks select _i) >> "backpack");
_text = _text + format ["%3%2x %1", getText (BIS_WL_cfgVehs >> _item >> "displayName"), getNumber ((_transportMags select _i) >> "count"), if (_text == "") then {""} else {", "}];
};
sqf Does not work
Does not work
sqf _this = nope
Tick tick tick sqf line break text line break tick tick tick
Not like you are doing
Tick tick tick line break sqf text line break tick tick tick
Does not work
I've never understood how to color the code and at this point I'm too afraid to ask
I thought it would just magically work with ```sqfSPACEcode π
hello, is it possible to determine any NIC information from the hosting machine? i.e. MAC address, etc? from the context of scripts, that is.
big no
whyyy would you want to do that π
sure, no worries. I want to cook up a UUID API for some internal tracking of mission array entries.
playerUID?
AKA Steam ID
hey yall im still trying to fix this its been a while since i have looked at it the concept and goal of this code is to take the chords of a location and clear all of the objects within a radius before the objects placed in eden are loaded i have ran it multiple times and have hit a rock should this work for the intended goal it doesnt even clear the objects when ran on a dedicated server
private _locations=[[5789.38,10383.6],[5724.87,10404.2],[5793.5,10421.4],[5759.32,10444.9],[5798.47,10468.9],[6895.849,7453.282],[6895.849,7453.282],[5822.715,10783.907],[5830.870,10187.938],[5845.938,10223.338],[5840.145,10143.083],[5876.150,10186.08],[5878.213,10210.816],[4985.84,11373.3],[4961.61,11323.8],[5755.97,10696.4],[5755.66,10717],[5755.51,10731.1],[5479.933,9977.303],[5469.477,9947.218],[5761.33,10628.7],[5730.21,10625.1],[4676.46,9315.29],[3875.18,9667.09],[5836.25,10830.8],[5938.71,10645.7],[5835.59,10545.3],[5805.89,10579.7],[4634.15,9265.12],[4712.04,9263.93],[4054.704,9105.791],[9877.941,13536.048],[4048.31,8318.89],[4073.25,8294.63],[6921.5,7584.5],[8262.4,11990.3],[8356.62,11957.9],[5935.47,11051.4],[5948.38,10987.6],[5922.09,10983.3],[5922.09,10983.3],[5918.39,10993.2],[5918.39,10993.2],[5763.97,10586],[5756,10567.3]];
private _radi=[50,20,30,50,20,20,20,30,30,30,10,20,8,50,20,20,20,20,5,10,20,20,50,99,15,40,50,20,35,25,100,20,50,50,100,100,50,50,25,10,5,5,45];
if (count _locations != count _radi) exitWith { hint "invalid grid" };
{
private _location = _x;
private _radius = (_radi select _forEachIndex);
{hideObjectGlobal _x} forEach (nearestTerrainObjects [_location,[],_radius]);
} forEach _locations;
this is clearmap.sqf
[] execVM "Modules\HG\Setup\fn_serverInitialization.sqf";
call compile preprocessFile "Modules\MapEdits\clearmap.sqf";
this is initServer.sqf
The language is sqf not c++. And I literally just told someone else how to do Syntax Highlight correctly
my bad i haven't even been here
i can fix it
i didnt know discord supported sqf
fixed my bad
NΓΆ Error messages in rpt? It doesn't exit on the exitwith?
not for players, per se. just general mission critical array elements.
no worries, we can just aim for random UUID for the time being.
ill have to run again and check for you when i sit back at my pc i apologize i got called into work
Why am i getting a zero divisor error even tho the if statement shouldn't be execute when the number is lower than 1. Or am i missing something? π€ ```sqf
if (PoliceFrisk_VestChance + PoliceFrisk_PrimaryWeaponChance + PoliceFrisk_SecondaryWeaponChance >=1) then {
_frisk = (PoliceFrisk_VestChance + PoliceFrisk_PrimaryWeaponChance + PoliceFrisk_SecondaryWeaponChance);
systemChat format ["Total: %1%, chance: %2%, (%3/%4)", (_frisk * 100) / _chance, (_chance/_frisk) * 100, _chance, _frisk];
};
how do you get this chance values?
_chance = 0;
if (vest _x != "") then {
_chance = _chance +PoliceFrisk_VestChance;
};
if (primaryWeapon _x != "") then {
_chance = _chance +PoliceFrisk_PrimaryWeaponChance;
};
if (secondaryWeapon _x != "") then {
_chance = _chance + PoliceFrisk_SecondaryWeaponChance;
};
try systemChat str PoliceFrisk_VestChance
nvm i found the error, _chance is 0 -.-
and yes
thanks
in response to earlier there is nothing referencing the script in the rpt file
it seams like its not executing
do the two blocks make sense as if they should execute when desired
This is gonna sound stupid but
I named variable convoy then said convoy setConvoySeperation 10;
When I run i get the error error generic error in expression
what is the full script, and what is the exact error message?
Full script is: Convoy setConvoySeperatipn 10;
The exact error is when I run the scenario: βcall Convoy SetConvoySeperation 10; error generic error in expression
so your script is call Convoy SetConvoySeperation 10;, with the extra call in front...
and where/how do you run the script? In the init field of the leading vehicle?
because in that case you can use this setConvoySeparation 10;
possible somehow to switch freelook via command?
https://community.bistudio.com/wiki/freeLook like this just need to not check but switch
Anyone experience issues with addMagazineCargo? Seems to cause a CTD whenever you try to swap your weapon in the inventory with another weapon. I removed addMagazineCargo from my script and it worked fine.
Can provide a video and crash logs
Make a repro @spark zenith
will do
private ["_unitPrimaryWeap","_unitVestContainer"];
_unit = param [0, objNull, [objNull]];
_unitPrimaryWeap = primaryWeapon _unit;
_unitVestContainer = vestContainer _unit;
if(_unitPrimaryWeap == "arifle_MX_f") then {
_unitVestContainer addMagazineCargo ["30Rnd_65x39_caseless_mag",6];
systemChat "Added 6x 30Rnd_65x39_caseless_mag";
};```
actual script
class cfgPatches
{
class addMagazineCragoCrash
{
name = "addMagazineCragoCrash";
requiredVersion = 0.1;
};
};
class cfgVehicles
{
class EventHandlers;
class B_Soldier_F;
class crashTestMX: B_Soldier_F
{
displayName = "soldier mx";
weapons[] = {"arifle_MX_f"};
magazines[] = {};
class EventHandlers: EventHandlers
{
init = "if (local (_this select 0)) then {[(_this select 0), [], []] call tst_fnc_testCrash;};";
};
};
};
class cfgFunctions {
class tst
{
class functions
{
class testCrash
{
file = "addMagazineCargoCrash\testCrash.sqf";
};
};
};
};```
no mods loaded other than the single pbo
@spark zenith is there already a ticket on feedback tracker?
Yes please, and link here
Hey guys, I'm trying to make a simple script that would place loads of 40mm into a rifle's magazine
Would this work?
player select [weapon] select [magazine]
player select [primaryWeapon] select [200Rnd_40mm_G_belt]
^ I intend to place 200 rounds of 40mm in the primary weapon of a player
so this select [primaryWeapon] select [200Rnd_40mm_G_belt]
@tough abyss Select is intended for use in arrays, strings and configs, not the player object. primaryWeapon returns the classname of a units primary weapon as a string, you cannot see the magazine of the string without looking in the config. You are using incorrect syntax and you will not be adding 40mm to a vanilla rifle with a simple script
How can I do that? I once saw a guy who placed 2x 3rnd 40mm GL into the magazine slot of a revolver, and another guy place lots of flashbangs into the magazine slot of an MG42
i asked them once, they just said "simple SQF scripting!"
i don't think they "placed them into the magazine"
They probably added a fired eventhandler and then used createVehicle or what ever to create a bullet/shell/missile/etc and then give it the same velocity and direction as the actual bullet
You sure? He gave me the revolver and when I picked it up it had the 2x 40mm GL placed in the magazine slot through SQF magic
cheats*
it still shouldn't transfer over if he picked it up
Nah not cheats, he's the admin on his own server with the debug console
Was the server modded?
Yeah we had a dozen mods
No it wasn't
He prolly added like a 40 mm AA mag or something into the gun
Vanilla revolver, vanilla 40mm
You know can make a copy of the mag
And just add more weapon tpyes
Or do the same with the gun
He just told me it's a few lines of SQF. Apparently he spawned the revolver into his secondary weapon slot with the 40mm inside it already
Wow you were right
cursorObject addWeaponWithAttachmentsCargo [["hgun_Pistol_Signal_F", "", "acc_flashlight", "", ["3Rnd_HE_Grenade_shell", 3], [], ""], 5]
Spawns a gun with HE 40mm
@still forum what did you bring upon this cursed land
π I already found that "bug" but I'd prefer to label it a feature
Looking at chat above, it indeed is used as a feature so I'll leave it at that :3 thank me lat... No, thank me right now!
Please don't exploit it to do bad, otherwise I'll really have to fix it and take that feature away
hello, i'm trying to add a fireworks script to mission, but when start script - nothing is working. drop don't work's for me, i think π¦
- create a new mission in 3den
- save the mission (make sure it's NOT binarized)
- code the script in the mission folder
- reload the mission in 3den
- place an object somewhere on the terrain (in 3den)
- add the following line in the init of the object:
// make sure path to file is the same as the file location relative to mission.sqm
nul = [this,120] execvm "ALfireworks\alias_fireworks.sqf";
- start the mission
ah, still no visual effects π¦
try the tutorial video on the workshop page, I'm sure that will help
try'ed that code:
[] spawn {
_time_life_projectile = 2;
_obj = objectParent player;
drop [["\A3\data_f\cl_exp",1,0,1],"","Billboard",0.02,_time_life_projectile,[0,0,2],[0,0,200],0,11,8,0,[5],[[1,1,1,1]], [1],1,0,"ALfireworks\trail_fireworks.sqf","ALfireworks\blow_fireworks.sqf",_obj];
};
for test's, but nothing is changed
still don't works
but that is NOT the code which is given in the description or tutorial...
to be fair, that array looks wrong (when comparing it to ParticleArray)
I do not have experience with drop or particles, but I would guess your RPT file has some errors explaining what is wrong
-showScriptsErrors might help as wellβ¦
Hey guys, I'm trying to set an event handler where, if a person fires the RHSUSAF M32 MGL, the ammo count would be set to 6 (cuz that's the max the MGL could take, in other words I want to have infinite ammo for the MGL). Will this work?
this addEventHandler ["Fired", {
params ["player", "rhs_weap_m32", "", "", "rhs_mag_M433_HEDP", "rhs_mag_M433_HEDP", "rhs_mag_M433_HEDP"];
player setAmmo [currentWeapon player, 6];
}];
Sorry for asking if this would work or not, I don't have access to arma until a few more weeks
params takes _underscoredVariables, so no
I think setVehicleAmmo works on players. Might just want to use the player as a target and the command will just use whatever magazine size it takes.
Soooo, this?
this addEventHandler ["Fired", {
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
if (_weapon isEqualTo "rhs_weap_m32" && _magazine isEqualTo "rhs_mag_M433_HEDP") then { _unit setAmmo [currentWeapon _unit, 6] };
}];
more likely
_year = 2019;
systemChat format["Happy new %1 year",(_year + 1)];
I would like to limit the number of UAVs ...
I want about two.
What is the way?
Don't place 3 UAVs
@winter rose I'm not talking about that simple thing.
We spawn a UAV using the VVS system on the server.
I want to limit this to a maximum of two.
So modify the VVS system... or fix its config... It is a script not a mod.
It's also not core ARMA... so not really a scripting question
is there a way to pass arguments onto an dialog control created with createDialog ? I have some buttons defined that do actions based on the params given. The action of such button looks this : hpp action = "[_argument1, _argument2] execVM 'itsAebian\CodeLock\actions\setCode.sqf'";
@hollow lantern use setVariable on the control
Ah wait
Well I guess I don't fully understand your question, sorry. But setVariable might be your solution. Not sure. π·
The problem is the object where the variable is attached to is not static, it is dynamic (aka multiple objects can exist). So I somehow need a way then to tell the action to fetch that specific one
So when you create the object, you can do setVariable on it
When the action runs, it will getVariable the data
yes, but that doesn't work in the createDialog
I'm not able to get the object
createDialog does not support to pass params to him
it's a simple sqf createDialog "KI_KeyDialog" command
so that dialog has no knowledge of the object
unless I could modify the Button via idc and change the action this way but I doubt
If you know the Display IDD you can use that
Does anyone here know how I can add a simple eject anywhere script? For helicopters on a server, not a zeus server or anything, it's just a pvp server
@hollow lantern use onLoad event specified in dialog's config to store the dialog's handle into uiNamespace. Get that handle right after you have called createDialog. Then you can find your control by idc.
After that you can add any event handler to the buttons
CtrlAddEventHandler
@vital surge ```sqf
player addAction ["Eject", "player action ['GetOut',objectParent player]",nil,1.5,true,true,"","!isNull(objectParent _this) && _this isEqualTo (currentPilot (objectParent _this))"];
This will only work for the current pilot, so some changes will be needed but will work in most cases.
Btw there is also #arma3_gui where you might have much higher chance to get answer
@worthy willow got an example for that? The button idc = 1610
I'll check it out Jimbo
What is the IDD ?
Wym
I was talking to @hollow lantern
how do I find this out? I have defined the button this way:
class buttonEnter: RscButton
{
idc = 1610;
action = "[cursorObject] execVM 'itsAebian\CodeLock\actions\enterPressed.sqf'";
text = "Enter"; //--- ToDo: Localize;
x = 0.417535 * safezoneW + safezoneX;
y = 0.632032 * safezoneH + safezoneY;
w = 0.0412325 * safezoneW;
h = 0.0550133 * safezoneH;
colorText[] = {-1,1,-1,1};
};```
The IDD is right at the top
dialog name?
KI_KeyDialog
createDialog "KI_KeyDialog";
private _display = (findDisplay 1234);
private _btn = _display displayCtrl 1610;
_btn setVariable ["object",cursorObject];
_btn ctrlAddEventHandler ["ButtonClick",{
params ["_control"];
_obj = _control getVariable ["object",objNull];
if (isNull _obj) exitWith {};
}];
Could do something like that
so instead of the action in the button I do it like this then?
I will check it out, thanks
this actually works lol, genius! Thanks @worthy willow
NP
I just discovered something very annoying, https://community.bistudio.com/wiki/animateSource setting speed to 'true' isn't instant it's just Very Fast
with the particular animation I was using it on, it's very noticeble that it's going quickly from 0 - 1 rather than just immediately jumping to 1
even mroe so if you use setAccTime and set the game speed into slowmo
https://community.bistudio.com/wiki/Arma_3_AI_Skill As a sanity check I want to make sure I'm understanding the sub-skill "general" correctly. The General sub-skill distributes the value it contains to other subskills automagically and does not have any other effect on the AI outside of what it has distributed to other sub-skills?
If that is true, what is the weighting of how it distributes the value given?
@worthy willow do you have an idea why the excuted script does not know anything about the passed variable?
_display = (findDisplay 1234);
_btn1610 = _display displayCtrl 1610;
_btn1610 setVariable [str _keyPad, _keyPad];
_btn1610 ctrlAddEventHandler ["ButtonClick",{
params ["_control"];
_extracted = _control getVariable ["keyPad", nil];
if (isNull _extracted) exitWith { systemChat "Error 500 - Internal Server Error"};
[_extracted] execVM "itsAebian\CodeLock\actions\enterPressed.sqf";
}];
In the enterPressed.sqf I have at the top a simple params ["_keyPad"]; which should hold the name of the object but it seems that the script doesn't like it.
Even after the params a
params["_keyPad"];
if (isNil _keyPad) then { hint "It is nil ;("};``` will return in a ```rpt
_>
11:21:40 Error position: <_keyPad) then { hint "It is nil ;("};
_>
11:21:40 Error Undefined variable in expression: _keypad
11:21:40 File C:\Users\Aebian\Documents\Arma 3\missions\Madley.Enoch\itsAebian\CodeLock\actions\enterPressed.sqf..., line 3
the 1st script snippet above is from my openDialog.sqf and the _keyPad variable works there as I do as well a getVariable and have recieved no issues so far
_btn1610 setVariable [str _keyPad, _keyPad];
needs to be
_btn1610 setVariable ["keyPad", _keyPad];
but then the variable will always be accessible as keyPad
I want the actual object name as "name"
as different objects can run the script and would rewrite the variable. Button ID is static, object-name however is not, so my idea was to make the variable name unique by using the variable name of the object or doing something like (warning, pseudo-code) Key_+_keypad
e.g. I used some tablets, I named them CellTab_01 CellTab_02 etc. I could now say (pseudo-code) _btn1610 setVariable [VAR_CellTab_01, _keyPad];
if you understand what I mean
Why not just make a list?
if I can fill that list dynamically
maybe
do you may have an example for this approach? I really only need a variable that is unique to the Object like CellTab_01 , CellTab_02 usw. but attached to the button so that I can pass stuff to it
I'm trying to figure out why the debug area of my script is borked on Dedicated server but works perfectly on LAN multiplayer.
nosAIdebug = [0, 1] select (paramsArray select 1);
nosAIaccNUM = [0.05, 0.10, 0.15, 1] select (paramsArray select 2);
[] spawn {
while {true} do {
sleep 5;
{
_x setSkill ["aimingAccuracy",nosAIaccNUM];
_x setSkill ["aimingShake",0.1];
_x setSkill ["aimingSpeed",1];
_x setSkill ["commanding",1];
_x setSkill ["courage",1];
_x setSkill ["endurance",1];
_x setSkill ["general",0];
_x setSkill ["reloadSpeed",1];
_x setSkill ["spotDistance",1];
_x setSkill ["spotTime",1];
_x allowfleeing 0;
if (nosAIdebug == 1) then {
allNosUnitsCheck = allUnits;
randoUnit = allNosUnitsCheck call BIS_fnc_selectRandom;
aA1 = randoUnit skill "aimingAccuracy";
aS1 = randoUnit skill "aimingShake";
aSp1 = randoUnit skill "aimingSpeed";
sD1 = randoUnit skill "spotDistance";
sT1 = randoUnit skill "spotTime";
[-2,
{
systemChat format [
"unit: %1\aimingAccuracy: %2\aimingShake: %3
\aimingSpeed: %4\spotDistance: %5
\spotTime: %6"
,randoUnit,aA1,aS1,aSp1,sD1,sT1]; /*These variables return "any" when run on dedicated server. In the Lan environment they work perfectly*/
}
] call CBA_fnc_globalExecute;
};
} forEach allUnits;
};
};
I am also working within the confines of ArmA II OA latest version.
paramsArray?
ah, yes, indeed
else param1 / param2 :p
I think maybe I'm just not understanding either one of two things: CBA_fnc_globalExecute or dedicated server isn't broadcasting the variables even though it knows them.
I cannot help on CBA though.
(for info, what is paramsArray select 0? another setting?)
Yes it's just another debug param for another set of scripts defined in description.ext .
I resorted to using the CBA function because of familiarity. I think to execute code remotely in Arma 2 I have to use the multiplayer framework with call RE; ?https://community.bistudio.com/wiki/Multiplayer_framework
but then you have to wait for the init to be done
That page probably gets accessed once every two or three years. "Insert self deprecating joke"
wellβ¦ Arma 2β¦
:p
I think I know what's happening here. Even if I used RE I would have the same problem because the code is executing on me and not actually passing me the information which is why on dedicated I get empty variables. So I guess the best bet would be to run the code on the server only. Then store the return values into a message and then pass the info?
the systemChat happens on the server yes
https://community.bistudio.com/wiki/Multiplayer_framework
better @tough abyss ?
Outstanding
Okay I've taken care of the original issue. The code now runs properly on dedicated. Now my problem is getting correct values.
allNosUnitsCheck = allUnits;
randoUnit = allNosUnitsCheck call BIS_fnc_selectRandom;
aA1 = randoUnit skill "aimingAccuracy"; /*aA1 returns 1 no matter what. The variable randoUnit is local to the server. The true aimingAccuracy value is 0.15*/
The above gets ran on the player.
And bottom line is that I'm not getting the correct value for aimingAccuracy.
I do get the correct value if the unit is local to me in a LAN environment.
use selectRandom instead of call BIS_fnc_selectRandom the function deprecated
This is A2
I have a handful of files that I'd like to run as part of player respawn. Should I be #includeing those files, or execVMing those files from onPlayerRespawn?
forEach could provide somekind of answer to that π€ΈπΌββοΈ
@worthy willow do you know if the control event handler knows anything about the var defined outside of the handler? My current approach is this:
_btn1610 setVariable [format ["VAR_%1", _keyPad], _keyPad];
_btn1610 ctrlAddEventHandler ["ButtonClick",{
params ["_control"];
_extracted = _control getVariable [format ["VAR_%1", _keyPad], nil];
if (isNull _extracted) exitWith { systemChat "Error 500 - Internal Server Error"};
[_extracted] execVM "itsAebian\CodeLock\actions\enterPressed.sqf";
}];``` The var used in setVariable will now be VAR_<keyPad-Name> so e.g. ``VAR_CellTab_01`` and I now want to fetch that dynamic var in the control handler so that I get the value out of it which is ``CellTab_01``
It doesn't know _keypad
how can I make him aware of it?
wiki doesn't tell me anything about that _control param
What you are doing doesn't really make sense at all
You are setting Var_keypad to keypad.
When you try to retrieve that variable, you already need to know the value of keypad because that's part of the variable name, retrieving that variable doesn't make any sense as you already know it's value before you retrieve it
@still forum hu? What I'm trying to do is to set the name of KeyPad onto a variable called VAR_<keypad-name> so that I can then fetch it later on in the ctrlAddEventHandler to get that passed value out of it
Your code sets _keypad value onto VAR_<_keypad value>
thats correct
Makes no sense, also you already need to know keypad value to retrieve the variable
And if you already have that anyway, then there is no need to get a variable whose value you already have
that's the whole script
Hey, I'm currently trying to get a unit to move into a vehicle that's nearby without affecting their normal course / already set waypoints and without teleporting them. This is what I got
{
_x moveInAny _vehicle;
}forEach units squad1;
``` However this teleports them into the vehicle and addWaypoint wont work unless someones knows a way. Btw this is run in a while true loop
the buttons however will be called from several objects that differ
Why VAR_%1?
Why not just set the variable "keypad"?
because keypad will then be overridden when another object with the same dialog executes a button
with the name of the other keyPad
it will as the variable is attached to the button and not to the _keyPad
Stop using format. Just make the variable name "keypad" instead of format with VAR_%1
Just do it
I won't be able to explain to you in a way that you understand
so let me get this straight then:
_btn1610 setVariable ["keyPad", _keyPad];```
Will attach a variable to the button 1610 with the name of ``keyPad`` and the value of ``_keyPad``.
When the ``_keyPad`` value is e.g. ``CellTab_01`` then the keyPad variable will have the value of ``CellTab_01 ``
If another object now runs the same dialog and the setVariable will run then the value of ``_keyPad`` is CellTab_02 and hence the variable attached to the button 1610 will be changed from CellTab_01 to CellTab_02
That's what my assumption is. However I will remove the format and see
You cannot store variables on anything. You store values.
The value you setVariable onto the control doesn't know anything about your local bariable
yes yes I got that. Still the value will be changed any time another object will execute the dialog. as the VALUE of _keyPad is different (it is based on the object name that runs the dialog)
If it closes the old dialog and opens a new one, why would that matter? The old is gone anyway.
If it opens a additional dialog, the dialogs will have different controls, and you set the variable onto the control anyway so...
Btw why do you have findDisplay twice with the same I'd?
And why do you name the first _ctrlIndicator. findDisplay doesn't return a ctrl
https://community.bistudio.com/wiki/displayCtrl it returns the control and needs the display as value
but I could also store that in a variable I have below, yes
just changed it
Ah yes. Inconvenient linebreak there
thanks @still forum works
Where do you find the name of bombs?
For IED scripts it says βM_MO_82mm_AT_LGβ where would I find names for other weapons?
on the wiki, check CfgMagazines in the search field @mystic cedar
Alright thanks
is there any EH or similar mechanism to detect if an unit joins another group?
I knowο»Ώο»Ώο»Ώ it's SQS, but it was easier to writeο»Ώο»Ώ π https://forums.bohemia.net/forums/topic/227164-wind-bug-weird/
Hello. I have a problem. I made a script, which changes smoothly the wind. Its works, there are no problems. Here is that script: (I know its SQS, but it was easier to write :D) ;SCRIPT BY JTS params [_value,_coef,_delay] private _changeX; ?(!isServer): exit ?(!isNil wndChang...
can't you just work with sqf unit1 in units group unit2
I don't think there is an EH for detecting if a unit joins another
@unique sundial can you use sqs in arms 3? Because his last answer is way funnier if you canβt use it
SQS is still supported in Arma 3 yes.
the answer might be "you can't use # for select in SQS" (but I am not sure of this) it seems to work fine for him
You still can but there are questions
@velvet merlin I think, no, must poll it periodically
Check if current group and previous group are different
Guys, I'm trying to open the doors of the gendarmerie offroad.. but there doesn't appear to be an animation for it
I can hide them, but not open them, i've looked through the parent classes too
Hello did anyone of you, manage to use/create a gear menu that works with the RHS grip accessories, ? I have problem with those, they seems not working properly, instead of bipods works fine...
hi,when im running [] spawn BIS_fnc_exportEditorPreviews; ( https://community.bistudio.com/wiki/Eden_Editor:_Configuring_Asset_Previews) it only generates 80 pictures and then rpt loggs :
Cannot save file. Directory ...\Screenshots\ exceeded size limit (250MB).
Does anyone know a solution for this ?
Yes, it is said somewhere in the wiki that you should expand the screenshot directory max size
Point 1 @sonic linden
maxScreenShotFolderSizeMB = 2000;
found it thanks
Personal advice, if you want to make a 455px pic, don't run the game in 4K
is it possible to get the behavior of a group instead of a member of the group?
if you set the behaviour of the group leader, then the whole group will follow
yes but i dont want to have to loop through every guy to get the groups behavior. i am trying to get the groups behavior from their group object. is that possible?
the irony is to set the groups behavior you have to do it on the group object. but you cant use "behavior" function on the group object.
@exotic tinsel that would be the leader's one
I have a trigger with sqf ([west, side _x] call BIS_fnc_sideIsFriendly); however the trigger doesn't get activated. When running the same command in the debug console with _x being player it returns true. Any ideas what's wrong here?
where does your _x come from?
as it is a trigger I suppose it fetches _x from the trigger area
or is that a false assumption?
your _x is undefined
thisList - list of all objects in trigger area, based on 'Activation' nothing with _x on the wiki, I guess false assumption then
hmmm ok
{ _x } forEach thislist
thx
Would anyone be interested in a Discord Webhook callExtension?
sounds like a good idea
It is basically done
Does anyone know a good banking script for Arma. Like those used in Altis Life mod, where the player can buy and sell stuff. I would like to use it in a survival mission
Can someone give me a hint why the following condition works when I test it with my player unit but does not work when AI passes the trigger?
{[west, side _x] call BIS_fnc_sideIsEnemy} forEach thislist && {_x isKindOf "AIR"} count thisList > 0``` The trigger should activate if the object type that passes it is type air (helo or plane) and the side of it is hostile towards WEST
sideIsEnemy only checks the last unit in thisList
or rather. it checks all, but ignores the result for every but the last
well the complete helo is manned with opfor units. They are hostile towards WEST and they were sitting in a helo, is the condition still valid then? Would it help if I do a sqf side (driver _x) ? Then only the driver will be checked
would findIf be better though
ah
huh, thisList is an array, according to the wiki findIf needs as 1st param an array and second is what to search for. How would I re-write that? I tried sqf thisList findIf {[west, side _x] call BIS_fnc_sideIsEnemy} && {_x isKindOf "AIR"} count thisList > 0 but got an expression error. The thing I want is that the condition should determine if the "air vehicle" is hostile and return true
!= -1
Anyone can tell me if headless client is unlimited?
an unlimited amount? technically it's limited to some millions I suppose, IRL you maybe don't want way too many
how many do you plan to have?
4
@winter rose thanks, works. The final result is sqf thisList findIf {_x isKindOf "AIR" && [west, side _x] call BIS_fnc_sideIsEnemy} !=-1
Would anyone be able to help me with a script?
You'd need to ask a question first otherwise we will not be able to do so Β―_(γ)_/Β―
Does anyone here know how I can get playSound3D to work with a custom sound file in the scenario folder?
Basically I'm creating a Scenario and I have a vehicleChat script in a Trigger but no matter which unit says the line, it's always "Driver"?
I'd have 2 Units called sur1 and sur2 but they both come up as Driver, even tho they'd both be sitting in Passenger seats?
My Trigger has, ' vehicle sur1 vehicleChat "I can't imagine how chaotic the cities are."; '
And no matter which seat "sur1" is in, it always comes up as Driver?
@winter rose Thanks a lot man
I had just found a workaround, but it was very ugly π
this one is much nicer
@winter rose If i put driver at the front, nothing shows up.
@still frost what exactly do you want to achieve?
Ah, the text displayed on "vehicleChat"
That I don't know.
@winter rose for an example I'll have two triggers one with ' vehicle sur1 vehicleChat "So are we gonna pick him up?" ' and the other ' vehicle sur2 vehicleChat "If he's still alive, yes." ' Now sur1 and sur2 are both in passenger seats but they both come up as "Driver" or "Pilot" in helicopters for some reason?
don't "vehicle" them, just unit use unit names?
sur2 vehicleChat "blah"
``` @still frost
@winter rose I've tried that and it comes up with an error.
β¦what would be the error?
Missing ;
β¦then add a ;
Even with that, it doesn't work unless I put "vehicle" in it
that's your full code?
And I'd use this script last year and it would show the appropriate seat, the code must've changed since the last time I used it?
try 0 = sur1 vehicleChat "blablabla" then
No, there is a mistake most likely on your side here
Probs, my full code is - vehicle unitname vehicleChat "texthere";
@winter rose I'll try your 2 codes again the next time I get on ARMA 3.
Thanks for your time tho, hopefully it works out.
ah, I thought you were trying in parallel
I just tried in Eden, it doesn't bring up any errors but it doesn't do anything @still frost
vehicle player vehicleChat "blah" works, player vehicleChat "blah" doesn't
@winter rose basically I want it to Display the right seat the Unit is saying the line from instead of it displaying Driver.
@winter rose I reckon these new updates must've changed something?
I have absolutely no idea - I didn't use this command since OFP
Yeah, I have no problems with Group, Side or Global chat....Vehicle chat is where my issue is at
Note: Object parameter must be a vehicle, not a player.
Note: If you are in a crew seat (i.e. driver, gunner or commander), then it will include that role in the chat name output (Eg: Driver (you_name): "Message").
Uhm... the wiki explains exactly how it works...
Lou... Y U NO READ WIKI?
I am WriteOnly
lol
@exotic flax I've been following the wiki all this time and it still displays Driver for everyone
Unless I'm doing something wrong? @exotic flax
you can't have it working how you would want
Time to use vehicleRadio @still frost
You can use it if you define entries in CfgRadio, even without sound
@winter rose alright, I'll give that a geez. Would you also know how to make the text white? To make it look like it's proximity chat instead of using "globalChat" and it displaying the faction.
If not I'll just stick with globalChat
white = globalChat, else you should create a custom channel
@winter rose wouldn't know how to create a custom channel....I'm just a very basic Scenario creator.
neither do I, but we can check together on the wiki π
you can read https://community.bistudio.com/wiki/radioChannelCreate for starters @still frost
if any issue, msg us here
PS: Singleplayer or MP?
@winter rose Singleplayer
perfect, so all you need is createβsendβdone
(and also add units that should send/receive to the channel, of course)
@winter rose cheers, I'll see if I'm capable of creating a channel π
it seems to be no big stress really - we're behind ya :p
thanks @opal mulch your a life saver
Hi everyone I am having a scripting issue
I need help lol
anyone here a scripting guru?
just write what your problem is and someone might answer if they know how to help
target1 animate ["terc", 0];
target2 animate ["terc", 0];
target6 animate ["terc", 0];
target5 animate ["terc", 0];
sleep 180;
thats my current code
the issue is I want it so when the player goes through the trigger the targets pop up which they do ,great
BUT
I need it so that the trigger cannot be activated again for a time so that more than one player can pass through the trigger without setting it off after it has already been activated
otherwise the targets keep coming back up
I recall triggers can be set to have custom cooldown
the sleep at the end of your code is unnecessary
that or a global variable
no cool down
count down and time out
time out from what i understand is a time required for the trigger toactivate
as in a player must stand in it for said seconds
before it activates
in init.sqf: JMCD_targetUp = false
condition: !JMCD_targetUp
onAct: ```sqf
JMCD_targetUp = true; 0 = [] spawn { sleep 180; JMCD_targetUp = false };
this might be stupid BUT
target1 animate ["terc", 0];
target2 animate ["terc", 0];
target6 animate ["terc", 0];
target5 animate ["terc", 0];
target1_targetUp = true; 0 = [] spawn { sleep 180; JMCD_targetUp = false };
like that?
shit wait
target1 animate ["terc", 0];
target2 animate ["terc", 0];
target6 animate ["terc", 0];
target5 animate ["terc", 0];
target1_targetUp = true; 0 = [] spawn { sleep 180; target1_targetUp = false };
target2_targetUp = true; 0 = [] spawn { sleep 180; target2_targetUp = false };
target6_targetUp = true; 0 = [] spawn { sleep 180; target6_targetUp = false };
target5_targetUp = true; 0 = [] spawn { sleep 180; target5_targetUp = false };
like this?
why not use the same var?
he's making a range of popup targets and he wants them to pop back up after a delay
and target1 animate ["terc", 0];
target2 animate ["terc", 0];
target6 animate ["terc", 0];
target5 animate ["terc", 0];
target1_targetUp = true; 0 = [] spawn { sleep 180; target1_targetUp = false };
target2_targetUp = true; 0 = [] spawn { sleep 180; target2_targetUp = false };
target6_targetUp = true; 0 = [] spawn { sleep 180; target6_targetUp = false };
target5_targetUp = true; 0 = [] spawn { sleep 180; target5_targetUp = false };
didnt work
well kind out
of
currently
they pop up just fine on the trigger
BUT
I need it so that the targets do not pop up again for a few minutes giving the rest of the group of people time to move in past the trigger
without setting off the trigger
use the global var, and use it as a condition for trigger
this is for a MP mission so i cant just use variable names and have certain characters set it off
can you give me an example?
Condition:
this &&target1_targetup
I believe the issue with that is the targets all start in the down position to begin with
otherwise that might work
they pop up as you get close
by themselves?
I have a script in the init.sqf that does that for me
you can script the "cooldown" in it yes
thats all i need but im not sure how
there is only count down and time out in the triggers options by defauklt
if you are using scripts, you don't really need triggers
the triggers make the targets pop up
the script simply makes it so they spwan in the downed position
spawn**
right-click β edit message :p
ty
or just arrow up
- server-only trigger
- init.sqf (or initServer.sqf):```sqf
TAG_trainingStarted = false;
- trigger:
**condition:**```sqf
this && !TAG_trainingStarted```
**activation:**```sqf
/* raise all targets */ TAG_trainingStarted = true; 0 = [] spawn { sleep 180; TAG_trainingStarted = false; /* lower all targets */ };```
@hollow gate ^
he wants all popup targets to have different triggers because it's a range in which you walk through and the targets are popped up when you're close
I like how cleanly you write your messages btw
it does make it easy to follow π
yes I have multiple triggers though
so would I need a script in the init for each group of targets then
something like that
incoming new thing for CBA Statemachines
https://s.sqf.ovh/2020-01-03_19-44-50.mp4
Assume not many people use it tho
i would like pt use the statemachine for a few things, however i am lazy and would prefer a graphical editor