#arma3_scripting
1 messages Β· Page 479 of 1
it's a command that doesn't work with all anims
It's a command, not function. Basically, some work with playMove, some with switchMove and it would be nice if there is one that works for all. BIS_fnc_ambientAnim is useful in SP, but it is not MP compatible.
IMHO animation commands are unnecessary partitioned in 3. Most of the stuff people like to animate can be listed in 10-20 animation sequences...
@fringe yoke Yes if you have the optional cache disable pbo. Then [] call ACE_PREP_RECOMPILE should do it.
Awesome thanks
@still forum please write an elaborate blog article about the fine art of sqf debugging with fancy secret tools you're hiding from me. kthxbai.
didn't someone else already ask me the same thing recently? π
Probably. See the interest is vast.
Ah no. That was about profiling
the fancy tools aren't publicly available yet. So not really useful trying to show something off that no one can use
See, 2nd genius idea for a blog article RIGHT THERE. You should become a famous sqf blogger. Just set up a patreon account and live off that.
You can make those tools available to your patreons. Ez.
I'm a problem solving MACHINE today.
Making explicitly non-commercially licensed tools available only when people pay me on patreon wouldn't work out.
π©
@digital jacinth hey ! Just downloaded your ragdolling work for ACE in order to give it a try. However the mod version in the ZIP file is not builded. It's not a matter of concern for me as I'm used to building mods, but is that an intended behaviour ?
if you downloaded the sources from github then they are indeed just that. The sources as a zip file
I guess the script version is intended to be put directly into missions instead of being run as an addon
the mod version is.. the mod.
Nope, ZIP file from Armaholic, http://www.armaholic.com/page.php?id=33882
Containing both script version and addon version, which is not builded
Ah. I guess armaholic just scraped the github thing then and didn't know what they were really doing π
Maybe I should report this. It means that unexperienced users cannot use the hosted material, if they don't know how to set up the script or build theaddon
Also.. @digital jacinth Beginning with version 1.1 server only mode is available for the mod is avaiable wut? π
Yeah diwako knows now. I guess he can just tell armaholic.
But people are supposed to load the mod from steam workshop anyway
According to his BI forum thread steam workshop is the only official download source for the mod version
Armaholic isn't even listed there
https://github.com/diwako/a3AceRagdoll/pull/1/files#diff-4806c88e6b70dc56118784ed0b1f86f4R31 You're right there kiddo
oh that's dedmen, really confused who this was all of a sudden and where they got their fancy tools from
You need to imprint my sexy fur fox avatar into your brain so that you can always recognize me
I use the minified mode, I would have recognized that avatar
lol
Oh hey. Yeah the mod is only available through the workshop. I am not used to github releases so far.
Also yeah my English gets weird when I post late at night 
Server only mode is weird some people requested it, dunno why
Server only mode is weird some people requested it, dunno why
Also by downloading the current head of the repo then it is currently the unreleased version 1.2.1
When you create a new release you can drag&drop files into it to add them. Add the mod pbo there
Hmm, maybe for the next release. Right now I traveling and waiting for some pull requests reviews for the community I play in
Yeah a release doesn't need to be tied to the latest commit. You can upload your own files (e.g. pbos) to the release, like Dedmen said
you can even upload many to the same release cough cough
You could for example make a beta-release and then upload 200 different builds to it coughs up blood
Yeah I will probably just upload 2 zip files one for the mod version and one for the script version. It is good to know if they do not need to be tied to the tags I need to create.
guys
runs in circles panicking
Always the same name just feels boring
Does one's know how this is supposed to work ?
like, this is the single command mentionning such a "convoy" thing
no way to create a convoy, or declare a group as a convoy, or an array of vehicle
it does not look related to anything else...
a group of vehicles IS a convoy
automatically ? They are not behaving as one very often...
https://steamcommunity.com/app/107410/discussions/0/617330406663655161/ how to make a convoy
ah, thanks
setConvoySeparation < tried that (probably in wrong way π€·) and was no luck for me sad_face.paa
(on dedicated just no difference... with/without)
Civ5 move (civ5home buildingpos 1); waituntil {!alive player}; civ5 move [5,4,20]; this i have in sqf script, calling it from init.sqf. (tried exec even execvm) Getting generic error in expression. Pls Help? Waituntil doing It. Dont know why.
tried exec even execvm exec doesn't make sense as this is SQF not SQS
Tried also 5 sec sleep for sure
you are getting more than "Generic error in expression" please post the full error
@lucid junco You can find the full error in your Arma log file (.rpt file)
Search the file for the error you're getting, then post that section of the file here
Will do, when Ill be Back home
π
[5,4,20] that position is probably on the edge of the map
looks like 20 meters above the edge, probably good view there... π
Just examples, im on phone And Dont remember position π
Ah so.. You probably have some typo in your code
and instead of showing it to us you just write up something that looks similar?
we won't find your problem with that
Lol
Wait we can add reactions now?
there is no reason to get "upgraded" to veteran anymore π€·
Other than blue being a better color than white
I thought Veteran was just to indicate longtime members/contributors and not really about any extra powers
extra powers are image embeds and reactions
because you don't want people with these abilities that you don't trust ^^
yeah recently added
Don't get upgraded to me. I don't recommend. π
if it was about longtime members then other here would be marked as vets too
It's more "people that are attract positive attention regularly" rather than "longtime members"
Looks at Lou and his lack of blue
Immediately after initializing the unit, isPlayer returns false, but the next frame return true. In what other cases does it return false, pls help?
except check is player he
isPlayer returns false as long as a unit is not a player
Okay, I'm wondering when a unit is not a player. I know that after the initiation, one frame is not a player, even if the player connected. Are there any other nuances?
There are plenty of other quirks you just have to remember
And unit is created on the server then control is passed to client so this could explain delay
If you attach local EH to the unit you can watch the show in your logs
Optimization challenge. Replace every " character with a ' character
Like turn a
["val","val"] string into ['val','val']
Original function to make better
_array = [_this,0,[],[[]]] call BIS_fnc_param;
_array = str _array;
_array = toArray(_array);
for "_i" from 0 to (count _array)-1 do {
_sel = _array select _i;
if (!(_i isEqualTo 0) && !(_i isEqualTo ((count _array)-1))) then {
if (_sel isEqualTo 34) then {
_array set[_i,96];
};
};
};
str(toString(_array));
why would anybody want to do that?
Python?
oohh ... now ... not `
yes. Discord can't print. It's for database inserts
input is array. It's supposed to be transferred to database. I don't know why they are doing it like that. Not the task right now ^^
here is my idea
str toString ((toArray str _array) apply {[_x, 96] select (_x isEqualTo 34)})
Don't even know if that works.
old; 3.3966ms
new: 1.1325ms
or you cant
right now ... because tostring seems to be broken in sqf-vm π
π¦
/rip
fixing it already π€·
That's how good life framework is. a guy can just write a new script in like 20 seconds. and it'll be 3x faster and a one liner instead of the old 26 line script
I was missing parenthesis
and fucked up the select ... unless i fucked up the select π€ wait a minute
wasn't there a command to increase moon brightness?
nope, was me who fucked up the select
"[``var1``, ``var2``]"
is the output ... which still does not looks correct .. ohh
i see why
_array = str ["var1", "var2"];
_str = str tostring ((toArray str _array) apply {[_x, 96] select (_x isEqualTo 34)});
diag_log _str```
correct for that code*
but you added some str in there
already
"[`var1`, `var2`]"```
if that is taken into account, it works perfectly
Life stuff man... https://github.com/AsYetUntitled/Framework/pull/468/files π€¦
π€·
why you actually start wokring on that?
Because helping a life server getting rid of their constant like.. 2fps and desync
rewrite the whole thing
no other way
fuck sake ... maybe i rly should start creating my life framework
but i cannot even get myself to continue writing that XMedSys rewrite to completion i started in february ...
str array splitString '"' joinString "'" ?
hah
nice idea
that actually --could-- should be WAY faster
That is WAY faster
arma really lacks some "replaceString" method ...
something like:
"input" replaceString ["strToFind", "strToReplaceWith"]```
anyone here bored and has c++ skills?
need somebody to do some fairly repetitive implementations ...
in sqf-vm
You have to be careful with those string commands if you have Unicode
Yeah, splitString/joinString can be screwy if the inputs aren't "normal" characters
Ah @tough abyss sadly doesn't work completly
Input ["","","",""] Original output """['','','','']"""
Your output """[',',',']"""
My output: """['','','','']"""
Going for the easiest solution right now
would not solve this at all on clientside ...
pass the str in callextension
youre done
thank me later
MySQL has the whole own language with bells and whistles, you are most likely be able to do parsing and conversion in it with added benefit of removing this load from sqf
that's all serverside code
@queen cargo about the replace thing, isn't there a BIS_fnc something that does it?
maybe
but i mean a proper operator to do that
and no, my bad. Just checked https://community.bistudio.com/wiki/Category:Function_Group:_Strings
@halcyon crypt no but you can pick up a night with full moon
yeah, I was mid mission and vaguely remembered something about a command being able to set moon intensity or something π
thanks though
or use setAperture(New) ^^
Well, std::strtok has the same problem splitting string when same delimiter is immediately following the previous one, so it would make sense splitString fails in the same way.
Mhh.. Weird
setAperture would make every light source brighter, though you could make some really nice looking night scenes
Stars the size of a silver dollar!
it's more of a workaround for the gamma thing in the settings
it appears to be quite weird on the Linux client port
makes everything look like it's something from the 8-bit era
in terms of color π
IIRC it behaves differently on Windows
Anyone knows how to get wheel selections on a vehicle ? Like when using ACE and "dismounting" wheels (meaning full damaging and spawning a wheel object on the ground) ?
I can't get it through ACE's code...
(plus, I don't exactly know what to search for)
I posted this in troubleshoting but I figured I would ask here as well; sorry for duplication. "Hi guys I've been experiencing a very weird issue with scripting I was hoping someone could help me with. Here are some details: https://www.reddit.com/r/armadev/comments/98b2vf/ai_helicopter_waypoint_breaking_while_ejecting/ "
oi folks. questiontyme. anyone can tell me if the info panel function of the mine detector is hardcoded or in scripts?
i can't find shit about it
or sensors in general
@west grove hard coded in the sense that it's a config thing
Afaik
For sensors, Google "Arma 3 sensors config reference"
Or just "Arma 3 sensors wiki"
but what tells e.g. the mine detector to detect mines
or the sensors to detect missiles or vehicles
or where is it defined that having the mine detector in your inventory will make the mine detector info panel available
Any idea of what is GETMVAR is some scripts ?
oh it's a macro... Sorry, I'm a bit tired --'
got another question.. i'm in a uav and want to force switch the vision mode... anyone has any hints?
i can check the current vision mode with currentVisionMode, but i have no idea how to set another vision mode
there is setCamUseTI, but as far as i can see, this is only for normal cameras
is there a way to play a sound in 3D and being able to interrupt it ? Like by deleting the sound source or so ?
if i remember right, i've used a game logic to play sound in 3d. after deleting the game logic, the sound stopped.
this is how i faked my early radio stuff
oh yes indeed, it is written in doc --' RTFM, as usual...
it looks like setHitPointDamage is not recognized... Not highlighted by the syntax coloration, and a "Generic error in expression" spawning at runtime. Any idea ?
There is no syntax coloration in Arma
@tough abyss I was unclear, syntax coloration extension for VSCode. Usually pretty up to date, but some commands are sometimes missing.
@still forum I am using the wiki, of course ^^ The only limitation I see here is the fact that given vehicle has to be local, and in my case it is. So I wonder what is this Generic error thing. I know sometimes I ask a bit to fast, but this is not this type of situation.
Having the full error helps more than "i have an error"
Yes. Not everything is always constantly up to date
That is command from ToH, so I wouldnβt exactly call it up to date
Arma always says
Generic Error in Expression:
<Here is where it went wrong>
<in this file and this line>
<This is the exact error that happened>
So you are literally only giving us the only part of the error message that's completly useless
Because there is literrally no other info in the script error.
_target |#|setHitPointDamage [_hitpoint, 0.1];
Generic error in expression
File blahblah\fn_doUseAps.sqf [LM_fnc_doUseAps], line 24
That's it. _target is defined and local. _hitpoint is defined and valid. The rest of the file is letterally empty (nearly 30 lines but commented things for later). That's why I'm lost.
Weird π€π€
What is the content of _target?
is target defined, is it an object, is hitpoint defined, is it a string of a valid hit point class?
Mhh... If sqf-vm would have more contributors, one could tun the code though it to get a proper Result
no you couldn't
That still wouldn't tell you what he's passing into _target
If we see that he's passing a string or smth then we already know what's going wrong. sqf-vm wouldn't help with that
did he log/systemchat the used local vars yet?
Do you see any message since we asked for the contents?
anyways. i got a weird issue. i'm trying to get valid (actually on surface) house positions. but this one house is acting weird and i'm sure there will be others.
classname: "Land_i_House_Big_01_b_blue_F"
code to test:
["bla", "oneachframe",
{
params ["_arrow"];
_inspos = [0,0,0];
_ins = lineIntersectsSurfaces
[
AGLToASL positionCameraToWorld [0,0,0],
AGLToASL positionCameraToWorld [0,0,5],
_arrow,
player,
true,
1,
"VIEW",
"NONE"
];
if !(_ins isEqualTo []) then
{
_inspos = _ins select 0 select 0
};
_arrow setPosASL _inspos;
}, ["Sign_Arrow_F" createVehicle [0,0,0]]] call BIS_fnc_addstackedEventhandler
i haven't tried all lod combinations yet but every lod i used with "NONE" gives me sunken in positions at the bottom floor. makes not sense
why not use building positions
and did you check if AGLToASL returns what you expect it should?
did you try using drawLine3D to check where the intersection is actually checked?
the input positions are from KK's wiki example
you mean drawline3d between those two positions yea?
yeah
k. one sec
Yep I systemChated both _target (which is an <OBJECT>, Badger IFV, properly passed to the function) and _hitpoint (which is a wheel hitpoint <STRING> depending on which wheel the action is performed. And it's the hitpoint name, not the selection name).
There is nothing more in the error message. If you guys have any further doubt about it I can post a screenshot somewhere and give you the link, but you'll not find anything else. Appart from the fact that it's in French such as my game is in this language. I simply translated it quickly.
If it returns <OBJECT> to you then it's wrong
The RPT log might print better error messages than the onscreen ones. Not sure
yea the line goes straight for the target. it works great on most positions on most buildings. it's very odd.
Ah, good catch. The RPT is stating Error sethitpointdamage: Type Tableau, Objet attendu, which means _target is considered as an array instead of an object. That is strange. But at least we know what the problem is. However when I do systemChat str _target it is trully an object. Gonna dig around this. Thanks for the tip, I never think about RPT since usually on-screen errors are pretty self-explanatory.
it is trully an object is it?
is it object or [object] ?
you probably forgot to take it out of _this properly?
yeah, object. I'm totally dumb, it's official now... I doubled "arrayed" the parameter in the function call, which makes absolutely no sense. Apologies for the linked chatter this evening --'
Whatβs doubled arrayed?
the parameter in the function call <--
[[object]]?
He was trying to do the equivalent to this: ```sqf
[[player]] call {_this setPos [0,0,0];}; //Generic Error in Expression: Type Array expected Object
But he said systemchat showed object not [object] or [[object]]
_this setPos [0,0,0] need check that place, lot of guys traveling there, probably some easter eggs, can't be just "good view"... π
aaand another mission in the missile tube⦠when will it end?
Soon β’
when you
switchplayer to another unit in multiplayer
and enableAI teamswitch to the last unit
do that AI become local to the player or the server?
can you remoteexec a setowner to make the last unit become local to the server?
like
if _man is the last unit from you where you switched from
onTeamSwitch {_man enableAI "TEAMSWITCH"; [_man,2] remoteExec ["setOwner",2]};
you you can change locality using setowner
but if that AI is not the teamleader it won't do anything
And I don't know if switchplayer transfers the unit. It should tho
im using a script that makes you switchplayer to other groups in am ultiplayer environment
thing is that after a while you have been switching through all group leaders so all AI become local to you and it becomes a little laggy in the fps side
i will try to test it in a dedicated server if setowner works with the eventhandler
maybe you can try just create group on the server side and join them instead of setOwner π€
Anyone have insight into the problem that I posted long ago here?
Trying to create a squad paradropping out of a helicopter but the AI manning the helicopter stops following waypoints upon ejection.
Seems as though it defeats the point of waypoints if I need to manually move the helicopter if I do something to the cargo of the vehicle midway through the route. Has anyone experienced this issue?
It seems like an AI bug to be honest, and I want someone's opinion on if this is a bug or if I am missing something. I've checked every property that I know of that could be linking the cargo (soldiers) that I'm ejecting and the vehicle, there doesn't seem to be any relation that would cause the AI heli crew to ignore waypoints (that exist, I checked). Even manually setting their waypoint to the next one does not relieve the issue.
im using custom chat commands. is it possible to capture who typed the command? to get their player object?
so i used this in the end
onTeamSwitch {_from enableAI "TEAMSWITCH"; _group = group _from; [_group,2] remoteExec ["setGroupOwner",2];};
it worked fine i think, i had a performance increase so i think it worked, couldn't test it deeply though, had too much fun while playing
I have a mission where I spawn a random number of weed plants that the players have to burn. At the location it can be 3, 6 or 8 plants.
Problem I'm having is that I'm using this at the end of the script to wait until all plants are destroyed and then succeed the mission
waitUntil {
!alive plant1 && !alive plant2 && !alive plant3 && !alive plant4 && !alive plant5 && !alive plant6 && !alive plant7 && !alive plant8;
};
Problem is if only 3 spawn the script errors when it comes to plant4. I know I'm missing something simple but I thought !alive plant4 would be still fine if plant4 was never spawned?
can you show the rest of your script?
I can but it's a complete disaster. I can't code for shit so it's going to be all over the place and horribly inefficient
well i have an idea how to solve your issue but it depends a bit on you code above that because you basically want to tie into the amount of plants you spawn, and then you want to check if the plants you spawned still exist. You want to avoid to check plants that you never even spawned in the first place
You were warned π
Well my first approach would have been to store the amount of plants i spawn, and then just check on those with a likely custom while loop with like a sleep 3 in it. You could also just replicate your switch structure from above and use a bunch of different waituntil loops.
You could also try some if (!isNil plant9001) then {}; madness.
I tried using another switch block but for some reason it still shit the bed.
I was even tempted to spawn 8 plants every time and then just delete excess for the smaller locations π
first thing i would do, i would cut out all the duplicate code
use arrays
you can just push markers into an array, and then use foreach loop to cycle thru all of the markers and spawn a plant on it, add ace interaction, etc.
Yeah I'm super bad at that because of my limited knowledge,
then you can re-use that array and cycle thru it again to check if the plants are dead
Ok thanks, maybe starting from scratch with what I've already learned is the best course of action
While I've got you is there any "isInside" type command I'm missing. Another side mission i was working on has an HVT move into a random building location, however on the Aliabad map there's a ton of "buildings" that are just rubble and it doesn't make much sense to have them spawn there
Not that i know off. There is 3 things you can use.
https://community.bistudio.com/wiki/BIS_fnc_findSafePos
https://community.bistudio.com/wiki/isFlatEmpty
https://community.bistudio.com/wiki/intersect (You might need multiple, can get out of hand. https://i.imgur.com/rv7od0w.jpg )
Ok I've been using the following (again probably a disaster)
//Get all town locations on the map and pick a random one
_towns = nearestLocations [getPosATL player, ["NameVillage"], 25000];
_RandomTownPosition = position (_towns select (floor (random (count _towns))));
//optional also for more randomization:
_posX = (_RandomTownPosition select 0) + (random 200) - (random 200);
_posY = (_RandomTownPosition select 1) + (random 200) - (random 200);
_MoreRandomTownPosition = [_posX,_posY,0];
//Spawn HVT
_groupHVT = creategroup east;
"CFP_O_TBAN_Rifleman_AK_47_01" createUnit [_MoreRandomTownPosition,_groupHVT,"HVT = this;"];
//Move HVT into a random position in the nearest building
_allpositions = nearestBuilding HVT buildingPos -1;
_hvtPos = selectRandom _allpositions;
HVT setPosATL (_hvtPos);
For the most part it works perfectly, it's just when that random position happens to be near a destroyed building
seems much more reasonable to me than the last one π
oh you mean your AI is then standing inside a wrecked building?
Yeah
Like all the walls are down, it's just rubble and my guys standing there like an idiot
π€ All destroyed buildings should have some "ruins" or something in the classname. You could detect that with some string magic, and then just skip that building.
I know you can use intersect to see if there's a roof over your head, but that's as far as I got
you're always just moving them into one building, right?
oh it seems it's just one guy?
Yeah it's an HVT and then I spawn a squad with a CBA defend command nearby
private _good_houses =[];
private _houses = HVT nearObjects ["House", 100];
{
if ((((typeOf _x) find "ruins_F") == -1)) then
{
_good_houses pushBack _x
}
} forEach _houses;
_allpositions = _good_houses selectRandom HVT buildingPos -1;
_hvtPos = selectRandom _allpositions;
HVT setPosATL (_hvtPos);
How about that
I found something on the forums that I was just testing
//Move HVT into a random position in the nearest building
_allpositions = nearestBuilding HVT buildingPos -1;
_hvtPos = selectRandom ((_allpositions) select {lineIntersects [AGLToASL _x, (AGLToASL _x) vectorAdd [0,0,10]]});
HVT setPosATL (_hvtPos);
yeah but you need more than just one position. You basically pick a building with nearestBuilding (which is always just 1, the nearest) and then you check it. What if it is bad? You need to make a list of buildings first, and then pick a good one from that list.
Oh and you probably want some contingency in case there is no building close.
Since I started testing that code I posted it seems to work fine, the only time he spawned in ruins he was actually under a tree so that would have counted as an intersect. Of course I get what you're saying and it could just be dumb luck so far
And the dumb luck ran out π
π€ If i do not missunderstand anything (which is possible, still no morning β yet) you're picking a building, and then checking, and you do not pick a different building after your check. The bit of code i posted generates a list of all buildings in 100m radius, then sorts out any ruins, and then picks a random one from that.
Yeah I'll try and incorporate your code with my disaster piece π
Eh most people need quite a while to get into scripting, lots of shit to learn.
is there a missing semi colon after
{
_good_houses pushBack _x
}```
nope
if you have just one line inside {} you don't need it
{
systemchat "hello"
};
{
systemchat "hello";
systemchat "you too"
};
well, one statement.
somethings not working, hang on I need to check the rpt
i used "getpos player" in my testing instead of HVT. I've assumed HVT contains similar position
not sure if scripting but:
in initServer.sqf I have [] execVM "create\aTrigger.sqf"; and in aTrigger.sqf I have
_trg setTriggerArea [10, 10, 0, false];
_trg setTriggerActivation ["WEST", "PRESENT", false];
_trg setTriggerStatements ["this", "hint 'Hello there'", ""];```
Now when I go and thest the hint isn't being output. Locality issue or uh what else if not?
The effect of this command is local, i.e. the hint will only show on the computer command was executed.
so in this case server
SP this will work fine.
it indeed did
MP needs local effects to be executed on all clients
see Jcd's link.
"Hello blaaaaah" remoteExec["hint",0];
be wary of your target
@waxen tide I must have screwed something up because it just spawns the HVT, doesn't move him or do anything else further in the script
I was trying to aim at enabling simulation for another (editor placed) trigger but couldn't advance since I couldn't get past testing with hint. So taking this a bit further, why this doesn't work then:
_trg setTriggerArea [10, 10, 0, false];
_trg setTriggerActivation ["WEST", "PRESENT", false];
_trg setTriggerStatements ["this", "editorTrigger enableSimulation true", ""];```
(fyi *editorTrigger* is the name of the editor placed trigger)
https://community.bistudio.com/wiki/enableSimulation ,
global args, local effects. Same locality problem
_hvtPos = selectRandom _allpositions;
systemchat format ["%1", _hvtPos];
what's the output of that?
(add the bottom line below the top line)
Just ran it from the console and it says any
well you need the rest of your script to run for that variable to contain anything useful
any means it's undefined.
I mean I ran the script and once the HVT spawned I ran the code you posted from the console
I'll add it into the script
whenever something doesn't work, i check the contents of all my variables. this takes care of 95% of all debugging, because you'll find a var that doesn't contain what you expected it contains.
I get the following error since I added the building check code you posted
https://imgur.com/a/4CvghZi
Midnight, ahh yes indeed. Hadn't even come to think that enableSimulation does also have locality "options". I went to check the Biki page you provided and found that there's also enableSimulationGlobal. Aand using that enables the editor placed trigger ππ»
That's because i'm an idiot.
wrong
_good_houses selectRandom
less wrong
selectRandom _good_houses
Yep, global variants are nice. Forgot about it otherwise I would've linked that as well. Best of luck.
@forest ore Might wanna bookmark
https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3
https://community.bistudio.com/wiki/Category:Arma_3:_Functions
Still can't get it to work, I replaced
_allpositions = nearestBuilding HVT buildingPos -1;
_hvtPos = selectRandom _allpositions;
with
private _good_houses =[];
private _houses = HVT nearObjects ["House", 200];
{
if ((((typeOf _x) find "ruins_F") == -1)) then
{
_good_houses pushBack _x
}
} forEach _houses;
_allpositions = selectRandom _good_houses HVT buildingPos -1;
_hvtPos = selectRandom _allpositions;
And now instead of spawning the HVT moving him to a building pos and carrying on with the rest of the script I just get a single unit not even in a building and the next line in the script which changes his weapon isn't even happening
well add some debug and check your log
private _good_houses =[];
private _houses = HVT nearObjects ["House", 200];
diag_log format ["_houses: %1", _houses];
{
if ((((typeOf _x) find "ruins_F") == -1)) then
{
_good_houses pushBack _x
}
} forEach _houses;
diag_log format ["_good_houses: %1", _good_houses];
_allpositions = selectRandom _good_houses HVT buildingPos -1;
diag_log format ["_allpositions: %1", _allpositions];
_hvtPos = selectRandom _allpositions;
diag_log format ["_hvtPos: %1", _hvtPos];
@leaden summit ```sqf
_allpositions = selectRandom _good_houses HVT buildingPos -1;
add parenthesis
Where exactly?
Will your life server include drinkable coffee Nigel?
πΊ
π
_allpositions = selectRandom _good_houses HVT buildingPos -1;
isn't this a downright error?
buildingPos takes an object not an array
Yeah, missing parentheses
buildingPos takes object iirc.
spits out an array
-1 indicates all positions, whereas any positive number indicates index.
I would imagine it still tries to index the positions as it's still an object
Yeah I originally had
_allpositions = nearestBuilding HVT buildingPos -1;
_hvtPos = selectRandom _allpositions;
HVT setPosATL (_hvtPos);
and that worked fine, it just also places the HVT in rubble
The changes jcd proposed were to help make sure he only gets placed in an actual building
What do you want to do?
You mean one that is not damaged? I guess you could after setting the position loop to detect the intersecting areas and move up until you become safely above
Put hvt in a random house?
Yeah but the aliabad map has things that look like https://imgur.com/a/aPRFZPc which count as buildings
_allpositions = (selectRandom _good_houses) buildingPos -1;
wat. HVT is not a building.
π€ π©
Unless I am missing something here? Your left parameter is HVT to buildingPls
_allpositions = (selectRandom _good_houses) buildingPos -1;
π
Hey that works better π
I didn't have any HVT! So i couldn't test properly!
oneliner
makes up elaborate excuses
π·
πΏ
private _buildings = (HVT nearObjects ["Building", 100]) apply {_x buildingPos -1} select {count _x > 0};
private _posList = selectRandom _buildings; //--- array with gud positions
```maybe this way ^ π
Wait a sec. Why not just evaluate _x buildingPos -1 in select?
Because you're essentially doing the same thing?
// place a bunch of HVTs in 3den (ten_hvt_1 - ten_hvt_100)
private _allHVTs = [];
for '_i' from 1 to 100 do {
private _unit = missionNamespace getVariable [('ten_hvt_'+ str _i),objNull];
if (!isNull _unit) then {
_allHVTs pushBack _unit;
};
};
private _hvt = selectRandom _allHVTs;
missionNamespace setVariable ['ten_hvt',_hvt,true];
// 2nd way
// target for nearObjects(can be positon array)
private _target = ten_hvt;
private _unit = ten_hvt;
private _allPos = [];
private _nil = {
private _house = _x;
if (((toLower(typeOf _house)) find 'ruin') == -1) then {
_allPos append (_house buildingPos -1);
};
} count (_target nearObjects ['House',300]);
_unit setPosATL (selectRandom _allPos);
not in the literal sense of my words
You can just place a bunch of HVT options in 3den
and select a random one
That's what I usually do because random house pos can be too random
just a question, can a case have multiple arguments like case ("x" || "y"): or case (_a and _b):?
Because it wouldn't make sense to ahve a HVT on balcony
This guy's a warlord with a golden AK. He ain't hiding π
If I was a HVT I would be enjoying the sun for sure
oh btw if that hvt thingy universal for any kind of locations, you maybe need filter bridges too... π€
But still I'd manually place them unless this is a mission where the task is randomly generated (like invade and annex)
@long hatch No, I do not think so. I believe you could make a second condition inside the case condition inside switch do control structure
@long hatch assuming _a and _b are Booleans, yes. The other one doesnβt make sense
Although I was going to use the same basic script for a prisoner HVT as well, so he might not want to be standing on the roof of a mudhut
Yeah
placing things in editor? EWWWW this is #arma3_scripting apply yourself.
Just place like a bunch in 3den and select a random one and then delte the rest
Yeah these are side missions for an ALiVE mission I'm putting together
@meager heart Do bridges have buldingPos defintions though? Wouldn't it filter out on it's own?
@high marsh yes, they have positions, some of them
If you want ai to walk on a object you generally need a buildingPos
Why? It doesn't make any sense as to why you would need them
And after all that they're still spawning in the rubble π¦
I thought bridges were treated as roads for AI?
hmm
If you give it "House" it won't find bridges. Or powerlines. Or whatever.
https://imgur.com/a/aPRFZPc is still a house
Oh and you could just do like a count on buildingPos to check if its a good building/house.
yeah well ofc that's why i proposed checking for the "ruin" string in the house classname.
They still spawn there though
vanilla ruins have ruins_F at the end of the string
well, with the diag_log commands i pasted all over the script, your *.rpt log should have a bunch of useful info to check on the classnames of those houses.
I'm guessing aliabad doesn't adhere to those rules
"rules" ? No, this is probably just for naming convention purposes. I doubt though they used a different type for ruins. You could always check in the config viewer
Hmm. Interesting.
so... need filter for both ^
https://pastebin.com/76Rz0mEg
That's from the rpt file
And this time the HVT spawned in the middle of nowhere
is this with the most recent fixed _allpositions = line?
Yup
private _good_houses =[];
private _houses = HVT nearObjects ["House", 200];
{
if ((((typeOf _x) find "ruins_F") == -1)) then
{
_good_houses pushBack _x
}
} forEach _houses;
private _house = selectRandom _good_houses;
diag_log format ["_house: %1", _house];
private _allpositions = (selectRandom _good_houses) buildingPos -1;
diag_log format ["_allpositions: %1", _allpositions];
_hvtPos = selectRandom _allpositions;
diag_log format ["_hvtPos: %1", _hvtPos];
I think i know already what the issue is. The selected house has no buildingPos.
but try this and check RPT
Worked the first time, but not the second. Also it gives me errors about the log after the first attempt
Here's the abortion of a script (this should come with a trigger warning for those of you who actually know how to code)
https://pastebin.com/BzQUW8dc
private _good_houses =[];
private _houses = HVT nearObjects ["House", 200];
{
if ((((typeOf _x) find "ruins_F") == -1) && (count (_x buildingPos -1) > 0)) then
{
_good_houses pushBack _x
}
} forEach _houses;
private _house = selectRandom _good_houses;
private _allpositions = (selectRandom _good_houses) buildingPos -1;
_hvtPos = selectRandom _allpositions;
try that.
So far so good
isn't the ruins check still broken
I'm not getting any errors and so far no ruins (again could be dumb luck)
I think when I adjust this for a prisoner HVT I might just limit it to building position 2 because I think that's always going to be indoors
80% sure it's dumb luck.
It is when you're as dumb as I am π€
well i once wrote a quite ... extensive script to check if a position is actually properly indoors
I remember seeing something by Killzone Kid which used intersects etc but last time I thought about it I had even less of an idea what I was doing than I do now
π―
Right that seems to be working great, thank you for your time and help.
Now to go back and readdress my "burn the weed crop" script π
I can send you that rubbish, it's old stuff i haven't touched in a while with some rough edges but it works and i had some help from here to optimise the performance a bit so it's plenty quick (especially if you just check one house)
I can tell you now I'd just be completely lost π
Eh whenever you want to come back to it, just poke me.
My idea was to set up ambushes with AI player can't see, i guess your idea is similar
Thanks, appreciate your help π
I want to get a VLS launcher to switch to Cluster missiles instantly so I can fire it. Best I can thinkof is use loadMagazine, which tells the VLS to load the cluster missiles, but only at the standard-long-as-all-hell reload speed. setWeaponReloadingTime doesn't affect it.
@sonic cradle delete all weaps and mags from the object, then add the mags first then next the weapon. should be instantly loaded.
@lusty canyon it loads, but not instantly. It's ready to fire after about 10 seconds.
you mean load different ammo type ?
if yes, there was action "SwitchMagazine/SwitchWeapon" iirc
oh also loadMagazine π€
https://community.bistudio.com/wiki/attachedObjects
Does this command works localy on a client if a object is created from the server?
I don't know any reason why it would be local only
I have a felling that does not work if the attached object or the object that is reciving attachings is created from the server
how about you just try it out?
also fix your english.. It's a chore to always have to read your messages 3 times
english machine broke
https://community.bistudio.com/wiki/getObjectTextures
This command returns nothing on simple objects but works on objects with simulation disabled.
Can some one put a note in it?
it should work on simple objects created through vehicle config name if it has hidden selections
It was a offroad placed on editor with the" Simple Object" check mark selected
is there a property that can identify if a weapon is pylon compatible? i want an array of weap classnames that can be placed ina pylon slot. (im assuming any weap can be placed in a pylon but there will be no model?)
nvm my AOA was wrong, gotta use getCompatiblePylonMagazines
So I've ran into this problem across two gamemodes, what would cause an interface button (Deploy, in both cases) to slowly develop crippling delays after 30m-3h playtime? It's clientside to my knowledge, and the client can work around this by simply backing out to lobby and back in, assuming JIP code is up to snuff. It's gotta be a scheduled/unscheduled menu problem. That, or some sort of underlying issue in code time.
Server and HC run 49-50FPS, and no other menu has the delay.
Maybe vars or something?
sounds like scheduled scripts
Sounds like liberation, it's caused by permament unscheduledscheduled loops.
scheduled*
Become a SQF specialist and help with the liberation rewrite
π
Liberation isn't the only scenario with this issue though. What I can't figure out, is it only seems to affect the deploy action.
You'd think the entire gamemode would slowly take a crap. (Which from what I hear, it does, but only after 3+ hours on the server, even though I've ran for a day+ with minimal issues)
I'm not proficient with SQF, but I don't see much outside of waitUntil being used for weird things, relating to deploy. I also don't know if it's the UI or the actual deploy action.
Hello, Having an issue with localisation of hints.
This based around a trigger: (screenshot)
https://gyazo.com/7ae4c31b8cd48debf3ff468f799e6253
Trigger Setup: (screenshot)
https://gyazo.com/100ce935cd7396bb49c269180fbd7a73
Here's the code in allowed.sqf :
_thisListTrig = (_this select 0);
{
uid = getPlayerUID _x;
} forEach _thisListTrig;
if (hasInterface) then {
if !(uid in commandOpsAllowed) then {
player setPos "commandOpsMarkerDoor";
hint format["Unauthorised Access by: %1 - You do not have permission to enter the Command Ops",player];
} else {
hint format["Welcome to Command Ops %1",name player];
};
};```
Okey and your question is?
And why is the trigger relevant?
The result is a hint for everyone in the mission. The expected result is a hint for only the person inside the trigger.
I tried to use hasInterface without any success.
player setPos "commandOpsMarkerDoor"; what's that supposed to be?
setPos doesn't take a string. This doesn't make any sense
The string is a marker.
params ["_thisListTrig"];
if !(player in _thisListTrig) exitWith {};
if !((getPlayerUID player) in commandOpsAllowed) then {
player setPos (getMarkerPos "commandOpsMarkerDoor");
hint format["Unauthorised Access by: %1 - You do not have permission to enter the Command Ops", name player];
} else {
hint format["Welcome to Command Ops %1",name player];
};
Ah
Sweet
Issue still persists.
I went into the area. And other players reported having the hint, without being in the area.
I already did that
if !(player in _thisListTrig) exitWith {}; this exits the script if the player is not inside the trigger
Right.
causing the hint to never be displayed
Yeah, I get that. Let me check and come back
So. The script works only for a person inside the area. The hint doesn't show for people outside. The hint doesn't show, for the x person if someone is already inside, if someone enters, the hint is only shown on the first person who entered.
yeah the hint shows again if someone else enters.
Don't know what the rest is supposed to mean. The code atleast doesn't do anything else
yeah the hint shows again if someone else enters. ... but only for the person who originally entered, NOT for the person who entered "second".
the code doesn't make any difference between first and second.. soooo.. dunno
is there a single config parameter that identifies a backpack as not being a normal backpack but having dismantled weapons or a respawn tents or other shenanigans in it?
@still forum here's a gif: https://gyazo.com/64500026d6f97622fa6caa31556082c8
I don't see anything from that gif
seems like everything is working like it's supposed to. The hint isn't showing for outsiders
hi guys. Im trying to get ammocount from autocannon_40mm_CTWS.
this script works for many other weapons, but for the autocannon_40mm_CTWS it gives me 0.
_weapon = _v currentWeaponTurret [0];
_ammoPos = _v ammo _weapon;
can someone explain why it works with some weapons only?
it works great with Gatling_30mm_Plane_CAS_01_F for example
I tried dumping the value from _v currentWeaponTurret [0]; and it is giving me the correct weapon name
Yes, but notice that Troy the person who is being moved is allowed entrance when ViBro enters first.
Ahh
Yes
No.. Actually not. The script handles that correctly
as long as thisList is correct
oi. got a weird question again. i'm trying to spawn leaflets via script, but can't figure out how to do it. anyone got any clues?
maybe with drop?
There is a leaflet bomb.. But I don't know how you'd detonate that in air
setDamage?
https://community.bistudio.com/wiki/Arma_3_Leaflets Doesn't really help tho
Well why not?
_dudeDrone = "BlahDroneClassBlah" createVehicle blahPosition;
_dudeDrone addMagazine "1Rnd_Leaflets_Custom_01_F";
_dudeDrone addWeapon "Bomb_Leaflets";
_dudeDrone fire "Bomb_Leaflets";
but that's just spawning a new drone
i mean, yeah, it works, but i was wondering if you can skip that part
and firing leaflets
For me that wouldn't really be an option if I just want some leaflets. Don't know another way tho
i guess best way would be a custom particle effect, because at its core i just want some papers flying around
shouldn't even need custom. I guess Arma already has such a particle effect for the leaflets
once more a good example of why it would be good to have a filter function in the config browser. ugh.
or a pdrive ^^
searching through stuff on p takes ages
unless you know exactly in which sub folder you have to look
Not for me.. Looking through a list of files is quite fast on windows π€
bis_fnc_initLeaflet
_leafletsParams = "Leaflets" call bis_fnc_getCloudletParams;
if (count _leafletsParams > 0) then {
//--- Assign script
private _leafletClass = gettext (configfile >> "CfgMagazines" >> _magazine >> "leafletClass");
private _leafletScript = gettext (configfile >> "CfgLeaflets" >> ("script" + _leafletClass));
if (_leafletScript == "") exitwith {["Script not defined for leaflet %1",_leafletClass] call bis_fnc_error;};
(_leafletsParams select 0) set [17,_leafletScript];
//--- Use custom model
private _cfg = [["CfgLeaflets",_leafletClass],configfile >> "CfgLeaflets" >> "Default"] call bis_fnc_loadClass;
if (istext (_cfg >> "model")) then {(_leafletsParams select 0 select 0) set [0,gettext (_cfg >> "model")];};
//--- Create particle source
_leaflets = "#particlesource" createVehicleLocal position _obj;
_leaflets setParticleParams (_leafletsParams select 0);
_leaflets setParticleRandom (_leafletsParams select 1);
_leaflets setDropInterval (_leafletsParams select 2);
_leaflets attachto [_obj,[0,0,0],"leaflet_spawn"];
};
there. Particles on the bottom. And on the top how you can get the params
_source = "#particlesource" createVehicleLocal (getPos player);
_source setParticleClass "Leaflets";
spawns a crapton of papers π
@polar folio try isKindOf "Weapon_Bag_Base"
@tough abyss already answered. It was just a dumb cross-post
@tough abyss found the answer. but thx
isnull(configfile >> "CfgVehicles" >> _backpackclass >> "assembleInfo")
@still forum i answered it myself...you need to relax
Just checked config thread, naughty naughty
the weapon_base thing doesn't apply to those respawn backpacks
Probably not but those could well have own subclass
sure. just letting you know
anyone knows why a code called with spawn inside a ButtonSetAction throws an error in a sleep and having the same code outside and being calles with [] spawn fnc_test is working?
how do you call it exactly?
"call" and "spawn" are two different things. so "called with spawn"...?
no problem its working now thanks β€
(β©ο½-Β΄)βββοΎ.*ο½₯qοΎ
"called with spawn" probably just means "spawned" π
My thought was things like call {sleep 5; [] spawn {code}} Β―_(γ)_/Β―
it's just a reflex from other programming languages, really π
i invariably end up saying "called the script with execVM" because the other option is saying "execVM-ed" which feels weird
but then i catch myself and correct it
haha
"spawned a script"
"called a script"
but yeah execVM is weird. But spawn==spawn compile preProcessFileLineNumbers==execVM
And the difference is only important if script is not getting executed at all where it's probably a typo in the filepath
execute/executed/executes script * π€ x3
what would be more cpu intensive
to check every 20 seconds if there is a tank near through nearentities at 100 meters
or checking if in neartargets there is a tank
Im looking for an experienced Arma Developer to hire. Someone who has been coding in Arma since at least Arma 2.
This individual must be 18 or over.
This individual must live in the Eastern Standard Time Zone.
This individual must be a citizen of the United States. This is only for tax reasons.
This individual must have a PayPal account.
Please forward this to anyone you know that meets the criteria. Please PM me, my discord name is LifeSnatcher, or email me at lifesnatcher1@gmail.com
@exotic tinsel wrong channel, post it in #creators_recruiting and not here
@inner swallow rgr that
thanks
you're looking for someone who's been coding since Arma 2. To what benefit?
the benefit of wrinting old coded unefficient scripts? :p
I guess
That recruitment ad, I wonder if they have healthcare plan
It's a job in the US, of course it doesn't have a healthplan.
what'd be the fastest way to place loads of objects dynamically?
dynamically in the sense that they're not defined in the mission file
is there no better way than createVehicle or createSimpleObject?
Hey you guys, I'm having an issue with one of my sqf scripts. I'm basically trying to assign a MissionNameSpace object name to a local Object variable:
//Get a whole-number for my 23 random objects
_introNumber = floor random(23);
//String for the object's in-editor name
_landingStr = (str (format["OpS%1", _introNumber]));
_landingZone = missionNamespace getVariable ("" + _landingStr);
It seems that using a variable-name doesn't seem to work. Say it selects "20" as the number and it gets "OpS20" as the string name, it doesn't find the object in the mission π¦
However, it does find it if I just put :
_landingZone = missionNamespace getVariable "OpS20";
Why Arma Y
_landingZone = missionNamespace getVariable _landingStr;
Also doesn't work
Fml you guys. It was "str" adding quotation marks around it so it became ""OpS20"" instead of "OpS20".
Just in-case anybody was on the edge of their seats there
come on now, no personal attacks
@peak plover I agree with you though. But sadly that applies to many people here and no one will ever be able to fix it
It's almost like people are people
I was lookin to find player head pos the other day
This is how you can do it if anyone else ever needs it
is that more exact than eyePos? do you know? I think TFAR has problems with eyePos lagging behind
Little update on my script problem: You need to use moveOut instead of any other variation of making people leave a vehicle to not break the waypoint system!
Issue resolved...
@still forum I do not know. But I've heard that modelToWorldVIsual is faster than some other ones
(player modelToWorldVisual (player selectionPosition ["head",'Memory']))
I'm gonna probably need modelToWorldVisualWorld π€
was using that for the icons position
A modelToWorldVisual [0, 0, ((A selectionPosition "head") select 2) + 0.5]
```A ^ there from macro
_target modelToWorldVisual ((_target selectionPosition "pilot") vectorAdd [0,0,(_heightOffset + .3)]) This is what ace uses.
Not sure why "pilot" π€
But ACE is not lagging. So me using eyePos for TFAR ist mooost likely the reason for my laggyness then
How would I make a script fire when any member of OPFOR is killed?
cba?
There may be a better way but I can think of three:
- Add an event handler to each opfor unit
- Add a per frame EH that checks the number of opfor
- Same as #2 but with a loop instead, that sleeps for 2 or 5s after each check.
when doing an atttachTo with a camera, the resulting view wiggles and jiggles at times quite a bit. Is there any better solution than attachTo? Maybe continuously calling setPos? Any cam script that does produce a nice video stream that can be scripted?
ok, thanks
another question, yesterday I tried to determine the position of a smoke grenade when it is stopped. I tried with a fired eventhandler and speed _projectile < 1, but this was not precise enough. Anyone aware of a solution to get the exact position when it has expended its velocity?
Wait till speed < 0.2?
or wait another one or two frames after speed got down
Hey @still forum Would the script within the addAction only work for the UID in commandOpsAllowed: ```sqf
_objectsInside = list commandOpsTrig;
_list = [];
// Check what Objects (in commandOpsTrig) are a Player.
{
if (isPlayer _x) then {
_list set [count _list, _x]
};
} forEach _objectsInside;
// Exits Script if Player is outside of the Trigger.
if !(player in _list) exitWith {};
// Kicks Player Function - Moves the Player to Marker.
kickFromOps = {
player setPos (getMarkerPos "commandOpsMarkerDoor");
hint format["Unauthorised Access by: %1 - You do not have permission to access Missions", name player];
};
// If Player UID in commandOpsAllowed Array - Shows addAction on commandOps Object.
if ((getPlayerUID player) in commandOpsAllowed) then {
commandOps addAction [
"<t color='#44bd32'>Mission: <t color='#fff'>Test<t color='#44bd32'>, By: <t color='#fff'>Capwell<t color='#44bd32'>.", {
execVM "scripts\commandOps\m1.sqf"
}]; // Issue - The addAction would be see ANY player, that was able to bypass the kickFromOps Function.
//(The ability to bypass the Trigger is to have two people enter the trigger, and then they are able to select the addAction.)
commandOps addAction [
"<t color='#44bd32'>Mission: <t color='#fff'>Secure and Hold - Gvozdno<t color='#44bd32'>, By: <t color='#fff'>ViBro<t color='#44bd32'>.", {
execVM "scripts\commandOps\m2.sqf"
}];
commandOps addAction [
"<t color='#44bd32'>Mission: <t color='#fff'>Secure and Hold - Gvozdno - Reinforcements<t color='#44bd32'>, By: <t color='#fff'>ViBro<t color='#44bd32'>.", {
execVM "scripts\commandOps\m2-reinforcements.sqf"
}];
};
if !((getPlayerUID player) in commandOpsAllowed) then {
call kickFromOps;
};```
@sullen willow You could also use addMissionEventHandler["EntityKilled", {<your code>}] which only requires you to create one EH instead of one for each Opfor unit.
good idea, @dedmen . I can wait for the speed to go below 0.2 and then use an offset to https://community.bistudio.com/wiki/diag_frameNo to wait some frames further
wtf. Why is my screen full of code all of the sudden (β―Β°β‘Β°οΌβ―οΈ΅ β»ββ»
{
if (isPlayer _x) then {
_list set [count _list, _x]
};
} forEach _objectsInside;
wtf is this??
kickFromOps = [
player setPos (getMarkerPos "commandOpsMarkerDoor");
hint format["Unauthorised Access by: %1 - You do not have permission to access Missions", name player];
];
That's not how that works at all.
Why do you write the same thing 4 times?
Be nice Dedmen, I assume he/she's not an experienced dev π
Your addaction code is almost complete duplicates everytime
@scenic pollen I know him
Yup. I would try to do it "smarter" but I just want it work for now.
Answer to your question is "yes" I think. But I don't know what _this select 1 is.. I'd just use player there
Because player is exactly what it does. No need to write needlessly confusing code
player would be global _this select 1 is specific to who is _caller for the addaction.
Only player can execute a action though
unless you have AI's in your group and tell them to active a action.
Which I'd assume you don't
And even then. That AI doesn't have a playerUID anyway. So that wouldn't work
Right.. you don't make sense in the context of: (this select 1) this from the wiki: https://community.bistudio.com/wiki/addAction (caller (_this select 1): Object - the unit that activated the action)
And the unit can only be player
so why write _this select 1 if you actually mean player
oh right... yeah
Wouldn't it be better to just don't show the action at all? to people that are not allowed in command ops?
Well how would I do that?
the addAction condition
Are you executing that code from the trigger?
private _objectsInside = list commandOpsTrig;
if !(player in _objectsInside) exitWith {};
private _actionCode = {
(_this select 3) params ["_scriptFile"];
hint format["Authorised Access by: %1 - You do have permission to access Missions. Missions will be loaded for you.", name player];
execVM _scriptFile;
};
commandOps addAction [
"<t color='#44bd32'>Mission: <t color='#fff'>Test<t color='#44bd32'>, By: <t color='#fff'>Capwell<t color='#44bd32'>.",
_actionCode,
["scripts\commandOps\m1.sqf"], 1.5, true, true, "", "(getPlayerUID player) in commandOpsAllowed"
];
commandOps addAction [
"<t color='#44bd32'>Mission: <t color='#fff'>Secure and Hold - Gvozdno<t color='#44bd32'>, By: <t color='#fff'>ViBro<t color='#44bd32'>.",
_actionCode,
["scripts\commandOps\m2.sqf"], 1.5, true, true, "", "(getPlayerUID player) in commandOpsAllowed"
];
commandOps addAction [
"<t color='#44bd32'>Mission: <t color='#fff'>Secure and Hold - Gvozdno - Reinforcements<t color='#44bd32'>, By: <t color='#fff'>ViBro<t color='#44bd32'>.",
_actionCode,
["scripts\commandOps\m2-reinforcements.sqf"], 1.5, true, true, "", "(getPlayerUID player) in commandOpsAllowed"
];
if !((getPlayerUID player) in commandOpsAllowed) then {
player setPos (getMarkerPos "commandOpsMarkerDoor");
hint format["Unauthorised Access by: %1 - You do not have permission to access Missions", name player];
};
If you execute that for the trigger you would add the actions everytime the player enters the command ops tent
After some time you'll have dozens of duplicates for each mission
Updated Script Above with Comments. ^^
Does this script you have created, to allow for repeated info, account for the comments in the script?
Or because I like macros.
#define MISSION_ACTION(missionName, missionAuthor, missionScript) commandOps addAction [\
format ["<t color='#44bd32'>Mission: <t color='#fff'>%1<t color='#44bd32'>, By: <t color='#fff'>%2<t color='#44bd32'>.",missionName, missionAuthor],\
{\
hint format["Authorised Access by: %1 - You do have permission to access Missions. Missions will be loaded for you.", name player];\
execVM (_this select 3);\
},\
missionScript, 1.5, true, true, "", "(getPlayerUID player) in commandOpsAllowed"\
];
private _objectsInside = list commandOpsTrig;
if !(player in _objectsInside) exitWith {};
if !((getPlayerUID player) in commandOpsAllowed) exitWith {
player setPos (getMarkerPos "commandOpsMarkerDoor");
hint format["Unauthorised Access by: %1 - You do not have permission to access Missions", name player];
};
MISSION_ACTION("Test", "Capwell", "scripts\commandOps\m1.sqf")
MISSION_ACTION("Secure and Hold - Gvozdno", "ViBro", "scripts\commandOps\m2.sqf")
MISSION_ACTION("Secure and Hold - Gvozdno - Reinforcements", "ViBro", "scripts\commandOps\m2-reinforcements.sqf")
comments in what script?
why does one need to account for comments?
Ah you mean if I fixed these things?
"(getPlayerUID player) in commandOpsAllowed" That is the condition. Only people that satisfy that condition will see the action
Hide all the complicated uglyness. And only show the easy to use stuff for the users
I expect you plan to add more missions.
Yes. Loads
Copy-pasting the same uglyness that's very hard to read dozens of times might not be a good idea
what formatting?
oh nvm
I just saw to 1% etc
That is soooo cool π
I need to use / look at define more
What are the \'s for?
is that new line (replacement of ;)
mutiline defines
if you want the macro to continue on the next line, then you put that (except on the last line as you can see, because thats where you want it to end)
Other than a nicer syntax when calling it, what's the benefit of a macro vs [] call myFnc?
performance... if you really want to
Same as just copy-pasting the content of myFnc everywhere where you use it
yes, functions also set some variables usually and extra scopes
Why do we use functions at all then?
because the performance impact isn't a lot and it makes code a lot more organized and readable
No
A macro isn't a call at all
it's literally copy-pasting the macro code into your script before compiling it
I see, so every occurrence of MY_MACRO is replaced with the contents of that macro (when compiled)?
yes
I see, thanks both
@peak plover eyePos will always be faster, it is just one command with a single argument
I'm using everyContainer to get all the containers in a vehicle, and then I'm saving MagazineCargo, ItemCargo, and WeaponCargo for that container. How can I add it all back? I'm a little confused about how to create a new container in a vehicle and get that container I just created
container aka backpack?
add them with addBackpackCargo
and then use everyContainer to find it
and then you can addMagazineCargo to the one you found
so if I have 3 vests of the same class, I just have to loop over every container until I find the empty one?
I think yeah
You should be able to set variables onto them if you need to give them a unique identifier
just randomly remembered i once created a promise system for SQF π€
in june actually Oo
awesome, efficient π
fuck ... i think i get alzheimer
Chemtrails
or have amnesia
I have the same problem.
I don't know where it comes from. But I'm thinking chemtrails
i think it is just the alcohol
way too much of it in the summer
anyways ... as i am already refing it: https://gist.github.com/X39/709ecbf88c5fda594586c9b995c8c6a0 was this here
So I tried doing
_container addBackpackCargoGlobal [_class, 1];
where _container is a vehicle and _class is the class of a RHS backpack.
I get Bad vehicle type rhsusf_iotv_ocp_Medic
What I am trying to accomplish is saving the entire inventory of a vehicle or crate. Weapons, Items, Weapon Attachments, everything. This is a lot of code considering how much I was expecting this would be.
Recursively loop through a combined list?
Yes?
what is a "combined list"?
Combo list? As in combo box?
I got the vests and backpacks working, I'm now stuck on weapons. I can use https://community.bistudio.com/wiki/weaponsItemsCargo to get all the weapons and their attachments from the cargo. Once again I can not find a way in the wiki to add it all back into the vehicle cargo.
you cannot add weapons with attachments
unless you add them to a AI and let the AI drop them into the vehicle
π€¦ why
I wrote a SQF command for it but BI didn't want it
Would you happen to still have it on gist or something?
Oh, so it's not written in SQF?
ok, I had thought you just meant a function
Nah. I'm kinda exact on my wording usually ^^
It would be nice to just have a setUnitLoadout/getUnitLoadout equivalent for cargo. But a few hundred lines of sqf to get and store everything, and then transfer it via an AI unit is cool too.
Strip off weapon of all attachments when you put it into storage
I'm just going to read the attachments when I save the cargo, and then add them into the root container when loading
This is going to be really complicated but you could also store weapon configuration in the database and when player takes it you can add all the attachments it had back. But tbh too much hassle not worth it
Yeah, that's way to much work for the reward, especially since I won't need this code after the 31st
Whatβs after the 31st, the end of the world?
can I add userActions and eventhandlers for gear such as backpacks, helmest etc?
π€
oh thats nice to know. so making a sci-fi jumppack should be possible then yes
send it flying
I'm noob with AI, what do I do if i want to have a civilian AI attack a given unit?
civilians will attack anyone if they have a weapon that is
_civilianAI setFriend [<given unit side>, 0];
```maybe
Are markers objects?
no, strings
pretty much i just want a "civilian" to walk around casually, but if theres enemy soldiers nearby, move towards them, then once close pull a grenade out the dark spots and throw it
correct
Markers are (edited for clarification: technically) objects but you can only refer to them by their name which is string
private _grenades = currentThrowable _unit;
_unit doWatch _target;
_unit forceWeaponFire [_grenades select 1, _grenades select 1];
```π€
need check distance probably, @austere granite
fsm question: from a state i got multiple conditions; will all the conditions be tested if they are true or only the one with the highest priority?
@tough abyss No markers are not objects. They are no entities
Every entity is an object but not every object is an entity. Anyway I wasnβt referring to markers as entities or other ingame objects, but you cannot have a bunch of properties as marker has if it was a plain string. They are structs in the engine, and structs are objects in C++
Yes they are an array of structs.
But object ingame, which is what people usually talk about here are ALOT more than just a c++ struct
Of course
@sleek token this is why you have priority param, the highest one checked first and if true - off you go
@tough abyss roger thanks a lot
fsm priorities it's like lazy eval without lazy eval π
@meager heart merci, but would that nade properly or just throw it randomly? Dont think we have heatseeking grenades yet. Ill mess around a little but left out the forceWeaponFire because of that, maybe doFire would do it
@austere granite do you want the grenade to be thrown *at* the soldiers or do you want more of a suicide bomber who would drop the nade at his feet?
thrown at, i might do a suicide bomber too, but that would be just a scripted explosion. Could also be molotovs or other things π
@tough abyss I'm running a persistent campaign until the 31st, that's why I need to save inventories and vehicle cargo
it will be slightly random always with forceWeaponFire yes and with doFire that "target dude" must be an enemy to civilian...
glhf π
how would you convert a x,y position (e.g. provided from findSafePos) to a 3d x,y,z one?
@sleek token
private _myPos = [50, 33];
_myPos set [2, 0]; // _myPos is now [50, 33, 0]
ATLtoASL if needed π
if I can help about the facepalmβ¦ π π
Would this work or did I type this wrong. I want to make it so if you dont got that license you cant use
if (!= license_civ_builder) exitWith {};
assumed license_civ_builder is a boolean,
if (not license_civ_builder) exitWith {};``` or ```sqf
if (!license_civ_builder) exitWith {};``` @civic oyster
Ok I will that, thank you
π
what about if I wanted !(license_civ_builder) or !(license_cop_builder) so if the player has one of them they can use but if they don't have either then exit. Can that even be done?
@winter rose
yes, with the or operand
condition1 or condition2```
```sqf
condition1 || condition2```
if (!license_civ_builder && !license_cop_builder) exitWith { hint "thou shalt not pass"; };```
my bad, corrected
if both are negative, exit
@civic oyster
ok thank you, I have been trying to find a way to do that haha
mhh ... i now see some hard simmilarities between operators and https://community.bistudio.com/wiki/SQF_syntax
tried to add π³ for that hint, but discord said no... π
@meager heart I saw it, then it was removed ^^
:sad:
for this (!license_civ_builder && !license_cop_builder) I would want to use (!license_civ_builder or !license_cop_builder) cause I only need one of them to be true not both
please define:
if you have both?
if you have one of them?
if you have none?
This (!license_civ_builder or !license_cop_builder) would be correct cause you cant be a civ and a cop at the same time.
license_civ_builder = civ license
license_cop_builder = cop license
not correct
as if you are a cop, you won't have the civ builder
your code will exit if you don't have one of them
what you want
if (copLicense or civLicense) then { /* you can work */ };``` the negative (for `exitWith`) is
```sqf
if (not copLicense and not civLicense) exitWith { /*stop right here */ };```
or simpler maybe, you can do as such:
if (not (copLicense or civLicense)) exitWith { /* blah */ };```
@civic oyster
ok I now understand that but where would I define the license builder. Would that go after if (copLicense or civLicense) then { in another if statement?
I don't get the "define the license builder" part?
So I want the player to have a license named builder, If they don't then I don't want them to use the menu. Its a placeables menu for placing traffic cones and things like that
as for that, it's your own framework I'm afraid π
ok
will setVariable always set the variable where the command is executed or literally only on the machine with the id used in the 3rd parameter. i know probably a dumb question. just want to be sure
the variable is set only on the client of given owner (clientOwner) id, or if id is negative, the variable is set on every client except the given one
yea i read that. wasn't sure about dedi and server in general because of wording. just unwarranted paranoia. just tested. works as intended. thx
Anyone know if it's possible to change the time it takes for a PAK to be applied? In ace?
yes. Medic and non medic have different time
Well.... https://github.com/acemod/ACE3/blob/master/addons/medical/functions/fnc_treatmentAdvanced_fullHealTreatmentTime.sqf This function returns the treatment time soooo maybe not.
Canβt wait for DayZ mod for Arma 4
Is there a way to lock a backpack, similar to the way it worked with the acex and a2? I have not started to try some stuff out, but would it work similar to a3 ace vehicle inventory locking?
yes.
Just use InventoryOpened eventhandler
And close the inventory immediately if no access
hmm, I think I am going to experiment around that. I also wonder why ace does not have it
Because no one made it yet. Β―_(γ)_/Β―
i still remember vividly the a2 times when playing as medic. First thing I did was lock my backpack and the look back while there are already 2 people trying to steal bandanges of me :V
I don't see any reason to not accept the pull request for that feature. Just needs someone to actually write the code
I also remember the need to lock it in A2 days.. But nowadays I atleast don't remember a case where I would've needed it
yeah same kind of. I only want it because of my crazy snowflake mission ideas
the only reason I do not attempt to do PRs for ace is because I am too lazy to set up the dev environment for it
locking the backpack as militar it's like a crazy thing, "lookig for a key in the middle of the battle to open the backpack"
has no sense atleast for me
I see it still as game and gameplay really. The stuff I do is not really meant for realism
well, that it's the point of ACE, the realism :p
to set up the dev environment for it Well you need mikeros tools installed and maybe a p-drive.
Mikeros tools you probably already have (And they won't be needed for much longer. Replaced by Armake)
And for a P-Drive you can use DokanPbo which can auto-generate the pdrive out of your Arma pbo's
mikeros tools are no go for me as my AV just hates the thing to hell and back. I pack my ragdolling mod with mikeros on linux because of that
Just switch to Armake :D
I also did that for most of my projects.
lookig for a key in the middle of the battle to open the backpack That's not how that works.
Backpack locking is just a workaround. In Real life you'd say "Hey get your hands of my backpack" and turn away so they can't grapple around in it. But in Arma turning away doesn't do anything.
tbh I do make a check function anyways it will include unconscious state in it, so it is just immediately unlocked if you are knocked out. besides ace medical just gobbles up your own medical supplies like that already
I never had a full dev-env setup like ACE explains it on their wiki. Never needed it
i do understand, but in my opinion it's not a necesary thing :p
dedmen do you mind on check an addon i made?
no I don't mind
hold up, is it possible to overwrite ace functions in missions? that backpack locking stuff already works on my end and ti would fit just too well into the existing onOpenInventory function.
not really no
Why don't you just integrate it into it?
Just do it without dev-env and don't test it π
sure I will first just get it feauture complete
I can create a build for you if you need it
i mean if you drop the thing I want the lock to be turned of and all that, so every time you pick up a backpck you need to lock it again
expect like some github upload in the next our of the POC
@digital jacinth The entire AV industry is largely a scam. It's not possible to actually make working, effective AV software.
@still forum
https://github.com/diwako/lockBackpack
Just thrown it into a mission for now, so I could see if it works or not
are you waiting for inventory display to open?
I thought returning true would prevent that
I took parts from the vehicle lock function, I returned true, but the wait and execute function still worked. So I believe the display has opened
the condition !isNull (findDisplay 602) returned true, that is why i think so
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#InventoryOpened does that need updating then?
dunno, i am using the cba xeh tho Extended_InventoryOpened_EventHandlers Maybe there is a difference?
Ah! Yes. I think only the last eventhandler takes effect
reason for me choosing this is because the original backpack EH does use the same, so why not try to get as close as possible before integrating them
What do you mean by "this"?
If it's really only the return value of the last eventhandler taking effect you need to do the waitUntil and close anyway. Because otherwise any mod that adds more InventoryOpened handlers would break it
hmm, looking in the vehiclelock EH again, there there is no true returned, it just does the waitUntil to kill the display (and open up the players inventory)
ah vehiclelock is what you base your stuff on?
I thought you use the backpacks eh https://github.com/acemod/ACE3/blob/98da86b74d4089bc3403d0b0c0074e6a46ce35d8/addons/backpacks/functions/fnc_onOpenInventory.sqf
I do. I used the parts of vehiclelock as example to close the inventoy
what
Wanted to find out why https://github.com/acemod/ACE3/blob/98da86b74d4089bc3403d0b0c0074e6a46ce35d8/addons/vehiclelock/functions/fnc_onOpenInventory.sqf#L35 But I guess I won't now...
ugh did their gitlab just exploited and someone is running their own stuff right now?
no they moved to github
oh
FunFact. ACE_player action ["Gear", objNull] There is also a OpenBag action that does exactly the same as the Gear action.
but yeah, obviously not returning anything and just waiting for the display has obviously the same effect
anyways, I have added it to the backpack addon now, including stringtable, I have not tested this because 'i cannot build ace right now. @still forum
for locking/unlocking we'll probably want a icon in the inventory display. Like it was with ACE2
Hm, I'll see what I can do. gotta find the old icon and recreate it then
dunno really, any real difference?
Ah I see, you set it on the unit
i first wanted to set it on the backpack
but then thought about the issues i could run into
then i was like "nah, unit is enough"
I don't know if that feature would be worth it.. Set the ownerID onto the backpack. So that you can leave backpacks on ground locked.
But I think that won't work anyway
Yeah forget it. That's fine ^^
but yeah, should i set the variable to nil or leave it as false? I am curious about it, I mean i do nil check it anyways everwhere
also fixing idents from 2 spaces to 4
my thought was to not transmit it over network if not needed. But I overlooked that the function is only executed if locked==true, meaning it was already transmitted over network
unbinarized config but should work
alright updated it with the missing comma, some more translations and the like
you sure the macros did not get replaced
Ah okay will try it out.
Forget everything I said. Turns out I can binarize π
π
hello, I have a short question. how is it possible to attach a weapon on a vehicle with enabled simulation so the gun is able to turn and to fire at enemys?
Well
You could attach a remote laser designator
Attach an actual gun to that
And play with this on the laser designator
He has a static gun. Which falls over when placed because it's not correctly made.
He wants to prevent it from falling over, and wants players to be able to get into it to shoot.
You know how to look up class names yes?
Oh
Use this in the editor then
Attach the gun to something with disabled simulation
Its really better to create own vehicle instead tbh
Not everyone knows how to model, make textures, animate and write configs π€·
But it's always good to learn if you have enough free time
why not take an existing static turret, hideselection the weapon, then attach ur own on top?
Do you mean creating a new turret that works. Making it invisible. And then just using the turret he actually wants as a dummy that's just there for the looks?
sounds like the most amazingly hacky thing ever. i love it!
Well the problem report I got is that he can't turn the barrel of the gun...
This won't really fix it
does anyone know what exactly makes hideSelection work? is there a hide animation needed inside model.cfg?
No. you need a hiddenSelection.
Then you can hide it
Guess it just set's it's texture to not render
ah k
hiddenSelections need sections on the model.cfg list
Need help with this data terminal script
I got it to work but I want to change it so the terminal is always open with no interaction.
@sharp pewter https://community.bistudio.com/wiki/BIS_fnc_DataTerminalAnimate ?
[myTerminal, 3] call BIS_fnc_DataTerminalAnimate;```
hahaha I redacted this example and it's exactly the one from the page π
@still forum btw I dropped the idea of a PR for ace due to someone linking me this
https://github.com/acemod/ACE3/issues/1840#
Guess the current "shake and zip" sound is this already, thus I release the script just as is.
Thanks Lou, I did see that post but not sure am I suppose to just paste that in init? Do I still need the script? Can I still change the screen Texture?
Don't see why that prevents you from doing a PR?
It sounds like they do not want lockable backpacks to me
@sharp pewter if you just want to change the texture, I think you can already do that in Eden editor
else, you can setTextureGlobal
@winter rose Ok got the animation to work thanks. Still need to change screen texture to custom ogv . Can you please show example of what i should type in init?? Can't figure out how to do it without using the other script.
sooo, what was the "proper" way of checking if the player is actually in game?
!isNull player
atleast at that point his body is ingame....
What is your definition of "in game"
something about waitUntil { player == player } and some meme about it being the dumb way π
π
I know you can do pip on ctrlSetText but is it possible to do it with structuredText ?
Does Anyone know of an AI gear script where I can just put down CSAT units and have the script give them the gear I want instead of manually editing in editor?
@tough abyss TMF and F3 mission making frameworks.
I can't get a new framework I have to work using the one I'm given
https://gyazo.com/b8b845b56a166626e7e5fafe0423c8b1 i got it working, any ideas if its possible to un-square the image xD
hey guys, I can't find the error in the following line:
[_veh,["Open BIS Virtual Arsenal",{["Open", true] spawn BIS_fnc_arsenal},[],1,false,false,"","","5"]] remoteExec ["addAction",0,true];```
for which the RPT log says
```20:42:29 Error in expression <(_this select 0) addaction (_this select 1)>
20:42:29 Error position: <addaction (_this select 1)>
20:42:29 Error Type String, expected Number```
isn't the 2nd parameter an array, not a number? π€
it's complaining about the first parameter
No wait!
(Didn't BI display a |#| at place of error before?)
It's complaining about some entry in the array
Why is your radius "5"
why would you ever wanna pass a radius as a string?
eh that's a good one, that wasn't supposed to be a string
unfortunately that's all the RPT has to say about the parameters
If only we had a debugger .......... π