#arma3_scripting
1 messages ยท Page 414 of 1
I am useing this to define it ```hpp
class RscEdit
{
idc = -1;
type = 2;
style = "16 + 512"; // multi line + no border
x = 0;
y = 0;
h = 0.2;
w = 1;
font = "PuristaMedium";
sizeEx = 0.04;
autocomplete = "";
canModify = true;
maxChars = 100;
forceDrawCaret = false;
colorSelection[] = {0,1,0,1};
colorText[] = {0,0,1,1};
colorDisabled[] = {1,0,0,1};
colorBackground[] = {0,0,0,0.5};
text = __EVAL("Line 1" + endl + "Line 2" + endl + "Line 3"); // how to output multiline
};
And this in my dialogs thingy and for some reason i can not even see the thing ingame ```sqf
class JaM_TextEnter: RscEdit
{
idc = 1400;
x = 0.572187 * safezoneW + safezoneX;
y = 0.324 * safezoneH + safezoneY;
w = 0.12375 * safezoneW;
h = 0.044 * safezoneH;
};
I am very new to this so its prob a VERY simple mistake...ยจ
are you doing createDialog "JaM_TextEnter"
No thats what the actual Name i put on the RSCEdit i placed in the GUI editor.
@river meteor
the dialog won't create unless you have a script to tell it to create
you can test it by running the command ```sqf
createDialog "JaM_TextEnter"
Oooo Yes lulz i open it via a sign
and it doesn't open and you get no errors in your rtp?
Pm ed you a screenshot of the begining of the code and then the part above is the last line ill show you a picture of how it looks in game
http://prntscr.com/i1d1il And the RSCEdit thing is supposed to be to the left of that
Pmed you the whole dialog
you need to add lineSpacing = 0 to RscEdit if you are going to use multi line style
err = 1 not 0
@still forum sry read this late https://gyazo.com/17eb86c29118b8e9c7bd45d1d45dfdfd Yes It's possible/no you can't, care to elaborate? ๐
I do not want to use multiple line
instead of 16+512 hve it be 2+512 then
I want someone to be able to enter a maximum of say 10 caracters. What i am makeing is a thing where people can input whatever and then display that as a numberplate with setPlateText
look at your config options for your RscEdit
you can specify the maxChars there, and you will want to change the style to 2 if you want a border and 2+512 if you want no border. You probably also want to set text to "" so that nothing displays inside of your edit box. I recommend a script with a UI Event Handler to handle displaying the input
Is it not possible to make whatever got put in to the box to a veriable ?
I've never used it, but the onChar UI event seems like you could read the input into a variable when the event fires
without an event, you have no way to know when to read what's in the input box
What if i make a button so when thats pressed it reads whats in the box would that be possible?
yes, but that still uses a UI event. This is not a problem by the way, using UI events are not very much code
or you could do a key event, so when the user presses the enter key it reads the input box
@fleet wind Nice tutorial with dialogs http://steamcommunity.com/sharedfiles/filedetails/?id=287378519 and you can do it with just ctrlCreate
0 spawn
{
disableSerialization;
_empty_display = findDisplay 46 createDisplay "RscDisplayEmpty";
_rsc_edit = _empty_display ctrlCreate ["RscEdit", -1];
_rsc_edit ctrlSetPosition [0.25,0.5,0.5,0.05];
_rsc_edit ctrlSetBackgroundColor [0,0,0,0.85];
_rsc_edit ctrlCommit 0;
uiSleep 5;
_empty_display closeDisplay 1;
hintSilent format ["Your text was %1", ctrlText _rsc_edit];
};
Thanks @meager heart Will have a look at that Guide but i where to be a lazy bastard for how where would one have to place that code for it to work ๐
If that was question, then put it in debug console and type something in a text box ๐
@uneven prawn Yes it's possible. I could do that. But you couldn't.
Does it require a mod or something?
It would yeah
A mod that doesn't exist yet.. Well.. It does but that's not publicly available. And it's quite "hard" to make
wats the smallest value for sleep
0
Well... -1e27 Might be actually the smallest
They all don't really make sense though
your question also doesn't really make sense
wait a second, -1e27? not -1e9 ?
i was just curious
also wat im tryna do takes a while to maybe possibly explain
rememeber dedmen im stoopid
don't forget to breathe out too ๐
well played
why did i take it would take a long time to type thid
so I wana make a repulsor type script,like say ur in a jet. my logic for now,which i havent tested is to
get velocity,lets call it Vi,get it so that I have the components aswell
sleep for a very small time
get the velocity,lets call it Vf
get the absolute difference,call it deltaV,get it so that I have the components aswell
decrease each vector component by that abs difference of the corresponding competent in deltaV times 4
do this utill user says staph
im stoopid see
Ah
Youโre not stupid, you just have bad luck when you think
minimum sleep time is one frame
which is 1000/<fps count> milliseconds
But. you are not guaranteed that you execute next frame
might also take dozens or hundreds or thousands of frames
so a sleep 0.1 could sleep for a couple hours
When you use a Each frame handler you are guaranteed to execute after one frame time
oh
which again can be between 8 and several thousand milliseconds
but you can use diag_tickTime to measure how long you have slept for
okay thats too fine for me?
so even if it takes longer than you wanted you know how long you slept and can use that in your math
good to know
ima assume if i do vector-vector it will return the vector diffrence and idk not something dumb like magnatidue right T_T
vector-vector is deltaVector
That returning magnitude would be bullshit but.. Not like SQF never does bullshit
uh just making sure youre not just gonna subtract arrays instead of using vectorDiff
or whatever the command name was
oh i like that more
vectorDiff is correct. There is also vectorMagnitude ๐
life ๐คข
I hate all variables
It has a _ at the start
foodie
you have a single guess
global is higher up and local is lower down. _ is quite low.
I still don't like variables
yes v is higher than _ because as you can see v_ the pixels of the _ are lower down
oh
slighty lost
but its okay
ill just cry
okay inception quesiton
how can u tell a addAction to tell it to change its own name
Name or text ? with text setUserActionText
That exists ๐ฎ
is it strange ? ๐
Yeah ^^
Usually we don't have neat commands that do things simpler than how you can already do it
ยฏ_(ใ)_/ยฏ
What am I doing wrong?
player switchMove "Acts_JetsMarshallingStop_loop" ```
Adds the action as intended but it either doesn't execute the script or something else. Not totally sure.
wats the best wayto get the vector of a vector poinin the other way? ```
[1,1,1]-vectorName?
Should specify that the second line is the actual surrender.sqf file
Uh
addAction executes the script in the quotes
surrender.sqf is not a script
it's a filename with a script insdie it
@swift ferryenai#3053 vector*-1 ?
FUCK YOU DISCORD. Thanks.
Ok addAction apparently accepts script filename
@sullen willow any errors anywhere?
Did you try adding a systemChat or hint or smth into your script to see if it executes
No errors, it's just not playing the animation.
thx
_vector apply {-_x}
:U ๐
Id also like to point out that [1,1,1] - _vector wont reverse it, consider [0,0,0] trivially
what is the biggest possible container for holding items? I don't want to add stuff to my shop container if I can fill it up and not be able to add more
fun fact: the huron cargo container has less space than a weapon box
the max you can fit in any container is 480 "units of mass"
so, about 480 bananas, or 48 nades
Eh, the addMagazine does not work on a box. The addMagazineCargo does not let you set the ammo count in the mag. I can manage though.
@thorn saffron https://community.bistudio.com/wiki/addMagazineAmmoCargo
๐
Hi guys got a question, so im currently putting a mod together which has multiple textures for the same 3d model, is there a way of scripting to the same p3d file or does individual p3d files have to be used for each texture?
idk if you could do it with scripting though thats why im askging
You can only do what's predefined in config and model itself
For anything else, you'll need to change model and config
@main oriole #arma3_config hiddenSelections hiddenTextures. If you want to have multiple times the same model with different textures. Otherwise multimaterial texture #arma3_model or #arma3_texture
Usually we don't have neat commands that do things simpler than how you can already do it
More like big inconcistency
Some things have neat helper commands, some dont
And more often than not the thing you currently need right now is not there.
["muzzle_snds_acp","","optic_MRD",""]```
How can I filter out the empty strings? The ""
_array select {count _x > 0}
Or
_array = _array - [""]
Second one probably better
the does the - variant rly removes all occurances?
will it remove every instance of the empty ""? ^
throws stones
just thinking ... in theory, one could optimize stuff like that select away
Okey.. Perf of that is worse.
huehuehue
THATS CHEATING
@still forum can one check for the commands in code?`
thinking about simple optimization of stuff like select {...}
yeah
I added that to the optimizer. It just goes down into the code and optimizes it again by calling the optimize func
But you need to do that at runtime
So if you want to optimize it you need to replace it with something else
oh yeah, that's what I wanted to ask you about ded, can you check lbSetPicture ?
there has to be fuckery or broken code involved
Like a custom Intercept command or a... uh............... Instruction
I refuse to believe that command takes so long to execute.....
_arr select {<simpleexpression>} could be optimized away easy when using an extra command
You mean because... yeah
@queen cargo especially _array = _array select Could instead just modify _array in place
it's literally the worst UI command perf wise ๐ญ
@lone glade the IDC variant or the control variant?
both if possible
What are you using?
You could intercept it to make it better lol
_containerArray = everyContainer box1;
_weaponsAndAttachements = weaponsItemsCargo box1;
_containersWeaponsAttachements = [];
{
_containersWeaponsAttachements append weaponsItemsCargo (_x select 1);
} forEach _containerArray ;
_strippingArray = _containersWeaponsAttachements + _weaponsAndAttachements;
// Actual Function starts below
// creating a magazines, weapons and items arrays
_strippedWeaponsItems = [[],[]];
_strippedWeapons = [[],[]];
_stripedMagazines = [[],[]];
{
(_strippedWeaponsItems select 0) pushback (_x select 1);
(_strippedWeaponsItems select 0) pushback (_x select 2);
(_strippedWeaponsItems select 0) pushback (_x select 3);
(_strippedWeapons select 0) pushback (_x select 0);
(_stripedMagazines select 0) pushback ((_x select 4) select 0);
if ((count _x) == 7) then {
(_strippedWeaponsItems select 0) pushback (_x select 6);
(_stripedMagazines select 0) pushback ((_x select 5) select 0);
} else {
(_strippedWeaponsItems select 0) pushback (_x select 5);
};
} forEach _strippingArray;
{
(_stripedMagazines select 1) pushback 1;
} forEach (_stripedMagazines select 0);
{
(_strippedWeapons select 1) pushback 1;
} forEach (_strippedWeapons select 0);
{
(_strippedWeaponsItems select 1) pushback 1;
} forEach (_strippedWeaponsItems select 0);```
Don't remember checking
you got a list with stuff one could optimize away like that?
because if not, then you might want to start one ๐
_array select {<constant that evaluates to true>}
We don't even have <constant that evaluates to true> yet. Like 2*2==4 or smth
_x == "" would be no constant though
yeah. I meant like true or 1==1 or nonsense bullshit
Which Idiot would run select on a hardcoded array? Instead of just modifying the array
@thorn saffron classnames is select 0 right?
The code above creates arrays for stuff that is attached to weapons that inside a box and possibly inisde vests etc. that are also inside a box. In a format that can be used with the normal add items commands.
[["muzzle_snds_acp","","optic_MRD",""],[1,1,1,1]]```
I just need to get rid of the empty strings from the array with the classnames
@still forum yes
starting to raise issues now at SQF-Assembly for this
theoretical support for commands is inside already btw
just practical support is not unless you added some commands
@thorn saffron Did you test that your array format is really correct? To me it looks like Line 7 messes the format up completly
_containersWeaponsAttachements = [];
{
_containersWeaponsAttachements append weaponsItemsCargo (_x select 1);
} forEach _containerArray ;```
This one checks uniforms, vests and backpacks for any weapons inside. confirmed working.
the final arrays return perfectly fine, its only the empty strings that cause issues.
I just need something like
(_stripedMagazines select 0) - [""]
Fun
_strippedWeapItems_name pushback (_x select 6);
(_stripedMagazines select 0) pushback ((_x select 5) select 0);
What is in 6 and 5?
the magazine is already in 4
depending if its arifle with UGL it can be either UGL ammo or bipod
ah
still slow though?
that's for a full filling of the left + right panels ofc
@thorn saffron only magazines?
a fuck me, it's within test variance, no noticeable improvement :/
Profile the command call seperately maybe
whatever, if I get rid of empty strings in one array I will know how to do the others
Profiler should have enough precision for that
Yeah I know @thorn saffron Working on it
hm... they're about the same, I wonder why i get 20ms differences at times
max was 150ms, min 130ms
@still forum
[["muzzle_snds_acp","","optic_MRD","","","","CUP_optic_MAAWS_Scope","","muzzle_snds_H","acc_pointer_IR","optic_ACO_grn_smg","bipod_01_F_khk"],[1,1,1,1,1,1,1,1,1,1,1,1]]```
All I need is to remove the empty strings from the first subarray and I will be able to get the item count correct. I will just run the removal before adding the count.
@thorn saffron
_containerArray = everyContainer box1;
_weaponsAndAttachements = weaponsItemsCargo box1;
_containersWeaponsAttachements = [];
{
_containersWeaponsAttachements append weaponsItemsCargo (_x select 1);
} forEach _containerArray;
// Actual Function starts below
// creating a magazines, weapons and items arrays
_strippedWeaponsItems = [[],[]];
_strippedWeaponsItems params ["_strippedWeapItems_name","_strippedWeapItems_Counts"]
_strippedWeapons = [[],[]];
_stripedMagazines = [[],[]];
{
_x params ["_primary","_barrel","_side","_optic","_magazine","_bipod"];
_strippedWeapItems_name pushback _barrel;
_strippedWeapItems_name pushback _side;
_strippedWeapItems_name pushback _optic;
(_strippedWeapons select 0) pushback _primary;
(_stripedMagazines select 0) pushback (_magazine select 0);
if ((count _x) == 7) then {
//_bipod here is UGL magazine
_strippedWeapItems_name pushback (_x select 6);
(_stripedMagazines select 0) pushback (_bipod select 0);
} else {
_strippedWeapItems_name pushback _bipod;
};
} forEach _containersWeaponsAttachements + _weaponsAndAttachements;
{
_x params ["_names","_counts"];
{
_counts pushback 1;
} forEach _names;
} forEach [_strippedWeaponsItems,_strippedWeapons,_stripedMagazines];
_stripEmptyStrings = {
params ["_left","_right"];
private _index = _left find "";//Find empty string on left side.
while {_index >= 0} do {
//Delete value in left and right array.
_left deleteAt _index;
_right deleteAt _index;
_index = _left find "";//Find nextempty string on left side.
};
};
{_x call _stripEmptyStrings} forEach [_strippedWeaponsItems,_strippedWeapons,_stripedMagazines];
Have fun
apply within apply would work too
I think you can somehow make the forEach at line 7 more compact. But too lazy to think now
@still forum Thanks, it worked
Oh .. Neat.. I wrote that in notepad++ without syntax highlighting ๐ Lucky I didn't put a typo in there
you kinda lost one ; but other than that it seems to work fine
Now all that's left to do is to just get the items and weapons from box and containers inside the box and combine with the stripped arrays. This way I will know exactly what is in the box... does not sound as grand now that I say it
@lone glade It supports animated textures. Whatever that is ๐
Tank threads and such
Animated modicons would be neat
Not animated as in animating a model and moving the UV
animated as in gif
@lone glade In a mission. If you don't start with \ it searches through all files in mission. Then it searches through.. eh... dtaExt? Then again dtaExt folder. Then in PBO's
I kinda understand why it could be a littl slow
dtaExt ?
Dunno
A folder in game directory apparently
filePatching could make that worse. Do you have that enabled? I did when I tested
yes I do
oh jesus
every launcher updates revert my launcher to french
the translations, it huuuuuurts
I don't think I'll find it by just randomly clicking around in the code... I need a profiler for that
https://github.com/dedmen/TodoStuff/issues Feel free to remind me later when I can dev again.
The IDC variant should be slower
What icons?
Does exactly the same but needs to find display first
LBSetPicture @peak plover
OMFG BI WHY SO DUMB?!!!!
No not dumb.
what
WTF am I seeing
@lone glade was also slow when setting pic to "" right?
@lone glade I demand answers now
Maybe it's not the icons but your drawing code?
drawIcon3D ["A3\Modules_F_MP_Mark\Objectives\images\CarrierIcon.paa", [0.0,0.0,1,0.7], (_pos), 2.0, 2.0, 0, "Active", 1];
foreach [all my groups]
inside a oneachframe
forEach all your groups doesn't give _pos tho
and you should draw in Draw handler
not eachframe
@lone glade I have a alternative. Go Scheduled
Global variable script handle. Terminate it when the panel is refreshed. Fill the panel but keep an array of icons instead of applying them.
When done with filling spawn a loop over these icons that set's the icon.
I WAS EATING OK
and yes, it's as slow with ""
so going with your solution wouldn't really change anything @still forum
It would reduce the frame drop but not improve speed
slow with "" doesn't make much sense though
which framedrop?
When the panel updates in unscheduled
those 130ms are opening + filling the left AND right panels + infobox and stats
It get's the listbox from the left hand variable. Checks if the types in the array are correct. And then tries to find the texture. But if string is empty it aborts immediatly
filling a panel after this is sub 50ms
so it doesn't search for the texture nor does it try to load it. So why is it slow?
Don't think so. I can't see it
not running the command is the best way to gain perf
We need better profiling tools
when we tested it months ago using "" didn't do shit :/
Something that instead of recording hundreds of scope creates just one and shows you the average
true
On my todo now.
I just don't see how it can be slow with empty string if we are using the binary variant with control. The IDC I can somewhat understand as it needs to find the control...
Do you want to add the todo to my github to investigate that with a proper profiler? I obviously can't run Arma at work
That one is older
Guys HELP, how to force underwater filter effect without swimming?
I found only how to change filter in CFG, but I have no idea how to force it
Did you take a look at https://community.bistudio.com/wiki/Post_process_effects ? The filter you want is "WetDistortion"
Hi guys, I'm trying to use playSound3D function with a sound located in a addon, and it's not working, is it possible or I'm just wrong ?
@tough abyss PlaySound3D needs the path + extension , paste your formatted code please
playSound3D ["\nolosharp\sounds\beer.ogg", player, false, getPosASL player, 1, 1, 0]
should be working no ?
(and thx for your help :))
I'm not sure but, I think if you want to use sounds from A3 or mods you have to use an @. If nolosharp RP is the mod folder "@nolosharp\sounds\beer.ogg" or something like that should work.
hum
@tough abyss I would really recommend to read the biki page about playSound3D
Look at the examples and how they have their file path
You have a subtle error that you should notice when comparing to the examples
We had someone with the same problem a couple days ago
Pay attention to the start of the filepath
all the examples don't have that
is your pboprefix correct? did you pack that pbo yourself?
packed myself, and the prefix should be ok
sounds works when I use config.cpp and say3d
so say3D right now works. but playSound3D doesn't?
that's it
maybe I should ! Dindn't tried that
that's quite surprising in fact
when the path isn't correct I have logs
18:12:22 Sound: Error: File: \nolosharp\sounds\beer.ogg not found !!!
but when I remove backslash, he seems to find it
so maybe it's juste cause of .ogg
Magic ยฏ_(ใ)_/ยฏ
Really thanks for your help
Should add a note to wiki then. There is one example in the notes that uses ogg but it doesn't say anywhere that ogg doesn't work
Cannot register on the wiki (desactivated for the moment)unfortunetly
I thought it was going to be activated after the new year?
new year probably means new year for the web guys
maybe they are still on vacation or smth
I'll do it friday when someone reminds me
:+1:
Is there any ways to differ createSimpleObject besides its type, for example 3 objects of the same types?
allSimpleObjects ?
Still will return me a maximum of p3ds or types
I think there's no ways to differ, just seeking ideas
I have posted a topic
https://forums.bohemia.net/forums/topic/213188-enhanced-artillery-computer/
Bottom like, would anyone know where and when the script is kicked off when you select a target from the artillery computer or when you press the 'Fire' button
like = line
I would like to add a feature or two
ask the guy who mad it
who is it?
Because im talking about the Vanilla Artillery computer here.
from BIS
Ok, I dumb. How can I combine these 2 arrays?
[["100Rnd_65x39_caseless_mag_Tracer","3Rnd_UGL_FlareWhite_F"],[1,1]]
[["30Rnd_65x39_caseless_mag_Tracer","11Rnd_45ACP_Mag","ClaymoreDirectionalMine_Remote_Mag","CUP_MAAWS_HEAT_M"],[1,1,1,1]]```
nope
yup
derp
check the wiki link I gave you
@inner swallow Tried, somehow I made it dupe the mags
go through the wiki and see f there is your sollution
@umbral nimbus Thats not it:
[["11Rnd_45ACP_Mag"],[1],["30Rnd_65x39_caseless_mag_Tracer","3Rnd_UGL_FlareWhite_F"],[1,1]]```
I need it like this:
[["11Rnd_45ACP_Mag","ACE_HandFlare_Red","MiniGrenade","100Rnd_65x39_caseless_mag_Tracer","ClaymoreDirectionalMine_Remote_Mag","CUP_MAAWS_HEAT_M","30Rnd_65x39_caseless_mag_Tracer","3Rnd_UGL_FlareWhite_F","CUP_MAAWS_HEAT_M","11Rnd_45ACP_Mag","30Rnd_65x39_caseless_mag_Tracer","3Rnd_UGL_FlareWhite_F","CUP_MAAWS_HEAT_M","11Rnd_45ACP_Mag"],[2,2,3,2,1,1,1,1,1,1,1,1,1,1]];
That's... different
aaaaaah you didnt say so
It mixes up the arrays completely
{
(_containerMagazines select 0) pushback (_x select 0);
(_containerMagazines select 1) pushback (_x select 1);
} forEach _stripedMagazines;```
```sqf
[["11Rnd_45ACP_Mag","30Rnd_65x39_caseless_mag_Tracer",1],[1,"3Rnd_UGL_FlareWhite_F",1]]```
_containerMagazines = getMagazineCargo box1;
{
(_containerMagazines select 0) append ((getMagazineCargo (_x select 1)) select 0);
(_containerMagazines select 1) append ((getMagazineCargo (_x select 1)) select 1);
} forEach _containerArray;
{
(_containerMagazines select 0) pushback (_x select 0);
(_containerMagazines select 1) pushback (_x select 1);
} forEach _stripedMagazines;```
thats what I do
Oh, shit, sorry
On mobile ๐
What I'm thinking of is
_result [] = { select 0 + select 0}
And then _result pushback (select 1 + select 1)
Something like that
something like this I think
(_containerMagazines select 0) = (_containerMagazines select 0) + (_stripedMagazines select 0);
(_containerMagazines select 1) = (_containerMagazines select 1) + (_stripedMagazines select 1);```
Yeah, although in this case you should be able to use append
Does not compile
(_containerMagazines select 0) = (_containerMagazines select 0) append (_stripedMagazines select 0);
(_containerMagazines select 1) = (_containerMagazines select 1) append (_stripedMagazines select 1);
I just mean it throws an error
Does append return anything?
You probably won't need the = either
Read the wiki Taro ๐
I prefer to bother people ๐
Lol
yeah just this was enough
(_containerMagazines select 0) append (_stripedMagazines select 0);
(_containerMagazines select 1) append (_stripedMagazines select 1);
Behold! My ultra awesome script that... checks whats inside a box...
https://pastebin.com/gbJj0Lgu
Created by annoying people enough that they help me out. I got it pretty close on my own though.
Does "animateSource" command not work on buildings/houses
made something that inherits from class house, but it does not do anything with animateSource command.
Animate works though
could possibly just inherit from something else I guess
or could it be simpleobject thing?
I am looking for a way to run RCON commands but from a third party (not from the server)
Anyone know how to?
I have posted a topic
https://forums.bohemia.net/forums/topic/213188-enhanced-artillery-computer/
Bottom like, would anyone know where and when the script is kicked off when you select a target from the artillery computer or when you press the 'Fire' button
like = line
I would like to add a feature or two
@young current Check this https://forums.bohemia.net/forums/topic/202835-animatesource-not-functional-after-168/
@meager heart that issues is not quite the same, in the post it seems like the default source names have changed and it worked with right source names
I may have had wrong source = in the animationsource class though so testing
yeah my own typo xP
then ยฏ_(ใ)_/ยฏ
works ๐
success
Is there a possibility i can auto mount a specific attachment on a weapon?
depending on your definition of auto-mount, yes
Like when i select my gun in the arsenal, the scope will be on it. And you can't pull it off in the arsenal.
oh, that way. Not that i know of.
So what's your way then? Maybe that's the fix for what my problem
although if you have it on once, and change gun, it should stay on
well, i was thinking of using a script command in the unit's init box
that way you start the mission with it attached
use this list for a list of scopes https://community.bistudio.com/wiki/Arma_3_CfgWeapons_Items
Mhhm i see, i will toy around with those options. Thx for the advice!
cheers
unit init's box , yuck. The only way you can truly prevent the player from removing the scope is just by doing constant checks.
yuck
it works fine
The only way you can truly prevent the player from removing the scope is just by doing constant checks.
that wasn't the requirement
And you can't pull it off in the arsenal. ?
it works fine
debatable, not very clean to say the least.
plus it runs for every client that joins, using init boxes on everything
@subtle ore are you trying to make arsenal with specific stuff?
plus it runs for every client that joins
if (local this) then {}
and often "not very clean" is not much of a concern tbh
@unborn ether No, this isn't my concern. Look above
@inner swallow But why not just write one script that runs on the units you want it to?
I mean, you're almost crippling yourself trying to use an init box (applies for triggers as well), rather than just one script
is this possilbe? and if so what is the right way to set it because what ive tried isnt working.
player addEventHandler ["GetIn", {_this execVM "TLS\functions\Server\fn_DriverCheck.sqf";}];
I believe getIn runs in the vehicle
ok, thats what i thought, trying to find away around setting each one of my vheicles up one at a time
thanks
how would i modify this to pass vehicle?
player addEventHandler ["GetInMan", {_this execVM "TLS\functions\Server\fn_DriverCheck.sqf";}];
you're already doing it...
cool thx mate
hence _this
Im trying to create a script that checks for pilots online and if not then sync the highcommand to squad leaders to use transportation heli. i got the pilot check done just having trouble finding a way to sycn high comand to all squadleaders. any one willing to help me out
im a noob i figured it out
I failed to get it to work. any one able to help me out with this script. im not sure if i should paste it in here its kind of big
OK could someone PM me about how to go about seeing what scripts will cause a slowdown on a server or see whats bogging it down
Learning how to use dedmen's profiler is a good start
anyone willing to pm me to help with a script for assigning highcommand to squadleaders if no pilots online
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
rgr that, sry about that
@exotic tinsel I doubt that works correctly in multiplayer, you're using player inside a loop. You should be using _x.
Yep
if (typeof player == "B_Soldier_SL_F") then```
->
```sqf
if (typeof _x == "B_Soldier_SL_F") then```
+edit your text above pls @exotic tinsel (it's a pita to read like that =})
rgr thanks guys
how can i send a hint to _x squad leader to let them know that they do or do not have support any more?
["You don't have a support any more"] remoteExec ["hint", _x];
argument 2 is an object and in the wiki it will tell you that command will be executed only where _x is local
worked like a charm thank you so much
hey was wondering does anyone know how one could export the array generated by the script in this video https://www.youtube.com/watch?v=Qpu33XEycEs to a log file or something? trying to speed up making a loot table for a mission im workin on and i have a few mods on that add alot so thought it be easier to remove the things that are broken or dont want than to add it all one by one
diag_log straight to RPT
copyToClipboard str array in debug console would also work
Or diag_log array
array being your variable
I'd recommend copyToClipboard
trying it now
i think it worked!
thanks a lot
glad people like you on here to help
now time to sort it lol https://i.imgur.com/Ne5tl67.jpg
You can probably pre-sort it ingame
and just export the seperate arrays
not probably. you can.
ok will do the script builds arrays of all weapon types and throws it into a loot table
so would just need to edit it where it spawns one set at a time
break it down to sort easier
cant be having people finding used launcher in the table now can i
i could but that would just be plain rude
speaking of sort https://community.bistudio.com/wiki/sort
Not that kinda sort @inner swallow
eh ๐
well thanks agian im off for now
Dedmen why though?
Was that not the intention here?
Oh, I see
why does he need that? Seems like he wants to do some persistent thingy?
You are asking why somebody needs something?
He posted a video. If you looked you'd know why
Hello there, I need a bit of help for something that's driving me crazy, is there a way to make this script repeatable ? It works, but only one time, I'd like to reset the waituntil condition to 0 after the key has been pressed
[] spawn {
waitUntil {inputAction "User20" > 0};
_execblocNote = execVM "blocnote\blocnote_Open.sqf"
};
Check wiki about while
I tried with a while loop but i crashes the game
uhhh
do you put sleep in it?
Ah I see
use while loop
and another waitUntil that checks when the value goes back to 0
inputAction should be 0 when the button isn't pressed
Okay I'm gonna try this right now, thank you, will tell you if it works ๐
Crashed >_<
why not use onKeyDown event handler and check if the right key has been pressed and then you can spawn your script in it?
while {true} do {
[] spawn {
waitUntil {inputAction "User20" > 0};
_execblocNote = execVM "blocnote\blocnote_Open.sqf";
sleep 5;
};
}
Nope, not using CBA
you're spawning infinite threads
@fossil yew Because I dont know how usekeydown works ^^'
so i need to remove the spawn, right ?
yeah
And I just left waituntil
I read it
You didn't do it
I sent you the code
After you said "do you use cba"
I said add a second waitUntil that waits for the inputAction to become 0
you didn't
Do you know how spawn works?
Not really, I know it adds code to the scheduler
Yeah
But I've never really used it
you are adding millions (till the game crashes) of scripts that all at the same time wait for the inputAction
(findDisplay 46) displayAddEventHandler ["KeyDown", {
params ["_empty","_dickCode","_shift","_ctrl","_alt"];
switch _dickCode do {
case 2:{
_execblocNote = execVM "blocnote\blocnote_Open.sqf";
};
};
};
@lofty rapids You are spawning millions of scripts. But you want to repeat one script
So the while is in the wrong place
๐ฟ
Oh thats why
@umbral oyster GG. Nice nonsense awful script there
@still forum why?
params for all parameters although you only need one. And a completly nonsense switch
I don't know how I should answer the why for the switch.. It's just nonsense
Thanks for explaining a bit how spawn works ๐
like execVM
You are basically spawning so many scripts till it's too much and the game crashes
read more here -> https://community.bistudio.com/wiki/Scheduler
Thank's for the documentation, gonna read this
Sorry for being a "noob" at scripting, I still need to understand a lot of things ^^
np
you should start from scratch, I don't know if there is a guide for learning SQF tbh
'cos strolling through the Wiki isn't most time efficient
(Dialog ๐ข )
im trying to write a down and dirty remove restricted items from inventory. could someone please take alook at it and tell me how far off i am. https://pastebin.com/sXeEZEx3
It's forEach, not for Each.
Besides the typo's and SQF wrongnesses the logic you are thinking about is correct
lol crap ok
_removeditems == _removeditems + ", " + _x;
Single=for assignment.==is a comparison that reportsBOOL, but doesn't assign any values to an identifier.
and ARRAY select STRING doesn't exist
_gooditem == false
You can't compare booleans with==. Just use the not operator!.
__playerloudout
Two_when it should be one_.
yeah being up 26 hours working on scripts has def taken its toll. im embarrassed
_currentElement = __playerloudout select _x;
The current element of the array is_x. So there is no need to useselecthere. It will just error, because_xalready is a STRING.
Idk, I don't think this works like this.
logic you are thinking about is correct
Doesn't look right to me.
nope, getUnitLoadout returns something like this -> https://community.bistudio.com/wiki/Talk:getUnitLoadout
It removes items if you are not allowed to have
you have arrays in arrays in arrays in arrays ...
In a forEach, can you use _y ?
I thought he asked about if his thinking works. And not how horribly wrong his script is
@winter dune Sure? Why not?
Well it doesn't.
Iterating through all items and then removing items that are not allowed
Though only _x will work
Sounds right to me
@winter dune you can use _SomethingLikeThisIfYouWantOrWhateverElseYouWantReallyNoLimitsWhatsoever
back to the drawing board. thanks guys for feed back all good.
do the following - go to ACE slack and search it properly, I think Dedmen, commy and company made several examples of similar code
(don't bother them over there)
you can't really search in ACE slack
slack history is limited
because of the message limit
The chance to find that script there is about 0
let me try ๐
I didn't see anything like that in the last months
.......
makes me think maybe we as arma community would be nice to donate some money at least for slack
it would be beneficial
Also thought about that
the message limit even applies to my PM's where I keep my todo list.
Couple weeks ago Slack notified me about what I wanted it to notify me about. I couldn't see what it was because history limit
Commy wanted me to do something
@lone glade donate to ACE slack. Not slack in general
So that we can pay off the history limit
seriously put a donation link on your home page
7$ per month
omg, per active user per month?! are they crazy?
think it's out of scope (read wallet) ๐ฆ
yeah
Maybe just make a bot that records all messages and makes then searchable that way
good idea, yeah
Wanted to do the same for discord so I can see the crap spammers write here and get banned
think it starts from here -> https://api.slack.com/docs/conversations-api ...
yup, my company has one, not for public I'm afraid ๐ฆ
(ffs, why can't you change the fkn background of the chat to dark...)
Oh god... HipChat...
Pic or didn't happen
@still forum We tested HipCrap a while ago... damn... that thing sucks ass
I never tested ^^
Don't touch it
I know you have to run a completly closed VM for it
Think about the molested inbread of Windows, Linux and and a Commodore64
liar, you just painted that in, Alganthe
Rainbow ๐ ๐ณ๏ธโ๐
^^
would "items" work instead of "getUnitLoadout" ?
You probably can't remove a vest using unassignItem and removeItem either.
Ctrl+F Inventory, Vest or loadout
you'll likely need to either interpret getUnitLoadout or try calling multiple commands
I'd just use what I need.
yeah, try to focus
If I need items then I would use a mix out of getContainerItems and stuff
because items is just bullshit
do you have arsenal in your mission?
check whatever I wrote for I&A, it should still be in the thing
or thier inventory
Why do you even let them pick the items in the arsenal if you want them not to have then
because vanilla arsenal doesn't care about limitations
If the arsenal doesn't have a lynx. How would you get a lynx
it was just an example
it might be easier for you to create a mod and just put scope=1 for things you don't want
hahahaha no
XD
holy fuck ded
Make them DLC items that you don't have
thou shall not have that! ๐
I think you can't pick them up then?
likely not
you'd murder me If I linked my I&A restriction code
it's gone from the game
murders @lone glade for good measure
but it's protected so you can inherit it
No I won't.
You are dead to me now
Till you are alive again in the next episode although you died
Just to die again that episode
omae wa mo SHINDEIRU
NANI?
Was talking about SP Kny
ok so i have a working version but its nasty and can not be the right way. i have to loop through, uniform, vest, backpack, weapon, etc everytime someone exits thier eventory. please tell me this is not the right way.
wont that cause tons of lag thought?
No
as long as you don't use items and iterate through all of them. it won't generate lag
crash your server?
That script runs clientside
from lag
It won't lag your server
I don't care. Maybe other people do
if its an eventhandler that will run client side?
cool cool thats how i have it setup
i'm starting to think I don't wanna add the "hit" stat anymore.... jesus
Hello people i have made myself a little GIU (Dialog) and have added a RSCedit. There is no text in the Box and i want players to add text and that then becomes a variable. I have no clue how to do this to. Please help.
Is there like a button to confirm what was entered?
Add an eventhandler to the button that executes code when the button is activated.
And that code reads the edit boxes input using ctrlText.
And then does whatever you want with that.
Thanks works Great The only thing i was looking for was ctrlText was looking through the wiki but unable to find it. Thanks for the help anyway.
Cool.
Hey
Does anyone know how I could disable collision with an object?
Like, if I placed down a box and wanted to be able to ghost through it, is that possible?
enablesimulation = false;
I'd like for it to remain visible, but nothing else
I'll try enable simulation, thanks
Just a quick one is setPlateText In the game yet? and If so whats the syntax dont think its on the WIKI sawy this tweet about it. https://twitter.com/Greenfist3000/status/930475986814201856?ref_src=twsrc^tfw&ref_url=https%3A%2F%2Fwww.rebornroleplay.com%2Findex.php%3Fapp%3Dcore%26module%3Dsystem%26controller%3Dembed%26url%3Dhttps%3A%2F%2Ftwitter.com%2FGreenfist3000%2Fstatus%2F930475986814201856
Dev only or something.
@AHomelessWalrus#7053 enableSimulation won't disable collision. It will disable your ability to open the box though.
And.. I never said anything about invisible. attachTo.
I'll wait till you discover that it doesn't and then ask why
Its only in dev lulz
That's how it is with new things.
you can get it on non-dev too. If you are desperate enough
What do you have to do then ? ๐ฌ
Learn Assembly,C++,Intercept,SQF,Reverse engineering
Wish me good luck ๐ฉ
Im a very new to this wole scripting thing anyway ill just wait unitl they push the update ๐
@AHomelessWalrus#7053 I would recommend "reading" to you. It's a nice thing
@cedar kindle physx
Humans are not physx though sooo...
They collide
@still forum You mentioned attachTo, basically I just hook it with another object then and it'll inherit those collisions or something like that?
The object you attach to something else looses collision
@still forum Tried it out, but still looks like the object has collision. Any ideas?
I'm pretty sure the attachto works correctly because the object moves to the new position where the thing it's attached to is
I mixed it up apparently
attachTo works with physx but not with non physx. and disableCollision works with non physx but not with physx
player disableCollisionWith yourBox
OK, I'll give that a shot
thanks
that script would go into the init field of every unit, right?
alright
I want to make a black screen with cutText, but some UI elements appear in front of that layer. How do I force the cutText element to be in front of everything else?
All cut things are in layers next to each other. Unless your ui elements are also done via cut, you can't change the order.
Can I use something other than cutText in that case? I only want a black screen.
What ui elements is in front of it?
The spectator elements.
Sidebar with unit list, camera controls etc.
These things basically: https://community.bistudio.com/wikidata/images/8/85/BIS_Arma3_EDEN_VirtualSpectator_4.jpg
If you can, use it before spectator is initialized, then it will work
I'm doing that already
cutText ["", "black out", 0.5];
sleep 2;
["Initialize", [(_this select 0), [blufor], true, false, true, true, true, false, false, true]] call BIS_fnc_EGSpectator;
Actually that might be the problem, cause I have the respawn screen in the background which also uses the cutText...
Don't think you can hide those with cutX.
private _display = uiNamespace getVariable "RscDisplayEGSpectator";
private _control = _display ctrlCreate ["RscText", -1];
_control ctrlSetBackgroundColor [0,0,0,1];
_control ctrlSetPosition [safezoneXAbs, safezoneY, safezoneWAbs, safezoneH];
_control ctrlCommit 0;
I guess this should also work.
hax
Seems less hacky than those cutX tbqhfamlam.
Probably an easy question but I don't seem to find the relevant starting point. Is it possible to camCreate on a monitor or laptop, to create security cameras that are viewable directly in game?
you could probably do something with custom UAVs to do multiple
how so?
AFAIK screens can only be 2D interfaces
unless somehow I can do a monitor which is a vehicle that has PIP
but to my understanding anyways PIP doesn't take a camera
and is automatically computed based on the rear view...
Car side mirrors use PIP and they are 3D.
yes that's what I said
but can you specify a camera view to be used for a PIP?
I'm googling "render to texture" but I am not finding much yet
๐
Well, obviously all car mirrors show different things, so yes.
but to my understanding anyways PIP doesn't take a camera Aha
and is automatically computed based on the rear view
Is that so
How do you look at anything without a thing to look at it with?
magic?
Sure!!! We all know SQF and Arma are based on pure magic
@candid jay ```sqf
0 spawn
{
private _laptop = "Land_Laptop_unfolded_F" createVehicle position player;
_laptop setObjectTexture [0, "#(argb,512,512,1)r2t(uavrtt,1)"];
private _cam = "camera" camCreate (player modelToWorld [0,5,1]);
_cam cameraEffect ["Internal", "Back", "uavrtt"];
_cam camSetFov 0.5;
"uavrtt" setPiPEffect [0];
_cam camSetTarget player;
_cam camCommit 1;
};
A huge question about data/bandwidth relation. What is an actual limit for total objects existing via ctrlCreate or mission.sqm, or setVariable or remoteExec data considering that objects are fully simulated or just simple, variables are global, and remoteExecs are JIP. Based on default arma basic.cfg settings, on a good DS machine hardware with mythical 1GBit bandwidth? Just to get where it ends by your experience?
I don't think anyone has experience on that
ctrlCreate is something completly different too
and remoteExec aren't objects
maybe he means network usage ?
@lone glade Merged, like objects calculation on CPU + bandwidth usage.
Which doesn't really help you
can anyone give me any pointers to correctly use and apply event handlers and a custom addaction on players in MP? everything works via editor and SP scenarios but I would like to get it working for MP/coop scenarios without the use of initplayerlocal to fire everything I need because that would require people who use it to manually add the correct EHs, which without nothing would work
dedmen, just asking. no need for irony, unless it pleases you ๐ thanks for the help.
thank you sldt1ck!
It does please me yes
If you didn't get that out of my sarcasm. Every PiP uses a camera
Which channel do I use for GUI questions?
this one
no
you can put it directly into the config.cpp
config is #arma3_config btw @lone glade :U
You have to have the base classes you use declared though (declared != defined)
anyone know how to stop a failed task from being subsequently succeeded?
I have a destroy task on a convoy which fails if the convoy gets to the end of it's waypoints.
but if I delete the convoy units the trigger fires (yes, trigger) and completes the mission.
@worldly locust
https://community.bistudio.com/wiki/setTaskState
https://community.bistudio.com/wiki/taskState
Set task state and read it in trigger code, before executing.
Ah. Yes.
I just tried taskState "Convoy" !="FAILED" as part of the condition and that gave off a generic error
@worldly locust Yes, because argument is not a String it is a Task type.
or just add in activation field of your trigger after your code there deleteVehicle thisTrigger;
lol. yep. that would work...๐คฆ
Is it possible to define which markers should be visible on a custom map control that inherits from RscMapControl?
Or the markers visible in the map will be by default all available on the control too?
@candid jay Any map control reads all markers created. The only way is to temporary do setMarkerAlpha for allMapMarkers (or for specific types) while you browsing this map display.
@candid jay And yes, basic map markers, such a Gas Station marker will never go away
oh that's a good suggestion demellion. Thank you.
Anyone know off hand if init.sqf gets executed again on the client if they return to the mission lobby and change players?
it get's executed after preInit
so yes
There isn't much difference between just going to the lobby or completly disconnecting
I don't think it is executed again for the local host, because that is more like loading a savegame. But not 100% sure, as I never use init.sqf.
it should only be for the client, and yeah it runs again
init.sqf guaranteed also runs for the server.
Thanks
^^yeah but not if the clinet goes to lobby and rejoins (afaik)
Yeah, definitely not on the server
How do I make a AI point? sorry new this stuff
I am testing this
[this] join grpNull;
group this addWaypoint [position car_1, 0];
this setUnitPos MIDDLE;
"];````
in the wiki the exemple they give is _soldier setUnitPos "UP";
the "" do not work with this command
but it works if i put that command late when the unit was already created
Post all of your code

