#arma3_scripting
1 messages ยท Page 312 of 1
no
ah ok
its just need to be setDamaged
yeh global variable is easiest.. but still not so easy if you want multiple
and I'm not sure, the function can run multiple times to create more units on different positions. Not sure if this will still work if the variable is global?
is this for that same hitpart thing?
yes
_obj setVariable ["other_object", _otherObject];
then in your event
_object getVariable "other_object";
hmm not sure if I can setDamage on a variable
you can.. what else would you use it on?
what i said above should work
_obj setVariable ["AEB_unitToKill", _unit];
_unit = _object getVariable ["AEB_unitToKill", objNull];
yes thanks that worked indeed.
appliance theft mod?
Ok I know what is wrong with this, but I don't know how to fix it
"VSM_OPS_multicam",
"VSM_OPS_2_multicam"} else {
"VSM_OPS_multicam",
"VSM_OPS_2_multicam",
"VSM_Beanie_tan",
"VSM_Beanie_tan",
"VSM_Beanie_tan",
"VSM_Multicam_Boonie"};
_availableHeadgear call BIS_fnc_selectRandom;```
I realise it's just filling the array with the last item because (I assume) it doesn't know to append it to the array. How to I fix that?
@JD Wang#0828 Erm, if your wanting them to be arrays they should probably be wrapped in [].
Yeah I tried
"VSM_OPS_multicam",
"VSM_OPS_2_multicam"]}``` etc
but it errors out
I get an "Undefined variable in expression" error when I get to
_unit addHeadgear _availableHeadgear;
maybe _unit is undefined?
btw there's a relatively new scripting command, selectRandom _availableHeadgear
that code is all kinds of fucked up
You mean mine?
try...
_addthisone = selectRandom _availableHeadgear;
_unit addHeadgear _addthisone;
But yeah, need to structure the array correctly. ๐
maybe it's just too early in the morning but it looks wonky as hell to me yes @leaden summit
it's 7am and i just smoked a joint, but is this what you're after
private "_availableHeadgear";
if ((_availableGoggles == "VSM_Balaclava2_tan_Goggles") OR (_availableGoggles == "VSM_Shemagh_Balaclava2_tan")) then {
_availableHeadgear = [
"VSM_OPS_multicam",
"VSM_OPS_2_multicam"
]
} else {
_availableHeadgear = [
"VSM_OPS_multicam",
"VSM_OPS_2_multicam",
"VSM_Beanie_tan",
"VSM_Beanie_tan",
"VSM_Beanie_tan",
"VSM_Multicam_Boonie"
]
};
_chosenHeadgear = selectRandom _availableHeadgear;
that if just looks all fucked up though
- bis_fnc_selectRandom <- ? selectRandom = way better
how do you get syntax highlighting up in here?
it's 7am and i just smoked a joint, <- Thats stuff you don't have to mention...
sqf was probably designed at 7am after someone smoked a joint, maybe i'm at an advantage
๐ ...
fair point. ๐ And the syntax highlighting is, I think, just putting sqf after the opening three backticks (same line, no space?)
nice, thanks
i don't think using _availableHeadgear / _availableGoggles as an array, and then a classname for the chosen headgear/goggles is the best idea
you'll look back at the code in future and be confused by the way you named the variables
have an array of availableX then select a chosenX from those arrays IMO
or something similar which won't confuse you in future
What kind of nonsense do you write there?
afaik he's selecting headgear and goggles randomly from arrays of available headgear and goggles
but calling the selected ones availableX
@leaden summit
_availableHeadgear =
if ((_availableGoggles == "VSM_Balaclava2_tan_Goggles") OR (_availableGoggles == "VSM_Shemagh_Balaclava2_tan")) then
{
selectRandom ["VSM_OPS_multicam",
"VSM_OPS_2_multicam"]
}
else
{
selectRandom ["VSM_OPS_multicam",
"VSM_OPS_2_multicam",
"VSM_Beanie_tan",
"VSM_Beanie_tan",
"VSM_Beanie_tan",
"VSM_Multicam_Boonie"]
};```
I realise a lot of my shit is wrong, I'm trying to piece together code I found to make it do what I want, that's how I learn. I've always used this script to randomise gear, but judt didn't want the units wearing boonies if they had the balaclava on because it clips ๐
That code above should work. No clue what oneoeh is brabbeling about.
weird variable names
and?!
Cool that works perfectly, thanks @jade abyss
Yeah, the variable names make it seem like they should actually be the names of the array, not the result of a random selection from an array. ๐
But hey, if it works that's the important thing.
_availableHeadgear = selectRandom
(
(if ((_availableGoggles != "VSM_Balaclava2_tan_Goggles") AND (_availableGoggles != "VSM_Shemagh_Balaclava2_tan")) then {
["VSM_Beanie_tan",
"VSM_Beanie_tan",
"VSM_Beanie_tan",
"VSM_Multicam_Boonie"];
} else {[];}) append ["VSM_OPS_multicam", "VSM_OPS_2_multicam"]
);
Doesn't look that much better ๐
would that work? isn't that trying to append stuff to a {} block?
edited it and added more paranthesis
still not confusing enough, please add some more
_availableHeadgear = selectRandom
(
[
["VSM_OPS_multicam",
"VSM_OPS_2_multicam",
"VSM_Beanie_tan",
"VSM_Beanie_tan",
"VSM_Beanie_tan",
"VSM_Multicam_Boonie"],
["VSM_OPS_multicam", "VSM_OPS_2_multicam"]
] select ((_availableGoggles == "VSM_Balaclava2_tan_Goggles") OR {_availableGoggles == "VSM_Shemagh_Balaclava2_tan"})
);
Someone should update the discord SQF syntax highlighting thingy and add selectRandom and the other new commands
Oh yeah, make the script more buttfk \o/
Challenge accepted.
Someone should update the discord SQF syntax highlighting thingy
discord isn't open source fml, it will never update
@little eagle The lib they use is open source on GH. Linguist IIRC
Can't be.
Linguist is using JonBons repository.
And his is up to date and used by Github for example.
I use it for ST3
Is iniDB still de facto standard for having database on your server in A3?
Well I know that there is also extDB for that prupose...
And it doesn't really matter what the standard is as it will run in the background and noone will care about it as long as it works ^^
Yeah, I just would like to have as tested / reliable platform as possible ๐
I think all those database tools are so old that they can be considered pretty stable...
But apart from that I can only tell you that I have extDB running absolutely smooth so far... ๐
Well, at least the extDB dev is still active
Extdb is still updated regularly to this day @scarlet spoke
Okay... I guess that answers the question about the stability ๐
Hey guys i am trying to write a script that reads possitional information from objects placed trough the map editor and than uses that information to create the same objects in the same possition. However my objects are badly displaced. I have a SP mission with init.sqf will anyone be able to help me out if i paste it here?
Im happy to help too
You able to send a pastebin of the individual script please?
Alright hold up a few minutes, having a look now
Try using the alternative syntax of createVehicle with the CAN_COLLIDE option. That should keep ArmA from changing the position of the object
@earnest path
I did try it didnt work but i will give it a go again.
Are you sure you need modelToWorld for getting the position?
Yeah I was gonna say
Its tables and chairs in a building so i need to get the offset from the centre of the object. The aim of this task will be that i can furnish all buildings of type X with that setup without editing the map.
So is "Land_MilOffices_V1_F" a furniture?
No thats a building on the map
Then you aren't creating any furniture at all as far as I can tell...
Im about to open the mission to give it a test
What i am doing is i am using the Eden editor to place furniture in that "Land_MilOffices_V1_F" building. Than i am getting the relative coordinates of each of the furniture objects and tryng to place new furniture objects overlapping the original once. If they overlap one to one i can use the array of data to populate any building of that type with the same furniture but i cant get it to overlap one to one.
So how big is the placement offset?
Like a few mm or rather on the other side of the map?
The furniture is within the building but its all over the place.
I see what you mean with the positions being way off. let me have a play around with the script, stay here
@warm gorge and @scarlet spoke thanks for spending time on it appretiate it! ๐
Have you tried to reduce the problem to a single object instead of iterating through multiple ones? Like just use an object of reference and one furniture object that should be recreated?
I have but it should not matter. If the model to world and world to model are consistent in their result than it should work. I have checked that they work with ATL coords so i am just lost . I tried a lot of different itterations before i ask questions here ๐
Well if it works in a small example then you messed up somewhere in your script otherwise the approach is the wrong one
Do it on one simple object and then start to build up on that
I also tried to use attachTo but it does not seem to work with buildings. Thats why i even spawned a secondary building on top of the map default building but attachTo does not work on custom spawned buildings too.
attachTo is not what you want in that case... Not really at least
@warm gorge Magician ๐ how did you achieve this
https://pastebin.com/zF7GucLm Line 13
_x worldToModel position _temporaryBuilding; to _temporaryBuilding worldToModel position _x;
So from this: _x worldToModel position _temporaryBuilding;
it's possible to do all of this in eden editor without actually running the mission btw
To this: _temporaryBuilding worldToModel position _x;
Oh wow sorry about this
Dont be sorry, we all make mistakes
Im glad I figured out what was wrong though, otherwise I would have been thinking of it going to bed aha
haha Yeah and wake up 3am wit a solution ๐
Well thank you very much for spotting that.
No problem, glad I could help
Hey, not sure if this is related to my scripting, but I am currently getting a crash with error STATUS_INTEGER_DIVIDE_BY_ZERO. I am not sure if that has to do with my scripting or a problem with my ArmA. It always crashes after initialization of my player and making a database connection with extDB3. Testing locally.
Anyone that could have a clue whats that about?
64 bit client and plugin?
can someone explain for me the usage of EH on dedicated servers? I tried to but its not working on my dedicated. What I tried is this:
if (isDedicated) then {
_obj addMPEventHandler ["MPHit", {
_object = _this select 0 select 0;
_hits = _object getVariable "hitTimes";
_unit = _object getVariable ["KI_unitToKill", objNull];
_light = _object getVariable ["KI_vehToRemove", objNull];
if(isNil "_hits") exitWith { _object setVariable ["hitTimes", 1]; };
if(_hits == 1 && alive _object) exitWith {
for "_i" from 1 to 2 do {
createVehicle ["Bo_GBU12_LGB",[(getPos _object select 0)+ (_i*cos (_i*17.5)),(getPos _object select 1)+ (_i*sin (_i*17.5)),0],[],0,"CAN_COLLIDE"];
_object setDamage 1;
_unit setDamage 1;
deleteVehicle _light;
};
_object setVariable ["hitTimes", 0];
};
_object setVariable ["hitTimes", (_hits + 1)];
}];
};```
if (!isDedicated) then {
_obj addEventHandler ["HitPart", {
_object = _this select 0 select 0;
_hits = _object getVariable "hitTimes";
_unit = _object getVariable ["KI_unitToKill", objNull];
_light = _object getVariable ["KI_vehToRemove", objNull];
if(isNil "_hits") exitWith { _object setVariable ["hitTimes", 1]; };
if(_hits == 1 && alive _object) exitWith {
for "_i" from 1 to 2 do {
createVehicle ["Bo_GBU12_LGB",[(getPos _object select 0)+ (_i*cos (_i*17.5)),(getPos _object select 1)+ (_i*sin (_i*17.5)),0],[],0,"CAN_COLLIDE"];
_object setDamage 1;
_unit setDamage 1;
deleteVehicle _light;
};
_object setVariable ["hitTimes", 0];
};
_object setVariable ["hitTimes", (_hits + 1)];
}];
};``` I tried HitPart on "Singleplayer" as it is available via ``addEventHandler``. But thats not available on ``addMPEventhandler`` so I took Hit. I just want an explosion to be triggered when an Object (in this case a fridge) gets hit two times and that works in "Singleplayer" but not on a dedicated Server. I want to admit that I created the Fridge Object using ``SERVER EXEC``
also tried via GLOBAL EXEC same result
So I am trying to make a condition true by putting this in the condition box of an object: phasep isEqualto 1; this does not activate the object so is there another way to remotely set a condition to true?
@hollow lantern Hit (and MPHit) only fires on the shooters machine, so unless AI owned by the dedicated server is doing the shooting, the eh will never fire.
This includes MPHit, because the way these MP eventhandlers work is, that they transfer their code across the network should the event happen on whatever local machine the event happens.
So not added on shooter machine == doesn't trigger
@tardy pagoda I don't understand this question. Makes no sense to me.
so in the arma 3 eden editor if you click on any object the condition will be true. I have a variable called phasep and i want the condition to turn to true only when the value of phasep is equal to 1. ive tried putting in phasep == 1 and phasep isequalto 1 but both dont work
When do you plan to set phasep to 1?
@little eagle Well the only one who is firing on the fridge are normal players but the explosion should occur for everyone globally. So if player A shoots at the fridge twice everyone should see the explosion
and thus everyone gets damage when in range of the blast
Shouldn't be aproblem since all commands you use have global effects.
createVehicle, setDamage, deleteVehicle.
The event will not fire on a dedicated server unless the shooting AI was owned by the server.
Because hit event only fires on the machine of the shooter.
why shooting AI? The one who is shooting is no AI, its a PLAYER. The object is just getting hit and when it got hit two times the EH creates a bomb on the objects position to create an explosion
object is a fridge btw no AI ^^
Then you have to add the eventhandler on the players machine for the event to fire.
on a triggers activation it does phasep = phasep + 1; i tested the value of phasep with an if then statement if (phasep == 1) then
{
hint "You are the leader of your group."};
Object doesn't matter, shooter matter for HitPart eventhandler
While you can add "HitPart" handler to a remote unit, the respectful addEventHandler command must be executed on the shooter's PC and will only fire on shooter's PC as well.
@tardy pagoda
The condition field of a trigger is evaluated twice a second (roughly). The condition field of an object is evaluated once at the init phase of the mission.
So if the condition of the object "presence" is false at mission start, the object is not part of the mission.
You're supposed to enter stuff like random 2 > 1 or maybe global variables you define in preInit.
thanks for answering my question ๐
yw
@hollow lantern I think it would be best if you add that eventhandler on every machine.
Do not use isDedicated (ever) and do not use MP eventhandlers either (ever).
okay is there a general idea on how to archieve this? I mean there is a initPlayerLocal.sqf but I think I can't tell the EH to run like I would put the EH there?
Add an eventhandler on every machine? init.sqf I guess.
but then I need to exclude to EH from my script thats not what I want is there rly no other way?
but then I need to exclude to EH from my script
?
What is he trying to achieve?
EH that works on dedicated server for every player
Why?
Ah I see what the problem is.
so that if someone shoots at a object (firdge) it will explode
Let me explain.
ok
You're creating an object on one machine (server), because createVehicle obviously has global effects.
And then you add an eventhandler to that object, but unfortunately the one you use has to be added on every machine, because anyone can shoot the fridge and the event you use only fires on the shooters machine.
another q: Why that _i*sing (_i * 17.5) etc?
// init.sqf
["Fridge_01_closed_F", "Hit", {
...
}] call CBA_fnc_addClassEventHandler;
^ this is what you should use
uuuh nice thanks
Hit doesn't trigger at all for me on this class, probably because it has damage disabled.
hmm true but idk why it works in singleplayer on it
well yeah the solution with CBA_fnc_addClassEventHandler; seems not to work, true. but my handler used in the script sqf _obj addEventHandler ["Hit", { _object = _this select 0 select 0; _hits = _object getVariable "hitTimes"; _unit = _object getVariable ["KI_unitToKill", objNull]; _light = _object getVariable ["KI_vehToRemove", objNull]; if(isNil "_hits") exitWith { _object setVariable ["hitTimes", 1]; }; if(_hits == 1 && alive _object) exitWith { for "_i" from 1 to 2 do { createVehicle ["Bo_GBU12_LGB",[(getPos _object select 0)+ (_i*cos (_i*17.5)),(getPos _object select 1)+ (_i*sin (_i*17.5)),0],[],0,"CAN_COLLIDE"]; _object setDamage 1; _unit setDamage 1; deleteVehicle _light; }; _object setVariable ["hitTimes", 0]; }; _object setVariable ["hitTimes", (_hits + 1)]; }]; works fine in Singleplayer
I shoot the fridge twice and boom the explosion will be created
How many fridges are in the mission?
depends, I have planned 6
ok
[_fridge, ["Hit", {
...
}]] remoteExec ["addEventHandler", 0, _fridge];
I think this is how it goes with remoteExec. I don't use it that often.
Point is that you have to add the eventhandler on all machines.
If it's only 6 and not fifty then transfering code doesn't matter.
Although Hit doesn't fire for me even in SP.
hmm weird
HitPart vs Hit?
let me check
true that, Hit does not work for me either buuuut HitPart works on it
[_fridge, ["HitPart", {
...
}]] remoteExec ["addEventHandler", 0, _fridge];
then
The CBA one doesn't work, because this is a map / terrain object and still has this disabled for performance reasons that were decided back in A2 :/
[_obj, ["HitPart", {
_object = _this select 0 select 0;
_hits = _object getVariable "hitTimes";
_unit = _object getVariable ["KI_unitToKill", objNull];
_light = _object getVariable ["KI_vehToRemove", objNull];
if(isNil "_hits") exitWith { _object setVariable ["hitTimes", 1]; };
if(_hits == 1 && alive _object) exitWith {
for "_i" from 1 to 2 do {
createVehicle ["Bo_GBU12_LGB",[(getPos _object select 0)+ (_i*cos (_i*17.5)),(getPos _object select 1)+ (_i*sin (_i*17.5)),0],[],0,"CAN_COLLIDE"];
_object setDamage 1;
_unit setDamage 1;
deleteVehicle _light;
};
_object setVariable ["hitTimes", 0];
};
_object setVariable ["hitTimes", (_hits + 1)];
}]] remoteExecCall ["addEventHandler", 0, _obj];``` That works as expected, thanks @little eagle
yw
I should've known that earlier. Used remoteExecCall for switchMove animations a while ago and solved it also with remoteExecCall
You could optimize this by using
{_this call My_fnc_hitFridge}
So you
- don't transfer as much data over the network
- circumvent a bug where Arma has to recompile the whole function passed to addEventHandler, because it's stored as string.
And define My_fnc_hitFridge in init.sqf (on every machine)
why are you shooting a fridge though anyway?
Say someone makes a script, and it works flawlessly being hosted via client.
But is completely fudged once hosted on a dedicated server.
Is ther a specific reason Servers don't recognize functions? Or some kind of engine difference that has to be remembered?
@rancid ruin Because I made a fridge with arms and legs and thats an enemy now ๐
nice, can't argue with that
@bitter bough Impossible to tell really. The scripter messed up somewhere. That's all you can say for sure.
Ugh.
Because I know for a fact that things work properly when being hosted. Both client and 'hosted client' side
There is no magic flip to switch to make something like that work
Yeah I know that much. But understanding why servers seem to have a different method for calling functions might.
there's a difference between client and server, that's about all there is to it
need to get locality correct or things won't work as expected
It's Mostly UI errors. Only one thing isn't really. This should be interesting....
_obj setVariable ["KI_unitToKill", _unit];
_obj setVariable ["KI_vehToRemove", _light];```
I tried to ``remoteExecCall`` them with
```sqf
[_obj,"KI_unitToKill", _unit] remoteExecCall ["setVariable", 0, _obj];
[_obj,"KI_vehToRemove", _light] remoteExecCall ["setVariable", 0, _obj];``` is that wrong? The code above works in singleplayer but the one below doesn't :S
_obj setVariable ["KI_vehToRemove", _light, true];```
that will broadcast them so they're everywhere
(the true at the end)
remote exec should work too i think.. but never tried setVariable in remoteExec like that
Currently using a scenario with indi v blu. However I have indi being initially friendly to blu.
Is there a way to make a trigger that, when I shoot/kill one of the indi dudes, they become hostile towards blu?
add killed eventhandlers to the indi guys... But that would mean a lot of eventhandlers
I'm trying to move a huron fuel container inside a trigger by airlifting it with a helicopter
How do I make a trigger that activates once the container has been moved inside of it by the helicopter?
I've tried
objectnamehere in thislist;
and
this && (objectnamehere in thislist);
but it doesn't work nor does putting the objectname in quotes
What am I doing wrong?
i think thislist is only units, not objects?
objectnamehere inArea thisTrigger might work
thisList In Triggers ("Condition" or "On Activation/Deactivation" line): An Array of objects that are currently fulfilling the trigger's condition (same as the what is returned by the list command).
@rocky drum 1 Person or the whole Indi Side hostile to Blu?
For all:
https://community.bistudio.com/wiki/setFriend
Example:
Resistance setFriend [West, 0];```
For a single Person:
https://community.bistudio.com/wiki/addRating
Example:
```sqf
_unit addRating -50000;```
@hollow lantern yeah, but thisList - list of all objects in trigger area, based on 'Activation' and activation can only be None - No default activation, only a custom condition expression can activate the trigger. Anybody - Activated when any object satisfies the 'Activation Condition'. BLUFOR, OPFOR, Independent, Civilian, Game Logic - Activated when any object of the given side satisfies the 'Activation Condition'. Seized by BLUFOR, Seized by OPFOR, Seized by Independent - Activated when the given side is in control of the area. Strength matters, which means one tank can be in control of an area while ten enemy infantrymen are still present. Radio Alpha, Radio Bravo, Radio Charlie, Radio Delta, Radio Echo, Radio Foxtrot, Radio Golf, Radio Hotel, Radio India, Radio Juliet - Activated by a player using a radio command (accessible for the player by pressing 0-0 on a standard keyboard). The trigger 'Text' will be used as the command title.
@vapid frigate Thank you! inarea this trigger worked
np
you probably want that activation on 'none' too
https://community.bistudio.com/wiki/Eden_Editor:_Trigger if u hadn't found it
@jade abyss addRating would make them enemies to all blufor as well? (i don't know a way around it though)
@jade abyss Whole.
Then play around with setFriend
@vapid frigate addrating -2000 = Makes the unit hostile to EVERY other Unit
Yep. Alreay on it. Cheers. It's madness trying to re-learn so many of the easier scripts.
Has anyone ever had issues with unique object variables? On my server with high traffic, many of the players returned from playableUnits randomly just become null.
what's the reason you're using playableUnits? and not allPlayers/similar command
functions*
@cedar kindle Would it make much of a difference though if I used allPlayers or whatever? If the issue is unknown to me, and not related to dead players or whatever, but just players randomly going null
@warm gorge I've had similar issues before and I must say, code optimization is key in that regard, avoid large dumps from allPlayers (what I use) or playableUnits in your instance. @cedar kindle I'm not entirely sure if there is much of a difference in performance over them but I know there are some differences in other areas.
@warm gorge To my knowledge I believe that playableunits works on unoccupied units... this could be avoided by SQF isPlayer _x I believe
playableUnits is slottable units occupied by AI and also players, can't think of when you'd want to use that
as for them going null, the variable will be objNull once the player disconnects but it should not be populated in the list anymore. might happen when they die if no respawn, unsure. If you're using an array argument and passing it around with sleeps etc you could fall into that trap. Hard to say without you posting some code
@cedar kindle Ive noticed the issue mainly through my admin menu, which simply loops through playableUnits, adding them all to a ListBox and then when you click on a player it does a check if the unit isNull, and if it isnt, displays info about the player. For these 'bugged' players, it doesnt show any info, because their null.
But the same issue is with all the menus which use playableUnits. Whenever I chuck their variable in the debug console watch, it shows as null, even know the player is alive and well.
Ive always used playableUnits in most cases as ive seen most other people use it
@rancid ruin Yes 64-bit and an extension.
use allPayers/CBA_fnc_players if you only want players, no reason to use playableUnits. how are you getting the selected player back from uiNS?
@cedar kindle _unit = lbData [1500,lbCurSel 1500];
_unit = call compile format ["%1",_unit];
call compile format
There it is again
Bad code.
What do you recommend instead?
Good code. Sorry I have no time atm.
missionNamespace getVariable format would likely be a lot faster
@tough abyss All good haha
but don't think it'd work with an object anyway
Yes, that's definitely it, QS.
Anyway,
call compile format
is where your code bugs out.
Ty captain
@little eagle Even then, if I just put the variable name of these 'bugged' players in the debug console watch, they show up as null. So wouldnt that be completely separate from using call compile format?
E.g in my case, lets say 'civ_11' is bugged. Ill chuck civ_11 in a watch bar, and it will show up as null even know they are alive and well
But what do you get with the first line
Because those variable names cannot be used to serialize object references.
Is it an object ?
Its players
civ_11 is an object, because all units are objects
If it's already a string why do you format it
And if it's an obj whu do you convert it to str
I don't get it
You cannot do that ^ reliably. That is where the bug is.
Cannot use str _object or format object
It will fail eventually.
My time's up.
If you save an object as an object why do you want to convert it to str anyway to call compile to get the obj
Wat
because you can't save an object to a listbox entry
^
only a string (lbData) or number (lbValue)
This game never fails to surprise me...
you can setvariable on a control.. thats the only way i can think of to work around it
(an array set on the whole listbox)
I understand call compile might not be the best method of doing this, but that isnt the cause of the issue that I know of. I dont see how the way I store a player reference in a list box has anything to do with player variable names (civ_1, civ_2 etc) becoming null
Because you cannot get an obj like this
you can get an object like that
serializing it might be unpredictable, but if you have the right name it should deserialize
I don't think {OBJNAME} = Objname
that's what the 'call' is for
no shit
I definitely am using the right var name, and they are alive. They just sometimes become null, and randomly 'fix' out of no reason
But I don't think it will return the obj anyway
they also null in the debug console watch things?
Yes
harmdhast it does.. it's just _obj = call compile "civ_11"; is the same as doing _obj = civ_11;
(well a lot slower.. but same result)
I'm not used to this kind of call compile sorcery
good, it should've died with a2
@warm gorge just to be clear, you mean objNull and not nil?
never played with editing in a2 anyway
@cedar kindle Yes, objNull
@ShadowRanger Are the players JIP or are they connected and initialized ?
@simple fiber Cant be sure exactly, because its such a high traffic server and it happens only sometimes out of the blue. Id say its JIP players mainly tho
Just use a isNull check when you build your list then :)
all I can tell you is that if the unit is named civ_11 and it's a reference to the player object who is alive, it cannot be objNull. So either you've got the wrong ref or something is overwriting civ_11 variable
@simple fiber I shouldnt have to when they are alive and well, thats the thing. @cedar kindle Thats exactly what I think. Thats why its so confusing to me, I dont know whats causing it. I know 100% im referencing them properly and using the right variables, so its weird
not using the var name elsewhere as well? (on something that gets deleted)
save the list as a gvar and select the index from the listbox maybe? then you avoid the whole serialization between namespaces and don't have to name your player objects with a variable
A check won't cost anything tbh. Assuming you are on AL
- To others, CIV_xx vars are not rewrote
@vapid frigate Id have to go through the whole mission file, but im pretty sure I dont. @cedar kindle Ill probably have a play around with it to see if I can figure anything out. @simple fiber Im not worried about the check, its just the neccesity of the check.
Probably the.best you can go with is to check if the player is JIP with getClientState or.other commands I probably forgot
the only way for them to become objNull is death/disconnect during the selection time
they can die and disconnect while the UI is open
Cheers for the help guys, ill make some changes and see how I go. If I continue with issues, ill be sure to update you all if I can.
๐
Hey o/ I keep getting an undefined variables error when I call _group = (_this select 0); \ _group = setBehaviour "SAFE"; Anyone know what that could be? The script that appears in is called from squad leader init with null = [group this] execVM "waypoints.sqf";
Oh wait, I don't need that = do I
brb kms
@vapid frigate hahaha, awesome ๐
just look at the code and google setBehaviour for an example
Indeed ๐ I'm just still so bad, but getting there ๐ I'll stop posting newb questions sorry
Weird question but where do you guys call disableSerialization in your scripts? At the very top? Or below your main private [] call?
private [] call ? I use it where it's needed just before it's needed
I just sometimes see people call it at the top of their scripts, above or below the most outermost variable private declarations
Not sure what 'habbit' to get into
I can show you what I mean if you want. Not sure i fim allowed to post links to github reps tho
Well.. There is no reason to use it where it's not needed. It might actually hurt. So I don't see a reason to use it at the top of every script
Sure you are allowed to post links.
Nah I dont mean it like that. But I have a lot of scripts which I use disableSerialization in, of course only when I need it though. https://github.com/A3Wasteland/ArmA3_Wasteland.Altis/blob/09bcafd33f5ab6e33e53658a0de1c58b67d51821/client/systems/adminPanel/playerMenu.sqf Example of what I mean, you can see it scalled at the top
Yeah.. okey.. Most people don't consider it as a real part of code and put it just like in the script you linked at the top of the script. together with the header and #defines and other misc stuff that aren't actually part of the script itself.
Personal preference. I like my scripts to be compact. So I'd move the disableSerialization call "out" of my script. Performance wise it's best to do it only when you need it. In the linked script for example if the if block doesn't execute you are still executing disableSerialization. But the performance impact is to small to really care about it.
Alright cheers
Why is it so hard to create something totally new? Bloom's Digital Taxonomy attempts to explain the situation by classifying cognitive abilities with hierarchy based on the difficulty of different aspects and tasks in digital world http://www.teachthought.com/wp-content/uploads/2013/07/Blooms_Digital_Taxonomy.jpg
@tough abyss Why wouldn't they be if they become popular?
I don't like most of the popular youtubers either, but I don't think I can use it as measurement of their intelligence or such stuff
What makes it ironic is that it states exactly that criticizing is a lot easier than creating something actually new (and working)
Yes
It's also interesting how the different levels vary in different persons, eg. I consider myself as good at creating, but very poor in applying/execution
Yup
Alright, let's move on that channel
#offtopic_arma is the general offtopic channel. the other offtopic channels are for specific topics...
What? There are way to many ideas out there and too few that execute them well.
Hi,
I can use ammo to get the current amount of ammo a player has in his weapon. Is there any way, without mods, to check the amount of amo a player has in his vest and backpack (not the amount of magazines, the exact number of rounds)
Like the total number of rounds no matter which weapon?
yes
private _ammo = 0;
{
_ammo = _ammo + (_x select 1);
} forEach magazinesAmmoFull player;
_ammo
thats what I was looking foor; thx
yw
wants std::accumulate
+1
call compile (magazinesAmmoFull player apply {_x select 1} joinString "+")
I thought this chat room might like it
Someone had a really ugly way of sorting things by distance. I think it was @turbid thunder . This might be better https://community.bistudio.com/wiki/BIS_fnc_sortBy it even has an example for sorting by distance
isn't there a neat way to sort arrays using apply?
i'm sure i saw someone post some elegant solution before
sort how
#define ASCEND true
#define DECEND false
private _array = allPlayers;
_array = _array apply {[_x distance player, _x]};
_array sort ASCEND;
_array = _array apply {_x select 1};
_array
I guess. Added something for Dscha.
For one the macro length doesn't affect anything after the precompilation, and two, it's readable ๐
By length I mean it takes longer to type so more work
Might aswell bind it to a key then ๐
Lol
Hi guys, can any one help me with PlayerViewChanged EH, trying to make a 3d person limiter with out nasty loops
Last time I tried it was pretty broken.
longer to type == more work? Most scripters have autocomplete
Unusable in MP
Well.. Might work good enoughish for first/third person switching... Wasn't that the problem with it not detecting the view change in Zeus Remote Control?
im ok with vehicles
Sometimes executed, sometimes didn't.
i actually want 3d person to be enabled when inside vehicle ๐
You can try to use it. What's the problem?
no idea how to code it ๐ฆ
Oh, this has nothing to do with cameraViewbtw. So you can't get rid of those loops.
how so ?
oldCameraOn: Object - cameraOn before EH fired
newCameraOn: Object - cameraOn after EH fired
after 13 years they still cant make it right....
Trying to limit a unit to only using standing and crouched positions. How do I disable prone?
setUnitPos "UP"
or
setUnitPos "MIDDLE"
But no way to allow both, but disable "DOWN" (prone)
There's also a button for this in the editor. It uses the same icons as the stance indicator.
yeah nice sort function commy. i think you wrote that exact thing here before lol
compileFinal doesn't work on functions stored in a displays namespace. Can overwrite them without problems. :/
Is there list of default displays somewhere?
Eg. display 46 is default display, Zeus interface is display/IDD 312, 12 is map etc...
Display list is config. I'm quite sure I told you that already
Just grab a allInOne config and search for idd and you'll get all existing display ID's
#46 is not the "default display"
#46 is RscDisplayMission
If there is an "default display" then it's RscDisplayMain or #0
Pretty sure zeus - RscDisplayCurator is 313, not 312
#49 is the pause menu - RscDisplay(MP)Interrupt
@still forum How do I "grab an allInOne config"? ๐
@tender fossil http://lmgtfy.com/?q=allInOne+config+arma+3
Sorry ๐คฃ
Ahh, it was literally "allInOne" instead of retoric clause lol
Helicoptergunner dolookat (player pointer) -> headtrack turret while pilot?
@vapid frigate Yep broadcasting the variable with true helped, thx
hmmm but now the fridge will explode eveytime when someone hits it. weird
it should be like --> two times hit --> boom --> end
hmm lets see
Helicoptergunner dolookat (player pointer) -> headtrack turret while pilot?
what
??
is it possible to spawn blood decals? Or?
is it an Object?
I'm honestly not sure.
=}
Weird question, but do you guys think a developer position on a server deserves the same sort of gratitude that a regular staff member (moderator/admin) would deserve?
Ask yourself: What would the Mod/Admin do without a Dev? What would a Dev do without a Mod/Admin? Whats more needed?
Yeah, well im in a bit of a 'sticky' situation haha. But id say a dev would be more needed, cause without them, you wouldnt have the server.
@jade abyss Just a bit difficult when you have someone who doesnt understand coding and all the work that I do, and doesnt think its worthy of a higher staff position.
Do what i would do, if they got a Problem say: "Good luck finding the problem"
Haha yeah
@tough abyss at that point the owner would label himself Developer
You won't get gratitude and appreciation because you are developping for random kiddos on life servers. There are communities out there that have a huge respect for their developpers / content makers including mine
It just depends if the admins recognize the amount of work needed or if they just don't care
But as ShadowRanger asked, I think a developper should be at the same level as an admin or mod. They often need access to the server and they have access to all the content. A dev must be someone you can trust like an admin
there's a difference between true appreciation and appreciation so that you keep working for them ๐
and most of the time it's the last case
what is a "higher staff position"? if they're not paying you then why would you care about an imaginary internet rank?
either get paid or do it cos you love doing it. that's my rule of thumb
Yeah but certain access does help with developing, such as access to the server files etc
yeah, you make good points
i'd say just work with friends, or at least people who you share mutual respect with
i predict you're probably working with 14 year old "admins" on a life server or something?
Nah much older, just one of the admins doesnt understand coding as well as I do or the other main admin does, which makes things difficult sometimes
but it is a life server right?
Yes
there you go then
lol
I code because I enjoy it and I like seeing people enjoy what I make. Its also good experience for me as im still fairly young. But not everyone understands the amount of work that can go into coding and how long some things actually take
i don't really mean that in a nasty way, but the life people are basically only known for disrespecting developers
I understand what you're saying
Would it be worth moving from using cursorTarget to cursorObject in most cases for getting the cursor target object for vehicles, players, buildings etc?
Ive noticed from when ive used it so far its a lot more accurate, and doesn't have detection/reveal issues like cursorTarget
I only use cursorTarget for in game debugging, trying to target a moving object eg helicopter
@thin pine What do you use for non-debugging purposes? Theres not really many other choices for getting targets
In my scripting activities so far I haven't really had a need for the cursor target/object grabbing commands other than a nametag script I wrote years ago
cursorTarget only returns something when the object can actually be identified. Imagine it like when it is night and you play on low difficulty that sometimes it isnt really telling you what unit you are aiming at, or the unit is not visible on the map even though it is pretty close to you and in your line of sight. Basically you need to have some level of knowsAbout or else it wont return something. cursorObject is going strictly by line of sight and doesnt care if you can actually see it (based on weather, fog, time of day ect)
If you need a reason to live, just look to the easily scripted AI of arma that always works and does everything you tell it to do to the letter.๐ ๐ซ
what are you having trouble with?
Nothing I can't work out msyelf. Mostly I'm dealing with pathing and unable to do more than leave it up to chance on whether or not the AI I'm working with will do what I want.
Just thought I'd leave that message. You know. For inspiration.
if !(meaning in life) exitWith {setDamage 1;};
โฌ ๐
Old joke, was used 1 month ago
^
In that case
setDamage [1, false];
@tough abyss
And why would you use alternative syntax?
Its defaulting to false anyways
I wasnt even aware it had an alternative syntax
Me neither
@rotund cypress Based on the wiki, true is default
false to skip destruction effects
I guess that is so turn vehicles into wreckages without them exploding? Hmmmm
lol
Never bothered about use efffects, never knew what it did, and AFAIK it defaulted to false, but I guess I were wrong ๐คฃ
The alt syntax was only added in v1.67.
makes sense
Is there a way to expand "doTarget" to allow multiple targets?
@rocky drum A unit can only always have one target assigned to it (although that doesnt mean that it will only shoot that target)
@tough abyss Theres still even a lot of missing BIS functions on the wiki from the current version and several previous versions. Not sure if youll see the dev version functions there anytime soon
https://community.bistudio.com/wiki/forgetTarget is this a dream? :O
if (dream in life) exitWith {call _fnc_wakeUpPlayer};
Is there any way to sort a combo box alphabetically? Unfortunately theres no similar lbSort command for combo boxes
Try lbsort
@thin pine lbsort doesn't work ^^
Surprised theres not a command for it already. Might be worth making a suggestion on the Arma 3 Feedback Tracker
@warm gorge A workaround would be to put all items in the format of ["text","value"] into one array and then use the sort command and add them back to the combobox
It will use the first element of a sub array
So if the display text is the first element in the items array, it will sort alphabetically
@warm gorge Does that make sense to you?
@tame portal In my case, im trying to sort allPlayers/playableUnits array by their names, so id assume you mean save their name, and object reference to a 2d array and then sort before looping through it and adding it to the combo box?
Yes
I'd do it like this
Foreach player object do
_allunitstosort pushBack [name _x, _x];
Then so
_allunitstosort sort false;
Then loop through _allunitstosort and add them to the combobox
Alright ill give that a go. That wouldnt be too performance inneficient would it?
For a menu that might get constantly opened
Instead of optixes pushback you could also use apply if you want to be fancy :p
@tame portal @thin pine Tried using apply for this, but doesn't seem to be working properly.
_players = allPlayers apply {name _x; _x};
_players sort true;
facepalm
_players = allPlayers apply {[name _x, _x]}; _players sort true;
Additionally _players = _players apply {_this select 1} Now you have array of player objects sorted by name
@still forum Ah I see, sorry bout that. Couldnt quite understand how the apply command works. The documentation on the wiki doesnt explain it very well/not enough examples imo. Thanks though, that works perfectly
https://community.bistudio.com/wiki/isEqualTo "It can compare Arrays, Scripts and Booleans (alive player isEqualTo true)" so yes, it should work
@Quiksilver#5042 why would you need to compare a bool though?
Its already true or false so using a command to return a bool if you already have one seems weird
seems like he's comparing the previous state
So apperantly you can just use "Player moveInDriver" on DLC vehicles to "circumvent" the DLC restriction?
@quasi thicket You can also use the arsenal to assign yourself DLC weapons but you'll be greeted with an unremovable huge watermark that covers, well, your entire screen
Is there a way to workaround AI taking the place of player units who get kicked off the game such as through client not responding?
Yay, new update on dev branch as usual, saw something interesting BIS_fnc_admin, anyone found out what it does yet?
Oh already on the wiki lol ๐
Surprisingly
Ironic or no? ๐
Killzone Kid is on top of new things usually
Aah alright
There are still tons of BIS functions missing though. Someone could probably convince him to run https://community.bistudio.com/wiki/BIS_fnc_exportFunctionsToWiki
I tried contacting people to update it, havent spoken to KK tho, might send him a PM now
He is not on Discord though @warm gorge
Yeah on the forums
He reads forum PMs. When I checked 6+ months ago there were 200+ functions missing from the wiki
You don't seem to be doing anything at the moment, you could add them. ๐
Does he have access though? ๐ค
None of us have access to exporting the output of that command
oh? I thought it was available for anyone
Well you can for individual functions, you just can't do a full dump
There is, just contact @lavish ocean
I wanted to add examples, but I couldn't
I sent him a PM on the forums and he made me one
I think the wiki formatting has slightly changed though so some editing is probably necessary
Ah nice, @warm gorge just PMd him on DS
Note to self: don't try exporting all the functions at once.
Seems to take a while.
Yeah I tried the other day aha
Is there a guide somewhere on how to make changes to the wiki? I dont understand the formatting for this
๐
cheers
can someone tell mich wich scriptlanguage is the most comparable to sqf`?
ok, who wants the 70,682 lines of functions export? ๐
C
There is a few languages which has it similarities though
I believe PHP can be quite similar in some ways as well
@waxen jacinth
ah, cheers!
C like syntax, but not statically typed, somewhat JS like @waxen jacinth
Really just a mash of a lot of languages
yeh thought there might be one wich is really similiar
It actually let you export all the functions? I'm pretty sure when I tried I hit the string limit. If you look at the "source" for BIS_fnc_admin you should be able to get a general idea of the formatting as well
that's a lot of missing functions
Yeah wow aha. I messaged Killzone, hopefully he can update it. Doubt anyone wants to add them all manually
I think you could dump the whole export to wiki in one go
How bad is a constant 5 FPS (server fps) for a server with 100+ players?
Well I wouldn't perform any AI tasks with it. Also players newly joining will have another daytime than players who are online for longer (in default). Loops / sleeps take longer serversided, etc.
"CHECKVISIBLE" - disables visibility raycasts
What exactly does 'raycasts' mean?
Does anyone have any experience with crashes with error STATUS_INTEGER_DIVIDE_BY_ZERO? I'm running a query with extDB3 and it stops after that with that error
sounds like I'll just not confuse myself with more locality issues.
anyone versed in the art of CBA perFrameHandler?
Due to locality issues, I need to use it so I can disable certain AI functions on a loop.
And then at a certain point, I will remove the PFH so the AI can resume normal behaviour
Locality issues = 2 Headless clients.
I could be using the removePFH wrong, but I'm not certain
I can test that. But I've been told to use PFH because once locality changes to a diff HC, it resets the AI
is there some hack to detect a weapon deployed event reliably?
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#WeaponDeployed
according to reyhard it triggers also when your weapon cant be deployed ("WeaponDeployed is triggered every time you are deployed. if you don't have a bipod you can still deploy")
the made the workaround to add the EH via weaponInfoType dialog onload of the desired weapon and apply some magic
{
onLoad="[...]; _this call rhs_fnc_handle_pk;";
};
//cfgWeapon class:
weaponInfoType = "rhs_rscOptics_pkm";```
script itself:
http://paste.ubuntu.com/24421669/
does that trigger properly? and isWeaponDeployed is reliable? ๐ฎ
thanks. will do some tests now
@tough abyss I take it I can't just plug that into the 'on activation' section of a trigger can I?
Hey, im scripting a mission for Arma2, using the RE command. (remoteexecute). I need an object that will always be local on the server so the
RE only executes on the server
any hints?
remoteExec does not exist in A2
this is arma 2 and it works ;p im currently using this line
[nil, nil, rEXECVM, "custom\server_kickplayer.sqf", player] call RE;
but I only want the kickplayer script to run on server. not on clients
the wiki says if I change the 2nd nil to some object local on server it should be god
It will be the same performance wise you think?
negligible difference
alright thanks
On all clients is public variable eventhandler that executes scripts that corresponds to less-than-100-percent-multiplayer-working script commands. One script for one commands, no string sending that will be compiled and executed for the sake of clarity and easiness of creating MP-friendly commands from the engine MP-unfriendly ones.
Who wrote this?
bis_functions_mainscope should be a game logic always local to the server, but I can't recall if this existed back in A2.
I didn't understand that part lol
let me test bis_functions_mainscope
looks like that variable exists
so you are sure bis_functions_mainscope is NOT local on clients?
I don't have a dedi server to test :->
//--- Create functions logic (cannot be created when game is launching; server only)
if (isserver && isnull (missionnamespace getvariable ["bis_functions_mainscope",objnull]) && !isnil {uinamespace getvariable "bis_fnc_init"} && worldname != "") then {
private ["_grpLogic"];
createcenter sidelogic;
_grpLogic = creategroup sidelogic;
bis_functions_mainscope = _grpLogic createunit ["Logic",[9,9,9],[],0,"none"];
bis_functions_mainscope setvariable ["isDedicated",isDedicated,true];
//--- Support for netId in SP (used in BIS_fnc_netId, BIS_fnc_objectFromNetId, BIS_fnc_groupFromNetId)
//--- Format [netId1,grpOrObj1,netId2,grpOrObj2,...]
if (!isMultiplayer) then {bis_functions_mainscope setVariable ["BIS_fnc_netId_globIDs_SP", []]};
publicvariable "bis_functions_mainscope";
};
initFunctions.sqf
thank you โค
This is from A3, but this sure looks like code old enough for the A2 days. And I doubt they changed it since.
hey guys
i got a script that generates random locations based on some input
i'm trying to test it via the console
if i spawn the function it seems to work okay
but when i try to player setPos to the function return value it gives me a generic error
i've tried a few things but it still gives a generic error with no explanation
currently trying this:
my_fnc = compile preprocessFile "scripts\randLoc.sqf";
_posVal = [9000,18000,100,0.8] call my_fnc;
so i tried that as well
my_fnc = compile preprocessFile "scripts\randLoc.sqf";
_posVal = [9000,18000,100,0.8] spawn my_fnc;
player setPos _posVal;
and i still get a generic error but now with the player setPos part
nah not like that
spawn won't give you the return value
it will give you a reference to the spawned 'thread'
[] spawn {
my_fnc = compile preprocessFile "scripts\randLoc.sqf";
_posVal = [9000,18000,100,0.8] call my_fnc;
player setpos _posVal;
};```
oh i see let me give that a shot
still giving me an error:
18:47:35 Error in expression <essFile "scripts\randLoc.sqf";
_posVal = [9000,18000,100,0.8] call my_fnc;
pla>
18:47:35 Error position: <= [9000,18000,100,0.8] call my_fnc;
pla>
18:47:35 Error Generic error in expression
hmm don't see what's wrong with that
unless you can't have _privates in debug console? i think you can in that spawn at least though
hm
so its got something to do with player setpos _posval
the call to my_fnc seems to go through alright
my_fnc hints the new coordinates
so i see that once i return to game
does your function definitely return a position?
_posVal = [9000,18000,100,0.8] spawn my_fnc; <---
so if you do my_pos = instead of _posval =
hint format ["%1,%2,%3", _randLoc select 0, _randLoc select 1, _randLoc select 2];
returnVal = _randLoc;
_posVal = [9000,18000,100,0.8] spawn my_fnc; <-- spawn -> call
yeh explained that already dscha
and the hint returns a location properly
No clue, there is too much codestuff without the CodeTag in here, hard to keep track of everything
```sqf
CODE
```
yeah i was just using the
_returnVal = _randLoc;
as an organizer but it should still work as a return value no?
or does that a pointer to _randLoc instead?
return a *
First of all: What are you trying to achieve?
i'm trying to test a random location script i wrote
so i've been using combinations of call/spawn/execVM in the console
execVM? Why?
[] spawn {
my_fnc = compile preprocessFile "scripts\randLoc.sqf";
posVal = [9000,18000,100,0.8] call my_fnc;
player setpos posVal;
};
so i findthat the first 2 lines of the spawn { } works
the last line of your function needs to return something
so needs to just be _randLoc
or _returnVal
how does "randLoc.sqf" look like?
if it's a statement, it'll just return 'nil'
ok one sec let me change that real quick lecks
i'll post the code in a pastebin if its still problematic
Just paste (next time) the whole Code in here, if you need help. Guessing what the rest of the code looks like is pretty annoying and wastes alot of time
ah okay that worked
thanks guys
so if i understand correctly
is it because the statement _returnVal = _randLoc doesn't actually return
yeah
the return statement of sqf has to be a single line
that just assigns _returnVal
that like calls the variable
my_fnc = {_a = 1; _a};
hint str (call my_fnc); //Result: "1"
ok i get it, thanks guys!
Question for the Alive experts! Does the TAOR Markers need to be square or circle?
either
you might want to ask ALiVE related stuff on our forums http://alivemod.com/forum/ or discord https://discord.gg/Z3cYUwJ ๐
As i was playing around with fired EH:
Anyone know a way to find out, when a bullet hit something?
@hasty violet Yeah actually, I used it a couple weeks ago and had the same issue, didn't understand what was going on
Why not do it the other way around with
https://community.bistudio.com/wiki/selectRandom
?
That doesnt shuffle the whole array though
it should be random ```private _cnt = count _this;
for "_i" from 1 to _cnt do {
_this pushBack (_this deleteAt floor random _cnt);
};
actually i guess that could leave chunks of the original
It is as random as the random command can get
but it could be pushing back the same ones each time
Having 3 Entrys in it and expecting everytime a different result is... erm.. yeah ๐
It could, it's random after all ๐
so it has a pretty high probability of having chunks from the original
unless it happens to do at least every 2nd one
It has the same probability as not having the same pattern as the original
There also is `CBA_fnc_shuffleยด
Depending on the frequency of non unique elements, of course
Isn't it the same code commy?
No idea.
I can't imagine BIS_fnc_arrayShuffle being not random though.
Well you are playing with randomness here. So maybe you're just unlucky.
Just shuffle a random number of times
@jade abyss In regards to a bullet hit event, I dont believe there is one. Only thing I could think of doing is using a waitUntil {isNull _projectile} in a Fired event handler
And that isn't safe for projectiles that can bounce.
Are you saying that Arma spawns a new projectile when it bounces off a surface?
No, but the projectile isn't deleted when it hits. It bounces.
I see
Yeah, that hit doesn't seem to work anymore.
+isNull is pretty useless, as (since commy said) they bounce around
none of them triggered -.-
_projectile addEventHandler ["Explosion", {systemchat format["Explosion: %1",_this];}];
_projectile addEventHandler ["HandleDamage", {systemchat format["HandleDamage: %1",_this];}];
_projectile addEventHandler ["HitPart", {systemchat format["HitPart: %1",_this];}];
_projectile addEventHandler ["Hit", {systemchat format["Hit: %1",_this];}];
_projectile addEventHandler ["Killed", {systemchat format["Killed: %1",_this];}];
_projectile addEventHandler ["Dammaged", {systemchat format["Dammaged: %1",_this];}];
_projectile addEventHandler ["Deleted", {systemchat format["Deleted: %1",_this];}];```
CfgAmmo have no eventhandlers in A3.
meh
Not even init ๐ฆ
Agreed.
Well you could add Got infront of each of these EH's. GotDamaged GotDeleted GotHit. That's also what they do on other objects
?
And a projectile doesn't get hit
You suggest it could already exist?
Just saying it's logical that these EH's don't work. Because the Hit eventhandler is a HasBeenHit eventhandler. Not hasHitSomething
Like the Killed EH. It only checks hasBeenKilled. Not if a Player hasKilled something
There is no difference in a projectile hitting you at 600 m/s or you running into a still projectile.with 600 m/s technically.
dat censorship
Hit EH on the projectile will probably fire if you hit the projectile with a projectile
Nope
@still forum Is that physically possible to do?
I don't think so
No, dedmen. Hit eh on a mine doesn't trigger when you shoot the mine.
โ
Neither does "killed"
๐คฆ
wasn't there somthing like ExplosionNearby
Yes, let's attach a gamelogic with explosion nearby eventhandler to every mine.
"Explosion"
๐ฌ
Armitxes
Triggered when a vehicle or unit is damaged by a nearby explosion. It can be assigned to a remote unit or vehicle but will only fire on the PC where EH is added and explosion is local, i.e. it really needs to be added on every PC and JIP and will fire only where the explosion is originated.```
btw... hmm...
re arrayShuffle, https://i.snag.gy/cD81lO.jpg
You can get the projectile fairy easily, QS with incoming missile.
can i shoot myself?
But passing it would be prefered.
hmm
mom =}
lulz
params ["_vehicle", "_ammo", "_whoFired"];
private _projectile = getPos _whoFired nearestObject _ammo;
This was like the first trick I was told in SQF.
getPos is probably not even needed...
what the?
?
Are you still using that?
IncomingMissile doesn't give the projectile, Dscha, so yes.
player addEventHandler ["Fired", {call My_fnc_firedEH;}];
My_fnc_firedEH =
{
params["_unit","_weapon","_muzzle","_mode","_ammo","_magazine","_projectile","_gunner"];
};```
IncomingMissile, not Fired
incoming... hmpf
Only the unary syntax according to the wiki
nearestObject
nearestObject [position, type]
It can if it has splash damage.
yes
It will phase through the shooter.
I guess so it doesn't collide with your own hitbox.
Yep, it ignores the player/shooter
vehicle player addEventHandler ["Fired", {call My_fnc_Handle_Projectile;}];
My_fnc_Handle_Projectile =
{
params["_unit","_weapon","_muzzle","_mode","_ammo","_magazine","_projectile","_gunner"];
_projectile spawn
{
uisleep 0.5;
_pos = player getRelPos [-5, 0];
_this setPos [_pos select 0,_pos select 1, 0.2];
};
};```
๐คฆ
๐คฆ ๐คฆ ๐คฆ
๐
๐
Damnit, i need a hit detection for the bullet -.-
You could create a ticket on the feedback tracker ๐
uh wiat, haven't tested EPE stuff yet
Yeah, sure. Sry, but i gave up on Feedback Tracker
If you have a bug, like animate being borked, just add a note to the wiki.
KK will reverse your change and say that the bug has been scheduled for a fix.
i still want that one pretty hard -.-
https://feedback.bistudio.com/T123926
Still waiting on that set of commands that removes items etc. from ammo boxes / vehicle cargo.
They were running out of budget after setUnitLoadout
hehe
"setVehicleLoadout" was too expensive
nah
EntityCreated
T_T
naaahhh
Concerning bullet stuff https://feedback.bistudio.com/T84736 But that's not really a hit handler
Yep
"Realistic tank armour" kinda like the direction why i need it
Projectile hits an object, EH trigger that gives out the vehicle that was hit, position, worldToModel Pos of Vehicle, maybe the angle it came from/in
โฌ Having said EH return the hit pos' armour angle could also be useful.
Could be used together with the projectile's angle in order to determine if penetration occurred.
Of couse, having all of that engine based would be nice ๐
Is there a base class for all types of Objects/Structures like Sandbags, Walls, Buildings and so on? Everything with the classname "Land_xxxxxxx". I search for something that I can use like "isKindOf "Land_base_F"
I think there is a Building class. Best way to find out would be to check the config Viewer. I don't have my game open right now.
@still forum I've already spent a lot of minutes in the config viewer. Maybe I am too brain AFK ^^ @tough abyss THANKS! Welcome back to arma... where buildings are under vehicles ^^ I have missed that xD
I am waiting for signature checks on extensions since almost a year.. but security obviously isnt worth enough too
Hey
I have the weirdest issue
_usedSpots = fullCrew [_vehicle,''];
_allSpots = fullCrew [_vehicle,'',true];
_emptySpots = _allSpots - _usedSpots;
_emptySpots = (count _emptySpots);
private _transUnitList = [];
_transUnitArray = call compile format ["_%1_%2",_side,_units];
_transGroup = createGroup (_side);
_unitPos = [(_pos select 0),_dist,[nil, _dist] select _out] call BRM_aiMaster_fnc_landPos;
{
_unit = _transGroup createUnit [ _x, _unitPos, [], 20, "NONE" ];
_unit setVariable ["unit_side", (_side)];
_unit setVariable ["aiMaster_cleanUp",true,true];
_unit addEventHandler ["Hit", BRM_FMK_fnc_setHitFace];
_unit addEventHandler ["Hit", {(_this select 0)setVariable["last_damage",_this select 1]}];
_unit addEventHandler ["Killed", BRM_fnc_onAIKilled];
_unit addEventHandler ["Killed", BRM_aiMaster_fnc_onKilled];
_unit setSkill _skill;
_unit setskill ["aimingAccuracy",0.6];
_unit setskill ["aimingShake",0.5];
_unit setskill ["aimingSpeed",0.5];
if (_offensive select 1) then {
_unit disableAI "AUTOCOMBAT";
};
if (side _unit == east) then {[_unit, "VANILLA"] call BRM_fnc_initAI;};
if (side _unit == west) then {[_unit, "VANILLA"] call BRM_fnc_initAI;};
if (side _unit == resistance) then {[_unit, "VANILLA"] call BRM_fnc_initAI;};
_transUnitList = _transUnitList pushBack _unit;
//_voice = selectRandom ["Male01PER","Male02PER","Male03PER"];
//_unit setSpeaker _voice;
true
} count _transUnitArray;
This fails because the 2nd time it loops the count, it says _transUnitList is number, expected array
//_transUnitList == [];
//after _transUnitList = _transUnitList pushBack _unit;
// _transUnitList == 0;
why?
haha np
Rhanks ๐
Spent over an hour trying to figure this out. It's the darn easiest things ๐
So I unpacked the Dynamic Recon Ops mission to try and add Zeus to it - for personal use, no intent to redistribute etc - but it doesn't seem to want to stick. It lists the first player as u1, doesn't destroy or replace that unit, even codes u1 in as the server admin... but adding a Zeus token with u1 as the owner doesn't allow for Zeus to be opened :/
Okay, it CAN work, but only if I cancel the mission setup menu... which you can't reopen, effectively breaking the mission. Hm.
And for a few brief seconds after the mission begins, too... narrowing down.
Do you have permission to do so?
No, I have not sought out the mission maker's permission to edit the mission, but I also have no intent on releasing it. But I understand the concern :/
It's one thing to have a peek to see how a mission maker has solved a particular problem, but it's quite another to alter someone's mission without permission.
I mean. It would really depend if you release it publicly. I edit missions from the workshop all the time for fun with my friends.
FM is right, though. I mean, without monetization its not crime of the century, but its still a sketchy thing to do - not everyone who says they'll keep it private means it, intentionally or not.
Indeed.
If they wanted it to be private, then why* would they release it ๐ค ?
jesus, mashed that
I get what you mean, but that feels like slippery slope to Ayn Rand "im a creator but i never write down my work because you arent worthy of it"ism.
Was it workshop?
Gotta have a peek at the license, very few limit you to do your own thing (w/o redis)
Most people will give you permission if you just ask. But, not asking, at its most basic level, is disrespectful.
If they have released something for the public to use, and you alter that for your own private usage, that's perfectly normal
You wouldn't say that about a mod, so why would you say that about a mission?
Aslong as he is remixing the mission itself, and not using its contents for his own creation
Regardless, gotta check license. I can't think of one which would revoke that right
No one will use his changes if he does not release it, why is there a problem with modifying something only you know you have modified?
In order to add Zeus to a mission via script: ```SQF
private "_curator";
_curator = (createGroup sideLogic) createUnit ["ModuleCurator_F", [0, 0, 0] , [], 0, ""]; // Create curator module, needed in order to assign a curator
player assignCurator _curator; // Assign a curator, the user in our case
openCuratorInterface; // Force open the curator interface
// Called with (requires CBA)
QUOTE(closeDialog 0; [] remoteExecCall [ARR_2(QQFUNC(openZeus), 0)]);
Again, at the most simple level, it's courtesy. Because you're tinkering with someone else's creation without at the very least even asking.
"Hey, can I change this line right here to do this so I can have fun with it for 5 minutes?"
rofl
NOTE: all player will be able to use Zeus (in case you're planning on using the above in MP).
And then someone who was playing on said mission likes it, makes a few edits themselves, then the next thing you know it's on SW.
But he said he was only using it himself? ๐ค
It's this attitude of "I don't need to ask permission" that has led to the recent wave of bans.
Its not that, people should defo ask for permission
^ as I said, intentional or not. The topic is a bit moot at this point, however - I have posted a comment on his SW page asking his opinion on edits.
But changing something that you are only gonna use locally?
I don't see the problem with alter content as long as you're using privately.
^^
I've done it, and I'll continue to. Hasn't caused any trouble to original creators or me as of right now.
How will people know that someone has changed it? If he is the only one using it?
^
Its a content creator thing, additionally as FM said, if I played with someone they get a copy, and may be less scrupulous about content rights.
Of course, but then its not locally anymore which makes it another thing
And then if he is a cunt and shares it, he will deal with the problems
Also, what "recent wave of bans" if I may ask? (@open vigil)
And he already have a copy which he can download from WS
Look at groups who alter community made mods for their own purposes.
have a look in #ip_rights_violations
@tough abyss those groups you just mentioned were the target of some of those bans
Tens, if not hundreds of folks get their hands on modified scripts and configs. Yet noone get hurt.
@open vigil 23rd Tactical Realism Unit, 1st Recon Battalion, DBH Server, RAEF?
TBH what they is pretty dumb.
Plenty of other ways to distribue content to a certain group of people with anyone external knowing.
You can even set SW mods to "friends only".
IIRC workshop moderators will be able to see it.
But why would he if no one Reports that. And I'm not sure if Dwarden even cares about private items with only a handful of subscribers
^
If it's reported, it gets dealt with. Anyways, back to Scripting ^, or you may continue in #ip_rights_violations
How do I prevent an object I'm towing from an attachto script to not have any collision damage around players? I've tried DisableCollisionWith.. but no luck
think attachTo'd stuff will never have collision
That's wrong, otherwise how could you kill people in ACE3 with the tyres you carry?
Collision is still on even when using attachTo
@viral lance You probably made a mistake with the locality. How'd you execute the command?
was that just an arma 2 limitation? i coulda sworn..
So, is drawIcon3D local via on a player? Or is it server wide?
local
I dunno what it was like in Arma 2 tbh, but atleast in Arma 3, the collision is still there and it is pretty deadly aswell
Just saying, that whole tyre carrying in ACE3, you can wreck vehicles aswell as people with it
Alright just making sure. Gotta be sure before I use it.
Is there any good way to reduce loading time into a editor mission(on like tanoa)?
make your the postInit scripts unscheduled I guess.
Noice!
@pliant stream ^
Pretty sure you mentioned this the other day ๐ I said we needed it!
interesting
are pv ehs not in wide usage in a3 anymore?
does everyone just use this RE thing
i only deal in a2 personally, and added _owner to server side pv ehs
PVEHs are still massively used, shame they didn't include it with this, ๐ค though
How do you know?
is there an opportunity to get a pitch/bank change for a camera into camcommit without a big workaround?^^
That command allows for some fancy things
Nothing that couldn't be done before aside from security stuff I guess.
I'm trying to come up with a MP compatible way to link any player in the mission (who has a particular backpack) to the BIS support requestor, and then unlink them if they take that pack off. Pretty much a no frills JTAC script. Does anyone know of a script that already does this?
I don't think there is. I opened the module function and it execVMs a script that requires the exact module to be present (classname hardcoded) and that script starts a fsm. Really convoluted stuff. Probably not possible to disable it without rewriting it all.
hi guys, a question. I have a server of altis life, i want make a script when if you are in range of an PVP action, if start show a popup message whit "you want start the action?" if selected yes the script force the first person and count the position in 2 km on the center of action if you go out, go out of the action and can use third person camera and report "this guy left the action zone"... is something possible to make?
Yes it's possible. Almost everything is possible in Arma
Is there any benefit using uiSleep over sleep? In my case for loops on a server mission file
If your game is paused sleep will also pause. uiSleep will continue running
Not correct! ๐
๐
and i quote again "uiSleep is basically using the system time (uiTime more specifically) and not simulation time."
true. ^^
(ignore us both from now on, thats a topic we often have)
Sorry to sound ignorant, but im a bit insure what the difference is between system time and simulation time
diag_tickTime is systemTime.. Well.. Offset from game start in systemTime
Simulation can be paused
For example when you tab out in singleplayer. uiTime will continue running but simulation time will be stopped
So using it on a server mission file over sleep wouldnt make a difference? Because theres no UI on the server
also when you change the Speed in Singleplayer. Simulation time will accelerate uiTime won't
Also: When your FPS is low (below 10) -> sleep can be delayed, uisleep don't
Its just the name, you can use it on the server aswell
IMO generally uiSleep is the better choice.. But in most situations it doesn't matter
โ
And thats the point, where we agree again and you can start listening to us again
๐
If you really want to go OCD then you can add these 2 characters to all your Sleeps. But I wouldn't waste that time (Hah! time! sleep! ๐ )
So if uiSleep doesnt get affected by low FPS, remember this is on the server in my case, wouldnt that be the better option in most cases?
Cause im having a lot of issues with the sleep command as its not accurate when the server fps is low
I would use uisleep on the Server. Thats the first thing that goes down in FPS (CPS), so its pretty important that the sleeptimer is started precisely
Yes.
There is also the possibility of using diag_TickTime and waitUntil, but... nah
Is waitUntil similar at all? Is it less efficient or whatever
_EndTime = diag_tickTime + (5*60); //5min
waitUntil{diag_TickTime > _EndTime; uisleep 1};```
added a sleep as an example
waitUntil checks it's condition every frame or every few frames. And if it's true it continues the script
waitUntil would fire up each frame (wich is most of the time not needed)
It is less efficient than (ui)sleep because it has to execute the script in it's condition. (ui)sleep is evaluated engine side without calling scripts
even an uisleep 0.01 can make a difference
Exactly.
So: Stick with uisleep, its enough
So if you just want to sleep. And have fps problems anyway. Stick(Not the wooden one) with (ui)sleep
Ah yep I see, I think ill swap over to uiSleep. A bit confused on the difference between systemTime and simulationTime tho
yepyep
Just to confirm, is uiSleep affected by server FPS at all? Or just a lot less than sleep
TBH Sleep also shouldn't be affected by FPS... What's probably happening is that the script scheduler is so filled up that it doesn't execute the sleeping script right after the sleep ran out...
naaahhh, that sleep can be delayed is okay.
Cycletime is reduced, so time goes on "slower"
If the scheduler is the problem uiSleep won't make it better.
Wait, its not "okay", but its correct