#arma3_scripting
1 messages · Page 15 of 1
no
look into the config
yes?
i assume you're doing it from the fired EH, so getNumber (configOf _projectile >> "searchForThisInTheConfig")
in CfgAmmo
does deleteVehicle on a unit trigger a killed event?
No
Answering myself, but is there a workaround to reload the event, I mean the groups have no enemies detected -> I want to change my time.
and when the event is true, I want to change the time as well.
Is there a command to remove map objects... say I wanted to remove all map objects within a certain radius of a point. Possible?
You can hide instead
will ai be able to navigate as though those hidden objects weren't there?
I don't think so
so the objects are still there as far as the ai is concerned?
Hidden objects are hidden for everyone and almost every perspective I think
The answer for that is probably quite complicated. On one Altis test I removed a bridge, and vehicles attempted to drive over it as though the bridge was still there. However, the collision-lookahead didn't trigger and so in some cases vehicles could cross the ground underneath when they couldn't cross the actual bridge :P
Is there a generic point light source object?
There's no global light point, only local ones?
Yes. So you need to make light for every clients
What's a name of a big flag pole object I can put bluefor or opfor flag textures on?
Flag_Red_F or such?
I don't know what I'm looking for. I'm seeing reference to swapping flag textures. But I'm not seeing to what kind of object that is applied.
I just realized there's a search bar in the object tree in eden.
there is a way to know when player is running ?
would be cool like IsRunning player
Is there a quick way to loop through all object instances of a specific class?
Yes
Say I want to loop through all instances of "WarfareBDepot".
Depends on the object simulation
If it's a house no
If it's a soldier or PhysX entity yes
Simple Objects too
It's just a building. Is there no way to just get an array with all the instances of a specific class?
You can use nearestObjects or nearObjects but they're slow
Also they don't give you exact class match
So you need a typeOf check in the loop
position is irrelevant, just want all instances of a class
I know. There's nothing else
If all of them are mission objs you can use allMissionObjects
But that's slow too
I guess I could just collect all the id's of objects as they are created on the server and pass them to the clients. Are the ids definitely going to be the same on every machine?
Is this safe to do? _depo = "WarfareBDepot" createVehicle _safe_pos; all_bunkers = all_bunkers + [_depo]; later: publicVariable "all_bunkers";
First of all, use pushBack
Second of all, depending on how many objects you have, that could be very network intensive
i have a strange crash problem with the extension version function that I can't figure out. the code causes buffer over run error when it leaves the function. Code: https://pastebin.com/XfpN5DHQ
i have used that code in EXEs before without problems
How large would that be?
I mean the appended string
I think the extension version's buffer is most likely small, maybe even less than 16 bytes
Check outputSize first
it was 32
You are asking why you are overrunning the buffer, but your code isn't even checking the buffer size at all.
You are overrunning the buffer, thats why you get buffer overrun error.
ok thx, I will keep eye on the outputSize. I ignored that
I'm currently working on a script that is meant to attach something to the player model and update the thing's position each frame. I'm aware that attachTo would make this easier, but I need precise location in all positions, and it gets a little screwy when the player aims very high or low. I'm currently using selectionPosition to do this, and it's working just fine. Unfortunately, every time the script runs selectionPosition (so, each frame) it dumps an error into the report file.
specifically, I'm running something like this:
selectionPosition [player, "proxy:\a3\characters_f\proxies\weapon.001", 0, true, "FirstPoint"];
it returns the appropriate position array, but also dumps this into the rpt file:
No point in selection proxy:\a3\characters_f\proxies\weapon.001.
Is this a bug, or am I not using this command right? (Even though, at the end of the day, the whole thing still works to spec)
what happens if you use the other syntax?
player selectionPosition ["proxy:\a3\characters_f\proxies\weapon.001", 1]
vehicle player addEventHandler ["Fired", {
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
if (_weapon == "SmokeLauncher") then {
systemChat format ["%1", getPosATL _projectile];
while {!isNull _projectile} do {
private _nearMissiles = (getPosATL _projectile) nearObjects ["MissileBase", 30];
if (_nearMissiles findIf {!isNull _x} != -1) then {
{
systemChat format ["Missile %1 intercepted", typeOf _x];
private _manualControlCheck = getNumber (configFile >> "CfgAmmo" >> typeOf _x >> "manualControl") == 1;
private _lockCheck = getNumber (configFile >> "CfgAmmo" >> typeOf _x >> "weaponLockSystem") > 0;
if (_manualControlCheck || _lockCheck) then {
private _missileVectorUp = vectorUp _x;
private _missileVectorDir = vectorDir _x;
private _xDirRandom = random 0.25 - 0.125;
private _yDirRandom = random 0.25 - 0.125;
private _zDirRandom = random [0.05, 0.015, 0.025];
_x setVectorDirAndUp [[_missileVectorDir # 1 - _xDirRandom, _missileVectorDir # 1 - _yDirRandom, _missileVectorDir # 2 - _zDirRandom], [_xDirRandom, _yDirRandom, 1]];
};
} forEach _nearMissiles;
};
};
};
}];
Why _nearMissiles always empty?
Same thing, it's still dumping a "No point in selection" into the rpt file
It's not just with the proxy, either. I tried using "spine", and it gave the same error, but also returned a position of [0,0,0], which I doubt is correct
test selectionNames for that LOD
I was copy/pasting them straight out of a return from selectionNames, to be safe
why do you even search for a missile?
selectionNames of LOD 1?
Just want to create script for vehicle smokes, which broke missile guidance, if it fly trought smokes
@still forum he's right
it keeps logging to rpt which slows it down significantly (~0.5 ms for that command, which is totally unacceptable)
even if it doesn't exist, it shouldn't log
@ripe hemlock make a ticket
I just used this:
_sel = (player selectionNames 1) #28; player selectionPosition [_sel,1];
with _sel == "proxy:\a3\characters_f\proxies\weapon.001", and it correctly returned position, but also put the entry in the rpt as it's been doing
Alright, I'll put in the ticket. Thanks! 😄
I wonder: How can you make an accurate weather forecast? OvercastForecast does only give a value, I cannot find out what it takes to start raining actually or to stop. How does the game handle weather?
you do realize that EHs run unscheduled right?
your while is just running in one frame up to 10000 iterations and wasting CPU time (lowering FPS)
I know
then why do you put a while there? 
im exectuing via debug console with [] spawn {"EH HERE"}
Lol
that spawn is not part of the EH code
_bla addEH ["EH", {this is EH code, and it runs unscheduled}]
you can't afaik
I think that you can use spawn to run some code in scheduled environment, even if it's in an EH. You just need to make sure that it only gets called if it's not already spawned and running
but if im spawn in EH scope it runs scheduled
yes
And..It still didn't work 😄
vehicle player addEventHandler ["Fired", {
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
if (_weapon == "SmokeLauncher") then {
systemChat format ["%1", getPosATL _projectile];
[_projectile] spawn {
params ["_projectile"];
while {!isNull _projectile} do {
private _nearMissiles = (getPosATL _projectile) nearObjects ["MissileCore", 30];
systemChat "Check";
if (_nearMissiles findIf {!isNull _x} != 0) then {
{
systemChat format ["Missile %1 intercepted", typeOf _x];
private _manualControlCheck = getNumber (configFile >> "CfgAmmo" >> typeOf _x >> "manualControl") == 1;
private _lockCheck = getNumber (configFile >> "CfgAmmo" >> typeOf _x >> "weaponLockSystem") > 0;
if (_manualControlCheck || _lockCheck) then {
private _missileVectorUp = vectorUp _x;
private _missileVectorDir = vectorDir _x;
private _xDirRandom = random 0.25 - 0.125;
private _yDirRandom = random 0.25 - 0.125;
private _zDirRandom = random [0.05, 0.015, 0.025];
_x setVectorDirAndUp [[_missileVectorDir # 1 - _xDirRandom, _missileVectorDir # 1 - _yDirRandom, _missileVectorDir # 2 - _zDirRandom], [_xDirRandom, _yDirRandom, 1]];
};
} forEach _nearMissiles;
};
sleep 0.25;
};
};
};
}];
Send me link when done
well for one thing missiles move very fast, so you could be missing it.
and for the other, where are you testing this? over water?
Thats why i didn't put 0.25 sleep previosly.
Yes, over water
nearObjects needs AGL pos
you're providing ATL
so it would never work over water anyway
first change the pos to ASLtoAGL getPosASL _projectile
second reduce the sleep time to 0.01
there's still no guarantee that it will work in a real scenario
because of how scheduler works
Dont work anyway
How can I make the Blackfish Gunship orbit some area
Because I’ve been trying different things and it keeps diving down
You can try Loiter waypoint
Yeah it’s not orbiting unfortunately. Counterclockwise, set altitude and radius.
It just keeps doing weird stuff
Try setting it to Careless. AI pilots have some funny ideas about the appropriate way to respond to spotting the enemy.
Alright. I'll try it again thanks
I managed to do it by working around it. Still limited prognosis of rain though, overcast alone does not seem to cut it, allthough an overcast of >= 0.5 is needed for rain
I want to get the information about the remaining bullets in the magazine
Here is the example, but I got it to work now , by putting attachments/weapons first into the array and at the end the magazines
on mouse hover or click?
I think you missed this changelog entry
Tweaked: Inventory UI listboxes now have the class names of the item inside lbData (previously only magazines had them) - FT-T163668
Ah you want not only classname but the specific magazine ammo 🤔
Well no. Thats easy.
Find all magazines with the same classname, and sort by ammo count.
Magazines with same ammo count are combined into one entry, and otherwise the more full magazines will be at the top
you can iterate through the entries in the inventory UI.
And find where the first magazine of that type is, now you have a sorted list of magazines, and know where the first of that list is
params [["_container",0],["_unit",player]];
if(_container < 1 || _container > 3) exitWith {[]};
_container = _container + 2; // Make it support getUnitLoadout select
private _items = (((getUnitLoadout _unit) select _container) select 1);
_DisplayNameArray = [];
_itemsNew = [];
{
_ClassName = (_x select 0);
if (_ClassName isEqualType []) then {
_ClassName = (_ClassName select 0);
};
_configName = _ClassName call A3SClient_fnc_util_gear_getConfigNameByClassName;
_itemDisplayName = getText (configFile >> _configName >> _ClassName >> "displayName");
if (_configName == "CfgMagazines") then {
_DisplayNameArray pushBack [_itemDisplayName,_forEachIndex];
} else {
_itemsNew pushBack _x;
};
} forEach _items;
//Sort Magazines
_DisplayNameArray sort true;
{
_itemsNew pushBack (_items select (_x select 1));
} forEach _DisplayNameArray ;
_itemsNew
This one works perfectly so far
doesn't actually account for item displayNames, but whatever, they're not meaningful in the use case
yea I changed it to the way how dedmen advised and it works better. Before the Magazines weren't sorted in terms of Bullet Counts
_itemControl = _this select 0;
_InventoryControlIndex = _this select 1;
_MagazineClassname = _this select 2;
private _MagazinesInContainer = switch (ctrlIDC _itemControl) do {
case 633: {magazinesAmmoCargo uniformContainer player}; //Uniform
case 638: {magazinesAmmoCargo vestContainer player}; //Vest
case 619: {magazinesAmmoCargo backpackContainer player}; //Backpack
default {[]};
};
if (_MagazinesInContainer isEqualTo[]) exitWith {};
// Looking for the Control Index of the Magazines
_MagazineControlIndex = -1;
for "_i" from 0 to _InventoryControlIndex step 1 do {
_ClassName = (_itemControl lbData _i);
if (_ClassName isEqualTo _MagazineClassname) then {
_MagazineControlIndex = _MagazineControlIndex + 1;
};
};
if (_MagazineControlIndex isEqualTo -1) exitWith {};
// Filter Magazines by classname
private _MagazinesFilterd = [];
{
if ((_x select 0) isEqualTo _MagazineClassname) then {
_MagazinesFilterd pushBackUnique _x;
};
} forEach _MagazinesInContainer;
// Sort Magazines
_MagazinesFilterd sort false;
_SelectedMagazine = _MagazinesFilterd select _MagazineControlIndex;
@still forum ty 
is possible to detect when mouse button 4 or 5 are pressed?
Excuse me, may I ask, how to tell when the client connects to the server?
about BE RCON player#79 connected
I want to judge the client to join the server through the code
Does anyone know how to do this
I don't know, either, but are you wanting to know from the client's side, or the server's side? I think it'd probably be slightly different
If I give an artillery unit a fire mission via doArtilleryFire, how can I check if it has finished its fire mission? i.e. when all rounds have been fired.
@ripe hemlock Server knows it
I want to let the server know at the same time when the client connects to the server
playerConnected event handler
what does unitReady return?
@little raptor I tried initplayerserver.sqf, but when the client connects to the server, there is no log output. It only outputs the log after I select the lineup to join the game
So which sqf file should I put playerConnected event handler in?
initServer.sqf
you can also use this:
https://community.bistudio.com/wiki/Arma_3:_Mission_Event_Handlers#OnUserConnected
not sure how it's different
Worked like a charm, thank you!
(returned false as long as it was firing)
thanks. will add to the wiki
@inner swallow
https://community.bistudio.com/wiki/doArtilleryFire
(see the last note)
is this how you ran it? or did it have to be the gunner of the mortar?
nope, this is correct
ok, thanks!
I was chaining move-wait-fire-move-wait-rearm-move-wait-fire-move-etc, so needed to wait for the script to stop for the rounds to be fired otherwise it was moving ahead before firing or something
first i tried using waypoints but i think the way i was doing it was incorrect
so it was just queuing up waypoints and running out of sync with the script
thus resorted to doMove + moveToCompleted then doArtilleryFire + unitReady etc.
One... side effect of using it like this is that... seems it can fire the rounds, then remain not ready if it knows there are ammo trucks nearby, and it then rearms, and is then ready. I will test with just the gunner and see what happens then.
can you add items to dead units?
I think so
On 2.10 can i swap the diagonal of a terrain quad? This would help me to better edit the terrain.
I'd wager "no"
I just asked to be sure.
as it would imply a modification of the 3D model itself, but again it is from my minimal knowledge of the topic
(and I saw no commands for it either)
Is there any code to identify the unique client computer ID?
As long as the client uses this computer, no matter what steam number he switches, is there an ID that uniquely identifies this computer?
clientOwner return this ID on clients
owner _object can be run server side and return the ID of the machine that is hosting the object
If you mean persistent hardware IDs then I'm pretty sure Arma doesn't have access to that.
Not even sure if steam has those.
Hi, is there a way to get the weapon position ? Because i tried
onEachFrame {
_gspos = (ASLToAGL (eyePos player));
teste setPos (_gspos vectorAdd ((player weaponDirection (currentWeapon player)) vectorMultiply 1));
};
And it is working but not correctly. Actually it's more like the "eyePos" than the weapon pos.
If you're looking to assign "permanent IDs" to players on your server, and all of your players are using a mod you are distributing, it might work to just save a randomly generated value into their profileNamespace (on their end), and then have a script run when they join the server that saves that value publicly from profileNamespace into their object namespace, at which point it should be accessible to the server for checking stuff
It depends on which weapon you're using at the time, but you can use _unit selectionPosition "(relevant weapon proxy)" to get the position of the weapon's origin
Be warned, though, selectionPosition currently logs an error, even if it finds the position properly. I was just talking about that here, last night, and submitted a ticket on it. It still works fine, but can add to load if it's a per-frame thing
profileNamespace is associated with a particular Arma 3 profile, and it's easy to change profile. Given that their Steam ID (which is not user-changeable) is not good enough because they could change Steam accounts entirely, it seems unlikely that relying on the relatively throwaway A3 profile is going to be solid enough either.
I've got a feeling they're trying to do hardware bans, and I've also got a feeling that isn't going to be possible.
Oh ok thank you i will try because i used
player selectionPosition "proxy:\a3\characters_f\proxies\pistol.001"
and seems to work too
Yeah, I'm currently using it on a per-frame basis, as well, for weapon locating purposes
Oh i need to replace "(relevant weapon proxy)" by what i put before because otherwise it doesn't work
Yeah, sorry. I didn't mention that that was just my own explanatory filler 😄
Yeah don't worry but i thought the string was able to take some code or condition instead of a basic name but don't worry 🙂
I want to disable the keys of the keyboard when the client connects to the server, how can I do that?
in OnUserConnected
Trying to figure out why this just makes the target naked instead of also equipping the uniform and bandages. This is for MP```params ["_target", "_player"];
if !(isPlayer _target) exitWith {};
{
removeAllAssignedItems player;
removeAllItems player;
removeAllContainers player;
removeGoggles player;
removeHeadgear player;
removeAllWeapons player;
_target forceAddUniform "vn_o_uniform_nva_army_01_01";
_target addItem "vn_o_item_firstaidkit";
_target addItem "vn_o_item_firstaidkit";
_target addItem "vn_o_item_firstaidkit";
_target addItem "vn_o_item_firstaidkit";
} remoteExec ["call", _target];```
you can use
disableUserInput true;
if i remember
There's a really good chunk of code in here almost a year back that Leopard20 posted up. It basically lets you find the positions of memory points in the models of weapon attachments, and then convert them into a world position. I might be able to dig it up if you're interested
where have you executed that ? It need to be run on the client you want to disable the input
initServer.sqf
this is why
andOnUserConnected
why not just use player init?
Because there are many cheaters who can open the console to cheat externally, they don't need to enter the game, they only need to select the faction interface
yeah very good thing too 😄
If cheaters are such a big problem that you're trying to add a custom hardware ban system, maybe you should be looking at things like enabling BattlEye on your server and implementing remoteExec (and mod) whitelists
Are you trying to stop a person from using their keyboard outright when they join your server?
Cheaters can create unlimited vehicles in the character lineup interface via createvehicle
I get the impression you are trying to stop them from typing things into a cheat console in another application
yes i want to disable their keyboards when they connect to the server, judge the corresponding fields on mysql so that they go to the server
Controlling the computer outside of Arma is not possible and would be a giant security problem if it was possible
If any application had the ability to block access to your peripherals globally, that would be a bigger issue than cheaters
They will create a console when connecting to the server and enter a code in the character selection faction.
That console will be in a different application will it not?
A totally separate executable?
Even if it was in ArmA tbh I don’t know if you could lock them out of it somehow
No, I think they might call the console to execute code by pressing the corresponding key when connecting to the server, but the console should be created via _ctrl, so if I can disable it when they connect, I don't think they can cheat
I’d have to know more about ArmA cheats to tell you if that would work or not, but my money is on no
I don't know if executing code on the server can disable their keyboard
Executing code on the server won’t be able to stop them from doing anything
It would have to be on their client
You can't do anything to them until they've actually connected, even with remoteExec. Because, you know, they're not connected.
I really think you should be looking at dedicated security options such as BattlEye and mod whitelisting to prevent people connecting with the tools to do this.
^
i use OnUserConnected and getUserInfocan get their uid name client id etc.
BattlEye can't do anything... As long as the console is open, the cheater can enter infinitely different codes
I’m curious what you are trying to set up that needs this level of automated security. Even if I was making a life server expecting to be full 24/7 I would just use the things Nikko mentioned, and have a reliable team to manually handle anything that gets through
What is allowing them to open the console?
I'm somewhat dubious of the idea that you can open the console while in the process of connecting without the use of mods or external tools
Before they passRscDisplayInventoryAfter tampering with the code behind to execute, I found a way to deal with it, using bis_fnc_initdisplay to judge. But the cheaters are updated and I don't know how they cheat. . . My scripts.txt doesn't even have any logs
If you have actually found an exploit like that in vanilla ArmA, and you can reliably replicate it, I’d make a note to Bohemia and they would probably look into getting it fixed pretty quick
They have an external tool to inject the launcher, but it can't get around the keyboard callout, so I wonder if it can be disabled
Isn’t the point of battleye to detect that?
Also how often are you expecting to see this exploit that it’s this big a deal?
There is a person who sells cheats in our country, he makes everything and sells others, he updated the injector with a new version this time, so I can't start
Sounds like a job for manual moderation on your server
The cheater could only call out the plugin when he was connected to the server locally, but he can now use the plugin when connecting to the server to the character selection interface
Report him to BI (and BattlEye maybe?). They can take a look at it, figure out how it's done, and hopefully block it.
Yes, there is no way. I added a field to mysql to determine whether the player can enter the server
then just kick them if theyre not in the list on connect?
or pw protect the server? 😄 i don't get it
I feel like you are kinda tunnel visioned right now
But that doesn't stop cheaters I guess, so I've been looking for if I can disable keyboard output when the client connects to the server
Well that just goes back, you could only possibly tell Arma to ignore keyboard input, but you can't tell their computer to do so
i use OnUserConnected and Determine whether the player's UID is in the database, if not, trigger servercommand #kick
This is the third time you’ve said that
This should be good enough, no? If they're still managing to run a few commands in the seconds before they get thrown out, you should be able to clean it up pretty quick.
Also, if this person is creating and selling cheats on a large scale, you should report them to BattlEye so that they can investigate and create countermeasures.
Is there any way to contact BE?
@hallow mortar TKS man
@ocean folio You can also use BattlEyes builtin filter lists
Which can be setup with Regex Expressions.
To detect and immediately kick / ban for violations
AFAIK I think BattlEye still works with them...
A Guide to BattlEye Filters
I noticed a severe lack of information on BattlEye across Arma and DayZ modding communities. This guide will give an overview of BE filters, BEServer.cfg and automatic banning with BE.
What they are:
BE filters are an optional feature of BattlEye Anti-Cheat for Arma...
Why this isn't on the BattlEye FAQ is beyond me..
is it possible to have an array of marker names or a random NameCity for getMarkerPos to look for?
example 'B_CTRG_soldier_M_medic_F' createUnit [getmarkerPos 'PatientSpawn', _group1,'pat1=this; dostop pat1'];
I'm trying to have an AI unit or group spawn via an addAction at a random location on a map
for randomly selecting - use https://community.bistudio.com/wiki/selectRandom
does linkItem not work on dead players?
so add it?
indeed
Good morning,
If i want blufor shoot to independent do I need change friendly status or can I keep them friendly to another and do like this?
if (isServer) then {
[] spawn {
while {true/*for testing*/} do {
private _units = units independent;
If !(_units isEqualTo []) then {
private _allUnits = units blufor;
private _unit = selectRandom _units;
{
"Unit exists" remoteExec ["systemChat ", -2];
( str(_unit)) remoteExec ["systemChat ", -2];
_x doWatch _unit;
_x doTarget _unit;
waitUntil {_x aimedAtTarget [_unit] > 0};
_x forceWeaponFire [primaryWeapon _x, "fullAuto"];
} forEach _allUnits;
} else {
"No unit" remoteExec ["systemChat ", -2];
};
uiSleep 0.5;
};
};
};
this far i got now
This is not working properly, so I need some help here.
Thanks
Both are ai , so don't effect to players
Seems like it'd be far easier to change the friend status?
Unless you have a good reason not to.
Well, just want this for certain area, like if there is 1 city where ai shooting (blufor against independent) and rest of mission they are friends
You could set them to side Civi, maybe (just the ones you want acting differently) and have side Civi be hostile to those you want them shooting at
Okey, i will try this out. Thanks.
Can I do that via trigger like change if side x , change hostile, inthislist
I would think that you could do it, but I don't know. I'm only familiar with this trick from Zeusing games, not from the scripting side
Compute the result, then store it in a hard coded array
It will reduce lookup time
You could also use a hashmap to contain all the "Minor cities" then the "Major cities"
If you were to do it as an array it would look something like this.
[["Kavala", "Perigos"],["Some smaller town etc"]];
I've done something similar for Draw3D to get map positions of towns
then just use SelectRandom after selecting the appropriate nested index
so do have to call that same script every time i spawn in civilian units?
no, not exactly, as you will be adding duplicate event handlers
run it once at init if you have preplaced civilian units, then just add the event handler to the ones you spawn on the fly
ok thank you
I have a script that enables a ppEffect for a player while they are inside a certain zone.
This is the script: https://sqfbin.com/hejivetojijifutateqo
It works perfectly.
*please note that the spawn in the script is not unnecessary, I just removed the part that it pertains to, as it is irrelevant.
I am trying to make it so that players wearing certain goggles will receive a less intense version of the effect. These are the two scripts that I have tried:
https://sqfbin.com/ofukojodekoyonanapiq, https://sqfbin.com/qusobopifuyexekupulo
Neither of them work. With the first one, no effects are shown at all. With the second one, it always shows the same intensity (regardless of goggles), but an intensity that neither of the adjustments should set it to; I think it's the default intensity for the effect.
I know I'm probably not fully understanding how these commands work, but the wiki pages for them are vague and lack many examples or notes. Does anyone know what I should do differently to accomplish my goal?
pp effect IDs can't be identical
That's why the 1st one doesn't work
ohh, I just forgot to change the id. lemme fix that
I'm not sure what's wrong with the second
I counted the effect args but they weren't the same
hmm
(or I counted wrong)
well, if the first one works then I'll use it
hey im using spawn BIS_fnc_dynamicText;
but i was wondering how would i get it to be higher up on the screen?
this is part of the full code
</t>",-1,-1,45,1,0,789] spawn BIS_fnc_dynamicText;
Set those -1 and -1 values to something else
Where exactly do you want it to be?
they make the text go off to the side of the screen
Ok but where do you want it?
@little raptor an update on this -- seems there's no difference between the result of unitReady myVehicle and unitReady (gunner myVehicle). So should be fine.
yeah I expected so
[mine setdamage 1]; && [mine1 setdamage 1]; && [mine2 setdamage 1];
how wrong is this code?
blow up 3 AT mines via a trigger when a civ enters it
and this is just supposed to be the trigger action code?
just mine setDamage 1; mine1 setDamage 1; mine2 setDamage 1;
i done that, but it didnt work 😦
well, adding arbitrary syntax won't help you :P
Try running that from the debug console and see what happens.
You could also do
{
_x setdamage 1;
}foreach [mine, mine1, mine2]
how did you setup these mines?
also use a hint to make sure your code is run.
(or a systemChat, I'm not picky)
@coarse dragon^@coarse dragon^@coarse dragon^@coarse dragon^@coarse dragon
inb4 non-scripted variant of mines
Gave em a name. And plopped the code in a trigger.
But I tested the same thing out with one and it went off with the trigger
1/ not telling us how you placed these mines
2/ not telling us what is the difference of setup: just mine setDamage 1 works then?
the code above (from John Jordan & El'Rabito) being correct, your issue is elsewhere then
It's set up for a civilian to blow em up
cool
It wasn't because I set a timer up wrong.. 22 instead of 2 
I am creating a RscStructuredText control and setting its text. I need to set the control to be the right size to fit the text. How can I calculate that based on the text?
ta-daaa
set the text then use ctrlTextWidth? 🙂
getTextWidth is a thing, but for simpler text
a question to devs, are any "Game 2 Editor" commands usable as they are? as in, does any of them have any effect in the current game (without being in a "Game 2 Editor" mode) ?
https://community.bistudio.com/wiki/Category:Command_Group:_Game_2_Editor
Returns vectorDirAndUp of object 1 relative to object 2
this is what I'm confused about
what is a relative vectorDirAndUp?
like… relative to the other
like relative direction, if a guy is turned to 90° and the other is 45°, the result is… hmmm… well something that is not 90°
In world space, [0,1,0] is north. In object space, [0,1,0] is forward (IIRC)
I think I understand now, thanks. I was confused by the implementation in this context https://forums.bohemia.net/forums/topic/215442-solved-point-one-object-at-another-bis_fnc_vectordiranduprelative/
I'm looking to "point" one object at another object's position with vectorDirAndUp. How would I go about that?
I searched for a while for this, and came up empty... I want to be able to point an object at another object in 3d space. So I need to calculate the values to use for setVectorDirAndUp. I know how to get the vector to the target (heading): _heading = [getPosASL _arrow, getPosASL _targetObj] call ...
Not with that function :P
_obj vectorFromTo _targetObj is a good starting point.
That gives you your desired vectorDir, and then you just have to fix your vectorUp.
Which this works for in most contexts:
_vecUp = _vecDir vectorCrossProduct [0,0,1] vectorCrossProduct _vecDir
that seems to work very well, thank you
my brain, however, is having a crisis
brb going back to geometry class
It's quite possible that you can get away with specifying vecUp as [0,0,1]. Depends whether (and how) Arma orthogonalizes the inputs internally.
Even this assumes that Arma normalizes the result. I'd be very surprised if it doesn't.
(_vecDir vectorCrossProduct [0,0,1] won't be a unit vector unless they're already orthogonal)
anyone know why <t valign='bottom'> isnt working?
https://community.bistudio.com/wiki/CT_STRUCTURED_TEXT
call me Mr Google
It is not broken though
titleText [format["<t valign='middle' color='#ff0000' size='6'>RED</t><t valign ='top' size='1'>top</t><t valign ='middle' size='1'>middle</t><t valign ='bottom' size='1'>bottom</t>"], "PLAIN", -1, true, true];
okay in sqf but how about in the config? it does not seem to apply to custom CT_STRUCTURED_TEXT controls
Does "if" or "switch" count as an exitable scope with "exitWith"?
exitWith always exits the current scope. Whatever the last curly bracket is, basically.
you can break anything, except waitUntil iirc
waitUntil should work too tho
as long as you return a bool
well yeah, but you can't outright do it like with other scopes is what i meant
What's the deal with playActionNow? With actions such as "FastL", they seem to sometimes move, but other times seem to get stuck on something or rubber-band back to where they started. Is there any way to avoid that?
Hi, can we get the "direction" of a selection like "selectionPosition" ?
Where can I get a list of AI features, i.e., ones to be used with "enableAIFeature"?
the BIKI?? 
Are these the only 2 features??? "AwareFormationSoft"
"CombatFormationSoft"
Which I don't really know what they do
it is the "sub-formation" iirc
There is no list of ai features that I can see
there is, linked
"see disableAI"
use enableAI/disableAI, no need for that obscure enableAIFeature alternate syntax
Neither of these is listed in the list on disableAI "AwareFormationSoft"
"CombatFormationSoft"
WHAT IS IT THAT YOU WANT
Because are for enableAIFeature
Oh thank you a lot 😄
Are the only two possible values for enableAIFeature, "AwareFormationSoft" and "CombatFormationSoft"?
So BIKI says
Why is it being compared to enableAI and disableAI if it doesn't contain the same list of possible string values?
you won't answer, hey?
I want to know what enableAIFeature is for, and if it has the same purpose as enableAI and disableAI.
its secondary syntax is the same as the non-*feature
otherwise it is an entirely different command with its main syntax
rrread the doc
So it's secondary syntax is an entirely different purpose?
Yes
as written
actually it doesn't explicitly say that
and you guys are giving me grief for idiotic language in the wiki.
If you say so, don't hesitate to contribute in #community_wiki
Second, for dodging the questions
and while you have the nose on the page, you wonder "what are the possible values"
you can admit all this can be frustrating from the outside
So what is the effect of enabling or disabling "AwareFormationSoft" or "CombatFormationSoft"?
an A2-introduced feature of sub-formation, as said
are you doing something in particular, or asking random questions about commands? knowing would help
I'm trying to track down every possible reason why AI would refuse a move order.
mods
sorry, a doMove command
Or rather, every possible reason they would hesitate or refuse a domove command.
or an inaccessible destination
Is there a way to check if the destination is inaccessible?
barely, unreliably
Is there any way to adjust a destination such that it is sure to be accessible?
https://community.bistudio.com/wiki/calculatePath
This is something but I don't think this is reliable enough for a purpose
not really
Is inaccessible destination related to my other question, about certain actions performed with playActionNow resulting in rubber-banding motion?
i.e., unit snapping back to its starting position after the animation is played.
that happens only some of the time
I don't get the connection between the two and playActionNow 🤔
My hypothesis to explain the rubber-banding motion is that the position they end up in at the end of a playActionNow command might be inaccessible.
Am I right in suspecting that could result in visually apparent rubber-banding?
I've been using playActionNow.
also: why bother with pathfinding if you make it walk
what's the difference between playMoveNow and playActionNow?
Do you mean why would I bother, or why would BI bother?
why do you consider pathfinding / path not found if you make the AI move by script
These questions were only related in these ways. In the case of domove, the unit fails to move for reasons unknown to me. In the case of playActionNow, sometimes the unit fails to move while the animation is playing or once the animation has finished playing, rubber-bands back to its starting position. In both cases I wonder if there is a common culprit that could explain the undesired behaviour, an inaccessible destination.
In the latter case, I'm suspecting the engine will now allow a unit to end up in an inaccessible location via playActionNow, even though no pathfinding was used to get there, because the unit would then become stuck in a position from which it cannot navigate.
But I don't know how inflexible the ai pathfinding is, so I don't know if this is enough to explain the playActionNow problem.
Is there any command which could give me a reasonably good idea of whether a position is too close to or within the geometry of an object to be navigable?
perhaps a way to test for collision with map objects against a sphere of some radius?
if you move the AI, it will be moved, period
pathfinding only occurs when a move order is given
regarding positions, nearest(Terrain)Objects and sizeOf
but something tells me you are taking the problem by the wrong end
Something else must be causing the rubber-banding then?
in the case of playActionNow
test in singleplayer
I have been.
then IDK
test without any mods
test in VR
test in usual conditions
only mods are CUP, CBA, and JSRS
still
also, what is the cursed location
also, what is the code you use
also, is the unit moving then saying "can't get there"
In the case of playactionnow, there doesn't seem to be anything special about the position, except maybe it's not aligned with some terrain cell resolution??? They don't say anything. Here's an example of code: _unit playActionNow (selectRandom ["EvasiveLeft", "EvasiveRight"]);
There's a sleep command right after that so there should be some grace period before anything else could be interfering.
no no, one issue at a time
the doMove thing, all the rest is solving attempt noise
this is the correct way to add 10 of these magazines yes? if so it seems to be only adding 1.
_vehicle addMagazineTurret ["rhs_mag_400rnd_127x99_SLAP_mag_Tracer_Red", [0], 10]
if not, how would I go about adding 10 without copy/pasting this line 10 times?
No, addMagazineTurret adds 1 mag, and the number is the number of rounds in that magazine (up to config max)
BIKI says the last 10 is ammocount
oh
for "_i" from 1 to 10 do {}; to loop
ammocount like bullets in the mag?
Ye
aww, I was hoping that was the built in method so I wouldnt have to loop
big sad
one last thing then
Why's a loop a concern?
Such a thing is possible with the addMagazines and addMagazineCargo commands, but unfortunately those are only for infantry magazines, not vehicle weapons
its not really, I guess I would be slightly worried about any effect on performance as the vehicle/s may be respawning frequently or there may be many of them
plus I'm going to be doing this for a few different vehicles
10 addMagazines won't cause a noticeable performance impact, and even if it did it would only be a very tiny spike at the moment it happened - no permanent effect
also one more thing, I would also like to remove the default mags, is there a way to grab how many mags the vehicle has of this type? or would it even matter if I just loop more times than there is mags?
_vehicle removeMagazineTurret ["rhs_mag_400rnd_127x99_mag_Tracer_Red", [0]];
would it error at all if say there is 5 mags but i loop removeMagazineTurret 20 times
removeMagazinesTurret
Does anyone have any ideas on how to hide the markers for terrain features such as churches, public transit etc.? I figured they would be covered by Location commands but they don't seem to match any of the types.
!code
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
I... don't think there is, unless you overwrite the map GUI
That's unfortunate
You want to make an empty map am I right?
No, not completely empty. I just want to hide some of the more detailed markers because you're not supposed to have perfect intel on the area. I've got rid of names (except the Piorun marker in the NW of Livonia for some reason, doesn't seem to actually be any of the hill/mountain types) and I wanted to take out the local utility stuff too. It's not a big deal but it would've been cool, and useful in the future if I ever wanted to hide a church without confusing people.
looking for some advice. Ive made a recruit ai script that delivers the ai via para drop from a chopper. when creating the unit i have to assign it to a group other then the players so the group is not local, otherwise some commands wont work on it. at the end of the script i add the unit to the players group like this
[_unit] join (_pGroup);
this works about 80% to 90% of the time. for the life of me, i can't figure out why it fails sometimes. i went a step further and added a check with a while loop like this
while {(group _unit) != _pGroup} do
{
diag_log format ["RECRUIT AI SCRIPT. _unit = %1, _pGroup = %2",_unit,_pGroup];
[_unit] join (_pGroup);
uiSleep 0.5;
};
this produces the same results.
i can see in the rpt that it runs once per unit so to me that would mean the check worked, and the unit joined the group, but in game the unit has not joined.
I'm left scratching my head. any insight here would be greatly appreciated.
when creating the unit i have to assign it to a group other then the players so the group is not local, otherwise some commands wont work on it
This sounds like it could/should be solved through the power of remoteExec rather than relying on automatic locality assignment.
Also, the()around_pGrouparen't necessary - it's just a single variable, there's no need to worry about it being evaluated in the wrong order.
In my experience, group joining can sometimes get stuck in a halfway state for basically mystery reasons. If it's a serious problem in your case, you might have to try bruteforce solutions such as repeating thejoincommand. Or.... create them in the intended group to begin with, and useremoteExecto target them with any LA/LE commands.
the script is ran server sided via remoteExec. I'm assuming my problem is this mysterious halfway state, when changing the units group to local from server via "join" perhaps I'll add a couple second delay and run the join again, as the check obviously isn't working correctly.
example?
@maiden juniper Any particular reason for using uiSleep instead of sleep?
I wonder why Push To Talk (caps) key doesn't work when there is a dialog open but Voice Over Net (x2 caps) does?
repro?
createDialog "RscDisplayEmpty";- Hold Caps Lock - no VON
- Double press Caps Lock = VON works
with default controls
No. But it won't make it slower or faster or whatever. Do what you prefer
thanks
Sorry but that is no repro. Firstly, as I demonstrated you need several texts in the same line and one of the texts making the line tall so that smaller sizes can be adjusted vertically. If all texts the same size visually you wont see difference. Secondly, I need copy paste so I can repro it and compare to what you claim
wont be at my pc for a while, tis the best i can do rn
Ok reproed, could you make a ticket please
you can tag me when ready
Not really, but I don’t think it matters, because as I said, I can it that it only runs once per unit.
Yes, I figured the script would be on the server (though it probably doesn't need to be unless you're using SE commands). What I mean is that you can use remoteExec again to target the unit's locality. The locality parameter of remoteExec accepts units, and if you pass a unit the command will automatically be sent to wherever the unit is local. Example:
_unit = createUnit [ ... ];
[_unit] remoteExec ["desa_fnc_unitLocalStuff",_unit];```
Is there a way to force AI to report status? Or otherwise clear the little red 'wounded' box on the group tray after they've been healed?
you mean apart from using the commanding menu?
Yeah, automating it.
try rejoining them, see what happens
it can refresh many things
[_unit] joinSilent group _unit
not sure about wounded status
Hrn. Might be worth a try.
That does seem to do the trick, though I'll have to monitor and see if it screws with anything else.
as long as you have at least 2 members in the squad it should be fine
also you shouldn't apply that to the leader
that code acts like "return to formation"
It's for vehicle AI crewmembers, which for most of the vics I'm testing is minimum two, besides the player.
It it's a problem, it's not really a big enough issue to hassle over, just a QOL for my peace of mind 😛
inPolygon seems to be inconsistent about whether the corners of a polygon are inside it or outside
is that something i should somehow report?
for example [2012.38,5538.97,0] inPolygon [[2008,5544,0],[2012.38,5538.97,0],[2008,5540,0]]; returns false while [2008,5540,0] inPolygon [[2008,5544,0],[2008,5540,0],[2012.38,5538.97,0]]; returns true
the game uses the winding test algorithm (afaik)
No chance of that working the way you want it to. Too much FP involved :P
being a vertex is irrelevant
since you're checking triangles you can write your own inTriangle check to support vertices
or just use in if you want exact matches
_vertex in _polygon || {_vertex inPolygon _polygon}
but since you're using floats that's not needed, unless you're deliberately passing vertices
Won't work if a point is exactly on a line rather than a vertex though.
The reason is that these algorithms work by comparing which side of each line a point is on, and that's never perfect with floating point. You have to adjust with epsilons.
that kind of thing will probably work for me
I still don't see why you're deliberately passing vertices 
otherwise i've already written my own test, i just stumbled upon inPolygon and found it to be like 10 times faster
can't elaborate further, i gotta go now
Are there any limitations or differences how missionProfileNamespace works compared to profileNamespace?
I just want to swap profileNamespace calls with missionProfileNamespace and see if it works out, as profile namespace gets pretty bloated when many mission instances store their info there
As far as I know, that's basically what it's for
thanks
i'm generating triangles to cover holes left after deforming terrain to put in trenches.
during that process i check if a newly generated triangle intersects with other triangles to see if it's invalid.
for that i've written a triangle intersection check which triggers if triangles intersect, but doesn't trigger if they touch.
currently that check checks intersection of the lines making up the triangles as well as checking if the points of either triangle lie inside the other.
into that function i feed triangles that (depending on the case) touch corners.
while writing this i've come to the realisation that i should check if i still need to check if the cornerpoints of one triangle lie in the other or if i have gotten rid of that need through other optimisations
hey, i have some part of a script that does not work as i want, the below should attach a lightpoint to the bullets and make the lightpoint visible to my firend but for some reason he cant see my bullets and i cant see his bullets
it should look like this:
https://www.veed.io/view/dd7ed2a9-68f6-48da-8366-ea12e95d53cb
0 = [150] spawn {
params ["_speed"];
_bullet = "B_9x21_Ball" createVehicle position Drone1;
_bullet setPosATL (Drone1 modelToWorld[0,0.2,-0.12]);
_dir = (getCameraViewDirection Drone1);
_bullet setVelocity ((getCameraViewDirection Drone1) vectorMultiply _speed);
_bullet setShotParents [drone1P, drone1P];
[Drone1,["laserShot", 1000, 1]] remoteExec ["say3d",0];
_tracerColor = selectRandom [[1,1,1],[1,0,0],[1,0,1],[1,1,0],[0.5,0.5,1],[0,1,0]];
_light = "#lightPoint" createVehicle (getPosVisual _bullet);
_light attachTo [_bullet,[0,0,0]];
[_light, 300] remoteExec ["setLightIntensity", 0];
[_light, [0,0,0]] remoteExec ["setLightAmbient", 0];
[_light, _tracerColor] remoteExec ["setLightColor", 0];
[_light, true] remoteExec ["setLightUseFlare", 0];
[_light, true] remoteExec ["setLightDayLight", 0];
[_light, 0.1] remoteExec ["setLightFlareSize", 0];
[_light, 300] remoteExec ["setLightFlareMaxDistance", 0];
[_light,_bullet] spawn {
params ["_light","_bullet"];
waitUntil {isNull _bullet};
detach _light;
deleteVehicle _light;
};
};
lightpoints are local
you should be using createVehicleLocal for them aswell
okay i will test it
Hello everyone, I am totally new in the programming on ARMA 3, however I am particularly interested in it in order to fix some bug. Indeed I try to understand the functioning of the AI especially with regard to the use or not of certain weapon and ammunition. Let me explain, the AI does not allow the use of FAB bombs (and any other type of unguided bomb) in all RHS vehicles except ONE, the Mi-24P not the V version P only and only this vehicle not even the SU-25. My question is: Why? Why does AI deprive this firepower? (It’s not as if she didn’t know how to use no guided bombs, she throws the Mk82 very well). And if anyone can figure it out, can anyone teach me how to solve it? Thank you very much for any answer 😉
most AI stuff are not "fixable" because they're not exposed to us
but it sounds like what you want to fix has nothing to do with AI. it's a mod problem. see:
https://community.bistudio.com/wiki/Arma_3:_Targeting_config_reference
in general, AI can't use scripted vehicle stuff (unless they specifically scripted that part too)
So do you think I can fix that problem on my own ? And if yes … how ? Thank you for you answer 😉
idk 
it depends what the problem is, and if you have the skills necessary (SQF scripting or config making) to fix it
Strongly recommend Advanced Developer Tools for config browsing.
Vanilla config browser is suffering.
do i need to remoteExec that command? because it has local effect.
you need to remoteExec the whole code
a code that creates the light
attaches it
sets its properties
how? please tell me xD
unfortunatly no
that's the easiest way
from what I see you only need 1 parameter for your function: the projectile
but I think projectiles are local 
anyway, for now just try sending the projectile over but I don't think it works
//fn_attachLightToBullet.sqf
params ["_bullet"];
_tracerColor = selectRandom [[1,1,1],[1,0,0],[1,0,1],[1,1,0],[0.5,0.5,1],[0,1,0]];
_light = "#lightPoint" createVehicleLocal (ASLtoAGL getPosWorld _bullet);
_light attachTo [_bullet,[0,0,0]];
[_light, 300] remoteExec ["setLightIntensity", 0];
[_light, [0,0,0]] remoteExec ["setLightAmbient", 0];
[_light, _tracerColor] remoteExec ["setLightColor", 0];
[_light, true] remoteExec ["setLightUseFlare", 0];
[_light, true] remoteExec ["setLightDayLight", 0];
[_light, 0.1] remoteExec ["setLightFlareSize", 0];
[_light, 300] remoteExec ["setLightFlareMaxDistance", 0];
waitUntil {isNull _bullet};
detach _light;
deleteVehicle _light;
[_bullet] remoteExec ["TAG_fnc_attachLightToBullet"]
also plz stop using getPos and position...
running ASLtoAGL on a world position is odd too
should use getPosASL _bullet if you're going to use ASLtoAGL
then again for something like a bullet I guess the difference is relatively minimal
and why doing remoteExecs with a locally created vehicle 
can just pass the position itself (nevermind, didn't see that you're attaching)
and remoteExecs shouldn't be there yeah
I forgot to remove his remoteExecs 
it's 0
because it doesn't have a land contact
if I want to clear the inventory of a vehicle do I need to run clearItemCargo, clearMagazineCargo, clearWeaponCargo and clearBackpackCargo?
Yes
or maybe better
clearWeaponCargoGlobal _vehicleObject;
clearMagazineCargoGlobal _vehicleObject;
clearItemCargoGlobal _vehicleObject;
clearBackpackCargoGlobal _vehicleObject;
That's what i use for MP
Hi, can i get a position from the "vectordir and vectorup" ? like that :
_vectordir = vectorDir _unit;
_newpos = ((getpos _unit) vectorAdd (_vectordir vectorMultiply 15));
Because the vectorDir seems to be only for some "axis" but not all and the vectorup seems to be for some others axis but not all.
- are you using
getPosintentionally? - what do you mean "get a position from the "vectordir and vectorup""? it makes no sense
you mean account for both dir and up when adding a vector?
I think yeah 🙂
e.g. 10 meters to the right of unit, 1 meter up, etc.?
exactly
in front of the direction
vectorModelToWorld
yeah but more like that :
_gspos = (player modelToWorld (player selectionPosition "proxy:\a3\characters_f\proxies\pistol.001"));
_gvector = (player weaponDirection (currentWeapon player));
_gpos = (_gspos vectorAdd (_gvector vectorMultiply 30));
Because i checked the function "vectorModelToWord" but you need to have an object. Actually i have a position and a direction i got with BIS_fnc_transformVectorDirAndUp
I put a "particlesource" and i want to control the particle velocity to fit to the "direction" i got with "BIS_fnc_transformVectorDirAndUp". Sorry for my bad explanations 🙂
I'm still not sure if I understand what you mean. but you can use several vectorMultiplys or matrices:
_fnc_vectorModelToWorld = {
params ["_vec", "_vy", "_vz"];
private _vx = _vy vectorCrossProduct _vz;
private _transform = matrixTranspose [_vx, _vy, _vz];
flatten (_transform matrixMultiply _vec);
};
usage:
[_myvector, vectorDir _veh, vectorUp _veh] call _fnc_vectorModelToWorld
it does the same thing as vectorModelToWorld except no object is needed
_myvector is what ?
is that what you want?
some vector
similar to _obj vectorModelToWorld _myvector
oh ok so _myvector is the same thing for "BIS_fnc_transformVectorDirAndUp" and the vectordir and vectorup is what i have so i will try and tell you then 😄 Thank you
wat? no
no for ?
_vy is dir
_vz is up
_myvector is a vector in "model space"
for what?
for "_myvector"
it will give you [0,0,0] back
but the "vectordir" and "vectorup" is what i got with the BIS_fnc_transformVectorDirAndUp right ?
a zero vector is the same in all spaces
what does it have to do with what I said?
that function transforms a vector in model space, defined with two perpendicular axes dir and up, into world space
but actually i don't have model
you don't need a model
you just need a vectorDir and vectorUp
the result i got is from a "vectordir" and "vectorup" generate with the BIS_fnc_transformVectorDirAndUp
ok but the "_myvector" is not needed because the "vectordir" and "vectorup" are already generated with the function "BIS_fnc_transformVectorDirAndUp"
I really doubt you understand what vectorModelToWorld means. that's what that function does too, except you just give it the axes directly instead of an object
yeah i think i don't understand something or you don't understand what i'm trying to do but it's my fault sorry. I will try the function and do it alone and i will come to you when i have a better idea how to explain that. So thank you a lot for your function 😄
How do I do make a string array a function parameter?
My mod uses a postInit CfgFunctions attribute to run a certain function at mission start. However, I noticed it is even running (it plays a sound) at the main menu mission when the game starts. How can I detect and abort in this case? I only want this code to run in an "actual misson", not on main menu.
how i can clear all cargo from a vehicle? i mean weapons, mags and all that... im trying to use clearItemCargo but it dont seem to work
are you just using call? Just put the array as an argument before the command
it'll be passed as _this
@open hollow like this ?
So in my function sqf file I just write something like:
params [
["_stringArray", [], [[]]
]];
So there isn’t a way to make sure there doesn’t get parsed some junk like an array of five objects into this?
what's the issue?
You cannot specify an array of strings specifically, only an array
if you want to validate that the array contains only strings you will have to do so yourself manually
i.e.
if !(_stringArray isEqualTypeAll "") exitWith {};
Ok this solution seems to work:
if (allDisplays isEqualTo [findDisplay 0]) exitWith {};
From source: https://forums.bohemia.net/forums/topic/224307-solved-prevent-function-initialization-in-main-menu/
I feel like I'm somewhat close to what I'm going for but it doesn't seem to be waiting for me to be close to the designated marker.
waitUntil { ({alive _x && (((getPosASL _x) distance (getMarkerPos "SADmark2")) <= 50)} count allPlayers) > 0 };```
I just want it to wait until there is at least one alive player within 50m of `SADmark2`.
Sorry, scratch that. It is waiting now, because I initially had the < as >. small mistake on that. But the new problem being is that the above statement never becomes true.
https://community.bistudio.com/wiki/inAreaArray might be better anyway
ooo, combined with an arrayIntersect could work.
something like counting between the two should work for what I need.
sleep 0.5;
_alivePlayers = allPlayers select {alive _x};
count (_alivePlayers inAreaArray _yourAreaParams) > 0
sleep 0.5;
allPlayers findIf {alive _x && (_x distance getMarkerPos "SADmark2") < 50)} > -1
these are the options I can come up with
i think inAreaArray is more efficient
also, getMarkerPos returns 0 height, so distance-ing with getPosASL may never even work if the marker is on high enough hill :3
Shoot, thats right.
also if you're crazy about optimization you can store the marker position to a global variable and reference that instead
probably negligible but I like to keep things neat in loops 🙂
private _markerPos = getMarkerPos "SADmark2";
waitUntil { sleep 0.5; (_markerPos nearEntities ["CAManBase", 50]) findIf {alive _x} > -1 };
@faint oasis It converts model space vectors to world space vectors. Simple as that.
Models are in a different coordinate space compared to world space.
Bit like how blender has several types of coordinates like Local and Global global being the reference point for all objects in the world and local being local to that object and model.
It's more commonly called Local space vs Global space.
Models are local to the models Global refers to the reference point of the entire world.
i want to change all radios from selected units in 3den but it aint working
{
if ( "TFAR_anprc152" in items _x) then {
_x unassignItem "TFAR_anprc152";
_x removeItem "TFAR_anprc152";
_x addItem "TFAR_fadak";
_x assignitem "TFAR_fadak";
};
} forEach (get3DENSelected "object")
any ideas on how to do it?
In Eden or in game?
3den
Before the game starts?
yea
Is the TFAR radios actually named the above?
First rule of debugging.
wait, it didnt lol
when save and load it changes wtf
diag_log does the string conversion itself iirc
diag_log _somevar
regardless you can just use str
@open fractal Oh it does now?
Well in that case if you need more than one var @open hollow then use format["%1","%2",_var1,_var2]; etc
I feel like that would become true if there were enemy AI near the point without players being near by. It's either that or I'm misreading something.
(wrong format format)
diag_log [_var1, _var2] can also work
format ["%1 %2",var1,var2];
&& isPlayer _x
Indeed you're right. ^ That above would fix it.
I just want to make sure I'm not insane.
There isn't anything in this that would cause a helicopter to just hover instead of land. Right?
It seems like it just hovers just after deleting the Loiter WP. This behavior happens regardless of if it is a scripted "Land" WP or even just a Move WP.
It just hovers...menacingly
I don't know but is there a reason why you use getposasl with distance instead of just inputting the object
Also getPosAGL isn't real @elfin comet
the command simply does not exist
I tried it as a hail mary attempt. Mixed up with ATL in my sadness I guess.
you're keeping me in suspense here is this something you don't know or something I don't know
Isn't getting the position just to use in distance redundant?
Although the event is global, on clients (non-server) and applied to remote vehicles, it will fire only if the vehicle is closer than about 6 km from the camera, otherwise it will fire later as soon as camera and vehicle are close to each other, alongside [[isEngineOn]] state change.
Can a native English speaker proofread this please? Adding a note to "Engine" event handler on wiki.
I just like being deliberate with code so that I know what is being used. No particular over arching reason.
Helps me be able to read it as reference for later projects.
I would break that into multiple sentences
actually I changed my mind
give me one second
Although the event is global, on clients (non-server) and applied to remote vehicles, it will fire only if the vehicle is closer than about 6 km from the camera. It will fire later than the actual engine state change, as soon as camera and vehicle are close to each other, alongside [[isEngineOn]] flag change.
```tweaked
Although the event is global, when on (non-server) clients and applied to remote vehicles it will fire only when the vehicle is closer than about 6km from the camera. Otherwise, it will fire alongside the isEngineOn state change as soon as the camera and vehicle are close to each other.
I like yours
From a grammatical standpoint that works. I might say "Should the vehicle be far away, it will fire as soon as the camera and vehicle are close enough together, alongside the isEngineOn flag change."
Thanks
yw
yep looks good
for https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HandleDamage
how does source and instigator differ?
in the testing i had done they where always the same
have you tested a gunner in a vehicle?
no, only as infantry shooting as infantry
I take it then one will give the gunner and the other the vehicle?
potentially. I think the "killed" handler differentiates those, I might be wrong
ah it is, source is now the vic, and instigator is the infantry unit in turret. Dang I was kind of hoping this could give me the projectile somehow so I could get impact velocity
Have you tested the hitpart projectile handler?
Gonna try to request a command to check if variables reference same array or hashmap, I wonder which command name to suggest? Thinking about:
<Anything> isSameRef <Anything>
```Any thoughts?
as example of UAV bomber drone ... Source = Drone, Instigator = Person controlling the drone
For ghosthawk helicopter door gunner killing a target... Source = ghosthawk, instigator = door gunner
The weapon/vehicle, vs who pulled the trigger
Is there any way to force mission to load missionProfileNamespace?
I noticed that it's not loaded on the first run of the mission on the cold game start, isMissionProfileNamespaceLoaded returns false. So, any missionProfileNamespace getVariable calls will return nothing making loading previous save impossible.
I have this at the top of the init
I've been told its unnecessary (i guess setVariable also creates the file)
if (!isMissionProfileNamespaceLoaded) then {
saveMissionProfileNamespace;
_exists = (missionProfileNamespace getVariable ['QS_var',[]]) isNotEqualTo [];
i also have this in description.ext, so it doesnt create a new file each time I change the mission file name (versioning)
missionGroup = "ApexFramework";
Does this overwrites existing file?
hmm, i use it to create the file initially, but I'm not the right guy to answer this question
anyway, i will check it
looks like a bug, to be honest - I can get any info from missionProfileNamespace on second and other runs, but cold start of the mission always returns nothing
Aren't we talking about game start and not mission start so missionProfileNamespaces aren't applicable?
I'm trying to read missionProfileNamespace variables on the first run of the mission on the first run of the game in initServer.sqf.
basically cold start of the game - start steam, start game, join the lobby etc
when you return to the lobby and try to run mission again without closing the game (return to lobby - start again) - everything works as it should
Thought you meant at the start of Arma 3 itself
@smoky rune you could check to see if simply having missionGroup = "whatever'; creates the file
or setVariable
file is already there
my guess is setVariable creates the file too
it likely checks the "isLoaded" internally
I noticed this strange behaviour today - despite having existing file, it simply does not load it on the first run of the mission when game is just started (isMissionProfileNamespaceLoaded returns false)
so I return to lobby and start mission again without leaving the game entirely - it finally notices that file exists and loads data from it (isMissionProfileNamespaceLoaded returns true, getVariable calls returns actual data)
I will try to reproduce it in the virtual reality sample mission
if you have file from before it should load it automatically. Are you saying that it doesn’t? I will need a ticket and repro
Yes, I have a .vars file for a mission, game loads it only on second run
Yeah, I'm working on it - If it is reproducable, I will create a ticket in bug tracker with the sample mission attached
Tried it on a live server, isMissionProfileNamespaceLoaded returns false (as there was no .vars file for the mission), missionProfileNamespace returns valid namespace.
All works as it should
As soon as you save the mission profile namespace, isMissionProfileNamespaceLoaded starts returning true, including on next join after game restart
what is the use case?
The use is to cut down on item by item array comparisons that isEqualTo does, when I simply need to know if a variable now holds a different array (it was remade at some point). Eventually I just redesigned the my code to avoid costly each frame checks on large arrays but having reference comparison would've helped.
Made a ticket @ https://feedback.bistudio.com/T167311
Did you mean that already existing mission profile namespace doesn't load right away but only after some time\frames when you start a mission after a game restart?
so basically you need isNotTheSame so to speak
Even after now double checking to make sure I'm using arguments that exist, I still have no idea what would be causing the helicopter to not land despite using the same script path as the Land WP that comes with the editor. Is there a different way to make a helicopter land at a specific spot? I know about land, but iirc, you can't pass a location to that.
https://sqfbin.com/japocibahehijogohicu
A separate thing that I'm also looking for an answer to is with regards to line 29. I need it to check if either the trigger area (LZarea) is empty or if the helicopter that the group that is referenced as _this in the script is piloting is full. Currently it just immediately completes. Figured I'd try to check if any alive players in the trigger aren't in a vehicle and have it take off when everyone is in. Not quit playing out as I don't think I'm referencing the contents in the trigger correctly.
I haven't checked if it loads after some time (brb), at this moment I can say that it's definitely not accessible on first run in initServer
missionProfileNamespace namespace doesn't return anything? Null namespace? Nil?
Actually, are there any implementation differences between isEqualTo and isNotEqualTo apart from one being negative of another? Doesn't seem so.
In my use case knowing if an array at a variable was another array, regardless of its contents, was enough. isEqualTo/isNotEqualTo work but they still iterated through arrays if it wasn't same array referenced, which I wanted to avoid to save a bit of each frame performance.
- It returns empty array with
allVariables missionProfileNamespaceandisMissionProfileNamespaceLoadedis false on initServer phase. - But when I reach actual gameplay phase (gain full control on character),
allVariables missionProfileNamespacereturns actual data andisMissionProfileNamespaceLoadedreturns true
this happens in the original mission, still haven't encountered same behaviour in repro mission, but encountered another issue that's seems somehow tied to this
Did a test to see what happens with mission profile namespace on a fresh game start:
onEachFrame {
diag_log [diag_frameno, time, getClientState, isMissionProfileNamespaceLoaded, missionProfileNamespace];
};
```results for having no `.vars` file for the mission, `missionProfileNamespace` is there all the time, `isMissionProfileNamespaceLoaded` is `false`
14:11:08 [26545,0,"GAME LOADED",false,Namespace]
14:11:08 [26546,0,"GAME LOADED",false,Namespace]
14:11:08 [26547,0,"BRIEFING SHOWN",false,Namespace]
14:11:08 [26548,0,"BRIEFING READ",false,Namespace]
14:11:08 [26549,0.017,"BRIEFING READ",false,Namespace]
14:11:08 [26550,0.04,"BRIEFING READ",false,Namespace]
14:11:08 [26552,0.073,"BRIEFING READ",false,Namespace]
14:11:08 [26553,0.107,"BRIEFING READ",false,Namespace]
```results when there is .vars file for the mission
14:09:45 [24689,0,"GAME LOADED",false,Namespace]
14:09:45 [24690,0,"GAME LOADED",false,Namespace]
14:09:45 [24691,0,"BRIEFING SHOWN",true,Namespace]
14:09:45 [24692,0,"BRIEFING READ",true,Namespace]
14:09:45 [24693,0.052,"BRIEFING READ",true,Namespace]
14:09:45 [24694,0.102,"BRIEFING READ",true,Namespace]
14:09:45 [24696,0.153,"BRIEFING READ",true,Namespace]
Tested on listen server
I guess you'll need to wait until getClientStateNumber > 8
thanks, will try that soon
14:18:59 [47419,0,"GAME LOADED",true,Namespace]
14:18:59 [47420,0,"GAME LOADED",true,Namespace]
14:18:59 [47421,0,"BRIEFING SHOWN",true,Namespace]
14:18:59 [47422,0,"BRIEFING READ",true,Namespace]
14:18:59 [47423,0.01,"BRIEFING READ",true,Namespace]
14:18:59 [47424,0.023,"BRIEFING READ",true,Namespace]
14:18:59 [47426,0.036,"BRIEFING READ",true,Namespace]
```on a second mission start
Now isMissionProfileNamespaceLoaded is true right away
So yeah, isMissionProfileNamespaceLoaded seems to be useless to tell if you can start reading from the namespace, have to check client state number.
14:22:14 [62856,0,"GAME LOADED",true,Namespace,321]
14:22:14 [62857,0,"GAME LOADED",true,Namespace,321]
14:22:14 [62858,0,"BRIEFING SHOWN",false,Namespace,<null>]
14:22:14 [62859,0,"BRIEFING SHOWN",false,Namespace,<null>]
```when starting different mission without `.vars` file after one which had it
So yeah, getClientStateNumber > 8 is the way to go
That 321 is missionProfileNamespace contents from previous mission which turns to nil once actual mission namespace is loaded
I noticed another anomalous behaviour (seems to be tied to this issue) - any missionProfileNamespace setVariable call in initServer does nothing, variables can't make it's way into vars file in that case
I will upload repro soon
ping me when you did
Ok, brb
Onedrive link:
https://1drv.ms/u/s!AhMgXWrzeR9zy4MN3SKo2TVsJ-I13w?e=rEFazJ
Steps to reproduce issue #1:
- Start game.
- Start listen server with mission via 3DEN or mpmissions way.
- Start mission.
- Call
call TEST_fnc_saveServer- this will call thesaveMissionProfileNamespaceand put it's content into systemChat bar; - Close the game entirely.
- Do steps 1-3 again.
- 1 Expected:
isMissionProfileNamespaceLoaded: true,allVariables missionProfileNamespacereturns all stored variables - 2 Actual:
isMissionProfileNamespaceLoaded: false,allVariables missionProfileNamespacereturns empty array or justcallnum, callstring
Steps to reproduce issue #2:
- Start game.
- Start listen server with mission via 3DEN or mpmissions way.
- Start mission.
- Call
call TEST_fnc_saveServer- this will call thesaveMissionProfileNamespaceand put it's content into systemChat bar; - 1 Expected:
allVariables missionProfileNamespacereturns all stored variables -serverID, callnum, callstring, initservernum, initserverstring - 2 Actual:
allVariables missionProfileNamespacereturns some of the stored variables -callnum, callstring, the ones that were saved via simple call, not initServer one
Yeah, I'm doing it right now 😉
@unique sundial
https://feedback.bistudio.com/T167316
Well, initServer is executed before init.sqf, and missionprofilenamespace is guaranteed to be available in init.sqf there are no other guarantees @smoky rune as of yet
'''The missionProfileNamespace variables are loaded at the start of a mission, before 'init.sqf' is executed'''
looks a little ambiguous
I am looking into possibility to move it earlier
https://community.bistudio.com/wiki/Initialization_Order
yeah, it's the case - I looked at green init.sqf rows before initServer to only notice that it's for singleplayer only 
if there are no side effects would probably make sense to load it as soon as possible
I am looking into possibility to move it earlier
it would be good, so profileNamespace and missionProfileNamespace would work more similar to each other, allowing to simply swapprofileNamespacecalls withmissionProfileNamespaceones
atm stable version of my mission uses profileNamespace and it looks like it loads way before initServer
Second problem solved to some extent. Forgot to set up the trigger to look for players.
Nvm, while the number goes up while in the trigger, it doesn't go down when I get into a vehicle.
@smoky rune ok moving it before initfunctions seems to work fine for both cases
Thank you!
I hope that A3 will receive some patch in the coming months so this new solution will be included there 😄
Yeah I'm pushing it for hotfix candidate as it is simple enough fix, we should have caught it during dev stage but since it is new feature it doesnt go to profiling and there is a lack of testing on dev
Should be fine after I moved it to load namespace earlier
hitpart would mean lots of network stuff since it fires on the unit that shot, not hit
afik
makes senses, didnt think to try that out at first
question, did you check it was unrelated to view distance?
Yes, both scripted and video menu options
Seems to be triggering if camera is closed than ~6300 meters or something
On Altis
Might be different depending on island size? Not sure
both terrain & object?
Yes
I can't find any further criticism, carry on :p
i have this problem with my DLL that it depends on two other DLLs but even they are all in same arma mod folder arma can't find the two other DLLs. any fix for this? (other than putting the two DLLs to arma main folder)
they are in same folder
So? Are you exporting the RV functions from those too?
no they are nuget DLLs
I know, but when you don't put them next to the exe you have to load them yourself
how?
Well in C++ you just use LoadLibrary and then GetProcAddress to get the functions you need
But class dependencies like in C# are probably not solvable like that
true
Can you just release a self contained lib?
what's that? 
Something that has all dependencies in itself 
right
I think that maybe for exes only
see this:
https://github.com/dotnet/ILMerge
might be useful 
have to try that one
there's also this:
https://github.com/Fody/Costura
Q: re: lineIntersects and variations... if we're talking about two units, I gather I would want to invoke lineIntersectsSurfaces and lineIntersectsObjs. For positions, using eyePos for either unit, literally until one sees the whites in the other's eyes.
What are the two objects to ignore? For now I am assuming that is the units involved in the LOS determination, at least based on one example. Although in another example, that is objNull, so I'm not really sure the intent there, and naming them ignoreObj is not especially descriptive.
https://community.bistudio.com/wiki/lineIntersectsSurfaces#Examples
https://community.bistudio.com/wiki/lineIntersectsObjs#Examples
Thank you...
For now I am assuming that is the units involved in the LOS determination
yes
in another example, that is objNull, so I'm not really sure the intent there
objNull means no object
so no object is ignored
so to clarify, yes, I gather objNull has the expected outcome; would potentially include either or both units, yes?
so it seems like the best practice there is to exclude both units, passing them as args.
There are plenty of *Intersects* uses that are not LoS checks.
okay, fair enough; but I am asking about LOS.
would potentially include either or both units, yes?
depends which LOD you intersect with, but yes
Could I get some clarification what this means. Would the objects include ambient life for instance? i.e. missing a LOS because he got a bug in his eye or such...
1 - CF_ONLY_WATER
2 - CF_NEAREST_CONTACT
4 - CF_ONLY_STATIC
8 - CF_ONLY_DYNAMIC
16 - CF_FIRST_CONTACT
32 - CF_ALL_OBJECTS (Usable only with CF_FIRST_CONTACT and it will check one contact per object)
Basically if there is some structure, building, wall, container, whatever, another unit, blocking... that's what I want in the results.
idk what lineIntersectsObjs checks, but I assume it's VIEW
and no, ambient animals have no VIEW LOD afaik
(also bugs are not animals)
IDK what that means "view" vis-a-vis the flags options... Ah I 🙈 ... just curious, since it mentions 'static' versus 'dynamic'. But I guess we're talking about things like spill bunds or what have you being static, one example.
IDK what that means "view"
https://community.bistudio.com/wiki/LOD
https://community.bistudio.com/wiki/LOD#ViewGeometry
'static' versus 'dynamic'
I assume static objects are slow objects and terrain objects. dynamic objects are normal objects:
https://community.bistudio.com/wiki/allObjects
Huh, interesting... course then it beggars the question, I am assuming these are the same flags in their intent... inconsistent in their documentation... 🧂 😉
just use https://community.bistudio.com/wiki/lineIntersectsSurfaces and be done with it 
it's the most complete command among all intersect commands
sounds good. thanks for the info, sir.
Alright, I give.
I have a function that's causing me a lot of grief.
Server executes a priming function that creates this trigger, server side only:
MikeCrewTrg = createTrigger ["EmptyDetector", [16298,8205,0], true];
MikeCrewTrg setTriggerArea [7,7,0,false,3];
MikeCrewTrg setTriggerActivation ["ANYPLAYER","PRESENT",true];
MikeCrewTrg setTriggerStatements ["this","[list MikeCrewTrg,""MIKE""] call SRD_fnc_spawnCrew",""];
I know that part works, and has worked in the recent past.
SRD_fnc_spawnCrew is where the screwyness begins.
Params ["_vehicleInZone","_whereParked"];
private _vehicleInZone = _vehicleInZone#0;
If (_vehicleInZone iskindOf "Man") exitWith {};
{removeAllWeapons _x; moveOut _x; deleteVehicle _x} foreach (crew _vehicleInZone select {!isPlayer _x AND !Alive _x});
[_vehicleInZone] remoteExec ["createVehicleCrew",driver _vehicleInZone];
{
_x setDamage 0;
_x setUnconscious false;
_x setVariable ["srd_downed", false, true];
_x setCaptive false;
_x setSkill 1;
_x allowDammage true;
[_x] call srd_fnc_AIRevival;
} foreach crew _vehicleInZone;
systemChat "SpawnCrew Engaged!";
The crew is created now, but none of the followon actions are obeyed, unless I manually call the function locally.
I know _whereParked is unused, it was for a prior implementation that I ended up ditching but may revisit.
timing
Think it needs a sleep?
The remoteExec runs well after the following code.
You can't sleep. It's unscheduled.
Well, yeah, I'd have to change it to Spawned instead of Called, but that's a minor detail.
You could change that function to remoteExec from the trigger where the driver is local.
[list MikeCrewTrg,""MIKE""] call SRD_fnc_spawnCrew
you can just usethisList
and even if you wanted to uselist, you can refer to current trigger viathisTrigger
And then you don't need to remoteExec the createVehicleCrew.
Probably still need a short sleep after the delete spam though
deleteVehicle doesn't happen instantly, IIRC.
Weirdly, that works fine; dead bodies are immediately replaced, at least in testing so far.
That's because remoteExec is delayed.
I tinkered with changing to a remoteExec, but couldn't get the reference quite right. Would something like ["spawn",thisList] be the idea?
The spawnCrew function itself should take a vehicle as a parameter, and then you'll know the locality when you call it.
you'll need a bit more code in the trigger statement but it'll make more sense :P
Ah, that seems to have worked it out 🙂
Funny, it worked fine-ish until today. Bluh.
correct, they are features
this one worked for me, thx! tried for hours to write batch script for that one without avail, then downloaded nuget package that automates the process and it worked 🙂
MSBuild.ILMerge.Task (nuget) in case some one needs it
is there a way to know that a terrain building was damaged by a player?
buildingChanged EH?
it doesn't have an instigator parameter?
how would I use to know that a player did damage the building and not an AI?
I would say add FiredMan event handler to all players
when they fire add an Explode event handler to the projectiles
or Hit
(or was it hitPart?
)
to detected what they hit
if the building changes afterwards they destroyed it
I would assume hitpart needs to be added to every terrain building
I said add it to the PROJECTILE
got a bit confused lol
let me check the new EHs then
so I'm not really sure about the behaviour of the new EHs
if they fire frag munitions, hitpart will still trigger once right?
can you even destroy a building with frag grenades? 
Tank FRAG rounds
those would be submunitions. not sure if they're supported
yeah there's an EH for that SubmunitionCreated
alright so now a player fires a projectile at a building
and I have hitpart on their projectile and buildingchanged EH in the mission,
So in order to coordinate the detection of a building being turned into a ruin, do I need to spawn a variable or something with a sleep interval so that buildingChanged can catch the fact the its the player who fired?
it most likely will be destroyed in the same frame
oh alright
I guess projectile EH triggers first
then buildingChanged
so you can simply check time when it was hit vs time when it was destroyed
and how much should be the duration for the check?
alright
(if it's destroyed in the same frame)
yeah that has to be tested by me
buildingchanged needs to be added to each client to make this work right?
yeah that's why I brought the need to add buildingchanged to every player locally
I don't think its a good idea to have projectiles checked by the server
?
what does it have to do with the projectile?
since projectile is calculated locally on the instigator, I would assume buildingchanged needs to be local to the instigator, so the whole system needs to be local in short
well now we come to another situation, lol
if two players fire at the same building, it might be counted as destroyed twice?
we can set a variable on the buildings itself to check if someone destroyed it earlier than the other in the short time frame, but to make that variable public, I would assume it would have a delay
you can let the server handle that
buildingChanged always fires on the server, I think.
Not sure how reliable it is anywhere else.
when a building is destroyed report it to the server
all clients have a copy too tho
no "HandleDamage" on buildings?
yeah but say two player fire, we might face a situation where it duplicates the building being destroyed twice?
you'd need to add it to many terrain buildings
plus it won't work anyway
due to streaming
so what?
oh, you're trying to figure out who destroyed the building :P
the server is handling the kills
I have a 15 buildings destroyed limit, so if they both fire won't that be 2/15?
if someone already took the kill it won't register it twice
again, if the server handles it no
hmm, so I do already have a buildingChanged on the server, do I need to add it to the client?
wat? those EHs are on the client
kill records are on the server
client kills and reports it to the server
server registers
client
you just do a remoteExec to tell the server
[getObjectID _building, _killer] remoteExecCall ["My_fnc_buildingDest", 2]
and that function has a hashmap of all destroyed IDs
params ["_buildingID", "_killer"];
if (_buildingID in alreadyDestroyed) exitWith {"don't count it twice"};
alreadyDestroyed set [_buildingID, _killer];
[_kiiler, -100] call my_fnc_addRating;
well Its only 15 buildings max (and then the mission fails) so is it possible to use setVariable to simplify everything?
on what?
_building setvariable ["BuildingIsDestroyed", true ,true];
which we can use to check if the variable is true or undefined on the building object, and then decide whether to add it as a causality or not
so you'd rather broadcast something to everyone instead of handling it in one place...?
which btw by the time the message gets there it's too late
also as I said already, terrain objects are streamed
^
the game keeps "deleting" them and then "recreates" them (they're not actually deleted tho)
so your vars will be lost
oh alright
So to recap:
-BuildingChanged EH added on every client
-FiredMan EH added on every client, which adds hitpart to every projectile the player fires, it stores time as a variable to do the following check
-BuildingChanged checks if isRuin is true when the time the hitpart activated on client is equal to time the building changed at.
-Check if building object id is in the destroyed buildings hashmap then
-Increment a public variable in the BuildingChanged script to notify all the players afterwards about the number of destroyed buildings.
-Check if building object id is in the destroyed buildings hashmap then
that is server's job
-Increment a public variable in the BuildingChanged script to notify all the players afterwards about the number of destroyed buildings.
no. server does that
so to last steps handled on the server, got it
one last thing, hitpart for both explosive/non-explosive projectiles
right?
because of fragmentation or?
best way to check if something is a grenade through config?
simulation
Alright thanks a lot
you can use hitExplosion EH instead
might be better
hey could anyone help me out with this? I am trying to convert a halo jump script to be able to be used on a dedicated server.
The following doesnt work in the init of the server
ghst_halo = this addAction ["<t color='#00ffff'>Solo Halo</t> ", "scripts\ghst_halo.sqf", [false,600,70], 5, true, true, "","alive _target"];
So I am converting it to remoteExec
ghst_halo = this addAction ["<t color='#00ffff'>Halo</t>", {[[[false,4000,70], 5, true, true, "","alive _target"],"scripts\ghst_halo.sqf"] remoteExec ["execVM",2]}];
However now the selection variables have changed and I am slightly confused, it asks for these
_host = _this select 0;
_caller = _this select 1; // 6
_id = _this select 2;
_params = _this select 3;
_typehalo = _params select 0;//true for all group, false for player only.
_althalo = _params select 1;//altitude of halo jump
_altchute = _params select 2;//altitude for autochute deployment
However when changing to remote exec, the _params it is looking for become arg 0 instead of 3, im not sure what the host/caller/id is or how its gotten.
Am I setting up this remoteExec wrong? should I be throwing the entire addaction into the remote exec rather than the remoteExec into the addaction or something like that?
Am I setting up this remoteExec wrong?
yes. the original script ~~had no parameters. ~~ used the action parameters
you can't just randomly remoteExec a script. it depends what it does
hmm, alright makes sense, so the params in the first addaction after the [false, 600, 70] are for the addaction not the script?
I guess the _id is the addactions return value
?
action arguments are _this
[_this, "scripts\ghst_halo.sqf"] remoteExec ["execVM",2]
but again you shouldn't randomly remoteExec things
you should read the script and figure out what part is not working
right, what would you suggest I do then? I can show you the script. When I attempt to call it on the dedicated server nothing is logged and nothing happens
ah, I should pastebin that sorry
I dont think the script even runs
sqfbin.com is another option
heres this, im going to revert the executed code on the server and see if I cant get it to log something
https://sqfbin.com/oxesihokupesesofexec
the only problem I see with this are chat messages
the systemChat?
and this line
[_caller] spawn bis_fnc_halo;
BIKI says don't use it
sounds like that function is from A2?
yeah didnt realize I left that one, I was changing them to systemChat so that only the player sees it
gotcha, is there a new method?
yes you just throw the player in the air 🤣
ah, with setPosASL?
yes
The script doesnt seem to run at all, it doesnt open the map or anything when the addaction is triggered in the dedicated server
it doesnt output any systemChat either
like I said don't remoteExec it
im not, I am running this addaction
ghst_halo = this addAction ["<t color='#00ffff'>Solo Halo</t> ", "scripts\ghst_halo.sqf", [false,600,70], 5, true, true, "","alive _target"];
added where?
in the init of a laptop object
the action appears fine?
yep. pops up teal colored
but no hint or anything when you activate the action?