#arma3_scripting
1 messages Β· Page 459 of 1
For user side it can be used for some minor stuff, like writing in-game notes, or smth (no clue yet)
admin, by access level, from godmoding himself|other player, up to plain code exec.
Where thing like himself|other will be segmented by permissions.
looks interesting π
just don't know if its worth it yet. There are alot of more user-friendly tools around.
@little eagle >I propse a new command: selectIf
@astral tendon >is selectIf a comand?
Well... It is now! https://github.com/dedmen/Intercept_CBA/commit/d39ee4dbe9f4ef64fbc99de7c428c1721356fe08
@tough abyss If you know how SQF works then you don't need to tell anyone the difference between a variable and a inline array. Because at the end both are exactly the same. The array returns an array. And the variable returns an array too. so in both cases you just have append ARRAY
A bit of clarity doesn't hurt, and when you've been away from arma for a while its hard to remember all the quirks of SQF. If you know how SQF works, you aren't reading a wiki page about arrays.
Assuming that's what you meant.
How many "Location" objects should be considered fine?
Would around 100-150 be fine?
select if?
uhhh
@hollow thistle
I tried with 100k
Only impacts fps when map is open
I guess with invisible ones it does not impact map?
as long as you are not getting into the thousands you don't need to worry about it
In liberation currently there are markers that are preplaced in eden.
They are "parsed" into array and used as sectors.
You could autodetect most of them by using locations https://community.bistudio.com/wiki/Location CityCapital is a big zone
I though array of locations could be more usefull as you can use them in "object" oriented way.
Well markers are not locations. If you need markers for something then you need them. Also dunno how easy it is to place locations in 3den
Auto detection of map locations would be cool but i think manual placement of sectors is better for our use case.
I had mine create 2 cluster arrays
1 for players 1 for ai
ai + all objects etc.
I was experimenting with clientside caching
Right liberation
I remember, the circles around areas
hello, i have a question. Is possible to calculate size of structured text control for given structured text?
something like hint calculation, but i need to use my control
Ye we are rewriting it from scratch for better code and performance. That's why im researching how to reimplement core functionalities in better way.
@verbal otter Do you mean the size of the text to be bigger?
So basically
the background of the control must scale according to the text?
@peak plover yes
I had something for that but can't find it right now. I remember someone else doing this here, but that was a while ago
I think I had my own thing but I just had something with the lenght of the string
and then resized the dialog accordingly
Try counting how many can 1 line fit and then modulo of that or sth along those llines
thank you! will try
i think - resize structured text like <t size='2'> is use (text size from config) * 2
yes, i know that π i just have issue with calculations of size control
@peak plover 100k locations? jeez.
Hey ! i am looking for a way, to check if the player enter in collision, with any objects in the game, i tought about checking the distance between the player and nearestObjects, but its a little tricky,what you guys would do ?
if the player enter in collision What does that mean?
If the player will soon collide with something? Or is he currently sticking his hand into some other object?
I mean, if a player run, then he got stuck in front of a wall, or a house..
He is currently sticking.
thats what i meant, sorry for my eng xD
you can use cameraViewDirection and lineIntersects to check if something is infront of the player
not sure if players triggere epecontact - because they collide with geometry LOD, not geometry Physx LOD
if you say it worked for players, then i doubt this changed.
i didnt get it to work for players
aha
You cant attach EpeContact to a unit for that case, it will only trigger at the time where you ragdoll from a car hit for example. So ^ Dedmen statement is more reliable.
Doesn't anyone know a good tool to edit stringtable.xml files? Something with a nice GUI?
nice thanks, I have been using stringForge.
Do you guys know if there is an eventHandler for side chat ? Or a good script that can run some filters on the text?
You can't.
@lone glade Well, you can return and read text from the chat. But you can't "filter" it ^^
@gleaming oyster How do you read from chat
@earnest path same concept: https://forums.bohemia.net/forums/topic/195346-release-arma-3-custom-chat-commands/
@gleaming oyster Thank you this seems nice
How do I get the world position player is aiming at (where the cursor is), where he is looking at. I do not mean the muzzle direction either.
cursorTarget maybe?
cursorTarget wouldn't work anytime
That's returns the aiming position doesn't it?
I am assuming this is supposed to work regardless of location or what you are looking that
AFAIK yes it works all the time. I can't remember what world position it gives you if you look at the sky, or the "fog" if you view distance prevents drawing.
where he is looking at
Dscha...welcome back. Cigs in hand with internet?
My best guess would be LineIntersect or just intersect
@errant jasper "Target" ? doesn't that just return say buildings or objects?
cigs in hand? Wut?
You said you were off to go get cigs and didn't come back for a long time :)
What? Target?
cursorTarget
The target has to be known to the player to some degreeΒ
Eh....
Does wiki need updating?
But if you want the direction the weapon is aiming at, I guess you should take weaponDirection, extend it (from weapon muzzle position) with vectorMultiply, and do intersection checks
CursorTarget/object if the wants that.
Are we talking about Taro's request? He wants the position.
How do I get the world position player is aiming at (where the cursor is), where he is looking at. I do not mean the muzzle direction either.
π
Yes, take the muzzle position, add to it the weaponDirection extended far enough (say 5km), and use an intersection check on that?
pos [0,0,0]
Muzzle, no
I would like to test how my scheduled code behaves when scheduler is heavily loaded (for learning purposes) how should i emulate that? limit my fps to eg. 20 and spawn bunch of AIs?
I do not mean the muzzle direction either
He want's to know, where the player is looking at (head, not Weapon), if i understood him right. @thorn saffron Clarification please
He said aiming at
Read what he wrote
Grab the position he is looking at with weapon as in a position([0,00,]])
Well, he can't have it both ways, aiming != looking
So looking just use screenToWorld.
Hehheheh
@thorn saffron use screenToWorld
Discord nitro treatin you nicely to captain emotes from cup disc? :^]
@cosmic lichen there is also that weird arma stringtable tool on my github github.com/dedmen
I use that for TFAR
@gleaming oyster The target has to be known to the player to some degree for cursorTarget is correct
@still forum Yep, we were talking about cursorTarget
@hollow thistle lowering FPS doesn't change load on scheduler much I'd say.
Spawn many threads with while true loops that do some basic arithmetic. Like adding numbers or smth
This obviously doesn't apply to screenToWorld
screenToWorld doesn't respect buildings. Only terrain
@still forum maybe loops with sleep ?
no
or is sleep special and not considered as load?
sleep suspends the script
giving the scheduler time to execute other scripts
which I guess is the opposite of what you wanna do
Server fps below 20 affects scheduler yes?
no
server fps below 20 affects netcode
@gleaming oyster you can use screenToWorld to get the furthest possible point. And then do lineIntersects between eyePos and the screenToWorld pos to check if anything else is inbetween
Ecample for lineIntersectsSurfaces
_PosStart = eyepos playeras start_PosEnd = positionCameraToWorld [0,0,10](10 = Range)
Code Example:
_LIS = lineIntersectsSurfaces [_PosStart, AGLToASL _PosEnd, player, ObjNull, true, 1, "GEOM", "VIEW", true];```
Cycle through the Output of `_LIS`
Taken from OBE code, no clue anymore if something else was missing there ^^
just replace posCamToWorld by screenToWorld
I know there was something, why i haven't used it 
@hollow thistle You can create millions. They only impact fps on the map, and maybe for obscure scripts that iterate nearestLocations. Check FPS on the map to see how bad it is.
Interesting that eyePos for example doesn't change by Z, even if you are looking to the sky. But when you ALT it does. So Arma wants to tell me that my character is still looking at the same spot in front of him instead of head actual direction? Imagination of how eyes would really look like in that case gives me creeps.
How do I select only cargo that is not loaded into a vehicle? Here is the code I am using to get the supplies:
_supplies = nearestObjects [_churchpos, [ KP_liberation_supply_crate ], 50];
You mean the crates? Lol
yeah
KP_liberation_supply_crate just equals CargoNet_01_box_F
would i need to build a list of nearby vehicles, check all their inventories for supplies and build a list, then use the list to exclude objects from my search, or is there an easier way?
I gues you could use the cargo commands like magazineCargo and do something like:
_peaShooterMagExitsts = "peaShooter" in magazineCargo _boxThing;
itemCargo, magazineCargo,weaponCargo,backpackCargo. etc
isVehicleCargo is for ViV i believe
Return transporting vehicle if vehicle is loaded in one.
Yeah, doesn't apply to cargo in the sense of items, only vehicles
Liberation uses attach to "load" a crate right? So maybe: private _unattached = _nearSupplies select {isNull (attachedTo _x)}; ?
@errant jasper I thought he was talking about containing items?
OH. In a vehicle???
Man I'm dumb. My bad
I dunno. @naive oyster are you talking about how you load supply boxes that can be loaded unto Truck in liberation?
This is what happens when it gets loaded: https://github.com/KillahPotatoes/KP-Liberation/blob/65157c7ec18012772d2cf785a3e05d6821f90a93/Missionframework/scripts/client/ammoboxes/do_load_box.sqf#L24 .
So you should be able to use the check I wrote just before to get those not loaded.
https://s.sqf.ovh/Brofiler_2018-05-18_20-32-45.png Call me crazy... Script profiling down to every single script instruction.
See the long GameInstructionFunction at the bottom that's taking so long? That's a call to format
Nice!
The bottom last one to the right, the teal/greenish one?
Formats are heavy
GameInstructionFu one
yeah. But in my last profiling format was still faster than the joinString equivalent
you was saying that latest profiler build has some troubles with current game version or it's working, Dedmen ?
Fixed yesterday
link ?
https://github.com/dedmen/ArmaScriptProfiler/releases/tag/RC5 yesterdays build. Without the assembly instruction profiling π
ty
@errant jasper thanks, that works perfectly. now you actually have to stop and unload the cargo truck for it to count for the mission goal.
Question, I noticed in AI behavior that the AI would automatically locate enemy artillery that is bombarding it's position. How could I exploit this in such a way that the AI would automatically counter-battery if they have artillery as well? Like a scorcher detecting the unit, and dropping it's own arty?
Is there event handler that can automatically detect type of unit spotted?
No, but you could make one
if (!isPlayer _x) then {
_x enableGunLights "forceOn";
};
} forEach allUnits;``` Could anyone help me with why this doesn't work? It should force the flashlights of AI on yet it doesn't
I run this in init.sqf since it is for all the AI currently placed down in the editor
if they don't have flashlights it won't work ofc
Yep, made sure they got the flashlights
is it possible to change the color of the background that appears behind addaction?
and again, hory shet dude, profiler works π
i was not expected that you can get that level of debugging... thanks man @still forum
Is there a way to see the server time on Linux in sqf?
Trying to replace this statement. _currServerTime = call compile ("real_date" callExtension "+");
@cunning storm nope. That's why that extension was made
Does the dll run in Linux?
99% the dll does not. Does it come with a .so file ?
No. It is just a dll file.
I'll probably have to do notifications through BattlEye or something then.
According to KK on his blog, https://community.bistudio.com/wiki/missionStart now works.
Maybe that can be combined with diag_ticktime depending on your needs.
No way to know IRL time in SP, right?
no
shaaame
Sigh... Yeah shame. Don't understand these half-implementations.
Remind me of A2 era, where something either was scripted to only work in SP or dedicated, but would fail on hosted server....
I think it was the opposite, at least the main campaign had to be hosted to work
@meager heart i was not expected that you can get that level of debugging. I also had a real debugger with breakpoints and viewing/editing variables and stepping through code and all the bells and whistles
dude so far what i saw/tried from your projects... you're doing the right things π
Don't have enough time to do all the things I want tho ^^
There are dudes saying you can remove connection/disconnection messages from chat control. Wondering how true is that. Any ideas?
@still forum Like what? Can you give an example? like ctrlSetText? blah?
no. Backend intercepty kinda stuff
Damn it.
Hey, is there a way to disable the connection and the disconnection logs from appearing? (The ones in the bottom right of your screen)
There is a way to kill the whole chatlog, if that would be sufficient. Deleting specific messages is curiously and sadly not possible.
Otherwise not with scripting.
Is it possible to do an inline method? Rather than a function, so I don't need to add it to CfgFunctions.
Just something like, for example
_doThing = {
_y = 20;
_y
};
Yes, you can put functions into local variables.
Can you give me an example? The above is how I'd assume it works, but it returns like a string.
Hmm, what could I make this example about? No idea... Could you maybe instead post your script, so I can look for a possible mistake?
Literally what I posted above.
_doThing = {
_y = 20;
_y
};
_val = _doThing;
hint format (["%1", _val]);
change:
_val = _doThing;
to
_val = call _doThing;
You printed a copy of the function. But you need to actually execute the function to retrieve it's return value. call executes a function.
I found a use case for , over ;.
In config this:
onLoad = ctrlParent (_this#0) setVariable ['BWA3_sizeReticle', SIZE_RET]; ctrlParent (_this#0) setVariable ['BWA3_sizeReticleTop', (64/8192)];
errors, because the script uses ; and that terminates the config enty, causing the config to not compile.
This however works:
onLoad = ctrlParent (_this#0) setVariable ['BWA3_sizeReticle', SIZE_RET], ctrlParent (_this#0) setVariable ['BWA3_sizeReticleTop', (64/8192)];
:~P
I'm afarid actually.
@tough abyss
{
if (side group _x == west) then {
_x addEventHandler ["Killed", {
params ["_unit"];
private _marker = format ["commy_corpseMarker_%1", _unit call BIS_fnc_netId];
createMarker [_marker, getPosWorld _unit];
_marker setMarkerShape "ICON";
_marker setMarkerType "mil_warning";
_marker setMarkerColor "ColorBlue";
_marker setmarkerSize [.5,.5];
_marker setMarkerText name _unit;
_marker spawn {
sleep 240;
deleteMarker _this;
};
}];
};
} forEach allUnits;
This seems more reasonable to me.
I'ma go give her a swing
is that top bracket actually needed? I included it in the code snippet because the OP did it
I see
Well it would be nice to see where only your body is, but if it shows on all clients that's not good
setMarkerLocal would fix right
Oh right. I forgot that createMarker creates it everywhere. Disregard what I said.
If you wanted to make the marker only be shown for the player, then you would have to use createMarkerLocal and all other local marker commands like setMarkerTextLocal etc.
Because if you use any of these not "Local" marker commands on a local marker, the marker will become global. This is because this game wasn't actually meant to be played or scripted for, but actually specifically to upset reason and logic and me personally.
What would be a good way to determine if a vehicle is armed? Such as HMGs or armed air vehicles. Would I need to check the weapons on the turrets, or is there an easier way?
Sometimes i dream of having something like ownerUID along with owner so we can detect UID better and faster than this:
private _owner = remoteExecutedOwner;
private _userArray = allPlayers select {(owner _x) isEqualTo _owner};
if (_user isEqualTo []) exitWith {}; // User not present anymore
private _user = _userArray select 0;
private _uid = getPlayerUID _user;
This is easy to make yourself though.
Sec.
// preInit function
commy_ownerUIDs = [];
addMissionEventHandler ["PlayerConnected", {
params ["_id", "_uid", "_name", "_didJIP", "_owner"];
commy_ownerUIDs set [_owner, _uid];
}];
// any script
private _uid = commy_ownerUIDs select _owner;
π€ thats actually way better. ty
You may have to broadcast commy_ownerUIDs using publicVariable or setVariable public if you want to use the array on clients.
filtering the __SERVER__ could help too π
So, I'm trying to change Kerry's loadout at the beginning of the first Mission, but it always loads as the same kit. where would I go to alter its loadout?
yeah
I was always wondering, who is owner 1, mission instance? π
The campaign is not very editing friendly. It's a set of hard coded missions.
it should all be in the mission init correct? cause I'm looking through it, but I cant seem to find it.
I don't know how that mission or the campaign works internally.
Well basically I've extracted it, and made it a scenario for eden.
That is some good first steps.
i mean first name will be __SERVER__ with PlayerConnected, commy
kinda server connects to itself π€
and by filtering i mean that ^
I was always wondering, who is owner 1
__SERVER__< he is
I remember sth about setting variables to map objects. It should still work for buildings? I think it was stones don't get them or sth?
sldt1ck, I don't understand what problem you're trying to circumvent here. PlayerConnected will not fire for the server iirc, and even if it did, how would that be a problem?
nigel, there're different kinds of map objects. Some support it, some don't.
with that filtering you will get actual first player, with PlayerConnected
and afaik it will fire for the server (might be wrong)
I think you misread the script, sld1ck.
You get a full array of all connected clients (and maybe the server) and the index position inside that array is the owner id.
So you can get the UID quickly from the owner id.
don't know man... maybe you're right and there is nothing to worry about π
I am right.
@meager heart server is 2 not 1?
afaik local host is 2... not sure about dedicated
Dedicated is always 2 too.
So thats why im wondering what stays for 1 all that times π
Nothing will stay at 1.
The array is either empty, or as soon as someone connected, be of size 2 or larger.
It will never be size 1.
Sure, index 0 and index 1 will be undefined, but no one has these owner ids anyway, so they're never selected.
Just trying to get BIS logic, like negative is an exclusion on owner -2 // anyone but server, 0 is everybody, 2 server > =3 are clients
So whats -1 and exactly 1 at this point
There is no owner -1.
There's also no owner -2
-2 means every owner except 2.
But that doesn't matter here, because remoteExecutedOwner never reports negative numbers.
As it reports the owner of who sent a script. And owner can never be negative.
No no, im not talking about owner exactly.
[someargs] remoteExec ['someFunc',1];
Whom it will send it to?
Like whos that?
Either nobody or everyone. Not sure.
afaik for RE it's just how they made it, nothing to do with owners id
Undefined behaviour I'd say.
what will return server command #userlist id's ?
"1" remoteExec ["systemChat", 1];
Tested in SP. Nothing happens. I infer that it is executed nowhere.
smart people said that #userlist returns id's, same as playerconnected first param
so 1 for re is nothingness then
I guess. Same as [] effectively.
Does attachto overwrite older attachto commands?
Yes.
guys, is there a function to generate random waypoints?
or to make ai guard a point but in movement
like guarding a base
BI_fnc_taskPatrol
thanks mate
@peak plover setVariable on stone doesn't error. But doesn't set the var.
Buildings are streamed in/out. So if a building is streamed out and later streamed back in the variable might be gone.
The server or HC "entities" never change position. So I think they always see everything. Or the HC sees atleast the same things
Is it possible to give a player a full screen radar while not being in a vehicle?
If the radar is full screen, they could see nothing else. I cannot imagine this being right.
No I want to simulate being an AWACS type thing
Surely you mean the arcade version of an AWACS, because I doubt anyone here is any clue how those things work irl.
I ask because that determines if it is possible to script or not and how much effort it'd take.
Yeah, just one player who has a radar screen and relays information to the fighter pilots
Don't need to compute BRAs or anything
I still have the file of my scripted mission squad radar. Maybe that helps, idk.
Is it possible to use vanilla radar?
It uses the textures of the vanilla radar.
There is no script command like:
enableAWACS true;
or anything like that though. It will take some effort.
Its not a display that can just be created?
My solution is:
if (hasInterface) then {
0 spawn {
disableSerialization;
waitUntil {!isNull findDisplay 46};
findDisplay 46 ctrlCreate ["commy_SquadRadar", -1];
};
};
So it is a control that can just be created.
14:12:52 soldier[O_Soldier_AR_F]:Some of magazines weren't stored in soldier Vest or Uniform?
14:12:53 Duplicate weapon Throw detected for B_T_Soldier_TL_F
14:12:53 Duplicate weapon Put detected for B_T_Soldier_TL_F
any idea?
Just ignore.
screenshots of code? really?
i can't ignore it
There is an error there points at screen
since spawn 1k AI and they should be only 6 xD
That error message has nothing to do with 1000 ais. Are you asking how to make it stop creating so many ais?
First one. Stop using BIS_fnc_param. That's like the worst you can do. For one there is param and second there is params
saw error in params
Second. Why are you setting _pos first to objNull and then to an array?
Third why are you setting _ran first to objNull and then to number?
Fourth why are you setting _rad first to objNull and then to number?
Fifth why are you setting _grp first to objNull and then to config?
i start using it cause of that:
Parameters
BIS_fnc_param has been replaced by param and params. The commands are approximately 14 times faster. Use them!
ah dam, i read wrong
xD
my english still in progress
id did understand that param was replaced with BIS_fnc_param
The commands are approximately 14 times faster.
param/params are commands. BIS_fnc_param is a function
It just doesn't make sense
That's the default value in case the function was called without one.
i was about
private _pos = [0,0,0];
private _ran = 0;
private _rad = 0;
private _grp = objNull;
private _var = objNull;
_var = 100;
Why not just directly set it to what you need?
First setting it to objNull and then immediatly overwriting it is literally useless
because it's under test now
but will be generated dynamically
and will change a few times
same var but changing
what a datatype is that
_grp = configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfTeam_AA";
config
thx
made it work with dataType configFile
params [
["_pos", objNull, [[]]],
["_ran", objNull, [0]],
["_rad", objNull, [0]],
["_grp", configNull, [configFile]]
];
configNull
oki
Interesting can you expect nil in params? π π€
Don't you set nil if you don't want to specify default value but you want to specify expected data types?
That would just make the default value nil
Dedmen, you can use configFile as an example of CONFIG type. I don't think this is objectively worse than configNull.
Don't you set nil if you don't want to specify default value but you want to specify expected data types?
Yes.
That would just make the default value nil
Being nil and being undefined is exactly the same.
So
params [
['_variable',nil,[nil]]
];
Will basically error out if i try to call that function with something not nil? π
Yes, and the error message is just b-e-a-u-tiful: Error Params: Type String, expected Any.
Think it might beat my favorite general result/error: ERROR: OK.
Think it might beat my favorite general result/error: ERROR: OK.
Try this one:
_a = []; _a pushBack _a;
^^ that's nasty
@late gull spawn cannot return data. Because the script is not done when spawn returns
@still forum any way to get returned data with scheduled process?
call.
The code has to be done to get the returned data
All weird workarounds you might be able to do. Are essentially just crappy versions of call
15:33:17 Error in expression <_a = []; _a pushBack _a;>
15:33:17 Error position: <pushBack _a;>
15:33:17 Error 167750984 elements provided, -1362697488 expected
Thats good π
call already can be scheduled.
spawn the call and wait until have data or something like that? xD
Maybe you should describe what you are trying to do.
yeah. That would be the equivalent to just using call. So just use call
Spawning just to wait is 99% likely to mean you actually just want a call as suggested.
yes got it
The call'ed code will also be scheduled if your original script was scheduled.
[]spawn = {
_a = []call fncX;
[_a]spawn fncY;
};
// do something else while the above is running
[]spawn fncZ;
that's what i was looking for
private _fncXReturn = [];
private _fncXAsync = _fncXReturn spawn {
_this pushBack (call fncX);
};
// do something else while the above is running
waitUntil {scriptDone _fncXAsync;}//wait till fncX is done.
(_fncXReturn select 0) contains fncX's return value
one sec
See you are also in wish SQF had closures camp.
fixed
great, will save that, thx
I like it, Dedmen. Well I don't, but it's madness and chaos.
block what?
private _fncXReturn = []; // <-- this private block the scope
private _fncXAsync = _fncXReturn spawn {
_fncXReturn pushBack (call fncX); // <-- this is not the same var
};
Yeah, but Dedmen fixed it in his edit.
As I said. Should be using _this and I fixed it already
ahh k
But just to be clear, this pattern is only really necessary, if whatever "work" you spawn off actually takes time, as in sleep or waitUntil. or the like.
If fncX just does some simply number arithmetic, it is unnecessary.
spawn is never necessary.
π€
Well, he's right, it should never be necessary. But some people (not me) just want to watch the world burn want to run code from event handlers that sleep and the like.
@little eagle u said that call it's already scheduled, so i can use sleep inside of it?
I'm saying that call has nothing to do with unscheduled. call will be whatever environment the original script already was.
{_arr pushBack _x} forEach _arr;
meh-heh
0 spawn {
call {
sleep 1; // sleep inside call
};
systemChat "test";
};
Hmmm, wonder if, _arr append _arr works. Believe we actually discussed this a month or so ago....
but you can't use sleep in standalone call
?? Sure if, in scheduled.
Depends on the environment of the original script. I don't know what you mean by stand alone.
call doesn't change if scheduled/unscheduled. It keeps whatever was there before the call
spawn always moves into scheduled. No matter what was there before
Yeiij, what is the environment of your original script? Do you know?
that is scheduled
so wth, where is not scheduled?
eventhandlers
^
humm
Just read the wiki page about the scheduler. It tells you everything
But tbh, I think waitUntil and sleep directly in the scope of the init.sqf is a bad idea.
At least put it into a different script instance.
i dont do that, just was an example
But it's a classic: waitUntil {player == player} at top of init.sqf, and then wonder why the server doesn't run properly when put on dedi.
well, moving out of that
the hell is wrong with bis_fnc_taskPatrol
ai walk into water
xD
Gotta watch out for those divers man.
But if it starts with BIS_fnc you got some percentage chance of it working, and some smaller chance of it working as intended, and slightly smaller chance of that actually being useful.
I think this one got 2 out of 3 right.
Actually it used BIS_fnc_findSafePos, to avoid water.
So either it is the pathing itself, or BIS_fnc_findSafePos failed and default to some pos in water.
the problem it's the waypoints goin in to the water
and they just walk like there is not water
That's what I am saying. BIS_fnc_findSafePos might have failed (called from BIS_fnc_taskPatrol).
That would help. But it is not fully reliable. I use it, and set the objDist high to spawn groups.
Apparently the roof of buildings is a suitable place to put a Tank.
AI follow waypoints to the best of their ability
if the best path to the waypoint is water, they'll take it.
Through the spawned buildings and beyond!
also afaik there are no water filters in bis_fnc_taskPatrol at all
(default i mean)
Hi guys trying to figure this out, not sure if anyone can help but here it goes:
Trying to add an addaction onto this line of code below but unsure on the syntax
private _lampsIn5000m = nearestObjects [player, ["Lamps_base_F", "PowerLines_base_F", "PowerLines_Small_base_F"], 200];
{ [_x, false] call BIS_fnc_switchLamp; } forEach _lampsIn5000m;
Are those map objects?
that will return [] ^ if objects not mission spawned
Currently tested this with a trigger, which turns off the lamps (objects ive placed on the map) but looking to trigger it instead with a addaction
Not only that, but I also believe that you cannot add actions to map objects. On the other hand, there is this carrusel on Alits...
I have an idea, Gray.
sure?
{
_x addAction ["Turn Off", {
params ["_target", "_caller", "_actionID", "_arguments"];
[_target, false] call BIS_fnc_switchLamp;
}];
} forEach _lampsIn5000m;
Thank you but im not very great with this stuff, i am unsure what "_target", "_caller", "_actionID", "_arguments" would be in the script that i sent
also maybe
private _hour = date select 3;
if (_hour > 20 || _hour < 8) then {
/* night code*/
};
The mission i am working on the team have to go in and turn on the emergency power at the generator, resulting in the surrounding lights to turn on
What do you mean what they should be? They're inherent to addAction. You don't need to do anything about them.
oh right so this would be placed in the object?
After that nearObject line of yours.
@limber tangle And those are terrain objects or placed ones from the editor?
Anyone remember that squad radar from dev branch that got canned? The textures are in the game, so I wrote a 100 lines script to recreate the thing:
https://gist.github.com/commy2/a9c38e87084d385e7e402203a14f6f83
useful thingy in missions ^
also was dir indicator ui thing from a2 afaik that is bis_fnc_dirIndicator and still in the game and works
yes, I tested and documented it recently π definitely works!
https://community.bistudio.com/wiki/BIS_fnc_dirIndicator
@little eagle , we just spawn the script & that's it? yay π
Yeah. It's a toggle, so you can call it again and it turns the thing off completely.
may I say⦠noice
This is a side product made while waiting for bwa3 to compile...
lol
how to make this thing a bit better
SORTED_VEHICLES apply {
private _units = (fullCrew [_x, "", false]) apply {_x select 0};
if (count (_units select {alive _x}) isEqualTo 0) then {deleteVehicle _x};
};
SORTED_VEHICLES < that is vehicles - <excluded vehicles list>
π€
Is this supposed to delete empty vehicles?
yep
{
if (crew _x select {alive _x} isEqualTo []) then {
deleteVehicle _x;
};
} forEach SORTED_VEHICLES;
tried with crew and was fails
What was "fails"?
with vehicles from addons sometimes it removes vehicles with players in
π€
yep
Which addon, which vehicle and which slot is not reported by crew ?
RHS tigr.. without mounted weapons
there is FFV for the gunner
also one BTR
cant tell exactly
and .... i think was one more
also with FFV
for the gunner
Never seen FFV for the gunner. Maybe they hacked something together with scripts and it's weird. Does fullCrew really report those slots?
tried exactly what you suggested above ^ but... was troubles, with fullCrew and empty filter it works
Does fullCrew really report those slots?
yes with empty filter
This is interesting. There were few reports that in current (legacy) liberation codebase vehicles sometimes vanish. Usually it happened with RHS vehicles. If it is true that crew does not work correctly sometimes for their vehicles I guess this might be a reason. (They were trashed by garbage collector :D)
about the same here ^
And full crew? works the same but returns empty slots too?
you can filter it as you wish
fullCrewis a command
https://community.bistudio.com/wiki/fullCrew
{
if ([gunner _x] + crew _x select {alive _x} isEqualTo []) then {
deleteVehicle _x;
};
} forEach SORTED_VEHICLES;
There. Fixed.
maybe make macro function for it... that will be called multiple times π€
also don't feel safe with crew π
It's gunner plus crew though.
that is the problem afaik with that ffv as gunner but not gunner...
Yeah, but why bother to add additional checks if this is the simplest?
hmm don't know man... thanks anyway, will see how it will works
It is kinda shitty when you need to create workarounds for someone else's mod.
can someone explain what an event handler is and its functions?
veteran29, so true
but what you can do... rhs is core for me.
But it is a bit broken since tanks dlc i think.
it is
Today I saw that all gunners of m113 were standing at the top of their vehicles and shooting with rifles π
@vapid venture It's a piece of code that you put in memory that is repeatedly executed whenever an event happens, E.g. a unit dies or fires a weapon.
aight, thanks.
It's a function that is "subscribed" and called when certain event that it subscribed to happens.
In simple words.
so in short it handles an event π
takes care of it π
what about azimuth?
How is this related to event handlers? Do you think about specific event handler?
I'm lost.
azimuth = bearing = direction
thanks
@hollow thistle I'm just tryig to get a better bearing, I dont know a lot of terms with scripting for arma
Ah you meant "what is azimuth", sry I have misinterpreted your question. My bad.
ah
I have just one more question
So, I have the initmission.hpp for the first mission in the arma campaign, I have it all set up in the editor and I'm trying to change all of the main characters loadouts (E.G. Kerry, Lacey, Adams... etc) but if I just change the loadout in the editor, their loadout stays the same as it originally was. I would assume somewhere in the initmission.hpp would be whats doing it, but I'm not sure what to look for.
Azimuth and Altitude are coordinates in the https://en.wikipedia.org/wiki/Horizontal_coordinate_system.
should {} forEach nil; throw an error or does it not care? π€
having some code that passes over a variable with 2 possible branches (typename or forEach) but further down the script it spits out undefined errors
ahh cool thanks π
hello
can i get help here about UAV issue?
im the owner of Exile server...and cant figure out how to put UAV like sentinel and Greyhawk one in trader for sale
sry my english is not perfect i hope u understand my problem
is there a way for force a ctrlGroup to scroll to the bottom ?
uhh
you can set the autoScrollEnabled property on the ctrlGroup object thingy and control it with the ctrlSetAutoScroll* functions
ill take a look
So I set the variable for a house and teleported away. I came back and it was still assigned
Does it matter if I'm singleplayer to reset building variables when I leave the range
or server
is this related to an earlier question? π
I asked before, went afk and Now tested
I assume that might be a bug on clients
But right now local server and single player variable was not reset
Even just setting variable reference to the house and checking the variable when out of view works
@still forum
@subtle mauve #channel_invites_list or google for exile discord. I'm sure they know
I don't know the original question but buildings going "out of range" keep their variables
they're persistent
I don't know where I remember that from that variables on buildings is unreliable
we rely on building variables on quite a few systems in ALiVE and it seems to be working just fine π
On server?
neat ^^
That looks pretty cool @wary vine
π
@peak plover not sure about client/server, the file that I have in front of me sets them globally
just gotta turn off auto scroll now π
but the function should be running server side so it should work on just servers as well
_controlGroup ctrlSetAutoScrollSpeed 0; should do it right ?
@wary vine in case you haven't figured it out yet, if you set speed to a negative value it'll stop/disable autoScroll
0 should work shouldn't it
perhaps ^^
hmm
now its not working at all xD
is there a way to wait until its at the bottom then stop ?
Interesting
wait what ? this is wierd.
If user focuses on the control, autoscrolling is interrupted.
thats crap
xD
well I guess it simulates your finger on the touchscreen π
ill show you, gimmie a sec
its fucking hiliarius
even if i focus the control it doesnt stop the autoscroll
I have to fight with it xD
Some map objects don't support setvariable, some do
Same amount no matter where on the map I am
Yeah buildings work
ill just do onFuckused event handler
yeah those properly use a different base class / simulation for performance reasons
a bit like the simple object thing
you could just keep a global array/hash and store the data in there using the id or reference of the object as a key
on _ctrlEventhandler onfocus the ctrl is _this right ?
onSetFocus? yes
ty
yeh, I'll just save the buildings with buildingPos into an array. thanks @halcyon crypt
_controlGroup ctrlSetAutoScrollRewind false;
_controlGroup ctrlSetAutoScrollSpeed 0.1;
_controlGroup ctrlSetAutoScrollDelay 0;
_controlGroup ctrlAddEventHandler [
"SetFocus",
{
params ["_controlGroup"];
_controlGroup ctrlSetAutoScrollSpeed -1;
}
];
``` so something like that should work ?
assuming that you want to disable auto scrolling when someone is manually scrolling the screen you could probably use onMouseButtonDown and onMouseButtonUp
setfocus should work right ?
Dont really need to π
only really need it untill all the messages are loaded
the controls group gets refreshed when messages are received.
ahh alright
Can I find the amount of building positions from the config?
like positions inside a building or positions of buildings/objects?
Hmm okay
okay
I'll just use buildingpos for now, but I guess I can make an array of pos in relation to model eventually
// 4845 buildings
https://i.imgur.com/ivuACsC.jpg // 492 clusters
https://i.imgur.com/K3NIBvJ.jpg // biggest: 34 clusters // total 526
https://i.imgur.com/vM5K8bY.jpg // biggest: 8 clusters // total 534
Clustering all the buildings and then clustering the clusters
I did something like this before
But it came out better this time
I'm not sure if clientside is the way to go 'tho
Updated with total cluster amount
Why stop at loot 'tho.
Anything that has excessive amounts of inArea / distance checks can be optimized
More aggressive version : https://i.imgur.com/dX2UcGJ.jpg
Layers: 5
Biggest layer amount: 15
Total cluster amount: 868
Fun stuff!
@peak plover Whats that for, spawning gear in building?
loot loot loot things π
What's going on here?
Is it possible to have conflicts with publicVariableServer where server handles some code with addPublicVariableEventHandler? Like when few of public commands happen at once?
They will all arrive and trigger the PVEH, but the variable could afterwards be different on the clients. Depending on who set it first and when the remote value arrived.
All messages go through the server, and all messages sent from one machine, i.e. the server, will arrive in order.
That has exactly the same behaviour.
It's just how the server-client structure operates.
But Depending on who set it first and when the remote value arrived. is not true for remoteExec, since it has no remote value
Sure it has:
[1, {variable = _this}] remoteExec ["call"];
π€
How to dynamically add artillery support module to human commander on dedicated server?
I tried with little luck
so, in a initmission.hpp, what would be forcing the main character to use a certain loadout even when changed in eden?
Probably nothing, and it is in a different file.
module_name synchronizeObjectsAdd [player]; //--- requester
module_name synchronizeObjectsAdd [requester_module_name]; //--- support unit to requester
@fossil yew
imo even better option with bis_fnc_addCommMenuItem
but you will need script it ^
and also we have bis_fnc_addSupportLink
and x2 don't forget about BIS_supp_refresh = true; publicVariable "BIS_supp_refresh"; after synchronization
Thanks
What might be the issue where your extensions fail to load with could not be found while its actually both in server addon and root of the server (for insurance)?
Server is x64 and extension is x64 ofc
Battleye, antivir, path is actually wrong.
I could use a small hint here: How in the hell does the AI use "doArtilleryFire" ? It appears to me that this function only works for a certain artillery range - almost as if the artillery computer was forced to medium range. In my case the AI artillery only covers approx 5km-12km.
Is there a trick to make it work outside of that range / any command to switch the AI's range settings?
When firing the artillery in question manually, I can cover the entire map due to the range settings from near to very far.
// EDIT: when checking "inRangeOfArtillery", it almost always returns true, but still doesn't fire outside of 5-12km.
Anyone know of any scripts to convert between VectorDirAndUp and Eden Euler angles? Trying to spawn objects in Zeus/Eden and even using BIS_fnc_setPitchBank isn't working reliably at larger angles (ignoring the fact it's not in XYZ format).
That's basically just math
https://www.opengl.org/discussion_boards/showthread.php/159883-converting-a-3D-vector-into-three-euler-angles
https://stackoverflow.com/questions/21622956/how-to-convert-direction-vector-to-euler-angles
https://math.stackexchange.com/questions/1381656/convert-two-orthogonal-unit-vectors-into-euler-vector
How can i put a Image (paa) on CtrlCreate RscPicture
?
via CtrlSetText I think
yup
https://community.bistudio.com/wiki/ctrlSetText
@molten folio
Ty
yw
_VarName = ("kill_Commander" + _rnum); //_rnum is random number
_commander setVehicleVarName _VarName; //_commander was created by 'createUnit'
missionNamespace setVariable [_VarName, _commander];
publicVariable _VarName;
build_Task_objs pushback [_commander];
publicVariable "build_Task_objs";
build_Task_objs get the following value on each server and client-side.:
//build_Task_objs:
Server: [kill_Commander15019339]
Client: [O Bravo 3-4:1 REMOTE]
how can I do client-side also get the [kill_Commander15019339] as build_Task_objs element?
call setVehicleVarName on clientside too
Hello. I have a problem. I Build a building complex fully enterable. There are places in it, they are above 100 metres above ground. How I can disable the Halojump falling animation? Everytime a player left a placed object to go to another object the falling animation activates... it sucks a bit. Especially when you want to something above 100metres. Can I global deactivate this automatic vanilla animation switch?
Everytime a player left a placed object to go to another object What does that mean? Walk between two different buildings? Does the Roadway lod overlap?
is there a way to get doMove or moveTo on dog agents to work on a dedicated server? So far every time I spawn an agent and tell it to move to a position it just runs straight until i pity delete it
it does work if I spawn it on a clients machine tho.
guys, i'm using Virtual garage to allow players spawn a vehicle
but i want to stop the player from creating more than 1 vehicle at time
any suggestion?
i been thinking about get the vehicles owned by the player to allow him or not to get another one
but how i do that?
['string',,'string2'] // invalid number in expression
arma..
That means there are two catwalk objects for a "bridge construction" and when I walk trough the two objects and "leaving" the first one I automatically going into a free falling animation. (Only above 100 metres) @still forum
For example
sounds like the roadways don't overlap
yes. roadway.
Its not possible for some objects to let them overlap for reasons. Is there any way to prevent from changing the animation? There have to be a function that initialise that anination above 100 metres.
no there doesn't have to be.
My guess is that it's hardcoded to start when you are above 100m AGL. and ground level is the next roadway lod under you
Can I place a Invisible roadway between the ground and the object?
Place some object with a roadway lod over the border where it happens
I don't know any. But I'm sure there are some simple walkable surfaces that aren't too high
invisible I guess not
A port concrete block for example? Try and error?
yeah
the VR blocks should also work. Maybe you can just place them under the border.
You should also be able to setObjectTexture them to invisible
But I can switch the visibility in the attributes or not? Unchecking a box
I think hideObject also disables collision. But you want collision
no
Ok. Strange workaround. Should be easier without using double number of objects especially for performance reasons.
are there limitations to what you can do with buildings that are on the map regarding scripting?
Specifically, finding objects and attaching objects (using memorypoints ideally) and adding eventhandlers? I'm asking because i'm wondering about to do functional terrain-placed bunkers that are supposed to have turrets in them. I need to spawn the turrets as vehicles in missions, can't place them on the map if they are supposed to work - but the bunkers need to be placed in the terrain otherwise it would look odd.
any idea of the syntax to use to count how many subclasses exist in a vehicles class Presets and return the displayname for each class present?
_name = getText (configFile >> "CfgVehicles" >> typeOf (vehicle player)>> "displayName"); I can do to get a top level string, but how to count subclasses in class presets, and how to extract the displayname from each one?
what is the command that i set numbers from 34.444 to 34?
round/floor
thanks
`
"(
{getText (_x >> 'Displayname')}
)" configClasses (configFile >> "CfgVehicles" >> typeOf (_plane) >> "Components" >> "Presets");
something like this i think i need, but damn my coding is rusty
("isText (_x >> 'displayName)'" configClasses (configFile >> "CfgVehicles" >> typeOf (_plane) >> "Components" >> "Presets")) apply {getText( _x >> "displayName")};
returns displaynames of all subclasses of "Presets" that have a displayName
it's returned yeah
so for example
_presets = ("isText (_x >> 'displayName)'" configClasses (configFile >> "CfgVehicles" >> typeOf (_plane) >> "Components" >> "Presets")) apply {getText( _x >> "displayName")};
PRIVATE _count = count _presets;
hint format ["first: %1, count %2", (_presets select 0), _count];
``` returns null and 0
don't see an error in there. As long as the part you gave me (configFile >> "CfgVehicles" >> typeOf (_plane) >> "Components" >> "Presets") is correct
well if i do PRIVATE _name = getText (configFile >> "CfgVehicles" >> typeOf (_plane) >> "displayName"); tha treturns the displayname of the plane i am in correctly
ok i missed a class TransportPylonsComponent
"isText (_x >> 'displayName)'" swapped ' and ) at the end
_presets = ("isText (_x >> 'displayName')" configClasses (configFile >> "CfgVehicles" >> typeOf (_plane) >> "Components" >> "TransportPylonsComponent" >> "Presets")) apply {getText( _x >> "displayName")};
works
thanks so much π
cool so i can now see if i can read the presets and apply them to the plane from a cockpit action.
what is the cheapest way to create new global namespace? (without cba)
Does it matter what do i use as simple object? I guess the less complex model the better?
correct
https://github.com/CBATeam/CBA_A3/blob/master/addons/common/CfgVehicles.hpp#L4 That's what CBA uses. Which is basically no model at all I think
So another question. What is the least complex model in vanilla? π
I'd say vr block. Atleast that get's close
Thanks!
@hollow thistle createSimpleObject with this model:
"\A3\weapons_f\empty.p3d"
is probably as cheap as you can get.
May need to cut off the leading slash. idk.
Location is always better than any object though. I suggest "Invisible" as classname. It only renders a text on map, which will be empty string.
createSimpleObject is needed when you want to share the namespace with everyone via setVariable public.
I'm was going to create my own custom event system as bis one seems to be slow. I'm not yet sure if i need global or local namespace to hold my handlers.
Reinvent the wheel. I wish cba could be dropped into mission folder. Arma 4 maybe.
Is there a command to get the direction of a object from the player? getRelDir does not do what I need.
getRelDir is the direction of an object from the player.
Or do you want cardinal directions and not directions relative from the player?
player getDir _target
oh, I did not know that getDir have that alternative syntax
Heard a rumors that arma 4 is real..
Well it sounds like meme for me already, so if thats a fact, i could, yes.
another question on extracting data from configs:
class Presets
{
class Default
{
displayName = "$STR_vehicle_default";
attachment[] =
{
"uns_pylonRack_7Rnd_Rocket_FFAR",
"uns_pylonRack_7Rnd_Rocket_FFAR",
"uns_pylonRack_6Rnd_Bomb_CBU25"
};
};
};
_newarray = ("isArray (_x >> 'attachment')" configClasses (configFile >> "CfgVehicles" >> typeOf (_plane) >> "Components" >> "TransportPylonsComponent" >> "Presets" >> (_presets select _i))) apply {getArray( _x >> "attachment")};
returns null
what i'm after is extracting the array attachment[#1,#2,#3] to be useful in my script.
any idea on the correct syntax to extract those magazines?
and also how to count the number of items in the attachments array
damn, i'm so rusty, haven't written any scrips for at least a year.
any idea why virtual garage spawn undestructible vehicles?
https://community.bistudio.com/wiki/BIS_fnc_garage
_newarray = (
"isArray (_x >> 'attachment')" configClasses (configFile >> "CfgVehicles" >> typeOf (_plane) >> "Components" >> "TransportPylonsComponent" >> "Presets")
) apply {getArray( _x >> "attachment")};
then _newArray contains arrays of arrays of classnames
If you want to get the attachments of a specific preset
_attachments = getArray (configFile >> "CfgVehicles" >> typeOf (_plane) >> "Components" >> "TransportPylonsComponent" >> "Presets" >> (_presets select _i) >> "attachment");
_numberOfAttachments = count _attachments;
hint str _presetarray;
``` returns [].
ah sorry didn't see you'd replied - thanks once more π
configClasses get's all subclasses of what you give it
your Presets>>Default doesn't have any subclasses.
ok i'm starting to get it thanks so much
never used much more than getting a number or name from config before. mining out classes and arrays is a little confusing.
i need send multiple pub vars at once, how to do it better ? one by one or with forEach or apply ?
for example
GVAR_1 = 0; publicVariable "GVAR_1";
GVAR_2 = 0; publicVariable "GVAR_2";
GVAR_3 = 0; publicVariable "GVAR_3";
GVAR_4 = 0; publicVariable "GVAR_4";
//--- or something like this
["GVAR_1","GVAR_2","GVAR_3","GVAR_4"] apply {publicVariable _x};
So, esoteric question here, if I setVariable missionNameSpace with public set to the empty array (or perhaps just 2), will JIPs get the value - or is it only for true?
afaik they will get []
? No, I mean the 3rd parameter to setVariable.
only people in that array
considering it's empty.. no one
I think JIP anyway only works for true.
If you send it to a specific player he will be a different player wehn he rejoins. so JIP makes no sense
I see... I was looking for a way to set a variable for JIPs without overhead of transmitting to current clients.
just tried with setVariable and apply for multiple vars at once, works π thanks man
ok my next question in this quest for true dynamic rearming...
is there a way to remove and replace a pylonmagazine / attachment?
removemagazine does not appear to work and nor does addmagazine
i normally try to write my code from scratch tbh, but i guess if it's public information it won't hurt to glance over it π
getPylonMagazines
who knew? lol thanks once again
nope still not helping. any idea wh owrote this for ACE? they might know the answer
@delicate mason it was this fella.
ok i messaged him. let's see if he knows.
found it
https://community.bistudio.com/wiki?title=setPylonLoadOut&action=history Happy to help π
what i needed was: removeWeaponTurret and setPylonLoadOut
those are what make the mags add and remove in the new system.
so after 4-5 hours of tinkering i now have a basic action menu based reload script that finds all the presets and lets you apply each with a single action click. simple but effective π and it's about 100 lines of code. just need to sort out error handling, and i'll post it on the forum somewhere
https://www.youtube.com/watch?v=_IWCLQ2Mlys thoughts ? was a bit of fuckery to get the position / size of the message boxes right but it works
since that video was uploaded, have added an event handler to onSetFocus, delete the text.
good job man, looks nice π
So I'm trying to export a scenario to steam, but when I publish it, it never takes my .hpp files or any of the scripts with it. How would I get it to take the scripts as well?
Binarize it?
whenever I binarize it it doesnt take the scripts with it
How do you binarize it?
Check [x] Binarize Scenario checkbox when saving the mission.
okay
Is there a faster way to hint a value, besides using format ["%1", _val];?
hint str _val
thank you π
Careful.
Text may be a better option depending on what it is you are hinting* In combination with str https://community.bistudio.com/wiki/text @tough abyss
Iff _val is undefined, hint str _val will fail silently, and hint format ["%1", _val] will still print <any>.
Sounds good. Thanks guys.
U should make a function for debugging and then call that
You should make a macro for debugging, so all your debugging can be disabled by changing one line, and there is zero cost at runtime.
ππ»
I personally just place diag_log [_val] or systemChat str [_val] everywhere and delete them when I'm done, because no one would debug anyway after they're done, right?!?
Is there any way to block BIS_fnc_* the same way CfgDisabledCommands does it for commands?
Why would you ever do this? Sounds like a dumb idea.
Because command I block in CfgDisabledCommands usually can have a BIS_fnc_ alternative which works fucking well.
Okay, I'm out of this discussion because CfgDisabledCommands itself is a stupid idea.
When it comes to something like addWeaponGlobal its very useful.
Nah, if someone wants to cheat, they'll just buy a memory editing based hack that bypasses battleye or everything the game can do.
@little eagle How would such a debug macro look?
Like TRACE_n in CBA.
Well that one is not Battleye based, and in common no one from script kiddes think of some CfgDisabledCommands presence, as they usually use some default methods, for example hint menus, where hint|hintSilent is disabled in my framework against some custom replacements.
I honestly don't believe there are many script kiddos novadays, but still not willing to ignore the possibility to do such things.
Get yourself a moderator 24/7 on the server. It is the only way.
CfgDisabledCommands and CfgRemoteExec are a joke.
Break more than they help.
Yeah I get what you say and your point. Im also pretty sure that only human factor can suppress human factor. But still it can make some things easier for people on the watch.
By stats there are usually 3\10 script kiddos so outdated or retarded so they hit that basic "walls".
@wary vine looks nice π
I've ran into a little problem when editing a file for one of my mods.
https://i.gyazo.com/38d792db50589f7ebc5709c9382a1192.png
https://i.gyazo.com/3a94f7cbfc72e173cb772ac26add38a6.png
Well this is weird when i try to add an event handler on mines it returns me a -1 is it known why or is that a bug?
The top one is the error, the bottom one is the lines around code 2041
@inner swallow class LIB_BasicAmmunitionBox_SU; //CUP_RUBasicAmmunitionBox
Or its the one right below it
ok
so. i don't know a lot about config editing
but the only difference i can see between that line and the structure of the other classes
is that there's no {} after the class name LIB_BasicAmmunitionBox_SU
I don't know if that matters, though.
@tough abyss did you include the mag_xx macro's? π
I am a noob at this so bear with me
class LIB_BasicAmmunitionBox_SU;
class I_CZSArmedForces1938_AmmoBox : LIB_BasicAmmunitionBox_SU {
author = ALiVE ORBAT CREATOR;
displayName = [Czechoslovakia] - Armed Forces [1938] Ammo Box;
class TransportMagazines {
mag_xx(CSA38_9mm_8xBrowning,50);
mag_xx(CSA38_rg34,50);
mag_xx(CSA38_rg38,50);
mag_xx(CSA38_Gsmoke,50);
mag_xx(CSA38_9_mm_36xBrowning,50);
mag_xx(CSA38_7_92_5xMauser,50);
mag_xx(ifa3_SMKLS,50);
mag_xx(fow_e_tnt_onepound_mag,50);
mag_xx(fow_e_tnt_twohalfpound_mag,50);
mag_xx(csa38_sm35,50);
mag_xx(CSA38_7_92_20xMauser,50);
mag_xx(CSA38_9mm_9xBrowning,50);
};
class TransportWeapons {
};
class TransportItems {
};
};
There is mag_xx there
is there supposed to be anywhere else?
there should be something like #define mag_xx somewhere
but I see this is an ALiVE ORBAT export
so it should be included already
That is in the config.cpp I believe
#include "CfgPatches.hpp"
#include "autogen.hpp"
#define mag_xx(a,b) class xx##a {magazine = ##a; count = b;}
#define weap_xx(a,b) class xx##a {weapon = ##a; count = b;}
#define item_xx(a,b) class xx##a {name = a; count = b;}
This is my config
hmm you can try changing the magazine = ##a bit to magazine = a
that's what the BIKI says it should be
otherwise, no clue
Do I do the same for the weapon?
sure
#define backpack_xx(a,b) class _xx_##a {backpack = a; count = b;} also useful - i made that for adding packs to crates
Well I will test it when I get home
can anyone tell me why in editor adding this line to a plane causes "init type script expected nothing" error? i had this working yesterday and then deleted the init line and replaced it, and now it simply refuses t owork...
this execVM "rearm_init.sqf";
aren't you supposed to prefix it with 0 = or something?
ahhhh
I'm not entirely sure but I've seen that a lot π
yeah thanks that fixed it
π
mental fart
@halcyon crypt yeah that didn't work
I was trying to avoid using the CUp weapons crates but I'll just test it with the unmodified version of the export
Hi does anyone know anything about particles headmeat1 , headmeat 2 etc?
Well that didn't work either
So annoying as this appears to be basic but I canβt find the info
is it possible to spawn a function from addaction instead of execVM ing a sqf?
am trying to optimise a vehicle based useraction
yeah that is possible
EB_rearm = _plane addAction ["<t color='#FFFFCC'>~"+(_presetarray select _i select 0) +"</t>","uns_missilebox_c\functions\fn_rearm_add.sqf",[_presetarray select _i select 0,_presetarray select _i select 1,_presetarray select _i select 2],14,false,true,"","",5];
any idea what is the syntax to spawn it instead?
Something more like this Rob,
EB_rearm = _plane addAction [
"<t color='#FFFFCC'>~"+(_presetarray select _i select 0) +"</t>",
uns_fnc_rearm_add,
_presetarray select _i select [0, 3],
14,
false,
true,
"",
"",
5
];```
Where you function in this case is compiled into uns_fnc_rearm_add.
Though you might want: {_this call uns_fnc_rearm_add} instead. Something about Arma recompiling it anyways - or maybe that was only for event handlers.
Good question if this applies to addAction. No idea actually. Just a filepath doesn't work, it has to be a compiled function or a string with sqf syntax.
Let me@refeame@#
Reframe my question . Is there a script for hit effects ?
On people not talking about bullet holes in walla
Rephrase? :D
how does A3 Wasteland save stuff? i remember that it had basebuilding and vehicles and on the servers i played it saved it does it save it because A3 doesnt have internal saving its always a DB can someone link me some Documentaiton on SQF -> SQL stuff? ^^
extDB3 -> google
yes
alright thanks π
@errant jasper thanks! how do i precompile the function?
@half laurel commy's link is the official way π
an anyone tell me if i'm doing that wrog?
// init.sqf
#include "config\config.sqf"
if (isDedicated or isServer) then {
[]execVM "actions\playerRespawns.sqf"; // BIS_fnc_addRespawnPosition
[]execVM "actions\vehicleRespawns.sqf"; // BIS_fnc_addRespawnPosition
[]execVM "actions\virtualArsenals.sqf"; // BIS_fnc_arsenal
[]execVM "actions\virtualGarages.sqf"; // BIS_fnc_garage
[]call startMission;
};
waitUntil {time > 0};
if !(hasInterface or isServer) then {
[]execVM "init_HC.sqf"; // spawn ai
} else {
[]execVM "init_HC.sqf"; // spawn ai
};
if (hasInterface) then {
[]execVM "actions\inventoryRespawn.sqf"; // BIS_fnc_addRespawnInventory
};
Can you describe what the problem is?
Though it seems strange you run init_HC.sqf always.
because test in editor, and if the server does not have HC will work anyway
i'm getting no errors, but respawn menu is not working
it's working in editor > play mp
but not in dedicated
Is it added in playerRespawns.sqf?
in that file it's added BIS_fnc_addRespawnPosition to vehicles
Can you show me the code?
Also isDedicated or isServer can be simplified to isServer.
nope
has efect in editor
so i can teste there
editor return dedicate true, but false to isserver
or in the other way, don't remember xD
if isDedicated is true then isServer is also. But not necessarily the other way around.
ok, but this is not the problem
updated the code with comments
all is working good in editor
the problem should be in the init.sqf
my locality system fail :p
Please tell me where you got this:
if !(hasInterface or isServer) then {
from, so I can take it down.
idk, bohemia forums, wiki or somewhere
Well just in general, I would recommend you use call compile preProcess instead of execVM in init.sqf, so all scripts run in order, so no script intrudes/conflicts with another.
Strange. Do you have any other code that executes when HC present / not present?
can someone point me a direction on how to spawn things so only the player who had accepted the mission for example is able to see the bomb
Thanks alot π
it seems like HC hates skipLobby=1;
probably because that's when it gets slotted
maybe try enabling slots to be auto-assigned?
hmm. okay. I've only ever used HC with the lobby, and there it works fine on its own, so i don't know
yes, now it's working fine with lobby
