#arma3_scripting
1 messages ยท Page 329 of 1
Shut up X39
Why should I stupid?
Adding "await" which does not exist does not solve the problem, because the question presupposes what SQF actual entrails.
Not your fantasy improved SQF compile something blah
This cannot be done in unscheduled period.
what you want cannot be done, of course not, but something that achieves the same end result can
Yes, but that was not the question.
wouldn't the best proof for this discussion be someone just submitting a code that you can run yourself and see if it can be done or not?
The thing is that you can't do it in unscheduled environment which then means you have to split the function into two.
Doesn't matter how fancy you will get with that. It can be written easily.
@simple solstice different people in the discussion had different ideas of what it was, so i don't think that will help much
But it no longer solves the initial problem
I submitted my code.
I can't submit code to prove something doesn't work
Which is why everyone waited for Untelo to post something.
i guess you all just misunderstood what i was talking about
Then do you agree Untelo, that what we did understood is impossible?
in sqf yes
Thank you.
Not "we"... You
Everyone can go home now. We wasted our time.
also x39 it was me that asked the question, so i think it's me that gets to define what i meant
You started moving ppl in the wrong direction
Shut up, X39.
lol I think X39 is on our side now
Doesn't matter.
It was commy2 who tried to fuck up by being stubborn and wanting to hear he is right
Nothing else he wanted but an ego boost
_blah = [_code, _args] call my_remoteExec;
This code has a meaning and if you intended something else, you have to specify.
i never said i want _blah to be the result
quoting myself: how do i derive the return value from _blah
Then why didn't you disagree with my example that worked in scheduled and was based on the (fair) assumption that _bah is the return value?
and the answer necessarily involves suspension
And why did you then claim that my example could be done in unscheduled (which it can't as you said)?
and the answer necessarily involves suspension
Thanks for agreeing with me again.
you're welcome...? but when i say suspension i do not mean waituntil/sleep/looping/polling
You can't have suspension in unscheduled environment by definition.
and to answer your question: i didn't realize you had misunderstood what _blah was
you can however return from the function after attaching a continuation
Yes, you can slit your whole function into two. But that is no longer
_blah = [_code, _args] call my_remoteExec;
He did not misunderstood... He doesn't want to understand @pliant stream
You should've clarified that _blah is not the return value. Then no one would've argued with you. Except that you're making stuff WAY too complicated.
Splitting up the function in two is trivial I dare say.
yes commy you're right that _blah cannot contain the result without sleeping, but it can contain a reference to the result, which will become available at some indeterminate point in the future
#include "macro.hpp"
_idc=SEL(_this,0);
_data=lbData [_idc,lbCurSel _idc];
_old= SEL(CONSTVAR(_data),0);
_array=[];
{
_elm=_x;
_d= {_x== _elm} count _old;
if (_d !=1) then {
_old=_old-_elm;
if (_elm in _array) then
{}else{
_array pushBack _elm;
};
};
}forEach _old;
_old=_old+_array;
_old
i dont get it, i dont see a problem here, but get generic error
But not in the same script in unscheduled environment, so it's pointless..
the idea is to remove duplicated items from array
@vivid quartz What line?
probably the empty if () then { /* this bit */ }
call {} is valid
Yeah, it's dumb, but valid.
the error happens on that line though
if (_elm in _array) then
{}else{
_array pushBack _elm;
};
could just be:
_array pushBackUnique _elm;
Does anyone know of a script that allows to place markers like in 3den?
what?
gonna dig more on this thanks @little eagle
@cedar kindle when you place an area marker in 3den you can drag to resize it before actually placing it.
That only works in 3den, but you want to do it ingame?
I think so, but there are probably ways to script it in.
Script theory: while a mouse button is pushed, create a marker from the location of first click to the current marker pos, use a loop of some sort to create and delete the marker every frame.
Probably x100 times harder in practice.
_old=_old-_elm;
_old=_old-[_elm];
that was the problem -.- wouldnt have thought of that
_old deleteAt (_old find _elm);
well you did, didn't you? ๐
Why can't we all be as skilled with SQF as commy?
๐ , thanks guys, @little eagle will do
You've not wasted enough of your life on it.
because there is not enough room for that many idiots in here @tough abyss
We're going to have to open another server for commy... ๐
It will indubitably become a place of calm, intellectual on-topic discussion.
๐คฃ
Anyone know of a way to make an invisible object which can be returned by cursorTarget?
hi!, someone why db value not work? I put the value that I put always I listen to the original volume.
class msg2 {name = "msg2"; sound[] = {$STR_radio_sound_silence, db+0, 1.0}; title = $STR_radio_msg_silence;};```
XD
shit posting? xD
@tardy yacht It could work if the object can be made invisible using setObjectTexture
Otherwise, no, impossible.
hideObject makes it invisible for cursorTarget too
@little eagle I'll try that thank you!
@little eagle
Client: fn_requestVar.sqf
[player, getPlayerUID player] remoteExec ["query_fnc_getVar", 2];
Server: fn_getVar.sqf
params ["_pid", "_sender"];
// Do processing here, then return:
[_varToReturn] remoteExecCall ["process_fnc_returnVar", (owner _sender)];
Client: fn_returnVar.sqf
params ["_returnedVar"];
// Do stuff with the variable here
Technically impossible to do _return = ...RE So this is the only way pretty much
@vague hull yes it is encouraged
Agreed.
for example: what is the best brace style and why is it allman?
@tough abyss
yes, but even more generalized would be, to send the name of the callback too, so you can do something like:
[[params],[function_to_call,callback_fucntion,who_to_call]] remoteExec ["commy_fnc_execute_and_return", 2];
commy_fnc_execute_and_return:
private _result = (_this select 0) call ((_this select 1) select 0);
[_result] remoteExec [callback_function, who_to_call];
You could pack the callback into another fucntion so you could filter it better
Good idea. I like it
seems to me the most general solution is to just pass code + context as callbacks
Ok want some more trigger? Good:
@little eagle @pliant stream your avatars are the same
4hrs ago:
Doesn't make it better. Split it up to 2 Funcs -> Done.```
the api user can determine what the code and context are
Sorry havent been here 4 hours ago
I was. I went to sleep for a couple hours haha
Nah, it's okay. Just wanted to mention it
Since this nonsense is going on for a while now.
@jade abyss if i understand correctly what you mean, that'll require separate and explicit global state for each call
dafuq?
Lol
Call func on the Server -> Send to Client -> Client calling in that Func another Func on the Server and passes the Arguments. Done.
damnit, Discord is damn slow
@pliant stream not preferably. The problem is with code being transferred over net is the battleye stuff going on, this way just make another function and you only send the name of it (also reduces traffic)
- you cant secure which code is actually being transferred
what if i want to have 1000 concurrent calls of the same function with different arguments?
You spam the network. Great choice.
And still: You have to send it from the Client to the Server.
Real life implementation of needing to do that?
none
nothing else than a single one
Exactly.
It's threads all the way down
But we are talking against a wall, how it seems.
ok back to work, vector timestamps are waiting ..
gl hf
so you send a message to server saying call function X and send back the result, server calls X, gets the result and sends it to client saying here is the result of X, if there were two client->server calls to X, how do you associate each result message with the correct caller?
just run every line of code on it's own thread. max concurrency. instant execution time right?
+As mentioned min. a thousand times before: SQF != C++/C#/Java/Whatever
there are green threads
call them how you want, nothing is executed in parallel
which is what a green thread is...
anyway... while SQF is indeed not another language (not sure why you would even make this assertion but ok) the problems of scalability with global state are the same
not really too
you don't need to use globals
you can remote exec something that remote execs something back
lul
with no globals involved
so you send a message to server saying call function X and send back the result, server calls X, gets the result and sends it to client saying here is the result of X, if there were two client->server calls to X, how do you associate each result message with the correct caller?```
Yes.
2nd: A PubVar on the Server has to store it, until it'sfinished (e.g. sending timestamp over and use ```sqf
_TempVarName = format["Bla_%1",diag_TickTime];
missionNameSpace setVariable [_TempVarName, []];```
(basic EXAMPLE).
so you send arbitrary code to the server for execution? that doesn't seem very secure
Like my example, simplified by Senfo
it's a game
all the more reason for security then
who is sending arbitrary code to server?
wtf dude, you just wanted to do exactly that
every single client is hacked and every single player is trying to cheat, that's the basic assumption you have to make
Cs, stop it.
๐
๐
Just sayin
don't have to be arbitrary code anyway, you can just whitelist the appropriate functions
not just installing it, you need to "norton.exe" callExtension "no_hackerz_plz"; tho
if you really want to
what i do is have a list of events on the server that are callable by clients
and they don't know what code is calling them
Not the first that you talk nonsense and can't back it up.
First you claim that remoteExec can return the Vars from the Client back (without executing on the Server), then claiming that you can "wait" without waitUntil/sleep/similar Stuff.
This:
https://i.gyazo.com/3b479dd26f519fd091eb38277a93695f.png
Just don't work.
why not? it just says call function on server, when server returns at some future time, run this other function
it can work in scheduled
so yes it is "splitting into 2 functions"
...
but it does so without global state specific to this callsite
Remote execution doesn't return anything of value.
sshhhh, we just said that ~10 times or so^^
of course it doesn't, you have to use another PV or RE in the other direction to send back the result
you can design a system that does
Differse from what you said earlier.
Then ffs prove it.
note the difference between remoteExec and my_remoteExec
i think what you've actually done is made waituntil in 500 lines of macros and functions
my_remoteExec returns a future
Yeah, and whats inside that my_remoteExec?
boy.. so much nonsense.
getting tired of that
it DOES NOT return the value of (_args call _code) as executed on the server
speaking simple:
glub = 1;
publicvariable "glub";
//PVEH for glub
foo = 0;
publicvariable "foo";
//PVEH for foo
glub = 0;```
I didn't realise this Discord had a role for a life mod
Hey, I have a script that I use to regear AI as they spawn in my community's main sandbox, but I was wondering if anyone knew of a way to plug it in to the AI that spawn in Patrol Ops. Any ideas?
I am building a simple custom Patrol Ops server.
With crazy monetization ๐ค ? https://community.cityliferpg.com/store/
No ๐
How do I regear AI units spawned by the Patrol Ops modules. Any ideas?
thanks @dusk sage ... now i have to vomit
https://i.gyazo.com/a963c14c42ace2748833e6aac1fdbe69.png @queen cargo ๐คฃ
Wow, $20 for a hummingbird.....
๐ค
Better let everyone know, hardcore monetization is cool with BI
pretty cheap, I payed almost 60k last time I bought one
@vapid frigate, in a mission script. No mods.
๐คฆ
+1 ^^
not sure then unless you can run a script as you spawn them
(in the spawning script)
How did it get to the point where Dscha is the most sensible person in this chat?
I've already got the gear scripts that I use for other projects, but now I'm just trying to find how to "hook" them in. Some kind of event handler or something.
I know.
scripting channel is more like debating club
I disagree!
Most active room on this server...
As usual.
This is the channel where I tell you why you're wrong.
lol
you are really stupid are oyu
you remind me of that one classmate
that thought he was the smartest
and always tried to compete with everybody
shovling his own grave
we called him "kรถlsch"
everyone, get your dicks out and compare :3
My Dad can piss further than your Dad.
im confused
Where did I shove my grave? Where was I wrong? I have no problem with being disliked by anyone. I just want to be right.
by loosing the focus
and putting it on trivial things you missunderstood
not getting the key
but finding ways to just be right
not helping
I lost focus? By demanding that the set problem was solved ?
Might need to introduce a #roastme channel
Alright. Back to #arma3_scripting
I did not loose focus by demanding that the conversation not gets shifted to green threads or red threads.
That's just not true
Take it to private chat.
๐คฆ
You're dumb X39.
there
The best channel.
My Dad can piss further than your Dad. ๐คฃ
The Best programming language, the best channel.
this is an SQF channel not C++
"best" was meant ironically or do you think anyone would sincerely say this is the "best channel"?
๐ค
Come on. It's not that hard to figure out.
this chat is giving me diabetes
who's the best scripter anyway? commy or x39?
Neither
if it was top trumps which one would win?
Uhhhh
someone would win bigly
hey all, can someone point me in the right direction please, i'm trying to prevent players spawning in with UAV terminals after being in the VA for for some odd reason this doesn't seem to work ?
private _baditem = ['B_UavTerminal','O_UavTerminal','I_UavTerminal'];
If (assignedItems player in _baditem) then {
removeAllAssignedItems player;
};
any ideas?
{
player unlinkItem _x
} forEach ['B_UavTerminal','O_UavTerminal','I_UavTerminal'];
ahh gotcha thank you ! ๐
If (assignedItems player in _baditem) then {
this line looks wrong
OPTiX is the best scripter here.
I can't tell what you're trying to tell me
so you shouldn't compare an array to an array?
So I almost got my theory to work ```
[4:43 PM] Neviothr: Script theory: while a mouse button is pushed, create a marker from the location of first click to the current marker pos, use a loop of some sort to create and delete the marker every frame.
It's not that you're comparing arrays.
You're looking for an array of the players items inside a list of classnames
I could use a little help, though.
Obviously it will always report false
๐
You need to loop through the assigned players items and check if the current item name included in your bad items array
*is included
Welp phone
@tough abyss
I made this, but it's not working as intended yet:
My_Draw_PFH = objNull;
addMissionEventHandler ["MapSingleClick", {
if (isNull My_Draw_PFH) then {
params ["", "_pos"];
My_Draw_PFH = [
{
private _pos1 = (findDisplay 12 displayCtrl 51) ctrlMapScreenToWorld getMousePosition;
private _sizeX = abs ((_pos0 select 0) - (_pos1 select 0));
private _sizeY = abs ((_pos0 select 1) - (_pos1 select 1));
_marker setMarkerPosLocal (_pos0 vectorAdd [_sizeX / 2, _sizeY / 2, 0]);
_marker setMarkerSizeLocal [_sizeX, _sizeY];
}, 0, _pos, {
_pos0 = _this getVariable "params";
_marker = createMarkerLocal ["My_Temp", _pos0];
_marker setMarkerShapeLocal "RECTANGLE";
_marker setMarkerColorLocal "ColorBlack";
}, {
deleteMarker _marker;
}, nil, {
!visibleMap
}, ["_marker", "_pos0"]
] call CBA_fnc_createPerFrameHandlerObject;
} else {
My_Draw_PFH call CBA_fnc_deletePerFrameHandlerObject;
};
}];
@little eagle this is what I have ```SQF
#include "script_component.hpp"
disableSerialization;
hint "Click on 2 points on the map to create an AO. Said points will act as the corners of the AO."; // Notify user
openMap true; // Open map
GVAR(isEHdone) = false;
// Add a map click EH
[QGVAR(aoPoint1EH), "onMapSingleClick", {
GVAR(aoPoint1) = _pos; // Assign 1st click pos to var
GVAR(isEHdone) = true;
// Remove our EH to allow compatablity with custom waypoint in nev_a3_overrides
[QGVAR(aoPoint1EH), "onMapSingleClick"] call BIS_fnc_removeStackedEventHandler;
}] call BIS_fnc_addStackedEventHandler;
waitUntil {GVAR(isEHdone)};
_mapDisplay = findDisplay 12;
_mapControl = _mapDisplay displayCtrl 51;
_mapControl ctrlAddEventHandler ["MouseMoving", {
GVAR(aoPoint2) = getMousePosition;
hint format ["%1, %2", GVAR(aoPoint1), GVAR(aoPoint2)];
// Use a function to find the middle point between the GVAR(aoPoint1) and GVAR(aoPoint2)
// Get X and Y of 1st point
_X1 = GVAR(aoPoint1) select 0;
_Y1 = GVAR(aoPoint1) select 1;
// Get x and Y of 2nd point
_X2 = GVAR(aoPoint2) select 0;
_Y2 = GVAR(aoPoint2) select 1;
// Calculate middle
_Xm = (_X1 + _X2) / 2;
_Ym = (_Y1 + _Y2) / 2;
// Choose a point and calculate X and Y distance from it to middle point
_xDiff = _Xm - _X1;
_yDiff = _Ym - _Y1;
// Create marker
_markerName = "AO" + str floor random 100000;
if (!(_markerName in allMapMarkers)) then {
createMarker [_markerName, [_Xm, _Ym]];
_markerName setMarkerShape "RECTANGLE";
_markerName setMarkerBrush "Border";
_markerName setMarkerColor "ColorRed";
_markerName setMarkerSize [_xDiff, _yDiff];
} else {
systemChat "Random marker name creation failed: marker name already exists. Try creating AO again.";
};
}];
BIS_fnc_addStackedEventHandler is soon to be discontinued.
Well fuck me and all my addons.
It's already removed on dev as of today.
Whyyyy... ๐ฆ
there hasn't even been a dev update today (and yesterday) ๐
nvm it happened earlier ๐
Maybe it was 2 days ago, but currently on dev branch, they don't work.
Tweaked: The BIS_fnc_addStackedEventHandler, BIS_fnc_removeStackedEventHandler and BIS_fnc_executeStackedEventHandler functions are no longer supported
addMissionEventHandler
I'm not convinced they will go through with this. There will be backlash and they'll reconsider
Thing is you can't always do that.
They'll get shit from at least 1 person...
Can't pass arguments and can't block input on e.g. onMapSingleClick
So will this no longer work onMapSingleClick {_shift};?
Tweaked: The BIS_fnc_addStackedEventHandler, BIS_fnc_removeStackedEventHandler and BIS_fnc_executeStackedEventHandler functions are no longer supported
That you answer your question.
anyone know what the action is where a player heals himself using medkits?
Hello, i have a little problem with the arma 3 update my hud doesnยดt work anymore can anyone maybe help me, https://i.gyazo.com/b0d0dbda3cf5af69667f06f1ca8fe287.jpg
there's quite a few juxtapositions in that there screenshot there
what did you mean?
ohh ohh
I can help ya
go into your steam workshop
search for anything with "life" in it
delete it
done
nice try 12 year old kid
twist the numbers to get close old man
thankyou @little eagle
someone know what I must set On Act trigger to play a sound with stringtable.xml?
description.ext
sounds[] = {contact_es,contact_en,signal_lost};
class contact {name = "contact"; sound[] = {$STR_contact_sound, 1, 1.0}; titles = $STR_contact;};
}; ```
I tried this: playSound ["$STR_contact"];
its same as cfgradio with *.sqf file?
I tried this:
contact.sqf: playSound "contact"; call BIS_fnc_MP; sleep 1.0;
On Act trigger: _nul = []execVM "contact.sqf";
I get this error: size: 'titles/' not an array
opinions on exceptions in sqf?
error in game when trigger is activated seems to refer to description.ext
@novel elbow heya
@oak marten I was having similar troubles with a script, if you scroll up you should find it all, but I just ended up using CBA_fnc_globalSay3d - not sure if that's an option for you, but it might be worth investigating if you can't get it working this way - that said I wasn't using stringtable.xml, so not sure if relevant. Just take this with a heap of salt cause I don't know shit
I need playSound, no say, or say3D.... The syntax is a little different and I can't find it.
Work (i don't need string): class no_signal { name = "no_signal"; sound[] = {"efs\signal_lost.ogg", 1, 1, 100}; titles[] = {0,"_"};};
Not work (I need string): class contact {name = "contact"; sound[] = {$STR_contact_sound, 1, 1.0}; title = $STR_contact;};
I don't know how write the title string, game show me a error, no entry _patch to description.ext_ /CfgSounds/contact.titles'.
P.S: I find the correct synstaxis:
class contact {name = "contact"; sound[] = {$STR_contact_sound, 1, 1.0}; titles[] = {"$STR_contact"};};
Anyone know a script to get the smallest number out of an array?
@pliant stream if you got a framework, you should use them
for the everyday dev however, there is barely the chance anyone would ever use em ...
@chrome mason yes https://community.bistudio.com/wiki/selectMin
@rancid ruin ty
np m8
ok something weird happend to me. This does not work on my server anymore
[[west, "HQ"], "This is a test"] remoteExec ["sideChat"];
I haven't defined a CfgRemoteExec class in my description.ext but I just did and tried again but nothing still
I have other custom functions that are working with remoteExec but sideChat isn't working at all
this works...
"hello" remoteExec ["hint", -2];
figured it out. This was my original config from CfgRemoteExec for sideChat
class sideChat { allowedTargets=0; jip=0; };
I removed the jip attribute and fixed
@tardy wagon D3D API access might come to Intercept but it's not really planned. We only want to get the basiscs so we can use ImgUI.
dank
Feel free to join Intercept slack for more Informations.
My Internet connection is currently a wifi antenna taped to a broomhandle. So.. I'm not really available for helping anyone right now
It's so hard to find a good ISP in pyongyang. jk. thanks for the info
Hey, I am new to Arma and I am wondering is it possible to create new ai from the ground up and how advanced can I make it
Example: alien crawing on walls and shooting lasers.
I am used to programming.
(Not an expert)
not gonna say it's impossible, but wouldn't be easy
would probably have to use scripted animations/physics, so likely not very performant either
from your example? i would guess animation/movement
in general.. conciousness maybe?
I was just talking about in general .
hey, if anyone knows anything about maps within GUIs (dialogs or Titles), i want to know how to disable the ability for the player to zoom in with their scroll wheel ( basiccally lock the map to one position and zoom). How can this be done?
Info: Mouse Buttons can't be blocked (sadly)
Rest:
https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3
Ctrl+F -> "map" -> there you go (F3 to scroll through the found stuff)
@little eagle this seems to be the culpit with the whole BIS_fnc_addStackedEventHandlers:
addMissionEventHandler ["EachFrame", compile format ["%1 call %2", _arguments, _code]]; };
Don't see how this helps me. All i want to do is show a certain area of a map (which i can do ) and lock it there, so that nothing the user inputs can affect the map@jade abyss
it was rewritten to use addMissionEventHandler
but the compile format should work
Do you expect someone to write it for you, or what do you want? @limpid pewter
Then where is the Prob? Go to that page, search for "map", take a look at the commands.
@tough abyss Is that the actual code they are using now?
https://community.bistudio.com/wiki/mapAnimAdd
https://community.bistudio.com/wiki/mapAnimCommit
https://community.bistudio.com/wiki/mapAnimDone
Seems like you missed about everything ๐
No, i didn't.
If that is what BI is doing now then...
So, i shall explain once more. I simply, want to display a section of my mission's map on to a menu (dialog). Now i don't want the user to be able to zoom, move or by any means interact with the map control on my GUI. This map control will only load the map control once, when the menu is opened and then it will stay on the specific position and zoom i have loaded it with. The links you have given above, don't have any relivance in trying to accomplish this at all. Shall i explain further or do you understand?
1 option would be to prevent it getting focus too
probably.. not sure how dragging goes then though
๐
Click through them, read the descriptions, check the bottom for other commands, that belong to it.
or as dscha is suggesting, you could keep moving the map back to it's original position/zoom
ยฏ_(ใ)_/ยฏ
^ how did you get taht from what dscah was saying?
k
It cannot be done cleanly with scripting. Needs config changes of min and max zoom level.
miscomunication is abish
that's what those 3 commands do.. move the map
thankyou commy and lecks for being helpful, can't say the same for you Dscha sorry
wtf?
@little eagle i can't confirm it is 1:1 their code, but i was sent this by reyhard
and another one for the list \o/
Nice @tough abyss
Code does look familiar doesn't it?
How could I've guess it I wonder. I must be lucky.
@jade abyss you still got that paste laying around from stackedEHs?
Since i am not helpful at all: ( ๐ )
https://pastebin.com/bdwbPqRW
alright it is 1:1 their code
*updated with SQF-Syntax Highlightingthingy
i think it's a good call to get rid of it if that's how it works
@jade abyss Dscha, what do you expect, you didn't explain at all what you thought was a good solution. But i apologise for getting mad, im just frustrated atm.
Prediction:
_eh = compile format ["%1 call %2", _args, _code];
BI
compile format ["%1 call %2", _arguments, _code]];
๐ค
Ya'll suck
nope, just you.
๐
๐
Yeah. That doesn't work. Try again BI.
has it always been like that?
No, it was changed in dev
And it obviously breaks because you can't serialize objects.
Old:
case "oneachframe" : { onEachFrame { ["oneachframe"] call BIS_fnc_executeStackedEventHandler; }; };```
ah ok, so they updated it to use mission event handlers? (which broke it more)?
Old:
fn_addStackedEventHandler
https://pastebin.com/Jz6tVFD5
fn_executeStackedEventHandler
https://pastebin.com/bM8ztL8Y
and then 'fixed' it with a patch note
Yeah, because they did it wrong.
*updated
btw, i got the map control to lock. Just set the zoom and pos in a while do loop whilst the menu was open. Thanks lecks
ofcourse ๐
What does serializing even do?
in general terms, converts to text and back to an object
that PFEH thing might be reverted - it was commited in March (and it wasn't packed since then), marked as experimental & guy no longer works for Bohemia
or I might give it a go & try "fix" it
Which does work for booleans, strings, numbers, arrays, but not objects or text
or groups
"The guy who wrote this is gone and it runs everywhere".
sry not necessarily text, but any storable formats (but in arma it's text)
or controls and displays...
by "text" I mean TEXT
STRUCTURED TEXT
the html stuff
๐
I was bored again:
SurfaceCamoVehicles \o/ ๐
https://www.youtube.com/watch?v=t7mt1dcfdb8
Another thing: Does anyone knows a way, to get the path where the surface Textures are stored?
Umm, that looks awesome
I dislike the lack of code attached to the video, but it's really nice
that looks like it would be very useful for trench/fortification type objects
Yep
Is there any way to get the Path, Reyhard?
Or maybe adding a command for it? =}
But how did you do it ? Is there a command that returns ground texture?
Nah, i take the surfaceType, some magic with the configfile, format it, setObjectTexture
Was just an idea, that i had 10min ago^^
This is how ACE does the trenches too
What of it?
nigel wanted to see an example of how it's done
Where is it? oO Am i blind?
Yep, i am.
Yeah, it's not everything that was discussed on Slack.
I can't find the part where it picks the texture either.
Maybe they never got that done.
That might've been the reason. Idk.
prolly. But was fun to drive around with that camoCar ๐
Thanks, yeah was looking for surfaceType. I theorised that it's something like this. There are many uses for this, good to know.
Yep. e.g. simulating the "friction" of Sand (making movements slower etc)
@jade abyss love the adaptive camo
Flying around with a chopper atm, looks funny ๐
as reyhard suggested, it could with a little work be really useful for automatically camouflaging structures too, having camo nets match the ground they are standing on, or having bunker roofs match ground to make them harder to spot from the air.
something for me to experiment with later, not even sure whether you can retexture those
As long as there is a HiddenSelection for it -> Doable within seconds (aslong as you stay on Altis/Stratis/Malden ๐ )
what, no Tanoa? ๐
Yeah, different Path
Does anyone know if it's possible to assign someone as an ace medic trough a script rather then using a module? I have a loadout script and would like to assign a medic to whoever takes the CLS loadout.
( [[_unit1, _unit2], "ace_medicClass", 2, true] call ace_common_fnc_assignObjectsInList )
the 2 is the level, 0 1 or 2
Thank you
someone know a speedlimiter script ???
Checkout addForce, Lecks
Thanks anyway
that didn't help?
no no ty
if (_speed > _maxSpeed) then {
_vehicle setVelocity ((velocity _vehicle) vectorMultiply ((_maxSpeed / _speed) - 0.00001)); // fix 1.42-hotfix PhysX libraries applying force in previous direction when turning
};```
that's the main part.. run every frame
PM
So how do I go about converting a stacked EH to an mission EH?
remove call BIS_fnc_addStackedEventHandler and add addMissionEventHandler in front of it ๐
kinda sorta
Going from this ```SQF
[QGVAR(mapTeleport), "onMapSingleClick", {
vehicle player setPos _pos;
[QGVAR(mapTeleport), "onMapSingleClick"] call BIS_fnc_removeStackedEventHandler;
}] call BIS_fnc_addStackedEventHandler;
to thisSQF
GVAR(mapTeleport) = addMissionEventHandler ["MapSingleClick", {
vehicle player setPos _pos;
removeMissionEventHandler ["MapSingleClick", GVAR(mapTeleport)];
}];
looks fine to me ๐ค
hmm did you try spawning the code?
Shouldn't make a diff. hmm
Nope, I'm calling it.
does it produce an error or does it just not do anything?
@tough abyss _pos is not a special variable in the mission eventhandler version
use:
params ["_units", "_pos", "_alt", "_shift"];
Order might be wrong.
shift and alt are the wrong way around
Thanks @little eagle, I'll try it.
Dunno about openMap. Maybe you meant openMap false as the map is usually already shown when the map was clicked on?
I rebuild the addon and openMap now works.
No clue what that was about ๐
Aye, tele works again! Thank you commy!
@tough abyss
Also, you don't need to save the eventhandler id in a variable. It's available inside the event script via special variable:
removeMissionEventHandler ["MapSingleClick", _thisEventhandler];
Neat, thanks.
Keep also in mind that if you remove an eventhandler from inside the eventhandler code, you are by proxy modifying the size of an (internal) array while iterating through it. It might skip one other MapSingleClick eventhandler...
Undefined behaviour
I'll check all functions that use such EHs to see if any problems surface.
yw
No conflicts arise ๐
Is there a difference between enableFatigue and enableStamina? They seem to do the same thing
The car speed limiter has a issue because it only runs every frame, the car might move a bit between frames, looks laggy
@frail dune The old "fatigue" system was replaced with "stamina", but the old commands were kept for backward compatibility. They both affect stamina now.
Ah, that makes sense. Thanks
Not really, but ok.
Either I'm blind or doing it wrong, because I can't see any difference in sway with fatigue on or off. ๐ค
@split coral getWeaponSway ?
Doesn't sound like the reticle\crosshair gives youi mucn info on the sway then.
Yeah, or there's no difference
Don't see why there wouldn't be
this addAction ["Rescue Hostage", "scripts/hostageRescue.sqf"]; Should this work?
because I created a "scripts" directory in the mission folder and placed that script there, Eden is still telling me that the script can't be found
@tough abyss Obviously you have a naming issue.
nope, turned out it should be a backslash instead of a forward slash
I always thought that made no difference.
Neither did I.
"So did I." - you mean.
Woops.
@tough abyss I remember when I first discovered that backslash mistake. Was stressing over it for like two days.
yeah I spent a bit of time on that problem as well @modern sigil
I've got a question, if I want to run addAction on every client connected to the server, how would I go about it?
if normal syntax is
object addAction ["funcName", "scriptfile.sqf"];
I know I have to use remoteExec
@tough abyss What you're asking is specifically why the command remoteExec exists. Check out the BIKI page for it and it'll work.
but the Wiki is confusing
Here's how I'd do that line you wrote but with remoteExec
yeah I've checked it but I have no idea where does the object go and where do parameters go
[ object, [
"funcName",
"scriptfile.sqf"
]] remoteExec ["addAction", 0];
(or change the 0 to -2 if you want to be picky about serverside stuff but then it won't work in the editor because in that situation you literally are the server)
Missing ]
right -- fixed
oh okay, so I can treat an array of parameters as another parameter for remoteExec
alright thank you
would this set the scope for the whole file?
so everything that runs in that file is server-side then?
Do you need to execute this after mission start (not on connect)?
That's what initServer.sqf is for
Old people from Arma2 will tell you to do a bunch of if (isServer) stuff in the init.sqf file though. That also works.
@dusk sage well, I don't really know when to run it yet
I am making a hostage rescue mission for practice
and I want to add an action to rescue the hostage
this will be a coop mission
against AI
You probably do want to do addActions after the mission starts. There's a few ways to do it. Easiest is probably to add this line before the addAction:
waitUntil { time > 0 };
although I want this action to be visible to each connected client, but I guess that'll work since in coop you connect before a mission starts
Old people from Arma2 will tell you
DAYUM
but I am not really certain about what you said about initServer.sqf @modern sigil
so I want to use that file whenever I want to execute a command for all clients?
initServer.sqf is a special file that you put in your mission folder. It automatically runs only on the server when the mission starts.
oh allright, but that is not applicable for me right?
There's also a special initPlayerLocal.sqf file that each player only runs for themselves.
since I want clients to have the action added then running it on the server won't really help
oh okay, can I putt addAction commands in those sqf files as well?
this would simplify loading scripts
@tough abyss When you want the server to tell clients to do a thing, you use remoteExec. So you put that thing I typed for you a bit ago in the initServer.sqf file and it'll make the clients do the addAction, exactly as if you had done it clientside anyway.
for example I'd run other scripts from within initPLayerLocal
so what's the difference between initServer telling clients to do a thing and initPlayerLocal executing on each client?
The difference is that the server is telling the client to do the thing, which is good because it means nobody's hacking or redefining variables or whatever.
Eh?
Ignoring that statement, he's making a co-op mission anyway, so security doesn't look like an issue
If you tell the clients to do it individually, then you open up the possibility of some smart hacker dude possibly fucking with your variables and function definitions and breaking the mission. It's a dumb small edge case, but it's supposed to be good practice to have the server be responsible for telling clients to do stuff.
okay, so just to confirm, there would be no problem with running other sqf files from within initServer? that would make the server tell every client to run that file?
initPlayerLocal..sqf seems like the perfect place for addAction.
initPlayerLocal runs on client init, (on connect), just stick your addAction there, if the object is available at that time @tough abyss
Effectively they all do the same thing -- you can tell the server to make the clients run the command... you can make the clients run it on their own... it's all good.
Yeah, I personally do addActions in the initPlayerLocal.sqf unless it's some special case thing like needing to add it only half-way through the mission.
yeah the thing I was worried about was that if I tell the clients to run scriptfile.sqf from within initServer.sqf or initPlayerLocal.sqf it won't run for clients because maybe referencing other scripts from within those is prohibited
but I think you cleared up my confusion
๐
thank you guys
In general, you want the clients to do as little as possible, scripting-wise, so that their computers can focus on just trying to get some decent frames. A lot of the time when people get bad framerates in Arma it's because of too much clientside stuff going on (usually on-each-frame stuff like while loops). Eventually your server starts to get bad frames because too much is going on over there and then you try to relieve the stress by creating a headless client. When you get to that point, you have reached peak Arma.
In general, you want the clients to do as little as possible, scripting-wise, so that their computers can focus on just trying to get some decent frames.
Which should not apply to scripts running once at mission start - like one that adds an action to the avatar via initPlayerLocal
๐ฏ
In general, you want the clients to do as little as possible, scripting-wise, so that their computers can focus on just trying to get some decent frames.
So bombard the server, and cause bigger issues ๐ ?
And destroying the network with all the REs
I remember looking at the DayZ source code in like 2012 when the mod blew up. He put almost everything inside of a spawn function. It's amazing that our computers handled all of those threads so well.
Love, you don't get to call people old using that avatar.
Depends what you mean by 'well', everything will just be more delayed ๐
anyone known how i can make: hintSilent parseText (_text); on/off by a key press? Its for a debug monitor (showing some data) I want it to be toggable. Cant really figure out how to
Loop the hint
loop lol?
onKeyUp
(findDisplay 46) displayAddEventHandler ["onKeyUp" {code}];
@stray halo
๐คฆ
@tough abyss so this would work (findDisplay 46) displayAddEventHandler ["KeyDown", "hintSilent parseText (_text);"]; ?
Another question. Can this be made serverside?
@jade abyss well just check if the key is the right one?
So he always has to press a button, to update his hint? Doesn't make much sense.
https://pastebin.com/VNt4G0Dm thats the code. This will display the hint at all time, then i want players to be able to turn it off and on
And thats running serverside
uhm, what?
You can't exec hint on the Server and expect it to be shown on the Client oO
Dunno how they did it. All i want is that code to be shown on a keypress, and then remove again
Just like you could in dayz back in the days
There is somewhere a loop running, check if a Var is true or false. Setting the Var to true/false is done by a Keyhandler.
very simple example:
abc = false;
while{true}do
{
sleep 1;
if(abc)then{hint _bla};
};
if (ACTIVE_SITE) then {systemChat "removing old marker"; deleteMarker ACTIVE_SITE;};```
ACTIVE_SITE marker...
ACTIVE_SITE is supposed to hold a marker, however it's initing to a string.
Should I init it to "null" or something?
Assuming that ACTIVE_SITE is not set (last Nil is "just to be sure")
if(!isNil "ACTIVE_SITE")then{systemChat "removing old marker"; deleteMarker ACTIVE_SITE; ACTIVE_SITE = Nil;};```
yepyep
Null = Object and Nil = variable type like a string correct?
Gotcha.
e.g.
isNil VarName = Generic Error in Expression
isNil "VarName" = works
Yep.
@jade abyss okay so i made a script called monitor.sqf in my mission file https://pastebin.com/iTqB98fz Joined server and it works. Now i need to make it so you can turn it on/off, what to do here?
Check what i wrote 20min earlier. There is an example
+You need to setup a Keyhandler
okay so make it false in the script, and then make a keyhandler that makes it true?
Inside the Keyhandler, with a Button assigned/selected:
if(VarToShowHint)then{ VarToShowHint = false; }else{ VarToShowHint = true; };```
I assume there is already one in it. You better check that, before you have to write your own.
@jade abyss@little eagle @vapid frigate Sorry about my shitty behaviour yesterday, i was just frustrated. I did end up using that loop to lock the RscMapControl from moivng, but today i found a better solution, thought you guys might want to know for future reference.
In my function that i use to create my menu, i put this ```sqf
ctrlEnable [3345,false]; // this disables the map control on the menu
nice, good to know
the only issue im having now with the map control is that is gives an error " No entry 'mpmission\test.Altis\description.ext/liberation_deploy/DeployMap.LineMarker'". If anyone knows how im supposed to define "linemarker" off the top of their head, it would be appreciated.
k
could probably check what it has in the config viewer for RscMapControl or whatever the default one is
class LineMarker
{
lineDistanceMin = 3e-005;
lineLengthMin = 5;
lineWidthThick = 0.014;
lineWidthThin = 0.008;
textureComboBoxColor = "#(argb,8,8,3)color(1,1,1,1)";
};
I'm trying to create a script that for players within a trigger area, first applies a post-process effect, then kills them outright after a countdown. If they exit the area, they shouldn't be killed and the ppeffect should be disabled. I'm pretty much entirely lost, I've got as far as ((vehicle player) in thisList);
i'm guessing boguu's thing is what's in the config viewer
^ ๐
Yeah that worked thanks again
Okay, so I've managed to create a trigger that kills a player if he's in the zone for 10 seconds. Problem 1: it uses timeout - I want the ppeffect to activate as soon as the player enters the trigger zone. Problem? 2: Not sure if after the timeout, say you've got 2 players in there who entered the zone 5 seconds apart - would it kill both on timeout, or would it kill each of them separately, after they'd been in the zone for 10 seconds?
Condition: (player in thislist)
Activation: player setdamage 1
i don't think anything happens when the player leaves the area
so i guess you could make the activation something like
//enable post processing
for[{_secs = 0}, { _secs < 10 && player inArea thisTrigger}, {_secs = _secs + 1}] do {
sleep 1;
};
if(player inArea thisTrigger) then {
player setdamage 1;
};
//disable post processing
haven't done much with triggers though.. not sure if there's a magic var for my_trigger.. and not sure whether it runs scheduled or unscheduled (might need to spawn it)
You can use thisTrigger within triggers to refer to itself
I think it'd just be thisTrigger, but don't quote me on that, I'm novice af
yay i was right
fixd
should be setdamage 1 right? ๐
err yeah
Hmm, gives me a script error
think it's saying _secs = 0 is an invalid value or something along those lines
they're just where you should put your PP code
Hmm
Condition should still be (player in thislist) right? It gave me another "Generic error in expression" and killed me soon as I entered the zone
i guess it's running unscheduled then, so you'll need to spawn it
unless it just needs brackets around the stuff on both sides of &&
thisTrigger spawn {
//enable post processing
for[{_secs = 0}, { (_secs < 10) && (player inArea _this)}, {_secs = _secs + 1}] do {
sleep 1;
};
if(player inArea _this) then {
player setdamage 1;
};
//disable post processing
};
Works perfectly, thanks very much
np
Is there any way I could call an ACE function instead of setting player damage? So like, render the player unconscious?
@outer scarab you can intercept the damage being applied with HandleDamage
kick off whatever ACE function you need to call
and then just return 0 on the last line
I have no idea what that means :v
I was referring to the script above
In other words if possible, I want to put players in cardiac arrest if they're in this zone for too long
tried just going ``` if(player inArea _this) then {
[player] call fnc_setCardiacArrest;
also of note is none of the ACE stuff is in the functions viewer as far as I can see, which might be why
they're on github https://github.com/acemod/ACE3/tree/master/addons/medical/functions
easier than functions viewer anyway
Yeah, that's where I got fnc_setCardiacArrest from
I'm not sure if I'm just putting in the wrong arguments or what
Heya @vapid frigate -- recognize your name from this time last year, helped me with function writing ๐
\o/
Ah, thanks oneoh
Is there a BIS_fnc anywhere to get the generic of any weapon name?
Basically turn "arifle_MX_ACO_pointer_F" into "arifle_MX_F"
because goddamn if trying to transfer inventory with those thrown into the mix
no problem @outer scarab . i just looked at the source script that lecks linked - most scripters are nice enough to give an example usage in the header ๐
i think that info is defined in the weapon's entry in cfgWeapons @lean tiger
open up the cfg viewer, cfgWeapons, find arifle_MX_ACO_pointer_F and have a poke around
never gone config crawling with SQF
but been around in the config on my own before to find asset gems
thanks for the direction ๐
although this is what you asked for @lean tiger https://community.bistudio.com/wiki/BIS_fnc_baseWeapon
even the same classname is given in the example lol
I knew I saw it one time -- I'd probably go googling later with the variable found in the config
you da real mvp
no problem
like gets said to everyone, bookmark these https://community.bistudio.com/wiki/Category:Arma_3:_Functions https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3
i just ctrl-f'd for "weapon" on the BIS function page for you
there's also the inheritsFrom command
i think the game will only really display a certain number
That's fine, they're meant to be spread out a great deal anway
What I'm wondering is how I could go about creating them better. Right now, I've got my init.sqf full of var = [] spawn {light = "#lightpoint" createvehicle getpos L1; light setlightbrightness 2; light setlightcolor [0.1,0.8,0.1]; light setlightambient [0,0.8,0];}; for each lightpoint, but this is inefficient, labour wise
uh
Yeah. So for every one I want to create, I got to place down a trigger, give it variablename L#, and add another one of those to init
what is the trigger for?
I'd rather be able to do something along the lines of var = [] spawn {light = "#lightpoint" createvehicle getpos this (or thistrigger); light setlightbrightness 2; light setlightcolor [0.1,0.8,0.1]; light setlightambient [0,0.8,0];};
simply a point of reference
for coords
70 triggers will be worse for perf than 70 lights
oh wow
Well, each of these lightpoints needs to be inside a rock, in specific places
but doing var = [] spawn {light = "#lightpoint" createvehicle getpos this; light setlightbrightness 2; light setlightcolor [0.1,0.8,0.1]; light setlightambient [0,0.8,0];}; in the init of an object doesn't work
because 'this' won't exist in the spawned script
i don't think you need to spawn it
var = this spawn {light = "#lightpoint" createvehicle getpos _this; ... or just light = "#lightpoint" createvehicle getpos this;
What would be the best object to use to create it from then? Something I can move around in the editor
a marker or a logic i guess
a trigger has to check what's in it every half a second
Oh, the script wasn't on the trigger its self
it was just using empty, named triggers, and the script in the init would create lightpoints at the position of those named triggers
But this seems like a lot cleaner a way of doing it
yeah should use a logic for that i think
Yeah, it means I can create compositions instead of "hand-crafting" each one
Thanks again man
np
Selecting one goes (_this select 0) but how do you do it for 0 and 1?
Like (_this select 0, _this select 1) ?? Well heh, doesn't work.
(_this select 0,1) aand this doesn't either
(_this select (0,1)) noope
Halp, I'm this hopeless!
for a 2d array?
_this select 0 select 1 would get [[notthis, this], [nothis, notthis]]
or if you want a new array with the first 2 item,s [_this select 0, _this select 1]
could also do that last one with _this select [0,2] with alt syntax 4 https://community.bistudio.com/wiki/select
I have like this now (doesn't work)
params[ "_newEntity", "_oldEntity" ];
if (isPlayer _newEntity) then {
(_this select (0,1)) spawn {```
would need to be able to select both _newEntity and _oldEntity at the same time
[0,1]
so I should just change the part (_this select (0,1)) to _this select [0,1]?
or do I need the parentheses too?
Or you just use
[_NewEntity, _oldEntity] spawn
ยฏ_(ใ)_/ยฏ
FFS DISCORD
-.-
shaddap commy
would need to be able to select both _newEntity and _oldEntity at the same time
You already did in line 2
/shrug ยฏ_(ใ)_/ยฏ
add 2x _ infront of it, commy
so just remove (_this select (0,1)) ?
and leave it like this if (isPlayer _newEntity) then { spawn {
i think you want _this select [0,2] or [_this select 0, _this select 1] or [_newEntity, _oldEntity] or just _this to pass the whole array
+Work with diag_log and check your .RPTs
e.g.
diag_log _this;
diag_log _newEntity;
etc bla
yeh and hint/systemchat
also, yeah.
will check the Lecks versions asap
yeah, that's the trouble for me at least
Dscha - Today at 12:28 PM
Or you just use
[_NewEntity, _oldEntity] spawn```
da hell?
why not [_newentity,_oldentity]
you got them selected already
uhu
read, Senfo.
@jade abyss stop being a ninja all the time
it's pretty simple when you get the hang of it.. everything in sqf is passed in arrays so you need a lot of ways to manipulate them
He want's to spawn it, he has to pass it over.
Me? Ninja? Nah, not enough 16:9 for that.
https://community.bistudio.com/wiki/Array recommend reading that
because arrays are everywhere in sqf
pretty sure there are 4:3 ninjas too
No clue, never seen one.
yeah well, don't have the attention span to read that stuff. I learn by doing (or most probably don't) but either way
then stop programming in the first place
"just" trying to get a few scripts going. Don't have the intention to create another Altis Life or [insert another popular MP mission name here] from ground up
Pro Tip: Hide laziness when asking programmers for help
and I DO appreciate the help You gents are offering here. Thank you.
You could generalize what CS said to: hide laziness when asking for help
(hmm, can't "like" CSSoftware's message)
I have to agree with that @vague hull @tardy wagon
I was being a bit too much inconsiderate there, apologies for that
the thing is, if you ask for help or somebody to fix it, you wont learn a thing yourself,
if you read the manuals, you get the knowledge to understand the background (even if you have to ask later)
any script that does something magical to you is most likly to break your neck later on
And you don't have to recreate a new gamemode. Knowing the basics is essential.
+You don't have to have every command in your head. Thats what this site is for:
https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3
Wish we had C++/TypeScript-like IntelliSense for SQF so I don't have to keep alt-tabbing and hoping that the BIKI will load fast
similar for VS code too
this deletes the body of a just respawned player
params[ "_newEntity", "_oldEntity" ];
if (isPlayer _newEntity) then {
deleteVehicle _oldEntity;
};
}];```
since sleep needs spawn how do I add it there?
So far what I've been trying I'm constantly getting Error undefined variable in expression _oldEntity
_this spawn {
params[ "_newEntity", "_oldEntity" ];
if (isPlayer _newEntity) then {
deleteVehicle _oldEntity;
};
};
}];```
params always looks at _this
So if you pass the parameter array to a spawn, the _this inside the spawn will be the same
very good, thank you @vapid frigate
here's the final. Body of the recently deceased gets hidden (sucked into ground) and then after 10 seconds will get deleted
_this spawn {
params[ "_newEntity", "_oldEntity" ];
if (isPlayer _newEntity) then {
hideBody _oldEntity;
sleep 10;
deleteVehicle _oldEntity;
};
};
}];```
params[ "_newEntity", "_oldEntity" ];
if (isPlayer _newEntity) then {
_oldEntity spawn {
sleep 10;
deleteVehicle _this;
};
};
}];```
that would probably be a bit more efficient
and illustrates optix's point
thank you gents ๐
@tame portal
OPTiX - Today at 1:22 PM
params always looks at _this
Nope =}
_Var params ["_ArrEntry1","_ArrEntry2"];
Right next to the BI Wiki
Thats rude.
Lol
=}
when "offloading" scripts to be only on server (dedicated) is it better to have one script file (.sqf) for eg. multiple event handlers or multiple script files that each house one event handler?
Well are they only run once?
hmm
now that's a question I don't know an answer just now
might be so that they are run once at the start of a mission and then for every JIP player
well, here's an example from the not so distant past
params[ "_newEntity", "_oldEntity" ];
if (isPlayer _newEntity) then {
_oldEntity spawn {
sleep 10;
deleteVehicle _this;
};
};
}];```
Will that be run only once or every time a player respawns?
every time an entity respawns, surely? isn't that the point of it?
yes ๐
It really won't matter, to answer your question
But if it runs them all every respawn, it wouldn't hurt to have them in one file
copy, thank you BoGuu ๐
@jade abyss so camo nets do have hiddenSelection for the net texture, bunkers don't unfortunately, but the open net does almost entirely cover the large 1 storey bunker so ... Would you mind sharing the surfacetype to texture mappings you were using, please?
haven't messed with procedural textures in the past so I thought I'd give them a try but all the r,g,b values I'm using are coming out in shades of white, i.e. several shades lighter than they should be. Anyone know what I'm doing wrong? For example 0.5,0.5,0.5 should be mid-grey but it comes out as a dirty white
show the rest of it. there is more in there than jsut rgb values
#(rgb,8,8,3)color(0.76,0.70,0.50,1) is the actual value I'm using, should be a sandy colour
what is it showing as?
practically white, https://imgur.com/a/aYRn4
should look like this - http://www.colorhexa.com/c2b280
@spark cobalt ArmA makes a lot of colors more white than they should be
The same happens when using the color codes for guis
Also, in case of vehicles, material can have an impact on visual color
I suggest lowering all color channels in the same way until it is dark enough for you
@compact current thanks
wanted to make sure I wasn't missing something. I've already played with decreasing the values to approximate the shade I was going for which obviously does work, but it seemed odd that the biki doesn't mention the issue ๐
I found that only some colors run into this problem
Most colors I've tested look like they are supposed to
I was actually trying this out on a variety of objects, my main aim was to use it on camo netting but the pickup was a better model to demo it in the screenshot
@polar folio some, like NO, it wasn't having a noticable effect so I didn't run through the whole list
Also have a look at the last comment and try setting the default material on the offroad before applying the color
@compact current interesting, it was doing it for all colours I tried, except primary colours and some mixes of those
Wrong OPTiX ๐
heh, discord's autocomplete kept fighting me and selecting the wrong one even though I had properly capitalised the first three characters
ok, CO did help a little, it's certainly much better than it was
Try setting the material to default
yeah, that did the trick, thanks
I mean the surface looks awful but the colour is much more accurate ๐ I'll play with it further but at least I now know the factors at play
๐
next time, take payment up front
runs out the door
having switched to real textures now, seems the same colour matching issue applies but I'm starting to get reasonable results. Only problem now is that the colours of the close, mid and far range ground textures are all different. Since I want my net's camo to hide things from aircraft I need to change the colour palette of the texture
Does somebody know the average speed of a generic loop in arma 3 ?
I don't understand the question. It makes no sense to ask this to me. @jovial nebula
Is there a way to disable "Error Dialogs" ? ( No entry 'bin\config.bin.....)
By fixing the error.
๐ค
mb you should tell us the error youre getting, that would be more useful
I making a mod and using other mods and I want to disable the dialog. There must be hpp file path , if I know the file I can rewrite the dialog
The dialog is hard coded. The only way to get rid of it is by fixing the underlying error.
I am fairly sure you can delete the resource for it
After saying this, I changed my mind
Fix the error. That's what error messages are for.
I already just said in teamspeak:
Make a workshop mod that disables the error message box
-> Most subscribed item on the workshop
Because 99% of the mods are broken ๐
And it's a terrible idea. So there is no reason why it wouldn't happen, except that it's hard coded and impossible in the first place.
the probleme is, if you disableUserinput and a error message will be shown, you game will be freezed
how about closeDialog ? would it work?
Hey guys, does anyone know if default groups in lobby removes when empty? LIke if I choose a group in side selection in lobby, and then I script myself into another group, will that old group remove itself?
Because I know you can script so you can create a group that will delete when empty
@vivid quartz maybe, i will look
@little eagle It's not impossible. My hack(toolkit) also disables that messagebox because its annoying ๐
Go away with your filthy cheats you hacker.
How would i go about turning off all lights within a trigger?
@sharp jay triggerList and bis_fnc_switchLamp
Will check it out, thanks @subtle ore
@sharp jay yep, trigger passes the triggerList params if you do something like this in the onActivation field: [triggerList] call compile preProcess "myAwesomeLightsSwitch.sqf"; and in the myAwesomeLightsSwitch.sqf : {[_x] bis_fnc_switchLamp; } forEach _this;
@subtle ore Wait, would { [_x,false] call BIS_fnc_switchLamp; false; } count nearestObjects [ player,["Lamps_base_F","PowerLines_base_F","PowerLines_Small_base_F"],200]; this work. I found it in the documentation for bis_fnc_switchLamp
@sharp jay yep it would work, just make sure you're using the classnames you want in the array there and 200 is from the distance of the player position.
player would either have to be local in mp, or sp
i will switch player with an invisible object though
is this mp or sp?
mp
where are you executing this at
Well, i want to have an action menu option when i am near an object
@sharp jay okay, you can do something like this in a event script called initPlayerLocal and then execute the same on respawn : player addAction["Switch Lights",{{[_x,false] call bis_fnc_switchLamp; false; } count nearestObjects[player,"Lamps_base_F","PowerLines_base_F","PowerLines_Small_base_F"],200];},[],1,true,true,"","(nearestObject player) isKindOf 'Lamp'"];
Thanks, i'm gonna add the action to an object instead, but that is the gist of it
cool
Thanks
yep.
@little eagle just wanted to know how many cycles of a generic for loop are done in 1 second,for example
No need for getting angry..
@jovial nebula Commy is always in his own little world ๐
@jovial nebula Still a useless question. There is no way to answer that.
Not angry, but there is no way to know. It depends on your rig, the mission and what's going on on your machine...
Also on what the loop actually does
There is a way to measure execution time with the debug console, but it's pretty useless for schedued environment,
Which this is presumably about.
I was looking for something generic,nothing of exact
But if there's no way of answering that , then no problem
Use the debug console to measure how long your code takes for 10000 loops and then do the math.
Then you know for your machine.
Something generic. Okey. Between 0 and a couple million per second.
Another answer: as many as the game can do.
depending on how you run your script (scheduled/unscheduled), your Computers performance and what other scripts are running (only matters for scheduled)
Btw. a scheduled script can only run for 0.3 ms anyway. Or was it 3ms. I can never remember.
At a time that is.
3ms. If it is the first script that get's to run that frame.
0.3 seems way too damn fast
300ns are a lot of time in my world ๐
He asked how many per second though. And that would then depend on framerate. Which depends on graphics settings and where you are currently looking. No way to predict that
Someday.
I wanted only to compare sqf execution times to the ones of an external extension
I wanted to count occurences in a huge array,nothing more
That's why I was wondering about it,but will do the maths as commy said
external extensions do different stuff than sqf does.
A empty loop in c++ takes 0ns because it get's completly optimized out.
in SQF it takes a unpredictable amount of time
Yeah yeah will do :\
Only way is to measure. Use debug console's performance analyze thingy. And also profile your extension
extension is almost always faster than SQF though.
Make sure to not use undefined variables in your tests with the debug console. It will not show an error, but it will screw up the measurement making your code appear to be faster than it is.
is ```
if (var1 = true && var2 = true) then {
somecode
}``` valid?
= --> ==
It doesn't work even with BoGuu's suggestion.
Because == cannot compare booleans.
And there is no point to anyway.
and that ^
== true
is pointless
so i can just have (var1 && var2)?
do var1 and var2 have to be bools? I can't remember how sqf works again
e.g do the vars need to return true, or just return something which isn't false?
Everything that is considered a boolean type in SQF.
Theoretically numbers and (I think. Would need to check again) also strings are convertible to bool but are not considered to be of type bool so && or the if condition throw an error because the type was not a bool.
do var1 and var2 have to be bools?
Yes.
e.g do the vars need to return true, or just return something which isn't false?
true
Sadly yes. Theoretically it would be easy to also accept numbers being not 0 as a true. But a BI dev was too lazy for that
Intercept does that.
Get rid of the BOOLEAN type completely and use 0, >0 to represent them instead
0, != 0
or just get rid of sqf and use a pre-existing scripting language instead of a proprietary one (not that many of those don't have their own unique issues which people will argue over instead)
Get rid of the BOOLEAN type completely isn't that a bit unintuitive?
Seems pretty clear at this point that SQF is legacy shit that made it's way into arma 3 because they didn't want to do a total rewrite of the scripting system
hopefully it will be better in Arma4
rather SQF than arma 3 being delayed 2-3+ years while they worked on that
What makes you think it would take that long? That's basically a development cycle for an entire game
cos eeeeeeverything is built on SQF and they'd not just have to implement a new scripting language, but re-implement all the helper functions and mission, ui, logic functions and modules their designers are used to
and then after that, make the actual game. see how long dayz is taking.
Right, the only problem that SQF poses is that it's weird as hell itself
yeah, do my super scientific benchmark of loading in to VR terrain with no scripts running, look up or down and see how you still only get like 120FPS or something
SQF is still a huge performance problem if you are really doing perf critical stuff.
would be closer to negligible if the engine wasn't as fucky though
its hard to say.. AI count could slow things down because they're all using SQF
it's not even those things imo quiksilver, load in to empty VR terrain and tell me how much FPS you get