#arma3_scripting
1 messages Β· Page 406 of 1
No. You can't copy paste this into the init box in the editor if that was the question.
Can i post links in this chat?
... depends on the content behind the link.
π€
then post it Β―_(γ)_/Β―
I can no longer drag and drop the thonk π¦
I looked into it, and besically it lets you type in commands by going !
thonk?
At least links no longer auto expand.
Ye, but it's annoying to put <>.
Would prefer if you had to put them to make it auto expand.
buhuhu? π
Like... Markdown.
Just a friendly advice
I can already tell that it wouldn't by just looking at the brackets/ parenthesis.
google it, install it, have more fun
I fixed the brackets
I saw the bracket mistakes
If someone typed the command in, they would get the curator thing attached to them
Well not like that it wouldn't.
What do you think would make it work?
Proper brackets.
And I also think you'd have to remote exec the code to the server, because assignCurator only works on the server machine. And define that commy_zeusGroup variable.
The other code is still in the init file
Now it's missing a comma, and there're still rogue brackets at the end of the file.
Missing a comma where and that bracket was there from the beginning, I didn't add it
i was just active sqf scripts, is there a reason that diag_activeSQFScripts returns a bunch of these "[""<spawn>"","""",true,523]"
Well, doesn't matter who made the file. If it the syntax is wrong, it will not work. Programming is very in indiscriminate that way.
What else do you want, Cloud?
[] spawn {
hint str diag_activeSQFScripts; //[["<spawn>","",true,1]]
};
[] spawn {
scriptName "myScript";
hint str diag_activeSQFScripts; //[["myScript","",true,1]]
};
That should help I guess.
danke will mess with this
I copied this straight from the wiki btw, lol.
I've never used this in my life myself. lol
Is there i way to make the AI drivers not follow gunner orders and move to their waypoints?
Commy, I got the command plugin working
What would you suggest the code be to add curator to a player who says the command?
[player, {
if (!isServer) exitWith {};
if (isNull (missionNamespace getVariable ["commy_ZeusGroup", grpNull])) then {
commy_ZeusGroup = createGroup sideLogic;
};
params ["_unit"];
private _logic = commy_ZeusGroup createUnit ["ModuleCurator_F", [0,0,0], [], 0, "NONE"];
_unit assignCurator _logic;
}] remoteExec ["call", 2];
Something like this maybe?
hm
give me one sec
this is what I was trying
I had modules ingame named curator 1 and curator 2
The commands are working, I just error out
anybody ever checked if two configs get checked via isEqualTo?
given following scenario:
class A
{
class sub
{
val = 1;
};
};
class B
{
class sub
{
val = 1;
};
};```
would `isEqualTo` return true or false?
_this is probably not the player. And why do I even bother posting stuff if I get ignored? The commands have to be executed on the server machine, therefore remoteExec is required.
I posted that like 3 times...
I'm sorry, I don't understand
@little eagle that is out of question
however, i got my doubts with how well it works using config
Works just fine with config. Even == works with config.
the remote exec part, the player sends a command to be executed server side, the plugin gets inititated out of the init.sqf and so I assume it's server side, so what I'm trying to do is make the player who do the command become owner of the gamemaster module
but does it only checks if two config classes are the same or does it check like it does with arrays
Was that screenshot taken while connected to a dedicated server, Matthew?
No, its conntected to my home computer
I'm not playing with a dedicated as of right now
though the file will be uploaded to a dedicated
I don't have direct access to it, me and the guy doing it are both working on seperate parts of this project
How do you know the code is sent to a dedicated server?
init.sqf is not server side.
It's global.
And I'm very sure the chat command code is executed on the client that typed the stuff.
I can get acccess to the dedicated
If it works, it works. You don't have to convince anyone here in the chat, just the game.
With the remoteExec, or without?
Ok, then I'm sure it'll still work in action connected to as server, in MP.
Thanks!
str (configFile >> "cfgvehicles") diag_log (configFile >> "cfgvehicles")
what do theese output?
config path
so it would print "configFile/cfgvehicles"?
can't remember the format but yes
format is important here
kk ty
@reef grove #creators_recruiting
I'm here to report my function works now
@zinc forum CBA got that chat commands stuff a couple months ago
common.hpp
// Pixel grid
#define pixelScale 0.50
#define GRID_W (pixelW * pixelGrid * pixelScale)
#define GRID_H (pixelH * pixelGrid * pixelScale)
dialogFile.hpp
class testDialog
{
idd = 12345;
name = "testDialog";
enableSimulation = true;
movingEnable = false;
class ControlsBackground
{
class Title: ctrlStaticTitle
{
idc=104;
x="safezoneX";
y="safezoneY";
w="safezoneW";
h="(5 + (5 + 2)) * GRID_H";
text="Test Menu";
};
};
};
Any ideas why these macros aren't working for me?
included ?
Yep
When I remove the macro GRID_H for the h coordinate in my dialog, and have it entered manually, it works fine
what's the issue?
When I use the macro, I cant see the control at all
Which ones?
after the h =
Thereee we go, that worked. Thank you! π
has anyone gotten the scripted event curatorObjectRemoteControlled to fire?
i tried the scripted event and the public variable handler and haven't seen either go off, it seems like BIS_fnc_moduleRemoteControl is no longer used
i grabbed it from modules_f_curator/Misc/Functions/fn_moduleRemoteControl.sqf , its still on the wiki as well under scripted event handlers
im trying to listen for remoteControl events, any idea where I should start poking around in bis addons?
wait one
how fast is saving data to profileNamespace?
couldn't find an easy way to do so @restive matrix
I wouldn't be able to tell without some perf testing
here was my test code based on the fn file
[missionNamespace, "curatorObjectRemoteControlled", {
params ["_curator", "_player", "_unit", "_controlled"];
private _text = if (_controlled) then {
_text = format["%1 is now remotely controlling %2", name _player, str _unit];
} else {
_text = format["%1 is no longer being remote controlled", str _unit];
};
systemChat _text;
}] call BIS_fnc_addScriptedEventHandler;
"bis_fnc_moduleRemoteControl_owner" addPublicVariableEventHandler {
private _player = _this select 1;
private _unit = _this select 2;
private _text = if (isNull _player) then {
_text = format["%1 is no longer being remote controlled", str _unit];
} else {
_text = format["%1 is now remotely controlling %2", name _player, str _unit];
};
systemChat _text;
};
@rancid ruin Faster than going through callExtension. But it get's problematic when it's too big and can corrupt
wut?
I can't imagine that PVEH working
oh, thanks discord, didn't see that scripted EH
basically i'm dicking around with a little fog of war system. i black the map out with big black markers at mission start, then place markers as the player moves around and "explores" the world
need to keep track of the what the player has already explored, e.g what map markers have been created, so they can be loaded later, as the mission will be persistent
i messed up the PVEH a bit but i was attempting to catch
_unit setvariable ["bis_fnc_moduleRemoteControl_owner",player,true];
ah okay
And from where did you get that magic
private _player = _this select 1;
private _unit = _this select 2;
Array?
If it's passing in player
yeah forgot to convert that into an array
still not sure why the scripted eh never fires, here is it being called in the fn file
[_curator,"curatorObjectRemoteControlled",[_curator,player,_unit,true]] call bis_fnc_callScriptedEventHandler;
is it called on the module only?
alright i know how to fix it then, thanks
in this case:
getassignedcuratorlogic player
is there any built in way to determine if two locations are on the same land mass?
i.e if you can walk from position 1 to position 2 without crossing water
Don't know any... no
think of a better way than using inPolygon?
no. Actually that's better than the idea I had
i've already made polygons of each land mass on tanoa, it took a while
i'm not sure if you could use a dummy AI, give it a waypoint, then check if it can complete it somehow
because the AI obviously has access to pathfinding
raycasting each meter would be more efficient
Oh you found magic OO gibberish that still uses private ARRAY and _this select ....
And it uses sleep 0.000001 in the code to make sure it get's scheduled
So I'd say... Have fun with that too
Also that thing uses Roads
So if the landmass is connected without a Road over that connection it wouldn't find the path
i was thinking to create tiles each X meter across the map and add them as nodes to the pathfinding grid
i don't really script for performance or release...just fun
inPolygon would definetly be bescht
excellent, i use that a ton already
one of the most useful new scripting commands in a while
what'd be a quick way to get each position on a 100 meter grid within 1km of a location?
a grid of positions spaced 100 meters apart, centered on the player
with each one no more than 1km away from the center
two for loops
from -500 to +500 in 100 step
one for x one for y
getPos player vectorAdd [x,y,0]
i should cache those positions rather than computing them each time as well right
say i'm running it every frame
Every frame would be terrible
or rather cache the offsets at least
You can compute the offsets once and just hardcode them
At that point it would be almost fast enough to run each frame I guess
That could benefit greatly from my script optimizer π
it's a bitch cos you do need to run stuff each frame sometimes
make sure to store getPos player in a variable instead of calling getPos player multiple times
and with sqf that leads to pain
i dick around with game engines mostly cos they're much faster, but it's fun to come back to arma
I also play around with Arma to make it much faster
even if sqf were 100x faster it'd still be horrible making new game modes and mods cos of the UI system
What if I give you the ability to have a new UI system?
sign me up
Let's say it works XML based like in Enfusion
i've not seen their system but i'm very used to web design so yeah
It's on my todo list. So check back in a year or two
tried some of the WYSIWYG solutions for arma 3, still a nightmare
WYSIWYG doesn't really fix anything
I hope that I can get it going sooner but... Todo list big
would it be like a middle man system for translating XML in to configs, or a new system for drawing UI entirely?
new system
Intercept based and basically drawing a overlay over the existing game
it's just the workflow for making it do shit
Ohhhhh.. I should really look into how the UI draw stuff works in engine. If it works like I imagine that will be so easy and cool :3 It's most likely not how I imagine it tho
if you can hook up chromium embedded webkit and draw that on top of the game window, listen for mouse events and javascript, etc
that would be so sick
game UI systems have always been a nightmare though, nobody has solved it
Do you know how huge webkit is? π
yeah i know, it's not entirely practical
it's been done with some games though
for UI heavy stuff sometimes HTML/CSS is the best way
I could do Intercept-Javascript scripting. So that you can use SQF commands via javascript
and then give you a HTML+CSS+Javascript based UI
Maaaaan that would be awesome and would get me busy for atleast a couple years full time
sqf <-> node/javascript would be sick
you'd probably see a ton of people pick that up
I don't like JS tho
it's used for literally everything
me neither but there's tons of game devs in js
tons of everything in js, good and bad
which is fucking retarded
well it runs in the browser so yeah
I like Lua so I make the Lua wrapper. Somebody else likes python so he makes the python wrapper.
We have no one on the Team that likes JS enough to make a wrapper for it
sqf is also retarded but it runs in arma so here we are
because it would require knowledge outside of webdev ded
sqf can be exscused tho
it stems from bad code from 10 years ago when BI was a small company
look at TKOM enscript
much better
javascript stems from before that when the internet wasn't fully formed
javascript just got way the fuck out of hand
similar to arma's needs tbh
Wow
Javascript Intercept would fit the whole Arma thingymabob.
Because.. The Javascript engine for C++ that I just found is calld "Duktape"
It fits so goood
hahahahahahahahahahah
duktape's been used in a few game engines i believe, saw that name come up the other day when i was reading
a perfect name indeed
are there namespaces in javascript?
http://duktape.org/ Whatever that uses
I would just do sqf.getPos(sqf.player())
n such
just like Interschept
honestly I can't wait for enscript (please be similar to TKOM and not some javascript abortion)
please make it happen dedmen that would be cool
i agree JS isn't fun, but it is the de-facto middle man language right now
any idea how this guy did his mod? http://steamcommunity.com/sharedfiles/filedetails/?id=1181881736&tscn=1509487007
cos you could do something like that easily with a JS <-.> sqf bridge
JS looks crazy as fuck too, a perfect fit for sqf
a match made in heaven
you could be the one that opens the pandora's box of arma 3 scripting at the end of its lifespan
I already did that though...
with intercept?
already did a year ago
Yeah...
but nobody uses it
no?
are people doing crazy shit with it?
Yes
i stand corrected then
any links to the crazy shit?
i thought intercept development stopped after the initial proof of concept
https://github.com/dedmen/Intercept_CBA
https://github.com/dedmen/interceptTest
https://github.com/dedmen/SQF-Assembly
https://github.com/dedmen/ArmaScriptProfiler https://forums.bistudio.com/forums/topic/211626-arma-script-profiler/
Disclaimer: If you don't use unscheduled scripts or you don't know what "unscheduled" means this won't be useful...
absolutely not
i'm getting conflicted reports here
^ and thus it didn't ded
It was abandoned for a couple months. Until I revived it
so the development did stop. But not forever
i don't know what the things in these links are doing
where are the kool screenshots and stuff
and the kool benchmarks
I added a BIF link for the profiler
script profiler is a fucking godsent
oh ok yeah this looks sick
Intercept_CBA add's misc stuff like new math script commands or a surfaceTexture function or a real Hashmap.
SQF-Assembly allows you to write assembly level SQF and also has a assembly level optimizer that will probably increase all scripts performance by atleast 20%
this is the kinda shit i'm talking about
how I learned that lbSetPicture was either bugged or stupidly intensive
surfaceTexture function?
didn't see the camo magik?
there's no way to store an image in arma is there?
like render to texture, only not live, but a snapshot
If you enable filePatching you can store it externally and load it from there as a normal texture
hmm
no non-dev mode solution?
cos you can't really ask people to add launch params to play your mission
not yet. I could potentially have memory only PBO's and be able to live edit files in them.. but meh
that sucks
you'd think it should be fairly simple
just want a little bit of memory that i can store textures in
rather than running PIP every frame
Kinda simple I guess. But where would you get the textures from?
a camera
So like a PiP but only screenshots instead of video
I guess that wouldn't be too hard for BI to implement
yeah say i want to have pictures of buildings
so you can click a building on the map and it shows you a picture of it in the world
shit like that
kinda like the editor preview images, only real world, as they are
Create a temp camera and display it fullscreen
indeed, it's not ideal though
if it's night time you're fucked for example
i just realised that surfaceTexture could make my fog of war thing way cooler
i just use the terrain type at the moment
yeah surfacetype
So I guess it works everywhere then
But it wouldn't make forrests display as green or such
yeah i'm not sure how to tackle forests yet
could just make markers where there are many trees i guess
It really just gives you the texture on that position. It can be different a few cm away from that.
yes
Refering to the UI stuff. It works EXACTLY like I imagined
terribly
I can just make a custom RscFrame kinda thing. And when that's Drawn a Draw function in Intercept is called
and you can do whatever DirectX can do
And draw inside that Area of that Existing Frame
so you still need to define the drawing area in normal UI Config but the rest is however you like
this sounds exciting
OUHH It get's even better
Well. For me. Not for you because less possibilities
You get DrawText that automatically adds newlines if it doesn't fit. Text that doesn't clip. Vertical Text. Any orientation of text I guess.
Draw a Frame filled/not filled though.... I have to look into that. Might not work completly. We'll see.
DrawLines, Polygones(3D)
Holy crap more virtual functions.
Might even be possible to let you draw textures
Yeah. I could load textures from path and let you draw them as background.
That will be sooo awesome. Let's push it onto my Todo list and let it rot for a year
Oh you need a font to draw text... How do you get a Font...
OMFG.
pushes it further back on his TODO list
Thahaha
What other commands return constants?
true/false/nil... and?
null and all it's variants ?
π
I now optimize CODE else CODE to [CODE,CODE] whether you want or not π
OMFG. Running https://community.bistudio.com/wiki/localize at compiletime instead of runtime drool
OI I can process configFile >> "CfgWeapons" at compiletime :U Dis is getting crazy now
Or check isClass (configFile >> "CfgPatches" >> "acre_main") once at compile time. Meaning no runtime overhead for that! Imagine!
"Do I have that addon" checks completly free! ish.. Ofcause you still have to compile your script
Now you make some free debug commands. You can start by porting WARNIING_n, ERROR_n, LOG_n.
They can't be free because they have to do something at runtime
I can only freeify stuff that is known at compile-time. So if you pass variables into WARNING/ERROR/LOG then I can't optimize. And I'd bet it goes to CBA_fnc_log right? and that's a variable
bmap[">>"] = [](game_value left, game_value right) -> std::optional<game_value> {
if (left.type_enum() != types::GameDataType::CONFIG || right.type_enum() != types::GameDataType::STRING) return {};
return game_value(sqf::config_entry(left) >> right); //#TODO test
};
Small piece of magic and now every configFile >> "stuff" >> "stuff" >> .. is completly evaluated at compileTime as far as you have constants.
So if you did configFile >> "CfgWeapons" >> _var before it will be optimized down to _constant >> _var :3
and getNumber/getText/isClass/isText are also constants now :U I looove this. @queen cargo bootstrapped a truly awesome thing
Is there a way to make a rvmat that reflects light to the surrounding area? linke just a little bit?
I'll just evaluate diag_tickTime at compiletime. That will make every script 100% faster
don't compile them, β times faster
If you can make diag_tickTime free, you can make the log macros free.
Well.. Yeah.. I can just make them.. not log
That's the point. Make them not log unless you enabled debug mode to half or full.
But that will only work if you know the debug mode at compile time
You could use a command line parameter to enable debug mode then
Well, DEBUG_MODE_NORMAL and DEBUG_MODE_FULL are the macros.
Google has sort of failed me; is getting ai to cross bridges (on foot or vehicle) as part of their normal pathfinding a lost cause?
Possibilities to manually set macros when a script is compiled might be added later
@calm sparrow Quite sure yes.
Yes, Val.
Being able to set global defines for every compiled script via command line parameter or SQF command should be enough for what you need right?
Pls no #define true false tho
I wonder what actually would happen if you did that
Could also use sqf syntax. Kinda like disableSerialization.
depend what kind of bridge it is
setDebugMode 0;
setDebugMode 1;
setDebugMode 2;
idk
I could make
"DEBUG_MODE_FULL" setPreprocessorDefine <value>
if you use nil or.. dunno some placeholder it undefines it.
Every script you preprocess after that will have that define set
Till you unset it or restart the game
Don't think you can make a command use nil.
It's backwards to have a command set macro defines.
Ugh.. Okey you can't pass nil. Then I'll just use empty array or smth. All defines have to be string anyway. So if you pass non-string I remove it.
The command is intended so you can use it in the debug console or smth
You won't use that in non-dev environments anyway
Now I can make stats on which SQF commands are used how often. I can even see which file uses which command how often
private ARRAY in ACE: 1
private ARRAY in Life: 166738
I can still only dev at work though. And I can't test stuff here :/
Does Life, whichever derivative of it, really use 170k private ARRAY, or are you kidding?
kidding
Don't do this to me.
Do I look like I would run any life script?
Well, you do have a furry avatar.
Urg...
*puke*
Wow.. I just optimized selectRandom and made it select the value at compile time...
Wouldn't that mean the function picks the same value every time?
yeah
Well...
But atleast it's faster now
π π¨
lol
We were talking about realism yesterday. Would you make a Benford's law compatible random command?
need to google that first
It's awesome. Do it, think about it.
Reject it, and then try it out yourself, and realize we live in the matrix.
Is that nonsense or would it make sense to have that in arma
Better than breaking selectRandom.
I'm looking through all ACE scripts and trying to find constant stuff
https://github.com/CBATeam/CBA_A3/blob/master/addons/music/fnc_compileMusic.sqf#L24-L25
Another very neat thingymabob. These configProperties calls are evaluated at compile time once. :U
But It's cached anyway
Something something, preprocess at build time.
Ewwww I just stepped into a fleximenu π©
I saw a wild typeName and immediately evacuated
Well, you can't blame them for that.
That's what they had to use.
Things I don't understand is making long as if statements about _shift, _control, _alt.
[_shift, _control, _alt] in [[true,false,false]]
^ Because I'm pretty sure this worked even in A2.
atleast that doesn't actually call true/false anymore with the optimizer :3
Yeah, I'm sure people will like 84 -> 85 FPS.
You know what they'd like more? 40s faster game boot time.
I guess? They do seem like the launcher.
Did you test how fast Arma starts if you uncomment the preproc/compile of CBA_fnc_compileFunc
Well 70s -> 0s
There is some tiny scripts for caching in preStart ACE, but the bulk is preprocessFile.
Can you imagine if it still did this at the first mission start?
Stats on preproc and compile times for stuff. Neato.
So much stuff on TODO list. But actually cannot even work on it
Reposting here if anyone can run this code in debug console:
π€¦
Its about the noise it makes
what noise?
Obviously it does. Because the hint runs like every frame
You just moved up the sleep though
wait thats wrong copy pasta
now it runs every 2 seconds roughly. The code you had before had the sleep wrong and would run every frame
fun fact: this used to crash the game
the game couldn't handle trying to produce that many sounds so fast and just crashed π
Yeah. You call hint every frame. Which obviously causes the hint sound every frame
and a sound that plays 60 times a second.. Could be called a "noise"
"earrape"
"ea" "rrape" ?
EA Rappe? What's a rappe?
"eardrumstroyer"
nvm still morning for me
What's going on?
how do i change the ordre of gui controls? Cause it seems my picture is infront of all my buttons
the ones below are in front, the ones above and behind
the ones on top are behind, the ones below are in front
ah, the message went through this time
aight thanks π I will try and see if it works now
@lone glade well the text i added is infront of the picture but it seems the buttons are still behind it hm
i have pmed u the code
oh, didn't realize it was for life stuff, sorry.
Yes, exactly.
lol
Sorry my bad was just looking for where I had done it
str configNull?
if (isNull (missionConfigFile >> "VirtualItems" >> (_x select 0) >> "processedItem")) then {
blank, X39
just "".
Which is infuriating when debugging it with the console
Also, >> errors when used on a non-class token on the lhs.
btw.:
inheritsFrom configFile == configNull // true
configFile is not inheriting so that was to be expected
Yeah, but the == reporting true for a null thing is.
well null and null are clearly equal aren't they?
Both start with N.. Like.. Not False
Then explain the twenty other null things that make == report false.
:magic:
(β©ο½-Β΄)βββοΎ.*ο½₯ο½‘οΎ Null
One sec
static auto kirbyType = host::registerType("KIRBY"sv, "kirby"sv, "Dis is a Kirby. It does things."sv, "Kirby"sv, createGameDataKirby);
static auto _kirbynull = host::registerFunction("kirbyNull", "Creates a non kirby thing", userFunctionWrapper<createKirbyNull>, kirbyType.first);
getArray (configFile >> "cfgVehicles")
what is this returning?
[] and I think RPT error, and once on screen error.
error or non-stoping error @little eagle ?
non-stopping
does CONFIG select NUMBER with index == childcount also return nil?
Good question, no idea.
select's kinda shit. Thankfully we have configProperties/Classes now.
wut?
What I wrote.
select and configProperties do different things
Description for getObjectMaterials: Gets all custom materials associated with the object... Is it working only if on object was applied texture with setObjectMaterial ? - fixed*
configProperties horrible command to implement ...
It too needs hiddenSelection's if that is what you're asking.
getObjectTextures return patch for hiden selections textures, but getObjectMaterials return ["",""]; So i'am asking is it works only if on object was aplied material ?
with setObjectMaterial
or its broken ?
Maybe it has no material?
Soldiers probably don't use them, because hidden materials break damage / wound marerials. So no bloody uniforms.
Well, not one you can change. Idk, give an example.
copyToClipboard str ({getObjectTextures _x} forEach (allMissionObjects "LandVehicle")); // ["a3\soft_f_beta\truck_01\data\truck_01_ext_01_co.paa","a3\soft_f_beta\truck_01\data\truck_01_ext_02_co.paa","a3\soft_f_gamma\truck_01\data\truck_01_mprimer_co.paa"]
copyToClipboard str ({getObjectMaterials _x} forEach (allMissionObjects "LandVehicle")); // ["","",""]
The truck probably doesn't use hidden materials.
hmm
You have to set them up in config:
hiddenSelections[] = {"camo1","camo2","camo3"};
hiddenSelectionsTextures[] = {"1","2","3"};
hiddenSelectionsMaterials[] = {};
That's probably what it looks like.
So no hidden materials on these selections.
so yes, there was no hidenSelectionMaterials and command works...
how can I make X number of buttons, spaced out evenly horizontally across the width of the screen?
i'm rusty as hell on UI
#define WIDTH_TOTAL (safezoneW - 2 * (93 * GRID_W))
#define WIDTH_GAP (WIDTH_TOTAL / 100)
#define WIDTH_SINGLE ((WIDTH_TOTAL - 6 * WIDTH_GAP) / 5)
class menuBar: RscControlsGroupNoScrollbars {
idc = IDC_menuBar;
x = QUOTE(0.5 - WIDTH_TOTAL / 2);
y = QUOTE(safezoneH + safezoneY - 9 * GRID_H);
w = QUOTE(WIDTH_TOTAL);
h = QUOTE(7 * GRID_H);
class controls {
class buttonHide: ctrlButton {
idc = -1;
colorBackground[] = {0,0,0,0.8};
x = QUOTE(1 * WIDTH_GAP + 0 * WIDTH_SINGLE);
y = QUOTE(0);
w = QUOTE(WIDTH_SINGLE);
h = QUOTE(7 * GRID_H);
text = CSTRING(buttonHideText);
sizeEx = QUOTE(5 * GRID_H);
shortcuts[] = {"0x0E"};
tooltip = CSTRING(buttonHideTooltip);
onButtonClick = QUOTE([ctrlparent (_this select 0)] call FUNC(buttonHide));
};
class buttonLoadouts: buttonHide {
idc = -1;
x = QUOTE(2 * WIDTH_GAP + 1 * WIDTH_SINGLE);
text = CSTRING(buttonLoadoutsText);
onButtonClick = QUOTE(createDialog QQGVAR(loadoutsDisplay));
};
You use macros and math.
macros? i don't like the sound of that
If you want to make life harder for yourself, then you can avoid them.
Some people want a challenge, I don't judge.
I've encountered a weird issue. Everytime I use sqf ["Open",true] spawn BIS_fnc_arsenal; in the debug menu, systemChat no longer works.
Seems to working fine in the editor.
how would switch camera work with the player's camera set if I were to use a custom one in replacement?
IE:
Custom one is created -> How do I use this one instead of the external or internal camera for the player?
if i understand what you asking...```sqf
0 spawn
{
private _camera = "camera" camCreate eyePos player;
_camera cameraEffect ["internal", "back"];
_camera setPosASL eyePos player;
_camera setDir getDirVisual player;
sleep 5;
private _camera_2 = "camera" camCreate (player modelToWorld [0,5,1]);
_camera_2 cameraEffect ["fixed", "front"];
_camera_2 camSetFov 0.5;
_camera_2 camSetTarget player;
_camera_2 camSetRelPos [0,0.5,1.5];
_camera_2 camSetFocus [5,0];
_camera_2 camCommit 1;
waitUntil {camCommitted _camera_2};
camDestroy _camera;
sleep 5;
_camera_2 cameraEffect ["terminate","back"];
camDestroy _camera_2;
};
@meager heart Not exactly, I want to adjust the position of the player's external camera.
switching to the camera using:
player switchCamera _camera;
doesn't seem to do anything, as i think the default camera set is taking control
Is that _camera target or new camera ?
new camerate created via camCreate
Then i think its wrong wait...
target switchCamera mode or switchCamera target
That dont work for switching to new or "some camera"
Right, my bad meant just:
switchCamera _camera;
^ Local to player
yes and that variable _camera shoud be target or mode and not new camera
oh...so:
_camera switchCamera "EXTERNAL";
?
or player switchCamera "External";
hmmm, I'll try this out. Thanks for the feedback
yw
Why can't I do getDir to an emptyTrigger and return the direction it is facing?
a triggers direction? π€
I was.
@worn igloo known bug. Not sure if a fix is/was on the way or will be or.. whatever
anyone know how to make something trigger when you close the arsenal?
trying to make it save loadouts for respawn when people change things
@vocal knot Well idk how arsenal is closed, but if its by button then yes just when the code executes you can excute a save command. If it can be closed by escape then save onKeyUp
@tough abyss can be closed by a few methods, was wondering if there was a more concrete method, ive seen it done before
something I can do to the addaction command when i call the arsenal?
Youve had your warnings, goodbye.
arguing with mods always ends well
Especially when he was warned and told to stop.
...and this is why we screenshot everything.
heh
best of luck to you, moderating is a pain
@tough abyss hm ive seen it done maybe i need to find the guy that did it
say
u know how some jets have like afterburner enegine effects
is there a way to put those effects on other jets
like take a f-22 afterburner engine glow and put it on ohhhh say a helicopter
could it be done someone with scrpts/config editing or something?
@vocal knot There is a eventhandler for Arsenal close I think.. Should be. There 100% is if you have CBA
look at BIS_fnc_addScriptedEventhandler
yeah ill check it out
is there a way to get a less crappy map view in the BI observer mode, or just ditch it altogether and make something custom?
like this is horrible, isnt it
the fuck is happening there O.o
is it a really small window?
because that looks like a scaling issue
the watched unit is off map, but its not alliged properly, the borders dont fit (why are they any in the first place) and not full screen
i cant figure out this ace arsenal default loadout thing....
not sure how im meant to open it in the editor
W.I.K.I
Well.. Then you didn't read it
click on a unit and press edit loadout
edit said loadout
click on loadouts in the menu bar
go to default loadouts
type a name
save
well, considering there's only one way to access ACE Arsenal there and that the default loadouts save button is not disabled I'd say it's pretty obvious
wut
and im telling you its not obvious lol
but then again I made it.
It doesn't work like that tho. You can't scream at people that something is in the wiki when it isn't
So i'm kinda biased.
if it was obvious i wouldnt ask π
While in 3DEN you have the ability to save default loadouts in ACE Arsenal
at release
When they Added Eden
i never knew that
they added a ton of stuff to this that i probably dont know about... havent been playing all that much since it came out tbh
is this important
no
ENUM BOIS
May a String definition in SQF span over multiple lines?
"Here I start
And here I end"
Somthing like this?
Yes.
Alright thanks
You can also use endl.
Huh?
Ah okay... No I was just asking because I need to know whether my lexer may match a String over several lines ^^
But the NL character would be included and respected in the String if I use above definition? Interesting...
Dunno. May depend on where it's used. \n is usually for hint, tooltips, multiline text controls etc.
Oh and while we're at it: Can a String enclosed in single quotes also use a "double-singlequote" as an escape sequence for getting a single quote in the String?
'This is ''MyString'' '
Like this
I have no idea. : (
Same here. Never tried. I'll ask SQF-VM
Should ask the game instead.
I'm speechless... The SQF-gurus having no clue. What a time to be alive π
I can't aa...... I'll ask the game...
π
But that will probably take longer than how long you take to start Arma and test
Alright I'm gonna check it and report back... Just let me switch PCs...
Let's see who's faster
' "" ' ?
Oh and while we're at it: Can a String enclosed in single quotes also use a "double-singlequote" as an escape sequence for getting a single quote in the String?
'This is ''MyString'' '```
'This is "MyString" text'
Otherwise it will just fail
So no double-singlequote escaping?
Why should it?
Because it works with double quotes
'' != "
I know... But it could have been that the Devs implemented it for both
For what?
No clue what you want
And I just checked in-game. It does work!
NOOOOOOO I was soo close
π
So we conclude that 'This is a ''Test'' right here' wil translate into the following String: "This is a 'Test' right here"
Whohhh that is clever
They don't have a hardcoded " or '
They search for either of them and then just use whatever character is at the current position
Instead of filtering hardcoded for " or '
It even works with {}
Whutt?
You can have preproc thingies inside multiline strings btw
I can define Strings with {}?
"I am a
#define me is string
string"
stuff inside {} is a string yeah
kinda
somewhat
Now I am confused xD
yes
It's a string, but not STRING type in SQF.
Does the preprocessor stuff has to be at line start or can it be anywhere inside the String (consuming the rest of the line of course)?
Pretty sure # has to be the first char, minus whitespace
# define BLAH
Like this would work iirc.
But there can be whitespace.
The preprocessor also trims left whitespace.
Not sure on the space between # and define tho.
you mean the space between #define and it's content ?
for #line that's a no
for #define it..... doesn't
Doesn't what?
So no # define not allowed
So no # define not allowed π
yes
So it's allowed
no
2x no = yes
yes
So no, (komma) # define is not allowed.
π
no no
Yes?
yes, no
basic human communication is hard
At least, i am not a french
the proof?
the conversation above
At least, i am not a french
π₯
I made a screenshot!
So close to becoming malcom in the middle theme
That was what I was going for, but no one remembers it here.
Yo, what do i have to put in the onButtonClick field to make this: ```hpp
class LastPos : Life_RscButtonMenu
{
idc = 1001;
type = 1;
style = "0x02";
colorBackground[] = {0,1,0,0.5};
text = "Discord";
onButtonClick = ????????????????;
x = 0.247344 * safezoneW + safezoneX;
y = 0.665 * safezoneH + safezoneY;
w = 0.12375 * safezoneW;
h = 0.033 * safezoneH;
colorBackgroundActive[] = {0,1,0,0.7};
colorBackgroundDisabled[] = {0.95,0.95,0.95,0};
offsetX = 0.003;
offsetY = 0.003;
offsetPressedX = 0.002;
offsetPressedY = 0.002;
colorShadow[] = {0,0,0,1};
colorBorder[] = {0,0,0,0};
borderSize = 0.008;
};
take you to a website??
hrefs?
Make button text use <a href...
On text, not button
Yeah... RscText?
Yeah
Ofcourse... That's what i thought! Thanks booboo π
{
_x moveincargo [(vehicle (leader _driver1)),(_foreachindex + 1)];
_x assignascargo (vehicle (leader _driver1));
}foreach units _sq1;
im having an issue where all my units disembark the vehicle
prematurely
as in right when it spawns
guys
i used pushback a lot but i discovered something wtf
_tab = [2,2,2];
_final = _tab pushBack [];
hint str _final;
the hint display : 3 (the array's size)
ok xD thanks
π
actually i was trying to add en empty array at the end, using the + operator like this
_final = _tab + [];
but it didn't do anything so i tried with pushback but i forgot that it modifies _tab instead of returning the array in _final
By the way the solution with + was this :
_final = _tab + [[]];
Hey guys, if you use a command that is in CfgDisabledCommands, will an error get thrown or even a RPT message?
Also IIRC href must be in structured text, i.e.: RscStructuredText or RscShortcutButton @dusk sage @chrome mason
Is there a script that can disable the "marker" that follows you when you are in a parachute
@rotund cypress there is just an rpt message saying the command was blocked/disabled. It won't give you any more info
ok cheers
Hello there,
I'm pretty desparate about one specific issue. You may have also experienced it.
it's the "error: no unit" bug. Basically name _player returns "Error: no unit", getplayeruid _player returns "", isplayer returns false, player body doesn't dissappear after disconnect, there's no disconnect event triggered, and who knows what other things. Also, public variables on the player (setvariable with public flag) doesn't propagate to the new player object. Basically it ruins some pretty serious stuff.
So... does anybody know what may be causing this issue and how to avoid it? My best bet is that it is respawn related somehow.
We've been getting this bug a lot lately on our servers. Before it was a bit more rare, but now it is happening pretty often. Last time I checked, 5 out of 60 players had this issue.
Oh and it is totally different on each client/server.
The name and player id will always work on client side, but player is null server side.
However, name player when dead will return error no unit
Regardless of unit being null or not.
Object variables always carry over if someone dies.
And bodies not deleting when someone disconnect is something wrong with your mission and not an arma bug, just use ondisconnect eventhandler and delete the object.
@lunar mountain
These are pretty much alive :D
"Object variables always carry over if someone dies." - It should, yes. we have a failsafe variable set on players when they join (profilename basically) and every script checks for that variable as name (and falls back to name _player if it's not available). Lot of " error: no units " on map, UI, nametags, etc. So I'm pretty sure it does not propagate over.
My problem is that getplayerUID also returns empty string, which f-up our position logging, same with no disconnect event.
may be something with how respawn or some eventhandlers set up, but either way, it is not expected to have issues like this. I hoped someone had this issue and figured it out.
So right now to have the names and playeruid working, players should reset those custom variables every time they respawn. Which is not a problem, it is just not a real solution :/ Also, I cannot fix not having a disconnect event with this. I use handledisconnect, although now that I looked up, I'm adding this EH 3 times (logging, cleanup and for HC handling)
although the bug happens before the player disconnects, having no DC EH is just a mere symptom as I see it
I want to use assignAsCargo to get units I've spawned via script to be able to disembark a vehicle when theyve received a waypoint to do so. I'm having a problem in that after i use assignAsCargo, all the units will immediately disembark. If I use moveInCargo without using assignAsCargo, the units will remain in the vehicle, but they will not disembark it. Is there something I could do to have the units be able to disembark via waypoint as normal?
is there an EV that triggers when I'm in a vehicle and press left click for the horn?
I thought about Fired, but don't know if that should actually work
Fired should still fire
worked around it by assigning the unit as cargo only when theyve arrived at the location
in case somebody needs to check a config entry: https://cdn.discordapp.com/attachments/365803725123747841/398619554848178176/unknown.png
just chat with him π @signal peak
config loaded is from version 1.62.137494
Guys, looking for coder for finish new version of MOCAP Melee mod, add ACE wounds compability, PM me please
@night void #creators_recruiting is where you need to be posting that
@subtle ore is no one response in this channel...
@night void Doesn't matter, that is where it belongs. Don't expect someone to reply to you immediately. You should not expect that anywhere.
not him again
As Midnight said: Post your stuff in 1 Channel, not 2, not 3, not 4, just 1
(Oh and, you can delete one of them)
_n = 2;
private _return = switch(_n) do {
case 1: {"one"};
case 2: {"two"};
case 3: {"three"};
};
"number " + _return;
How do I rewrite this to properly return the value from case to _return?
the way I have it written the results is number true
try this in your case statements "case 1: {_return = "one"} ;"
trying to avoid having _return = in each case. I think there is another way.
fair enough. not sure π
usually it returns true if there's no default. so it doesn't seem to be reaching any of your cases.
if you set a default and _return becomes the value of the default you can know for sure that it hasn't hit a case.
Yeah it should return whatever is inside of {}
ok, I'll look into it
I just executed that code block in the debug menu and it correctly returned "number two"
yeah I'll debug why it isn't going through any of the cases.
have fun π
question
is there a command that allows u to set the thrust of a vtol
lik say for example
power of 75 makes the vtol when the thrusters are at full 90 so taht it doesnt move up or down, the thing is thatits kinda hard do to that cause u use shift and z to increase/decrease thrust so u can easilty jump between 76 and 74 percent thrust
nbm
nvm
I found it
_this setAirplaneThrottle .5;
``` incase if anyone wants to know
is there a command that is similar to modelToWorld but uses a position as the argument?
@stable wave Yes! https://community.bistudio.com/wiki/modelToWorld
It is like.. 100% similear and uses a position as argument
_n = 2;
private _return = ["null","one","two","three"] select _n;
"number " + _return
trying to avoid having _return = in each case. I think there is another way.
Seems irrational. You should avoid_return = switch ...and_return = if ...instead, for they are ugly. @tulip cloud
@still forum Β―_(γ)_/Β―
@little eagle If it was actually that simple of a problem, I would have indexed it like you did. But I'm taking some params and they are being processed depending on the case. then the results are sent to another function for further processing.
Well, that is not what your example shows.
But yeah, switch reports true if no case is sound, and no default block was defined.
Anyway to get extended event handlers to run for built in map object with Land_ prefix?
Nvm, I see you can't set variables on them either
i think itβs a performance trade off
Setvariables on buildings on map? You can do that
Not the one I tried. It has no typeOf
what building is it?
how to spawn a vehicle in a random radius without having it getting created inside an object and explode?
_vehicle = createVehicle [_vehicleClass,_spawnPosition,[],_spawnRadius,"NONE"];
Delete everything in that radius.
is the safePos function from BI any good?
Not really, no.
Guys
how to check if ACE mod enabled and what Medical module using currently?
how get current ACE bodypart damage statement?
how to check if target is ACE Uncon now?
Spawn it elsewhere disable damage, setvectors and setpos to new location, enable damage etc (been awhile since i looked at that stuff though)
Really annoying you cant supply direction/vector when using createVehicle etc
@elfin palm "Land_WoodenCounter_01_F"
@tough abyss interesting idea
selectBestPlaces is better
@little eagle answer me please in PM about ACE, thank you
how to check if ACE mod enabled and what Medical module using currently?
!isNil "ace_medical", and I don't know
how get current ACE bodypart damage statement?
There is no such thing.
how to check if target is ACE Uncon now?
_unit getVariable ["ace_unconscious", false]
iirc
May be "ace_medical_unconscious" or "ace_isUnconscious". It's somewhere in the doc.
where to find ace docs? google bitching me with it
β€
https://www.google.com/search?q=Arma+ace+docs Β―_(γ)_/Β―
y but here no info about medical framework!
Then: It's your problem. =}
Well ACE is open source and each script function is documented there. Just look there
Well makes no sense to ask these questions if you don't know how to code.
im looking for funcs and use examples π
I guess, then it's time for you do some work on your own (at least this time)
anyone have an example of a customChat / radio channel working on a dedicated server mission? having alot of trouble using it and the docs are lacking
@little eagle did u find how to kill target with assigned killer? we already tryed it with SetShotParrents
Does the case of the letters in a hexadecimal number in SQF make a difference? Or is the hex-spec case-sensitive?
@errant jasper can you not use set/getVariable on it?
@elfin palm I did not try that exact combo. But I did a setVariable on it in the debug console, and then used allVariables to read and it always returned [], even after using setVariable.
Not used allVariables before, but you should be able to retrieve anything done with setVariable through a getVariable on the same object.
@scarlet spoke insensitive
Does that also apply to the 0x prefix? So can I use $ 0x and 0X as a prefix for a hex-number?
@still forum
Alright then I will consider it case-insensitive until proven otherwise ^^
Thanks
@elfin palm Just tried set and then getVariable, and no it does not work.
post code block
you can't muzzleflash
also how do you do code formatting on this?
`
mycode
`
ty
_building = createVehicle ["Land_WoodenCounter_01_F", getPosATL player, [], 0, "CAN_COLLIDE"];
_building setVariable["foo","bar"];
_var = _building getVariable "foo";
hint (_building getVariable "foo");
AAAAH
that works for me @errant jasper
I am attempting to use structures already on the map.
Okay, and you have not been able to setVariable on the individual objects?
I just did a quick one again on utes, used nearestTerrainObjects to get the building and then assigned it using set/getvariable and that worked for me.
buildings != land objects
I did it with a fence
please excuse my terminology
if it works with a fence should be fine with your wooden counter
Nope, I'm wrong, looks like it was a false positive earlier, good luck anyway π
anyone know any jumppack scripts? not a jetpack where u can hover but more so well.....a jump pack
i made one and im not sure if its all that well
here I guess ill show it
removeAllActions _this;
_this addAction ["<t color='#A668C2'>jump</t>",
{
directionPerson=direction (_this select 0);
horizontalSpeed=6;
verticalSpeed=15;
(_this select 0) setVelocity [((velocity (_this select 0)) select 0)+(sin direction (_this select 0)*horizontalSpeed),
((velocity (_this select 0)) select 1)+(cos direction (_this select 0)*horizontalSpeed),
verticalSpeed];
(_this select 0) allowDamage false;
(_this select 0) setvariable ["jumping",true,true];
sleep ((verticalSpeed/9)+(verticalSpeed/9)*.2);
while {((_this select 0) getVariable "jumping")} do
{
[west, "HQ"] sideChat Format["t %1",time];
if((((speed (_this select 0)))==0)) then
{
(_this select 0) setvariable ["jumping",false,true];
}
};
(_this select 0) allowDamage true;
},[1],0,false,true,"User15"," driver _target == _this"];
hint format["done %1",time];
but I was wondering if there was better I guess logic to making a jumppack
well that was fun to piss about with in the editor lol.
would be good to not allow consecutive jumps while in the air
Simply add a condition for the action so that it will only reappear n seconds after being invoked the first time. That should do it for most cases
[] spawn { while{true} do { <CODE>; sleep 300; }; };
All, I am trying to integrate ALiVE and UCM (https://forums.bistudio.com/forums/topic/210728-ucm-utilities-construction-mod/). I need to force the spawning of ALiVE virtual units when they are around the AI workers so that they attack them and, to do so, I have an idea.
ALiVE relies on allPlayers to decide whether to spawn / despawn units: if there are any players close to "virtualized" ALiVE units, they will be spawned. The interesting thing about that is that allPlayers returns not only players but also all connected Headless Clients. I am hoping to manage somewhat to create a HeadlessClient_F in the construction area that arma thinks is connected which, in turn, would make ALiVE spawn units.
So the question is: does anyone know the internals of HeadlessClient_F to make arma return a logical unit in the list of allPlayers?
@night void No.
no what?
is there a command that allows u to make the y axis inverted for say the gunner on a vtol?
did u find how to kill target with assigned killer? we already tryed it with SetShotParrents
No, I didn't.
@edgy dune No.
awww shit,cause theres this vtol where the gunners seat gun is inverted in the y axis
@little eagle π¦
guys, any way to stimulate player to throw own spawned grenade and assign player as thrower?
is there any wiki for making tables
Woodworking books probably
well i guess, but i actually meant liike in lua you can do
table = {};
table.whatever= {
image = "imagepath/blabla.paa",
name = "whatever";
};
table.whatever2= {
image = "imagepath/whatever.paa",
name = "whatever 2";
};
is there a way to do something kinda like that maybe with array
none of ther comands are making the car move
vehicle player sendSimpleCommand "foward"
is there a way to do something kinda like that maybe with array...
Tables in lua with arrays - https://www.tutorialspoint.com/lua/lua_arrays.htm
OK I am looking into headless clients and that got me wandering. Letβs say thereβs a mission with 100 AI, and 5 human players. Is there a significant fps improvement if each client spawns 20 AI that therefore have locality on different machines vs the server spawning all of 100?
okay thanks π
Did i reach that point where i am asking questions that are out of this dicordβs knowledge? I that even remotely possible? π€£π€£
well then
will try experiments and report back!!
π
@candid jay probably not
Also that's not #arma3_scripting so no wonder you don't get a answer about that here
not only that but the answer vary depending on the hardware used
Its also pretty subjective i.e what is server fps / number of objects/vehicle etc
Also Is the AI near each other or spread out etc, due to HC beening basically a client
Easier to just test it out if you got spare hardware/resources for HC & test it yourself
what i am saying is: if hc can seriously help fps (there are videos of 800 ai on 1 server and 3 hc), why not use the playersβ clients
will try some experiments
Torndeco I get your point, I am just taking about all of them near each other for instance https://youtu.be/ZIWHLbzRpJ8
and basically just curious π
so indeed i will try it out
^ pretty much
HC is using the unused cores / threads on your server to your advantage
understood
You can add eventhandlers for locality changes to handle transfering ai /disconnects etc. It is doable, done it for clientside zombies etc.
Arma pretty stable, no big changes coming . So i would just use HC if you got resources for it, just remember to have HC near AI if possible
Instead of a client who might already have poor fps due to hardware etc
thank you
iirc normal AI (zombies may differ!) have issues when they transfer locality after theyve started combat, due to the danger.FSM not properly migrating over.
@candid jay Don't expect magic from HC, yes it works, but nothing really major will happens...
And about this video you posted "with 800 AI" Check this https://gyazo.com/a989a8867043394e3f151181c0e45334 no HC and 600 + AI and all of them with waypoints in cycle, server fps at bottom left
That's obviously only because the server doesn't need to simulate their helmet straps coming loose
π
or because they're not engaged
place down an "enemy" unit or make them fight and watch the framerate crumble
On server not really
I'm gonna eat all your kittens
That's a nice name Dedmen, very readable.
Snakes also not bad
^^_
Can u hint only to a specific person?
You can only hint to.. yourself basically
hint is local so where you execute it there you hint
you can execute anything on a specific person.
oh lol ive been hinting globally
π€ "Hinting globally" ?
remoteExec with -2 as target
it'd just be local to the server if you were to hint on the server
hints @subtle ore the exit globally
Hm
so i want to randomly select (and display on the map) one from a number of pre-selected map markers in various locations
i was going to do this by making a bunch of hidden map markers, and then iterating through them picking one at random. before i go down that rabbit hole, i wanted to check here and see if theres a simple solution or if i'm even spinning in the right direction
for starters i don't even know how to make a map marker hidden
yeah, get an array of possible positions, the types of markers and just create them on the fly