#arma3_scripting
1 messages · Page 495 of 1
tbh ive been coding in arma for like 3 weeks but ill try
i didnt even know what EH was until 10 min ago
so i need to figure out how to execute code only when player is in vehicle
?
hahaha lol
also i dont want to use the version from the code that person sent me its not mine. sqf (vehicle player) addEventHandler ["IncomingMissile", { titleText ["SHOT", "PLAIN"]; }]; I could use this format and it would work?
markdown syntax
oh okay lol
okay whatever i dont care i cant do markdown properly
just want to learn how to code this stuff really
lmao
Well thats not really complicated
you got the code
But idk how you could assign it to a vehicle
playSound "warning";
(vehicle player) addEventHandler ["IncomingMissile", {
[parseText format["<img size='0.52' image='exile_assets\texture\mod\icon.paa'/><t color='#e5e7ea' size='0.6' font ='PressStart2P' shadow = '1'> MISSILE INCOMING</t><br/>"],-1,-0.2,1,1] spawn bis_fnc_dynamictext;
}]; ``` how could i remove all the parts from the code i sent?
so that it still uses the parsetext format
like i dont wanna use his code
(vehicle player) addEventHandler ["IncomingMissile", {
titleText ["<t color='#e5e7ea' size='0.6' shadow = '1' font ='PressStart2P'>SHOT</t>", "PLAIN", -1, true, true];
}];
well tbh go into a vehicle, copy/paste the code in the console debug, exec local it
i mean only when player is in vehicle **
but in your mission
how do u actually exxec code w infi
ok thanks
what is infistar?
thats an "anti-cheat"
actually hackers used to pay the creator lmao
well maybe quicksilver know the answer about that EH
who chris? idk whats true and what isnt but anythings possible
honestly infistar is more of an admin tool than anything
you have to know how to spot the hackers and dupers
look up like 20 messages in chat?
incoming missile
yessir
i dont know how i would implement that into the code so it actually functions?
sqf (vehicle player) addEventHandler ["IncomingMissile", { titleText ["<t color='#e5e7ea' size='0.6' shadow = '1' font ='PressStart2P'>SHOT</t>", "PLAIN", -1, true, true]; }]; like how to put this into use
fuck i cant markdown to save my life
ok i guess maybe i should ask then
how do i put EH into action?
how do i call them
Lol i tought about that too but in my head it was like "addind an EH every time a player enter a vehicle is bad"
didnt tought about that delete eh
getIn is for vehicle I guess
player addEventHandler ["GetInMan", {
(_this select 2) addEventHandler ["IncomingMissile", {
titleText ["<t color='#e5e7ea' size='0.6' shadow = '1' font ='PressStart2P'>SHOT</t>", "PLAIN", -1, true, true];
}];
}];
player addEventHandler ["GetOutMan", {
player removeEventHandler ["IncomingMissile", 0];
}];
oh sure
@signal pulsar well you have to create a file that is called when the player connect
ok so this is all really helpful
ok thats my question
ty
so like if im running exilemod
could i attach this to initplayerlocal?
alot of this is going over my head unfortunately
could you give us the exemple quick
instead player addeventhandler?
but hey ty for answering questions i am learnig alot
@signal pulsar well, if we add an EH when the player enter a vehicle, we need to make sure that this EH is deleted when the player get out, other wise you're going to have xxxx active EH.
but to delete the right EH we need the index
thank you
removeAllEventHandlers no need to save variable
i feel like theres soemhting im missing here because you three kinda lost me there /:
player addEventHandler ["GetInMan", {
(_this select 2) addEventHandler ["IncomingMissile", {
titleText ["<t color='#e5e7ea' size='0.6' shadow = '1' font ='PressStart2P'>SHOT</t>", "PLAIN", -1, true, true];
}];
}];
player addEventHandler ["GetOutMan", {
(_this select 2) removeAllEventHandlers "IncomingMissile";
}];
thanks M242 lol
Yeah like this
thats tricky and hope @signal pulsar doesnt have other EH
should do the work
but the script quick posted is nice
private _vehicleEventHandlers = [];
{
_vehicleEventHandlers pushBack [(_x select 0),(_vehicle addEventHandler _x)];
} forEach [
['Local',{_this call (missionNamespace getVariable 'QS_fnc_clientVehicleEventLocal')}],
['Killed',{_this call (missionNamespace getVariable 'QS_fnc_clientVehicleEventKilled')}],
['Hit',{_this call (missionNamespace getVariable 'QS_fnc_clientVehicleEventHit')}],
['HandleDamage',{_this call (missionNamespace getVariable 'QS_fnc_clientVehicleEventHandleDamage')}],
['IncomingMissile',{_this call (missionNamespace getVariable 'QS_fnc_clientVehicleEventIncomingMissile')}],
['Fired',{_this call (missionNamespace getVariable 'QS_fnc_clientVehicleEventFired')}],
['EpeContactStart',{_this call (missionNamespace getVariable 'QS_fnc_clientVehicleEventEpeContactStart')}],
['Engine',{_this call (missionNamespace getVariable 'QS_fnc_clientVehicleEventEngine')}],
['Fuel',{_this call (missionNamespace getVariable 'QS_fnc_clientVehicleEventFuel')}],
['Deleted',{_this call (missionNamespace getVariable 'QS_fnc_clientVehicleEventDeleted')}]
];
i dont think i have any other EH
but okay so where would i want to put these then?
make a file and call it mission side?
Yes
Create a file, name it as you wish, then call in whatever init you want to
Well you could execVM it ?
should i call it in initplayerlocal after client is loaded in?
Sure
sorry u guys are having to ELI5 this
eli5 ?
lol its ok
well to me it seems like ur method would be the best no?
its never the best
i am a simpleton rn true
and btw @signal pulsar this discord is very good to get started, bc people always talk and debate about things, scripting, optimization...
logs are precious
been coding arma for a long time like 5 yrs just never got into understanding what i was reading ya know
i started with a2 overpoch
and this time around im trying to learn
what everything means so i can start writing my own stuff
arma is very satisfying when you got a "ok" lvl
also quick question u said add title text?
you can do what ever you want in the game
I said add a hint before the title text
In case I messed up something with the <t </t> tags
or no
sorry ishould be more clear
where in the updaded EH code u sent me would i wanna add the hint
ok wait
yeah nvm im lost
Just before the titleText part 😄
i didnt even add any of that to the code
i thought id only need the part that i could put in my initplayerlocal
do i also need to include ``` player addEventHandler ["GetInMan", {
(_this select 2) addEventHandler ["IncomingMissile", {
titleText ["<t color='#e5e7ea' size='0.6' shadow = '1' font ='PressStart2P'>SHOT</t>", "PLAIN", -1, true, true];
}];
}];
player addEventHandler ["GetOutMan", {
(_this select 2) removeAllEventHandlers "IncomingMissile";
}]; ```
do i need to include that event handler too?
ok nvm
im so dumb
? xD
i think i understand what ur saying
let me show u and u tell me if im gright
so i learn
alright
titleText ["<t color='#e5e7ea' size='0.6' shadow = '1' font ='PressStart2P'>SHOT</t>", "PLAIN", -1, true, true]; adding this to ['IncomingMissile',{_this call (missionNamespace getVariable 'QS_fnc_clientVehicleEventIncomingMissile')}],
?
what
ok yeah im just dumb
1 - Create a new file
2 - Paste the following in it :
player addEventHandler ["GetInMan", {
(_this select 2) addEventHandler ["IncomingMissile", {
hint "lol";
titleText ["<t color='#e5e7ea' size='0.6' shadow = '1' font ='PressStart2P'>SHOT</t>", "PLAIN", -1, true, true];
}];
}];
player addEventHandler ["GetOutMan", {
(_this select 2) removeAllEventHandlers "IncomingMissile";
}];
3 - Call the file you just created in initPlayerLocal.sqf
@tough abyss what is the reason for missionNamespace getVariable in your example?
Event handlers are executed in mission namespace by default, ...['Local',{_this call QS_fnc_clientVehicleEventLocal}],...this would be enough and it would be more readable IMO.
thank you
it didnt work
obviously i did something wrong
or im not understanding
i dont understand where to add the hint or titletext
@signal pulsar I just gave you the code you have to copy
i put it in my initplayerlcal
oh u posted a new thing while i was tabbed into game testing it
i see
let me try
Helmet-cam live feed. Players at base can watch a live feed of operations.
thats cool
sorry but I dont see my code in that file
you said to call it in its own file @compact maple
all the way at the bottom
call compile "overrides\incomingmissile"
some thing like that
[] call compile preprocessFileLineNumbers "Overrides\IncomingMissile.sqf";
replace it by
[] execVM "Overrides\IncomingMissile.sqf";
btw how are you testing it ?
llol on my test serve
i ocpied my whole liver server
to another folder rename test
new DB
exactly like how the real server setup
i will try this ``` // Compile all the things!!
{
_code = "";
_function = _x select 0;
_file = _x select 1;
_code = compileFinal (preprocessFileLineNumbers _file);
missionNamespace setVariable [_function, _code];
}
forEach
[
["IncomingMissile","Overrides\IncomingMissile.sqf"],
]; ```
@compact maple u thunk that will work?
thats how its being compiled by the dude whom gave me his file
well idk
Sure that'll work. It's basically poor mans CfgFunctions
@compact maple dont know if ur still around but still no dice
no matter which way i try to call the file
@signal pulsar try it in debug console
ive never used armas default debug editor guess its time for me to learn that too
What’s to learn, paste code and press execute button
Why? No need to check CfgFunctions if you know there's nothing in there
Why would it be empty ?
He put his function into initPlayerLocal as he said. And the guy who made that framework has his own method to compile functions, as he said. So why would the guy who made the framework use his own method AND CfgFunctions.
And why would he put his function into initPlayerLocal AND CfgFunctions while he probably doesn't even know that it exists.
He wrote that it does that. Right in this channel
expecting people to read
Good one
ive just never used the debug console is what im saying
do u access it in the map editor?
You've never pressed 'escape' before?
lol
yeah but u cant on the live server
You can if you're in CfgAdmins.
ok kuplion
waves
You've never pressed escape in a single-player game before?
um no thats not what im saying
Seeing != using
can u access on a live server running infi
you are a word
ok so um once i execute this in the debug what do i want to be look for in whats returned
test whether your eventhandler works now.. I guess
Probably wouldn’t hurt to learn some basics before attempting to modify someone else’s mod
okay but how is it someone elses? its being remade from scratch...
im not using their code at all
the concept yes maybe
You are trying to hook it up to their framework, no?
no sir
quick was showing me his framework
but i am not attempting to use anyone elses code the person who made this script was pointing me in the right direction
bc what fun would it have been if he just gave me the code
he told me this: you have to add an incoming missile event handler to a player vehicle" and from their i just googled alot and been asking questions
It cannot be simpler
Get in vehicle, open debug console and copy paste code someone gave you here already
Do you know how to test it?
well yeah i need someone to shoot a rocket at me
once i exec the code in debug
what i was asking earlier tho is can i do this with infistar debug bc i need a second person to shoot the rocket
you can do it with whatever can execute code for you
So what is the problem? Once you get it working from debug console then you can try to make it permanent
@tough abyss went into to it in editor placed a bunch of AA ai to shoot me down which they did but nothing came up when i executed the code before hand
There you go so you are doing something very wrong
is there a way i can find out why?
What code you executed in console
@tough abyss i pasted this ```sqf
player addEventHandler ["GetInMan", {
(_this select 2) addEventHandler ["IncomingMissile", {
hint "lol";
titleText ["<t color='#e5e7ea' size='0.6' shadow = '1' font ='PressStart2P'>SHOT</t>", "PLAIN", -1, true, true];
}];
}];
player addEventHandler ["GetOutMan", {
(_this select 2) removeAllEventHandlers "IncomingMissile";
}];
pasting this version in the debug instead makes the message popup but still need to go about adding it to Getin
private ["_vehicleObject"];
_vehicleObject = _this select 0;
playSound "warning";
[parseText format["<img size='0.52' image='exile_assets\texture\mod\icon.paa'/><t color='#e5e7ea' size='0.6' font ='PressStart2P' shadow = '1'> MISSILE INCOMING</t><br/>"],-1,-0.2,1,1] spawn bis_fnc_dynamictext; ```
You want to assign the eventhandler for incoming missile to the vehicle
yeah im trying to figure out how to do that right now in a way that works
because they were trying to show me above @arctic veldt but um i couldnt get it working
getin getout
theres a serverside file: ExileServer_object_vehicle_event_onGetIn not sure if it would be affecting what im doing
The code you posted works for me, so as I said you are doing something wrong
Are you adding the code while you are in a vehicle?
when u say the code works for you which of the two the top or bottom? @tough abyss
im trying to figure out how to make add only when u get in
Top
i pasted the top code into my debug
and got shot by a rocket
and it did nothing.....
clearly im just autistic
Were you in vehicle when you executed code?
no
No idea, then
i shouldnt need to right isnt that what the get in get out is for?
like thats the whole point
Yeah it should add itself when you get in
so i shouldnt go into editor with servers modlost loaaded on client?
Try without any mods
The only way to debug is to get clean mission
Or you could be guessing forever why it doesn’t work
were making progress! @tough abyss so um without titletext and all that it worked
it said lol right before rocket hits
It should say it when rocket is fired, get some distance
mayne im just too close to AI less than 500m
its just idk how far the AI will attempt to lockon or shoot
ok yeah so i got it working but if im hella close to the AI it delays too long
you cannot stack getIn so what you are trying will not work
wdym by stacking it
also your right @torn juniper it didnt work on the live server only in the editor
i think it has to do with not executing the code right
because i can paste it into the debug like i said and it works fine but implementing into the live server code
is where i have an issue.
@signal pulsar is that code from my mission file? 😂
You're missing server sided stuff which I run in a server pbo
i think i figured it out
and also plz read up in chat before saying im using ur code omy server
cuz im not and happy to prove this to you
i think snow messaged you the other day if your MGT dave right? @random estuary
Yes

🍿
Press2start is an Exile exclusive font that I use in my mission file for incoming missile event handling, it's all good, you can learn how to do it now
i was looking for you today i joined ur discord was gonna ask u bout it but coudnt find ur name
i have a question about spawning enemy ai and mortar. do i spawn the ai and the mortar object separate and then tell the ai to get in or something on the mortar?
Just add the event handler where vehicles are spawned and make sure any info you pass client > server and vice versa is whitelisted for remoteexec
It’s all well and good attempting to reach out to the people you stole from 😂
@exotic tinsel First you createVehicle and then you createVehicleCrew
https://community.bistudio.com/wiki/createVehicleCrew
how did i steal his work? im not using any of his code man i just told you i was looking at it to learn
Hello
@tough abyss thanks mate
He’s just shown you how.
I have a problem to disturb.
Disturb at will
You tried to steal it, as is evidenced by the code being the same as that by @random estuary . You were just too dumb to admit it.
A language barrier? Ok, what are you confused about?
Is the connection of objects to the origin of the sound.
{
sounds[] = {};
class africancity
{
name = "africancity";
sounds[]={sfxsound};
sfxsound[]={"sound\africancity.ogg",15,1,18,1,1,1,0};
empty[]= {"",0,0,0,0,0,0,0};
};```
I do not know how to go.
This is an example where I'm going to do it.
https://www.youtube.com/watch?v=XmfgyX7DFU8
But I do not understand the correct work.
createSoundSource[
"africancity",
getPos player,
[],
0
];
Is this what you want me to put in the stuff?
This will create the source at player, if you want it elsewhere then reference the object or it's position.
Oh i have it but i do not understand
hey @rough cradle id send u this screenshot about relavent things but i think u blocked me... what a shame.
Or maybe it's because of the different languages I try to understand.
haha
What I understand now is the origin of the sound.
Yes, it's playing the source
Init wherever you'd like, the init.sqf works just fine.
Okay
Why would I want a screenshot from you? 😂
{
items=1;
class Item0
{
position[]={3630.2627,17.24,2505.4241};
name="West";
text="West";
markerType="RECTANGLE";
type="Empty";
colorName="ColorWEST";
a=500;
b=500;
};
};
class Sensors
{
items=584;
class Item0
{
position[]={5920.9106,14.246628,3313.363};
a=30;
b=30;
angle=-90.1884;
rectangular=1;
activationBy="WEST";
repeating=1;
interruptable=1;
age="UNKNOWN";
expCond="";
class Effects
{
soundDet="sfxsound2";
};
};```
I did it with a mission, but I'm not sure it works.
@rough cradle after thinking about it further im going to try to add this to a file careful createvehicle to the EH is put on from the get go
so it does it on vehicle creation?
😂
im already overwriting it im my mission he said this: https://gyazo.com/e02df46e1f50bddda0501f522843d38d
so exile network messages
im trying to spawn in an enemy mortar and make it fire at nearby bluefor. this works
_mymortar = createVehicle ["O_Mortar_01_F", getMarkerPos "marker_0", [], 0, "NONE"];
createVehicleCrew _mymortar;
but this doesnt make then shoot
_mymortar setCombatMode "RED";
_mymortar setBehaviour "COMBAT";
anyone know how to make the enemy mortar fire on bluefor?
hi i'm trying to run a loop when a player runs into trigger that will spawn fire on him until he kills a specific unit. I've tried and failed with various ideas here is my latest attempt am I any where near? while {true} do { loop = 0 spawn { while {true} do { this = "test_EmptyObjectForFireBig" createVehicle (getPos P1); sleep 3; }; }; if (!alive C1) then {breakOut "loop"}; sleep 1; };
rgr
FYI, rule of thumb is to ask before using someone else's stuff. (this is not directed at anyone in particular, but it is a warning)
I'd like to get the base position which has the shortest distance from pickup place to some bases:"base_A", "base_B", "base_C".
Is there more concise expression?
//base_A, base_B, base_C, and _pickup
_aa = _pickup distance2D base_A;
_bb = _pickup distance2D base_B;
_cc = _pickup distance2D base_C;
if ((_aa < _bb) and (_aa < _cc)) then {
_spwanmark = getMarkerPos "base_A";
} else if ((_bb <= _aa) and (_bb < _cc)) then {
_spwanmark = getMarkerPos "base_B";
} else {
_spwanmark = getMarkerPos "base_C";
};
thx, @ruby breach
so, if I'd like to check if all players are in one or two vehicles, would I put something like this in the condition of a trigger? (players are not grouped) ```
{alive _x && vehicle _x in (plane_1 && plane_2)} count playableUnits == {alive _x} count playableUnits
Or am I missing what Im trying to do completely here?
😃
Quick question. If you call compileFinal with the same string value, is the resulting code cached and returned on the 2nd call onward without recompilation, or do you need to implement a cache yourself to avoid recompiling it on successive calls?
anything like "find" or "in" for subarrays?
yes jcd, that would be https://community.bistudio.com/wiki/BIS_fnc_findNestedElement
@dim token do you have an example of what you mean?
thanks Quiksilver ❤
@rough cradle if you take code that someone publicly posted to be taken and used by anyone. That's not stealing.
@dim token no. You need to cache yourself. Or just use CfgFunctions if that's what you need
@waxen tide or findIf I'm assuming BIS_fnc_findNestedElement is not using findIf and is using something very old with according performance
(allPlayers - crew plane1 - crew plane2) isEqualTo [] @neat ridge
@still forum That’s not what happened. He joined someone’s server, downloaded their mission file, then took code from it, not realising the server owner had protected his code by utilising a server side component too.
No need to use every saveProfileNamespace each time profileNamespace setVariable is used?
only last saveProfileNamespace is enough?
e.g.
if (isnil "_locselpos") exitWith {
profileNamespace setVariable ["SAVE_OBJARRAY", nil];
saveProfileNamespace;
profileNamespace setVariable ["SAVE_MILARRAY", nil];
saveProfileNamespace;
profileNamespace setVariable ["SAVE_OBJMARK", nil];
saveProfileNamespace;
finish = true; publicvariable "finish"; diag_log format ["TASK LOCATIONS END PAST LOOP %1", ciy_objarray];};
once is more than enough yes
Also use tags for your variables. To make their names unique
Some vanilla script that's running atleast on client, continuously executes saveProfileNamespace. That script doesn't seem to run on a server though
saveProfileNamespace flushes all variables to file. So you need to do it alteast once
Some vanilla script that's running atleast on client, continuously executes saveProfileNamespace. efficient way to destroy ones SSD
thanks, guys. 😅
@queen cargo If to compare to what Windows does on the background - this is just a tiny bit of harm caused to your SSD.
But yeah, still not an excuse to using that much.
there is never any reason at all to save more then needed @unborn ether
this might even cause game hangs depending on how the saving is implemented and HD speed
and @still forum , what it means? use tags for your variables. To make their names unique
TAG_YOURVAR @quasi rover
barnes_myVariableName instead of just myVariableName
I did it SAVE_OBJARRY no?
SAVE_ is not really a good tag though. Many people save things
Aha.. thanks again.
Is there anyway to make a passenger seat able to use a gun
For example the quad bike passenger
@hexed obsidian 2xCtrl to use gun in some passenger seat.
I am talking about when it is otherwise not enabled see the example
not with scripting
@still forum Yeah thanks i think i can use findIf !
0.0001 more FPS on your FX
I wasn't being sarcastic.
0.0001 more FPS on Intel maybe.
2 FPS on my FX
It's actually 0 FPS since i moved that code into the setup thingy that pre-generates data for the mission and buffers it in profilenamespace - https://i.imgur.com/kcyAQnR.jpg
first i was annoyed waiting 15-45 seconds to calculate roadblock spots for each city, and then it's much simpler to have a list of locations with features attached (x roadblock spots, x houses of class "whatever" for which i have a composition to fortify, etc) and then pick one that suits the mission than to randomly pick and then check afterwards (which, if done at mission runtime, takes 15-45 seconds)
for whatever reason that reminds me of my insurgency mission 🤔
but scanning will always be required for that to work 🙈
i am in need of a list containing all houses in any given square
as object references
oh yeah sure.
to get building positions and alive status
that's actually reasonably quick
what hurts me is the A* search thru 175.000 road objects to find paths that need to be roadblocked.
well ... it is not really quick
you have to scan each available 1x1 km² square
https://github.com/X39/XInsurgency/blob/OOS_Insurgency/InsurgencyModule/src/Mission/Main.oos#L27-L72 actual mission was written as proof-of-concept in OOS back then
the A* stuff takes 2-3 times as long as finding the houses i need (which is a list of classnames of houses for which i have a composition to spawn into, and any house with buildingPos defined to randomly put some soldiers in those)
but it should be kinda readable to anybody (actual C notation, object based, SQF ... are raw SQF commands in COMMAND(LEFT,RIGHT) syntax)
" buffers it in profilenamespace" why? Why fill profilenamespace with garbage.
Why not cache in uiNamespace?
i could also just manually safe an *sqf file which contains nothing but 1 huge array like Amaury did if that makes you happier 😛
what's the difference between ui and profile namespace?
i guess the caching happens serverside? what about some callExtension for it?
it's entirely serversided, and it's not garbage but rather core data for literally everything ever spawned.
he ment that you bloat the profileNamespace file with that for no reason but to cache
and that there are better solutions
like?
like using an extension and saving actual cache files somewhere on the server
meh
would only consider that if there is some properly documented stuff that works out of the box
there are a lot of very scary points on that todo list of mine
i only know of the database stuff dayz people used in arma 2 days
and i would consider that overcomplicating things
would tbh rather do a copytoclipboard and paste it in some file, it's not like this needs to be done all the time, ideally it needs to be done once per map.
uiNamespace get's cleared at game restart. profileNamespace is saved and shouldn't really be bloated with crap.
It's probably enough to generate the cache once at game start and save it to uiNamespace
generating the cache takes like, idk, an hour?
wuht
if it really is that long you should consider making it mandatory to be inside of the mission itself Oo
in unscheduled?
and improving the god damn method
😄
i've spend several 100 hours on that already
this is like the 50th version of that script
and it's still not as clever as i would like
It's not worth it to improve that code performance wise, especially since i'll run it ONCE per map and safe the result in a lookup. If anything, i'll probably make it slower by adding more checks to come up with cleverer positioning.
--> making it mandatory to be inside of the mission itself Oo
stop even consider any namespace
and put it into the map as script file
@waxen tide Unscheduled. Scan in preInit (if scanning map). No profileNamespace.
End of the message.
it's a 1600km² map, it's still gonna take ages.
CACHE = call compile loadFile "mymission/mapinfo.sqf"
so that is the reason
you run path calculations inside of SQF
you are insane
that is the actual problem
yeah i talked about that here a few times
aka: problem solved
no it's not the problem, it's the solution.
i've tried 50 different approaches without path calculations, and it all failed. now with paths everything is splendid.
solution is some external tool you would pase that simple scan data inside
instead of processing it in SQF
because processing the ammount of data in SQF takes ages
it's not an issue, the map author so far updates every ~6 months 😛
not for you personally maybe
but there might be a shitton of ppl out there who do not really like to imagine having arma open for hours just to get something working on any map they like
TL;DR: Your user experience is horrible
my user experience is people playing on our server.
🤦 and then those theoretical people using that for their mission which are not on your server
also, callextension could save you here again
by speeding up the whole process by a magnitude
i have like 20% of my immediate todo list done
i'm not going to learn how to write a DLL to speed something up that runs automatically withhin an hour 2x per year on my pc while i watch a movie.
totally wrong priorities.
besides on like stratis it's like <5 minutes
this is a 40x40km map
generating the cache takes like, idk, an hour?
for the current map i intend to use.
besides on like stratis it's like <5 minutes
just executing your cache generation code in unscheduled should make it finish quiker atleast.
switching off the 50k debug markers it spawns and despawns should also help 😛
way bigger problems right now
i'm apparently too dumb to calculate a circle of coordinates
well, only half of the time.
Don't get me wrong, i'm extremely grateful this discord exists so i can ask my dumb questions and get incredibly good answers. Without this discord as ressource i wouldn't be scripting what i'm scripting. But currently performance optimising this basic stuff that works and is no immediate issue is just not high on the priority list. especially since 9001 other things are on that list as well. Maybe in a year or so.
#define TYPE_HASH "#CBA_HASH#"
what on earth is this supposed to do?
my guess is that this is equal to 'CBA_HASH' or #CBA_HASH
and "enables" parsing of the inner string even though it is "secured" via "
but no word of that in https://community.bistudio.com/wiki/PreProcessor_Commands#.23
okay ..
preproc doesn't run inside "" quoted strings
besides: define foo(bar) #bar #abc
is the # in ArmA pp also only working on arguments?
That's a very good question.. It would make sense I guess. But on the other side I expect "no".
Can't test right now
neither me ... steam again invalidated my arma installation
means i am downloading everything right now again ❤ -.-
HDD failing?
Never had it
it tends to remove games from my installed list
Does anyone know why
_unit = _group createUnit [_asset, _position, [], 0, "NONE"];
results in a
16:24:39 Error position: <createUnit [_asset, _position, [], 0, "N>
16:24:39 Error Fremdfehler: Unknown enum value: "NONE"
even though that "NONE" is documented here:
https://community.bistudio.com/wiki/createUnit
@tough abyss could you check that quickly? the preprocessor question?
Test Scenario is as simple as putting this into a file:
#define foo(bar) #foo #bar
foo(bar);```
and then just loading its content via `preprocessFile`
Hold on
holds @tough abyss tightly
moves closer to @still forum and @tough abyss
expected output is either "foo" "bar" or #foo "bar"
It fails
just wtf arma 🤦
Maybe because foo is the name of a macro. But you are not providing the correct number of arguments. But it should just ignore the thingy if it doesn't match argument count
ohh.
crap
indeed
though ... no
#define foo(bar) #foobar #bar
foo(bar);```
should not make any difference
because then the whole thing would just be empty
Is #bar on the new line?
mhh?
Im on mobile
"foo" "bar";
well ... crap
as expected 🤦
now the next question is: would it parse macros inside the stringify?
#define foo f o o
#define bar #foo
bar```
if this now yields "f o o" i will be in trouble and mildly surprised
"f o o"
Gonna break it to fix it?
my preprocessor currently also would yield the above though
but that is because i forgot to skip " stuff
Just don’t forget that // is treated as comment inside "" in define
Only in Arma
He only time it is not a comment when it is inside "" and not in define
'//123' will be treated as comment
Every time
And it doesn’t perform string concatenation "123" "456" will not result in "123456"
just fuck this shit ... ""BA_HASH""
finally ...
what exactly is https://community.bistudio.com/wiki/scriptName actually doing?
"assign a name" is way to vague
so ... pretty much a nonsense command? or do i miss something here
if all it does is giving a spawned script handle a name it is a nonsense command to me
does it only applies to unscheduled?
and what happens in non-scheduled?
so the only visible effect then is in the profiling
Could be yeah. Can't think of anything else
Think it is used for error reporting in bis fnc error
also in general script errors.
file: filepath [scriptName]
that counts as "stuff SQF-VM will not do"
anyways ... i think i finally nailed the preproc
Dude, you can’t pick and choose
is there a way to get all memory point names from a vehicle via sqf?
https://community.bistudio.com/wiki/selectionNames is the only way to get selections. But not in Memory LOD.
There is only https://community.bistudio.com/wiki/selectionPosition
Btw Crossposting is a shitty thing to do
Why would ace people know more than the commands list on biki?
i know the cmd list too
its about hacks, or additional params like with selectionPosition
Well you can just make a huge list of common mempoint names. And use selectionPosition to check them
if ppl were satisfied with what BI provides, modding wouldnt haven gotten anywhere
atm my idea is to make an o2script to copy the desired points to res lod
but something native in sqf would be best for compatibility reasons
You could also just set them in a custom config entry
would need to get every modder to do it though to turn it into a standard
std::memory_points
custom config entry is the current approach. its OK but for compatibility reasons not that great either (for our WW2 setting the scope is limited though)
quick question, do variables reset/get removed if the unit aka player respawns?
@mint kraken Shouldn't. Certain attributes like fatigue being enabled gets reset after respawn. But things like event handlers or variables shouldn't reset as long as it wasn't set on the player object itself
Ok, thanks!
is there a way to get the value that is currently inside of a RscEdit box? I.e have a number input, and be able to forward that to a fnc
@wide hamlet https://community.bistudio.com/wiki/ctrlText
Yup, np.
so there is a command for getting the 2d distance between 2 points
is there a pre-existing function to do the same for only a single dimension?
specifically relative to another object's position and rotation
You could try using : https://community.bistudio.com/wiki/vectorDir
and work with the numbers returned from there directly. 
A single dimension just means subtraction, right?
basically yeah
I don't think it translates directly
but for local coords it is a bit more complicated
Yeah abs and - @runic surge abs(x2 -x1) distance in single dimension
x: 100, y: 200 vs x: 100, y: 100
the y distance would only be 100
distance2D will return 100
I guess my next question is something stupid cause im having a brain fart here. How can i check if x,y,z characters are inside of a string
distance 2d only ignores height
@wide hamlet
getPos player in [[0,0]];
thats an array though
What are you saying then?
[100,200] distance2D [100,100] what does this return? @runic surge
you ever have that thing where you know what you mean in your head but cant put it into words. thats where i am at. One sec let me see if i can explain this better
No worries.
basically i have a string right? it could contain numbers, letters, symbols etc. I want to only allow numbers so i am looking for how i could check that string for forbidden characters and return true/false or whatever else is needed. For example "100" would be ok but "100a" would return false
i thought there was a built in function for it. i could be wrong and might just have to go through the string one letter at a time with a for loop
parseNumber
parse number returns the first number i.e. "a100" would return 0
and "1a0" would return 1
You can do "abc" find "a", but you'll probably be better off stripping out [0-9] and seeing what's left.
@tough abyss [100,200] distance2D [100,100] what does this return?
I mean if both the x and y values were completely different, I only want the y distance as if the two points were perfectly aligned on the x axis
bad example I guess
thought find required an array in front not a string
Look at the page. there's an example for string.
I could just use worldToModel and modelToWorld actually
Then you use the formula I gave you for whatever element of the position array you choose, x or y or z @runic surge
You can also try ["100abc", "0123456789"] call BIS_fnc_splitString
right. Ok ty
What do worldToModel and modelToWorld have to do with 1D distance 🤔
Right? You just select the coordinate you want, subtract, and abs.
This is a slightly tweaked version of something I wrote years ago that may help @wide hamlet. There's probably a better way to write this, I just gave it a 5 minute pass and updated the really dumb stuff. ```sqf
private _input = param [0,"",[""]];
private _output = _input;
private _arr = _input splitString "";
private _replace = false;
private _nums = "0123456789" splitString "";
{ if !(_x in _nums) exitWith {_replace = true}; } forEach _arr;
if (_replace) then {
_output = [];
{ if !(_x in _nums) then {_x = ""}; _output pushBack _x; } forEach _arr;
_output joinString "";
};
_output
apply should make this alot easier I think
or select I guess
((_input splitString "") select {_x in ["0","1","2","3","4","5","6","7","8","9"]}) joinString ""; that maybe?
Looks about right.
i ended up doing a for loop that goes through each of the characters in the string and checks that against an allowed characters string. Works like a dream. Im struggling with ctrlChecked now. It says it recieved a number when it expected a control. But the control of the checkbox is 2800 so im kinda confused there
ooh it wasnt looking for the idc.
well yea lol
right. the control is the type right? i.e. CT_CHECKBOXES
so ..wat
displayCtrl
https://community.bistudio.com/wiki/ctrlChecked
Clicking the "control" link on there leads to places
Do you want CT_CHECKBOXES specifically? Because this one is more simple https://community.bistudio.com/wiki/cbSetChecked
well i need it to return either true/false to my function and currently it is always returning false no matter if it is checked or not
but changeing the fuction from ctrlcheck to cbchecked worked out
Why not add an onCheckedChanged eventHandler to it?
onCheckedChanged= "TRUEORFALSE = ( (_this #1) isEqualTo 1 );";
is there a simple way to add a line break to an array between elements?
using endl adds an empty string
Question _timer = diag_tickTime;
waitUntil {
sleep 1;
peepsWithVar = count (allPlayers select {_x getVariable ["resetDone", false]});
playersInGame = count (allPlayers select {_x getVariable ["nowInGame", false]});
peepsWithVar == playersInGame || diag_tickTime >= _timer + 30;
};
how do you display the string to see that endl adds a empty string and not actually a line break?
Does that not work because I have the count stored in those variables?
I don't see why that code won't work
@still forum I just copy to clipboard
only problem I see is that you should use local variables. Or global variables with tags
Also.
Why do you count and select. Instead of just count?
allPlayers count {_x getVariable ["resetDone", false]}
I can do locals, but for some reason it skips right over that waitUntil loop, not sure if its throwing an error or its passing some how.
check RPT then
if it's skipping the waitUntil. Might be because you are running in unscheduled where you cannot suspend
and from where is that called. And so on. Where does it start
that's unscheduled then. You cannot...
["scripts\roundReset.sqf", "BIS_fnc_execVM", true, false, true] call BIS_fnc_MP;
What now. BIS_fnc_MP or....
thats one of the commands
What are you doing that ^^
for one. BIS_fnc_MP is deprecated. You should be using remoteExec.
Second why do you use the execVM BIS function instead of the execVM command
execVM is scheduled. So sleeping is not a problem
The server has all clients run that sqf
Sorry for the confusion. The server runs 1 sqf has the clients announce a variable when its done, (waitUntil) then runs a sqf serverside only then that runs an sqf for all clients as well. rinse and repeat
2 run for clients and 2 runs for servers.
so the waitUntil runs serverside? how is that serverside script called. From a eventhandler? or init.sqf or another init script?
initServer is scheduled.. so that also shouldn't be a problem
did you try adding logging before/inside/after the waitUntil to check what exactly is going on there?
I have a suspicion its because I am storing the counts in those variables instead of just comaring
I can change that, its no problem.
well TBH not exactly sure how to do that. I did check the rpt for script errors and found nothing
I have like no skills in debugging serverside stuff
private _timer = diag_tickTime;
diag_log ["entering waitUntil", _timer];
waitUntil {
diag_log ["waitUntil1", diag_tickTime];
sleep 1;
diag_log ["waitUntil2", diag_tickTime];
private _peepsWithVar = allPlayers count {_x getVariable ["resetDone", false]};
private _playersInGame = allPlayers count {_x getVariable ["nowInGame", false]};
diag_log ["waitUntil3", diag_tickTime, _peepsWithVar, _playersInGame];
_peepsWithVar == _playersInGame || diag_tickTime >= _timer + 30;
};
diag_log ["waitUntil exit", diag_tickTime];
@runic surge parseText and <br/>
oh i see just add the diag logs to figure out where we are in the code?
yeah. And what code is running when with what variables
nice wonderful trick thank you
If it exits somewhere inbetween. You'll see it.
If some variable are not what you expect. You'll see it.
If everything works fine and the problem is elsewhere. You'll see it.
If you see anything. You'll see it.
If you see it. You'll see it.
You'll see it. You'll see it.
Cookie. Eat the cookie.
Eat it god damnit!
thank you very much for that. I use this already but not to this extent
lol OK nice
Thanks man
@high marsh most I can get that to do is add a second comma after every element in the array
You copy array to clipboard?
_Composition = parseText (_Composition joinString "<br/>Next Line");
Or doing it that way just replaces the commas with the actual text "Next Line"
yes
You can’t
how do we put a code box up?
Only strings can be copied to clipboard
like how dedmen posted that code in a box
```sqf
<code>
```
copyToClipboard str _Composition;
that gives me the array in the proper form
no quotes
ty
How do you expect to see line breaks there?
are you pasting the result in notepad. Or something intelligent like notepad++?
Line breaks will be part of the array not part of string
notepad doesn't show \n linebreaks
I am using np++
You need to split the resulting string with line breaks not add linebreaks to array and then str it
Str "" is """"
It will not parse linebreak
copyToClipboard (((str _array) splitString ",") joinString endl) are you trying to do something like this?
I don't understand why it can't be done to something other than a string
that is almost it except I have subarrays within the main array
well this code doesn't care about subarrays
also that gets rid of the commas entirely
it does everything
so you want to replace , with ,\r\n ?
copyToClipboard (((str _array) splitString ",") joinString ","+endl)
Join it with (",”+endl)
[[1,2],[3,4]]
becomes
[
[1,2],
[3,4]
]
Dedmen your my new gf
I'm a twink tho
w/e
Not a fem :U
pretty much the same thing tbh
split the main array. But not the subarrays? oof
What same thing, still no comas?
I found the issue because of you. It was the global variable problem. I had to pieces of code... '''sqf< test >'''
depends on how many input objects there are
''' test '''
Because if it would only be one level. You could just throw shit at it till it works like this:
copyToClipboard (((str _array) splitString "],[") joinString "],"+endl+"[")
@carmine abyss wrong quotes. Just copy mine
No splitString doesn’t work like that
<test>
Bis fnc splitString does I think
<peepsWithVar = count (allPlayers select {_x getVariable ["deciderDone", false]});>
``` and
peepsWithVar = count (allPlayers select {_x getVariable ["resetDone", false]});
because they were global they kept the old value
I already told you to replace select with count Your code does too much stuff for no real reason besides you not knowing that count can be used with code
no that's not how that works
the loops probably were both running and overwrote eachother
thats why it was going right through the waitUntil. the values were already equal.
but they don't "keep" values. That's not how variables work. no.
if you set a variable. It get's set.
It doesn't keep a previous value whenever it feels like it. You set it, the value changes.
so say I assign var = 1 and re run that sqf does var already equal 1?
if var is a global variable yes.
yep thats what I am saying. on the waitUntil isnt the condition run first?
no
ah
code is ran from top to bottom
even in for loops
it can't know which of your lines where each line returns a value is supposed to be a condition
scripting isn't magical
yes. even in loops. everywhere
it jumps back to start at the end of the loop. But code always runs from top to bottom
but waitUntil has to have the condition at the bottom no?
maybe i am thinking of c++
that also doesn't do that
well then i have no clue what I am talking about 😃
If it would just execute the condition first. Then all variables that are supposed to be defined before the condition will be undefined. That just doesn't work
Just remember to not use global variables if you don't actually have a need for global variables
copy that
and always add private before you "create" a new local variable
private for anti cheat purposes?
Otherwise you might overwrite already existing variables with the same name that you don't intent to overwrite
i gotcha
_func = { _var = 3; };
_var = 5;
_parameters call _func;
//_var is now 3. wtf. Why does someone else change my local variables. What the hell is going on
🌻 🌻 🌻 thats for you @still forum
I understand
Dedmen you a professional programmer?
I guess so.. yeah
what helped you learn sqf?
I knew other languages before.
Started with "AutoIt". And I already knew C++ before I got really started with SQF.
But SQF is really easy to understand once you understood the lowest-level basics
I started with SQF. It was rough. Then learned c++ and went back to SQF and it helped a lot.
I'm not a good comparison tho. I learn fast
self taught ?
ye
cheers
btw I have peepsWithVar and playerCount update during that waitUntil loop incase someone leaves the game it wont throw the numbers off
_playersInGame***
You could also get rid of the variables. And just move the code directly into the condition. But that hurts readability
macro ?
polo
To hurt readability even more?
waitUntil {
sleep 1;
count (allPlayers select {_x getVariable ["resetDone", false]}) isEqualTo
count (allPlayers select {_x getVariable ["nowInGame", false]}) ||
diag_tickTime >= _timer + 30;
};
``` like that?
😮 Didn't expect the isEqualTo optimization. But yeah
you still need to replace the select tho 😄
I'm pro man
https://community.bistudio.com/wiki/count alt syntax 1
checking...
oops. The code I sent you doesn't work. Mixed up condition and array arguments
that explains why I was confused
I'll be relocating to my exhaustion recovery station. brb
keep the flowers
So all the "pregenerating data for an hour in sqf on a 40x40 map" i got laughed at for yesterday? I have a question. So far my format for saving it looks like this:
[
location,
[roadblock_pos_1,roadblock_pos_2,roadblock_pos_3], // variable length
[
[[fortify_house_classname,[[building_pos,cover_eval],[building_pos,cover_eval],[building_pos,cover_eval]]]], // variable length
[[fortify_house_classname,[[building_pos,cover_eval],[building_pos,cover_eval],[building_pos,cover_eval]]]], // variable length
[[fortify_house_classname,[[building_pos,cover_eval],[building_pos,cover_eval],[building_pos,cover_eval]]]] // variable length
] // variable length
];
This seems suboptimal to me. Is there a better way to handle the data?
hint parseText format["Blah array : %1 <br/> Blah array : %2,_arr1,_arr2];
I think my question was shit. New attempt: Is there a better way than nested arrays to store such data ?
the plan is to have a set of requirements on each mission, like the need for 3 fortify_house_classnames to spawn 3 mission objectives in 3 houses. so i would do like
if (count (_array select 2) > 2)
to see how many i got for each location, and then pick random from whatever passed the check.
params ?
and maybe a second check because there is 5 building_pos required for 5 objects to be spawned, so i would need to count the subarrays too etc. Oh i hadn't thought of params! might be brilliant. but then we're still talking arrays, not some other newfangled magic.
really likes arrays
you try to find a array with atleast 3 entries?
Out of multiple arrays? use findIf to find it.
You know about selectRandom to select a random thing I guess? you can preFilter using select and filter out all arrays that are too short. And then selectRandom
no i am wondering if multiple nested arrays are the ideal form of storage or if there is an alternative i'm not aware of.
Also for the array storage. You could split it into multiple arrays of course. That won't really make it much better
and then use the index?
If you need to look up things by classname. You could transfer it to a CBA Namespace. Which will have Hashmap like O(1) lookup times. Instead of iterating arrays everytime
Yeah. I guess.
Dedmen have you made any mods or missions?
You can also after you load the cached data. Split stuff like
BuildingData = _bigArray select 0;
fortifyData = _bigArray select 1;
So that you can refer to these. Instead of always having to select the subarray first
the basic idea is to have a loopup table of pre-calculated data for each location, so i can pick locations by criteria a certain mission has.
is there a way to simulate a player for MP type testing'
@carmine abyss I'm currently maintainer of Intercept and TFAR.
Made a couple Intercept based mods. Did some work on CBA/ACE.
Don't really have a completely self made mod that's public
well to match a mission to a location i kind of have to evaluate all the locations, and sort out the ones that match my criteria, and then randomly pick one.
nice credentials though
must be bitcoin
If you have a pre-determined set of criteria. You could filter once. And cache that stuff too
i'm not entirely sure yet. imagine you want to fill 3 houses with 5 objects each. then the criteria would be that a location has at least 3 houses with 5 building pos each.
the pre-determined set of criteria is defined for each mission that's defined and that can be spawned.
the goal is to have like, a couple dozen of said missions. or, ideally, piece them together randomly from sub-elements
or you could atleast pre-filter parts of that. Like prepare arrays with locations that have >1 or >2 or >3 or >4 houses. And then later at "runtime" filter for building positions
i think i would like to say flexible until the criteria emerge over time, and once the criteria that matter are established, i would do such optimisations.
Or something dynamic. Automatically cache things for a criteria once it's been seen once.
Do you have CBA?
i had criteria that proved to be not useful and then there was stuff i missed so i'm still afloat in that area atm.
vanilla is not of interest to me, so CBA and ACE are a given.
CBA Namespaces can be awesome for that.
just setVariable format ["criteria_house%1,buildpos%2", _minHouses, _minBuildPos]
if variable already exists, great. You already had that same criteria before and don't need to re-filter now
ahhh i see
But all depends on whether your code is really taking long enough that trading speed for memory usage is worth it
🤔
I guess generating missions doesn't happen every couple seconds
no, i would say 0.5 to 6 hrs
depending on the size of mission and lazyness of players.
At that point I wouldn't really care about optimization at all I think
heh yesterday X39 wanted me to write a dll for it
freeze the server for half a second every half hour. Who cares if AI lag a tiny bit. They already lag around randomly anyway. even without your code
i think it's already a great step forward to have pre-calculated data. spawning an AO took 45-90 seconds atm, now it's like 5 seconds while spawning 1000 objects.
isn't there a way to have the code run with low priority
damn you guys are big league
i've noticed for example that shoving around array elements for several seconds in scheduled does nothing to performance sometimes, if you do not access anything (map data, cfg, logfile)
so whats Invade and Annex' biggest problem? I cant play that with my best computer.
also when generating a mission, the previous mission has finished. at that point players are on their way back to base, with pretty much no to minimal enemy contact to be expected. i planned on doing sidemissions, but i would keep them small for performance reasons anyways and wouldn't have to do fancy filtering i guess.
since nobody yelled at me, i'll keep my nested array for now and see how it works out.
sheduled is low priority. 3ms max per frame. No real impact on fps should be possible
then why you assumed AI would lag? did you assume i would run this madness in unscheduled?
nervously adjusts his glasses
I did say unscheduled up there. yes.
i was under the impression that, if you hand the scheduler a single script that runs for a long time, AI calculation etc will still work relatively unaffected. unless the script does crazy stuff like spawning 100k objects
i've noticed tho that if you write self-replicating scripts and clog the scheduler with 100+ scripts that run forever, everything grinds to a sudden halt.
i kind of wish i would know a bit more about how it works inside the engine.
of only a subject matter expert would blog about such things
sigh
The scheduler always sorts scheduled scripts by last execution time.
If that sorting already takes 1ms. there isn't that much left of the 3ms
alright got the server up lets see how it works with the new code
and that part is also not 3ms limited. if it goes over, it does. And no scheduled script will be executed. or at most a couple lines
so minimizing the number of scripts in scheduler is good
how many scripts must there be in the scheduler to achieve that ?!
i hope that's then some accident, like some bug causing new scripts to be called all the time, and not actually by design.
that being said, placing 400 empty cars halfs my FPS in editor, so i guess there is plenty of bad stuff happening there already.
depends on CPU speed and cache size and memory speed and stuff
grab profiling branch and find out what's going on 😄
Or move your code to unscheduled. So that you can use my profiler to find the slow parts of your code :U
if you make a new, empty scenario and just place lots of vanilla vehicles, FPS does down the drain. zero scripting involved. that's what i meant.
stop deleting messages :U
b-but i accidently spammed the channel because my head fell on the keyboard.
i've figured it out.
Stage 1: scan map, calculate roadblock positions, collect houses + evaluate building positions // needs to be done when map updates
Stage 2: sort houses with list of defined compositions // needs to be done when we add new compositions
Stage 3: sort all the data by filtering it thru criteria of known missions // needs to be done when we define new missions
@ runtime: each mission has a set of available, suitable locations. pick one randomly.
well if you approach it with the right mindset, i find it quite easy to do things in a way which does not affect fps.
i guess managing the amount of enemies you have is quite important
i try to have as little as possible, but constantly replace them
also i set an arbitrary amount of AI i can spawn as max, and when that's hit, i don't spawn any more
each mission has a number of AI, and if it doesn't fit inside the budget it can't be spawned
think of it as "reserving" AI numbers.
say you can handle 150 AI max with good performance
and you spawn a mission that has a value of 100
if players kill half of those 100, i have freed up 50 i can spawn as reinforcements, but the global server AI budget still reserves 100 of the 150 for that mission. and i got 50 left for a sidemission.
so then i just check all my sidemissions and i can randomly spawn any which has an AI budget of less than 50
well what am i doing ... github readme starts with this:
The goal of this is to provide an interesting, dynamic mission that can run unattended 24/7 on a public server, providing a good challenge to experienced milsim oriented players.
The general scripting approach is to write a large number of functions that automatically parse existing map and mod data, to provide a lot of flexibility when porting the mission onto a new map or modset.
Missions shall be made up by basic building blocks, which in turn are mostly made up of generic functions that accept a lot of parameters to randomize them and adjust the mission size to the current player numbers.
Usability for vanilla gameplay is not inside of the current scope, CBA and ACE are to be considered mandatory.
i tried to come up with some artifical performance score, but i realised if i just take AI numbers, i'm probably quite accurate and it's trivially simple to count. Now does a tank with 3 AI inside cause more or less performance drop than 3 infantry units? idk, but i think that's irrelevant.
i would say the idea and concept is close to what I&A does, but targeted to a different audience and less restrictive. and, if i may be so bold, with some more fancy stuff.
i had 3 people play a very rough version a couple of days ago to test some basics. but it lacks tons of features.
80% of the static spawn stuff is figured out
only a few bits of the dynamic reinforcements tho
Ai behaviour is still just a point on the todo with lots of ideas attached
shrugs
hard to get people involved, too.
what do you think ACE can provide in terms of mission flexibility?
can apply delete an array element?
for [{private _i = 0}, {_i < count _struct}, {_i = _i + 1}] do {
...
_cost = _cost + ([_filtered, _equipType, true] call ZE_fnc_calcCosts);
...
};
Is it normal behaviour that the _i variable is exposed to the function ZE_fnc_calcCost?
Do people here use scripted dialogs/ui or config dialogs/ui?
oh, right.
how to create a placeholder empty group in 3den using script? I've tried the usual
_grp = createGroup west;
_grp create3DENEntity ["Object","B_Soldier_F",screenToWorld [0.5,0.5]];
_grp create3DENEntity ["Object","B_Soldier_F",screenToWorld [1,0.5]];
but it generates both in own group. Ignores groups created by createGroup
also, how to move a unit into a vehicle in 3den? I have references to both (dynamically created) but moveInDriver no habla
@earnest ore in SQF it is, that’s why you should use private in function too
i by default write private infront of every var i declare and only remove it if it doesn't work out 😛
Yeah, caught me off guard when my function started doing crazy loops. 👀
I have some NPCs with animations and props in my mission. U know... the immersive stuff :D
Sometimes things fall over or a stupid one shoots an NPC. I'd like to have a script called all 30min so reset all NPCs and their initial setup even the props. I can imagine there is already something convenient written for that case. Any suggestions?
1 char in a string is 1 byte, right?
For most cases but not always
Hello guys, is there an existing command to found non used IDC for controls in a given range ?
@waxen tide Russian Ш is 2 bytes for example
Arma strings are multibyte strings containing Unicode, so if character is 2 bytes it will be 2 bytes in the string
Also AFAIR count also counts bytes in strings.
i won't be able to export map data with copytoclipboard, strings are limited to 10mb apparently :/
toArray reveals all the bytes
10mb of strings? whatya doing there buddy?
14mb
@compact maple how do you mean non used idc?
blobs?
Binary Large Objects in short.
Well every controls have IDC when they're created, so I wanted to know if there is a function that automatically assign a free IDC to a control
or at least give me the number
@waxen tide write a compression function in sqf, to zip it, text could be zipped a lot, since you fanatically oppose extension use, this could be fun 👍
@compact maple Are you using ctrlCreate or config classes?
config classes
Then how are you willing to assign them automatically? There are tools that do export in some sequence but nothing more.
Second question is why would you assign it automatically and what does free mean?
I mean an IDC who's not used by an existing control
If you don't care about accessing that control from config, you can use -1 as an example.
Yes but I do care 😃
-1 are good for background, image or such things, but for button, slider, etc.. If I want to interact with them I need an idc
You can allControls https://community.bistudio.com/wiki/allControls and ctrlIDC https://community.bistudio.com/wiki/ctrlIDC
Yeah, I got what you mean, well u can use #define preproc commands to create some automated process, but when I was working with configs I just used some range of like 5000-5100 and thats all.
I don’t understand what assign idc automaticallymeans
Well I got it thank you, I was just asking my self about this
Free means it is your UI you can pick idc you want
Yes I know, I just need to be organized lmao
The engine used idcs and idds matter only in UIs created by engine. Engine creates Gear dialog for example it will expect user interaction with certain controls with hard coded idcs, which would mean something, but if you create the same dialog yourself none of that would matter to the engine
what's the difference between idcs and idds ? tought it was the same thing
@unborn ether https://www.youtube.com/watch?v=Dh0AHrMEMvg
googles "compression algorithm implementations"
I think you choose the wrong engine 😄
nah i'm good.
can't these terrain editing guys put their radiusA radiusB and angle values properly? jeez
@waxen tide can apply delete an array element? no. But you can have it return nil and filter them out afterwards with - [nil]
@waxen tide 1 char in a string is 1 byte, right? ASCII yes.
ponders
maybe i should just use a database extension, i know basic SQL anyways.
i bet SQL queries are so fast that i can do everything at runtime then.
btw thx dedmen (apply)
But you can have it return nil and filter them out afterwards with - [nil] computer says NO
Anyway this is known limitation, nil was always special case
If you want to remove nil you can use arrayIntersect with target array being both arguments
Hey, do you know why this happen ?
this doesnt work
if (isClass (missionConfigFile >> "CfgVehicles" >> _classnameVeh)) then {
private _price = getNumber (missionConfigFile >> "CfgVehicles" >> _classnameVeh >> "price");
};
test1 = _price / 100; // _price undefined variable
but this works :
private _price = getNumber (missionConfigFile >> "CfgVehicles" >> _classnameVeh >> "price");
test1 = _price / 100;
_price is undefined?
yep
I am struggling with this for 1 hour, decided to take it out the if statement, and it works
Because it is defined in then { scope and you attempt to use it outside of it, private or no private would not matter here
tl;dr remove private
because i'm tired and telling you rubbish.
"computer says NO" wat? I've seen that code a ton of times
private or no private would not matter here @waxen tide
yeah i just noticed. i'm a bit tired, sorry.
I’ve seen people ending their scripts with if (true) exitWith {} tonnes of times
btw exitwith, is this weird ?
{
private _abort = false;
if (_something > _some_other_thing && _more) then
{
_abort = true;
[] call do_stuff;
};
if (_abort) exitWith {};
} forEach _array;
[1,nil,3] - [nil] what does sqf-vm return? @queen cargo
[1,any,3]
Not weird, legit way of breaking from the loop @waxen tide