#arma3_scripting
1 messages · Page 413 of 1
Unreal Engine > Totally not worth BI using
2:14 AM] X39: simply because there is non of those today
what is pillars of eternity
what is that other game from obsidian that i cant recall the name of now
people indiscriminately shit on unity games these days alganthe, same with asset flips
what is divinity OS
I don't know about that. If I remember correctly, Talos Principle just used the default unreal AI, same animations and everything for their enemies
i think people shit on unity / UE because it all looks the same
Gameplay is more important than assets
Ecape from Tarkov is made in Unity Pro if anyone knows
That's a pretty decent example of a non asset flip game
honestly EFT is a fucking work of magic data wise
it's insanely compressed, but in return the system calls are through the roof
Pff.. RV engine only engine
@rancid ruin asset store still is useful
thing is: just do not just copy assets blindly in
there are more then enough games only containing bought assets
but they utilize them well and got actual gameplay
i really want enfusion to be good 😦
I only want it to be fixable
way more worth than being "good" IMO
The ability to fix everything that BI overlooked
Because they will overlook stuff
@austere granite all not available on consoles and especially not on the nintendo switch (which is the actual platform i care about, path of exile for example is a game i already play but is not so enjoyable due to it being F2P and that means no character changes depending on character)
also most of them are not what i seek simply because they are mostly just "hack n slay" with main focus on slay
no interesting spells etc.
but that belongs to #other_games_chat
must agree to that what Dedmen said about enfusion
BI has the choice of going full Assasins Creed DRM bullshit on A4 now that BI is more successful than ever.
No.
but c++ is way more work than c# died.
more important is that they do not fuck up EnScript
comparing a fork to spoon is the best
I don't care about EnScript. I can make my own
@unborn ether c++ is more work then c# is
honestly forks are useless
comparing them within the context of gamedev
i dont use them
c++ is obviously more work
C++ is better than Java 😄
rule of thumb for that would be: c++ for the engine stuff, c# for the scripting stuff (reasoning being that c# can be recompiled anytime)
C++, same as Java and C# is just a tools dude.
Each has a purpose
You can't just compare them, only against your requirements
agreed, and c# is an easier tool to use than c++
like a hammer vs something more complicated
Depends on what you want to do though 😉
If ever touch some Windows apps scripting, i'd rather touch them C# just because easier (not math dependant things)
There are things that C# just can't possibly do. Which probably aren't relevant on game dev
Launcher for the game is the best result of C# job
you'd have a hard time writing a good engine from the ground up in c# yeah
jup
there's python on Epic's roadmap for UE4
python's just way too slow for game dev
python isn't thaat slow
think the EVE online guys used some faster version of python for their game though
it's pretty fucking slow, look at PyGame
pygame's an engine that you can script in python with
thought we were talking about that
C# actually can do everything that can be done in C
and a game launcher should not be done in C# unless only target platform is windows
as WPF will not work on any other platform
the moment WPF is available on ALL platforms though, WPF and with it C# should be the one language all use when developing desktop applications
why should one do that?
doesn't mono work fine for cross platform c#?
Well gaming apps is mostly used on Win (not considering console games)
I already commited to do it. But not fully switch
Gotta learn to hack around to be ready for A4
i'm excited for the possibilities of dayz modding but am gonna wait and see how the scripting is
@queen cargo thiscall function hook with C#
Isn't A4 still like 3+ years away?
i'm ok with giving it a pass if EnScript or whatever it's called is totally fucked or too much work to learn
@still forum not sure what you mean with thiscall
apparently it's like java, and i have about 0 experience with java
According to BIS, A4 gonna be A3++ 😄
ahhh ... now i understand @still forum
indeed, that stuff would require one to use c++ in conjunction with c# (or not ... could also be wrong as i am not using those c# libraries capable of doing that often)
I already checked and C# doesn't support inline assembly. Atleast I couldn't find a way after an hour of searching
nope, no inline assembly
that is correct
all has to work in the CLR stack
though, there are unsafe blocks and methods, those still just get compiled into .net code
that might get compiled into actual assembly if the CLR decides to do so during runtime
C# actually can do everything that can be done in C
Do anything completly without the CLR and .NET
that sounds fun...
You said it's possible
Well.. no actually you didn't
what. no you did
I need sleep can't even read
welcome to the club 😄
you can hook C/C++ methods which is enough to do all you want with C#
So you can do anything you want in C#. By just not using C# for the things that C# cannot do
Well.. That works I guess?
Why would you hook instead of using it purely ^
a language running in a VM cannot do assembly without using a non-vm language ...
C# is just faster to develop, again, for the specific purpose.
If you wish to manage something really huge and important on "maths" - thats not that tool exactly.
https://www.codeproject.com/Articles/1392/Using-Unmanaged-code-and-assembler-in-C
this is essentially how to do all you want utilizing interop
C++ is cross-platformed (mostly) while C# is W-oriented
C# is depending on CLR which is available for all systems
only the windows related stuff like WPF is not available on non-windows systems
People often tell me C# is better than C++ because it's cross platform
wat
i like the look of rust and D, i hope they take off
well.. Then run a C# .exe on Linux for me.
You telling me I need to recompile a Linux version then?
nah
No, C# and anything non-windows is a bad idea
ATOM BEST
JAVASCRIPT SHALL RULE THE WORLD
It already does
ATOM BEST
ok ... now you crossed a line @lone glade
I know 😦
No that's spam now
@lone glade Im smart, i code HTML 😄
spits
well now people can tell that and be a bit of a true
mono can run a Windows built C# exe just fine (without WPF anyway... 😁 )
like most of the channels
@unborn ether What do you expect? 3000 people all telling you "no" ?
this is the only good channel on the server
Ok, anyways anybody knows how to fight that HC might change port in the middle of reconnecting to a server?
yeah, it's a client
Also that belongs to #headless_client this is #arma3_scripting
As I said. If you ask a question. Don't expect thousands of people to tell you that they don't know
especially on a specialized subject like that
I smell subjectivity
OK WHATEVER GUYS, I know I'm supposed t o be posting in #headless_client
but whatever guys
¯_(ツ)_/¯
Well since its dead it was just an attempt to ask it here.
You may just stop mentioning that 😄
Seems to be the excuse by everyone
ohhh i remember ❤ https://www.youtube.com/watch?v=R4Q79bpeA10 this music
I remember how I loved waiting for you Arma to start
I still do, because from time to time (even vanilla) it decides to just wait before launching it.....
boring video, no boobs
that's not quality video, watch BI teach you:
https://www.youtube.com/watch?v=-R7q2XsGIgs
How can you edit the main menu screen? 😃
Does anyone know a way I could find out the model of a road im on? I thought nearestTerrainObjects would pick it up but it doesnt
what does QGVAR stand for in ACE3?
as a macro
I can't find the macro file where it's defined ../
createDialog QGVAR(ProgressBar_Dialog);
this is the code with the macro
don't know if I answered your question
thanks
@warm gorge do you need the model or the type of the road ? Aka if it is a highway or a small dirt road ?
You can not get any more info than that about a road. You don't know which texture, which actual p3d model etc etc. You can only find out how wide the road is with scripting
Alright all good, cheers for the info
Is there any way to disable ACE markers?
ouch
My main purpose is to disable group channel markers
so I'm trying something like:
private _null = [] spawn {
private ["_display"];
disableSerialization;
while { true } do {
waitUntil {_display = uiNamespace getVariable ["RscDisplayInsertMarker", displayNull]; !isNull _display};
if !(currentChannel == 5) then { _display closeDisplay 0; };
sleep 1;
};
};
unfortunately this does not work
why not just delete the markers themselves
or yeah, do what nigel says
which is what you want
i want to disable them only on specific channels
but enableChannel does not work for group
that was my solution to map drawing before you could disable it 😄
Hello enableEnvironment has to be executed Client side or Server side ?
clientside
Ok thanks
there are no ambient animals or sounds on the server
I guess it's the same for enableSaving
No Idea. Why don't you just use the Mission attributes?
Good question 😉
Is there a way to disable Ace Cookoff on one object and leave enabled for all others?
yes
mind sharing?
20 seconds of googling: https://ace3mod.com/wiki/framework/cookoff-framework.html
sweet, thank you
Has anyone seen Norrin around lately?
Norrin, also known as Norrie disease protein or X-linked exudative vitreoretinopathy 2 protein (EVR2) is a protein that in humans is encoded by the NDP gene. Mutations in the NDP gene are associated with the Norrie disease.
Huh? #arma3_questions
What ya mean?
@still forum don u knoe de wae?
No. That's why I ask
Norrin, amazing scripter, been around for years.
Don't know the name. Was probably before my time
He's probably taking a break like all good Arma-ists do from time to time.
One of his most famous is the "Air Taxi" script
Are you saying everyone that doesn't take a break is not a good arma-ist? 😦
😭
I take a break every night
were is nkey ded ? 😄
That counts
you stowed him away in a dungeon?
No. He's online right now. Dunno what he's doing
Speaking of taxi, I have to play one right now.
norrin did a revive script that was hot around arma 3 release as well
everyone was using that shit
@rancid ruin He is just not worth for ded attention, so stfu 😄
Say I have a box with a filled vest inside, when I use the "everyContainer" command I get array with stuff like this:
["V_PlateCarrier1_rgr",2bc06b00# 163955: dummyweapon.p3d]```
How can (via scripting) get the array of items and such in the vest so I can empty the vest and "move" the items to the box with the vest.
The second element in that array is the vest
You just use any of the container commands on the vest like you would do with the box
Yeah I kinda get how I can put staf in and out of the box/vest. I'm having trouble in accessing that vest array
first one is the classname of the vest, second one is the container ref
@thorn saffron Just select it with a step
use params, select, or whatever, and use the cargo commands on it
oh ok, just a question: how can I get the array to coppy into a clipboard?
oh
or whatever I want copied from the console
you mean the content of the vest?
just in general
copyToClipboard
copyToClipboard can't copy arrays though. Only strings
And if you want to copy stuff from the console like you said. just CTRL+C
That I kind of figured out myself 😛
Is there a reliable way to move zeus spawned units to be local to the server? We sometimes have issues where a zeus will be laggy, and all the units will start teleporting around.
Ideally, something like a zeus can spawn some ynits, give them waypoints, then pass them to to dedicated server.
obj setOwner 2;
no simzor
Will that preserve waypoints?
Why no?
because it simply won't work
Its lierally what it does, transfers the locality of an object to server.
Why will it not work?
because it doesn't work like that with groups....
and units are in what again?
GORUPS
hell, i'm fairly sure there's a warning about that on the page
Srsly though, why does it not work?
Since Arma 3 v1.40, this command should not be used to transfer ownership of units with AI (agents are an exception to this rule). Using command in an unintended way will display an on-screen warning and log a message to .rpt file.
To transfer ownership of all AI units in a group properly, use setGroupOwner instead.
``` oh, it does
because it doesn't work.
and setGroupOwner also has issues
waypoints and behavior aren't passed properly with it
Ehm, AI's should be handled by server or a headless client.
setOwner doesn't work at all.
And still same principle, even if its setGroupOwner instead of setOwner.
just checked, ACEX headless module handles waypoints @kindred lichen
Warning! Incoming scripting stupidity and ineptitude!
_containerArray = everyContainer box1;
{
_containersItems = getItemCargo [(_containerArray select 1) select _forEachIndex];
} forEach (_containerArray select 1);
Trying to get the array of items in vests that are inside a box. I just get generic error in expression. Eh...
select _forEachIndex??
Just use _x
The wiki page for forEach tells you how that works
Nah that entire loop is messed up
getItemCargo takes a object not an array
everyContainer returns array of arrays. Not array of two arrays of arrays. Read everyContainer on wiki
you have 3 errors. And all of them are solved by reading the wiki pages for the things you are trying to use
_containerArray = everyContainer box1;
_containersItems = [];
{
_containersItems pushBack (getItemCargo (_x select 1));
} forEach _containerArray ;
ahh select 😛
Or you might want to use append instead of pushBack, depending on what you are doing with the array etc
ded, i'm at the point where I should decide if I make the stats control EH driven (and thus modifiable by third parties) or not.... the lazy ass within me is telling me no.
What speaks against it?
the fact that I know for sure people won't bother using it, ever
looks at most of the wiki 😭
TFAR will display stats about Radios
With a little push ACRE will probably do that too
oh, that does't need a modification of how i'll add those
it's already planned
it's "page" based, first page is vanilla
I don't know what you mean then
you told me to make it so 3rd parties could hook their own controls
But.. Adding own pages for TFAR n such.. is own controls? You are really confusing me
no, it isn't :D, there's 5 of each:
title
bar
text (within bar)
wait, i'll modify some things and show you what I have right now
You mean. Only support these types of controls?
yes
Instead of leaving third parties do whatever?
they wouldn't be able to unless I use CBA EHs to update and show / hide it
Well TFAR needs only text I guess. And AB needs a table n stuff
https://i.imgur.com/xjJTtch.jpg
~~ BIS ~~ modders could solve one of the biggest gripes people have with the inventory: the fact weight and volume is a combined value. "All" that would need to be done is to split it and have the volume fill the vest/uniform/backpack while the weight of the items fills the total gear weight at the bottom. This way you could have small but heavy items, or big but light ones. C-mags could weight the same as the MX 100rnd mag, but take more volume. Also the compatibility could be solved like this: keep the old mass config value and use it in case item has no weight or volume defined, if it does then use that instead, you can still use mass if say weight was defined, but not volume, in that case you use the mass in place of whatever was not defined. This would ensure compatibility with mods.
@thorn saffron weight doesn't exist
the won't change / add such a major thing this late into the game
this would be even worse for modders than the marksmen platform update
fun fact:
types are still written as such "2 * 256" by BI even tho it's not needed anymore
the 2 was the volume it took.
I like to use X* Y makes it easier to mass edit all of the values in one go
it's resolved to 512 anyways
unless you mod for A2 and A3 at the same time it's not needed
At runtime. cough cough
yeah, but I can quickly swap say 2 to 1.75 for all the multipliers
Oh sorry, I thought it was talk about configs
yes, types in configs, such as cfgWeapons and cfgMagazines
Well I edited the Blastcore to double the lifetime of all particles by replacing "lifetime =" with "lifetime =2* " and bam! couple of thousand edits in one go on many different values.
I don't see how that's related to what @lone glade is talking about
I have no idea what I'm talking about, I'm just trying to sound smart (and apparently I'm failing 😛 )
You just gave them the fuel for their imperfection 😄
@rancid ruin Thats was a sarcasm, nvm, not to you exactly 😄
Damn, everyContainer does not cover the rifles or other weapons.
Uhm yes.. because they are not containers
Oh nice, weaponsItems can read stuff from the box instead
@thorn saffron Containers are only uniforms,vests,backpacks
^ any supplyXX class
I need to check what happens if you put a pistol with attachements into vest in a box and run that everyContainer command
that includes "boxes"
you get the ref of the container taro, use the weaponCargo command and weaponItems
@thorn saffron https://community.bistudio.com/wiki/weaponsItemsCargo
didn't we go through this a day ago already?
possibly 😛
mission today had like 800 objects at [0,0,0]
the supply140/200 etc
5 fps
is it worth monitoring stuff there and deleting them?
can “line drawing” be disabled for a specific channel?
or is it at least returned in allMapMarkers?
allMapMarkers returns which user placed it
allMapMarkers returns which user placed it
^^ Or rather, if it was user placed or placed in editor / script
Ok so using
_containersMagazines = [];
{
_containersMagazines append getMagazineCargo (_x select 1);
} forEach _containerArray ;```
results in this:
```sqf
[["B_IR_Grenade"],[2],[],[],["30Rnd_556x45_Stanag","16Rnd_9x21_Mag","SmokeShell","SmokeShellGreen","Chemlight_green","HandGrenade"],[6,2,1,1,2,2], ["30Rnd_65x39_caseless_mag","3Rnd_SmokeRed_Grenade_shell","Titan_AA"],[1,1,1]]```
With I imagine is kinda hard to use to add the items to the box. So I would need to create custom arrays for holding the classnames and the item number. Or use some crazy contraption with checks if the subarray is even or odd 😄 .
I've got question about keeping a presassigned load out after a respawn. For example, I give units clothing weapons, inventory items etc. I can set it up to keep their current loadouts after respawn but keeps what they had when they died.
Also I tried to setup role selection on respawn and failed spectacularly lol
@timid olive You need to confirm teh state of the loot with setVariable + getUnitLoadout. Once unit respawns, just getVariable + setUnitLoadout.
Would that work from a loadouts.sqf? Or is something else needed? Im far from well versed in Arma code, but I can do it, in a pinch.
@timid olive Well the event of saving might be anything of your desire, like leaving a marker area, or pressing a button. For applying gear you can use onPlayerRespawn of https://community.bistudio.com/wiki/Event_Scripts
Right, I'll give that a read when I can get to my computer. Ideally I'd like to use an addaction on say a laptop with loadouts to choose, if that fails or is massively convoluted I might try to use role selection on respawn.
I think saving might not actually be what I'm looking for after reading what I just put lol
@timid olive You can export an arsenal loadout with CTRL + SHIFT + C ->
Is there a limit to how many Event Handlers can be on the EH stack at a time? My code is seeming to just completely ignore my attempts to add a new EH. No errors or anything
if(local player) then
{
//change (this to player)
//your arsenal export here
};
@subtle ore That works for respawn? Or just to define the kit on initial spawn?
@timid olive
if(local player) then
{
player addEventHandler["Respawn",
{
//arsenal export
}];
}:
depends if you have respawnOnStart set to 1 in the description.ext
if you don't then you'll need some sort of init script.
if(local player) then
{
//arsenal export for initial execution
player addEventHandler["Respawn",
{
//arsenal export for after respawn
}];
}:
you can toss that in a init.sqf script or something
That would be new territory for me, I got some learning to do.
Yeah, it's farily easy. Read up on: https://community.bistudio.com/wiki/Event_Scripts
This is also super important for mission configuration: https://community.bistudio.com/wiki/Description.ext
Something that is also confused: https://community.bistudio.com/wiki/Locality_in_Multiplayer
I can setup description.ext fairly easily, and init.sqf as well when it comes to scripts I've downloaded. This looks like a whole new bag of cats.
Also you can check Respawn templates and what is cfgInventory with cfgRoles
One thing I recommend you do: Try and do it yourself, you'll understand how to create these scriptsi later on instead of relying on others
@meager heart Wouldn't matter if you were to run checks after the player has been spawned, unless the new respawn sets the player [0,0,0] ?
Yeah, hopefully that'll get you a leg up in all of this farsight
Becuase as far as I can tell the player doesn't exist yet at the respawn menu sldt1ck
yes but menu inventory works with cfgInventory
Right, I understand that. But from farsight has expressed so far he hasn't been using the respawn menu
but if he is
then the CfgInventory + CfgRoles is the way to go yes
if you want people to choose from a select range of inventories
that is a bit pain lol
¯_(ツ)_/¯
I tried to once, it failed in amazing fashion. I picked a loadouts I assigned and became a bird lol
Yup, I changed it to something else, and it went back to the spawn menu, changed it again, spawned under the map so I gave up lol
No respawn points? There must've been something you were doing incorrectly
did you have a respective respawn_west or respawn point marker / module placed?
Usually is lol, I understand the logic of coding but fail in the execution . I used empty markers with respawn_west
Happens every time I try something new.
https://m.popkey.co/34fe63/EGWlQ.gif
you need also MenuPosition template
I'll check these out when I can, thanks for the assist, I'll let you know how badly I mess these up lol
Lol, it's all part of it
I see it as, you either nail it the first time or fail until you get it nailed.
Oh I've noticed, it took me weeks to figure out multiple spawn points until someone said just copy past the marker and change the names
Lol
Does anyone know why a ctrlAddEventHandler would return -1? (meaning it fails to add)
Indeed, my skill with mission design is laughable at best, but the fails are great
@river meteor This happens when you try to add EVH not supported for the argument, i.e ctrlAddEventHandler will fail if added to display. Also fails, when the argument doesn't support that EVH.
anybody have any idea why when i start arma 3 it disables my windows audio. Which at that point i cant reenable it without a restart. This happens with and without a headset
how to get banned 101
@willow kayak Has nothing to do with #arma3_scripting
read the rules and stop reposting in every channel possible
You've posted everywhere
not everywhere just some places
"Just" in some
yep
I only joined this discord to get help on matter didnt even read them
@willow kayak That doesn't make you exempt from having to follow the rules
That should be the first to do with anything surely ?
No one is going to help you if you do something like that
no most discords dont have rules
i have stopped posting everywhere so since this is the scripting channel you guys should get back to scripting talk
This one does, and it's pretty obvious under "Information"
@unborn ether I'm adding a "ButtonClick" event to a button type object. It's pretty straight forward code and I do virtually the same thing elsewhere, so it really doesn't make sense to me why it would fail to add
@river meteor Interesting, is that RscButton or something custom?
@unborn ether Custom
@river meteor Check it with ctrlType. As far as i remember ButtonClick is only applicable to type = 1
@unborn ether It's a type 1. I've done the exact same control event not for this exact ctrl, but for this ctrl's parent. So the only thing unique about this control is the idc and the x,y,w,h. I'm storing the control is a variable that looks something like this _myControl = findDisplay DISPLAY_IDD displayCtrl CTRL_IDC;
@river meteor 🤔 Check if its not controlNull this way.
@unborn ether Can I print the variable value to find this or do I need to do a comparison?
@river meteor _myControl will give a result
@river meteor It will be either No control or Control ###
so it is no control @unborn ether
@river meteor Well that means that findDisplay or displayCtrl fails to find what you need.
@unborn ether I think I forgot to include my .hpp file that contains the parent classes when I made the display
hahahahha
yes, don't forget defines have to be included everywhere you wanna use them 😄
Unbelievable man. Super shocked that I got no error, and the display looked like I expected it too as well
@river meteor Well both findDisplay or displayCtrl return NULL-objects on failure.
Yeah but I figured the display would throw an error due to referencing parent objects that weren't defined
nah
Just like pointers man. Program makes you think you are ok for a while until it drops the floor out from under you
Thanks for the help @unborn ether
So a followup question since I need to figure out my includes, where should I include my defines if multiple .hpp files need to use the same defines.hpp file
To avoid redefining it in the description.ext?
doesn't matter
only mikeros tools complain about redefs without undefs
preprocessor doesn't care.
when I load in the game I get a popup about it though
circular defs ?
include it once on the hpp file that is above the rest
or include it before the other includes in description.ext
does description.ext need to include everything else though?
what do you mean by "everything else" ?
So I have we can say 5 displays each in their own .hpp file. I was under the impression that I would need to do a #include for each file in the description.ext or include a file which includes another file, but make sure that the tree starts with description.ext as the trunk and everything branches outward
include merges the file into the target one
@Mnaason if you #define in the same body where you #include another data - this will share, as preprocessing has an order. But that will not work for spawn call execVM as this is scripted part already.
Ah I see, so I can include the definitions in one and it will apply to all of them as long as I include them in the one I included the defines
yes
think of include as preprocessor copy and pasting the included file where the include line is
Cooked this one myself. This way I get an array with same format as the one you get from getItemCargo, so I can reuse code.
_containerArray = everyContainer box1;
_containersMagazines = [[],[]];
{
(_containersMagazines select 0) append ((getMagazineCargo (_x select 1)) select 0);
(_containersMagazines select 1) append ((getMagazineCargo (_x select 1)) select 1);
} forEach _containerArray;```
```sqf
[["30Rnd_65x39_caseless_mag_Tracer","11Rnd_45ACP_Mag","ClaymoreDirectionalMine_Remote_Mag","CUP_MAAWS_HEAT_M"],[1,1,1,1]]```
Does anyone know if its possible to disable the join/leave messages in sidechat?
If you are referring to the disconnected/connected then no
Its battleye and only thing that could come close would be showChat false
Yes it's possible. No you can't.
Why is it so quiet today? I thought I'll miss loads of stuff while sitting here with no interwebz.
I only missed one spammer and some smalltalk about the preproc
trying to figure how to retrieve the stats without destroying perf
just got back in front of my pc too 😄
What are you doing that you can feel the stats on perf 😮
It's just a couple config lookups :U
nothing yet
Oh. Good! Thinking ahead is good thinking
i'm debating wether doing it while I retrieve them in scanConfig and then do the "3rd party" ones on arsenal opening or doing it when the item is selected and using pre-defined min-max for the bar progress calculation
I don't think the perf is worth all the memory you waste for that
so second one it is?
min-max? That's something you can do in scanConfig. But like. Don't cache all stats in scanConfig while 90% of them are probably never accessed
Did you find a solution for custom controls? like the AB table?
nah, CBA EHs don't work in 3DEN
Do you know why?
postInit not running
Why do they need postInit?
Mods can register their stuff in config instead
like XEH
I don't see why local events wouldn't work without postInit
Otherwise just do the basics now but leave the API open enough so that can be added later
that's what I'm planning to do
nope, CBA EH really doesn't wanna run in 3DEN :/
also fun fact: running ctrlShow true on a control group unhides all child controls for it
moving cached units
Now how do I do a systm similar to the https://community.bistudio.com/wikidata/images/b/bc/A3_dynSim_proxyEval.jpg
Is there any reason they used squares instead of circles?
easier to calculate?
well, it's a square and not a circle for one
Hmm
Yes
I guess
Save 4 points around cached units and that will form a square and then inAreaArray then from the player :\
Actually squres suck
@peak plover that looks like a grid
squares just represent the tile(s) the unit is in
Anyone know of a way to detect if the player is looking through a magnified optic of some sorts? Binoculars, weapon sights, vehicle optics, etc?
@tough abyss https://community.bistudio.com/wiki/cameraView
Perfect, thank you.
@young current I thought squares represent the check, and that they'd be combined with nearby groups, they would make a bigger one, so there'd be less checks total
Hmm
I need to run tests and see if it's a lot faster to use inarea with square
Maybe inpolygon 😐
Is Commy.... dead?
Why?
nope
not everyone can deal with the fact that they contributed but lack the prestige in public
not everyone who's gone is dead, more importantly 😛
death is a common thing amongs modders
though ... most time it is the project that faded away
member medical rewrite?
member the heat death of the universe?
which one youre talking about? AGM, ACE or XMedSys rewrite? think CMS also wanted to do one before they announced ACE
CMS rewrite was done, it's called the ACE medical system now
I have 0 drive to make / finish ACE Arsenal stats, 90% of them are bullshit
I'm really only interested in the AB stuff
Not needing to delve deep into configs anymore to configure your ballistics calculator will be awesome
how quickly does items _unit get updated in MP? I’m checking client side whether a specific other player has a specific item (“ACE_DAGR”) and the mileage varies a lot, sometimes it results as held even when it has been dropped on the ground for a long time (>5 minutes)
Updates about remote objects to certain client are sent depending on distance from that object to client's camera
Better idea would be to make player send notification when certain item is dropped or taken, depends on what you're doing though.
I basically want to track users on a map depending on whether they have / don't have the "ACE_DAGR" item in their inventory. BTW we were standing 10m apart.
I was thinking to do the whole EH circle, it just seemed a little... off.
Just have each client setVariable their units when they drop or get the item
yeah got that
I thought to ask here first if that was normal, because I didn't expect it.
Yeah it is normal, network optimization with infrequent updates on information of secondary importance (compared to say position, damage, etc.)
ok, thank you
another question...
_USER_DEFINED #<PlayerID>/<MarkerID>/<ChannelID> is MarkerID a counter on a / player basis?
because I'm seeing weird behaviors
Yes each player has their own counter
ah-ha
that's why then.
gotcha
so the key is the combination of all 3 I guess (to be on the safe side)
Yeah its just network-unique name which also holds some info about the marker and its origins
Anyone know why setWaypointStatements's condition statement would execute repeatedly when WPs are assigned to the player's group, yet not have the same behavior when assigned to an AI's group's WPs?
e.g If I put a hint message in the condition, the AI will just walk over to where the move WP is, but the hint is never shown
yet if it's the player's group's WPs, the hint message gets shown repeatedly while the player is moving to the WP's position
I've only used setWaypointStatements on AI groups, and it does fire only once... Never used on a hybrid group of players / AI, sorry
Beware that setWaypointStatements will fire on each connected player
So if you're doing some remoteExec logic in there (including functions with global effect) you'll end up cross-firing 😃
(just sayin'... it bit me once)
oh that's annoying
UNLESS it's a local trigger
createTrigger by default creates it local, unless you specify differently. Triggers in EDEN will be global.
Nice
@meager granite I only see the put and take EH but they refer to putting / taking an item from a container... not the ground (at least, according to docs). Are you aware of other EH that would also cover dropping the item or passing it to another soldier in their bag?
CBA has inventory EHs afaik
I can't seem to find a list
Uhm... The ground also is a Container that gets created
ah ok then all good. The docs referred to "containers" and give as example (vehicle, box, etc.) 😄
loadout EH
oh nice
What does this adds on top of take and put though, if the ground is a container... do you happen to know?
not having to do it yourself ? 😄
loadout playerEH is not take/put. Not at all
it's getUnitLoadout each frame and comparing to the loadout of last frame
I understand that, hence I'm asking what is this supposed to give more thatn take and put if the ground is considered a container...
It's way easier to use
But it only works on the local player
so it kinda is a completly different thing
that's fine
and no the ground is not a container
If you drop an item then a weaponHolder is created on the fly
I have to set a global variable anyways, given that items apparently does not get propagated as I would have expected
iterating over items to find something will get pretty bad pretty quick btw
Especially with ACE when some medic might have hundreds of items
how to get the selectionumbers of a model?
@still forum that's why i'd rather use take and put IF they work for objects put/taken from ground and from other backpacks too
I just have to try, was only reading docs for now
I'd have the same issue with CBA's loadout since I'd still have to loop the loadout
put/take works if you have nothing adding/removing stuff via script. Like Arsenal
I mean the 0 and 1 in ```sqf
_objectname setObjectTexture [0, "\pboname\texture.paa"];
_objectname setObjectTexture [1, "\pboname\texture2.paa"];
That is the hiddenSelections array in the config of your object
what are hiddenSelections used for?
to allow you change to a custom texture
They are selections that you can set the texture on
Just like the script you just posted
How do I know which selection represents which part of the model?
Try setting it's texture and use your eyes to see what changed
a model doesn't have any hidden selections
a model has selections
I think Elitness can show them. Not sure
you can take if from the config of the model
The config doesn't say anything about how many selections there are
Are you done editing?
says nothing about how many or what selections there are
yes
and I think model.cfg also doesn't need to contain them all
As I said. Elitness might be able to display them. Not sure and don't have it handy right now
anyway, what do you want to do with it Jermin.
You can get selection names (at p3d level) from script: https://community.bistudio.com/wiki/selectionNames
If you want to know which ones you can change the texture of, that's what hiddenSelections is for, and it is a CfgVehicle setting of the model
I want to texture a vehicle but I don't want to miss any parts
some scripts specifically texture the third hidden selection and leave the others in tact
I want to figure out why the programmer did that
He probably tried. And saw that he only wants to change the third
The vehicle creator decides what selections exist and which are exposed as hiddenSelections.
He can have a single hiddenSelection that allows you to change the texture of one nut on one of the wheels.
Or he can have hundreds that allow you to change everything you'd ever want. Or just none.
OK
also getObjectTextures will return path to all hidden selections if they exist, Jermin
no
well.. yes.. obviously. As.. You know. Guns have textures...
but not #arma3_scripting
Why? Is it an engine restriction?
Kinda
You need to pass an object to setObjectTexture.
You can't get the weapon object though
Alright then
out of curiosity, when you place a weapon on the ground, is that not an object?
no
especially if you place it through editor?
No
ground holder
it creates a invisible box and places the weapon inside it
aha
same as the one on your character
BI hax
your uniform is a body
your vest / backpacks are attached to you by special containers, so are your weapons
your wrist is a weapon throwing nades
it's also a weapon to "put" mines on the ground
lol
yeah i knew about the weapons
(and weapon stone is actually a grenade that doesn't explode)
and there is no actual body at all
didn't know about the rest
Ive got a hopefully simple question. howdo you make the nearestobject look for a player the position is a sign for example and i want to know who is the closest player. nearestObject [position, type] is the syntax wouldent the script then be
nearestObject [Testsign1, player]
no... the syntax wouldn't even be close to that
type should probably be "Base_man" or something
Scripting is not magic. It's logic following a syntax
It takes a position or object. And a classname
player though https://community.bistudio.com/wiki/player returns an object
so you have a syntax error there
_nearestPlayer = nearestObject [Testsign1, "Man"] That would kinda work. But also return AI's
Read the wiki page of https://community.bistudio.com/wiki/nearestObject and https://community.bistudio.com/wiki/nearestObjects
Returning AI's is not an issue thanks for the help
Why are numbers so small memory wise, and what are some strategies to work with larger digit numbers in sqf?
Numbers start losing precision at digit 8 if I remember correctly, and they will also be displayed in scientific notation after digit 6
you can use toFixed to display them correctly
Yeah. They are single precision floating point numbers
if you need better then store them as string
Or use more than one number
Or change your logic to not need big numbers
Thanks for the toFixed. That helps one problem, and I think for the other I'll just consider it a creative limitation.
toFixed doesn't make them more accurate though. It only helps displaying them without further losing precision. Unless you convert them to STRING at some point in your logic, they will just be as inaccurate.
but surely when you come to use that string'd number it doesn't make any difference
you can't get around single precision floats just by storing them as a string
isn't the losing precision thing a consequence of binary to decimal conversion, etc?
Well at the point where they are lost its not a big value against its size actually, 1000015 -> 1000020, is not a big loss. You can trim it by Number->String->Number to make anything after 6 digit to be 0 for your operations
not a big deal in arma yeah
unless you're doing some non-map-related stuff
like to run in to float precision problems with a terrain it'd have to be ridiculously big
i ran in to issues with single precision floats in a little game i made, using real world mapping data on a global scale. had to use double precision because yeah, the world's a big place.
Floats are pretty bad in Arma. Just look at how jerky attachments on weapons are.
You mean that stuff when your gun moves badly against your hands?
Oh yeah, since scope view is an actual object, found some while was scrolling simple objects
Guys, Is it possible to change the speed of reloaded weapons at the scripts?
Anyone have example?
@umbral oyster No, you cant change reload speed of a gun, as its based on animation speed. You can only change such things as: firing speed, recoil, sway.
simple question: does a minimap have the standard map interactions available, or do you need to custom code them in?
i couldn't find an example on which functionalities are available
@candid jay The one from GPS you mean?
actually I am thinking about the microDAGR from ACE, or a simple tablet for instance
so satellite / mix
@candid jay Well the only base control that simulates any map (actual engine map) comes from RscMapControl type. So if you find a control itself, you can apply EVH same as for any map control.
ok so if you want to use it to add markers for instance you need to code that in yourself?
@umbral oyster did you look into the scripting commands
Yep, I look, and nothing found
@umbral oyster setAnimCoefSpeed can work too
that working on players?
But then all anims will be that speed
@rotund cypress nope, not work
setWeaponReloadingTime doesn't increase the reaload of infrantry guns same as setAnimCoefSpeed
setWeaponReloadingTime working only on vehicles, right?
player setAnimSpeedCoef 10 will make it really fast to reload weapon. It does work. @umbral oyster
@rotund cypress Did you actually check this?
@rotund cypress nope, I trying, that not work
Ehm yes, otherwise I would not have told him about it.
what are you after @umbral oyster ?
It does, you are doing something wrong then. @umbral oyster
@young current ?
what are you trying to do
@rotund cypress Pity, but it doesn't actually, exactly around realoding anims. Simply because reloading is considered as gesture, as you can move that time.
player setWeaponReloadingTime [player, currentMuzzle player, 0.5];
correct @young current ?
no idea. look what the command page says and try it out.
@rotund cypress ```SQF
(findDisplay 46) displayAddEventHandler ["KeyDown",{
params ["","_code"];
if (_code in (actionKeys "reloadMagazine")) then {
player setAnimSpeedCoef (random 10);
reloadStart = time;
};
}];
player addEventHandler ["Reloaded",{
reloadFinish = reloadStart - time;
systemChat str(reloadFinish);
player setAnimSpeedCoef 1;
}];
This shows it doesn't affect it.
@umbral oyster setWeaponReloadingTime only affects a speed of fire of infrantry guns, and some weapons of type "Cannon". You can't make unit weapon to reload faster.
Just wondering if there is a script for grass cutting other then the eden editor ones, as I need to cut a large area of grass? Any help would be great!
@fiery lynx You can createVehicle these types of objects at specific coords
class Land_ClutterCutter_large_F : Thing
class Land_ClutterCutter_medium_F : Land_ClutterCutter_large_F
class Land_ClutterCutter_small_F : Land_ClutterCutter_large_F
Hey, just a quick question, sure I could figure it out in a few minutes but can't really be bothered and just want to see if anyone can help. -- I'm making a custom main menu for a mate who asked for one and I'm just wondering how to change the place that the camera is spawned on main menu? I assume it's CFGWorlds or something ( I'm talking about like what you see behind the main menu, sometimes it's a heli, sometimes a dock, etc)
If noone can help I'll just research it and share what I find here afterwards
thanks dude
how can I get an object's p3d model name for a thing I'm looking at
@thorn saffron modelInfo
sorry, getModelInfo
_modelInfo = getModelInfo cursorObject;
Thanks, will try it now
@thorn saffron for objects that are map placed just do cursorObject and it'll be in the stuff there
Yup, got it to work
Hia guys - back after some time away from ArmA III where last I was working on learning to script etc..
With this new EDEN editor, it looks like a lot of stuff that we had to code before has now been "automated" - or made drag and drop, is this correct?
Like setting up multiple respawn points with a ticket system literally required no coding
EDEN editor is full 3D
not talking about 2D vs 3D
talking scripting vs drag n' drop (in EDEN)
example is ticket based respawn system
Yeah there is a lot of that
so a lot of stuff has been "normalized" into modular components instead I guess?
but this is not mutually exclusive right?
you could if you wanted to - still do it the "old" way?
like script stuff?
yes
Yeah totally
ok
Eden completely replaced the old editor
really struggling to just get some knowledge about the API and setup"
of what?
well example...
making a mission with 1 spawn for east and one for west - then a hill in the middle with a sector control
each side has 200 tickets - if one side owns the sector control, then I want the opposing side to bleed tickets
this seems like it is possible to do without actually writing any script - with EDEN editor
I seen a tutorial to do that. It's just a couple of modules and some triggers
Just as possible as before
and probably a lot easier too
Eden didnt introduce new modules for it - to my knowledge
Zeus is in mission game master
they have the "zeus" logo next to them
these modules
I'm totally new so not saying anything against what you say 😄
Yea they migtve been introduced or modified with the curator dlc
man you've been out of the loop for some time
I didnt get so far last time lol
But yea they can do a lot of basic setup for you
If you wanna handle the details, script
but question: if I drag the "ticket bleed" module in - do I need to also have a sector control module and then sync them?
and do I need to sync the bleed module to the respawn modules?
(well other way around I guess)
They removed the infopanel for modules sadly.
yeah that one sucked
I think some still have some info but not all
here is a problem I run into a lot - get a lot of video's - but they are not in "EDEN" format, and used a different approach it seems - a much more scripting based approach
You almost always have to mix and match in the end
ok
But you can do exactly the same thing, the modules are the same etc.
there is no documentation for the "new" more UI based approach?
Theyre the same just the editor looks different
I don't wanna do stuff in a hmmmm deprecated way
Some changes with modules, since they can now have their own areas
See the cover map module
yeah was a question I had too - like would the ticketbleed module with a radius do the same as a sector control module?
so it's like 2 in 1 module
handles dominance at the same time within it's own area
ok so have to sync with a sector control
did - but not sure I get right results lol
did not work
but maybe it just doesnt work coz some other mistake I made 😄
can I upload an image of my modules?
well guess I can - will you look at it is more what I mean 😃
You could link imgur but i wouldnt be able to help you either way
Maybe theres more experience in #arma3_scenario too
damn, thought I was in that room WTF
lol
well - you guys are a helpful lot - I'll say that, nice discord server!
Don't worry we will be massive dicks to someone else, to keep the world in balance 😄
no need I just beat my dog to compensate
Yey fun
it had to be giant ehh....
Yeah. What fun is it to beat someone with a straw? 😄
Not everone here is that nice. Beware of me
huge would suffice was my point
@thorn saffron thanks for the links, last one was really good!
@gaunt hamlet there's a sector control module tutorial video in the old format that works fine in the new editor, I tried on the weekend.
Got the sector control to work
and got bleed to work based on sector control
just get default values of bleed 😦
Just had to sync both the Sector Control module and the Ticket Bleed module to a Game Logic
Seems the Sector Control module can proxy sync with side logics on behalf of the Multiplayer Sector thingy if you just sync them all to the control module
which was pretty cool
Question: For end game logic - Do you just add some evaluations to an event of some kind and call a arma function that ends the game and takes a side as argument for winner?
like as a trigger or something
Probably take this to #arma3_scenario or #arma3_editor now 😜
will do - thanks for help guys
Hey guys, is there any scripting command that will trigger the "Unload all cargo"?
For example, to script unloading of a vehicle inside a blackfish
I suppose, maybe it has to be done via an action?
https://community.bistudio.com/wiki/setVehicleCargo
Can also be used to unload a specific loaded vehicle or all loaded vehicles.
hey, I keep getting the issue where it says that the base class is undifined, altough it is? If been trying but nothing works... help?
That is #arma3_config
okay, my bad
Hello boys and girls just need help with a hopefully simple thing. Ive got a variable called ColorRed and is equal to 0.5 I would like to use that in this script _veh setObjectTexture [0, "#(rgb,8,8,3)color(0,1,0,1)"]; and make the first one in 0,1,0,1 be equal to ColorRed (0,5). Simpley what i am asking how do i use a variable the script. This was my first attempt _veh setObjectTexture [0, "#(rgb,8,8,3)color(ColorRed,1,0,1)"]; But it did not work.
I am very new to this whole armar scripting thing and scripting in general....
find format in the biki for examples
trying to figure it out with the help of that... What confuses me is the format syntax is ? format [formatString, var1, var2 ...] and the ´setObjectTexture´ also uses [] do i then have to use both something like _veh setObjectTexture format [[0, "#(rgb,8,8,3)color(%1,1,0,1)"],ColorRed];
no, since format itself returns a string, and not a string within an array
["arraystring"] = [format [formatString, var1, var2 ...]]
close, you just put the format in the array instead
Keep in mind that it doesn't "use" []: rather it uses arrays, which are denoted with []. They aren't random magical special brackets, so to say.
_veh setObjectTexture [0, format ["#(rgb,8,8,3)color(%1,1,0,1)", ColorRed]];
The variable ColorRed is taken from a Slider inside of a dialog and there for is equal to something like [Control #1900,0.7]Where the last part (0.7) is the part i want the variable to be in order to change texture of the car. How can i remove everything els....
if you slider range is from 0 to 255
just do
and you should have a string with 4 values from 0 to 255
my mistake, one sce
0 to 1, for arma RGB
now it's from 0 to 1 xD
if it's from 0 to 1, select 1 will be enough
Yea. So take value from controls array > format into proper format for procedural texture > Profit
The yourSliderCtrl part would the be what i have named my slider or the idc?
you can have extract the value from a slider with two methods
either you use sliderPos IDC
or do ((finddisplay) displayCtrl sliderIDC) select 1
sliderPos is more simplier to do
sliderIDC ?
oh its just a number ok
yes
thought you talking about command
// Extract value #2
_yourSliderCtrl = ((findDisplay yourDisplayIDD) displayCtrl sliderIDC) select 1;
Thats faulty, as displayCtrl returns a Control not Array
shhh, keep watching dismal
👍
the whole conversation got me hooked
okay
neither really matters until @fleet wind replies either way
My brain is melting. im just trying to hint _MyRGB like this and i get an error saying Error select: typr Number, Expected array,string,config entry error says to be on row 11 ```sqf
_yourSliderCtrl = sliderPosition 1900;
_myRGB = format ["%1,%2,%3,%4", _yourSliderCtrl select 1, _yourSliderCtrl select 1, _yourSliderCtrl select 1, _yourSliderCtrl select 1];
hint format["Slider RGB %1",_myRGB];
don't follow my code
Row 11 = _myRGB = format ["%1,%2,%3,%4", _yourSliderCtrl select 1,
use sliderPosition to retrieve the current position of your slider
So slider position will return a number only?
yes
fantastic im on to something now Hahhaha Thanks for all the help you guys have provided 😉 Not easy being noobie trying to code.
Yes!!!! Ive got my little reskin cars thing to finally work Thanks alot for the help.
ok so, the "weaponsItemsCargo" returns me arrays in this format:
[["arifle_OSR1_F","muzzle_snds_H","acc_pointer_IR","optic_ACO_grn_smg",["30Rnd_65x39_caseless_mag_Tracer",20],["3Rnd_HE_Grenade_shell",2],"bipod_01_F_khk"]]```
With basically boils down to this:
```sqf
//rifles, with UGL
[["weapon","muzzle","siderail","scope",["mag",ammo],["UGL mag",UGL_ammo],"bipod"]]
//launchers and pistols and rifles without grenade launcher
[["weapon","muzzle","siderail","scope",["mag",ammo],"bipod"]]```
Now, I would need to "disassamble" every weapon to get out the weapons, the items and the magazines separately. The issue is twofold: first, it must work for both rifles with and without UGL (+ other weapons), second I have little to no idea what am I doing.
I kludged up this:
_weaponsAndAttachements = weaponsItemsCargo box1;
{
private _count = count _weaponsAndAttachements;
if (_count == 7) then {
private _weapon = _weaponsAndAttachements select 0;
box1 addItemCargoGlobal [(_weaponsAndAttachements select 1), 1];
box1 addItemCargoGlobal [(_weaponsAndAttachements select 2), 1];
box1 addItemCargoGlobal [(_weaponsAndAttachements select 3), 1];
box1 addItemCargoGlobal [(_weaponsAndAttachements select 6), 1];
box1 addmagazineCargoGlobal [((_weaponsAndAttachements select 4) select 0), 1];
box1 addmagazineCargoGlobal [((_weaponsAndAttachements select 4) select 0), 1];
} else {
box1 addItemCargoGlobal [(_weaponsAndAttachements select 1), 1];
box1 addItemCargoGlobal [(_weaponsAndAttachements select 2), 1];
box1 addItemCargoGlobal [(_weaponsAndAttachements select 3), 1];
box1 addItemCargoGlobal [(_weaponsAndAttachements select 5), 1];
box1 addmagazineCargoGlobal [(_weaponsAndAttachements select 4), 1];
};
}forEach _weaponsAndAttachements;```
you are resetting the count every loop of the forEach @thorn saffron Count never appears to change either. You can use _forEachIndex to get the index of what the forEach loop is doing and do away with _count in the first place
I get a zero divisor error
I'm trying to "dissemble" this:
[["arifle_OSR1_F","muzzle_snds_H","ACE_acc_pointer_green","optic_ACO_grn_smg",["30Rnd_65x39_caseless_mag_Tracer",30],["3Rnd_UGL_FlareCIR_F",3],"bipod_01_F_khk"]]```
why is the same array outside and inside the for loop?
@river meteor look above, the _count can be either 6 or 7
@thorn saffron Do you understand the concept of a 2D array?
Not in a bit, I suck at scripting.
each set of "[]" is an array
that I do know
this is what I try to dissemble:
//rifles, with UGL
[["weapon","muzzle","siderail","scope",["mag",ammo],["UGL mag",UGL_ammo],"bipod"]]
//launchers and pistols and rifles without grenade launcher
[["weapon","muzzle","siderail","scope",["mag",ammo],"bipod"]]```
ah I think I know what I'm doing wrong
so the first one is a single array, and within that array you have another single array, and then within that array you have 7 items
so if you take the count of your array, you get 1
if you take the count of your array select 0 you still get 1
oh no excuse me, if you take the count of your array select 0 you should get 7 for the first array
right now in your code _count will always be 1
also change this: _weaponsAndAttachements = weaponsItemsCargo box1; to _weaponsAndAttachements = weaponsItemsCargo box1; select 0
Tried this, but fucked up somewhere:
_weaponsAndAttachements = weaponsItemsCargo box1;
{
private _count = count ((_x select 0) select _forEachIndex);
if (_count == 7) then {
private _weapon = _x select 0;
box1 addItemCargoGlobal [((_x select 1) select _forEachIndex), 1];
box1 addItemCargoGlobal [((_x select 2) select _forEachIndex), 1];
box1 addItemCargoGlobal [((_x select 3) select _forEachIndex), 1];
box1 addItemCargoGlobal [((_x select 6) select _forEachIndex), 1];
box1 addmagazineCargoGlobal [(((_x select 4) select _forEachIndex) select 0), 1];
box1 addmagazineCargoGlobal [(((_x select 5) select _forEachIndex) select 0), 1];
} else {
box1 addItemCargoGlobal [((_x select 1) select _forEachIndex), 1];
box1 addItemCargoGlobal [((_x select 2) select _forEachIndex), 1];
box1 addItemCargoGlobal [((_x select 3) select _forEachIndex), 1];
box1 addItemCargoGlobal [((_x select 5) select _forEachIndex), 1];
box1 addmagazineCargoGlobal [(((_x select 4) select _forEachIndex) select 0), 1];
};
}forEach _weaponsAndAttachements;```
get rid of the loop entirely
you don't need it, and your code was fine the way it was before
I need to do this for every weapon in a box
ah ok
or weapon inside a vest, uniform or backpack that is inside a box. Its containerception. Right now I'm just trying to do that for a weapons in a box
So, I have a box, a container, where player can dump all his stuff, weapons, uniforms, backpacks etc. Its supposed to be a sell box that allows you do dump stuff in and sell it all in one go. The selling is basically reading the contents of the "sell box", adding exactly the same items to shop inventory and removing the items from the "sell box". To do that, the script has to know what are all the items inside. The issue is the vests, backpacks and the uniforms are themselves containers (so its like having box inside a box), and can have items inside (mags grenades etc.). Also the weapons can have attachments and magazines so are kinda like a container themselves. Note that you can put a weapon (with attachments) inside a backpack and then put that into a box, so you have the boxception of a: (kinda) box inside a box, inside a box.
I have the uniforms, vests and backpacks kinda figured out as they are considered the same kind of container.
The weapons are a bit different beast as they are not really a container, the items are "attached" to it (+ the magazines) and the "weaponsItemsCargo" command returns an array in that weird format I showed above.
So I'm basically dissembling everything inside the "sell box"
ok, so where you do all the select _forEachIndex, put those values back to what they were
once you are inside the array of a specific item, the weapon name is always going to be _x select 0
doesn't change relative to where you are in the higher level array
if you have more than one weapon inside the box it looks like this:
[["hgun_Pistol_heavy_01_F","muzzle_snds_acp","","optic_MRD",["11Rnd_45ACP_Mag",11],""],["CUP_hgun_Glock17","muzzle_snds_L","CUP_acc_Glock17_Flashlight","",["CUP_17Rnd_9x19_glock17",14],""]]```
[["weapon","item","item","item",["mag",11],""],["weapon","item","item","item",["mag",14],""]]```
I understand that yes
you have a 2D array, aka an array of arrays where each inner array represents another weapon
with another array inside for good measure
sort of
the _x is representing a specific weapon
so when you do _x select 0, you always get the name
so if you want to get "muzzle_snds_acp" it's _x select 1
does that make sense?
All right, I got it kinda working working, for some reason it does not add the bipod to the box
_weaponsAndAttachements = weaponsItemsCargo box1;
{
private _count = count (_x select 0);
private _weapon = _x select 0;
if (_count == 7) then {
box1 addItemCargoGlobal [(_x select 1), 1];
box1 addItemCargoGlobal [(_x select 2), 1];
box1 addItemCargoGlobal [(_x select 3), 1];
box1 addItemCargoGlobal [(_x select 6), 1];
box1 addmagazineCargoGlobal [((_x select 4) select 0), 1];
box1 addmagazineCargoGlobal [((_x select 5) select 0), 1];
} else {
box1 addItemCargoGlobal [(_x select 1), 1];
box1 addItemCargoGlobal [(_x select 2), 1];
box1 addItemCargoGlobal [(_x select 3), 1];
box1 addItemCargoGlobal [(_x select 5), 1];
box1 addmagazineCargoGlobal [(_x select 4), 1];
};
}forEach _weaponsAndAttachements;```
count should be = count _x
ok, got it working properly now
nice @thorn saffron Can you teach me how to do syntax highlighting?
sqfhint "test";
sqf hint "test";
I can't do it 😦
'''sqf hint "test";
It's a tilde right?
you need new line after sqf
In the armar 3 Gui editor how do you get up new prodjects or paste in code you already got? Or is that even a thing
Ok I have a small problem: how can I remove the weapon from the box? removeWeapon does not seem to work, I can add a "stripped" rifle, but I need to delete the one with stuff on it.
_weaponsAndAttachements = weaponsItemsCargo box1;
{
if ((count _x) == 7) then {
box1 addItemCargoGlobal [(_x select 1), 1];
box1 addItemCargoGlobal [(_x select 2), 1];
box1 addItemCargoGlobal [(_x select 3), 1];
box1 addItemCargoGlobal [(_x select 6), 1];
box1 addmagazineCargoGlobal [((_x select 4) select 0), 1];
box1 addmagazineCargoGlobal [((_x select 5) select 0), 1];
} else {
box1 addItemCargoGlobal [(_x select 1), 1];
box1 addItemCargoGlobal [(_x select 2), 1];
box1 addItemCargoGlobal [(_x select 3), 1];
box1 addItemCargoGlobal [(_x select 5), 1];
box1 addmagazineCargoGlobal [(_x select 4), 1];
};
box1 removeWeapon (_x select 0);
box1 addWeaponCargoGlobal [(_x select 0), 1];
}forEach _weaponsAndAttachements;```
why don't you just delete all weapons from the box after storing the array?
true
you can use ```sqf
clearWeaponCargoGlobal box1
There are a few separate clear commands to get rid of other items like magazines, backpacks, and generic items
I know, I focused on stripping down weapons as it was important and complicated, I got the code for items figured out
ok that got it done
however the issue might be with weapons that inside vests and such, I might need to append the _weaponsAndAttachements first with any of those
I recommend you take weapons out of vests before doing your script
The point is for player to be just dump all the stuff in and have script deal with that
The way I said that sounded wrong, what I meant to say was I recommend you write a script to take weapons out of backpacks and vests before running the script you have now
yeah, but if I use clearWeaponCargoGlobal I need to know every weapon that is inside of the box first
so I don't lose anything on the way
right, which is why you need to take everything out of vests and weapon carriers and put it inside the box before even storing the array of weapons
yes, the issue is to do that I need to run weaponsItemsCargo on the potential weapons inside vests and stuff. It would be much easier if I could specically say: "removeWeaponGlobal arifle_AK12_GL_F" and don't worry about deleting something by mistake.
I will deal with that when the time comes I guess
The easiest way would be to first build the _weaponsAndAttachements and append it with any weapon that could be inside any boxception, then run the function for stripping all of them down
you can use commands like backpackItems and everyBackpack to have a small script that loops through the backpacks and stores the items in the box
not really, i will lose the info on what is attached to those weapons if I try to move them to the box first
odd, my script does not add the magazines for pistols and such, it does use the "else" part, something bugs out there
nvm I forgot to add a bit
private _sellBox = box1;
_weaponsAndAttachements = weaponsItemsCargo _sellBox;
clearWeaponCargoGlobal _sellBox;
{
if ((count _x) == 7) then {
_sellBox addItemCargoGlobal [(_x select 1), 1];
_sellBox addItemCargoGlobal [(_x select 2), 1];
_sellBox addItemCargoGlobal [(_x select 3), 1];
_sellBox addItemCargoGlobal [(_x select 6), 1];
_sellBox addmagazineCargoGlobal [((_x select 4) select 0), 1];
_sellBox addmagazineCargoGlobal [((_x select 5) select 0), 1];
} else {
_sellBox addItemCargoGlobal [(_x select 1), 1];
_sellBox addItemCargoGlobal [(_x select 2), 1];
_sellBox addItemCargoGlobal [(_x select 3), 1];
_sellBox addItemCargoGlobal [(_x select 5), 1];
_sellBox addmagazineCargoGlobal [((_x select 4) select 0), 1];
};
_sellBox addWeaponCargoGlobal [(_x select 0), 1];
}forEach _weaponsAndAttachements;```
^ the final form more or less
@river meteor Also, I dumb. I forgot that unforms, vests and backpacks are actually containers with you can do stuff like any other box. I just need to change target those instead of the sellbox. I can already do that. I just need to turn this script into a function for stripping weapons and have it be called during this:
_containerArray = everyContainer box1;
_containersWeaponsAttachements = [];
{
_containersWeaponsAttachements append weaponsItemsCargo (_x select 1);
};
} forEach _containerArray ;```
@thorn saffron Yeah that makes a lot more sense then what I was telling you to do. Good job
Hello people!
I want to add a box in my mission where players can enter text and that text then becomes a variable.
I tried using the RscEdit but was unable to figure it out. Was unable to find a defines for it.
If anyone happens to sit on some code to make this happen that would be appreciated. A box where you can write things in a dialog and save them as a variable.