#arma3_scripting
1 messages Β· Page 493 of 1
enforced styling via functionality
the alternative would be some weirdo crap like in JS or python where global variables are "global" or not depending on a keyword that was placed somewhere fairly random
int number = 42; //global variable
void MyFunction()
{
int myNumber = 12; //local variables
}
no need to bother with _
as JS will only put a variable in local space if you use the var keyword
state enforced styling
SQF is not typed in that way as you know
this is what sam hyde warned us about
as i said: you know SQF is not typed at compiletime so the above is not possible at all
"int" this is so old
Its 2018 we shouldnt have to say int and crappy things
indeed @compact maple
even c++ nowadays got the auto keyword
SQF has the private keyword that works somewhat simmilar
and the reason for the differentiation of private and global variables was probably due to cost and the namespace problem
as global variables are not actually global variables
and rather sqf foo = "bar" is a handy shortcut for sqf missionNamespace setVariable ["foo", "bar"]
didnt know that lol
If you know the type of variable you want to assign and result in, why would you type it dynamically over strongly typed?
it is not getting transfered to that in the SQF-Assembly @compact maple
but that is essentially what happens
@earnest ore ask pyhon, JS, Go, PHP, those weirdos using dynamic in C#, ... ppl
there is reason for and against compile-time known typing
Type declarations are pretty awesome when doing object oriented things
not needed there either
even SQF can be done object-oriented
though ... the implementations differ in speed and usability
one of those is what https://github.com/X39/ObjectOrientedScripting does to actually put OOP into SQF
Might not be needed, but when I'm doing a big project, even in PHP, it's good to actually declare in function parameters what types are expected
I'm not trying to comment here on sqf, just on the thing of why are people still declaring types in 2018
^
And while I'm guessing it was just a tongue in cheek comment, this is the internet and I am bored π
anyone have problem with Corpse Manager?
tested with
corpseManagerMode = 1;
corpseLimit = 1;
corpseRemovalMinTime = 5;
corpseRemovalMaxTime = 5;
added unit to NOT remove it
//removeFromRemainsCollector [unit1];
still got removed
addToRemainsCollector/removeFromRemainsCollector < had no luck with those
(just mission eh works π)
Well I got corpse manager to remove dead bodies to improve performance, but I have set of "dead bodies" in destroyed convoy for immersion, but those corpses are getting removed so when players found destroyed convoy, no corpses around
I marked those corpses with removeFromRemainsCollector but they got removed anyway
yeah, like add loop to each killed unit to delete body after x minutes, and exclude those copses, but WHY, if we have nice BIS solution that should work
that should work != works π€·
BIS taught me to find workaround for even simplest task, damn you BIS !
if that whole system was not moved into engine, then this is how it looks > https://gyazo.com/7215a9393cb8734f8e785a9dcb271ca7
Timing. Remove them from GC prior to making them corpses.
@earnest ore so remove them from Corpse Manager before they become corpses ?
Mhm. Something like:
{
_x setDammage 1;
} foreach (units this);
That's in the units init.
@earnest ore Removing unit from GC before it becomes corpse - worked
Which begs the question, how do you pose the corpses?
I place units in editor and run unscheduled script (execVM) on them where I setDamage 1 to unit. Before that I remove unit from GC
execVM is scheduled dude π
@earnest ore makeCorpse.sqf where I setDamage 1 to unit, remove weapons, spawn blood around, add flies, add flies sound loop, etc ...
@meager heart yup, my mistake π
here is final result ... https://imgur.com/EHebF38
How might an addaction look that grabs a list of items from an inventory and adds them to a character, so that they don't have to grab items one at a time?
It will be considerably more easy to just make the addaction add the items to the players witohut removing it form the box. unless you want limited ressources
Something like:
This addAction ["Equip Rifleman Kit",
_unit add ammo;
this remove ammo;
etc.,
];```
Roger. Limited resources is a necessity.
It's a persistent sandbox with a logistics system, so we have to order every *magazine to the field.
very rough idea and not tested because i am at work
this addAction [{
params ["_target", "_caller", "_actionId", "_arguments"];
private _cargo = getItemCargo _target;
_cargo params ["_items","_amount"];
private _index = _items findIf {_x = "your ammo class here!"};
if (_index >= 0 && {_amount#_index > 0}) then {
_caller addItem "your ammo class here!";
_target removeMagazineGlobal "your ammo class here!";
_amount set [_index,_amount#_index -1];
};
}];
Yeah... addItemCargo and clearItemCargo exist, but there is no removeItemCargo. I suppose you'd have to look at all the things in the ammobox and either give to player or save it somewhere. Then clear and the re-add.
ther eis however removeMagazineGlobal
Interesting insight, @digital hollow, is there just a direct take item command?
Thanks, @digital jacinth, will look it over!
i updated the code snippet a bit, so that might be going in the direction you want
Sweet! Thanks a ton. Will report results.
Does removeMagazineGlobal work on ammobox/weaponholder? It says for unit.
you probably want the cargoGLobal commands
There's https://community.bistudio.com/wiki/BIS_fnc_invRemove, but the example is for unit. Not sure if it works on weaponholder.
OHH wait
You can't remove items from containers
you can just remove all and readd the ones you wanna keep
I think you can if you know item Id, which you donβt have means to obtain
Pretty sure you need to use let in JS if you want to limit var to a scope @queen cargo
I got confused myself before too
I think var scopes to function while let scopes to code block or something like that
and people say sqf would be complicated .. π
π
it's the curse of continually updating languages to keep up with the times, you're gonna have a lot of old stuff sticking around
Yeah, let is block scope while var is function/global scope. But it is sqf channel isn't it π€
SQF was only complicated for me because it was the first language i learned
now that i get it it's really pretty simple
IMO learning sqf is harder if you were already working with other languages.
@hollow thistle nah not really
If you know c# or c++ itβs super simple
Or even lua for that matter
The learning aspect is part of the problem but honestly the main issue is always tooling. There are very distinct advantages to not making up another language unless you have to, many many languages could have been embedded and used for Arma's scripting purposes and then with the right integration we get decent debuggers and profilers and testing tools and all that jazz.
i mean i was able to get a basic rundown of C++ from a friend of mine and i pretty much got it
and the only language i'm proficient in is SQF
I can see why we might want a language that does things vastly different, it isn't like c++ is the best thing for everything, I'll choose just about anything other than c++ given the choice. But SQF isn't special as a language, it is pretty primitive and quirky. I don't rate it as far as languages go and from what I have seen from enfusion I don't think that is going to bring anything new or interesting either. Things could have just been easier, this feels like the more difficult path for BI and for the modders.
foreach in other languages: https://en.wikipedia.org/wiki/Foreach_loop
foreach in sqf
{
code
} foreach array;
I will never understand this. Ever.
binary operator that consumes code and an array π€·
how about array and code :U
Cool, let me just pass this to another scripter.
Instead of immediately knowing that's a foreach from the beginning, he must go through multiple lines of code to find out it's a foreach loop.
@earnest ore
SQF;0;25;{ code } foreach array;
BEXP4;0;0;
CODE;0;10;
VARIABLE;4;4;code
BINARYOP;11;7;foreach
VARIABLE;19;5;array
``` no problem bro
Completely backwards.
you could ask BI nicely if they would provide you with a copy-cat that just swaps the operators
<ARRAY> forEach <CODE>
if it makes you happy π€·
Sure, I could. Would they?
as i said
ask nicely and it may happen
You just all spoiled because of apply and select, before those {} forEach [] was completely normal construct
Does cameraView work to determine whether a vehicle gunner is using his optics (control-rmb) or not?
Should return GUNNER no?
https://community.bistudio.com/wiki/cameraView
Says Returns mode of active camera view. Mode is one of: "INTERNAL" (1st person) "EXTERNAL" (3rd person) "GUNNER" (optics / sights) "GROUP" (commander view)
Which to me implies it might work but I'm not sure and I don't have a whole thing built yet to test it
Because weapon optics use a different keybind than vehicle optics and so I wonder if they're the "same thing" as far as Arma is concerned
As infantry, GUNNER is returned when looking down iron / scope. Same deal with vehicles by the looks.
is possible to run script in main menu?
yes
@dusky pier Main menu is also a display, RscDisplayMain it also can run events like onLoad if you replace them.
Iβm curious https://forums.bohemia.net/forums/topic/219881-remoteexec-jip-playback-reversed/ if this is true
I don't believe its reversed but can trust that is not guaranteed by order.
That should be checked.
Especially if you use spawn in a remoteExec, since logically scheduled is not guaranteed by order 100%
It shouldn't really be referred to as the JIP queue anymore then.
When calling a function that has optional values with default settings, how can you set a variable that comes after a 'blank' one when calling the function? So if I wanted to do [thing, otherthing] call function where the first element's default value is 'thing', but I want a different value than 'otherthing' in the second position
is this something that needs to be done within the function?
[nil, otherthing] ?
@unborn ether thank you!
Ok Iβll bite. The JIP order is precise, consistent and is exactly the order in which remoteExec commands with persistent flag were executed. Whoever tells you that there is no guaranteed order, the order is reversed and other nonsense - ignore it
i'm trying disable fn_feedbackMain.fsm use ```sqf
fn_feedbackMain setFSMVariable ["stopfsm",true];
terminate fn_feedbackMain;
@meager heart it needs to be done through script before the mission fully loads up. For example a guy says "help page2" i need it to get the first and second bit of the message so i can run a script off of it.
someone known how to script throw of dice, i think i need use "random" but i don't have any idea how to build that type of script.
ah yeah. round would have lower chance for 0 and 6
actually the problem is that you either do not want the 6 or the 0 π€
though .. that part is true too π€· π
selectRandom [1,2,3,4,5,6] Β―_(γ)_/Β―
round random [1,3,5]
random 6 < will not return 6 afaik π€
Random real (floating point) value from 0 (inclusive) to x (not inclusive).
from the wiki ^
@tawdry harness idk what you mean here it needs to be done through script before the mission fully loads up
but "the ez way" for those messages > https://discordapp.com/channels/105462288051380224/105462984087728128/502003571420823552
Yes it won't
highest value is 5.99999999999999999999999999
but rounding 5.5 should return 6.
π π€·
floor(random 6) + 1
See Hcpookie's comment in: https://community.bistudio.com/wiki/random
and ? π
round is weighted against the min and max.
If the stars align, ceil returns 0. Die creates a wormhole.
The above is uniform, +1 just shifts 0 - 5 to 1 - 6.
Enjoy your working die.
Now you can D&D in your ARMA.
ceil random 6 < what's wrong here ? π
... I just said what's wrong.
π
my post above was about > just random x will actually not include x, nothing there about dice... π
@keen pewter asked about how to implement a dice.
?
lmao
π¬
_group = [position player, civilian, 5] call BIS_fnc_spawnGroup; civilian is not a side ?
try it, it will not spawn 5 civilians :/
if I do _group = [position player, civilian, ["C_man_1", "C_man_1", "C_man_1", "C_man_1", "C_man_1"]] call BIS_fnc_spawnGroup; that is working. BIS get your shit together π
BIConsistency β’
i guess there are no cfgGroups for civs π€
Anarchy!
oh... nvm... that function not uses cfgGroups... π
#BIConsistency then
BIS_fnc_spawnGroup > https://pastebin.com/kTu5aPwz
setUnitAbility does something (afaik was disabled) ?
_this param [10,10e10,[123]]; π
^wut
So i have a system that is meant to persist FOBs that people are building in my mission, and im having an issue with the objects not being returned to their correct positions on load (I figure because of collisions). Here is what I've tried so far:
_x params ["_class", "_pos", "_dir", "_vector"];
_obj = createVehicle [_class, _pos, [], 0, "CAN_COLLIDE"];
_obj enableSimulationGlobal false;
_obj setPos _pos;
_obj setDir _dir;
_obj setVectorUp _vector;
_obj enableSimulationGlobal true;
What does it take to make sure an object gets put at an exact poisition w/o the issue of it getting misplaced due to collision?
I dont really think you can avoid that, because when creating it it always face the same direction and then it turn, from my experience...
what if i turned it and then set pos?
that seemed to yield much better results
im guessing setvectorup and setDir take collision into account, and setpos doesn't
@tame lion I have a similar systme to create whole towns from scratch. I ran into the same problem of the object being slightly misplaced. You can use getposWorld and setposworld, as these do just set the object withotu checking collision.
Another thing is use setVectorDirandUp for dir and up vector
ill have to change that then, although it seems simply placing the object last did the trick for me though
setposworld is also a bit faster then setPos, not that it matters for many things, the useful part is really that it does no collision checks.
@tame lion use the other setpos commands
would you recommend ATL?
depending on what is used as the object center
i mean i move them by setpos to location of their waypoints
sounds logical
if their simulation is disabled they should interact with the world less
hmmm that would explain some issues
can i make the waypoint completed somehow?
id like it to execute its statement
@meager heart it cant be done through debug console
I could probably put in a different condition for the waypoint?
Like proximity or so?
So it would work for units with and without simulation enabled?
I suppose the βtrueβ there could be replaced with something
My googlefu is weak, is there any information on how to manipulate keyframe animation modules from EDEN via sqf?
i think of something like show adaction on any item (throw dice) and show resulted for all people on server in hint but i don't known how to property usage "random" command
what's the command to import a .p3d model into arma 3 mid-mission?
i know it exists, i just can't remember
you guys show mi some light for my question
https://community.bistudio.com/wiki/createSimpleObject nevermind, found it
you have a shooter and your idea of entertainment is a dice game?
Roll 1.
Critical failure.
Russia launches tactical nuke - it's super effective.
russian roulette simulator would be similarly interesting
Hey guys, a little question, it seems I can't use "sleep" in a function wich is called by a event handler, is that true ? And if I'm right about this point, how can I do the same thing ?
eventhandlers are unscheduled
yes you cannot sleep
you can only sleep in scheduled scripts. Which you can "create" by using the spawn command
productVersion @simple solstice
@tough abyss thanks, I asked google the wrong questions then!
deleteAt deleteRange
is there a script for random mission makers for invade and annex
Does Arma's modding capabilities allow for sidechain compression of sound? Example: While a loud explosion noise or gunshot is heard near the player, all other audio is temporarily lowered in volume
ACE hearing kinda does that.
Loud shots make you deaf. Makes everthing else go more silent
Does that mean there is an API to independently adjust the volume of every sound being heard by the player?
independently no. All sounds at once, yes
got it, thank you!
If I am not mistaken, there are two ways to mod Arma: through CPP and through SQF. CPP offers more customizability, is this correct?
cpp is just configuration
got it, thank you Rylan
I was going off of a memory from seeing a CPP mod be able to remove zoom on all weapons
Yep. That would require CPP and not be possible with SQF
and there are many things that are the other way around
Also you can write SQF inside CPP files. So that question overall is a little unclear
lol oh man
dang, I wish I had access to the list of all sounds a player was currently hearing
If you are making a mod,you would need it and you can use config entries in scripts but it's not like you can create new commands or anything drastic
Without Intercept that is π
https://community.bistudio.com/wiki/getAllSoundControllers
https://community.bistudio.com/wiki/getAllEnvSoundControllers
You might be able to do something with these
oh snap, Intercept allows me to write all of my SQF scripts in CPP? That sounds like a great vehicle to get me exposed to CPP
my day job is Javascript, and I am always eager top get more low level π
What CPP are you talking about?
Arma configs are cpp files but they are not c++.
Intercept is a C++ SDK.
it is just the same syntax if I understand correctly
@runic surge awesome! taking a look
It is long long way from JavaScript to C++
Yes. Intercept could do that for you. Keep in mind that it doesn't work with battleye yet and that every player needs it loaded as a mod.
Both these downsides don't apply to SQF
oh, thanks for the heads up @still forum
Omg, a sound filter can have its own cutoff range? AKA a low pass filter can be partially engaged at range? That is so tight!
#DJArma
I've moved over from Propellerhead Reason to Arma for my new Witch House songs
@iron osprey there also is sqf-vm to use sqf outside of arma π€·
Is the use of (str _x) in this, acceptable? ```sqf
_addons = activatedAddons;
_addonsSTR = [];
{
diag_log format["[CAP Addons Check] %1 - %2",(getPlayerUID player),_x];
_addonsSTR pushBack (str _x);
} forEach _addons;
_timestamp1 = time;
sleep 60;
_timestamp2 = time;
while {_timestamp2 > _timestamp1} do {
CAP_timeout = true;
};
waitUntil {"BW_WalkableMovingObjects" in _addonsSTR or CAP_timeout};
if ("BW_WalkableMovingObjects" in _addonsSTR) then {
[
["SYSTEM","You have an activate Addon that is not Allowed. Please unload: Walkable Moving Objects | @WMO - Walkable Moving Objects.",0],
["SYSTEM","You have an activate Addon that is not Allowed. Please unload: Walkable Moving Objects | @WMO - Walkable Moving Objects.",5],
["SYSTEM","You have an activate Addon that is not Allowed. Please unload: Walkable Moving Objects | @WMO - Walkable Moving Objects.",10],
["SYSTEM","You have an activate Addon that is not Allowed. Please unload: Walkable Moving Objects | @WMO - Walkable Moving Objects. YOU WILL NOW BE DISCONNECTED FROM THE SERVER!",15]
] spawn BIS_fnc_EXP_camp_playSubtitles;
sleep 15;
["end1",false,5,true,false] spawn BIS_fnc_endMission;
};```
activatedAddons is already an array of strings
Why do you want string of a string?
Delete everything above the if check, and then use ```sqf
if ("BW_WalkableMovingObjects" in activatedAddons) exitWith {};
wut? in is case sensitive
Correct. so if "BW_WalkableMovingObjects" isn't cased correctly, it's not going to work properly
Or use findIf
or the mod gets renamed
or or or
activatedAddons gets the .pbo name correct?
I think activatedAddons return lowercase names but not 100% sure
Like with allVariables
All the arma 3 default addons are returned as lowercase, but not 100% sure if that's because of the command, or the addons
Sorted it. Thanks @ruby breach
taken from config.binsqf raP CfgPatches I CfgFunctions Γ CfgVehicles Γ§ BW_adaptive_roadway h Γ units
is it possible to get a model's bounding box dimensions without useing an object?
I need to get that info without spawning any objects
I am using info like slope angle, steepness, position, etc, and those same parameters of positions within the bounding box area of a given object to determine if the location is a good place for said object to spawn
so if there is a drastic change in 'steepness' on one side of the position within the bounding box, the position isn't good
you probably could form some sort of a database to read from
but other than that can see a way to do it without spawing the object first
I already use object presets so I guess I'll just add some more elements to the array of each object
minor inconvenience really
using big objects on bumpy terrain results with a lot of overhanging objects that don't fit into the terrain well with just a single position
same issue with the average of several positions as well
so I'm getting more specific
You could try sizeOf for a rough estimate
NOTE: The object has to be present in current mission to be able to read its size (otherwise zero will be returned).
Same issue with the other commands
Yeah a bit retarded, why make argument a type name if you need the object to exist, could have been object argument.
Does netID of an object ever change by any conditions?
So I just started learning to script and I've been following this DevTeam Paxton guy, I've gotten to his cfgFunctions tutorial where he has you create a scenario where an on load a player will have weapons removed, and on JIP they do (ie he puts nothing there). can anyone help me out?
To be clear I've got simple commands to work on and off JIP (like hint"") I'm just having issues creating and calling functions (in this case removeAllWeapons _player)
@runic surge You could spawn an object for a ms. Check the object then delete it.
@tough abyss
What do you need help with?
That's not at all efficient or performance friendly. I have been avoiding those types of solutions
@runic surge Well if it requires an object - you have to. I would use boundingBox with createSimpleObject
The last one is not actually a full operation vehicle, so it will not take much.
I am just using preset values for preselected objects
maybe you can try findEmptyPosition < it has param vehicleType
If a [vehicleType] parameter is specified, then the search will look for an empty positions that is big enough to hold that vehicle type
@runic surge π
Won't work for what I'm doing
Positions are found first, and then organized with their slope angle and steepness. Every generated position needs to be checked for every given object type and it's preset offset/rotation values
Does netID of an object ever change by any conditions? It should not
One part of the netID is the ownerID. So if you change the objects owner to a HC for example.. It might
I don't know if it's the currentOwnerID or originalOwnerID
Hello ! I need help with the addAction command. I would like to be able to open and close a shed door (tanoa building). But I can not understand how it works. Would someone have a link for a tutorial or explanation?
I can tell you how addaction works but i have no clue on how (or why) to open a door with it
Doors have an open close action already, dont they?
I don't know if it's the currentOwnerID or originalOwnerID original @still forum
@still forum Checked it, so its original owner. If you create vehicle from server side, it will always stay 2:# no matter if vehicle ownership was changed. Just info.
Should maybe be added to the netID wiki page if it's not on there yet
Hi, i'm trying to create mission restart button in inMission ui as walkaround to description.ext's skripLobby setting's ,mission selection screen scriping by hostPlayer issue, how could it be possible?
@still forum Done
hey guys, whats the best way to loop into missionConfigFile, and get the first attribute of every classes ?
@compact maple π what's that for, you don't know your own classes meta?
@unborn ether actually I've created a config to handle the markers on the map. There are category for each type of markers
class Makers {
class Catergory1 {
displayName = "My Category Name";
markerTypes[] = {};
};
class Catergory2 {
displayName = "My Category Name";
markerTypes[] = {};
};
};
Use configClasses and get* commands to utilize your purpose.
Thank you, I've checked the get commands, I saw getText, getArray, etc, but what if I have :
class markers_weapons {
variable = markers_weap;
sigle = "WEA";
};
markers_weap will be an global array.
is that even possible lol
You cant declare and SQF array in a header file that way, unless you are using __EVAL and similar preprocessing commands.
Im not declaring it, I just wanted to reference it to the actual class
But I guess I'll change that
is that even possible lol Id say yes, even though I donβt quite understand what you re asking
Hey guys, does someone know if it's possible to check if a variable is a valid number ?
isEqualType
Oh thanks, I'll try this
Ok, that didn't work, the question is : is there a way to check if a variable is defined ?
!isNil "varname"
I think it won't work on a number.
I have something funny out there x)
It says I can't use "isNil _tookDamage" because... _tookDamage is not defined π
Well.
Obviously
read again what @tough abyss wrote
You need to use "
you want to check if the variable exists. Not if the content of the variable is a name of a variable that exists
Is there some multiplayer mission using the new task system properly and with a non-weird implementation?
There is no new task system, just old task system wrapped in questionable sqf wrapper
questionable as in "don't use it" ?
As in is it worth it?
You have bare commands available, does the sqf wrapper make it easier and more reliable?
idk i would expect the "wrapper" to take care of mp syncronisation and stuff like JIP handling
Well, this raises questions, hence βquestionableβ
I'm a fan of not experiencing suffering myself that other people have already suffered thru
i would assume tasks are such a basic thing that there is some established way to do it that is considered best practice ?
i see.
all you really need is just > https://community.bistudio.com/wiki/BIS_fnc_setTask + https://community.bistudio.com/wiki/BIS_fnc_taskSetState π
also for the Shared Objectives option, you can just use editor options
Shared objective can be added to mission from EDEN editor by:
opening Attributes >> Multiplayer >> Tasks >> Shared Objectives panel
selecting either: 'Enable' or 'Enable with Task Propagation'
If 'Enable with Task Propagation' is selected, system automatically re-assigns tasks to every subordinate according to the group leader whenever the leader changes his assigned task.
done
@waxen tide π
ok thanks. β¬ββ¬ γ( γ-γγ)
hey guys
{
_name = getText (_x >> "name");
_variable = getText (_x >> "variable");
_sigle = getText (_x >> "sigle");
_icon = getText (_x >> "icon");
_img = _display ctrlCreate ["RscPictureKeepAspect", -1];
_img ctrlSetText _icon;
_img ctrlSetPosition [
_posX,
0.94 * safezoneH + safezoneY,
_w,
_h
];
_img ctrlCommit 0;
_btn = _display ctrlCreate ["RscInvisibleButton", 74102];
_btn ctrlSetText "";
_btn ctrlSetPosition [
_posX,
0.94 * safezoneH + safezoneY,
_w,
_h
];
_btn ctrlCommit 0;
_btn buttonSetAction "[1] call fnc_markerDisplay;";
_btn ctrlSetTooltip _name;
_posX = _posX + (0.01 * safezoneW + safezoneX); <<< I struggle here. How can I incremente this to make all of my pictures aligne with the same space between them
} forEach _allMarkersCategory;
are you sure about buttonSetAction ? π
check this > https://community.bistudio.com/wiki/buttonSetAction
we have ctrlAddEventHandler ButtonClick
well the buttonSetAction work
You are setting _posX after you use it?
What next image? It is destroyed at the end of the scope so it is undefined at the beginning of next iteration
I have a gear script that runs fine when I spawn AI on the server and keep them on the server, but after I installed a headless client script, the AI are now just naked after ownership transfer. Does anyone know of a simple solution to this? I should probably have just done my own headless client script, but I didn't, and I wonder if there is an easy way to fix this.
@shadow sapphire Its hard to understand some context without code itself. Using command like setUnitLoadout doesn't care where it was executed, while addWeapon and similar commands are AL so, if your unit is not local to your headless client - it will have no item/weapon/magazine added this way, etc.
So if you spawn unit with server and then addWeapon on HC, only HC will see it in its gear.
Ah! Neato! Good to know! Yeah, I was not using setunitloadout. Is there a drawback to using that command? I'll read up on it.
getUnitLoadout gets the current loadout - gear it up, save, and then use setUnitLoadout
Hmm... there is a bunch of randomization in my gear script, so I think I'd have to define the loadout classes in script somewhere.
Oh, no. This will make my description.ext file HUGE... Hmm....
use SQF variable then
private _loadouts = [
...
];
Complete all gear sets, get them, store in array and then make a function of it to gear units.
All gear sets are complete. I don't know how to store them in arrays.
getUnitLoadout?
Oh! So I can just wrap them in the getUnitLoadout syntax as they are?
I think I'm getting it.
I'll have to remove the loadouts from my switch script.
You have units types, you have units, gear every unit and convert all that add* to a function with all needed gear loadouts stored.
Using getUnitLoadout and setUnitLoadout
Will do. Thanks a ton!
Is it possible to have multiple 3d waypoints (such as a task destination) visible to a player at once?
afaik nope, only current wp with the "wp text/description" will be shown @iron osprey
thanks @meager heart. I'm scratching my head at a good way to communicate asynchronous goals to a first time user. So far I can only effectively communicate a linear sequence of goals via tasks, task destinations, and advanced hints to accompany a task
might need to hop in to a custom GUI : O
You probably get this question quite a bit, but what is the best way to start scripting in Arma 3 as a complete beginner?
can u do an if staement in an Addaction?
yh
@copper needle
https://community.bistudio.com/wiki/Initialization_Order
https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3
https://community.bistudio.com/wiki/Category:Arma_3:_Functions
https://community.bistudio.com/wiki/PreProcessor_Commands
http://killzonekid.com/category/tutorials/
object addAction [title, script, arguments, priority, showWindow, hideOnUse, shortcut, condition, radius, unconscious, selection, memoryPoint]
do whatever you want in the condition part of it
and use default values for the other ones, unless you want them changing
player addAction ["Equip Gear", tag_fnc_EquipGear,, 8, false, true,, player distance B_MRAP_01_F < 2]
would that work @cold pebble
what shall i put there instead
oh yh i got tit
it*
player addAction ["Equip ESU Gear", life_fnc_EquipGear,nil, 8, false, true,"", player distance B_MRAP_01_F < 2];
like that then
yup
kk ty x
I basically already have given up at this point π
, but is there any way to remove a backpack from a player without deleting the backpackContainer? The only way I found was letting the unit perform the "DropBag" action, but this is slow and more importantly does neither work when the player is in a vehicle nor when he's swimming.
Any ideas?
Thanks in advance π
action does work only in idle unit stances and also interruptible. The only way is to create a weapon holder beneath the player (better simulated) and parse the backpack gear to it.
yeah but I need not the content of the backpack - that's not a problem at all - but the backpackContainer itself π¦
backpackContainer is link to a dull cargo object for backpack, so it's somewhat the backpack itself, so if you just want the backpack itself, addBackpackCargoGlobal to a weapon holder and removeBackpack
You misunderstand π
I know what backpackContainer does ^^ I don't need a backpack with the same content. I need that specific object.
The goal is to to add the backpackContainer of a unit to a specific weaponHolder. (Not "just" a backpack with the same content)
so stuff like addBackpackCargoGlobaland removeBackpack won't work for me
because I deletes the object / creates a new object
Is there any handle in the BIS Virtual Garage that can be used to extract the vehicle information and spawn it globally? π€
You are talking about creating a new link on existing backpack - well no, i don't know any ways
I know I can manually give it velocity, but that wont activate the jets and what not
how can i get a list of all child classes of a class?
@waxen tide that would be BIS_fnc_getCfgSubClasses
thanks!
@waxen tide thanks ! I needed this
weird, me too
@waxen tide @compact maple configClasses mates
@unborn ether yep its good, everything working but my image popping lmao
Just in case its better to use "engine solution" instead of BIS_fnc_ if we have one ofc.
Right, I used this :
_configs = "true" configClasses (missionConfigFile >> "CfgVehicles");
with my own Cfg
@unborn ether thanks. It seems i get the entire path then tho? Is there an easy way to cut down on that? (checked the wiki, wasn't obvious to me yet)
is there a way to get the relative Z position from a given rotation and position?
I am trying to find a position that is higher than another relative to it's surface rotation
so basically as if that point on the ground was flat instead of global values
I have an angle and a position to work with
how about attaching something to it on a higher Z position and fetch its pos?
I don't want to do that because I would have to create two objects and delete them, which is one thing I am trying to avoid
ok
I need to get this info for thousands of positions at least
what are exactly are you making?
I am finding positions that have very specific conditions for object spawning
I can spawn something on a slope of a certain amount of degrees, and I can find flat areas, but I can't find 'flat' areas that are tilted at the slope's angle
not sure if I explained that very well
no I didnt understand lol
I don't know how to explain it but I might be able to achieve what I am attempting by looking at the difference in slope direction (which is downhill)
Of what?
I'll try to come up with some sort of visual example next chance I get
make a drawing
I am going to make a diagram with a blender screenshot
from your description, what i imagine is your trying to spawn two objects, one uphill from the other, both on flattish terrain
not even close lol I could easily do that with what I have
it's detecting the 'flat' sloped area that is the problem.
making some screens now
it's difficult to explain
I am trying to find 'sloped' positions on an existing slope, as if that slope is flat ground. I thought to test for this by seeing if a nearby position is above the others, but that doesn't work on a slope without being able to get relative Z position
https://i.imgur.com/2cjQgXL.jpg
that's kind of a diagram to visualize what I mean
I have a question ...
From the fullπ€ Arsenal ..
There is no custom face list.
How do I add it?
mp.
["AmmoboxInit",[this,false,{true}]] call (missionNamespace getVariable 'BIS_fnc_arsenal'); Will do the trick for others asking in the future
hey :), it is possible to write a forEach into a forEach ?
y
{
_vehicle = _x;
{
_crew = _x;
} forEach crew _vehicle;
} forEach vehicles;
But you don't need to do the variables
So _x do not conflict ?
@peak plover why not? Donβt have to worry from which namespace this is called
If you want to use the vehicle inside the 2nd foreach you need to do above
Otherwise they don't conflict
@tough abyss I guess...
good thank you
yep its working
{
private _name = getText (_x >> "name");
private _sigle = getText (_x >> "sigle");
_currentCategory = [[_name],[],true];
{
_oneMarker = (_x splitString "_") select 0;
if (_oneMarker == _sigle) then {
(_currentCategory select 1) pushBack _x;
};
} forEach allMapMarkers;
TP_MarkersOnOff_allMarkers pushBack _currentCategory;
} forEach _allMarkersCategory;
The point is to be able to disable some markers by clicking on a UI I created.
Every marker created on the map begin with 3 letters, which are in config :
class markers_weapons {
name = "Weapons";
variable = "markers_wep";
sigle = "WEP";
icon = "";
};
When the player connect, I loop into all theses markers, and pushback them in their array according to their sigle
I dont know if its clear but its clear in my head lmao
how many sigles are there?
I would think it would be better to just loop the allmapMarkers once and do a few if checks or a findIf
does anyone know how to effectively put an AI in an AA gunner seat in various 3rd party mods? i can do it, but they dont detect as an enemy.. just curious..
I'd use findIf. But since you are doing this only once and out of gameplay it doesn't matter
It's just that if you ahve 1000 markers (drawings should be markers too) you are doing 10000 iterations
Oh I didnt think of that
Wait, what? A numeric string converts into number when passed through functions as parameters?
Hrm... then:
[getPlayerUID player, true] remoteExecCall ["ZE_fnc_moneyBalance", 2];
params["_callerSteam", ["_silent", false]];
if(zDebug) then { systemChat format ["zDebug (moneyBalance): Client:%1 | SteamID:%2 requested their balance", remoteExecutedOwner, _callerSteam] };
_bank = profileNamespace getVariable "zBank";
_account = _bank findIf { _x#0 == _callerSteam };
_callerSteam becomes a number.
where do you see that it becomes a number?
In the moneyBalance function, i added a hint format ["%1, %2, %3", _account, _bank, _callerSteam];
In bank, the uid was surrounded in quotes, but callersteam wasn't.
format doesn't keep quotes if you insert a string
format["%1", "string"] -> string not "string"
Right, of course it doesn't. /headdesk
When in doubt -> hint typeName whatever
private _iteration = 0;
_btn buttonSetAction "_iteration call life_fnc_markerDisplay;";
Im struggling with this
_btn buttonSetAction format ["%1 call life_fnc_markerDisplay", _iteration]
^thank you !
Is there a simple way to find whether or not a direction is within a certain margin of another on a 0 - 360 scale?
I can't seem to make a functioning expression
if the margin is 10, and the angle is 50, than anything less than 40 and greater than 60 is outside of the margin
but if the angle is 355, or 5, how could I check that?
_dirM = _dirT
if ((_dirT + _marginDir) >= 360) then {_dirM = (_dirT + _marginDir) - 360;};
if ((_dirM > _marginDirMax) OR (_dirM < _marginDirMin)) then {}
_marginDirMax and _marginDirMin are the selected angle to be compared to with added and subtracted margins
I have tried doing this to both the base direction, and the direction being compared
I must be missing something obvious
I was wondering if by any means there is a way to lock ship's doors, for example on the Liberty class destroyer. For buildings there is a variable to assign, but as the ship is built with multiple parts, I have no idea on how I can do this ?
(moved, wrong channel, sorry)
@tough abyss of course that exists
I'll see if that is what I need
sounds like it is
thanks
this only seems to check positions
I should be able to make a modified version though
i use sqf _disp = findDisplay 46 createDisplay "RscDisplayEmpty"; when i need to close this display - use sqf _disp closeDisplay 1; when i close display is deleted? Or just closed
is there a script to referh a listbox. For example, on KOTH the refresh button gets all the new players on the server
Eh, just lbClear the listbox, and run the same code you filled it with the first time?
I only want the elements from all 3 arrays where the _count is the highest number. Anyone got an idea how to do that?
_array_1 = [0,1,2,3,4,5,6,7,8,9];
_array_2 = [3,4,5,6,7,8];
_array_3 = [4,5,6,7];
_count = [1,1,1,2,3,3,3,3,2,1];
does findEmptyPosition not account for terrain objects? I would have figure that would be it's main purpose
doesn't seem to though
selectMax is what you're looking for if i understand correctly @waxen tide
nope
idk how to explain it better
there is multiple arrays, each with elements in it. some elements are present in multiple arrays. i want to find the highest possible number of duplicates an element can have, and then i want to select all the elements that have this highest possible number of duplicates
I'm still careful but that looks like exactly what i need. Thanks! You might be my hero.
@tough abyss One step ahead, much obliged
So my goal is to filter out what i encircled in black and marked with "FILTER OUT" and i want to "detect" the spots i marked orange with "ROADBLOCK" https://i.imgur.com/CrHvhIk.jpg
Not really having a brilliant idea right now for that.
Why not marker and some maths to get some edge of it?
please elaborate?
i don't follow
my goal is to fortify a random city with roadblocks, so i need to find good (tatically reasonable) positions
the marker shit is just for debugging.
oh, was just wondering whats that 100 markers drawing.
Anyone has a function to check is a date is pastΒΏ?
id a date is past?@minor lance
What is the best way to make a R2T display with the correct aspect ratio?
If the date is in the same year you could use dateToNumber on both dates and compare the numbers. If different year, compare the years @minor lance
I used that "dateToNumber " thanks!!
I love how snakes and rabbits creeping me out everytime when they open a house door somewhere around me.. on empty server.
Is there any way to render a DrawwIcon3D inside a cameraΒΏ?
wat
@tough abyss ty
how would you use setVariable on a every unit in a faction? eg setVariable x on all nato units
{
_x setVariable ["blah","bleh"];
}forEach (allUnits select {side _x == west});
Are there problems with onMapSingleClick and it's EH Equiv? I can't seem to get either working anymore
Is there a way to create variables so that everytime the code runs it has a unique ID sort of thing?
I'm not really sure how to explain it well
// Delay for meteor to disapear
["Meteor Strike", "Spawn Basic Meteor",
{
params["_pos","_unit"];
object = "B_RangeMaster_F" createVehicle _pos;
object allowDamage false;
[object, true] remoteExec ["hideObjectGlobal",2];
object setPos (getPos object vectorAdd [0,0,1000]);
fireEffect = "test_EmptyObjectForFireBig" createVehicle position object;
fireEffect attachTo[object,[0,0,0]];
hint format["%1",object]; //Used to debug
[{isTouchingGround object},{
_explo = "DemoCharge_Remote_Ammo_Scripted" createVehicle getPos object;
_explo setDamage 1;
object allowDamage true;
object setDamage 1;
deleteVehicle fireEffect;
deleteVehicle object;
}, object] call CBA_fnc_waitUntilAndExecute;
}] call Ares_fnc_RegisterCustomModule;```
thats the code, the problem is that I cant make multiple meteors at the same time
I tried making object private but then the CBA_fnc_waitUntilAndExecute; wont run
To elaborate on the problem, if there is already a meteor (thats what this code makes) in the sky, when I place another one it overides the old one, so the new one will explode BUT the old one will not (and the fireEffect does not get deleted)
https://cbateam.github.io/CBA_A3/docs/files/common/fnc_waitUntilAndExecute-sqf.html pay attention to passed arguments section
@surreal peak Where did you get this code from?
looks like it's a module from the ares mod
@surreal peak you can just do something like a for loop and then use format and put the _i variable in the name of whatever you're createVehicle'ing
@waxen tide ewww no
Β―_(γ)_/Β―
Just use local variables and pass the local variable to the waitUntil and use what @tough abyss said
His issue is
he is using a global variables
he overwrites the variable
All instances of waitUntil will be using the same meteor because the object can only point to 1 thing
And because it's overwritten it's always the last created meteor
Don't create global variable per meteor
Solution 1 : use local variables
Solution 2 : have an array of meteors and iterate through that array
290 units. all west
{ _x setVariable ["blah","bleh"]; } forEach (allUnits select {side _x == west});
2.0366ms
{ _x setVariable ["blah","bleh"]; } forEach (allUnits select {side _x isEqualTo west});
1.96275ms
{ if (side _x == west) then {_x setVariable ["blah","bleh"];}; } forEach allUnits;
1.9602ms
So yes. if inside the loop is faster if it the select would essentially just return the whole list.
288 units west and 288 units east.
{ _x setVariable ["blah","bleh"]; } forEach (allUnits select {side _x == west});
3.07692ms
{ _x setVariable ["blah","bleh"]; } forEach (allUnits select {side _x isEqualTo west});
2.92128ms
{ if (side _x == west) then {_x setVariable ["blah","bleh"];}; } forEach allUnits;
3.31788ms
2 loops is not always worse. If you run the "expensive" code for all units. That's slower than running cheap code for all units, and then running cheap code for a subset of these units again.
@peak plover
I would still go for the select variant. Because the if variant is only very slightly faster if all units happened to be of side west (which is unlikely) and the if variant is also a F-ton slower when the units are equal west-east
(allUnits select {side _x == west}) apply {_x setVariable ["blah","bleh"]};
```π€
@peak plover i've tried to make everything into a local variable, but when I make object local the waitUntilAndExecute doesn't seem to work
im assuming that to make it a local variable I add an underscore before it
so it becomes _object
if im wrong please correct me, im kinda new to this
also if needed, the mods I have to make this code with are CBA and Achilles
You have to pass it as a parameter to the function
@still forum Interesting
Yeh, if it's heavy code then the heavy code should be looped as little as possible
An alternative in that case might actually be a xeh init
Does anyone know his way around CfgFactionClasses?
"Default" has 4 spawnable vehicles, a blackhawk wreck, 2 buoys .. ?
there is lots of empty stuff which seems to be just some logic stuff
π€
probably manually filter out "default" and then throw away everything with 0
so I only need to pass _object in the parameters?
oh shit, I also need to pass fireEffect aswell dont I
is there something like pastebin with proper SQF syntax highlight?
is there something like pastebin with proper SQF syntax highlight? uhm.. Pastebin.
Just select SQF under syntax highlighting..
with waitUntilAndExecute, am I right in thinking the parameters are passed in the 3rd part
e.g. ``` [{isTouchingGround _object},{
hint "Touched ground";
_explo = "DemoCharge_Remote_Ammo_Scripted" createVehicle getPos _object;
_explo setDamage 1;
_object allowDamage true;
_object setDamage 1;
deleteVehicle _fireEffect;
deleteVehicle _object;
}, _object] call CBA_fnc_waitUntilAndExecute;``` `_object` is being passed in the parameter
because for some reason when it is a local variable it does not work
but when its public it does
you are not taking the local variables back out
they are passed in _this
you have to use params to take them back out
I usually avoid pastebin and use an alternative because pastebin often throws me captchas or other annoying things. but thx.
Just stop setting files to "expires never" and things will be better
When you say use params to take out them out is that at the beginning where I have params["_pos","_unit"]; which would then become params["_pos","_unit","_object"];
I also changed the waitUntil to:
hint "Touched ground";
_explo = "DemoCharge_Remote_Ammo_Scripted" createVehicle getPos _object;
_explo setDamage 1;
_this select 0 allowDamage true;
_this select 0 setDamage 1;
deleteVehicle _fireEffect;
deleteVehicle _this select 0;
}, _object] call CBA_fnc_waitUntilAndExecute;```
Is a fsm distance check less costly then a distance check via script?
I don't know what you are trying to tell me..
You need to have params inside the waituntil code
to take it out of _this
or just use _this directly
but _object will be undefined
@torn juniper FSM's are scripts.
yes
deleteVehicle _this select 0; no
use _object now that you have it
also _this is not an array
Maybe I worded it bad, would it be better to have a check via FSM for distance versus another loop constantly watching for distance?
Depends on what you're doing in either scenario.
What environment you want it ran in.
Isn't your FSM check also just a loop constantly watching for distance?
Since a fsm is constantly looping, checking state anyways.. seems like it would be smarter to do everything in the fsm versus another watcher
Exactly
i ususally set the expire date very short. 1 day or 1 week ususally.
Im starting to feel like an idiot now that I still cant figure this out. This is the code ATM, https://pastebin.com/Bw50C8US and the waitUntil still isnt working
I think I did what u said
@still forum Please tell me if im an idiot
which line did I fuck up?
{isTouchingGround _object}
_object is undefined
inside that code you get _this with your arguments
if you want _object. You have to first pull it out of _this. Or just use _this directly
Drop everything and read about _thisand params, you wonβt guess this shit, you have to know @surreal peak
Hello! I asked yesterday about draw3D command inside a camera... anyone has a solutionΒΏ? When I create a camera, my draw3D command is not showing. When i delete the camera and the player is in his own player camera, he is able to see the draw3D text
cameraEffectEnableHUD true; @minor lance
With battleeye active - is a MP player allowed to change values in the <username>.var.Arma3Profile ? Reason for this is that I have some variable values stored in the namespace of the user for some time before syncing it with the server profileNamespace
I want to be sure nobody can manipulate these values before they get synced
or at all..
hm that's sad
The problem is the following. In my Mod when a player kills an enemy NPC they receive 1 Reputation Point ok? At the moment I directly sync this gained point to a hash on the servers profileNamespace
so far so good
But when a player does some machine gun fire into a group of let's say about 10 enemies things go wrong
the syncing to the server actually goes nuts since it first fetches the actual amount of reputation points, adds the new gained one to that amount and THEN saves it to the server hash again - all without checking the players namespace once.
When a player kills 10 NPCs within 2seconds the events have some race conditions to the values on the server side therefore kill 1-3 fetches the 0 reputation points from the server... so 3 kills result in 1 reputation points in the end
Thats where you have a database on the server and an mp eventhandler onKilled for the npc
Then the database just increases their rep
Maybe I worded it bad, would it be better to have a check via FSM for distance versus another loop constantly watching for distance?
@torn juniper they do the same thing lol
Way to kill the server by storing user data in server profile space
yea I will switch to a DB when I have my own hosted server - it is just a placeholder
You can have db on your pc
yea but I dont wanna run the game on my machine since friends gonna play the mission
MySQL runs as a service no problem
I've done something weird to my array.
https://pastebin.com/LV96umG9 - script
https://pastebin.com/emTQTSfu - log output
How can _x be undefined inside a ForEach?
hm ok my array is full of nullobjects
nvm
@tough abyss yea, I was looking for a distance check from a player to delete a unit if too far away, currently had a loop that just ran over everything checking distance of each unit distance to a player if it was more then x delete that unit
Was wondering if switching to have each individual unit check its own distance to the nearest player would be better or worse
In the end I donβt think it will matter either way too much since AI will be on HC
hey every one, I have an UI with 10 icons.
I would like to add a slider so I can add more than 10 icons in that UI, I know how to create a slider, but I dont know how I link my icons to the slider
what does linking icons to a slider mean?
You put controls inside a controlsgroup, tada, you have a slider and they are linked?
hm yay this is what I want, I've never worked with controlsgroup
whats are the good steps to get it working ?
but as I create my UI like this :
_header = _display ctrlCreate ["RscPictureKeepAspect", -1];
_header ctrlSetText "";
_header ctrlSetPosition [
0.041 * safezoneW + safezoneX,
0.89 * safezoneH + safezoneY,
0.025 * safezoneW,
0.026 * safezoneH
];
_header ctrlCommit 0;
Thanks @tough abyss
Slider? You mean scroll bar?
Yea I mean an horizontal scroll bar
Looking for a scripter to come into our community and help us out with scripting. it will be a paid job which can be discussed over a conversation.hit me up if your interested.thanks guys
Would it be feasible to implement vector-based trigger-shapes?
or some form of point-to-point drawing of shapes within the editor?
Looking for an advanced arma 3 developer for paid work.
Must be located in the United States and over age of 18. desperately need an advanced developer to join our team to improve what we have and continue with us on the project.
is anything wrong in the variable assignmentΒΏ?
_edit buttonsetAction format ["hint '%1'; medSelection = ['%1', player];", _part];
hint is Ok, but the variable is nil allways
call compile format ["hint '%1'; medSelection = ['%1', player];", _part]; works π¦
@cosmic bolt didn't we talk about this the other day?
https://community.bistudio.com/wiki/drawPolygon
w./
We did. However, what I'm thinking is a tool that uses that function
i.e., something that would allow you to draw shapes directly in editor, without scripting.
Say, a custom trigger that draws polygons between a set of points, and which allows you to drag each point individually in order to reshape it
@cosmic bolt Okay, great. use onMapClicked and push positions returned from that to an array. After finalizing draw the polygon
nothing that works well isn't going to be as easy as one two done
Is there a way to hide players HUDs via script?
Or like enter a cinemtaic mode with the letterboxing?
How can I make script that detect some vehicle spawn in whole game and change texture everytime when it is spawned?
Putting some line directly on spawn script might be simple but I want to make it separately so I can apply most case.
@manic bane
the command vehicles
the command apply
the eh respawn
I will try these at home. Thanks.
@minor lance The button eventhandler might be running in uiNamespace.
Try missionNamespace setVariable ['medSelection', ['%1', player]];
@exotic tinsel cut the cross-posting. Also this is the wrong channel for that.
{
sleep 3;
if (typeof vehicle player == "I_APC_Wheeled_03_cannon_F") then
{
vehicle player setObjectTextureGlobal [0, "A3\Armor_F_Gamma\APC_Wheeled_03\Data\apc_wheeled_03_ext_co.paa"];
vehicle player setObjectTextureGlobal [1, "A3\Armor_F_Gamma\APC_Wheeled_03\Data\apc_wheeled_03_ext2_co.paa"];
vehicle player setObjectTextureGlobal [2, "A3\Armor_F_Gamma\APC_Wheeled_03\Data\rcws30_co.paa"];
vehicle player setObjectTextureGlobal [3, "A3\Armor_F_Gamma\APC_Wheeled_03\Data\apc_wheeled_03_ext_alpha_co.paa"];
};
};```
This works anyway but my actual goal was changing texture immediately after vehicle spawn without injecting any code to spawn script. Do you have any better idea?
do you have CBA?
GetIn EH would also probably work
@peak plover thanks for advice. GetIn EH might remove useless excution when players stay in vehicle.
@still forum No. Why? Does CBA has function for that?
NATOGORGON =
vehicle player setObjectTextureGlobal [0, "A3\Armor_F_Gamma\APC_Wheeled_03\Data\apc_wheeled_03_ext_co.paa"];
vehicle player setObjectTextureGlobal [1, "A3\Armor_F_Gamma\APC_Wheeled_03\Data\apc_wheeled_03_ext2_co.paa"];
vehicle player setObjectTextureGlobal [2, "A3\Armor_F_Gamma\APC_Wheeled_03\Data\rcws30_co.paa"];
vehicle player setObjectTextureGlobal [3, "A3\Armor_F_Gamma\APC_Wheeled_03\Data\apc_wheeled_03_ext_alpha_co.paa"];
NATOSTRIDER =
vehicle player setObjectTextureGlobal [0,'\A3\soft_f_beta\mrap_03\data\mrap_03_ext_co.paa'];
vehicle player setObjectTextureGlobal [1,'\A3\data_f\vehicles\turret_co.paa'];
while {true} do
{
sleep 3;
if (typeof _vehicle == "I_APC_Wheeled_03_cannon_F") then
{spawn NATOGORGON};
if (typeof _vehicle == "I_MRAP_03_F" \\ "I_MRAP_03_hmg_F" \\ "I_MRAP_03_gmg_F") then
{spawn NATOSTRIDER};
};```
I made almost same one with GetIn EH. Did I make it right?
CBA would make it very easy
But I need to make it without CBA because my community just play no-moded game now.
_ctrlButtonAbort ctrlSetEventHandler ["ButtonClick", "[] spawn SR_fnc_abort; (findDisplay 49) closeDisplay 2; true"];
Is there any way to set what the abort button does in the pause menu while still keeping the confirmation popup when you click it? This seems to be aborting straight away, with no popup.
Just add the confirmation UI dialog into your script
Do you happen to know off by heart what dialog that is?
Wait its a GUImessage isnt it
π’
It's quite hard to read
@still forum Do you know where I could find the default script executed when the Abort button is clicked? I can't find anything for it in RscDisplayMPInterrupt.sqf
@warm gorge Most of interactible display actions are hardcoded into engine, such as lobby display interactions.
But usually OK/CANCEL buttons are 1and 2 idcs
That is probably the case then. I'm not sure why it is closing this abort confirmation popup though... Very confused
Hi, anybody knows how to check the LifeState of a unit in an ACE Mod Enviroment?
it's probably in config. not SQF file. Like almost all UI actions @warm gorge
You mean check whether the unit is unconscious? @little ore
@still forum yes, excactly
_unit getVariable ["ACE_isUnconscious", false]
So the biki page on setApertureNew is a bit dry. How do std and stdLum affect the aperture? If I wanted to effectively increase or decrease the overall aperture (within min and max), which would be the one to change?
Also, is there a scripting command to get the current aperture value?
@still forum TY. Couldnt find it in the ACE Wiki. Now i know where to look it up π
Is it me or Arma now stores last server password?
question on Zeus: any created unit is created on Zeus' system. Is there any script/mod that transfers the units to the server? There's ZISH but it doesn't seem to be maintained.
@round scroll
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#CuratorFeedbackMessage ,
find curatorObjectPlaced, curatorGroupPlaced, vehicle placed. Etc. Whatever you need
then delete it and recreate it on server
or HC if you have one
@unborn ether CBA
@round scroll ACEX Headless transfers it to HC. Not sure if to server too. But you can use that as a base and change a few things to make it transfer to server
ok, thanks a lot!
@still forum How long, never mentioned before.
last update
Isn't that bad for security reasons? Like, you can get every server password on any server now.
not at arma computer currently, but may this work for transferring Zeus generated groups to the server, if added to the Curator init box: this addEventHandler ["CuratorGroupPlaced", { params ["_curator", "_group"]; [_group, 2] remoteExec ["setGroupOwner", 2]; }];
@still forum How's my brain usage will limit from saving password somewhere in profilenamespace or smth?
I don't think having some server passwords saved locally is much security risk, given that very few players share the same a3 install (read: same computer) to play arma. And even then, most of the people in that category are siblings and probably wouldn't care if their family knew the password to some arma server they play on.
me?
Well yeah this whole discussion
@unborn ether get every server password on any server now If the user was never on the server. He doesn't have the password
Yeah exactly
^
You can only get the passwords the players on your server have been on
I think I understood now what you mean. I'll talk to people.
Wait, are you saying the passwords saved by one users CBA can be accessed by other users playing on the same serer as them? I don't think that's a thing...?
You can't get the passwords to all servers from all players however
I'd suggest not talking about that anymore. Don't need to tell people that things might be possible :x
gotcha
I'm honestly so confused rn anyway...
registers www.arma-server-passwords.com
Okey I talked to people: "won't fix. It's a password for a game server. cmon."
lol
Should be an opt-in
Maybe open a issue report on CBA github if you think it's a problem
I don't think it is right now
I'd say. Don't join servers that you don't trust. They can do a F-ton more serious stuff than grabbing passwords for other server
yeah it's opt-out currently
I still have a probably possible exploit related to that which I need to test out. Just don't have time
not really no
Theoretical upper limit for profileNamespace size is your Ram size. So you can't even fill up your disk or something
what if you save it really hard and fast
There's no upper limit for log output, is there.
true
I had a 280GB RPT once
lordy
Yeah, I've had to clean a few of those out of our server.
Is this why people preach -nologs?
don't worry, writing to log a lot slows arma down so much that you'll flee the server if you have any common sense
My server is fast enough without these things.
Though I have special log handling stuff and my hax sooo. Kinda unfair
I'm constantly running that
Average 70-80 fps on my server.
Dunno about delay and perf and stuff
although the AI's a friggin fast man... But I'm also running a HC
Yeah that seems to be a huge difference
In the name of science I wanna know if there's a difference between 50 fps server and 300+ fps server.
When shooting 1 client from 2nd client
Would the delay be smaller?
Could be. More network message throughput..
in theory it should be
@still forum I had a 280GB RPT once people say if you close arma once a few month it might help π
Broken script on server over I think 6 hours or so
They see me whileng, they hating
When could we add reactions π€
Is it considered a bug that civilians are not seen by AI until they're revealed?
Just a general tip: this is not how you name variables π
private ["_u","_wp","_rkt","_am","_i","_vlnrd","_vl","_vlnr","_vcnr",
"_vc","_vcnrd","_vg","_vgnr","_vgnrd","_trg","_fp","_spd","_dis","_trvldis","_sltd",
"_sspd","_acc","_agl","_trgtp","_rtp","_trgp","_trgv","_ttimp","_prd","_t"];
how can I check best if a trigger is defined?
isNil triggerName // doesnt work
isNil "triggerName" // does work
but
triggerName setTriggerStatements [...] //does work
"triggerName" setTriggerStatements [...] //does NOT work
which results in this not working for me
if (!isNil TRIGGERNAME) then { TRIGGERNAME setTriggerStatements ["this", "call X11_fnc_doStuff", ""]; };
already tried thx dude π
Oh right,
if (!isNil { TRIGGERNAME }) then { ... }
i write the prettehiest code anyways.
If TRIGGERNAME contains string you can do:
if (!isNil TRIGGERNAME) then {
(missionNamespace getVariable TRIGGERNAME) setTriggerStatements ["this", "call X11_fnc_doStuff", ""];
};
But I don't exactly understand what do you want to achieve.
isNil needs a name of variable to check (string), not the variable itself.
@hollow thistle Technically you could do
_var = "Blah";
if(!isNil "_var") then {
"BLAAAAH!"
};
Yeah you could but that is out of scope of his question (I think π€ )
@tender fossil and that is also not how you use private
I think these names came to be because someone watched that stupid video from that phronk guy
"make your variable names as short as possible" yeah.. right..
π
I thought you were joking. https://youtu.be/452DDfsdOWk?t=109
No indentation, illegible variable names...
What a complete madman.
r/madlads
And then you wonder where all the bullshit scripts are coming from
instant downvote.
It's because of people like him. Thinking they know everything and that everyone should learn from them
π
lul
Someone just PM'ed me this "hack" that crashes his server
[] spawn {
waitUntil {alive player};
while {true} do {
life_fnc_RequestClientId = player;
publicVariableServer "life_fnc_RequestClientId";
};
};
If that crashes your server.. Man..
just wtf
it went from life to death...
the difference between some_very_long_name_that_100_percent_is_not_doublequote_optimized_doublequote_according_to_him and var_foo is literally so negligible π€¦
even in sqf-vm where i do NOT calculate the hashes first this is bollocks
best part is his gigantic range of comments and complaining about filesize π€¦ π€¦
Should have just run Minify π for π SQF https://github.com/inimitable/sqf-minifier
should not have done it at all is the better variant @earnest ore
π
thx for exposing me xD I'm a rookie and I don't think exposing my problem (just to make fun of it) will help me a lot
But while we are on it, He should have used sqf-vms beautifier cmd line Option to get something that is human readable
https://github.com/SQFvm/vm/releases
Loads provided file from disk and pretty-prints it onto console.```
You just exposed yourself. I didn't say who that code is from. Now every lifer knows that people got that code because of you
I'm not boasting about being a professional developer btw @queen cargo
you are the one talking in the youtube video @tough abyss ?
and yeah it's crashing my server cus this code is being called likely hundreds of times per second well, hundreds of times might be an exaggeration but it's called a lot, constantly
lol
why should I use CfgDisabledCommands for this?
hundreds of times per second is not an exaggeration
@queen cargo you are the one talking in the youtube video no
then it was not @tough abyss i was talking about
that dude in the video is what i am complaining about
[] spawn {
waitUntil {alive player};
while {true} do {
life_fnc_RequestClientId = player;
publicVariableServer "life_fnc_RequestClientId";
};
};
@tough abyss
his name is phronk and he's on discord too
M242Today at 11:30 PM
Ever heard of CfgDisabledCommands?
He wanted a biki account too.
lol
something that kills most servers btw is this:
fnc = { while { true } do { [] spawn fnc }; };
while { true } do { [] spawn fnc; };
only run this on the server and it is pretty much done
especially the life servers
I'm slightly confused. I mean, if a client gains remote execution anyway, isn't that already a problem?
nah @earnest ore
the moment i have any way to execute code, even if local, you are already fucked
people should stop caring about what happens on life servers.
TLDR. His server doesn't have even the most minmal of security protections established. And he is complaining about people killing his server
Like. Even after that first TLDR sentence you can already say "Ask on a life forum, bye"
why are you wasting your time answering people here if it's just to make fun of em
keep playing minecraft tho
it's just that life people have worked hard to earn a really shitty reputation here.
I told you what you have to do. My "helping people" is done here.
I can use the rest of my free time to do whatever I want
You got a life specific question. So go ask on a life forum.
Same as people with CUP specific questions ask in CUP Discord.
TFAR questions -> TFAR Discord
ACE questions -> ACE Discord.
And so on.
Somehow it's only the life people who get offended when you treat them like everyone else and redirect them to the proper place
Thinking of writing a worm that would save itself in profile namespace and execute that code on every life server user goes to while simultaneously replicating for each player on the server. That would be something π
Btw is there a life discord that we can redirect people to? If so it should be added to #channel_invites_list
That would be a interesting project
I didn't hear of such a thing yet. sounds fun
Sounds doable
Need anti virus counterpart so we can charge life server owners $$$ for protection, howβs that for a startup?
And the chorus goes:
Am I evil? Yes I am
Am I evil? I am man, yes I am
π
Are you saying man are evil? What are you? A Feminist?!
re - sorry that I left my question abandoned... but I was doing sports
a thing u guys dont know much about
@queen cargo he is skipping his exercise on a regular base
oops too much intel
@frigid raven i personally was jogging today again
Woah James ? So u assume his gender ? @tough abyss
it gets better everyday π
no u werent - stop destroying my trollings
Howβs book going then?
nobodies working on it, no responses --> pretty much dead @tough abyss
I once wrote a replicator script in LUA for computercraft turtles in minecraft. I got one turtle to replicate twice on its own. Sadly i never managed to flood a server with a borg-like presence.
a thing u guys dont know much about pfft.
i once ran half-marathon distance
had to wave some people off who wanted to call an ambulance on me at the end tho
does that still count?
Is setIdentity a global command? It says on wiki it doesnβt have to be local to the unit/machine it is ran from but I was wondering if it set the same identity for everyone
Effects of this scripting command are not broadcasted over the network and remain local to the client the command is executed on```
@tough abyss where do you see that? But thanks yo
hover over those small icons above the commands name on the wiki
onPlayerRespawn.sqf parameters: [<newUnit>, <oldUnit>, <respawn>, <respawnDelay>]
Wiki used <respawn>, it's super descriptive.
What even are you.
The marker? The respawn type? I don't even
@earnest ore test it out. Debug
So I have two bits of data I want to combine together. How would I combine ((_veh = "B_MBT_01_arty_F" createVehicle position player;))
And ((enableEngineArtillery true;enableEngineArtillery true;))
what
y tell us what you're trying to do
BIS_fnc_taskSetState according to wiki, returns Boolean.
["ruskieTask", "SUCCEEDED", true] call BIS_fnc_taskSetState;
returns "ruskieTask"
This is one of those days.
I need coffee.
Its for a zeus mission that has the engine disabled by default.
/*
Author: Jiri Wainar
Description:
Set a task's state.
Parameters:
0: STRING - Task name
1: STRING - Task state; one of the following:
"CREATED"
"ASSIGNED"
"AUTOASSIGNED" ("ASSIGNED" when no task is assigned yet, otherwise "CREATED")
"SUCCEEDED"
"FAILED"
"CANCELED"
2: BOOL - Show hint (default: true)
Returns:
STRING - Task ID
Example:
["Hunter","SUCCEEDED"] call bis_fnc_taskSetState;
*/
private ["_taskID","_state","_hint"];
_taskID = param [0,"",[""]];
_state = param [1,"",[""]];
_hint = param [2,true,[true]];
[_taskID,nil,nil,nil,_state,nil,_hint] call bis_fnc_setTask;
```@earnest ore
Probably should use the functions viewer more often. π
Thanks though.
@bold cedar Are you not able to get the artillery computer up for a certain player?
Yeah. Thats my problem. Enable Engine Arti computer only does it locally for that player.
or in this case
me
But if my buddy takes the gun, he can't see it.
I was thinking about how I could maybe run it for the whole in game group? (Me and my friend are grouped me as the leader).
you can just add enableEngineArtillery true; < into initPlayerLocal.sqf
no way to just do it from debug I take?
hmm... press "global exec" there
I got a script that reads my car speed but the problem is that its over compensating from my actual speed that's shown in the top left corner
anyone got a clue why?
How is that script calculating the speed?
don't you love working with blackboxes?
while {alive _car} do {
if ((isEngineOn _car) && (player IN _car) && (cameraView == "INTERNAL")) then {
_myspeed = speed _car;
if (_myspeed > 999) exitwith {hint "slow down";};
_myspeed = round _myspeed;
_myspeed = format ["%1",_myspeed];
_myspeed = toarray _myspeed;
if (45 IN _myspeed) then {
_myspeed = _myspeed - [45]; // Take - out of array
};
if (count _myspeed == 1) then {
_myspeed = [0,0,(_myspeed select 0)];
};
if (count _myspeed == 2) then {
_myspeed = [0,(_myspeed select 0),(_myspeed select 1)];
};
where exactly π
oh ok
can u tell me what line so i can have a look?
that indentation was satisfying
Description:
Object speed (in km/h). Returns relative speed of given object along Y axis. An equivalent to:
3.6 * (velocityModelSpace _obj select 1)
hm still giving me over compensated values
kk gonna try it now π
whats the difference between [] spawn {}; and 0 spawn {};
lmao okay
^what is this ?
if (45 IN _myspeed) then {
_myspeed = _myspeed - [45]; // Take - out of array
};
if ((count _myspeed) isEqualTo 1) then {
_myspeed = [0,0,(_myspeed select 0)];
};
if ((count _myspeed) isEqualTo 2) then {
_myspeed = [0,(_myspeed select 0),(_myspeed select 1)];
};
probably
[] spawn {
disableSerialization;
private _ds = findDisplay 46 createDisplay "RscDisplayEmpty";
uiNamespace setVariable ["DS_DISP",_ds];
private _plr_img = _ds ctrlCreate ["RscObject",1100];
_plr_img ctrlSetPosition [0.245,0.0868,0.451515,0.794948]; _plr_img ctrlCommit 0;
_model = (getModelInfo player)#1;
_plr_img ctrlSetModel format["\a3\%1",_model];
_plr_img ctrlSetModelScale 2;
};
try'ed this, but is not works π¦
changed model to "\a3\Ui_f\objects\Compass.p3d", but still not working. Any idea why?