#arma3_scripting
1 messages Β· Page 371 of 1
What you posted? Doesn't look like SQF or config, so nothing in Arma.
ok, thanks.
surely you could write a reader for pretty much any text file in arma considering we have ways to manipulate strings
it would be painful cos it's sqf, but it's possible
you would have to read it with an extension however @rancid ruin
why? i've parsed .txt files myself from mission dir with no addons
_names_first_contents = loadFile "\functions\character\names_first.txt" splitString toString [13,10] joinString "";
_names_first = _names_first_contents splitString ",";
for a names_first.txt file like
John,
Bob,
Dave,
Steve,
....
i can't remember what the splitstring and tostring is doing exactly but i remember it definitely worked
its removing linebreaks
past me, why didn't you just split it by linebreaks instead of by commas?
so the first line is creating a string like this then?
John,Bob,Dave,Steve
Ah, loadFile, didn't think of that π
im trying to find a decent reason why AI squads are not holding at theit dan hold way point instead of move around
but that seens to be just arma being arma
@astral tendon did you try dangling steak in front of them?
I did with disableAI "MOVE" but afther it got turned on again they said "fuck it" to my way point and start to hang around in the vilage intead off move to the waypoint.
seens like unit capture is my only friend.
bugy as hell for cars but at least they work to some level.
Hello! I was wondering what is probably the best altis life framework that is out currently that supports most scripts and such ?
@astral tendon So, I want you to take a very long look at this https://community.bistudio.com/wiki/disableAI
I already tryed as many combinations i could with it, yet they still unrelible.
what I am trying to get at here
is that you should not be using disableAI
nor triggers
im not even using triggers in this one.
don't use disableAI then
just the units init and waypoints
so what i am going to do with out it if they cant hold and still on their hold marker?
literally just move them to the point
they aren't going to move without more intructions
and then actually move to their move marker with out going around the map?
squad hold into a coupound
explosion
trigger activated
hold waypoint skiped
move to the next marker were players destroy their ammo cache and thy to go afther they
what happens:
squad dont hold, walk around the map
explsoion
trigger activated
squad does not give a single dan wabout their waypoint
Code please
same happens with veicle
code
there is literay none
Why.
this is a exemple of a pure starting mission making
No, that's learning how to use drag and drop functionalities
what i did to try to fix that:
disableAI "MOVE" + the hold maker (they actually hold and still)
explosion
trigger activated
enable AI "move"
they move akwardly to the waypoint or some times it just dont do it at all
i dont know how the trigger did broken everyting even the hold mark.
Whats a good object I can use for an anchor point for a player that wont interfere with cursorObject/cursorTarget or impact on performance if there was a lot of them?
@astral tendon https://community.bistudio.com/wiki/doStop didn't even take me more than a minute to find this jem
@warm gorge memory point on the player/
?
and for the vehicle, i just decide to give up and use the unit capture and record my self driving to the goddamn palce
@subtle ore Nah just to create temporarily and attach a player to it. Its for a tazer script so they cant move. I know some people use helipads etc for this sorta thing but was wondering if there was some special one like a helper object or something
and how about make they actually move to the giving waypoint?
just a simple move marker
I need help setting up ACE mod on a Altis Life 5.0 server
@amber palm You should ask on Altis Life Forum or some ACE specific site. Also I fail to see the link to #arma3_scripting
Hi everyone. I am strugling to find a webpage that describes the steps to convert assets into a mod. Coul anyone point me to a direction?
what kind of asset?
it's quite simple
config.cpp which looks something like this
class CfgPatches {
class whatever {
init = "call compile preprocessFileLineNumbers '\folder\script.sqf'";
};
};
wrapped up in a folder called "folder" with script.sqf in it
then pack that folder in to a .pbo and it'll run your script
and will that show neatly on the launcher? is it ready for steam workshop, is it signed?
yes, i guess, no
e.g. where would I write the cfgFunctions?
you can just stick it in the config.cpp, same as anything else i think
ok. Thanks.
best to rip apart other peoples' mods and see how they managed to do things, i think that's how most people learned
that's how i figured out certain things anyway, there's not many good guides for arma modding
hey chaps π
anyone here can recommend a good weather script?
a dark feel with plenty of fog
for a WW2 mission I am working on
setDate [2035,1,1,0,0];
0 setfog 1;
dark and foggy π
cheers
Anyone know how to create Safe Zones in Exile mod? if so can you pm me how!
@flint kraken ask that question in the exile discord
Why is:
_fnGetClass = {
_finalArr = [];
{ _finalArr pushBack (_x select 0) } forEach _this;
_finalArr;
};
_arr = getArray (missionConfigFile >> "CfgArsenal" >> "Weapons" >> "list");
[missionNamespace, _arr call _fnGetClass, false, false] call BIS_fnc_addVirtualWeaponCargo;
Giving me a generic error expression at (_x #select 0) at briefing, and yet the same code works in the debug console.
@Golias#2739 and will that show neatly on the launcher? is it ready for steam workshop, is it signed?
It's signed if you sign it. It is ready for steam workshop. It will should show neatly on the launcher after you have it in workshop.
@earnest ore There is no "generic error in expression" unless one special case
Check what the real error is
If _this is nil
That fnc can just be replaced by an apply, tho
_arr apply {_x select 0};
_this spawn {
params ["_injured","_healer"];
_startDamage = damage _injured;
if (_startDamage > 0) then {
waitUntil {damage _injured != _startDamage};
if (damage _injured < 0.2) then {_injured enableAI "move"
};
};
};
}];````
in MP this does not work, the AI does not move
in SP it works, what is wrong?
I think, you need to execute enableAI where AI are local in multiplayer
if you don't have HC, this will be on the server
@astral tendon
And saw in the wiki, the eventhandler need to be added where unit is local
so same as before
how i do that?
use remoteExec command
Don't forget to check, in the wiki, if the command are local or global when using it in multiplayer
i will try that.
You were already told about this last time π
Because some event handlers work with out it
_car = _this select 0;
if ({alive _x} count (crew _car) == 0) then {_car setDamage 1}}];```
like this
You need to add the eventhandler HandleHeal only in the server
so don't put anything inside the init, or use a condition with isServer command
because if i give you a solution, all player we tell the server, to move the IA
Β Triggers only on PC where EH is added and unit isΒ local
Yeah, and if you don't have HC, the IA are local in the server
No they are not local to the server. They would be local to the HC
Roque obviously doesn't have an HC running
Yeah like i said, if you don't have HC, this will be local to the server
so use isserver command
and add only to the server
No
Just because you add it to the server
Doesn't mean that it'll be executed locally to the AI
yes
Yes
Idk what are you talking, you said, if he doesn't have HC, so the IA will be local to the server, and two lines after, you said, the unit will not be local to the server Uh
No, i said in both conditions
That ai will not be local to the server
Ubless
The creation takes place local to the server machine
Yes and
Which in case. Still wouldn't allow you to be one and done
The eh needs to be added locally to each ai unit
Because why would you just be one and done if you needed to add functionality to each differently?
Mission event handlers can be used to trigger eh through mission namespace
Which don't require either a target or local target
Wow, you're so cool
Do you keep your machine under lock and key at night?
Wear a little tinfoil hat?
m here to help people, if you're the right one to rot the life of this channel, I invite you to leave it, and never come back, I'm not even attacking you, just try to help this someone who asked for help, if you're so strong that you say it, why are you still here?
Ouch. That hurt, I think you hurt my tiny little heart.
i realize this was discussed briefly several months ago but does anyone know what enableTraffic does?
i think it's working only in TOH
sorry, TOH?
Take On Helicopters
Ported from TKOH, doubt it was ported for full functionality
roger
Much like the DB functions from TKO&
Seems like there are quite a few
But all of the wiki commands are exported from the base game
So theu may be there, just that they may not work
bummer, i was a little excited for a second there that there was work going on for a good patterns of AI life
It's very possible to do in arma 3
You just may have to muscle it a little more than you would in TKOH
you may have misunderstood, what you heard was, "i want a hacky scripted AI paterns of life that kinda works" what i said was "i want a good patterns of life" that being said, my standards are a bit unreasonably high in that i want R* quality. (ref: all your bacon and eggs)
iirc hearts and minds did something very similar for handling bridge patrol over tanoa bridges. Traffic as well. Civies would either pass the car in front of them or drive behind them.
Well come on nos
You could probably script something better than whatever mockup they had in TKOH
A hacky ai script is only a hacky ai script if you make it so
true
again, my standards may be "unreasonably high" in what i expect for AI out of the box.
i hope you sensed my joking tone
Arma ai are certainly more configurable than any other game ive seen
I did sense your joking tone
I just chose to reply with something a little more serious, as i think people take arma ai as granted. cough quiksilver cough
are there any solid ambient life mods you would recommend?
TPW does some ambient modules
spawn a lot of cars with civilians lying under them playing that mechanic animation and pretend all their cars broke down at the same time
credible simulation achieved
pop noice
guys, on a mod, where do I add the cfgFunctions?
on the addon's config.hpp, next to the CfgPatches?
do you guys know how to give respawn tickets to units?
say I have added a trigger in EDEN editor which is represented in the mission.sqf like so:
class Item1
{
position[]={1100,-30,8060};
interruptable=1;
age="UNKNOWN";
expCond="isServer || !isServer";
expActiv="onMapSingleClick ""(Driver(vehicle Player1)) DoMove _pos; Player2 sideRadio ''"";";
class Effects
{
};
};
Do you guys know if there is a way to create a trigger via script in my init.sqf without having to manually do :
_trg = createTrigger ["EmptyDetector", getPos player];
_trg setTriggerArea [5, 5, 0, false];
_trg setTriggerActivation ["CIV", "PRESENT", true];
_trg setTriggerStatements ["this", "hint 'Civilian near player'", "hint 'no civilian near'"];
Something like:
_myTrigger = {
position[]={1100,-30,8060};
interruptable=1;
age="UNKNOWN";
expCond="isServer || !isServer";
expActiv="onMapSingleClick ""(Driver(vehicle Player1)) DoMove _pos; Player2 sideRadio ''"";";
class Effects
{
};
};
_trg = createTrigger ["EmptyDetector", getPos player, true, _myTrigger];
no, you need to use the commands
Ok, thanks!
There is no way to change the side of an object like an ammo crate or empty vehicle from CIV to something else, is there?
On this page, https://community.bistudio.com/wiki/Functions_Library_(Arma_3)#Folder_Path, it says that it is possible to add a path to the category in cfgFunctions, and it will search the file as %ROOT%\myPath\fn_myFunction.sqf. Is fn a typo (fnc), or not?
thanks Tajin. It is unfortunate because ACE does not use those. Katekarin, thanks, it was a typo indeed
another question. If I have the class CfgFunctions on the config.cpp for an addon named foo with a script fn_bar.sqf on it, what path should I add to class func {file = "...";}? class func {file = "foo\fn_bar.sqf";}?
Hey guys, I'm looking at this line of code to return all compatible optics getArray(configfile >> "CfgWeapons" >> _x >> "WeaponSlotsInfo" >> "CowsSlot" >> "compatibleItems"); but after looping through the array it seems to be empty, not quite sure where to go with it. Also, does getArray return an array of strings or do classes get returned as their own special type?
i have this on my mission init
player enableFatigue false;
player addEventhandler ["Respawn", {player enableFatigue false}];
};```
but when a JIP player connects to the server he still got the fatigue
use initPlayerLocal.sqf or onPlayerRespawn.sqf maybe?
i wonder when player will ever be nonlocal π€
dedicated server or headless client
@obsidian bane Just use BIS_fnc_compatibleItems/CBA_fnc_compatibleItems.
nice, didn't know there was a function for that. Thanks.
Damn, still getting used to this keyboard.
uhm i got mentioned here but i see nothing
Commy's fault
Sorry.
=}
^^
I play that game pretty often with someone special π
I sometimes get the red 1 and then can find nothing. I'll blame you from now on.
Okay.
@little eagle what keyboard did you get?
lol, just using a different old one.
does it have mx blue switches?
Idk, probably not. I'm not a geek. I just want to type my rants.
pretty sure you are a geek
if you're typing more than a few paragraphs of anything, code or text, you'd do well to get a mechanical keyboard β¨
OK
@little eagle works like a charm, thanks man
Does anyone know if using this: 'trigger setTriggerStatements [condition, activation, deactivation]' would be the same as using this: 'trigger setTriggerActivation [by, type, repeating]' ??
or can this 2 be used together
Uhm, you can use one after the other?
Ok, thanks... sorry Im very new at this arma scripting xD
they're separate things
would you say that this:
_trigger setTriggerActivation ["ANYPLAYER", "NOT PRESENT", true];
could be activated by anyplayer, at any place in the map, repeatedly?
(if the conditions are true)
no it only applies to the trigger
Statements are separated by semi colons:
trigger setTriggerStatements [...];
trigger setTriggerActivation [...];
when no player is in the trigger, it activates
so it would depend on the size of the trigger / what it covers
ok what Im trying to do is: if a player is in a vehicle add X action
no matter if that player is inside the trigger or outside the trigger
Just add the action at mission start and make being inside the vehicle a condition of the action.
and it can happen any number of times
No triggers,
and this condition of the action could be dynamic? like is not always going to be the same vehicle
vehicles spawn during the mission
yes, you can have a condition of when the addAction is available
ok, let me read about that "addAction" function in the docs
You can specify inside the condition which vehicle.
I'd say you add the action to the vehicle and not the player.
And then just check if the object the action is attached to is the current vehicle of the player.
That way you avoid having to deal with respawn changing your body disarding all old actions.
yes but, since the player can buy any number of vehicles during mission I cant attach the action to a vehicle, unless I manage to add it manually
like every time the vehicle spawns I add the action
Is this with mods?
Hmm, any way to execute a script every time a vehicle is created? I mean, is there something like an eventhandler in that framework?
yes, the spawn has a callback
or eventhandler to do things after
well not the spawn, I believe is the execVM
By "spawn" I meant the vehicle creation. Common term in video games unrelated to the spawn command.
I was playing a mission downloaded from the workshop where the dev added functions to control de HeliPilot from the Gunner seat by adding functions like "Increase Altitude" "Turn to target" so I opened his mission to learn how he did it (im planning to credit him ofcourse) and my intention is to:
- Make it work as a stand alone mod for any attack helicopter
- Make it easy to integrate into any mission
in the original mission the dev added triggers, which are represented in the mission.sqm like so:
class Item233
{
position[]={1689.3507,5.5,5563.3813};
a=5;
b=5;
repeating=1;
interruptable=1;
age="UNKNOWN";
text="GunnerCMDs";
name="GunnerCMDs";
expCond="!(isnull (driver(vehicle pilot01))) && (Gunner Viper01) == player || !(isnull (driver(vehicle pilot01))) && (Gunner Viper02) == player || !(isnull (driver(vehicle pilot01))) && (Gunner Viper03) == player || !(isnull (driver(vehicle pilot01))) && (Gunner Viper04) == player";
expActiv="nul = execVM ""HGM\HGM.sqf"";";
expDesactiv="removeAllActions Player;";
class Effects
{
};
};
since im trying to replicate this behaviour, my intention is to dynamically create a trigger in the init.sqf file
thats why im doing that... the problem is that the class stated above does not have anything related to "trigger setTriggerActivation [by, type]"
only the repeatin is present in the class
since by default a trigger has a repeating set to false... i need to be able to change it, but theres no way to set it without set the "by" and the "type"
["Helicopter", "init", {
params ["_heli"];
_heli addAction ["Test Action", {
systemChat str _this;
}, nil, 2, false, true, "", "cameraOn == _this"];
}, nil, nil, true] call CBA_fnc_addClassEventHandler;
This is what I'd do, but it requires mods.
hmmm ok Imma test what I have so far, if not I will consider your solution
thanks for your support
FYI, I just released a mod that may be helpful to some of you. Dictionary, that essentially implements a (Pytohn-like) API for dictionaries. The IMO nicest feature: _string = _dict call DICT_fnc_serialize
Steam: http://steamcommunity.com/sharedfiles/filedetails/?id=1166863961
github: https://github.com/LordGolias/dictionary
I have been using it extensively in production, and thought it can be helpful to others.
@thick sage how you get access to the file system of Arma without an extension?
there is no access. Why would you need that?
What is the purpose then? Oo
Though it was to iterate over files
Ohh... I see...
Should get some sleep finally... Second time I missread something
π
Tipp for ya Btw. Using locations is more performant (as long as one does not needs garbage collection)
Also you got a perfect example for what one should use try catch throw commands (errors)
What's wrong with locations and garbage collection?
Also you got a perfect example for what one should use try catch throw commands (errors)
lol
They do not get auto deleted on scope exit @little eagle
You have to manually delete them
How is that different from OBJECTs?
And yes, APIs are where that set of objects is supposed get useful
It is not
It also is just an assumption that the whole dictionary is working with arrays instead of locations
I saw setVariable in there, so I assume it's pseudo namespaces.
it uses vehicles as CBA. The main use case is to easily serialize nested dictionaries
@thick sage lel, i just wrote the same thing basically
done with it, check here... hey someone just wrote that
is there a way to keep AI doing supresive fire?
commandSuppressiveFire and doSuppressiveFire works but they dont keep shooting
Hello again!
So... I found the neat object "UserTexture1m_F". Is there a way to make the texture at 0 emissive or unshaded? :D
(I mean, when using object setModelTexture [0, "path\to\texture"])
Try it using an emmsive material
@austere granite, what? Either you did not understand what I coded, or I did not understand what you wrote. Because I am pretty sure this does not exist.
The closer we have would be iniDB, which supports writing to file (which Dictionary does not), but unfortunately
-
does not support saving natively into Arma (profileNamespace) and
-
does not support nesting (i.e. not possible to save a OBJECT type with native types).
-
means that you must use a filesystem, 2. means that you still need to define your own hierarchical "schema" when saving the database in iniDB, e.g. through a custom convention of naming keys that will invariable limit the depth that you can go.
Dictionary completely abstracts you from this problem. You define an object of data (which contain other objects), and it just serializes the object to a string. To give you an idea, in the mission I am working on there a single global variable, AS_persistents (with a maximum depth of 5 or 6 atm), that contain all the data I want to save persistently (with nesting). To save it,
private _data = AS_persistents call DICT_fnc_serialize;
profileNamespace setVariable ["MY_MISSION", _data];
to load it
private _data = profileNamespace getVariable "MY_MISSION";
AS_persistents = _data call DICT_fnc_deserialize;
Wasn't there a command to shuffle array added some time ago or I am dreaming?
thanks π
I had an impression some command was added, I guess I was dreaming
Also thought we had something like that.. But I guess not...
had a dns issue with the wiki for some reason π€
maybe you're thinking about selectRandom?
Or I was thinking about sort
deleteAt made shuffling easier.
Are bis functions ever updated with new commands?
Hmm, nice
KK rewrote them all at one point.
π
wut?
Except stuff like the arsenal, where all hope is lost.
Why are so many functions still such a heap of garbage then?
Example?
New tasks are quite unreadable as well
Task Framework came with A3, didn't it?
Yeah, the functions are confusing
Personally I think the SQF commands are easier to use, but I guess the point is that you don't have to worry about locality when using the functions.
I need an array of numbers from 0 to X in random order, I wonder if this can be done better:
_to = 10;
_array = [];
_result = [];
for "_i" from 0 to _to do {_array pushBack _i};
for "_i" from 0 to _to do {
_random = selectRandom _array;
_result pushBack _random;
_array deleteAt _random;
};
_result;
Not that performance difference would matter, just curious if this can be improved
The deleteAt already reports the deleted element , so you can put the pushBack, deleteAt and selectRandom all in one line.
Good call
_to = 10;
_array = [];
_result = [];
for "_i" from 0 to _to do {_array pushBack _i};
for "_i" from _to to 0 step -1 do {
_result pushBack (_array deleteAt floor random _i);
};
_result;
Well I guess it can't get any better than that
to 1, I think. Both random floor 1 and random floor 0 always report 0, so you do that element twice.
Hmm
deleteAt 0 would report nil for the [] empty array.
pushBack nil fails silently.
So there is no practical difference, but one iteration is useless.
for "_i" from (_to + 1) to 1 step -1 do {
That's how it should be then
or ceil random
so no additional + is done
Yes, _to + 1 is the size of your array, since it has 11 elements.
_to = 10;
_array = [];
_result = [];
for "_i" from 0 to _to do {_array pushBack _i};
for "_i" from _to to 0 step -1 do {
_result pushBack (_array deleteAt ceil random _i);
};
_result;
ceil random is bad, because there is a one in ten million chance it reports out of bounds
ceil random 5
could be
0
every other full moon
Something to do with floats?
Hm, good point
Yeah, I figured
(I seem to have brain malfunction today as I somehow managed to type "going" instead of "good" and noticed just now π€ π« )
Muscle memory.
i'm a bit confused right now, a fired EH triggers on all clients or only the one it was assigned to?
to extend my confusion, what about cfgWeapon based EHs?
fired is AG, EL. It will trigger for remote units, but only on the machine that added the eventhandler. It's the same for config fired, but I never used the CfgWeapons version. I assume it's the same, but you never know...
Config should be the same everywhere, so the question is if it triggers for machines that not own the object that fired the weapon. For fired it does (AG), but the question remains if the CfgWeapons version is also AG. I assume it is until proven otherwise.
my confusion still stands π
AG means arguments global i know
EL execution local
Yep, that sums it up.
i still can't grasp if its executed on nonlocal units or other clients
i'm a bit slow today π
nonlocal units
Yes, because AG
other clients
No, EL
Of course EL just means that you have to use the addEventHandler on every machine to have the event code be executed on every machine.
ok, so i need to test how the config version actually behaves
thanks! rest should be clear by now
The CfgWeapons one, yes. Because I can guarantee that the CfgVehicles one is AG, EL too.
Well, config and EL is hard to tell, but for simplicity it is.
but what means EL in that context π
In context of config?
That you have to own the mod and that config entry for the config entry to be executed.
only "assigned" where the vehicle or unit is local?
No, it would be assigned to all objects even remote ones on the machine that has the config entry.
You're confusing A and E again.
E in this case is on which machines the code will be executed in case the event triggers. That's always the local one for events and always every one for MPEvents (please don't use them)
A is the object the event is attached to. AL means it only fires for local objects (killed), while AG means it fires for remote objects as well (fired).
What's so bad about MP Events?
Nothing really. MPRespawn is good aside from the bugs.
π€¦ thanks π
Dunno if they ever fixed them.
now i get it π
A is concerned about the object the event is attached to, while E is concerned about the machine which execute the code block. I guess that is how you can think about it.
"...is good aside from the bugs" is a good way to describe Arma in general π
MPRespawn is/was weird.
Rather people would KISS and use respawn eventhandler with remoteExec than MPRespawn. At least with the former you know it works.
OR
Make Respawn AG in A4.
Triggered when a unit, it is assigned to, respawns. This EH does not work as one would expect MP EH should work like. It is only triggered on one machine where the unit it was assigned to is local. The only difference between Respawn and MPRespawn is that MPRespawn can be assigned from anywhere while Respawn requires the unit to be local. This EH must be used in conjunction with the addMPEventHandler command.
Yeah, MPRespawn is fucked
Why not entityKilled though?
You sure?
what are the effects ?
See ex3
But it's kinda obsolete, since you can now just delete the logic.
class test_EmptyObjectForBubbles: Thing //inherits 36 parameters from bin\config.bin/CfgVehicles/Thing, sources - ["A3_Weapons_F"]
{
author = "Bohemia Interactive";
mapSize = 1;
_generalMacro = "test_EmptyObjectForBubbles";
scope = 1;
animated = 0;
side = 4;
faction = "None";
editorCategory = "EdCat_TEST";
editorSubcategory = "EdSubcat_TEST";
vehicleClass = "Emitters";
simulation = "thing";
icon = "iconExplosiveAP";
displayName = "Underwater Bubbles";
picture = "\A3\weapons_f\ammoBoxes\data\ui\map_AmmoBox_F_CA.paa";
model = "\A3\Weapons_F\empty.p3d";
class EventHandlers //sources - ["A3_Weapons_F"]
{
init = "(_this select 0) call compile preprocessFile """"\A3\weapons_f\data\scripts\bubbles.sqf"""";";
deleted = "{deleteVehicle _x} forEach (_this select 0 getVariable [""""effects"""",[]])";
};
};
See the newish deleted event.
does someone know if its possible to play a guesture only locally but in sync with the animation queue?
playAction is global and *Move commands would be local but can only play fullbody animaitons afaik
Im having issues using safezones as the coordinate system for menus on my mission. For people with smaller resolutions, text becomes stretched and out of wack and sometimes impossible to read. Is there any way around this? When I used GUI_GRID, I had issues which is why I changed to safe zones but now this is causing issues
use pixelGrid
Does it work well over different resolutions?
it's intended for that, however there's some weird things going on with UI scaling, I'm using pixelGridNoUIScale for now
Looks like a new system, havent seen that used much yet at least. I guess ill give it a go, because safezone is just causing too many issues for me
you still have to use safezones for anchoring
Oh its not in the GUI editor yet
GUI editor is trash, diag branch + diag_mergeConfigFile is much faster
ofc, if you know what you're doing it's much faster
plus it's pixel precise compared to safezones
[4:25 PM] alganthe: GUI editor is trash, diag branch + diag_mergeConfigFile is much faster
that
learn to write GUI configs yourself instead of GUI editor
do you guys know were i can find radio commands? like the "injued!" command? my medic does not heal injured squad mates
i wanna make a script so AI call medic once low on healt
Ingame config viewer.
Or
Use a default one
Yep
I am going to assume you want the unit to screech something else other than just injured
that page have no list of radio commands
Ingame config viewer. There's your full, complete and always up to date list.
thanks
π€¦
i think actions will work better
Slowly crawls away with hands over ears
Anyone know the basic concept of retrieving a texture in Arma from the web? I assume it's possible, as I've seen servers pull Youtube videos from the web. Basic goal is that I want to assign a billboard a custom texture, but have it re-retrieve the texture every 5 or 10 minutes from a webhost, rather than storing it in the mission file, to allow for easier changes to images, rather than having to modify the actual mission pbo.
Really? Would it not even be possible with a mod/hook specifically made for it?
htmlLoad?
it's for controls tho, he want a billboard, don't think that's possible
Definitely not possible with 3d object textures without editing the mission pbo / addon pbo.
Exception is Squad.xml, but that logic is only for the squad.xml stuff.
Wonder if you can abuse it somehow. Doubt it though.
Extension to download the image file onto client machines.
Don't forget about BE Whitelisting, since extension will be on client machine
But then you still need file patching.
or live config reloading, good luck with that
Not config, but inlcuding the texture into a loaded pbo file.
only possible with filepatching
i messed around with this once: https://www.youtube.com/watch?v=1XPozlo_b3k
htmlLoad with arguments for the size in pixels i want it, to get a map overlay from an online picture
that's about the max you can do, but there's a ton of flaws with it
Anyone know the basic concept of retrieving a texture in Arma from the web? try the clan sign application to a model i have seen that
you mean squad.xml? Those pictures are cached and even then i don't think you have a whole lot of acces to it
i think they assigned it squad url to a billboard which was the server / player or a logic
it weas a while back and it maybe even the billboard was Man class
i think you can even play live video now or HTMl vids cant you to a PIP ? or is it third party dll ?
when i did this https://www.youtube.com/watch?v=vdGU6vmPMrk i didnt need filepatching
it was in editor tho so who knows
That is PIP?
nope
no
How?
Yeah, that's not going to work outside the editor and without file patching.
The extension?
tried basically all of those solutions
actually loading in a picture needs filepatching
Why would it need filepatching if say allowed to load by the server?
textures are local
are we still talking about him wanting to load in a picture on a billboard?
if so, you need a local texture
u cant like stick a base64 encoded image into the set texture cmd
and without file patching you can't load pictures outside addon/currently loaded mission
is there a variation of the setPos that acept a array of objets?
No
foreach loop
im trying to use ```thislist setPos [11606.3,8057.68,0];````
Yeah but that's not a command variant commy. π
{
_x setPos ...
} forEach thisList;
Yeah but that's not a command variant commy. π
Put it in a macro and it essentially is.
Trigger.
Triggers? AGAIN?
that works
sits on the floor cries
No.
Not at all
Not one bit
What the hell is wrong with people and their triggers.
You get triggered by triggers.
what is wrong with triggers anyway?
Replace trigger with anything you do regularly in SQF and then feel my suffering.
Words cannot express the migrane i am getting from this convo
Aspirin, glass of water, nap.
triggers make stuff complicated for absolutely no reason and they don't do anything special that you wouldn't be able to do otherwise with more control
I thought you have beer there Commy. Wtf. Plus i am on lunch break, no beer here.
Beer doesn't help with headaches, does it?
Pretty sure aspirin and beer isn't the best
In my experience drinking water helps, and beer is dehydrating. If you drink so much that you pass out, then I guess it helped.
Hah. Well water it is then, with my luck i will grow a brain tumor over this trigger bullshit
If you dont want to die
Dont use triggers
If you dont want to live in anguish
Then dont use triggers
Ban them all
Unfortunately as a mere mortal to those at BI, i cannot lift the hammer.
I really hope that gets fixed
I am really tired of manaully placing ubits
But. But. But. But.
NOTE:Β Currently in Arma 3 this command does nothing π’
how do i getPosASL in the editor?
what do you mean?
i need to get the possition of someting in the editor, but needs to be in ASL
if i right click and log possition it does not work
open up the debug menu and put it in a watch field with the return of "log position"
just paste "log position"?
why would you think that?
nevermind.
Just found this on Github, by LordGolias https://github.com/LordGolias/dictionary
Cool stuff
Dictionaries in SQF wasn't something I thought I would see π
? Bunch of implementations of it
just use intercept and make a std::map from gameValue to gameValue.. done in <5 minutes π
Honestly if you add to intercept by default, you will prob get more people using it on serverside π
Yeah.. was planning on a plugin with such stuff. hashMaps, some math functions and such
aren't dicts just a normal key/value data structure?
in which case i've seen about 6 different sqf solutions for that
Yeah there are bunch of different versions, pretty sure CBA has one aswell.
A native version via intercept would be nice.
The important thing with Golias' version is that you can store OBJECT's which can have sub values.
and that it's serializeable
Intercept could use Arma's serializer though.. which is known to be able to serialize everything and deserialize it also over network
do you guys know a perfect loap for music?
loap?
pfh
_hashMap = createHashMap;
_hashMap set ["stuff", _object];
_found = "stuff" find _hashMap;
These command names are not as nice as I would want them.. But I don't know how else I would call that
Repurposing existing commands instead of adding new ones looks quite good
set would accept [ANY, ANY]
you can PVAR hashMaps just like any other type. But controls/displays would create problems as they can't be serialized
Would take me about an 20 minutes to implement into engine if I had access.. But BI doesn't have time for such things
https://image.prntscr.com/image/ZYOu0a2BQzemNB4uhNcxvw.png
https://github.com/dedmen/interceptTest/blob/master/interceptTest/cba.cpp
There we go.. Only took an hour because I was playing around trying to get serialize to work. But i didn't implement the necessary backend for that yet.. So no PVAR yet.
@little eagle Can you post that image here so that people don't need to click shady link? :x
but how would that be different from find? Just as alternate syntax doing the same thing?
hashMaps have no index
True. Then name the command select and not find.
125 find hashMap on hashmap with 10k elements.
0.002ms in diag_codePerformance
123 find map instead of map find 125?
I wanted to replicate the original find. That takes the array it searches in as right arg
No it doesn't
derp
There are 3 things I want from sqf
hashmaps
entityCreated mission eh
addClassEventHandler
entityCreated?
2 of these Intercept can't... Well... it could do it the CBA way.
entityInit. Like entityRespawn and entityKilled
I actually havent looked at entities yet, any short summary of what they are or a link?
It's just a mission eventhandler version of init/killed/respawn events.
If I had these 3, and the ClassEventHandler one would work with dialogs, I could turn the whole of CBA into a mission script.
Okey I added count hashMap and hashMap select ANY the select one is just a copy of the find
Good.
Throw some Ideas at me for other simple stuff I can implement
Is it case senstive or insenitive for the keys?
hashMap. so sensitive
It also accepts anything. case-sensitive only applies to strings
Important to dcument that. Will catch people out
@Adanteh#0761 Not possible
What else do people need?
I could add createNamespace but.. That's not "simple"
pseudo-namespace
well yeah.. I could just use the hashMap and accept it as argument to set/getVariable
No need for createNamespace when you have hashMaps. But maybe with hash do.
That's one of the few things I can't implement
Only arrays are passed as references. Numbers aren't.
I could do increment "varname"
But if you do increment varname
Then the increment function only get's the value inside varname. It can't actually write to varname
I do actually get values by reference. But...
_v1 = 5;
_v2 = _v1;
increment _v2;
would also increment _v1. And I guess you wouldn't want that
maybe a command implementation of usual config return?
dunno if that is a thing
private _value = call {
if (isNumber _cfg) exitWith { getNumber _cfg };
if (isText _cfg) exitWith { getText _cfg };
if (isArray _cfg) exitWith { getArray _cfg };
if (isClass _cfg) exitWith {
{
private _subset = _hashCurrent select 1;
private _return = [_x] call _fnc_recurse;
} forEach (configProperties [_cfg, "true", true]);
nil
};
nil;
};
ignore inheritance.. I can only do what SQF can do. Can SQF ignore Inheritance?
configProperties can
yes, but not directly
I mean, I can turn this into a macro.
All I'm saying is, that dedmen can therefore turn this into a function with the limitations he has.
Intercept would do the same as the macro. But in one command.. and thus alot faster
Yep.
ah okay. Anyway @still forum the vanilla config viewer shows is a config value is specified in that scope or if it's inherited by indentation
As an example
The ignoreInheritance parameter would work the same as the ignoreInheritance parameter does in configProperties.
default getNumber config
or getNumber [config,default]
array version, so you can add more parameters.
ignoreInheritance being optional and defaulting to false.
params ["_input"];
if (!(_input isEqualType true)) then {
if (_input isEqualType "") then {
_input = call compile _input;
} else {
if (_input isEqualType {}) then {
_input = call _input;
} else {
if (_input isEqualType 0) then {
_input = (_input >= 1);
};
};
};
};
_input
something likel this?
basically any input to bool
Basically the opposite of https://community.bistudio.com/wiki/parseNumber ?
yes
parseBool π
fn_parseToBool.sqf is my name π
Top
the combined config get would be nice though. getConfigValue (aka don't care what it is, just return it)
2 things. Do away with the "With" and write out "Def" as Default.
And getNumber actually works on STRING entires, but isNumber reports false.
So you need isText and isNumber.
GG compare_case_sensitive does case insensitive compare... WTF.. I code too much when tired
dunno if this makes sense, but ```sqf
params [["_code", {}, [{}, ""]]];
if (_code isEqualType {}) exitWith { _code };
if !(_code isEqualType "") exitWith { { false } };
private _function = uiNamespace getVariable _code;
if (!(isNil "_function") && { _function isEqualType {} }) exitWith {
_function
};
_code = compile _code;
_code;
Actually.. it compares case_sensitive on linux and insensitive on windows
aka give a string, if it's a function get that, otherwise compile it
Good job.
added getBool which works with number/string from config.
and getAny. Which get's number or string or array depending on what's there
nice
vectorRotate does what?
rotate by 5 moves first elements five to right. and last element get's pushed to first and so on?
ahh.. vector! not array π
my vector math is not so good tho :x
selectLast
^
_array select (count _array - 1)
pop which is deleteAt for the last element.
insert
getLast? seriously? :D
game_value getLast(game_value right_arg) {
return right_arg.to_array().back();
}
There ya go.
@little eagle popEnd and popFront ?
Sure.
popFront had a different name though, didn't it?
popEnd was just pop and popFront was...
arrayMove
params ["_array", "_element", "_targetIndex"];
_array deleteAt (_array find _element);
private _right = _array select [_targetIndex, (count _array)]; // [''hello', 'cya']
_array resize _targetIndex; // ['bye']
_array pushBack _element; // ['bye', 'hi']
_array append _right; // ['bye', 'hi', 'hello', 'cya']
_array;
or somethnign like that
does that sqf even make sense
game_value popEnd(game_value right_arg) {
auto elem = right_arg.to_array().back();
right_arg.to_array().erase(right_arg.to_array().end()-1);
return elem;
}
game_value popFront(game_value right_arg) {
auto elem = right_arg.to_array().front();
right_arg.to_array().erase(right_arg.to_array().begin());
return elem;
}
It's literally so friggin easy
Name popEnd, pop and popFront, shift
No, they'd get used to it, because the names are actually brilliant.
@Adanteh#0761 I dunno what that thing does
What about the real question here: peek
Example: [['hi', 'bye', 'hello', 'cya'], 'hi', 1] call MB_fnc_arrayMove;
Return: ['bye', 'hi', 'hello', 'cya']
but.. peek is just select isn't it? @tame portal
Peek is like pop, but it does not remove
So, select
well... select 0 ?
Basically
But selectLast?
so.. selectLast?
^
is that called peek
Adanteh that's swap ?
Peek is the more appropiate name
yes
peek is a better name than selectLast
Thank you
well not swap
but if you already have pop for front/end.
people would again be confused if peek means start or end
You are all insane
Peek always means top
No u
I havent heard of a peek at the bottom yet π
already have select 0 for start and selectLast for end.
could make a std::queue like datatype
selectLast was always known as peek
That's grown up words
well.. for me peek is "look at next value" and on a queue that would be first
selectLast.. is not first
peek _array // _array param [count _array - 1]
pop _array // _array deleteAt (count _array - 1)
shift _array // _array deleteAt 0
Everything else is a lie.
For me peek always means look at the last element and return it, but not remove it
make a PR if you want it π
[1:23 AM] Dedmen: well.. for me peek is "look at next value" and on a queue that would be first(edited)
^^ Yep
is it still server-only stuff
params ["_control"];
private _controlPos = ctrlPosition _control;
private _controlParent = ctrlParentControlsGroup _control;
while { !isNull _controlParent } do {
private _parentPos = ctrlPosition _controlParent;
_controlPos set [0, (_controlPos select 0) + (_parentPos select 0)];
_controlPos set [1, (_controlPos select 1) + (_parentPos select 1)];
_controlParent = ctrlParentControlsGroup _controlParent;
};
_controlPos
gets actual position of a (sub)control, instead of relative to its parent
For me a Queue only has Queue and Dequeue, Clear and Peek
@austere granite Does this work for controls inside controls groups from inside controls groups?
yes
Inside a pineapple under the sea?
yep.
push, pop, clear, peek
peek shows value at start of queue. as it is FIFO
π
Please react with a pineapple to your pineapple
Thanks
God damn it
π
Urgh, you disgust me
Cucumbers
Gimme more commands.. stuff that more than one guy finds useful :x
@still forum For?
params [["_pos", [0, 0], [[]]], ["_posSecond", [0, 0], [[]]]];
if (count _posSecond < 3) exitWith { false };
if ((_pos select 0) < (_posSecond select 0)) exitWith { false }; // Left of pos
if ((_pos select 1) < (_posSecond select 1)) exitWith { false }; // Above pos
if ((_pos select 0) > ((_posSecond select 0) + (_posSecond select 2))) exitWith { false }; // Right of pos
if ((_pos select 1) > ((_posSecond select 1) + (_posSecond select 3))) exitWith { false }; // Bottom of pos
true;
i only find UI things useful
I disgust you? Have you ever tasted an aubergine?!
posInPos thingie
give60FPS please
It tastes and smells like fresh not-cucumber in the morning
posInPos thingie
inAreaArray?!
forceFPS. Just end the frame after a certain amout of time.
lol
commy its for ui things
Oh, ok.
public void SetGameFPS(float desiredFps) {
throw new ArgumentException("Cannot be logical number");
}
logical number
inArea you could somewhat use, but half the arguments would be pointless
and obviously UI positions aren't based of a central point
pls
Doesn't this look like it's not a cucumber? https://i.imgur.com/hPURiEE.png
π
This looks like the veins on my cucumber
ArmA roads are SO inconsistent
Half of the roads aren't properly connected and hence roadsConnectedTo returns bullshit
how did you do that satnav? that's nice
It's especially bad on Malden..
you draw markers for the route?
@still forum createVehicle that takes vectors arguments
would then call setPos?
if arma's vehicle controls weren't so fucked you could make a cool euro truck simulator style mission with that
but driving in arma always feels bad π’
@rancid ruin https://i.imgur.com/hPURiEE.png
PURIEEE
nice link
Good bot
you gonna release that sat nav?
You got me in this channel to upload pictures.
I could just repaste the image path π€¦
@rancid ruin That's a modified map control
I actually don't know where this Navi could be useful lol
Life
I wrote it for that specific cough scene cough
Jesus commy
I'm sure some units want to run into battle with a TomTom in their hands
life communities would pay good money for it π
Jesus commy
Is this the nice way to point out that I should shave myself after a week already?
@brazen sparrow Oh they do, mostly because those people have no idea how to script
Their support tickets are always super silly things
I mean, have you looked at a instruction file of ours yet?
if u gave me a free copy i would π
They are basically bullet proof, if you do mistakes while following them you were either not paying attention or in general have a problem lol
"at the very bottom" is the 100% guarantee someone is going to add it at the top of the file
added findCaseInsensitive does what you think it does
Same for in now.
But god damn that name. Can't you come up with something better?!
Its ok you can make up a macro for it π
findMX, because CASELESS, slowclap
...
either go ifind or findci.
Or you could do both names etc, short & long version for the command
iFind and iIn
Would apple sue?
I'll go for findCI
Naming convention used for c++ (boost string crap), kinda before apple π
Cl (case Less) or CI (case insensitive)
invalid picture
commy just paste the link again
Why does it not work now lol
Dun't no work.
Not reposting junk.
if ("string" startsWith "st")
What do you mean?!
dunno what c 'ish people call that, but thats the python name
nvm.. also implemented
lol
game_value arrayAppendUnique(game_value left_arg, game_value right_arg) {
auto& leftArr = left_arg.to_array();
auto& rightArr = right_arg.to_array();
auto_array<game_value> output(leftArr);
for (auto& elem : rightArr) {
if (output.find(elem) != leftArr.end()) leftArr.emplace_back(elem);
}
return output;
}
nice
_array appendUnique _array2
That's quite inefficient though. I should first do a isSorted check and if it is sorted do a binary search instead
But I only want to do simple stuff now
no
for targetpath, targetmodefiles in extra_data.items():
That is script instruction stuff.. I'd need to have access to the compiler to do that. And I don't
okay
Atleast I don't want to because Battleye wouldn't like that
that's about all i can think off
appendUnique
It's called Union
It has been called that for hundreds of years π¦
but.. arrayUnion ?
Why not? They already fucked up arrayIntersect when it should've been named intersection
IMO it's more readable that way.
union and intersection as well as subtraction are basic operations in set theory.
You guys gotta have more Ideas.. I'm bored..
All the vector commands, but with n dimensional vectors, n!=3
vectorAdd should really support that.. and I can't add an existing command with same argument types
Theoretically I can delete Vanilla commands... But that is disabled for good reason..
can you disable setUnconscious
nth-root, ln (natural logarithm) and logarithm base n. Implement these.
there is no nth-root func in c++..
I know you can do that with log right?
and that is LN right? natural log?
log is base 10
solveRiemannHypothesis
there is no nth-root func in c++..
There is cuberoot. But I never understood why there's no nth root.
But you can do nth root with logn right?
Uhm, I don't know how you'd do that, but that doesn't mean you can't.
cbrt x
is just
x^(1/3)
I guess.
For SQF at least. Where there's no negative results for either anyway.
I now know why there is no nth root. std::pow(value, 1.0/root)
Sure.
Do you know how to change base of logarithms?
btw: The Topic is booooooooooorrrrrrriiiiiiinnnnnnnggggggg
Your mother is boring.
Probably
We are making new SQF commands here @jade abyss That's not boring
If only it were so easy
It is
okey.. apparently log(n)/log(15)
would be log of base 15
But this is the SQF channel. If you don't like it.
<------- there's the door
How do I implement my missions without mods with no sqf, huh? lol
No, there is your Avater Commy2
you think that's right? @little eagle
Yes.
Technically his avatar is set in the frosty outside world
base logn number ?
It's not that cold today here.
Technically... i don't give a damn
ln for natural log
uh, sounds kinky
yeah. already have that
Sounds more kinky
all done
I wonder how many mods I break with that...
With what?
adding new commands
Ah yeah.. didn't even think about that
Refresh me, what is OFPEC?
tag_name
MyTag_varName
tag is called OFPEC tag
Wait wtf? Why wouldn't people do that?
exactly, Adanteh.
because some people think their scripts are the only scripts that run in the game
Lazy. The real question is why people bother naming them fn_blah or fnc_blah though.
Someone should make something for that
like something you could use that takes care of prefixing
and adds module names too
And then does it a lot
GVAR π
Modules you can keep track of internally
Everything after tag_ should be yours anyway
GVARMAIN then
increment would a b nice one
+=
LOL
to get some Emoji into it
π€
+= best
++number would return the number.
+= still not possible
so you do _number = ++_number instead of _number = _number +1;
guess that doesn't really make it better
bla bla bla excuse bla bla mimimi blablabla
Do it!
no
missionNamespace setIfNil ["varName", {code}] ?
++_number
This currently is the same as
_number
You might break something with this.
instead of the endless if isNil _var then _var = x
*IfNilSet
How are you adding commands anyway
New DLC
Intercept
.. i wish i could locate my Intercept = Orange DLC picture now π¦
Do we have pushFront(Unqiue) already?
no
wow you guys are still at it
Do it. I wonder if it should report the size of the array afterwards or just 0.
carry on at this rate and you'll have fixed arma 3 by morning
Not unless addClassEventHandler is implemented.
still boring
game_value pushFront(game_value left_arg, game_value right_arg) {
auto& arr = left_arg.to_array();
arr.emplace(arr.begin(), right_arg);
return {};
}
game_value pushFrontUnique(game_value left_arg, game_value right_arg) {
auto& arr = left_arg.to_array();
if (arr.find(right_arg) == arr.end()) arr.emplace(arr.begin(), right_arg);
return {};
}
Just return nil now.
I guess pushFrontUnique could return bool
added something or didn't
does that now.
... compiling since 30min, bluescreen... Okay guys, you got me for ~45min again \o/
what u compiling?
A specific Engine
#Unreal
#BetterThanSQF
#Intercept
--- Break
#StillArmaBugs
Can you use the Eden boundingboxes and resize them through scripting?
No
no
reee
yes