#arma3_scripting
1 messages ยท Page 266 of 1
septagons?
Which you'd need to go and look at how markers are defined.
Negative radius draws a hexagon
and the guy posted a picture of the results iirc
Ah slight problem
It has to be run as a draw eventhandler
Even says becareful
So how are you updating all the hexagons @rancid ruin If you are restricted to the non-scheduled environment?
Sounds expensive.
@buoyant heath I can see him running into performance problems
Serious ones.
Unless they are operating as messengers
constantly listening which is still nuts if you used triggers.
Might be able to with markers
Still too expensive
not really
Why would you be watching the markers constantly?
He was thinking of loading areas of the map based on the hex grid.
Again how is he going to listen to each grid?
Why listen to the grid? Watch player position then translate that to the grid
@rancid ruin How are you monitoring the grids or player to when they're inside the grid?
SO you'll constantly be looking x,y
and the distance between them?
For a limited distance region yes
...
It's not like he needs to check the whole map every time (or ever)
Is there such thing as UVs in UI configs???
Like, you could add a tiled sprite and switch UVs?
Didn't find it anywhere, but I still hope that it still exists hahaha
i'm not doing anything with the hexagons currently, they're just map markers
but i did test out creating locations for each hex. can set/getVariable on them and then do nearestLocation to figure out which hex is nearest to a position
is there any decent way to size a structured text control to the size of it's contents?
it's using a monospace font so i guess i could size the width according to the number of characters in the longest line, and the height to the number of lines, but that seems a bit meh
How are projectiles created?
and calculated? @buoyant heath
SQF scripts?
or external .dll via PhysX?
Anyone know?
Internal engine magic
If FSM is stuck in a state waiting for some condition to be true, how many times per second this condition is checked?
many times
iirc its not too reliable but you could run a simple loop that does diag_log diag_fps; and count the amount of logged lines per frame
Hey Guys, is there an command for setting style in sqf? Like you would do in a dialog Style = ST_PICTURE
I've done this and I need to define the style otherwise the picture won't show in the box. Only the text
private _clothesReload = [] spawn {
disableSerialization;
waitUntil { !(isNull (findDisplay 602)) };
_clothesReloadButton = (findDisplay 602) ctrlCreate ["RscActiveText",1928];
_clothesReloadButton ctrlSetPosition [0.267969 * safezoneW + safezoneX, 0.181 * safezoneH + safezoneY, 0.04125 * safezoneW, 0.055 * safezoneH];
_clothesReloadButton ctrlCommit 0;
_clothesReloadButton ctrlSetText "gui\img\icon_clothes.paa";
_clothesReloadButton ctrlSetToolTip "Retexture Clothing";
_clothesReloadButton buttonSetAction "[] call FLF_fnc_texturePlayer;";
};
No there is not
control manipulation commands are limited in this regard, you can't change style, many properties or attributes
Can I use define?
And define my own class
In a hpp file?
And include it in this file?
And rename RscActiveText to like My_RscActiveText?
This is what supposed to be done in first place
So I could do that using that command? ctrlCreate ["MY_RscActiveText",1928];
No, ctrlCreate only works with game configs, not mission configs
Ahhh ๐ฆ
You need to define your classes in mission config, then create display that uses these classes
Or you can search game config classes to see if there is active text class with ST_PICTURE already made
and use it instead
Ok and thats the only way to do it?
Is there any other rsc I could use that is not RscActiveText that would work out of the box?
There might be other active text class with style set to ST_PICTURE, look in game's config
In the config viewer of debug console?
Best option would be to dump entire config, using config viewer will be way too slow
Or you can write a script which will check all root classes in config to see if it has type and style that you need
Actually, I just checked myself, RscActivePicture is active text with ST_PICTURE style
And that will work with setButtonAction?
I guess
Ok thanks a lot mate
Please don't consider this spam, I don't have any relation with the page I'm gonna publish. My algorithms complexity teacher recommended me the page udemy.com for coding online courses. They have an offer for the next 14h that leaves *all the prices at 14โฌ. I just bough 7 courses worth 1200โฌ for just 98โฌ. I just leave this here if anyone is interested in expanding their coding abilities.
And pretty please, don't think of it as spam, it's just sharing with good will
Hey guys, I am having a strange issue, in my other profiles / missions I have put a .sqf file and in the file I have just put a simple script which is hint "Test"; and when I go into editor and i either call, spawn or execvm it the hint doesn't pop up, anything I need to do before getting scripts working or anything at all?
@open vigil
Can I copy something like this to clipboard? https://gyazo.com/68d1082f16b45a943020c0bfd851b6fb
selecting a line and pressing ctrl+c copies it iirc?
@slate vale Is this a dedicated server?
do you waitUntil {alive player} and sleep 1; before calling the hint?
@cedar kindle Yes but copying the whole file i mean
What is that called?
bin core and languagecore_f
I guess it is bin.pbo
Because I saw that in the config
Screenshot
One of those files contains shader data
the other contains a file called
config.bin
you need to de-rapify it
aka "Unbinarise it"
http://stefanstools.sourceforge.net/grepWin.html
Go to your P: Drive, grepWin -> Search for the name -> Do some research for youself, instead of asking for absolutely everything.
If you have the unpacked data -> You will find something.
^ Or setup A3 dev environment
it's a single file.
Contains every mod definition
for both A3 and mods
NPP and Atom I use
Search for the class definition
Then you should find that stuff for your own...
Thats how I started to understand all the GUI stuff
I know how to operate a editor lol
@jade abyss
Doesnt mean I know everything
Ok I see @tough abyss
The GUI is built on an OOP construct.
The stuff you ask for is in the files, so where to look for the data of the files? Right in the files.
I made a copy of the file Dscha and added a unique key ID name at the top in comments
Well I didnt know that @jade abyss
You can copy and paste everything you need from the .pbo's
Or just inherit from it, depens on what you wanna do with it.
The other thing is: Alot of searching/testing is needed, if you want to accomplish something.
Using Inheritence is the best option
purely for the reason it's "good practice"
Use the base root classes you don't have to deal with certain headaches
with naming things like this.
Depends on @tough abyss I ended up creating my own Classes (copied them to a new file, added a tag to it) since Bohemia had the tendency to play around in the UI Files =}
MyGUIName : Inherits from some weird ass-name
Well of course in that case sure
but people name their GUI's weird names
Seen atlis lifes grossness?
^^
Not how it is now, no clue. But i remember the mess, that Tonic left behind ๐
I made a script once, was added to the released file. Each time when he entered a car as driver the the tires blew up and a msg popped up: "You are too fat, get out of the car", When he left the car -> Wheels get repaired again ๐
Haha
I think so, can't rly remember if we just played around or rly added it to it. Its a few years ago.
getIn EH + UIDCheck
class fuelTank: life_RscXSliderH {
idc = 20901;
text = "";
onSliderPosChanged = "[3,_this select 1] call life_fnc_s_onSliderChange;";
tooltip = "";
x = 0.47;
y = .80;
w = "9 *(((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
};
Ah lol ๐
I would just name it RscFuelTank
Well I guess he was not much for cleanliness maybe? ๐คฃ
As I said still dirty
No he was about obfuscating the shit out of it
Thats why the entire thing uses Macros now
The macros has been toned down a lot
One thing you need to know about that inheritence system that can violate
be violated "sort of"
When you create a "custom class"
The macros used too be huged back in th eday
the only way to name it unique
is use type = #;
The type is definition in this instance not the class
And the engine just works out okay this definition is valid and so is this one.
Only ways you can create sexy rounded GUIs or designs that look unique require
ST_PICTURE style.
Buttons become pictures etc.
and paa files unfortunately are space hogs
in life @rotund cypress the superclasses are in common.hpp
Macros == Obfuscation? ๐ค
All the code said was "I am tired of people using my code, I am going to macro everything"
Probably because macros bounce around a lot makes it harder to folow
And why would you name something that isn't a 'base' class, like a 'base' class
If you actually looked at half the macros, there is little chaining
i know @tough abyss
More convenience
@dusk sage Alits Life used to when I worked on it
I rarely ever see these
#ifdef MacroName(INPUT) (do something here)
You make it sound like that's a bad thing
IMO
I think that why use macros when you can just type it out
For beginners
It will be easier
To follow
And to learn
Tis SQF ๐
Then why did BI add them to SQF?
Sometimes, they are usefull.
^
There is little chance you'll run into issues that header guards would be applicable
Due to the nature of SQF
We're calling, spawning all these functions
They won't conflict
But isn't it the same as just typing it out
Yeah
I saw one guy use a #define MUTEX()
In C++ world and such, you can make far more useful macros
Sure you can chain macros in SQF, and it really saves time
yeah ive seen that @dusk sage
You can actually do this though in SQF
__EXEC
Yes
C++ aint no SQF though
ACE macros are harder to follow
that's only because no one reads the doc and asks what X does instead (including me)
they're from CBA btw.
mass = 50;
class MuzzleSlot {
iconPosition[] = {0.000000, 0.400000};
linkProxy = "\A3\data_f\proxies\weapon_slots\MUZZLE";
compatibleItems[] = {"muzzle_snds_H_MG_blk_F","muzzle_snds_338_black","muzzle_snds_M"};
};
class CowsSlot {
iconPosition[] = {0.500000, 0.300000};
linkProxy = "\A3\data_f\proxies\weapon_slots\TOP";
compatibleItems[] = {"optic_Hamr","optic_MRCO","optic_Nightstalker","optic_DMS","optic_ERCO_blk_F","optic_Holosight_blk_F","optic_Arco"};
};
class PointerSlot {
iconPosition[] = {0.200000, 0.400000};
linkProxy = "\A3\data_f\proxies\weapon_slots\SIDE";
compatibleItems[] = {"acc_pointer_IR"};
};
}; ``` is there anyway to enable all attachments on weapon whithout having to type in everyones code as well as can someone give me the coding for enabling attachment of Bipod?
@gilded rover Belongs in #arma3_config
sorry
anybody good with MCC at all? the MCC discord is dead.
any idea why (entities "HeadlessClient_F") would be [] whether one is connected or not? 2 modules in editor (and not empty when run from editor)
yes, playable
For some reason changing the colour of the smoke effect... does not change it
its remaining black no matter what
@subtle glen did you place the HC's inside a vehicle? entities does not report units inside vehicles
k
probably should still use:
(allPlayers select {_x isKindOf "HeadlessClient_F"})
that way they are not reported anymore after they disconnect, but again after they connect
i thought headless clients were a kind of abstract client for unloading ai ownership to...but they're actual units?
why on earth can you put a headless client inside a vehicle??
the implementation is... let's say hacky
that is so weird to me
why on earth can you put a headless client inside a vehicle??
no idea, you could and it's the first problem that comes to mind when usingentitiescommand
so like, a headless client has a position and everything?
it's just like a normal vehicle?
could you kick the HC from a server with a lot of AI and watch the fps plummet?
probably, never tried
yes
what a strange concept
How Do I run a script at the beginning of launching a mod? Via #include in the config.cpp or?
preinit / postinit i think
where should I put that?
lovely thank you!
no problem. another option is to un-pbo other people's work and see how they do it
How Do I run a script at the beginning of launching a mod?
At game start once per session or at each mission start?
@little eagle once per session, for example: loading a unit in the editor without facewear
so once per placed unit
correct
that is not what once per session means, but OK
yeah, wups D: brain shorted once again
You sure it has to be once per created unit? Because that is really shitty to do without CBA
Once per mission would be easy
Well the main issue I'm getting is that when I place a unit from my mod, they get random face/eyewear adapted to them
Oh, then just change the units config
So no facewear is allowed for them
e.g.
identityTypes[] = {"LanguageENG_F","Head_Euro","NoGlasses"};
I use this for my German soldiers and they never spawn with glasses
first one is the language they speak
second one is what heads/faces they can have
third is what facewear they can have
Oooh fancy!
and what about No entry 'bin\config.bin/CfgWeapons.29th_Soldier'
tried to find a fix but no one actually 'posted' a way to fix it, just a fixed version
you referenced "29th_Soldier" somewhere as weapon, but it does not exist in CfgWeapons
ctrl + f for that class name and check where it does not belong
Maybe also try creating a new mission. When doing addons, the mission can be corrupted with class names that were removed
29th_Soldier certainly does not sound like a weapon
yeah, it's a uniform ๐
uniformClass = "29th_Soldier"; ?
you have to use a different class name for the uniform item and the uniform model / soldier model I think
other wise the game chokes
well, do you have this item in CfgWeapons or not?
it's in cfgvehicles tho
The uniform item (which you can drop on the ground) is a CfgWeapons entry
class CfgWeapons {
class Uniform_Base;
class UniformItem;
class BWA3_Uniform_idz_Fleck: Uniform_Base {
author = "$STR_BWA3_Author";
scope = 2;
displayName = "$STR_BWA3_UniformIDZFleckName";
picture = "\bwa3_units\ui\bwa3_uniform_fleck_x_ca.paa";
model = "\A3\Characters_F\Common\Suitpacks\suitpack_blufor_diver";
class ItemInfo: UniformItem {
uniformModel = "-";
uniformClass = "BWA3_Rifleman_Fleck";
containerClass = "Supply40";
mass = 40;
};
};
e.g.
You need a uniform item and a soldier model / uniform model
they both are needed and are connected
See: uniformClass = "BWA3_Rifleman_Fleck";
one is named 29th_Soldier the other is 29th_uniform
uniformClass = "29th_uniform";
I think, instead of
uniformClass = "29th_Soldier";
I'm not following
mind to explain it a bit what you mean?
there is no - uniformClass = "29th_uniform"; - in the cfgWeapons
so it is a mission fail?
alright sweet and
what about this: https://puu.sh/sr9rZ/7fa45bd1c8.jpg
Is there a way to change that? tried it aswell but no luck..
Yep, all of them are different and have a "displayName" set to them with different names but it doesn't apply
they need different displayName obviously
In CfgVehicles?
no, it will show whatever the displayName in CfgVehicles is
if it's the same for multiple classes, they'll all show up the same
try restarting the game. maybe eden scripting has some caching of the config going on
I'll give it a shot
alright, naming issue is fixed
No entry 'bin\config.bin/CfgWeapons.29th_Soldier'
still remains
and the headwear issue is gone aswell
facewear
yeah wups
headwear is helmets
What is
uniformClass
in the CfgVehicles classes?
uniformClass = "29th_Soldier"
Does a class named "29th_Soldier" exist in CfgWeapons?
negative
There you go
that's all "No entry 'bin\config.bin/CfgWeapons.29th_Soldier'"
is telling you
no such class
What classes do exist in CfgWeapons?
"29th_uniform_Pvt","29th_uniform_PFC","29th_uniform_Cpl","29th_uniform_Sgt","29th_uniform_SSgt","29th_uniform_TSgt"
and a few more
Then change
uniformClass
in the CfgVehicles class
to any of these from CfgWeapons
accordingly
?
which should I change, as I'm guessing the second picture's classes rely on the first picture's class name?
which would mean that I have to make a new class like the first picture for earch and every one of the ones shown in the second picture?
Are we still talkign about No entry ?
Correct
You don't change the class names
...
You change the uniformClass entry
the class names are fine
But
as I said
The uniformClass from the class inside CfgVehicles
has to point to a class name inside CfgWeapons
Because you have to give your soldier model a uniform
And a uniform is a CfgWeapons entry
commy2 - Heute um 17:51 Uhr
What is
uniformClass
in the CfgVehicles classes?
van Gastel - Heute um 17:51 Uhr
uniformClass = "29th_Soldier"
commy2 - Heute um 17:52 Uhr
Does a class named "29th_Soldier" exist in CfgWeapons?
van Gastel - Heute um 17:52 Uhr
negative
commy2 - Heute um 17:52 Uhr
There you go
I'm not following anymore, Nevermind, i'll just fiddle around with it
How is it that difficult?
You change uniformClass to a class name from CfgWeapons
done
lol
Even the comment behind the entry says that
in your screenshots
Thanks a lot! fixed the issues
my god that took ages and way to much re-reading to understand
sorry for the trouble !
although
hahaha
now it only gives me 1 single texture over and over again -.-
fml I feel retarded.
"texture" ?
might be a conflict
lemme check
just to make sure
I can't follow with this: You change uniformClass to a class name from CfgWeapons
like, my brain is just retarded or I'm totally missing the simplest of things
Well that is the changed version
i'll revert to the old one
there you go
this should be the one with the issue
omg
why did you rename 29th_uniform to 29th_soldier ?
that is not a soldier, that is a uniform
mind blown
all you needed to change
is L382
uniformClass = "29th_Soldier"; // This is the classname of your uniform, if you create more uniforms you need to create more soldier classes to correspond with them
to 29th_uniform
because that actually exists in CfgWeapons
same for the one underneath?
which line?
436
Don't tell me I didn't say this over and over again
The classnames are fine
xDDD
But the entry is wrong
๐คฆ
why?
"But the entry is wrong"
so now it should be good to go?
Idk, it's very confusing if you name a uniform solder
and I'm pretty sure tons of things will go wrong if you name your uniform item (CfgWeapons) exactly how you name your soldier model /CfgVehicles)
that's not the correct attitude
I wont give up tho.
I think you're having the wrong expectatiions about this
you have to fix one error at a time
changing one line won't magically fix everything
because atm it's a mess
tbqh
Well I've been fixing errors in this thing for over 5 months now hahaha, started from 0 and slowly working my way up
Well the error is still there, everything else works fine
I could fix it in an hour. But where would the fun in that be. It's really not difficult. ยฏ_(ใ)_/ยฏ
back to re-reading
this discord is very resourceful for troubleshooting but i think this whole thing shoulda been in #arma3_config
It started with another problem, my mistake
oh yeah, running a script when you launch a mod, i remember ๐
right in the feels
Alright, I'm going to eat dinner, after that I'll start 'spamming' the #arma3_config channel ;D
Is there any way to setup a "timer" to call a function every X time, like an "interruption/event" way? I don't like running scripts everytime doing while(1){ sleep(x) do this }; Or, alternatively, "call a function in 30 sec"
CBA has this: https://github.com/CBATeam/CBA_A3/blob/master/addons/common/fnc_addPerFrameHandler.sqf#L1-L27
otherwise, no
Thanks, I will take a look
you also have CBA_fnc_waitAndExecute, which you can use in a function and make it call itself in X seconds
literally no performance impact
that doesn't call repeatably unless you do the CBA_fnc_waitAndExecute in the function you're calling
right, waitandexecute is one and done
use the perframehandler with a delay for a repeating thing
or call your function again at the end of the W&E
hmm the docs on CBA_fnc_waitAndExecute are a bit contradictory
Description says: "Executes a code once in unscheduled environment"
Params says: "_delay The amount of time in seconds between executions, 0 for every frame. (optional, default: 0) <NUMBER>"
Hmm, thought that had been fixed. W&E is one and done
yeah the header for the script is correct, guess the docs aren't updated yet
the function header shouldn't be fixed in the release version either. PR was merged 19 days ago
ahhhh well I checked in the repo
actually, it is released ๐
CBA_A3 v3.1.2.161105
Yes both functions should do the job, anyway as I avoid having dependable content with other addons I will redo my addon just using vanilla functions.. Thanks all ๐
so i have a question, when signing a pbo, is there anything that is required inside it to make its bisign valid? I have a pbo i edited myself and when i try to sign it it still kicks me
Try using Addonbuilder to pack and sign the pbo, other pbo packing programms sometimes create problems when signing files
such as PBOManager
so i have verifySignatures = 2; on my server, but if i was to remove a mod pbo from my modpack i can still join
You'd notice a difference if you added a mod not signed by the server
Not removing one
hmm yea
is there an easier way of doing this rather then adding some checks to my required addons in mission file?
.sqm that is
Anyone know offhand the script to spawn in an MQ-12 falcon with AI?
Every time I spawn it in all I can do is "hack UAV"
and that doesn't allow direct control of pilot or turret
createVehicleCrew (_vehicle); ?
hey, i found a peeing script but i dont know how to use this in mp. there are particles which are created local and i tried to create them global but its not working. i tried it with mp function and remote exec no solution. the particles are created foreach client itself but i cant the pee of other players
@dim owl I won't help you ever implement pissing on people
@tough abyss Thats for roleplay...
Good input as always @tough abyss ๐
It is a pretty dumb request, tbqh
Postal ftw ๐
@worldly zinc Don't. Create the particle array in the config and then call that array local to all clients
Yeah there is an animation for it
iirc it's part of a campaign animation
Curious; is there any way to temporarily disable night vision mid-mission, or at a certain point? I know of the DisableNVGEquipment, but that seems to be exclusive to vehicles.
Hey is there any possibility to disable a scroll action? E.g. get out of a vehicle through scrolling
you could just lock the cargo or vehicle
Locking the vehicle is an option, but there is another way, the option would still show up but you can disable it from doing anything when used (see example 3) https://community.bistudio.com/wiki/inGameUISetEventHandler
^ this sounds easier and cleaner
@spice kayak Not really, except for removing all the NV devices of the players. They could always pick up new ones though
Yeah, good point. I wanted some sort of like, 'EMP' type effect is all, and NVG would be one of those things affected.
Thanks guys
I think what @native hemlock sent me is most suitable for what Im doing ๐
The problem with it is, that it won't take away to menu option.
Doesn't need to take it away
It just won't do anything
I guess I will be able to show a hint which is just what I'm after ๐
Yeah, then go with that
@spice kayak
If you're using CBA, then this works:
// init.sqf
commy_disableNVG = true;
["visionMode", {
params ["_unit", "_mode"];
if (commy_disableNVG && {_mode == 1}) then {
_unit action ["NVGogglesOff", _unit];
};
}] call CBA_fnc_addPlayerEventHandler;
Just flip commy_disableNVG to true or false, if you want to enable them or not
Oh, that's amazing. I'll have to check that out, thanks!
the event handler only fires if you change the NVG mode atm, so to kick out all players out of the NVG, use:
player action ["NVGogglesOff", player];
commy_disableNVG = true;
is commy_disableNVG part of CBA, or variable name? I've just tried googling it and gotten nothing. Sorry, I'm just getting back into things after not touching A3 for a year!
no, it's a global variable name I just made up
it's used inside the evnt handler to toggle it on or off
Ah, I figured that was the case.
That makes sense.
Thought it was too coincidental with the naming haha.
Well, I did create CBA_fnc_addPlayerEventHandler. It was a port from ACE
Oh, alright then! Man, I think the worst part about all this is having to probably re-learn everything about scripting. Ugh.
I had a good thing going too, but I'm sadly probably going to have to scrap nearly all of it. It's basically japanese to me at this point, and I can't read japanese D:
Me neither. I can read SQF though.^^
Sucks, programming used to be a big part of my life, then life happened, and now it's like, what on earth is all this mumbo jumbo?! Well, I'll probably get started on it this weekend. Still not sure how to make the mission better though. Had a basic idea, but the execution is mediocre at best.
SQF is the only programming I ever did. Computers are boring if it's not for a game with explosions and all that
and soldiers and tanks
It's like playing with programmable tin soldiers
Ha, my time with programming wasn't that enjoyable sadly :P
For me it's like someone who learns circuits just for his model railroad.
Oh you will have to find enjoyment in doing Arma modding. Otherwise you won't be able to pull through
Alternively masochism
Error: Type Not a number, expect: Number, Not a number
what a lovely message
I used to find some enjoyment in it a year ago when I was making this mission of mine, but due to hard drive corruption, I had to wipe the drive. Sadly, I thought I had lost the whole damn thing, so I just gave up. Until yesterday, when I found a build of it on google drive. Not the latest, but close enough to. I really want to finish it, turn it into something great, but I just feel I can't anymore haha.
my favourite error message:
_a = []; _a set [0, _a];
results in:
no problem dude, commy is here to help you ๐
20:45:51 Error in expression <_a = []; _a set [0, _a];>
20:45:51 Error position: <set [0, _a];>
20:45:51 Error 25028600 elements provided, 0 expected
Well, commy can finish it if commy likes :P
I feel that's probably what it'll come down to, honestly; asking someone else to review it, take it, do whatever they want with it, make it something more than I ever could.
It could be a really fun mission, given the basic concept of it.
if you need security testing, ill gladly help.
Ha, security testing? I think I need ideas more than anything. I'm surprised I even managed what I did.
i'm good in having ideas. just add me on steam, same name and picture
The basic idea of the mission was a coop search and retrieve, with one person's goal to secretly sabotage the mission. It's randomly decided, so there's no way to know who it is. I think this screenshot best details what I was going for. http://i.imgur.com/JUcvI9l.png
The commander unit also had the ability to track the person in posession of the terminal, though the intervals of the scans were dependant on how many players there were. The more players, the less often you'll get information. A means of balancing, in a way. It was fun, but with the way it was structured, you needed at least 6 people to play the mission. Commander's screen: http://i.imgur.com/uMzNysc.png
I also love color coding. Getting that done was fun.
Bohemia, really? rofl https://i.imgur.com/Yv6xh2y.png
Ha, that doesn't surprise me at all.
@noble juniper Sorry about that, I've added you now. Would you mind if I added you too, @little eagle?
I don't really use discord for PMs
Ha, all good. I did mean on steam though :P
But yeah, if I need any help, I'll ask on here!
@little eagle I had MakePBO errors suddenly complaining about duplicate definitions of the IS_ADMIN macro, did anything change related to that recently?
the fault was on our end but it wasn't there before
have been using the same tool versions for months now ๐
is there a ctrl type for drawing lines in displays/dialogs?
pretty sure it has been a change in CBA that caused the error since there hasn't been changes on our side, not that it matters in any way since it's fixed already. Was just wondering. ๐
No, marceldev
It's a bugfeature in mikeros tools
it errors now when you redefine a macro. jonpas posted the solution
the error is not needed, but mikero thinks it is and you can't disable it
I know it's an "issue" with mikero's tools but we haven't changed the code and I haven't updated the tools in a couple of months so I just wondered why it started throwing errors suddenly
two macros share the same name
say i have an array of 5 or so positions, what's the best way to select the one which is closest to X position?
_Nearest = 1000;
_Nearest_Pos = [0,0,0];
_PlayerPos = getPos player;
{
if(_x distance _PlayerPos < _Nearest)then
{
_Nearest_Pos = _x;
_Nearest = _x distance _Nearest;
};
}forEach _MyPosArray;
systemchat format["NearestPos: %1 - Distance: %2", _Nearest_Pos, _Nearest];
example
thanks, i'ma test that now
ah wait, that won't work^^ gimme a sec. Writing in Discord is crap
@rancid ruin Check again.
Alternatively: You can start with:
_Nearest = ((getPos player) distance (_MyPosArray select 0));```
isn't there a function for sorting arrays?
i seem to remember using it once and it didn't work
There is one, but afaik there is nothing that sorts an existing array by its distance to an object.
nearestObjects had a sorting Function in it, iirc.
I think there is a BIS function
(or an similar one)
max. number of 10 input params is supported <- meh
yeah i could never get that bis sort function to work
Or you could do
Is there a way to increase native sprinting speed without using setVelocity?
setAnimSpeedCoef
Ok
that's what makes it fun
Thanks
_distances = _positions apply {_x distance _definedPoint};
_closestPos = _positions select (_distances find (selectMin _distances)):
On phone, may not be coherent
@rancid ruin Put it on 100, allowDamage false; and run around the Map ๐
i was hoping for use of min function, i like min
not seen selectMin before, nice
yeah if you don't allowdamage false then you die when flying from small bumps in the terrain, it's awesome
Yep
it's like low gravity benny hill
That killed me even moving forward the slightest
setVelocity + MP = yeah.... no. Just .... no.
Yep
ah selectMin is still dev version only
Ah, my bad
You can use min aswell
But will have to type it all out manually, or loop still
has anyone experimented with any of the new sound controller stuff yet?
Hahah 100 wasnt that fast ๐ @jade abyss I could atleast get 200 metres without dying ๐คฃ
It was fast though
wich bitch highlights me
Yeah? And?
Constant using of e.g. setVelo[100,0,0]; is bs in MP
Reason?
Read?
//_positions _origin
private _temp = _positions apply {[_x distance _origin, _x]};
_temp sort true;
_temp select 0 select 1
_origin being the center and _position being a bunch of 2d or 3d positions
fastest way to get the closest one in SQF
on average
^ false
This is the last thing he needs to heard ๐
Lost some hours by Arma 3. Why?
If you create a castle tower object on the client and then run a code in server that get its position, vectorDir, vectorUp... the vectorDir will be wrong. What i do now is get all the info on client and send it to the server.
He needs to heard "i love you!" from a very in love woman.
Position and orientation vectors set to local object do not syncronize to server instantly
No
You can setpos as much as you want on local entity, updates will be sent to server (and other clients later) in normal pace
setPos on remote entity though will instantly send setpos packet to server.
Can't recall if setPos'ing remote entity will make it move right away on local client, might be dependent on simulation type.
setPos's effect is always global. Does any command sync instantly? I wouldn't find it surprising if everything was tied to refresh time.
No, setPos on local entity doesn't broadcast anything
Position syncs to server and then other clients eventually just like if you weren't setPos'ing anything, through regular updates.
What would the effect of setting the position of something in the non-scheduled environment be randomising the positions?
I came to this conclusion through experience
@tough abyss To local or remote object?
Local: It will move somewhere each frame on your screen, will move to some position through some intervals of time on server, even less movement on other clients, depending on distance from their camera to object
Regularity of updates to server and from server to clients depends on simulation type, buildings update less, vehicles much more often
Remote: You'll spam server with setpos messages, infrequent position change on your screen, infrequent on server, infrequent on other clients.
Basically setpos'ing remote entity lot of times is not a good idea, only some positions will apply in the end
What about set posing on a server-local entity?
Same
Orientation vectors are not broadcasted through commands at all, you can execute them as much as you want, if it will be remote entity, they will reset on next update from server, if it is local entity server will eventually get them from you.
Invade and Annex repeatedly setVelocity on a jet
Same for setVelocity, it doesn't send any packets, you can execute it as much as you want
What?
_air spawn
{
private["_x"];
for [{_x=0},{_x<=200},{_x=_x+1}] do
{
_this setVelocity [0,0,0];
sleep 0.1;
};
};
setVelocity's effect is also global
Command itself doesn't send any packets
With local arguments
Velocity will be eventually synced to server and other clients by normal means
makes sense
No, you can set velocity as much as you want
The only bad practice here would be to set position to remote entity often
Setting velocity or orientation vectors to remote entity is not an issue, they will just update on your client and reset to actual values from server eventually
Is Patrol Ops 3?
Better than Invade & Annex?
In general as a platform to build from?
I'd say I&A? PO3 probably has a lot of legacy code from the A2 era
That's a very uneducated opinion though ๐
Anyone here looking for a unit to join? im recruiting to my unit.
๐ imnot sure how to call it, its a milsim unit
wrong channel... see the above
ok thanks
Just asking, if no one know, please just ignore me, and sorry... but, can i use realBoundingBox function in simple objects? ๐
I'm converting all buildables to simple objects, and looking all the related code to find possible problems, one problem was using typeOf on then (obviously :P)
So since i create the simple objects using alternative syntax (that have classname as argument) i store the classname in a object var "cnm".
And i can use typeOf like: (_obj getVariable "cnm") typeOf ["House",configFile >> "CfgVehicles"];
typeOf _simpleObject return "".
(i play so bad that you recruit me in a different way: you convince your oponent to recruit me :P)
Hey Guys, is it possible to make this a tad transparent? cutText ['', 'BLACK OUT', 0.5];
I'm looking for a black out effect to do upon opening a menu but then having it a bit transparent so you still can see a bit through
@๐ ๐ ๐ ๐ ๐#9777
you are the master of logic and clean code
^ false
T_T
Who is the master?
@tough abyss
damn unicode
you are the master commy
that little two liner was awesome
@rotund cypress write a post processing effect i think https://community.bistudio.com/wiki/Post_process_effects#ColorCorrections
Thanks @rancid ruin
Also, is there anyway to see script performance? How much performance or so a script takes? Except for the debug console
I mean like
All the scripts currently running
think there's some diag functions yeah
i tend to just write my scripts as modularly as possible so i can test one at a time
Yeah, I have problems with lag atm and every action being very slow but right now Im going through my git repo to see what could be causing it
Not really optimal
this is used to determine the time a script takes to execute
the debug console button is a wrapper for this function
it does not work in MP atm for whatever reason
and it's not a good method when commands like createVehicle are involved, since that means that for every tested cycle, one vehicle will be created
Okey thanks I'll have a go at that
what would be the best way to approach lerp'ing the position of a draw ctrl event handler?
e.g move a drawn icon from point A to point B on the map ctrl at a speed in meters/s
Simple Objects: You can't set variables on simple objects ๐ฆ and i use this a lot. Really worth to convert 2000+ buildings from normal building (created with createVehicle) to simple building objects (created with createSimpleObject) in terms of performance?
How would one script the removal of rounds fired from a vehicle mounted gun to prevent people from firing?
(safezone purposes)
@tough abyss you could setvariable on logics or locations that you create at the position of a simpleobject
@tough abyss using boundingBoxReal on a simple object should probably work because it still has collision stuff enabled, I think
does
_icon ctrlSetFade 0.5;
_icon ctrlcommit 1;
_icon ctrlSetFade 1;
_icon ctrlcommit 1;
sleep the thread? and are the single commits quequed or do I need to put a sleep in between?
alright, It doesnt queue too I guess?
There is no queue
when you commit second time it changes target values to whatever you commited the last
@vague hull You need to add an sleep/uisleep (after the 1st CtrlCommit) manualy to it
Alright, thx to both of you!
I might need to figure out a better way to do blinking icons then ..
dont wanna start extra threads for it
I - Chernarus map, no AI, player positioned on the void (outside the map):
Extra Objects: 0 / FPS: 108 fps
Extra Objects: 10000 simple objects / FPS: 103 fps
Extra Objects: 10000 complete objects / FPS: 83 fps
II - Chernarus map, no AI, player positioned in Chernogorsk:
Extra Objects: 0 / FPS: 58 fps
Extra Objects: 10000 simple objects / FPS: 56 fps
Extra Objects: 10000 complete objects / FPS: 47 fps
@rancid ruin @halcyon crypt thanks for the info.
I like how simpleobjects I'm the Dev branch once pulled more FPS than normal objects ^^
that's quite a difference in fps
While I don't doubt the numbers, I'd love to see something official on that.
@rancid ruin just tested with 30000 objects now.
Player on void: 0 so and 0 co - 108 fps / 30K so and 0 co - 97 fps / 0 so and 30K co - 56 fps
Player on chernogorsk: 0 so and 0 co - 58 fps / 30K so and 0 co - 52 fps / 0 so and 30K co - 36 fps
@open vigil i'm sure to change anything i need to use simple objects now. This is a decision i could not archieve just with someone saying "Yes, simple objects is a lot better".
I'm not disagreeing. It's just something I'd love for Bohemia to produce.
All the buildins are on the same place in all the tests, the difference is that simple objects building have a different Z position because i was not able to use the createSimpleObject alternative syntax that alow use of ASL positioning.
createSimpleObject ["building_class_name",ASL pos]; dont work.
it says "building_class_name" is missing.
load up vr terrain and spawn 20k of the 1m blocks within viewing distance
that will rinse your fps
And i spawned 30K mostly buildings, not blocks, in chernarus!
yeah i was trying to make minecraft in vr terrain
arma can't handle rendering that many blocks though
i see, the blocks was a lot near.
on the 30K test in chernarus the buindings was 89 meter away from the other
in a 89 meters grid
@open vigil i understand mate, just taking advantage of the chance to talk more about the test
Go hardcore and script your own occlusion culling to hide blocks out of sight /s
onEachFrame {{lineIntersectsWith..}foreach _20kBlocks}..
_20kBlocks ๐
i think i got 6fps with that many blocks on screen
fps would go in to minus figures with some scripting on top
Negative amount of frames per second ๐ค
I'm confused if you are just pointing out that simple objects don't really affect FPS, or that replacing map objects with simple objects gives better FPS. I don't think you'll see any benefit from replacing map objects with simple objects. Map objects are likely already "simple" objects in the engine. You would also lose destruction effects, AI pathing, and probably some occluding.
(when I say you I'm referring to Donnovan)
What is the best way to profile performance @dusk sage
?
other than diag_codePerformance ?
diag_tickTime ?
Performance is a pretty broad term. Individual script performance is most easily done using diag_codePerformance. Multiplayer performance is a little more complex, but it probably wouldn't hurt to look at results from the exportJIPQueue and logEntitites server commands https://community.bistudio.com/wiki?title=Multiplayer_Server_Commands&redirect=no#Arma_3
logEntities server command should do the same as described here by the command https://community.bistudio.com/wiki/logEntities
Worked with Patrol Ops before?
Quiksilver?
Behaves similar to Invade & annex
Not a good option for our milsim group?
We have a pretty big unit
We are currenly running liberation.
It's an FPS hog
Ever played liberation?
and noticed how laggy it is?
What should I build upon?
I&A or Liberation?
I have noticed.
It's why I've been working at modularising I&A
But as I change more and more
the key indicators of being I&A
are being lost.
I also use a Framework present in the I&A
used in my missions.
So our I&A is both part framework core
and non-framework
I've learned a considerable amount from Patrol Ops 3 code
and I&A + Liberation
It varies
Depends on the configs values
It's kind of weird.
It works out the "aggressiveness" + AI count together
It's spawnable zone limit
is about 150
People trigging several zones at once == bad
@native hemlock on my mission players can place Arma 3 objects on the map, its a construction system. So instead of creating those objects with createVehicle i will create then with createSimpleObject. But i need to make some changes because simple objects dont allow some commands like, i know until now, typeOf and setVariable.
I&A is very good
and learning from that
and applying things in Patrol Ops 3
to I&A appears to be working
Actually no.
And I never see it?
On.. any server?
I remember playing Dom 2 on A2
We allowed to edit / build on it?
@tough abyss but since its all about buildings, i compared "complete" building objects with simple buildings objects. Motorized vehicles will continue to be created with createVehicle.
I found that the event handler being used by my framework could be apply to any attack message
Radiotower
The radiotower eventhandler is controlling everything
It's apart of a modular framework
Not really.
The EH can be applied to anything that involves objectives
@meager granite i avoid to use hideObject because i don't know the badies it generate. But since you is sugesting that, so must not be that bad. There is any gain in use hideObject in a custom building that is out of the player view distance?
that involve blowing stuff up
From VIPs, to radio-towers
The events are standalone
taking the "killed handler"
Making it into a function
Then you just hook that function
sa matra was being sarcastic about hiding stuff out of sight
So the flexibility is maintained
Yeah basically
but make them variable parameters
The best thing about EH handled mission objectives
Is as soon as they fire
They can be just connected to a listening function
When the radiotower is blown up
For example I wrapped into it the remoteExec hint stuff I&A came with base line
So the mission flow was handled by the EH
For the MAIN AO
params [
["_radioTower",objNull],
["_unitsArray",[]],
["_dt",objNull]
];
_radioTower addEventHandler ["killed", {
["The tower has been destoryed and was handled by a handler"] remoteExec ["AW_fnc_globalHint",0,false];
private _targetCompleteText = format [TakenAOmsg,AO_String_Name];
[_targetCompleteText] remoteExec ["AW_fnc_globalHint",0,false];
["CompletedMain",AO_String_Name] remoteExec ["AW_fnc_globalNotification",0,false];
//Clean up the AO of vehicles and infantry
deleteVehicle _dt;
[enInfantryArray] spawn QS_fnc_AOdelete;
[enVehicleArray] spawn QS_fnc_AOdelete;
private _aoClean = [] execVM "scripts\misc\clearItemsAO.sqf";
private _MarkersClean = AOMarker_IDs spawn GG_fnc_deleteMissionMarkers;
waitUntil {scriptDone _MarkersClean};
waitUntil {scriptDone _aoClean};
}];
That sort of thing
That's how event based programming works
Exactly.
I also noticed EH's cost less than scripts
Not sure why.
How all my code works, is 1 module is made from the next.
HandleDamage eventhandler, check for condition, return damage
^
Thats how my code works.
I also have another option open
CBA_A3 written event handlers
You can simplify it by tons
For example
Simply attach a variable to the Tower
Make it true as soon as someone plants the explosive
_tower setVariable ["hasBeenPlaced",true,true];
Just make your conditions as easy as possible so code running it can check is easily, use eventhandlers and stick to it
It will save you a lot of performance issues with scripts
In OS programming the eventhandlers are called "SIGNALS"
For example, many of those life servers have modded vehicles and since the creators don't know how to script they put in a loop for each vehicle instance to wait for a condition then animate a light bar
Why not just hook up the addAction on the vehicle or even better make it key based
Some of it is.
That's really the goto example for bad programming
KeyHandler based
Every life-servers I hate
So is this bad programming?
while {true} do {//badcode///};
?
It's death to SQF
Well.
Well do some stupid stuff in there and you see yourself with low frames. It obviously depends on the code inside of it
While loops are really just the emergency solution. If something cannot be eventbased because of missing engine functions
use a scheduled inside an EVH
[_var] spawn { ///scheduled code // };
That way large pieces can be evaluated by unscheduled / scheduled
Not sure if thats a bad idea.
You can also use onEachFrame handlers instead of while true, it runs less often
surely while just runs as often as the code takes to execute?
While true is almost always faster and executes multiple times
If you aren't doing a 10 second CPU intensive operation of course
private ["_AO","_missionList","_currentMission","_nextMission","_loopTimeout","_isDebug"];
//Added beugging system.
_isDebug = true;
_loopTimeout = 20;
_missionList = [
"region_manager"
];
//if (PARAMS_AOReinforcementJet == 1) then {_null = [] execVM "mission\main\CAS.sqf";};
/*
_currentMission = execVM "mission\main\region\regionCE.sqf";
waitUntil {
sleep 5;
scriptDone _currentMission
};
*/
while { true } do {
// _mission = _missionList call BIS_fnc_selectRandom;
// _missionList
_AO = compile "GG_fnc_regionManager";
_SelectRand = floor(random(count(_missionList)));
_currentMission = [] spawn (MissionNameSpace getVariable "GG_fnc_regionManager");
diag_log format ["Mission Selected %1",_AO];
waitUntil {
sleep 5;
scriptDone _currentMission
};
sleep _loopTimeout;
};
Replacing that while {true} do {}
with ```
_EHManager = addEventHandler ["eachFrame" { // do code // }];
I assume that runs serverside?
Obviously that makes less sense in this case..
Probably would be better to do a _handle = while {true} do { [_somevars] spawn { waitUntil { scriptDone _handle};
?
One loop on the server is fine
Although
Im pretty certain you don't need one at all
If it the mission isn't time limited
It
It's not*
It's based on the amount of enemies
and whether the radiotower is destroyed
The main mission anyway.
It also uses a createTrigger
To check if there is any Opfor left
It would probably be a good idea
To remove the createTrigger too
Replace it for EH based
with a tiny while loop in it
to check if the enemy count < threshold
waitUntil {_towerDestroyed && east countSide enemyUnits };
No no.
It would fire the killed handler
then inside the
[] spawn {
waitUntil {_towerDestroyed && east countSide enemyUnits};
};
Like that?
That way the handler would temporarily suspend
Halt until the condition become true
Then terminate
do you guys just stick all your functions in a big file? no cfgFunctions?
Mine are all cfgFunctions
a file compiler?
params [
["_radioTower",objNull],
["_unitsArray",[]],
["_dt",objNull]
];
_radioTower setVariable ["towerDestroyed",false];
_radioTower addEventHandler ["killed", {
["The tower has been destoryed and was handled by a handler"] remoteExec ["AW_fnc_globalHint",0,false];
private _targetCompleteText = format [TakenAOmsg,AO_String_Name];
[_targetCompleteText] remoteExec ["AW_fnc_globalHint",0,false];
_radioTower setVariable ["towerDestroyed",true];
waitUntil {
towerDestroyed && (east countSide enemyUnits < enemyLeftThreshold };
["CompletedMain",AO_String_Name] remoteExec ["AW_fnc_globalNotification",0,false];
//Clean up the AO of vehicles and infantry
//Deprecated detection method.
//deleteVehicle _dt;
[enInfantryArray] spawn QS_fnc_AOdelete;
[enVehicleArray] spawn QS_fnc_AOdelete;
private _aoClean = [] execVM "scripts\misc\clearItemsAO.sqf";
private _MarkersClean = AOMarker_IDs spawn GG_fnc_deleteMissionMarkers;
waitUntil {scriptDone _MarkersClean};
waitUntil {scriptDone _aoClean};
}];
Purely event based now.
Now that would be cool
I can as I said use CBA_A3
XEH
Ever used CBA_A3?
@open vigil On my tests about simple objects, the server had more or less 500 normal motorized vehicles... with 200 motorized vehicles the percentage fall in fps for spawning 30K simple objects is even better!
why the heck would you want that to evaluate every frame?
PFH does not execute code every frame, but every N amount of seconds. It's a CBA (ACRE originally) thing
you're thinking of onEachFrame
waitUntil loops execute every frame. And they take away scheduler time from every other script. Addons simply should not use them, as mission scripting becomes dependant on the used addons and therefore unpredictable.
hey im trying to add a action to a tree. it will not work and i dont know why. heres my code:
_test = nearestTerrainObjects [player, ["Tree","Small Tree"], 10];
{
_tree = (_x select 0);
_tree addAction ["<t color='#FF0000'>Testaction</t>", {hint "test"}];
}foreach _test;
there is a german server which get it work with the trees. i think you can do that ๐
okay
ok thx
my plan would be:
- create game logic
- place near tree
- setvar the tree object in a logic variable
- addAction to the logic
- read the belonging tree with getVar
I wonder if object references are serialized for streamed objects or if they become null
I don't mean the id, but the object reference
guss you can use nearestObject too and just save the type
its not working ๐ฆ any other ideas ?
I'm writing something
Is this action supposed to belong ton every tree or jut some?
does not work for me with the copy to clipboard :/
@little eagle just for some in near of a marker
okay
IT WORKED!!!!!! thank you so much!!!!