#arma3_scripting
1 messages ยท Page 401 of 1
LOL
I had taht as well for s&d ai to clear buildings
nah, it's a waypoint :/
Shit was annoying
Do you save all the used positions?
so 2 units don't end up in same pos
I have a check to avoid that
I wanna use the same array because then it won't conflict with ace garrison
teeeechnically i could save the pos, but AI being AI they don't always stand exactly there
you save like houseposition position?
nope
Wha den ? ๐
unit check in a very small radius on the pos before placing / giving a waypoint
I also have something for those that path to there
can't remember what
nope
huh?
they won't end up on the same pos, i'm 100% sure of that
How do you make sure of that? 2 buildings 20 units per group
5 groups
No one stacks?
the function tells you it can't place all of them and they don't path / get placed
enabling debugging on the AI component will show you traces like those:
TRACE_1(format [ARR_2("fnc_garrison: while loop ended | %1 units ready to be treated by PFH",count _unitMoveList)], _teleport);
ah, I save the units currently being "guided" to a pos to avoid stacking
where are they shaved?
only units currently moving are there:
missionNameSpace getVariable [QGVAR(garrison_unitMoveList), []];
aahha
so, ace_ai_garrison_unitMoveList
okaay thanks
I technically could cache the positions but it wouldn't be of much use if a zeus place a unit there or one make it's way there
or if it get killed, etc
honestly seeing AI climb ladders terrify me
there's some issues in the pathing algorithm imho, AI absolutely refuse to path in certain situations
like, they climb those small brick houses in construction (the ones with the ladders), but can't get down
missing ai positions but pathing seems to kinda work
actually takistan houses seems to be the ones working the best
they nearly always climb ladders to get on roofs there
they can even naviguate those 3-4 stories houses with dual ladders fairly easily
yeah
Which small brick houses u talking about?
btw zenomorph or sth made script that checks if it's a window
and such
back in a2 i beliv
not really houses, like those small construction sites with a single story and a "roof" (flat area) accessible via a ladder
also the control tower ladder is either misplaced or has fucked up lods
the AI cannot climb them :/
What is better in terms performance? a loop check or a waitUntil?
Like for checking if a target is nearby and if yes then boom
yeah, you can go with a waitUntil (which is a loop)
it suspends the rest of the code until the condition is cleared tho
k
also, scheduled only
If you need to check a condition every frame and run the code every frame it's waitUntil
every frame sounds a bit... too often
waitUntil{sleep 1; (condition)};```
also works, if you don't need it every frame. (sleep first! Condition must be on the end)
sleep is checked more often than that btw
tztztz
once you realize you don't need sleep, it blows your mind wide open ๐ก
dscha hasn't changed his name yet today
Well Currently im managing a IED array using a loop with a sleep at the end that checks for every IED nearby targets
wrong
well its not one IED but like 20-30
nevermind
and triggers trigger to much
I was thinking 3-4 ๐
lol who places only 3-4 IEDs on a road
You can't have IED with sleep
and yeah, don't use sleep in scheduled if it's for IEDs
I use uiSleep
network lag + scheduler = the vehicle has passed the thing before the condition is checked
it is currently one loop for all bombs
30 bombs ~1 second (30 fps)
but how should I manage all bombs with one waitUntil?
wait I just show you how I did it so I can get suggestions to improve it.
sleep 2;
//Setup global variables.
if(isNil "IEDList") then {
furv_IEDList = [];
furv_IEDcount = 0;
furv_IEDSleepTime = 0.5;
};
waitUntil {furv_IEDcount > 0};
while {furv_IEDcount > 0} do {
{
if(!(isNull _x)) then {
_objPos = position _x;
_targets = nearestObjects [_objPos, ["Man","LandVehicle"], 2, true];
_counter = {alive _x && not(side _x == opfor)} count _targets;
//Explode IED
if(_counter>0) then {
furv_IEDcount = furv_IEDcount -1;
_x setDamage 1;
}
}
} forEach furv_IEDList;
uiSleep furv_IEDSleepTime;
};
wait why the fuck are you sleeping right at the start?
#define pirate private
pirate _bombs = [];
waitUntil{
if (_bombs isEqualTo []) then {
_bombs = _bombs + my_bombs;
};
pirate _bomb = _bombs deleteAt 0;
//check the bomb
false
};
pirate
@still forum Might not be bad for a mission.. I mean.. it's your mission that breaks when you add a mod from someone who thought the same
could also be a new script command. no reason to not use tags :p
XD
fixed
yeah just redefine the typo l o l
i'm going to burn you for that define nigel
my macro files are giant becauise i make alot of typos
private is faster than without
So, then explain me why to use private in there =}
lemme explain
faster
@peak plover I dont understand your script.
it checks a bomb every frame
global vars:
Available in the namespace they're defined in, use tags, no need for privatization since they're available in all scopes
_local vars: Available to the current and lower scopes, privatize, always
Privatization, push the local var to the innermost scopes, avoid the local var being redefined 3 scopes down
simple ๐
Every... Frame?
ah now I understand it
speed == 1 bomb / frame
but isnt a every frame check performance heavy?
no
@delicate lotus before you were checking all bombs as fast as possible then sleeping
it depends on how many scripts are running, how heavy the checks are and how much you want to break triggers
and my target check using nearestObjects is good?
You checked a lot more than one per frame
oaisdngfiasbgdasg
wtf
_counter = {alive _x && not(side _x == opfor)} count _targets;
_counter = {alive _x && {not(side _x isEqualTo opfor)}} count _targets;
to make it only check the second condition if the ffirst one is true
Run that and note the times
! is a lot more readable
Yep
same as those people using AND and OR
I use ! and not
&& || > AND OR
it reminds me too much of electrical logic gates
but I didnt know that you can put condition inside conditions using {}
&& || master race
Anyway, Nigel: Check your Codetimes above ingame (or even try that with more conditions).
afaik it's best if the conditions that check false more often are placed first
I think it was @still forum the last time, as we tested that
but honestly it doesn't matter, I still use lazy eval
I should've gist'd the results of the tests we had on #dev in the ace3 slack
iirc LazyEval doesn't seem to work ๐
it does
check the times again
it's not true lazy eval tho
i mean, now^^
1-2 Weeks
oh ded retested it?
It wasn't that long ago
There is nothing wrong with the ui scripting in Arma: https://github.com/CBATeam/CBA_A3/pull/860/commits/66bd2e5891fb517b6d5d9e19a88a7e7bb8c013e4
@little eagle Oi, where you there, when we tested lazyEval?
shit commy, the band-aid is bloody again, apply another one
_bombs = _bombs + furv_IEDList;
Why add an empty array to it?
deleteAt would edit original array
wait, where is that
if (_bombs isEqualTo []) then {
_bombs = _bombs + furv_IEDList;
};
does not make sense to me, explain pls
that doesnt make sense
if "furv_IEDList" is an array that's stupid
Otherrwise you edit furv
so _bombs = +FURV_IEDlist?
It kind of does iff you want flat copy of furv_IEDList, but then you could use [] + syntax.
So _bombs = furv_IEDList ? also yes furv_IEDList is a array.
it depends on what he actually wants i guess ๐
a copy of the furv_IEDList array
[] + then probs yeah
do you need to keep furv_IEDList as is or can you modify it?
@cedar kindle New script command? ๐ nice joke
@lone glade yes I need to keep it as is
then use +
or wait...
if (_bombs isEqualTo []) then {
_bombs = + furv_IEDList;
};
Oi Dadmouse, do you remember if lazyEval worked or not?
wow=+ wrosk?
^what commy posted
If I blow up an IED, it will be objNull right?
yes.
I need a null check then...
@jade abyss what u mean by "work"
waaait a second, let us explain
@still forum any advantage
yes...
@peak plover + ARRAY is deep copy and [] + ARRAY is flat copy of arrays.
above a certain level yes
Wasn't the last test kinda dissapointing?
if you do _bombs = furv_IEDList and edit the _bombs array you'll end up modifying furv_IEDList too
When we discussed Quaksliver's mess
What's a deep cop[y?
if you have if (_lvar && _var2 && _var3 && _var4 && _var4) it's not really worth it
yeah thats why im going to do a deep copy now
@peak plover The difference between deep and flat copy is, if sub arrays are also copied or passed by reference.
"Worth it" starts when?
When it's worth it.
I wanna punch you right now
Can't really say that. You need to develop a feel for it
= + not working
Deep copy: also copy all sub arrays, flat copy: copy array, but keep references of sub arrays.
What do you mean "not working"?
Wait now im confused
g = + [4];
g
//[4]
?
I still need to do a null check to check for IEDs that already exploded?
shouldn't it add anothr 4 every time I execute
why the fuck would you use + there
That is working, nigel.
I'll make a script to illustrate the differences and then paste it as gist.
Gimme a minute.
example:
I don't use + when using getVar on a profileNamespace array, when modifying the local var where said array is now saved I also edit the original array in profileNamespace
to avoid that I use +, tadaaa, the local var is now a new ref separate from the profileNamespace one
for "_i" from 0 to 100 do {g = g + [4];};
g
//[4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4]
for "_i" from 0 to 100 do {g = + [4];};
g
//[4]
array + array is something else
=+ just same as [] +
Yeah I already understood that thrice
I''m trying to delete a ctrl but getting an error saying '/playerSettings/controls/butnHidemarker.hideMarker': "" encountered instead of '='
what does this mean?
private _bombs = [];
waitUntil {
if (_bombs isEqualTo []) then {
_bombs = +furv_IEDList;
};
private _bomb = _bombs deleteAt 0;
_objPos = position _bomb;
_targets = nearestObjects [_objPos, ["Man","LandVehicle"], 3, true];
_counter = {alive _x && {not(side _x isEqualTo opfor)}} count _targets;
//Explode IED
if(_counter>0) then {
furv_IEDcount = furv_IEDcount -1;
_bomb setDamage 1;
furv_IEDList = furv_IEDList - [_bomb]; //Look here
}
false
};
Can I use that instead of a null check?
@stable wave it means your config is wrong, that isn't a script error.
I just copied ```sqf
class btnKillfeed : w_RscButton {
idc = -1;
text = "Killfeed";
onButtonClick = "with missionNamespace do { [] call A3W_fnc_killFeedMenu }";
x = 0.158; y = 0.57;
w = 0.125; h = 0.033 * safezoneH;
};
class btnHidemarker : w_RscButton {
idc = 1;
text = "Hide Marker";
onButtonClick = "with missionNamespace do { player setVariable ["hideMarker", true, true] }";
x = 0.296; y = 0.57;
w = 0.125; h = 0.033 * safezoneH;
};
I just copied the first class and make the second one
btw
wow, haven't seen screen percentages used in ages
if !(((nearestObjects [_objPos, ["Man","LandVehicle"], 3, true]) select {alive _x && {not(side _x isEqualTo opfor)}})isEqualTo []) then {
// explode
};
if they are IEDs
you should also check speed for gameplay
If you wanna let them defused
No they should not be defuse able
I do not want to use ACE period.
private _origSubarray = [0, 1, 2];
private _origArray = [_origSubarray];
private _refCopy = _origArray;
private _deepCopy = + _origArray;
private _flatCopy = [] + _origArray;
_origSubarray pushBack 4;
private _newSubarray = ["a", "b", "c"];
_origArray pushBack _newSubarray;
systemChat format ["Reference Copy: %1", _refCopy]; // [[0,1,2,4],["a","b","c"]]
systemChat format ["Deep Copy: %1", _deepCopy]; // [[0,1,2]]
systemChat format ["Flat Copy: %1", _flatCopy]; // [[0,1,2,4]]
@peak plover
๐ค
@peak plover you are mixing up += and =+
yes
I hope my example is clear.
Hmm this is very interesting
Yes, even though it's seldom needed, it's good to know.
And ofc this is all undocumented.
anyotne got biki account?
yes. everyone
everyone now
I dont
pls post cod stuff
@delicate lotus You don't have a BIF account?
no I dont have
it was changed a while ago
Registraion of new accounts for the Community Wiki has been temporarily suspended. We apologize for the inconvenience.
That's a lie
Temporarilyyyyyyyyyy
it just can't register because they accidentally IP blocked their registration proxy
And how do I log in?
I can login fine
This is the page that comes up when I try to log in though.
after logging in or before you are asked for creds?
After creds.
It creates your biki account automatically in the backend
I guess that's not working as they have banned their backend from accessing biki
That's all very interesting, but it means that I can't post anything there.
I got an arma mobile ops newsletter from the biki account dwarden created for me
wew lad
sooo, yeah, it's a bit fucked right now
furv_addIED = {
params [["_object", objNull,[objNull]]];
if(!(isNull _object)) then {
furv_IEDcount = furv_IEDcount+1;
furv_IEDList pushBack _object;
};
};
Is a null check here necessary?
Anyway, here it is: https://gist.github.com/commy2/d0af36ba7b839eb8eb93874b08dcab2e
Learn it, bookmark it, or just ignore it ๐
@delicate lotus Is that a joke question?
I didn't change tho
You just notice it more because my name stands out more
which might not even be because of the blue
well it's also the asci art
Magic spider attack!
so there's that
@delicate lotus You potentially set _object to objNull just one line above. So object can obviously be null. And if you don't want null objects the null check is obviously necessary because you have objNull right above it
๐ ๐ ๐
๐ ๐ ๐ฅ
the feeling when you think turning your script into a inline function is good until you notice that you actually execute the function before it is even registered.
use cba xeh
welp time for cfgFunctions.
^^
If I create a file called functions.hpp in the mission root folder and add #include functions.hpp in the description.ext, will that work?
Yes.
how to escape double quotation marks in contrl text attributes?
" ' ' "
works like a charm. thanks
okay I think I made some bubu
I have 15 objects with [this] spawn furv_fnc_addIED; in their init.
Function code:
params [["_object", objNull,[objNull]]];
if(isNil "IEDList") then {
furv_IEDList = [];
furv_IEDcount = 0;
};
if(!(isNull _object)) then {
furv_IEDcount = furv_IEDcount+1;
furv_IEDList pushBack _object;
};
Yet furv_IEDList only contains one of the 15 IEDs.
what did I do wrong?
if(isNil "IEDList") then {
Forgot to tag this one.
It's always undefined, and therefore furv_IEDList becomes [].
Btw, what's the point of furv_IEDcount if you could just write: count furv_IEDList?
nobody can trust your refactor
@little eagle furv_IEDList will contain null objects / IEDs that are nolonger alive.
OK.
It's not proper refactoring if you don't end up with twice the features, half the bugs, and a quarter the code.
And 5% more lifetime gone
and a lot of tears
That's why I decided to write perfect code from the start.
yes you never do errors
Only happy accidents.
"happy crashes"
"perfect code"
I haven't crashed my Arma in months tho.
I see you haven't touched the diag branch
aka the "I fucking swear i'll crash if you ever take a glance at me" branch
@little eagle you want to crash your game? include a reference basic Arma files in your description.ext, pbo the mission and try to host it in mp.
Yeah, I know. It's been bugged since they added 3den.
Works fine with files in the mission folder though.
@delicate lotus why furv_IEDcount ? Why not just count furv_IEDList
ikr
Its not like we already discussed that
^^
I read slowsly
I see
But reply fast.
Now I could be cocky and make a joke about slowly reading, age and your name but I dont wanna be banned.
I haven't crashed my Arma in months tho. Nice! I crashed it a couple dozen times just yesterday
I can't ban people
You know why?
You crash the game, because you haven't released tf-ar one zero yet.
If you do something wrong you get a script error. If I do something wrong I get a crash
Is it possible to remove the Open Inventory Action from ammoboxes while still being able to add custom Actions?
Only with addons.
:/
I guess for a mission you could try inGameUisetEventHandler or whatever the name was.
And overwrite it with a custom script.
Or maybe inventory opened eventhandler or whatever that was called again and block it.
nah that would be too much work for such a tiny detail.
If I execute clearItemCargoGlobal _box from initServer.sqf. Will it be synchronized to JIP players?
Global == Global == everywhere == yes
I think technically it copies the cargo space from the server once you connect, so it would also work with the deprecated non-Global commands, for JIP only.
in MP, where is a player local?
no not like that
Init box in the editor.
initPlayerLocal.sqf
I mean like a function
Like I have a addAction which code should be executed on all machines.
Once activated?
yes
remoteExec
thx
I just found out that I can give remoteExec a object as target so I dont even need to get the objects owner ^^
commy will medical rewrite force broken legs to lye down like in ace2?
S-sure.
you'll have turned into nothingness eons before the medical rewrite release nigel
Well I can edit the current one for my liking until then
Already got defibs, pakking in medical resets revive lives, pakking in medical 5x as fast, fixed bleeding screen
Surgical kit fix broken limbs
Gotta do the lie down with broken legs
That would be funny
@little eagle When is your Realistic Rope Community DLC going to drop?
haha
Feed me for a year and I'll think about it.
@little eagle no
Well then "never".
Oh I wish.
A working game as dlc
๐
FPS dlc
can you survive on dried fruits and berries with a tiny bit of water ?
gotta start that self mummification process early
I'm already working on fps mod. No need for DLC
๐ฉ
tfw all your friends play in Arma is life and y hate it
well they dont even play arma anymore
Anyone got link to that life mod that wants to do standalone?
"X is unfriended, arma's discord is my new friend"
There was a trailer?
they only play rainbow or this knight game from ubishit.
for honor?
yes
For honner. Who is honner?
lul
I want to see it now, just to see how many stolen / badly imported assets I can spot
yeah the titel is cancer
Well im a teen and I dont like life mods
(as in using UE4 community stuff)
Yes
Nigel, I can't make the mission create the slot dummies automatically, but I can simplify it down to the mission maker having to execute:
10 execVM "setup.sqf";
In the editor once and save the mission, where 10 is the number of slots.
Looks like just crappy UE4 stuff
and I doubt it actually functions
Just setpieces to sell the gam
UE4 > RV4
it's a nice little UE4 projects to learn how to asset flip tho.
is it possible to create playable units on the fly?
No.
is it possible to create a gamemaster setup on the fly? like making a unit gamemaster using a script. (Zeus = Gamemaster)
Well, it not being possible implies it being impossible as far as I can tell.
๐ค
@delicate lotus The closest thing is something like this: https://github.com/commy2/Arma-3-Scripted-Lobby
Which I guess is in it's testing phase?
fucking as in changing base classes for UI overrides?
CHANGE FONT SIZE
Just delete it, it's not needed.
star shitizen*
you don't want to be put on the naughty list, do you ?
star citizen is a great game
Further you smug, santa hat wearing, cat. Many will disagree with you
If I do player setVarialbe ["someVariable", true, ture] on a client and then he quits to the lobby and join another side, what will the value of someVariable be?
unit doesn't exist anymore, nil
OK
@subtle ore And? just because many disagree about it shouldnt change your own opinion
There isn't a lot of game to be calling great really. When it becomes an actual complete thing to review then it might very well end up great, but right now the ingredients aren't even gathered let alone cooked into a great chilli
now, now, this isn't the place to discuss this
yeah this is #arma3_scripting
Is there a way to set the number of rounds of a magazine inside a container?
Basically, I need to drop a players weapon, with its loaded magazine and items, and have him able to pick it up again.
There is an ugly work around.
It uses waitUntilAndExecute, but it could be rewritten to use spawn/waitUntil if needed.
Are those in cba at the moment?
And when the dummy performs the action, does it take time equivalent to the animation? (I gues thats what the repeated delayed runs of _fnc_drop is for?)
how to check a variable is not set on an object?
private _var = _object getVariable "varname"; isNil "_var";
thanks
if (isNil {_object getVariable 'gang'}) then {
// no gang set
};
@peak plover Christ man, you really do have lifer code don't you?
ummm... no i don't ๐ณ
Explain to me what that shit is then huh?
umm... just a random example ๐ฐ
how can I write "" inside of a string?
Noooo....this goes far more than example
@delicate lotus
_string = '""';
_string = """""";
d-d-d-dude ๐จ I'm not life lol ๐ฐ
nigel is not life
Yes you are!
Nigel is a lifer#
๐ญ not life
Yes you are nigel, i will crack you open like a peanut until we find out the truth
๐ง
Midnight is bullying again
Like a cheesy 80's spy movie Nigel, we'll find your stash of lifer code
"what the..... ARE THOSE DONATION SCREENS ?"
"CALL THE SQSTAPO"
"bake him away boys"
๐ต
life is a great gamemode and should be the original arma.
okay yeah thats a bit too much of sarcasmn
life is what brought in the most money in recent years and should be a bigger focus for BI
a perfect mix between devil's advocate and sarcasm
I REFUSE TO BELIEVE
they know, it's not bad
FAKE NEWS
Many would do a lot worse in that situation
New dlc for our mil game? let's add ambulances ๐
All life players buy dlc because pop up message and wanna drive ambulance
ez $$$
we need lootboxes in arma
life boxes
not monetized
๐
Rare item "life" (bans you from all life servers permenantly)
I wonder if lootboxes go against BI monetization rules
wait, wait, wait, randomized arsenal items gotten through a "roll" wheneve you open it
drop crates from the sky and pick one ๐
@lone glade Hahah
Hold down CTRL+R in arsenal
And hear people withoiuth ssd cry lag
anyway yeah
lootboxes
yup
like 300% improvement?
unit spawning has no stuttering
I run it on a hdd just fine
ctrl + R doesn't do anything in ace arsenal
Loading times are very fast compared to normal (with mods)
Eggsellent
Somehow scripting is more fun than thinking of pictures and story for a mission
Some say drinking bleach can be more enjoyable thansqf
Ugh
Agh
Egh
I got a cool story for a mission, roleplay as civilians
@delicate lotus link a script you made
Java? ๐คข
a script?
1 sqf
Functions are scripts
and some loadout scripts exportet from the arsenal
/*
author: Alexander
description: Equips vehicle with basic NATO supplies.
returns: nothing
*/
if(isServer) then {
params [["_car", objNull,[objNull]]];
if(!(isNull _car)) then {
//Clearing
clearItemCargoGlobal _car;
clearMagazineCargoGlobal _car;
clearWeaponCargoGlobal _car;
clearBackpackCargoGlobal _car;
//Adding
_items = [["arifle_MX_ACO_pointer_F",2],["30Rnd_65x39_caseless_mag_Tracer",10],["100Rnd_65x39_caseless_mag_Tracer",10],["FirstAidKit",5]
,["ToolKit",1],["HandGrenade",5]];
{
_class = _x select 0;
_amount = _x select 1;
_car addItemCargoGlobal [_class, _amount];
} forEach _items;
};
}
wat
oh yeah totally forgot that
well that for example is the function I use to equip vehicles with nato supplies
nothing too shiny
But what if you need csat supplies?
then I will adjust the script to my needs
You need to make a function that will work with a car and cargo
Then you don't have to rewrite function
thats true
But only change car and cargo (params)
soo tru
Function: loadout_fnc_cargo
Description:
Adds loadout to vehicle/box/cargo
role/faction can be forced
Parameters:
0: _target - Unit or container
1: _faction - Faction string or side (defaults to west)
2: _cargoType - Cargo type array, default "generic"
Returns:
nothing
Examples:
[car] call loadout_fnc_cargo;
[car,"nato",["ammo","medical"]] call loadout_fnc_cargo;
nvmd.
I also had a autocargo function that determines automatically cargo based on what's in there. Like for ex. car has 1 personal aid kits. it will get medical only, but if it has a rifle it will get a rifle with the correct faction
so if first example, it would just do that
wow thats actually quite nice
at first it takes a lot longer, but later on it speeds it up a lot, because I only edit 1 file to change vehicle,unit loadouts and cars and units will have same maagazines
๐ค
West,trapped_civies
@peak plover How do you check if its a Unit or a Container / Vehicle? My idea would to use isKindOf "Man" and if not then cargo, right?
if (_target isKindOf "CAManBase") exitWith {
container and vehicle are identical
so they don't need to be checked
if (_target isKindOf "AllVehicles" || _target isKindOf "ReammoBox_F") then {
LOL I didnt know something like CAManBase exists
or ReammoBox
is that all listed in the config Browser?
why ru?
what program do you use to make your scripts?
Looks nice
with this if you have your blinking | on a scripting command or function and press f1 it opens the bohemia wiki
holy
also autocomplete and stufffs
Im going to take a look at it and check if it is better then the Arma 3 Plugin for IntelliJ
its gucci
can you make custom snippets in it too?
what u men
You know what a snippet is right?
no clue
its like the header you posted
manually write it lol ๐
but automatically added at creation
soo many editors
Soon everyone will switch to VSCode once the SQF debugger works with it ^^
probably tbh
wats vscode
Microsoft's go at electron script editor
Is there any good tutorial on how to use diary entries with JIP?
anything I can think of seems way too convoluted to be the only way to do it
๐ค
Is there any good tutorial on how to think of a story?
Pretty broad question for a scripting forum. Many stories following the https://en.wikipedia.org/wiki/Hero's_journey
@delicate lotus Are you asking about stuff that belongs to #arma3_scenario
sry @still forum
If it's about a real story, then there are better places to ask than an arma3 server xD
Just go on any life server forum, there are great stories there
if it's about a story for an arma 3 campaign, then I don't know, maybe #arma3_scenario, maybe some game development community
also, in arma the best stories aren't scripted
they just happen
and are unique to the players that played them
๐ ๐ ๐
a good mission simply leads the players to allow for great stories
But he wants abackstory/brief
try /r/worldbuilding then
It is certainly hard to implement a story / a good briefing in a mission which is just casual hostage rescue
Animated avatars should be banned.
discord gold feature
Just like those non ASCII char names.
non name names banned
faces, icons, heats and numbers ban
As it should be.
only normal names pls
You mean I attract myself?
You seemed like a reasonable guy, Dedmen, until you started with those animal costume shit.
Guys, can shift you beef from #arma3_scripting to #offtopic_arma please?
Or you just argue in sqf...
push FurtherV
push cookie
callOperator eat
Who is cookie @still forum
how can I get the argument from a EH? like for the "fired" EH how can I get the projectile
nvm
XD I got it
okay new question
so I got this nice piece of code
_this removeAllEventHandlers "Fired";
_this addEventHandler ["Fired", {
_ZBullet = _this select 6;
hint format["%1", (( typeOf _ZBullet))];
}];
_this select 6;
is the porjectile that is fire,bullet,grenade mines ,whatever
my question is,how can I check to see if _zBullet is a bullet and not say a mine or grenade?
if I'm using cutRsc how do I locate the display that I created?
what is the typeof in your example? @edgy dune
like wats the output or why I have it?
what example output
maybe you can use isKindOf
@tulip cloud make your display set a uiNamespace variable in it's onLoad handler
the output is like
swop_dc15_ammo or something
if I do IsKindOf, wat do I compare the bullet to? the bullet superclass?
Maybe just Bullet
XD thx ,i tried to find out but idk where to start looking for the superclass of bullets
I thoguht it was the 7th parameter?
in the "fired" EH
ohh
shit
there is ammo
thx tho
Hoping for some noob scripting help.
How can I get the addAction to reference/link-to the _rooftopDoor/_streetDoor created in it's iteration only? When I run this as is, upon selecting the action, I get transported to the last building position that was created in the initialization process.
_thisMapCenter = getArray (configFile >> "CfgWorlds" >> worldName >> "centerPosition"); //Using map centerPosition so script can be used for multiple maps in future.
_searchArea = 30000; //_searchArea is large to accomodate multiple maps useage.
{if (_x isKindOf "Land_MultistoryBuilding_03_F") then {
_buildingFoundation = "Land_HelipadCivil_F" createVehicle [0,0,0]; //Using Helipad for future helo placement/use and it's ability to attachTo objects.
_buildingFoundation setpos((_x)buildingPos 14); //Using buildingPos to get standardized height placement, using setPos on ground was returning varying heights based off each buildings terrain placement.
_buildingFoundation setDir (getDir _x);
_buildingFoundation setVectorUp [0,0,1];
_rooftopDoor = "VR_Area_01_square_1x1_grey_F" createVehicle [0,0,0]; //addAction roof placement position.
_rooftopDoor attachTo [_buildingFoundation,[.45,11.9,-.6]];
_rooftopDoor setDir 270;
_streetDoor = "VR_Area_01_square_1x1_yellow_F" createVehicle [0,0,0]; //addAction street placement position.
_streetDoor attachTo [_buildingFoundation,[-.5,6,-52.41]];
_streetDoor setDir 270;
_rooftopKeypad = "Land_InvisibleBarrier_F" createVehicle [0,0,0]; //Placed over keypads next to doors, runs the addAction.
_rooftopKeypad attachTo [_buildingFoundation,[2.92,11.17,.55]];
_rooftopKeypad addAction ["Street Access","
_operatorUnit = _this select 1;
_operatorUnit setPos [getPos _streetDoor select 0,getPos _streetDoor select 1,getPos _streetDoor select 2];
_operatorUnit setDir (getDir _streetDoor);
",[],6,true,true,"","_this distance _target < 4"];
_streetKeypad = "Land_InvisibleBarrier_F" createVehicle [0,0,0]; //Placed over keypads next to doors, runs the addAction.
_streetKeypad attachTo [_buildingFoundation,[2.05,5.26,-51.31]];
_streetKeypad addAction ["Roof Access","
_operatorUnit = _this select 1;
_operatorUnit setPosATL [getPosATL _rooftopDoor select 0,getPosATL _rooftopDoor select 1,getPosATL _rooftopDoor select 2];
_operatorUnit setDir (getDir _rooftopDoor);
",[],6,true,true,"","_this distance _target < 4"];
}
} forEach (_thisMapCenter nearObjects _searchArea);
Format this please! #info_help_tips
_rooftopDoor and _streetDoor are not defined in the addAction code
I have no Idea how you get it to use the last created buildings thingy
use _keypad setVariable ["rooftopdor", _rooftopDoor] and then in your code _keypad = _this select 0; _rooftopDoor = _keypad getVariable... and the same for streetDoor
@still forum Thanks, I'll give that a try. I had a feeling it was going to involve setVariable, but I don't yet understand how setVariable really works.
Is there a way to override settings for vehicle cargo capacity without modifying actual mod files?
_myDisplayIDC ctrlSetPosition [(_startLocation)-((0.092500*_percent)* safezoneW + safezoneX),_ctrlPos select 1];
This is my failed attempt to shift a display control on the screen.
I want to shift it to the left by 0-9.25% of player's screensize depending on a percentage. (For a status bar showing the value of 0-100%)
When I do ctrlPosition it shows the x position changing by .3-.7 with this script.
nvm..I see my mistake :/
No @drifting sierra
If you like ugly solutions and a lot of code to do a simple thing like changing the inventory space, it is possible.
However, if you are new to SQF, no you cannot do it.
Yea, i am new to scripts
If you want to attempt it, have a look at the eventhandlers; onContainerOpened, onContainerClosed, onPut, onTake.
has anyone messed with the civilian presence thing much yet?
i'm trying to figure out how to control the civs a bit more
The spawner module? @rancid ruin
yes
I tested it out when it was released. Quite nice feature, however it was limited for me. (The AI seemed to go to the point of the module and stand there.)
Then others after the first AI, would move around...
This question is more for #arma3_scenario imo
not really cos i'll be controlling them with scripting
i can moveto the civ agents to make them go to non-module waypoints, but then afterwards i'm not sure how to reset their behaviour
Hm is there something where you can put an addaction on all assets even if they will be spawned
@gray thistle What do you mean? Do you want to add it to like terrain buildings as well?
If so (there might be a better way) you can use nearestObjects and add it to a certain class on all objects
But it might be better to addAction when the cursorObject is the right type even at a certain distance this is more optimized
i just want to have an action on default on an asset like B_UAV_06_F for the leafelets
instead of this (the object) i want to add it on the asset (all object created and uncreated to be created later on)
I need help scripting an evac heko to take off on eden editor i got it to land but cant figure out how to get it to take off after i get inside
'''If ((vehicle player) == helo) then {(group helo) addWaypoint [[0,0,0],0]};''' may help
Put it in the get in waypoint of the player
there's quite a few premade scripts that you could look into for evac choppers and piece together, check armaholic & biforums @twilit scarab
what would side player return for Independent players?
in OFP it was GUER, I doubt it's changed
what would playerSide return then?
Same thing, only if the player were to switch sides playerSide would return the first selected side
side player would return the current side regardless of what was picked first
OK
if (side player == GUER) then {ctrlDelete (_Dialog displayCtrl 8811)}; gives me Error Undefined variable in expression: guer
@stable wave use Independent
https://community.bistudio.com/wiki/playerSide (also check the link thru for side)
Guer is obselete iirc
but you can test it yourself by just writing a quick script to output "side player" as a string to a hint\
^ or that, probably easier
Damn phones
I did that last night and it did return GUER
then it's your script
Why the hell would it return guer?
I've never seen "independent" used in a script, that said I typically don't use indy
I have always seen returns as "Independent" in a3
GUER is string representation of independent side
so I should use INDEPENDENT?
Why in caps? Its just a scripting command that returns side value: https://community.bistudio.com/wiki/independent
tbh, i did the same ๐
"GUER"
*Gorilla
resistance ftw
call compile str side group player == "GUER" ๐
if i'm not wrong, side player == "GUER" will work too
because the output from side obj is a string
@stable wave
side group player this even works, when the player is dead (dead = Civ)
Siri, remind me to change the debug console representation of the SIDE types.
I am sorry @little eagle , but i didn't understand. Please use more Macros.
#define GUER resistance
GUER defined.
I baffles me that people have such difficulty understanding that resistance and independent are exactly the same thing, but GUER is just the stringified representation of it (not even "both").
iirc, resistance is an old fragment from OFP
It's only if you also say that west and east are too.
while independent just came in with... ... wait... Arma 3
So every old scripter used Resi (incl. me), instead of the new one ๐
Yes and A3 added blufor and opfor as aliases for west and east.
I'm still using the old commands, because idk, I see no point in the new ones.
Yeah, we need a third alias for the sides.
SideBlue
SideRed
SideGreen
SideYellow
good, bad, neutral.
And for consistency, we name one of them goood with 3 o and the third one sideNeutral just because.
Btw anyone know how long time that default side west bug happens for jips ?
Probably as long as the player / group player is null.
Are you worried about this, because you read it on the wiki?
not because wiki, was some issues with that thing
it was mission with opfor and greenfor and welcome message with part that was showing player side
and was west sometimes
The bigger question is, why east has index of 0 and west has index of 1? (in configs, internally, etc.)
because Arma
Because the Reds were the good guys after all.
>Yes and A3 added blufor and opfor as aliases for west and east.
missionNamespace setVariable ["GUER",resistance,true];
missionNamespace setVariable ["CIV",civilian,true];
^ Still forgot to do these
@still forum last day a read a topic where you said that some servers have set up a default 50 CPS value, is it still going on this kind of thing, or the amount of CPS the server can get is unlimited?
cps*
excuse my ignorance, why is there a 50 cps limit?
Something like this
The arma does not need more than 50 cps
WE should be happy they don't lock clients to 23 FPS
In thory having 100 cps would actually be good.
Maybe it works similar to having 100 tick servers in cs/bf4
It should
Small scale 5v5 TvT would be a lot more responsive
As long as clients and server keeps ~100 fps
There are no cps in Arma.
It's called FPS.
If I google "CPS Arma", I find the Exile forums. Figures.
๐
until last week we had a awesome proportion between the CPS to FPS with a factor from almost 1:1
Wow, I wonder why...
The answer for the worse performance was a bad asset mod. Figures.
Classic
cps is just another metric for measuring arma performance, its been around alot longer than exile
Project terminated.
ASM did his job a long time now and i hope you enjoyed it a bit.
This monitoring project was originally mean't as a temporary solution a...
One condition per frame, or what is this about.
You can read the description of cps from fork of repo (since original got pulled long time ago)
https://github.com/dayz9998jp/ASM
CPS is expressed by condition evalations per second and measured from an reference condition in ASM.fsm.
Ah, so it's about the >scheduler.
It's something The Old cooked up, even worse then.
There is nothing wrong with it.
Its a good measurement of how the unscheduled enviroment is behaving, something diag fps won't always show
Nah, it's not.
Ok then whatever commy ;)
But you really should have heard of CPS / ASM before if you been using arma for so long.
No, I haven't because CPS does not exist in Arma. Someone thought about a flawed alternative way to measure performance and named it CPS, but it doesn't represent anything useful.
blue name removed
I'd miss attaching poops.
Seriously. Get off the phone if you want to chat. I'm falling asleep here.
Posting with phone is rude. It's very inconsiderate to make others wait for your responses.
It is useful
Its not ideal, but the author tried to get BI to implement some API to get engine measurements in the end he gave up.
He also did some work with memory allocators back in the day aswell, until arma implemented random memory addressing i believe
Is been around for over 4 years now in arma community
Lastly arguing it doesnt exist in Arma, is kinda of elitiest attitude
May it be "elitist". As long as it's true, and it is, I'm fine with that.
CPS don't exist.
Some of us don't have to measure performance because their code is so good it makes the game run better
Optimize the Engine by SQF ๐
For example i know Linux armaserver unschuduled enviroment behaves alot different to windows unscheduled enviroment.
Let's see how long you can come up with new names, Dscha.
Be sure to leave air gaps - empty lines - in your sqf code. It will reduce resistance and make your code faster.
Avoid too many indents for low cw values.
Let's see how long you can come up with new names, Dscha.```
Preview: Next 30 days are secured.
<https://i.gyazo.com/df7aa13caf5a6632f7ec66f47d064e47.png>
You animal
I don't want to spoil it, can't wait to check every day.
๐
You should've done this as advents calendar.
Funny part you are giving BE more to parse / log with extra whitespace, so adding more is giving it more work todo ๐
all good
Default value is 1 (enabled). Debriefing cannot be disabled in multiplayer.
Seriously ๐ฆ
getClientState "DEBRIEFING READ" ?
No you will need press continue with #missions
Nah, I need it to work every time.
addMissionEventHandler ["EachFrame", {
private _display = uiNamespace getVariable ["RscDisplayDebriefing", displayNull];
if (!isNull _display) then {
_display closeDisplay 2;
removeMissionEventHandler ["EachFrame", _thisEventHandler];
};
}];
^ this to my exit mission script. lol
#missions needs continue?
It should put you in the mission selection screen instantly
Wait, missions can edit CfgFunctions, right?
n-n-no?
Eh, BIS_fnc_initDisplay would be difficult anyway.
Wait, missions can edit CfgFunctions, right?
Yes and No. They can Add new, but predefined CfgFunctions via Addon won't get overwritten.
Hate that. Eliminates hotfixing BIS functions
yeah, need a mod to edit bis fnc
yeah
don't abuse BI funcs....
I don't, but other stuff might call it. From an addon or module.
Some aren't optional, like effectFired and initDisplay.
copy pasta the bis fnc and fx it
there's a reason that "limitation" was put in place
haha
Example: a friend was using the vehicle respawn module. It calls a bugged function.
Bad friend
bad commy
^ this tbh
Yeah, but not all my friends are l33t scr1pt3rs
scr1pt0rs, please.
1337 == 1999
- Dscha
so 2038
friends
Not writing scripts that replace friends
๐จ ๐บ ๐ท ๐ท ๐ช ๐ณ ๐น ๐พ ๐ช ๐ฆ ๐ท
31 Oct = 25 Dec
Sure nigel, but where does it end? You make a script that replaces friends, a friend-replacer-script. Next thing you are writing better friend-replacer-script-script scripts
I have a script on the script that adds scripts to the script
2xzibit4me
@peak plover On dedicated server, if you login as admin mission is started, when you type #missions will be debriefing screen and you have to press continue... and then you will be in missions selection screen... that how it works sorry
๐ค
class Extended_DisplayLoad_EventHandlers {
class RscDisplayDebriefing {
commy_noDebriefing = "_this spawn {(_this select 0) closedisplay 2;}";
};
};
This kills it.
The binary syntax does, the unary snytax only works on the admin in ui scripts.
I think the idea is that you put the function with serverCommand and the password into a -serverMod addon and remoteExec that or smth like that.
It should work on the server auto 'tho
๐ฆ
Why does the server need to know the pw
Some security voodoo that obviously doesn't work in practice.
If at least one client loads faster than the (local host only?) server, then all connected players become seagulls and HandleDisconnect doesn't fire with the right objects. ๐ค
wait what
The seagull does not appear in the entities list, but in the allMissionObjects list.
And I think the seagull is passed as player object to HandleDisconnect, needs testing.
I have a nice 100% repro abusing some minor dialog / 3den MP glitches / weirdness.
The issue with this is obvious. Annoying seagulls and players not getting deleted when they disconnect.
So what happens if 1 client loads faster than the server_
I haven't had that in a while
handleDisconnect doesn't seem to fire at all, unless there's a typo in here:
addMissionEventHandler ["handleDisconnect", {systemChat str _this}];
Doesn't fire once the mission loaded bugged.
PlayerDisconnected still fires just fine.
But obviously doesn't pass the last player object.
Retesting with mission that loaded properly...
because it's server only ^
Both are, and I am the server, alganthe.
๐ฑ
Arma's just bugging out, and now it's time to find out the primary source, and then to create a work around.
Yep, if I try it in a properly loaded mission (no seagull symptom), HandleDisconnect fires along with PlayerDisconnected.
You test it with Dedi?
Local host.
Yeah, screw that
should still fire
It's borked af
no it isn't
Well, evidently it is.
It is
you... YOU KNOW NOTHING DSCHAN SNOW
Doesn't mean finding out why wouldn't help for proper servers ๐
is the issue reproductible on dedi ?
My bet: Works on DediServer
I don't have a dedi, and not with my repro. Though I've heard of seagull bugs etc. on dedicated servers too, and this may or may not be a hint of what happens.
Because: Client != rdy before server
One reason, why i bought a 2nd Machine and tested in "real enviroment".
Another thing is that I can't get Ended mission eh to fire. At this point I've never seen that one work properly even once. It's probably a lie.
^^
Anyway, it's not a bug with my scripted lobby mission, so I am happy.