#arma3_scripting
1 messages · Page 390 of 1
Which one?
Heheheheh
The taffy monster ragdoll thing definately needs fixing. Been this way for very long time Not sure what is happening. For example sometimes with my suicide bomber as he moves towards you a satchel is spawned and attached to him then Allah Akbar, boom, Instant taffy monster. Locality never changes on bomber or charge. Its always on server. At least I think its not changing because all bomber and bomb is always created on server. Most of the time it doesn't happen but sometimes it does. Occurs more often when mods are running.
I've seen the thing with stiff straight arms when fps is very low.
Hello guys, is there anyway i can screenshot every uniform in the arsenal ? working on a php panel so i need image according to classnames
there's a function to "export" specific objects / vehicles
it basically spawn them in a gray box and screenshot it
yep thanks, its working well for vehicles, but apparently not for uniform and all kind of gear, headgear
@meager granite i use enableSimulation false on setUnconscious units
also used for dragging and so
to keep them in ragdoll. my old reviev sytsem also kept them as dead, but wasn't too happy with that either
_unit setVariable ["Unconscious", true, true];
_unit setUnconscious true;
_unit spawn {
waitUntil { (animationState _this) in ["unconsciousfaceleft", "unconsciousfaceright", "unconsciousfacedown", "unconsciousfaceup"] };
if !(isNull (_this getVariable [QGVAR(draggedBy), objNull])) exitWith { }; // -- If being dragged right away do't disable sim
_this enableSimulation false;
["enableSimulation", [_this, false]] call ClibFUNC(serverEvent);
};
basically
overal the whole ragdoll state is one massive buggy mess though 😦
Don't think simulation would help my case though
when I have problems like that I use the moto: "if you dont want them to see it, hide it" but thats for other games you all have tons more exp with arma engine then I do. But hiding, replacing it then unhide it who knows...
all, i realize this is a generic question but what can cause a game crash if you click on respawn?
I have a mod that is super minimal.
it does have a while loop with a sleep in it. so minimal i don’t get it.
Does it always crash?
yes.
createDisplay could crash the game.
no display created.
ACE spectator?!
it has ACE as dependency but ACE alone does not make the game crash on respawn
There's a crash with the current game version and the ACE spectator: https://github.com/acemod/ACE3/pull/5844
Freeze or ctd?
back to desktop
But only in that mission.
only with this small mod.
ok i was hoping for something generic besides the obvious idiotic stuff
i’ll have to dig in then
thanks commy
is there a scripted way of detecting which item in a listbox / treeview / etc you're doing a mouseover?
basically i wanna do different scripted tooltips
Not what i want. The data is constantly going to change, and rather than making an event that updates all the tooltips all the time, i'd much rather just do something that would just run some code when the tooltip opens up, and then use that return fo that code to set tooltip on the fly
aka
_control lbSetTooltipDynamic [0, { call FUNC(doSomething }];
Currently hovered over lb item ...
I don't think that exists.
I don't think so either, but i was hoping someone could prove me wrong
But if the data changes constantly, you must be using lbSetData/Picture/Value anyway all the time, no?
maybe there'ssome hacky way to do an onLoad or isNull check on tooltip control type....
nope
So just the tooltip is supposed to change, but not the text and picture? That is a weird menu you're building.
list of objects currently placed in object placement tool for terrains. The object placed/deleted isn't THAT fast... but when you're scrolling to change for example the scale of the object, that changes a lot and would be nice if i could just do getVariable on it
i was going to just keep a namespace of which index an added object has in the list, but then if i delete one... it means adjusting everyting below it again
The problem is that you can't tell which item is hovered over.
So you have to adjust all.
yep
Alternatively, adjust say 100 per frame and then every 10 frames the current one would update. Is still 3 times per second on 30 fps.
i remember ages ago i did somethign with checking mouse position, then getting origin of listbox + the size ofan item.... but that doesn't work for anyhthign that will scroll
Sadly you can't request the position of a scroll bar, I think.
also true
What about doing 100 each frame? scheduling the work.
Would mean perf is independent of the number of items.
Yeah thanks for the suggestion. Wasn't planning on doing it directly anyway, will end up doing something like that
So is the General Vanilla Medical System still tricky and unreliable in a basic Form? its been a while since i had to script anything medical related.
Any idea why im getting this error with the code linked? I've got no clue and can't seem to figure out a solution.(http://prntscr.com/hj529h) https://github.com/DylanSMR/A3BaseWars/blob/master/DS_StoreMenu.hpp
Just what it says you have idc defined twice
🤦 Thanks. I guess I didn't see that 😛
Btw, this:
movingEnable = false;
enableSimulation = true;
Doesn't work. Use 0 and 1 or #define those booleans as 0 and 1.
if your using extdb2/3 extensions it can return time with offset etc
pretty sure there are some date functions aswell
if < 0 then _time + 24
Ever heard of modulo?
modulo is your friend
is it possible for two players on the same side to be an assigned curator as long as they are assigned to seperate curator modules? im running into a bug where if one player is an assigned curator in zeus on module A, and I assign a curator on the same side to a dynamically created module B, player assigned to module A can sometimes get a black screen and be unable to close Zeus / must restart game
but it doesn't happen every time
I know that, im doing it via script and that also works, but sometimes a player already within Zeus will get stuck on a black screen if another player is assigned to a newly created curator module during runtime, as if the game no longer sees them as being a curator so they are unable to close the interface and it gets stuck
im assuming its some kind of bug because the issue is inconsistent
They should run fine assigned to two seperate modules. I ran a mission a few days ago though and had similar issues, along with being unable to cancel remote control of a unit. Are they able to reach the escape menu / debug console?
hmm not sure about the escape menu / console, ill have to check next time, ive gotten stuck in ArmA interfaces before and was unable to open either so id assume not
code wise im pretty much doing exactly what MCC Sandbox mod does, tell the server to create and setup a new logic group then spawn and assign a new curator module to it, then simply assign/unassign a player curator to it later in the game, so it should be compatible with missions that already have curator things setup
Well, zues interface is display* #312 / 49 iirc - you might be able to work around it by providing a key bind that does a closeDialog until its worked out.
has the minimap (gps) display changed since the 1.78 update?
the GPS shows as display 311 ctrl 101 'CA_MiniMap' for me... but the icon rendering does not work for some reason.
nevermind, got it working.
You want to go to top left but you are going to top right? I'd say.. turn around and go the right way.
The Indentation is terrible and the code is not that readable.
That I don't understand your question and can't read your code because the indentation is so terrible
And the functions description of " " doesn't really help understanding what that thing is supposed to do
whoever made that script seems to have no idea about what he is doing..
So for variables
Header
Text field
Ctrlheader
Ctrltext
Just change the parameters
Let's set the position. Then immediatly set it again without any delay to a slightly different value.. wtf?
He want it to be top right
Actually notif are spawning top left, he doesn't want theses to spawn here
Yes ind is terrible but it's easily readable if you jump some lines
Why can't people just use somewhat readable indentation and some code bin thingy site that supports SQF
(╯°□°)╯︵ ┻━┻
If you want to move from left to right you just need to change the X value of the position
So L 36/44/46/78/79 change the 0.005 to.. 0.8 or something
Maybe www.sqfbin.com is required for that to work @still forum
Sounds good!
@main oriole #creators_recruiting
@still forum lol is there a channel for that 😂
@main oriole You can delete yours in here now
Cross posts are against the #rules how good that you can just delete messages in Discord... And how good that every second guy seems to be unable to delete messages.. Wait.. no.. that's not good
I bet most people just ignore #rules and so don't even know that cross posting is not allowed. Or when people tell them where to post.. They seem to think it's the fault of the guy that directed them elsewhere.
I guess some of them think "Uh, i am intellitentetetet. Me has no see this message, lolzroflpip, they never know, lolzroflpipfart."
A little thing they tend to forget: The Message will be deleted anyway (but in this case it's incl. them). ¯_(ツ)_/¯
hello guys, if I create a eventhandler fired, and if i call a function with _this in param what am I able to get exactly ? The player who fired ? His guns ?
- go here and search "fired": https://community.bistudio.com/wiki/Arma_3:_Event_Handlers
You get all the informations about all the EHs (incl. a list of "_this" entrys/outputs)
Thanks you I already know the 1st page, but not the 2
It's kinda "hidden" in addEventhandler ( https://community.bistudio.com/wiki/addEventHandler )
yep thx ! 😃
👍
Working zeus compass control https://i.imgur.com/uP2Ko69.png
is it still part of UI?
What do you mean?
It's a control (group) on display 46, but can be added to any other display.
and it's animated by hand or is it scripted?
Scripted.
ah, thought you find a way to use those animation sources for compass
I don't think that would work outside the zeus display.
This is meant for the ACE spectator.
Eventually.
what is QGVAR ?
macrobois unite
it's a macro, when the function compliles it'll replace those by whatever it's set to
for example QGVAR(uwot) is <prefix>_<module>_uwot
in CBA it means QGVAR(uwot) within module foo it would translate to CBA_foo_uwot
it's a nice way of making sure everytihng is prefixed, both with your mod prefix and your module prefix (That way you can use the same variable names between modules, without needing to type it out yourself
ok, not sure if i understand that
im just trying to figure out hoe to best change the patrolarea of a group. i give them a searcharea with CBA tasksearcharea
but i am not sure if it just changes the area if i call it again a second time
or if it adds areas
now looking into the function i see that the searcharea function runs recursively and i might just able to change the used parameters
[_group] call CBA_fnc_clearWaypoints;
_group setVariable [QGVAR(taskSearch), _args];
and this is what CBA does during a recursive call
where _args, is the array of parameters .... so maybe i could just do these two steps in my script?
and not interrupt the recursive loop, or rund a secornd one....
again, im not sure if the first one gets interrupted if i call the function a second time on the same group
What's the problem? Did you copy paste the code and it would crash?
no i didnt copy paste anything yet.
cuurrently i just run the cba function that is fine
im just not sure what happens if i call the function a seco´nd time (with a different area)
will that run a second recursive loop?
while {(count (units _group)) > 0} do {
_destinations = _group getVariable ["fez_group_destinations", fez_activeAOs];
diag_log format ["FEZ AI_OPS: %1 is assigned to Areas %2",_group, _destinations];
_destination = selectrandom _destinations;
[_group, _destination, "AWARE", "YELLOW", "FULL", "STAG COLUMN", "", [3,6,9]] call CBA_fnc_taskSearchArea;
//sleep 1800;
for "_i" from 1 to 60 do {
sleep 30;
_wpindex = currentWaypoint _group;
_wppos = waypointPosition [_group,_wpindex];
if (surfaceIsWater _wppos) then {
_nearestlocation = nearestLocation [_wppos,""];
_wppos = locationPosition _nearestlocation;
[_group, _wpindex] setWaypointPosition [_wppos, 20];
};
_newdestinations = _group getVariable ["fez_group_destinations", fez_activeAOs];
if (!(_newdestinations isEqualto _destinations)) then {
//deleteWaypoint [_group, 1];
_destinations = _newdestinations;
diag_log format ["FEZ AI_OPS: AREAS CHANGED! %1 is now assigned to Areas %2",_group, _destinations];
_destination = selectrandom _destinations;
[_group] call CBA_fnc_clearWaypoints;
//_group setVariable [QGVAR(taskSearch), _args];
[_group, _destination, "AWARE", "YELLOW", "FULL", "STAG COLUMN", "", [3,6,9]] call CBA_fnc_taskSearchArea;
} else {
diag_log format ["FEZ AI_OPS: AREAS UNCHANGED! %1 is still assigned to Areas %2",_group, _destinations];
};
};
};
Good question, I think you're supposed to only use it once. Have you tried doing it twice and observed what happened?
fairly simple
there is a list of markers as a variable attached to each group
iitially i just used the first bit, and that seem to work. so a group with that script on would search an area, and after a while when the while loop repeats, a new destination would be chosen
up to then it seemed fine
Ah, CBA_fnc_clearWaypoints first and then CBA_fnc_taskSearchArea again. That could work.
as the units would change the area after a while, but now im thinking, that that might just be consequence of a second loop running
yes, i just added that, will see if that doies anything
i noticed that someting is going wrong when i added a script that changes the assigned destinations
which does cause the if/then part to fire
but they did not change destination
There are no loops in that cba function. The recursion happens with the waypoint statement, and deleting all waypoints deletes that statement too.
But I think I know what you mean.
The variable still persists and so QGVAR(taskSearch) will carry over from the previous search task.
right?
it appears that something does persist, at least i did not notice the change that i wanted to see
Try this...
Replace:
//_group setVariable [QGVAR(taskSearch), _args];//
with:
_group setVariable ["cba_ai_taskSearch", nil];
as i now have it there towards the end. correct? i just added that, will see now if it works
oh
right ill do that in addition to deletewaypoints
I think that means that you can also get rid of [_group] call CBA_fnc_clearWaypoints;, since taskSearch seems to already clear all old waypoints.
sometimes double effort seems to do the job ^^
thanks for the tip. will see if that works
Idk, cleared is cleared:
https://github.com/CBATeam/CBA_A3/blob/master/addons/ai/fnc_taskSearchArea.sqf#L55-L57
You can clear it thrice if you want to. But it won't make any diff.
your variable there looks like it would do the job alone indeed
not sure if the deleting waypoints does it alone
Is it possible to speed up the time on a single module?
It is possible to speed up simulation time in SP. But that affects everything.
Not possible.
Ok thanks u
so deleting did the job
Really? Surprising to me. It should work without deleting the variable and without deleting the waypoints.
i did not delete the variable
Well, setVar nil DOES delete the variable.
looking at the function again, it does not show up there at all, does it?
What shows up?
i mean the variable. its nowhere in the function. so how would it stop the recursiveness of it if it is not checked?
or am i overlooking it?
Sorry, what variable again? I'm now confused.
QGVAR(blah)
->
"ADDON_COMPONENT_blah"
ADDON is clearly cba, and the COMPONENT is ai.
So:
"cba_ai_blah"
But again, in theory you don't need to touch this variable and it should work anyway.
well i didnt. just deleted the old waypoints now. matter of fact, that might just have resulted in me seeing the result much faster. it could have changed the search area, but i would only see that after the last waypoint from the last recursion is done. maybe i just didnt wait long enough before. that would be a bit surprising but possible
does init.sqf get called again when a player respawns?
no
but this is what i don't get. dunno if you remember i told you a little mod crashed yesterday
Well, I have a function called on postInit:
class init { postInit = 1; };
in there:
player addEventHandler ["respawn", { [] call mymod_fnc_init; }];
this causes a neverending loop when a player clicks on respawn
i don't understand why.
respawnTime is 0 / unset?
correct
You do realize that eventhandlers carry over to respawned units, right?
Copied from the corpse.
I think you essentially added a repawn eventhandler while respawning appending the array of respawn eventhandlers indefinitely.
if my understanding is correct, init gets called only on postInit and that's on mission start.
True.
ok
But you also call it from that respawn eventhandler.
so I do not need to reinitialize a respawned unit.
You must not.
thank you, well that's an easy fix.
Did it work?
All of them are in A3.
here: "Multiplayer: Some event handlers are persistent (i.e. they stay attached to a unit, even after it dies and respawns)."
but since I could not find anywhere which ones, I wrongly assumed respawn wasn't one of them.
In A3, all of them are persistent. This is just a persistent comment from A2.
Same diff.
The doc itself is seldom worth more than the average comment.
yeah that's why i lol'ed
Do you happen to know if CBA_fnc_addEventHandler are also persistent?
They add to the mission namespace, so they persist as long as the mission persists.
Including loaded savegames.
Independent from respawning objects.
ok sounds great. thank you.
so i basically just need to get rid of the unnecessary re-initialization of EH
that'll fix it
I think so.
still on this recursiveness. if i run the function multiple times on the same group, wont it recurse multiple times in parallel? even if it uses the same destination....
in theory i should then see waypoints hopping a few times, the more often the loop runs, no?
if (isNil {param [1]}) then {
The recursion happened when you respawn any of them.
ah right. the waypoint does the execution...
i do see waypoints jumping though... something assigns new waypoints before they are fulfilled.... m script moves them off of water surfaces, but this is hopping over different locationson land...
but its only one group out of 30 at the moment doing that stuff...
and the guys are standing around there. looks like they are still discussing where exactly they want to go
it even counts up the waypoint number, without adding more waypoints. im now at waypoint 27 for that guy...
deleted the waypoints for the guy, lets see if goes back into business after a while
having it with a new unit. the guys freeze and count up move waypoints. this ne is at 21 already
All, does anyone know of an issue with the time command. I read in the comments (https://community.bistudio.com/wiki/time):
On overloaded servers (below ~10 server FPS), time readings are unreliable. Seconds actually take longer. While the clients keep a steady tempo, server time lags behind, resulting in considerable offset between client and server time (easily 30 minutes for a 2 hour game). Client time is synchronised to server time during JIP, but other than that it runs independently.
that was 7 years ago though, so arma2.
time is everywhere different. Doesn't have to be a slow server.
i know it’s different. i just want to know if time computes seconds correctly
because we have a countdown timer that uses it, and sometimes the countdown takes longer for no reason.
for instance countdown of 60 minutes starts at 11:00, at 12:00 there are still 18 minutes remaining.
code is _minutesRemaining = _countdownTime - floor(time/60)
running on server only
then remaining time is published to clients
time is based on the ingame simulation time, not the real world time. And the simulation depends on the fps. Since you're using CBA anyway, I'd suggest you use CBA_missionTime instead. It's based on the real world time (machine clock) and synched for everyone on mission start.
not using CBA in this mod
Then hack something together with diag_tickTime.
i understand that it is based off simulation but wth
not 18 minutes on a 60 minutes countdown
¯_(ツ)_/¯
_this addEventHandler ["Dammaged",{"code"}];
``` is this the correct way to use the dammaged EH?
What's "code"?
The code can't be in quote marks, otherwise lgtm.
is commets ```css
/commet/
oh no i know thats just a place holder ,like i ment```css
/code goes there/
but thx tho
fez_OPS_Groups = fez_OPS_Groups select {count (units _x) > 0};
would that throw an error if _x is not a group, or would that element just not be part of the resulting array?
units works for objects and groups.
units player
for example is just shorthand for
units group player
so if i had an array initially that contained for whatever reason markers or so in addition, that might be a problem? or are markers objects too?
For markers it would error.
units #_x
type STRING, expected GROUP, OBJECT
thanks again! good to have you around
Anyone know of a good extdb3 tutorial? The documentation for how to actually execute queries in sqf is elluding me looking at their wiki
Have a look at another using mission using extdb3 or have a look @ https://bitbucket.org/torndeco/extdb3/issues/69/set-of-functions-used-to-handle-extdb3-api
I have compiled some functions that could help begining mission developpers in the task of using extdb3. Most of theses functions are error safe and well optimized. I would be glad to see them improved and included in a pbo next to the .dlls.
Feel free to contact me on steam for any questions.
http://steamcommunity.com/id/youpala
OO_EXTDB3 - A driver for extDB3 addon MysqlLastest version : 0.2 by Code34
GitHub : https://github.com/code34/oo_extdb3.altis
OO_extDB3 is a driver...
Those are exactly what I was looking for, thanks.
What is the setPlateNumber and getPlateNumber command syntax
Pretty sure these don't exist.
car setPlateNumber "012345"
getPlateNumber car // "012345"
That's what I think they would be.
_building = selectrandom (nearestObjects [_pos, ["House", "Building"], 500]);
seems to return all sorts of things
but no buildings so far ^^
i mainly hit the lights on airport runway with it, and powerlines
street lamps...
ok. i should be fine if i could exclude lighting devices and power lines from the result. any idea how i could go about that?
i did hit a few buildings now, so they are at least not excluded....
Yeah, those plate commands don't do anything. Strange that it was mentioned as added in Sitrep today.
Are you sure Jigsor?
16:12:56 Error position: <setPlateNumber "012345">
16:12:56 Error Missing ;```
I'm not on DevBranch, Can anyone on DevBranch confirm?
it says missing ; not that it doesnt exist ^^
No the command doesn't exist in stable
more importantly, how can we identify actual buildings in the game
one way seems to be by figuring out wich ones are enterable.... but that would then be only a fraction
What do you mean by that?
_building = selectrandom (nearestObjects [_pos, ["House", "Building"], 500]);
does return buildings but also a LOT of bullshit
streetlamps, benches, powerlines...
i would like some actual buildings. those that at least look like something where humans could enter
@proven crystal
private _buildingList = nearestObjects[_pos,["House","Building"],500] apply {count (_x buildingPos -1) != 0};
private _selection = selectRandom _buildingList;
Fixed
That would include non-enterable buildings?
Meehh....maybe , because if I remember correctly there are still memory points defined for the steps of the non enterable buildings
I shall try that tomorrow. Thanks
Sure.
How is apply there different to select?
To be honest with you, I think the only difference is that apply executes the code to each item in the array, while select is only concerned with returning the element if it meets conditions. Though I'm not 100% sure, someone else could probably explain it better.
just looked at the wiki. looks like apply can do a bit more than select
but what you sent there should work with select as well
Indeed
thanks again and goodnight
yep
Hi, i am working on an enemy AI vehicle spawning system and i was wondering if anyone knew the best way to retrieve a list of all indepent vehicles only and put them into an array. I assume this can be done with configFiles, but i can't remember how to retrieve such a list.
anyway to recover a .sqf file that returns boxes of null after power outage?
@subtle ore apply creates a new array based on what the code returns. your code would return an array of true/false
you want select in that code to filter out bad stuff
@cedar kindle gotcha, thanks for the clarification
Hi there,
I am having an issue with the functions "in" and "find". I am querying a database in Exile. The output returns a string.
The string being searched: [[""CUP_B_M1128_MGS_Desert_Slat""],[""CUP_B_FV510_GB_D_SLAT""]]
The string trying to find: CUP_B_M1128_MGS_Desert_Slat
I am getting either false or -1 when using in or find respectively. Do I need to remove the brackets and the quotation marks in order for this function to work properly?
Regards, Dane
Anyone have any tips for detecting if a fired missile is an A2A missile?
I was hoping that the ammo, magazine, or weapon would be based off some A2A specific base class
but they all appear to use generic base classes like MissileLauncher which is used by A2G missiles too
I imagine theres some sort of guidance property that I could use to detect it, but I don't know nearly enough about CfgAmmo
When I call a function like this:
_var1 call testFunction;
Does the script pause until the function is done (even if it returns nothing) or will it continue?
it runs testFunction and won't continue until it's done. (does not matter if it returns anything)
Okay cool, so only spawn and execVM will keep the script running?
Call will run testFunction on the same thread. Spawn will create a new thread and run the function on that.
Thanks for the quick response, will keep that in mind
@vivid locust
Fnc1 = {sleep 2;};
[] spawn
{
systemchat "0s";
call Fnc1;
systemchat "2s";
};```
@rugged umbra
The string trying to find: CUP_B_M1128_MGS_Desert_Slat
You have to string vs string with in.
You can use select and compare instead.
Why double quoutes?
I'll assume the array is bigger.
_arr = [["CUP_B_M1128_MGS_Desert_Slat","car1"],["CUP_B_FV510_GB_D_SLAT","car2"]];
_target = "CUP_B_M1128_MGS_Desert_Slat";
_arr2 = (_arr select {(toLower (_x param [0])) isEqualTo (toLower _target)} param [0]);
systemChat str (_arr2 select 1);
// car1
The double quotes isnt my choice, its how the query works to my knowledge
Ill try that
@peak plover
Thank you for your help!
I changed the ouput type of my database query to an array.
The array appears to have the format: [1,[[CUP_B_M1128_MGS_Desert_Slat],[CUP_B_FV510_GB_D_SLAT]]]
I used the following:
_currentVehicles = format ["loadActiveVehicles:%1", (getPlayerUID _player)] call ExileServer_system_database_query_selectFull;
_activePrestige = format ["loadPrestigeVehicles:%1", (getPlayerUID _player)] call ExileServer_system_database_query_selectFull;
_matching = (_currentVehicles select {(toLower (_x param [0])) isEqualTo (toLower _DropSelection)} param [0]);
diag_log format ["SERVER - AAA - Matching Vehicle: %1", (_matching select 1)];
I get the following:
Error in expression <[1,[[CUP_B_M1128_MGS_Desert_Slat],[CUP_B_FV51>
20:32:52 Error position: <CUP_B_M1128_MGS_Desert_Slat],[CUP_B_FV51>
20:32:52 Error Undefined variable in expression: cup_b_m1128_mgs_desert_slat
The variable _DropSlection is a string that is selected by a user in a dialog.
Hi
am i right to assume that waitUntil is run per-frame unscheduled? Could complex check bring FPS down? If it's scheduled, there is still 3ms rule applied
No, and yes.
apparently it's scheduled <- sleep is allowed
@little eagle , how can waituntil severely impact FPS if scheduled per-frame limit is ~3ms (until heavy native command is executed)
Commands are still atomic, so if you use an expensive command, it's still done all in one frame.
find big array, copy big arry, allMissionObjects, isNil, nearObjects etc.
@little eagle Thnx
but the code inside waitUntil is really scheduled. So 3ms limit applies to the code inside it
waitUntil doesn't have any more impact than any other script that you might run
without sleep command it's the same as a while loop with a sleep 0.00001 at the end
it's the same as a while loop with a sleep 0.00001 at the end
it should.
you mean being able to use the while loop to capture multiple times a frame instead of once a frame?
Can we please get a facepalm emoji for this incredible dumbness?
The game is only simulated once per frame. Meaning positions/velocities/everything only changes once per frame.
Why on earth would it make sense to record the same position and velocity multiple times? less than 3ms apart from eachother
Then don't.
Hey, im making a safezone script using markers. The safezone works well, but the user feedback doesn't. Using this code ```sqf
cusRadio = radioChannelCreate [[0.92,0.92,0.92,1],"","SAFEZONE",allUnits,false];
ooo, ok i shall have a look at this command
ooh, so the problem is that they don't re-add themselves when they respawn then.
Apparently.
ok thanks alot
yw
btw, it works thanks
Hi, how to get references for all vanilla IGUI displays? I am found stance, weapon, custom panels, but not group bar and vehicle status....
@little eagle also need vehicle status, support icons (On left side of the screen), and all helicopter gauge
Pretty sure every helicopter has a different display for that (even though it uses the same assets).
RscUnitInfoType
commandbar doesn't have any references
class cfgIngameUI {
#include "CommandBar.hpp"
/*class CfgWeaponModeTextures {
default = "#(argb,8,8,3)color(0,0,0,0)";
semi = "\pr\frl\addons\interface\img\fireselector\mode_1.paa";
dual = "\pr\frl\addons\interface\img\fireselector\mode_2.paa";
burst = "\pr\frl\addons\interface\img\fireselector\mode_3.paa";
fullAuto = "\pr\frl\addons\interface\img\fireselector\mode_5.paa";
fastAuto = "\pr\frl\addons\interface\img\fireselector\mode_10.paa";
};*/
};
Do you want to hide it?
cfgIngameUI { class CommandBar { // blabla } };
@little eagle not hide, adjust transparency
they're seperate sections of the UI, that you can't access through scripting
so you'd have to do a mod
^ this I fear.
vehicle status also has a bunch of hardcoded elements. The only way to do it is by recreating the UI for it in a mod, and giving it proper idc/idcs and set some vars to uiNamespace
that is all part of class rscIngameUI
@Adanteh#0761 it already mod, if need modify config - ok
(NOTE THE DIFFERENCE BETWEEN rscIngameUI and ctrlIngameUI
https://youtu.be/4tRMGZ-mO-k?t=26s bottom right is adjusted vehicle info on rscIngameUI classes
(and later as infantry the same for soldier)
Hi 😃 I need some help to understand array. So let say I want to create a file where I get player's slot name. In this case "civ_1" and get it called into a funtion. Exsample. [player] call life_fnc_test;
How do I get this infomation I called into fnc_test? If you understand what I mean 😃
params ["_unit"]
the **[1, 2, 3]** call
the array there is access through _this
if you you params without anything in front of it it'll be used as _this params
In my test file I have a global variable and plus a new variable. That variable need to me the player variable
life_paintballspiller = life_paintballspiller - [player];
then [1, 2, 3] params ["_one", "_two", "_three"]
Let's just say I do this [player] call life_fnc_test;
how do I get that infomation in the life_fnc_test? 😃
params
i just told you
[player] call { params ["_player"]; (player == _player) };
Hey all, what's the point of preprocessor commands? Do they have advantedges over SQF variables?
Yea I already have and that is the reason i'm asking in here. I had seach on the otherfiles in my altislife mission I do not understand it therefor I ask here 😃
@blissful fractal do you nderstand : [player] call { params ["_player"]; (player == _player) }; this line?
Year I do. I think I got it now. I will make a test 😃 Thanks
kewl
@atomic epoch preprocessor also allow removing part of code at compile time
Intresting. Have you ever needed to remove code from compile time?
Debug code.
its useful for debuggin, a single
a single define you put somewhere to add in extra logging/etc
basically you just #include the same file throughout all your functions, then with one #DEFINE turn on extra debugging all over
Another example is constants. Lets say you do code with keybinding eventhandlers. And you want to check if the key is Tab. Instead of looking up the code, you include the library file (#include "\a3\ui_f\hpp\defineDIKCodes.inc" ) and write DIK_TAB
so i heard there is a new numberplate command?
on that note: https://i.imgur.com/ubGa54V.png somethign is tarted using
That's clever
Not in 1.78, Heisen.
my base macro file has the full path to my IDC location, and also full path to the dikcodes etc
@little eagle which release it planned for RC ? dev branch?
but it includes it only #IFDEF __INCLUDE_IDCS or #IFDEF __INCLUDE_DIK
I don't know. It's probably in dev branch.
I'm assuming this works best when you put all your debug function inside the SCRIPT folder, so it's available for all missions
Dev
@atomic epoch each call of function request CPU time (Load code, move parameters and return value and etc) even you no need this, you can disable debug by variable (And chech this in debug function), but it is not remove call from all scripts, preprocessor - also remove call
So:
Preprocessor debug - Does not request CPU after compile as it remove the call
Scripted debug - Takes up CPU after compile, as it calls a function
?
Yes, scripted debug also need time for checking this variable
It is important in time critical scripts or in eachFrame/draw3D
@atomic epoch In each fms-state you can call sqf functions, or call two different fsm (With debug and without) depending on defined constant 😃
Is #Define local to a script, or is it global? (ie. Can what I defne in scriptOne.sqf can be used in scriptTwo.sqf)
Local.
But you can define them in a common header file and #include that one in every script you need it.
How does #include work in terms of file structure?
Okay gotcha, and ../ for lower directories?
- “..”
Upper.
Why would that be upper though?
Idk, for me "upper" means shorter path.
Hmm.
```[["weapons", "Minesweep","HintDetector"]] call BIS_fnc_advHint;````
The hint works but i recive a small error at the botton saying that is too long, any way to fix that?
[["weapons", "Minesweep","HintDetector"],nil,nil,nil,nil,nil,true] spawn BIS_fnc_advHint;
no errors
The warning at the bottom is only in the editor I believe.
@astral tendon And with this ```sqf
[["weapons","Minesweep","HintDetector"], 15,"",35,"",false,false,false,true] spawn BIS_fnc_advHint; //--- Default params
still get that error
Are you sure it isn't from another fnc or script?
if someone is playing on very large UI setting it might be outside the screen
'it' being the text
hence the error but just ignore it
Well, thanks for the info.
Just a question, is the BIS_fnc_UnitPlay MP friendly? because in the next mission i am about to work there will be like 5 cars were players will be riding as gunners and other unit captured vehicles around.
How would I get the classname for the prowler but with the desert skin?
@tough abyss https://community.bistudio.com/wiki/Arma_3_Assets
@meager heart well you can't get the classname on there with the desert skin applied on it
@tough abyss press ctrl+f in browser and past - prowler 😀
B_LSV_01_unarmed_sand_F ?
Lol I feel stupid now
Don't worry I have the same "emotions" quite often in arma 😁
I'm trying to make a helicopter landing script that will be addAction'd to the helo to allow the player to request a drop-off closest to current location. This is what I've created so far:
_aircraft = vehicle player;
_aircraftPilot = assignedDriver _aircraft;
_lzPos = [getPos _aircraft,0,500,15,0,0.2,0,[],[]] call BIS_fnc_findSafePos;
_lzPad setPos _lzPos;
_aircraftPilot move _lzPos;
sleep 3;
while {((alive _aircraftPilot) && !(unitReady _aircraftPilot))} do {sleep 1;};
if (alive _aircraftPilot) then {_aircraft land "Land";};
The problem I've encountered is that BIS_fnc_findSafePos only runs through a limited number of positions, skips over suitable areas, and doesn't return the closest one. I found through testing that running it multiple times increased the number of positions, but I don't know how to do it as one search, or adding multiple searches into one array, and I don't know how to get it to select the closest one. Any help?
@wispy lynx Something like this ?
_pos = getPosATL _heli;
_pos set [2,0];
_safe_p = [_pos, 20, 500, 10, 0, 20, 0] call BIS_fnc_findSafePos; //--- Closest to heli
_heli move _safe_p; //--- Need helipad in there
@meager heart can you explain what the line: _pos set [2,0]; does?
changes height to 0
so how does that increase the number of positions BIS_fnc_findSafePos finds? I'm new to this scripting, so trying to learn.
yep
it might not, safe position in general is not that reliable
yep x2 😀
is there a way to run several BIS_fnc_findSafePos, dump the returned positions into one array, then select the nearest?
You can do it, but i don't get it why you need it this way ?
private _array = []; _array append (_bla call BIS_fnc_safePos); _array = _array apply { [_something distance _x, x] }; _array sort true; _closest = _array select 0 select 0;
add linebreaks where needed 😄
when I run my script as it is, the return from BIS_fnc_findSafePos randomly chooses a spot further away than an open spot right near the helo, or defaults and flies off to mapCenter default pos. Through testing, I found that if I ran multiple BIS_fnc_findSafePos in same area, multiple locations showed up. But I don't know how to cleanly script that multiple search into one line, and select the nearest one.
Why not call bis_fnc_findSafePos on actual heli position and just adjust params min dist and max dist?
It can't be any closer...
Just drop z on returned atl position
@Adanteh#0761 so as I understand it: create private array, from array search BIS_fnc_findSafePos, apply distances to array pos's, then select nearest pos in array?
@meager heart that is what I'm doing: _lzPos = [getPos _aircraft, 0,500,15,0,0.2,0,[],[]] call BIS_fnc_findSafePos; with "_aircraft"
Your params min distance is 0 and max is 500
yes, min dist from _aircraft = 0 or directly underneath it, out to 500 meters search
should the search distance min be a positive number?
and i think >= 10
@Adanteh#0761 @meager heart okay, I'll try it with 10. I'll also try the array method, thanks both of you for your help.
gl
Hey all, I have a bin file that I can't unbin with my tools. Do any of you want to help?
I'll send the file to you
disableChannels[]={{0,false,true},{1,false,true}};
Is there anything wrong with this line of code? It is in my description.ext file and is saying there is a missing ';'. Am I missing some other .sqf file? I am just beginning to populate my mission folder with these files and I noticed some other lines of code started working, like the 'respawnDelay' in the description.ext started working when i simply created a blank respawn.sqf... What am I doing wrong here?
#define false 0
#define true 1
at the top of the file?
@ripe hearth, square brackets [] instead of curly ones {}
@ripe hearth looks fine
Ive been seeing unmodded servers with christmas decoration models around. How is this even possible without mods?
Didnt think p3d files could go into mission files
https://community.bistudio.com/wiki/createSimpleObject
look at comments
Didnt think p3d files could go into mission files
P3D can be inserted into the MissionFile itself. Only the config.cpp's can NOT be send over.
Ah yep cool. What about if you have textures for the p3d models, do they need to go in a certain path in the mission folder?
Can anyone explain to me how I build my addon when I #include files outside my addon?
Or, more accurately, I'm trying to build a series of addons (like how cba is a series of addons). One of these addons (named danger) has a .hpp file that has a #include of an hpp file from one of the other addons (named main). How do I set up my file structure and addonbuilder so that it can find what it needs.
@chilly hull , you define $PBOPREFIX$ file in root of your main addon - it defines path mapping for resource resolution. See how it's done in ACE (CBA is the same)
https://github.com/acemod/ACE3/blob/master/addons/main/%24PBOPREFIX%24
https://github.com/acemod/ACE3/blob/05d30c55732b95cfe38d145c738f3fdc227aec18/addons/interaction/script_component.hpp#L3
So it will look in the P drive for files, regardless of what I have set as the project directory?
@chilly hull you define the addon with $PBOPREFIX$ containing \mydrive\mypath\myaddon - Arma remembers to map the content root of that addon to \mydrive\mypath\myaddon path. Next time #include "\mydrive\mypath\myaddon\mysubdir\myanothersubdir\finallymyfile.hpp" is met, preprocessor will start looking for resource mysubdir\myanothersubdir\finallymyfile.hpp from where corresponding \mydrive\mypath\myaddon was defined in $PBOPREFIX$.
I'm actually trying to binarize files in addonbuilder
I'll just turn off binarize for now
how do i make a function return something?
abc_fnc_bla =
{
if(_Var == 0)then{_Var = 1;};
_Var
};
_Var = 0;
systemchat str _Var; //0
call abc_fnc_bla; //Function sets _Var to 1, if it was 0
systemchat str _Var; //1
okay thanks
@plucky willow
abc_fnc_bla =
{
if(_this select 0 == 0)then{_Var = 1;};
_Var
};
_Var = 0;
systemchat str _Var; //0
_Test = [_Var] call abc_fnc_bla; //Function receives: "1" as answer
systemchat str _Test; //1
systemchat str _Var; //1 (Also "1", since it was changed in the "call" and defined before )
Another example, using a Variable to store the result directly
axle_spawn_patrol = {
params ["_units","_wpSpawn","_wpDistance"];
//EXAMPLE: [_array,"spawnWP",50] spawn axle_spawn_patrol;
private _sq1 = [getmarkerpos _wpSpawn,EAST,_units,180] call BIS_fnc_spawnGroup;
[_sq1] spawn axle_set_skill;
[_sq1,getmarkerpos _wpSpawn,_wpDistance] call bis_fnc_taskPatrol;
_sq1 //return _sq1
};
_group = [_units,"wpSpawn",50] spawn axle_spawn_patrol;
{
_x setDamage 1;
}foreach units _group;
so it would look something like this?
erm, i think spawnonly returned the handle
Return Value:
Script Handle - can be used to determine (via scriptDone (also via isNull in Arma 3)) when the spawned script has finished. In Arma 3, the handle is also available inside the spawned script in _thisScript variable.```
you need to call a function, if you want a return
so if my function has sleeps in it I have to use spawn, how can i achieve getting a return and having sleep?
since the function uses sleep it has to be spawned
well that particular function could be called
_group = [_units,"wpSpawn",50] spawn axle_spawn_patrol;```
That part
🤦
i see what you mean, it is called
kk, the you might have to split it up and do it inside axle_spawn_patrol (or call the rest from there)
@south pasture 👋🏻
since the function uses sleep it has to be spawned
It only means that it should be executed in scheduled environment. duringcallenvironment is inherited from caller to callee.
can you give an example? i dont really understand
[] spawn {
_abc = [vars] call bla_fnc_blablub;
sleep 1;
hint str _abc;
};```
okay that makes sense
damn Discord... i clicked somewhere else -.- Was wondering why the text didn't appeared -.-
stupid pc
so would this be possible?
bla_fnc_blablub = {
sleep 1;
};
[] call {
_abc = [vars] spawn bla_fnc_blablub;
hint str _abc;
};
No
bla_fnc_blablub = {
sleep 1;
true
};
[] spawn {
_abc = [vars] call bla_fnc_blablub;
hint str _abc; //"true"
};```
oh okay i see what you mean about inheriting
👍
Nope
You can see it as an mutilated inbred of C#, Java and some other languages.
A bit of this, a bit of that.
i only really know sql
And?
just sql lol
@plucky willow do you have the idea of concurrency and multithreading? spawn actually is the thread creation (not really sure if it's native OS thread)
@south pasture nothing in Arma is multithreaded. spawn doesn't create a real thread
Then https://community.bistudio.com/wiki/Scheduler#Threads is misleading, but that's ok
Yeah "Thread" is just a good word to talk about it. Scheduled Environment explains how "Thread"s work
https://community.bistudio.com/wiki?title=Code_Optimisation&diff=104842&oldid=104096&rcid=109264&curid=9141 The bestest optimization evar bois! Make sure to apply that in all of your code 😄
i thought that was already known
that's actually 0.0001ms ^^
hey guys, pretty unrelated, but is BIF working for you? I've been getting conn refused error this entire week... (lol it works when accessed through google, but not when the domain is entered directly in the browser...)
yeah, i see lol. looks like their server is badly configured... it should automatically pick up https.
yep... Just BI things 😄
is ther e something wrong with while {!isnil _marker} do {.....}?
doesnt seem to fire....
or wait... do i have to create effects on clients?
im trying to create smoke
_marker is the variable name of the marker as string?
and you delete the marker?
Just put a diag_log inside the loop to check if it's running
i call that script with the marker as parameter
The createMarker returns a string iirc though
yea didnt put in a log output... will check on that
So isNull -> String ?
yeah.. And I don't think that means there is a variable with that name
you can't isNull or isNil a marker name
I know, that's what i am saying
i would guess that if it was a problem with isnil-isnull, i would see an error message at least
isNil "_marker" ?
if you want to detect if a marker doesn't exist then getMarkerColor _marker != ""
I have special premium NO-MENTIONS-ALLOWED package 😉
Marker color lol
you can also check if position is [0, 0, 0]... but what if a marker is really on there? 😄
hm thats a way too i guess. but that would also error if the marker doesnt exist, no?
erm, didn't you check Marker with their Names?
@proven crystal No. As he said. If it doesn't exist it returns ""
@still forum but if i have 6 million markers that's slower 😉
true. My method is kinda terrible. Also thought of yours but didn't know if reliable
so far i found it to work just fine
int he past i did check getMarkerPos _marker isEqualTo [0, 0, 0] but.... no ponit and well... what if it is 0? 😄
so
the script is starrted with an existing marker as parameter. and then it adjusts position in a loop. but marker might dissappear and then i want to leave the loop
while { getMarkerColor _marker != "" } do { // enter hacks }
should work for your case then
at the moment i just get no output at all from that script. no error eirther.... so i do assume that the isnil bit does not cause a problem per se
isNil checks if a variable is set to anything
private _testVar = nil;
isNil "_testvar" >> true
private _testVar = objNull;
isNull _testVar >> true
notice difference between quotation marks too
so ill try while {!isnil "_marker"} do {...} and add a diag log too...
while{ getMarkerType _markerName != "" };```
^the above would be preferred, since
while {!isnil _marker} do {...}
Would also return any objects with the same name.
100 proposed solutions, and he goes with his own, and wrong, idea.
A while is really expensive for what is trying to be done here it seems.
He wants to adjust it's position in a while loop. How would you do that without a while loop?
So pleasy Commy enlighten us. What is the best way... 😃
Should just execute whatever function he is waiting for from the script that deletes the marker.
That tbh
Does camouflageCoef change during gameplay, or is it a constant value?
The coef specifically doesn't change on it's own, but the value it's multiplying changes with your uniform.
(Assuming no mods).
const then
Commy, did you ever figure out how to transform into a ninja with that?
Completely silent weapons?
You could just setCaptive yourself if you want that.
Right, so if camouflageCoef is 0, the uniform doesn't really matter? Because 0 * u = 0.
Yes.
True, camoCoef is more thrilling.
Because if you push them in their face, they'll shot.
@little eagle - yeah but there's a decent chance of setCaptive being used by a given mission, as you mentioned in your PR.
Unfortunately :(
And they'll shoot back until you stop shooting and they loose you again.
Lol
while {!isnil "_marker"} do {...} works btw. it was just the ""
Punch bob and run away, works every time
interesting though that it did not throw an error without those
🤦
@proven crystal It works because it can never be nil. Meaning that's always true
Meanin. It doesn't actually work at all
wut?
_marker is never nil
@proven crystal if you ask a question and people give you answers.... and even explain WHY the answer is the answer they give
then.... consider using it 😄
Half a dozen people gave you answers that will work. And you just ignore them and rig up your own solution that actually doesn't work at all
i did?
Yes.
the "" were part of the several suggestions or not?
[5:41 PM] Adanteh: while { getMarkerColor _marker != "" } do { // enter hacks }
[5:41 PM] Adanteh: should work for your case then
Your problem was while (something) doesn't work. So you replaced it by while (true) Is that really what you want?
no
the "" part was explaining on how isNil itself works and that you should always
okay lemme give you an example
private _marker = "thismarkerdoesntexist";
isNil "_marker"; // FALSE
That is really funny
why is that false?... because _marker is actually set to something
Like comedy
marker is "thismarkerdoesntexist"
... so sure it might not be a marker, but you're not asking if it's a marker, you're just asking if it's.... something
just to reply to Dedmen here, i am trying to learn from this and use the advise, i might just not understand it first try.
isNil only checks variables. Your marker is not a variable it's a string. Meaning you can't use isNil at all
So before you checked if something that is not a variable is a variable. Which is ofcause always false.
Now you check if _marker is a variable that contains something.. And yes. It contains the name of the marker
so that's always true
It's completly unrelated to the marker itself though. If you delete it then _marker still contains it's name. and still is not nil
Sadly there is no markerExists function
But you can use the other functions that get properties from the marker. If the marker doesn't exist they just return a default value instead.
inb4 intercept
hmhmhm....
crap. so does that mean, that im using that isnil thing completeley the wrong way?
yes
there are a few other scripts that i launch with a check
for example
fez_CTO_zones = [];
};
well that is correct
you're asking if the variable exists, and if it doesn't set it to an empty array
that's all isNil is, checking if a variable itself exists, not the value of the variable
so in that case it's usage is good
static auto _markerExists = host::registerFunction("markerExists"sv, "Checks if marker exists"sv,
[](uintptr_, game_value_parameter right) -> game_value {
return sqf::get_marker_color(right).empty();
}, GameDataType::BOOL ,GameDataType::STRING);
There ya go. You forced me!
if (!isServer) exitWith {};
_marker = _this select 0;
_create = false;
while {!isnil "_marker"} do {....```
still dont get why the thing would return something then when i delete the marrker
oh or could i just add a _marker=nil; in the end?
ahh i think coin dropped now
not sure what took it so long
maybe i should eat soon
or sleep
ffs? Still arguing about that?
no
Of course
im all good now thans for the patience
At least
At last.
🤔
for the moment ... ;)
@proven crystal It would work. But you and I already got told the performance with that would be bad
Why do you keep searching for worse alternatives if you already have a perfectly working way.
Hey, hey. Guys?
Should I use:
while {!isNil _marker} do {
???
Yes!
i used Dschas thing now seemed good
👍
Dedmens answer will always be intercept
Yeah. Intercept is already posted above
i did inb4 it though, so it's fine
QUESTION INCOMING
what are the odds that it's a life question?
about 1/8th
we really don't get that much life questions.. They usually get bullied out before they can ask
What's the meaning of life?
42
HUEHUEHUF FORTYTWO EX DEE EX DDEEEEE
u so fny
I read the first three chapters of that book and idk why people like it so much.
I didn't even watch the movie
because so quirky and nerdy amirite guys
Hey, I'm new here, don't know if this is a scripting question, but as everything can be done via scripting I figure why not ask here.
I have a mission I'm making (just to learn different tools) where I have a helicopter flying over one inf who is only armed with a RPG-7. I want that inf to fire at the heli, but miss, and I'm so new to this, that I can't even get him to fire... plz send help
I have a script exactly for this!
YES!
That's not thaaat easy.. I guess you ........ Commy is getting too good...
wasn't there someone who basically asked just this somewhere within this week
I'd say last week
I found this chatroom today, very sorry if reposting!
How high is the bar for asking questions btw?
and is there an easy way to search for already answered questions?
The bar for asking questions is not high at all. As long as you correctly ask it and it's not a life/exile question. If it's life/exile question you'll get redirected to life/exile forums.
And stuff like
"My script no work! How fix?" you won't get a serious answer to.
And this ^ fires the rocket from soldier1 to heli1, missing by 20 meters left or right randomly.
Nah, you just spam the chat with nonsense.
That hurts ._.
Is true though.
I mean, this script is meant for tanks or infantry, so it might hit it anyway if it tries to miss and the heli has just the right speed in the right direction, but w/e.
Should work if the ai is directly underneath. I think.
Very helpfull commy! Thanks a lot!
Rockets / missiles are so nice now in 1.78+ with their whistle sounds.
any tips on how to/where to learn the scripting language of arma?
Tip: Don't.
(if you still insinst: Learning by doing + https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3 )
I'm so far down the highway of making bad decisions, so why not one more 😉
I never learned a language without using it.. so.. That's the only way I know.
Just a lot of google and reading
And after I had over a year of experience I went to ask the professionals for things
But since A3 is "slowly" reaching it's EOL... hm... you might learn to do some basic stuff, but... yeah, thats it^^
I was born knowing sqf.
But! knowing other programming languages makes SQF easier to understand and they are still useful after Arma 4
A little probably
Same ;_;
@little eagle I certainly are
Okay, sqf mustn't be the cause of it... but it takes a huge part of it 😄
I have headache all day, but made 13 pull requests anyway.
Masochism?
Just ordinary insanity.
@jade abyss sounds perfect lets go
🇾 🇪 🇸
no, i don't think explicit gear controls exist for either AI or the player
AI just has speed modes
I think you can tell them to go "fast forward" instead of just "forward"
rip
Do you mean aircraft gear? 🤔
u know the halo pelican
the ai doenst open the back door so I was trying to see if I could do so
now is there away to tell the ai to use a specific action that I add to a vic
Only works on player controlled aircraft.
oh
no worries @jade abyss @little eagle
will have you covered once the exact specs for arma 4 get released (in regards of language)
you can continue coding in much loved SQF ❤
and a tool will convert it then
"_marker"
but without ""
if (!isServer) exitWith {};
_marker = _this select 0;
diag_log format ["FEZ smoke %1", _marker];
while {(getMarkerType _marker) != ""} do {
_pos = [_marker] call CBA_fnc_randPosArea;
diag_log format ["FEZ smoke loop creating smoke for %2 around position %1", _pos, _marker];
};
it wont enter the loop
i see the first log, but not the second
is _marker actually correct in the first log?
yep
there is more code in the while loop. but that log is the first line there and should show even if there were later errors
if the code block itself is messed up it might not show that log
or execute it properly
so you probably wanna pastebin a bit more
if (!isServer) exitWith {};
_marker = _this select 0;
diag_log format ["FEZ smoke %1", _marker];
while { _marker in allMapMarkers} do { // {(getMarkerType _marker) != ""} do {
diag_log format ["FEZ smoke loop running %1", _marker];
_pos = [_marker] call CBA_fnc_randPosArea;
_buildingList = nearestObjects[_pos,["House","Building"],100] select {count (_x buildingPos -1) != 0};
if ((count _buildingList) != 0) then {
diag_log format ["FEZ smoke loop creating smoke for %2 around position %1", _pos, _marker];
_building = selectRandom _buildingList;
_object = "land_garbage_square3_f" createVehicle getpos _building;
hideObjectGlobal _object;
_smokeffect = selectrandom [1,2,3,4,5,6,7,8];
_particlecources = [_smokeffect,_object] call Achilles_fnc_SpawnSmoke;
sleep (60+ random 120);
deleteVehicle _object;
};
sleep 60;
};
yhmm that looks fine glancing at it
im just trying it with the allmapmarker thing.
is it an area/shape marker or an icon?
its an area
i wouldn't be surprised if getMarkerType is actually "" if it's shape
so one thing that's good to test, if you're just in the editor the watch fields
see what getMarkerType "yourmarkerName" does
just restarting the server. scond
and check getMarkerColor "yourmarkername" too
weird....
so in the log i see "21:32:12 "FEZ smoke commander_area_EAST_1" and "21:32:12 "FEZ smoke commander_area_EAST_2"
that is correct and the names of 2 generated markers
but then there is nothing else....
even though _marker in allMapMarkers
no. does seem to work with the allMapMarkers. just forgot to save ^^
yeah then it'll be because getMarkerType == "" if it's a ellipse/rectange marker i bet
aka
DSCHA WAS WRONG I WAS RIGHT NAANANAN
i hope
haha
i have a new error now whooptydooo
btw pls tell me you're not testing every line on a dedi restarting the thing
not everytime. i do bits and pieces locally but have to run the thing on the server eventually to see it all work together
so i did try out the spawnbit etc separately before and thought it should work....
Error Undefined variable in expression: achilles_fnc_spawnsmoke
that bit runs perfectly well if i just execute it in the mission
addMissionEventHandler ["Draw3D", {
{
drawIcon3D ["a3\ui_f\data\IGUI\RscIngameUI\RscUnitInfo\role_gunner_ca.paa",[1,1,1,1],(((_x modelToWorldVisual (_x selectionPosition "head")) vectorAdd [0,0,.2])), 0.8, 0.8, 0, "test", 1, 0.0315, "EtelkaMonospacePro"];
}forEach listOfObjects;
}];
If I try to use private variable it doesn't work. Is there a way to pass a private variable to addMissionEventHandler?
BIS_fnc_addStackedEventHandler onEachFrame
is that more cpu intensive?
Don't know. Maybe, maybe not. Your eventhandler code with addMissionEH gets recompiled every frame, which doesn't happen for scripted eventhandlers like stacked.
So if it isn't recompiled each frame, how would drawIcon3D update?
BIS stacked saves the function and arguments in it's own global variable. addMission stores the function as string and recompiles it for every execution.
Recompile is turning string into executable sqf code.
With BIS stacked it stays CODE.
["globalVar", "onEachFrame",
{
{
drawIcon3D ["a3\ui_f\data\IGUI\RscIngameUI\RscUnitInfo\role_gunner_ca.paa",[1,1,1,1],(((_x modelToWorldVisual (_x selectionPosition "head")) vectorAdd [0,0,.2])), 0.8, 0.8, 0, "test", 1, 0.0315, "EtelkaMonospacePro"];
}forEach _this;
}, [fDrawList]] call BIS_fnc_addStackedEventHandler;
Something like that?
Yes.
hmm performance test time
Is there a way to modify the AAN Logo on this function --> https://community.bistudio.com/wiki/BIS_fnc_AAN
Why do you want, and how do you obtain a blue name @Adenteh
Why do you want
😂
Hang out with the cool kids.
tbh i just wanna be able to put reactions and embed links 😦
🐒 💨
It's annoying sometimes when every link you post pops up with a preview.
it would be good if you oculd turn it off yea
ill try tomorrow iand figure this out.... i find it a bit weird.
but @Adanteh#0761 getMarkerType of an area marker does return the shape. in my case ellipse
so in principle the thing should work.
it works now with the check if its allmapmarkers, but i dont like it
the next bit is that the entire code runs fine if i test it locally but on the server the achilles function has an error
Why are people so attached to achilles?
Error Undefined variable in expression: achilles_fnc_spawnsmoke
im not attached, just tried 2 things of it for the first time
enum errors EVERYWHERE
You were given several smoke examples, and you choose a zeus functionality?
A function not designed for direct execution?
LOADCOEF
Ugh.....
what does it all mean?
nearly all commands that take enums as arguments just throw errors, because you know, it miiiight be one.
Or not.
Next step is reporting all strings as possible errors, you never know
so i should rather make my own smoke function? be aware that i might try that...
honestly what i recommend is just writing a game from scratch
starting by writing a GUI in visual basic to track the IP
The others gave you a good example, use it
I would avoid using ares as one, it's useful but hastily written.
writing game from scratch certainly sounds fun too, but id be happy with some smoke in some areas
Have you tried createVehicle'ing some smoke grenades?
wanted it more permanent. i just stumled across that achilles thing and thought that looks good, also with a few variations
My brain is a little ENUM right now
ERROR FOREIGN ERROR LOADCOEF
i dont know what ENUM is, but it apparently ruins my evening :(
whatever it does, it is not doing it well apparently
less than 72 chars too if possible
just use a client like gitkraken, so you got a seperate line for 72 char commit message + then below description
I liked the first version ever, then it turned to shit version after version
i hate theeir style of advertising, it's like they're speaking to toddlers, but outside that it's oaky
Impressive RPT file: https://pastebin.com/WXCSUshc
You have to use the right ones. Clearly all of these are caused by CBA.
Help request: Can someone explain how to select a position from and array? I am searching an area for positions, putting those positions into an array, then sorting the positions by distance. But when I try to getPos the nearest one, I get an error that the selected position is a number, not an object or location.
You already have position, you don't need getPos
_position = _arrayOfPositions select 0;
_safePosSearchCenter = "Sign_Sphere200cm_F" createVehicle [1655.75,5488.876,0];
private _array = [];
_array append ([getPos _safePosSearchCenter,0,500,15,0,0.2,0,[],[]] call BIS_fnc_findSafePos);
_array = _array apply { [_safePosSearchCenter distance _array] };
_array sort true;
_closest = _array select 0 select 0;
_safePosVisual = "Sign_Arrow_Large_Yellow_F" createVehicle [0,0,0];
_safePosVisual setPos _closest;
_safePosVisual setVectorUp [0,0,1];
@tough abyss nope, just saw it on reddit
I need to do the arsenal documentation before release or people will spread misinformation / drive me insane
triggering initiated
@wispy lynx You're losing original array with positions by replacing it with array of distances
_array = [getPos _safePosSearchCenter,0,500,15,0,0.2,0,[],[]] call BIS_fnc_findSafePos;
_array = _array apply {[_safePosSearchCenter distance _x, _x]};
_array sort true;
_closest = _array select 0 select 1;
BIS_fnc_findSafePos only reports one position.
Oh really, didnt use it in years
I tried using the "distance _x, _x]};" but it wouldn't take it?
Because _array is just one position and it's elements are numbers.
Well with findSafePos returning single position your entire approach is wrong.
distance fails on numbers.
When position cannot be found at all, default map center position is returned, which will be in format [x,y,0]
Wow, what a useful feature /s
Okay, so what I'm trying to do is have BIS_fnc_findSafePos run several times, put the return into an array, then search the array for the closest, then getPos the closest... better appraoch?
sounds like a safe place to me Sa Matra
What if you're in a bad spot and trying to escape to a safe position?
😄
BIS_fnc_findSafePos seems to skip over "safe places" and selects default pos, but thru testing I found running it several times on same area, it does better. I just don't know how to put the multiple searches together and select the nearest one.
for loop and pushBack
for "_i" from 0 to 5 do
{
}: //etc
If it wasn't for this "default map center position" detail, you could just increase distance until you had position returned
@wispy lynx use selectBestPlaces
it's your best shot instead of using the BIS funcs
@subtle ore Tried that, but when I try to select a pos from the returns, I get the "number, not an object or location...."
Actually findSafePos uses isFlatEmpty
Well yes, ebcause it's going to return _i , not your special variable _x
@alganthe#8904 I looked at that, but it says that it is slow and hangs up game while searching "should not be used in areas larger than 50m"
it's intensive, but whomever left that comment is wrong
unless you require 100% precision then yes, but that's stupid
@alganthe#8904 oaky, I'll revisit, just need ballpark.
60% precision with 10 sources is pretty good
Man, this all sound so bad. I'd just go for terrain vector and line intersect checks.
Is this for heli?
selectBestPlaces would be more efficient
Trying to find helo landing area when flying over trees/forest, so needs to be 15m from nearest trees (rotor blades) and gradient not exceeding 0.2
K, I'm off to try selectBestPlaces, thanks for the help everyone.
Look into findSafePos code to see how it works too
Hey guys, I'm looking to see how I can have a foreach loop for a variable, which checks any sqf varName_x (_x is 1,2,3,4,5,6,7,8,9,etc...)
@little eagle
That is a comparison of those 2 methods
Left side is crappy laptop and right side is high-end pc
_hasGodmode = player getVariable "DS_var_godmode"; //1=on,0=off
_status = (_hasGodmode == 1) ? "(On)" : "(Off)";
``` Is that a thing? Or do I have to manually use a if/then statement.
you do realize you can use true / false @jovial ivy ?
I do, that was just an example.
and no, unfortunately you can't do that
you can however have:
private _myLocalVar = if (condition block) then {something} else {something else};
That'll do it. Thanks
the return value semicolon rule apply there btw
private _myLocalVar = if (condition block) then {
"weee"
} else {
"wooo"
};
you can also have a switch, a foreach, a count, a for forvar and I must be forgetting others after the =, same principle
Closest you can get to ternary is probably
["Off", "On"] select (_hasGodmode == 1)
@jovial ivy
is there a way to display different pip 'camera' views on each seperate monitor
/*
File: fn_fedCamDisplay.sqf
Author: Bryan "Tonic" Boardwine
Description:
Turns on and displays a security cam like feed via PiP to the laptop display.
*/
_laptop = _this select 0;
_mode = _this select 3;
if (!isPiPEnabled) exitWith {hint localize "STR_Cop_EnablePiP";};
if (isNil "life_fed_scam") then {
life_fed_scam = "camera" camCreate [0,0,0];
life_fed_scam camSetFov 0.5;
life_fed_scam camCommit 0;
"rendertarget0" setPiPEffect [0];
life_fed_scam cameraEffect ["INTERNAL", "BACK", "rendertarget0"];
_laptop setObjectTexture [0,"#(argb,512,512,1)r2t(rendertarget0,1.0)"];
};
switch (_mode) do {
case "side": {
life_fed_scam camSetPos [16029.1,16938.9,3.08817];
life_fed_scam camSetTarget [16034.9,16930.6,0.00146008];
life_fed_scam camCommit 0;
};
case "vault": {
life_fed_scam camSetPos [16031.1,16936.6,10.287];
life_fed_scam camSetTarget [16017.1,16957.3,0.597221];
life_fed_scam camCommit 0;
};
case "front": {
life_fed_scam camSetPos [16084.3,16997.8,23.6492] ;
life_fed_scam camSetTarget [16037.8,16966.7,0.00145817];
life_fed_scam camCommit 0;
};
case "back": {
life_fed_scam camSetPos [16002,16904.9,5.71753];
life_fed_scam camSetTarget [15998.7,16939.7,0.00146866];
life_fed_scam camCommit 0;
};
case "off" :{
life_fed_scam cameraEffect ["terminate", "back"];
camDestroy life_fed_scam;
_laptop setObjectTexture [0,""];
life_fed_scam = nil;
};
};```
atm looks like https://i.gyazo.com/ca94b88201ca769fbd8edc0272f94f30.jpg