#arma3_scripting
1 messages ยท Page 387 of 1
- that presumes a vehicle with physx simulation so GRAVITY
This is for creating a lift rope for a map. There is no play here.
- unitplay in MP does anyway
onEachFramestuff
but you are asking about linear set of vectors nd positions whe you not ?
which is what I'm doing linearly
or are they dynamic position ?
no, commy is talking about drawing cables, not about the chairs themselves
Yes.
that's a completely different story that I'm dealing with on another thread in my head
oh that was done for early fastropes , looked like dog shite
even cloudlets were used ๐ฎ
I wish we could have a VEHICLE in arma that is not pulled by gravity
but nooooooooooOOOOOOO
there are chairs that are cars
i have made some and they are not physx
wont they do it ?
Buildings are not pulled by gravity.
yes you can
yes but you cannot have a cargo in buildings
True, but you could attach the car on a helper building.
I disable Simulation when chairs are empty
just use the card chair
attachTo to a dummy object, maybe class Building.
car
but you need to enable it when people get in or they are stuck
get in handler on the chair
commy anyway you need to compute the position of the object onEachFrame because if it's static there's no way to just move it
True.
The problem is that all the scripting is done on the SQF level, but all of the physics is done on the C++ level that can't be accessed. So we only have so much to work with.
I wish I could have a VEHICLE I could say: go EXACTLY from point A to B in a straight line, then to C still in a STRAIGHT line and so on
Amazing things could've been made otherwise.
yep
still
I mean, we already have a fully working cablecar with 60 chairs going up and down on a 1.3km line
I already have that, as I said my chairs are vehicles
except that I didn't inherit from Car because gravity there is stronger in the simulation
so I use planex
you said Building i thought
no, commy suggested that for other reasons
well i think personally if its linear i would attach it to an animaterd vertices
to wut
the chair to an animated vertices that animates between pylons in line with the cable resolution lod
you can't have a 1.3km model
go ahead ๐
like Bis electrisity in cnernarus
you can't have a 1.3km model
Sounds like you tried.
hem no
lol i thought same ๐
models have limits
you can animate models tho lol its just they disspaear t uv stretch = __x times original space
i had an house that animated from 1 floor to two once over to see if i could make a modular village
disaster but fun
for instance the geometry LOD: The exact value of the limit is not yet known, but it's somewhere around 50-60 meter from the center of origin (meaning that your object can be 100m wide/long at max if it is symmetrical to the center of origin) https://community.bistudio.com/wiki/LOD
anyway... #arma3_model
yeah altho Suma said he had added code to surpass 5o meetrs i think he meant in the vertical
models are limited in size in every direction except vertically?
what in the fuck
just why
because how the model detection is 2-dimensional grid @rancid ruin
Make it very tall and topple it to the side. Win.
that's what i was thinking
inb4 ctd
vertical geo broke too at 50 meter
geo physx apparently works beyond 50 meter limit?
no
I got rocks/cliff stuff 260m tall and they seem to work ok
-> #arma3_model
#getfucked
how do i make civilians not run away? even wtih allowFleeing 0 they still run away
try
_newGroup setBehaviour "CARELESS";
_newGroup allowFleeing 0;
_worker disableAI "FSM";
_worker disableAI "COVER";
_worker setSkill ["courage", 1];
_worker setSkill ["spotDistance", 0];
_worker setSkill ["spotTime", 0];
where _newGroup is the group of the civilians
How do you attach a module to a helicopter
I tried this : mfire attachTo [feed2, [11, 0, -1] ];
But when I move the helicopter the module stays
ObjToAttch attachTo [AttachToMe,[coords]];```
thanks
yeah I tried that
is feed2 known/existing?
same for mfire
Is it one of those sfx modules?
Thats the module
ah
The module moves, but the effect doesn't.
The effect is created where the module is at the start and is not attached to the modules position.
They're probably not using the module. The module itself is just a vehicle to execute a script. They probably scripted the effects themselves.
@jade abyss Thanks i change your code a bit its working well ! ๐
๐
@candid jay can you post a bit more of your script. I want to get this right.
// compute pos
private _vdir = _pos vectorFromTo _end;
private _vlat = vectorNormalized (_vdir vectorCrossProduct [0, 0, 1]);
private _vup = _vlat vectorCrossProduct _vdir;
// create cable
private _cable = "Bosnia_Cablecar_Cable" createVehicleLocal _pos;
_cable setPosASL _pos;
_cable setVectorDirAndUp [_vdir, _vup];
// get to next position
_pos = _pos vectorAdd _vdir;
^ this is what you posted before, but there is no _start here.
sure, not on my pc now will write you an mp
is there away to change an AI faction with scripts? ive been trying ```
_this setSide independent;
_Grp = createGroup WEST;
[_SelectedAI] joinSilent _Grp;```
This is going places https://gist.github.com/commy2/3e289545e536e98a95cb033498ea0d64 ๐ถ
so
is there way to attach just like the tank barrel to a helicopter for.........science O.O
dang
I was thinking in the name of science
adding like a tank barrel to the pawnee
"another one bites the dust"
well with addweapon It does give it massive recoil
Dang well I tried XD
cause I was adding like sidewinders to the pawnee,thought it be nice if I could see it visualy
would it be possible to do so with scripts in zeus?
rip
oh yea I have no clue on how to make a mod
oh yo
no clue wat that is
Hopefully this is the right place to ask. Is anyone aware of a script that deploys the bipod of something automatically, e.g. on an AI?
AI can't deploy or rest the weapon, only players.
Ah, that's a shame. Thanks for responding so quickly.
Hope everyone had a good Thanksgiving.
I asked a question earlier that hasn't been answered yet. Can one client make a call directly to another client or does the server have to be involved?
How do you get a reference to other players other than yourself?
World space.
Sorry, I need to clarify. Not the actual player position.
Just the player's client @subtle ore
Oh
Yes.
Sorry, a bit new to scripting.
@subtle ore Oh I don't need anything returned. I just want to manipulate the player, such as disabling fatigue.
To disable fatigue you'll need to do it on the player's client
So just do player enableStamina false globally
I see, thank you.
dont think that would work. it would take the player object from where ur executing it from, not the JIP player
Just have it in init.sqf if you want it disabled everywhere all the time
0 spawn {
waitUntil {player == player};
player enableStamina false;
player addEventHandler ["Respawn", {_this select 0 enableStamina false}];
};
init.sqf executes every time u join...
client start
init.sqf runs on client and server when they load the mission
(and server as it is sort of client too)
not really. u use it for things you want both the server and client to do
Init.sqf been there and worked like this since dawn of arma
Nothing odd about it, it does what it says, inits stuff in the mission
What "it"?
It just executes everywhere early in the mission, that's it
If you mean objects, then yes locality of entites is already setup at this point
newly created player unit might not be local or even sent to player though so you need to do waitUntil
It runs for JIP as well, because their mission just starts and so init runs
Hey guys, I was hoping someone could help me with a spectator script.
I currently have an addaction that calls the following line:
["Initialize", [player, [], true, true, true, true, true, true, true, true]] call BIS_fnc_EGSpectator;
This puts the player in spectator mode and is working fine... The problem is that I'm unable to exit the spectator. Ideally I would like to do this with a keypress. Any help would be very appreciated!
Yes that works, however I need to be able to use it without the console
Init.sqf:
0 spawn {
waitUntil{!isNull findDisplay 46};
findDisplay 46 displayAddEventHandler ["KeyDown", {
if(_this select 1 == 1) then {
["Terminate"] call BIS_fnc_EGSpectator;
};
false
}];
};
Adds event handler that checks if ESC is pressed and executes spectator stop
Display 46 events should still run, needs double checking though
in the end i did that same thing with a mod, overwriting the keydown or something of that display. โ but I'd be very happy to be proven wrong
Yeah, you're right it uses its own display through createDisplay, not createDialog
Might be easier to just add event handler after you start the spectator
@dark heron
player addAction ["Spectator", {
["Initialize", [player, [], true, true, true, true, true, true, true, true]] call BIS_fnc_EGSpectator;
waitUntil {!isNull(["GetDisplay"] call BIS_fnc_EGSpectator)};
["GetDisplay"] call BIS_fnc_EGSpectator displayAddEventHandler ["KeyDown", {
if(_this select 1 == 1) then {
["Terminate"] call BIS_fnc_EGSpectator;
true
} else {
false
};
}];
}];
That works, thank you so much!
scheduled
uhEG even has a GetDisplay method? sweet :)
@jade abyss hello, i tried to create a RscListbox with ctrlCreate and I can't get it working. Just read https://community.bistudio.com/wiki/ctrlCreate and it there is no Listbox in the available Rsc, how should I proceed to create my Lb inside my dynamic dialog ?
@compact maple RscListBox
Yea my bad I am actually on mobile ๐
Well the class is there, you must be doing something else wrong then
Okay tought I couldn't create it cause it's wasn't in the wiki list, I must have missed something
To see what classes there are just open Config Viewer and look at classes that start with Rsc, RscListBox is there.
all, I'm using say3D to loop a sound in game
however, there's always a small interruption in the loop
what is the best way to have a sound loop seamlessly?
Im using a simple:
while { alive _source } do {
_source say3D _sound;
sleep 0.8;
};
however every time the sound loops there's a slight interruption.
Do you have CBA?
Certainly not with the scheduler, but I wouldn't use a pfh either.
createSoundSource with a CfgSFX + CfgVehicles class abusing the sound config entry.
https://github.com/acemod/ACE3/blob/master/addons/cookoff/CfgSFX.hpp
https://github.com/acemod/ACE3/blob/master/addons/cookoff/CfgVehicles.hpp
private _soundName = selectRandomWeighted [QGVAR(Sound_low), 0.1, QGVAR(Sound_mid), 0.25, QGVAR(Sound_high), 0.65];
private _sound = createSoundSource [_soundName, position _vehicle, [], 0];
That will loop it endlessly.
Until the sound source is destroyed. createSoundSource has global effects, which makes it even easier to use.
@3rK#4254 you can create any Rsc with ctrlCreate.
BIS_fnc_exportGUIBaseClasses will copy in your clipboard all default Rsc classes you can use, there are some usefull preconfigured controls you won't find anywhere else
Thanks you @slender halo
Trying to detect all dead units nearby, Is there anything I can use in place of player nearEntities ["Man", 10]; as nearEntities doesn't work on dead things.
There is allDead?
{
if (player distance _x <= 10) then {
// Do something
};
}forEach allDead;
hopefully that works, spent hours pulling my hair out wondering why nearentites wasn't doing it's job unless unit was alive. I'll give it a try thanks
AllDead will return dead vehicles too, use allDeadMen
is it possible to add an action to a static object?
For some reason the addAction command is not working
it does have geometry...
ok thank you
Add action to player with condition that checks if you're looking at needed object (cursorObject == ...) and close to it
hum
i'd rather create a hidden gamelogic
it's working now, there was an issue in the model (geometry without mass)
thank you
FINALLY Thank you BI!
@jovial prism @cosmic kettle might be better/faster (?)
allDeadMen inAreaArray [getPosWorld player, 10, 10];
๐ฎ If that works you deserve a medal
Dat fix ๐
According to the wiki... he fixed it.
^^
whistle nothin
inAreaArray fisrt param must be a position array, so i added getPosASL
getPosWorld !
faster ?
nice
getPosWorld player //0.0014 ms getPosASL player //0.0014 ms
between 0.00000 and 0.00004 ms faster ^^
(according to BIS code optimisation, didn't tested)
Yeah, we should just choose the worse one if we're not satisfied with the difference between two options.
i will too now
They should've just made a getPos2D command.
Or made commands disregard Z every time when not needed
Any hints to why this doesn't work ```{
{vehicle player addWeaponCargo[_x,1];} forEach (weapons _x);
}
forEach (player nearEntities ["weaponholdersimulated",10]);
By the purpose of command itself
@jovial prism weapons command works for units and vehicles equipped weapons, not vehicle cargo
You need weaponCargo or getWeaponCargo
@meager granite Nice, it worked! Thanks.
You need addWeaponCargoGlobal for this to work in MP.
@little eagle Yeh I guessed, Just working in editor atm.
Another issue i'm having is when I run ```{
if (player distance _x <= 10) then
{
vehicle player addBackpackCargo[(Backpack _x),1];
};
}forEach allDeadmen;``` It's causing bad object if the dead unit isn't actually wearing a backpack.
into vehicle inventory
It was duping items because I could empty the backpack into the vehicle but the backpack is always full
Ah, prefilled backpacks. They are a joy.
You'll soon encounter the limitations of the sqf api.
Happens to all of us.
Although X39 will probably tell you that everything's fine.
Everytime I read things like this I think about stopping to develop sqf-vm
Never did stuff with backpacks besides polling items @little eagle
Thing is, once i've had the popup of bad object it doesn't come back and you wouldn't even be able to tell.
Is it possible to lock an APC's crew positions, but allow players to spawn in the cargo bay, using the admin debug abilities? I tried with lockDriver and lockTurret, but I get the feeling this is a locality thing that I'm missing.
I'll give it a shot. Tried to give players a mobile bof and respawn point... ended up with them driving off into the sunset :/
Which I'm hoping to work on, for the sake of immersion ๐ I try to take vehicle controls out of their hands when able - touchy, but the official servers are limited in scope by the 16 player count.
Would that script work with 'this' if used in the vehicle's init field?
Humm. I used >this lockDriver true; etc etc. From what i recall they couldn't get in the driver's seat, but had no problems with the turrets.
I may have made it invincible >3>
Which they weren't supposed to find out because I'd be directing it, but woop.
So, got my gear scavenging script working ๐ด BUT is there a way to stop the action appearing unless inside vehicle? I've tried vehicle player addAction ["Scavenge","test.sqf",[], 7, true, true, "", "driver vehicle player == player"]; but the action is still avaliable from outside the vehicle. ๐
That sorted it thanks ๐
hey guys, quick question, is there an easy way to award points to the medic for a completed revive?
@tough abyss RemoteExec the code worked, players spawned into the cargo bay and could not switch with the AIs in crew positions ๐ Thanks again!
Hey, it's quick and easy to copy-paste into the exec box, it's all I need.
Can anybody see what's wrong with this vehicle player addAction ["Scavenge","Scavenge.sqf",[], 1, true, true, "", "driver _target == player"] On SP the action doesn't show till in driver seat (which is correct) on MP it's showing when out of vehicle as well as in driver seat.
this is wat I got
for that
_this addAction ["Name of action",
{
},[1],0,false,true,""," driver _target == _this"];
it and works in mp
Question,is there a way to detect when someone goes into autohover?
thx man
is there any way to tell the position of a nearby explosion from handledamage?
I don't think so.
@manic sigil you should probably not have call whitelisted. Stupidly unsecure.
Better to either make a function and remoteexec that or remoteexec the command directly.
[] spawn {
waitUntil {
if (triggerActivated victor2regrouped) exitWith {
{ _x hideObjectGlobal false} forEach nearestObjects [Area_Deka, ["man"], 100];
{ _x enableSimulation true} forEach nearestObjects [Area_Deka, ["man"], 100];
{ _x setUnitPos up} forEach nearestObjects [Area_Deka, ["man"], 100];
true};
};
};```
in the
its giving a error undefined variable up, but that error does not apears when i execute this alone in the debug console
the lack of "" in the UP was the problem, funny that it did not give me a error in the console.
Debug console runs unscheduled and in unscheduled environment you can use undefined variables without errors.
"UP" needs to be in quote marks.
Thanks for the heads up.
Best way to test if a returned array is empty or doesn't exist?
_profile = _profile select 2;```
@rotund cypress Ill confess that that goes over my head; what would I do to make it more secure? And how might it be exploited?
_active = _profile s>
19:58:05 Error Undefined variable in expression: _profile```
ordinarily it returns an array
but I'm looping through an array of profile names. Occasionally the profile has been entirely killed and ALiVE hasn't finished purging it from the system, so it's still in the array that generates my loop, but not returned from alive_fnc_profilehandler
I've tried isnull _profile and got Error isnull: Type Array, expected Object,Group,Script,Config entry,Display (dialog),Control,Network Object,Task,Location which seemed pretty self explanatory
OK. I'm getting a bunch of elements, so I think the last bit is probably too "belt and braces" for me. But the first two could definitely be on.
I've tried !isNil though and I got a very wierd error, must have a syntax error somewhere.
if (!isNil _profile) then {
_profile = _profile select 2;
_active = _profile select 1; //[_profile, "active"] call ALIVE_fnc_hashGet;
_profileType = _profile select 6; //[_profile,"type"] call ALIVE_fnc_hashGet;
// if (_debug) then {
// ["%1 - %2 ", _active, _profileType] call ALiVE_fnc_DumpR;
// };
// _profile call ALiVE_fnc_InspectHash;
if(_profile select 5=="entity") then {
_iProfiles=_iProfiles+1;
_num = count (_profile select 11);
if(_active) then {
_tree tvAdd [ [_iRoot,_iType,1], format [ "%1 - %2", _profileType, _num]];
}
else
{
_tree tvAdd [ [_iRoot,_iType,0], format [ "%1 - %2", _profileType, _num]];
}
}
};```
aha
right.
has anyone tested performance difference between an object with simulation disabled and using dynamic simulation?
I'm assuming, hence the question. It would make sense it would be an empty array
so maybe just count _profile>0
It seems that dynamically toggling the simulation would increase the load as each vehicle would be checking to see if the player is x distance from it.
compared to making a script that once a player enters then it toggles simulation.
cheers. will try that in the morning. too tired to fire up ARMA again. lol
What about collisions?
With a "server only" detection it come to way more "shitty jiggling" situations like it has now
No
It just doesn't move
Like a brick/house
Why should it have any checks in it, when the Sim is disabled? ^^
And what if the obj. had disabledSim for a purpose? ๐
@manic sigil enables a hacker to remotely execute whatever code he wants
how can I force open the inventory (gear) window?
action command. With "Gear"
thank you ๐
Is there a function for converting a decimal number to hex? More specifically, a color array [r, g, b, a] to a hex color code?
IIRC, no
But doing such things yourself is not that much work
As I said: not that hard
Using tostring command makes it even more simple as no actual string building is required
Say I have 2 objects. Object 1 is the anchor and object 2 needs to maintain relative position as object 1 changes heading. How would I calculate this?
My first thought was to measure the distance between object 1 and 2 and then get the heading of object 1 and then get relative position base on that. Though is that the right way of doing this?
getRelPos @tulip cloud ?
https://community.bistudio.com/wiki/getRelPos
@jade abyss and based on the initial data he wants to reposition object 2 according to the offset and orientation
so object 2 always looks the same in object 1's eyes
measure the distance between object 1 and 2 and then get the heading of object 1 and then get relative position base on that.
hm? You sure?
Sounds more like "I want that object always 5m, 90ยฐ to the right"
so basically if i see you infront of me and i turn around, i still see you infront of me
Hu?
that would be my guess ๐
ah ok
๐
Returns position, which is given distance and relative direction away from original object.
Yep. Either attachTo or getRelPos ( i would prefer attachTo)
Unless that Object should stay on the Surface (then getRelPos is better, since it takes AGL, so you just set 0 as Z-Axis)
That also. It depends what he wanna do with it ยฏ_(ใ)_/ยฏ
+For MP -> constant setPos -> Erm... bad idea
i mean if he wants to calculate it, id get the initial offset between the two models and then you can always use modeltoworld with the saved offset to get the theoretical position
Let's just wait for answer for the prev. questions, before we assume more and more and more and more... ... ... etc.
Yes
๐
๐
๐
๐คฆ
So @tulip cloud , whats you pick.
My kid interupted me sorry about that.
So modelToWorld works great for what I'm doing for calculating the initial position of objects. Though once I set a different heading for the parent object then I need to update the location and heading of all children objects. I think doing a forEach attach will be the most efficient method.
So all objects will spawn from an array and attach themselves to the parent object. Then I can set the parent object location. From my experience attached objects don't follow terrain so might have to experiment with this a bit to make sure nothing crazy happens.
I might be missing something here. Does modelToWorld XY grid change based on an objects heading?
Any reason a light source's flare could be flickering?
_light = "#lightpoint" createVehicle _randomPos;
_light setLightColor [0.9,0.41,0];
_light setLightBrightness 4;
_light setLightAmbient [0.9,0.41,0];
_light setLightFlareSize 0.4;
_light setLightFlareMaxDistance 150;
_light setLightUseFlare true;
_light setLightDayLight true;
_light setLightAttenuation [0.1, 0.8, 100, 70];
It's mostly on but sometimes quickly disappears and appears again (the flare effect)
The light itself and it's influence on the gameworld are fine
@tough abyss I thought that its that aswell at first (could still very well be) but now I feel stupid, it was because they were at height 0
anything above 0 works fine ๐
arma 3 script to unlock vehicle chopper weapons to copilot ??
what about it?
does it exist? if so any help on it..
why the hell would you complain about this when you can complain about something else?
No
No
I can't change the engine or how sqf functions
You're "allowed", but it won't change anything, your rambling is pointless
Not to intrude on this important conversation...I have a question.
I see a functions to set or get direction. Though there is 1 function that is lookAt but it seems like it is designed for AI or something to look in a specific direction and not actually set the direction of any random object. Am I correct in this?
control what the unit(s) is/are looking at (target or position). It says looking at not the direction they are facing
that is why wanted to check with the community
no, looking to use it on a trigger...which wouldn't work because it's for AI and using on myself wouldn't help.
What are you trying to accomplish?
arma 3 script to unlock vehicle chopper weapons to copilot ?? , does it exist? if so please any help on it..
I have point a and point b. I want point b to face point a.
What's "point a"? Marker?
both points are triggers
I overlooked the "since version x..." I actually think I've used this before. Thanks for the tip.
_triggertwo setDir getDir _triggerone
it's different for markers
How can i get spectator camera coordinates (while being in spectator mode with enabled debug console)? Thnx
What are the prerequisites to be able to compile functions from FunctionViewer (to not restart mission everytime after small edits).?
For recompile question i found the answer - https://community.bistudio.com/wiki/Functions_Library_(Arma_3)#Recompiling
AGLToASL positionCameraToWorld [0,0,0];
Hello, i made some ppEffect to train, i got stuck with something, how do i do if i want the effects to come and leave "smoothy", cause when i create my effect, its comes instantly, not gradually
@compact maple https://community.bistudio.com/wiki/ppEffectCommit
makes it happen over time
Its always good practise to think securely though @tough abyss
@noble pond yes, this is what i do, but it cames instantly even with _rad1 ppEffectCommit 10;
Anyone uses unit capture? it seems unti fire is broken on helicopters
is there any way to retrieve the current mission folder from an addon, or even the root of all the arma profile?
that only returns the name, not the path
Does anyone know how to enable crosshairs on players even if they are unarmed?
what are you referring to? i do mot see any mission path reference in there
Is civilian side not available in an objects init field? As I am currently getting undefined variable CIV
civ is a faction side = 0,1,2,3
ye
str civilian == "CIV" -> true
is there a way to take a look at the single player source code/
civilian isEqualType sideUnknown
this is true
since its a side datatype, but for some reason i am getting a undefined variable civilian in object init field so maybe its a thing that doesnt work in the init field of objects?
can you show me the init field content?
Yes hold on one second please.
@tame portal init="[this, civilian, ""<t font='RobotoCondensed' color='#FFFFFF'>Ground Vehicle Garage</t>"", ""GW_client_fnc_vehicleOpenGarage"", [civilian, ""Ground"", [""civilian_groundvehiclegarage_spawnmarker_1""]], ""Ground Vehicle Garage"", ""Garage""] call GW_client_fnc_initWorldObject;";
@candid jay pretty sure it is possible to get mission file path. trying to find an example, but it's been some time
and whats the error message youre getting simzor?
thank you fusselwurm
I think I figured out my problem however, I am inserting a side datatype and calling it via string, so I think I have my problem there.
Alright I got it sorted. Thanks anyways @tame portal
What was it?
So I was taking in a param with side data type
then i used that to call another script
by parameter
but because of the way the addaction was being added (call through string)
it didnt work
format ["%1 call %2", _scriptArguments, _script], @tame portal
@candid jay huh,not sure if this is what you wanted actually... there is the FILE preprocessor command : https://community.bistudio.com/wiki/PreProcessor_Commands#FILE
yes I'm familiar with that
but you'd have to call it from mission file
i m beginning to see your problem
thank you for looking it up though ๐
at my group, we put lots of libs into missions (via package manager), so for us FILE was sufficient :/
SCAR ๐
@little eagle You have too much free time
So thats how a straight curve looks like
It's two points 20 meters apart connected by a chain which is 20.2 m long.
does the valign attribute for RscStructuredText work? i can't get my text to align to the bottom with 12:46:09 "<t shadow=2 valign='bottom'><t shadowColor='#000000' align='center' valign='bottom' size='0.777856' font='PuristaBold' color='#FFFFFFFF'>SE<br />|</t>"
It doesn't work from my experience.
I always just move the whole control downwards.
Or upwards in your case.
"bottom"
Well it's true.
There is no title
titles != title
That squiggly letter at the end is wrong
I wasn't specific enough? The error message says title doesn't exist and in your config you have titles
It's because CfgSounds is something completly different
Radios != Sounds
And if you check wiki you'll see CfgSounds uses titles and CfgRadio uses title
Another consistency achivement from BI
CfgRadio needs title and CfgSound sneeds titles[] - apparently. No reason in asking why. BI, that's why.
Computers be dumb.
If it says "no entry" something always check if that entry is there.
Should just add both title and titles[] lol.
You still have titles?
But that screenshot shows titles
show what you have now
Also that's #arma3_config btw
The code above is wrong
Don't "restart", go back to 3den and save and load the mission.
I want to see the code you are using right in this exact moment that gives you problems
What is the error? still no entry for title in CfgRadio?
Don't "restart", go back to 3den and save and load the mission.
There's no point at getting angry at machines. They don't give af.
Which I can admire.
show me what config viewer shows on your CfgRadio class
It's not. if you do it right
Wiki shows your title cannot be an array. Somehow
And you have title[] which is an array
how would i get the rel dir a player is looking at (i.e in freelook) - i know eyeDirection returns a vector but im bad at math and dont know how to convert that into a number
@fluid radish you mean direction in degrees?
yes @still forum
@fluid radish https://stackoverflow.com/questions/6247153/angle-from-2d-unit-vector There is the math
https://community.bistudio.com/wiki/atan2 already returns degrees
(eyeDir select 1) atan2 (eyeDir select 0)
I'm not sure if eyeDirection is correct. You might want cameraDirection
Does find work with multi-dimensional arrays in A3?
ew just noticed arma 3 is using tabs most places
Thanks @little eagle
That looks dope
what is it though? seems like its just drawing a curve from the heli to the head of the unit
oh its a CBA funciton
got it
does anyone have a function to convert a color in format [1, 1, 1, 1] to a HEX code like #ffffffff? trying to avoid writing my own if someone else already has one
No it's not a CBA function.
It's a "Catenary curve" It's how a rope would curve if that was a rope
@still forum yes, and according to the systemChat it seems to say its a function ๐
Apparently sir commy wants to make it one
@fluid radish
"#A7A7A7" call {
params ["_color"];
_color = [
_color select [1,2],
_color select [3,2],
_color select [5,2]
];
_color apply {call compile format ["0x%1", _x] / 255}
};
i think that's going in the opposite direction, but it a start
There's also the BIS_fnc_colorRGBAtoHTML
BIS 0.0417 ms
ACE 0.0261 ms
But does it matter really? You don't do color conversions very often I imagine
not at all. how did you manage to find that? it's not on the wiki
huh, must have missed it then. but that's exactly what i was looking for, thank you
๐
stringToColoredText uses toHex, which is only called by the magazine emptiness indicator and the grenading throwing hint top right.
So idk if it matters. Prolly not. ยฏ_(ใ)_/ยฏ
Could also use the BI function instead and spawn that script. Would mean no worries about performance at all, and the indicator would pop only like half a minute later in MP.
/s
Its 0.015 ms you could've spent playing the game!
I'm having a bit of trouble with addDiaryRecord and MP. This is in the object players interact with: intel1pick addAction ["Download Information", remoteExec ["intel1.sqf"]]; and this is the running script: https://pastebin.com/zc3ccjPG
For some reason when I go to activate it, nothing hapens.
I don't think you can use files with remoteExec.
yup you can't.
You can remoteExec execVM
Oh I see. Okay, so I just need to change the remoteExec section and it should run okay?
*run okay in MP
Were you born this way Quiksilver or were you dropped as a kid?
I had to google "scurrying". I've never heard that one.
That's when you walk without lifting your feet right?
is isKindOf the only way to get a vehicle's sub-class? I'm looking for the best way to return either an object or classname's sub-type. ("landvehicle","plane","helicopter","ship")
Ah, I don't think that's the right one. I swear I had something like that somewhere.
Essentially you go backwards with inheritsFrom and configName.
commy if only they would adopt CBA into the vanilla version :/
Until you end up with <config null> = no more parent classes.
that sounds like it would cost more than just nesting a few ifs.
Wouldn't
while {isClass _config} do {
be better than
while {configName _config != ""} do {
?
I think so.
But even for non CfgVehicles, they now have an alternative syntax for inheritsFrom.
Sry, isKindOf I mean.
currentWeapon player isKindOf ["Rifle", configFile >> "CfgWeapons"];
So who cares. Just use that instead.
can someone give me a hand with my onEachFrame handlers here? No error but the lights are being set in the wrong position https://pastebin.com/raw/a4R75yKG
setPosASL AGLToASL
instead of setPos ?
Ah, nvm. None of the local variables are defined inside the eventhandlers scope.
They don't carry over, you need to pass them as arguments.
Still, don't use setPos. This is what happens when you trust it to work with AGL. It betrays you above roadway lods above the sea: https://www.youtube.com/watch?v=pXNo3fDsogg
if I'm using modelToWorld visual, setpos is okay right?
modelToWorld is AGL. So setPos will do exactly what the vid shows above an aircraft carrier.
modelToWorldVisual as well?
Yes.
This is the fix: https://github.com/acemod/ACE3/pull/5800/files
It was the ONE time I used setPos and it came back to hunt me.
hehe
what I don't understand is, if modelToWorldVisual format is agl, and setpos is agl as well
why is that bad?
setPos isn't AGL apparently. But only over roadway lods on the sea. Who the fuck knows.
It isn't listed on the wiki's page about the position formats anymore either.
So it's probably just special.
Not even AGLS like getPos. Special special.
perhaps using modeltoworldworld and setposworld?
if I'm using oneachframe, should I do modelToWorldVisualWorld?
alright, got it all figured out
_pos = _vehicle modelToWorldVisualWorld _pos;
(_this select 0) setposworld (_this select 1)
i'm trying to use @still forum 's arma script profiler, but i keep getting "Script core not found" when i launch with it. i'm on the profiling branch and have battleye disabled. any ideas?
What's the problem with that?
Not an error and also doesn't break anything.
Just tells you Intercept is working correctly.
I know I should write something else there ^^ But too lazy
Should change that to Script "Arma script profiler succesfully loaded" not found ๐
oh, i just assumed it wasn't working, didnt bother to try that. derp
if (script == true && 1==1 || "x" == "x") would be better.
Don't see anything to optimize
@still forum you once said something about you replacing cfgFunctions for ACE, I see that it's done with macros, but how exactly does this work?
ACE doesn't use cfgFunctions
yeah, was it something with scriptName?
They use CBA macros. I just modified the CBA macros for it
or am I mixing things up. hmm, I'll have a look into those. What is the benefit, apart from not having to go through the cfgFunctions on every iteration?
Being able to control yourself what to do. Instead of using a crappy BI function that you have no control over
so the forums appear to be up but i can't seem to log in, anyone else?
#community_forum != #arma3_scripting
Can confirm
Hello all. Another (quick) question. I am getting an error when running an execVM:
['#'execvm (_this)' Error execvm: Type Number, expected string.]
Furthermore, for some reason even though I have a createDiaryRecord, everything BUT that is working in the same script.
player createDiaryRecord ["Clues", ["Generator Location", "Local resistance cells have managed to <marker name='generatorloc'>loc ate</marker> a generator which is powering The Castle. If we destroy, it will knock out communication and power to the city, making our extraction easier. <br /><img image='generator.paa' />"]];
What is the benefit, apart from not having to go through the cfgFunctions on every iteration?
- It's easier to write
PREP(myFunc)and then useFUNC(myFunc)instead of having to set up the CfgFunctions config. - You can add functions without having to go through config which requires a game restart or diag_mergeConfig which only works on dev branch.
- You can make functions that compile only e.g. on machines with interface, so dedicated servers and hc's don't have to compile ui functions.
- You can selectively enable debug mode for each component.
- You can disable the functions cache for each component selectively instead for everything or nothing (faster mission restart while debugging).
Is it possible to avoid chat from channels added via radioChannelCreate to be visible in the lobby selection screen to anyone?
Lobby or briefing?
@little eagle Sorry for the late reply. The lobby, so before the player has even selected a slot
anyone using make_file.dll of KK from an addon: where do you save your output files? I havenโt found a way to retrieve a path such as user profile and such
@warm gorge Then the answer is no sadly.
@candid jay main arma directory for me
It will bring up a message box asking you to save the file
so how do you do that? by passing just the filename and no other path?
@cosmic kettle Commy gave more details above
Thx for the notice! ๐
@still forum You wanted to see it compared to a RopeX: https://i.imgur.com/HOFTzER.png
No I didn't ^^ Someone else
@little eagle Which one is be less intensive? (ropeCreate vs. draw)
Drawing them is not the problem. These are > 400 segments for my curve and, idk, 100 segments of rope?
The problem is calculating the rope tension, which wouldn't be feasible with SQF in real time. It needs some approximation algorithms that would be better off in C++ land.
@candid jay you might want to look into this : http://www.armaholic.com/page.php?id=30684
What is the difference between:
if (!isNil "_var")
and
if (!isNil {_var})
Both result in the same output, so just wondering out loud, the latter is code the first a string?
Yes..... The first is a string and the second is code....
The second one has a lot more overhead
You already answered my next question thanks ๐
I know.. That's what I just did...
I found the atom sqflint package and it keeps saying that _var is not being used if I use the string check.
So was considering changing all string checks to code checks... just to get rid of those false flags
Tell the author of sqflint that that's happening and have him fix it
Might as well. Thanks for the info!
Hmm,isNil STRING can only check variables, whileisNil CODE can check the return value of any expression.
If your expression is just one variable, you might as well use STRING.
Could someone pls help a noob with some real basic trigger stuff?
What's the trigger
@barren magnet thank you
@blissful wind ahahahahah, that is 10/10
You should post it + the mission with the code for it on the biforums
I think many would appreciate that idea
@little eagle ArmA 3 SQFhysiX next?
I mean, we DO have addForce and addTorque now...
I already forgot what it was about.
_newTrigger = createTrigger ["EmptyDetector",[1,2,3],true];
missionNamespace setVariable ["_TriggerName",_newTrigger];
diag_log (getPosWorld _TriggerName);
I get error that _TriggerName is a string not an object.
setVariable is for global variables. "_TriggerName" as name doesn't look right at all. Local variable begin with underscore, not global variables.
Just copy paste the whole error message.
@tulip cloud what @little eagle is saying is that the "_" prefix is reserved for local scope, either in a function or local to the .sqf file. Pushing that to missionNamespace probably silently fails
_name = "myTestName";
_location = [4000,4000,0];
newSpawn3 = createTrigger ["EmptyDetector",_location,true];
newSpawn3 setDir 0;
missionNamespace setVariable ["newSpawn3",_name];
{
diag_log _x;
}foreach allVariables missionNamespace;
tried it this way too.
I looked through the missionNamespce and newSpawn3 still exists in there and there isn't any myTestName.
What are you trying to do?
You are doing newSpawn3 = "myTestName" and expect a variable "myTestName" to magically appear
I... have to look up to be sure
but I think your setVariable is backwards
with that setVariable, you'd able to call "newSpawn3" as a variable elsewhere, but it'd return "myTestName", which is not the trigger you've made
๐ต just SQF things ๐ต
It's truly a black hole of time
Fastest way to debug anything is to just create a local server with the editor
then back out to the lobby and back in with each change
but on the other hand, that probably is zero help for the .ext and .cpp files
woohoo
[name,value] ....if it was [newValue,value] on the wiki I wouldn't have made this rookie mistake.
isn't it changing the variable name to a new name?
You can't change a variable's name
so how does it work if I'm creating multiple objects using the same variable = createVehicle
You overwrite the variable
Ok so setVariable is more of a cloneVariable?
No.
It set's a variable.
creates new one if doesn't exist and overwrites if it does
So both the old and new variable are set to the same object?
yes
Wait.. If you overwrite a variable there is no new variable
you overwrite the old one.
it is still in the missionNamespace though
If you set it in missionNamespace... ofcause...
hey is anyone around to help me with using checkvisibility?
I want to use it to check if a particular player is looking at a specific prop
I can't use cursorobject because that applies to any player
well no not exactly, you can use cursorObject when the script is being executed local to the player
Okay, let me try and understand. I have 4 players 2 OPFOR and 2 Civilians named Terrorist 1 and Terrorist 2. I want to create a trigger that says, when Terrorist 1 is looking at a prop, it will explode. I don't know how to restrict cursorobject to just terrorist 1
[objnull, "FIRE"] checkVisibility [getPos IED1, eyepos Terrorist1] >0.5
is what I have in the condition
but doesn't fire
Even if I group CursorObject trigger to Terrorist1, the moment he satisfies the present condition any player can then look at the IED and it will explode
use the VIEW lod instead of fire, see if that makes any difference.
I'm using this as a test [objnull, "FIRE"] checkVisibility [eyePos Terrorist2, eyepos Terrorist1] >0.5 this work, as soon as the two terrorists face each other it explodes
"VIEW" allows them to see through walls which isn't wnat I want
@tough abyss cool I was looking at that but I'm really new to this so do you ahve any advice on how to apply it to my specific case?
@subtle ore using getPos seems to be the issue, I can't use eyepos on a prop tho
@tough abyss I think that worked! Man, after three hours of messing with this I think you might be my hero
thanks so much
god damn it no it's stopped working again
missionNamespace setVariable on the server doesn't go to the client. I thought missionNamesspace was global. What do I need to do to push the variables to the client?
missionNamespace setVariable [newVariableName,sourceVariableName];
publicVariable newVariableName;
ok
but publicVariable requires the string
of the name of the variable
this is where SQF is goofy as heck
@tulip cloud
missionNamespace setVariable [newVariableName,sourceVariableName,true]; //?
alternatively that
lol...I knew that...thanks I forgot about the optional element
iwantthisglobal = "my value";
publicvariable "iwantthisglobal"
as an inline alternative
yeah, I've read that multiple times and my mind is just jello and useless this weekend
Get some rest, unjello it ๐
second should too
Goofy question: is there the inverse to the EH "handleDamage" like perhaps "damageDone"
tldr: need to know what buildings players hit
@lean tiger do you need to know every building they might hit or specifc ones?
Don't think so.
Alternative:
HandleFired EH, lineIntersect where it watches, add a HandleDamage EH to that Object
@lean tiger
case "ARM_Quee":{
private _value = 8;
for "_x" from 0 to 7 do {
private _toAdd = (_value + (_value * _x));
// code
};
};
Why would atom's linter-sqf flag _value as being an unused variable?
Could be not trusting the for loop -- loads of editors throw warnings on conditional exection
@cosmic kettle is _value declared before the case?
@still forum lol I thought I was going nuts. All other cases are fine though, just this one specifically.
@jade abyss Yeah, but always private.
hm, strange.
I think it makes player characters more sturdy, maybe also vehicles, but I know no details.
I remember something about RHS and this setting having to be disabled or the tanks would never blow up or something like that.
What's up with Chuck Norris and Pepsi?
@lean tiger Yeah seems to be the case.
The nearestObjects array of "kinds"/"types" is of strings -- can it listen to an array of configFile entries?
I'm looking at that goober ๐
What I'm asking for clarification for, if anyone is familiar with it offhand...
Parameters:
types: Array - list of class name of the objects to search for.
Examples provided are only array of strings, can it take configFile notation as well, the way isKindOf can?
See Ex. 3
isKindOf returns if the object passed in parameter 1's "kind" matches parameter 2
alternatively, you can narrow it in scope to say "is it of this "kind", and also a member of this config tree"
Which is alt syntax 2
I'm asking if that alt syntax 2 is a [generic evaluation] that can be passed in the array of nearestObjects
or if nearestObjects just requires an array of strings describing the vehicleClass
I'll just have to take enough samples for the string array
but thanks for letting me bounce it off ya
Still no idea what's going on.
I was suffering for a way to bulk-reference "parents" for the array variant of nearestObjects
was hoping to just point to a configEntry, the way you can with isKindOf
You don't need the parents for nearestObjects.
You want all cars? neareatObjects ["Car"]
All tank? neareatObjects ["Tank"]
etc.
well, quick question up front -- what do you call those strings
isKindOf suggests they're the "kind"
Classnames.
Except that, in testing, I found isKindOf returns true as long as it matches any string found in the parents field of the splendid config viewer
Yes, isKindOf reports true for any parent class, which is by design.
Otherwise you could just do:
typeOf _vehicle == "B_MBT_01_F"
right, and just nearestobject that MBT
Yeah, that would report all the MBT's.
so, in short, I was looking for a way to pull all config parent entries down, to quickly dump as minimal a list of possible of all the types of objects I'm trying to pull with a huge radius nearestObjects
yeah, I couldn't find a list anywhere
and I'd like to keep it dynamic
and be able to verify membership of objects to those types in the case of outliers
and I found this
whew
You mean vehicle classes that don't appear in my list?
If you want every object regardless of class, why don't you just make the array of classnames empty.
Then it will list every near object.
because I don't want them all, I wanted all kinds, and be able to performance tweak my selection
all classes*
Car, Tank, Helicopter, Plane, CAManBase, StaticWeapon
Those are pretty much all.
Ship
I wanted to be exhaustive and exact
but like I said, found that function
๐
because, like I said, it's huge
100km radius -- and I've got it running under .1 seconds on stratis
You could just open the ingame config browser to look at all classes.
yeah, that's a real pain in my behind, was looking to be able to hideObjectGlobal my results, then see what remains
then cursorObject it
tl;dr: Capturing every damaged building:
how do you properly return a value from a function using exitWith?
returnedValue = [] call my_fnc_test;
fn_test.sqf
for "_i" from 0 to 10 do {
if(_i = 5) exitWith {_returnVal = _i};
};
_returnVal
returnedValue = any when I try this
do I need to put _i outside at the end of the fn_test.sqf?
define _returnVal before the for loop
that did the trick!
You needed to define _returnVal in the main scope of your script. i.e.:
private _returnVal = 0;
for "_i" from 0 to 10 do {
if (_i == 5) exitWith {_returnVal = _i};
};
_returnVal
Ah, damn discord not updating the chatlog.
Anyone know how to add "addon free arma radio" by armaphronk to an official zeus server?
@Quicksilver I had a mute 4x4 today on Dev
Yep, I_C_Offroad_02_unarmed_F and C_Offroad_02_unarmed_F don't have engine or driving sounds. Horn works though
Probably paste that in #arma3_feedback_tracker ?
Is there a performance difference between using nearestobject and radius then using an area trigger?
Those are two different things.
nearestObjects a dozen times every frame is ofc more expensive than a trigger checking once every few seconds
Strange data type: wtf is this - data of array elems, when array is extended.
_arr = [];
_arr set[4, "qqqq"];
systemChat str _arr;
_elem = _arr select 0;
systemChat format["Value type:%1, type of type:%2, val:%3", typeName _elem, typeName typeName _elem, _elem];
typeName is ?, typeName typeName is ? - how to deal with those?
typeName _elem is Nil or Nothing.
typeName typeName is typeName of string.. so.. String.
Ahhh
typeName nil might not work
because nil parameters sometimes just fail silently
but format["%1", _elem] gives "<null>" not "any"
There is a difference between Nil and Nothing
And there are actually two kinds of Nothing
One that is actually something and the other nothing is really nothing and often ends badly when it appears somewhere
how to check for <null> nothing? will isNil work?
should
is there a literal for <null>Nothing (as nil for any Nothing)?
Not all nils are created equal
no there isn't
also nil != nil.
A nil can have values like strings or numbers have.
That's why when you stringify a nil you sometimes get scalar or similear. That means a nil that was supposed to be a number
Don't actually know if any is nil... But if it is then that would mean a nil of unknown type
I think getVariable with a non-existent variable name returns a Nothing
I think scalar means that it is variable of Number type but it doesn't hold any value in it
Which is still nil
Number type itself can only contain numbers. And it can't contain no number
class nilType {
variableType type;
}
class numberType {
float value;
}
like that.
ow. my head hurts.
and i thought it was bad enough we had null and nil
like null and undefined in javascript
I mean nil is created off non-initialized Number type, as in expression supposed to return Number type but doesn't, so it makes nil of Number type.
format ["%1", ln var]
format ["%1", getPos var]
format ["%1", vehicle var]
I actually don't know if the engine automatically creates a nil with correct type or if the dev has to manually specify it... Theoretically the engine knows what type something returns.
If it's not automatic then we already know we can't trust it.. because BI..
I think each command has expected return type and if it fails, nil with such type is created
I'll look it up
Interesting, producing nils of try, if, etc return very close memory addresses
If the argument is nil then the function isn't even called and the return value is a Nil of the type of the return type of that function
nil can only stringify to scalar,bool,array,string,nothing
Else it returns the memory adress of that type.
And all types are in an array
So yeah.. It returns the memory address in that array. And as all.... 31? or 27 or smth like that types are in that one array it's close together
Yeah I guess its just an address in that array
format ["%1 %2 %3", vehicle var, if var, try var] => "0xdb06b8 0xdc5384 0xdc6910" (OA)
wait...
nil stores an array of types.
Because there are compound types
so the memory adress is actually that array inside the Nil object
not the global types array
class NilVariable{
VariableType types[<dynamic array>];
};
For compound types it returns all types in a string seperated by a whitespace
addMissionEventHandler for example returns nothing and scalar
so the nil should be "nothing scalar"
returns Nothing if ID doesn't exist.
And I'd say -1 doesn't exist
Where did you get addMissionEventHandler returning nothing and scalar? Thought it was supportInfo but it only shows argument types, not returned type.
ok
asin returns scalar_nan
Yeah just like ln in above example
Well, whatever the case checking if variable is nil by making a string out of it is a terrible idea
isNil{}
https://gist.github.com/dedmen/5fab3a2f98ca9dac5bb56aa661235749 Here is a list of every command that returns a compound type
So I think generally. If you pass a nil or nothing to a function it returns a nil.
If you pass a valid argument to a function and that function just returns nothing.. It returns a Nothing
and nil returns a Nothing I guess
Can those be checked?
There is also a Nothing type variable which isn't nil
Everything can be checked with isNil
Can it be checked if its nothing or if it's nil?
no
isEqualType with the nothing type variable maybe?
every variable is a "gamevalue". the gamevalue contains a pointer to the underlying data.
a Nil gamevalue points to a nil object that contains the type.
a nothing gamevalue contains a nullptr
isEqualType should be able to differentiate them.
as a nothing doesn't have a type at all
It does, there is nothing type and it is very much useless
But.. as commands you pass "nothing" to just return nil... isEqualType probably just returns nil if you pass nil or nothing to it
addMissionEventHandler ["Draw3D", {systemChat str [typeName _this, typeName objNull]}]
Draw3D has literal nothing type as _this for some reason
undefined variables are any right? Interesting..
Wasn't it that you can't actually delete variables from missionNamespace? just set them to nil?
So that way you could probably detect variables that have been set but "deleted"
test = getPos var; format ["%1 %2", test, getPos var]; => "any array"
same with namespace setVariable
So setting to any nil kind seem to actually delete it
player setVariable ["test", getPos var]; format ["%1 %2", player getVariable "test", getPos var] => "array array"
entity setVariable is different though
Maybe the = operator as a special check
that setVariable doesn't have
how about missionNamespace setVariable ["test"...
missionNamespace setVariable ["test", getPos var]; format ["%1 %2", test, getPos var] => "any array"
๐ค
Yeah looks like its OBJECT setVariable ARRAY that doesn't delete on nil
GROUP setVariable ARRAY too
How to discard any AI movements and put unit into READY state via API?
Problem is: the group is created with BIS_Fnc_spawnGroup and very shortly after it's teleported to the other place. between creation and setPos subordinates were moving to proper formation. After teleport they continue to move to formation position coordinates(which are from pre-teleport time). I need subordinates to just stop after teleportation and be ready for further orders
doStop maybe?
and very shortly after
Why not create them in the right place to begin with?
doStop
Order the given unit(s) to stop (without radio messages). The units stopped in this way will leave the groups formation. It will prevent them from moving around with their group (or formation leader), while still being able to turn around and even move to a new position if they see fit.
looks like new commands will be ignored
give them a new command to get into formation after that
@little eagle ,
Why not create them in the right place to begin with?
Group is created and then given to UPSMON control with "RANDOM" -> (teleport to rnd start position)
Anything you could command them to do might interfere with Upsmon, so you should ask the dev to solve this problem.
{
_x doMove getPosWorld _x;
} forEach units _group;
This should make them ready and not ignore orders like doStop.
Maybe leader should issue sort of regroup on squad level (which API command?)? Supposedly that should recalculate formation coordinates
doStop- ...The units stopped in this way will leave the groups formation. How put unit back to group's formation?
^^^ doFollow
But experimenting with it, units continued to move to pre-teleport positions
https://github.com/acemod/ACE3/blob/release/addons/medical/functions/fnc_showBloodEffect.sqf#L29
(count [ctrlNull,ctrlNull,ctrlNull] won't this be 3?
Yes.. But the code you linked isn't what you posted
controlNull, not "ctrlNull"
Yeah, but counting nulls works?
count doesn't count anything. Reports the array size. Index of the last element + 1.
Has nothing to do with null or even nil.
count [nil,nil,nil]; 3?
Where do you see that in the code?
I don't see it in code per say, but I'm updating my custom ace, and I'm going over changes and wondering why I did them
For some reason I changed that, maybe it was to fix the bug when bleeding would not cause bloody screen
Possibly pressing escape near the time bleeding starts
Would cause that
Uhm, why not create an issue report describing when a bug happens, and then a dev looks at it if he can reproduce it?
Im not entirely sure how to recreate it but I've heard other people complain about bleeding and not know about it too. I'm pretty sure I made a issue on github when I first found this.
Yeah, that's useless then. You're essentially trying to debug this without even knowing when something happens. No point in doing so.
Ask for better information.
Yeah, this is entriely on the assumption that it's a bug and that this fixed it. It might just be that I've not ran into the bug by luck since I "fixed" it
Any ideas on why my mission's cba_settings.sqf seems not to do anything? The values are editable in the editor and even if I don't do that, they are set to the defaults when I run the mission.
I have an idea. Try this:
- restart game
- start mission, get bloody
- return to main menu
- start a different mission, get bloddy
Did you use 3den to pack the mission to pbo, Caranfin? Or did you use a tool to add the file?
I packed the mission wiht 3den
The settings shouldn't be editable anymore under the mission tab if the file is there.
But they still are, right?
Hold on actually, the test mission I'm running atm isn't packed, I'm just running it from the source files in 3den
The thing is this. You need to load or save the mission once with 3den AFTER the file was added. This game crashes if a file is not present, and my workaround only works if you save or load it with the file there.
Do you need to have CBA loaded when you load/save the mission, then? It's not enough to just have the file in the source when you export the mission running the game with no mods?
Yes you do.
Ah, that explains a lot
I've been trying to use the cba_settings.sqf to get around mod dependencies while still having the mission configured in an optimal manner
Give me a minute and I can give you a script to set the needed flag without cba present when saving the mission.
That would be excellent, thanks
Ah, dang. You can't set 3den flags without the mod existing with script.
You'll have to edit the unbinarized mission.sqm ๐ฆ
Eh, that's not an issue unless those edits get overwritten when I try to open+export the mission in 3DEN
Try adding this entry to the description.ext:
cba_settings_hasSettingsFile = 1;
But don't if the file isn't there. The mission would crash on a dedicated server.
I'll try that, thanks
@little eagle damn:
13:14:28 Error in expression <mespace;
private _missionConfig = "";
if (getMissionConfigValue ["cba_settings>
13:14:28 Error position: <if (getMissionConfigValue ["cba_settings>
13:14:28 Error if: Type Number, expected Bool
13:14:28 File x\cba\addons\settings\initSettings.sqf, line 47
Damn it D:
๐
I like this solution though. Will definitely add this to the next version. Anyway, I'll give you the mission.sqm thingy in a minute.
Looking forward to it.
On a public server where people can bring any mod they want (and assume the server has no mods running) AI are killed by players, yet the server doesn't know the weapon/cartridge they use. Would it possible to tell the server to ignore any messages from a client regarding AI being damaged with modded weapons? ๐ค
TL:DR tell server to ignore any message that contain modded content
You can add handleDamage to the AI on serverside
Or Hit handlers
I think they get the projectile/weapon? Atleast you get the shooter and can check if the shooters weapon has a classname you know
class CustomAttributes
{
class Category0
{
name="Scenario";
class Attribute0
{
property="cba_settings_hasSettingsFile";
expression="false";
class Value
{
class data
{
class type
{
type[]=
{
"BOOL"
};
};
value=1;
};
};
};
nAttributes=1;
};
};
Don't get confused by the "false". This is right.
I hope you know how to edit this PoS.
If it's modded, would the weapon return an undefined, null or something that would give away its a modded weapon/projectile?
I know the RPT at least spits out errors on them
@little eagle yeah, I'll try that
I think it might still give you the weapon classname. Just check if CfgWeapons >> classname exists. If not then.. it's not vanilla
Alright will see if that works. Thanks!
If it doesn't, I can always say the mission needs CBA. Who even plays the game without it anyway
Or make a two versions of everything I guess but that's dull
Stupid game and it's stupid dependency handling.
Sadly none of this can be fixed by the community.
Yeah, most of the time it's pretty easy to just build stuff that autodetects supported mods and gives gear/crap as appropriate
But this issue has been annoying me for months
Who knew asking might help??
Developers can't fix something they don't know about.
Yep
The community can fix it... With a Mod ๐
What is the preferred way to delete array elements by condition while iterating?
Something like this?
{if(cond)then {_x="toDelete"};}count arr;
arr= arr -["toDelete"];
{
_array set [_forEachIndex, objNull];
} forEach _array;
_array = _array - [objNull];
Alternatively:
_array = _array select {
// do stuff
!conditionToRemove
};
Method without copying the array^^:
private _delete = [];
{
if (cond) then {
_delete pushBack _forEachIndex;
};
} forEach _array;
reverse _delete;
{
_array deleteAt _x;
} forEach _delete;
@little eagle Thnx, select example looks most elegant (and probably the best performance)
Yeah. Sometimes you need to modify the array without copy. Then you have to bite the bullet and use method C.
Is it possible to have debug console for dedicated server in telnet-like form? if at all
Yes. CBA has that. somewhat
CBA?! is that documented? My first thought was RCon
hi all,
I'm trying to use LineIntersectsObjs to return the closest object within 50m of a character's eyepos
not sure how to write the endPos in this case
as it's eyepos+50m
Originally I was using [IED1, "VIEW"] checkVisibility [eyepos Terrorist2, getPosASL IED1]>0.5 which almost does exactly what I want, however it comes as true even when Terrorist2 is looking in the opposite direction
and will not fire at all at values greater than 0.5 for reaasons I can't understand
CBA has watch fields for server and all other clients.
And can also exec code on server and get return value. All integrated into debug console.
@swift glen eyepos + eyeDir*50