#arma3_scripting
1 messages · Page 492 of 1
private _marker = createMarker ["Marker_" + str _blacklistCenter, _blacklistCenter];
_marker setMarkerShape "RECTANGLE";
_marker setMarkerSize [2000, 1000];
_marker setMarkerDir _dir;
_blacklist pushBack [_blacklistCenter, [2000, 1000, _dir, true]]; // Seems to be incorrect.
_blacklist pushBack _marker; // This works as expected.
_jetUnit = "B_Plane_Fighter_01_Stealth_F" createVehicleLocal [0,0,500];
_jetUnit setPosASL [0,0,500];
_jetUnit engineOn true;
[_jetUnit, _unitCaptureData] spawn BIS_fnc_unitPlay;
_jetUnit animate ["canopy_open", 1, true];
_jetUnit action ["LandGearUp", _jetUnit];```
hmm... the `animate` and `action` don't work. really making me think
oh, can i not animate the canopy (?)
_blacklist pushBack [_blacklistCenter, [2000, 1000, _dir, true]]; // Seems to be incorrect.
[center, [a, b, angle, rect, height]] < height it's a number not bool @dim token
@meager heart That's the rect value. Not providing a height.
oh crap... my bad.. 😃
epic meme
here
does adding a vehicleCrew to a locally-made unit change its locality??
Guys, what I'm trying to do is clear a cargo container or a jeep or anything
Just is that the script command doesn't seem to work
on a SP mission
brb
guys My friend said that for some reason the code is picky. We had to use global command like clearWeaponCargoGlobal. This seems to work. The other script command didn't work.
In case anyone was wondering, it's a bug in BIS_fnc_findSafePos where all blacklist array values that conform to the shape of arrays containing two arrays ([[], []]) are handled as top-left corner, bottom-right corner areas. I patched that function and it works as expected.
From my understanding, the trees from Tanoa are not available to spawn as simpleObjects. Are the tall trees on Altis available? I have gone through all of the plant objects but haven't found it.
Source for objects: https://community.bistudio.com/wiki/createSimpleObject/objects
why don't you try using the simple object command on the tanoa models?
@tough abyss I don't know what I mean with that. Did I write that?
https://community.bistudio.com/wiki?title=assignTeam&diff=107109&oldid=97108
From commy. I don't know his reasoning. Maybe because spawn executes later. Maybe some script that runs right after the init script would change the team back?
@drowsy axle is there a command to check what pbo's are loaded on a client no but multiple. Every pbo has to create a CfgPatches entry. So you could just iterate through it
@tough abyss , I would go as far as saying do not put it in init period, or even use in postInit only. Very correct that is. But teach that to people who don't know how to create a textfile in explorer, and who's only scripting related skill is copy-pasting stuff from forums into init boxes.
@still forum Is CfgPatches data automatically generated if the user has not packed a pbo with CfgPatches?
Okay, so no CfgPatches no load?
ye
looking for ideas to get height of tallest hill on map ( to set limit for ambient planes not hit any hill )
Hill's usually have a location marker on their top
https://community.bistudio.com/wiki/nearestLocations use that to find locations of type Hill (https://community.bistudio.com/wiki/Location#Location_Types)
And then just https://community.bistudio.com/wiki/locationPosition on each of them
locationPosition returns a position that is altitude zero ASL
ATLtoASL command
Is there a way to get a proxy position via scripting? I want to get the mount location of the side rail attachments (flashlight etc.)
Yes. But no.
https://community.bistudio.com/wiki/selectionPosition. But that only works when you can get the object. Which for a weapon, you cannot.
Is weapon actually a unit proxy?
@still forum _max = 0; { _dummy = createVehicle ["Land_VR_Shape_01_cube_1m_F", locationPosition _x, [], 0, "CAN_COLLIDE"]; _height = (getPosASL _dummy) select 2; if (_height > _max) then { _max = _height; }; } forEach nearestLocations [[worldSize / 2, worldsize / 2, 0], ["Hill", "Mount"], (worldSize / 2) * sqrt 2]; hint format ["max: %1", _max];
wtf?
why?
Why not just get the terrain height at that position?
Don't see why you need to spam create vehicles at every mountain
As I said. ATLToASL or just https://community.bistudio.com/wiki/getTerrainHeightASL
Ok, then how about getting the muzzle position for hand held weapons, is that possible?
Not sure. You can definitely get the hands tho.. Which is close-ish?
I need the muzzle, it will be easier to work my way toward the attachment position (I will use array for known weapons and a generic side position for everything else).
Been doing that a while ago: you need to do it by body/player model memory positions.. no other way around that
Greetings,
sombody an idea?
I want to set the ACE3 medic variable for a player within an loadoutscript and it must run on dedicatet server
normaly the funktion ist
player setVariable ["Ace_medical_medicClass", 1];
You can also try to set the unit trait for the class
player setUnitTrait ["Medic",true];
I am using displayAddEventHandler , how could I block it to run it once per key press? It repeats while key is pressed
@digital jacinth yeah thats works but only lokal with the loadoutscript, becuase the script only fired local but i figured it out now imm using:
[_unit, ["Ace_medical_medicClass",1]] remoteExec ["setVariable", 0, true];```
AFAIK it now works
you do not need to remote exec setVariable...
_unit setVariable["Ace_medical_medicClass",1, true]
that last true will broadcast it to every machine
ahhhh okay, i will give it a try thank u much
@still forum You mentioned a while back, tried searching for in discord, using search function, about ForEach and using an array sqf _objects = [ ["classname",[0,0,0]], ["classname",[0,0,0]] ];
How would I include both in the forEach?
is there anyway to adjust AI view range without editing CFGarray or using a knowsabout
I found it @dusk sage / @still forum . sqf CAP_units = [ ["O_Soldier_F", [0, 0, 0]], ["O_Soldier_F", [0, 0, 0]], ["O_Soldier_F", [0, 0, 0]], ["O_Soldier_F", [0, 0, 0]], ["O_Soldier_F", [0, 0, 0]], ["O_Soldier_F", [0, 0, 0]], ["O_Soldier_F", [0, 0, 0]], ["O_Soldier_F", [0, 0, 0]], ["O_Soldier_F", [0, 0, 0]], ["O_Soldier_F", [0, 0, 0]], ["O_Soldier_F", [0, 0, 0]] ]; { _x params ["_classname", "_position"]; _classname createVehicle _position; } forEach CAP_units;
👍
Doesn't have to be params
How else?
_x is an array
you can grab those values however you want
select, for example
params is the most elegant though, IMO
Depending if you want vars*, of course
e.g: ```sqf
{
(_x # 0) createVehicle (_x # 1)
} forEach CAP_units;
in a script is it possible to wait until a function is done to continue the script?
I thought if I used spawn I could but that doesn't seem to be the case
that's how call works...
but call doesn't work with functions that have sleep commands
also I need to use sleep in one of my functions because it doesn't wait until the function called before it is done
0 spawn {
call tag_fnc_kek;
call tag_fnc_lol;
hint "bla";
sleep 13;
call tag_fnc_topKek;
};
aka you can call and suspend in scheduled...
also if call was from scheduled, you can suspend inside of that call'ed function too
_handle = [var1, var2] spawn tag_fnc_function;
waitUntil {scriptDone _handle};
So why doesn't this work? Say 'tag_fnc_function' has a significant delay and sleep commands and I want to wait for it to be completed before continuing
I obviously don't understand very well lol
idk what's inside of that tag_fnc_function
https://community.bistudio.com/wiki/BIS_fnc_setPitchBank
It's the solution posted by ffur2007slx2_5 here
this seems to have about a 1 second delay
it's for setting the pitch/bank of an object that is attached to another object, and after that I delete the host object
but if I don't have a sleep command between those two, it doesn't work because of the delay
it's a workaround for relative rotation
It might be better to just redo the relative rotation function by finding a way to actually calculate it
how can i look up the Map image of te current map i am on?
like what is the config entry for it usually so i can get the image path?
Map image? You mean the preview image?
naw, like the map topography when you open your map
i want to put it on a screen with setobjecttexture
//--- loading screen background map
_image = getText (configFile >> "CfgWorlds" >> worldName >> "pictureMap");
//--- default overview picture
_image = getText (configFile >> "CfgWorlds" >> worldName >> "pictureShot");
worldName it's a command just no discord highlight @tame lion
pictureMap is probably the one you want to use
pictureShot is just the preview screenshot for stock terrains
neither have any topography info on them though
that's the only two in the world config...
That's fine. I was looking for something quick in a zeus op we were doing that would put the map screen on a display. I just didn't know the config entry
probably the easiest way is just your custom picture...
there is no config entry for that
and the sat image is split into a ton of small tiles
so yeah a custom picture is the best way to do it but that wouldn't work on the fly
e.g: ```sqf { (_x # 0) createVehicle (_x # 1) } forEach CAP_units; ``` 🤦♂️ The whole idea of adding # was that you didn't have to use brackets around it 😂
Hello, I'm trying to make a mission where in prison the players have to get to a guard house to open to doors. I'm going to be placing a monitor and add a code that unlock the door. Is it possible?
@still forum @meager heart Sorry to mention you, but is there anything better than nearest* commands to grab exactly map objects, since allMissionObjects is a self-explanatory. Trying to grab all gas stations on the map, but scrolling with nearest* with worldSize is a bit nasty way. Thanks.
i know only one way nearestTerrainObjects + Fuelstation 🤷
Damn, yes thats what I use.
This way seems to be caching some objects, since it drastically increase the memory pool, don't think that's good in any way.
maybe you can just get them in b4/"testing mission" and just use array with the positions, if that's for only one map 🤔
afaik altis life happens only on altis lol
hey guys
fixed*
Hi guys. Cant I use action to make AI perform an action added with addAction?
Yeah ok, then thats what Ill do 😁
can anybody explain the difference between the faction NATO vs. BLU_F ?
Isnt BLU_F like the parent of NATO ?
is it possible to disable lightpoints which come with a building? I am placing down solar towers and they have a few lightpoints which I do not want to show up.
I have key press eventhandler like this:
waituntil {!isnull (finddisplay 46)};
range=8000;
moduleName_keyDownEHId = (findDisplay 46) displayAddEventHandler ["KeyDown",
{
if(isNil "button_clicked") then {button_clicked = 0;};
if(inputAction "NextModeRightVehicleDisplay">0.5)then{
if(button_clicked==0)then{
hint "Click";
button_clicked = 1;
};
};
if(inputAction "NextModeRightVehicleDisplay"<0.5)then{
button_clicked = 0;
};
}];
It works however when I click other key, and after that the key it is suppose to trigger, it doesnt recognise it, the next click however recognises fine
What could be the issue?
@digital jacinth you could make your own house class that inherit from that class and remove class Reflectors
or just put an empty one in there
class Reflectors
{
};
Sadly I cannot introduce new mods, it is for a mission only
ok maybe spawning it as a simpleObject?
If I recall correctly, lights shouldnt work on simpleObjects
"Unsupported features include PhysX, damage, AI pathfinding (causes walking through walls), and built in lights."
so it should work
ah, that is good idea, right now i am placing them in the editor but plan on spawning them in at some point during the mission
@tough abyss Please stop teaching people lies.
A params is not a cpu waste if you would do more than 2 or 3 _this select's instead.
@nocturne basalt yes. There is a way to make AI execute actions. Atleast if you control them yourself via the command menu you can make them do it. I guess there should also be a way to script that.
yeah Im just making a function that I call instead of using the action command
@tough abyss Again. Stop spreading lies.
https://community.bistudio.com/wiki/Arma_3_Actions#User
Here @nocturne basalt
Don't think so. But please don't teach beginners stuff that isn't true.
infantry spawns in the air, when a UAV is spawned as part of the group before them, using Bis_fnc_spawngroup?
@tough abyss The whole reason I used # was so I didn't have to use select, nothing to do with parentheses. Just because it's not going to cause an issue, doesn't mean it should be less clear. The person didn't ask for nanosecond improvements
addition was never needed as select works, it is confusing, doesn’t cover all cases select covers and potentially can interfere with preprocessor. In other words there is NO REAL BENEFIT, unless you want to avoid parentheses, this is why this is fucking hilarious when someone adds them as well 😂
It's not our concern whether it was a benefit to add it to the game, that's not our choice. It exists, it works, it's shorter to write than select, and has the benefit of not having multiple overloads, it was just example code to someone who didn't seem to know another way. The only thing that is hilarious here is your objection to parentheses, take my sincerest apology that clear code upsets you
over select's only real benefit is precendence
I’d rather BI added something useful, something missing or something community was asking for 15 years
People wanted a way to select an element from an array without using select for awhile
Total waste of programmers time
without using select for awhile not really.
People wanted to be able to use [] for a while
which they didn't give us
because they can't
Indeed, but we got half way there
Do you also say that when you lost all your money in a 50-50 bet? Well. "I got half way there" ?
I'd be way happier if BI chose to not give us crap that's confusing and useless
Difference is, not losing anything by them adding commands, I'm happier to write something more succinct
CODE READABILITY NEEDS INTENSIFY
select is better than #
Also @tough abyss, would parentheses be acceptable in a case like this?
private _a = [5.5, 6.5];
ceil (_a # 0);
so if i understand right, any code in the init field of an object will be executed everytime a player connects. das that also happen if that object dead or deleted by the time new players connect?
because i have some objects on which i want to run some code from init, but only once. so what i could do is delete the original object during startup and replace it with a new one
basically createvehicle on original position, delete original object and run code on that object
i suppose another way would be adding them to an array through the init box, and then run code over that array.
what would be an elegant way?
hey guys. can somebody help me out with this? its displaying number: any
private["_player"];
_player = param[0];
_getNumber = _player setVariable ["currentNumber", 4];
_displayNumber = _player getVariable ["currentNumber"];
hint format["Number: %1",_displayNumber];
};```
I think you need to add the default return value
_displaynumber = _player getvariable [“currentnumber”,<somethinghere>];
Or not use array
Anyway.. This code doesn't even make sense
_getNumber = that makes no sense. setVariable always returns nil.
getNumber = {
params ["_player"];
_player setVariable ["currentNumber", 4];
hint format["Number: %1", 4];
};
And that code also won't work. as getNumber is a command. You cannot assign a function to it
Have no idea what you're trying to do
I think its just supposed to return that number. Setvariable shouldnt even be in there anywhere
If so then it would be
LJ_fnc_getNumber = {
params ["_player"];
private _currentNumber = _player getVariable "currentNumber";
hint format["Number: %1", _currentNumber];
};
i suppose... or private _currentNumber = _player getVariable [currentNumber,<somethinghere> ]; for the default return value
the friggen spawngroup function gives me headache. no that i use groups with multiple vehcles they collide all the time
to i really have to go back to a script that makes sure that all individual units spwan the way they should?
also i would rather not have UAVs as group leaders.
Thank you @still forum
Wow! This is even worse than I thought 🤭 Thank you @dusk sage for bringing this up. So arr = [{}]; 123 call arr # 0; //— fine call arr # 0; //— error you need parentheses in second case! So really # allows to type 5 chars less, but comes with a bunch of potential problems. Was this needed? Nope. Basically the usage of it comes down to... “just because you can doesn’t mean you should”
yes. Because unary is always higher precendence than binary
When a programmer was choosing precedence for # he thought to himself, this is boring , how can I make it more exciting? Well I suppose I can give it higher precedence than binary but lower than unary... 🤔
At least this is also consistently inconsistent
player addEventHandler ["HandleDamage", {0}]; // works and player takes no damage
player addEventHandler ["HandleDamage", {
params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
if (vehicle _unit != _unit) then {systemChat "damage reduced"; _damage = 0;};
}]; //unrealiable, its fires but player still takes damage and dies
Is there something I forget about this event handle?
You should read on how HandleDamage EH works
I did
The code block is not returning _damage
If you did what is returned in second case?
_damage is supouse to be returning
And you re returning an assignment
assignments don't return anything. Not even nil. The only real language bug
So easy to fix actually.
Which doesn’t even represent nil
Also HandleDamage fires for each damaged selection and then some
You need PhD in Arma if you want to override it, and I am not joking
player addEventHandler ["HandleDamage", {
params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
if (vehicle _unit != _unit) then {systemChat "damage reduced"; 0};
}];
Forcing to return 0 then it works, though I always think that _damage was returning in the end of the event handler
Cancelling damage like this will reset the whole damage. So if you had legitimate damage accumulated after you return 0 your old damage is reset
I doubt this it what you want
PhD
I said it, you need it
I was thinking about doing some math to reduce damage but never mind that.
Just was thinking about code optimization advice: Removing items: myArray set [1, objNull]; myArray - [objNull] has been replaced by deleteAt and deleteRange
But that might be misleading, since deleteAt and deleteRange requires index(es).
What if I want to remove anything that is objNull in that array?
It's suggesting that the two step process has been replaced
then that code is still the best I'd say
You need the index for step one still
Noob scripter here. Can i execute scripts by pressing certain keys? (for example i click H and enemies spawn)
Thanks!
Those “has been replaced” statements are not just misleading, in many cases are plain wrong. Nothing is replaced, new commands added that provided improved functionality. Improved != replaced
is it possible to search contents within nested arrays?
I'm getting a weird issue where 2 of my files are coming up as not found. I know the files exist, and they are in the pbo. I have even tried renaming the files and every occurrence of them being used, but they still say not found. The files are being compiled using PREP with CBA XEH preStart and preInit. The addon is setup similar to the ACE project template.
Anyone know what might be going on? It only happens when -filePatching is used
PBO unpackers also unpack these files? And you double checked file paths and stuff?
And with -filePatching the files are also where they should be?
is there some way to check if location is village ?
get the position. And run https://community.bistudio.com/wiki/nearestLocation with village filter and check if it returns the same
^ NameVillage < village 👌
How can i find out which of my scrips draw most on my performance? Something seems draining
Seems to be taking quite a while to spawn in units. I assume those spawns are on some scheduler, and that schedule is maybe crowded
there is little icon for performance in debug console
ok that throws me out a function as result
that would be the worst performing one or what_
or most called?
what do you mean "draining" ?
scripts executing slow. or low fps?
no. The profiling button in debug console tells you how long your script takes to execute
hi guys. Id like to spawn a bomb and cause it to blow up.
this is not working:
"Bo_GBU12_LGB" createVehicle (position _v);
guessing its because bomms are not in cfgvehicles
Can someone tell me how I should do this?
@nocturne basalt create bomb with createVehicle then delete it with deleteVehicle _object;
hmm but nothing happens when I run "Bo_GBU12_LGB" createVehicle (position _v);
well i run a regular respawn that spawns between 3 and 6 groups. takes up to 15 seconds per group to spwan. sometmes i see the thrid spawn only finishing after 70 seconds
had one of those rounds taking 2 minutes for 6 groups to show up
I tried adding it in the init script of a unit
I've used createVehicle many times
i mean, i call the spawns one by one, so they come up after each other beacuse i dont want them parallel. but this doesnt seem normal
so im thinking some functions result in delays
i use a debug timer now to measuer when spawns start or end
so are you spawning bombs too?
Im trying to spawn something thats inside cfgAmmo
so right now it shows me: spawned 6 groups in total in 49.803 seconds
that seems reasonable
?
all I want is to spawn something that blows up instantly
Im making a suicide bomber
when the man is close enough to an enemy
@nocturne basalt "Bo_GBU12_LGB" createVehicle (position _v); that "_v" is local variable if you are putting that code into init of unit. Try to replace it with "this". "Bo_GBU12_LGB" createVehicle (position this);
`
ok ty Ill try
but bombs should explode when spawned like this right? or do the need to be dropped from a vehicle?
you are creating "explosion" object
yea
you can one use these: "Bo_GBU12_LGB_MI10", "Bo_GBU12_LGB", "Bo_Mk82", "HelicopterExploSmall", "M_Mo_82mm_AT_LG", "HelicopterExploBig", "M_Air_AA_MI02"
now i am at spawned 6 groups in total in 102.361 s
that does not seem nowmal. time doubled
or 2 groups in 80 seconds... getting worse...
i mean some of them are larger groups, but this seems too much
creating units is very slow. yes.
But you are usually not spawning a unit every couple frames or so
Is it possible to get the laser pos memory point position on the player's current weapon?
its on a side attachment proxy (usually)
@thorn saffron You can get a mempoint of what is an object, but you can't distinct weapon as an object, neither its attachments, so they are just models.
The only way to tracer your lasersight is to manually deal with the offset from player hands as selection.
and that does not work all that well
Can't we even get the weapon muzzle position?
Weapon muzzle, in short is a weapon meta, since weapon is not an object, it doesn't have any position or whatever.
No its not that much time critical. Its spawns based on proximity to an area
But 2 minutes is a lot
I want to avoid them popping up in cleared areas
You asked the same thing on Friday and got answers by 2 people that it's not possible like that.
Oh
That's not gonna change
Might not have seen those
Not you. Unless you asked the same thing yesterday?
Well i did ask about speeding up spawns before
And i might have overlooked answers
Varies a bit. I take the time on start of function, and return after the spawn command
Unit numbers vary, between 3 and 8. Sometimes with vehicles
@thorn saffron Tbh, you can just easily build a laser sight path with vectors, starting ray position, end position, using such things like vectorAdd will make an actual ray.
And i have a function in there for finding safe positions to spawn. Not sure exactly how long that one takes. But thats once per batch of units
So essentially i return time at start of script, difference to every spawn, and end of script
you cannot profile scheduled code while it's running in scheduled
How long your script takes to execute in scheduled. Depends on all other scripts that are running in scheduled
@proven crystal scheduled code is not accurate on time or order, so time is irrelevant there and will be based on your VM load.
But if i return the time difference from start of script to the time after i call a function?
Shouldnt it return that difference?
scheduled scripts can pause any time. For a arbitrary long time
The thing is that if you schedule a 250 units of code the order of execution might be 1,3,5,249,250,15,12 etc.
your 2 line scheduled script. Might take hours to complete
Your Sleep 0.1 might sleep for days.
Try to avoid scheduled code as much as you can, especially if you wish to get some actual profiling results.
So rather not use functions if i can avoid it?
I don't see what that has to do with functions at all
@unborn ether The problem is the starting position. Using the hands as a base does not give me the best position as weapons can have the laser module in all kinds of places. Also the hand moves around and that in turn moves around the laser a bit.
@thorn saffron There is a thing that will help you much with that weaponDirection currentWeapon player
So if you have starting point as vector, which are hands, and you have an actual vector of weapon direction - small maths with adding them together = +- accurate lasersight tracing.
yea so i mean if i use spawn it will run the function in unscheduled environment right?
ill then have an issue with return values, but i guess i could work around that
but i thought its better to have them done one after the other, to not overload things
have i achieved the opposite?
it will run the function in unscheduled environment right no. exactly opposite
ah damn so how do i get a piece of code running in unscheduled environment, calling it from a scheduled one?
@proven crystal It depends on your execution way, so if you have a function in your CfgFunctions executed via preInit flag - it will be unscheduled, if postInit - scheduled. Default init scripts (https://community.bistudio.com/wiki/Initialization_Order) have their own behavior. There are also exceptions to this, for example, any event handler added in scheduled environment has its own environment which is always unscheduled. blah, blah.
So if you want all of your initialization chain to run unscheduled, use preInit flag for your function called myInit.sqf or something.
i just want those spawns to happen much faster
says something there that triggers would run in their own unscheduled environment?
maybe i could go that route
If you want spawn to happen "faster" you need to decrease your VM load.
"says something there that triggers would run in their own unscheduled environment" no
trigger condition might run in unscheduled
as I said. You can use isNil to run code in unscheduled
Or use Event Handlers, once again, totally depends on your purpose.
any event handler added in scheduled environment has its own environment which is always unscheduled What do you mean by "it's own environment" ?
every scriptVM has it's own "environment" scheduled or unscheduled
Just to clarify that added event handler code has unscheduled environment, no matter in which environment it was added, in short.
I'd recommend to read the wiki page about the scheduler
the isnil thing looks like an option now... ill give that a try
Hello, wondering if anyone can help me.
One of my friends has created/finished off Chernarus 2035. (it's an incomplete map, missing objects.)
He has placed all the CUP buildings and trees (He's created a mission without trees as it brings the editor to around 20 FPS when looking at all these trees)
I want to be able to (in the mission.) grab all the following information, I've already come up with a solution: ```sqf
init.sqf
_objects = [];
for [{i=0}, {!isNil (object + str _i)}, {_i = _i + 1}] do {
str = object+_i;
_objects pushBack _str;
hint str _str;
};;
{
[_x] execVM 'fn_getStuff.sqf';
} forEach _objects; sqf
fn_getStuff.sqf:
// [_thing] execVM 'fn_getStuff.sqf';
params = ["_thing"];
_direction = getDir _thing;
_position = getPos _thing;
_classname = typeOf _thing;
_var = _thing;
_STR = [_classname,_position,_direction,_var] joinString " ";
diag_log str _STR;``` If you have any suggestions. It would be great!
Your _objects is an array of strings, how exactly you take getDir or getPos of a string?
Following a helicopter insertion video, have got this: vehicle this land 'land'; if (isServer) then {BW_HelicopterGo = false; pulbicVariable 'BW_HelicopterGo';}; in the activation field of the last waypoint, exactly as its put in the video too, but its returning an error when i click Ok
any ideas?
States that the error is Missing ;
pulbicVariable?
Overlooked it like 7 times
hi all, im trying to force players to walk when they enter briefing area via trigger in act .. sqf if (_unit in playableUnits) then {player forceWalk true;};, but this does not do the trick.
Find it very immersion breaking when player run in briefing area, any suggestions to make this work?
https://community.bistudio.com/wiki/inArea you could use that and have a predefined area
inArea via named marker?
yep
inareaarray returns you an array with all units in it, in case you have use for that
if (player in playableUnits) then {player forceWalk true;};``` so this rather
{
if (isPlayer _x) then {_x forceWalk true;};
} forEach inAreaArray "marker";
oo ok
ill give it a go
with marker name
yup
I don't know if I'm using the right syntax
thanks @still forum stuff now pops up almost instantly
{if (isPlayer _x) then {_x forceWalk true}};forEach inAreaArray "marker";``` syntax fixed...testing now
so just add allPlayers and it should work
{_x forceWalk true} forEach (allPlayers select {_x inArea location_1});
@proven crystal ok trying that one
For whatever reasons I cannot get my helicopter to follow its waypoints through an addAction. It has a Trigger synced to the first move waypoint with the condition BW_HelicopterGo; the Helicopters init reads: this addAction ["Training Flight", {BW_HelicopterGo = true; publicVariable "BW_HelicopterGo";}]; and the last waypoint (before the cycle waypoint) is vehicle this land 'land'; if (isServer) then {BW_HelicopterGo = false; publicVariable 'BW_HelicopterGo';}; Any Ideas?
Tried it with a few different types of Helicopter and none of them work either
Is this incorrect? _var = call compile _varSTR;
I have had this script working before, and its exactly the same in the video im following so im not quite sure
i get generic error with this one ...
{_x forceWalk true} forEach (allPlayers select {_x inAreaArray brief});```
brief needs to be a string I believe
still learning proper syntax...please eloborate
{_x forceWalk true} forEach (allPlayers inAreaArray brief);
or this {_x forceWalk true} forEach (allPlayers select {_x inArea brief});
What is brief btw?
marker
briefing area
im activating this via trigger set to repeat and player detected
Put brief in "" then.
ok testing ... sqf {_x forceWalk true} forEach (allPlayers select {_x inArea "brief"});
@copper raven ok this works but now i can ONLY walk 😃 sqf {_x forceWalk true} forEach (allPlayers select {_x inArea "brief"});How would i disable this when player exit trigger 🤔
How do you have your trigger setup?
🤔
seems it activates but nothing is telling it to stop force walk
exactly, you dont tell it to stop
maybe a while loop in there or so
TANK run!!!....I CANT
{_x forceWalk true} forEach (allPlayers select {_x inArea "brief"}); for 5 seconds repaeted every 5 sec while in trigger???
so while player is in area, sleep a few seconds. once that condition is false, set speed back normal
while (_x inArea "brief) do {sleep 5;};
trigger timers will only effect activation ... not deacativation
{_x forceWalk true; while (_x inArea "brief) do {sleep 5;};_x forceWalk false;} forEach (allPlayers select {_x inArea "brief"});
{_x forceWalk true} forEach (allPlayers select ({_x inArea "brief"} do {sleep 5;});```???
does not look correct 🤔
While = Repeats Code while condition is true
but would that disable the code once activated and revert player to normal state
In condition, player inArea "brief",on activation, player forceWalk true;, and on deactivation player forceWalk false;. If I'm not misunderstanding how triggers work, that should work. 🤔 And make sure that your trigger is not Server Only.
{
_x forceWalk true;
while (_x inArea "brief") do {sleep 5;};
_x forceWalk false;
} forEach (allPlayers select {_x inArea "brief"});
ok ill try both and give some feedback 👌
switches to slow, waits while pkayer still in area, and when that condition is false, leaves the while loop and finally turns speed back normal
@copper raven @proven crystal Hells yeah guys working like a charm, thanks so much ...
https://cdn.discordapp.com/attachments/499525081773637755/501088842732797952/Capture.JPG
🍻 🍻 🍻 all round
Your first setup didn't make sense. You ran trigger on each machine, and foreachd through all players. Your current setup will fix locality all together, forceWalk args also must be local.
welcome to the rabbithole
oo im well and true lost in this here rabbithole :)...thx again
Is this incorrect? _var = call compile _varSTR; 🤮 Why not _var = missionNamespace getVariable _varSTR; instead?
Why have trigger monitoring marker if one can put trigger over marker area and monitor player in that trigger 🤔
Yeah, that works too i guess. I'm just not into triggers so much xD
is there a way to see the full version of an error message displayed in game?
it cuts off in the .rpt at the same place
{
create3DENEntity ["Object", "BTHBC_A3EM_LongDistanceSphere", _x select 0, true];
} forEach _posArray;
returns:
Error in expression <
{
create3DENEntity ["Object", "BTHBC_A3EM_>
Error position: <create3DENEntity ["Object", "BTHBC_A3EM_>
Error Type Number, expected Array
despite the code working exactly as expected
_posArray is formatted like this: _posArray = [[[0,0,0]], [[0,0,0]], etc];
it creates the entities at the proper positions
create3DENEntity has a return value. Sometimes Arma doesn't like it if you don't safe that return value so just try private _IdontCare = create3DENEntity [...]
that's what I had originally
I removed it for testing
it used to be _entity = create3DENEntity ["Object", "BTHBC_A3EM_LongDistanceSphere", _x select 0, true];
private too
Error in expression <
{
private _entity = create3DENEntity ["Object", "BTHBC_A3EM_>
Error position: <create3DENEntity ["Object", "BTHBC_A3EM_>
Error Type Number, expected Array
everything works as expected and the syntax is correct so I don't know what the issue is
I figured it out
I had _posArray = [_originalPosition]; where I initially defined the array
_posArray = [[_originalPosition]];
it should have been that
not sure how I missed that lol
^^
not sure how I missed that lol which place is that on the Sentences Devs say most often List?
I even copied the array to clipboard to see if any positions were wrong and still missed it lol
Does anyone know a way to add a weapon with attachments to a backpack. I know there is setUnitLoadout, but I can't get it working without modifying the rest of the loadout. It always reapplies everything (so the vest, uniform, weapon, etc.) even when passing nil as arguments for everything except the backpack. I just want to modify the backpack.
I don't think you can
configs for soldiers and containers use weapons that have custom class configs
so there are classes that have different varieties of attachments
Yeah I know 😄
but it works with setUnitLoadout so there is a little bit of hope in me left ^^
or someway to prevent setUnitLoadout from touching the vest / uniform
You can't prevent setUnitLoadout from applying the uniform/vest, but you can manipulate the load out data so the new uniform/vest exactly matches the old one.
yeah setUnitLoadout even does this for you. It reapplies the same loadout as before when you pass nil instead of a array/string for the specific loadout component
but the reapplying causes if I have modified the players vestContainer
like attaching something to it or changing the texture or even just setVariable or something
because it wont reapply those modifications
I have two dialogs loginDialog and registerDialog. Both of them have a Unload event handler. The problem is that my loginDialog Unload handler is stacking. The odd thing for me is that I am actually closing it with closeDialog. Doesn't this release the event handler in this case? See some snippets for reproduction.
When pressing the Register button in my loginDialog the following code executes:
closeDialog 1; // closing the login dialog
[] spawn X11_fnc_registerDialog;
Now when within the registerDialog I press ESC right away to close the the dialog.
That invokes the Unload event handler of registerDialog:
[] spawn X11_fnc_loginDialog; // to recreate the login Dialog
On every call of X11_fnc_loginDialog the Unload event handler is set. Unfortunately this stacks the more often I press ESCAPE in the registerDialog.
My intention was that when I call closeDialog 1 the dialog is destroyed and therefore it's eventHandler...
But since the DisplayControl has an ID I kinda think the event is bound to the id regardless of the display being created or destroyed eh?
@tender root If you're applying customizations to the vest, why not put a variable on the player storing the details of the customization at the time it's applied? You can read it later and to recreate the customizations immediately after setUnitLoadout.
@delicate totem I don’t apply customizations. It just that I’m concerned to use setUnitLoadout when it’s behaving like this, of this, because I want to ensure compability with as many mods as possible 😅
I have no idea what you're trying to accomplish so I'll shut up now. 👍
@drowsy axle https://discordapp.com/channels/105462288051380224/105462984087728128/501076126714822681
I could swear I already told you a dozen times or more.. getVariable
missionNamespace getVariable _varSTR;
@tender root https://discordapp.com/channels/105462288051380224/105462984087728128/501107203973840912 No.
@runic surge https://community.bistudio.com/wiki/create3DENEntity
https://discordapp.com/channels/105462288051380224/105462984087728128/501106594302656527 Position is an array.
Why do you try to double array your pos? why not just put it in directly. And just use _x ?
Did you try diag_log'ing stuff to see that you get what you think you get?
@tender root "Does anyone know a way to add a weapon with attachments to a backpack" I made a script command for that. But BI didn't want it.
You can spawn a AI. Add the weapon to the AI. And let the AI drop it into your backpack.
https://discordapp.com/channels/105462288051380224/105462984087728128/501117828188078091 just store these modifications manually then
Basically Im trying to add a weapon with attachments to a players backpack, but I don’t want to break anything other mods/scripts are doing in terms of customizing the vest or the uniform.
Okay I found my mistake - my code is kinda calling the logic twice!
@frigid raven Unfortunately this stacks the more often I press ESCAPE in the registerDialog. Just set a variable onto your dialog. To mark when the EH is already set
Why don’t you delete your post then?
@still forum Like I said storing modifications is not really an option. Im just anxious about compatibility not saving my own modifications.
The AI idea is kind of crazy, but I'll give it a try
@still forum
the double array is just what the function I use to get the list returns for some reason, not sure why
The AI idea is the only possible way currently
I think there is a second element returned for an optional input
@still forum gotcha ...Arma scripting commands letting me down time after time
Can someone point me to the place where I can learn to put code into an addon that it would normally be put in a mission?
I would start with this
Basically everything you normally would put into the description.ext goes in the config.cpp
That’s the basic tldr 😅
What would be the init.sqf so to speak?
But won't be much use for you unless you secretly work for BI
@still forum unfortunately I don’t 😅
replacement config stuff doesn't really have much to do with putting scripts into a mod pbo.
@drowsy axle there is no init.sqf in mods
How does stuff happen then?
You have CfgFunctions preInit/postInit. But all the mission event scripts don't work in non-missions
Happens about twice per day. Nothing special 😄
Basically, battleye is being a pain, and won't display a message when x minutes to restart.
Why will a mod help with that?
I need to be able to run a script that would print out a message at the certain time (server local time)
I've notivced that it's hard or not easy to find a servertime function that gets the time of the server.
With „time of the Server“ you mean what exactly?
And.. How do you think would a mod help with that?
I don't see what that has to do with pushing stuff into a mod
We are not taking about ingame time do we?
a mod would help, so that no matter the mission, a message will popup
Ah yeah. You want a serverside mod then. With CfgFunctions and with a preInit function
Right
I didn't mean client side mod.
How would I be able to get the local time of the server?
class CfgFunctions
{
class ServerMod
{
class main
{
class postInit
{
postInit = 1;
file = "ServerMod\server_init.sqf";
};
};
};
};```
"real_date" callExtension ""; Let's say I wanted to use this.
Would I just have a .dll on the server? and have a file called: server_init.sqf inside @ServerMod/addons/server_init.sqf.
@ServerMod/addons/server_init.sqf no. A pbo
ServerMod.pbo
And you also need the CfgPatches entry in the config.cpp in your pbo
The Mod Folders are basically irrelevant the only thing that matters to Arma are the pbos itself
And i don’t know of your path in the cfgFunction will work or if you need a backslash in the beginning
Never sure about paths in Arma 😅
How do I get signatures? wait i won't need it as it's on the server.
Yeah you probably won’t need one
But just fyi you can create keys with the Arma tools
neither
Just read what I wrote https://discordapp.com/channels/105462288051380224/105462984087728128/501132884611039232
And your question will answer itself
But won't be much use for you unless you secretly work for BI you think this will somehow change things?
Please put the cfgPatches in the beginning 😅
And it still has to be packed into a pbo
I know thanks
But the rest looks fine 😅
initServer.sqf:
[] spawn {
while {true} do {
sleep 7200;
hint "Server-side Script is working!!";
};
};```
Sleep won’t work because the script is called not spawned
So just enclose it in [] spawn {} if you’re lazy 😅
I did 😃 ^
And you won’t see the hint because it just has a local affect
??
Also that script is postInit
Oh right yeah
Delay mission start?
postInit is scheduled yes
but all other postInit scripts and the loading screen will wait for you to finish
also known as endless loadingscreen bug
Ahh okay
if (time == 7200) then {
diag_log "Server-side Script is working!!";
};
``` What about this?
You still won’t get a hint on the client 😅
Changed
👌
But I need player to see the message? Maybe: ```sqf
systemChat "Server-side Script is working!!";
Never used that before.
"Server-side Script is working!!" remoteExec ["systemChat" -2];```??
[“Server side script is working”] remoteExec [“systemchat”, -2];
I don’t know what’s the default value for the target
So yours could be correct as well
Writing code on a mobile phone sucks 😂
lol
Also I assume if (time == 7200) then { is a joke?
@still forum the missing comma?
Fixed it 😅Like I said. Writing code on a mobile 😅
it's not anymore
if (time == 7200) then {
"Server will restart in 10 minutes!" remoteExec ["systemChat"];
};```
@still forum Sure but don't you have to be incredible lucky for the time to be exact 7200?
Fair point
I'm assuming that the mission has been ran for 3 hours. Which is the normal case
oh lol
yeah missed that
it's not in a while loop?
how do you expect that to work then?
The server restarts every 3 hours and 10 minutes
The time won't be 7200 right at mission start.
Time might go from say, 7199.94 to 7200.09 in a frame?
Why don't you just keep the Sleep?
Why do you all of the sudden want to change that perfectly working code? to something that won't work.
😂
[] spawn {
while {true} do {
if (time >= 7200) then {
"Server will restart in 10 minutes!" remoteExec ["systemChat" -2];
};
};
};```
Now you just spamming the network for 10 minutes straight after two hours
Yep
ExitWith?
Change the then to a exitWith
Somehow my math was off: sqf [] spawn { while {true} do { if (time >= 10800) then { "Server will restart in 10 minutes!" remoteExec ["systemChat" -2]; }; }; };
😂
add exitWith + server restart code
I guess it’s just a warning not intended to really restart the server
Now you constantly check a condition which will only be true every 3 hours and then only for a couple minutes
Again. Why did you remove the sleep and try to do that instead?
I could do....
^ Sleeeeepppp...
ExecVM sqf sleep 10800; "Server will restart in 10 minutes!" remoteExec ["systemChat", -2];
or use a waituntill.
[] spawn {
while {true} do {
sleep 10800;
"Server will restart in 10 minutes!" remoteExec ["systemChat" -2];
};
};```
How accurate is the suspension time?
Midnight is asking the real question here
suspension?
Sleep <-
If it needs to be "somewhat" accurate I would use something like: waitUntil {sleep 1; time > 10800}.
we were in the middle of a fob hunt and the server goes down. from my guys.
That's really no different though flash.
sleep accuracy matches time accuracy combined with the general scheduler accuracy
Basically want to give them a warning
so.. You'll be between 0 second and a couple hours accurate
Good luck @drowsy axle with your script. I’m gonna head of to bed 😊
Thank you
uh. Doesn't time degrade in accuracy? 0-0
Ouch.
But. The scheduler accuracy is the same for a waitUntil with Sleep 1. Or a while true that constantly checks a condition without any sleep
Yes. But the error in accuracy from a range from 0 to 10800 should be almost unnoticable.
so sleep is the most accurate?
Okay
you don't need to be accurate to the second anyway
obvs I don;t want to spam: Server will restart in 10 minutes! Server will restart in 10 minutes! Server will restart in 10 minutes! Server will restart in 10 minutes! Server will restart in 10 minutes! Server will restart in 10 minutes! Server will restart in 10 minutes!
So anything is good I guess
ServerMod\servermod\initServer.sqf or ServerMod\initServer.sqf PATH: @ServerMod/addons/servermod/initServer.sqf
lol ded
pboname\filenameinsidepbo
ServerMod.pbo and initServer.sqf inside it
->
ServerMod\initServer.sqf
Is there a way to trigger a script when weapon is changed?
hello fellow arma´ed people.anyone a quick alternative for an eventhandler?i have one that is overriding a default file of a mod but this will cause trouble so i need an alternative
How it is overriding? Maybe just another eventhandler?
i made a vehicle locking plugin that has an eventhandler for checking if a vehicle is locked and closing the inventory dialog.the same eventhandler minus my edits ( which work) is running inside of a mod which has an override function.so i am basically executing the default code plus mine and the building system of the same mod says NO.
so i need a workaround
inventoryOpened EH
@neon snow do you have CBA?
yep
CBA_fnc_addPlayerEventhandler has a WeaponChanged EH
use inventoryOpened @sturdy cape just close the dialog one or two frames later
Thank you Dedmen 😃
the problem is a closedialog wont work for some reason and the file does a breakout
no,no.i wanted to say i use InventoryOpened @still forum
Why not create a trigger and set timeout on it for activation
i am german,we have to be more careful regarding the language barrier then everyone else 😉
Dedmen just said nijet to all language barriers long time ago... 😃
so no problema 👌
ne panimaju
see ^
LMAO
How could I check if missioneventhandler with particular name exists?
explain "exist"?
Is added with addMissionEventHandler
🤔
I checked with nil but it dropped me error I think
Dedmen, I am not sure if I understand you correctly, I have a missioneventHandler with ID "JHMCS", how could I check if it is bigger than 1? sorry if stupid question
private _id = addMissionEventHandler ["", {}];
missionNamespace setVariable ["tag_myEH", _id];
```🤔
wat
no you don't
mission eventhandler ID's are numbers
What you are saying doesn't make sense
JHMCS = addmissioneventhandler ["Draw3d",
{ };
so variable
oh
^ imo ez way 🤔
thank you so much 😃
What path would I use in cfgFunctions folder search if I had a addon structure of:
P:\@clientlogger\addons\functions ?
pboprefix.txt:
logger\functions
no dice
Warning: rapWarning: **********missing file(s)***************
Warning: \@clientlogger\addons\functions\config.cpp Line 21: logger\functions
rapWarning: **********missing file(s)***************
fn_logClientState.sqf :scanning
pboprefix.txt :configuring
</end entries>
Missing File Summary
config.cpp : logger\functions
pboProject output
just functions folder ?
yup
🤔
I'm not sure what you're asking
P:\@clientlogger\addons\logger_functions <- Source directory being packed.
Contains:
config.cpp,
pboprefix.txt,
functions (folder),
inside functions contains fn_logClientState.sqf
in config.cpp:
class CfgPatches
{
class clientLogger_functions
{
name = "Client Logger - Functions";
author = "Midnight";
url = "";
requiredVersion = 1.80;
requiredAddons[] = { };
units[] = { };
weapons[] = { };
};
};
class CfgFunctions
{
class logger
{
class logger_general
{
file = "logger\general";
class logCLientState{preStart=1;};
};
};
};
@high marsh didn't we just talk about how folder structure works?
pboname\filenameinsidepbo
unless you have pboprefix
in that case
pboprefix\filenameinsidepbo
also your pdrive layout is wrong
the files are supposed to be P:\<pboprefix>\fileinsidepbo
so P:\logger\function..
also config.cpp Line 21: logger\functions not found, but you set functions folder as > file = "logger\general"; 🤔
@meager heart I mistook the log file for another
thank you both for the feedback
if we talked about this before i don't remember
Talked about this with capwell just a few hours ago
_zoneDelete = player addEventHandler ["Killed", {
params ["_unit", "_killer", "_instigator", "_useEffects"];
// what should go here?
}];```
Trying to use the killed event handler to delete a local marker using deleteMarkerLocal for the player who was killed. How would I go about putting that into the event handlers command parameter?
how do I make players spawn with a specific custom loadout/respawn with them in multiplayer
I don't want to re-invent a wheel so asking here. Does someone have function to draw a line via markers on map? Define startPos and endPos and it will create rectangle marker between those 2 positions on map facing direction of those 2 positions.
you can try this https://community.bistudio.com/wiki/drawPolygon
and/or https://community.bistudio.com/wiki/drawRectangle
also you can just create "rectangle" marker and orient it
@finite jackal Dont understandthe question. You already know that you want to put https://community.bistudio.com/wiki/deleteMarkerLocal into there
@thorn saffron well see the kk's comment https://community.bistudio.com/wiki/enableEnvironment
no_animals_Init_Var = what use does that thing have?
it's useless
also your XEH is wrong
you need a subclass for your addon
By telling him why his code doesn't work and how to fix it?
okey.
Cool.
Oh also @thorn saffron you need to call your event init inside your subclass. Like on the ACE one I linked
What spectrum?
{
class no_animals
{
requiredAddons[] = {"CBA_Extended_EventHandlers"};
units[] = {};
weapons[] = {};
requiredVersion = 0.1;
version = 1;
};
};
class Extended_PostInit_EventHandlers
{
class no_animals
{
clientInit = "call compile preprocessFileLineNumbers '\no_animals\init.sqf'";
};
};```
better?
Yep. Don't see anything wrong
If it's just one line of code you could also place it cirectly in the config
rK helped me, no more worries!
You can create custom loadout config in mission config and setUnitLoadout it in respawn EH. And use forceRespawn command to make respawn EH trigger on join as well @glad edge
That is exactly what I'm trying to do, if only I understood it. Haha
In main menu? I think its done via scenes
ok cheers
Main menu is just like mission
really ? you can custom it then ?
there is files being loaded in the main menu then ?
@fossil yew @compact maple https://community.bistudio.com/wiki/Arma_3_Main_Menu#Configuration
_fnc_SetVariables =
{
_posN = _pos;
_numRow = _cnt;
_numCol = _numRow;
_cntRow = 0;
_cntCol = _cntRow;
_offset = [0,0,0];
};
call _fnc_SetVariables;
I use this function to reset these variables after a specific task is done so it they can be used in similar tasks.
Should I use the private command inside the function or outside, or at all?
I use the private command for all of my variables including these ones but I figured I could simply have them be defined in the function and call the function instead of having them defined in two separate places right next to each other where they aren't necessary
@runic surge Honestly I didn't get the reason of that, since:
private _var = 0;
diag_log _var; // 0
private _DT_fnc_yourFunction = {
private _var = 1;
diag_log _var; // 1
};
call _DT_fnc_yourFunction;
diag_log _var; // 0
oh
of course
should have been obvious lmao
actually those variable ARE used outside of the function
it only exists to reset them, so I don't need to private them inside the function
Underscored vars are destroyed at the end of the scope they were defined in, so manually resetting them doesn’t make much sense tbh
I am resetting them within the same scope
I need to use the variables for several different tasks but they are changed within some of those tasks
Pretty sure you are, otherwise it would make even less sense if you were resetting them outside of their scope
If you don’t want variables with the same name to be affected in nested scopes, use private keyword in nested scopes
Or do not assign to them
I have 4 different tasks that need those variables in their original state
each task modifies them during their calculation
Instead of resetting them at the end of each task, or having 4 different sets of variables that are identical, or redefining them as private variables, it would be more efficient to just use a single function so I have a 'universal' set of values
at least that's my logic
No idea, but sounds convoluted, maybe you need to rethink the design
each task is only slightly different than the other, with the exception of one, so I feel keeping each individual task as simple as possible would keep things simple
also each task depends on the previous being completed before it
there is probably a better way but I couldn't think of one
I see GVAR in ACE3 and ALiVE but did not yet figured out what it is? Is it a convention for a specific macro best practise?
Does it stand for GENERATE VARIABLES?
Because the macro kinda has some array logic
GVAR -> Global variable
modname_modulename_varname
GVAR(blood) in medical module -> ace_medical_blood
is it possible to call an inline function defined in one sqf in another sqf?
what do you mean by inline? If you assign it to global var you can.
even local you should be able to in say your init.sqf
How could I get angle difference between forward look and freelook?
Thanks 😃
Also, is there any eventhandler to handle event of weapon switching in a vehicle?
Not in vanilla
Tried the CBA and no luck aswell
Does anyone know of a way to check the animation source for the AFM wheel brakes?
@gilded garden you mean heli animationSourcePhase "wheel" ?
I want to find a way to animate an object based on the RTD Wheelbrakes On/OFF
Ahh
Yeah, its a bit harder than i though it would be too 😛
Does this work? https://community.bistudio.com/wiki/setBrakesRTD
Any idea why this code:
_vector1=eyedirection player;
_vector2=vectorDirVisual vehicle player;
acos(_vector2 vectorCos _vector1)
returns wrong angles? When I look up at approx 80 deg it shows 40
And maximum seems to be 59.999
I doubt you could look up 80 degrees
I did, in cockpit with edited ViewPilot
Maybe you need camera direction not eyedirection
@tough abyss thanks ill have a look at that
acos (getCameraViewDirection player vectorDotProduct vectorDirVisual vehicle player)
acos (getCameraViewDirection player vectorCos vectorDirVisual vehicle player)
``` @neon snow
also vectorDirVisual < direction vector in world space
@thorn saffron if the variable of the function is visible. Sure.
Is it possible to get the position of all simple objects that I have spawned? I am trying to randomly spawn trees that aren't too close to each other.
I'm trying to get the position of other trees that I've spawned (example: createSimpleObject ["a3\plants_f\Tree\t_FraxinusAV2s_F.p3d", _pos])
thank you! I was messing with "nearestObjects" and "nearestTerrainObjects" and was coming up short
seriously, 60mins of debugging
working on distribution algorithms for scenery
Hey, is anyone able to help me with controlling respawn loadouts? I want to setup custom ones but I cannot even seem to control the loadout on respawn using existing ones from a .ext. Currently testing this using the example code from the arma 3 respawn wiki page. Always respawns me with the character that was selected, rather than the specified kit. (Which I want a custom loadout ultimately) Help greatly appreciated! Please note I am a very inexperienced coder. :/
When are you applying the initial loadout after mission start?
one way of doing it is to exec this AFTER you applied the loadout on mission load
myLoadout = getUnitLoadout player;
player addEventhandler ["Respawn", {player setUnitLoadout myLoadout}];
Id like to try and save some data for players. I hear i could do that with profilenamespace?
Any tips on that?
Also could i store some data on the server that way?
@proven crystal ```sqf
// write to profile
profileNamespace setVariable ["variable",/some data/];
saveProfileNamespace;
// load from profile
profileNamespace getVariable ["variable",/default data/];
// delete from profile
profileNamespace setVariable ["variable",nil];
saveProfileNamespace;
profile is good for save player settings, but for more data - need use inidbi or extDB3
@tough abyss hm... but variable not contain anything
extDB3 pretty good
For players id probably like to save last position and loadout or so
On the server side i have some objects which all have several variables.
Would like to store the state of those vars on the server
In terms of volume, this would probably amount to roughly 300 objects with mabe 10 variables each. Most just numbers or true/false state, one is an array with several unittypes. Dont know if that counts as a lot of data
@proven crystal you can save last position and loadout on profilenamespace. But players can back up position, or loadout and connect to server all the time with saved position.
Yes.
if you want to prevent cheating then you are bound to safe these things on server only
@tough abyss setting the var to nil doesnt actually delete the var still shows up in (allvariables profilenamespace)
Don't you find it kinda weird that literally every reply that I give to your statements is telling you that you are wrong?
@tough abyss First of all "" is not a nil, nil is nothing, nothing cant be something. If you are getting it with default value of "" or even nil itself, it doesn't mean it's existing:
profileNamespace getVariable ['variable',nil]; // if nil - doesnt exist
profileNamespace getVariable ['variable',""]; // if "" - doesnt exist
So I don't know how can you dump nothing literallly.
i wouldnt be worried about cheatin. it would be for the purpose of a unit to save the state of the map at mission end
i dont think people would mess around with it
so but generally in terms of overall volume, am i hitting the limits of what shouldbe done with profilenamespace?
i.e. should i figure out to use iniDB or whatever?
i wouldnt be worried about cheatin
if you plan on playing this on a public server, then you should. If you are just playing it within your gorup then you can scold the person cheating.
As a dev for a monolithic application, never trust the client
There are not that much of exploits novadays, most of them are probably private and expensive, but to start with... If you are worried about your server security you have CfgRemoteExec + CfgDisabledCommands and whole bunch of BE filters like script.txt to close the plain execution of some code, that doesn't belong to your framework. In other plans, you should be wise when you script something and just not let people do something that shouldn't happen. Some commands like remoteExecutedOwner for example, will prevent sending code back to substituted destination. I'm still seeing some frameworks allowing client to RE spawn|call straight to a server which is total bs. Anyways, at the end of the day, people who knows SQF close to perfect will still be able to use your framework security against itself, this just gives more errors rate. and more time to accomplish. Arma was never 100% secure.
I am not worried about cheating. Closed server. And even if someone were to cheat it wouldnt be much concern right now
My only concern would be data volume for the server parts.
No idea for how much this option could/should be used for
i have searched the web extensively and been testing for weeks now. There is threads and answers, but they no longer work. Just trying to get a paradrop to work. I use unAssignVehicle, moveOut and even leaveVehicle + [_x] ordergetin false . It all works, the chopper spits out the units, they parachute to the ground and while airborne they return their chute as their assigned vehicle. However, as soon as the units hit the ground, they get re-assigned to the helicopter w3hich makes it land and wait for the units to re-board. Even if I execute unAssignVehicle on these paratroopers again, i can see the debug return them as unassigned for one second, before being reassigned to the heli. I can not interrupt this process. Any ideas?
are they in the same group as the helicopter?
if so, try creating a separate group for the jumpers
how can i find out if 2 areamarkers overlap?
i could probably create a few kind of sensor spots around the edges, but is there a better way? cant seem to find a command or function for it
i tried every scenario, some work but what does not work is getting an AI controlled to stay out of the chopper they paradropped from. Or, keeping the piolot from assigning them again, I don't really understand who's responsible
do you run vcom and do they have a waypoint far away?
is possible to prevent drop item to weaponHolder? I tryed use onPutItem eventhandler, but weaponholder is already created.
@dusky pier Weapon holder is created at the stage of opening a gear display, not putting an item.
So the only way is to block gear dialog with InventoryOpened
Which is... ridiculous.. obviosly.
@unborn ether thank you! I tryed find source of gear dialog scripts, find that: addons\ui_f\scripts\handleGear.sqf. But i think something wrong.
InventoryOpened is Event Handler.
`text`
@unborn ether i know 😄 that works fine.
I was mostly wondering how do you escape the markdown tile escape
@dusky pier there is no source for gear dialog scripts. As the scripts don't exist
@olive gull Please reserve whatever brain cells you have left for intelligent questions. Thanks
I have two Killed Event Handler. One on every CAManBase and one on my player. When my player dies - both are called. How can I prevent the CAManBase Handler to bubble up?
I tried a lot of this return true stuff, but somehow I fail
@frigid raven Uhhhh....what? can you just post your code and tell us your problem? Bubbling up? Return true stuff?
set a variable onto the object. If variable is already set, the other handler already ran
k will do then - thought would be too hacky somehow
Don't see why you need a second handler on your player
your player is CAManBase too
Could just check if object is the player in your CAManBase handler
I know but somehow things do not work
Like I grenaded myself out of the world beneath a neutral faction guy
in the handler logic isPlayer _unit was in both calls false
because my player respawned too fast
I assume
is there something like... wasPlayer 😄
isPlayer is not the same as object==player
I am on the server side tho
Gonna check these ones anotehr time - I fixed it and put the problem to sleep now
devs gonna dev
vehicles select {_x isKindOf 'air'}; // yields: [B Alpha 3-5:1 REMOTE,testair,B Alpha 3-4:1 REMOTE]
{driver _x setVariable ["VCM_Disable",true];} forEach (vehicles select {_x isKindOf 'air'};
driver testair getVariable "VCM_Disable"; // nothing
Can anybody explain what I am missing?
missing )
hate my life
Question regarding creating custom ui dialogs. I've built a dialog but under seemingly random circumstances, the dialog will crash the game for users. I can't figure out what is causing the issue cause in my own testing everything works fine. It's also not asst specific times either when it happens for them; sometimes it's when making a selection in a list box, sometimes hitting a button, sometimes when just opening
Ate there unwritten engine limitations for ui dialogs?
Without seeing the code it is anyone’s guess
Hey is there anyway to capture what the player said in chat and turn it into a string?
Yes, disable chat and make your own, this way you are in control
With remoteExec you can make chat BI could not have dreamed of
i can't wait until we switch to a real OOL with arma 4
Hey is there anyway to capture what the player said in chat and turn it into a string?
0 spawn {
waitUntil {!isNull findDisplay 24};
findDisplay 24 displayCtrl 101 ctrlAddEventHandler ["KeyDown", {
params ["_control"];
hintSilent str [
ctrlText (findDisplay 63 displayCtrl 101),
ctrlText _control
];
}];
};
```into debug console ^ @tawdry harness 😃
also there was KK's "who's talking" thingy
@tough abyss Where they confirms that? Dont think so
BI confirms SQS/SQF will be used in a potential future arma title Do you have any official quote to substantiate your claim?
I didn't see it in the last spotrep atleast. So far the only thing that BI said about a future Arma title was it being Enfusion engine. But after that they denied they had any plans for a future Arma title yet everywhere.
So it seems really weird to have them say that Fookin SQS will be included in a thing that's not even planned yet
@tawdry harness CBA also has a eventhandler for chat messages I think. If you are using CBA that might be easier
cba_events_chatMessageSent iirc 🤔
i personally would be perfectly fine with it (sqf-vm for the win!)
though ... reworking SQS/SQF into something more ... "robust" could be needed
something that actually implements stuff like if etc. as actual language elements
the language actually would be perfect for putting A FUCKING LOT into actual language keywords instead of all being some weirdo operators
--> more assembly instructions that actually handle everything + some very simple optimization
hah
haha
HAHAHAHAHAHHAA
no
i remind you of famous stuff like: domination, insurgency or whatever other popular A2 mission/mod comes to your mind
all broken beyond repair
when "ported" to A3
Still at least i wouldnt have to start from scratch
why does it matter if you have to start from scratch? Should we really limit ourselves because someone doesn't want to have to restart?
Lol
the logic is so flawed quick
I do not want to be limited in creative ability because someone else decided they just wouldn't be damned to take the time to remake their old crap
AI is a fundamental part of the game, visuals have been cut. None of this adds up.
Saying no one uses AI because you see a handful of people aren't, is a stupid generalization.
Server browser tells you nothing, you're closed minded if you think this is a determination of tendencies in the community
There is no hidden majority, AI is used in I&A as a main premise of the gamemode!
If each AI lover in arma could kick you in the balls if AI were removed, you'd have no balls!
Why do you think that's so Quik? Because kids and manchildren love instant gratification
It isn't a reflection of the arma community as a whole
and it's extremely dull to be making blanket statements like this
You remind me of someone starting off for the first time
they look at the browser and assume this is what the community is
Did you even read my comment on I&A? HAM?
For fks sake man, you take no credit for making teamwork against ai playable
So what? Why the hell would we just drop AI because you don't think there isn't enough players?
How many do you need? 1,000? 2,000? 1,000,000?
is there a way to add Faces to custom virtual arsenal ?
@high marsh can you elaborate more how?
@real tartan CfgIdentifes in mission config may be picked up in VA, I doubt it though. Otherwise, it may just have to be in player faces or in config
@subtle ore I am asking in general, that includes mainly A3 default faces. is there a way to select those in arsenal that is custom made ( that means that I add weapons, magazines manually with BIS_fnc_addVirtualItemCargo etc )
unless addVirtualItemCargo does the trick, then I doubt it.
the "unlocked" initialization of the arsenal function may give information
as it does index all the faces in a3
hmm, they remove ctrlDisplay for those sections 😦 if arsenal is not full
{
_tab = _x;
{
_ctrl = _display displayctrl (_tab + _x);
_ctrl ctrlshow false;
_ctrl ctrlenable false;
_ctrl ctrlremovealleventhandlers "buttonclick";
_ctrl ctrlremovealleventhandlers "mousezchanged";
_ctrl ctrlremovealleventhandlers "lbselchanged";
_ctrl ctrlremovealleventhandlers "lbdblclick";
_ctrl ctrlsetposition [0,0,0,0];
_ctrl ctrlcommit 0;
} foreach [IDC_RSCDISPLAYARSENAL_TAB,IDC_RSCDISPLAYARSENAL_ICON,IDC_RSCDISPLAYARSENAL_ICONBACKGROUND];
} foreach [
IDC_RSCDISPLAYARSENAL_TAB_FACE,
IDC_RSCDISPLAYARSENAL_TAB_VOICE,
IDC_RSCDISPLAYARSENAL_TAB_INSIGNIA
];
Nobody uses the AI because they suck
The AI don't suck?
Not really, they're pretty above industry standard in many ways
Laugh all you want, because it's popular to shit on the AI. But I can find satisfaction in utilizing AI in the way I like to use them
Just because you don't think [they suck] doesn't mean it is so
It's more about lack of utilization
and to say we should remove AI from the game is completely regressive.
a lot is to be said about how far AI has come in arma, and how well it works if used properly. A lot of people miss out on the chances to use AI properly in their game modes.
Can you provide an example of a mission with properly used AI that doesn't show it's obvious defects?
@mortal wigeon they are literally better then pretty much All other AI in games... Name one where the AI works better, promise ya that is just due to a 100% scripted scene
@earnest ore H&I ?? HAM??
guess you cannot name such a thing @mortal wigeon 🤷
ArmA AI is far from being human like
but there is none human-like AI in any bloody game
Hearts and minds and what sorry?
🍿
@earnest ore Invade and Annex, you know this guy Quiksilver? He made it all work seamlessly. Go play on a server and tell me you anticipated AI being where they were and that they don't function effectively or overly effectively. It's so perfectly blended, and it's great on performance as long as server owners don't bloat it with extra crap
Oh, i'm familiar with that one - unfortunately through strayagaming. If i remember it correctly, they implemented something in their mission that wouldn't allow you to use the esc menu on death, thus you'd have to quit via task manager / pkill.
Why in the flying fuck that is allowed at all is beyond me.
It's just a loophole. Same goes for editing profile data. But this has nothing to do with AI. It kind of pisses me off that we've gotten to the point where the majority of players would rather complain than make the most of what they have.
To the Arma 4 SQF conversation.
Yeah it would be truely awesome if people would port their completely fucked up crap scripts to A4 without having to change or improve a single thing.
Makes me kinda happy thinking that people cannot just copy-paste some 10 year old OFP bullshit that they found on some forums into their great mission framework
You don't even have to look that far back
I was trying to see where you were coming from by what missions you've been playing. Our group uses Zues controlled missions exclusively with and without AI modifications. Handling these monsters to do the deed correctly against human players has been a real pain in the ass for us more than half the time - things ranging from garrisoned units shooting through doors and walls, units not using their arsenal (grenades), suicidal tendencies, zues being unable to force units to retreat as a group or as individuals, air units... let's not talk about air units.
About the only thing i've seen them do well at is suppression.
Which is about good enough to make the game enjoyable.
I am all for a clean break if we get a programming model that is faster and has more scope, it must contain a model for multithreading which both justifies the change and provides us with a lot more performance in the future.
"i want magic that works" ? @tough abyss
more scope
multithreading wich both justifies the change and more performance
wut?
multithreading in game-engines would be a "nice to have" feature in theory but practically, it will lock objects, update stuff on them and unlock afterwards
if the update process takes too long or too many are done, rendering will be halted and micro-fps-lags will occur
Still waiting to see official source for this insane claim @tough abyss
I really don't understand why people just improve and enjoy the current platform
because SQF is a pretty bad language and has a lot of quirks about it that you don't see in other programming languages
like how you dedicate one function per file
that is pretty much BS darling
you do not need to
unless you want to use CfgFunctions
SomeFunc = { ... };
OtherFunc = { ... };```is perfectly valid
yikes
fixing that for ya too:
// In CfgFunctions this file is put as TAG_fnc_PreInit with PreInit = true
SomeFunc = { ... };
OtherFunc = { ... };```
interesting
single file, multi ops
either way
i don't like it
also the way SQF does local and global variables really makes me hmm
thats just a " _ "
SQF is perfectly fine, just your expectations are false due to the language not behaving like "you would expect" as all who say that are literally expecting a C-Like lang
though .. SQF is slow AF
which is indeed something that could be improved upon
@tough abyss why do local and global vars make you "hmm"
arma4 👀
as all who say that are literally expecting a C-Like lang
please god give us a C-like language
