#arma3_scripting
1 messages ยท Page 578 of 1
@wooden plaza you are missing the mod tha has wy_sww
got the WY_Snow_Winter_Effects_and_Retexture_Pack mod on my server
only started getting when added the snow script in think that might be why
I have a minor problem that has been bugging me, this snippet gives a Generic Expression error, why?
waitUntil { time >= time + 30};
first of all because it will never continue, since it will always be false...
second; where and how is this used/called?
It's a cooldown timer, kind of got it from the example on the 'time' BIKI
infact the one on the BIKI copied verbatim also gives a Generic Error
example on biki is:
private _future = time + 30;
waitUntil { time >= _future };
Which will work because the future time is "static" within the waitUntil, yours will always return false
and waitUntil needs to be in scheduled scripts (see https://community.bistudio.com/wiki/waitUntil)
so most likely called at the wrong place/moment
Most likely
try:
0 = [] spawn {
private _future = time + 30;
waitUntil { time >= _future };
// your code
};
It's supposed to be run after a function that depends on a trigger, I don't want the cooldown to be before the function runs as then you'll have to wait after trigger is met. Will the above format work normally?
so function -> trigger -> cooldown -> continue function?
More like trigger > function > cooldown > trigger again
Either way cooldown has to be last
so it shouldn't trigger again until the cooldown has ended, got it ๐
in that case I would create a global value (eg. in missionNamespace) with the time of the last execution, and at the start of the function check if the old time is more than n seconds ago
That's seems like a better idea, also stops the function from running for too long. If it doesn't work I can always just use sleep
if (time >= missionNamespace getVariable ["lastTriggerTime", 0] + 30) then {
// your code
missionNamespace setVariable ["lastTriggerTime", time];
};
^^ not tested, but should give an idea on how to tackle it
Thanks a lot would have eaten my keyboard without you
np
independent, see https://community.bistudio.com/wiki/Side
been looking, could not find, thanks!
was just there and saw this,...INDFOR and thought hmm? never saw it like that before
I' having a awetime spawning as independent without NVG's
aweful
{
showWindow = 0;
hideOnUse = 0;
priority = 6;
role = 0;
displayName = "Activate Impulse";
position = "pilotview";
radius = 9;
condition = "(alive this)";
statement = "0 = this spawn 3as_fnc_afterburnerMK1_turn_on";
};
``` When activated an error saying the statement line is missing a semicolon. Ideas?
exactly as the error says... there's a semicolon missing IN the statement
statement = "0 = this spawn 3as_fnc_afterburnerMK1_turn_on**;**";
Oops. thanks for that. It's still throwing the same error but I will double check for missing ;
in that case it's most likely in the function (bit hard to tell without the exact error)
How would I make a group of vehicles only start moving when players reach a waypoint?
use triggers
how do I create selectable options for a mission?
I can actually run the function in the debugger fine. It's somewhere in the cpp
in the snippet you posted there are no (other) issues, so it could be a missing ", {, } or ; somewhere
I've gone over the portion for my useraction classes in the cpp and still not finding anything. Maybe it is in the function and I'm just not seeing it
https://hastebin.com/gufexuzaki.cs
script looks fine by me
Does anyone here know if the Arma 4 release is real and if the engine will still allow most existing scripts to be used?
A4 rumours are fake...
as for SQF support in the Enfusion Engine, no idea... currently DayZ:SA uses a hybrid which still supports it, but there has been no news about how it will work in a game with only Enfusion.
can I https://community.bistudio.com/wiki/setPosATL on a group unit (ie a squad) or only on specific units?
Only on objects. So units.
like, i want to offset every member of the squad to a certain position, do I have to iterate for every member or i can just squad1 setPosASL [1,2,3] ?
mmh so how do I move them without changing their relative position?
{
private _pos = getPos _x;
_x setPos (_pos vectorAdd [0,0,1]);
} forEach units _grp;
Will offset Z of every unit in a group by 1
Not sure what do you want to achieve.
Do you want to move the squad and keep formation?
no it's like
i have a mission that is supposed to start in the sea
but since players are solid they keep drowing because they forget rebreathers
so i want to add an option to start on the beach directly
which means i have to move the players and the SDV (that is also the current arsenal) to the beach
Trying to move them by offset does not sound like good idea for that.
how would you solve it?
my idea was to place an invisible marker and say "move them to this position keeping the same distancing etc."
Move SDV to marker pos
Yeah. Not sure why you need to save distancing between players.
It's still not complicated but I don't want to explain this from a phone xD
I get it; all players should move to a new position, where each player needs to stay in their relative position (just moved as a group). at least that's what I'm understanding from it
Get leader pos, get position offsets via vectorDiff
^^
Move leader move other units and apply saved offsets.
This should lead you into right direction. It's not a hard script to write.
almost 4am here. Glhf
I'm having trouble with this code and getting an error that says missing {
{
_x unlinkItem "NVGoggles";
}
foreach allUnits;
};
yea it's not hard but i hoped there would be a shorter way to do it
@sage flume what is the full script, because there seems to be stuff missing...
if it's too long please put it on pastbin, otherwise use ```sqf code ```
well I'm porting another mission and it's very complex. I was told by the author to just put it at the end of the "MainLoop.sqf"
may not be an easy question to ask I suppose
is there a way to check if two variables reference the same data?
{
_x unlinkItem "NVGoggles";
} foreach allUnits;
this is correct (without the extra };, unless that's a part of the code before it)
@stuck musk except for checking if they contain the same data, no
oof
in that case there's a }; too much in your code
I'll paste a bit before and after it so you can kinda see
_ww2cPos = position player;
[] call RYD_WW2B_AnimalsLoop
};
//[] call RYD_WW2B_Sfx;
[] call RYD_WW2B_Flyby;
[] call RYD_WW2B_Smokes;
};
{
_x unlinkItem "NVGoggles";
}
foreach allUnits;
};
//diag_log "------END OF MAIN LOOP------"
};
THats just the very end of the file with stuff on either end of my NVGoggle issue
again... there's a }; too much somewhere, so I suggest counting the { and } and make sure they are equal
lol, I've been looking for hours but I'm just to old to get it, Ha
at least youve given me a hint
I'll mess with the };
counting brackets since 2001 ๐คฃ
and programming for a long time, and it's always something too much or not enough
so uhm to get a list of all the units in the player's team is "members group player"? cuz it gives me a generic error in expression
https://community.bistudio.com/wiki/Team_Member and the help is not much useful
https://community.bistudio.com/wiki/units is what you're looking for
oh, right...
8 years of not arma scripting made me forgot too many things
thank you very much
np
switch ({"Param_SpawnPosition" call BIS_fnc_getParamValue; }) do {
// Elaborate value on include/params.hpp
case 0: {};
case 1: { [teamLeader] spawn FG_fnc_membersOffset; };
default { _enemyMinSkill = 0.40; _enemyMaxSkill = 0.60; };
};
FG_fnc_membersOffset = {
private ["_squadLeader"];
private _teamMembers = [];
{
_teamMembers pushBack _x;
} foreach units group _squadleader;
hint str _teamMembers;
};
No error but no hint either (i tried to hint "aaaa" but still no hint), what am I doing wrong?
(the "Param_SpawnPosition" call BIS_fnc_getParamValue; returns 1 btw)
private ["_squadLeader"]; must be params ["_squadLeader"];
yea and it was complaining about the {} in the switch statement too
well, not complaining, failing silently, but still
and why not do
_paramValue = "Param_SpawnPosition" call BIS_fnc_getParamValue;
switch (_paramValue) do {
that will prevent a lot of issues
so, now i have an array with all the units in the group and their vectorDiff of their position against the team leader, so i can move the team leader then move the other units after subtracting the member offset from the final position
Is this me or is this ArmA? On Stratis map, editor, play in MP - put into console: [[3421,6041,0], 30, 100, 12, 0, 0.25, 0, [], [3421,6041,0]] call BIS_fnc_findSafePos This will return only 3421 (number) and not a position [X,Y] (array). Removing the default position, returns world middle as [X,Y,Z].
Hey folks,
Need a hand with this, tried wrapping my head around it but just can't get it working, would appreciate any assistance.
private _routeMarkers_01 = [];
(calculatePath ["wheeled_APC","careless",_convoyStart_01, _convoyEnd_01]) addEventHandler ["PathCalculated",{
{
if (_forEachIndex % 10 == 0) then
{
_routeMark_01 = createMarker ["convoy_marker_01" + str _forEachIndex, _x];
_routeMark_01 setMarkerType "mil_dot";
_routeMark_01 setMarkerColor "ColorRed";
_routeMark_01 setMarkerSize [0.6, 0.6];
_routeMark_01 setMarkerAlpha 0.6;
};
} forEach (_this select 1);
}];
I'm trying to get the markers that are created inside the EH into the _routeMarkers_01 array so they can be deleted later. Tried different iterations of pushback but so far no luck.
Any ideas?...also apologies for the poor formatting.
Hi community , could you please clarify me some issue .
I play some mission with my friends more 5 hours and we want save progress .
But if i add in source mision enableSaving [true,true];
Not work fine went after started misiion logic mission crashed .
How i can save progress in server after restart ? ( i know mission AntiAltis save progress work fine )
before* restart
it depends on the mission, some work with databases.
if you use saveGame it saves on the server iirc, and this is useless if the server is a dedicated one.
You would have to use a specific script to save then
Is there a function to create ORBAT module by script ?
you can create all modules with createโฆ createVehicle or createUnit though, I don't remember ๐ค
want to avoid creating modules on map each time I create mission ...
Hi, so i am trying to set a spawn up that spawn a BTR, removes it gunner and makes it move between point A and B and once destroyed delete the wreck.
Now the question is, how do i define it? right now i am using the "doMove" function:
_veh = "rhs_btr60_msv" createVehicle getMarkerPos "truckspawn"; this doMove (getMarkerPos "movebtr");
right now, you only create the vehicle, not the crew.
this does not refer to anything
oh right, what would i need to refer to the crew when it spawns?
https://community.bistudio.com/wiki/createVehicleCrew
but you could use BIS_fnc_spawnVehicle, too
aight, that worked so far, but how do i make them cycle between point A and B now? google wasnt realy helpful
you can use a "CYCLE" waypoint
create one "MOVE" waypoint to "movebtr"
create one "CYCLE" waypoint to "truckspawn"
i want the BTR to spawn when activating a script (unlimited use) so i cant pre define the waypoint
so _grp will be the BTR name then?
sorry, what?
_wp name of the waypoint and _grp name of the vehicle to move?
that is an example, _grp is the group to which you want to add the waypoint
my group would be the vehicle in this case, right?
no, a vehicle is an object
group would be the crew's group
private _spawnResult = [getMarkerPos "truckspawn", getMarkerPos "truckspawn" getDir getMarkerPos "movebtr", "RHS_BTR60_MSV", east] call BIS_fnc_spawnVehicle;
_spawnResult params ["_vehicle", "_crew", "_crewGroup"];
_crewGroup addWaypoint (...)
``` @fervent kettle
thanks that worked so far, one last question, whenever i try to define the waypoint type it gives me an "undefined variable" error
how do you "define" a waypoint type
probaply the wrong word for that, happens in math to me too :P
however i ment this one here truckspawn setWaypointType "CYCLE";
so its giving you undefined variable error. Then I would assume.. That you have a... hm.. undefined variable? there?
I was that far too lol
where do you define truckspawn ?
it`s in a marker
Ah its a marker then
markers don't have variable names
and markers are not waypoints
you cannot setWaypointType on a marker
setWaypointType sets the type of waypoints
okay, thought i could just use it, how do i set the type of waypoint then?
you need to get the waypoint
From the snippet above, I think addWaypoint returns it
https://community.bistudio.com/wiki/addWaypoint yes it does
after reaching point A it just keeps driving into the nowhere, do i need to implement waitUntil or smth?
so I tried:
initServer.sqf
_module = createVehicle ["ModuleStrategicMapORBAT_F", [0,0,0], [], 0, "NONE"];
_module setVariable ["Path", configfile >> "CfgORBAT" >> "BIS" >> "O_Brigade", true];
_module setVariable ["Parent", configfile >> "CfgORBAT" >> "BIS" >> "O_Brigade", true];
_module setVariable ["Tags", [], true];
_module setVariable ["Tiers", -1, true];
but module is not showing
also tried:
_module = (createGroup sideLogic) createUnit ["ModuleStrategicMapORBAT_F", [0,0,0], [], 0, "NONE"];
_module setVariable ["Path", configfile >> "CfgORBAT" >> "BIS" >> "O_Brigade", true];
_module setVariable ["Parent", configfile >> "CfgORBAT" >> "BIS" >> "O_Brigade", true];
_module setVariable ["Tags", [], true];
_module setVariable ["Tiers", -1, true];
ok, so apparently variables need to be STRING, as function is calling call compile (_logic getVariable "Path")
so the second works for creation?
https://community.bistudio.com/wiki/createVehicle
For objects of type "Logic" use createUnit instead.
indeed
also createAgent works too
is there some way to convert
configfile >> "CfgORBAT" >> "BIS" >> "O_Brigade" to 'configfile >> "CfgORBAT" >> "BIS" >> "O_Brigade"' ?
str { /* code */ }
```_perhaps_ ๐ฎ
@real tartan see also https://community.bistudio.com/wiki/createUnit 's notes
Since A3 1.86 if you want to place a module with createUnit, you have to ensure that the module gets activated automatically by setting BIS_fnc_initModules_disableAutoActivation to false
@winter rose got that in code, just excluded part from it to deliver simpler example
okido - just to be sure ๐
does _name make the variable private automatically or do I still have to say private _name ?
as i am having some weird issues with the function
_ is the private definer, yes.
does _name make the variable private automatically or do I still have to say private _name ?
no it doesn't, yes you have to set private if you want it private
@bright flume _ makes the variable local, but not private
see https://community.bistudio.com/wiki/Identifier
โฆalthough it seems there is a mixup with private and local there too ๐
fixed
private keyword was called local in A2
yep
but _var variables are local vars, not always private
I also fixed global variable โ public variable
Finally, I have found it:
/*!
Base script class for all motorized wheeled vehicles.
*/
class CarScript extends Car
{
The Car Script!
ah...
sorry local == private to me...
xDD
spank spank
Yes it's in DayZ, I think the guy would be happy to know
hey dont blame me for BI decided to rewrite the rules...
https://community.bistudio.com/wiki/Variables i am reading this, it says that variables have to be = nil to be cleared up, is it also required for private ones or those are cleared when the function exit?
local ones are cleaned up when they go out of scope
would it be useful to specify it in the "Deletion" section?
Well it's stated that
A variable is only visible in the script, or function, or Control Structures in which it was defined.
So if it's not visible then it's reasonable to assume that it has been cleared up... and it's like that pretty much everywhere else
But in arma world it's generally good not to assume anything ๐
not visible does not mean not allocated
yep, a clearer message could do indeed
i can launch a while inside a function and create a variable that is 15GB large and it would still not be visible outside it
anyway, #community_wiki ๐ hehe
the "cleanup" part will be changed someday soon\โข
if Ded' can confirm where the cleanup happensโฆ exit of the scope, or exit of the script?
wish they just followed java's terminology...
Mhh?
https://marketplace.visualstudio.com/items?itemName=billw2011.sqf-debugger this project looks very promising, it would be fantastic if BIS had a native integration tho
BI once had a native integration, got removed because a hacker missused it
but its basically as good as native one would be
heh it would be nice to have it and require, like this one, that battleye is disabled to use it
Well what would be the difference if I just take mine, and slap a BI sticker on it? ๐
Same thing
it's Official\โข
and not {{unsupportedTool}} ๐
(also, you may lose your copyright in the process ๐)
@flat elbow there is also sqf-vm ๐คซ
sqf-vm is imho not comparable at all
it has a ||very outdated(I must update it)|| VSCode plugin
the main difference would be that it would be native (ie no mod add required), supported, probably also more widespread as more people would use it, etc.
Sqf-vm has arma.studio Integration
And just lacks people to implement operators (with the most common already implemented)
it lacks the ability to test the script in a real scenario with all the mods and people on the server and units positioned mods etc.
after all it's a VM
SQF-VM is hands down the best for linting and automated testing on CI
Its preprocessor found so many bugs in ACE that noone noticed
oh yes, and this โ๏ธ its compiler reports even more errors than arma
i wonder why people don't all converge on one set of tools and improve it like it's done with ACE and CBA instead of developing parallel projects that mostly overlap
@flat elbow so something, no Tool ever can give you, to Show User errors?
nono i mean this https://community.bistudio.com/wiki/Category:Community_Tools
12 code editors, 9 debug consoles, 4 SQF debug tools, 14 addon creation
There is one debugger, one profiler, and one emulator. They are all very different things
Debug consoles weren't integrated into the game in Arma 2 and older, which is why people made some
Different editing tools because there are different editors, and different types of tools, they aren't all the same thing
HAH
โฆpwetty pwease? OwO
So many 'code editors' are because there are many IDEs for which these plugins are made. But why people were making own code editors I don't understand much myself, apart from the reason of fun
for the glory of Satan, of course! ๐ฅ
yes!
i understand syntax highlighters, what makes my nose itchy is the lack of a standarized toolset of development for A3
like, i'd expect a "here is our IDE, you connect it to A3 like this, you interact with it like this, click here to see variables, click here to put breakpoints, here is the stack, here is to pbo the directory etc.etc.etc." and as a side project people create their own things for fun (for example for notepad++ or VIM or whatever)
I guess there should just be a 'latest tools for arma 3' page, because for instance the one you have listed above lists tools for all arma games
although... it can sort by game
it would help but the best would be a standarized toolchain
so we can just focus on creating content and code and not fight the custom toolchains too
for something 'standard' there should be some central authority, and there is no such person in the community of course ๐
everyone has his own favourite IDE, favourite pbo packer, etc
Make a DevTool CDLC
like now i am trying this addon for visual studio code and it stopped doing any breakpoint
๐คทโโ๏ธ
well... the case for debugger is special, it's the only debugger and therefore the best we have
I'd understand your argument if we had >1 ๐
i agree with you but we do have a central authority, BIS
that's why I said an official toolchain
....aand what do you expect them to do? to tell everyone to use a specific pbo tool for instnace?
ah ok, well there is one for DayZ
which is far better than std tools for arma 3 (in terms of scripting at least, not aware about models and such)
to tell everyone to use a specific pbo tool for instnace
they are already doing that. Didn't work
no, i'd expect to have an IDE with a built-in connection to A3 engine and all the toolset we need to develop content (and we already have some of them, there's A3 tools in steam, but it lacks an "official" IDE with a native connection for debugging)
okay, well in dayz there is such thing and it really works...
I doubt anyone will make one for arma 3 now
but for the next game, it looks like we'll have it ||finally||
trust my word ๐ took me a day to make the debugger work but it does work nice
and the for code is good enough
wanna hear how long it took me to make it work? HAH
idk, 10 minutes?
well it took me two days, I think ๐ until I figured out how TF it resolves paths
i mean, it can be bad, but it's at least something that we can improve on
which to my eyes is a better stance than having something some poor guy made and hope it gets updated with the news and gets fixed and gets features
and it does not get dropped the next month because the developer of the community tool stopped caring about it or does not play anymore
well ideally community should have same tools as game developers...
Or better ๐
such thing never made a game successful, we all know what happened to the Source engine
oh wait... ๐
Or better ๐
Haha... ha... ha? ๐ค
aren't BIS developing a new engine? i remember such a rumor
well it's part of dayz now
The correct abbrev is "BI"
Yes but they not-so-recently shortened the abbrev to BI. Because BIS is Bohemia Interactive Simulations
mmh it rings some bell in my memory about a skype conversation with one of the guys in the studio that told me something similar
Well... There is arma.studio... But it never gained traction so loads of stuff still missing + me rewriting mayor parts to make it easier to maintain
But it was the attempt to make it THE arma ide
arma.studio?
You can't yourself outdo MS and their VSCode in this field IMO
well because it has everything and you can make a plugin for it easily...
Arma.Studio is a scratch built IDE, was the first to have Arma debugging support, had syntax highlight and some linting, ability to have a integrated UI Editor.
But... Why spend weeks/months building a new tool, when you could just combine 3 already existing tools together and use that instead.
Might aswell make a plugin for vscode to add the UI Editor, Linting and syntax highlight plugins already exist, debugging plugin too, and tons of other plugins that are useful for developing are available too
So why make a completely new IDE instead if you could use a existing one, and add the rest with plugins
i agree with you, it could leverage VSCode, i'd expect a "here is BI plugin with native debugging integration to A3, install VScode, install it and go cry play with SQF!"
Well... ๐คทโโ๏ธ๐คทโโ๏ธ Wanted to integrate a ui editor too
Hard to do with a Code Editor
does anybody know how GUI_GRID_X etc are defined? I can return safeZoneX but can't find out how to get the value of GUI_GRID_
asking because I am trying to dynamically align dialog controls to others via scripting
Hello all, just a quick question. Is there anyway to do a
headgear _player isKindOf ['_x', configFile >> 'CfgWeapons'];
so if it is true then return it false? like isNotKindOf
Sure, simply I am wanting to use a reverse version of isKindOf. So if it isnt what I want it to be then show etc. I am doing RHS Helmets and using isKindOf to prevent all these helmets appearing through the class they all inherit off
if that makes any sense
!(headgear _player isKindOf "") ?
We're working on a custom scripted mission and he was testing his function, all worked fine
Okay sorry, anyway. My guy went to the toilet, came back and changed a couple of settings in his function
all of a sudden the console doesn't want to run the function
like calling the function doesn't do anything
compile error somewhere i'd say
the function recompiles and he can see it in the function viewer
no errors popped in both compiling and calling it
try [] spawn {call myfunction} in debug console
without spawn it runs unscheduled, which hides undefined variable errors
maybe something exitWith'ing the function then ยฏ_(ใ)_/ยฏ
Idk, it's so weird
Dedbooper, thanks mate all good now
is this correct (I'm new)
{
_x unlinkItem "NVGoggles";
}
foreach allUnits;
};
I keep getting an error
missing {
thought so,...?
hmmm]
Aside from the consistant error I still spawn with them on
well note aside but rather still can't get it to work
I feel like I saw this code beforeโฆ ๐
yup, just not working and I wanted to double check
for anyone wondering about my issue: He accidentally added an { somewhere in the code and it completely borked everything without any error
@winter rose what big eyes you have, lol
so, when you copy paste say from a forum post, how is it that you could a hidden charactor
copying script that someone might post that is
because the forum is broken
Hey. My function call in multiplayer doesnโt work, which is called respawn unit.
It works.
[this,"opfor","opfor_squadleader"] call SerP_unitprocessor;
This does not work.
params ["_unit", "_corpse"];
[_unit, "opfor", "opfor_squadleader"] call SerP_unitprocessor;
}];```
My "description.ext"
```class CfgFunctions
{
class mis
{
class Main
{
file="mis_funcs";
class preinit
{
preInit=1;
postInit=0;
};
};
};
};```
Changing the value of "postinit = 1" does not help.
As I understand it, the function is called only at the start of the mission and it cannot be called during the mission. What can I do about it?
like now i am trying this addon for visual studio code and it stopped doing any breakpoint
@flat elbow I haven't seen this problem. The only problems I know are that breakpoint line can be wrong (Arma preprocessor does not generate correct line numbers), and sometimes step function will stop working, although breakpoints will still be hit. What exactly did you see?
@lapis ivy your CfgFunctions doesn't define a function called "SerP_unitprocessor"
It works, but only when starting a mission. All units are given inventory. It also works in a network game, but on the server the function does not seem to be called.
I use the Serp platform
It's mod
My File folder missions
mission/mis_funcs/fn_preinit.sqf
Serp_unitprocessor = compileFinal preprocessFileLineNumbers "Equipment\unitprocessor.sqf";
mission/Equipment/unitprocessor.sqf
_faction = _this select 1;
_loadout = _this select 2;
_item_processor = {
removeAllItems _this;
removeAllWeapons _this;
removeAllItemsWithMagazines _this;
removeAllAssignedItems _this;
removeUniform _this;
removeBackpack _this;
removeGoggles _this;
removeHeadgear _this;
removeVest _this;
};
if (!isServer) exitWith {};
_unit call _item_processor;
_svn = format ["SerP_equipment_codes_%1_%2",_faction, _loadout];
if (isNil _svn) then
{
missionNamespace setVariable [_svn, compile preprocessFileLineNumbers format ["Equipment\%1\%2.sqf", _faction, _loadout]];
};
[_unit] call (missionNamespace getVariable [_svn, {}]);```
you should use the MPRespawn EH from the server only (and ideally remove it from init field)
@lapis ivy
@ebon ridge simply, i opened VScode on initServer.sqf and put a break point at the first line
Do I need to use remoteExec?
i was in editor with the mods enabled (RHS+ACE3+CUP+NiArms+CBA, some compatibility mods like for CUP to ACE3 from NiArms to RHS etc. etc., Spatial Sound mod and JSRS for them and the required mods to use the debugger) and i started the mission both in multiplayer and in single player, yet no break point was hit
then i exited the editor, opened it again, loaded the mission, launched it in SP, it hit the breakpoint, i said "continue", arma freezed
tried to detach the debugger and reattach it, no luck
had to kill arma3 process
player addMPEventHandler ["MPRespawn"...?
params ["_unit", "_corpse"];
[_unit, "opfor", "opfor_squadleader"] call SerP_unitprocessor;
}];```
then i exited the editor, opened it again, loaded the mission, launched it in SP, it hit the breakpoint, i said "continue", arma freezed
@flat elbow Oh okay, I have never had this happen, can't say what the problem is either. I'm using the workshop version of ADE, and intercept, and my released version of the debugger plugin. However pretty much all my breakpoint work is done in scheduled code, I don't work in unscheduled at all, so that is not tested much by me.
@lapis ivy if you insist on using the init field:
if (isServer) then {
this addEventHandler ["MPRespawn", {
params ["_unit", "_corpse"];
[_unit, "opfor", "opfor_squadleader"] call SerP_unitprocessor;
}];
};
is it possible to tell the AI to not shoot at a specific target (eg the helicopter) but still shoot at everyone else (eg. the players when they get out of it)?
yes, with setCaptive @flat elbow
"If unit is a vehicle, commander is marked."
that means they will still shoot at the helicopter?
@winter rose Does not work ๐ฆ
@flat elbow nope
@winter rose maby "addMPEventHandler"?
woops, yes
Ok, i'll try now
@winter rose This does not work...
this addMPEventHandler ["MPRespawn", {
params ["_unit", "_corpse"];
[_unit, "blufor", "blufor_squadleader"] call SerP_unitprocessor; }];
};```
remove the if (isServer) part, since it needs to run on all machines, especially respawn
nonono, it is added to all machines but only triggers where the unit is local.
so remoteExec it is @lapis ivy
unless it's 100% certain that this is always local to the server
gn
How do I properly run this using remoteExec?
this addMPEventHandler ["MPRespawn", {
params ["_unit", "_corpse"];
[_unit, "blufor", "blufor_squadleader"] remoteExec SerP_unitprocessor; }];
};```
?
quick question , is the only way to make a timer with sleep?
or waitUntil
Wrong chat
@tough abyss i don't understand?
Basically I have NO idea how to script and have been looking for a developer for the last past 3 days just been having difficulty getting help
what you struggling with
sqf is basically just a place where you write what you want to happen in code and execVM the script via a trigger or what not
sqf is scripts
Like I have so many ideas and not being able to make it is super frustrating
okay hang on ill PM you
@lapis ivy ```sqf
// no "if isServer"
this addEventHandler ["Respawn", {
params ["_unit", "_corpse"];
[[_unit, "blufor", "blufor_squadleader"]] remoteExec ["SerP_unitprocessor", -2];
}];
@winter rose
This does not work.
How do I do cfgfunctions correctly?
I already have it:
{
class mis
{
class Main
{
file="mis_funcs";
class preinit
{
preInit=1;
postInit=0;
};
};
};
};```
fn_preinit.sqf
Serp_unitprocessor = compileFinal preprocessFileLineNumbers "Equipment\unitprocessor.sqf";
it is unitprocessor that you should functionise
{
class myTag
{
class myCategory
{
class myFunction {file = "myFile.sqf";};
};
};
};```
For such an example?
see https://community.bistudio.com/wiki/Arma_3_Functions_Library for documentation
ugh,i am a bit dumb right now. i am using BIS_fnc_holdActionAdd for an action assigned to the player -- but it is only supposed to show if the player is in x distance to the object.
now the thing is, i am actually adding multiple actions for multiple objects ... but i only want to use one script of course
and now for some reason i can't figure out the correct condition to make them show up
if it would be only one object, of course i'd simply check for that one object and be done
is only _target and _this working in the conditions?
pretty sure i'm just doing something simple in a complicated way
well, not much to show
adding it: [a_cm01] spawn fn_cm_HoldAction;
argument 1 is _object
(so a_cm01)
then the hold action condition: (_target distance2D _object < 5)
so i'm prett sure _object simply doesn't work in the condition here
you are not using BIS_fnc_holdActionAdd here ๐ค
then the issue may be inside fn_cm_HoldAction ยฏ_(ใ)_/ยฏ
https://community.bistudio.com/wiki/BIS_fnc_holdActionAdd
conditionShow: String - Condition for the action to be shown.
Special arguments passed to the code:
_target (action-attached object)
_this (caller/executing unit)
yup, mentioned it above
so why not _this distance2D _target?
or you want that once the object is close to the other, the action appears?
i have multiple objects which once the player is close to them, will enable the hold action
the player does not have to look at them (it's an area), which is why i made the player _target
otherwise the player would have to look at the object
_object is indeed not known to conditionShow
then _this distance2D _target
then it shows up always
because the player is the action-attached object and the caller
i feard such
can't pass arguments to condition, I think
you could do one global var with array of objects and check, so you only add one action
i think i will make a trigger area and set a value in a variable. then i will check if the player is in the trigger and read out the value
hm
how do you check an array in the condition?
still working on it. found another issue just right now
yes, works. thanks for the help
ok now i have other issues. looks like this isn't really how i can do it
i need to know which object the player is close to and then change the action text + code that runs
the code shouldnt be much a problem. just have to check where the player is closest to. but the action text ..
maybe i should just add the action whenever the player is close, and remove it when he is away.
that would be easier, else you would have one script that deals all the text messagesโฆ it's better to split one object = one text message I think
that, or add the text as a parameter, or a variable set on the object maybe?
ok, trigger worked.
doesnt look as fancy, but who cares i guess
player walks into trigger -> add action, save action id. player leaves trigger -> remove action based on saved id
the important thing is it works!
the worst code in your life so far! ๐
indeed
Im trying to do
if (not canMove _BTR60) then { {_BTR60 deleteVehicleCrew _x} forEach (_BTRcrew _BTR60); deleteVehicle _BTR60; };
but it gives me a missing ) error
thought i had to name both, crew and car
no, see https://community.bistudio.com/wiki/forEach
forEach crew _BTR60
crew is a command, not a variable
ok, worked, but the veh wont get deleted
with deleteVehicle it should
but it somehow doesnt :/
paste your code please?
```sqf
your code
```
private _RHSBTR60 = [getMarkerPos "truckspawn", getMarkerPos "truckspawn" getDir getMarkerPos "movebtrA", "RHS_BTR60_MSV", east] call BIS_fnc_spawnVehicle; _RHSBTR60 params ["_BTR60", "_BTRcrew", "_BTRcrewGroup"]; _BTR60 setVehicleAmmo 0; _BTRcrewGroup addWaypoint [getMarkerPos "movebtrA", 0]; if (not canMove _BTR60) then { {_BTR60 deleteVehicleCrew _x} forEach (_BTR60); deleteVehicle _BTR60; };
```sqf
your code
```
with 3 ยด ?
as I posted.
ยดยดยด
private _RHSBTR60 = [getMarkerPos "truckspawn", getMarkerPos "truckspawn" getDir getMarkerPos "movebtrA", "RHS_BTR60_MSV", east] call BIS_fnc_spawnVehicle;
_RHSBTR60 params ["_BTR60", "_BTRcrew", "_BTRcrewGroup"];
_BTR60 setVehicleAmmo 0;
_BTRcrewGroup addWaypoint [getMarkerPos "movebtrA", 0];
if (not canMove _BTR60) then
{
{_BTR60 deleteVehicleCrew _x} forEach (_BTR60);
deleteVehicle _BTR60;
};
ยดยดยด
i dont get it man
```
private _RHSBTR60 = [getMarkerPos "truckspawn", getMarkerPos "truckspawn" getDir getMarkerPos "movebtrA", "RHS_BTR60_MSV", east] call BIS_fnc_spawnVehicle;
_RHSBTR60 params ["_BTR60", "_BTRcrew", "_BTRcrewGroup"];
_BTR60 setVehicleAmmo 0;
_BTRcrewGroup addWaypoint [getMarkerPos "movebtrA", 0];
if (not canMove _BTR60) then
{
{_BTR60 deleteVehicleCrew _x} forEach (_BTR60);
deleteVehicle _BTR60;
};
oooh
and edit to add "sqf" after the first one (and line return)
see the pinned message in this channel, it helps having colours
aaah right
perfect ๐
now! you did forEach _BTR60 , which is wrong
and your code does what you tell it to do - the created vehicle can move, therefore it is not deleted
but itยดs not canMove and once i destroy it, it still doenst disappera
your code says:
- create the vehicle
- if the vehicle cannot move, delete it
your code should be
- create the vehicle
- once the vehicle cannot move, delete it
so you could do```sqf
_BTR60 spawn {
params ["_vehicle"];
waitUntil { sleep 1 ; not canMove _vehicle };
{ _vehicle deleteVehicleCrew _x } forEach crew _vehicle;
deleteVehicle _vehicle;
};
aah thanks ๐
I created a script to spawn cars along road. I look for road segments and then align the car along it. Works perfectly. The road segment object ID looks like "166135".The problem is that the road may go over a bridge and the segment object ID looks like "70078: bridge_01_f.p3d". Spawning a car on the bridge results in explosion or other things. Looks like the car is spawned under the bridge. Any ideas how is could check if the segment is regular road or some other object like bridge?
Using isNumber or parseNumber does not work.
Answering to myself : count (str(segment)) for roads is 8. So anything else I consider a non-road.
How to prevent enemy from spawning (populating) outside of map area?
I'm porting a mission so if there might be a setting in his code somewhere, could I search there or is it a "perimeter" issue?
Is there anyone who could spot the error in this? Its killing me.
addAction ["Heal",{[objNull, player] call ACE_medical_fnc_treatmentAdvanced_fullHealLocal;}]
I'm trying to set up a scrollwheel menu option to fully ACE heal someone
what are you adding the action to?
ACE_medical_fnc_treatmentAdvanced_fullHealLocal that function doesn't exist
its
ace_medical_treatment_fnc_fullHealLocal and it only takes one argument
https://github.com/acemod/ACE3/blob/master/addons/medical_treatment/functions/fnc_fullHealLocal.sqf
Hello everyone! Do you guys recall any existing fast body looting script? I mean the system which will transfer all rifles, gear, ammunition from near dead bodies to a vehicle for example
Its quite hard to google this, everything i find leads to dayz-wasteland loot placing systems
does it exist?
i dont know, i just imagine it will take time to write the new one from scratch so tried to find existing beforehand
So arma sometimes gives combinations of certain guns and attachments a different classname than the normal gun. Is there any way to disable this? (I'm not counting on it) Or is there any way to make a gear restriction script work with this? I'm currently using the following code:
private _weapons = weapons player;
_weapons = _weapons apply {toLower _x};
{
if (_x in _weapons) then {
private _found = false;
private _weap = _x;
{
if ( toLower(_x) find _weap != -1) exitWith { _found = true; };
if ( _x isKindOf _weap ) exitWith { _found = true; }
} forEach KP_liberation_allowed_items;
if (!_found) then {
player removeWeapon _x;
_removedItems pushBack _x;
};
};
} forEach _weapons;```
But that doesn't work as intended, some items that should be allowed are still getting through
recall got me confused; better say "know of any" :)
@wispy cave to get the base weapon (so without attachments etc) you can use BIS_fnc_baseWeapon
thanks im not native speaker
@wispy cave i used next config parent for that case, just find out propper config parameters to check for your case (for example, no linked items)
huh looks like there is nice bis function already
thanks, I'll give that a shot
the direct parent might cause issues for modded stuff, eg. I have weapons which inherit a config with attachments, so it would break in that case.
do note that the baseWeapon does require properly configured weapons, so might not always return the correct version for messed up mods
but it's a good start for vanilla, CUP, RHS, etc.
for now I'm just using vanilla and RHS so I should be good, gonna test it in a bit
I am very new to scripting, how would I go about adding string to this?
hint str _unit "has been killed!";
hint format ["%1 has been killed",_unit];
name _unit prolly better?
Yea they both work, thank you โค๏ธ
Hey I don't understand what
displayName = $STR_SP_Reb_E;
this means
$STR_SP_Reb_E;
sorry, what?
a config entry that refers to $STRsomething is looking for a translation, usually located in a stringtable
Ill have a look
Yea but in my case I am trying to understand the Altis life framework xD
โฆoh
Hi, been trying to get this script to work on Dedicated servers. The EventHandler doesn't work I think, but not too sure.
[doubletap, true] remoteExec ["hideObjectGlobal", 2];
doubletap addAction
[
"Get Double-Tap",
{
params ["_target", "_caller", "_actionId", "_arguments"];
timeFiring = -1;
idPerson = _this select 1;
_sus = [] spawn {
doubletap say3D "open";
sleep 0.8;
doubletap say3D "swallow";
sleep 0.8;
doubletap say3D "break";
sleep 0.8;
doubletap say3D "belch";
idPerson addEventHandler ["FiredMan",{
params ["","_weapon","_muzzle"];
typeWeapon = _weapon call BIS_fnc_itemType;
switch (typeWeapon select 1) do {
case 'SniperRifle' : {timeFiring = 0.5};
case 'AssaultRifle' : {timeFiring = 0.5};
case 'Handgun' : {timeFiring = 0.5};
case 'Rifle' : {timeFiring = 0.5};
case 'SubmachineGun' : {timeFiring = 0.5};
case 'MachineGun' : {timeFiring = 0.5};
case 'Mortar' : {};
case 'GrenadeLauncher' : {timeFiring = 0.5};
case 'BombLauncher' : {};
case 'MissileLauncher' : {timeFiring = 0.5};
case 'RocketLauncher' : {timeFiring = 0.5};
case 'Cannon' : {};
case 'Throw' : {};
};
if (timeFiring isEqualTo -1) exitWith {};
(vehicle idPerson) setWeaponReloadingTime [(vehicle idPerson), _muzzle, timeFiring];
}];
};
if (timeFiring isEqualTo -1) exitWith {};
},
[],
1.5,
true,
true,
"",
"true",
5,
false,
"",
""
];
@lapis ivy my very bad;
it's ```sqf
remoteExec ["SerP_unitprocessor", 2]; // NOT -2
I know what it is just just know where it is to edit it
you have better chance on the L*fe Discord server @tough abyss ; see #channel_invites_list for its link
god this place looks scary, so where do i begin to learn this master's launguage?
the first steps would be detailed in here:
https://community.bistudio.com/wiki/Introduction_to_Arma_Scripting
basically, keep the wiki close to you and everything will be fine ๐
Hey, does every object act as it's own namespace?
Sorry, by it's own i mean it has it's own local namespace
more or less yes, except that terrain objects may be unloaded/reloaded, and lose set variables (iirc)
is there a limit for playSound3D how many sounds can 1 object emit ?
@winter rose thanks
not a coded one, but the sound source limit in your audio options @real tartan
I'm very much new to scripting in ARMA 3. I'm attempting to write a script which marks a task as complete once the player has opened the ACE arsenal menu.
this addEventHandler ["ace_arsenal_displayOpened", {
["Task2","SUCCEEDED"] call BIS_fnc_taskSetState;
}];
This is currently in the init line of my designated ace arsenal box. Any help is appreciated as well as a link to the resource which helped you learn Arma 3 scripting.
addEventHandler is for engine eventhandlers, the ace one is a scripted eventhandler
to be exact a cba eventhandler
http://cbateam.github.io/CBA_A3/docs/files/events/fnc_addEventHandler-sqf.html
this is what you want
this will add a global eventhandler though, not one specific on that object
Hey guys, so i've got this idea in mind, but i've no clue how to do it.
So basically I want to place down a trigger, and whenever a BLUFOR player activates it an AI says something in chat. How would I go about doing that?
set the trigger activation type as you like and in the onActivation line use one of the chat commands
Thanks!
there are no examples
can I somehow get the displayName of a magazine if I have the magazine classname as string, e.g from getPylonMagazines? A naive getText (configFile >> "CfgMagzines" >> "FIR_ALQ99_P_1rnd_M" >> "displayName") failed
yeah, looks like configClasses works:
systemChat str "(configName _x) isEqualTo 'FIR_ALQ99_P_1rnd_M'" configClasses (configFile >> "CfgMagazines")
for my custom main menu background scene , I have a camera created by bis_fnc_camera a little distance away from the TV (as there is other stuff in the scene)
now the problem comes with the UAV live feed displaying on the target giving a white screen on the TV while the camera created works , but if the camera that is created does not exist the UAV feed works
initIntro.sqf
/* create camera and stream name */
private _camera = "camera" camCreate [0,0,0];
_camera cameraEffect ["Internal", "Back", "uavrtt"];
_camera camPreparePos (getPosATL drone vectorAdd [0,0,-1]);
_camera camPrepareFOV 0.1;
_camera camPrepareTarget tgt;
/* switch cam to NVG */
"uavrtt" setPiPEffect [0];
_camera camCommitPrepared 0;
/* apply render */
tv1 setObjectTextureGlobal [0, "#(argb,512,512,1)r2t(uavrtt,1)"];
[
//--- Spec-Ops Briefing area
{
["InitDummy",["Altis",[10906.5,12117.3,1.86901],320.376,0.75,[-19.7727,0],1.75474,0,1120.02,0,1,1,0,1]] call bis_fnc_camera;
setviewdistance 600;
}
] call BIS_fnc_initWorldScene;
can anyone see why?
jeez, simple typo, CfgMagzines instead of CfgMagazines, this one works: getText (configFile >> "CfgMagazines" >> "FIR_ALQ99_P_1rnd_M" >> "displayName")
jeez, simple typo, CfgMagzines instead of CfgMagazines, this one works:
getText (configFile >> "CfgMagazines" >> "FIR_ALQ99_P_1rnd_M" >> "displayName")
@round scroll hate it when thats why you pull your hair out
"there are no examples" - except for the one after "Examples:" i guess.
where?
if we are talking about https://community.bistudio.com/wiki/BIS_fnc_missionSelector, ofc
@west grove?
oh this one indeed
it is actually extracted from the function's header itself
which means the dev's documentation itself is invalid ๐
yeah, i guess it got changed at some point, but the note wasnt updated
what's missing here is the marker size as first argument
Iโฆ don't see "marker size"?
_missionChosen = [markerSize "m_map", getMarkerPos "m_map", _listOfMissions] call BIS_fnc_missionSelector;
this works.
you opened the function itself?
yup
:>
รจ.รฉ
okay okaaay
I'm on it ^^
if you can confirm, but I believe it returns a Number? @west grove
index in the list, I think
stupid me, it was written ๐คฆ anyway, better check than sorry
Is there a way to execute a code snippet on all clients, within a script executed on server only? For titletexts/hints as an example
@molten roost yes, remoteExec
@west grove better?
https://community.bistudio.com/wiki/BIS_fnc_missionSelector
much :p
correct though? ๐
ah. Thanks! Appreciate the hasty response!
looks good to me
hasty response in the middle of the night! ๐ฆ
Thanks for the feedback, Mr le "French Cat" mao
and now have I tested the code, and it works ๐
@winter rose which code?
https://community.bistudio.com/wiki/showUAVFeed does anyone know how this works?
the code from the missionSelector page I just filled :3
showUAVFeed uses PiP yes?
the code from the missionSelector page I just filled :3
showUAVFeed uses PiP yes?
@winter rose well done
if i understand UAVFeed correct it streams what the UAV sees
as for your issue, I believe that a camera filming a PiP screen is a no-go, BUT: you can place a player unit where you would want the camera to be, and disable its simulation, add vignette effect AND have the PiP on your screen ๐
how to disable crosshairs then xD
place a civilian
no weapons, no crosshair, no animation
why do we always make stuff stuipidly overcomplicated
ยฏ_(ใ)_/ยฏ
I'm trying to make a script where you point at an object, and do an action to "take a photo" of it. The script identifies the object you're looking at, how far away it is, and whether you've photographed it already. Here's the script: https://pastebin.com/0nNNDcg4
The problem: the second check in the sequence - determining whether it's already been photographed, by seeing if a variable is 1 or 0 - behaves as if it's 1 (photographed) even if it's the first time I'm using the action. As you can see, I'm using a default value of 0 when I check the variable, and in SP testing nothing else can be setting that variable, so I'm confused about what's happening.
Is multiplayer server list is some kind of "magic" listboxes too? Wondering if you can fetch players count data before connecting to a server.
Anyone knows if <delay> setFog [...] uses ingame time or real time for transitions? I.e. is <delay> affected by timeMultiplier?
@quartz pebble https://community.bistudio.com/wiki/setFog see Notes
Why does this not work:
fn_giveArr = {
_arr = [1,2,3];
<broken example - removed>
because you don't call the code.
_arr1 = { code };
โ
{ code } select 0
@eager stump ^
Sry, my example above is incorrect - I'm trying to reproduce the issue. Your comment is valid.
Oh, and thanks for answering my (stupid) question.
that is what for this channel is ^^
I was wondering how i can add an addAction to every playable char
so one player could activate another's action?
Naa more like every player has the option to call a single script, in this case healing
use addAction in initPlayerLocal.sqf then ๐
hi does anyone know how to make a dialog button attached to player's head??
dialog as in talking?
see https://community.bistudio.com/wiki/drawIcon3D @high horizon
but i cannot click on it @winter rose
you would then have to use a mix of selectionPosition, modelToWorld and worldToScreen! ๐
@high horizon ^
Does anyone have experience with extDB3?
I have quite a lot of web application experience, SQL etc, but not so much in Arma, and I'm trying to connect web application to mission file. If anyone could help, that would be amazing.
Something like this would work? Its just a preview
_posini = player selectionPosition "head";
_wortoscr = worldToScreen getPos _posini;
_button ctrlSetPosition _wortoscr;
@winter rose
no, because selectionPosition returns a position and you cannot getPos a position
private _headRelativePos = player selectionPosition "head";
private _headWorldPos = player modelToWorld _headRelativePos;
private _headScreenPos = worldToScreen _headWorldPos;
_button ctrlSetPosition _headScreenPos;
```@high horizon - use `private` and name your variables properly so you can read your code easily
Thx @winter rose
@winter rose
this addMPEventHandler ["MPRespawn", {
params ["_unit", "_corpse"];
[_unit, "opfor", "opfor_squadleader"] call SerP_unitprocessor;
}];
};```
Equipment/unitprocessor.sqf remove the line:
```if (!isServer) exitWith {};```
So on init server adds MP Respawn globally for that unit. When the unit respawns the event only gets called where the unit is local.
Your previous !isServer was stopping the equipment script, as the unit is not local to the server, but instead resides on the player( clients ) machine.
This was suggested to me on the BIS forum
if you remove isServer check, better remove "MPEventHandler" and just use the "Respawn" EH
I already tested on the server, this works. If there are problems, I will try to do it.
there might/will, as every connecting client will add an additional EH
wait I might have read that wrong, dismiss that.
anyway, if issues, sure go #arma3_scripting
What determines what is loaded first for a mod like what actually is loaded in terms of order (if multiple) or is there a specific thing you define as load point for all scripts?
yeah Im refering to inside just one like what is the start point for the mod itself example ace or alive... trying to work up a flowchart so I can track script execution logic
don't know what you mean by start point
first thing that runs is initFunctions which compiles all CfgFunctions and calls the preStart/preInit/postInit eventhandlers
the very first script to be run when a mod gets loaded and what/where is that defined.
most mods hook into one of these eventhandlers
ah okay
like if a mod uses preStart, its preStart will fire according to mod load order in requiredAddons/-mod
yeah its using cba so xeh pre/post are here
hey guys
so me and @winter rose have been trying to see why i get a white screen on a tv thats suppose to display a UAV live feed.
Lou managed to succeed and get it right and gave me his mission file which i only opened in editor (like im suppose to) but sadly when i ran the mission i got a white screen again.
/* create camera and stream name */
private _camera = "camera" camCreate [0,0,0];
_camera cameraEffect ["Internal", "Back", "uavrtt"];
_camera camPreparePos (getPosATL drone vectorAdd [0,0,-1]);
_camera camPrepareFOV 0.1;
_camera camPrepareTarget tgt;
/* switch cam to NVG */
"uavrtt" setPiPEffect [0];
_camera camCommitPrepared 0;
/* rotation loop */
[_camera, tgt] spawn {
params ["_camera", "_target"];
private _degreesPerSecond = 5; // ROTATION SPEED
private _clockwise = true; // COUNTER/CLOCKWISE ROTATION
/*
private _distFromCentre = 200;
private _altitude = 300;
private _startDir = 0;
*/
private _distFromCentre = _camera distance2D _target;
private _altitude = getPosATL _camera select 2;
private _startDir = _target getDir _camera;
while { sleep 1; true } do
{
private _angle = (time % 360) * _degreesPerSecond;
if (!_clockwise) then { _angle = -_angle };
private _pos = tgt getPos [_distFromCentre, _startDir + _angle];
_pos set [2, _altitude];
_camera camPreparePos _pos;
_camera camCommitPrepared 1;
};
};
/* apply render */
tv1 setObjectTextureGlobal [0, "#(argb,512,512,1)r2t(uavrtt,1)"];
/* "camera" settings */
player switchCamera "internal";
player enableSimulation false;
player hideObject true;
showHUD [false, false, false, false, false, false, false, false, false, false];
/* Post-Process */
private _vignetteEffect = ppEffectCreate ["ColorCorrections", 1501];
_vignetteEffect ppEffectEnable true;
_vignetteEffect ppEffectAdjust
[
1,
0,
0,
[0, 0, 0, 0],
[1, 1, 1, 1],
[0.299, 0.587, 0.114, 0],
[.75, .75, 0, 0, 0, 0, 3] // [a, b, angle, cx, cy, innerRCoef, interpCoef]
];
_vignetteEffect ppEffectCommit 0;
"Mediterranean" call BIS_fnc_setPPeffectTemplate;
can anyone see why this would not work on a different PC?
also this mission is run in the intro phase as its a scene
are you sure pip screens are enabled in the video settings?
yeah i set mine to ultra
then i dunno. if it works on a different computer but not on yours, i'd first assume it is your hardware
do other pip screens work? mirrors in cars, etc?
we checked, and yes
I asked him to run without mods and check game files too (done 100% w/o mods @gilded rover ?)
im running check files again while im not at my PC
ran without mods and still same issue
@west grove the diver screen of the T140 works (when you in soldier view and see the internal compartment)
weird
anyone willing to try the test mission? I can send a zip. (dm me)
How would I, when using ace3, reset someone's stamina?
lou, send me the package
we come to the conclusion thatโฆ this mission is HAUNTED
@winter rose how so?
yes, but only on the first start
after loading the mission again it always worked
so i am blindly assuming this has something to do with loading parts of the map ... dunno
okay i dont know wtf just happend , i move the civi closer and it works... xD
yup
but even if i move him back again / load a different map and do the same again... suddenly it always works, even from further away
yeah it works now , I really dont know how
@winter rose I owe you big time , thanks!
game file check or *(ar)magic*
you're welcome, let's hope it doesn't fail in the main menu!
oh boy , mak9ing me stress now , ill post update
you had to ginx it didnt you xD
so once i restarted my arma everything breaks
so i load your mission and everything works again
and now the PiP live feed works in the main menu
How can I correctly use the lock on using face identification for selected units?
_success = lockIdentity player;
I add this to all units in init?
Try lockIdentity this in the unit's init
If you have a list of the units you can put into an array, you can use a single forEach rather than many inits
Also, try not using init field
Why not? It should work fine if you're only doing a few selected units. Unless it breaks under JIP with this command, but I think remoteExec would solve that
It is somehow a "bad practice", and is used wrong 90% of the time
Init fields get rerun on every player's connection, so if you have a setDamage 0.5 to begin wounded, heal yourself then someone else connects, you get back to 0.5 damage
@hallow mortar ^
should be fine for this command though, unless you want to unlock the identity later
if isServer can take care of a lot of init problems, which is good enough if you're only doing a few simple things and don't want to leave the editor
which is why I said "try not"
if you know what you are doing, it is not that bad
for me it is a remnant of the past, and running code that does nothing because of bad locality (or does the same thing over and over again) should ideally be avoided
// Get the player UID
_PlayerUID = "76561198054271928";
//Prepare the Query
_query = format ["0:FETCHDATA:SELECT nation FROM roster_view WHERE armauid = %1", _PlayerUID];
//Query the Database
_nation = "extDB3" callExtension _query;
diag_log _nation select 2;
Sorry, addendum to my post earlier. I've got the database linked to the mission file now using extDB3. This above run in the debug console as 'Server Exec' works fine now and returns the nation of the player based on an external MYSQL database. Seems pointless, but it's just to prove the connection works.
My question as someone who's not really touched Arma scripting, is can anyone point me in the right direction on how I would for example add this functionality to a AddAction where a player can trigger it, but the script will execute the Query via Server Exec, and then perform some local action on the player, such as set a loadout.
My problem is more around the locality, I think. Sorry if this makes no sense!
Is it is simple as wrapping the callExtension in some Remote Exec?
Is it is simple as wrapping the callExtension in some Remote Exec?
you could do that
I didn't read the rest of the text and I won't so might not be the full answer
How do i make the player join an AI squad when he enters a heli?
Let`s say i have player A & B, both have an action menu attached but i dont want that they see the others, can i just say
player addAction ["<t color='#0ac6d2'>Heilen</t>", "heal.sqf", "player distance player <0.5"];
cause the last part looks horribly wrong
i don't know what heal.sqf does, but if u add the action locally for each player, you don't need any distance checks
like, if u add the action for player a on player a's machine, but dont add action for player a on player b's machine, player b won't see the action on player a anyway
how exactly do i do that? I just bumped that line into initPlayerlocal
what? you're asking for something else then
Nono, when i test it and use an AI i can see the option from a far distance
well that certainly wasn't clear enough in your initial question, anyway, https://community.bistudio.com/wiki/addAction take a look at radius parameter, that'll be what you need
can i send you a screenshot privatly to visualize it?
i mean you've described the "problem" you have in two different ways so far, and as far as i can see none of them are referring to what it actually is, i've answered them both, and gave you solution for the second one
maybe it helps you to understand a bit better what i`m trying to say
when i look away from the unit the "Heilen" option disappears, but i dont want that others can see it: https://steamcommunity.com/sharedfiles/filedetails/?id=2054561077
so, add the action only to that player then
rather than every player(what you're doing now)
naa, it just appears on playable chars, in this scenario i`ve taken over an AI and the "Heilen" option only appears only when i look at the playabler character
when i look away it dissapears
v1 engineOn true;
execVM "flyScript.sqf";
v2 engineOn true;
execVM "flyScript2.sqf";
How do i make the init.sqf execute both because it only executes the first one?
i am pushing a string to my array: MyArray = [localize "STR_MYSTRING"]; and it will save as ["here is my string"] instead of [localize "STR_MYSTRING"] ....anyone can tell me how to get around this? :>
what you're trying to do doesn't make sense
1/ store as "STR_MYSTRING" and then use localize on it
2/ store as { localize "STR_MYSTRING" } then call this
@west grove ^
i am doing 1 right now
problem is that i cant just do a quick debug "myest" because it will always look for a string to localize
no you aren't doing that, you're storing the return value of localize
nevermind, i'll deal with it somehow
it is for a remote execution I assume?
I just realised that because there is no hand-to-hand combat in Arma, all we do is remote execution ๐ ๐ ๐
just some testing around, nothing really important
i ~~probably ~~just have to think different
if you need a second brain, beep me up (we may find someone)
now testing the jamming stuff on dedicated server and of course it doesn't work at all. For SP I could tie into a per frame and second function setup by Yax for the F/A-18. But on MP with the WSO being in a remote plane (that is on the server), of course nothing works.
basically I need to run an eachFrame eventhandler for the WSO, sitting in a turret of the F/A-18
F/A-18 is an airplane iirc, but what's a WSO?
weapons system officer, the guy in the rear seat
the whole jamming exercise is meant to give those unlucky 2nd pilots something to do in MP ๐
ok another Question, i want to make an AI play an idle animation but whenever a player activates a trigger it plays a short animation and then goes back to its idle state
sorry im fairly new to writing scripts so i dont know where to start
see playMove and its list of moves on the wiki!
gonna try this hack: ```sqf
if (((assignedVehicleRole _unit) # 0) isEqualTo 'Turret' and _unit in _vehicle and _unit != driver _vehicle) exitWith {
// gunner treatment
js_jc_fa18_lastPshRunGunner = 0;
["js_jc_fa18_perFrameHandler","onEachFrame", {
params ["_vehicle"];
if(js_jc_fa18_lastPshRunGunner == time) exitWith {};
[_vehicle] call js_jc_fa18_ew_fnc_perFrame;
//run per second based _systems
if(time > js_jc_fa18_lastPshRunGunner + 1) then {
js_jc_fa18_lastPshRunGunner = time;
[_vehicle] call js_jc_fa18_ew_fnc_perSecond;
},[_vehicle]] call BIS_fnc_addStackedEventHandler;
};
gate animate ["bargate",1]
there might be an event handler for setting it close/open
this should do
this addEventHandler ["AnimChanged", {
params ["_unit", "_anim"];
_unit animate ["bargate",1]
}];
@echo yew
if it opens on the script, then change animate number to 0
np, it's a bit hacky and bodgy as it doesnt block you from doing it. But hoipefully it works
Hey how would I add more spawn points to one garage?
life_garage_sp = "air_g_1";
Hm I'm trying to script a tank firing its main gun at an object using
tank doWatch (getPos target);
tank fire ((weapons tank) select 0);
And it seems like the tank is firing, but it doesnt actually play the shooting sound/ creates the muzzle flash
Does anyone know why my mission doesnt insert vehicles on db on altis?
not without more information
There is no error on showscriptserror
Just i buy a car and when i save it on the garaje it doesnt appear anymore
there is no clue of the car
what about sql logs?
[01:20:38:458405 +02:00] [Thread 7596] extDB3: SQL: Error MariaDBQueryException: Field 'colorido' doesn't have a default value
[01:20:38:458530 +02:00] [Thread 7596] extDB3: SQL: Error MariaDBQueryException: Input: INSERT INTO vehicles (side, classname, type, pid, alive, active, inventory, color, plate, gear, damage) VALUES ('civ', 'pop_evox_bleufonce', 'Car', '76561198241514030', '1','1','"[[],0]"', '0', '584771','"[]"','"[]"')
maybe field "colorido" make this crash? @robust hollow
it is possible. fix it and try again.
What should i do? make a default value on sql ?
the error explains exactly what is wrong, and how to fix it
set a default value to the colorido field in your database
ok thx!!!
https://gyazo.com/81d5ffb46e53f738001f6cd669218866 https://gyazo.com/81d5ffb46e53f738001f6cd669218866
Hey guys looking for some help as my scripting knowledge aint the best. I am looking to make folding doors for a new fire station but am struggling to understand how to attach the second door, so it moves with the first one. Any help would be great.
@subtle timber might be a better question for #arma3_model or #arma3_animation if you tear apart the Liberty you can see how their sliding multipart doors work.
what was the issue again with CBA options not working with skipIntro/world=none used?
i think i've have had issues with ui events not firing without a world loaded. possibly related ๐คทโโ๏ธ
I seen that notated somewhere but I cant find it now I changed mine back and now I can configure addons on my main streen.
yep
one has to use uiNamespace in main menu
but curious what specific limitations they ran into
dunno just went looking for it cant find it now ugh... too late ๐ ยฏ_(ใ)_/ยฏ
the issue could be the cutscene intro VM blocks the regular missionNamespace or sth along these lines
I bet D knows. maybe just some types of scripts arent run without intro's allowed. /shrug
eyes discord warily...
I'm having some issues with assigning a custom CfgRank to a unit. I've tried both unit setRank "Cpt"; and unit setUnitRank "Cpt"; but still get the same error: Unknown enum value: "Cpt". Anyone got any ideas about why this is and a fix for this?
I've gotten the ranks to show on the ORBAT Viewer so I would imagine it is possible somehow.
@jaunty ravine
You'll probably find that the possible values for that command are hard coded in engine and are not reliant on classes inside CfgRanks
Ah, well, that sucks
Any guesses why this wouldn't work in an object's init?
I have a row of sandbags called "cornerbags" that I'm trying to anchor this box to.
this attachTo [cornerbags, [1.024, 0.197โฌ, 0]];
what does it do?
Throws up an error saying missing ]
then something else is wrong ^^
Which is why I'm asking here, 'cause as far as I can tell, that looks right.
Oddly, this works.
this attachTo [cornerbags];
if you -just- remove this attachTo [cornerbags, [1.024, 0.197โฌ, 0]];, is there an error?
No, no error without it.
is this the only stuff in the init field?
try 0 = this attachTo [cornerbags, [1.024, 0.197โฌ, 0]]; ?
no error on my side.
ah, I got your error
an invisible character after 0.197, as 0.197#, error message said
@vernal venture ^
Looks like adding 0 = works, too. Thanks.
no need for the 0 = - your issue was this char. yw
Via a script, is it possible to set recoil values of guns?
I think that has to be done via a config edit? Not quite sure though
https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3
Ctrl+F "recoil" โ setUnitRecoilCoefficient/unitRecoilCoefficient
Its need to be done there too @oblique arrow, but its not working for a few guns in RHS so yeah.
Although I'm looking more detailed changes of recoil instead of just a coefficent for all of its values @winter rose, I still appreciate it because I could use that as a patch for the bugged guns.
all the rest is config edit yes
Yeah exactly but that's okay.
Hello.
I am working with the HandleDamage EH (https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HandleDamage)
THe hitpoint print something like : hitface, hithands
I would like to access the class of these hitpoint to print the name of the part like "Face" or "Hands"
how can I do it ?
use getAllHitPointsDamage @compact maple
I'd like to print the real name of these part, like getting their names with cfg
what makes you think such "translations" exist?
so it doesn't exist?
I don't think so; these are internal model names/selection names, if you want translations you would need to make them yourself
Alright, I will, thanks ๐
any way to get a handle ID of a running spawn thread?
private _spawnHandle = [] spawn {};
Know that. But I have already spawned it๐
no can do
Hey folks, quick question
I've got a MP mission I need to spawn a destroyer and I want to assign it to a public variable in the mission
so that it's available to all clients if it makes sense
I was building the mission initially in the editor and it was all gucci when I put it in init.sqf, but Im wondering how to do it best for MP context
not the aircraft carrier, a destroyer?
TAG_MyPublicVar = createVehicle [โฆ]
publicVariable "TAG_MyPublicVar";
yes, of course
sweet, thanks
see https://community.bistudio.com/wiki/createVehicle for the syntax
https://community.bistudio.com/wiki/Arma_3_CfgVehicles_Structures
for the classes
awesome, thanks
I mean, Ive got the syntax already because Ive been executing it on the local side anyways
just wanted to make sure it's gonna be MP compliant
Btw since you're smart Lou, any chance you have an idea on how I can fix my issue with the the scripted tank firing from earlier
? (https://discordapp.com/channels/105462288051380224/105462984087728128/697940319102304307)
I am not smartz, my stupid is fast!
Fair
well ```sqf
tank doWatch (getPos target); // doesn't wait for the cannon to be aligned
tank fire ((weapons tank) select 0);
i was literally doing a similar thing for my mission yesterday
@oblique arrow try using aimedAtTarget > 0.9 ?
in a waitUntil, might do the trick
it's always tricky to make a unit fire at anything non-target
I mean it seems like the tank is theoretically firing (atleast the fancy CSAT dlc tank did the autoloader reload animation) but it just doesnt play the effects connected with firing
I used a default NATO "Merkava", it shot immediately
use fireAtTarget to trigger the boom immediately
perhaps it will do everything needed in the CSAT DLC tank
(also, please note that it won't fire if it is still loading the ammo)
[] spawn {
tank doWatch target;
waitUntil { tank aimedAtTarget [target, ((weapons tank) select 0)] > 0.9 };
sleep 1;
tank fire ((weapons tank) select 0);
};
```\*boom\*
This is odd
This is odd
@oblique arrow Welcome to Arma ๐
So I tried it with the Merkava in the mission and it works fine, tried it with the CSAT standard tank and it doesnt want to work, tried it with a modded CSAT tank and it doesnt want to work either
yeah thats true
it might be that ((weapons tank) select 0) doesn't return the main gun turret in the csat tank
I added a hint that gives out the return value of that and its
cannon_125mm so that should be the cannon @finite sail
thats the standard CSAT tank
you're right, it is odd
shouldn't it be a muzzle and not a weapon?
I tried it with the Merkava and it returns cannon_120mm
okay tried it with the AAF tank and it doesnt seem to shoot either
hint return is cannon_120mm_long
Nvm I rearranged the waypoints a bit and it did fire
muzzle
O___o
https://community.bistudio.com/wiki/weaponState
https://community.bistudio.com/wiki/currentMuzzle
@oblique arrow
muzzle may differ from weapon name
you say that like I know what that means
back to my multiplayer scripting problems. I have the code at https://pastebin.ubuntu.com/p/ph2MgwQ3S3/ showing me in the log that it is running, but nothing is displayed on screen: ```
15:11:01 "perFrameGunner: after display detected"
15:11:01 "perFrameGunner: after jamming check"
15:11:01 "perFrameGunner: doing stuff"
15:11:01 "perFrameGunner: setting freq 30000"
15:11:01 "perFrameGunner: setting freq 40000"
15:11:01 "perFrameGunner: setting freq 50000"
15:11:01 "perFrameGunner: setting vehicle O Alpha 1-2:3 REMOTE"
15:11:01 "perFrameGunner: setting vehicle B Alpha 1-1:1 REMOTE"
15:11:01 "perFrameGunner: setting vehicle O Alpha 1-1:3 REMOTE"
15:11:01 "perFrameGunner: setting vehicle O Alpha 1-3:3 REMOTE"
15:11:01 "perFrameGunner: after display detected"
15:11:01 "perFrameGunner: after jamming check"
15:11:01 "perFrameGunner: doing stuff"
15:11:01 "perFrameGunner: setting freq 30000"
15:11:01 "perFrameGunner: setting freq 40000"
15:11:01 "perFrameGunner: setting freq 50000"
15:11:01 "perFrameGunner: setting vehicle O Alpha 1-2:3 REMOTE"
15:11:01 "perFrameGunner: setting vehicle B Alpha 1-1:1 REMOTE"
15:11:01 "perFrameGunner: setting vehicle O Alpha 1-1:3 REMOTE"
15:11:01 "perFrameGunner: setting vehicle O Alpha 1-3:3 REMOTE"
that's from the client log
ok, the control is not ok: private _ctrl = _dsp displayCtrl _x; -> diag_log format ["perFrameGunner: ctrl is %1", _ctrl]; -> "perFrameGunner: ctrl is No control"
the dialog is up at https://pastebin.ubuntu.com/p/Zz8M9KBRmX/ and basically works, e.g. the interface is shown
maybe the whole idea to control the display/dialog from a per frame eventhandler is not sound?
"Draw3D" may be more suitable perhaps?
ok. Question left is why it works in SP and not in MP with the display stuff
that' s a big block of code, I'm afraid of it ๐
IDK, maybe your js_jc var are only defined server-side?
put systemChat to see if it fails at one point
he he, yeah, took a bit to write it. I've now put some debug msg in, that yield: ```
15:20:38 "perFrameGunner: after display detected"
15:20:38 "perFrameGunner: after jamming check"
15:20:38 "perFrameGunner: doing stuff"
15:20:38 "perFrameGunner: setting freq 40000"
15:20:38 "perFrameGunner: ctrl is No control"
so it can be isolated to these lines: sqf if (dialog and {alive _jammer}) then { diag_log "perFrameGunner: doing stuff"; { diag_log format ["perFrameGunner: setting freq %1", _x]; private _ctrl = _dsp displayCtrl _x; diag_log format ["perFrameGunner: ctrl is %1", _ctrl]; _ctrl ctrlSetTextColor [0, 1, 0, 1]; _ctrl ctrlCommit 0; } forEach (_jammer getVariable ["js_jc_fa18_ew_jamFrequencies", []]);
not sure why this fails in MP: private _ctrl = _dsp displayCtrl _x;
is it possible there is already another display using idd 70?
oh, that's a possibility, while I check isNull _dsp, let me see the log
i can find display 70 in a blank MP editor mission
yes, you are right!
the no display check fails only before mission start
thanks, I give that a try with a different idd
works, thanks a bunch @robust hollow !
๐
We have a custom loading screen, I have added progress bar and text box with the IDCs corresponding to the docs, the progress bar works but the text doesn't change from default, any ideas?
ctrlCommit is there?
not needed for https://community.bistudio.com/wiki/startLoadingScreen afaik?
however hidden in the comments it says confusingly In Arma 3 default loading screen has no control do display text. The description of the command now contains information what is needed to create custom loading screen resource.
Hey everyone,
So I have an idea for a mission script. I want to create a kind of timer that reads out the remaining time in digital format, instead of displaying it.
For example: timer starts at 40 minutes, and is ticking down. Let's say you push its button when there's 37:46 left on the clock. A voice will then read out the digits of the remaining time at the moment you pressed the button ( "three...seven...four...six" ).
In case that sounds weird, here's an example of a clock that has a voice reading out the digits of the current time, over and over:
https://www.youtube.com/watch?v=S7KNhBAAY10
Note: has to work in multiplayer. Doesn't need to be incredibly accurate.
Mechanically it doesn't seem very difficult. I could make a countdown timer that updates a global (local) variable. Somehow translate the seconds counter to digital format with simple math. Then make pressing the button couple ten possible different sound samples with four free spaces.
I guess my question is whether somebody has already done something like this before, so I am not making busywork for nothing. Anyone?
@acoustic abyss see my comment in https://community.bistudio.com/wiki/BIS_fnc_VRTimer
aaand I only read half of your question again.
as for the voice, it's no big deal - grab a voice generator,
and you can either spawn the script on every client, or remoteExec playSound
you may have to do it yourself yep.
I could probably have written that more efficiently ๐ , true.
nah it's me, lack of attention after work :p
Keeping it local is easiest since it doesn't have to be accurate to the second. By the way, I read that there are several "time" commands to specify client vs server time (of course). How much do they normally differ after an hour or so?
time gets synchronised regularly, afaik
if you want only one correct value, the server must have authority over everything else
see https://community.bistudio.com/wiki/Multiplayer_Scripting#Join_In_Progress (for time)
Of course! JIP.
Well in this mission there really aren't any JIPs. But I will have to change that. Public variables make my scalp crawl
Thanks for the tips.
just remoteExec should be enough, maybe
Cheers. And take a break from the phone bud ๐งโโ๏ธ
Hey guys,
Got a bit of a dumb question (probably). But I've been scratching my head for a while.
Essentially what I am doing is creating a loadout selector using addAction and switch statements. This is for a dedicated server. I have a script that creates 10 actions, one for each type of role. Upon clicking these actions I receive the kit I chose, and it works perfectly (and on the dedicated server too!!).
The problem I have encountered is with the initiation of the script itself. Ideally I would like to be able to put the script (something like nul = execVM "SupplyBox.sqf") in the init field of the object the players will interact with to grab kits from. This is simply because I have used the vertical blue locker as the object the players will interact with, and have lined a wall with lots of them. I don't want to have to reference a unique "variable name" for each individual locker.
I have messed around with _locker = _this select 0; and then reference the private variable _locker in the script with _locker addAction [etc]; but to no avail. The script doesn't recognise _this and I get errors. Classic noob maneuvre...
I'm asking you brilliant people what you think the best solution is to create addActions to every container, and to do so from the objects init field in the editor? Is this the most practical way? My init.sqf is already cluttered like crazy, I want to try and minimise the impact on the server at launch.
Cheers blokes!
alright gents, I've got a squad of players - player_1, player_2, etc. I have "enable damage" unchecked in 3den. Then I have a trigger which makes them vulnerable again. Works fine when testing in the editor, IE "play in multiplayer". When it doesn't work is when i pack the .pbo and run it on a dedicated server. So, I've tried "player_1 enableDamage false" in the serverInit.sqf. Still no dice. What am I doing wrong?
to be clear, the players aren't invulnerable on the dedicated server, but when testing through 3den they are
it appears that the variable names (player_1, player_2, etc) are not being carried over to the players in a dedicated environment
When you play in multiplayer in the editor its really self hosted mp so all globals are shared between the server and client without needing to call publicVariable. But you can also launch another client from the arma 3 launcher (select another profile) and it will act more like a pure client, so you can find MP issues there without needing to go to dedicated.
@spark rose enableDamage doesn't exist, though. (it's allowDamage)
yes i'm sorry Lou i have allowDamage not enableDamage
Okido (can't help but remove "stupid" errors out of the equation)
if you look at https://community.bistudio.com/wiki/allowDamage , the "aL" & "eG" mean that the argument must be Local, while the effect is Global.
usesqf [player_1, true] remoteExec ["allowDamage", player_1]; or```sqf
{ [_x, true] remoteExec ["allowDamage", _x]; } forEach [player_1, player_2, player_3, player_4];
thanks Lou, i will give that a try
Is there any way to fully suspend server equivalent to startLoadingScreen for SP?
@remote basin
in the init field:
[this] execVM "script.sqf";
```in script.sqf:```sqf
params ["_locker"];
@ebon ridge what do you mean?
Thanks @winter rose I got it in the end, it was the underscore that was killing me. Cheers!
Hi there,
I'm looking for a mod/script which allows players to load vehicles on others vehicles (eg. Load a quand onto an HEMTT)
Does anyone know a such script?
Thank you for you time and reading!
Regards
the recently-added HEMTT Cargo and HEMTT Flatbed can load vehicles natively
Don't suppose anyone with some experience using triggerAmmo could give me a bit of insight:
I'm looking at using this to clean up some of my functions for various fusing methods.
It works as expected with infantry weapons however, when trying the same method on a vehicle weapon, a tank/artillery shell for example (both shotShell) it appears to not work.
I mean something like freezing time basically.
disable all simulation, interactions, freeze time etc.
I'm writing something to do it myself now, just want to see if there is some functions to help or canonical solution
nothing native except enableSimulationGlobal forEach
kk thanks
@spark rose workz?
Yup @hallow mortar but I'm searching something more general which can work with modded vehs for instance
it can even with mod vehicles, depending on their mass/dimensions
now if you are looking for something like loading a tank on a quad, there is still attachTo ๐
@winter rose haven't tested yet - I'm the de-facto babysitter at the moment!
Actual vehicle-in-vehicle loading has to be built into the carrier vehicle to begin with, afaik. Some mod vehicles do support it, depending on whether the creator has set it up. (Any vehicle can be loaded into a configured carrier, mod or not, if it's an appropriate size and weight)
Any global solution to convert non-configured vehicles is going to be an attachTo bodge job and may need to be set up for each vehicle individually.
hi, anyone can link me a good guide to learn dialogs?
ask the peeps in #arma3_gui @polar anchor ๐
ty @winter rose
@winter rose It works for me. The poor AI guys still perish though...
do you execute this from the server?
yes, it's tied to a trigger that is evaluated on the server.
hi, how to disable vanilla action ? example : Inventory action
@spark rose should work ๐ค
@faint oasis perhaps mods
hmmmm
so the initServer.sqf i have this ''{ [_x, false] remoteExec ["allowDamage", _x]; } forEach [player_1, player_2, player_3, player_4, player_5, player_6, player_7, player_8];''
{ [_x, false] remoteExec ["allowDamage", _x]; } forEach [player_1, player_2, player_3, player_4, player_5, player_6, player_7, player_8];
is remoteExec not disallowing damage for the server ai guys when players aren't there?
it should send the command to the server, even if it is on itself
be wary that if a unit changes locality (a player joining or leaving, an AI unit joining a player's group) the command has to be repeated
it seems to be a result of me being the groupleader and bailing out (even though aircraft is destroyed) they ride it in to their deaths
so they are invulnerable, that's passed correctly. they're just not getting out of the a/c
ah, okay
AI making poor decisions in Arma? ๐ค
try a GetOut eventhandler that automatically ejects any AI in your vehicle when you eject?
@winter rose what is perhaps mods ?
to disable vanilla action
you can disable inventory thanks to event handler "InventoryOpened" (or intercepting the inventory key), but if you want to disable actions like healing, opening doors etc mods are required to do so
oh ok thx
hi, im trying to call a function but i get this error on mission startup: https://imgur.com/a/lD0djYi can anyone help me?
description.ext
#include "Functions.hpp"
};```
**Functions.hpp**
```class crimiloFunctions {
tag = "crimilo";
class Functions {
file = "functions";
class playerJoin {};
};
};```
**initPlayerServer.sqf**
```_player = _this select 0;
[_player] call crimilo_fnc_playerJoin;```
**fn_playerJoin.sqf** (located in functions folder, as specified in `file = "functions";`)
```private ["_player"];
_player = param[0];
hint format ["%1 joined", name _player];```
file = "functions"; sure thats correct? isn't that default?
private ["_player"];
_player = param[0];
no.
params ["_player"]yes
_player = _this select 0; no. Same as above, params.
what's the difference? from _this select index and params?
@hallow mortar haha spot on, when don't they make poor decisions?
@still forum i changed them to:
fn_playerJoin.sqf
_player = param[0];
hint format ["%1 joined", name _player];```
**initPlayerServer.sqf**
```params ["_playerUnit"];
[_playerUnit] call crimilo_fnc_playerJoin;```
but still get the error
you dont need _player = param[0]; you already made _playerUnit
file = "functions"; I think thats default so I think you can remove that?
removed _player = param[0] and file = "functions";
but they're not related to the error. i can't say that error tbh
everything looks fine
checked RPT for file not found errors?
no idea what u talking about ๐
@still forum why private ["varName"] NO and params ["varname"] YES?
@polar anchor RPT is the debug file, found here: C:\Users\USERNAME\AppData\Local\Arma 3
oh i see, thx @surreal peak ๐
because private array and private string are bad performance and almost always bad
you should use private keyword
but params already has it integrated
so why do 5 steps, if you could just use params and do everything in one step
also, underscore
Can you call an Admin Command in a Mission Init.sqf, and if so how would I go about doing that?
Looking to start a custom Fortify Preset for ACE, and it requires an Admin Command to make the preset available.
"admin command" ?
Per ACE 3:
If the Fortify module is present in the mission, server admins can use chat commands to set-up or change the different parameters. Useful to give players additional resources based on progress on the mission for example.
Yes. I know Admins can use commands. It is called in Mission via Chat command with:
Then you will have to set the mission preset to myMissionObjects with #ace-fortify blufor myMissionObjects to enable it.
I am asking if that chat command can be called via Init instead of having to have the Admin manually call it each and every time they want to use it in a mission.
Such as using the serverCommand function from here: https://community.bistudio.com/wiki/serverCommand
Doesn't the Fortify module have editor options to set up the presets?
Yes, but only for the included presets. To use a Custom preset you have to set up the preset in a description.ext file, then call it via serverCommand from an Admin user in chat.
We are trying to find a way to set it to automatically run that command on mission start instead of the Admin having to manually run it every time.
Try and thy shalt see
Biki 4:10
I feel like there should be a mission script command to do that without jury-rigging an automatic chat command, but you would need to look at the ACE documentation (or ask the ACE team) for that
@jaunty shadow what is the command the admions run?
#ace-fortify blufor myMissionObjects
myMissionObjects being the custom item preset.
yeah
should be able tyo do it with the acex_fortify_fnc_registerObjects


