#arma3_scripting
1 messages · Page 581 of 1
What should I be looking for? PboPrefix.txt seems to specify x\alive\addons\mil_ied
Then try and thy shalt see!
thou*
That didn't quite work for me previous time I tried it, but I shall certainly try again 😆 Thanks for advice
@loud python would "thy" stand for "yours" then?
thy is the possessive form of thou
I was positive I saw it as replacement of thou too, but until further verification I shalt be corrected
idk, people these days use them interchangeably if they want to sound fancy
I want to speak a proper Old English :p
_ctrl = (findDisplay 46) ctrlCreate ["RscStructuredText", -1];
_ctrl ctrlSetStructuredText parseText format ["<t align = 'right'>%1</t>", 1000000];
For large number it return 1e+006. How can I format it to be 1000000 ?
(did
isLocalizedwork?)
@winter rose I want to get list of string keys from game in first place to check if it localized, e.g."STR_BIS_key1", "STR_BIS_key2"
Is it possible to find the classname of the chosen role listed in CfgRespawnInventory? typeOf player returns the classname defined in the mission.
{
class OPFOR_1
{
vehicle = "O_soldierU_AR_F";
};
};
``` ... I'm looking for the vehicle info.
@real tartan you cannot
@real tartan see
toFixed
@winter rose works, thank you
BIS_fnc_numberText works too
Hey so, bohemia made a new engine, right?
partly, if you mean enfusion
does that still use SQF?
no if you mean enfusion
Is there any info in whether they will ditch SQF?
They already did
does enforce have no GC or what?
Enforce? Thats a different engine. Enscript has no GC no, refcounting.
BIS can we get Lua please?
What does BIS have to do with this? Enfusion is a BI engine.
@loud python
Is there a way to list all "string_names" from Stringtable.xml in game?
No, but here https://synixebrett.github.io/stringtables/
@real tartan
What does BIS have to do with this? Enfusion is a BI engine
BIS probably stands for bohemia interactive simulations, right? I'm just so used to writing that from function names that I typed the S without thinking 😄
Yes
Enforce? Thats a different engine. Enscript has no GC no, refcounting.
huh? if there's also an unrelated engine called enforce, then I don't mean that;
from the wiki:
Enforce Script is the language that is used by the Enfusion engine
That's what I was talking about
Enforce is a Engine, RV is a Engine. Enfusion is Enforce + RV + New Stuff
Enforce was made by Black Element Software
hmmm... well, as long as it runs better than arma 3 I don't care much about the engine itself
for me the relevant part is really just the scripting language
and from what I've seen, enforce script is... Let's just say it really makes me wonder what the thought process was
Is it possible to get real random weather? I mean can I disable the weather and weather forecast and instead make random weather by script?
yea
@robust hollow How about you give me a hind of how to achieve it?
totally random weather would be easy, but if you want it to be realistic, you'd have to add some more logic for that
@loud python Yeah, that's obviously the case. My problem is that I have no idea how I can set a random overcast forcast and random weather change times...
as in... you don't know which commands do that? if so, R3vo posted a link to the wiki page
you can just decide on the next weather parameters and how long the change should take, then call all the commands like _time setRain _rain, etc.
i have an oldish script that may or may not work
hey, is there a way to read a trigger object synched to another object?
i tried using _objects = synchronizedObjects _logic;
but that doesnt return the trigger, and synchronizedTriggers wants a waypoint as parameter, but i only have an objcet.
it is kind of hard to look at but im not going to fix it up
https://gist.github.com/ConnorAU/a95c61efb75279cfbe9e8fa361280ae3
Hi, everybody. I use the Zone Restriction module to restrict the game zone. I have three such modules:
First: it restricts all players from going outside of combat.
Second: restricts EAST to enter the territory of WEST
Third: restricts WEST from entering the territory of EAST.
But the problem: after killing the player and his respawn, the second and third stop working! And the restriction on leaving the combat zone continues its work perfectly. What is the problem and why can this be?
@robust hollow Do I understand the part in your script right that if you do a forced weather change the forecasted weather is executed after which you can add your own weather?
it forces clear weather when the script starts running, then it does smooth weather changes over the defined transition time
@loud python Isn't it true that if you only use overcast it autometically edits rain etc. realistically?
@robust hollow So how did you get rid of the forcasted weather and the default first weather change time that enforces said weather forecast?
there are settings in the 3den editor to disable weather options i think
idk, that script was written back in 2017 i think, so cant say what the whole setup was at the time.
@robust hollow Ok, still thanks for the help.
iirc changing overcast should change the other parameters too, but that can be turned off
I haven't scripted weather much, so I don't remember how exactly that works
might be a separate command, or a parameter or something
overcast, fog, rain, rainbow, lightning, wind
these are the settings you can edit
only one weather change at a time can happen, iirc
if all members of a group are killed, will the group return null or sth and cause an error when trying to be called?
e.g if you 3600 setOvercast 1 and 3600 setFog 1, only the fog will apply
this info may be wrong/outdated though
what safety measures do i use to prevent an errror when calling a dead group
@spark turret groups get auto-deleted after the death of the last members - not always immediately
you can check if the group isNull
thanks lou
Anyone able to point me towards a random side mission script? Found a few options but non of them really work, Ideally id use a version of Jigsor's side mission script, however, the Fnc's used are all over the place and super hard to understand xD
BIS_fnc_ambientAnim just doesn't work on MP, even following the guide in the comments. I don't see any reason why either really, but running via editor MP the server side client looks fine, another client connected has no animation on the units at all.
what is _radius = waypointLoiterRadius [groupOne, 1];
used for? do the units move around in that radius while waiting for its completion?
@spark turret same as the loiter waypoint in Eden
yeah just found out that type exists, gotta look into it
any way to increase the search radius for a "seek and destroy" WP for infantry? read in a forum its 50m standard, would like to increase to maybe 100
Hi. How do I use the "hint format" for each player separately? I only need to show the message for the player who is out of the zone.
I have:
Condition in the trigger: "this"
At activation:
hint format ["Вы нарушаете условности игры. Запрещено покидать зону боевых действий!", player];
The message is shown to all players, and I only need to show it to the person who logged in to the trigger.
@lapis ivy make it "not server-side", and in condition set !(player in thislist)
@winter rose
I added a trigger to the condition
vehicle player in thisList
And it worked. But I don't know if it will work if the player is in the car.
Thanks.
@winter rose
How can I correctly add a function to a trigger call BIS_fnc_neutralizeUnit ?
I need to kill a player if they don't leave the zone within 8 seconds.
I wouldn't want to do two triggers, but do everything in one.
hint format ["Вы нарушаете условности игры. Запрещено покидать зону боевых действий!", player];
sleep 8;
call BIS_fnc_neutralizeUnit;
My understanding is that if a player returns to a safe zone, they will still be killed.
ideally, don't use triggers 😁
I would use the forbidden zone module, but my bots are deleted after the briefing, and the module is not active for new players who entered the game after the start, since the module is synchronized with each unit.
[thisTrigger, player] spawn {
params ["_trigger", "_unit"];
private _timer = time + 8;
waitUntil { !(_unit in list _trigger) || _timer > time };
if (_unit in list _trigger) then { _unit call BIS_fnc_neutralizeUnit; };
};
code
hint format ["Вы нарушаете условности игры. Запрещено покидать зону боевых действий!", player];
[thisTrigger, player] spawn {
params ["_trigger", "_unit"];
private _timer = time + 8;
waitUntil { !(_unit in list _trigger) || _timer > time };
if (_unit in list _trigger) then { _unit call BIS_fnc_neutralizeUnit; };
};
Is this correct?
seems fine
, player
Whats that supposed to do in the format?
you don't have any placeholders in the text, that won't do anything
Any specific reason why you pass player as arguments, instead of just using player inside the function?
Oh, I fixed that already, I just forgot to get it out of here. Thanks.
hint format ["Вы нарушаете условности игры. Запрещено покидать зону боевых действий!"];
[thisTrigger, player] spawn {
params ["_trigger", "_unit"];
private _timer = time + 8;
waitUntil { !(_unit in list _trigger) || _timer > time };
if (_unit in list _trigger) then { _unit call BIS_fnc_neutralizeUnit; };
};
@winter rose
The trigger fires, but the timer does not. Kills right away.
old one looks correct to me tho
nope, I wait until current time goes beyond _time
…you did sleep today, did you…?
don't remember
if (lockedVehicle this) then
{
this lockDriver false;
}
else
{
this lockDriver true;
};
i'm getting an error saying im missing a )
but i don't see any open brackets
@slate cypress → https://community.bistudio.com/wiki/locked
or lockedDriver?
On this page: https://community.bistudio.com/wiki/switchMove
It says:
This command has global effect when executed locally to the unit and will sync for JIP. In this case the animation on the executing machine is immediate while on remote machines it will be transitional.
What does "transitional" mean? As far as I can tell it just doesn't work at all non-locally.
// addAction parameters
params ["_target"];
// clearXGlobal means to clear X from something, for everyone on the server.
clearBackpackCargoGlobal _target;
clearWeaponCargoGlobal _target;
clearItemCargoGlobal _target;
clearMagazineCargoGlobal _target;
// Remove the addaction so it can't be run by several players.
[_target] remoteExec ["removeAllActions", 0];
// Spawn a sleep and addaction, so that after 10 seconds, the action is readded to the vehicle.
["_target"] spawn {
sleep 10;
_target addAction [
"<t color='#ff0000' font='EtelkaMonospacePro' size='1.2'>Clear Vehicle Inventory</t>",
"scripts\client\clearInventory.sqf",
[],
1,
true,
true,
"",
"driver vehicle player == player"
];
};```
this gives me :
https://gyazo.com/dd8cb4953b6c96ce7abde9709d206de7
Any advice?
It means if you switch move prone while standing up, locally unit will just drop into prone immediately while on remote machine unit will crouch then prone @ebon ridge
Because _target would still be undefined within the inner spawn
You need to define _target
It means if you switch move prone while standing up, locally unit will just drop into prone immediately while on remote machine unit will crouch then prone @ebon ridge
@unique sundial Thanks but I don't understand how this can apply to arbitrary animations like are used in ambientAnim (which is what I am looking at). There is no transitional positions surely?
hmm
[_target] spawn {
params ["_target"];
hmm
well I had to remoteExec 0 on it to get it to apply on client machines
@ebon ridge if it doesn’t work use global remoteExec
yeah i am, so docs are just wrong?
No
Well I'm seeing the evidence that they are, so what is the explanation?
You have repro?
You said it doesn’t work
yo, it worked
thanks @ruby breach and @unique sundial you guys are legends
onto the other problem, it shows the addaction even though I'm out of the vehicle. Any clue how to remedy that?
could I add an if statement, like ```sqf
if {driver player = player} then {
addAction [stuff]
} else {removeAction [stuff]}
};
or would that not work
« add or do not add - there is not try »
use the condition parameter in addAction @wheat island
Hey! Is there a script to get rid of the NVG slot in the inventory? The EMP script i am using wont perform such an action no matter how hard i try so im wondering if there is another way
you can not disable inventory slots
you could possibly switch the nvg to a broken one
Contact addon added some of those
no, not like that, more specifically like remove the item in the inventory slot @young current
how can I prevent taking item from container ?
player addEventHandler ["Take", {
params ["_unit", "_container", "_item"];
if (faction _unit in ["OPF_F"] ) then
{
// prevent taking item from inventory
};
}];
Awesome, can i just run this in global?
{ _x unassignItem "NVGoggles"; _x removeItem "NVGoggles"} foreach allUnits;
should work
do you want to remove AI or players stuff?
players
ah
gonna try it out
MB, thought u wanted to remove AI stuff
ah
I will need the custom class name in that case right?
I believe so
Yeah
okey, thanks for the help!
Use hmd command
{ _x unassignItem hmd _x; } foreach playableUnits; might work
dont think you can delete the item after though
I get this error which says there is an undefined variable in playableunit?
will probably say that cause there is someone without a NV goggle
It is plural, units and there is a link to biki just above don’t just copy paste blindly
ahhhh
oke, i try again
sweet!
do a check if there is no NVG
make sure it wont break
like, test the script with people without NVG
good to hear! Also what im about to say next isnt to be rude or insulting, but you should try to google your questions before asking, https://www.google.com/search?q=arma+3+script+delete+nightvision+goggle+from+invent&rlz=1C1GIGM_enGB793GB793&oq=arma+3+&aqs=chrome.3.69i57j69i59l4j69i60l3.3184j0j4&sourceid=chrome&ie=UTF-8 has the first two results with answers which require little modification
will save you hours later on
ah, yeah I probably should've, thought my crude knowledge of the scripts would get me there
XD
thank you!
😄 NP
is it at all possible to count how many sectors a side has (from the sectors module) and store this value as a vairable?
https://community.bistudio.com/wiki/BIS_fnc_moduleSector seems like you can
this is what I was using lou
and dedmen
i only want to lock the driver seat, nothing else
ohhh disregard
i see
thanks
Now I'm getting an undefined variable this error
Does it not recognise this in a .sqf file?
this works in init field
oh
(and in triggers, etc)
how do you call your sqf?
addAction
then use (_this select 0) for the object it is attached to, (_this select 1) for the one using the action
thanks
this addAction["Toggle vehicle lock", "toggleVehicleLock.sqf", nil, true, true, "", (vehicleVarName _this in allowedPlayers), 5];
Error type number, expected string
specifically looking at this part
(vehicleVarName _this in allowedPlayers)
It must return "true" for the action to be added.
this is in init field
Hi would this work in a multiplayer setting, or am I misunderstanding task locality here?
pow = {["task_pow", "SUCCEEDED"] call BIS_fnc_taskSetState;};```
how would i go about checking the side of a player, i currently have this:
if (playerSide !resistance) exitWith {
hint "You Are Not A Member Of The Cause!";
};
I want to make sure the player is independant, but this currently doesnt work.
of course it doesn't, because you do not respect the commands' syntax!
let's see the wiki 😉
@jagged elbow ^
you want either !(playerSide == resistance) or (playerSide != resistance)
nor the ! syntax
you want either
!(playerSide == resistance)or(playerSide != resistance)
@alpine ledge Thanks that worked
Sorry another question, i have a cash variable, im trying to display this cash variable in a hint, i have this part working however i want a cash symbol, in this case £, to display along side it so far i have this:
player addAction ["hint cash", {hint "£"+str(cash)}];
But this only displays a £ sign.
player addAction ["hint cash", {hint format ["£%1", cash]}];
Thanks that worked, would you mind explaining what the %1 part means?
%1 means "replace this with the first parameter"
you could also do hint ("£" + str cash)
parenthesis are needed here (because hint takes precedence on +)
i see, thanks for the explanation
I can spawn in text, but how do I get it to fade out? ```sqf
_layer = cutText ["<t color='#4169E1' size='5'>Objective Updated!</t><br/>Capture the HVT in Vyshnoye.", "PLAIN", 5, true, true];
I tried adding cutFadeOut 5; on the end, but doesnt work.
Nevermind I worked it out.
Hola, I'm working on a server function and need to find who called it. I found the command remoteExecutedOwner but I have yet to find a way to get the object reference to that player. This is what i've tried but now I see it wont work because remoteExecutedOwner returns the client owner id and not a network id.
private _playerID = remoteExecutedOwner;
private _player = _playerID call BIS_fnc_objectFromNetId;
if (_playerID isEqualTo 0) exitWith { diag_log "Invalid remoteexec owner."; }; //invalid
if (_player isEqualTo objNull) exitWith { diag_log "Unable to find player object from netid"; }; //unable to find player```
I did alot of searching on the scripting commands list but was unable to find something to go from an owner id to an object or network id
I would pass the player variable when calling it from the client but I would assume that is unsecure and can be changed by giving a different object reference
Should i add an eventhandler to the server that stores a players object and srt the index equal to the owner id? Or is there a cleaner solution
I would assume that is unsecure and can be changed by giving a different object reference
well yea, i guess. but if you only use it correctly it should be fine? i think in the past i've had to use a server function to find an object with matching clientOwner id.
Its not me im worried about using it incorrectly. I was mainly worried about hackers manipulating it
you in a situation where thats a common problem? i reckon if they have gone to the effort to target your code specifically, they could probably find a way to route their "attacks" through another player to use their remoteExecutedOwner anyway.
i think your best option is to make a server function to find the unit associated with remoteExecutedOwner.
i dont think there is a command or function for that already?
Yeah nah there isnt a function for it
But I just had an idea for the player to pass their netID, but then the server double checks that the owner of the object associated with that net id is equal to remoteExecutedOwner
if its not then we know its false and they aren't the owner
I think with remoteExecutedOwner and routing attacks through the person directly, if the remote execute config is setup correctly then clients are only allowed to run functions through the server and not set the target for anyone else
Actually above wont work because anyone can get the netid of anything
If i disable the command netId for everyone except the server I believe that'll do the trick
how would the player pass their netid if it is disabled?
I changed it to their object reference
should have mentioned that
private _playerID = remoteExecutedOwner;
if (_playerID isEqualTo 0) exitWith { diag_log "Invalid remoteexec owner."; }; //invalid
private _objectFromMachineID = (netId _player) call BIS_fnc_objectFromNetId;
if (!((owner _objectFromMachineID) isEqualTo _playerID)) exitWith {}; //spoofed```
that is completely pointless though?
it just uses the netid of the object to get the object you just got the netid from?
which is the same object.
That is assuming that the given object is the correct one
in which case yes its pointless
but if someone were to give it a different persons player object then it would return a different object other than the remoteExecutedOwner
right, but you dont need to use its netid at all
just compare owner _player to _playerID
that was stupid
params [["_player", objNull]];
private _playerID = remoteExecutedOwner;
if (_playerID isEqualTo 0) exitWith { diag_log "Invalid remoteexec owner."; }; //invalid
if !((owner _player) isEqualTo _playerID) exitWith {}; //spoofed```
👏
Good morning! As I'm pretty new to scripting, I would appreciate any constuctive criticism on this code, which spawns random Groups every 10 minutes on my server.
spawnwest = [{
//check if an actual player is present
private _allHCs = entities "HeadlessClient_F";
private _humanPlayers = allPlayers - _allHCs;
_humanPlayers = count _humanPlayers;
if (_humanPlayers > 0) then {
//select random group
_groups = [];
{
_faction = _x;
{
_type = _x;
{
_groups pushBack _x;
} forEach ("true" configClasses _type);
} forEach ("true" configClasses _faction);
} forEach ("true" configClasses (configFile >> "CfgGroups" >> "West"));
_grp = selectRandom _groups;
//spawn group
private _vfgrm = [27000, 24200];
private _marschziel = [27000, 23200];
private _side = West;
_gruppe = [_vfgrm, _side, _grp] call BIS_fnc_spawnGroup;
_gruppe addWaypoint [_marschziel, 100];
_gruppe deleteGroupWhenEmpty true;
diag_log format ["%1 spawned at %2. Will move to %3.", _gruppe, _vfgrm, _marschziel];
} else {
diag_log "No players present - spawn cancelled";
};
}, 600] call CBA_fnc_addPerFrameHandler;
Looks fine so far. You could consider to cache all available groups when it runs for the first time.
@cosmic lichen by using grp instead of _grp and then just skipping the "select random group" part, if grp is already defined?
No
Store the _groups array, instead of doing very slow repeated config lookups that always return that same result
Anyone knows if there is a script to disable sprinting?
@smoky verge like, allowSprint?
huh that was easier than I though
@winter rose assuming I want to use it only on the players in the trigger what should I use in the syntax?
something like forEach player intislist?
is the trigger players only?
if so, you could to a { _x allowSprint false } forEach thislist
the trigger is player presence so it should work
also is there an allowJog?
or generally something to slow down to walk speed
I would edit stamina but with ace it may just explode the universe
oh didn't know about that first page
thats actually awesome
thanks
Is there a command similar to "diag_log" that outputs to the dedicated server console?
im writing a script where a roadblock gets reinforced when under attack. I want to be able to distinguish between transport vehicles and vehicles then can fight, i.e. a truck should be used to move there and then left near the road while a jeep with an MG shouldnt be abandoned. ANyone know a smart way of doing that by script?
simple way: check if your vehicle is a truck
advanced way: check that vehicle weapons are something else than "horn"
check for truck isnt enough, ill go with the horn way
or im going lazy and call anything truck a taxi in editor and just read the name.. we ll see
truck0, truck1, truck2
private _trucks = [];
for "_i" from 0 to 2 do
{
_trucks pushBack (missionNameSpace getVariable format ["truck%1", _i]);
};
or just ```sqf
private _trucks = [truck0, truck1, truck2];
how about using this:
_list = fullCrew [vehicle player, "turret"];
and if (count _list == 0) //no turret -> taxi?
check if vehicle has a gunner, should be enough?
wont work on empty cars, altough generally they shouldnt be emtpy if they have a gunner
yeah i guess gunner check is enoguh
i still have to use fullcrew get type cargo to distignuish between pure taxi and apc. bc apcs have a gunner but als ferry passengers.
heh, then you have taxi, gun, and taxi+gun yes
therefore, two checks
yup
it will declare trucks with an MG as guntaxi, so i might also look into "damageRestistance"
maybe check ammo of the vehicle?
wont help for getting a difference between an APC with a .50 and a truck with a .50
gotta get some kind of armour value, found "damageResistance" in the configs.
you are adding more criteria to the distinction you are looking for
I thought you only wanted to know
- if the vehicle has a gun
- if the vehicle transports people
(can be one, the other or both)
well i want the QRF which reinforces the attacked roadblock to act logically. APCs and tanks and MG-jeeps will keep their crew boarded, while trucks, no matter if mg or not will only be used to ferry. they have no use in direct attacks
then checking for weapons is "useless", you simply want to check if the vehicle is one of the trucks
name them (easiest solution), or check isKindOf with the truck's parent class
yeah i guess naming is really the easiest way. not elegant, but to cover every single case of vehicle to work is probably more error prone
MRAPs are also "just trucks" but do pack a punch. so lets elave it to the mission maker what to use as taxi and what as gun.
if you are making a framework, it is a good thing to have a very strong check for such cases.
if you are "only" making a mission, make the function for you first, the rest is not important.
passing an array of "vehicles that should continue their road" may also be more beneficial to the script's modularity, given you might want to micromanage who stops and who doesn't (e.g an important officer/prisoner in a BMP, etc)
of course I'm right! :p
dont know what to look for, i wanna change the groups sign shown in zeus to motorised, mechanised, armoured etc. what kind of field do i need to manipulate for that?
is it ORBAT High Command?
yeah orbat was correct
i just noticed that its not displayed in zeus but only high command so its useless for my purpose
maybe https://community.bistudio.com/wiki/Military_Symbols and Set up Groups / Markers List @spark turret
does anyone have a solution to my problem
Why does addaction scripts only appear locally ? Is there a good way to make an item interactable on the scroll wheel for the entire server?
Thinking what would be a good way to restore object's hidden selection materials?
Sadly setObjectMaterial [0, ""] doesn't work.
Config doesn't have materials in hiddenSelections either in most cases
Currently thinking going as far as digging into models to get their original materials and re-apply them.
@fathom pawn remoteExec yes
Ah Ty
@meager granite you can get them with getObjectMaterials
(store them before changing them, I suppose)
Nope, it returns empty strings
@slate cypress https://discordapp.com/channels/105462288051380224/105462984087728128/701543533991034991
your issue says you are giving a number instead of string.
have you checked addAction's doc on the wiki?
also, is the sqf (vehicleVarName _this in allowedPlayers)part a Boolean argument?
I've checked the docs
and yes, it should return true for the action to show
I believe that statement does return true
but it is somehow getting a number
object addAction [title, script, arguments, priority, showWindow, hideOnUse, shortcut, condition, radius, unconscious, selection, memoryPoint]
``````sqf
this addAction["Toggle vehicle lock", "toggleVehicleLock.sqf", nil, true, true, "", (vehicleVarName _this in allowedPlayers), 5];
According to the docs, _this points to the target player who it shows up for
in script code
title = "toggle vehicle lock"
script = "toggleVehicleLock.sqf"
arguments = nil
priority = true → should be a number
showWindow = true
hideOnUse = ""
there is an offset
also, the condition is a String - not a Boolean
ah how did I not see that priority is a number 🤦♂️
so if it is a string,
I'd use an if statement and return "true"?
I think you only missed priority, the rest is only offset by one
no, you would simply wrap your statement in quotes
this string will then be compiled and called by the engine
yes
ok thanks
what can I use to check if thisTrigger inside a trigger object is a vehicle (car, apc, tank, heli)
if the trigger is … in a trigger?
@slate cypress didn't get your question, do you mean "check if the triggering unit is a vehicle"?
yes
i'm making a maintenance area
currently looking at this function
getting an error "missing ;"
_objectType = thisTrigger call BIS_fnc_objectType;
if (_objectType select 0 == "Vehicle / VehicleAutonomous") then {return true;};
thisTrigger is the trigger itself
also, return doesn't exist in SQF
ah
but thisTrigger would be the object that enters the trigger area
_objectType = thisTrigger call BIS_fnc_objectType;
_objectType select 0 == "Vehicle / VehicleAutonomous";
this is the condition
oh
given that the player is driving the vehicle,
there'd be two objects in thisList
how do I know which one is the vehicle
if it is a vehicle
It's been a while since I've messed with triggers, but pretty sure the only object in thisList would be the vehicle, which you'd then have to use the crew command to get the occupants of.
this is what i've done for the condition
_object = thisList select 0;
_objectType = _object call BIS_fnc_objectType;
_objectType select 0 == "Vehicle / VehicleAutonomous";
but it isn't activating the trigger
does ```sqf
_objectType select 0 == "Vehicle / VehicleAutonomous";
It's not "Vehicle / VehicleAutonomous", it's one of ```
Car
Helicopter
Motorcycle
Plane
Ship
StaticWeapon
Submarine
TrackedAPC
Tank
WheeledAPC
isn't "Vehicle / VehicleAutonomous" the category though
it returns an array
[category, type]
Just output BIS_fnc_objectType and see what it actually is
My guess would be ["Vehicle","Car"] or ["VehicleAutonomous","Car"], but not really sure tbh
The condition works now.
I'm getting a "generic error in expression" error for the actual activation code
this is the activation code:
thisTrigger setFuel 0;
thisTrigger vehicleChat "Repairing...";
oh wait
i didnt update it
nvm
(again, thisTrigger is the trigger itself yes)
yep xD
still getting the same error for it but with the updated version
the vehicleChat statement works
but it skips the setFuel and errors
_object = thisList select 0;
_object setFuel 0;
_object vehicleChat "Repairing...";
sleep 2;
_object setDamage 0;
_object vehicleChat "Rearming...";
sleep 2;
_object setVehicleAmmo 1;
_object vehicleChat "Refueling...";
sleep 2;
_object setFuel 1;
_object vehicleChat "Maintenance completed!";
It manages to do all the chats.
Ignores sleep statement
no sleep in activation, unscheduled
how do I pause it so that I can get a little wait time
(thisList select 0) spawn {
params ["_object"];
/* your code here */
};
you can, but spawning won't care about it since it is a new scope
sleep works in a spawn
ah ok
undefined variable _object error
(thisList select 0) spawn {
params ["_object"];
_object = thisList select 0;
_object setFuel 0;
_object vehicleChat "Repairing...";
sleep 2;
_object setDamage 0;
_object vehicleChat "Rearming...";
sleep 2;
_object setVehicleAmmo 1;
_object vehicleChat "Refueling...";
sleep 2;
_object setFuel 1;
_object vehicleChat "Maintenance completed!";
};
of course, thislist doesn't exist in the spawn
I passed thislist select 0 as argument, and assigned it to _object with params ["_object"]
delete the line _object = thisList select 0; and everything will be fine 👌
oof i must be half asleep today
works
thank you for your help lou and gnashes :)
how to skip iteration in foreach? can I use exitWIth?
nope, this exits the whole forEach
there is no "continue" in SQF
wrap with if () then {}
oh and I was looking for continue command and never found one :|
Thank you!
I just prefer to check for negative and exit instead of wrapping code (in C#)
yes 😄
for readability, yes
for both for, forEach and while maybe
okay, so this only happens on a dedicated environ - I force eject the players from the aircraft - and all the human players live, while the AI dies on ejection, even though damage is disabled on them.
//define players
_players = [player_1, player_2, player_3, player_4, player_5, player_6, player_7, player_8];
//make sure players have no damage
"no damage..." remoteExec ["hint"];
{_x setDamage 0} forEach _players;
//eject players from aircraft
"ejecting..." remoteExec ["hint"];
{moveOut _x} forEach _players;
sleep 6;
//make players vulnerable
"players becoming vulnerable..." remoteExec ["hint"];
{_x allowDamage true} forEach _players;
fishyradar enableVehicleSensor ["ActiveRadarSensorComponent",false];
//make a marker at the crash site//
waitUntil {(visiblePosition fishy) select 2 < 1};
"making crash site..." remoteExec ["hint"];
createMarker ["Respawn_West", getPos fishy];
"Respawn_West" setMarkerType "mil_triangle";
"Respawn_West" setMarkerText "Crash Site";
"Respawn_West" setMarkerColor "ColorOrange";
//make sure all players are still in the same group
sleep 20;
"regrouping..." remoteExec ["hint"];
_players join playgroup;
leader playgroup == player_1;
@spark rose allowDamage needs a local argument
also, leader playgroup == player_1; will do nothing (only returns a boolean)
Lou, can you explain further about the local arg for allowDamage?
understood about leader
you should remoteExec allowDamage, else it will not be dealt with
{ [_x, false] remoteExec ["allowDamage", _x] } forEach _units;
gotcha, it has to be run local to the players machine
exactly
i had first attempted that but had problems with syntax... 😦
but why are AI killed on moveOut command?
maybe because they are all ejected at once, therefore colliding - I don't really know though.
try spacing them ```sqf
"ejecting..." remoteExec ["hint"];
{ moveOut _x; sleep 1; } forEach _players;
sleep 5;
@spark rose ^
is there command to disable ACE fatigue that happens after player get injured? I use ace_medical_treatment_fnc_fullHeal but it not removing the fatigue
player setFatigue 0; ?
I did, but I think ACE using different fatigue
Well, check the ACE documentation and code, of it exists it should be there
@winter rose They still all are dead upon exiting (maybe before i can't tell), but only in a dedicated environ
even though damage is not allowed until well after ejection
and their damage is set to 0 beforehand
???
*magic*
try eject action?
all magic is just unknown science
I strongly believe in an Arma 3 DLL deity and you can't prove me wrong
you use setDamage instead of allowDamage false
maybe:{_x setDamage 0; _x allowDamage false;} forEach _players;
@spiral fractal I use allowDamage false in the initServer.sqf
try it
{ [_x, false] remoteExec ["allowDamage", _x]; } forEach [player_1, player_2, player_3, player_4, player_5, player_6, player_7, player_8];
So I have a script that spawns units in:
_HVT010 = [[6550.99,6086.35,0], EAST, ["rhs_msv_emr_officer"], [], [], [], [], [], 308.080] call BIS_fnc_spawnGroup;
I then run a separate script to wait for that unit to be killed: ```sqf
execVM "\scripts\Meeting1\HVTS1.sqf";
All thats inside the script is.
```sqf
waitUntil { not alive _HVT010 };
_layer2 = cutText ["<t color='#4169E1' size='5'>Mission Update!</t><br/>HVT has been killed...", "PLAIN", 0.5, false, true];```
However it doesn't work anyone know why?
because _HVT010 is a local variable, and it doesn't exist in the execVM scope
How would I change it to a global variable, I tried "setVehicleVarName" but didnt work when I tested it.
what you could do is
_HVT010 execVM "\scripts\Meeting1\HVTS1.sqf";
```and in the HVTS1.sqf, have```sqf
params ["_vehicle"];
waitUntil { not alive _vehicle };
(...)
are the execVM and the BIS_fnc_spawnGroup in the same file…?
Yes
show me what you got!
Will do
Exactly ^ what I had in mind 😄
@winter rose nailed it. I put a trigger on the start location activated by any player present with sqf { [_x, false] remoteExec ["allowDamage", _x]; } forEach [player_1, player_2, player_3, player_4, player_5, player_6, player_7, player_8];
@high silo params variable names must be prefixed with an underscore!
now they live
nice! we got it working take that, A3 gods!!1! ⛈️
yyyup
Will save and test.
but if this is the only code you have in that file, no need for an execVM, you could simply spawn it
The scripts also gonna call in QRF and shizzel, so thought it would be more simple for my little brain
okido, no problem
Still doesnt work
what have you done this time
She started it
Hey, can I get some help with a quick script ?
depends on your script!
What's the spawn code for the spawning of say a rhs ammo box???
less interrogation marks, more classnames please!
use createVehicle @whole plinth
For example heres the code for spawning a arsenal---- spawn BIS_fnc_arsenal;
no.
this is code to make the Arsenal available
to spawn an object, you will need createVehicle and the class of the object you want to create
see https://community.bistudio.com/wiki/createVehicle for documentation
I'm playing "Old Man" and I have a bugged Task which can not be completed anymore, is there a script which I can type in the console to just "complete" the task ?
okay Lou, last thing. If anyone on the team accidentally teamkills, they are removed from the squad. I don't want that to happen. There's got to be just an option for it somewhere right?
@wise mulch I don't think so, many scripts must be intertwined in this scenario - it is unfortunate, but you might have to take an earlier save
I've found this Install_Virus setTaskState "Succeeded"; online but it doesn't work ... Also, on the same site it was something about weather (I wanted to turn off the rain) and it worked, but only for like 1-2 seconds then the rain came back
@spark rose well, technically they are -not- removed from the squad, but they are removed as a leader (if they were) and get shot
you could try playing with addRating - e.g from the very beginning, player addRating 10e10 and you will have plenty of TeamKill licences :p
Well ... I was trying to do the task and I had a save right before completing it, and every time I would try to complete it, it wouldn't work
And then I had a lot of fighting to do, and then moved onto a few other things and I do not have a previous save ...
guys, quick question, i copied the bis sector init script and made a few modifications, but when i want to stop de module default initialization via "_sector setVariable ['BIS_fnc_initModules_disableAutoActivation', true, true];" it doesnt give a damn about that and simply uses the default init script instead of mine
@winter rose I was thinking, maybe I'm not writing the name of the task properly ...
_signal = "SmokeShellGreen" createVehicle (position _this); _signal attachTo [_this, [0,0,0]]; 0 = ["AmmoboxInit", [_this, true]] spawn Box_NATO_Wps_F; (Does this look right?)
no.
If I understand it correctly you want to spawn an ammo box, attach a green smoke to it and make it an Arsenal, correct?
Almost correct.
No arsenal just a rhs ammo mags box. But this is being used in the supply drop module the a3 has by default.
rhsusf_mags_crate is the correct classname for the "RHSUSF Ammo Crate"
so something like should work:
_crate = "rhsusf_mags_crate" createVehicle (position _this);
_signal = "SmokeShellGreen" createVehicle [0,0,0];
_signal attachTo [_crate, [0, 0, 0]];
I'll give that code a try.
createVehicle you say 🤔
Ammo crates are also in CfgVehicle afaik
@exotic flax I guess 😄
https://discordapp.com/channels/105462288051380224/105462984087728128/701825596078030979
U happy now @winter rose
it's not me you should satisfy really, it's the Arma gods!
all hail daddy Lou
Well k,The code work kind of we have two ammo boxes ones nomal supply drop then the RHS one attacted to the parachute spawned. umm Well I quess a3 gonna be a3.
nvm
class ListBoxMembers: OrgSplitter_RscListBox
{
idc = 102524;
x = 0.4195 * safezoneW + safezoneX;
y = 0.400 * safezoneH + safezoneY;
w = 0.155 * safezoneW;
h = 0.18 * safezoneH;
style = LB_TEXTURES + LB_MULTI;
onLbSelChanged = "[] call menuUpdate;";
};
Using LB_MULTI to select multiple items in a list box. 'onLBSelChanged' is only called when you left click, but to select multiple items you need to either Ctrl + Click or Shift + Click
anyone got any ideas?
im not too good with GUI but have you tried onLBListSelChanged ?
Hello. At which step mission modules initialize in multiplayer?
preInit, Init, postInit?
Is it safe to check at postInit that module exist and initialized on mission?
nice. thx
@still forum In my case i want to force the module to call my init script instead of the default one. but even after adding "_sector setVariable ['BIS_fnc_initModules_disableAutoActivation', true, true];" it uses the default one
dunno
shiieeet....
@still latch (just for reference, ) keep https://community.bistudio.com/wiki/Initialization_Order close 🙂
@twin robin question:
why do you need the module if you are not going to use it? you could use a "normal" Game Logic?
if i use the normal game logic with BI script, it doesnt work.
i only want to use custom icons for the sectors depending on some variables, nothing else
😆
the whole thing exectures in preinit without issues
but i cant stop the initialization with the default script
im trying to create an if statement that checks if a task is complete, ive had a look at the wiki and to my knowledge it seems correct syntax wise but it throws an error.
This is the code:
if (taskState task1 == "SUCCEEDED")then {
hint "Completed";
};
the hint part will be changed for something else once i know the is statement works
what's in task1 variable?
throws an error without an error from rpt is not that much helpful.
Try to paste it here or smth.
the task1 is the task id
im using waypoint type "GETIN" to make a group board a truck, but the waypoint position isnt precise enough for the group to recognize the truck as the target, so they dont get in. can i attach a waypoin to a truck?
or how do i realiably order a group to board a vehicle by script?
Is there a way to check the animations of a class before I create it? What I want to do is I have a list of objects I need to create, but if it has no animations I'd rather create it as a simple object instead of a normal createVehicle
animationNames requires an object reference
maybe you can get them from the object's config
Yeah I am looking into that now, seems like I can just get all of the subclasses of the animations class from the config and just do a count check
Hey guys, I need some help with a script I'm making, this one https://pastebin.com/3ZSLetDm
For some context, what this does is it creates an enemy at a set distance (200 in this case) of the unit "TeamLead01" , in a random direction, who then stalks a target group (in this case, "alpha").
Now my goal is to check this enemy's position so it NEVER spawns close to another player, but I don't know how to approach it. Some help would be appreciated, thanks guys!
get distance to all players, if one is smaller than 200m, get new random position, repeat until condition is met. easiest and dirties approach 🙂
Hey, I'm trying to get some objects inside one of the vehicle of RHS.
I'm using attachTo and it works when looking from the outside, but from the inside the object is just not there.
Is there anything that can be done to fix this?
nope, from a first-person POV your vehicle always goes above everything else (why you can see your feet when walking on somebody)
languaaage 👀
where can I see all the available icons? only found this: https://community.bistudio.com/wiki/Arma_3_Task_Framework#Task_icons
that's apparently it - but you can use your own
Thank you!
anyone knows why i cant createRope doing with two balloons? Land_Balloon_01_air_F I try before balloon2 enableRopeAttach true; and balloon1 enableRopeAttach true;
how do you create ropes?
from https://community.bistudio.com/wiki/ropeCreate:
FROM object has to be transport vehicle
Transport vehicles: https://community.bistudio.com/wiki/ropeCreate/transport
@woeful mirage
yeah but i want createrope with player and balloon or balloon and balloon. i can only attach vehicle and balloon... i dont know why
https://www.youtube.com/watch?time_continue=32&v=t8kQ9PqiD84&feature=emb_logo and how works that? with transport vehicle too?
see the comments
how can I check if object is wheeled?
I know there is isKindOf command but I dont know what classes there are and I cant find the full class hierarchy list
oh I think I found it
idk.
Heya! i want a custom sound file to originate from a radio and i have looked on forums to no avail
Im pretty new to scripting so can anyone tell me what im doing wrong
class CfgSounds
{
class BBCRadio4
{
name = "BBCRadio4"; // Name for mission editor
sound[] = {\Sound\BBCRadio4.ogg, 0.8, 1.0};
titles[] = {0, ""};
};
};```
this is the line i have for the Radio file itself
This is the line i have in the radio objects init
_soundSource = createSoundSource ["BBCRadio4", position player, [], 0]
Hey. I need to apply the post processing effect to all players in multiplayer. Here is what I have:
PPeffect_colorC = ppEffectCreate ["ColorCorrections",1500];
PPeffect_colorC ppEffectAdjust [1.01,1.15,0,[0,0.38,0.67,-0.03],[1,1,1,1.1],[0,0,1.04,0]];
PPeffect_colorC ppEffectEnable true;
PPeffect_colorC ppEffectCommit 0;
PPeffect_grain = ppEffectCreate ["FilmGrain",1550];
PPeffect_grain ppEffectAdjust [0.00543673,0,1,1,0];
PPeffect_grain ppEffectEnable true;
PPeffect_grain ppEffectCommit 0;```
Do I need to create a class `CfgPostprocessTemplates` in the Description.ext file?
I just don’t quite understand how I should do it right.
@lapis ivy you could either use a class, indeed, or remoteExec a script (or put it in initPlayerLocal.sqf)
@winter rose
If a player is killed and respawn, will this work?
@lapis ivy yes afaik
@light moat for createSoundSource, you should define a CfgSFX (see https://community.bistudio.com/wiki/createSoundSource)
else, you can use say or playSound with the sound from CfgSounds
is there any way to check existence of file in addons. Icons/textures/audio?
not sure if this works with those types of files but you can give it a go. I dont believe there is a proper way.
http://killzonekid.com/arma-scripting-tutorials-kk_fnc_fileexists/
KK_fnc_fileExists = {
private ["_ctrl", "_fileExists"];
disableSerialization;
_ctrl = findDisplay 0 ctrlCreate ["RscHTML", -1];
_ctrl htmlLoad _this;
_fileExists = ctrlHTMLLoaded _ctrl;
ctrlDelete _ctrl;
_fileExists
};
I managed to setup a script that makes what I described earlier, here: https://pastebin.com/wkjd01zh
The AI spawns and stalks the group named "alpha". My question now is: how can I change it so the enemy AI stops spawning after everyone in alpha is dead? even if the script runs again.
Ok, simply using an alive count and exitWith did the trick!
so I have a Campsite composition, oh maybe 6 or 7 items like a couple of tents, fireplace, boxes, etc and I want it to spawn in the woods given the smallest clearing. I'm thinking that for the clearing maybe 30 to 50 feet. I have tried every combination I can think of with this code but I want to ask if anyone can give an idea.
_fe = _pos0 isFlatEmpty [10,200,0.25,3,0,false,objNull];
This is what I started out with, not what I ended up trying.
how can I execute plain code on server (without function)?
init.sqf?
I want to execute in in addaction
or is it possible to make file with all the functions that server will know about?
when I test my code in debug console I create function and then use remoteExec to call it and press local exec, nothing happens, wehn I press global exec it works and then if I press local exec it also works. like if server stores the function somewhere
for example: reset_veh = {.. code .. }; [] remoteExec ["reset_veh", 0];
oh ok I think I understand now
reset_veh = {.. code .. };
[[],reset_veh] remoteExec ["call",-2];
the game cant execute a function if it isnt defined, so if it is only defined on the server you would need to remotexec the function content in a call.
why -2?
0 executes on everyone and the server. -2 executes on everyone but the server.
use whichever depending on where the code is supposed to execute.
I keep getting an end of line syntax error
but idk why
My lines should be fine
class CfgSounds
{
class BBCRadio4
{
name = "BBCRadio4"; // Name for mission editor
sound[] = {\Sound\BBCRadio4.ogg, 0.8, 1.0};
titles[] = {0, ""};
};
};```
im trying to have a sound originate from an object, in this case, a radio object
```nul = [thisTrigger] spawn {while {true} do {(_this select 0) say3D ["BBCRadio4", 500, 1]; sleep 57;};};```
what am I doing wrong?
can you paste the error? does it give a line number or something
my only issue with ur snippet is the sound file path isnt in a string, but i think that usually fixes itself.
try using a tool to find the error. or dm me ur config if u want, ill try to find it.
@robust hollow attempting to dm
is there a way to animate a large amount of units with the same animation?
heya! my custom audio file wont play, does anyone here possibly know why?
im trying to have a sound originate from an object, in this case, a radio object
null = [thisTrigger] spawn {while {true} do {(_this select 0) say3D ["BBCRadio4", 500, 1]; sleep 57;};};
nvm worked!
yo guys, can anyone help me out with my basic.cfg? can't figure what to put in it even though I've got all my dedicated server specs right there;(
@celest ferry the cfg for the server?
@light moat yeah
sure thing, what are you trying to do?
putting customs entries for MaxMsgSend, MaxSizeGuaranteed, MaxSizeNonguaranteed etc that fits with my dedicated server specs
not quite the channel for it. try reading the recent conversation in #server_admins for some guidance.
0 executes on everyone and the server. -2 executes on everyone but the server.
@robust hollow @spiral fractal beware, as not all servers are dedicated but sometimes player-hosted
hey anyone now how to make a trigger to smoke grenade effect plus looping/auto when player comes back to the radius . thxs im a noob with this
Well, you can either spawn a smoke grenade when they're near or if you're looking for something a bit more consistent look into particle arrays:
https://community.bistudio.com/wiki/ParticleArray
the distance testing should be pretty trivial (look into distance on the wiki, its a simple comparison to figure out if they're within range)
thxs my friend o> @austere sentinel
Theorycrafting here (i.e. I haven't tested yet, don't want to waste the time if someone else already knows the answer)
1: Does putting global vars in a function library class with preInit=1 make them available to the rest of the function lib?
2: Is this considered bad practice/unsafe?
yeah that was the plan
Anyone know if I can temporarily disable simulation on all objects for the first few seconds of the mission? Seems like vehicles are spawning before the 'hide terrain object' module, causing one hell of a fuster cluck at the spawn base, any ideas?
nice language workaround 😁
all objects as in mission objects?
// server-side
private _stuff = allUnits + vehicles;
{ _x enableSimulationGlobal false } forEach _stuff;
sleep 3;
{ _x enableSimulationGlobal true } forEach _stuff;
Perfect!
Vanilla arma doesn't seem to have any way to see if a particular limb is injured on "Arms" or "Legs" with any of the event handlers I can see or the getHit command.
ACE seems to be able to detect damage for their system on particular limbs and I've been trawling their code to see how they do it but i'm at a loss?
Is anyone aware of how ACE detects damage on a particular limb or if there is infact a vanilla solution?
the hide terrain object does work in multiplayer
that's true, this is called from an sqf which isn't working at the moment in dedicated, but does work in a player hosted environ
aha
@winter rose will that cover obects too? Such as buildings placed where there would otherwise be a terrain vehicle
I think so yes
Sweet, thank you 🙂
idk if my question is more a #arma3_config thing to see if its easy enough to do. I'm making changes to the vanilla medical system for use in my group so that, using ace_interaction, individual limbs need to be healed rather than just a global body heal based on damage. I'm trying to find damage values of each limb but i've come a bit stuck with only hitHead,hitChesthitLegs,hithands being available
there is no left/right arm distinction afaik
@daring pawn see https://community.bistudio.com/wiki/getAllHitPointsDamage
is there any module for spawning waves of AI where the number of AI increase every wave?
or do i script this
script
ok thanks
Yea that's what I was referencing. I'm having a look at how ACE Adds defined hitpoints and it appears in
https://github.com/acemod/ACE3/blob/5a4487f1eae7173d9551d2df9eff7f0ca675aca4/addons/medical_engine/CfgVehicles.hpp here and
https://github.com/acemod/ACE3/blob/16ed2a82c2d3b743da83dc0455c1f56f1837ff76/addons/medical_engine/script_macros_config.hpp here
They seem to add an extra 4 hitpoints to different base classes as class HitPoints but the wiki for ArmA Config reference for hitpoint is moot
https://i.imgur.com/wPvVqqk.png These are the vanilla hitPoints found in configViewer
https://community.bistudio.com/wiki/Arma_3_Soldier_Protection This looks to be a bit closer to what i'm chasing for
But I'd need to add a hitpoint to the LOD it seems? Which is what confuses me about ACE's method
I am creating this content in a mod as well btw
Hey. I want to make a periodic random air strike. I put the module "Air Support", but the value "radius of placement" is always reset to 0 after saving and loading the mission. Perhaps there is some kind of script, so that at the start of the game this module randomly selects its location within a radius of 300 meters?
if (isServer) then { this setPos (this getPos [(sqrt random 1) * 300, random 360]); };
@lapis ivy ^
Thanks!
Is there a way to make attached objects not interact with players
i.e. I attach a crate to a player for them to move, but don't want them to be able to kill others with it
Is it possible to include two different audio recordings through "playmusic"? Or is it better to use "playsound"?
@austere sentinel try disableCollisionWith perhaps
@lapis ivy one music at a time, one sound at a time
I need to start one track at the start and loop it until the end of the game, and after the briefing turn on another one. It is necessary for the atmosphere. Will they start and play two tracks at the same time?
And did I make the loop right? Will this work for everyone in multiplayer?
while {warbackground} do {
playmusic "war_background";
sleep 155;
};
one music at a time
if you playMusic another one, the previous one will stop.
[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,
"",
""
];
this script is working in singleplayer, but isn't working on dedicated. I'm thinking it's something to do with the event handler. I'm essentially wanting people to click on a vending machine, and it then doubles the person's fire rate.
Don't know if this should go here or #server_admins but on this wiki page (https://community.bistudio.com/wiki/Arma_3_Startup_Parameters#Server_Options) it says the following for -autoInit: Warning: This will break the Arma_3_Mission_Parameters function, so do not use it when you work with mission parameters, only default values are returned!
By broken, do they only mean that the default values are used or is there something else broken?
Hello,
If you can please help a noob finish his first mission...
I have a trigger which activates on civilian presence.
It activates as soon as one civilian is inside it.
I need it to activate after 7 civies are inside.
I got this bit from the internet and placed it in condition:
count ({(alive x) && (side _unit == civilian)} forEach units group thisList) > 6;
What i got is a ''generic error in expression''
count (
{
(alive x) && (side _unit == civilian)
} forEach units group thisList
) > 6;
```~~yes, you have one too many parenthesis~~
wrong count syntax 🙃
{ alive _x && side _x == civilian } count thislist > 6
```@coarse sedge
(also, undefined _unit, wrong usage of group on thislist that is an array)
@winter rose well, the error msg is gone, but still the trigger does not activate
@daring pawn the normal man should have more then head, chest, legs and hands. Are you using a modded unit by chance?
@ornate marsh idPerson should be a private variable, same with typeWeapon and timeFiring
@winter rose
I have a trigger which activates on civilian presence.
It activates the following :
[leader_BLUEFOR,BLUrequester,BLUprovider_ARTY] call BIS_fnc_addSupportLink;
As you can see, it makes the arty support available as soon as there is 1 civilian inside the trigger (tested).
I need it to activate after 7 civies are inside. The plan is the get the civilians to safety and then have artillery support available
also what is ```sqf
if (timeFiring isEqualTo -1) exitWith {};
(vehicle idPerson) setWeaponReloadingTime [(vehicle idPerson), _muzzle, timeFiring];
}];
};
if (timeFiring isEqualTo -1) exitWith {};
},
[],
1.5,
true,
true,
"",
"true",
5,
false,
"",
""
];
yeah im not suprised it didnt work, would have fixed a prob which would have arrised otherwise
the setReloading thing is whats actually doubling fire rate
why are they both checking for isEqualTo -1
https://community.bistudio.com/wiki/setWeaponReloadingTime look at the Notes
@coarse sedge the code should work, maybe add this && before it
@ornate marsh u in TS? Dont wana clog up chat with Qs
ill jump in
@winter rose yep, it works! it did not register their presence, i think it's becouse they were inside a vehicle with an indipendent driver
ah yes, vehicles are not counting crew
thank you very much, you just put an end to 12h of torture 🙂
pleasure!
@daring pawn the normal man should have more then head, chest, legs and hands. Are you using a modded unit by chance?
@cold pebble
It does not no. In regards to things modifiable by any engine code, its only hitHead, hitBody, HitHands, hitLegs - https://community.bistudio.com/wiki/setHitPointDamage
https://community.bistudio.com/wiki/getAllHitPointsDamage
"hitface","hitneck","hithead","hitpelvis","hitabdomen","hitdiaphragm","hitchest","hitbody","hitarms","hithands","hitlegs","incapacitated"
Theres a few others but they're not specific left or right arm/leg.
I looked at it in config viewer, thats all there is.
Ah yes thats what I expect
So thats part of my issue atm. May have to work in the method ace uses but i'm still figure it out. Theres very little intel about class hitpoints
I'm trying to see if something is possible but I don't exactly know how or where to start.
A mission end script activated by a trigger which causes your screen to fade to black and the mission to end without the standard "MISSION COMPLETED" in the screen with the digital noises.
This is how far I've gotten so far:
"<t color='#800000' size='5' shadow='0'></t>",
"BLACK FADED",
5,
true,
true
];
};```
I got the black screen working haha
do you happen to want the "classic" ending, though?
Just a black screen fading in and then after a few seconds have it boot you out of the mission back to the slot selection screen
it's for MP
It's my first time trying to do this stuff.
you could use https://community.bistudio.com/wiki/BIS_fnc_endMission (coupled with remoteExec)
the fadeType parameter allows for a blackout
oh wait, without the "mission completed"
Yes
well, either
["myEnding", true, 5, false, true] call BIS_fnc_endMission;
```or```sqf
cutText ["","BLACK OUT", 5];
sleep 5;
endMission;
["myEnding", true, 5, false, true] call BIS_fnc_endMission;
Works!
Thank you!
Hi Everybody.
I want to create a whitelist with a text file.
With a preprocess for get the array on the txt file. It's for i can add a PlayerUID without need to restart the mission
Hi, I'm trying to add an action to all players which would run a function.
The function should check if the player is either: looking at obj1 and the distance between them is < 500 OR the same check with obj2.
This code snippet is located in initPlayerLocal.sqf.
I'm getting the following error: Missing ; at the line "systemChat "No Match..." at the end of test_fnc_scan. What might be causing this?
test_fnc_scan = {
params [["_scanner",objNull]];
_scanner = this select 0;
_callerCursorTarget = cursortarget;
systemChat "Uploading picture to server..";
sleep 2;
if (((_callerCursorTarget == obj1) AND ((_scanner distance obj1) < 500)) OR ((_callerCursorTarget == obj2) AND ((_scanner distance obj2) < 500))) then
{
systemChat "Target confirmed.";
};
else
{
systemChat "No match. Either wrong vehicle or too far <500 m";
};
};
//add scan action to object
player addAction [
"Scan for target",
{
params [_target, _caller, _actionId, _arguments];
_scanCaller = _caller
_scan = [_scanCaller] spawn test_fnc_scan;
},
[],
0,
false,
true,
"",
"true",
-1
];
replace :
};
else
{
by
}
else
{
Don't close the first scope if {} when you have an else !
hey huys!
guys!
Im trying to make a custom airfield, but the amount of grass cutters i have to place down lags the game out, even when using a script to do it. Is there any other method or change I can make to the script to make it not lag out? Thanks for any suggestions.
Thanks! It seems that the code now runs, but I get an error for undefined variables _scanner and this in the test_fnc_scan. Is the _scanner variable not passing correctly to the function or what might it be?
Try like that :
test_fnc_scan = {
params [["_scanner",objNull]];
_scanner = this select 0; //Here is the caller on your addAction.
_callerCursorTarget = cursortarget;
systemChat "Uploading picture to server..";
sleep 2;
if (((_callerCursorTarget isEqualTo obj1) || ((_scanner distance obj1) < 500)) OR ((_callerCursorTarget == obj2) AND ((_scanner distance obj2) < 500))) then
{ systemChat "Target confirmed.";
} else {
systemChat "No match. Either wrong vehicle or too far < 500 m";
};
};
//add scan action to object
player addAction [
"Scan for target",
{
params [_target, _caller, _actionId, _arguments];
_scanCaller = _this select 1;
_scan = [_scanCaller] spawn test_fnc_scan;
},
[],
0,
false,
true,
"",
"true",
-1
];
@tough abyss
I am trying to find _ctrl or _display for tooltip when you hover over some item in inventory. Anybody got idea how to find it? I want to add something there. here is picture what I mean. https://i.imgur.com/ZDURrmP.png
On a modded item or on the arma 3 item ?
arma 3 item
Hi Everybody.
I want to create a whitelist with a text file.
With a preprocess for get the array on the txt file. It's for i can add a PlayerUID without need to restart the mission
@stable badger WithloadFile/preprocessFile, launch Arma with the-filePatchingparameters and place yourwhitelist.txtin Arma 3 root directory and then you can just useprivate _ids = call compile loadFile "whitelist.txt"to fetch all the ids. Keep in mind that it's sqf so you need to enter valid code in there (i.e: an array of ids) or write an Arma Extension https://community.bistudio.com/wiki/Extensions (shouldn't be to hard, regardless of the language you chose) and then juste parseSimpleArray the output and do whatever you want with it (it has to be done from the server, there is no way to do that from the client afaik).
is there a command to get all child controls of _display ?
Inventory display ?
IDD is 602 and child are 633, 638 and 619.
Now you can use the selectedIndex 😄
with this you can do something 😄
addEventHandler ["InventoryOpened", {
params ["_unit", "_container"];
}];
how do you get those specific numbers, show me the way master 😄
You can use https://community.bistudio.com/wiki/allControls to get every controls attached to your Display
Heyoxe faster than me 😄
And if you want more, you can search in the config (either the AiO or directly in-game), there are also a bunch of lists with most utilized idds/idcs and the internet
when I put allControls (findDisplay 602) in debug console, it shows me empty array
Do you have your inventory opened?
can't, ESC will close inventory
I think I found goldmine: https://community.bistudio.com/wiki/Arma_3_IDD_List
For help you. Go to the config in game and search RscInventoryDiary (something like that) and you can see all IDD and IDC
Some are missing. I usually use:
https://docs.google.com/spreadsheets/d/1mfvetmBp2iC44rOzQwNnvlSzQyXAYbkOEw2vhFLLJGg/edit#gid=0 (Spreadsheet with Arma 3 IDDs)
https://dbmst.blogspot.com/2013/05/arma-configfile-display-idd-list.html (Korean website with IDDs and images of the coresponding display)
And if I do not find what I want or enough details: https://forums.bohemia.net/forums/topic/191737-updated-all-in-one-config-dumps/ with any decent editor it should be easy (or do as Bastien said, it works too)
We accept any inputs in #community_wiki
Some are missing. I usually use:
https://docs.google.com/spreadsheets/d/1mfvetmBp2iC44rOzQwNnvlSzQyXAYbkOEw2vhFLLJGg/edit#gid=0 (Spreadsheet with Arma 3 IDDs)
[...]
@cunning crown Huh that is mine actually. But it is rather old and not maintained 😅
It still works, mostly never had to dig trough the config, unless I was doing some weird stuff with the defaults displays 😄
I use that too @cunning crown , not that I really understand the stuff that use IDCs
is it still usefully indated?
Oh, it was @slim verge , replying, not you
apologies 🙂
Np ^^
But I can ansewer anyways; IDDs are for display (think of it like a page), and IDCs are for each individual element of that page. And yeah, it's still usefull, I don't think BI changed the IDDs along the way (and it would be a bad if the every did it)
That's your mistake, 99% of the best programming is done drunk @finite sail
I'm well aware of that, lol
the fact that its monday isnt going to put me off
TUESDAY
ffs
I'm likely completely overlooking something so simple. Is there a way to have drawicon3d display a name for a single unit
yes…?
the text property
@urban tiger ^
see Example 2
https://community.bistudio.com/wiki/drawIcon3D#Examples
Yep, I'm an idiot 😂 completely overlooked that param
Glad to be of some help 😁
blease add description to link kthxbai
why I cant getVariable from server? missionNamespace getVariable "var"; in console works only when I press server exec, tried remoteExec also didn't worked
if it only exists on the server, then only the server can get it like that.
how can I make server show it to all users?
publicvariable “var”; after it is set
with CBA_fnc_notify
idk, never used cba
but I think its not updated
when I set it publicvariable “var”;
if it changes later
you publicvariable it again then. as long as it doesnt broadcast too frequently and the data size isnt too big it should be fine.
you have to publicvariable something when you change it
can I call publicvariable before I want to show it instead?
yes
and each time the variable changes
I like to use https://community.bistudio.com/wiki/BIS_fnc_getServerVariable sometimes, too
good for getting the variable from the server as opposed to the server sending it to clients
call BIS_fnc_getServerVariable; will work from client or I have to use remoteExec?
I have trouble understanding the client/server in arma
it works from client
it 'fetches' the data from the server. as long as the data is a nonlocal (ie global) variable on the server, it works fine
when I execute this command using local exec I get nothing, then I press global exec and get the value, then when I press local exec again I get the value, why?
if you press global, you've grabbed the variable to every client and server
then if you press local, its' already local
when I use local exec I have to press it twice
are you using missionnamespace as the name space in the function?
yes
sometimes, it's a little slow, though ive never known it take more than acouple of ms
are you using the BIS debug to do this?
I am in debug console, connected to dedicated server on my PC
right. and where is the client that you are running the getservervariable function from
on the same PC, I run arma and connect to the server
the same pc?
yes
the server and te client are the same pc?
yes
ok, and you are running the server exe and the game client as two seperate processes
yes
that should work as expected. the server and the client should be different instances.
ok, let me test here because ive never had the behaviour you describe
ok, im not seeing the issue you are
I will add sleep
mm yeah, probably not the issue, especially if the 2 instances are on the same box
they will have 0 ping
I manage to get 12 ping 😄
thats 12 ms, its still almost instant
so, let me get this right
you have a global variable on the server?
I think its global because it is used everywhere
does it start with an underscore?
no
its global, whats it called?
this function should be called from a scheduled environment, which the debug console is not
it still works in practice
its set inside mission.sqf inside if (isServer) then {
it should freeze the game until the result arrives, I believe - unless it is spawned
but dismiss what I say, it's imprecise (and late).
the mission is actually running?
yes
you are right, lou, it should be scheduled, but in practice, unless the server is mullered, it works within a couple of cycles
i dunno, @spiral fractal , it's working for me
how are you launnching the srrver?
definitely too late, I can't read code 🤣
🙂
I'm off 👋 be nice to each other
I use TADST
can you get other variables from the server using the function?
other known variables
only on 2nd local exec
is battleye running?
this might be an artifact of the console like lou suggests, though its working for me on first press
also, i use other debug consoles and they show the same
it might actually be that it is working,
are scripts that rely on the variable failing with undefined variable?
no, everything works fine, I am editing existing mission
unless there's a compelling reason to use getservervariable to 'fetch' the varoable, id be using publicvariable tbh
as long as you aren't doing more than once in a few seconds and you aren't sending massive strings
I dont want to edit every script that changes it to add public "var"
"btc_global_reputation"
oh yeah, hearts and minds
I want to add admin only command so he will be able to check rep
so making so many changes just for it is not worth it...
yes, this would be a good usecase for getservervariable
im wondering if the variable isn't in missionnamespace, has the author tucked it away on the servers profilenamespace, or similar?
it is set in mission.sqf in if (isServer) then {
so its global
yes
in the BIS debug
type the server name into the top box,
and press server xexec
exec
BIS debug is the ingame console?
yes
server name? the title? I did and nothing happen
yes
press escape and the BIS debug console comes up?
yes
in the box under debug, type the variable name and press server exec
in the line between the box and the server exec button, the value of the variable should show
it does but updates only after I execute 2nd time
dunno mate, i gonna give up.. bedtime for me
oh.. instead
instead of the variable name in that box
type diag_fps and press server exec
and tell me what the number that comes back is
53
ok, so the server isn't being killed by the mission
no
I will try to use mission code that show rep when ask civ, I will try to make it work without civ
ok, good luck, i gotta sleep
Thank you! good night
This works:
_action = [
format["Are you sure you would like to upgrade your security for: £%1", [_cost] call RR_fnc_numberText],
"Upgrade Security",
"Yes",
"No"
] call BIS_fnc_guiMessage;
This throws this script error: https://i.imgur.com/qxRKkXi.png
_action = [
format["Are you sure you would like to split £%1 of your funds? Each member selected will recieve £%2.",[_fundsToSplit] call RR_fnc_numberText,[_fundsPerMember] call RR_fnc_numberText],
"Split Funds",
"Yes",
"No"
] call BIS_fnc_guiMessage;
need some help with this one
See the comment by "Eden" on https://community.bistudio.com/wiki/BIS_fnc_guiMessage
aka put a spawn block around it
how would I grab the pbo name of a cursorTarget
typeOf?
thats class name
Hello! im looking to find a script that will enable me to make an object an intel item in eden, ive searched forums to no avail, any help?
Tried those, they were meh, hoping for something simpler ig
I dont think those wormk @spring lodge
any one know how to get this to work 'Mortar1 commandArtilleryFire [getPosATL[thislist select 0], "8Rnd_82mm_Mo_shells", 6];' its in a trigger and im getting an error saying type array expected object
Mortar1 commandArtilleryFire [getPosATL(thislist select 0), "8Rnd_82mm_Mo_shells", 6];
the getPosATL requires an object, by putting thisList select 0 in [] you are making it an array
@light moat have you experimented with https://community.bistudio.com/wiki/BIS_fnc_initIntelObject ?
[this] call BIS_fnc_initIntelObject;
this setVariable ["RscAttributeDiaryRecord_texture", "a3\structures_f_epc\Items\Documents\Data\document_secret_01_co.paa",true]; //Picture
[this,"RscAttributeDiaryRecord",["Top Secret Docs","These Docs outline the enemies defenses"]] call BIS_fnc_setServerVariable; //Title, Description
this setVariable ["recipients", west, true]; //The sides that the diary entry is shared with
this setVariable ["RscAttributeOwners", [west], true]; //Sides that can interact with the intel
@spring lodge I have, to no avail mayve im doin somethin wrong?
hmmm ok thats a problem then that mortar fire scrip will drop shells exactly where the player is rather than where they where when the percived call was put in
Little help with this bit of code plz Mortar1 commandArtilleryFire [getPosATL(mortar1 getHideFrom (thislist select 0)), "8Rnd_82mm_Mo_shells", 6];
For my own sanity: Mortar1 commandArtilleryFire [getPosATL(mortar1 getHideFrom (thislist select 0)), "8Rnd_82mm_Mo_shells", 6];
sorry i dont know what key you talking about
there im an idiot
would it be
Mortar1 commandArtilleryFire [(mortar1 getHideFrom (thislist select 0), "8Rnd_82mm_Mo_shells", 6];
well its not throwing up an error when i close the trigger
That will try to find object 'mortar1' and drop 6 mortar rounds on it. So essentially, its own position.
The first argument of getHideFrom is the thing you want to find, the second is which enemy should be looking for it. If it doesn't find one, it will return [0,0,0] which will just try to fire at a corner of the map.
soooo Mortar1 commandArtilleryFire [((thislist select 0) getHideFrom mortar1), "8Rnd_82mm_Mo_shells", 6];
I have flipped the order of getHideFrom, sorry. Assuming they're within a trigger area, and you have it set to 'players inside area' it will select one and try to fire 6 mortar rounds at it. The prerequisite being that the 'Mortar1' knows where they were/are, or it will return [0,0,0] and try to fire at the corner of the map.Mortar1 commandArtilleryFire [(Mortar1 getHideFrom (thisList select 0), "8Rnd_82mm_Mo_shells", 6];
If you don't care whether the mortar knows or not, and you just want them to fire use Mortar1 commandArtilleryFire [(aimPos (thisList select 0)), "8Rnd_82mm_Mo_shells", 6];
making a piece of intel
if (isServer) then {
comment "Diary picture";
this setVariable [
"RscAttributeDiaryRecord_texture",
comment "Path to picture";
"a3\structures_f_epc\Items\Documents\Data\document_secret_01_co.paa",
true
];
comment "Diary Title and Description";
[
this,
"RscAttributeDiaryRecord",
comment "[ Title, Description]";
["Top Secret Docs","These Docs outline the enemies defenses"]
] call BIS_fnc_setServerVariable;
comment "Diary entry shared with.. follows BIS_fnc_MP target rules";
this setVariable ["recipients", west, true];
comment "Sides that can interact with intelObject";
this setVariable ["RscAttributeOwners", [west], true];
};```
says im missing a bracket somewhere
any help?
those comments inside of arrays cant be doing you any favours
what do you suggest?
move them out of the arrays or dont have them
In general, comments should make something easier to read.
so something like this then?
if (isServer) then {
this setVariable [
"RscAttributeDiaryRecord_texture",
"a3\structures_f_epc\Items\Documents\Data\document_secret_01_co.paa",
true
];
[
this,
"RscAttributeDiaryRecord",
["Top Secret Docs","These Docs outline the enemies defenses"]
] call BIS_fnc_setServerVariable;
this setVariable ["recipients", west, true];
this setVariable ["RscAttributeOwners", [west], true];
};```
missed the first one
right
specifically the comment inside the first setVariable and the BIS_fnc_setServerVariable call are the issue
comment "Path to picture";
and
comment "[ Title, Description]";
so then without the comments my bracket issue may be gone?
okay one more question, i dont want the picture file path, should i just remove that whole line in
"RscAttributeDiaryRecord_texture",
"a3\structures_f_epc\Items\Documents\Data\document_secret_01_co.paa",
true```
@robust hollow
replace it with an empty string ""
or just dont set the variable, probably a better idea
if (isServer) then {
[
this,
"RscAttributeDiaryRecord",
["Top Secret Docs","These Docs outline the enemies defenses"]
] call BIS_fnc_setServerVariable;
this setVariable ["recipients", west, true];
this setVariable ["RscAttributeOwners", [west], true];
};```
yea
if I create sqf file with function in it and then in init_server I add: [] execVM "scripts"; can I later call function from that file like this: [player] remoteExec ["my_fnc_doAction", 0];
if my_fnc_doAction is also defined on the target, yes
target is the player?
In this case, yes.
in ur example, it is every player and the server
if I set to 2?
yea, that will specifically send to the server
this function will teleport player into heli cargo, if I send the player as param it should work no?
Rather depends on your function, I think.
thanks @fading barn any way to make mortar1 know about the person who triggered the trigger
Yes.
mortar1 knowsabout (thislist select 0)==4
Mortar1 reveal [(thisList select 0), <some number from 0 to 4, 4 being maximum knowledge>];
ahh ok
Would probably be better.
But like I said before, you can just use the second example if you don't care whether the mortar actually knows what it's firing at. E.g. unless you'd like them to potentially warn other units, or continue to fire after the trigger ends.
basicly i have the code in a repeating blufor detected by Indi trigger and every time they are spotted a short time later the mortar fires on that last position
when I run remoteExec it will execute the code on server, so it will have access to all the server variables and missionNamespace right?
and inside that code I can use commands that are AL, AG without additional remoteExec?
yes
If it's repeated, maybe turn down the number of rounds fired from 6? They're firing to hit the player's position directly, unless they're bookin' it pretty fast they're gonna get wrecked. ~15 seconds to ~45 seconds at the longest to be out of the splash range or they're in a lot of trouble.
when I pass function name into remoteExec server will find the function and execute?
just to be clear though, missionNameSpace is "Server variables". every game instance has its own missionNameSpace where global variables are stored.
i got it firing every 2 min
if it is defined on the server, it should work, yes.
Don't know why tooltip is not working, tooltip is not set
player addEventHandler ["InventoryOpened",
{
params ["_unit", "_container"];
_unit spawn
{
waituntil { !(isNull (findDisplay 602)) };
{
_x ctrlAddEventHandler ["LBSelChanged",
{
params ["_control", "_selectedIndex"];
diag_log format ["LBSelChanged | _control: %1 | _selectedIndex: %2", _control, _selectedIndex];
_control lbSetTooltip [_selectedIndex, "my tooltip"];
lbSetTooltip [ctrlIDC _control, _selectedIndex, "my tooltip"];
}];
}
forEach (allControls (findDisplay 602));
};
}];
@cunning crown @stable badger @distant oyster @finite sail
Yeah, but you've got it firing 6 rounds every 2 minutes. That's a lot of mortar rounds.
its mainly for exfil under fire scenario
It's your script, I was just giving you a heads up in case you didn't know.
also im ironing out the creases i might drop the rounds
any way to increase dispersion or rounds
Yes.
my code works in SP and MP, not on dedicated server 😐
