#arma3_scripting
1 messages ยท Page 283 of 1
Anyone know how to fix the issue with RscText being under the RscPicture in a GUI, like the layer is above it but the paa over takes the text for some reason ?
What would the get around be then ?
But:
You can use RscText to use a Image/Texture
Because RscEdit and everything is above the RscPic
It like doesent make sence :/
ill just use the RscText for the image aswell then
instead of RscPic
An annoying thing I found out...if you use RscPicture and add mouse events - when you click it the image is brought to the front
yea i just found that out aswell
You can also try
RscPictureKeepAspect
Thanks for the help, guys much apreciated ๐
Does anyone know why my PVP scenarios don't reset between matches properly? When we start the next round, the battlefield is already destroyed, this is despite the fact that we are NOT using persistent battlefield. I've tried ending the mission on the server, on every client, still not luck.
are you saving stuff to profilenamespace or uinamespace maybe?
cos those variables are stored in your profilename.vars.arma3profile or whatever the file is called
they persist
i think he is talking about actual terrain objects. i can't remember, if they ever fixed that but there was always that bug where stuff stayed destroyed unless you restart the game or load another terrain and then reload the first. can't remember which
ohh right yeah you need to change terrain and back again
at least, i ran in to the same thing when hideObjectGlobal'ing 100s of vanilla terrain objects, and that was the only way i found to un-do it
@tough abyss Nice script. I really like your vehicle flip script as well. So fluid and cool
@peak plover thanks!
scripting wise, without a mod is there a method of increasing inventory size of a vehicle?
nope
attachTo a box to the car, like an ammocrate on the back or sth
Erm... not sure if you can access the Crate then
surely you could intercept it with the containerOpened event handler and then redirect it to a different object?
I meant more like: Can you access the Inventory of the Crate AT ALL
ah yeah i dunno
@tough abyss btw. regarding EngineDmg:
_Car addEventHandler ["HandleDamage", {```
Not sure if it reacts to water, but worth a try.
Wait, is there no alias for the Dammaged event handler?
because that's triggering me ):
A proper spelling of Dammaged
oh god
Since OFP
dammage
damage
Dammage refers to the amount of dam in the unit, aka damage or health lost...
getDammage
Description:
Returns the object damage in the range from 0 to 1. Alias of damage.```
Or just a simple missspelling ๐
stahp pls
Lovely. Please keep it ๐
reading through BIS_fnc_3Dcredits
//#define DISPLAY (uinamespace getvariable "BIS_dynamicText")
//#define CONTROL (DISPLAY displayctrl 9999)
_display = uinamespace getvariable "BIS_dynamicText";
_control = _display displayctrl 9999;
#define DISPLAY _display
#define CONTROL _control
this
is
so
wrong
(The first one, at least)
wrong why?
its because of first two commented out macros
they just added these to skip changing script itself
doesn't look too bad, but the new solution errors in scheduled env. if the function is called with serialization enabled, or when any of the variables become undefined.
also, variables appear not to be set to private, which always makes me sad : (
hahahaha
How come I can't set the wind in-game? Using setWind when wind is forced just makes it reset, and when it's not forced the wind just goes haywire.
idiot question:
_makeairveh addAction ["<t color='#4af241'>Un-Armed</t>",{_mavU = 1;},"",6,false,true];
_makeairveh addAction ["<t color='#4af241'>Armed</t>",{hint format ["gay"]},"",6,false,true];
_loopvar = 1;
while {_loopvar < 10} do
{
if (_mavU isEqualTo 1) then {hint 'working'; removeAllActions _makeairveh; _mavU = 0;} else {};
};
everything works except the if condition
any idea why
if i set the if condition to true, it works
it's _mavU == 1
probably not
well the only possibility for the if not working is that _mavU isn't 1 ๐
this code is totally broken
How is this executed?
_mavU = 0;
No, the whole script
You cannot carry over local variables from the scope of the addAction statement or into it.
I think your script runs in unscheduled environment and the while loop just quits after 10k iterations.
10k iterations all in one frame mind you
alright, thanks
Also, you shouldn't use removeAllActions . Just remove the actions you added. You will break other mods and missions with that.
That else {} is horrendous too
it was a last resort
True. Else is unnessecarry unless you plan on having something to execute there
i didnt know why it wasnt working so
The whole thing is pretty pointless, no? What does this even do?
Besides printing "gay"
Still don't know how it's executed.
Why is there even a hint format when you don't plan on inserting variables into the hint string?
Yeah, that is strange too.
alright lads dont go full on at me im new to all this
Well if no one ever tells you something is wrong, you cant learn either
Or well, "wrong" is the wrong term
If it works, its not wrong
umm
Hi
hi
You should be glad to have the mistakes pointed out. This isn't elementary school hug class here.
@static spire dont worry too much though, when I started scripting, I did loops by constantly execVM'ing the script cuz I didnt know any better and now I made an enclose horror map on VR with fully custom AI and a waypoint system that works very nicely ๐
oh god
Jup.That was like 3-4 years ago me having no knowledge of scripting
I started scripting like 4 months ago
Sounds like a few life communities I had the horror of working with
I'm writing all the scripts for my community, lots of work to do, but it's fun
indeed it is
Same here. Building all our stuff from the ground
My one and only nemesis though: GUI
fuck gui
I managed to make a lil indicator icon for my horror mission but thats it ๐
Im good with gui but when you spend ages doing one with like 50 classses then forget thr buttons
So bad lol
the one thing I never understood was where to get the default classes since you need to define them somewhere but I wasnt able to figure out the default settings to set so that a basic, whatever really can work
Get the all in one config of whatever the latest version is.
And browse that. It's easier than the ingame config viewer
Config viewer is a pain
"all in one config"?
all in one config is the exported master config of the vanilla game.
Nice to look up the definitions of base classes and other stuff you want to use.
I guess thats where I get all the GUI classes I desperatly looked for
Yes. And everything else too.
is it an easy way of setting a maxSpeed of my vehicle?
right now Im using a custom script. It works, but the experience does tend to get a little choppy
No.
depending on how long I let it sleep after each loop
ok
I find it weird that there is no variable to set in the cfgVehicles
There was in A2. But shitty PhysX is too advanced for something so simple...
:\
I guess thats why the RHS MRAP has horrible climbing abilities even for the smallest of degree that goes upwards
I don't blame them. PhysX is almost impossible to deal with as modder.
They have a million vehicles. I only manage 3 (4 soonTM)
Well a million is a bit much
variants of one vehicle probably use a copy pasted config with adjusted values for name and possible gunner positions but doesnt touch the PhysX aspect ๐ But yeah. Also, tanks randomly going at high speed is fun too
usually it is annoying but one time, I saw the AI just instantly speeding backwards down a road and almost flip it
PhysX needs more than a config. Two vehicles with the same config behave totally different, because of their model. Which is one of the worst things about it.
D:
well "because of their model" could be said about many games depending on the changes made. A kart replaced with the model of a truck for example is obviously going to act weird but I take it that even attaching something to an existing car like, spare wheels, a gun ontop ect can mess things up?
Nah. The Eagle with roof hatch and the Eagle with FLW100 use the same physx.
But you can't "copy paste" the PhysX stuff from the vanilla Merkava to the Leopard.
Or from a T54 to a T90
How come?
you have to assign masses to selections in the model. And selections will be in a totally different place if the model is different.
This is getting annoying now, anyone have a way round it: The RscPicture overlays My RscText, ive tried structured text loads of shit, I need it to happen otherwise it defeast the purpose of having a image lol.
config?
@cerulean whale you may know, its conner btw wouldent be suprised if youve forgot who i am lel.
I know a few conners. ๐ Where did I meet you? ๐ Hue, I have the same problem. Do it as an RscEdit in GUI editor and then switch the RscEdit text after you export to RscText
That's what I do
I worked for you at Trinity before it closed, i also was with you at Havoc xD with Kirk or whatever his name was xD
Oh lol. ๐ haha xD
You remember ?
Ye
Your at Huskies aint you ?
Yeah
Nice man, hows your framework coming along ?
Good, nearly done ๐
In GUI Editor, because RscPictures overly the RsctText. I make a RscEdit in GUI Editor, position it. Then I export and change the RscEdit text to RscText... e.g. https://gyazo.com/cd3f77ab5d4df845aad5d37f2b8a2773
That's weird.... Doesn't happen for me. Can you send me your Dialog? It might be behind it in the config
The dialog or the common.hpp?
Dialog
AhI see
You need the RscPicture to be at the top of the config
you see
The lower down it is under class controls the further it is to the front
think of it like paint
if it's at the top it's been pushed to background
It was the first thing i put in gui editer so its the first layer
thats weirds
Thanks anyway, ill give it a try
getShotParents
handy batman function
hahaha
sqf_irl
xD
The EDEN editor performance test give same results to _a distance _b; and _a distanceSqr _b;, distanceSqr is useless?
What did you test?
DistanceSqr is squared distance. Different Algorithm to compute distance
if _a and _b are undefined, then yes. they are exactly the same, performance wise : P
@BoGuu#1044 @little eagle _a and _b are different positions.
I first set a randonly, then set b randonly, then check performance with a distance b and a distanceSqr b. Result is the same.
@little eagle no, its not undefined, sorry for the _.
May the the EDEN performance test is not precise for small times.
I use distanceSqr the most, and in some situations you need to make code more complicated to understand, Not sure if just wasted my time. ๐ For a zero gain its not worth.
distanceSqr cuts 2 steps out, that's all
[0,0,0] distanceSqr [100,100,0]
//0.0078 ms
[0,0,0] distance [100,100,0]
//0.0069 ms
Difference is extremely small and always within the variation.
But not operations that take long at all
BOO HOOO! ๐ฆ
What is the gain so?
From the forums: "Remember allways to use distanceSqr since its extremely more faster than distance"
that's something that's said everywhere about everything since programming began (or at least since sqrt became available)
at the end of the day, it's not THAT expensive these days unless you're doing thousands upon thousands of them
it all depends on the platform and implementation - from the stats it just looks like they're equivalent in arma
Bit more to it than just a simple sqrt @ionic orchid
You can use classname and pos? @tough abyss
I don't think the classname alternative does
@compact current you also can try one of the existing external UI-Editors and fiddle around with those
eg. http://x39.io/projects?project=ArmA-UI-Editor
When does the "Ended" event handler trigger? Exactly when BIS_fnc_endMission is fired or at the end screen just before aborting?
_endevent = addMissionEventHandler ["Ended",{ systemChat "Mission ended"; }];
That doesn't display anything for me, and I'm not sure whether the event handler works or not...
@tough abyss iirc Using the Coords from createVehicle to assign a the correct Pos is not the best choice (only [0,0,0] then setPos* to somewhere else). Means -> setPosWorld/ASL = Way to go.
+Wasn't set/getPos slower than set/getPosWorld ?
Is the entity killed eh only locally executed where it was assigned?
How about when it's created on the client? Will it be local to that certain client then?
@tough abyss I meant that:
_Car = "Class" createVehicle [0,0,0];
_Car setPosWorld _DesiredPos;
(creating the Obj at [0,0,0], then moving to the desired Pos)
Hmm is there a good way to check if the client it's about to close on client? Tried with unload event on "display 46" but it doesn't always trigger.
even when you spawn stuff below surface with setPosWorld -> It will be set on ground.
Search the Net, there was someone who made some further tests, where spawning at [0,0,0] then setPosing it was was faster then ordinary
use the same?
Create the object at [0,0,0] then move it? Isn't that possible with SimpleOs?
Then just take setPosWorld or ASL from start?!
No clue where your prob is right now oO
@tough abyss you tried the alternative syntax of createSimpleObject?
@tough abyss ah, i got it.
What i do is record the offset on first use so if i spawn the object again there is no need to calc the offset again.
What i do is record the offset on first use so if i spawn the object again there is no need to calc the offset again.
But better should be create a list of offsets.
is there a short version to set enabledamage false for all objets without a ingame trigger?
or do i have to list all the objects then in the init
or can i do it with a class in gerneral ?
hi all how can i get the ammo , projectile , weapon info , as im tryign to change wich gun is a taser in altislife
i know with fired eventhandle but i can't seem to figure it out how to add it to myself to actualy test the gun and see the details
one sec ๐
soo
u are in editor place down a trigger
set it to radio alpha
and check "repeatable"
then type into the init field :
[Open,true] call bis_fnc_arsenal
when u press 0 - 0 - 1 on your keyboard you should go into the virtual arsenal
or just the way you go to your radio normaly
or you put the bis_fnc_arsenal on something as addaction
player addEventHandler ["Fired",{format["PART: %1 || DAMAGE: %2 || SOURCE: %3 || PROJECTILE: %4",_this select 5,_this select 10,_this select 0,_this select 2];}]
?
im trying to use that to see the projectile etc i shoot my gun but it doesn't work
error:zero diviser
you want to see the projectile itself
i need the classnames of those variables for a script
i want that gun not to do dmg but execute a script , i got the script and all in place just need the variables
look up the tazer script then
thats why i need those variables ๐
i dont have any altislife scripts...^^
i got the scripts just need to figure out the variables of the projectile, ammo , gun
so im trying to get those with the addeventhandler but that 1 doesn't work and not sure what i misstyped
in my mind i dont belive there is any special ammo ^^ its just a gun where the hit activates the script and the tazer is not dangarous because of a fn_handledamage ๐
thats what i tought yet i cant get it to work with a gun from addon
yeah because u have to cant just set the dmg to 0 from a weapon u also need the script for if hit then tazed
let me check something
sooo
there are 2 seperate scripts
first you need the addeventhandler
for the tazed script
then player setvariable "istazed", false and so on
for the addeventhandler i need the gun i shoot with , ammo type , projectile
in this example the script is in the tazer.pbo itself
its from capps
u can check it out ๐
X-question from #arma3_scenario: I want to show sometext on screen and such on mission start, but initPlayerLocal executes before the initial loading screen is gone, so it doesn't show up
where else can I run the code, so that it executes on mission start, but not before the player actually sees it?
or can I somehow pause the script until the loading screen is gone?
(The code doesn't run in initPlayerLocal itself, but is spawned from there)
put a sleep before?
sleep for how long?
I mean, it'd be an option, but I'd like it to not depend on the players performance
sleep is in seconds so i sugest between 120 and 240
for me the loading screen is about 2 seconds long
make it run in a zone then on the map ?
on a slower PC it might be more
trigger*
the trigger runs with a slight delay though
gimme a sec to eat then I'll give you the proper code
so the player sees his character for half a second, then the screen goes black and the text shows
@civic maple thanks a lot ๐
is it so important to be totaly at the start a trigger would be a perfect solution because most people are afk when joining lol ๐
atleast brain afk ๐
have you played the apex campaign?
they do pretty much the same thing, but with some fancy voice acting instead of my boring text
start of first mission
you can do the same
I've had it happen to me that I saw my character for half a second or so and that was the most immersion breaking thing of the entire campaign
set the gamemode to hardcore no thirdperson ๐
well, I do that anyway, but that's not the point
I don't mean that I see my character; I mean that I see ingame stuff before a cutscene starts
it feels weird and poorly timed
I could live with that if there was no other option, but I'd prefer avoiding it in my mission
why dont make the game the cutscene ?
because stupid players that's why xD
Some people need the screen to be black if you want them to read the actual text xD
also it looks pretty
and cinematic
and pretty
thats why i want all my walls to be enabledmg false .... cause people tend to drive against them to drive the short way instead of enjoying the map i did ๐
so i still cant get player addEventHandler ["Fired",{format["PART: %1 || DAMAGE: %2 || SOURCE: %3 || PROJECTILE: %4",_this select 5,_this select 10,_this select 3,_this select 2];}] to work
just put an AT gun on the other side of the wall
+1
that only works with walls though, but it doesn't fix my black screen problem ๐ญ
why?
me eatin, can't look at scripts
I mean, I could despawn the AA guns if there was a function like waitForPlayerToRead <text>
but that doesn't exist
you can start witht he black at the start let it black for the time needed and put a sleep on the text for ~10 seconds
there has to be some way to find out if the player has a menu open
or u accept that some people dont like to read ๐
hasInterface?
Returns true if the computer has an interface (a real player). False for a dedicated server or for a headless client.
sounded very good, but it's the wrong thing =/
cutText ["", "BLACK FADED", 10, true];
sleep 2;
0 = ["Operation Cobra", -1, -1, 3, 1] call BIS_fnc_dynamicText; sleep 1;
sleep 2;
cutText ["", "BLACK IN", 10, true];
0 = ["NATO Airfield", "SE of Theresia"] call BIS_fnc_infoText;
0 = ["20 Days before", "Firestorm Incident"] call BIS_fnc_infoText;
that's my current code
what I want is something like
waitUntil <loading screen is gone>;
cutText ["", "BLACK FADED", 10, true];
...
What would that change?
or waitUntil {alive player && isplayer player};
Trying that now...
waitUntil {alive player && isplayer player}; doesn't work
interesting video, but it's kinda the wrong thing xD
@civic maple I don't see how a custom loading screen would help me
ffs not even waitUntil {!userInputDisabled}; works, even though the player clearly has no control
this game hates me
it hates everyone
guys. do all eventhandlers (on units) survive respawn?
do arma 2 scripts work in arma 3
they shouldโข?
I am abandoning my original idea
I am now trying to do it like in the apex campaign
but that's even weirder
you get the splash screen only on your first spawn
and only if it's at the start of the mission
was there a way to store a variable locally on the players machine only?
during the mission
I want something to execute only on the first respawn, so I need to somehow keep tracked if the player has respawned before
just use a global variable
global means global to all scripts on the machine it is declared on
ok so it stays on the local machine
stuff only gets shared over the network, if you want it to or you use something like an event handler that fires on every machine. and even then it's more like creating identical clones of the variables rather then really sharing them.
I know, but I was kind of expecting that variable = 1 would automatically share them
wouldn't be the first time arma 3 did weird stuff like that xD
that would be crazy to send a package everytime a variable is declared
you'll need to do publicVariable "var"; to share a variable
it's good to be cautious about the engine quirks but it's better to learn to read the wiki fully and learn how everything works exactly instead of assuming weird things
that would be crazy and that's exactly why I expect arma to do it xD
if you aren't sure about locality of commands for example, take a look at the top of hte wiki page. there are network flags there specifying the MP behaviour of each command
pretty sure the EH page has that for each EH too
then there are event scripts like init.sqf which is more of a case of something running everywhere instead of actually sending packages sharing vars.
that will give you a good understanding about the architecture
The more I think about arma 3, the more I realize how amazing it is that such a relatively small game has this kind of feature
most of this stuff was even in arma 2
It has the content of a game and almost the customizability of an engine
Is there a way to check if a AI unit knows about the location of a player group?
mmh and how can I do this with a dynamic player group which like 50 players? XD
what exactly do you want to do?
I want an artillery which fires at the players
but I dont want it to fire if the AI has no way to know where the player is
There's also targetsQuery for getting list of targets
this allows you to actually get a value from distance between actual position and perceived postion. which could be more dynamic than a yes/no thing
mmh okay
one enemy unit would be enough
cuz, it would be realistic if they share the information
I heard some things about Java support for Arma 3 modding back when the game was in alpha, has that ever become a thing?
no, got discontinued
ah :/
Java support for modding in arma?
No
no but when I read it I can only think about its as a joke
It would be the one thing that is even worse than SQF.
java and performance XD
My unpopular opinion is, that you don't need OO programming for 99% of the stuff you do with Arma.
The people that want it are usually those that started with C++ or Java
I gotta problem with my mod. anyone wanata hop down to a voice chat and help me with it
voice chat
Nah
okay then
i'll try to explain my problem
you know in your inventory how you got three tabs? one for you uniform, one for your vest and another for your backpack. the icon for the back pack shows up but the icon for your vest and uniform does not
but when you go into virtual arsenal the mini version of the icon does display beside the name of the vest and uniform
how do i fix this
wat. why?
what do you mean why?
And the problem is that you have no idea where to start?
yeah i dont know why it does work for the backpack but not for the uniform/vest
here i'll pull up my scrpit
Ok. Here is a copy of the BIS_fnc_arsenal script:
It's one of the most horrible pieces of SQF ever written.
If you want to fix that issue of yours, you have to rewrite that function and find the line that causes it and fix it.
i'm new to this bro i won't know what i'm looking for
I don't know either. It's over 3000 lines. It's a mess and no one knows where to look for it.
what is the line that adds the icon for the inventory
dfs znrswznub w4z
cause i put this and it works for the backpack but not the vest/uniform:
picture = "Custom_Uniform\Data\icon_assaultpack.paa";
What. Where do you "put this"?
here
class B_AssaultPack_Base;
class Custom_Backpack_Compact_Kirk: B_AssaultPack_Base {
author = "Brandon Kirk";
scope = 2;
displayName = "(JTFNATO) Assault Pack[Kirk]";
maximumLoad = 160;
picture = "Custom_Uniform\Data\icon_assaultpack.paa";
model = "\A3\Characters_F_EPA\BLUFOR\backpack_kerry.p3d";
hiddenSelections[] = {"camo", "camo1", "camo2"};
hiddenSelectionsTextures[] = {"Custom_Uniform\Data\custom_pack_kirk_co.paa", "Custom_Uniform\Data\backpack_compact.paa", "Custom_Uniform\Data\custom_pack_kirk_co.paa"};
};
thats for the back pack
class Custom_Camo: Uniform_Base
{
author = "Brandon Kirk";
scope = 2;
displayName = "(JTFNATO) Combat Uniform [CDN]";
picture = "Custom_Uniform\Data\icon_civ_shirt.paa";
model = "\A3\characters_f\BLUFOR\b_soldier_01.p3d";
class ItemInfo : UniformItem
{
uniformClass = "Custom_Uniform";
containerClass = "Supply40";
mass = 5;
};
};
thats for the uniform
class Custom_Vest_Kirk: Vest_Camo_Base
{
author = "Brandon Kirk";
scope = 2;
displayName = "(JTFNATO) Platecarrier[Kirk]";
picture = "Custom_Uniform\Data\icon_plate_carrier.paa";
model = "A3\Characters_F_EPA\BLUFOR\equip_b_vest_kerry";
hiddenSelections[] = {"Camo"};
hiddenSelectionsTextures[] = {"Custom_Uniform\Data\custom_vest_kirk_co.paa"};
class ItemInfo : VestItem
{
uniformModel = "A3\Characters_F_EPA\BLUFOR\equip_b_vest_kerry";
containerClass = "Supply140";
mass = 15;
hiddenSelections[] = {"camo"};
class HitpointsProtectionInfo {
class Chest {
HitpointName = "HitChest";
armor = 16;
PassThrough = 0.3;
};
class Diaphragm {
HitpointName = "HitDiaphragm";
armor = 16;
PassThrough = 0.3;
};
class Abdomen {
hitpointName = "HitAbdomen";
armor = 16;
passThrough = 0.3;
};
class Body {
hitpointName = "HitBody";
passThrough = 0.3;
};
};
};
thats for the vest
OK, now that sounds like a completely
COMPLETELY different problem
Can you show a picture of what "icon" you mean that is missing?
Because I think I know what you mean, but am not sure.
yeah give me a sec i'll have to get in game
thx
how do i send pics?
Upload to imgur and link
You're wearing a uniform and vest, but the icon does not appear in the inventory UI. works for backpack.
Correct?
yeah
What does that have to do with the arsenal?
You should've just written that:
You're wearing a uniform and vest, but the icon does not appear in the inventory UI. works for backpack.
sentence and everyone would've known what the problem is
Ok, let's see
class Custom_Vest_Kirk: Vest_Camo_Base
{
author = "Brandon Kirk";
scope = 2;
displayName = "(JTFNATO) Platecarrier[Kirk]";
picture = "Custom_Uniform\Data\icon_plate_carrier.paa";
model = "A3\Characters_F_EPA\BLUFOR\equip_b_vest_kerry";
hiddenSelections[] = {"Camo"};
hiddenSelectionsTextures[] = {"Custom_Uniform\Data\custom_vest_kirk_co.paa"};
class ItemInfo : VestItem
{
uniformModel = "A3\Characters_F_EPA\BLUFOR\equip_b_vest_kerry";
containerClass = "Supply140";
mass = 15;
hiddenSelections[] = {"camo"};
class HitpointsProtectionInfo {
...
};
};
That is the vest you're wearing?
yes
also it say no armour when you mouse over it in the inventory ui
but i game it does protect you
where do i add that?
okay and the icon?
Hmm. I'm not sure why it doesn't show the icon.
Does it show any error message in the RPT file?
%LOCALAPPDATA%\Arma 3
maybe you need another "picture" entry in teh class iteminfo?
no you don't
just guessing.
; )
sure, any text editor
ctrl + f for "custom"
Custom_ is a strange tag btw. Looks like a placeholder for a real tag
might be a good idea to move this to the config editing channel where it belongs to get the right people to look at it
I think I already know why
why?
Can you try changing:
picture = "Custom_Uniform\Data\icon_plate_carrier.paa";
to:
picture = "\Custom_Uniform\Data\icon_plate_carrier.paa";
is it like that for my backpack?
no its not
just looked
then should i do that for my backpack too?
No, you change one thing at a time to debug something
okay
Just to be sure you catch what makes the difference
If this doesn't work, then you can try giving the vest the icon of the backpack. That way we could test if it's a problem with the graphic or with the config.
IT WORKED BRO!
the slash in front?
Put that slash everywhere
slashes for everyone!
It belongs there. Without slash it searches from the root and not the addons folder
what about the backpack?
The C++ level uses different methods for different item types
They probably programmed it in a way where it uses the addons folder as backup, but only for backpacks
so i should?
Yeah. backslash everywhere
model="\A3\weapons_f\Ammoboxes\bags\Backpack_Compact";
even before "A3"
so start every "___" with a \
Not every. There are some exceptions, but from what I've seen, everything you use should have it
model, picture, textures
okay awesome thanks
JTF NATO is the mod if you want to check it out on the steam workshop
In theory there should be a RPT entry about a "texture" (picture really) not being found
Not sure though.
alright thanks man
yw
cheers
My facial expression when I open a script made by someone else.
My oral expression when I open a script made by somone else > http://i.imgur.com/h1qM1i5.jpg
My appetite for bleach has risen, as I realize that pressing escape will immediately re-open the full-screen dialogue.
Show us your best script
I think I should really over-look some of my own scripts. Because I do would not wish these feelings on anyone.
You would feel just as bad
Using indentation is important.
What's the 'proper' way of using indentation?
if (true) then {
script
};
if (true) then
{
script
};
if (true) then {script};
I know people that do both, I prefer the second one as it is easier on my eyes.
I personally only use the third one on really short lines that are repeated
I've been using the first one. However if it's a simple line of code or just exitWith {} I tend to use the 3rd
the first one is by far more popular
make it easy and just follow ace3 https://ace3mod.com/wiki/development/coding-guidelines.html
Or have random amount of indentations on each line!
don't forget to mix spaces and tabs
^^
first one i like lots more
i have a tendency of also using the last if it's just a one line thing
haha the spaces and tabs and random indetations ๐
it's usually in cases where i expted a return
_return = if (_condition) then { call fnc_bla } else { fnc_bla2 };
Where i dont'want to use select because it'll execute both
i still gotta check if param still always executes the default return
[1, 2] params [["_one", call fnc_someSlowAssFunction]];
It'll always call that function, even though the param is present
what's objectively wrong with the second way? looks way more readable to me
java and performance XD ( @delicate lotus )
What if I actually told you that the execution speed of Java programs has improved by a lot
actually I bet that it's almost as fast as e.g C++ in some scenarios
True words.
The Java SQF implementation would definetly perform better than current SQF. It was only ditched for security Reasons. Some Java Functions are even still in the engine right now I think. But not accessible.. Maybe it will come back some day
It says infinte while loops are not allowed. Why is this?
Don't have too much experience with SQF, but I assume that you run it on the main thread and therefore it's gonna freeze up the main thread
Thats indeed what it does.
infinite while loops are not allowed because they would freeze your game. Instead unscheduled while loops are limited to 10k iterations
infinite while loops are allowed in scheduled environment. In unscheduled environment there is a 10k iterations limit, but you would lock up the game anyway with infinite loops there.
Alright. Mine is in scheduled because it's been running way longer.
Hay Guys, i have a problem. I got my own arma 3 main menu. I want that my "loadingscreen" is not a picture, i want it to be a video. Thats my picture: class LoadingStart: RscPicture
{
idc=2310;
text = "general\vid.ogv";
autoplay = 1;
loops = 10;
x="0 * safezoneW + safezoneX";
y="0 * safezoneH + safezoneY";
w="1 * safezoneW";
h="1 * safezoneH"; it doesnt work with the video. Its just black
I'm not sure whether it's even possible to use a video in the loading screen...
In bohemia wiki they wrote its the same as with picture, just use this code: text = "general\vid.ogv";
autoplay = 1;
loops = 10;
I dont really understand xd
Maybe it just doesn't work for loading screen? Because that one may be special?
hm. Ok ๐ฆ So i will go with an paa file.
I don't know if thats the case. Just assuming stuff
You sure you wanted to post this in #arma3_scripting?
works for me
๐ฆ Where do I need to publish it?
?
@civic maple soory anden
np
@little eagle How did it go? ๐ฆ ๐
I just used texview2. The other tool is annoying to use
No, straight to paa
save jpg as png, then use pal2pace from TextView2 (BI Tools)
save as
(not sure if you can do jpg straight to paa, never ever needed that)
sure you can. I just did
okey i am download textwiew 2
i am try thanks everybody
tga to paa >>> its true ?
Anyone know how this would be done? I'm trying to do something simular, would I use cutRsc / cutText or cutObj / cutText or something completely different? Thank yaw https://gyazo.com/fbe06074b1a9ee94768261c25ff3fc34
imagetopaa error>> Fail to process
Naw the loading bit
I'd use a dialog instead.
Hm okay, how would you format the font like he has on the initializing bit
by adding controls to the dialog. probably a RscStructuredText one where you can use html like tags for formatting
Oh nice I didn't realise you could do that, can you import fonts using controls?
Not without changing some configs (needs addon.pbo, not mission), but Arma has a bunch of Fonts
Okay great thanks pal
@little eagle is he using his own image as the background or is that effect achieved messing around with the editor do you reckon?
It might be one of the images of the loading screens already in Arma, but I can't recognize all of them.
You would add a RscPicture to your dialog and give it that texture
CfgFontFamilies
in the config viewer has all available fonts
Yea of course, I think it is because it looks familiar. Thanks mate been a big help ๐
class CfgFontFamilies
{
class LucidaConsoleB
class TahomaB
class EtelkaMonospacePro
class EtelkaMonospaceProBold: EtelkaMonospacePro
class EtelkaNarrowMediumPro
class PuristaBold
class PuristaLight
class PuristaMedium
class PuristaSemibold
class RobotoCondensed
class RobotoCondensedBold
class RobotoCondensedLight
};
You wouldn't know where the loading screen textures are located would you?
ui_f.pbo I'd guess
Okay bud I'll check it out thanks
"\A3\Ui_f\data\GUI\Cfg\LoadingScreens\LoadingStripe_ca.paa";
"\A3\Ui_f\data\GUI\Cfg\LoadingScreens\LoadingNoise_ca.paa";
"\A3\Ui_f\data\GUI\Cfg\LoadingScreens\Loading_01_co.paa"
ui_f_data.pbo is the PBO file
It's basically LoadingNoise_ca.paa on a black background as far as I can tell
Looks about right to me ๐ thanks again brother
Is it possiable to call a function on a specific player, using there player uid ?
What will I find if I open that function?
/*
Author: Nelson Duarte
Description:
Returns object belonging to given UID
Parameter(s):
0: STRING - The UID of object
Returns:
OBJECT
*/
// Parameters
private ["_uid"];
_uid = _this param [0, "", [""]];
// The shooter
private "_unit";
_unit = objNull;
// Go through all units and find matching UID
{
if (getPlayerUid _x == _uid) exitWith
{
_unit = _x;
};
} forEach allUnits + allDeadMen;
// Return
_unit;
eh, it's alright. But relying on + priority being above binary commands is pretty ugly
can also use allPlayers instead of (allUnits + allDeadMen)
Yeah. That should make it quicker.
count instead of forEach will save you another tiny bit of time ๐
#countindex2017
๐
no _forEachIndex is the reason basically
well then
It's a tiny bit less stuff to do in C++ land
But it's more limited over all
also, the new breakOut syntax would be faster too
new syntax? :3
new D:?
ima look it up later i guess
return value
1.5 something
Since Arma 3 v1.47, breakOut can be used to return a value. It is the closest SQF comes to having "return" like operation.
params [["_uid", "", [""]]];
scopeName "main";
{
if (getPlayerUID _x isEqualTo _uid) exitWith {
_x breakOut "main";
};
} count allPlayers;
objNull
You think it makes a difference? I think it's pretty much the same
the exitWith will cause overhead trying to exit the scope, which you will exit regardless
then has the alternative syntax to check IF then CODE vs IF then ARRAY
there is just IF exitWith CODE
So... I want something to happen when a player joins (mission start or JIP), and then, 60 seconds later, something else to happen. is it a terrible idea to use sleep in initPlayerLocal.sqf?
Thanks guys, i just used remoteexeccall with the uid passed as a param and then a if statment checking if the uid is equal to the players uid then do.... etc
@little eagle After precompilation?
Even so, the way the engine is checking types wouldn't be a large overhead, vs exiting scope
preprocessing does not get arround these type checks
Even so, the way the engine is checking types wouldn't be a large overhead
Well, I'm not so sure about that
@little eagle I'm getting an error when I run the server that it can't find my loading.paa, is this the right way to call it? Baring in mind that my LoadingScreen.hpp is in dialog folder and my loading.paa (the texture) is in dialog/images
class BackgroundEffect: Life_RscPicture {
colorBackground[] = {0,0,0,1};
idc = -1;
text = "images\Loading.paa";
x = 0 * safezoneW + safezoneX;
y = 0 * safezoneH + safezoneY;
w = 1 * safezoneW;
h = 1 * safezoneH;
};
};```
Ah fixed all good
Sorry, compilation*
Does anyone know what this error could mean? https://gyazo.com/ce0a6314bc2f9d228245032887e21bc0
The file dialog which is defined in my RscTitles in Description.ext is http://pastebin.com/fRqgiYmK
Can't see where I'm going wrong :S
Can you do a for statement and have it increment by a set value? (As a pose to 1)
Got it, step does it
it is right in front of you @tough abyss
No entry 'mpmissions\__CUR_MP.Altis\description.ext\RscTitles\LoadingScreen.duration'
the UI you created is required to have a duration field
due to the way you create it
just add a field duration = 32000; and you should be fine ...
though, after 32000 seconds, it will be hidden
@cerulean whale yep
for "_i" from x to y step z
oh didn't see your second message
๐คฆ
Lol
In my hpp file @queen cargo ?
Thanks for pointing that out pal I'll get into it now
Does anyone know the x,y,w,h numbers for a full screen? I'm trying to put a loading screen in but it doesn't span whole screen
https://community.bistudio.com/wiki/SafeZone
also consider using a UI editor @tough abyss
Anyone have a link to a good example of a game clock? Something similar to a count-down timer, which can be reset, puased, started, stoped, etc.
Trying to write a general purpose timer.. D:"
what exactly you have in mind @hearty plover ?
@queen cargo Well, I need a timer, which can work like this [TIME TO RUN] call timerStart.sqf and can be stopped or puased with, [] call timerStop.sqf and timerPuase.sqf
Also, It needs to be server side, and synced to all players...
As I plan on taking the data and using it to cut a display to each client..
Fuck this all sounds stupid.. D:
RscText
some update task
a variable with the start time
and some calculation to get the latest time via current - start
fairly simple actually ...
required steps:
- display "timer" dialog
- create a "timer" variable and publicVariable it
- create a "running" variable and publicVariable it
- create a backgroundjob (eg. onEachFrame, Draw3D, spawn, ...) to update the timer dialog by simply doing
timer settext (TIME - startTime) - tell the backgroundjob to terminate when the timer is paused
something like that
exact steps could be different ... but that should get you started
would write it down if i had the time ... but trying to fiddle around with avalondock2 ...
fucking styling -.-
Can i cancel a moveTo command aplyed on a agent?
Is there an alternative to or a known method for doing something similar to nearestTerrainObjects[[0,0,0],["tree"],100000,false,true]? I'm able to run that on different size worlds and get a list of all the trees but on heavily forested maps (xcam_taunus for example), the array it tries to build takes up too much memory and crashes ARMA. I've tried looping through sections of the map in a for x = 1 to 4 { for y = 1 to 4 kind of deal hoping that if I used a smaller radius, I'd be able to go through the map in sections but the memory usage just grows and grows until it crashes whereas I kind of expected it to grow and linger until the script completed. Any thoughts?
Line 6 of the above is missing a semi-colon according to Arma3...
I am guessing it's something wrong with my nested if statements, but am unsure of what I am doing wrong.
https://community.bistudio.com/wiki/else that's what I am looking at that has me stumped, as my syntax and such looks okay
I'm not completel familiar with the syntax, or if it's different for cpp files but in sqf, I think the if's require a then
if (condition) then {}
Don't forget you can't use indexers like array[0] ๐
Re: my issue. Or does anyone know a way to force memory used by a script to clear? I 'spawned' my for x, for y nearestTerrainObjects[[xdistance, ydistance,0] hoping that if it ran in a different 'thread' that the memory would be released when the thread completed ... though I haven't yet tried nil'ing the thread handle ... I'll try that.
@cold quartz I'm not sure what you're hoping for. And use 'thread' loosely, even if you are spawning/execVM. When you refer to memory usage, are you storing results, etc?
If you are going to await execution, there is no need to be spawning it
That was a test
I was crashing arma and trying out different ways to get the process' memory usage to stop growing
o.o
Originally, there wasn't any spawning, it was all in the context of the single script but I figured, 'maybe' if I spawned it, it would clear when it fell out of scope.
Yea, but when it reaches a certain size, I'm attempting to clear the array they're getting pushBack'd into...or at least I thought that's what I was doing?
@cold quartz i created a function long time ago to itterate over the map to find certain objects
you can change that to do what you want to
https://github.com/X39/XInsurgency/blob/a19889986ac7a391ae09d4dcfd3f6802666ec13c/codeBase/XLib/getAllHousesOnMap.sqf
https://github.com/X39/XInsurgency/blob/a19889986ac7a391ae09d4dcfd3f6802666ec13c/codeBase/XLib/getAllHousesOnMapPerGrid.sqf
as bonus: rewrote those using my lil OOS language
in OOS: https://github.com/X39/XInsurgency/blob/OOS_Insurgency/InsurgencyModule/src/Mission/Main.oos#L27
the compiled SQF: https://github.com/X39/XInsurgency/blob/master/codeBase/Mission/getAllBuildingsOnMap.sqf
hf
Elegant, thanks! By looking at yours, I think I helped to identify the primary flaw in mine. I'm essentially duplicating and possibly triplicating every tree w/ my hugely overlapping search radiuses. I also think I answered my 2nd question too. On the iteration, I was trying to set the array to nil or [] to free up the memory after each 'batch' of 100 but that wasn't reflected in the processes tab for ARMA's memory usage. Once I spawned it then eventually nil'd the spawn handle, the memory usage increased and decreased like I expected.
I need multiple string or such...
explain yourself man
For example:
case "name":
{
_patch = "\PATH\PATH\" + (_name_array select 0) + "_" + "check1" + ".paa";
};
what's the issue?
TIP: _agent moveTo getPosATL _agent; make the agent cancel the current moveTo command.
Tested in Eden Editor.
Can i do this or not?
what you wrote won't do anything because the syntax is wrong
So, i would separate each case right?
switch (_uniformClass select 2) do {
case "name1": { // do something };
case "name2": { // do something };
default { // default do something };
};
like that?
we don't know what you're trying to do though
@rancid ruin switch (_foo) do { case "str1"; case "str2": { /*work to do*/ }; };
uh ... wait
i'm so confused
syntax error
in it
fixed*
ohh ... wait ... wrong annotation
but your approach is wrong @spring dune
gah ... should get some sleep ๐ sorry @rancid ruin for false annotation
example 2 sums up switch cases pretty well
_color = switch (side player) do {
case west: { "ColorGreen" };
case east: { "ColorRed" };
};
this sets the variable _color to a string, depending on if the player's side is west or east
Sorry for noobish Q. Sleepless night... Blah blah blah...
I just asking because some of classnames have different parts
For example:
rhs_uniform_emr_patchless
rhs_uniform_msv_emr
select 2 = emr and msv here...
switch ((_uniformClass)select 2) do
{
case "emr":
{
_patch = "\PATH\" + (_###_name_array select 0) + "_" + "EMR" + ".paa";
};```
It's a part of...
use pastebin dude ๐
Huh... Sorry. Will do
that just spamms the channel
} forEach getArray (configFile >> "span class="re5"> CfgVehicles" >> getText ( configFile >> "span class="re5"> CfgWeapons" >> uniform _unit >> "span class="re5"> ItemInfo" >> "span class="re5"> uniformClass") >> "span class="re5"> hiddenSelections");
oh my lord god
so ... what would an example input to that function look like now?
Don't ask me really about this. Not mine code. Just trying to change switch structure.
_############!
he just hid the tag @dusk sage
Ofc. )
So... The Q same...
Any ways to combine cases with different values called by one Select?
so ... as said ... if it works @spring dune then do not change
if it needs to be extended ... well ... need example input for the call to the script to even understand anything on it (as it seems completly ridiculus to me ... could be the time)
if it just needs to be changed for the sake of cleaness ... rewrite :3
you do can have multiple cases executing the same code
I'm trying to rewrite. And this is first step:
- expanding of switch
Like that right?
switch (_condition) do {
case "string1";
case "string2": { hint "string1 or string2" };
etc.
};```
exactly
Just wasn't sure about... Sorry guys. And ofc โ Thank you! ๐คฆ ๐
P.S. Imma true noob.
just always check the wiki ๐
it is pretty well written in most cases
and now bring me a beer
i have a UI-Editor to rewrite ...
I did, @queen cargo . My mind just stuck.
Which one?
full rewrite as i am fucking annoyed by the mistakes i made due to missing knowledge about WPF ... and some required concept with it
it just makes it a badass piece of shit to debug
Looks like really useful thing... ๐
But I can't fully estimate appreciate it. Not my level. ๐
Neat app. I don't really mind wpf but I hate styling controls.
there's some errr CSS in your SQF
Uhmm...
Another begginer Q there...
Can i wright like this: http://pastebin.com/6PK6k5pb ???
if > then > else > else... I mean.
@rancid ruin I see now what u talkin' about
@dusk sage that sounds bad... ๐ฆ
if else else? Oo
case "g3":
{
switch (_uniformClass select 3) do {
case "": {};
case "": {};
};
};
this or this or this...
if elseif else
๐
Yup, @queen cargo
that does not works in SQF due to the way if works
if there would be a single-line accepting if else
then it would work just like in any other lang
Yeah, that's why i'm askin'
I also just noticed this
if (((_uniformClass) select 3)=="span class="re5"> mc"||"tan") then
That won't work for more than one reason
if (index == 0)
return 0;
else if(index == 1)
return 1;
else
return 2;
is actually
if (index == 0)
{
return 0;
}
else
{
if(index == 1)
{
return 1;
}
else
{
return 2;
}
}
but as the first is not possible in SQF
you are stuck with the second
or with switch
http://pastebin.com/Lei5rZ5u
Check it
just use switch darling ....
You cannot do
and ...
_x == 1 || 2
actually he has ... pastebin just fucks up sqf
"span class="re5"> mc"
Yup, it's broken again...
hahahaha
Watch snapshot above
though ... it would be great if a programming language would just work like that
Yup, i saw your message about this.
@queen cargo Hah. )
Not being rude, but are you reading what's being said
You can do
_x == "something" || _x == "something2"
Or
_x in ["something", "something2"]
Now i understand you. ) Thanks a lot for patience! ๐
๐
Anyone know why isNil is returning false when a variable IS defined?
e.g. isNil backpack player
Full code?
Also
oh dw I have a workaround
Anyone know why isNil is returning false when a variable IS defined?
just if backpackPlayer != ""
If a variable is defined, it is not nil
which means you have
isNil ""
or isNil "something"
So unless something is defined
๐คฃ
I thought if backpack player was undefined (you have no backpack) it was set to nil
isNil returns true because the "backpack" is not defined as variable in current namespace
but it's set to ""
isNil will check the variable in the string
It will literally be
not if the string is empty
THE REASON IT DIDN'T WORK. Is because when you have no backpack it is set to ""
I did that arleady @queen cargo....
Why would it return nil
It returns a string
It wouldn't make sense for it to return nil
because you have no backpack. I didn't realise that at the time @dusk sage
isNil is not for string comparison
thats why you are using the wrong thing here
@queen cargo I don't think you get what I am saying
I DIDN'T REALISE IT LEFT IT AS A BLANK STRING WHEN YOU HAVE NO BACKPACK
i do not think you get what i am trying to communicate to you
COOL THEN STOP CAPS LOCK
still you use it wrong
isNil would also return false for backpack carried
You aren't seeing my point even though I explain it. isNil {Undefined Var} would return true. isNil "Backpack " would return false
what you wanted to have is isNil code --> isNil {backpack player}
Well, isNil backpack player works just fine. because backpack player is always a string
and you do not listen which is even worse
whether you have a backpack or not
meaning it is useless
isnil is useless with backpack because it is always a string, even if no backpack exits
๐ฟ
...
okay ... i will quickly explain it in length
with code examples
why your whole attempt and understanding of IsNil is wrong
as linking to te page did not helped
isNil "" = false
because: "" == string
and you seemed to ignore the context i tried to transfer to you @cerulean whale
@jade abyss isNil "anything", might not return false though
Exactly @jade abyss That is my point here. @queen cargo I understand what you are showing me but it is irrelevant to my situation...
and isNil in the first place is useless in this situation therefore I do not need it....
//backpack player => B_carryAll_base is set for all theese examples
isNil backpack player; //=> will be true```
```B_carryAll_base = "something";
isNil backpack player; //=> will be false```
```isNil {backpack player}; //=> will be false```
Don't think so, but okay. Carry on.
@jade abyss Which I did about 20 seconds after asking the question, and I don't really why this conversation is still happening lol
(since one is ConfigClass and the other one is a Variable, but okay)
Wondering also Ben^^
Yeah, changing b_carryAll_base as a var has no effect on the configClass
I was wondering how that worked as well lol :/
what do you mean D:?
Yeah, changing b_carryAll_base as a var has no effect on the configClass
If that would work... oh my... it would fuckup whole Arma^^ So... no, i don't think thats even possible
Look at his example. He sets a var but then uses backpack player negating the var
๐คฆ
Negating the var?
negating the effect of setting the variable in the first place
I don't understand what you mean
@queen cargo Sry, but what you wrote was Schwachsinn aller feinster Sorte ๐
๐
no @jade abyss ... they are separated examples and explain what he did in most basic SQF possible
He sets a variable... and doesn't use it, yet changes it in both examples. Yet in the examples it apparenly changes the result. It's weird. ๐
that is because IsNil is not checking the string
the string is taken as variable name
and the variable under the name in the string of isNil is checked for being nil
Would it make sense? Not rly.
No, the string of backpack player is a string taken from configClass
var = ""; isNil "var"; and var = nil; isNil "var"; is essentially what i put there
as that is what it is doing
exactly @jade abyss
You don't understand what isNil does then @cerulean whale ๐
still, i got one question:
Everything X39 has said is 100% right
WHY THE FUCK DO WE TALK ABOUT THAT?
Who the F would check isNil for a backpack AND Who the F would assign a Var with the name of a Backpack ffs oO
That makes no sense at all
@dusk sage It checks if a variable is undefined..... What he is doing is this ```SQF
B_carryAll_base = "nil"
isNil backpack player
Exactly my point^^
okay ... lets fiddle it down further ...
again: Why? This is a case that might happen... ... .. erm... never?
By doing B_carryAll_base = "nil", you are defining it in missionNamespace, so it is not nil
@dusk sage let me get his example
B_carryAll_base = nil;
isNil backpack player; //=> will be true
B_carryAll_base = "something";
isNil backpack player; //=> will be false
isNil {backpack player}; //=> will be false
Yep, that makes total sense
How does canging the variable effect the result because it doesn't check the variable, it checks the string returned from backpack player
myvar = "Bla";
isNil "myVar" = false
//typeName _player ==> "OBJECT"
_backpack = backpack _player;
//typeName _backpack ==> "STRING"```
from wiki:
`isNil STRING` `isNil CODE`
further from wiki:
```Tests whether the variable defined by the String argument is undefined, or whether an expression result passed as Code is undefined.
The command returns true if the variable or the expression result is undefined (i.e. the expression result is Void), and false in all other cases.```
But