@drowsy axle event handlers are things that allow you to automatically run scripts on an event https://community.bistudio.com/wiki/Arma_3:_Event_Handlers It can be useful for resctricting items, check for unallowed items when a players takes something, restrict vehicles, dismount player if they don't have perms for that vehicle, or things like tasers, run a damage handler script to see if it is the taser weapon and ammo.
#arma3_scripting
1 messages ยท Page 448 of 1
Okay, thank you. @glad venture
@glad venture To rename existing item name, you need to change displayName entry of its class. I don't think its the best way of doing it, it's better to just inherit it to a new class and change it there. Kinda, create a new one instead. You can try to destruct existing class with delete but I would never do that, behaviour unexpected.
From TacOps DLC there came new objects. One of them is a grey Personal locker can be used as a inventory filled object. Is there any way to declare each Locker to a special player in MP? For example there are 4 lockers all filled with equipment for a special class (SQL, FTL, etc) I want that only a SQL get access to a SQL locker. How can I realise it?
My brain is melting, been looking at this for too long. Anyone wanna give me a hand with ctrl EH's?
display_Options = (findDisplay 46) createDisplay "RscDisplayEmpty";
CTRL_FPPLock = display_Options ctrlCreate ["RscCheckbox", 7147];
CTRL_FPPLock ctrlSetPosition [0.402031 * safezoneW + safezoneX, 0.313 * safezoneH + safezoneY , 0.0154688 * safezoneW, 0.022 * safezoneH];
CTRL_FPPLock ctrladdEventHandler ["onCheckedChanged", {
If (!FPPLocked) then {
FPPLocked = true;
} else {
FPPLocked = false;
};
If (FPPLocked) then {
EH_FPPLocked = player addEventHandler ["Respawn", {
[] spawn {
while {(true)} do
{
if (cameraView == "External") then
{
if ((vehicle player) == player) then
{
player switchCamera "Internal";
};
};
};
};
}];
};
}];
Need the [] spawn {....}; code to run after a checkbox is clicked. the normal ctrlChecked and cbChecked only return false, no matter what, seem to have done this for a while.
If you do spot anything, PM me, going to sleep on it.
@ruby turtle do you mean ammoboxes
I just mean the tall lockers I can spawn. They have an door animation and you can fill them with items
@ruby turtle Easiest way would probably be a combination of set/getVar and an InventoryOpened EVH. Prohibit access if var on container doesn't match class
I think reading #arma3_scripting might give me brain damage
@ruby turtle you could probably turn it into a virtual ammobox, allow certain items and set class restrictions
lol
Okey and maybe easier can I display a special Text in the face of a player when he is watching to the locker? So they see its only for SQL. I dont like virtual arsenal for MP Missions
what is SQL, are you talking about the database or is it a class of soldier?
you could add an event handler to the container for on container open and if the player's class doesn't equal required class then close the inventory
oh
Its a 60 clients coop event. I have to safe much performance as possible so I need a solution without any big scripts they are running in backround maxbe display name should be better?
are you going to go by config type/slot like rifleman slot, squad lead slot etc?
Hoq do you mean that?
so, you know how there are the different type of men you can place in editor, are you using that as to determine roles or a script?
I just name the roles for lobby and creating loadouts trough ACE Arsenal and the loadouts are integrated in the mission sqm.
So the first one :)
@brave jungle
FPPLocked = !FPPLocked;
instead of
If (!FPPLocked) then {
FPPLocked = true;
} else {
FPPLocked = false;
};
will make your eyes feel easier, same for anything like that.
https://community.bistudio.com/wiki/User_Interface_Event_Handlers
read the warning on that page
@ruby turtle I think I got it, you'll have to put this in the lockers init and the second part in a separate function: this addEventHandler ["ContainerOpened", {[["Medic",_unit],"mission_fnc_checkLocker",true] call BIS_fnc_MP;}];
//checkLocker
params["_type","_unit"];
if(player isEqualTo _unit) then {
switch (_type) do {
case "Medic" : {
isRight = getNumber ( configFile >> "CfgVehicles" >> typeOf _unit >> "attendant" ) isEqualTo 1;
if(!isRight) then {closeDialog 2;};
};
};
};
Like I said, head hurts, I'll add to the file to check over tomorrow, thanks :D
Have to check this tomorrow , but when I have 12 dfferent roles, I have to create 12 new cases right?
well, you only have to create for as many unique classes of lockers, if you are going to only have locker for like 2 classes you only need 2
Ao can you give me please a example with two cases? Its really late in germany and I don't be able to understand the syntax ๐
jesus christ....
Shalom
case "Engineer" : {
isRight = getNumber ( configFile >> "CfgVehicles" >> typeOf _unit >> "engineer" ) isEqualTo 1;
if(!isRight) then {closeDialog 2;};
Ah just see it now, thank you swatguy ๐
does anyone what the default handleDamage function for ACE3 advanced medical system is? I'm trying to overwrite it so that it only injures a unit if certain conditions are met.
@ruby turtle Fill with with addWeaponCargo instead of addWeaponGlobal. That way people will only see the items that were locally added.
If someone puts items into it everyone can see it. But items that you added via that script cannot be seen by others.
@brave jungle
If (!FPPLocked) then {
FPPLocked = true;
} else {
FPPLocked = false;
};
uh.. how about
FPPLocked = !FPPLocked;
You are using ctrlChecked/cbChecked inside the onCheckedChanged Eventhandler? That's kinda dumb...
https://community.bistudio.com/wiki/User_Interface_Event_Handlers
The checked state is already in _this. Just take it out of there.
@glad venture "default" ? I can tell you what the handle damage function is. But I don't know what you mean by "default".
https://github.com/acemod/ACE3/blob/master/addons/medical/functions/fnc_handleDamage.sqf There
this shit has been pissing me off
anytime a client is passing player through a re to another player, and then that player tries to re back to them with the param its giving an error
@still forum i had used cbChecked outside of an eh. I got values but they returned false no matter what. Saw online they were broken but an eh would work. Got a return with a hint but it doesn't seem to fire with code in it, unless I removed something by accident.
@tough abyss I think you are missing a ]
You are stringifying a object. And expecting that to turn into an object when you just call it
that just doesn't work at all.
Any here ran into a way to script it, so you can use Gauges from advanced flight model, while still on standard flight model?
Id say you cant. I would think those gauges use the advanced flight model sources for their values and standard fligtmode just wont output those
unless of couse you just use the graphics
and make your own logic behind it
Okay, a guy in my community, thinks he have been able to do it in one of those Dayz wannabe mods online. But he of course cant remember which ๐
hes the one who needs to prove it ยฏ_(ใ)_/ยฏ
@tough abyss would https://community.bistudio.com/wiki/remoteExecutedOwner help you ?
then you wouldnt need to pass the player through
Yeah, just hoped some really smart people in here could be my saviour, as he is "special" ๐
@still forum I am using ace advanced medical and removed the default damage event handler and put mine in instead. I am trying to do make a taser script that does no damage if it is a taser, but does the default ACE function if it isn't. Do you know if I have to use fnc handle damage advanced or just fnc handle damage?
if it is a taser
that explains a lot
taser is my keyword to leave this conversation as quickly as possible
https://community.bistudio.com/wiki/assignItem That says If the slot is occupied by another item, it gets replaced. Does that mean old is deleted and new is put into it's place.
Or does that mean they are swapped and old one goes into inventory?
question then... Goes it into inventory before the new item is taken out of inventory?
I'm thinking if it's safe to swap a item of same mass from inventory to radio slot.
Currently I check canAdd. Then unassign old, assign new, if canAdd previously failed then addItem old again.
0 idea on that
Better don't touch it then. It kinda works right now.
i'd assume it unassigns the item first
unless old item == new item
Is "EachFrame" Mission Event Handler better then while {true} and should I use it and only it?
It's a completely different thing. You should use it if you really need it. And not use it if you don't need it.
onEachFrame can be used for UI stuff,
while { true } is... risky? depends on what you want to do.
advantage: while { sleep 0.01; true } is possible
Hmm... I am trying to get away from my loops in a more elegant manner, cause they seem to impact server FPS.
onEachFrame is far worse than a bad while/true loop. A while{true} loop can't crush FPS. the onEachFrame definetly will when done incorrectly
you should use eventhandlers where possible. (besides EachFrame)
I thought the minimum you can suspend is 0.05 which essentially turns out to be no suspension?
It will still suspend till the next scheduler frame that executes the script
I think only things like sleep 0 or something really extremely small might just skip the sleep
Okey. Checked it.
Sleep always suspends if the sleeptime is not over when the sleep instruction is reached.
sleep add's a new sleep instruction to the code.
After the call to sleep is done it executes that instruction. If that took long enough that your delay is already over (should be less than a microsecond) then it won't suspend. Otherwise it always suspends
And as soon as a script suspends. It might be gone for half an hour
Okay, lol
Hello, there is a problem. I change the position of the object in height, it is necessary to smoothly lift the object from the ground, I use the cycle for "_i" from 0 to 100 step 1 do {_obj setPosASL [(getPosASL _obj) select 0,(getPosASL _obj) select 1,(getPosASL _obj) select 2 + 0.015];
but the object instead of rising from the ground - slides down the slope
can you try this? parenthesis included
for "_i" from 0 to 100 step 1 do
{
private _newPos = getPosASL _obj;
_newPos set [2, (_newPos select 2) + 0.015];
_obj setPosASL _newPos;
};
also, don't forget to sleep in your for loop
ok, funny - tried ATL?
yes
trying on my side
btw step 1 < is default
...as expected, it works (in VR)
@verbal otter have you tried enableSimulation false?
In vr? ๐ค
no, but get it working
problem was in changing position all time
i take coords in variable before cicle, and then use x and y from variable
_z = _posCHD select 2;
for "_i" from 0 to 100 step 1 do {
sleep 0.3;
_z = _z + 0.015;
_posCHD set [2,_z];
_obj SetPosASL _posCHD;
};```
so it works? good
@winter rose (only in vr) :p
We are all just virtual! Nothing is real!
We're in the matrix
But the blue pill only takes us to the next level of simulation
So our reality endlessly simulates itself
I doubted for a moment that my sqf-fu was off
Never wiki man, you know all
command-wise, I still discover a forgotten one here and there :D
Cfg* is not my usual environment though
disagrees
@verbal otter Altis is cursed
/*
_z = _posCHD select 2;
for "_i" from 0 to 100 step 1 do {
sleep 0.3;
_z = _z + 0.015;
_posCHD set [2,_z];
_obj SetPosASL _posCHD;
};
*/
for "_i" from 0 to 100 do {
_obj setPosASL AGLToASL (_obj modelToWorld [0,0,0.015]);
};
๐ค
modelToWorldWorld and get rid of AGLToASL
modelToWorldWorld ๐
running joke, but modelToWorldWorldAGLtoASLWorldASLStoATLATLReal
xD
@meager heart ty, is working
Not sure if this is the right section, but, is "script injecting" still a thing? If it is, how would I protect variables that i've assigned to players from being changed/edited? ARMA 3
compileFinal ?
you could check if the variable is still what you think it should be.
That could protect variables that are only set once. And also only if you run battleye
you mean by passing it through the server first and checking to see if it has been tampered with?
"Script injecting" i think was more popular and easier to do in early arma 2 than it is now. Not sure though. Yeah, essentially making sure it's within reasonable value limits. Or checking if damage is disabled for example
Or if your variable is static, then i guess you can use compileFinal to prevent it from being written over
Dedmen probably has a better explanation though
Generally though without Battleye you can't do anything to protect against it.
And with Battleye you also can't do anything against the real hackers.
I don't know if script injectors are still that common. They are atleast alot more rare than a year back
Was popular with kiddies in a2 dayz mod
yeah, the only thing I really want to protect against is variable editing
Yeah, what's your variable storing values for?
experience points/levels etc, important values
Those are likely to change then, so make sure you have a sort of "max" value. If you really care, then see how much it changes over time
A script kiddy will most likely enter huge numbers for experience
just check periodically if the experience is so high that it's impossible for a human to reach that
"Human",
Can bots get 75 tank kills in 1 minute?
Are we talking secret terminators?
Arma 3 to make the next simulated matrix? I am telling you man, they talk to each other internally, they have plans we can never predict
Although... now that I think about it, it wouldn't really be that hard to protect against if you just literally check every value the client edits in a legit and unlegit way with the server.
They may follow the rails of the terrain, but an ai that travels that far has to be thinking of something.
in other words; just don't trust the client.
correct. You can never trust him
Koth has something like that i think.
you could calculate and store the experience on the server. And let the client just tell the server that he just killed something. Or most likely the server can also figure that out by itself.
Then just send back the experience to the client so he can display it. In case he wants to know his exp.
That works. But how much traffic might this induce? Lots? Little?
Or does it not matter in the scheme of things because of it's purpose?
Pew pew pew
A real hacker can still cheat ofcause. But that should be enough against script kiddies
"cheating" I suppose is fine, as long as he takes his dirty paws off of my top secret values >:]
Lol, tips hat in dedmen's direction . I'm sure you'd know mr white hat hacker
@high prism You have launch codes being updated in there or something?
shh
Knew it.
anyway, thanks guys ๐
:+1:
Is there some manual on how to stop using [1,2,3,4,5] call BIS_fnc_selectRandom and start using selectRandom [1,2,3,4,5] instead?
I cant force myself, seems to be medical problem.
Manual? Step one: keep calm and replace
lkiterallu
just a JOKE, I can't rid it of my mind simply.
No, it's not a joke. You have a serious pro blem and it needs fixing
To rehab with you
https://regexr.com/
Expression (\[.*?\]) call BIS_fnc_selectRandom
Replace selectRandom $1
Ohhh wait.. You wanted manual.. And I gave you a automatic way...
For manual use please use your keyboard and fingers
(are)|(is) (you)|(he) (really)|(rly) sure?
๐
anti variable cheating -> can continually check the delta if it seems fishy
?
Refering to conversation from an hour ago
Is it possible to return if a weapon a player is holding a dlc weapon? getObjectDLC and sorts don't provide the solution
Or, one that isn'f broken in mp at least?
I may just generate a static list
you should be able to check config entry in CfgWeapons >> weaponClassname >> dlc
Some of them have a dlc and some don't. It's weird, but i'll double check here soon
Like the RPG7 doesn't have any dlc entry :(
Variable on object can kill FPS ? I have 4 variable on 1127 objects, wanted to know if this can kill fps, or only the network
no
@little oxide Well once they've set (globally ofc) they are part of JIP data. So if you don't update that frequently, no.
This doesn't kill network
variables that are just sitting in memory don't do anything to fps
Well, you didn't ever say they were global..
The frequency and data size impacts CPU, when broadcasted, since network packets must be utilized.
In current reality network is not an issue, since by my experience 2 mbits is kinda topmost load I've ever seen per-client.
Prefer to regroup all variable in only one variable for some optimization of JIP Data ?
1x setVariable against 4xsetVariable, think so.
That also depends on what and when is touching that data.
So if its several diffrenrent spawn|execVMemed scripts, they can conflict on the same data, especially if that is different PCs.
moving everything into one is very bad if like 3 of the 4 variables change very rarely
you have to update everything if you have it in 1 variable
I have 3 of the 4 that never be updated, so i can move these 3 into one, and let the one that updated in only 1 var
I'm not sure about the details (correct me if I'm wrong), but moving those variables into one wouldn't change much since they aren't updated, so there's basically no extra cost in having them in separate variables, while it would make the code more readable (which probably matters a lot more)
The problem in "overengineering" the little details is that when you're optimizing them, you could be doing something else that's more meaningful (a thing known as opportunity cost in economics)
But of course, if you have absolutely nothing else to do and/or saving even a few setVariable call costs would make a difference, then it's worth it ๐
Usually the rule of thumb is to write human readable (human friendly) code at first, not thinking about the performance too much (ofc still avoiding the biggest performance hogs), and then, in second iteration, start to optimize the code based on the observed worst performance hogs and repeat it until you have code that's human readable and fast enough
(As a sidenote, I believe that BI is a great example of a company whose development process has been severely fucked up by code that does its job but that no-one can understand) cough Arma 2 AI cough RV engine cough
@tender fossil They can't appeal to everyone's scenarios. Just like everyone complains about performance, they can't make generalizrd optimizations for all if it impacts one aspect of the game one way or another
Although some bits don't make sense sure
Yes, I'm speaking on general level
As in? I may be a bit confused as to what you are saying sorry
About the management
@tender fossil three variables are three JIP messages. Instead of one.
And you would also need to store the variable names for them
which is absolutely insignifcant for 3 variables. But super not insignificant for 3 variables on thousands of different objects
@still forum Yes, naturally if the effect is multiplied, it'll quickly start to have some systemic effect
Hello, I have a short question. Is it possible, to get custom pictures on avdertisment Walls but the picture file have not to be in the mission.pbo and could be linked from a rootserver ftp or something? We just want to change pictures for Event adverts on ad walls in our public mission but don't want to edit the mission.pbo everytime.
So if we update our adverts we just exchabge the png or jpeg files with new ones without editing the mission.
I have a counter adding numbers smaller than 1, is there any way to avoid the problem that gives me x.9999?
or the .0001 for that matter
nvm i just scaled it up to whole numbers
How would I stop AI from dying and instead place them in a wounded state?
@shadow sapphire you could do an event handler
Also, does anyone know the command to sync units to a module?
@glad venture, thanks, but I need more direction than that, haha. I know I need an event handler, but I am truly a bad scripter. Anyway, gotta work right now, Iโll get back to my shit scripts later.
@[10th MntD] LiquidBlaze#0067 You can only do that with htmlLoad and this is for control only.
So its not possible to load pictures out of the mission.pbo? Damn why? What is if we are using a database function. Could it work with that?
@DEL-J#8291 Any Arma unit dies in some specific conditions. Instant death comes with having head neck and body damaged to 1. In other cases unit dies if 3 or more of any hitpoints are damaged to 1.
@ruby turtle .PAA is a game texture asset, you cannot load it on-fly into a game. To be short, anything that is a picture in Arma is converted to .PAA or either a engine procedural texture.
im working on a UAV script that put marker over enemy occupied area. and its skipping the last group everytime. i can't figure out what is the problem. it's probably something stupid but i can't see it.
target_list = [t_1,t_2,t_3,t_4,t_5,t_6,t_7,t_8,t_9,t_10];//for testing
while {true} do {
templist2 = [];
{
templist1 = [];
_unit = _x;
distance1 = 0;
{
if(_unit distance _x < 150) then {
templist1 = templist1 + [_x];
if(_unit distance _x > distance1) then {
distance1 = _unit distance _x;
};
};
} foreach target_list;
if(count(templist1) > count(templist2)) then {
templist2 = templist1;
centerpos = position _unit;
zonesize = distance1 + 10;
{
target_list = target_list - [_x];
}foreach templist1
};
} foreach target_list;
_marker = createMarker [str centerpos, centerpos];
_marker setMarkerShape "ELLIPSE";
_marker setMarkerSize [zonesize, zonesize];
systemchat"test";
sleep 1;
if(count target_list == 0) exitwith{};
};
No that is not the problem. .paa files should be also able to load from a pre defined path everytime the mission restart, we could update the .paa file to show another picture ingame. That is what we are want to do.
We don't want to change it "on the fly"
also if there is a better wy to do it. i'm all ears
does anyone know how to randomly spawn enemies within an area?
@glad venture createUnit
placement: Number - The vehicle is placed inside a circle with given position as center and placement as its radius
@unborn ether thanks, also is the unit like _unit = createUnit, so _unit is the ai and not an array like you get with bis_fnc_createVehicle?
also
bis_fnc_randomPos or bis_fnc_randomPosTrigger or _randomPos = _area getPos [<random_distance>, <random_direction>];
and maybe selectBestPlaces ๐
ez
So, is there a reliable way to delete dead unit from a vehicle? ๐ค
As soon as body "cools down" (changes from proper unit to body), deleteVehicle, moveOut and other commands no longer work. Deleting vehicle itself leaves unit in limbo but its still there.
@meager granite crew gives you full list of all units, even dead AFAIK. The thing is that there is a visual glitch might happen if you simply deleteVehicle - visually its still occupying proxy.
So far I only came up with hacky solutions like moving body into another vehicle with moveInAny, then having another unit get into that seat to push body out and then finally delete it.
@unborn ether deleteVehicle doesn't work on dead units inside vehicles, its not glitch, unit doesn't deletes until its out of the vehicle.
@meager granite ๐ค I had some solution, can't find it now. Try this one before deleting:
{unassignVehicle _x} forEach ((crew vehicle player) select {!alive _x});
That's pretty hacky there sir lol
Not sure if it worked on MP switchable units like players, or not. But Eject or moveOut should work afterwards.
Nope, unassignVehicle does nothing
@meager granite dead units local to you?
Of course, all in local environment as server
Looks like remains collector refuses to deal with such units as well
2018, still no moveOutDead command
I guess I'll have to resort to hackery then ๐ค ๐ซ
I'm curious about a way to make a client side script where any small caliber rounds (say 6.5 or smaller) doesn't do damage through armor at all. Anyone thought on this?
Check material type with HitPart?
Though at the moment of HitPart bullet already hit and damage is already sent to another client ๐ค
Oh, drats.
Is the tough armor the whole object or just a part of it?
Because if it is the whole object you can add a handleDamage event handler to check the projectile, and the object being hit.
The tough armor is only on the head excluding the face, on the chest and on the back. The shoulders and sides are generally only covered by soft armor, which would stop pistol rounds, but not rifle rounds. However, for me, it would work juuuuust fine if we pretended the whole torso was protected.
The whole object?
@shadow sapphire So far only complex solution comes to mid: Store all hits to certain entities in array with flags whether hit should register or not by HitPart check
Interesting. Ugh! Probably not worth it, then.
Then target entity stores but not applies HandleDamage, asks shooter to report on which hits should be counted and which ignored and then manually applies that HandleDamage depending on response.
It just irks me that if you hit a guy wearing solid armor three times in the plates with a weak round (5.56), he dies. That's not even close to accurate.
@naive estuary, you're saying we could check if the armor is being hit, and if it is, tweak things at that point?
Much easier in non-multiplayer
Haha, well, it has to be multiplayer for it to be useful for me.
Actually, checking which part was hit against armor values of worn stuff could work too
I wrote a script once for blank fire weapons, they just delete every round as it leaves the barrel. Maybe if we could delete the bullets as they hit certain objects, it would stop the wearer from being damaged. Problem is, the victim of the projectile probably wouldn't flinch anymore, which would be wrong.
If it is executed on all clients then it should in mp just fine. I believe that the server trusts clients with hit registration implicitly.
IDK, I just think Arma's whole damage system should be rewritten by me, haha.
There are too many clients and too much going on on my server for things to go to ever client.
I think it would tank performance.
Thinking about, does hitting plate carrier responds with flesh surface hit? Probably does. If it does, then my idea is nil.
Anyway, I gotta go pick up my wife from work. Thanks, guys!
@naive estuary The issue is that decision whether there was actualy hit or not cannot be affected, HitPart is just an event, you can't deny a hit with it from shooter side.
You can deny damage from the hit with HandleDamage but not hit itself.
I know. In his case he wouldn't want deny the hit. If you get hit in a plate with anything you would feel it, but it wouldn't harm you.
Yeah, shooting right into chest plate responds with meatbones.bisurf surface so my idea doesn't work
So yes, you'll need to check which parts are protected by helmet and vest and then apply or ignore damage in HandleDamage depending on it.
How about detecting where the shot hits? Chest head, arms, etc?
This all started because I was thoroughly testing the damage model for infantry in Arma 3. I was NOT impressed. I just wanted a simple, SIMPLE AI medic script. Basically an event handler that, when the AI goes down, it checks to see if the head is at max damage. If the head is not max damage and if a medic is within eight hundred meters, then it goes into a wounded state and is added to a queue, and the medic will eventually get around to healing it.
Which is fairly easy.
with removing dead units from vehicles, maybe something like this
private _units = (fullCrew [_vehicle, "", false]) apply {_x select 0};
_units select {!alive _x} apply {moveOut _x};
moveOut, eject, etc. doesn't work
dead units cannot be moved out through script at all
How about setpos?
Fully dead units*
hmm
Oh, shit! That would work, @naive estuary, @meager granite. If target is wearing a whitelisted armor, then they donโt receive damage if they are hit in the torso. Done! Right?
But that's rather hacky, you need to move unit somewhere else first
@shadow sapphire You can check which armor protects what on the fly
maybe just setPos them... ๐ค
And no, setPos*, attachTo, etc. doesn't work either
nice ๐
@shadow sapphire see https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HandleDamage
@shadow sapphire configFile >> "CfgWeapons" >> _vest >> "ItemInfo" >> "HitpointsProtectionInfo"
Just make sure to have some basic caching so you don't iterate through it on each HandleDamage, that would be lame
Roger. Will look into that.
@meager granite I created a hunter, killed its driver and was able to move it out with setPos
Because unit is still unit, wait a little until it turns into body
Ah
follow up on my last post. i rewrote the whole thing and i manage to make it work. i'll probably post it on the forum once im done with it. https://www.youtube.com/watch?v=hzOzJ-VPCZY
str unit will show memory addess and model name instead of group name and index
just tried
0 spawn {
private _units = (fullCrew [cursorObject, "", true]) apply {_x select 0};
_units apply {_x setDamage 1};
sleep 10; //--- to make sure they dead dead
_units select {!alive _x} apply {moveOut _x};
}; ```
this ^ https://gyazo.com/c214093f35eda5751dc0e538d3feab58
or i'm missed something ? ๐ค
As I said, moveOut doesn't work.
If moveOut worked then you didn't wait long enough
don't know then...
deleteCollection will hide the model. But I don't know if the object will still occupy the vehicle crew position
It doesn't care, since anyone entering his seat will kick him out.
7:22:31 BE protection activated for player id=977342073, name='#######', msgType=371
Can anyone tell me whats that exactly about? Happened since I used vanilla console
hideObject and hideObjectGlobal would hide the body visually, but it is still considered in the crew of a vehicle.
@meager granite deleteVehicleCrew on the object works when after the body has gone from a unit to a corpse.
yeah... still no commands for that
Fun thing is, first vehicle doesn't have to be actual vehicle where unit is in and it still deletes the unit
Not sure why do you even need to provide vehicle in the first place, its not like engine doesn't know where unit is
Anyway, at least I don't have to do all that mess with moveInAny to delete units, thanks for pointing me at the command I missed ๐
does anyone know if their is a way for a script to check for current state of weather?
You mean rain and overcast and stuff?
https://community.bistudio.com/wiki/rain
https://community.bistudio.com/wiki/overcast
https://community.bistudio.com/wiki/fog
https://community.bistudio.com/wiki/wind
^^
im wanting to check if its raining for the script to do something
any way to check if rain is active?
rain > 0
I'm not sure when rain kicks in. I guess with rain > 0.5 it will rain
not trying to make it rain want the script to check
If you are running stuff like ACE weather there are probably better ways
is that what rain > 0 does
Yes. We are talking about exactly that
ok
ok thanks
Rain is not possible when overcast is less than 0.7.
so need it to check for rain and overcast or just rain?
0.09 and still rain btw @still forum
if ((overCast > 0.7) && (rain > 0.01)) then {};//Its raining
ok thanks
your input will be used in the future enabling of horrible things to a playerbase lol
Hi, such question, whether probably to receive the size of the control to contain the structured text, as it is made in hint?
yes, to count lines or size image
ctrlPosition
The idea is that, as in the hint, there was no empty space left
you want to make a hint that has no space left ?
yes, something like this
He wants to figure out how big a control has to be to exactly fit the text. Without overlap or empty space
Correct me if im wrong, but I dont think you can edit the hint control ?
ctrlCreate
then use ctrlText height
hmm, ty i will try this
Is it possible to get the chat box to open in editor and be able to use it?
Inside editor i don't think so.
Inside editor preview in MP yes
Just host a local MP game and use the Editor there
Ha alright its just that i want to test things with exile and mp games are aids on the mod
Also too much effort for setting up a server
No
For exile mp server i would have to set up a database and create a local server on my machine
Hello, does items in the game, have unique ID, so we can identify an item in an inventory or whatever ?
no
okay thatโs sad, thanks
If you are making a mod you can just make a thousand slightly different items which you then only spawn a single one of any of them. So that there can be at most one of any of these item types.
You can then use these to create a "unique" item.
TFAR and ACRE do that for their radios
and ACE for dogtags
listed from 1 to 999 hehehehehehe
Yep it could be done but, I want to work with the official items
Just call your mod "official items mod" then ๐
ahaha that would be crappy
BI should work on feature like this
and btw on his user interface editor
Maybe they will for Arma 4
theyโre already working on a new motor but donโt know when this will be out
and with theses ID we could do incredibles thing like if a soldier drop his weapon and someone take it, he will be able to see who dropped it
That is kinda already possible
dropping a weapon creates a invisible weapon container on the ground. Which you can set variables on
so as long as only one soldier dropped his weapon into it. It's pretty easy to use that variable
yep thatโs an idea but not that good for perfs
like when you want to play a 3D song u have to create an invisible helipad, lol please..
variables do nothing for perf
and to play a sound in 3D you don't need an object no.
weapon container if there is so many it can be laggy, right ?
never saw that before, about the 3D sound, to play a song Iโve read that you have to create an empty helipad, attach it to the player, and play the song on it
w00t
If you want to play the song on the player and have it move with him. Then you can just play the song on the player directly
hm okay will try but I think I forgot something
What would be the best way of doing a gagged thing to go with tfar so the guy gagged would sound muffled.
I have tried something with canSpeak but other people around me sound muffled too xD
_position = _center findEmptyPosition [0,10]; ```
Is the position excluded as a return value of findEmptyPosition, if an object, such as ammo box, is already occupied on the empty position within area by script ?
center findEmptyPosition [minDistance, maxDistance, vehicleType]
Searches for an empty position around specified position. The search starts looking for an empty position at a minimum distance of [minDistance] from the [center] and looks as far away as [maxDistance]. If a [vehicleType] parameter is specified, then the search will look for an empty positions that is big enough to hold that vehicle type. If an empty position isn't found, an empty array is returned.
This command ignores moving objects present within search area.
So from the sounds of it, yes it will exclude the position if something is already there. If no valid positions are found it returns an empty array.
thx. @naive estuary
No problem. And depending on your need, https://community.bistudio.com/wiki/BIS_fnc_findSafePos offers similar capabilities with more configuration.
Would anyone be able to provide me to a helpful link for creating a lightbar for vehicles?
I want to make custom police and ems vehicles
@compact maple createSoundSource is what you seek
@unborn ether thanks you
Does anyone have experience with in game live feed? e.g a drone or satellite feed to a monitor. I've had a look around online and most examples I can find are 4-5 years old and don't work now. I have little to no experience scripting
Someone asked the same question just a couple days ago
and the stuff that is 4-5 years old still works.
@past ruin You need to render something as a texture?
I guess? Like I said, this is new territory for me. I've tried all the example missions I can find but they're outdated and don't open correctly in eden
@past ruin
https://community.bistudio.com/wiki/Procedural_Textures#Render_To_Texture
+
https://community.bistudio.com/wiki/cameraEffect
+
setObjectTexture|Global
Quick question, is there a limit to how many elements can be placed inside an array? I've got an array of 1,000+ lines saved under a variable, and it loads, but it seems to almost crash half way. I've read the wiki on Arrays and it says it can have up to 9,999,999 elements, but that doesn't seem to be the case with me.
In case anyone is wondering, the array is just pure config patches.
how would u go about adding this to players? I need it in their init, for for them to exec. " this setVariable ["SKM",["P",30,50,true,2,""],true];"?
are you putting this in the init.sqf?
if so, try player setVariable ["SKM", ["P",30,50,true,2,""], true];
also, if i were to addAction, would any1 new joining, would they have that action?
if you were to put it in your init.sqf, i'm pretty sure they would
ty โค
No problem ๐
So animals like snake still can open doors in buildings. This just gave me creeps again.
Someone know how i can put a taser gun for a medic in Altis Life?
@plucky mauve Put where?
@trail epoch initPlayerLocal.sqf if to be more precise.
@unborn ether I need put the taser function for medic
Just crumble it up and throw it at the medic
Hello i need a bank robby script for 4.4r4 but it must be the same as in the a3l pm me ๐๐ผ
this is #arma3_scripting not #creators_recruiting , also be ready to pay I doubt people will do it for free
I'm not thinking he is offering any pay @lone glade
He is demanding someone to make that script for him.
I wish there was a inAreaArrayArray
wat
[positionsArray] inAreaArrayArray [positionsArray]
I wanna check if all players are in 10 areas at once
@tough abyss If you explain in detail the functionality you want I'll give you a script for $399
#350
Pfft
How to stop a 'playAction' or 'playActionNow'
_unit playAction "" I guess
stopActionActionWorldASLtoATLReal
Usually when working with numbers in Arma, once you go above 10 million it starts turning into random crap like this '1e+006' right?
it by default stringifies to scientific notation yes.
unless you use toFixed to stringify
Anyone here know how to create ace action on the map?
In case anyone cares https://github.com/intercept/intercept/pull/201/files
I didn't hear about setcustommissiondata or opensteamapp yet
I love getMusicPlayedTime
i love you
I love Frontlines
no you don't ;_;
Anyone here that loves trying out commands with unknown use? https://community.bistudio.com/wiki/getMusicPlayedTime
Probably time since the current playing music has started. As there can only be one playMusic running at a time
It's right Dedmen, but if the last music finished, this will not return 0, but return the max time of the last music
Returning 0 if no music was played before
it's also not subject to time acceleration
you can actually set the speed of a sound in a CfgMusic or CfgSound (last element of sound[]= {})
โฆyou can actually set it to accTime. Since OFP ๐
Tested openSteamApp and ithink he do anything, he return all the time false
test the example on wiki
how do I make colored text in a hint?
Hey, anyone got any experience making Modules for Eden editor?
I got canSetArea = 1, but I don't know how to fetch the "area" to use in my script.
Also is there a way to set the default size of the area for the module?
Hey guys, can someone tell if it is possible to do the artillery support provider/artillery support requester module functionality via script at any given time?
I could script it myself but i would like to use the existing framework (the chat that the support stands by, the marker with the ETA for the shells and all that stuff).
I found a few functions like 'BIS_fnc_addSupportLink' but that still needs the modules _(
not without basically scritping it yourself to let it work the same way
all those BIS functions are shit to use outside modules
not what i wanted to hear ๐ฆ but thanks for the fast anwser.
basically go through the function, look at which variables are used, then just create a gamelogic in the proper location and set all the required variables
Like it's possible, but it's more effecient to just take the function and rewrite it in a way that you need the modules
/ logics
I'm trying to add houses to a gang base, but when I set it either, the doors won't open, I cannot place storage boxes, or the house is not even there. Anyone know why this is happening?
@RadioActiveGoat#7492 You are trying to add houses to a gang base. Which way you do it and is this life framework or so? <- Undefined is higlighted
just ctrlsetposition to group
is there a way to click and drag to move a controls group ?
@wary vine Yes
You're not gonna like believe me
Your display should support MouseMoving where it locates and reports the mouse positioning, while your control is controlled with MouseButtonDown|MouseButtonUp which will recognize if you are holding a button on it, and in between all of that you do ctrlSetPosition depending on on your display reports. Probably will require some trigonometry knowledge.
hmm
so in essence
ouseButtonDown|MouseButtonUp eventhandlers
and ctrlSetPosition
and make bumper bars, so it wont go off the screen.
But don't forget that this will "fall through" on anything active behind the current group
?
Any active controls group will react to that events at the point where few of them intersect with each other
About your bumper cars, its simply doable with min|max
so you can say like
private _thatx = (_shiftedPosition max 0.05 min 0.95) * safezoneW + safezoneX
Ofc thats not including widht diff
ty
im getting somewhere ๐
not sure what you meant by ```
private _thatx = (_shiftedPosition max 0.05 min 0.95) * safezoneW + safezoneX
thats what i got so far
@wary vine you should min and max your x and y, so they basically will not go <=0 or >=1
how to do i find out min max ?
@wary vine with min and max ๐
Simple example:
0 max 0.05; // 0.05
0.5 max 0.05 // 0.5
1 min 0.95 // 0.95
0.5 min 0.95 // 0.5
i got some crazy shit right now.
but sorta works.
Lega_testFunction = {
while {!(Lega_BackgroundControlMouseup)} do {
_left = 0.427812 * safezoneW + safezoneX;
_right = _left + 0.145 * safezoneW;
_top = 0.2382 * safezoneH + safezoneY;
_bottom = ((0.2382 * safezoneH + safezoneY) + (0.43 * safezoneH));
_mouseX = getMousePosition # 0;
_mouseY = getMousePosition # 1;
sleep 0.001;
if (((getMousePosition # 0) > _right) || ((getMousePosition # 0) < _left)) exitWith {};
_difference = ((getMousePosition) # 1) - _mouseY;
private _lastControl = Lega_xPhone_BackgroundControls # ((count Lega_xPhone_BackgroundControls) - 1);
private _lastControlTop = (ctrlPosition _lastControl) # 1;
private _firstControl = Lega_xPhone_BackgroundControls # 0;
_firstControlBottom = ((ctrlPosition _firstControl) # 1) + ((ctrlPosition _firstControl) # 3);
if !(((_lastControlTop < 0) && (_difference < 0)) || ((_firstControlBottom > _bottom) && (_difference > 0))) then {
{
private _pos = (ctrlPosition _x);
_shiftedPosition = (_pos # 1) + _difference;
_pos set [1,_shiftedPosition];
(Lega_xPhone_BackgroundControlsButtons # _forEachIndex) ctrlSetPosition _pos;
(Lega_xPhone_BackgroundControlsButtons # _forEachIndex) ctrlCommit 0;
_x ctrlsetposition _pos;
_x ctrlCommit 0;
} forEach Lega_xPhone_BackgroundControls;
};
};
};
xD
but its works... sort of.
You don't like EVH do you? ๐
and also
๐ต ๐ฆ ๐ท ๐ฆ ๐ฒ ๐ธ
will easen your life ๐
(ctrlPosition _lastControl) params ['_lastX','_lastY','_lastW','_lastH'];
@unborn ether When I do it like this, I can't open the doors.
https://i.gyazo.com/c485552fcb0c6e4826a914e8cd2eaa69.png
@timber veldt enableSimulation false will also disable animations on the object
Makes sence, I will see if it works now ๐
hi need some help in editor
@tame portal After i enabled Simulation I can't buy the house or open the doors.
try to rent it, maybe... /s
Hello,
Using the PLP_CalmSoldier script and although testing it in MP in the Eden Editor, the AI fail to go into the animation?
E.g. When I place the WOUNDED_1 anim on the soldier, I can hear him groaning in pain but he is stood up straight on the bed?
Anyone familiar with this issue? I get no error messages.
Just to clarify, MP testing in Eden was successful, the AI are in their respective animations, but when i upload the mission.sqf to the server and test it. The AI are not in animation
ask the script maker
I have, no answer yet so resorted to this
that sounds like a locality issue
what do you mean by locality?
I mean locality by locality
well obviously, but please expand on your point?
the locality that the animation is played on is probably wrong.
as in the script executes a command that changes the animation for whoever ran it but other clients don't see it
I see what you mean, but that would then mean I would see the animations (which I don't in the mission which i uploaded to the server)
no.
That would mean you wouldn't
They might run on the server and thus you don't see them
or they only run on your client. and a millisecond later the server overwrites it and thus you don't see them
ahh I see. Any idea on how to solve this issue?
ask the script maker
Took a quick look at the script, 700 lines of repetitiveness, but it does not look like that script is made to work in MP.
Anyone here know if it is possible to recreate the Vanilla Command Chat channel? I.E, everyone can send messages on it, but only certain players can send and receive messages on it?
@errant jasper it does work with MP
Well, then I guess you have no problem then...
Some animations work, some don't. It's very strange
How do you start the script?
embed the script into the mission file under the folder 'Scripts'
then place:
_nil = [this, "SIT_RIFLE"] execVM "Scripts\PLP_CalmSoldier.sqf";
in the init of the unit
So for "WOUND_1", according to the script it, for every player/server does the following:
- waits a bit
- disable parts of the AI brain
- adds such that whenever an "idle animation" is done it will play another random "idle animation" - this is random on each machine, so you might see different animation!
- adds a handler, such that if the AI is killed, it will play a particular killed animation
- Then it stores for WOUND_1, two particular "idle animations" and a killed animation.
- Then it randomly starts playing one of them. This is what starts the idle loop with the AnimDone event handler above.
- Then, for WOUND_1, it starts a script they regularly plays a random wounded sound. Again the command is local so you might hear different noises each time.
- For other modes e.g. not WOUND_1 the following is delayed until combat or AI dead. But for WOUND_1 the following happens immeidately:
- Both event handlers are removed.
- The AI brain is enabled again.
My theory is, that when the AI brain was reenabled, the AI chose another animation for the unit. Strange though that it worked during your Eden testing..
I appreciate you looking in to it, genuinely! Thank you. It is a strange one, i'll play around with it and see if I find an solution
Theres no way to get the discrod syntax highlighting for sqf for notepad++ is there?
XD
there is also numerous other solutions for syntax highlighting including linting etc.
oh never heard of that
Visual Code, sublime, sqdev, arma.studio
I use sqf syntax in notepad ++ Google search brings it up
Who needs syntax highlighting and linting? Just write everything in the default windows notepad. Or if you are feeling like a professional use Microsoft word and save as a txt and change it to an sqf.
Yeah, you can even add ClipArt effects to the code in Word to make it look more appealing
Or, if you have a Samsung phone you can use Samsung Notes.
That way it's easier to incorporate emojis into your code.
if (โบ๏ธ<=๐ข) then {[๐ผ,๐] call ๐บ};
Can anyone explain how you set buyable houses with CG framework, I made it so far that you can buy and open doors. But when I try to place a large box it says, that I need to be in the house :/
Having a minor issue with these lines - https://github.com/Neviothr/ArmA/blob/master/Nev/addons/debug_menu/functions/fnc_onLoad.sqf#L116-L142
When looking at the sky Cursor Object: %9 (%10) will be Cursor Object: (, is there a way to remove the left over (? Why is it even there?
@tough abyss Cursor object in the sky is NULL
*objNull
in that case you have to format that part of the string before the main part
with an if statement for example
_cursorObjectText = if (isNull cursorObject) then { "No target" } else { format ["%1 (%2)", typeOf cursorObject, cursorObject] };```
you could put that if statement directly into the format part aswell but i think thats a bit messy
str (cursorObject) // <NULL-Object>
@unborn ether he wants to get rid of the brackets when theres no object
his current code results in Cursor Object: (<NULL-Object>)
cosmetics ๐
id be annoyed by those brackets aswell ๐
eh but it would result in an additional space
Cursor Object: (<NULL-Object>)
id get the rope if my code produced that
i cant live like this
ded
I can't see that many applications for this past debugging. In that case <NULL-Object> isn't that bad of an output.
he just wants his output to look nice..
its probably gonna get seen by someone else who throws that monitor thingy on so might aswell put in some minimal effort to make it look nicer
theres no information getting lost when it says No Target so i dont think its bad
I think ```
Cursor Object: (<NULL-Object>)
and this is why its hard to argue over this because everyone has their own opinion ๐
But your opinion is wrong and mine is right.๐
Is there a way to trigger a steam screenshot via script?
That saves to the Arma 3 folder doesn't it though? I was hoping to trigger a steam screenshot
It's not steam but it's probably the best you can get.
Steam performs screenshot with its API, so its not in your power.
Is there a way to simulate user input though, and just simulate F12
No. If there was it would only allow you to simulate userinput within the game it's self.
you could build an extension to do that ๐
We already have an extension, so it'll be easy to add, just was wondering if a base game method existed.
Also, does anyone know if there is a function to get your position in a group
Like the 3rd member of a group, so it would return 3
can't find anything in the wiki
@fringe yoke I found this: https://forums.bohemia.net/forums/topic/185059-how-to-retrieve-the-actual-number-of-a-squad-member/
also https://community.bistudio.com/wiki/joinAs, see example #2
Awesome, thanks
yw
hey guys
I have task modules setup and they work properly when synched to a player
but I only want the tasks to be created for the player through a script
I have an addAction on a unit that initiated a script to create dialogue, and then after the dialogue is done I want the task to then be created for the player.
how can I achieve this?
@wary vine ui https://youtu.be/n0s07t-MYDg ๐
also "ArmA 3 Solitaire" https://youtu.be/g86a80pPzPY
Code on the hastebin please?
nide @meager heart
Is there a known issue with RoadBarrier_F? My debug is not even seeing it as an object when I spawn it in.
Screenshot of issue, cursorObject and cursorTarget both returning <NULL-object> when looking at a RoadBarrief_F https://i.imgur.com/aIkVhbf.png
nearestObjects [player,["RoadBarrier_F"],10];```
returns
[1ecec9a5600# 1779946: roadbarrier_f.p3d,1ece4c0cb80# 1779934: roadbarrier_f.p3d]```
So Arma knows its there.
Well its just breaking then.
@tough abyss Because you have a typo in there.
@tough abyss Everybody is kinda pointing you to toss some code to see syntax.
sounds to me like hes trying to do something like the spyglass patches check that altislife uses
@worldly zinc This was and still a issue? of arma. cursorObject command checks object presence by some specific LOD which is not present for this object. Same goes for 2D helipad, you cant find it by cursorObject but its still an existing object.
cursorTarget then?
cursorTarget is is outdated version of cursorObject, as it has no ability to detect objects with no simulation and some other specific conditions. Also requires reveal most of times.
nearestObject ๐
Ah I didn't remember rn which was which ;-) I still have my head on the pillow :-p
so definitely cursorObject
@lavish ocean Can we get a fatigeEnabled command?
gotta bodge it ๐
check if the player is running and not in a vehicle and loop
while {
(isNull objectParent player) &&
(speed player > 0)
} do {
if !(getfatigue player > 0) then {
// _nofatigue
};
sleep 0.1;
};
xD
and don't tag BI Minions please.
I know it is possible, not what I am saying. Aids af to loop like that when it could be checked with one line
it can
isStaminaEnabled @tough abyss
just the naming convention was different
@winter rose Just seen that
fatigue + stamina xD
why would they name diffrent
why cant things be kept with the same naming convention
threw me off
https://community.bistudio.com/wiki/Arma_3_Stamina
Fatigue is the older name; new fatigue system was named Stamina
https://gyazo.com/19ca2f265a96adab4d82e50167090d09 thoughts guys ?
dont worry about the home screen icons , i got someone making me som nice ones ๐
xD
got the iphone toggles xD
yup
when i do the tfr calling system on it im gunna set it so you can change volume with the switches
yeah
still gotta do the animation for the toggles shouldnt be too hard tbh
just moving it slightly in the x axis
what ?
the toggle switch
the names and background are on one layer
Nooooo
then the switch colour and switch are on differnt layers
^ oh ok
because I wanna animate the switch
oh ok
so change the x position and change the toggle colour
yeah
glad i passed math in school xD
hahaaa
if (((getMousePosition # 0) > _right) || ((getMousePosition # 0) < _left)) exitWith {};
private _difference = ((getMousePosition) # 1) - _mouseY;
if !(((_lastControlTop <= 0) && (_difference < 0)) || ((_firstControlBottom >= (_bottom - 0.09)) && (_difference > 0))) then {
{
private _pos = (ctrlPosition _x);
_shiftedPosition = (_pos # 1) + _difference;
_pos set [1,_shiftedPosition];
(Lega_xPhone_BackgroundControlsButtons # _forEachIndex) ctrlSetPosition _pos;
(Lega_xPhone_BackgroundControlsButtons # _forEachIndex) ctrlCommit 0;
_x ctrlsetposition _pos;
_x ctrlCommit 0;
} forEach Lega_xPhone_BackgroundControls;
};
for the background slider
Long_Ass_Variables_Are_Very_Fun_To_Work_With
or make another shorter reference to them, aka
private _myList = My_Super_Long_Variable_Of_The_Death_ToWorldWorldReal
Is it possible to set the textureNoShortcut of a shortcut button through scripting?
Same speed when you put on and off, It's like when you taking off, this is more fast than when you take on
still, it's impressive - congrats @wary vine !
it is the same speed
private _newX = if (_x isEqualto _offX) then {_onX} else {_offX};
private _newPos = [
_newX,
(_pos select 1)
];
_toggle ctrlSetPosition _newPos;
_toggle ctrlCommit 0.02;
1/0.02 is 50. Unless you have 50+ fps, this will be the same as 0.
hmm
What's to think about?
gotta think of another way to do it xD
Do what?
keeping the toggle slide smoth-ish
As in, move it faster the farther it has to move?
its always the same distance
How is it not smooth then?
0.02 is mooth for me
Explain to me how 0.02 is different from just straight up 0.
Yeah, I was saying that 0.02 is so quick, that it is the same as 0 in every use case. Because you never play at >50 fps realistically.
commy has a point
i want to check if a unit took a cellphone from a crate. Is there a better way to do it than the take EventHandler for each player in the mission? It is basically needed for one player (i dont know which one but there is only one cellphone) roughly every 1h/1,5 hours. But loadouts change a lot. So it would get triggered rather often for beeing used really rarely. I looked at the container opened and closed EHs but they dont seem to give me what i want.
Use the inventory opened handler on the crate
when someone opens the inventory. Then add the take handler. And remove it agian when Inventory closed
that way you only have the Take EH when you need it
Take fires for remote units?
What if the player drops the thing and another picks it up?
is the phone an item? if so, in items _unit?
The question is what you need to know this thing for.
If it's some marker updating loop for example.
The loop could just check all objects on the map if they own the cellphone. And if they found the unit, only check the unit the next iteration. And check all objects again only if the unit lost it.
Thanks dedmen that is probably the best way.
Commy i just need to check if the cellphone got taken from the crate. Then firesupport is added for the groupleader. No matter who picked the phone up. The phone is deleted afterwards.
How exact does the time need to be? Would it be enough to just add an InventoryClosed to the player and see if he has it?
OK, what Dedmen said then.
Easiest would be if you don't use a cellphone, but a backpack.
ยฏ_(ใ)_/ยฏ
But i dont know if the player already has a backpack.
I prefer @errant jasper 's InventoryClosed idea
How is the fire support added? Depending the code, another option is to simply change the condition (if there is such a code-piece) for it only to be available if the player is carrying the cell phone/backpack
And a backpack "calling" in artillery support or stuff is kinda strange. And as TFAR is optional for that mission i cant use a LR radio backpack.
The backpack is bugged of course.
i cant follow commy. But iยดll use muzzles idea ๐ Should work good. Thanks for the quick help ๐
If it were a backpack, you could just put it's object into a variable and use getPosWorld.
ah okay. But i think i ยดll go with the cellphone for calling in support.
This is vanilla?
well currently not. CBA, ACE, ACE_X
Yeah but it is a mission with an ace arsenal that gets new stuff after each wave is defeated. Therefore loadout will change a LOT. And an airdrop with the cellphone in it will roughly happen every ~1-1.5 hours. Therefore i think loadout would fire way to often for the time it would be actually used.
ACE already uses the loadout eventhandler. I don't see a problem.
It's essentially free for you.
["loadout", {
params ["_unit"];
if ("<cellphone_classname_case_sensitive>" in items _unit) then {
systemChat "you have a phone";
};
}, true] call CBA_fnc_addPlayerEventHandler;
This check even a hundred times in a mission is nothing.
okay. Well thank you very much ๐
Only works for the local player, so you need to add this in init.sqf I'd say.
initplayerlocal works aswell?
Sure, doesn't matter where.
check
Other question i just stumbled upon with the new Eventhandler wikipage. I always used (_this select 0/1/2 etc.) in eventhandlers for the parameters that are available but on the new page there are actually names like "_container", "_unit". And as i know that it is available for ACE i wanted to ask if i can acces those params via those var names?
The names are arbitrary.
ah f*ck me. params. obviously
Yeah, params ๐
thanks again ๐
@tame portal - thanks. I ended up finding another solution ```SQF
["NULL-Object", format ["%1 (%2)", typeOf cursorObject, cursorObject]] select (!isNull cursorObject)
I want # to work with booleans.
god damn hippie syntax
just kidding but select is something i dont think of directly as an alternative to the ? : syntax of other languages ๐
o
Or even alternative unary syntax.
:0
Implying to use _this, exactly like param(s) does.
I wish + and - etc. would know when an ARRAY is a vector, and then use the vectorAdd, vectorDiff commands instead of what + and - usually do for arrays.
How would you tell?
That could work. Would need conversion commands back and to array/vectors.
Nah, all the commands that accept ARRAY, would also accept VECTOR.
This must be confusing for C++ people.
But + would be different depending on type.
Yeah, it wouldn't be bwc.
bwc? Don't know that one https://www.acronymfinder.com/BWC.html
@wary vine looks good
thanks
This is probably going to be obvious to someone ... but not to me! So, I have this :
_next_wp setWaypointStatements ["true","nul = [_grp,_next_wp_mkr] execVM 'fth\object\movement.sqf'"];
But the values of _grp and _next_wp_mkr are not written out correctly; so I tried a format approach:
format ["_next_wp setWaypointStatements ['true','nul = [%1,%2] execVM 'fth\object\movement.sqf''];",_grp,_next_wp_mkr];
... no joy. What am I missing?
Hey guys, is there a way to delete the evindence. In the CG framwork?
I mean delete them for good, so they don't even spawn ๐
["Altis",[3678.92,12898.8,53.6434],28.1986,0.75,[-19.4925,-0.000124383],0,0,720,0.3,0,1,0,1] call BIS_fnc_camera;```
how to i get the positions to move to each other
smoothly?
@drowsy skiff
Variables don't carry over to other scripts. Your waypoint statement is a entirely different script.
And you can't just turn groups into strings and back.
I guess the _grp is the group the waypoint belongs to?
and _next_wp_mkr is a marker. Thus a string?
_next_wp setWaypointStatements ["true",format["[group this, %1] execVM 'fth\object\movement.sqf'", _next_wp_mkr]];
thanks @still forum
plez help xd
I didn't realize how clunky waypoints were.
_next_wp setWaypointStatements ["true", format ["[group this, %1] execVM 'fth\object\movement.sqf'", str _next_wp_mkr]];
Pretty sure you have to pass a marker like this into format, because you otherwise lose the quote marks that make a marker a marker and not a global variable.
thanks - but it turns out you can avoid that final str b/c the marker var is already a string
and yes, waypoints are super clunky ๐ฆ
The marker is indeed already a string, but if you put a string into format, it will delete the outer quote marks.
yeah but he string a string
format ["%1", "my_marker"];
-> "my_marker"
That's what I said.
format ["%1", str "my_marker"];
->
"'my_marker'"
It's not really displayed as ', but "", but w/e.
is there an "easy" way to convert safeZone to pixelGrid ?
Why would you break your ui?
about wp's...
private _wp = _group addwaypoint [_position,0];
_wp setwaypointtype "move";
/*_next_wp setWaypointStatements ["true", format ["[group this, %1] execVM 'fth\object\movement.sqf'", str _next_wp_mkr]];*/
waitUntil {(currentwaypoint _group) == (_wp select 1)};
[_group,_next_wp_mkr] execVM "fth\object\movement.sqf";
๐ค
kinda more freedom...
(maybe)
True, but now you have two loops.
I wish they were like triggers, objects were you can use setVariable on.
so safezone is better then pixelGrid ?
other way around
Yes, safeZone is better than pixelGrid.
Seems to me that if you have to ask, then you don't have a good reason to switch.
never change a running system
Eh, disagree. We would still be single celled organisms if that were a good paradigm.
Someone can help mit with armake? Trying to build https://github.com/TaktiCool/CLib (addons/ folder) --> https://i.imgur.com/jXdEa6t.png Command is zsh armake build -f /mnt/p/Git-Files/CLib/addons/CLib /mnt/p/KI_AMD/@A3_Releases/Clib.pbo
somone just adivsed me to switch
Did they say why, ud9d-1?
That way it will work flawlessly on all interface sizes and resolutions
That's already covered by safezone.
That's literally why it exists in the first place...
The only use I found is drawing one pixel wide lines. https://github.com/CBATeam/CBA_A3/blob/master/addons/settings/gui.hpp#L186-L193
@hollow lantern does the file that it's complaining about exist?
I just posted a screenshot of lit lol
No you didn't
cfgCLibLocalisation.hpp
You posted a screenshot of a different file called cfgCLibLocalisation.hpp
eh
That's a entirely different file
CfgCLibLocalisation.hpp vs. cfgCLibLocalisation.hpp
C != c
Trust him, he has a blue name.
Armake is great (never used it)
build succeeded, thanks for the help Dedmen
(โฉ๏ฝ-ยด)โโโ๏พ.*๏ฝฅ๏ฝก๏พ
What's the syntax if I wanted to set a script inside this event handler? Just say I wanted to set their damage to 0.9 or some such thing with a "killed" eventhandler.
params ["_unit", "_killer", "_instigator", "_useEffects"];
}];
this setdamage 0.9;```
@shadow sapphire move it two lines higher
3*
this addEventHandler ["Killed", {
params ["_unit", "_killer", "_instigator", "_useEffects"];
_killer setdamage 0.9;
}];
Presumably?
Haha, so that's it? I just put it INSIDE and no other alterations? Dammit. I haven't tried the script at all, I just assumed it couldn't be that easy...
Not killer, @little eagle.
Who else?
I am working on a script for the AI to be able to be healed the way our players are healed.
The unit is already dead, no necromanzing in A3.
So, if they go down, we want to stop them from dying and put them in a state where the medic will know about them.
So, I guess I need to use "hit" then?
You can't revive units in this game.
"Hit," rather than "killed?"
Try HandleDamage...
I'll look at that one real quick.
But even with HandleDamage, the units will die. Because HandleDamage is poop.
Crap. That sucks.
vanilla revive don't works for you, DEL-J ? ๐
Prevent drowning with HandleDamage, I dare you.
vanilla revive kills the unit
Yes! That's what I was trying to do, @lone glade with my dumb setdamage idea up top.
It kills the unit for a good reason: HandleDamage is poop.
EZ commy, insta kill if downed underwater ๐
@meager heart, vanilla revive doesn't work, no. Haha, we built our own casualty system for players, now I want an AI answer to it.
We are trying to ensure that anything we can do, our enemy AI can do as well.
like if they crashed in a plane underwater... ๐
Ai's aren't humans. AI's can't press the "respawn" button
Okay?
The respawn button isn't available on our server anyway. But beside that, we want to get it close. That was the point. We've built systems for the AI to walk mortars and artillery onto targets, they can attack and move as company size elements and they can break contact if they know they are losing. They can also select appropriate base locations and fortify them.
I'd honestly just work with respawn and just teleport the player to the corpse, copy the inventory with those handly unitLoadout commands, and delete the corpse.
aka vanilla revive
Or that. Same thing prepackaged.
Are you guys reading what I'm typing? We already have a much better medical system for players. It's done. It's complete. We don't need that.
I want to be able to shoot a hostile AI, have him enter a wounded state, and then have an AI medic that is near him go heal him.
How is it complete and done if the most basic part isn't?
What are you talking about?
@little eagle AI respawn. Not player respawn
@still forum, Thank you, haha!
AI can't respawn, that's true. But instead you could just create a new AI.
That's not a bad idea, but it would have to be done cleverly to not be obvious.
Problem with AI is. Their brain dies too. Where humans have a seperate brain that doesn't die together with their ingame caracter
I've considered this idea.
I don't know what else you would do.
creating a new unit is how respawn basically works
The brain of the AI is the group, and the group survives, Dedmen.
except if the entire group dies at once
Well, then no one can be revived anyway.
Well, we don't have any other respawn in the sandbox. When we have a player get wounded, he goes into a wounded state without ever dying. If he bleeds out, THEN he dies.
I'm looking at how we do it with players. I'll just pick through and copy this. We use handledamage and catch it at 0.95.
I don't see the problem with createUnit.
There isn't a problem with it.
Well
I need a way to have the medic move to and "work on" killed AI before I deleted and replaced them. Just seems more complicated.
You need that anyway, don't see how it's more complicated.
Because if the AI on the ground is dead, doesn't their criteria change? Like often time they are marked as civilian or empty. Would that not change things?
What exactly would that change?
Their side.
And what does that change for your script?
I'm not sure. That's why I was asking. It wasn't rhetorical.
Well, I ask, because I may be missing something.
Maybe, maybe not. The script doesn't exist, so everything is hypothetical right now.
Different question
I'm looking at how we do it with players. I'll just pick through and copy this. We use handledamage and catch it at 0.95.
Why not do the same for AI?
0.95 is not enough if the hit is on the face ๐
Or the body.
Haha, I'm going to do that. The only reason I haven't tried that way already is because you were saying to kill and replace the downed AI, and I was discussing that with you. I was weighing it out.
I guess you didn't write the original script, right?
@lone glade, IDK why you don't think it's enough, because it's worked for my community for years. We've never had it fail to fire.
@little eagle, negative. Far beyond my skills even now, but especially when it was written. This shit is downright hardcore.
Really?
Really what?
This shit is downright hardcore.
I'm intrigued.
๐
Don't sent it to alganthe. He will rant about some minor shit no one should care about.
LIES
truth
see this cute little snail? <- how could it be rude?
and yeah, I rechecked, 0.95 is fine, it's the vanilla death treshold
For some reason I remembered that 0.9 was the max for the head
oooooh right
Though, vehicles explode at 0.9,while soldiers survive up to 0.95 iirc.
w/e
It's highly intertwined with our sandbox. I don't have my developer's permission to share.
Basically, if players are at less than five percent health, they are placed in a wounded state, which I think we've now changed to use setUnconscious.
While players are unconscious, it's standard stuff, they can't move, but they can look around and speak, other players can carry, drag, and drop the wounded, or load them into vehicles. Meanwhile, the wounded players bleed out, all players with first aid kits can stabilize them and restart the bleed-out, but only medics can stop the bleed-out and fix them. If the player does bleed-out, then they are added to our "redeployment" queue, and after a length of time, everyone in the queue is respawned in the back of a helicopter, which takes them to our main operating base and unloads them.
Sounds cooler than ACE tbqh.
hello
My community's goal is to build a persistent full spectrum battlespace simulator.
So, we have lots of overlap from ACE and the like, but we don't use the mods, we just make our own scripts. Easier to control that way. More reliable, etc.
How Can I tell if I ate from the infistar?
๐ค
we need some thonking in here
Does not compute. Don't say I didn't try.
I'm sorry about my English.