why the face palm anyway?
That unit init has no idea what opfour is,
and what is "[this] join grpNull; group this addWAypoint[position car_1,0]; this setUnitPos MIDDLE;"];
Why is it all broken up into quotes and msising brackets? Why are the brackets even there?
Why did you put that in the unit creation anyways?
And why would i not do that?
but is not wrong
it all works, is jut that "" thing that is the question to me
Opfour is a group variable i made for the test
My bad, I guess I didn't ever see that optional para
but ithas no clue what opfour is
its just a name
i put a unit, then give hes group a name opfour so when i create the unit it is sigh to that unit and then removed and make it owns
im just playing around with the unit creation
private _otherDudeGroup = group other_dude;
//not
private _otherDudeGroup = opfour;
@astral tendon replace "UP" with 'UP'
I got it, but it also works with out any of the "" ''
i need to know if that is something related to the editor and the debug console before dedicate to do a sqfwith it
k
another problem is that i cant set the face of the created unit face
[this] join grpNull;
group this addWaypoint [position car_1, 0];
this setUnitPos 'UP';
this getSpeed FAST;
this setSkill ['aimingAccuracy', 0.1];
this setSkill ['aimingShake', 0.1];
this setSkill ['aimingSpeed', 0.1];
this setSkill ['spotTime', 0.1];
this disableAI 'WEAPONAIM';
this setUnitLoadout getUnitLoadout selectRandom units loadout;
this setFace 'AfricanHead_01';
"];
๐ ๐จ
the problem was the lockIdentity
@astral tendon You can use SQF in your markup after ```
uh, can you paste it some place else?
```sqf
lockIdentity
```
stuff
getPlayerUID test
sqf Me setdamage 1
...
rip
its tilda tilda tilda sqf new line with code then new line tilda tilda tilda
No space after tripple * .
Press Shift+Enter for newline.
if (!alive player) then {hint "Rip"}
ay
noice
can some one add a note that on the unit init if you use setFace you need first use lockIdentity
lockIdentity this;
this setFace 'AfricanHead_01';
something like this
Is the lockIdentity always set to true default though? @astral tendon
Maybe there is a command like; isIdentityLocked or something
I tink that only happens with the createunit
units from the editor i dont need to do that
what is the problem anyway?