#arma3_scripting
1 messages · Page 502 of 1
what are you trying ?
Me
yeah
Remove https://imgur.com/a/EYm9bR2 amongst other things.
@empty harbor your on this discord
can u shed some light?
its not packing my pbos properly at all, missing files from like every folder.
I don't think he'll help you 😄
He is the guy that specifically made his tools such that you cannot ignore the errors
@tough abyss i think its impossible
my dll refuses to pack exile because of that.
there are a legion of mistakes in the array[] specifcations too
Isn't exile just poorly written in the first place?
Yep
poorly designed perhaps and not well written
I'm just guessing here, but in my eyes it's the same as life, pretty much.
I do have to say though... They do have some really great duct tape.. It's a wonder that this heap of garbage doesn't fall apart
lmao
exile is fixable by those who want to use it by simply renaming their foolishly named config.cpp
rename the file. that simple
You could just do the thing that I told you like 5 times now that you should do
what* would u reccomend naming it to
haha
get rid of that bullshit nonsense config.cpp
pigscanfly.sqf
as i recalll, that's what it's conetnts are.
Because it literally doesn't matter
nots not i dont think
+1
all that matters is that it goes away
it's only a boring include file
#include "PigsCanFly.rvmat"
problem solved
there are also a large number of array[] errors. all of them easily fixable, but it takes time
i honestly dont even want to keep trying anymore
i just keeps relling my my syntax is wrong
It's like you are trying to buy a ship that's already sinking
just patienty fix the errors
makepbo -! -Z C:\Users\Daryl\Documents\GitHub\exilechernarus\Exile.Chernarus_2035 Exile.Chernarus_2035.pbo
legit just worked
and now its like nope syntax error
you're foolish to obfuscate anything before the errors are removed.
yeah
well im fricken sick and tired of people taking my content
i worked hard on all these icons etc etc.
already had multiple players join my server just to download my mission file
kid message me on discord legit told me that he was gonna use some of my code on his new server
it wasnt asking he was just like "hey im taking ur code"
your code?
GitHub\exilechernarus\Exile.Chernarus_2035 it being from a public exile github.. Doesn't sound really like "your code"
Yeah.. I was going to comment but sometimes it's better to just not get furhter involved lol
um its my github repo?
@still forum my server i use a private github repository for all my files ?
So it's your code yes?
You should name it something other than exile then.
If you wrote an entire new gamemode make it clear that it's not the same thing.
i named it that way bc i have multiple exile server maps
So you are saying it's your code then?
on diff repos
no i didnt write exilemod
i knew
u were gonna have some smart comment
like that
or something
i know that
Why does your code have that config.cpp with errors that you are unable to fix, and that you don't even know what it's for, if you wrote that by yourself?
for fucks sake
let me finish
like i said
do u think i make exilemod?
just being a smarty pants about it and being all technical
i think u get what im tryinng to say
all my custom logos/ map edits/ script modifications what ever.
its all in my github
and i spent weeks doing it all
ok?
i do not know why exilemod decided to name their files the way they did.
i think we both know i wasnt trying to say that every single line of code word for word is from scratch my code.
From what I understand. If you haven't made the entire map, script, or logo you can't claim ownership of it really. Only thing you might be able to copyright would be your images. Unless this is false, if you have a problem with it you can pretty much lock your server and only allow trusted people to join.
"trusted" :^)
Also the original code might not allow obfuscation. But I can't find licenses on similar mission files
though.. A missing license means you cannot take it at all. If there is no license, there is nothing that allows you to do anything. Thus you cannot touch it.
original code of exilemod ? @still forum
i know plenty of other servers that do this
of that mission file
Yeah. I know too. I also know plenty of other people who illegally reupload stuff to the workshop
like the mission sqm file
making your own "community" mod pack which includes other peoples mods isnt allowed without their permission right?
@still forum im not good at any of the legal shit but.
yeah
Same with mission files. You cannot just repack stuff unless you have permission. And that includes every single file in that pbo that you are trying to pack.
Especially problematic are APL licensed things. As you are not allowed to obfuscate them
ok wait wait wait
so ur saying
that if i made my own chernarus 2035 mission pbo folder from scratch
like i went in the map editor
placed all my own traders etc etc whatever was neccisary for vanilla exile to run on that map
i understand the part about other peoples scripts and shit like that.
What would be the point of that?
You'd just be contributing to every exile bloat script server.
im sorry bloat script?
why do all u people on this discord need to push opinions so hard
Maybe you did?
Opinions are usually subjective.
Exile is objectively a pile of garbage, which is also why you are having problems with it.
yes but kinda felt like he was taking out that opinion on me
How do I find this: #include "\a3\Missions_F_Curator\MPScenarios\MP_ZGM_m11.Altis\initServer.sqf"?
How do you find it? It's packed under a3\Missions_F_Curator
The path tells the truth yes.
just some advice need if possible ```sqf
private _listbox = (uiNamespace getVariable ["lega_psearch_menu", displayNull]) displayCtrl 3;
private _tvSelection = tvCurSel _listbox;
private _dataStr = "tv_data";
_tvSelection apply {_dataStr = _dataStr + format ["_%1", _x]};
private _index = _listbox getVariable [_dataStr, []];
private _arr = (getUnitLoadout player);
private _temp =+ _arr;
private _string = "(_this";
for "_i" from 0 to (count _index - 2) step 1 do {
_string = _string + format [" select %1", _index select _i];
};
private _string = _string + format [") set [%1, '']; _this", (_index select ((count _index) - 1))];
private _gear = (_arr call (compile _string));
player setUnitLoadout _gear;
(_arr call (compile _string)); 🤢
all the parenthesis there are useless btw
unary always has higher priority than binary
i know thats why i asked for advice
for the call compile section
the parenthesis are just there for my viewing purpose, i just personally find it easier to read
private _value = _this; //prev _string
for "_i" from 0 to (count _index - 2) step 1 do {
_value = _value select (_index select _i);
};
_value set [(_index select ((count _index) - 1)), ''];
how bout something like that?
I guess that you might have chained select in there?
yup
That should work then
i will give it a shot
execute the code right away, instead of building a string and then executing all at once
index is an array of index's based on the selection
i.e if it was the optics selected on the primary weapon it would be something like [0,3]
got a zero divisor with that
my bad with the c+p, tyvm @still forum
it works fine
just had to change a few vars
Lega_fnc_testFnc = {
private _listbox = (uiNamespace getVariable ["lega_psearch_menu", displayNull]) displayCtrl 3;
private _tvSelection = tvCurSel _listbox;
private _dataStr = "tv_data";
_tvSelection apply {_dataStr = _dataStr + format ["_%1", _x]};
private _index = _listbox getVariable [_dataStr, []];
private _arr = (getUnitLoadout player);
private _value = _arr; //prev _arr
for "_i" from 0 to (count _index - 2) step 1 do {
_value = _value select (_index select _i);
};
_value set [(_index select ((count _index) - 1)), ''];
player setUnitLoadout _arr;
[lega_seize_int_unit] call lega_fnc_pSearch_openMenu;
};
annoying that tvsetData only allows strings so i have to use an alternate method to store anything
Thanks guys, which .pbo would I need to depbo it. https://gyazo.com/45cec1b8701fc32e0a78546611a9b9b6
@wary vine I don't enough space to setup a P:
hmm
gimmie a sec
copytoclipboard preprocessfile "\a3\Missions_F_Curator\MPScenarios\MP_ZGM_m11.Altis\initServer.sqf"
then ctrl+v in your test editor
Okay thanks you very much !!!
a pdrive would help you alot for this sorta stuff
saves you having to mess with arma 3 files
@drowsy axle even better
copytoclipboard loadfile "\a3\Missions_F_Curator\MPScenarios\MP_ZGM_m11.Altis\initServer.sqf"
i just have mine on an old ssd
Ah right. Thanks for the assistance. 21:01:43 ErrorMessage: Include file a3\Missions_F_Curator\MPScenarios\MP_ZGM_m11.Altis\description.ext not found. 21:01:43 Application terminated intentionally ErrorMessage: Include file a3\Missions_F_Curator\MPScenarios\MP_ZGM_m11.Altis\description.ext not found. Had this error and thought.. how can I get the file, so thanks a million.
picked up a 128gb ssd for like £15
where are those includes to ?
change ```
a3\Missions_F_Curator\MPScenarios\MP_ZGM_m11.Altis\description.ext
\a3\Missions_F_Curator\MPScenarios\MP_ZGM_m11.Altis\description.ext
where are you including from?
The mission. I just copied this folder, the only folder.
You can't include external files from mission pbo's
I can't
i do @still forum
but BIS can
Bi broke that when 3den came out
#include "\a3\3den\UI\macros.inc"
#include "\a3\3den\UI\macroExecs.inc"
BIS doesn't have mission pbo's. Their missions are in a mod
@still forum i use this fine in my mission
How are you packing?
just as a pbo
both obfusqf and pbomanager work for me
Well I just know it's broken 😄 Maybe it's only when packed from 3DEN
3DEN pbo header also has something weird
ahh I was going to say i use external includes all the time in my missions xD
Maybe it's time to test again if BI fixed it
Is this proper for a multiplayer mod? Specifically the "player" variable. Or should it be "this"?
#include "\a3\editor_f\Data\Scripts\dikCodes.h"
[
"WindowBreaker",
"WindowBreaker",
["Smash", "Press to smash a window"],
{[player] execVM "\WindowBreaker\windowBreaker.sqf"},
{},
[DIK, [false,false,false]]
] call cba_fnc_addKeybind;
this doesn't make sense there
cba doesn't set a this variable
You might mean _this. But _this doesn't contain player, because that wouldn't make sense there
player is correct yeah
player doesn't work on server. But on a server no one can press a hotkey
I get mixed up on _this vs this, but player works? Cool.
Using that bit above, here's a snippet of my actual code and I'm getting sqf errors related to how the player variable is defined I think:
[] spawn {
//_this = player; //For testing
params ["_player"];
_player = _this select 0;
private _window_pos_arr = [];
private _house = nearestObject [player , "House"];
params ["_player"];
_player = _this select 0;
``` 🤔
Yeah someone was helping me with the code, so I'm not really sure how parameters work
ditch _player?
not so 😄
Not even mentioning that you're not actually passing a parameter into that scope
Ok
the local player you can get with only player
Gotcha
params get's the parameters out of _this.
_this select 0 does the same.
Both won't work if _this doesn't contain any parameters
so if only pass one argument you can do this:
_hello = "ss";
_hello spawn {
hint _this; //ss
};
if you use more than one argument you need to pass a array:
_hello = "ss";
_hello2 = "aa";
[_hello, _hello2] spawn {
_hel1 = _this select 0;
_hel2 = _this select 1;
hint (_hel1 + _hel2); //ssaa
};
So do I even need a param in this case? Do I even need to define player?
so if you use params you can do this so:
_hello = "ss";
_hello2 = "aa";
[_hello, _hello2] spawn {
params["_hel1", "_hel2"];
hint (_hel1 + _hel2); //ssaa
};
if you need the local player, no
if you always use player. you can just use player in your script yeah
Ok, great. Because my script worked when I punched it into the console in-game, I'm attempting to package it as a pbo and test it out as a mod now
player is a magic variable from bi no it's not
player is not a varaible, nor is it magic
it's a command that returns the locally controlled unit
#include "\a3\editor_f\Data\Scripts\dikCodes.h"
[
"WindowBreaker",
"WindowBreaker",
["Smash", "Press to smash a window"],
{[player] execVM "\WindowBreaker\windowBreaker.sqf"},
{},
[DIK, [false,false,false]]
] call cba_fnc_addKeybind;
Do I want the [player] part in this then? Or is it not needed?
no
Keep in mind. If you're breaking windows on buildings etc JIP won't see them as broken.
How do I fix that? Remote exec or fnc_mp?
remoteExec with jip flag
take a look at here: https://community.bistudio.com/wiki/remoteExec
I'm a little confused about the syntax, is this right to set 1 damage and get it to work globally and for JIP?
[_house, _hitpointname,1] remoteExec ["setHitPointDamage",0,true];
Looks fine.
No
right arg is an array
remoteExec doesn't magically take gibberish and convert it to what a command needs
Ah yes, he is right.
This is what I had before the remoteExec
_house setHitPointDamage [_hitpointname, 1];
Gnashes, make me a remoteExec that translates gibberish
[vehicle,[hitPointName, damage, useEffects]] remoteExec ["setHitPointDamage"];
But what part of that has the JIP flags?
that is only the format for setHitPointDamage in remoteexec
or is JIP the default
No jip by default, target and jip flag needs to be added to gnashes example
you do it already above
[_house,[ _hitpointname,1] remoteExec ["setHitPointDamage",0,true];```
???
[_house,[ _hitpointname,1] remoteExec ["setHitPointDamage",0,true]];
[_house,[_hitPointName, 1]] remoteExec["setHitPointDamage",0,true];
Oh dur
Ok seems to be working. I just noticed if you smash the Spacebar though, it plays the glass breaking sound multiple times
but you remove the action after smash?
The CBA keybind runs the script, which checks for windows, breaks them etc. Not sure how to remove the action
I'm not using addAction if that's what you were getting at
i don't work with cba, do you see the action after smash?
No the action works fine, the only thing that multiplies is the sound effect, which is added in because setHitPointDamage is silent
Might just need to move one of my if checks
okay
Hmmm not sure how to prevent that
It is a thing you'd have to try to do though
Can I plug an "if script is running, don't run" argument into my CBA keybind?
script_handler = [parameters] execVM "scriptname.sqf";
waitUntil { scriptDone script_handler };
Is what I'm seeing
// Register a simple keypress to an action
#include "\a3\editor_f\Data\Scripts\dikCodes.h"
[
"WindowBreaker",
"WindowBreaker",
["Smash", "Press to smash a window"],
{execVM "\WindowBreaker\windowBreaker.sqf"},
{},
[DIK, [false,false,false]]
] call cba_fnc_addKeybind;
Is what I have already, so I can probably wedge it into the brackets where the execVM is I guess
Hey guys, does anyone know a method to remove the connection message? Or even modifying it? I just want to say: "A player is connecting.". Is that even possible?
nah, make a if statement
if(scriptdone script_handler) then {
script_handler = [parameters] execVM "scriptname.sqf";
};
@dim owl no, there is no offical way, you can try to edit the chat dialog or you spam the chat full with some spaces (warning: very dirty)
Okay thanks, I saw it on another server i believe but i'm not completely sure. Is the systemchat thing in the engine? Or could I check for incoming systemchat messages and create like a filter?
@pure blade that script won't fire off, not sure if it's a CBA thing or not though
if the script don't end, you must look up if the script stuck on a loop or something
Good point
Yeah i also though about an evh for that but I don't think it's going to work
you can get the messages from the chat dialog i think
I'm trying to create a custom virtual arsenal and so far I've created a whitelist of equipment but people can still Save/Load in their loadout. I need to disable the option to Save/Load. Larrow made this script to somebody that was asking for the same thing: ``` [ missionNamespace, "arsenalOpened", {
disableSerialization;
_display = _this select 0;
{
( _display displayCtrl _x ) ctrlSetText "Disabled";
( _display displayCtrl _x ) ctrlSetTextColor [ 1, 0, 0, 0.5 ];
( _display displayCtrl _x ) ctrlRemoveAllEventHandlers "buttonclick";
}forEach [ 44146, 44147 ];
} ] call BIS_fnc_addScriptedEventHandler; ``` It seemed to work for players on the server but somebody that rejoins can use the Save/Load option again. How can I remote execute this script with JIP activated?
You could just add it to the player init and it will be executed every time the player connects
Dont have access to that, I'm executing it on the debug console.
I suppose I could loop it but I think that will take a toll on the server performance.
if it's not blocked by the remoteexec config, you could use {/* your code */} remoteExec ["call", -2, true]; or something like that. cannot test it atm
Will try, thanks.
@quartz coyote Do you have a github?
hello!
i need some help
how can i change a dialog text colour into black and align it?
thx!
in a dialog, i mean
what kind of dialog
normal dialog XD
IT's different for static and structured text
here's a list of commands for gui
I'm sure you can find the one you're looking for
i'd like to define it on the .hpp
i know it's possible, i did it a time ago
but i don't remember now
:/
Text alignment can be controlled using the style property and the ST_* constants. < from https://community.bistudio.com/wiki/DialogControls-Text
kkarma
@peak plover hello why ?
You said something about working on a pvp scenario or sth
Yeah we're looking for someone to work with us on some project. You interested ?
Nah, I don't think I'm that good at scripting yet.
I was just wondering about how you do things for it
That's why I wondered if you have a github
Is there a way to make cystom chat message with played voice ? Something like when units say something about target etc
But I need to have recorded sound for that , correct ?
I thought there was a way to make a chat message play with the voice of ingame AI, like when you order someone to openfire etc
Well.. Find the voice actor who voiced that. And ask him to speak your text ^^
Ok 😀 thanks
I am looking for a command which is telling me if a vehicle is open or closed. A prowler is open, a tank not. Is there a command or do i have to script it?
ABout that voice stuff, are the ai voices not scripted at all?
in sqf
@neon snow you can just use the existing voice files
Uuu nice. Thanks @peak plover
i have _inidbi = ["new", "Vehicle Garage"] call OO_INIDBI;
_readVehicles = ["read", ["Vehicle Garage", "Merc Vehicles"]] call _inidbi; this in my script and this is the only part i need to let the server execute, because clients dont know inidbi. Only the server does.
create a function for this and use remoteexec
dont have functions for the old scenario yet, is there a workaround? Dont have the time ^^ Tomorrow i am working on the functions.
right, thanks, that was the idea i needed
is the init eventhandler from class Eventhandlers executed on every client? Or only once by the owner?
should be every client that has the config entry
hm also jip right? So when the player joins after an object was created it has to be initialized again for him. I think I had once a issue with joining players moving objects back to their initial position defined in the init.
strange, the arsenal script works perfectly but the garage-script with the dialog wont. Except the dialog, it opens. grah...
I don't know if init runs for JIP.. Have to test that (I won't)
I will, ty anyway 😛
a global variable is initialized, the server knows inidbi but it somehow refuses to load the infos into the variable oO i am going crazy.
this is for the server:
_inidbi = ["new", "Vehicle Garage"] call OO_INIDBI;
_readVehicles = ["read", ["Vehicle Garage", "Merc Vehicles"]] call _inidbi;
theGarage = _readVehicles;
theGarage is still empty.
well is _readVehicles empty too?
let me test this.
strange, its empty.
i dont get any errors either in the rtp files... now i am really confused.
could there be somehow a cache-conflict? since i redid the inidbi-entries all along without renaming them?
My had hurts, how to get direction from one object to another but disregard of what direction first object is looking at?(thats how getRelDir works)
damn, I am stupid for not reading entire pages, big thanks
Two questions. 1. If a client runs {code} forEach allUnits, is that local only or do all multiplayer units run that code? 2. If a client runs a function like [] call myFunction, the code inside myFunction has {} forEach allUnits, does that run for allUnits in multiplayer as well?
if you run code locally it will be running locally
it doesn't do anything magically without you telling it to do that
ty
So when would forEach allUnits be needed? Only server run scripts?
is i possible to include different files based on a config entry ?
if (config isEqualto something) {
#include something
} else {
#include somethingelse
}
Why not?
What to do when A2 server started to crash often after various necessary changes to mission file? Logs show nothing unusual apart from the usual memory dump, and it would be way too much work to go through the changes one by one
you can id #ifdef in the preprocessor
how can i check if a unit is artillery?
@proven crystal sqf private _arty = "B_MBT_01_arty_F"; if (_unit == _arty) then { code };
yeah but ho would i make it workable for artilleries from multiple mods, not just specific types
tomething like iskindof "Tank" just for artillery
i think they all inherit from "MBT_01_arty_base_F" somhow
Make an array of arty classnames. Or mb there is some value in config that would indicate arty.
((typeOf _unit) find "_arty" > -1)
hmmmyap that ould work
mlrs for the rockets
i just came across the getartilleryammo command... that might be a way as well, and might lead to more use
("Artillery" in (getArray (configfile >> "CfgVehicles" >> typeOf _vehicle >> "availableForSupportTypes"))
ah very nice
_x enableVehicleSensor ["PassiveRadarSensorComponent", false];
_x enableVehicleSensor ["ActiveRadarSensorComponent", false];
_x enableVehicleSensor ["IRSensorComponent", false];
_x enableVehicleSensor ["LaserSensorComponent", false];
_x enableVehicleSensor ["NVSensorComponent", false];
_x enableVehicleSensor ["VisualSensorComponent", false];```How come anti-air vehicles can still lock on and shoot missiles after disabling all their sensors?
I would assume so. What else would they be for?
for the radar
I never got deep into sensors or radars, but I think they are not needed for using missiles
ah, ok ty
@carmine abyss So when would forEach allUnits be needed?
What kind of question is that? forEach allUnits iterates through all units. You need that when you need to iterate through all units
@wary vine is i possible to include different files based on a config entry That's not how the preprocessor works no. Preproc runs before any script runs.
@carmine abyss https://discordapp.com/channels/105462288051380224/105462984087728128/518573130109681694 How's that supposed to work?`A unit can never ever equal a string. That's nonsense.
Sensors are only for detecting enemies afaik. If they already know about the enemy, they don't need sensors to find him.
It's a really dumb question from a dumb person. Sorry code god.
a = [0];
b = a;
b set [0,1];
both a and b will be [1]
Is that intended behaviour? I guess internally they just copy a pointer?
a = [0];
b = a apply{_x};
b set [0,1];
fix
b = +a
copy a into b
instead of passing reference
in SQF everything is passed by reference
wow. Time to document that somewhere...
That is documented. Read the wiki.
dialog controls cannot be rotated?
you had your answer from dedmen already, what in specific are you trying to achieve? Start with that first.
I learned basics from looking at wiki and examples
What in specific do you want to try and do?
Thoae are all math operators
You just copied the most basic things that are the same in every other language
And even in maths. Did you go to primary school? they teach maths there.
It's a placeholder for var
a and b?
First two letters of the alphabet?
You know.. Like x and y in maths?
You are the second guy in one week that calls me rude for saying the truth
the other one started raging because I said "I like Inventory" when he asked what the key to open the inventory was

Right... Maths... Boolean Algebra..
Anywho, don't let people hold your hand through learning something new. Tackle it head on and ask questions along the way. Youtube videoa are awful for this.
Ratgerial, if you click on the hyperlink for ! a you'll see several examples of how that operator is used
Typing on mobile sucks
_a is a local variable.
alive player checks if the player is alive (duh) and stores the true/false it in _a.
if not _a then hint that to the player.
This all combined. If player is not alive then hint "The player is dead!"
^ Boom
no
_a's purpose is to store the result that alive command returns
You could also just do
if (!alive player) then {
hint "The player is dead!";
}
_a isn't really needed here
player is you. The player. The unit that you control
You have event scripts, init fields.
Youtube videos are the absolute worse way to do this
YouTube videos on scripting will not be very helpful. KillZoneKid's tutorials are pretty good but they assume a certain amount of knowledge, at least in basic coding functionality like a != b 😉
In the init.sqf, and initPlayerLocal.sqf, player is defined. Player is not defined on server FYK
If I correct you now I'll confuse the beginners 😄 🙊
Correct it
In addition, while SQF is fun ... it is not the right language to learn how to code imho
player is a command. commands cannot be undefined
vanilla is full of scripts
Ever entered the main menu? scripts! on every button.
Tried the arsenal? Scripts. 100% of it.
Ok, player object undefined on server.
sqf is the same whether you run mods or not...
its not undefined, its "null" 😄
if it would be undefined it would be nil
correct me if wrong
sqf is the same whether you run mods or not well.. Mods can make sqf bigger 😄
Fine. Null!
LOL
stop that intercept stuff, you will confuse them even more 😄
Hello World!
wow that was like 6 or 7 years ago....
I have literally no idea. Something shit.
That would be a certain CTI mission framework 🤣
Sent things flying into the sky
well maybe the bugfixes for older version were first.
Editor, you'll eventually need to touch SQF
SQS is basically SQF but just more shit syntax and shouldn't be used.
There is a C++ thing, but I wouldn't recommend to a beginner, you first need C++ AND SQF basics before you can try that
So.. You only have SQF. That's all that arma uses
I sent you a link before. To killzone kid's blog with some beginner tutorials
Besides these (Which are already outdated and partly crap) I only know of even worse youtube crap that will just teach you how to copy-paste crap code and make it even worse.
SO you have this list of commands: https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3
And you have a context when to execute them. Context can be: event handler (the game calls your code when something happens). You do that with addEventHandler command.
Or the context can be a script which you have created with spawn command.
There are also some mission-specific files which are called by the game, i.e. when it starts the mission, like init.sqf and others: https://community.bistudio.com/wiki/Initialization_Order
Start your editor, place a character
start the mission
You press escape and you have this debug console to mess with
You can start your coding efforts with that
What's confusing about that Ratherial?
You are pretending that programming should be something easy that a 5yo can learn in 5 minutes.
That's not the case. You don't go from crawling to parcour running.
Your try taking small steps, and fall over. Then slowly get into walking, then maybe running a bit, one or the other jump maybe too. And slowly build your way up.
Do you not know what a string is? An Array? Integers?
Hey all. The the other day saw a Reddit thread that had a starting point to create an actionable off/red/green jump light in the back of a cargo plane. I can't find it now does anyone possibly have that link? I want to mess around with the script a bit.
@vagrant mango You need to create a light source.
You probably need to do some general programming tutorials then, on a more common language
Do you know what a sequence is? do you know what characters are?
_lightSource = "#lightpoint" createVehicle [0,0,0];
"word" here <--
A sequence of characters. The characters w, o, r and d
that's a string
Well, in every programming language there are basic data types: numbers, strings, arrays, sometimes structures. First of all you learn what basic types there are, independent of what language you are looking at.
I really think you should stop trying to learn SQF.
Get WHATEVER tutorial on youtube that teaches you the basics of programming. What Language doesn't even matter.
Once you learned how to crawl, you can start trying to learn how to walk.
Don't jump from lying on your back to running around. That just won't work.
That's fair. SQF reads like fucking garbage. It's tough to look at and understand.
Yes. SQF learning youtube videos are garbage
I'm not telling you to learn SQF with youtube
For learning the very basics of a programing language... which you will very much need to know before tackling SQF
@stuck surge what they're trying to say is there are common concepts in just about every programming language that transfer pretty well. Start somewhere else.
Python is widely the most used an accessible..
There is not, for SQF
@stuck surge unfortunately not. Programming is either alot of experimenting on your own, or having someone help you out 1:1 which many arent willing to do because of the nature of how they got that knowledge.
@stuck surge https://www.youtube.com/results?search_query=basics+of+programming
https://www.youtube.com/playlist?list=PL8dPuuaLjXtNlUrzyH5r6jN9ulIgZBpdo this stuff will be helpful I guess.
It's very much aimed for beginners.
Concerning arrays and strings. See #14 for example
The one from "VoidRealms" I can also recommend. I watched tons of videos from that guy
I mean this in a nice way, not being an ass. Google "What is an array". Read until you sorta get it. Then experiment.
I would recommend to look at assembler of some basic CPU some time... 🤔 It really teaches you about how programming works
Oh don't be fucking dicks.
I actually did, as far as assembler goes
knowing how to find things out by yourself, and teach yourself things is like the only requirement you need to have to learn programming.
If you don't know how to google things, Or look for tutorials on youtube on your own.. You're kinda goofed. I mean maybe you're lucky and find a guy that's willing to invest his time into you and hold your hand.. He won't do that forever for free.. Because you know.. Teachers are getting paid for such stuff
But even in the simplest of programs, you need to understand the very basics, e.g. c #include <stdio.h> int main() { // printf() displays the string inside quotation printf("Hello, World!"); return 0; }
The problem is some people learn different. I start at getting someone else to explain or show me the way. Because if I go straight to experimenting I am just breaking pots and not knowing how.
Lol what do you mean?
I'd recommend starting with Python. Accessible, usable for just about anything, and theres tons of tutorials. It has a benefit of being more human readable.
Learn basic flow control and data types/structures
Won't know unless you try it.
Dude. You are sitting in a corner constantly telling yourself "I can't do this"
Correct. If you don't get up and start doing things, You'll never do it.
If you don't want to start learning, why do you ask us then?
We give you the answer and you're just like "no i can't do this"
correct
that's what you want
Yep... nothing can teach you how to program, only the building blocks for programing. Programming is an art
Yes
Remember the thing about crawling -> walking -> running?
programming is running.
You can't even crawl yet. So don't try learning to run while you can't even crawl.
And then one day you will be able to take over the programming of TFAR while Dedmen enjoys his retirement on Lemnos
@stuck surge just do it and follow along. Soak it all in and when you've finished and you have questions about those things you don't totally understand then ask someone.
Okey then bye. If you don't wanna learn, don't waste our time
Not "Do this for me" but "Hey, I'm not clear on how the difference between local and global scope and how the impact your code, can you expand on it?"
Then you should probably forget ARMA scripting then
Programming is a really very demanded skill to know today. Especially if you are in engineering or science or close to it. You can apply it in many ways, including arma of course.
No
Well I started by scripting for some other game which had scripting support, on my own... but there were people to help learn further, fortunately.
But you do not require college to learn programming.
Not originally no... learned how to program well before college
I'm self taught and work as an developer.
You asked what a+b is supposed to be ¯_(ツ)_/¯
Counts can be pretty fundamental with alot of things. And while I get it, it's also bad form to insult someone who isn't in your position because you expect them to know. Programming isn't my strong suit, security is, if you came to me not understanding what the SUID bit is I wouldn't make fun of you because I think you should know. I'd ask some probing wuestions then explain. It. At the same time @stuck surge you need to just start somewhere. That's the best way. Programmers are pretty notorious for being like "Idk, here's the shitty documentation figure it out like I did". There's a ton of pride in this line of work.
Stop stressing. Just jump in and be ready to learn something.
Asking a question is now the same as saying if something is fact? Okey.
Oof.
True. I can't really handle idiots that well.
If you have a very specific question I can most certainly give you the answer, but I'm not that good at helping people that know nothing, don't even try to learn things by themselves, and expect everyone to be holding their hand and teach them everything they need to know from the ground up.
I'm not sure if basics is "so much".
No
I was a beginner too. I took google and youtube. And learned things till I wasn't not a beginner anymore.
@stuck surge stop. Go do the courses.
No, you're an idiot for not taking the free certificate in software development.
@open vigil ^
Which is learning how to google.
Dedmen is a type of person that will mop a floor with you in a way that should encourage you to learn if you are not a sensitive flower.
Daily scripting drama :d
You know that in the internet you should be ready to take anything with a grain of salt, do you?
oh.
he's gone.
yup.
Adult stepped in.
With a sniper.
If he does, he needs professional help. Not some randoms on some discord.
ADHD is not a defence for being inconsiderate
Everytime he has been here and asked a question he has exploded at someone who answered him tbh (Ratherial that is). First time he exploded at me...
2nd time today he was removed. This time it’s permanent.
Anyway, back to #arma3_scripting
LOL, been scripting in the background throughout the conversation 😉
2nd time today. 3rd time this week
I'm trying to execute Floofs CRAM script onto a Praetorians init. How should I convert it so it works by simply posting into the turrets init? https://forums.bohemia.net/forums/topic/215598-release-c-ram-script/ - CRAM script
is there a way to convert this string: "1e11e52eb00# 438914: ammoveh_f.p3d" back into an object?
No
Technically yes, although I don't recommand doing anything this way
You should be saving an object you need to retrieve later as a variable. But you can convert that string back into an object using something like so ```sqf
_arr = nearestObjects[player,[],50];
_arr select {(str _x) find "1e11e52eb00" > -1} param [0]
I would guess you could loop through all the objects that match
that seems pretty terrible though
It's extremely redundant.
But again, that is bad, and you should not be doing that
alrighty, thanks for the help
shouldnt _unit removeWeapon (secondaryWeapon _unit); work to remove a launcher from a unit?
works with handgunweapon and primaryweapon
Yes, it should (I think) assuming that the secondaryWeapon is local
If not, use removeWeaponGlobal
Damn you ARMA! Why would you not barf on this: sqf case "Artillery":{ switch(true)do{ case ((_x select 0) in ["CUP_1Rnd_StarCluster_Green_M203","CUP_1Rnd_StarCluster_Red_M203","CUP_1Rnd_StarCluster_White_M203"]):{ _index = _ctrl tvAdd [[0,6],_x select 4]; _path = [0,6,_index]; }; default { _index = _ctrl tvAdd [[0,8],_x select 4]; _path = [0,8,_index]; }; };The missing }; on line 724 of a 1574 line SQF script... Not one error in the RPT... And damn you @deft dock ... wtf is with Star Cluster GL rounds being Artillery? 😉 Assume the answer is, as always, ARMA...
Why... it's just a fragment of code to sort gear into categories in a trader dialog...
Gets funky when I have to do stuff like this (yes, need to add stuff to the String Table): sqf case 3:{ { _index = _ctrl tvAdd [[_mainindex],_x select 0]; _ctrl tvSetPicture [[_mainindex,_index],_x select 1]; _ctrl tvsetValue [[_mainindex,_index],-1]; _sp pushBack [_mainindex,_index]; }forEach [ [localize "STR_HALV_BACKPACKS","\a3\Ui_f\data\gui\Rsc\RscDisplayArsenal\backpack_ca.paa"], [localize "STR_HALV_GOGGLES","\a3\Ui_f\data\gui\Rsc\RscDisplayArsenal\goggles_ca.paa"], ["Military Headgear","\a3\Ui_f\data\gui\Rsc\RscDisplayArsenal\headgear_ca.paa"], ["Civilian Headgear","\a3\Ui_f\data\gui\Rsc\RscDisplayArsenal\headgear_ca.paa"], ["Military Uniforms","\a3\Ui_f\data\gui\Rsc\RscDisplayArsenal\uniform_ca.paa"], ["Male clothes","\a3\Ui_f\data\gui\Rsc\RscDisplayArsenal\uniform_ca.paa"], ["Female Clothes","\a3\Ui_f\data\gui\Rsc\RscDisplayArsenal\uniform_ca.paa"], [localize "STR_HALV_VESTS","\a3\Ui_f\data\gui\Rsc\RscDisplayArsenal\vest_ca.paa"], ["Female Vests","\a3\Ui_f\data\gui\Rsc\RscDisplayArsenal\vest_ca.paa"] ]; };
I hate dialog coding though... in any language
I personally think localization and string tables are stupid and there is only one true language.
I don't understand people who write variable names in their native language
Well, I have people on from all over the world so localization is just polite
Not that I preach what I teach...
yeah, back to the code
switch(true)do{
case ((_x select 0) in ["CUP_1Rnd_StarCluster_Green_M203","CUP_1Rnd_StarCluster_Red_M203","CUP_1Rnd_StarCluster_White_M203"]):{
_index = _ctrl tvAdd [[0,6],_x select 4];
_path = [0,6,_index];
};
default {
_index = _ctrl tvAdd [[0,8],_x select 4];
_path = [0,8,_index];
};
what is this
switch true do
what?!??!
_thing = [8,6] select ((_x select 0) in ["CUP_1Rnd_StarCluster_Green_M203","CUP_1Rnd_StarCluster_Red_M203","CUP_1Rnd_StarCluster_White_M203"]);
_index = _ctrl tvAdd [[0,_thing ],_x select 4];
_path = [0,_thing ,_index];
Except that it is simply a switch statement enclosed within this switch statement: sqf default { switch(_x select 8)do{ ... }: };which is enclosed in another switch statement
You'd really have to see the 616 lines of code in nested switches that categorize the 3213 items available in the traders
Looks like rewriting too much and slow code
But I guess it's life code so it has to be sloppy
🤷🏻
Life...? No. I do not do Life. Epoch
It goes in the same category
LOL, okay
Again... categorizing items into a trader dialog can be complicated. Have heavily modified code written originally in 2014 by someone else... Have plans to rewrite but also have lots of other things to do both related to Epoch and to serious MILSIM
ohh, so you generate the list only once per mission load?
No... because it has to set up the dialog each time you access the traders. Actually if someone could advise me (maybe offline) on how I might do that (not looking for someone to do the work for me), I would change things. Do hate dialog code though which is why this is code I just make incremental changes to - and mainly outside of the dialog creation portion
I do realise that this is not necessarily the best way to do things though 😉 But the scope of sorting all those items, (weapons and mags by mod and type - handgun, ar, lmg, smg, shotgun, gl, launcher, sniper, magazines by what they do - building parts, medical, loot, food & drink, clothing by type - military, male, female, etc.) does require a bit of work.
So it could be different every time the dialog is opened?
Since it's so many items, I would do most of it during pre/postinit if possible
And just save stuff into a variable
Not that set up no... the items available to sell to a trader will change for example. Was my understanding that globals should be avoided...?
Especially one potentially so large
Wouldn't the game lag or dialog take some time if it's that many items?
Actually not
Why should using globals be avoided?
That was what someone said to me once... ? Was told to try and minimize their use in ARMA. I may have been misinformed
Back when I was starting out
If not then I guess I could just run that code at server restart and store in a global instead of the current local var
Extract that bit from the trader menu and simply use it when a player interacts with a trader...
unrelated
Result:
0.001 ms
Cycles:
10000/10000
Code:
call {
systemChat (selectRandom ten_arr);
};
Result:
0.0067 ms
Cycles:
10000/10000
Code:
call {
systemChat (selectRandom ['test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test','test']);
};
It just uses ram
I think I tried to crash my game once to see if globals kill performance
At ~30million variables the ram usage reset but It didn't crash
I think that means it moves stuff from ram to page file or sth
Which would be slower
So if it needs something next time there might be a stutter. (like when textures load in)
I'll work on extracting the code then. Should be pretty easy... And given it would then run on the server at restart it should alleviate any server FPS issues when a trader dialog is opened. My dedi is pretty good so should be good. Thanks, appreciate it
Also do what gnashes said before
If you are rewriting the code
I wouldn't even use switch at all
ever
Will do so... something similar at least. Basically was just modifying not rewriting the code in the past for this particular script (have rewritten several others) but now I will rework it for 2018 😉
@peak plover again, pure performance vs readability (thus easier maintenance)
The performance difference on the page are for 10000 iterations; for one use the difference is virtually non-existent
I'd argue that switch is less readable
But that's preference
He is using switch instead of if / select
cuz there's only 2 options in that switch
switch case > if else if else
so im trying to give my zeusses a quick and dirty action to take units around them as prisoners. i have a few issues though. the action and set captive and everything works thats ok, but what i cant seem to get working is to have them drop all their weapons and make the whole thing work with the ace captives system
because i want to load them in vehicles and drag them around as well
one thing is removal of weapons. i can use removeallweapons, that works, but if i want to use each weapon individually i seem to have issues when using
_unit removeWeaponGlobal (primaryWeapon _unit);
sleep 1;
_unit removeWeaponGlobal (handgunWeapon _unit);
sleep 1;
_unit removeWeaponGlobal (secondaryWeapon _unit);
wait... it seems to work now....
wtf
hmmm nope... so it works when i run the line from a units initbox during the mission, but when i run it from a script, it just removes the rifle...
hmm yea... so if assign a variable to a unit and then run these lines from the debug console it works
but if i spawn this function with the unit, it only removes the rifle
FEZ_FNC_Dropweapons = {
private _unit = _this select 0;
_unit removeWeaponGlobal (primaryWeapon _unit);
_unit removeWeaponGlobal (handgunWeapon _unit);
_unit removeWeaponGlobal (secondaryWeapon _unit);
};
also if i do like this, i have to run the functions multiple times....
FEZ_FNC_Dropweapons = {
private _unit = _this select 0;
private _weapons = weapons _unit;
{_unit removeWeaponGlobal _x} foreach _weapons;
};
alright so that was stupid.... i had my own function overwritten with a non functional one....
nevermind then....
so after thats solvd: how do i make them ace prisoners so i can load them and drag them around?
thought i could just call ace_captives_setHandcuffed but that doesnt seem to work
actually it does. so far so good. now i just would like them to use different prisoner animations. that used to work fine with switchmove but nor it seems to put units back into the standing handcuffed animation
except if i use "Acts_ExecutionVictim_Loop"
these sitting animations dont seem to last "Acts_AidlPsitMstpSsurWnonDnon01","Acts_AidlPsitMstpSsurWnonDnon02","Acts_AidlPsitMstpSsurWnonDnon03","Acts_AidlPsitMstpSsurWnonDnon04","Acts_AidlPsitMstpSsurWnonDnon05"
and how can i drop a units vest including its contents into a weaponholder?
_unit action ["DropBag", _weaponHolder, backpack _unit]; works for backpacks, vests doesnt seem to have anything siomilar...#
private _vest = vest player;
private _vItems = vestItems player;
removeVest player;
private _gwh = createVehicle ["GroundWeaponHolder", getPosATL player, [], 0, "CAN_COLLIDE"];
_gwh addItemCargoGlobal [_vest, 1];
{
(((everyContainer _gwh) select 0) select 1) addItemCargoGlobal [_x, 1];
}forEach _vItems;
``` is one way. Not 100% sure if there's a better way.
If I get time later today, I might circle back around and see if there's something more viable. I wrote that a few years back
Quick question regarding ACRE and RHS
I'm trying to use scripting commands from ACRE to add ACRE racks to RHS vehicles, and am having no success. Grabbing documentation for the ACRE commands asap
I'm not sure why this won't work with RHS vehicles. I know RHS config's are annoying and badly structured but it shouldn't interfere with scripting commands (I hope...)
thanks @ruby breach works as it should
now i got to still get the guys to randomize their animations a little. i still dont really understand why the sitting stuff wont work. but i also cant find the reference on how these animations are put together...
@proven crystal private _unit = _this select 0; what is _this referring to?
Whatever he passes as a parameter?
What do I need to watch out for when "hot swapping" Module init functions? All other functions can be recompiled without restarted Arma with the known approach of having the addon folder at the arma root directory but it does not seem to work with all functions I call through a module init function
_this is the input parameter that you get when you call or spawn or execVM or whatever a function
I know that I just didn't see the parameters
well there are none. he's not calling the func
Is there a simple way to
have a texture be the same size on the in-game hud as in photoshop?
you know you can zoom in photoshop right?
and you know that there are displays with different DPI right?
And you know that people can change the ingame hud size right?
safezoneh/w
My idea would be. Store the size in pixels. And use the pixelGrid system
safezone doesn't give you screen resolution, nor DPI
imagine someone looking at it on a phone screen. You just won't ever possibly get the same size as in your photoshop on your desktop
I want the element to always be the same size
No matter scren
aspect ratio
With safezoneW it seems to do that
what is your definition of "size" ?
centimeters, pixels, aspect ratio, percentage of screen size
percentage of screen
then safezone should work. But safezone respects GUI size I think. So you'd have to account for that somehow. Are there maybe safezone commands that ignore gui size?
hey there. Do someone know how to disable fireflyies???? after update i have scenerio full of them 😄
So I could measure stuff in photoshop and just write the configs without trial and error
@lucid junco enableSimulation [false,true]
wrong sorry
again. Size is relative.
"in photoshop" yeah.. Zoom.
@lucid junco
taking your screen size. And the image size in pixels. Then calc that down to percentages
But keep in mind that safezone is not edge of screen
@peak plover thanks man. didnt know where to start to search this
Np, you should ALWAYS disable the animals for multiplayer
they are not synced and will cause people to see rabbits that no one else can see
What do you mean by that dedmen, safezoneX is left side safezonx+safezonew is the right side, right?
no
it's still a bit off of the edge of the screen
https://community.bistudio.com/wiki/File:UI_all.jpg red is safezone. black is screen size
as you can see. Read ends sometimes before it reaches the end of the screen
apparently the safezone Abs commands can fix that tho
So how would I be able to break it?
Change from very small to large?
And it should not be on the corner anymore?
The size will probably change somehow.
Best you just try around
looks like battlefield 😄
Maybe you'll have more luck with pixelGrid.. I never t ried that
No
that's perfect
the 2 screenshots
have different sizes
But hud is exactly the same size
that's what I want
confused well. Good night 🛏
Already 2 hours over when i planned to sleep ffs
😴
what can i do to select a thrown object to pass it to a script?
🤔

I forced to the side and bottom with safezone
I don't think I can use pixel here
Because the texutre at the bottom
it would get stretched
From what I understand pixelgrid is not really for that
Having problems with your life config huh?
@sturdy cape what can i do to select a thrown object to pass it to a script?
["CAManBase", "Fired", {_this call health_fnc_onFired;}, true, [], true] call CBA_fnc_addClassEventHandler;
// grenade
659: handgrenade_throw.p3d
Do you mean like this?
health_fnc_onFired = {
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
private _varName = str _projectile;
health_firedNamespace setVariable [_varName,[_unit,_weapon,_magazine,(velocity _projectile)]];
health_firedNamespace_variables pushBack (_varName);
// check if the namespace should be cleaned
if ((missionNamespace getVariable ['health_firedNamespace_nextClean',CBA_Missiontime])> CBA_Missiontime) exitWith {};
call {
// set time for next clean
missionNamespace setVariable ['health_firedNamespace_nextClean',CBA_Missiontime + 1]; // todo bigger delay
private _variableCount = count (health_firedNamespace_variables);
// only clean if more than 300 variables
if (_variableCount < 300) exitWith {};
// delete amt will be 100 less than the total amount
private _deleteAmount = _variableCount - 100;
// loop through the first 100 and set them to nil in the firedNamespace
for '_i' from 0 to _deleteAmount do {
health_firedNamespace setVariable [health_firedNamespace_variables # _i,nil];
};
// delete the oones that were set to nil from variables array
health_firedNamespace_variables deleteRange [0,_deleteAmount+1];
};
};
//[blu_0_1,"Throw","HandGrenade",[0,0,0]]```
Does anyone know if I can turn the following into a simple math?
private _stopAt = mission_health_fullHP / 3;
_stopAt = call {
if (_hp > _stopAt*2) exitWith {
_stopAt*2
};
if (_hp > _stopAt) exitWith {
_stopAt
};
0
};
Well I know how to make it simpler I guess
if (_hp < _stopAt) exitWith { 0 };
[_stopAt, _stopAt*2] select (_hp > _stopAt*2)
More expensive. but simpler
Well id prefer to work without xeh.just need to select the ammo object on the ground as param
I thought there would be like a special division and super math for that 😂
Without XEH? @sturdy cape
Do you guys not have CBA?
i am not sure what that code is supposed to do
especially because my head is currently somewhere else
I divided my hp into 3 chunks
I want it to stop at one of those chunks based on which chunk it is in right now
I was wondering if a simple math equation could replace if etc.
but: to get it "cleaner":
private _stopAt = mission_health_fullHP / 3;
_stopAt = switch (true) do
{
case (_hp > _stopAt * 2): { _stopAt * 2; }
case (_hp > _stopAt): { _stopAt; }
default: { 0 };
};```
chances are however, that this is the slowest variant
hmm, yeah, I thought there's a math formula for sth like that
well ... technically, there is
The cleanest way is for me to define the code for my call as a function and then just call that one 😄
fnc_ceil_to_neirest = {
params ["_val", "_multiple"];
ceil (_val / _multiple) * _multiple;
};
[_hp, mission_healt_fullHp] call fnc_ceil_to_neirest;```
hf
will not really get simpler
you may want to use floor though
depending on your requirements
as this would still round up 🤷
stupidity
as i said
at work now
not really that much of a fast thinker then besides work related stuff
So they introduced BIS_fnc_3DENExportSQF which exports everything from EDEN, including markers and vehicle customizations to be called and dynamically recreated in a ZEUS mission, or a regular mission I suppose.
I managed to export the code from EDEN with it, but how do I actually use it in a zeus mission? The calling parameters are not documented or I can't find them...
just look into the script it generated
if it takes parameters, you'll read that in there
right, it takes a forest of arrays, do you happen to have an example?
it takes? Are you sure?
It should contains tons of arrays with all the info. I don't know what parameters it could even take. Can't think of anything that would make sense there
params [["_layerWhiteList",[],[[]]],["_layerBlacklist",[],[[]]],["_posCenter",[0,0,0],[[]]],["_dir",0,[0]],["_idBlacklist",[],[[]]]];
this is the first generated line, I'm guessing the reason it's not executing is that
I tried calling it without supplying arguments, but it doesn't spawn anything or give any error
you're supposed to call it from the debug console during a zeus mission for example?
I guess so yeah
alright, I'll dig around and if I find anything I'll post back
Module Scripting in 1.86 with is3DEN = 1: 'init' mode is no longer called when the module is placed in 3den. Only 'attributesChanged3DEN' seems to be called now.
Does anyone know if this change is intentional?
how can i turn a bundle of sqf scripts that are supposed to be called server side on mission startup, into a server side mod? in their script version i start everything from initserver.sqf
if !(isServer) exitWith {};
another thing could be just mount the mod as servermod only
so i just have to convert the stuff in pbo and load it on the server?
or is there more to it?
i mean i see stuff like config.cpps exist, and i dont have a clue what that might be for
so really i need the basics right i guess
Not really that different. the config.cpp is bascially a description.ext with a whole lot of more options
so if you specify cfgFunctions or some preInit or postInit, it works the same in config.cpp
hmm i did not do that. i just load my functions as variables
e.g. you can add something similar like this into it
class Extended_PreInit_EventHandlers {
class diwako_ragdoll {
init = "call compile preprocessFileLineNumbers 'diwako_ragdoll\functions\diwako\ragdoll\cba_settings.sqf'";
};
};
Just use serverinit instead
But this will require CBA
alright ill try and play around with it.
yea its just a few actions and modules for zeusses and a shooting range thingy. so nothing with models or sounds or anything
modules for zeuses need to be run by clients, unless you remoteExec the code from server onto clients
yes i do that
Just to make sure, you do mean Ares/achilles modules, not ones that are defined in config like vanilla or ace modules
yep, its achilles
so the my config.cpp would look somewhat like this?
class CfgPatches {
class FEZ {
units[] = {};
weapons[] = {};
requiredVersion = 1.83;
requiredAddons[] = {
"ace_medical"
,"cba_common"
,"ace_common"
};
author[] = {"Fetzen"};
authorUrl = "";
version = "1.0";
versionStr = "1.0";
license = "https://www.bohemia.net/community/licenses/arma-public-license-share-alike";
};
};
class Extended_PreInit_EventHandlers {
class FEZ {
init = "call compile preprocessFileLineNumbers 'FEZ\Fez_Init.sqf'";
};
};
oo
oO
i doubt you need ace_medical and ace_common in the required addon aarray., license is optional and only added by me.
now oyu need to look out that your pbo prefix is "FEZ" and the file called "FEZ_Init.sqf" is in the root folder of the pbo
also try serverinit instead of init in the preinit eh
roger
well one of the functions uses ace medical, so ill leave that in there
but i figure ill have to delay workon this for the moment because of this
ace tracers pbo is outdated
error message
which apparently is not only an issue with my own mission file
anyone else here having that?
Well.. Is your ace tracers outdated?
i wouldnt know why it would outdate between yeterday and today?
i mean there was that arma update, so i wanted to check if this is a common issue maybe?
Uh well.. How about the ace update from today?
ah damn, yes i ran a modpack that contains ace instead of the real thing
ok so i would have my @fez folder and inside that i have a fez.pbo and the config.cpp right. the fez_init.sqf is in the root of that pbo
should do?
yes, no, yes, yes
your pbo is in the addons folder inside your @fez
and ..... edits message
oh alright... thats why i keep asking these things ^^
Ok i see others have a mod.cpp in the main mod folders. Thats for displaying general mod info?
ju
ok... and a key i understand would only be required if its also a client side mod?
ye
would it cause issues if clients have it loaded and no key available?
with verifySignatures enabled you wouldn't be able to join servers
ok so just to be sure i would create a key anyway. although i think our unit server doesnt do it. there is a modpack that is only partially signed
@tough abyss
how to make it so that I can get allies to join my squad when I go near them
https://community.bistudio.com/wiki/ArmA:_Introduction_to_Scripting
https://community.bistudio.com/wiki/addAction
https://community.bistudio.com/wiki/nearObjects
https://community.bistudio.com/wiki/select
https://community.bistudio.com/wiki/side
https://community.bistudio.com/wiki/join
I think this is all you need
hurra this seems to work nicely!
thanks everyone, i have just created my first little mod
needs some finetuning though
it seems to want to load some functions already when i open the editor... how could i prevent that?
use the is3DEN commands to detect editor
if (is3den) exitWith {};
but will it load the stuff then when i launch a game from eden? if it has exited the scripts before? or does it launch the whole stuff again when i hit "play in multiplayer"?
when you hit play ok in the lobby, the mission will load and it will https://community.bistudio.com/wiki/Initialization_Order
preInit will run
ahyes... sweetness. all works like a charm
Is it no-longer possible to switch the owner of a zeus module via the scripting API? (I had missions that depended on the ability to switch zeus based on in game pickups that no longer work)
I haven't tried online, but it worked in local multiplayer an hour ago
so i figured out to make keys and everything, but how do i pack the stuff with the addon builder? do i have to do it directory by directory?
with pbo manager i just pack the whole thing but i dont think i can binarize the sqfs with it
hmmm works if i dont binarize i guess
sqf's can't be binarized 🤔
ah ok. was just hoping i could hide my crappy code ^^
do you mean obfuscation?
making it unreadable. i thought it was both the same thing yep
obfuscation!=encryption!=binarization
they are all wildly different things
Also we help you here getting your code working. And you thank the people that help you by hiding it from everyone and preventing people from potentially learning from your code?
no just until i cleaned it up!
shakes head
i wouldnt mind people looking it in general. ont worry. i did send it to some poeple already.
theres a whole page full of really unnecessary remoteexecutes for some actions.... it just looks shit this way
put it on github. open source. And then send people the link so that they can drop comments everywhere 😄
the whole point of my question was to avoid that embarressment until the new year :D
Okey i can wait till then. Enjoy your new year banana cake
🍌 🍰
dont be mean when i do 😬
Whoa, banana cake is great
🍰
Best form of obsfucating is writing terrible code
No one can steal your code if it's broken and does not work
🤔
They can. And you have been here for long enough that you should know that people will still steal broken stupid code
lul. was already waiting
Instead of doing if checks or writing the same function twice, sometimes when the function can be similar, it would take less space to write it only once and do the changes to the string
So having 2 - 3 more specific functions with a lot of less checks in each and only writing all the code once
but it doesn't make a big difference and is pointles
Unless it's something that runs like every frame for every unit or sth
Looking for a script that i can place on a radar that pretty much deletes (would prefer if they blew up) bombs dropped from planes?
I haven't seen one
But I guess safe zone scripts are kind of like that
@nimble raven Do you know if the bombs work on the fired EH?
["CAManBase", "Fired", {systemChat str _this}, true, [], true] call CBA_fnc_addClassEventHandler;
This, but for the plane
And then if it has the bomb in there
You can add a per frame handler and check if the bomb is near the radar or if a radar is near the bomb
Then copy the position of the bomb and delete the bomb.
Spawn in an explosion
Because I think you can't setDamage 1 for bombs and cause them to explode
I think you can
I posted in help and was referred here... is it possible to store variables on bullets using the fired event handler?
yes
kind of
bullets don't have a namespace, but you can str the bullet and use that as variable name
@peak plover Well... I was doing that but the problem was the ability to access the variables once the bullet became a nullObj
So I tried storing the bullet as str from the beginning and doing call compile _projectile to access the actual obj but it seems like having a colon in the name is messing it up
remove the variables stored on the player with the bullets name
What do you mean by that
I was using a naming scheme like TFR_%1_path... an array stored on the shooter that tracks the bullet's path
when the bullets name is stored as a str, that's easy enough
You want to track the path?
but when I'm tracking the path I can't use getPos on the str and I can't seem to get back to an object reference
Yeah, I need to track the path and some other things
Tracking the path means you are saving the position on every frame
Not every frame, but yeah, that's the idea
All you need is to run a cba PFH when the gun fires
Pass the projectile as an argument
no need to str
PFH?
So this is where it gets tricky then
What do you mean
What I'm trying to do is track the projectile until it hits a "target"
the targets have event listeners and tell the shooter that it has been hit so it stops tracking the projectile
target will be an animal but it can be anything at this point really
No man hold on, I'm trying to explain what happens
Once the projectile stops being tracked, the "target" connects the impact position with the last tracked point to get the angle the bullet was traveling
then I have to do some other mathmagician stuff to figure out whether or not that would intersect where I have notional "organs"
If it always hit, this wouldn't be difficult either but you already referenced the "misses" and that's the real problem. Clearing these variables on a miss
not sure how many memory points animals have
but you can attachTo some objects inside the animal
Sure, yes
for the projectile
You can just save the position into an array
ex
PFH runs when bullet is fired
Well that's what I'm doing but once the projectile becomes null, I have no way to reference the stored data
On hits I can clean it up fine because I have another _projectile reference from the hitPart eventListener
but on a miss, the projectile just becomes a null object all that path data remains
// as arguments for pfh:
[_projectile,str _projectile,_firedBy];
// PFH
params ['_args','_handle'];
_args params ['_projectile','_projectileStr','_firedBy'];
private _arr = missionNamespace getVariable [_projectileStr,[]];
If (isNull _projectile) exitWith {
// remove the PFH with _handle
// use the firedBy (player object who fired)
// and the array from projectileStr
};
_arr pushback (getPosASL _projectile
I really think it would be easier to avoid using the PFH and use hitPart EH if possible
no way to reference data stored just store the str _projectiel as an argument
@vapid drift Test this out:
Put objects inside the animal to represent organs
Add hit eventhandlers to the objects
Attach objects to the animal
See if th bullet penetrates the animal and hits the objects
That might be the easiest way to do it
that's what I wanted to do to begin with
Hey guys, Has anyone had a look at Warlords yet? I was wondering about a few things...
I even though about making my own custom helper object type organs
@drowsy axle I did, ask away
How do the CP get taken away.
that would eliminate all of this work but using existing items is a no go because of the awkward sizes
I was thinking more of like a soda can
some vanilla items
@drowsy axle what do you mean
@peak plover I'll play around some more with the string stuff and see if I can get it to work
I tried some objects roughly the size of lungs and what not but a .50 couldn't penetrate them so... lol
What's the issue with the str thing?
Did you get it now btw?
@drowsy axle
_add = -100
{
_x setVariable ["BIS_WL_funds", (_x getVariable "BIS_WL_funds") + _add, TRUE];
} forEach BIS_WL_allWarlords;
The string thing is that I either have an array of strings or an array of objects
Ahh cool @peak plover
And they both have their own problems