#arma3_scripting
1 messages ยท Page 298 of 1
yeah with Arma 3 user texture objects its much easier
yeah that too
Getting a "generic error" when calling the following, any clues? ```SQF
fnc_safeStartOn = {
isSafeStart = true;
safeStartLoop = 1;
ssDelManProj = player addEventHandler ["Fired", {deleteVehicle (_this select 6);}];
ssDelVehProj = (vehicle player) addEventHandler ["Fired", {deleteVehicle (_this select 6);}];
player allowDamage false;
if (isSafeStart || safeStartLoop == 1) then {
while {safeStartLoop == 1} do {
sleep 60;
hint format ["Weapons are cold, wait for admin to trigger start. (%1 minute since briefing stage started)", safeStartLoop];
systemChat format ["[SafeStart] Weapons are cold, wait for admin to trigger start. (%1 minute since briefing stage started)", safeStartLoop];
safeStartLoop = safeStartLoop + 1;
};
} else {
while {isSafeStart} do {
sleep 60;
hint format ["Weapons are cold, wait for admin to trigger start. (%1 minutes since briefing stage started)", safeStartLoop];
systemChat format ["[SafeStart] Weapons are cold, wait for admin to trigger start. (%1 minutes since briefing stage started)", safeStartLoop];
};
};
};
that error message should contain a line number
you spawning the function? (not calling it)
i think that error happens trying to sleep in a nonscheduled environment
(the alternative would be the game freezing for 60 secs)
same reason they didn't fix https://feedback.bistudio.com/T122322 ๐
aren't animations part of simulation which is disabled for simple objects?
Yeah good guess, maybe something changed with simulation
Simulation disabled?
I got similar reports of doors not opening, no details what and where exactly though
Thought it might be my custom spawned buildings with disabled simulation
Spawned a building, disabled simulation, doors open just fine
๐ค
Try to disable global simulation some time after creation?
and see if animations still work
Makes perfect sense to me. Simulation disabled = no animations.
BIS_fnc_initRespawn adds HandleDisconnect event handler always returning true, resulting in broken missions with disabledAI=1
Ahahahaha
BIS_fnc_initRespawn (a3\functions_f\Respawn\fn_initRespawn.sqf) adds HandleDisconnect event handler on postInit which always returns true since last called function (BIS_fnc_logFormat) returns true. This breaks any mission with disabledAI resulting in player units remaining in game and breaking mission logic.
This is brilliant. I love stuff like this.
Enable simulation for a frame on clients?
I guess client no longer processes animation messages with disabled simulation now
spawn worked, thanks @vapid frigate.
Why are all the position commands so imprecise? They all give positions in 10cm intervals, which means that if you use it to make a camera follow an object, it's very laggy.
I had to use getPosVisual to get a smooth camera.
seen someone mention that disconnecting players get turned in to AI with 1.68 so that's probably related
there also was a workaround, let me find it again
All the position commands except getPosVisual are broken. They only return positions in like 10cm intervals
For those who interested, fix to issue with HandleDisconnect is very simple
Have a logic on map with
BIS_initRespawn_disconnect = -1;
in init field
EH gets added on post init
so having logic with this line in init is sufficent
no why remove anything
just have this and it will not get added
yes
it checks if BIS_initRespawn_disconnect is nil before adding though
so you just have to define it before code kicks in
is there a thread on forums about this?
did anyone complain yet?
gonna reply there
New channels down there huh
for anyone not already using simpleobject...
this will take all classes you specify and make them simple
was the way global variables changed in addAction execs are handled changed?
what do you mean?
like
if I have variable x
and I have an action that changes x's value to 3
ie
x = 3
did they change how it propagates over the network?
it suddenly changed for me
it wont propagate over the network unless you explicitly send it over
using for example publicVariable
Variables are not synchronised over network unless they are attached to an object and broadcasted with the corresponding parameter or published with publicVariable
Yeah
Was working previously doing that..
trying a restart, sometimes Arma just pulls shit
^ was that
It will depend on the extension
You will need to recompile the extension for 64bit etc + rename to the correct format i.e _x64
Heyho folks, is there any opportunity to change the kick message of kicking via servercommand?
So what mods got updates for 64 bit so far?
TFAR ACE ACRE had it for months. ALiVE has x64 pre-release. extDB don't know. I think extDB3 has x64 support.
Cool
@still forum extDB3 has 64-bit dll, tested today, works fine
That feeling when the person in charge of the mods says that version of Ace isn't necessary
And cup
I had to do some fixes for BWA3 on 64 bit, but that also has been out at least a month.
The same crash that broke STHUD interestingly.
It is.
ptsPerSquareSea = 0; crashes the game (map control)
Has to be >0 on 64 bit. Works fine 32 bit
@velvet merlin โ
Yes.
At least that's what I heard. And it's 100% what crashed the old BWA3 versions.
already tried but didnt help in our case
hmpf
some ppl say also it doesnt fix sthud for them (but hard to tell if they didnt mess up)
There is always a possibility of other errors, but this definitely crashes 64 bit.
Just don't take it too seriously.
Even if you break the fun for thousands one weekend, it's all just games.
Was the a native command to check, if the current CargoIndex was taken or not?
(Native = not using Crew/FullCrew)
This new RscTreeSearch will that search a tree automatically without you having to script a search function yourself? If anyone knows
damnit
Does anyone know? This new RscTreeSearch will that search a tree automatically without you having to script a search function yourself? If anyone knows
No need to post it 30min later, when there are 3 msgs gone by...
If anyones knows -> He will answer (if he wants to).
I guess ๐คฃ
Hello, am i going insane?
//server
"TEST" addPublicVariableEventHandler {
(_this select 1) params ["_uid", "_netId"];
format["Client %1 (%2) UID %3", _netId, name (objectFromNetId _netId), _uid] remoteExec ["systemChat"];
};
//client
TEST = ["12345678",clientOwner];
publicVariableServer "TEST";
replace clientOwner with string - it works, anything else produces no effect, what am i doing wrong here?
I don't see clientOwner anywhere in there
oh woops, was copypasting array from memory
clientOwner == nil?
oh :x
"TEST" addPublicVariableEventHandler {
_netId = owner (_this select 1);
_uid = getPlayerUID (_this select 1);
format["Client %1 (%2) UID %3", _netId, name (objectFromNetId _netId), _uid] remoteExec ["systemChat"];
};
//client
TEST = player;
publicVariableServer "TEST";
Also doesn't work
The Dedicated Server in question does not use BattlEye
oh my god i am in fact, going insane
Syntax:
objectFromNetId id
Parameters:
id: String
owner only works on the server machine and the id reported by clientOwner is not guaranteed to be the same as used by remoteExec or publicVariable.
also objectFromNetId needs the netId not the OwnerId. https://community.bistudio.com/wiki/netId which the name of the function kinda already says
@rotund cypress it's written down on the wiki page
You have to use a predefined RscEdit to use it
Can you link? Or is it Dialogs Ctrl?
either I'm blind or the wiki rly don't covera it: Is there a command script solution for spawning a module? In particular I want to spawn a zeus (curator) module which I can use later one
createUnit
ah lol thanks
https://community.bistudio.com/wiki/ctrlCreate example 4 @rotund cypress
But also see this: https://feedback.bistudio.com/T123788
What's it for?
allows searching an rsctree
Searching in RscTree
little upsetting it uses a hardcoded RscEdit though
Hardcoded?
Can't you do that all yourself with a RSCEdit?
Yes you can
But the point is that you dont need to make a function yourself now
I guess
O.K.
I'm not sure what matching it has
But that's the fun part about ui.
Well, I've made a search function myself already, but if I can get it without having to do it myself and make a script of mine cleaner without excess code like search, I'll take a premade BIS function
Oh @dusk sage so by hardcoded you mean it can only use RscEdit with IDC 645
So premade RscEdit
"excess code" : (
Well, you get the point @little eagle
Tbh, no. I mean yeah, but that's not something I'd ever consider.
@dusk sage Hopefully a hotfix patch comes soon
Not a new ArmA patch without any bugs or errors or something else amiright?
is there a way to give addCuratorAddons all loaded AddOns? Or how is it done via the module in eden if you set "All AddOns (including official and non-official)"
curatorThingy addCuratorAddons ((configFile >> "CfgPatches") select {configName(_cfg select _i)});
there is a better way. maybe assign instead of select. not sure
maybe using configClasses
hm.. is moveInCargo broken?
for "_i" from 0 to 12 do
{
_Unit = "B_Soldier_F" createUnit [position player,(createGroup west)];
_Unit assignAsCargoIndex [cursortarget, _i];
_Unit moveInCargo cursortarget;
};
(Unit gets created, but not moved in the Vehicle... hmm)
also tried:
_Unit moveInCargo [cursortarget,_i];
&
_Unit moveInCargo [cursortarget,(1-12)];
moveInAny also doesn't work with AI. hu? oO Do i miss something?
I remember wanting to make a zeus that ONLY has the remote control option
@hollow lantern
private _allAddons = "true" configClasses (configFile >> "CfgPatches") apply {configName _x};
// existing curators (server)
{
_x addCuratorAddons _allAddons;
} forEach allCurators;
// all future curators (createUnit, all machines)
activateAddons _allAddons;
You can run this everywhere or pick apart what you need.
But im pretty sure each option isnt separated by addon
Does work
for "_i" from 0 to 12 do
{
_Unit = (createGroup west) createUnit ["B_Soldier_F", [0,0,0], [], 0, "FORM"];
_Unit moveInCargo cursortarget;
};```
Does NOT work:
```sqf
for "_i" from 0 to 12 do
{
_Unit = "B_Soldier_F" createUnit [position player,(createGroup west)];
_Unit moveInCargo cursortarget;
};```
Note to myself: Always read the small stuff called "Return Value:" down below ...
thanks @little eagle
tried to check if there is any lag in createunit i.e check if _unit isnull?
STRING createUnit reports no object reference
There is no lag in creating a unit. It will always report the object reference. But only if the correct syntax is used.
Or fixed with A3, including getting rid of the init thing.
No one wants back warts.
class CfgFunctions {
class Aebian_Config {
class Aebian_init {
class Aebian_AddActions {
file = "\ADB\scripts\Aebian_AddActions.sqf";
postInit = 1;
};
class Aebian_Zeus {
file = "\ADB\scripts\Aebian_AddActions.sqf";
postInit = 1;
};
};
};
};
``` Shouldn't that work? For some reason I get a missing bracket error alltough my code seems fine for me. ``` 18:22:47 Error in expression <usepos=getPosATL player; hint format["%1",(getPosATL player)]; copyToClipboard (>
18:22:47 Error position: <",(getPosATL player)]; copyToClipboard (>
18:22:47 Error Missing ]
18:22:47 File \ADB\scripts\Aebian_AddActions.sqf [Aebian_Config_fnc_Aebian_AddActions], line 11 ``` thats the code: ``` if (isDedicated) exitWith {};
player addAction ["<t color='#C95849'>[A] Position (Player)</t>", "housepos=getPosATL player; hint format["%1",(getPosATL player)]; copyToClipboard (str (housepos));"];
player addAction ["<t color='#455361'>[A] Direction (Player)</t>", "dirpos=getDir player; hint format["%1",(getDir player)]; copyToClipboard (str (dirpos));"]; ```
You need to escape the quote marks around %1 in both lines.
"dirpos=getDir player; hint format["%1",(getDir player)]; copyToClipboard (str (dirpos));"
"dirpos=getDir player; hint format[" %1 ",(getDir player)]; copyToClipboard (str (dirpos));"
Maybe that helps you to visualize it. The game thinks your string ends after the second quote mark.
hmm I'm pretty sure it worked before without escaping them. But yeah that kinda explains the error https://img.knight-industries.org/2017-03-17_18-44-20.png
It never did, I can guarantee you that.
But there is no need to use formatin the first place.
hint format["%1",(getPosATL player)];
could just be:
hint str getPosATL player;
Oh my
Or, you just use addAction with CODE, not STRING...
That thing is a mess
Inside of a String ( " " ) -> You exit it premature with another "
Means:
Inside a String -> Use ' instead of "
Means:
"....rmat["%1**"**,(getPosATL pla....
Turns into:
".....rmat['%1**'**,(getPosATL pla....
I know how to escape things lol but thanks
Then why didn't you use/do it? ๐
Escaping strings is fun:
QUOTE(QUOTE(QGVAR(forward)) call FUNC(playSignal));
http://redmonk.com/sogrady/2017/03/17/language-rankings-1-17/ <- includes some SQF stats ๐
because it worked without escaping, I have my pbo here I used before here and there is also nothing escaped but I had the addActions InGame thats why...
It never worked without escaping.
it worked? No way.
...
.rpt or didn't happen ๐
okay I'll do w8
^^ Waiting for ErrorLog. You wanna give me some Popcorn, Commy?
here:
๐ฟ
๐
๐
onUnload = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QUOTE(GVAR(DisplayInformation))), nil)]);
urg
@halcyon crypt Where do you see the .sqf stuff?
Okay, so 1) this are the AddActions: http://images.akamai.steamusercontent.com/ugc/85972156535986553/8EB4343CEF701E80EF2FCB3A5B68ED009297A47F/ 2) and thats my PBO with the SQF and nothing escaped: https://dl.knight-industries.org/@ADB.zip I can also share a RPT if you wish...
nothing too interesting though, just thought it was funny ๐
lol
player addAction ["<t color='#C95849'>[A] Position (Player)</t>",{ housepos=getPosATL player; hint format["%1",(getPosATL player)]; copyToClipboard (str (housepos)) }];
"housepos=getPosATL player; hint format["%1",(getPosATL player)]; copyToClipboard (str (housepos));"```
!=
```sqf
{ housepos=getPosATL player; hint format["%1",(getPosATL player)]; copyToClipboard (str (housepos)) }```
Those obviously aren't escaped, because they are not inside a STRING ...
hmm well okay then I messed stuff up
As we told you
Just stick with the curly brackets. There is zero benefit in using the STRING syntax and in future, (if they fix a bug), it might even be worse.
Yep
+If a Blue, Orange or Green Colored Person says something -> 99% of the time its true.
Hmm.
Like: Commy likes me.
Thats the 1%. Everybody knows -> Commy likes noone.
I love you all.
that's the spirit โค
^^
I also lie without shame.
Guys, can someone explain difference between IGUI and GUI?
ingame generic user interface
usier XD
jesus...
Some what is the difference? @little eagle
[12:06 AM] commy2: I also lie without shame.
You can't back up now ๐ค
there is none @rotund cypress
one is "ingame" (in mission), the other is menu etc.
What if that was also a lie, Marcel? hmm
ingame, e.g. the weapons dialog
Oh so RscDisplayInventory is IGUI? @little eagle
And if a red name speaks, it's 99% wrong.
it wasn't, โค is truth!
sush, my sentence!
Sure, Sim. But don't take it too seriously. In the end it's just arbitrary folder names.
Than say it sooner dscha
in regards of that string escape thingy
SQF uses block text escape for strings
"foo is a string with content ""foo""" will work
though ... i am quite sure SQF is not using proper block text which span above newlines etc.
3min ago @plucky beacon
Dscha - Today at 12:06 AM
Missing "I"(edited)
Problem solved. Next one.
Alright @little eagle
Ya but you didn't say it for the rscinventory thingy
step on Lego
@halcyon crypt wasnt that based around search machine stats?
evil one, aye?
@queen cargo probably, didn't really read it. Just went to the chart ๐
ahh no
it was based on github stats
oh yes but it most likely used the new github search thingy or whatever
If I want to copy an entire config to clipboard I tried this copyToClipboard str (configfile >> "CfgHints") but it actually just copies the path.
or not ยฏ_(ใ)_/ยฏ
Anyone know how I can do it?
yes, with a hell lot of scripting you can get there @rotund cypress
but copyToClipboard is kinda dull since BI limited max string size
Cause I'm not sure where CfgHints are
Don't think that is possible with just a few lines, Sim.
In the addons folder
Don't you have a P Drive SimZor?
Also:
This one, will be your best friend!
http://stefanstools.sourceforge.net/grepWin.html
TotalCommander is the way to go on windows @jade abyss
findstr is like Windows' grep
pff, TotalCommander. Thats so 90's
oh grepWin is a gui.. lame
Yeah, "KlickyBunti" in German
is that an actual dictionary word? ๐
Okey so I converted the bin file but CfgHInts is not in there ๐ญ
18:15:35 Script command setOwner cannot be used for object 'B_T_LSV_01_armed_F'. Use setGroupOwner instead.
what?
@halcyon crypt Don't think so^^ Its a "childish" mix of words like "Klick" (click) -> "Klicki" and "Bunt" (colorful) -> "Bunti". So a 1to1 translation: "ClickyColorfully" (sounds lame)
@rotund cypress https://community.bistudio.com/wiki/AllInOne_Config
@rotund cypress git clone git://git.withsix.com/cmb.git <- all configs and scripts unpacked for pretty much everything made by BI and maintained by kju ๐
it's big though.. 1.3gb
(unpacked)
So does this have the latest files, latest patch?
up to 1.66 at this point
I need 1.68
[12:14 AM] marceldev89: how about https://community.bistudio.com/wiki/BIS_fnc_exportCfgHints
copies to clipboard
which ones do you need?
BIS_fnc_exportCfgGroups BIS_fnc_exportCfgHints BIS_fnc_exportCfgMagazines BIS_fnc_exportCfgPatches BIS_fnc_exportCfgVehicles BIS_fnc_exportCfgWeapons
these are available
heyho, anyone knows how "DynSimGrid" works? can't find any further information
https://community.bistudio.com/wiki/Arma_3_Dynamic_Simulation#DynSimGrid
DynSimGrid
Displays the map overlay with the most detailed Dynamic Simulation grid. The individual grid cells are coloured by the side colour of units that are present there. In case there are multiple different sides present in the same cell, the resulting colour is the summation of all present side colours; e.g. greed (Independent) + red (OPFOR) colours the cell to yellow.
I know that ;D I mean how to activate this command tbh
hmm you'll probably need to run the diag exe from the dev branch for that
As the part of the Dynamic Simulation system 3 new diagnostic modes were added to the debug console. All 3 diagnostic modes overlay map with an extra information. The modes can all be active at the same time, if needed.
https://community.bistudio.com/wiki/Arma_3_Dynamic_Simulation#Ingame_profiling says something about the diag_ commands but beyond that no clue ๐
hmm, so nothing new to me ๐ - so trial and error
Okey I have now looked through most of the PBOs where CfgHints could be but without any luck
Hahah lol okay I foudn it
Turn out its in ui_f_curator
I couldn't find CfgHintCategories though
@rotund cypress
configSourceAddonList (configFile >> "CfgHintCategories") //["A3_Language_F"]
How did you find that?
oh god
daaaamn
Just the command I needed
โค @little eagle
how many cases can I have in my switch case before I have performance hit
1?
multiple if()exitWith{}; -> faster than 1 Switch()do case
O(n)
alright then
Put to most common "case" at the top, etc.
I mean if O(n) = O(50) is that a problem?
Probably should categorize these into type then
Air, Land, Sea
Ignore me and follow commy2's advice ๐
Not sure why you're asking if it's a problem. The linearity will still apply to anything else
Just thinking about performance
It will only run a couple of times per mission so maybe it's not awful
case "B_MRAP_01_gmg_F": {"O_MRAP_02_hmg_F"};
case "B_MRAP_01_hmg_F": {"O_MRAP_02_gmg_F"};
case "B_G_Offroad_01_repair_F": {"O_G_Offroad_01_repair_F"};
case "B_G_Offroad_01_F": {"B_G_Offroad_01_F"};
case "B_G_Offroad_01_armed_F": {"O_G_Offroad_01_armed_F"};
case "B_Quadbike_01_F": {"O_Quadbike_01_F"};
case "B_Truck_01_transport_F": {"O_Truck_03_transport_F"};
case "B_Truck_01_covered_F": {"O_Truck_03_covered_F"};
case "B_Truck_01_Repair_F": {"O_Truck_03_repair_F"};
case "B_Truck_01_medical_F": {"O_Truck_03_medical_F"};
case "B_Truck_01_ammo_F": {"O_Truck_03_ammo_F"};
case "B_Truck_01_fuel_F": {"O_Truck_03_fuel_F"};
I'm sure you can put together what I'm categorizing here
oh wait my GMG and HMG are switched
rip enemy team
what diffrence would it make?
Bit faster
you can make a pair of arrrays and use their indexes
really good for massive amounts of variables too
At worst your switch is O(n), as FM pointed out. A lookup shouldn't be
๐
question, I want to make the default output make an error but it still wants to return something in the switch case
private _enemyClassname = switch (_classname) do {
case "B_UAV_02_CAS_F": {"O_UAV_02_CAS_F"};
default {if (true) exitWith {_error = format ["Classname %1 is not available in script, edit vehicleCreator.sqf",_classname]; systemChat _error; hint _error;}};
}:
_enemyClassname doesn't get anything from default obviously.
I could output _classname and if _enemyClassname == _classname do thing?
use breakOut
If you want to fully exit the file or scope(s)
so it keeps getting out of blocks until it's in the base file and then exits file
interesting
hm?
oh but I need to identify scopeName?
It'll breakTo (and then out) the scope defined
So BreakTo is how you can skip around in a single file
I've been wondering how to do that
neat
_error = str parseText format ["Classname<br/>%1<br/>is not available in script, edit vehicleCreator.sqf<br/>Identical vehicle has been spawned on the enemy side instead.",_classname];
isn't this supposed to make new lines?
oh, you can't do multi lines in hints?
wat
no that doesn't make sense, it just appears to stop after the first break
hint "abc \n def"```
dats it
tanks
_error = str parseText format ["<t size='1.25' font='Zeppelin33' color='#ff0000'>Classname\n%1\nis not available in script, edit vehicleCreator.sqf\nIdentical vehicle has been spawned on the enemy side instead.","O_G_Van_01_transport_F"];
hint _error;
MFW no text color, font or size changes
nonon \n is for normal text....
Thats why i gave you that example
hint parseText format["<t font='RobotoCondensed' size='1.2' align='center' color='#FFFFFF'>%1 - %2</t>","Thing1", "Thing2"];```
so thing1 and 2 can have \n
No ffs
Listen you Penguin
hint "abc \n def" != parseText
So you little Apple:
hint parseText format["<t font='RobotoCondensed' size='1.2' align='center' color='#FFFFFF'>%1 <br/> %2</t>","Thing1", "Thing2"];
sideways penguin
Yeah
servers seem to have a sticky view distance
although, I've managed to change it using the TAW script
private _ran = 5;
switch (true) do {
scopeName "switch_scope";
case (_ran <= 5) do {
systemChat str ["<=5", _ran];
breakTo "switch_scope";
};
case (_ran <= 4) do {
systemChat str ["<=4", _ran];
breakTo "switch_scope";
};
case (_ran <= 3) do {
systemChat str ["<=3", _ran];
breakTo "switch_scope";
};
case (_ran <= 2) do {
systemChat str ["<=2", _ran];
breakTo "switch_scope";
};
case (_ran <= 1) do {
systemChat str ["<=1", _ran];
breakTo "switch_scope";
};
};
Weirdly, this executes all do-blocks.
Probably because case sets a flag only if the condition is true, but doesn't ever reset it if it's false.
I tried to make an "anti-break"
Undefined behavior.
lol
I did it wrong
:
not do
๐คฆ
private _ran = 2;
switch (true) do {
scopeName "switch_scope";
case (_ran <= 5): {
systemChat str ["<=5", _ran];
breakTo "switch_scope";
};
case (_ran <= 4): {
systemChat str ["<=4", _ran];
breakTo "switch_scope";
};
case (_ran <= 3): {
systemChat str ["<=3", _ran];
breakTo "switch_scope";
};
case (_ran <= 2): {
systemChat str ["<=2", _ran];
breakTo "switch_scope";
};
case (_ran <= 1): {
systemChat str ["<=1", _ran];
breakTo "switch_scope";
};
};
breakTo doesn't work. Still exits the switch scope.
Only one is shown.
thanks SaMatra
Hey, when I do this```SQF
veh = vehType createVehicleLocal [14760.3,9148.35,1];
veh allowDamage false;
veh setpos [14760.3,9148.35,1];
veh setDir 200;
The vehicle I am spawning clips with the ground an sends dust flying everywhere... even though I am creating it in the air.. How would I work around thaT?'
take a look at this https://community.bistudio.com/wiki/Position
also try setdir before position
Bug with simple objects and nearestObject(s):
https://forums.bistudio.com/forums/topic/151099-scripting-discussion-dev-branch/?page=49#comment-3165046
allVariables doesn't work on controls. Always reports []. Is this new?
Can i find out from a dead unit who the killer was?
No.
Too bad. Not sure if eventhandler is the way to happiness in my case
How so?
I want to have a small lootscript that spawns stuff around units killed by players. But im using alive and that wont save the eventhandlers when virtualizing
params ["_unit", "_killer"];
_unit setVariable ["myTag_killer", _killer, true];
systemChat str (cursortarget getVariable "myTag_killer");
Seems simple enough and you can even get the killer on remote machines.
But im using alive and that wont save the eventhandlers when virtualizing
wait...
So my way now would be to have a script that periodicalky checks for new units and attaches the eventhandler to those that dont have it yet
check out this:
["CAManBase", "killed", {
params ["_unit", "_killer"];
_unit setVariable ["myTag_killer", _killer, true];
}] call CBA_fnc_addClassEventHandler;
Can do. I just thought it would be less ressource intensive to check dead units for the killer
It doesn't matter, because it's not like there are units dying all the time.
Like every second or frame or something like that.
Exactly. But there are units spawning/despawning all the time
Eh.
Which is why i thought checking dead bodies would be less work than repeatedly attaching eventhandlers
I mean both is not a real load i guess, just dead body checking would be nicer than alive units checking.
There is no other way to do this afaik.
Ok. Thanks
hm can i add stuff itno the victims backpack and stuff or will that throw an error? id otherwise just use the location
other than that, does this look abot right? ```_unit addEventHandler ["killed",{
_victim = _this select 0;
_killer = _this select 1;
if (_killer == _victim) then {
//hint "suicide!";
} else {
if ((side _victim != side _killer) && (isplayer _killer)) then {
_victim addItemToUniform "blabla_item";
for "_i" from 1 to 2 do {_victim addItemToBackpack "SmokeShell";};
} else {
//hint "friendly fire!";
};
};
}];```
ah no MPkilled i guess
side group _victim
and
side group _killer
Your logic is flawed btw. Any kill by AI would be reported as friendly fire.
true. im copying around from an older script
there is a more elegant way to do random selects right? im doing stuff like _Array select floor random count _Array atm
a got it
selectRandom _Array
for anyone wondering
oh thats even better. i used _Array call BIS_fnc_selectRandom
theCurator = curGrp createUnit ["ModuleCurator_F", player, [], 0, "NONE"];
``` shouldn't that work?
lgtm, if curGrp is defined
thanks commy oversaw that
@lavish ocean Is there anyway to get to the previous version of the Arma3 tools? The latest version of the addon builder has changed and is producing PBO's that don't work with the 1.66 version. Arma3Legacy166 branch didn't work. PS it also has a bug now with the PBO name where it makes a directory named the .PBO and puts the PBO with the same name in that directory
dang. you can only select year going back to 1982 in the editor? that's lame
trying to figure out why my rsclayers aren't working since update
I'm having trouble check if an EH exists. ```SQF
// Check if player is in vehicle, if so - assign EH
if (vehicle player != player && {player in [gunner vehicle player, driver vehicle player, commander vehicle player]}) then {
ssDelVehProj = (vehicle player) addEventHandler ["Fired", {deleteVehicle (_this select 6);}];
};
// In another function, check if EH's global variable(?) exists, if so - remove EH
if ({isNil ssDelVehProj}) then {
player removeEventHandler ["Fired", ssDelVehProj];
};
I seem to have misunderstood index.
objectName removeEventHandler [type, index]
How do I find the index, though?
it's returned by addEventHandler
you are not check.. wtf are you doing ๐
// In another function, check if EH's global variable(?) exists, if so - remove EH
And then you have a syntax error in a code statement in an if statement that doesn't even try to check if the variable exists
if (!isNil "ssDelVehProj") then {
player removeEventHandler ["Fired", ssDelVehProj];
};
Before you tried to do "If variable doesn't exist then try to use it" and even failed at doing that ๐
Also you need to remove the variable from the vehicle not the player.
// Check if player is in vehicle, if so - assign EH
if (vehicle player != player && {player in [gunner vehicle player, driver vehicle player, commander vehicle player]}) then {
ssDelVehProj = [(vehicle player),(vehicle player) addEventHandler ["Fired", {deleteVehicle (_this select 6);}]];
};
// In another function, check if EH's global variable(?) exists, if so - remove EH
if (!isNil "ssDelVehProj") then {
(ssDelVehProj select 0) removeEventHandler ["Fired", (ssDelVehProj select 1) ];
};
Shouldn't vehicle player != player be replaced with isNull objectParent player
commy is AFK right now so. Doesn't matter
I'm reading everything.
What's the best SQF scripting guide nowadays? I'm reading one from Arma 2 days
BI Wiki :u
Yeah, but in addition to that ๐
KillzoneKid writes nice stuff. But I don't think he has a general tutorial on SQF
BI Wiki again.
Thanks @still forum. I'm not the brightest "coder".
My snippets probably made commy facepalm real hard.
so im trying to add a few items to a dead units uniform after it was killed by a player.
it is supposed to loop every 60 seconds, check if the unit already has been set up this way, and if if not, add the eventhandfler. what am i doing wrong?
i start this script from the initserver.sqf:
while {true} do {
sleep 60;
{
if (!(_x getVariable ["MyUnitDeathSet", false])) then {
_x setVariable ["MyUnitDeathSet", true];
_x addEventHandler ["MPkilled",{
_victim = _this select 0;
_killer = _this select 1;
if ((side _victim != side _killer) && (isplayer _killer)) then {
_fooditems = ["kss_bread","kss_caviar","kss_chicken","kss_chips","kss_corn","kss_cucumbers","kss_mre","kss_mushrooms","kss_pea","kss_red_beans","kss_losos","kss_sausage","kss_soup_chicken","kss_soup_vegetable","kss_kilka","kss_shproti","kss_steak","kss_tushenka_beef","kss_tushenka_pork","kss_tomatoes"];
_drinkitems = ["kss_cocktail_patron","kss_bottle_big","kss_bottle_small","kss_soda_coke","kss_beer_dark","kss_beer_light","kss_soda_mdew","kss_mre","kss_soda_pepsi","kss_vodka"];
_victim addItemToUniform selectrandom _fooditems;
_victim addItemToUniform selectrandom _drinkitems;
//for "_i" from 1 to 2 do {_victim addItemToBackpack "SmokeShell";};
//_pos = getpos _victim;
diag_log "death handled";
};
}];
diag_log "death setup handled";
};
} foreach allUnits;
};```
To be honest they made me facepalm.
That script looks correct to me so far. What part of that is not working?
there dont seem to be items in the end...
cluld it be that _victim is dead and thus does not have a uniform as a normal unit would?
so additemtouniform wouldnt work
I'm busy facepalming at myself and Arma
add more diag_log stuff maybe? It will tell you if the script is even executing
I mean... aren't we all? ๐
spelling mistake in the line that i call the script with.... lets see now...
i dont get the output from diag_log "death handled";
the others show up... and the loop is running
if i run isplayer _killer on the server it should return a bool also righgt? or am i screwing things with locality up again?
MPKilled will execute code on each client and server on death
plus copy of this code will be broadcasted over network for each unit you add it to
Oh wait, it is not addMPEventHandler
Can you even use MP* events with addEventHandler?
I don't think you can
shouldn't
Can you even use MP* events with addEventHandler?
No
Ye
Mpkilled is different to killed I believe
Check the wiki if you need
I just recall that
MPkilled is run on every machine
@proven crystal @cerulean whale
killed is local to the unit it's tied to
ye just saw that
k
thanks
๐
_x addEventHandler ["killed",{
diag_log "handeling death";
_victim = _this select 0;
_killer = _this select 1;
if ((side _victim != side _killer) && (isplayer _killer)) then {
diag_log "killed by player";
_fooditems = [...];
_drinkitems = [...];
diag_log "adding itemCargo";
_victim addItemCargo [selectrandom _fooditems, 1];
_victim addItemCargo [selectrandom _drinkitems, 1];
diag_log "adding items to uniform";
_victim addItemToUniform selectrandom _fooditems;
_victim addItemToUniform selectrandom _drinkitems;
diag_log "death handled";
};
}];
that part doesnt do anything
whats wrong with it?
tried item cargo becasue i thought maybe the dead bodies are boxes rather than units
doesn't do anything means? The eventhandler doesn't get executed?
_fooditems and _drinkitems are undefined
i just took the list out for readability
hmm, edited ?
no ^^ When I wrote my message they were in there
addItemCargo does not work with dead bodies
so the uniform bit should do?
Does it log?
Fetzen what part of that code doesn't work?
no outputs
So nothing works
so even diag_log "handeling death"; does not fire
are you running that serverside?
yep
Error is somewhere outside of the code then
probably
killed only triggers on the machine that owns the unit
DriftingNitro told you killed is local to the unit it's tied to and MPkilled is run on every machine
You need to add the killed eventhandler on every machine
diag_log "deathhandler started";
while {true} do {
sleep 60;
diag_log "deathhandler loop started";
{
if (!(_x getVariable ["MyUnitDeathSet", false])) then {
_x setVariable ["MyUnitDeathSet", true];
diag_log "variable MyUnitDeathSet set";
_x addEventHandler ["killed",{
diag_log "handeling death";
_victim = _this select 0;
_killer = _this select 1;
if ((side _victim != side _killer) && (isplayer _killer)) then {
diag_log "killed by player";
_fooditems = ["kss_bread","kss_caviar","kss_chicken","kss_chips","kss_corn","kss_cucumbers","kss_mre","kss_mushrooms","kss_pea","kss_red_beans","kss_losos","kss_sausage","kss_soup_chicken","kss_soup_vegetable","kss_kilka","kss_shproti","kss_steak","kss_tushenka_beef","kss_tushenka_pork","kss_tomatoes"];
_drinkitems = ["kss_cocktail_patron","kss_bottle_big","kss_bottle_small","kss_soda_coke","kss_beer_dark","kss_beer_light","kss_soda_mdew","kss_mre","kss_soda_pepsi","kss_vodka"];
diag_log "adding itemCargo";
_victim addItemCargo [selectrandom _fooditems, 1];
_victim addItemCargo [selectrandom _drinkitems, 1];
diag_log "adding items to uniform";
_victim addItemToUniform selectrandom _fooditems;
_victim addItemToUniform selectrandom _drinkitems;
diag_log "death handled";
};
}];
diag_log "death setup handled";
};
} foreach allUnits;
};```
Yes it does. For AI that belong to the server
initPlayerLocal.sqf -> addEH "stuff"
@proven crystal
```sqf
CODE
```
InitPlayerLocal.sqf -> AddEH
And that means that the killed event will never be executed on all player owned objects
(in the missionfile, obv.)
use addMPEventhandler with the MP variant of that eventhandler.
Or use the clientside Eventhandler on the clientside
the ones at the moment should all be server sided units i suppose
Pretty sure the MP one doesn't work either if it's not added on the machine that owns the unit
dedmen
Difference is that the code will be executed everywhere if it's added on the local machine
Not what you want at all
Triggered when the unit is killed. EH can be added on any machine and EH code will trigger globally on every connected client and server.
That would mean one item per connected client
Still, one item per connected client is not what you want
Just add the killed eventhandler on every machine.
Just use the one in initPlayerLocal.sqf, why beeing so fancy?
player addEventHandler ["killed", {call Tag_fnc_MyFunction} ];```
Yeah Commy.
but if the units are owned by the server?
Every unit inside allPlayers is not owned by the server
Oops ๐ Yeah.. He's using allUnits not allPlayers. So the old code with the killedEH should still work for AI's
lbSetCurSel triggers the LBSelChanged event
great way to lock up your game
And apparently the event does not happen if there is only one element in the listbox, despite it happening when you select what is already selected via lbSetCurSel
Weird stuff
I have a question. Is there a way to detect that a certain model is a tree or a rock? Like, when cursorobject returns the object of a tree or a rock, or a bush, is that detectable that it is a tree or a rock or a bush?
private _isTree = _object in nearestTerrainObjects [ASLToAGL getPosASL _object, ["TREE", "SMALL TREE"], 1, false];
This is the best I have, but it only works for map trees, not spawned trees.
Map trees are going to do just fine though someone just told me about getModelInfo and it seems that through that I MIGHT be able to detect it too. Thx for the answer I'm gonna see if I can accomplish what I'm attempting here, if not, well, then I'll be back soon ๐
private _isRock = _object in nearestTerrainObjects [ASLToAGL getPosASL _object, ["ROCK"], 1, false];
O.K.
If i do an onplayer connected event handler on a client side, it'll work when other players join a server right?
No, it only fires on the server.
That is what you'll have to do.
for context this is for an addon, trying to make a mod version of a script
Anyone know how to get helicopters to fly to a precise point?
move will make them complete the waypoint within like 500 meters
Maybe https://community.bistudio.com/wiki/setDriveOnPath If you wanna go overkill
@still forum Doesn't move at all then, unfortunately
Place a helipad and place the waypoint on that? Maybe they behave diffently then. Arma Campaign can do it so...
@still forum I doubt it. I was thinking of using that with land though, and then cancel when he's close enough
Trying to get it to fly over a car to sling load it
Ouh. Fly not land... Missunderstood then
Yea, they stop when they're like 200 meters away
so you can't get them to a precise position
aaaaaand of course he detects there's a car there, and lands somewhere else.......
Now it works
but can't cancel the landing, and he refuses to move on until he's landed......
insertion_chopper_pilot action ["cancelLand", insertion_chopper_pilot]; is not working
oh
land: "NONE" (cancel a landing) Available since ArmA 2 57463 build.
great
thank god. that works. "cancelLand" action didn't
Confirmation that setdriveonpath don't work on aircraft?
is it possible to force a briefing? Say, each side had to come up with a plan then confirm the plan. Then they would be able to continue.
I don't know about forcing a briefing but you can force a map
Okay, from there then would it be possible to see if a line has been drawn on the map? etc?
Nevermind, I'll just make a onscreen button for that
hey does someone has a good attachTo solution? I mean I can place a object onto a vehicle in 3DEN but how can I get the cordinates codes for attachTo command from it?
I haz a question. Is it somehow possible to detect if two static objects collide with each other? Or, would collide?
Trying to figure out a system where the player can build stuff but preferably in a way where he can't build everything in one and the same spot with the models overlapping each other
Ahhhhhh
I see
Unfortunatly for me, buidlings arent physx handled
For the better I guess ๐
I've made a horror mission with fully custom AI and pathfinding and waypoint system in a fully enclosed area before which used lineintersect to detect if the enemy can see the player ๐
I can handle
Hopefully
@compact galleon there should be a waypoint completion radius, dor helicopters it is around 200m by default
@turbid thunder just curious, does your AI hunts inside buildings?
@vital onyx I took the VR map and built my own corridors and hallways using walls in vanilla
No winning condition though
well you will die anyway haha
but another short question: is there a way to tell a trigger that I don't need to be fully inside with my Truck? As far as I see my trigger activation fires only if i'm completly inside with my truck (HEMTT A4)
is there a way to check if a variable is a string, or boolean?
can't find anything obvious in the docs
I wonder what you are doing that you would have one variable that can have multiple types
@subtle ore https://community.bistudio.com/wiki/typeName
Well. What I'm doing is, if I wanted an area defined by a marker. Then it'll use a marker, if not then it'll use the map size as the entirety of the area
@hollow lantern Oh, cool. Thanks.
Example 4 should match your needs, yw
Indeed it does, awesome.
Ok I made some good bounding box progress. Managed to get cans on all 8 edges of the bounding box, however I did notice that even boundingBoxReal was a bit abstract with the sizing
Whats a good solution to turn a turret of the tigris AA directly into the sky? It's empty and I just want the gun to look straight in the air without any gunner. There is a method available with placing a soldier first and in his init this assignAsGunner tank; this moveInGunner tank; 0 = this spawn {_this doWatch player; sleep 2; (vehicle _this) engineOn false; deleteVehicle _this}; but therefore I need to create a object above the AA
ok found it, https://community.bistudio.com/wiki/animateSource
hmm didn't work
A class with the same source name should also be present in main config in CfgVehicles AnimationSources and have to be bound to the "user" controller for the command to work. If in order to animate door in example below using animate command it would require 2 calls:
Cannot animate turrets with scripts. If that were possible, I would've made a hunter-killer system ages ago.
It will work if you create a simple object aa tank though iirc. Can't shoot with those though.
hmm ok thanks
Well as a matter of fact, the UGV can have its turret animated
Yes, because:
A class with the same source name should also be present in main config in CfgVehicles AnimationSources and have to be bound to the "user" controller for the command to work. If in order to animate door in example below using animate command it would require 2 calls:
As like, the only vehicle
Simple animated killer systems?
I dunno about you but that sounds like a plan to me ๐
Nah, doesn't help me, but maybe the AA tanks of @hollow lantern are for scenery only anyway.
well kindOf but I will try that tomorrow, maybe I will make him scenery or just quit haha
AI inside would aim all over the place anyway and if it's empty, might as well make it a simple object.
I like how you typed the "kind of" as "kindOf" as in like, the scripting command. Btw I remember that in the campaign, there once was an AA tank just shooting into nothing just for the looks. With AI though
@little eagle Oi, you're smart, soo I have question for you ๐ If you would have to make a script that allows players to place objeccts but restrict them into not placing objects inside objects, how would you do that?
place how?
Currently trying smth out with bounding boxes but the returning bounding box for some objects seem to be way larger than the object itself
Like, I dunno, addAction or smth doesnt really matter, but mayby imagine you have an addaction to place something, then a local preview of the object you want to place spawns, you walk to the place where you want it placed and confirm. Should work inside buildings but deny placing things like boxes into the wall or other boxes
hmm
Although I could probably manually adjust the size of the bounding box to be more fitting of the actual model and then lineintersect my way to victory buuuuuuuut the way I know arma, there is always more than one way of doing it and knowing me, I'm likely to not do it in a way that would be optimal
There is no command to check if two objects are touching.
Well I'll just try it with the bounding box and see how well those coordinates really work out of the box. Tomorrow that is. Also need to find a good way of doing a lineintersect check from every point to every point to make absolutly sure that there is no way my object is touching anything.
Wish there was <entity> boundingBoxesIntersect <entity> command
Well, bounding boxes are pretty useless and that could be scripted in 5 minutes.
and it will work 100 slower if you need to do it on each frame
Eh. like 10 lines max.
It's also probably something you can do once and twice a second and have a final check before placing.
โ Yep, thats MORE then enough
3.50 lines you got a deal
Nope. Three fiddy
Depending on the size of the bounding boxes, thats not enough
I would go for 1 line each meter (width) for each of the sides of the box and 4 vertical lines
Charge extra for comments
I know that RP isn't the most appreciated gamemode here, but would here be anyone who might be interested in developing lightweight open source RP mission? I'm starting to develop it soon and I'm looking for gents that might be interested in developing RP as open source.
Oh, there's channel for it now? Thanks for the tip @jade abyss
2-3 Days ago.
+it's not the RP-Mode, its the Attitude of 99% of their selfproclaimed "creators/modders/scripter" (aka ABadWordThatIWillNotWriteDownInHere)
I agree that the RP community is pretty toxic
hmm is the usage of params or the usage of BIS_fnc_param better?
ah ok
"native" commands > Functions
Just a note if you have a mission with persistence & are using getAllHitPointsDamage + setHit
Arma Units now have hitpoints with the same selection name i.e "HitBody" + "Incapacitated" both use "body" selection name
How does dynamic simulation work with lights?
The light go off when simulation is disabled?
So lights should not use the dynamic simulation?
I wonder how many missions this will shred:
https://community.bistudio.com/wiki/targets
variable name
Does anyone the ACE3 event handlers for broken tyres? When using setHit on the wheels it does destroy them but ACE does not detect the tyre is broken and you can still remove the missing tyre.
@grand berry I don't think ACE has any documentation for that last I checked. But I guess you could always go digging
targets seems like a simple way of detecting hostiles nearby without having a giant array like nearTargets. I wonder if it sorts the list based on the distance you are away from it
can you look for specific targets?
You can filter by side
Cool.
No one will ever use the command, but everyone that uses "targets" as variable will get their script broken.
Good that I'm not "No one" and good thing that I never did that
I'm assuming targets will be used by AI modders, like every other AI related command.
Can someone explain to me what kind of difference it makes to use getPosVisual instead of getPos? It seems several commands have also a "Visual" variant but I'm not sure exactly what it changes / what benefit I would have from using one over the other
@subtle ore thank - yea looked in the wiki and had a dig though the git hub. Not found what i need yet.
@turbid thunder
getPosXVisual reads the position from the render scope instead of the simulation scope.
simulation scope: where the object is
render scope: where the object appears to be, where it's drawn
The position in simulation scope is updated more frequently, so moving objects, especially fast moving ones, aren't choppy.
You would use the "visual" variant for example when drawing nametags.
ahhhh ok thx commy
In the difficulties setting, there is an option to disable death messages
No i just want to change
Hello again
21:38:03 Error compiling '' in 'HitArms'
21:38:03 Error compiling '' in 'HitLegs'
21:38:03 Error compiling '' in 'HitPelvis'
21:38:03 Error compiling '' in 'HitAbdomen'
21:38:03 Error compiling '' in 'HitDiaphragm'
21:38:03 Error compiling '' in 'HitChest'
21:38:03 Error compiling '' in 'HitArms'
21:38:03 Error compiling '' in 'HitLegs'
21:38:03 Error compiling '' in 'HitPelvis'
what is the problem ?
Nothing, ignore
okey thank you
Please use the public chat and not PM's. If it's a question, maybe someone who lurks knows the answer, or maybe learns from it.
remove the message per server config and substitude it with your own via killed eventhandler
yes
Okey "DeathMessages = 0;" I closed it. How do I write myself? I do not know :((
Was the best approach to pass a group to a script? params does not work with a group as far as I know, right?
well it returns a false array to me
@little eagle I work 3 days
I have a headache ๐ฆ please help
Shouldn't sit in front of the PC with a headache.
group player call {
params ["_group"];
systemChat str (_group isEqualTo group player);
};
This should work just fine.
Should print "true".
_null = [TAIGA, Helo22, "A_ONSTAT", Landing22] execVM "itsAebian\ru_airsupport.sqf"```
``units TAIGA`` in the debug console returns my two soldiers: Leader22 && Gunner22
```sqf
params["_group", "_vehicle", "_cond", "_helipad"];```
If I do a format on _group here I instead get ``O TAIGA`` && ``any``
Because I want to extract the two soldiers via
```sqf
_group params ["_leader","_gunner"];```
you can't extract from a group using params.. As far as I know
params only accepts array as parameter
okay but why is the group TAIGA I just give not equal to the _group ?
_group params ["_leader","_gunner"];
Yeah, that is not how it works
Try this:
(units _group) params ["_leader","_gunner"];
Although I doubt it's guaranteed that the first unit in the group is the "leader".
@rancid pecan maybe
@rancid pecan get used to it
and browse the wiki for dificulty setting as well as addMPEventhandler (MPKilled) if you want to do you own killmessages
well it seems that the first param is taking the group and creating an array since 17:39:04 Error units: Type Array, expected Object,Group
Can you cp what you did exactly?
params["_group", "_vehicle", "_cond", "_helipad"];
(units _group) params ["_leader","_gunner"];```
thats at the start of my script which generates the error
I just executed it with _null = [TAIGA] execVM "itsAebian\ru_airsupport.sqf"
What error
for testing and that above was the output of the rpt
please paste everything
17:39:04 Error units: Type Array, expected Object,Group
ok
units _group params ["_leader","_gunner">
17:39:04 Error position: <units _group params ["_leader","_gunner">
17:39:04 Error units: Type Array, expected Object,Group
17:39:04 File C:\Users\Aebian\Documents\Arma 3\missions\[A]_Cuda.Woodland_ACR\itsAebian\ru_airsupport.sqf, line 10
17:48:46 Error in expression <p", "_vehicle", "_cond", "_helipad"];```
```sqf
/*
author: @Aebian
description: Airsupport script for my test mission.
returns: nothing
// _null = [TAIGA, Helo22, "A_ONSTAT", Landing22] execVM "itsAebian\ru_airsupport.sqf"
*/
params["_group", "_vehicle", "_cond", "_helipad"];
(units _group) params ["_leader","_gunner"];```
Debug console, WATCH fields:
TAIGA
What does this report?
units TAIGA returns : [Leader22, Gunner22] but just watching TAIGA returns: O TAIGA
So TAIGA is not actually a group, but an array of units.
it is, I did : TAIGA = group this; in the init of the group leader
is that wrong?
No, it's correct, but for some reason, it is an array and not a group
Do you by chance have the same variable defined somewhere else?
maybe in the Callsign? I just changed it now
there was also TAIGA set
ah yes
hmm
I renamed the callsign to RU_TAIGA and now its O RU_TAIGA
if I watch TAIGA
Yeah that's it!
If you use these as "group names" or "object names", that is the same as when you use them as variable.
O RU_TAIGA
This looks like a group now. Now it should work.
O stands for "opfor"
works, thanks @little eagle
yw
player action ["getInGunner", cursorTarget];
Does this still work?
I guess you can work around it for now.
hahaha
Sure
Luckly there is an alternative way of disabling weapon disassembly
With the new setActionText commands, you can make it indestinguishable from the vanilla actions.
I do this in the Eagle, because all moveToX actions are bugged in vehicles with FFV slots when in the driver position
https://i.gyazo.com/9a767c9a80d49e6e5b48c4b4f2d05f82.png I'm perplexed by this error, because the sound still plays
do sounds need titles now? This didn't happen before the 68
name = "beep1";
sound[] = {"\sound\beep1.ogg", db+0, 1.0};
title = "";
I added title and it still comes up to the error. I don't know what it's asking for
title[] = {};
"title" as in "subtitles" I think. They correspond with the sounds by array position.
I don't remember sound cfg involving subtitles
Well, "titles".
titles: Array of Number, String - Delay and subtitle text shown when sound is played. If the delay is longer than the sound itself, then the sound will be repeated until the time limit has been reached. Can be empty.
was it always this hard to get a dead unit out of a vehicle? not even setpos is working for me
ya basically
Also note to self, adding a delay to the subtitle on CFGSounds makes the sound play multiple times
I'm working on an addAction script. Basically I'm trying to figure out the most effective way of having the player select the Select Helicopter option which will add 8 additional options which will be a list of helicopters. Then out of the list of helicopters they should be able to select one of them and it spawns it in. Though my problem is I'm unable to figure out how to effective give the spawned helicopter a variable name.
Once the player spawns the helicopter in they will select which city to fly at. As soon as they get into the vehicle both them and the vehicle will be teleported to that city and they will begin flying. To do this correctly I believe I need to assign a variable to the helicopter. Correct me if I'm wrong.
googling VVS framework
vehicle triggerDynamicSimulation true;```
This will stay simulated all the time or just when unit's are nearby
http://www.armaholic.com/forums.php?m=posts&q=24727 @tulip cloud
You use this, replace the create vehicle with create unit, and plug in a new script that sends the helicopter on it's way to the location
ok I'll test it out...Thanks for the direction. ("that's a lot of text" <-- Because I'm so lost)
You want a filtered list of aircraft for someone to spawn, jump into, and be flown to a location right?
I don't know if I get the teleporting thing is all
but you can start with having the filtered list of vehicles to spawn and work from there
VSS works perfectly
nice
was the best approach to have a condition that in a certain trigger there need to be lets say 20 blufor units simultaneously active? I guess something with count allUnits?
cond: count thisList >= 20?
hmm yeah, pretty simple lol , thanks
thisList ๐
Is there any good Teleport scripts out there? I'm going to make it so you pick your city and then a 30 second countdown. You basically have 30 seconds to run to your spawned helicopter and start the engine so that when you are teleported you are full RPMs so you don't crash.
Right now I'm planning on it just being a simple list of all the cities and once you select one it starts the countdown and then teleports you. (It would be cool if it could be linked to the map or something more visual.
I would put a wait until the helicopter is off the ground then teleport
damn, this is neat https://community.bistudio.com/wiki/fullCrew
helped me solve the move out dead units from vehicles issue. incase some one has a similar problem. returns all you need
_towns = nearestLocations [getPosATL player, ["NameVillage","NameCity","NameCityCapital"], 25000];
systemChat str _towns;
This script is returning "Location, NameCity at x,y"
I'm trying to pull all the location names so I can Teleport the player/helicopter to LocationName. It is giving me the X,Y coordinates but the actual location name is just returning the type (NameCity)
_locTypes = ["NameCity","NameCityCapital","NameVillage","NameLocal"];
_worldCenter = getArray (configfile >> "CfgWorlds" >> worldName >> "centerPosition");
_worldSize = getnumber (configfile >> "CfgWorlds" >> worldName >> "mapSize");
_locNames = [];
_locations = nearestLocations [_worldCenter, _locTypes, _worldSize];
{
_locName = text _x;
_locPos = locationPosition _x;
_locSize = size _x;
_locNames pushBack _locName;
}forEach _locations;
hint format ["%1", _locNames];
@tulip cloud
I tried this out in debug but I used diag_log format to return the response to .RPT from there I was able to get a list.
18:00:31 "[""Lami"",""Lifou"",""Yani Islets"",""diesel power plant"",""cocoa plantations"",""Lobaka"",""lumberyard"",""Lakatoro"",""La Foa"",""Savaka"",""Regina"",""ferry"",""railway depot"",""Katkoula"",""ferry"",""Moddergat"",""Lรถsi"",""Tanoa Sugar Company"",""Tanouka"",""Tobakoro"",""Georgetown"",""Kotomo"",""Rautake"",""plantation"",""temple ruins"",""Harcourt"",""Buawa"",""Yasa Island"",""Saint-Julien"",""sawmill"",""Balavu"",""Namuvaka"",""Vagalala"",""Imone"",""Sosovu Island"",""fuel depot"",""Leqa"",""Galili"",""Sosovu"",""lumberyard"",""Blerick"",""ferry"",""lumberyard"",""banana plantations"",""Yanukka"",""Oua-Ouรฉ"",""harbor remnants"",""Comms Alpha"",""Cerebu"",""roadhouse"",""Laikoro"",""Saioko"",""Belfort"",""Mont Tanoa"",""Tuadua Island"",""Oumรฉrรฉ"",""Red Spring surface mine"",""forest clearing"",""Comms Bravo"",""Muaceba"",""Nicolet"",""Lailai"",""Doodstil"",""maze"",""Tavu"",""Lijnhaven"",""Ile Saint-George"",""Nani"",""Petit Nicolet"",""Port-Boisรฉ"",""fortress ruins"",""Saint-Paul"",""Nasua"",""
This is a great start but I need the coordinates also. I see you have _locPos = locationPosition _x; not sure how to use that with the names.
position reports the position of a location.
hmmm is there a solution for getting the animation or animationSource of an object? especially doors and gates
There's more location type than I included, check here https://community.bistudio.com/wiki/Location
@little eagle yeah but I need a animation for that don't I? like in animationSourcePhase there is this example sqf _phase = house animationSourcePhase "Door_1_source"; and well at the end is the source. I remember in ArmA 2 I just had a small code snippet where I just had to look at the door/ gate and I was given the animation that could be used with obj animate ["", 1] and so on
With Sources -> No, not possible. You have to know the name of the Sources.
With "AnimationSources" from the Config -> Possible.
๐ use that
@little eagle yep, that animationNames command works, thx
BIS_fnc_someFunction is better than it's counterparts right? so like BIS_fnc_execVM vs execVM
Other way around
wait so for example, selectRandom is better than BIS_fnc_selectRandom?
and if so why?
i thought it was speedier if we used BIS
because selectRandom is a direct command and BIS_fnc_selectRandom is a function. Sidefact: isEqualTo is faster then ==
hmm ok (notice how newbie I am)
danke. thought the native was the other way around
No. A function is written whenever you don't have a direct command implementation.
Is _locNames = []; a built_in function? It is returning for example CfgWorlds >> Tanoa >> Names >> Georgetown01 >> name = "Georgetown";
But I want just Georgetown01 because I can then use that classname to get Georgetown01 >> position[] = {5396.22,10334.7};
No, that's a variable.
So I can't do getPos Georgetown01 and return 5396.22,10334.7 ?
getArray (configFile >> "CfgWorlds" >> "Tanoa" >> "Names" >> "Georgetown01" >> "position")
brilliant ok, now to plug this in...
The one question that still hasn't been answered is how do I create an Array that is filtered with only capitol/city/village types. I don't want it to return the name ("Georgetown") but I want the variable name ("Georgetown01")
private _filter = ["NameCityCapital", "NameCity", "NameVillage"];
private _names = configProperties [configFile >> "CfgWorlds" >> worldName >> "Names", "isClass _x"];
// filter out all non-cities
_names = _names select {getText (_x >> "type") in _filter};
// convert array of configs into array of classnames
_names = _names apply {configName _x};
_names
works on every map
were these mentioned yet being in 1.69?
b:CONTROL ctfindheaderrows SCALAR
b:CONTROL ctfindrowheader SCALAR
b:CONTROL ctheadercontrols SCALAR
b:CONTROL ctremoveheaders ARRAY
b:CONTROL ctremoverows ARRAY
b:CONTROL ctrowcontrols SCALAR
b:CONTROL ctsetcursel SCALAR
b:CONTROL ctsetdata ARRAY
b:CONTROL ctsetheadertemplate CONFIG
b:CONTROL ctsetrowtemplate CONFIG
b:CONTROL ctsetvalue ARRAY
b:CONTROL ctvalue SCALAR
u:ctaddheader CONTROL
u:ctaddrow CONTROL
u:ctclear CONTROL
u:ctcursel CONTROL
u:ctheadercount CONTROL
u:ctrowcount CONTROL
n:getcursorobjectparams
u:isdamageallowed OBJECT```
ct? ๐ค
Controls Template
Hm, interesting
And here I am still wishing we had commands to control scrollbars
@steep matrix They were. New RscControlsTable https://community.bistudio.com/wiki/ctData
Is it right that only the units in heli can listen to music?, but all the clients can listen to music even not on board .
// _ari1 is pre-defined heli object
// "fnc_playMusic" is function name for playing Music
{ if (_x in _air1) then { remoteExec["fnc_playMusic",-2];};} forEach allUnits;
not sure what you're asking?
you want the music to only play for people in that heli?
yes right. @halcyon crypt
@quasi rover No. -2 will execute on every client except the server
{
if (isPlayer _x && {vehicle _x == _air1}) then {
["the_music_file_or_class"] remoteExec ["fnc_playMusic", _x];
};
} allUnits;
something like that
So it'll play for everyone but the server times the number of units in _air1
^ and I believe @halcyon crypt's code can be reduced to
{
if (vehicle _x == _air1) then {
remoteExec["fnc_playMusic", _x];
};
} forEach playableUnits;```
playableUnits includes AI and dead units though
Alright. sqf { if (isPlayer _x && {vehicle _x == _air1}) then { remoteExec["fnc_playMusic", _x]; }; } forEach playableUnits;
I believe it's an optimization non-the-less, not having to iterate all units in the world
true
Which reminds me I need to add suggestions to use lazy evaluation into my tool
is there still a group limitation, max 144 groups?
thx guys, I'll try it later. @compact galleon @halcyon crypt
@vital onyx wasn't it increased to 288?
well, I would like to see kind of proof, if possible)
Coming right up
@vital onyx http://i.imgur.com/ELb4137.png
I'm surprised I still get >20 fps after ordering all 288 groups to move to my position
I killed a few, now they're all firing at me
144 groups per side was already a lot but 288?
But if you have groups that are bigger, it's infinte ๐
100 groups of 10 vs 100 groups of 10. You run out of FPS before you run into a group limit now
I enjoyed 20 x 2 man patrols instead of 3x8 man patrols, because it feels more dynamic and cooler. This update is a really great. Haven't really tested out anything too extreme yet.
Ya, having 5700 units might be overwhelming
I checked how BI increased the Group limit and they did it exactly as I thought.
CfgWorlds >> GroupSquad and GroupPlatoon and GroupCompany just create more entries in these and you get more groups.
in 1.68 they added 2 squads. So if you add more Squads in your own Mod you get even more groups.
Atleast I thought thats how the limit is determined before they increased it. And them adding more squads after they increased the limit kinda confirms that
Adding 4 more squads doesn't change anything now. Maybe the limit is made before Mod PBO's are loaded
I didn't try before
There was a tweet mentioning the group count was doubled to 288 in dev branch. Not sure if it made it in stable
I checked how BI increased the Group limit and they did it exactly as I thought.
Doesn't sound like you exactly know after all.
They could've just added these to comply with the new gorup limit (regardless of it's in stable yet or not).
So you don't get missing string errors when making use of it or whatever.
Could still be a magic number define in the source.
Well.. I changed the groupNameFormat and added a few Squads but these are ignored when placing down groups. Even if there was a hardcoded limit it should respect my changes on the name format
So there is something else going on
Oh, what's the classes access?
0
If it's set to ReadOnly, then you cannot add sub classes iirc.
But the sub classes are showing up in configViewer
It's CfgWorlds. You should be able to add your Map to that if you are making one so it should be editable right?
๐ฎ The first 4 squads are from A3_ui_f. The 2 new squads are from "".. nothing?
0 ReadAndWrite additional values can be added
1 ReadAndCreate only adding new class members is allowed
2 ReadOnly no modifications enabled
3 ReadOnlyVerified no modifications enabled, CRC test applied
But that's exactly how it works.
http://prntscr.com/em8nbs
Those are not 288 groups. That's just what the message is showing. Check on the left. There are so many groups that there weren't enough names and it created 5 Alpha 1-1 groups
So you did increase the group limit, but the error message you get when hitting the limit is displayed wrong.
The error message is apparently hardcoded
Yeah, why not. It's probably a string in stringtable and they didn't bother to %1 the group limit.
5:11:09 Warning: Adding units to a remote group is not safe. Please use setGroupOwner to change the group owner first. Anyone know if that creates a new group?
http://prntscr.com/em8spt 1336 Server slots. I just modified the output of the algo that scans the entries in CfgWorlds. So BI could easilly double the group limit again if they wanted to. But why let players kill their fps ^^
@runic spoke calling setGroupOwner to yourself transfers the group to you. It doesn't create a new one. Then you can add the new Unit and transfer the group back if you want
Just execute the code that adds a new member to the group on the group owners machine using remoteExec
I'm litreally just asking if that creates a new group, not how to fix it.
As I already said. no
Ok, thanks.
you are adding units to an existing group. No reasing for it to create a new one. It warns you that stuff could be messed up. But most likely thing I can think of is the new group Member ignoring his Leaders orders
Zombies ignoring a leaders orders, exactly what i want! ๐๐ผ
Okey confirmed. Group Limit is calculated after loading dta\bin.pbo and before all other Mods are loaded.
after adding a few squads and platoons to bin.pbo I got a group limit of 432.
I wonder what happens if you only increase the group Limit serverside....
You can also square the group Limit by editing 1 byte with a hex-editor in the binary
lol
Okey if the server has increased group Limit and already has over 288 groups. Every joining client will think he can't create anymore groups and will spawn as a seagull.
Except if respawn type is set to RespawnToGroup and the group the player is joining in already exists.
These are assumptions though.... Can only really find out by testing this.
If a player join and creating his group is done serverSide everything is fine. If a player creates his group clientSide it will fail.
If that doesn't work you can still fill the player slots with AI and enable respawn. And if a player disconnects teleport the AI to spawn and disableSimulation it. That way it will always make sure a Players group already exists when someone joins.
But if you are some big server or something with a modpack for all players you could just build a Extension that increases the groupLimit at gameStart. If you really wanted to.
@still forum Is the group a "hardcoded" config value?
several config values
class CfgGroups{}; is the only thing that i can find "about it"
it has something to do with CFGworlds if I remember
there are 3 config classes. for Name,Platoon and Squad. Alpha 1-1 Name Platoon-Squad
total group count = Count of Names * Count of Platoons * count of Squads
previously there were 9 names, 4 platoons, 4 squads. 9*4*4 == 144. Now they added 2 squads and 3 Names 12*4*6 == 288
It is CfgWorlds >> groupNameFormat and the classes mentioned in there
wew
[_zombie] joinSilent _group;
_group setGroupOwner (owner _player);
if (_zmbGroup != _group) then
{
_zmbGroup setGroupOwner -2;
deleteGroup _zmbGroup;
diag_log "SM_Zombz (Hard Coded Debug): Deleteing old zombie group (Result of spawning on a remote group)";
}; ```
In the RPT: 10:30:25 "SM_Zombz (Hard Coded Debug): Deleteing old zombie group (Result of spawning on a remote group)"
if (isNull _group) then
{
_group = createGroup [SM_ZombieSide, true];
_player setVariable ["SM_ZombieGroup", _group];
_group setVariable ["SM_IsZombieGroup", true];
};```
server = 0 right?
2
owner _player
also looks weird. owner only works on the server and there is no "player" on a dedicated server
in remote exec it's 2
ok
0 is global.
-2 is all clients but server
for remexec
ye
just use owner command?
The whole thing looks weird
_zmbGroup setGroupOwner -2;
deleteGroup _zmbGroup;
Why?
Why transfer it, then delete it?
lol
You can't delete groups that are not local
wait what
And i don't want to send a network message to delete a remote group
this is news to me
You can't delete groups that are not local
True, but wait
_group remoteExec ["deleteGroup", _group];
Why not like this?
Any good resources about remoteExec besides the wiki?
If you insist.
Yeah well I'm having a hard time wrapping my head around it.
I +1 @little eagle and @tough abyss The documentation for remoteExec/Call is abosolutely brilliant.
What is it you're stuck on?
wrong person
Explain the parmas part of this: ```SQF
[obj, [primaryWeapon obj, 1]] remoteExec ["setAmmo", obj];
Oh I get it.
unit setAmmo [weapon, count]
The order of things confuses me...
param someCommand [param, param]
// Turns into...
[param, [param, param]] remoteExeC ["someCommand", param]
It's bizarre.