#arma3_scripting
1 messages · Page 246 of 1
Have you used the F3 framework before?
awesome!
but group OBJECT will never == STRING
OK so I need to parse the object to a string?
what no
other way around
you need the group
in eden easiest way is to simply set it as group attribute
I currently set the groups in the unit inits as per F3, so I need to set the group elsewhere too?
that var might get set after assignGear is done running
but you would ideally do (group _unit) == myGroupName, in this case, == GrpNATO_CO
group name in EDEN is the Composition Variable name, when you edit group attributes
OK so my code will look something like if((group _unit) == GrpNATO_CO) then foo
ya
Excellent, i'll give that a bash, thanks chief
keep an eye on the next F3 release, the team is re shuffling a ton of stuff to adjust everything to eden spec
Any ballpark on release date or just soon(tm)?
©
I'll keep an eye out then, thanks for the heads up man
Also - just gave that a test - worked like a charm. Thanks @indigo snow
np
i've got a similar question to that guy earlier, except i'm more stupid
pls somebody ELI5 vectors
and why this script doesn't work proper
why does this 3d ctrl only ever reach 0.66 on the vector i'm modifying?
_model = (uiNamespace getVariable 'a_3d_model_ctrl');
_modelDirUp = ctrlModelDirAndUp _model;
_modelDir = _modelDirUp select 0;
_modelUp = _modelDirUp select 1;
_d1 = _modelDir select 0;
_d2 = _modelDir select 1;
_d3 = _modelDir select 2;
_u1 = _modelUp select 0;
_u2 = _modelUp select 1;
_u3 = _modelUp select 2;
systemChat str _d1;
_d1 = _d1 + 0.1;
_d = vectorNormalized [_d1,_d2,_d3];
_u = vectorNormalized [_u1,_u2,_u3];
_model ctrlSetModelDirAndUp [_d,_u];
}] call BIS_fnc_addStackedEventHandler;
Anyone here? got an issue w/ create vehicle
let me guess. It takes ages, until the object appears online? 😛
Beautiful minds of the editing world. I am trying to figure out how to get the remove all foliage (Ctrl+G) from the 3den editor to work during game play. Any ideas?
not sure if you could do it better than hideObjectGlobal'ing something like nearestTerrainObjects [getPos player, ["Tree"], 500]
can one use loadFile on any file type within a mission? (sqm, paa, *)
2x questions;
- How can I view the raw code for a bis_fnc? They're blank in the cfg viewer, assuming they're under cfgfunctions.
- How can I find the IDD for a specific part of the UI? Ex., the "hide" button in Virtual Garage.
please and thanks ❤
@tough abyss
1: You can use the function library or viewer (whatever it's called). Should be a button next to the config viewer.
2: You can either scan the configs for that button (grab an AllInOne config dump from somewhere) or https://community.bistudio.com/wiki/allDisplays / https://community.bistudio.com/wiki/allControls
@halcyon crypt Ah, I was just being stupid, then. As per the norm. Thank you! 😃 And thanks for the allDisplays link, as well. Exactly what I needed.
Ah, though it doesn't seem to get the me necessary IDDs. I know the LOAD button in Arsenal/Garage is 44146, and neither the allDisplays or allControls gives me numbers similar to that. I have managed to guess a few other IDDs, but this is inefficient and doesn't help me in future situations.
Guess your only option is to scan the AllInOne config dump then 😃
That worked, didn't even know the Allinone dump existed, thank you 😃
allDisplays does not return child displays of other dialogs
findDisplay can't get them either
can write code for copy to clipbord building ID from cursor target ?
@vagrant badge Yes, but it's not suggested to use building IDs as they can change
_str = (str cursorTarget);
copyToClipboard (_str select [0, _str find "#"]);
So you want the classname?
yes class name
That's about as easy as it gets https://community.bistudio.com/wiki/typeOf
copyToClipboard (typeOf cursorTarget);
@native hemlock dont wor i try in editor on tano hangar
fail
Any way to stop a player from entering a vehicle outside of allowGetIn (broken, action still shows up)
like, stop the action from occuring, not act after the fact
Is locking not an option?
nope
revive system, want to stop peop;e from entering a vehicle with someone on their back
Worst case you could settle for GetInMan event handler
and drop the dude yeah, but I want to avoid that
mission
then probably not
if it was a mod it would've been much easier
Maybe using this like example 3 https://community.bistudio.com/wiki/inGameUISetEventHandler
oh good idea, didn't think of that one
oh arma.. what a silly EH
that one might not work for keybindings
Since Arma 3 v1.49.131743 this EH returns array of params for selected/activated action in _this variable:
what was even the point before? 🙄
disabling action menu entirely
is there a better way to detect how near a unit is to something other than the distance command?
cos this guy here is apparently not with 15 meters of the tree: http://i.imgur.com/fysVHcY.jpg and that is bullshit
yes, the center of the tree is about 15.1 meters above your head, but you're still within 15 meters of that tree FFS
dude i think i've bookmarked every page about sqf there has ever been
Just save that^^
that's already saved on my browser homepage bro 😃
p.s vivaldi browser is very nice now
is it possible to make civilians ignore gunfire? allowFleeing doesn't quite do the job
hitPart EH is still local to the shooter in latest A3 or not?
yep
ok good (at least no further mess up)
ok bad (that is so bad design)
not rly bad design
it is more that you got invalid expectations
that EH is not for what you would expect 😛
but you can get the networked variance with a lil bit overhead on networking side and some scripting
bla bla
ACE2 has scripted such system
IF(A3) has scripted such system
the result is utter madness due to the bad design
and btw - the EH was made for ACE on request
the BI dev was just so clueless (or lazy) that he made it so bad
just ask Nou how "happy" they were with the result
BI loves to merge scripted features/modules into engine (while performance in general doesnt matter for these) which makes customization no longer possible more or less (without BI adding tons of extra sqf cmds)
whereas meaningful sqf cmds that would save ppl inefficient and complex scripting, it doesnt happen
anyone else has the error "author/ is not a value"? I searched for it in mission.sqf but couldn't find it anywhere
Never mind, seems to be connected to the new update
I'm trying to animate the fence in "Land_ConcreteWall_I_gate_F" (Tanoa building asset) but I don't know the corresponding animation name
hey guys
spawning a box with createVehicle (not present in mission.sqm), then trying yo add arsenal to it using
["AmmoboxInit",_box] spawn BIS_fnc_Arsenal on every client, but arsenal is not enabling, why?
I know the additonal params for Ammoboxinit are optional but what happens if you use: ["AmmoboxInit",[_box,true,{true}]] spawn BIS_fnc_arsenal;
worked with ["AmmoboxInit",[_box,true]] hence it is a default value and no error given in my first try
anyway thanks - that solved my pain)
btw, first option works fine from box init field in editor
Yea i use the first one you posted all the time from editor.
Also is anyone aware how while using MenuInventory to remove default loudout, defined by unit's class and leave only custom one?
Hi guys, quick question. If addAction is run serverside then will all clients be able to see the action?
No
If you look at the top left of the wiki page for addAction it shows an E with a big L, meaning "Effects of this script command are not broadcasted over the network and remain local to the client the command is executed on" https://gyazo.com/d6f427393862a0b266fe99eec2059189
Does anyone know wether BIS_fnc_arsenal has global effect?
the addVirtualItemCargo has global flag, what about arsenal function itself?
it init the boxes everywhere
it's good practice to call it only once in initServer for all your boxes and add the items clientSide
why not from server using global flag?
I got the new Revive system from the APEX Protocol campaign working on the server. Only downside to it is that on respawn it resets your entire loadout. Is there maybe a workaround? BTC revive seems to remove a player from group leadership when killed
resets after you got revived?
Quick question. I've just started writing my own function to check if a number is in a range (min,max) but this seems so extremely basic..is there no BI command that does this already? I've looked but I couldn't find any..
I mean it's literally just if(_number > (_minMaxArray select 0) && _number < (_minMaxArray select 1)) but considering SQFs speed vs native C++ speed I figured it's worth asking here. 😛
None to my knowledge, and that's such a simple operation that even if there was a function we are talking hundredths if not thousandths of a millisecond
yeah fair enough...my function is very fast so it ain't a problem. Now and then I still stumble upon some useful SQF commands I had no prior knowledge about so I was secretly hoping something like this would be one of em 😄 It's all good though
Tbh I dont know why people cut their scripts down to be performant as hell if its not necessary
I mean if it's not important theres no need to adjust it 100 times to cut it down for 0.0001ms
depends entirely on the usage
if you run the script on each frame for example it's nice to have it as fast as possible.
Preferably you'd make it as fast as possible, and then have it run on as few frames as possible
@tame portal Might work for some small missions. If you have a bigger crapload running -> imho each 0.0001 ms counts 😛
Yeah I know it depends on the situation
but then there are people that shittalk others for not boosting their scripts to 100% performance even though its absolutely unnecessary
@tough abyss "I CAN SQUEEZE OUT 0.0001MS BLARGH"
I'd give my virginity back for 0.0001
@nocturne iron i have no clue how they get removed from the field ... but i assume by getting killed
thus your loop does not makes sense
better use killed EHs
only reason to use such a construct would be if you would not have had access to the spawned unit
there you go with your performance boost
Thankyou
It's an on-death
I was originally going to do an EH but the EH has to also be applied to the troops coming in as reinforcements
uhm ... so?
Wasn't sure how to apply it :p
<OBJECT> addEventHandler [<STRING>, <STRING|CODE>]
I get that, I was just worried that putting the addEH inside an EH triggered event would create some kind of cpu crunching loop
just keep in mind a fact about BIS_fnc_moduleRespawnVehicle - if air vehicle spawn with posATL select 3 > 0 - it would be respawned with engine on and retracted gear (which is always true for artificial island built with scripts)
Yeah
I've modified my script to be a function that adds the EH to a given unit (_unit)
would applying the EH to units I spawn with the function like so work?
{_x moveincargo _helicopter; _nul = [_x] spawn fnc_act3_unitspawn_blufor_eh;} foreach units _grpCargo;
what EH are you applying? is it SP/MP?
Killed, MP
It's working SP so far
Only complication is I have to find a way to prevent like 10 choppers spawning if a squad gets wiped out at once
hello guy
i'm trying to close inventory if groundweaponholder is around(in 5m)
can i place my code here ?
use ```
need help its take my whole night
addMissionEventHandler ["EachFrame", {
disableSerialization;
if (!isNull findDisplay 602) then {
if(isNil "KAPU_HANDLE_GROUND") then {
KAPU_HANDLE_GROUND = [] spawn {
private _suppArr = player nearSupplies 5;
for "_a" from 0 to (count _suppArr) - 1 step 1 do {
if((typeOf (_suppArr select _a)) == "GroundWeaponHolder") then {
(findDisplay 602) closeDisplay 2;
};
};
KAPU_HANDLE_GROUND = nil;
};
};
};
}];
its not triggered when i open like unifrom on the ground
aw
how i can detect the ground event
i'm in altis life its got backpack ,veh, house
use https://community.bistudio.com/wiki/nearSupplies as suggested in the description of the EH
Hey guys, is it possible to add a drag/drop animation for wounded players while using the End Game revive? Activating on player Killed, deactivating on player Revived?
I did the loadout saving the same way
i did on my server
returns something like this
[B Alpha 1-1:1 (alganthe),
3c9a8100# 4: dummyweapon.p3d,
3c992b00# 7: dummyweapon_single.p3d,
3c992400# 8: dummyweapon_single.p3d,
59231600# 21: dummyweapon.p3d]
@tough abyss not at the moment
so try nearSupplies in the event you provide ?
@lone glade awh thanks anyway
use nearSupplies and filter out the player, if there's other holders override the EH and close the inventory
okay i will be back . give it a try
@lone glade just for confirmation, creating a drag/drop script and calling it the same way as my loadout save/load (player addEventHandler ['Killed',{tag_saved = getUnitLoadout (_this select 0);}];
player addEventHandler ['Respawn',{player setUnitLoadout [tag_saved,TRUE];}];) won't work?
no, the system is much more complex than that
is that new func ?
ah okay, thanks
also the reason you cannot use revive inside vehicles is because setUnconscious is broken inside them
@lone glade thanks man, hope they will fix that in time then
eh, I doubt it
so... back to BTC revive then?
currently writing my own because I don't like btc
@lone glade me neither, so if you need any help or testers, let me know!
yes you correct its fired
hey 😃 does anyone know where the path to your mission.sqm is saved? like C:\Users\me\Documents\Arma 3 - Other Profiles\[6Rus]DonElSarjo\missions\bla.vr
some variable in uinamespace?
Added: diag_ActiveScripts script command returning an array of running scripts
can someone compare the output of this (in todays dev branch) vs diag_activeSQFScripts please
hey @lone glade
@velvet merlin probably only runs for scheduled scripts
can you please take a look i tink i go wrong
#include "..\..\script_macros.hpp"
/*
File: fn_inventoryOpened.sqf
Author: Bryan "Tonic" Boardwine
Description:
For the mean time it blocks the player from opening another persons backpack
*/
_suppArr = player nearSupplies 5;
_stopIt = false;
{
if(typeOf _x == "GroundWeaponHolder") then { _stopIt = true; };
} forEach _suppArr;
if(_stopIt == true) exitWith {
hintC "sorry, some weaponholder within 5m attached and its just not aollowed to look into";
true;
};
private["_container","_unit","_list"];
if (count _this isEqualTo 1) exitWith {false};
_unit = _this select 0;
_container = _this select 1;
_isPack = FETCH_CONFIG2(getNumber,"CfgVehicles",typeOf _container,"isBackpack");
if (_isPack isEqualTo 1) exitWith {
hintC localize "STR_MISC_Backpack";
true;
};
if ((typeOf _container) in ["Box_IND_Grenades_F","B_supplyCrate_F"]) exitWith {
_house = nearestObject [player, "House"];
if (!(_house in life_vehicles) && (_house getVariable ["locked",true])) exitWith {
hintC localize "STR_House_ContainerDeny";
true;
};
};
_list = ["LandVehicle","Ship","Air"];
if (KINDOF_ARRAY(_container,_list)) exitWith {
if (!(_container in life_vehicles) && (_container getVariable ["locked",true])) exitWith {
hintC localize "STR_MISC_VehInventory";
true;
};
};
//Allow alive players who've been knocked out to be looted, just not the dead ones
if (_container isKindOf "Man" && !alive _container) exitWith {
hintC localize "STR_NOTF_NoLootingPerson";
true;
};```
its alway handle GroundWeaponHolder but nothing around
what do you mean by "nothing around"
and it doesn't open ?
player has one
make sure to have the debug console running checking for containers around
ya i'm , only this take me almost 24hr 😦
@velvet merlin you forgot to mention the biggest change in today's dev branch changelog:
Changed: Disabled soft formation for cars formation driving
dammmmmn finally
Another quick question guys. I remember at some point CfgRemoteExec got disabled because BI wasn't done with it or something. Is CfgRemoteExec fully functional and working by now?
it's broken
they disabled mode 1 because of issues, apparently those issues are still present but you can enable mode 1 anyway
I got massive desync / increase in bandwith when using mode 1
also, something that might not be noted somewhere:
init.sqf sometimes run before remoteExec data with JIP flag
there fixed
initPlayerLocal and initServer do run after always
them edits 😄
holding 3 discussions at the same time is hard 😛
If this info is rock solid perhaps it should be added here https://community.bistudio.com/wiki/Initialization_Order
i think that persistent functions are called refers to remoteExec (previously bis_fnc_mp)?
who knows where remoteExec is on that list now
yeah :S
matches the table...I've never used any of the targeted inits though so I have no personal experience with their order of init
oh dedicated*
initServer -> initPlayerLocal -> init afaik
you lost me.
preInit and postInit are placed properly tho
first you say "init.sqf seems to run before initPlayerLocal" and now you say "initServer -> initPlayerLocal -> init afaik" - haha im so confused. But it's okay. I'm not bothered about any of this. Perhaps you shouldn't have 3 convos at the same time
well, it's how it's "supposed" to work
someone would need to log everything and redo that table
BIS_fnc_initFunctions might also show you them
it may well not be deterministic
the right question should be:
do people use init.sqf for the right reasons
aka when you need a value set on the server and client and you're too lazy to write it twice
@tough abyss example of headache?
headache ---> "I forgot to tag my public vars"
anyone have any difficulty examples theyve made with the new system?
so after diag_activeSQFscripts, diag_activeSQSscripts, diag_activeMissionFSMs the diag_activeScripts finally is done
•Added: diag_ActiveScripts script command returning an array of running scripts
note it returns the array with count by types as originally wanted (just for statistical measurement)
I guess the next step is diag_ActiveScriptsCount
no, that's the one already
anyone here?
I've got an issue and I've been trying to solve it for the past few days
When spawning buildings via createVehicle or createSimpleObject, then attaching them to the player, then detaching, they can then deal mass amounts of damage just by bumping into them
what is the question
How do you disable collision damage for certain objects
I'm not looking to disable collision, just the damage that it deals.
Is there a way to check inventory for headgear items? Like if class ItemInfo is HeadgearItem
@vivid eagle If I'm understanding your question correctly this should work
(items player) apply {
_parents = [configFile >> "CfgWeapons" >> _x >> "ItemInfo", true] call BIS_fnc_returnParents;
if("HeadgearItem" in _parents) then {
systemChat format ["%1 is in your inventory and inherits from HeadgearItem", _x];
};
};
That will check all items in your inventory and show a systemChat if that specific item's ItemInfo inherits from HeadgearItem
Awesome, thanks @native hemlock will test it in a bit.
hey guys, is there any scripted way to force player enable NVG? I mean scripted way to make it on/off for remote client
oh yes, forgot to look in here
hope it will make difference for new goggles which have both NV and TI channels
off works ok for NV and TI - sets back to normal vision mode, but no way to switch to TI mode
and I think I do not need it for now
thanks @native hemlock !
checked in configs
did not found something related to particular vision mode
well, does not work for switching vision mode in scope
@half hornet try just setMass 0.001 the attached object - that stops it dealing collision damage afaik
what is the id of this dialog
what would be the most performant way to store a large amount of data which I could then filter? am I best doing this in a .cpp file and then using some config functions?
arrays
yeah i have a shit ton of arrays, what's the fastest way to find X array?
and don't say select
lol
name the vars they're assigned to properly ?
if you have an array of subarrays select is indeed the best way
also depends which kind of data you're storing
say I want to attach arbitrary data to those arrays and then filter them all by X value though
this is stuff best done in config right?
like key/value style?
and if you don't tell me what kind of data you're storing I wont' be able to help you much
like say i'll be storing a ton of polygons which represent areas
mod or mission ?
like 5000 of them or something crazy
it's going in a mod anyway, so i don't mind doing it via mod
if it's a mod do it via configs
but i'm sure you can rethink of the design and try to avoid having such a high amount of data
you're probably right, i'm just having a bit of fun
have traced a load of fields on tanoa and altis, as polygons, and i'm messing around generating 1000s of plants inside these areas
but really i was just wondering in general what the most efficient way to store data is
it depends entirely on what you wanna store
and since apply has been introduced it has changed
like say we're storing data on farming fields. in javascript i could go field.owner = "john smith"
or field.nearestTown = "kavala" or whatever
configs for that kind of data preferably
i'd like to query data on sensibly named keys somehow
arrays in an included file if a mission preferably
thanks very much, useful info
and what's the best command for querying configs? there's a few ways to do it and i'm never sure which is best
ah i've been doing pretty much the same thing, thanks!
as a side note, i don't trust the inPolygon function with anything more complex than very simple polygons http://i.imgur.com/GJNizkb.jpg
that doesn't surprise me 😮
^i just made random positions near the center of the polygon, if (inPolygon) then i made a marker
unreliable as fuck
once the polygon gets to a certain complexity i think it just goes "fuck it, a rectangle will do, yeah?"
Anyone knows if the Alt syntax of https://community.bistudio.com/wiki/addPublicVariableEventHandler command still doesn't work as intended?
@rancid ruin if BIS' inPolygon is shit you might try this http://pastebin.com/UUK8dnLZ
though if you're doing it a lot it might hurt performance
anyway to return all data in listbox ?
Hey, I make a script for verify mod version between client and server, but I want to executed on the .pbo and not in the mission. I tried in my Functions.h (in the .pbo) this : class verifyFiles {preInit = 1;}; but the script is not executed
@pliant stream i get "invalid number in expression", line 28, when i call that function
what were the arguments
[(getpos player),zone] call test_fnc_inpoly```
in fact it's throwing that error before i even call the function
yea the macro is wrong
hold on it's an old script i had let me fix it
@rancid ruin try this one http://pastebin.com/8uK516sU
[[0.1,0.1],[[0,0],[0,1],[0.2,0.2],[1,0]]] : true```
i think i just realised why i wasn't getting the results i expected before
my code being shit rather than inPolygon not working properly
😄
that function is clever stuff though, did you write it before the BIS function?
don't know when that inPolygon was added, but it's arma 3 only i wrote mine for arma 2
didn't even know arma 3 had that before today
they are both about the same performance wise
really lol
unless it's a complete shit implementation the native command should probably have much better performance
inPolygon vs. foxy_fnc_poly
avg 0.31ms vs. avg 0.18ms
that's the results i got running each 10 times from the debug console
hint str ((getpos player) inPolygon zone);```
hint str ([(getpos player), zone] call foxy_fnc_poly);```
being inside said polygon each time
are they both giving the same result as well?
yeah, it's just a simple 4 point poly though
yours goes as fast as 0.11ms for me sometimes, and BIS' is always around 0.2-0.4 lol
bohemia pls
i get 0.234687ms for mine and 0.0031ms for inPolygon
maybe you're doing something wrong
they both give exactly the same correct results though
just use inPolygon
Does anyone have a line which can be executed to disable all hints in a scenario?
Is it frowned upon to ask for general scripting help, with little previous knowledge? I've just hit a potential issue that scripting can fix?
No, as long as you aren't like "Can someone script x for me please?"
Never hurts to google your issue or question with "arma" somewhere in there as well
Of course, naturally.
So I'm creating a map for future Zeus missions for a small group of friends. Small base on the edge of one of Tanoa's islands, with plenty of Helis etc. Now I want the Helis to respawn once lost. As a rule, we don't lose helis often but when we do the simple respawn script means that we're ending up with two many helis.
Are there any working examples of an object that brings up a menu to respawn certain objects at certain places upon request
I can happily hack away at a code such as this but my search efforts have fallen short, even when looking from the ground up.
I'm not sure if I know what you mean by "two many helis", for every heli destroyed is it spawning a new heli?
Has anybody played through the campaign? At some point there is a tied person, of whom you have an action to untie. There is a funky circular loading icon when doing it, anybody know how to reproduce that?
Thanks for reminding me...
I said I was going to put that BIS function on the wiki
Oh someone added it today https://community.bistudio.com/wiki/BIS_fnc_holdActionAdd
cheers 👍
Hm
Does anybody already have the line that got used in the campain mission for the circular thing?
What circular thing?
holdActionAdd
In the campain it had a pretty neat paa
Was a circle with a circle progressbar around it
a3\ui_f\data\igui\cfg\holdactions\
Are they always there or do you have to reference those paas
Ah great
Thanks honey
The progress circles are all different icons
For the circles? Looks like it based on how many icons there are
There is an example on the forums: https://forums.bistudio.com/topic/192346-woah-woah-woah-bi-trying-to-sneak-one-in/?p=3058266
It has the circular loading icon
Anyone knows what determines the order in which preInit / preStart functions are run from cfgFunctions?
You might be able to get more insight from BIS_fnc_initFunctions, I would assume it's in the order they are read
ye looking at initFunctions.sqf
seems like it's just from the order of configs
Which i guess is purely alphabetical
_cfgFunctions = (_pathConfig >> "cfgfunctions");
for "_c" from 0 to (count _cfgFunctions - 1) do {
that's about all there is to it
It's not alphabetical though, it's in the order they are loaded in game/in the config
Seems you are right. What is the easiest way to change that. preloadAddons?
I've never really understood what that config entry did, are you trying to run something with a preInit before a BIS function?
Basically got a different compile script and want to compile different functions on preInit/prestart based on some conditions
Thing is that I'm uising compileFinal and want to make sure the correct one is loaded also when extra addons are added (That use the same function names)
basically replacement functions
That's about the simplest explanation i can give for it
Okay well i managed to do it. Made an extra dummy PBO putting the cfgPatches name of the other mod in there and doing requiredAddons[] += { my pbo with functions }
Guys, i need some help with a hopefully just dumb scripting failure.
Anyone got some time left?
what would you guys see as useful capabilities to do meaningful performance (fps, network, scripts) logging and debugging to be added?
what is available:
-
fps logging - https://community.bistudio.com/wiki/diag_fps
-
capture slow frame - https://community.bistudio.com/wiki/Performance_Profiling
-
log slow frames - https://community.bistudio.com/wiki/diag_logSlowFrame
-
#monitor to show server fps
-
network calls (although BI doesnt tell what each type is) - https://community.bistudio.com/wiki/mpStatistics.log
-
list network entities - https://community.bistudio.com/wiki/logEntities
-
list running scripts - https://community.bistudio.com/wiki/diag_activeSQFScripts (FSM, SQS)
-
measure runtime of a piece of code - https://community.bistudio.com/wiki/diag_codePerformance
-
logging of scripts taking more than 3ms in debug.log (diag.exe only)
134.367: (last instruction at e:\kju\a3data\users\test\missions\#testVehicles.VR\init.sqf:40)```
ifll exec script on some action, and in script write "player move "...."" , it will be done on every player ? player addaction ["Free hostage", "hostage,sqf"], and in hostage.sqf - player playmove . Is it correct ? I just done everything like this, because tested it alone. Now im thiking it was bad idea
I was wondering, is there a particular reason why the 3D editor (of which I'm not a fan at all) tries to convert a 2d mission to 3d but opens a completely empty mission? Like it deletes literally every piece of information
@tough abyss Maybe place a playable unit in the old 2d mission, and then try it out again
I'll try that, thanks!
@velvet merlin a debugger?
@pliant stream
wont happen in this engine
the next one using the ToM scripting engine might
i know
didnt look into those games myself
static code analysis is quite useful though (not for performance aspects)
i wish someone would rewrite squint from SBSMac
preferrably open source so others could contribute and keep it uptodate
uhm.... all steam servers just died?
mmhm 😦
can't even enter my server's lobby
apparently a poodlecorp "hack" (ddos?)
at least they are claiming it
and they are back
hmm
keyCarSoftBrake[]={};
keyCarBrake[]={};
keyCarGearUp[]={};
keyCarGearDwn[]={};
keyCarShiftFwd1[]={};
keyCarShiftFwd2[]={};
keyCarShiftFwd3[]={};
keyCarShiftFwd4[]={};
keyCarShiftFwd5[]={};
keyCarShiftFwd6[]={};
keyCarShiftFwd7[]={};
keyCarShiftFwd8[]={};
keyCarShiftRvs1[]={};
keyCarShiftRvs2[]={};```
GearUp
GearDwn
keyCarSoftBrake
keyCarBrake
Were they always in the profile? Can't remember seeing them before.
i think yes @jade abyss
AFAIK BI tried to implement in in A3 during dev but gave up
try to search in the exe if there are still references to these strings
Hi all, I'm not particularly good at scripting but I can hack away at stuff to modify.
I'm looking for a script / to create a script that respawns vehicles on request. Imagine a small inanimate object next to a helipad that a user can simply select 'request new vehicle' etc.
Any ideas? I can get the vehicles to respawn after death on a timer but thats it really. My search efforts have fallen short.
"my_vehicle_type" createVehicle [x,y,z]
that's how you create a vehicle
to add an action to an object use addAction https://community.bistudio.com/wiki/addAction
so you might add a "spawn helicopter" action or something to your small inanimate object in its init handler
is it true Eden editor will break the EOS system?
Thx4Info @velvet merlin
Nice @pliant stream I think you've given me that needed boost, thanks!
I'm trying to use the EOS layout from BMR on my own insurgency to create a starting FOB, however when using the 3d editor EOS system breaks and won't spawn anyone
even tho squares are activated
script error keeps going zero divisor in eos_core
(MyObj getVariable ["myArr",[]]) pushback (1)
Does this update "myArr" as set on myObj?
I would think not
I would do _var = .. Getvar...., edit that then re-set the variable as ... Setvar ["",_var] , but thats just me.
I imagine it wouldnt work cause all its doing it fetching the var, nothing about setting it, but i dont know for sure cause ive never tried 😃
@lone axle it will if myArr already existed on MyObj
neat
@pliant stream regarding the vehicle spawn you've just helped me with, If I take your examples verbatim it simply respawns on load of the map, is there something I'm missing to get it to work as planned?
For instance, walking up to a generator or whatever, having it display a 'spawn heli' option in the context menu? once selected, it respawns?
@frail trout that's what you use addAction for
my_small_inanimate_object addAction ["spawn heli", my_spawn_function]
Sorry @pliant stream I'm learning retrospectively due to time constraints so there's many basics that I'm not aware of.
Oh okay in the objects init, I didn't mention the object.
just started with player addAction
is there a chat shortcode for code snippets like above?
surround a code block with three backticks (`) on each side
or one backtick for inline code
{
comment "type of the heli to spawn";
_type = "Land_UWreck_Heli_Attack_02_F";
comment "get the position of the generator object (first argument)";
_pos = position (_this select 0);
comment "get a list of objects of the same type in a 10m radius around the generator";
_near = _pos nearObjects [_type, 10];
comment "if list is empty (no existing vehicles) then create new one";
if (count _near == 0) then
{
_type createVehicle _pos;
};
};
comment "create generator object near player";
_my_generator = "Land_FieldToilet_F" createVehicle position player;
comment "add spawn heli action to generator with the handler _my_spawn_function";
_my_generator addAction ["spawn heli", _my_spawn_function];```
why don't you try this in the editor console
PortableHelipadLight_01_Blue_F addAction ["Spawn Heli", B_Heli_Transport_01_Camo_F createVehicle [2214,13335.585,0]];
This is what I have so ar which actually doesn't sem to do anything. Obviously I don't want you to simply script for me, I'm very interested in learning myself, but sometimes the best way I can learn is via working example.
yea i edited the code with comments
i didn't actually test it but it looks legit to me
okay cool, I'll try that as that seems much more in depth and seems to have a few features that I would obviously want! Thanks man
@pliant stream this would be inside of an .sqf file right?
if that's what you like. for now i suggest you just copy paste it into the editor debug console and execute it to see what happens
then you can read the code and see why it does what it does
and like learn n shit
haha yeah, exactly - thanks bro. Hugely appreciated
@pliant stream Any idea why the else arguement is stopping anything from working?
`_vehicle_spawn_function =
{
comment "type of the heli to spawn";
_type = "B_Heli_Transport_01_Camo_F";
comment "sets position of spawn - use landing pad as coords";
_pos = [2215, 13335.252, 0];
comment "get a list of objects of the same type in a 5m radius around the helipad";
_near = _pos nearObjects [_type, 5];
comment "if list is empty (no existing vehicles) then create new one";
if (count _near == 0) then
{
_type createVehicle _pos, hint "UH-80 Ghost Hawk Request Accepted";
} else {
hint "UH-80 Ghost Hawk Already Present";
};
comment "create generator object near player";
_my_generator = "Land_FieldToilet_F" createVehicle position player;
comment "add spawn heli action to generator with the handler _my_spawn_function";
_my_generator addAction ["Request UH-80 Ghost Hawk", _vehicle_spawn_function];`
It's not a crucial aspect, just would have been nice.
I assume you didn't paste the part of the function where it's closed?
or is the function supposed to be done before the comments?
in that case I think a }; is missing
also you're calling _vehicle_spawn_function but it's named vehicle_spawn_function?
@frail trout also you separate statements using a semicolon ; not a comma , type createVehicle _pos, hint "UH-80 Ghost Hawk Request Accepted";
@lone axle I'm not calling a function, I'm defining it. At least, as far as I am aware.
i think the code block got fucked up because you did inline with single backticks instead of code block with three backticks
Three back ticks at the beginning and end - is that right?
```
hint "hi"
```
Would show up as
hint "hi"
Does anyone know if you can move the EG Spectator camera to a specific position?
Thanks @pliant stream and @native hemlock
Okay so I've got the below in an sqf file.
_vehicle_spawn_function =
{
comment "type of the heli to spawn";
_type = "B_Heli_Transport_01_Camo_F";
comment "sets position of spawn - use landing pad as coords";
_pos = [2215, 13335.252, 0];
comment "get a list of objects of the same type in a 5m radius around the helipad";
_near = _pos nearObjects [_type, 5];
comment "if list is empty (no existing vehicles) then create new one";
if (count _near == 0) then
{
_type createVehicle _pos; hint "UH-80 Ghost Hawk Request Accepted";
} else {
hint "UH-80 Ghost Hawk Already Present";
};
Then I have the below in a random object:
this addAction ["Request UH-80 Ghost Hawk", _vehicle_spawn_function];
The above script seems fine however on the init script within the object I'm getting a "Init: local variable in global space" error.
_vehicle_spawn_function is a local variable
It would be a good idea to put it in CfgFunctions in your description.ext https://community.bistudio.com/wiki/Functions_Library_(Arma_3)#Adding_a_Function
That will go in your description.ext and you have a few options of which way you would want to do it. So for example using the file path way it would look something like this
class CfgFunctions
{
class leon
{
class vehicleSpawning
{
class spawnVehicle
{
file = "some/path/fn_spawnVehicle.sqf";
};
};
};
};
@native hemlock is it typically bad dev practise to leave loads of scripts in the root, like best to organise etc?
Then your mission folder would look something like this
mission.sqm
description.ext
some
path
fn_spawnVehicle.sqf
I'd say so yes, if you have a couple of scripts it is no big deal but gets messy quickly
Then in the init of the object you would have
this addAction ["Request UH-80 Ghost Hawk", leon_fnc_spawnVehicle];
SO regarding the parent classes @native hemlock, is there reason for those. I notice one is Leon and another related to spawning?
There are different formats, so it depends. For some reason the format I gave didn't work in the editor when I just tried it. So try this one instead
class CfgFunctions
{
class leon
{
class vehicleSpawning
{
file = "your\path";
class spawnVehicle {};
};
};
};
That would look like this
mission.sqm
description.ext
your
path
fn_spawnVehicle.sqf
In this format for CfgFunctions the class vehicleSpawning could be renamed anything, it's just a categorization you could use for organization
So if you wanted to add more functions related to vehicle spawning you might add
class vehicleSpawning
{
file = "your\path";
class spawnVehicle {};
class armVehicle {};
class rotateVehicle {};
};
Okay cool - I'm actually still getting the local/gloab variable error though?
local/global*
Can you paste the init for the vehicle
And have you tried using the vehicle respawn module?
init for the object yeah? and no.
It probably would do exactly what you are looking for
this addAction ["Request UH-80 Ghost Hawk", _vehicle_spawn_request];
You need to update that
this addAction ["Request UH-80 Ghost Hawk", yourTag_fnc_yourFunction];
Yes if you defined it in the CfgFunctions like I described
I think the vehicle respawn module would do exactly what you'd like
While in Eden Editor pres F5 (Systems) > Select the cog icon (modules) > Search for vehicle respawn or go to multiplayer and find vehicle respawn > Place down vehicle respawn module > Select the vehicle or the module, right click, and click Connect > Sync to, then move your cursor to the opposite object and click it
If you did that correctly there will be a blue line between the vehicle and the module. If you right click the module and go to attributes you can set the specific settings for the respawning of vehicles attached to that module
Am I going to be able to make it print Hint text and allow a custom option text such as the coded version?
Having a look now.
Yes, it has a built in hint it displays, which you can disable. Or alternatively you can use the expression field to execute code when the vehicle respawns
lol so yeah that does exactly what's needed. Thanks @native hemlock !
interesting one
{arr deleteat 0} forEach arr;
deletes all but last element
PS yeah, I know that modifying array while iterating it is a weird idea
nope, it deletes first 2 elements if count arr == 3, deletes first 4 elements if count arr == 7
so, do not do like this)
Those results are consistent though
well by this way you get half an array removed
If the number of indexes was even it would be I imagine. Can you verify?
With count equal to 10. Not on PC
not on PC? where?
Sorry, I'm not at a computer to run it
it removes 5 of them
69 > 35 > 17 > 8 > 4 > 2
seems to be skipping an element on every deleteAt inside forEach code block
anyway I found my way through it
Yeh, so you'll always end up with floor((countarray + 1)/2) elements being removed
since it is for script replacement of BIS's vehiclerespawn module - I just replace destroyed vehicle with new one in array
yep, that's odd, but again
changing an iterating array is always weird idea
unpredicateble behaviour
It seems predictable from this. It's lowering the number of elements it's looping through each time
It's bizarre though. Checking count every time
and just do not change the array length
because as @queen cargo mentioned - arrays in arma are mutable objects, and I do not want to spawn copies of it
What are you trying to do to an array?
I am writing a MP vehicle replace module to replace stock one
adding a vehicle to respawn manager - means to add this vehicle object to an array on server
from time to time script iterates through this array to check if we need some vehicles get respawned
when we have one - we need to remove old vehicle - because if we just delete it, its array element will become objNull
so I ended up replacing old vehicle objectin this array with a respawned one
Does the replacement vehicle have to go on the end?
Can't you replace the old element (at that index)
that's what I finally did
private _index = rwt_adrem_managedlist find _oldveh;
rwt_adrem_managedlist set [_index,_veh];
before removing _oldveh
I need to iterate to check respawn conditions
{
private _veh = _x;
if (_veh call RWT_fnc_adremNeedsRespawn) then
{
[_veh] call RWT_fnc_adremRespawnVehicle;
};
} forEach rwt_adrem_managedlist;
Iterate through and use set with _forEachIndex
I only need it sometimes, vehicle are not likely to respawn all at once at the same moment
for example we need it to respawn when alive _vehicle isEqualTo false
But you need to frequently monitor them all for that?
Loops in loops 😛
Hehehe
Hard to see much on the phone. Looks good though
I think BI has a very similar set of functions
that's to avoid tons of while {true} do {}
they have many similar functions, but I always hit some limitations
like with vehicle respawn module
you probably mean something like https://community.bistudio.com/wiki/BIS_fnc_runLater
yes
["itemAdd", [_id, _code, _timer, _timerType, _condition, nil, true]] call BIS_fnc_loop;
//On each frame event handler
missionNameSpace setVariable ["BIS_fnc_loop_onEachFrame", ["BIS_fnc_loop", "oneachframe", {
//Function is called every frame
["oneachframe"] call BIS_fnc_loop;
}] call BIS_fnc_addStackedEventHandler];
^^^ from BIS_fnc_loop
come on :)
that's a complete handbrake
in unscheduled environment
PFH ;)?
PFH?
for visuals yes - for things like respawn management - big overkill
I can't see the code on the phone, but I guess you're using a trigger longbow?
@dusk sage yes, trigger checks every 0.5 seconds if we have a job queued - it is just a select cmd
if there is one - the job is spawned
@tough abyss I know, I am not from that company)
So a slower PFH then
much slower
it designed for workloads where +/- 2-3 seconds will not matter
like bomb timer, veh respawn and other similar use cases
For purely the vehicle respawning, you said you'd need to check every 15 seconds. Surely a loop would be adequate?
why I need a loop? again, I made a cron scheduler for such things
max precision with trigger - 0.5 seconds
PFH, trigger, doesn't matter. You need to check one thing every 15 seconds
not exactly
the trigger evaluates ~0.5 seconds the first element of job schedule array, if arr select 0 >= time - it means that now we need to spawn a job
so we keep in trigger's loop only one simple operation
Like the idea behind PFH, yes
yep
All I'm saying is you are checking every 15 seconds, it doesn't seem crucial to use
Hi, I have a problem with base respawn. For testing purposes I made a simple mission file. 1 soldier 1 respawn marker, added the description.ext and startet testen. Hosting die Server on my local machine, everything works as intented. Loading the mission on my linux dedicated server the respawn button is grayed out and respawn doesn't work. Any ideas what the problem might be?
is it possible to make a map ctrl which can't be dragged around with the right mouse button?
like, part of a dialog but not interactable with mouse cursor
like the foldable map mod?
yeah except part of a dialog, not a display
I guess it is, check Karel Moricky's mission in workshop - he has a mission showcase for all types of controls
hi guys, my server's been infested with SSPCM users lately. I'm currently using BASIX anti cheat mechanic and I've added sspcm.pbo to the blacklist. However some people still seem to bypass it, and I think it's because it only checks for lower case "sspcm" and not any capital-lower case combo of "sspcm". Is there a way to have it check for "sspcm" whether it's in capital letters or not? If not, would it be possible to have the basix search for .sqf files that are in the pbo file?
there's absolutely no reason I can think of right now to use the scheduler
it provides no advantages over unscheduled whatsoever
Is there a command similar to count that returns an array of the items that meet the condition?
foo = {_x % 2 == 0} §command [1,2,3,4];
foo = [2,4];
Or more simply
_even = [1,2,3,4,5,6,7,8,9,0] select {_x%2 == 0}; // returns [2, 4, 6, 8, 0]
cheers
@tough abyss Why not use verifySignatures?
wouldn't that block players with legit mods from joining my server?
Not if you have the corresponding bikeys in the keys folder
true but I meant "legit mods" that are not in the pack the server runs
like if my server isn't running RHS, someone with RHS would be kicked off
also I've tried the verify signatures but clan members with the exact same mod pack wouldn't be able to join, even if they have the exact same (!) files as the server
like putting them on a USB and transferring
You generally don't want people to run mods that your server isn't using
e.g. someone with RHS accesses arsenal and picks a RHS weapon, then everyone else will get errors
then there are tons of mods which simply aren't made for MP
And they won't see it, if they are in a vehicle you don't have the mod for they will be floating through the air
Then from an anti cheat perspective you can't block a PBO name or CfgPatches entry, because those could be simply renamed by the addon user
@tough abyss then you were doing something wrong, or the mods weren't signed
all keys copied to the keys folder for the server
rest of the mods are all signed on client machine
for some it's RHS, some it's USAF etc etc
Sounds like eating a cactus
Server admin defines a set of mod played on server, if you do not verify mods players connect with - you will never get rid of cheaters and errors
pure brainfuck instead of game
I know but I'd prefer letting people with non-SSPCM mods join, regardless of the mods on the server. Is the coding of ArmA 3 when comparing filenames subject to capital <-> lower case differences?
like "sspcm" and "SSPCM" aren't the same for it
just to confirm what I was thinking
most things in Arma are case insensitive, or used to be anyway
not sure about string comparisons though
seems like "abc" == "ABC" is case insensitive and "abc" isEqualTo "ABC" is case sensitive
This is the code used by BASIX to check PBO files:
//Addon Blacklist
_Setting1 = true; //Scan player PBO files ("true" is on, "false" is off, set to false by default)
_Setting2 = ["devcon.pbo","DevCon.pbo","DEV_PostA3.pbo","DEV_CO_Dummy.pbo","sspcm.pbo","SSPCM.pbo"]; //Addons you don't wan't on your server (e.g. "devcon.pbo")
// BASIX Engine
if (_Settings select 0) then
{
[{
if !(isServer) then
{
_Settings = call BASIX_SETTINGS;
if ((_Settings select 11) && ((getPlayerUID player) in (_Settings select 12))) exitWith {};
if ((count activatedAddons) > 348) then
{
for "_i" from 0 to ((count activatedAddons) - 1) do
{
_pboName = (activatedAddons select _i) + ".pbo";
if (_pboName in (_Settings select 1)) exitWith
{
_reason = format ["Blacklisted Addon (%1)",_pboName];
_reason spawn BASIX_BAN_ADD;
sleep 0.1;
waitUntil {!(isNull(findDisplay 46))}; (findDisplay 46) closeDisplay 0;
};
};
};
}
}, "BIS_fnc_spawn", true, true] spawn BIS_fnc_MP;
};
first bit (Addon Blacklist) is from the files called Settings
2nd bit from the file Initial
use ```
@lone glade sorry could you elaborate that a bit more?
use markdown code block
three of those before and three after the block
also, enable signature check, otherwise you're just open bar for cheaters
verify signatures will kick off anyone not using a mod that is not running on the server, so if people have a older version of a mod, they will still get kicked off, am I right? Also I'm not sure where you want me to use the markdown code block, do you mean '"SSPCM.pbo"'?
like this
mycode
if you want people to be able to join with older mods keep the keys
just enable signature check, if you refuse to do so you have no ground to complain
might be just me but I'm seeing your [mycode] without any quotation marks
Does anyone know how to use the restrain/unrestrain feature from the apex protocol in your own singleplayer / mp mission?
which "restrain" feature ?
In the first mission from apex, you unrestrain a polcie man in the house you shall get to
Just before going to the radio tower
You press spacebar for a few seconds and then he is free
yeah, that's HoldActionAdd
uh nice, thank you
there
read the header of the function too, it has more informations
for the animations themselves check the animation viewer then > cinematics, it has all of the ones you want.
and finally, if you want the animation to be seen by everyone remoteExec switchMove
Allright, thank you 😉
is there a native command/function to shuffle an array?
sure
private _cnt = count _this;
for "_i" from 1 to _cnt do {
_this pushBack (_this deleteAt floor random _cnt);
};
_this
put this into a function and enjoy.
cheers
Just realized that copying MyObj_2 no longer creates MyObj_2_1 but MyObj_3
That makes me absurdly happy
@lone axle I didn't notice before, but if that is true then thank god!
hm, is SetMarkerText still buggy sometimes? I rember some cases, when they were not synced to JIP Players.
why's my camCreate quality so shitty?
never mind, think i've got it
switchCamera quality is normal, but rendering to texture gives me like 1/4 quality
Is there a way to open the Esc-pause menu via script?
guys is armaholic essentially dead for scripts? Virtually everything I've tried is full of errors
@lone glade @lone axle
No need to make another function
https://community.bistudio.com/wiki/BIS_fnc_arrayShuffle
didn't realize KK rewrote it :p
😉
Ok. I tried making a GUI for something a while back and I had a problem. I made it in the arma 3 GUI editor and all that, I didn't even add any functions to the buttons because when I went to test it, it just would say couldn't find the class name
Both the class names were the same. But it didn't launch anyways.
We'll need to see it to comment 😛
I'm on my phone right now so I can't, but is there any reason you can think of?
Or is there some documant that is like a step by step that I can read through to see where I messed up?
2016/07/19, 17:00:34 Performance warning: SimpleSerialization::Write 'params' is using type of ',NaN' which is not optimized by simple serialization, falling back to generic serialization, use generic type or ask for optimizations for these types
2016/07/19, 17:00:34 Performance warning: SimpleSerialization::Read '' is using type of ,'NaN' which is not optimized by simple serialization, falling back to generic serialization, use generic type or ask for optimizations for these types
2016/07/19, 17:00:34 .: Value type not matching: Number != Not a Number```
dafuq? `Value type not matching: Number != Not a Number` oO
i got that error once and it made me angry and upset
So, any idea why moveInCargo would just.... break and refuse to do so ?
and on top of it "fuse" the unit that I used as target with the vehicle ?
nevermind found it, localilty issue, moveInCargo uses AL
apparently moveInCargo doesn't assign objectParent properly :/
Does someone know the IDD of the dialog for adding markers on the map?
check in config?
Alternatively figure out which one it is from https://community.bistudio.com/wiki/allDisplays
@vital onyx Where do I find the respective config?
@native hemlock thanks I'll have a look
It might be "RscDisplayInsertMarker" idd = 54?
@scarlet spoke open config viewer in editor and scroll down to Rsc* classes
I do not remember exact name, but seems @split coral pointed you where you need
@vital onyx @split coral Thanks for your help! 😃
Has anyone got access to a database or just collection of really useful scripts that you throw in your content? I'm after a simple earplugs script that has a keybinding at the moment.
Oh also a kill ticker too. "player1 killed CSAT Grenadier - 200m" etc
kill ticker seems like something which would be pretty easy to make but impossible to do properly
@split coral You were right... It's idd is 54
@frail trout Just look into the ACE SourceCode
@scarlet spoke - actually a solid idea i hadn't thought of.
KoTH also have an earplug script (just press F1 to toogle EP)
@frail trout
if (soundVolume != 1) then {
1 fadeSound 1;
} else {
1 fadeSound 0.1;
};
nice, now you just need to write the kill feed function quickly
don't forget to handle explosion and collision deaths
So actually someone interested in script collection with easier process of adding it to your mission?
Yeah, wouldn't most people?
I've made an attempt to make a framework for such thing
or better anmed skeleton
allows to copy script folder to your mission, run install script and it will be present
@frail trout any feedback is appreciated, https://forums.bistudio.com/topic/192009-release-arma-3-mission-skeleton-version-11-with-mission-build-script/
Your post doesn't descibr what it includes exactly?
it is a tool for installation now we need to pack the scripts to form a library and the easy way to install them
I have repackaged one of my scripts to support this approach
more to come
so currently your library is empty?
oh well, I'll definitely download it.
there is also need to request permission from various scripts authors for such repackaging
I couldn't personally give you any feedback until you've got stuff to add though dude!
A basic revival system
A more in-depth revival system
Earplugs (hotkey and idealy a visual icon, top right or something to say they're in)
Custom Music Player that uses triggers easily
A few different types of mission intros - thing such as patrol ops comes to mind.
Neat library idea @vital onyx
Yeah great idea. you could add in some serious functionality in seconds.
I could likely think of a hell of a lot more. I genuinely believe that the arma life servers have some of the coolest little scripts added in their mission files.
Don't forget a deathcam
everyone likes to watch their own corpse
or maybe that's just me...
the arma life servers have the shittiest written code you've ever seen outside of MCC
^
Well I've experienced some good stuff just trying out the tanoa life servers to see what they are all about
I honestly don't know how I feel about this framework idea. On the one hand, it makes missions easy to build for people that aren't familiar with scripting. However, it encourages laziness on behalf of the person using the script because then they don't actually have to learn how things work in order to use them.
@winged thistle unfortunately that's true, but my oringinal intention to start working on it was time sacing on routine operations
I prophesy a wave of new mission makers flooding the channel with repeat questions...
to a get a good repeatable result
@winged thistle, isn't that quite an elistist viewpoint?
No
It's not elitist to expect people to learn how to use tools provided.
Just ask anyone you've ever referred to as "teacher"
it's much better to have to learn how to use and write stuff than depend on someone else to do it for you
^ Give vs teach a man to fish
this problem already present
Touche
just instead of asking howto questions in separate threads of particular script authors you move it to a single thread
and it will definitely simplify support and save time for authors of scripts
which other people can find more easily
It's that whole "lead a horse to water" idea though. Ultimately, there will always be people that are too lazy to use Google.
as for me I am most happy to support stringtables in separate files, split logically and then make the script merge it for me
the only thing I am worried about and not sure how to do right is about how to resolve dependencies, when some script depends on functionality of another script
Maybe have a flag for each script, and if present, check for dependent script, otherwise, error handling
yep there is some work to study and perform
I'd just do everything in an array var for dependencies, but maybe I just like to work too hard
right now it is am empty book shelf without library assistant
Well, I stopped watching The Outer Limits for now. Let me take a look at what you have so far...
Well in that case we shouldn't have DIY website building applications and services and a myriad of other industry comparables. But they exist due to demand.
Perhaps there's not demand for this, but it'll likely create it.
I get what you guys are saying though
Go find me a Wix.com website that doesn't suck donkey balls.
😛
Those tools breed complacency rather than competence.
I'm not saying don't do it. Just saying it's not always the best option for someone with grand mission plans in mind.
@winged thistle I would broaden you thought, show any site using framework that does not suck :)
sarcasm of course, but
Well, as a web developer, I could show you a few, but I'm speaking purely from a technical standpoint
Front end is arbitrary
I know some people that write good mission scenarios, but very limited in scripting
Scenarios would equate to the front end in arma
sounds reasonable
Doesn't really matter what people make, honestly. Someone, trolls or otherwise, will always hate it.
so I am not worrying :)
Is there a reason you didn't put onplayerkilled and onplayerrespawn in the functions folder?
I don't think it really matters, but I've always tossed em in there
Left the inits out though
Maybe I'm just an organization freak...
Yeah, after looking at it, everything looks pretty damn good, but my brain explodes when I see a bunch of related files not organized into folders.
So
What should I write first? Earplugs? Basic revival system?
... Attack dogs?
I skipped this one, should go into scripts like init.sqf and so on
some of the files are put into the root not to fight the dir paths
as when you paste a path to icon for your dialog - it uses path from missionroot
#include uses relative path
so file structure - is a quick and dirty approach to lessen a headache, yet looks less beautiful
@barren magnet yes it is not present in Apex, you may configure revive from editor in mission attributes
Well i though it would be impletmented by default
well in the description.ext i know but still ...
Gotta say, I love me some sexy lookin' script, but if it works, don't fix it
exactly
being all life a linux man, writing a batch script caused some pain, so first working set was left
lol Embrace your Microsoft overlords
they are going to introduce bash interpreter officially
waiting also for stock wget.exe
@vital onyx I configured it in the attributes, but still revive is not available ...
Or pastebin...
if it is edited from Eden - then screen shot is more handy
yep eden
Well actually the attribues are in the mission file
i could paste you those from my description.ext
respawn = 3;
respawnDelay = 30;
respawnVehicleDelay = 0;
respawnTemplates[] = {"Revive","MenuPosition"};
respawnOnStart = -1;
respawnDialog = 1;
disabledAI = 1;
reviveDelay = 20; //The time it takes to revive an incapacitated unit (default: 6 seconds). Having a Medikit will halve this time. Must have "Revive" Respawn template enabled.
reviveForceRespawnDelay = 45; //The time it takes for an incapacitated unit to force their respawn (default: 3 seconds). Must have "Revive" Respawn template enabled.
reviveBleedOutDelay = 60; //The time it takes for a unit to bleed out (default: 2 minutes). Must have "Revive" Respawn template enabled.
they are all pretty default values, and everything from the system works, execpt he throws that error
What's the error?
check config for cfgrespawntemplates
however if you respawn it is unknown
I haven't played with their respawn system since before Apex
I use my own
let me slap together a test mission and check it out
They changed it?
yes
It's still listed on the wiki 😛
So what to do?
there are some settings in 3den
I want to use the revive system
Hmm I will try it out to just have the revive system
@barren magnet Revive template has been removed from CfgRespawnTemplates
so only available from EDEN
I am not aware of description.ext entries to provide the same
I'm gonna see what I can find.
Guys I'm looking into creating a keypress handler for the earplugs script provided earlier and have found this thread:
https://forums.bistudio.com/topic/124287-run-script-when-button-is-pressed/
The thread also lists the codes for the keys but they don't match up with what's used in the example so its left me a little stumped?
https://community.bistudio.com/wiki/DIK_KeyCodes#Alphabetic_sort
I can help in a sec Leon
I already have one
Interesting. The whole revive business was revamped.
@barren magnet, I just created a blank mission and checked out the mission.sqm
oh cool
@winged thistle I was able to get everything working fine. BUT only via mission attributes. The question would be if i could make it work with just the description.ext
as missions sqm can change ...
I'm not entirely sure. I have to relearn the system since they changed it and removed the template.
There are options in the attributes that are not available for description ext but necessary for it to work ... genuis arma
Hi, sorry for interrupting, but does anyone else have a problem with using mysql_escape with extDB3? Every time I try running the query it crashes my server.
contact @tough abyss for that maybe 😃
Yea, just wondering if it's a problem with how I formatted it or if it's an actual bug.
Hahaha sure thing
I mean honestly, I found extDB2 much easier to use lol - ever since I had to make the switch to 3.
Sorry for interrupting, but could anyone please tell me how to spawn a cluster artillery explosion in the same manner as a car bomb script?
I wish @vocal mantle was here for that one. He loves exploding things.
If its crashing your server its a bug, submit a bug report on bitbucket. And give a simple repo etc
Okay @tough abyss thanks for the quick reply 😃
@frail trout Something like this http://pastebin.com/n7dj6ngk
Create a new case for each DIK you want to use. Put stuff in the cases. Voila, you're now a master of the keys.
You owe me a beer.
😛
Let every server from now on contain an earplugs script.
DIK codes
Should be on the wiki, sec
Those values are all listed in hex
Convert to dec
The keys look like they are in hex
Yup
oh right okay, so you an straight convert
So do us all a favor and convert them all and update the wiki 😛
does arma not use the hex keys anymore?
oh okay
It's actually fairly easy once you recognize the pattern
so this script just needs chucking in an .sqf and referencing in the init?
Yeah, instructions at the top of the paste I linked
Just slap that EH into initplayerlocal.sqf
Reference it in functions.hpp as well
Otherwise, no go
Forgot to add that bit
You've actually just provided more insight than you think. So initlocal would apply when making sure the script applies to all players on a MP server or...?
It applies to all players where the player is local, aka to each player
Since we don't want to add it to each player everytime another player joins, we put it in initplayerlocal
So if I'm creating an MP mission (it's basically just an empty map for Zeus missions between friends) I want to be referencing the created scripts in there rather than just init?
Gotcha
Assuming you only want them to work for the local player
If you want something to run whenever a player joins, use onPlayerConnected EH
I want all of the scripts I am using to apply to each and every player on the server
Like ["connect", "onPlayerConnected", {[_id,_name,_uid,_owner,_jip] call TAG_PlayerConnected}] call BIS_fnc_addStackedEventHandler;
come on no need for such stacked EH
Well, it's what I use cuz I have complex stuff happening
Recommend a simpler solution?
Pretty much the same result either way
I'm going to also have to look into functions.hpp as that's something I've not come accross yet
So, you have options 😛
It's fairly simple
Just makes declaring functions simplified
I prefer remoteexec way
I run mine from the server, and it only handles a server function, so no need, but yeah, remoteExec works
class TAG {
tag = "TAG";
class general {
file ="\functions";
class keyDown {}; //keyDown function
};
};
};```
functions.hpp example
Then you can simply call the function with TAG_fnc_keyDown
be sure to #include "functions.hpp" in description.ext
Sorry just catching up, so I don't have to create and add something to functions.hpp but merely reference it from within description.ext?
If you want, you can just put cfgFunctions directly in description.ext
But I prefer organization
my cfgFunctions example assumes that you put your fn_keyDown.sqf file in a folder called "functions" in the mission root
And yes, you have to put "fn_" as a prefix to the files you reference in functions.hpp
I realize now, I just explained that whole thing to you backwards...
Should probably have started from description.ext, but hey, all the info is there.
Yeah I kinda understand most aspects. I mean if it doesn't work, I just blame you and throw lines of code at you anyway.
putting cfgFunctions directly in description.ext is what I'm confortable with at the moment
Well, don't do it
Get comfortable with granularization
You'll thank me later
It's really easy.
For example, let's say you have cfgFunctions in description.ext currently
Everything is peachy keen
yeah
Well, instead, move cfgFunctions to a new file in the mission root called "functions.hpp"
(Normally I would say put it in missionroot\functions, but hey, simplicity)
Then, where cfgFunctions was in description.ext, instead, put #include "functions.hpp"
That's it
Probably because I explained it backwards 😛
Just be sure your filepaths match up to the actual file locations in functions.hpp, and be sure to add "fn_" as a prefix to your actual filenames for the scripts you reference in functions.hpp
Let's take keyDown for example
In functions.hpp, cfgFunctions would look as I have it above, where your function is referenced with class keyDown {};
No prefix there
But the file with your keyDown script would be named "fn_keyDown.sqf"
@frail trout just read carefully https://community.bistudio.com/wiki/Functions_Library_(Arma_3)