Okay @still forum I have always been kind to you. If you don't have a kind response back then don't answer at all especially when you assume I haven't looked anything up. As a matter of fact I have the wiki open all the time and just because it's open doesn't mean that I can fully understand what I am reading. Do me a favor and don't reply to me unless you can learn how to be nice to people okay?
#arma3_scripting
1 messages · Page 500 of 1
¯_(ツ)_/¯
@carmine abyss I always feel bad when someone like Dedmen answers me since he's an incredibly capable person who, when helping me, is always wasting his time. Time he should spend on way more complicated shit. But that's just me. If he says your stuff doesn't make any sense, then it doesn't. When he says read the wiki, hell son, go read the wiki. And you would probably get a way better answer if you explained EXACTLY what you want to do, because from your code, i sure can't tell.
well I think he wants to spawn items into 3 crates...
but yeah, that code makes zero sense what so ever
I expected you to tell me why you thought it returning "nothing" doesn't matter. Or that you tell me what you are trying to do.
Sorry that I handle you like most people here who come along with such a pile of pure nonsense code, they don't read wiki, because if they did they'd see by themselves that it doesn't make sense
for [crate1, crate2, crate3] do
This is python code, isn't it ?
Well you guys can stop saying I don't read the wiki because I spend a lot of time on there. I am trying to put 5 pieces of random loot in 3 crates. All crates having different loot. You also seem to not understand that just because something is posted on the wiki doesn't mean I understand it. I am not an expert. I am just someone trying to learn and sometimes it's easier to get an answer with a different explanation from someone else. You seem to be bothered by easy problems. If that's true then don't answer. Instead go gather some social skills you seek to lack and maybe you can then encourage newbies like myself to learn so we can then teach others. Your snarky replies not only don't help anyone, but they turn people away from wanting to learn a tough thing like modding a game like Arma.
no @spark sun
So you read the wiki right?
https://community.bistudio.com/wiki/Control_Structures#for-Loop
https://community.bistudio.com/wiki/for
Why do you think that you can just plug objects into a thing that expects 3 pieces of code?
Granted. You chose the worse type of for loop that exists, which is at the same time also the worst documented one.
But if you just look there. You see a thing. That takes an array with 3 code statements.
You can't just throw apples at a lasagna and expect it to turn into applepie.
The parameters literally tell the for loop
Count from this, until this condition is true, and do this every time you want to go to the next element.
You are trying to tell it
This is a object. Iterate until this object. Do object every time you want to go to next element.
Again. Doesn't make sense.
The answer to your question is. Stop using that type of for loop. Forget that it ever existed. It's the purest pile of shit that you can imagine.
Even if you someday figure out how to use it. It's still worse than all alternatives that you could use.
do i add that systemchat eventhandler the same way as others? im a little confused
_index = _object addeventhandler ["cba_events_chatMessageSent", {
params ["_message"];
/// compare string _message with bombcodestring
}];
?
damn
not Arma engine events
never did cba events
yea yea was just looking...
so no adding to some object, but running onclients
?
so i couldnt really use them for AI for example, could I?
wll in some ways i guess
hmhmhm
well first ill see if i can get me a message. thanks
thats certainly true ^^
i guess i meant potential other cba eventhandlers that might or might not be useful for AI
Anyone know what particle effect the one is when you hit the ground and it sprays dust up
not a definitive one. It's defined in the material that you shoot on. When you say dust I guess you might mean the default dirt one?
CfgCloudlets >> ImpactDust2 maybe? No idea. Not enough time to find it now
@carmine abyss You still didn't properly explain what you're trying to do. You should work on your communication skills. Maybe if you stop spending so much time on being offended you'll find time for that.
" I am trying to put 5 pieces of random loot in 3 crates. All crates having different loot. " Is exactly what I said. Not sure how can mis understand that. You guys do realise not everyone is at your level of coding right? There is such a thing as being new to something. Not everyone starts off at your level.
Sigh. YEAH YEAH SNARKY COMMENTS. PFFFF.
First, i think in the first like you meant to do a foreach loop, not for. Because you're looping thru an array of elements. The elements seem to be the names you assigned to your crates? Those names should be strings? So you need to put "" around them. I THINK. Your for loop is supposed to run 5 times i guess? Never used that notation.
for "_i" from 5 to 0 step -1 do {
};
That's what i always use. Seems more clear. Idk.
I can't really tell how many items you want and what the chances shall be because your code to do that is totally messed up. but you need to first to the selectrandom stuff, and then do the additemcargo. you're first adding and then selecting nothing, like dedmen said. and that [] spawn _rndmLoot; .... i've got no clue what you're on about. you would need to define something like:
_rndmLoot = { *code* };
[] spawn _rndmLoot;
I think. It's fucking 3 AM.
Those names should be strings? So you need to put "" around them. I THINK. not if they are variable names
Thank you for the explanation @waxen tide, but honestly I joined the discord because I thought I would get friendly advice. Not thrashed because I dont know as much as you guys or my questions arent hard enough for your expertise. See you guys later.
{
for "_i" from 5 to 0 step -1 do
{
private _rndItem = selectRandom ["30Rnd_556x45_STANAG", "SmokeGrenade"];
_x addItemCargo [_rndItem,1];
};
} forEach [crate1, crate2, crate3];
🤔
private _addedItem = remove that and you're golden
oh, right. doesn't return jack.
So is he offended and leaving forever and telling he'll see us later?
Personally i'm offended by the lack of logic evolution manages to pack into a single person.
How about a slightly different approach. Because I don't like for loops
{
private _amount = floor random 5;
_x addItemCargo ["30Rnd_556x45_STANAG", _amount];
_x addItemCargo ["SmokeGrenade", 5-_amount];
} forEach [crate1, crate2, crate3];
you get 5 items. A random amount of magazines, and the rest smoke grenades.
oh so the 2nd param for addItemCargo is the amount 😛 (i didn't even look it up)
Essentially the same thing as the other code "5 items.... ehh... "a random mix of two items and that 5 times"
Yeah.. Can't even verbally explain the other code.
yeah, makes more sense this way around.
I guess mathematically the randomness of mine is very suboptimal.
Not random enough for a mathematician. But good enough for this purpose
i sometimes call shuffle array twice in a row 😱
Not that
More like
Change the chance of outcome based on previous outcomes etc.
like if there are 3 options
and it lands on 1st one 3 times in a row
It can still be random
But it would be boring
Hey can someone help me out with something I'm trying to do
depends if you tell us what it is 😛
so for my server I want it so when you press join the server you skip the lobby(Done) and then a loading screen starts and you are frozen until it is over and after that you can move but I'm not sure how to do that part
Is there a way to turn off all HUD via script?
Will this work if HUD elements are forced in description.ext?
@peak plover that link you sent was that supposed to help?
https://community.bistudio.com/wiki/startLoadingScreen
https://community.bistudio.com/wiki/disableUserInput
Also don't try to crosspost into my PM's. I'm not some personal helper ape, you crosspost, you loose any help from me.
It's also kind of a bad move. Why would you crosspost? Because you think the people that you already asked here are just gonna tell you shit? Why even ask here then?
Also https://discordapp.com/channels/105462288051380224/105781923573456896/422366953269886986 yeah. How about not being a dick to the people that you are asking for help?
Uh? crosspost???
I'm not trying to uh?
and by me saying ^ to "Tennessee" I see why that could be taken in a rude way I was just asking because I have read that and i didn't know if he was sending that to me
I love how he brought something that he didn't know the full meaning to and tried and throw it on me for saying "Hi" to him via PM
How do you deal with recursive forEach? like I have forEach inside forEach inside forEach, mainly asking about the `_x" and if it has to be changed inside the recursive forEach
private _otherVariable = _x
and @still forum Thanks for the links
then use the new name inside the inner loop
{
_containersWeaponsAttachements append weaponsItemsCargo (_x select 1);
{
{magicalCodeUsing forEach _x}
} forEach _containersWeaponsAttachements;
} forEach _source;```
Do I define the private inside the bracket with the magical code?
no
You set a variable to _x
you should do that in the place where _x is what you want
{
_vehicle = _x;
{
_crew = _x;
systemChat (name _crew + ' is inside ' + typeOf _vehicle);
} forEach crew _vehicle;
} forEach vehicles;
I'm trying to call a function but I get error here, a generic error in expression. What exactly is wrong here?
params ["_weaponContainers"];
private _containerWeapons = [[],[]];
{
(_containerWeapons select 0) append ((getWeaponCargo _x) select 0);
(_containerWeapons select 1) append ((getWeaponCargo _x) select 1);
} forEach _weaponContainers;```
I get the error at the forEach. I used a hint and the box does get passed into the function fine.
Hey, is the whole task framework with BIS_fnc_taskCreate and etc. (https://community.bistudio.com/wiki/Arma_3_Task_Framework) global?
What is the use of "!isNil"
tests whether the variable defined by the String argument is defined
! turns true in false and other way around
Ah I figured it out, I was passing a single instance instead of an array.
I'm looking at that link
I get it now thanks Jeroen
where would you define the string at?
How does one use params in a way to add optional arguments while still checking if its a valid input? I know you can use param ["_var",0] but it returns true even if you give it for example ObjNull.
when you use isNil you need to give it a variable, this variable needs to be given in the form of a string
"_var"
isNil "_var"//returns false
!isNil "_var"//returns true```
If I do this
waitUntil{sleep 0.05;```
3 Times will it go through each one and count the time for each?
sleep doesn't "count"
doing that 3 times would be useless as 3 times sleep of 0.05 == sleep 0.15
@unreal leaf you can use params to only accepts object. but nullObj is a object
if you want to check for null you need to do that manually
progressLoadingScreen "number";
that number that has to be between 0-1 thats time?
A progress bar is a bar that shows progress between a start and a end. Between 0 and 1. 0% and 100%
so if the player is frozen
"disableUserInput true"
at the start before the loading screen is starting
and then
startLoadingScreen ["Starting Servers L-S System"];
but during the loading screen how do I automaticly make it stop the loading screen after the mission is loaded?
Well. What does "mission is loaded" mean to you?
meaning all the basic stuff that needs to be loaded when you press the slot in the lobby of the server like the mission file but I'm wanting it to just do it in a loading screen not loading in the lobby if that makes since
You can't
I can't? I have seen a server that you press what slot you want then you load but it skips the loading mission until it shows there loading screen and then downloads the mission
You can do some complicated/clever #arma3_config in a mod to hide the lobby
but not via scripting in a mission script or something
how would I do it via a mod?
You can edit the lobby dialog via config edits.
No idea how you'd hide the "loading mission" or display a loading screen before that happens
I are ready did it where it skips the lobby but what point in skiping the lobby will it download the mission?
I was thinking that it will download it while its showing the loading screen
since it skips the lobby
so the server skips the lobby and then theres that spand that it downloads the mission until you are in is there is there a way to just when the player connects it turns the loading screen on until its done downloading it?
Ok so I have this bit, it works, but there is an issue when a gun is not loaded and the magazine is a null. I tried adding an if but then the whole code just does not do anything and there is no error:
{
_x params ["_primary","_barrel","_side","_optic","_magazine","_bipod"];
_strippedWeapItems_name pushback _barrel;
_strippedWeapItems_name pushback _side;
_strippedWeapItems_name pushback _optic;
(_strippedWeapons select 0) pushback _primary;
_stripedMagazines pushback [(_magazine select 0), (_magazine select 1)];
if ((count _x) == 7) then {
//_bipod here is UGL magazine
_strippedWeapItems_name pushback (_x select 6);
_stripedMagazines pushback [(_bipod select 0), (_bipod select 1)];
} else {
_strippedWeapItems_name pushback _bipod;
};
} forEach _strippingArray;```
The version checking for null
{
_x params ["_primary","_barrel","_side","_optic","_magazine","_bipod"];
_strippedWeapItems_name pushback _barrel;
_strippedWeapItems_name pushback _side;
_strippedWeapItems_name pushback _optic;
(_strippedWeapons select 0) pushback _primary;
if (!isNil "_magazine") then {
{
_stripedMagazines pushback [(_magazine select 0), (_magazine select 1)];
};
if ((count _x) == 7) then {
//_bipod here is UGL magazine
_strippedWeapItems_name pushback (_x select 6);
_stripedMagazines pushback [(_bipod select 0), (_bipod select 1)];
} else {
_strippedWeapItems_name pushback _bipod;
};
} forEach _strippingArray;```
null != nil
what is it? a null type, or nil, or empty string or empty array? all of them are very different
Yes. magazine will not be nil
@still forum ? can I do that?
¯_(ツ)_/¯
i guess no answer
what do you mean?
@tough abyss Top right, toggle textures
I think you can edit the map control as well
@limber rune You are trying to make it so the game goes from the lobby into the game but without the loading?
I don't get it
You want a fullscreen overlay image while it loads?
See how the map is a lot darker?
Is that a mission.sqm thing or is it script thing? (Thanks for your fast response)
so when you press join it skips the lobby and it goes strait into game but I want it so it has a loading screen while the that time when your going in-game there a loading screen
Thanks ill take a look.
I know how to skip the lobby
Right
I'm trying to know how to instead of the lobby theres a loading screen while the mission downloads for the players
I don't think that is possible unless you're moded.
Dedmen gave you an answer before:
You can do some complicated/clever #config_editing in a mod to hide the lobby
but not via scripting in a mission script or something
You can edit the lobby dialog via config edits.
No idea how you'd hide the "loading mission" or display a loading screen before that happens```
Yeah
I know that FacePalm
ok
hmmm ill look at the code and see but from what I know thats the loading screen after you press what slot you are in the lobby
So
You want the game to do this:
When a player clicks join on a server
It starts to download the mission/load the map
Now an image will appear
yes but its not a image it has like a progress bar and idk the logo of the server etc. and the background is what the player your join in as. Like lets say theres a list of 100 Civs slots only and you skip the lobby it will automaticly put you as the first one and go down the list so as the player it puts you as you can see what it sees but you can't move or do anythingdisableUserInput true until the loading screen is done
You can't do anything when the mission is downloading anyway
can I do it before the mission starts downloading like the loading screen starts then the mission downloads
if I have an array that is just empty [] how do I make an if condition to check if it's empty? if (!isNil "_magazine") then { does not seem to work
There is no reason to disableUserInput, you can't do anything anyway when it's downloading.
Use chat and hit esc are like the only things
oh ok
is there any scripting command to return the RPM of a vehicle that isnt a helicopter?
Multiple people asked that over the last couple months
I haven't seen any "yes" answer so far
bummer, thanks
looked into things like animation sources and sound sources. but no joy so far
yes it is
Actually.. Not sure if we talked about non-advanced flight model helicopters. Or vehicles in general
There was also some problem with helicopters and rpm
Woudl that be possible with intercept @still forum
Does anyone know of a way to say basically If (!HC1) exitwith {}; to preface a script, where HC1 is a specific headless client?
sure..... with lots of work 😄
That in itself no
But if you start the HC with -name parameter
https://community.bistudio.com/wiki/profileName you can probably use that
Well, the HCs are already named, but it's still not working. It throws an error when I use the above. I'll read about the profile name, but they already are named in 3Den and can be paged using the names given.
If I go with;
If (isServer) exitwith {};
If (hasInterface) exitwith {};```
Then it runs on every headless client, where the effect I need is to run on one headless client.
It throws an error when I use the above. Yes. That I told you
https://discordapp.com/channels/105462288051380224/105462984087728128/513738870781771776
It throws an error which?
to preface a script which script? preInit?
The script is a function defined in the function hpp.
so how do I do it? lol so the image mod you send @peak plover that is it Kinda but how do set it up so it skips the lobby and then how do I make it do the loading screen no one has told me how to do it thats my main question how do I make it do the loading screen
that doesn't tell me anything
function hpp is not any kind of native game thing
it could literally be whatever
It's loaded from the description.ext? I don't understand what you want to know.
Also doesn't tell me what it is
there a tons of native game things in description.ext and you can script whatever into there too
I want to know what you are using.
And whether it's preInit or postInit or anything special
and how the script is called and from where
The script is called with this from a trigger condition:
[ThisTrigger] remoteExec ["ASG_FNC_GIP1", HC1];```
It spawns an AI group.
Because there are three headless clients, and it spawns the AI group on every headless client.
[ThisTrigger] remoteExec ["ASG_FNC_GIP1", HC1]; but that only executes on HC1
I don't know what you want me to tell you, but when I run that line, the group spawns once for each headless client.
It uses the BIS_fnc_spawnGroup; if that clarifies anything.
If (isServer) exitwith {};
If (hasInterface) exitwith {};
params ["_trigger"];
_Base = (getpos _trigger);
_HQ = [_Base, INDEPENDENT, ["I_officer_F","I_medic_F","I_officer_F","I_soldier_UAV_F"],
[],["LIEUTENANT","PRIVATE","SERGEANT","PRIVATE"],[],[],[],180] call BIS_fnc_spawnGroup;```
That's the whole test script.
So the issue is that your remoteExec command executes the code on every HC. Even though you told it to only execute on HC1?
Correct.
does the trigger execute on server? (server only trigger)
In fact, if I remove the isserver/hasinterface, then it runs on the server and every client as well.
I don't know how to tell where the trigger is executing. If it executes on the server by default, then yes, it's executing on the server. I don't think it's currently a server only trigger, but it may be. I'll check.
No, it's not set to server only.
there is a checkbox in the trigger for "server only"
if the trigger executes everywhere
that means every client (including HC's and server) are now telling HC1 to spawn the group
meaning HC1 is spawning the group multiple times
Got it. That's magic. Good stuff.
which is also why your HC1 condition doesn't change anything. Because the script does indeed only execute on HC1. It just does that multiple times
In fact, for some reason, that's the only trigger I have placed in my whole test scenario without server only checked. That's wild.
Anyway, thanks a ton.
Well, I hate to have to report that nothing appears to have changed after checking that box. It still runs for every client as well as the server.
Yeah, still spawning on everything every time, regardless of if box is checked.
add diag logs to the code.
And also log "remoteExecutedOwner"
to see who remoteExecuted the code
it should only log in HC1's log. And remoteExecutedOwner is probably different for each execution
Forgive my ignorance, but I don't know how to do that.
in your script
diag_log ["ASG_FNC_GIP1 executed", _trigger, remoteExecutedOwner] Just as first line
I think I'm going to have to tell it to log this somewhere specifically, the headless client logs look like trash. I can't even identify the diag log.
just open the logfile in a editor and search for ASG_FNC
How do I get backpacks that are in a box? I the getItemCargo does not return backpacks, I need their classnames and the count
@still forum So how would I setup the loading screen?
¯_(ツ)_/¯
@thorn saffron everyBackpack
combine with typeOf
or is there a backpackCargo command maybe?
ok backpackCargo returns the backpacks one by one, good enough
@still forum ?
You don't know what it means when a human shrugs his shoulders?
-_- thanks for the help
@limber rune, he can't help everyone with everything all the time. In fact, I think he's a bit too helpful, too many of us never learn how to adequately troll the wiki, the information is all there, just requires the time and willingness to dig through everything, then trial and error it all out. You shouldn't be ungrateful because he doesn't have all of the answers. Dedmen isn't the nicest or most patient person on the Discord, but he's certainly among the most helpful. I'm not trying to bitch you out, I'm just trying to get you to take a moment to think about what you seem to be doing.
for such advanced stuff as what he is trying to do. The information is probably not there.
It's a VERY nieche things. And you need to have advanced knowledge about many things to make such a thing
Anyway, @still forum, these are the only relevant logs I could scrape:
From my client/server log:
8:12:16 Error in expression <[ThisTrigger] remoteExec ["ASG_FNC_GIP1", HC1];>
8:12:16 Error position: <remoteExec ["ASG_FNC_GIP1", HC1];>
8:12:16 Error Type Any, expected Number, Side, Object, Group, String```
From the headless client log:
```SQF
8:12:16 ["ASG_FNC_GIP1 executed",6: <no shape>,0]
8:12:16 ["ASG_FNC_GIP1 executed",6: <no shape>,0]
8:12:16 ["ASG_FNC_GIP1 executed",6: <no shape>,0]```
ya google for arma isn't the best
Could it be that your trigger executes before HC1 is done joining?
That's double tough. How good is the search engine for Killzone Kid's blog, haha?
Typically no, I am triggering it manually only after the headless clients have completely loaded and joined the mission. In fact, I don't even start the mission until they are all completed loaded in.
However this one time, I closed them, deleted their log files, then reopened them, and may have beaten them to the punch, but I gave them plenty of time.
Based on the number of AI spawned, I think the headless clients were all fully loaded for even the latest test.
,0] from your logs tells me either there is an error. Aka not remote executed. Or.. Dunno
Short question, how would I use a function, like BIS_fnc_jukebox with remoteExec?
parameters remoteExec ["BIS_fnc_jukebox"]
hmmm
I actually tried that and It didnt work. I guess I just have an syntax error or something.
Thing is though, BIS_fnc_jukebox uses an Array datatype as parameter, and this error contains a string, and then another array
"this error" ?
@still forum, thanks for putting me on track. I'm going to leave it alone for a while, but thanks a ton for the help this morning.
@still forum do you know GUI Classes?
nvmd Dedmen, got it working now.
Guess I just wrote too many [] at some of the tests
¯_(ツ)_/¯
how can hide commanding menu , With showhud in description its bugged and hide addactions too
😦
what is bugging? showhud works fine for me
How do I set up the params so I can later select something like select _weaponCount instead of (taroShopInventoryArray select 0) select 1)
taroShopInventoryArray =
[
[[],[]], // weapon' class names and count [[classnames],[count]]
[[],[]], // magazines' class names and count [[classnames],[count]]
[[],[]], // items' class names and count [[classnames],[count]]
[[],[]] // backpacks' class names and count [[classnames],[count]]
];```
take a look at https://community.bistudio.com/wiki/select Alternative Syntax 5
I tried making this, but it didn't work sadly,
taroShopInventoryArray params
[
["_weaponClass","_weaponCount"], // weapon' class names and count [[classnames],[count]]
["_magazineClass","_magazineCount"], // magazines' class names and count [[classnames],[count]]
["_itemsClass","_itemsCount"], // items' class names and count [[classnames],[count]]
["_backpacksClass","_backpacksCount"] // backpacks' class names and count [[classnames],[count]]
];```
I don't think you can use nested params like that. Is there any reason you're using subarrays instead of just one array with weaponclass, weaponcount, magazineclass, magazinecount, etc etc?
So I have just one global being around
I mean why use
taroShopInventoryArray = [["_weaponClass","_weaponCount"],["_magazineClass","_magazineCount"],[etc],[etc]];
when you could just use
taroShopInventoryArray = ["_weaponClass","_weaponCount","_magazineClass","_magazineCount", etc, etc];
ah the subarays are for recounting the items and being compatible with the addXCargoGlobal syntax
Ah yep. You could easily pull that data out for those commands as needed via select. In a bit of a rush at the moment sorry mate.
With what you were trying to do the first time I think you'd have to
_weapondata params ["_weaponClass","_weaponCount"];
_magazinedata params ["_magazineClass","_magazineCount"];
etc
Which doesn't seem efficient at all.
Yeah, at least the array works, its just a bit harder to read the various selections.
hi guys, so I have a problem.
I want to close a display with a button.
Here is ym code:
private _display = findDisplay 46 createDisplay "RscDisplayEmpty";
private _b = _display ctrlCreate ["RscButtonMenu", -1];
_b ctrlSetPosition [(0.325 * safezoneW + safezoneX),(0.35 * safezoneH + safezoneY),(0.14 * safezoneW),(0.22 * safezoneH)];
_b ctrlSetBackgroundColor [1,0,0,1];
_b buttonSetAction format ["(allDisplays select (allDisplays findIf {_x isEqualTo %1})) closeDisplay 1;", _display];
It says error zero dividor. Is there any other way to close the display on button click?
it says zero divisor because your findIf returns -1 because a display cannot be equal to a heap of garbage
you cannot just "format" things into a string and expect it to work
There are some things that happen to work when you turn them into a string. But they are the exception
solution is to store the display you want on your button as a variable
and then retrieve it again in the code
Don't know where this notion comes from that "format" actually inserts some magic kind of reference to any type of variable into a string
a string is a array of letters. There is no place for any magic variable references. That's not how that works.
okay, thanks. I will store it temporarily as global var
can i not pass arguments wen i add an ace eventhandler somehow?
for some reason i dont like gobal variables
Anybody know why this isn't working?
waitUntil {!alive _Vehicle};
{
_Vehicle = vehicle _x;
_x action ["Eject",_Vehicle];
[_x, true, 99, true] call ace_medical_fnc_setUnconscious;
Sleep 3;
_x allowDamage true;
} forEach _Passengers;
If I test with _Vehicle setDamage 1 and _x setDamage 1 it works properly
@radiant needle yes, waitUntil {!alive _Vehicle}; first line: _Vehicle is not yet defined!
tick "show script errors" in A3 launcher options for easier debug
sorry, that wasnt the whole script I pasted
_Vehicle is defined prior and does read out correctly when I do systemChat str _Vehicle
don't re-define it… also, is _Passengers var defined?
pastebin your whole script plz
null = [(_this select 1)] spawn {
_Vehicle = vehicle (_this select 0);
_Passengers = fullCrew _Vehicle;
Sleep 10;
_Vehicle allowDamage false;
Sleep 1;
_Explosive01 = "DemoCharge_Remote_Ammo_Scripted" createVehicle position _Vehicle;
_Explosive01 attachTo [_Vehicle,[5,4.25,4]];
_Vehicle setDamage 0.75;
_Explosive01 setDamage 1;
_Fire01 = "test_EmptyObjectForFireBig" createVehicle position _Vehicle;
_Fire01 attachTo [_Vehicle,[5,4.25,4]];
Sleep 0.75;
_Explosive02 = "DemoCharge_Remote_Ammo_Scripted" createVehicle position _Vehicle;
_Explosive02 attachTo [_Vehicle,[5,4.25,4]];
_Explosive02 setDamage 1;
_Fire02 = "test_EmptyObjectForFireBig" createVehicle position _Vehicle;
_Fire02 attachTo [_Vehicle,[10.15,4.25,4]];
Sleep 3;
_vehicle allowDamage true;
systemChat str _vehicle;
waitUntil {!alive _Vehicle};
{
_x action ["Eject",_Vehicle];
[_x, true, 99, true] call ace_medical_fnc_setUnconscious;
Sleep 3;
_x allowDamage true;
} forEach _Passengers;
deleteVehicle _Fire01;
deleteVehicle _Fire02;
};
also, sleep is wrongly placed
@radiant needle use pastebin.com next time plz (keep this one here)
It's executed through ares achilles by clicking on the plane
that's what (_this select 1) is
also what works, what doesn't?
So the plane goes boom, receives the damage, but upon crashing it says type array expected object on the _x action
Systemchat is saying B ALpha 1-3:2 or whatever
also for info, nowhere in your script are the passengers allowDamage false so they may die with the additional explosions (unless it is done in another script)
Doesn't seem to be working
→ what is the issue? the error message? the bug?
No error message, but they are not being removed from the vehicle and set unconscious
and yeah I was setting allowDamage manually, but I can easily throw that in the script
Maybe if I try vehicle _x in the action
instead of _Vehicle
well, at least it reaches your code =)
just use _vehicle, don't redefine it
So I tried with (Vehicle _x) just incase and it still doenst work
So I have this for my script
and it runs through all the dismounts
but yet they stay in the vehicle and dismount 1 by 1 slowly
and aren't set unconscious
any scripts that prevent a vehcile from using certain ammo types? like disabling AT rockets for LAVs
So the problem seems to be with the eject action, beacuse if I replace it with setDamage 1 they do all die
@tulip hare removing a vehicle weapon's ammunition works, so long as there are no ways to rearm. Forgot the commands for that, though.
thank you I didn't know what to search in google.
Yeah this is definitely and issue with the eject action
No code errors though, it just doesnt eject them
Seems getOut works
@radiant needle instead of using eject
You can use setpos
just set them right under/next to the vehicle
I actually used getOut and it worked as it did before
Seems like their behaviors got switched sometime between when I last used the script
@radiant needle https://community.bistudio.com/wiki/action
Does anyone know of a better, less laggy way to implement walkable vehicle interiors? Ive tried WMO but wondering of there is another option.
It's where you can walk around in a moving vehicle. Specifically the moving part.
oh like the thing in ace where you can move the tire to repair the vehicle?
oh
ok thanks for explaining that to me
isnt another way is if your ping is like 0 to the server lol
lol
wasn't this question supposed to be ask at #arma3_questions?
Hi guys. Do you know if arma can handle a simple object as the target for remoteexec ['function',>>target<<,false]?
yes, it has ot be local to some machine
remoteexec ['function',>>target<<,false]
ok i recon that the simpleobject can not be a source for remoteexec target comand, so i decided to pass the owner in a global object variable:
_trench setVariable ['pzn_trenches_owner',clientOwner,true];
How do you think, guys, is there any gains in terms of network optimisation instead of just making regular createvehicle and make it not damagable?
Hey guys, i got kicked because of reasons.. so my post is gone as well :P
I asked if there is a way to disable the debug messages that pop up in the middle of your screen, specificly talking about VCOM in combination with other mods, since i am trying to record videos, it gets rather annoying.
Thank you!
run the game without showing script errors
how do i do this? 😃
remove the start parameter "-showScriptErrors"
So just to try out and see maybe someone from Achilles is here, but the issue is these boxes which are script errors, but they are disabled as default so Achilles is enabling them somewhere, anyone knows more info about this? https://cdn.discordapp.com/attachments/514044867564011530/514047219004080138/unknown.png
That happens at the start when you first load in
give me a sec to look into it ill see if i can help you
debugMessages.sqf?
@molten imp If I'm right it mite be the sqf
debugMessages.sqf
thanks mate appreciate it, so i experimented a bit, and when i call in a gun Run, with certain airplane types this error occurs 😄 however after figuring out which planes i can use and which not, this is not a big problem for me anymore 😃
can i not pass arguments wen i add an ace eventhandler somehow?
@proven crystal You can pass arguments to CBA eventhandlers. Don't know what a ace eventhandler is supposed to be.
@molten imp don't run in editor. It force enables showing script errors.
i meant the CBA one
do you really read the entire chat here? i mean that question was a while ago. just wondering, thanks a lot though.
so to get the eventhandler on th eclient i run
fez_bombcodeentry = ["cba_events_chatMessageSent", {
["cba_events_chatMessageSent", fez_bombcodeentry] call CBA_fnc_removeEventHandler;
params ["_message"];
blabla
}] call CBA_fnc_addEventHandler;
so it removes itself after it fires
how could i pass that eventhandlerID into the eventhandler without a global variable?
fez_bombcodeentry
so i can keep it a private variable
there are a few others that i want to pass to that EH too
CBA_fnc_addEventHandlerArgs
you already get the eventhandler ID as a variable inside the handler
ah wunderbar
yea nice that will do. many thanks
Can someone make a script that when a city is attacked the IDAP intervenes by sending ambulances and supplies? It will be very cool because of IDAP don't have a real sense in the editor
It is easy, you just change this line and it will work until the next error
When doing multiple animations do I still use the [this, “animtype”, “none”] call BIS_fnc_ambientanimation
No
You can use playMove, etc if you wish
playMoveNow will cancel all previous animations though. See Wiki for more info.
What do you mean?
How would I go about setting up an xp and money system that can be used to unlock and buy guns, vehicles, etc?
You start from scratch. And build it
I don't know what you are trying to ask
what you are asking about is a multiple hundred line system with maybe UI's added onto it too.
It's not a simple 2 minute "how" job
Unless you wanted examples of basic math to add/subtract and booleans to check if someone has enough dollarydoos
(I really just wanted an excuse to use the word dollarydoos)
dollarinoes
@civic oyster set up functions for transactions and keeping money
I made variable names based on playerUID and use server to change anything with the money
Players can access that variable but I never change it from anything other than the serve
When I want to buy something, I save the code I want to run when transaction succeeds on the client and ask server to make the transaction
If the transaction succeeds then the server will return the transaction id and client will run the code
@pure blade sorry for not answering u... I was busy...
how can hide commanding menu , With showhud in description its bugged and hide addactions too
addactions hide too
when u set to true hide commanding menu
Is it better to make loops using CBA_waitandexecute or via the scheduler?
I've seen that ACE doesn't use spawn but that instead.
A looping function every second, that's it
although, it then also depends on how many you have.
But you say one. So scheduler.
If you don't care that it also takes 2 or 3 seconds sometimes
And if I need lots of them?
The precision doesn't matter, it's more about performance
scheduler goes through all scripts to check if their sleep timeout is over. It does that VERY fast as it's all directly in engine code.
CBA sorts the entries once. And then only iterates so long till it finds a function that shouldn't yet run and then stop.
Meaning cba only checks atmost 1 single function per frame of the functions that should not run, whereas the engine checks all of them.
CBA checks are in SQF tho and thus much slower than the engine side scheduler stuff, but it checks less scripts. And CBA also has to sort them, and the sort time depends on the amount of entries.
So the answer is: it depends.
But I'd say go with scheduler if you don't care about precision
alright, thanks!
Is there a way to detect a grenade explodes via like event handlers?
scan for #explode entities? :3
Do you just want to check whether any grenade exploded or a specific grenade? @warm hedge
A specific, like the thing I just thrown
You could try if the Fired / FiredMan EH fire when throwing a grenade (https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#FiredMan)
access the "projectile" via the EH
Ah no worries, I know how to get the object
and as far as I know most explosives explode by setDamage 1 so adding a Damage EH to that would maybe be a solution
not sure if thats true for grenades tho
and i don't know if the EH even fires for explosives
but worth a try I guess 😄
Something I've been wondering for a while: why does "AttachTo" always cause the vehicle/object to move slightly when automativally getting the offset? Does it round the pos/axis values? It's incredibly annoying to attach something perfectly, only to have it rotate just right of center.
Tried with both of "Dammage" and "HandleDamage" but looks no luck
don't know why it shifts but have you thought about "calculating" the offset yourself @eager prawn ? maybe via vectorFromTo(https://community.bistudio.com/wiki/vectorFromTo)
@warm hedge 🤔 maybe wait until it's equal to objNull?
I have but I don't want to 😂
@eager prawn 😂
well I guess you don't really have a choice 😅 if you want the object to stay exactly where it is 😄
It worked, but I gotta do some tweak to get the position. Thanks @tender root !
np 😊
Quick Questions: Do i have to name my function-script-sqf's "fn_name.sqf"? A tutorial did not, two did. One was old, two were older.
so if i would use the functions just to do my biddings, i dont have to use fn_?
CfgFunctions requires that naming (except if you set the filename manually, which you can afaik do?)
If you do anything by yourself then the name doesn't matter at all. You might aswell have Nar_fnc_MyFancyFunction inside WhatDoICareBoutNaming.Trololol
@still forum is there any thing I can read to do this or is it something that I just have to make
Second one I guess
or try to look in some Life/Exile code as example
especially life mods have lots of such stuff
Thakn you a lot @still forum helps. So, for matter, to finalize it for myself to understand it, if i use cfgfunctions (what is shown in the tutorials) i am forced to use fn_ names, when i dont use the "features" of cfgfunctions, i can do whatever me pleases?
Both things arent really too relevant but i guess functions are a alternative to dozens of sgf files doing the same thing over and over again
yes yes
alrighty, thanks agin ^^ i watched many tutorials and read a lot about functions. Still was bit unsure because many never mentioned it clearly what you have to do and what not ^^ Glad i got here 😃
hmm im messing around with particles for the first time. how can i make them move with the wind
?
have a script here from armaholic and trying to figure out how it does what it does
patches of fog. there seems to be one type, which has movement, the other is rather static
and what does bounceonsurface do?
means if the particle goes through water if I recall right
there should be at least partially commented particle info pack somewhere on the wiki
And possible in the Arma3 configs too
Anyone knows any method to change strings for https://community.bistudio.com/wiki/DialogControls-Toolbox
😦
I don't see anything here
so I don't think so
Why don't you just create some buttons?
How do I take the output of that function and load it into a crate/vehicle with every weapons attachments?
I cant seem to figure it out
There is no return value for addWeapon so I cant get a reference to the object to be able to add the attachments in a loop
Worse case scenario I could just put the attachments in as items but it'd be nice if they load on the weapon
There’s no way to directly add attachments to a weapon in a container
Untrue, but I'm not sure if it's accessible from the editor. (RHS AKs often have DTK attachments preinstalled, for instance.)
Problem is it cant be from editor
well actually if it works in editor it probably works in script
no @ruby breach
You can create a unit
and add the weapon to him and the attachemnts
And then make that unit drop it inside the container
Is it possible to make him invisible?
yes
yeah u can just create the unit on the server and hideObject the unit
[_unit,true] remoteExec ['hideObject',-2];
Sweet
Do you believe there will be any significant performance issues with this?
or nah
It will take some time
And probably not compared to other things that will affect performance
The unit dropWeapon action
takes like a second or sth
because he has to do the animation
ah ok
I would just put the attachments in the container
If anyone wants them they can take them 1 by 1
Ever played the most popular game on steam?
PUBG also does this, when you kill someone, the attachments fall off
No problem
@peak plover You didn't read. There’s no way to directly add attachments to a weapon in a container
Yes, spawning a unit and all of that will work. But it's still not an addItemToWeaponCargo command (or would it be addItemToCargoWeapon) 🤔
I don't deal in absolutes.
Where there's a will, there's a way
My mind must have slipped and I just ignored the part where it said no
^
It works 🤷
Anyway I can tell when the unit is finished with an action?
That way I can delete him
Nevermind just threw in:
deleteVehicle _unit;```
Arma 3 Inventory system at its best 😄
Added stuff like attachments to the arma series over five years ago... still no functions / commands for scripters / modders to use them properly
@high marsh and now try to add a weapon (including attachments) to a cargo container
not as a unit's primary weapon
if you want to add a weapon with attachments to the players backpack / vest / uniform you can use setUnitLoadout although that command is broken aswell 😅
adding a weapon with attachments to any other container is straight not possible
and letting a unit drop its weapon into a container is imo no solution. More like a "hacky workaround" 😅
So you've come to complain?
Hi guys. What is preStart, preInit, postInit. Please explain. I read Wikipedia but didn't understand anything(. What starts first. Explain the boot order.
@inner swallow I read Wikipedia but didn't understand anything
and then read https://community.bistudio.com/wiki/Event_Scripts
well, that's not wikipedia
but i assume you mean the BI wiki
did you read that link? because it explains the boot order
then if you read the event scripts page, it explains what each of the files do
The first link @inner swallow postet has the exact order 😄 wont get much clearer than that
and preStart is just as it states on the Function Library Page called upon Game Start
1 to call the function upon game start, before title screen, but after all addons are loaded (config.cpp only)
Anyone knows how to get vehicles seat names(pilot, driver,commander)?
I only need them if they contain a turret. So no back seats
Not sure exactly what you need
But fullCrew with the “turret” param might get you close
@unreal leaf what do you mean by "seat names" ?
driver gunner and commander are special, they have their own commands for putting people in them
you can isKindOf to find out if it's air
Hello, i'm trying to create tasks through the taskCreate function, and attach it to objective module(so zeus can edit it). I got it working, but i got a display issue, the logic at first doesn't update the description/title in the GUI, it only does after zeus sets it after, i mean it's a minor issue, but would be great if anyone knows a way to update the logic.
case "s_task":{
_block params["_state","_desc","_pos","","","_type",""];
private _logic = _logicGroup createUnit ["ModuleObjective_F", _pos, [], 0, "NONE"];
[_logic] call SHR_fnc_addObjToZeus;
[side shr_curator,_varname,_desc,[_logic,true],_state,0,false,_type]call BIS_fnc_taskCreate;
//[_varname,_type]call BIS_fnc_taskSetType;
};
Hello here.
Is it possible to edit existing diary?
Which dairy would you like?
Skim? Cream? Half/half? Whole?
And now?
lol
@still latch don't mind those guys 😅
I don't think it's possible. But I havent worked much with the diary yet.
@tender root it's very possible
But what you have to do
Remove record and make new one from same format
This is obvious. How to read existing entry?
i have a moment of confusion, how do i make sure that i add an eventhandler to all players on mission start?
initPlayerLocal?
[player,["FIRED",{
_shooter = _this select 0;
}]}] remoteexec ["addEventHandler",0,true];
yea initplayer local would be a way but i have it all sort of bundled somewhere where things will only execute on server at mission start
😦
that will never work
or does it?
you want to add the EH to one specific unit? not every player?
Wait
execute on server? yeah will never work
you are sending over the value that the "player" command returns. Which will be nullObj
you probably want to execute player command on the receiver side
i launch all my stuff through one line in the initserver. most things do run server side
Why
initPlayerLocal is bundled in mission. Just use that.
Yeah exactly
A remoteExec at mission start (beyond the problems originally stated) would not work on players that join late either way.
i have a slightly messed up idea
I do too
🤢
but at one point i would like to make this a server side thing and i would like to keep it in the one line to run the whole pack :(
@eager prawn thanks. Nice to know.
@proven crystal publicVariable the function /s
or just remoteExec the whole code via call or spawn
save your code into a variable (function) and then remote exec that
COOKIES 🍪
I'm sure that you can build a system which saves functions into the profilenamespace
Make it with version managment
functions -> profilenamespace ==bad
┬─┬ ノ( ゜-゜ノ)
When you join server
Grab list of functions required from server and versions
See if you need any new ones and publicVariableClient the ones that need updating
Before asking for the new ones, check profilenamespace
hmm
but I guess that can be abused
minute is over.
yes.
that is probably the easiest way
@peak plover why just not store them client-side?
if you care about thieves, you can obfuscate the mission. it will make it very tidious for someone to recover it
nah that was a stupid idea
The best way is to make the functions and publicVariable them from the server
I'm thinking more along the lines of someone would edit the profilenamespace and change the functions to do malicious things
You could hash them to check for validity (serverside ofc)
but really.. not a good idea to begin with
How
send the function from server to client. To store it in it's profileNamespace.
And then always send the function from client to server to check that it's right..
Sure. but.. why? Why so ultra overcomplicated? Just keep doing it how it's been done for years
No need to reinvent a wheel with sharp corners instead of curves
can server side addon call a mission object by its variable name?
yes
im trying to apply an addaction to an object from a server side addon. i set he object var name in the mission file. can someone provide an example on how to do this? referencing the object by its var name isn't working.
in your serverside addon
Check for the variable
waitUntil {
!isNil 'ten_car'
};
call ten_fnc_car;
in debug console
// when looking at a car (local exec)
missionNamespace setVariable ['ten_car',cursorObject,true];
thx mate
Anyone ever made a circle that can fill up on the ui?
_ctrlMap ctrladdeventhandler [
"draw",
format [
"
with uinamespace do {
_map = _this select 0;
if (time > uinamespace getvariable ['RscMiniMap_refreshTime',0]) then {
_display = ctrlparent _map;
_ctrlGrid = _display displayctrl 1002;
_ctrlGrid ctrlsettext (mapgridposition vehicle player);
_ctrlTime = _display displayctrl 1003;
_ctrlTime ctrlsettext ([daytime,'HH:MM'] call bis_fnc_timetostring);
_ctrlHeading = _display displayctrl 1004;
_ctrlHeading ctrlsettext str (floor direction vehicle player);
RscMiniMap_refreshTime = time + 0.1;
};
{
_map drawLine [position _x,position player,%1];
} foreach groupSelectedUnits player;
};
",
/* %1 */ _colorSelect
]
];
🤔
Wouldn't make sense to send the whole function back and forth
It would be easier to check the size or sth like that
To accuse me of stealing this person would have to prove that my code is the same as his 'tho
He wouldn't have access to my code in any way that could be used as proof
does
with namespaceBlah do {
_var = 1;
}
set var as a valid variable to retrieve from nameSpaceblah?
I need to make not major wounds to not reopen in ACE Medicine. Does anyone has any expirience in modifing ace? Is it even possible to rewrite some of it's functions by custom addon?
Yes it is. I added several functions to ace by adding a mod ontop of unmodified ace. such as tons of tweaks to the medical menu and making tourniquets show up. Your starting point should be the treatment actions, there the callback function is defined. you simply high jack this config entry of the function for bandaging and run your own code instead of aces.
great, thanks
if you need a pointer in which variable to look for the bandaged and possible reopening wounds, take a look at the unit using
_unit getvariable ["ace_medical_bandagedWounds",[]]
// returns array of bandage informations (these are not ordered!)
// [ID, classID, bodypart, percentage treated, bloodloss rate]
got it!
@high marsh you know how local variables work right? So you know that, that can't be the case
well local variables are not in any namespace
so it doesn't matter if you have a with..do
Stored in memory?
Right
you can use setVariable to set variables with underscores at start to a namespace
but you can only retrieve them with getVariable
Right. That all makes sense. But why would you ever need a with namespace do control structure?
If you want to save all your variables in uiNamespace, but don't want to write set/getVariable everytime
Ahh. I see. This is what I was curious of, good to know.
Does anyone have any of the good old "Hill climb gear" scripts laying around? I miss being able to go up a hill without having to speed up like Evel Knievel.
Can I have a little advice here in regards of how to create a proper mod structure?
https://github.com/CoopR-Mod/CoopR-Altis/tree/refactor/separation_mod_mission
Please see this branch. I try to extract my mission script code into a standalone mod. Therefore I created the addons/myTag_component/ layout. In the root dir I have reusable macros and constants defined in variables.hpp (I know stupid name, subject to change), testing.hpp and debug.hpp for instance. These need to be available in ALL functions. Do I have to #include them at every script files top lines? Or is there a more convenient way to bring them in as aspects to all functions/scripts?
Do I have to #include them at every script files top lines? yes
If you look at CBA or ACE. You will see it in every single script file
It's usually more convenient to just put a "script_component.hpp" (that's what it's called in CBA/ACE/TFAR/ACRE) into your scripts folder with the content
#include "..\script_component.hpp" that way you don't have to worry about the ..\'s in your script files
Hey guys, a little question, when I try to show the result of the "distance" command, I have nothing, like if the function doesn't return anything, am I blind with something with this command ?
https://community.bistudio.com/wiki/distance
what's unclear? Show us your code.
metter = player distance object;
hint toString[metter];
_metres = player distance object;
hint format ["%1", _metres];
Yeah I tried with something clean, but the problem isn't to show this value, it's to use it in a if.
make sure "object" is not nil. Also that is a really bad global name, you should tag your globals with some prefix.
if (player distance object > 50) then {};
if the player is further than 50 metres away it returns true
Ok, I'll explain better, I want to execute something only if a unit is close enough to another one.
@still forum
regarding mentioned mod structure context: #include "\z\ace\addons\main\script_mod.hpp"
Is this an ACE fancy thing or valid for basic arma3 mods as well? I mean is z referring to the root when I use this in my non-ACE mod ?
replace the > with <
that would make it if player is closer than 50 metres it returns true.
@frigid raven
inside ACE $PREFIX$
"z\ace\addons\cookoff"
So I had roughly
if (unit1 distance unit2 < 3) then {something};
yes, that's functional. If unit1 is closer than 3 metres to unit 2 it returns true and runs "something".
And this something wasn't executed
Well, did you run it before (unit1 distance unit2 < 3)?
But when I put a else... Thé code un the else don't run...
How do you run this code?
I replaced every instructions with hint, for thé debug.
In thé init field.
Of my units.
Show us your code. I can't help you unless you upload that somewhere. Preferably in a spoiler or some way that doesn't spam this chat.
```sqf
<code>
```
wait, sqf is supported?
no. i just made this up. sqf ofc isn't supported. and if you even TRY to use this, your pc will explode and shrapnell will kill you.
if (sqf) then {systemChat "SQF"} else {123};
that's it. you're ded.
M'y computer is off, I'll show you something a bit later
Ok. go to https://forums.bohemia.net/forums/forum/154-arma-3-mission-editing-scripting/ and search for what you need. If you can't find it go ahead and make an account then a new post.
The format of the forums are better for this type of stuff compared to discord imo.
I'll check your link, but it really looks like the fonction returns nothing, and all I saw during my researches don't tell my syntax is false.
So I think I'm juste forgeting a stupid little detail.
@frigid raven if that's your prefix. then that will work for you too. If that's not your prefix. That won't work for you
Has anyone ever made a circle that will fill up UI element?
Why is HandleDamage EH selection reporting so broken?
HitPart works wonderfully, but HandleDamage just spits out same selections (head,body,legs) EVERY time. on vanilla.
Am I missing something there? ACE is using HandleDamage AFAIK, and it works fine
// Deal with the new hitpoint and selection names introduced with Arma v1.50 and later.
// This will convert new selection names into selection names that the medical system understands
// TODO This should be cleaned up when we revisit the medical system at a later stage
// and instead we should deal with the new hitpoints directly
_selection = [_unit, _selection, _hitPointIndex] call FUNC(translateSelections);
_this set [1, _selection]; // ensure that the parameters are set correctly
// If the damage is being weird, we just tell it to fuck off. Ignore: "hands", "legs", "arms"
if (_selection != "" && {!(_selection in GVAR(SELECTIONS))}) exitWith {0};
it does sth like this w/ selections. does that fix anything?
what do you mean with "spits out same selections", its normal that handledamage triggers multiple time on one bullet hit
uhm yeah, but it spits head,legs,body when the bullet clearly hits the leg
what I want is to get is a precise name of what selection got hit by the bullet.
HitPart gives me that, but it works on the shooters PC.
I know, but
While you can add "HitPart" handler to a remote unit, the respectful addEventHandler command must be executed on the shooter's PC and will only fire on shooter's PC as well. The event will not fire if the shooter is not local, even if the target itself is local. Additionally, if the unit gets damaged by any means other than shooter's shooting, "HitPart" will not fire. Because of this, this event handler is most suitable for when the shooter needs feedback on his shooting, such as target practicing or hitmarker creation.
but normal you don't have only one part that got dammaged, mostly are twice or more parts are dammaged with one hit
@pure blade I refuse to acknowledge that if I shoot someone in the foot, he gets a hole in the head.
I need precise information about WHICH part got HIT by the bullet, not DAMAGED
// remoteExec the hp update to the target
[_unit,(-_totalDamage),true] remoteExec ['health_fnc_hpUpdate',_unit];
private _hp = _unit getVariable ['unit_health_hp',5000];
_hp = _hp - _totalDamage;
if (_hp < 1) then {
_unit setDamage 1;
if (!isNull _killedBy) then {
_unit setVariable ['unit_health_killedBy',_killedBy,true];
};
};
hitPart works fine for me
Yeah... guess I will need to use that and broadcast the "holes"
search the part that got the most damage
@pure blade HandleDamage doesn't give precise information
there is no rightleg, leftleg
only legs
hitPart has 3 parts for each leg
yup, and thats wonderful and what I need!
it also gives you _position
@peak plover how do you add it to all units?
CBA
["CAManBase", "HitPart", {_this call health_fnc_onHitPart;}, true, [], true] call CBA_fnc_addClassEventHandler;
And it runs on init of every player?
runs in postInit for everyone
including server/hc
If you don't use functions you can just put that in init.sqf
yes
Alert! classical question incoming. Sorry I was not able to find wiki or docs or google results for it because I am dumb. I want to test my mod without packing it - so I can make file changes while I see bugs etc.
I think I remember it is rather trivial to accomplish that - but couldn't figure it out as always
-filePatching
and put your modfolder directly in arma folder
so when your prefix is "test" have a "test" folder in arma folder next to arma3.exe
then it will load scripts from there first. before loading from pbo
you still need to restart mission tho to recompile funcs I think
yea am used to that but thx gonna try that asap
and god beware u lied to me... god beware
afaik you still need to pack it. But it will load files from folder instead of pbo
wait
still have a packed @naive oak folder in armas addons folder?
Or the one besides arma3.exe should contain unpacked AND .pbo files?
"@mod\addons\test.pbo"
and test\config.cpp
ok got it
fuck I already said ok got it
how to ask another questions without drawing wrath onto my humble person
throws wrath
Would someone be able to help me? CODE: https://pastebin.com/GPZcHLmV
I have a loop.
I need something to only run once, at the start of the loop. // !!!!!!!!!!!! This to only run on first pass.
I need something to NOT run for the first pass and then TO run indefinitely. // !!!!!!!!!!!! This doesn't exist, until after the first pass.
If then else with an iterating variable
I was thinking of an _i count.
_forEachIndex
it's a while loop @pure blade not forEach
and why you don't run code directly in front of the loop?
Because It needs to be within the loop, for it to happen continuously. As it applies to something inside the loop. I cannot have it outside.
create an integer outside and count it up inside?
_i = 0;
while {true} do {
_i = _i + 1;
};
You can define the lights outside of the while loop
What do you mean by
it needs to be within the loop
yeah do it so
I sorted it.
or if you don't need the index you can create simple boolean firstrun
create the variable local in the spawned script handle
What variable
Hey guys! I AddonBuilder won't build my addon because it cannot find the path defined by $PBOPREFIX$. There is a screener of the folder structure incl. the hpp/cpp files https://imgur.com/a/o8UcbFs
I tried to find a typo but not luck
Anyone know why passengers are still dying?
https://pastebin.com/pwy5CkLv
And not becoming unconscious?
Because you don't move out the units till the vehicle is destroyed
Also MP syncing time probably doesnt help either, like the unit might technically still be in the vehicle for a little bit, so keep that in mind when you just move the allowDamage line down
I added this
null = [_x] spawn {Sleep 10;_Passenger = _this select 0;_Passenger allowDamage true;};
and it still has issues
units will get messed up if you kill the vehicle they are in either way
move out the units first, only then allow destruction of the vehicle
Shouldn't they survive if allowDamage is false?
ALso i highly recommend you stay away from getPos/setPos combos, the setter and getter don't work the same way, use something like setPosASL/getPosASL instead
Does getPosASL allow the alt syntax?
no, but math works wonders
like if you're on top of an object (lets say a pier, could be realistic sceanrio with your script), then getPos will return 0 height
but setPos will put you at 0 terrain height instead, which will be inside said pier
Also it seems like the passengers are not becoming unconscious
@digital jacinth
I added several functions to ace by adding a mod ontop of unmodified ace. such as tons of tweaks to the medical menu and making tourniquets show up. Your starting point should be the treatment actions, there the callback function is defined. you simply high jack this config entry of the function for bandaging and run your own code instead of aces.
Is that some public project? Sounds very interesting.
Ha I found the issue, they were unconscious, animation was just glitched
@waxen tide https://github.com/acemod/ACE3/pull/6681
it's gonna be in the next ace
Ace is a public project
check his github
maybe something there
thx
Is there a way to retrieve a boolean from a config?
Found this:
Use getNumber to get boolean values from a config file. 1 equals true, 0 equals false and if no value is found (when a valid variable is undefined) 0.67 is returned.
Do you need to define that 0 equals false and 1 equals true somewhere?
Is there a way to use nearObjects with multiple classes
@vivid locust Not really
private _result = getNumber (<CONFIG>);
if (_result == 1) then {
systemChat 'Result was true';
} else {
systemChat 'Result was false';
};```
That's how one would use it
Iirc config doesn't even support a Boolean type
@radiant needle No, u can use https://community.bistudio.com/wiki/nearestObjects instead
@chilly wigeon yeah, I guess people just use 0 and 1 instead 🤷🏻
or string
@radiant needle either filter nearestObjects for the classes you want, or compare multiple uses of nearObjects
Anybody can help me out with the AddonBuilder? https://i.imgur.com/4U7E5t6.png
I would like to pack my different addons but am unable to, since they all refer to the core addon. I did not figured out how to tell where dependencies lie
@waxen tide the tourniquet stuff will not be in the next ace update but th eone after that, Check the milestone it is attached to
The are more changes which are tailored to the group i made it for
Blood bags carry more volume and the apply time is shorter
bandages across the board have the same healing values
PAK is heavier
Epi now works kind of like the epi in basic
medical menu is changed that you do not click on any body part, but you are dynamically presented an action to bandage a limb that is bleeding, tourniquets will be applied "smartly" as in applies to the limp that is bleeding the most.
Basically the whole thing is to simplify a few things and tailored to less "medical downtime"
@frigid raven either disable binarize or change the include to #include "..\core\script_mod.hpp". It is giving you that error because its processing the include when packing the pbo instead of when you load it to your game, so it doesnt know the prefix.
@frigid raven P-drive?
Also stop the spam please
It probably can't find the include because you don't have a p-drive setup.
It looks for the file at P:\x\coopr\addons\core\script_mod.hpp
Also afaik your prefix shouldn't have a leading \. Just like ACE/CBA
@still forum
First of all, sorry for the spamming.
Aye the P-Drive thing again - did not thought about that before.
Well the leading \ I thought it is a convention therefore I applied it
for #include yes.
for pboprefix no.
The root filesystem starts at \. Thus if you wanna include from there, you gotta put that down.
But your mod path is made up of root+prefix+path inside your pbo.
thus you'd have \\x\coopr\addons\core
double backslash at start. As root already has it
alright got it
do i have to re-add "respawn" eventhandler after a unit has respawned?
i seem to be loosiing fired eventhandlers, when i respawn, so i figure i need to use a respawn evethandler to add my fired eventhandler, but then hao about that respawn eventhandler?
It should stay. I never had the issue that it is gone after a player Respawned
the fired or the respawn eh?
or both?
thing is i add the EHs to the units on mission creation. so its not happening locally.
i think somewher it says that some EH stays, when it is locally added
Is there a way to add an event handler when player pushes a button mapped to a specific action (like salute, sit, etc). Something like this one, but in an event handler form?
https://community.bistudio.com/wiki/inputAction
you really only have the keyDown EH
but you cannot check if the key belongs to a inputAction
This looks promising: https://community.bistudio.com/wiki/actionKeys
Then use the keyDown EH
Problem is, I'd have to update it if player remaps his keys in game... still better than nothing
but you cannot check if the key belongs to a inputAction
Read the first note on the bottom of that page. AND the second.
CBA keybinds are very nice
CBA keybinds are really the only option you have. But they only work for custom keybinds. Not to detect vanilla ones
could you not just use the same keybind to fire 2 commands?
you could bind it once for CBA. and again for the vanilla key.. But.. That means the user has to do very specific things for your mod/script to work
Oh I see the problem with the bit fields and modifiers as well... it's pretty dammaged
Is it any problem having the same class definitions for CfgFunctions and CfgPatches ?
class CfgFunctions {
class coopr_character {
file = "x\coopr\addons\character\functions";
class createCharacterState {};
and
class CfgPatches {
class coopr_character
{
// Meta information for editor
Both have coopr_character but in different scopes right? Shouldn't be a problem in my eyes
ok thanks - one step clother to the final solu... ehm... goal
Okay last question before I get drunk. I managed to have my .pbo loaded and could access 3DEN. Now checking for my functions in the Function Viewer I acutally saw the function names but they had no functions body - empty preview of the scriptcode.
I double checked everything for typos and such but could not find anything suspicious in my eyes.
Here is the specific addon I am testing with: https://github.com/CoopR-Mod/CoopR-Altis/tree/refactor/separation_mod_mission/addons/core
config.cpp seems fine for me and so does CfgFunctions... what else could I've been missing out here?
did you check putting the function name into debug console watch field to check if the variable has been set?
did you check RPT for file not found errors?
#1 I thought what the watch field resembles the same the function viewer yields?
#2 Nope will do now
A mod could break the function viewer. I've done that in the past ^^
well I only have my mod and CBA loaded...
this is the result - I don't get why the display is broken
do you only have the core pbo? do you have things that modify ui things?
I pulled it down to a myFunc function now and removed the dependency to CBA
now I am curious
well weird message is gone but still not function bodies visible
well do they work in debug console or not?
yes
but nothing happens there
I think I need to reread the whole docs about func definition again
["AmmoboxInit",[this,true]] spawn BIS_fnc_arsenal;
is there a way to get an item list from this BI Arsenal?
cursorTarget addWeaponWithAttachmentsCargoGlobal ["arifle_Katiba_F", "muzzle_snds_B", "acc_flashlight", "optic_aco" , "", 1] HYPE
Chances are very good that it will make it into Arma soon :3
woooow, last week i made a workaround for this -.-
Many people made workarounds for that.
Next task is a boundingBox command that only takes geo/view LOD into account. Current one takes memory lod into account which causes it to be off by alot
I wrote that command myself. And just got it tested by a BI dev after begging for it for over a year 😄
so ACE_Throwing does not fire off the "Fired" event handler. Does anyone know if there is an event handler setup in ACE for throwing? Or would I have to script one? I'm looking on the ACE website and they don't have one for throwing
ACe has their own fired eh afaik sec
nicely done Dedmen. persistence rules
["ace_throwableThrown", [_unit, _activeThrowable]] call CBA_fnc_localEvent;
https://github.com/acemod/ACE3/blob/master/addons/advanced_throwing/functions/fnc_throw.sqf#L75
@tame lion
thanks @still forum you're my hero lol
can you also get them to put the simpleObject tickbox back into object attributes?
🤣
i mean the tooltip of dynamicSimulation says it doesnt work with simple objects, and that option is not even there anymore. supersimple would be nice to have too
i dont even know how to get an object with supersimple object by script....
createSimpleObject with p3d filepath is super simple
with classname is normal simple
but how do i replace editor placed objects with supersimples? for normal simpleObjects i could at least consider to use the function to replace the object
you need to make a script that convert your editormap into an array or string or whatever and then you can spawn all objects in this array after mission start
Many people made workarounds for that.
I feel lazy to google it, but what is it? (inb4: action 'dropweapon')
yeah.. That is about the only thing. Spawning a AI or an agent. Adding weapon to him. and telling him to drop it
DROP IT KEVIN!
Well there are 0 guarantees that we'll get it..
kllrt could compile and test it. He still has to forward it for code review and get it merged
up next
boundingBoxVisual
boundingBoxVisualReal
geometryCenter
Btw addWeaponWithAttachmentsCargo doesn't support magazine or ammocount in magazine. Is that really important for anyone? or can we live with that?
^ that's how i did it
Ive managed to put music on helis but the songs distort a lot
@still forum HYPE
Actually expanding on it a little more. Current one can't do magazines
container addWeaponWithAttachmentsCargoGlobal [weaponClassname, muzzle, side, top, bipod, [(primaryMagazine), (ammoCount), (secondaryMagazine), (ammoCount)], (count)]
in parenthesis are optional
This should be better
Does secondaryMagazine need ammoCount? That's only grenades in grenade launchers right?
Ah whatever. Edited.
yea well. would be nice to be able to grab a gun fully loaded with grenade in GL
next up. removeXXCargoGlobal... Remove a specific weapon filtered by classname and attachments. Or a specific backpack.. magazine.. so on...
I can see why BI didn't want them. It's a chore
if i use skiptime (24 - daytime + 4.20); in my initserver.sqf it works. it does not seem to do it if i put it into a file that i call from the initserversqf. why could that be?
do you checked if the code was excuted on your other files with diag_log or something? because it should not make a difference in which script do call this code
i added a bunch of diag_logs because i thought so too. but all seems to be ok.
but i created a completely separate file for the skiptime command for test as well,
if i run the command from initsqf, it works. if i run the file that contains that command only, it doesnt work
how do you "run" that file
not sure if I should put in #ip_rights_violations or not, but if I find a script say on the BI forums or armaholic forums, how would I go about citing the forum and wat would I need permission wise from them to use that script?
Technically. You do need permission directly from the author that you are allowed to reuse it
And if you are already talking to the author anyway to ask about that, you can also clear up how you need to attribute him
aye thx
I want to use my unpacked mod so I can develop it while testing it. Therefore I put the @Mod folder here steamapps\common\Arma 3\@Mod. Within there is the addons folder with all .pbo files so it will be recognized as mod. Besides this the addon folder has it's unpacked content as well. Not after starting it still prefers the packed functions. I have file patching activated
Besides this the addon folder has it's unpacked content as well that's wrong. I told you what to do yesterday. And as far as I heard, you did it correctly yesterday
sounds like my mum 😄
Does anyone know why
_xSize = getNumber (configFile >> "CfgWorlds" >> "Altis" >> "Names" >> "Kavala" >> "radiusA");
works but
_xSize = getNumber (configFile >> "CfgWorlds" >> "Takistan" >> "Names" >> "Rasman" >> "radiusA");
doesnt?
Possibly another way to get the size of an area (doesn't have to be too exact)?
I've tried
_area = nearestLocation [ getPos player, "nameCity"];
_xSize = getNumber (configFile >> "CfgWorlds" >> worldName >> "Names" >> (text _area) >> "radiusA");
systemchat format ["%1", _xSize];
Altis: 500
Takistan: 0
Is there a guide how to load a mod unpacked? I still can't find anything - you guys had to read it by ourself and one point in time ^^ where is this magic resource
"you guys had to read it by ourself and one point in time" or we just knew how arma works and could figure it out by ourselves
as I said.. I told you yesterday
I re-read that part
https://forums.bohemia.net/forums/topic/216379-loading-unpacked-files/
Try adding -mod=mymod to your commandline?
what is your problem then?
https://discordapp.com/channels/105462288051380224/105462984087728128/515237275161067530
You wrote Besides this the addon folder has it's unpacked content as well.
which is wrong. I told you where to put that into, and it's not the addon folder
arma3\@mod\addons\component.pbo
and
arma3\@mod\component\<sources>
That what I did according to
@mod\addons\test.pbo"
and test\config.cpp
Where I assumed ur last statement meant to be @mod\test\config.cpp
tfw your question gets buried 😦 @still forum could you kindly teach a special person how to check the configviewer in worlds?
Debug console. Has a "config viewer" button below it
@frigid raven why can't you just pack/unpack your mod everytime you need to change something in it btw?
That what I did according to Apparently you didn't
@tough abyss because I change 40 things a minute
I told you to
@mod\addons\test.pbo
component\config.cpp
And you did
@mod\addons\test.pbo
@mod\component\config.cpp
Can you see the difference?
Also component here needs to be your full pbo prefix
hm - I was unsure if really all of my 15 folders have to reside within the arma3 directory
so you have a x folder. Next to your arma3.exe and your other stuff further in there
https://discordapp.com/channels/105462288051380224/105462984087728128/515237275161067530 here is again where I told you exactly that yesterday
so its x\component\config.cpp then?
there - now I got it
you replicate the in-game filepath in your arma directory.
https://discordapp.com/channels/105462288051380224/105462984087728128/515438639229042688
root filesystem start is your arma directory
Just like with the P-drive too
ok let the magic begin
not to ruin your guys fun but how would I go about pasting configFile >> "CfgWorlds" >> "Takistan" >> "Names" >> "Rasman" >> "radiusA"
into the config viewer? Or would I have to manually find it?
manually afaik
Alright, thanks!
Is there something like "text" that you can return a locations class with? IE:
text _location; //"Rasman"
class _location; //"City_Rasman"
aaah, thank you!!! I tried typeOf already
sadly cup maps don't work as well because the sizes are all 1:1 instead of being more exact. I'm able to do my stupid mission now though. 😄
While I'm at it. Does missionNamespace remain the same over server restart? IE:
_data = 123;
missionNamespace setVariable ["data",_data];
#SERVER SHUT DOWN
#SERVER STARTS UP
_data = missionNamespace getVariable "data";
I'm trying to do a stat save without setting up a database.
Ok, thanks. I thought there was a serverNamespace but I guess that doesn't exist. Could profileNamespace be used on server?
to save to servers profile?
yes
alright, thanks for the quick replies by the way! 😃
yes
How to migrate the defines.hpp (GUI dependency file) from a mission's Description.ext to a mod structure? Why do I ask? Because I am stupid and I want to migrate to a mod as you might have figured out already and included the defines.hpp only at those addons where I use a GUI. However it breaks the arma3 GUI somehow. The error message after I started Arma yields:
23:30:37 Warning Message: No entry 'bin\config.bin/RscMsgBox/Bottom/CA_ButtonOK.type'.
23:30:37 Warning Message: '/' is not a value
This is one of plenty of them.
Yet I was not able to find a tutorial that did not showed how to use defines.hpp and GUIs in a Mod. All tutorials only showed how to make it work in a mission and a Description.ext
PS: I #included the defines.hpp in the config.cpp of my addons at the very top
class CfgSounds
{
sounds[] = {};
class CombatArea3
{
//
name = "CombatArea3";
// filename, volume, pitch, distance
sound[] = {"dub\CombatArea3.ogg", 2, 1, 100};
titles[] = {0,""};
};
};
Is there a easy way to do this with many files? Its anoying have to to this manualy with each file name
don't redefine classes that already exist in vanilla @frigid raven
As to how to find out which ones are already in vanilla... Look each one up manually in config viewer
@astral tendon Not really.. You have to do every file. You can use macros though
any recomendations? never use that
@still forum uh ok - thought it would be something wrong with the load order of the .hpp
class CfgSounds
{
sounds[] = {};
#define SOUND_DEF(soundname) class soundname { name = #soundname; sound = {#soundname, 2, 1, 100}; titles[] = {0,""}; };
SOUND_DEF(CombatArea3)
SOUND_DEF(otherSound)
};
That too
you should have correct requiredAddons
each SOUND_DEF is the name of the file?
yeah
Meh I don't get it - I did not redefined existing ones the error messages RscX classes are not inside the defines.hpp I include
therefore they might be really missing... but
gosh makes no sense
Yeah. The errors are not in a hpp file
Arma doesn't even know that the hpp file exists
just look if you have RscMsgBox anywhere in your code
I really did
nuttin
It only happens when I include this defines.hpp which worked fine in my mission setup before
and without it - ye my gui.hpp files are about to cry
Let's roll back a bit
read that
https://github.com/CoopR-Mod/CoopR-Altis/blob/2248f3805028b4d1eef1c47503b68eea6caec32a/define.hpp#L99 Then see that you are doing exactly what I said not to do
Almost all of your defines.hpp is redefining vanilla classes. Which you shouldn't do
change the definitions to declarations
🤔 k give me a sec
k looks like this now
class RscStructuredText;
class RscPicture ;
class RscEdit;
class RscCombo;
class RscListBox;
class RscButton;
class RscShortcutButton;
class RscShortcutButtonMain;
class RscFrame;
class RscSlider;
class IGUIBack;
class RscCheckBox;
class RscTextCheckBox;
class RscButtonMenu;
class RscButtonMenuOK;
class RscButtonMenuCancel;
class RscControlsGroup;```
my gui.hpp now cries for the missing RscText. I need to make that one defined now, aye?