#arma3_scripting
1 messages ยท Page 513 of 1
isKindOf checks if a config class inherits a specific other class
typeOf returns the classname of your class
you can use ANY class in isKindOf, tank or car are not special
anything you target outside of CfgVehicles with isKindOf needs to use alt syntax correct?
Is there a easy way to check if is "car" or "tank"?
if(car isKindOF "car") then
{
};
if(tank isKindOf "tank") then
{
};
or better say what "kind" he is?
Yup, I dont.
Look at the picture in inheritsFrom. Every class "isKindOf" everything above it
Let's take the prowler.
The prowler's inheritance is like this
All -> AllVehicles -> Land -> LandVehicle -> Car -> Car_F -> LSV_01_base_F
For every one of these isKindOf will return true
@high marsh maybe anything else the thing im looking at might be?
Look at dedmen's example
Just make a list of types that you want to check, and check them.
prowler will return true with isKindOf in the targetS: Land, LandVehicle, Car, Car_F, AllVehicles, All, etc
Like if you want all tanks use isKindOf Tank.
And so forth
So, is just impossible to know what kind is my object im looking at with out have to compare to a already know one?
What..?
You can compare whatever you're looking at to whatever exists in the entire scope of arma.
That being, every possible type of vehicle.
Yes but I want to known what kind he is
What exactly are you trying to do?
What do you mean what kind? We suppose you were trying to find what TYPE the vehicle was
Im looking at a object and I need to know what kind he is, I need to know if he is a "tank","car","atackHellicopter" or watterver with out have to compare.
params
[
["_yourThingyMabBob",objNull,[objNull]]
];
{
if(_yourThingyMabBob isKindOf _x) then
{
};
} forEach ["tank","car","air"];
๐
and if you want to do something different for each type, then you simply remove the forEach and add your own checks
Explain.
He's not talking to you
He's responding to Roque_THE_GAMERToday at 9:23 AM I need to know if he is a "tank","car","atackHellicopter" or watterver with out have to compare.
"Without having to compare", what's the point then? You need to compare.
"tank", "car", "air" are all arbitrary steps along the inheritance path that are deemed useful, they aren't special properties of a class. I think this is what he's not getting
why is the words tank car and air not enough?
because there might be not only car, tank and air objects
what else might there be?
Is there any better way to broadcast a variable on server when run locally other than publicvariable? IE:
//replace
Variable = false;
publicVariable "Variable";
//with
false remoteExec ["Variable", 2];
weapon holders, other editor placed objects, dead bodies, blood spill, many things.
Look them up in config viewer. It shows you the inheritance, and then just choose one of the parents and check for that
what you are thinking of doing is simply not possible because that's just not how it works
@tough abyss publicVariableServer
or missionNamespace setVariable ["Variable", false, 2]
An object can be many things a car for example is also a Landvehicle. Unless you have something to compare it to there is no single kind to return because it could be many kinds. @astral tendon
You can always return what it is with typeof but it will be specific
@tough abyss remote exec takes command name or function name, it makes no sense what you wrote
@robust hollow just wanted to thank you guys again,worked instantly and is THE mega awesomness ingame.now events like a brain toasting wave make finally sense^^
Brain toasting wave.....?
I mean. If you're willing to push the buttons I can try Ded.
Have anyone here found a solution to how Arma 3 objects kill players with such a high frequency?
Is there a way to configure a servers collision damage to be more forgiving or whatever could solve it?
Trying to have hardcore servers online. And im starting to see why so few others attempts it since persitence of characters gets F'd by Arma 3 glitches..
I have Enhanced movement activated and would like to see if I can lower the amount of deaths due to climbing.. (and please refrain from answering "yes uninstall the mod")
Iirc Arma 2 used to have same issue in dayzmod and they made getting stuck in doors and on top of objects nonlethal
@tough abyss yeah I was trying to show an example. A human would understand it, but PC wouldn't ๐
@wet cobalt have you tried solving it by yourself yet and now you re looking for help or are you just asking generally if someone has a script for it?
Im asking for a general direction in where to look for a possible solution. Not a copy paste answer.
less general then the wiki landingpage hopefully ^^
well an idea might be to look at what objects kill players and figure out why that is. maybe the physx size is crappy
and then dont use these objects
any object pretty much. The problem is that Arma 3 kills players that gets stuck
glitching into things cant really be helped
like even if the foot gets inside a object
Arma characters geometry is just a blob
Ye in arma 2 they never stopped the glitching it self. They somehow stoped it from setting damage to 1 though.
well there are commands for that
maybe a script that disables damage for anything else than weapon fire and teleports the players when hes stuck for like 5 seconds?
and damage and collision events
anyone know it the collision events dont fire up during a glitch or fire up to late?
no idea
sometimes glitching occurs due lag
when your movemnt is nor processed correctly
in those cases the collision doesnt probably fire correctly
but when your position then gets updated inside an object
something like if (lag) then {disalbe movement and firing} might help?
ye would be awesome if I could somehow nerf that event to bits when you get stuck. In arma 2 the only downside was that cars had a harder time running over people :p
But I am willing to do big tradeoffs to solve this one.
Problem is that it does not only happen due to lag. I would need a more abstract solution.
make a list of when and with what object it happens and then write a script for each object to either avoid the glitch or prevent the player dying if the glitch occurs
I liked the idea of having like a array of what can kill you. Should not that be possible?
Don't remember ever dying from glitching into objects, And through enhanced movement i glitch into objects ALOT.
only thing that hurts me is when I fall down after glitching, like when I climb into a roof or smth
though i dont know if a collision glitch can be detected with a vanilla command
Could use handleDamage to just ignore damage unless it comes from a projectile.. But what about nearby explosion damage
it happens to everyone on my server pretty much. Cant get them to stay more then 3h
yeah thats what i would do @still forum
You could teach people to not climb onto objects that moost likely cannot be climbed upon
and maybe form physx contacts iE cars
ye people dont want to get teached sadly. They want to play instantly.
vehicles use a diffrent kind of collision check so they should be able to be excluded
Would it be possible to set the damagehandling when server is initialised?
I'll read up more on handleDamage.
Any more places I should look?
not sure how well it works to overwrite vanilla damage handlers
Easy. Just add HandleDamage eventhandler. done
Problems arise when mods try to do the same, like ace
oof.... yeah.. kinda
maybe do a check if a surface is directly above the player to detect when he falls through a floor
and only then disable the fall damage
Sounds very promising. Thank you guys. Now I can stay busy for a while.
Apreciate the help.
@wet cobalt do you run lots of mods?
with custom objects?
because custom objects can also be made badly which causes engine issues
we run like 50 mods on our server and i never had any bad glitches except with a frigate and the gunboat
there are a lot of poor quality assets out there
I run quite a few mods and script-modules. But its mainly the enhanced movement that seams to be the problem. But I would still love to get it going.
But not impossible that in all those lines that I have included something not quite robust enough :p.
If I change map and remove enhanced movement and make my server a lot easier to survive on (mainly the pve) then this would not be a big problem
what map are you on?
Chernarus Redux
ah yeah there's lots of "bad" clutter on there that you cannot walk on but people would try to climb onto
it migth not be enchanced movement but something else you run that messes it up
same houses as chernarus 2035?
also objects that you can get on with it are not usually designed to be walked on
ye and climbing through windows. Had a player that died when climbing over a small fence.. only grass on the other side. Was the last I saw of him for a while probably :p
dangers of using the engine in ways that its not intended to be used.
Indeed. Its my headache now :p
you should also test different mod combinations and different terrains if the issue is as noticeable
yeah find out what the cause is
map or enhanvced movement or else
otherwise try to make an eventhandler that notices when a player dies from a glitch and then respawn them with all inventory nearby
It is possible that im trying to fix the symptoms instead of the sicknes, ye
probably easier
since arma has a lot of hardcoded dumb stuff
lokking at you AI
Ah, anyone got a recmmendation for a nice immersion EOD/IED script or even a mod
i saw something online but cant find it again that had randomized different kinds of IEDs and each had a GUI to disable it with cutting diffrent wires etc. But im open for all suggestions
Huuum do you have ACE3 ?
20 minutes of trying to kill my self looks really promising so far with setting the damage eventhandler. I get marked as in combat but no damage delt and then pushed out of the objects. Falldamage seams to be reduced as well which is a nice bonus
Thanks again guys
@high marsh its like the brain scorcher in S.T.A.L.K.E.R
someone still got that fired eh where you have chicken projectiles? want to show that to a buddy
Hi, does someone know how to add a locking ability to a vehicle ?
target locking?
Yes, I made some researches and it appear that I want to to do exactly is add a sensor to a vehicle.
I want to use a laser tracker, and the missile that will lock on will be an ATGM LG
I see that I can add a sensor editing it class but I need to do this with a script.
nope
Nope ?
Not very convenient... My goal was to use a script to edit the vehicles I will have to spawn. If I make my config with the class system, will I be able to copy/paste the vehicle to keep my configs ?
If you want to add sensors to a vehicle that doesn't have it, you'll have to mod it. After that you can use it like any vehicle.
And can I hade a missile camera to follow the ATGM ? Like the driver/gunner one.
@digital hollow So if I copy/paste it with Zeus, my new vehicle will keep my configs if I understand well ?
If it's modded, yes.
What do you mean by "modded" ?
Like how CUP or RHS has vehicles in their mods
Or how ACE alters vanilla vehicles with its mod
Ok, modded like this, I hopped something easier x)
Easy, just use a vehicle that does what you need =p
I'm already working with CUP.
That I try to do is adding the new ATGM to a CUP vehicle ^^^
You can try just adding the weapon. I think it has LOAL mode
Yes and.. no
It's very uneffective.
If I just add the weapon, it'll lock on only if I aim at the laser.
And that I need is more a form of mobile artillery.
@silent bough sure got ace. any recommendations for the EOD script?
I don't know any script that can do the job, but now you know that you already have EODs.
If you script a little and you've got the time, I think you could do that yourself.
What do you want want the script to do exactly ?
Hello is there anyway to make it so set a argument on an addaction so the script will check for what the argument the addaction had
_actionID = this addAction ["Picture", "BriefingPictures.sqf"]; This the current action and i would like to so the script to check what argument the action had to select which pic
yes, passing arguments is detailed on the wiki page
3rd param
_actionID = this addAction ["Picture", "BriefingPictures.sqf", "Pic1"];
so like that
yeah and in script if (_this select 3 == "Pic1") then {......}
Great ty!
@silent bough ideally having a GUI with randomized wires to be cut so its difficult every time again. I havent done anything with GUIs yet so i doubt i can just create something like that myself
Hello im having issues attaching texture global on objects through a script on my dedi, but when i did it on my pc it worked perfectly
Im trying to spawn a weapon on the ground but I would like attachments to be on the gun aswell. The approach Im currently taking is spawning a unit then putting the weapon with attachments on the unit and after that deleting the unit. Does anyone have another/better idea of an approach?
Nope
@tough abyss Do you have any idea of the issue
does _argument equal "Default"?
And also if so does _target equal the thing your trying to set texture to?
what is the target
Whiteboard (Altis)
Variable name:Screen
cant really help much with that snippet cause it doesnt show where the variables are set.
Ill edit it now
There
_target = Screen;
_caller = _this select 1;
_argument = _this select 3;
_Briefer = "76561198131470785";
_Gate = Gate;
_Texture1 = "Images\cityBW.jpg";
_Texture2 = "Images\MRAPPic.jpg";
_Texture3 = "Images\presslocationBW.jpg";
_Texture4 = "Images\SahraniNorth.jpg";
_Texture5 = "Images\SahraniSouth.jpg";
_Default = "a3\structures_f\civ\infoboards\data\mapboard_altis_co.paa";
if (getPlayerUID _caller isEqualTo _Briefer) Then {
if (_argument isEqualTo "Picture1") then {
_target setObjectTextureGlobal [0, _Texture1];
Hint Format ["Picture 1 Enabled:%1", _Texture1];
};
if (_argument isEqualTo "Picture2") then {
_target setObjectTextureGlobal [0, _Texture2];
Hint Format ["Picture 1 Enabled:%1", _Texture2];
};
if (_argument isEqualTo "Picture3") then {
_target setObjectTextureGlobal [0, _Texture3];
Hint Format ["Picture 1 Enabled:%1", _Texture3];
};
if (_argument isEqualTo "Picture4") then {
_target setObjectTextureGlobal [0, _Texture4];
Hint Format ["Picture 1 Enabled:%1", _Texture4];
};
if (_argument isEqualTo "Picture5") then {
_target setObjectTextureGlobal [0, _Texture5];
Hint Format ["Picture 1 Enabled:%1", _Texture5];
};
if (_argument isEqualTo "Default") then {
_target setObjectTextureGlobal [0, _Default];
Hint Format ["Picture 1 Enabled:%1", _Default];
};
if (_argument isEqualTo "Gate") then {
_Gate setVariable["bis_disabled_Door_1",0,true];
_Gate setVariable["bis_disabled_Door_2",0,true];
_Gate setVariable["bis_disabled_Door_3",0,true];
_Gate setVariable["bis_disabled_Door_4",0,true];
Hint "Gate Enabled";
};
}
else {
Hint format ["You are not the mission host %1", name _caller]
};
how is Screen defined?
Variable Name of the whiteboard
Yeah so basically none of the commands work when the mission is on the dedi. The addactions is on a laptop on a table having all actions on them.
the gate doesnt work either?
u wanna add this in the script to see what it says?
hint ([
format["_caller: %1",_caller],
format["_argument: %1",_argument],
format["_target: %1",_target],
format["_Gate: %1",_Gate]
] joinString "\n");```
@robust hollow why don't you just use parseText ?
hint parseText format["Caller %1 <br/>
Argument: %2 <br/>
Target: %3 <br/>
Gate: %4 <br/>
",_caller,_argument,_target,_gate];
๐คท just a debug log so didnt really care about doing it properly
Easier on the ๐
\n should work in text hint too
Yeah it does, parseText is nice and clean ๐
@crystal schooner Screen isnt defined
Gate is though and it isnt working :&
what does the hint say the argument is for gate?
Screen is undefined
whats the argument tho
Why though if it is object variable?
define Screen and then try again
Fuck simple object makes it so it cant be a variable right...
If its a simple object you cant have a variable name or am i wrong
Oh dear
It isnt my mission ok
๐คฆ
why don't they try and learn themselves?
Because the mission we are doing starts tomorrow
Maybe you should have also made sure it was ready before planning it? ๐
Well the mission is ready but now its just fixing the details (:
dmg control? ๐
is gate a simple object? ๐ค
NOOO ๐ฆ
But you disable 4 doors how gate is related to them?
Wait is disabled door true false or 1 or 0?
Ye i've done that
So what is Gate?
This setVariable["bis_disabled_Door_1",1,true];
This setVariable["bis_disabled_Door_2",1,true];
This setVariable["bis_disabled_Door_3",1,true];
This setVariable["bis_disabled_Door_4",1,true];
That is the init of the gate
Thank god map works now
Map? Are you having an issue with the terrain now?
Yeah but what is it?
I believe its a CUP Gate
What kind of gate has 4 doors?
It probably doesn't i just added multiple doors to get it working
And it did on my PC
Its in the init of gate is that a big nono
Or from local instance
If you use init add if (isServer) then {...your set vars..};
But it will be broken for JIP
Actually no should be fine for JIP
to lock the gates so players cant drive away before briefing is done
what kind of orc horde are your players that they will try to run away from the briefing lol
nice. just disable simulation for them during briefing lol
OMG i'm a retard.... Fixed it all. They had disabled simulation on the gate.
Great, check all other attributes for every object then, this looks like tendency
Well everything else is just standard objects in the base. They can just stay like that i guess.
Gotta teach them what to enable/disable simulation on.. Thanks for the help though really appriciate it. ๐
I've discovered something very strange when using set/get variable on a location. The Size y and x must be greater than zero.
not a surprise since the map coords start at 0/0
Thought it'd still keep a reference. ยฏ_(ใ)_/ยฏ
i do recall the say3D distance parameter not working for me in the past, had to set the distance in CfgSounds. I assume say2D suffers from the same problem (what ever it may be).
yeah jus set it in cfgSounds
is there a way to capture ingame chat via sqf?
(or any status message in that "element")
dont think so, the best you can do for chat is get the message from the text box as they hit send.
class RscDisplayChat
idd = 24;
class controls
class CA_Background: RscText
class CA_Line: RscEdit
idc = 101;```
one can parse the input at least
yea thats the kind of thing im meaning
isnt that just the display that says which channel ur in and if you are VOIP activated or not?
oh sorry, i was thinking output as in the actual chat log
@velvet merlin is there a way to capture ingame chat via sqf? yes CBA has it.
https://github.com/CBATeam/CBA_A3/wiki/Registering-Custom-Chat-Commands
There is a cba_events_chatMessageSent eventhandler that just get's params ["_message"]
Intercept it and modify if necessary?
Might as well make own chat system
Less of a headache, full control
https://www.reddit.com/r/armadev/comments/am00zp/applying_a_local_variable_to_people_with_certain/
Any thoughts peeps? I'm truly stumped with this one... Probably a simple fix glaring me in the face but I'm too sleep deprived to figure it out ๐
squadleader?.. I assume that slot is also the group leader, you can just check by
leader player == player and done.
If the player is the leader of his group, then he is a squadlead
@tough abyss custom chat and kill message system would be a fallback indeed, but less desirable if can be done by other means
@still forum The Leader could turn out to be the JIP'ng rifleman in a dead group
well if he's the only guy in his group, he leads the group. Maybe that's enough?
I guess the problem with his check is that if any of the leads is not present in the mission, the variable will be nil and it will error out @remote basin
isNil { //make sure undefined variables don't trigger errors
squadleader = player in [platco, alphalead, bravolead, charlielead, deltalead, echolead];
};
how about that?
I have tried it with 5 players in the dedi server, all of which were different roles. When they were in the squad lead roles they still did not return a true or false for squadleader
That looks great @still forum , will try it now and get back to you ASAP. Cheers for the help!
@velvet merlin if by other means you mean hacking displays and controls I will go with custom chat any day
@still forum that will trigger undefined var error in scheduled as soon as you try to use undefined var
And initplayerlocal is scheduled right?
@remote basin use roleDescription instead of variables
@tough abyss whats so bad about reading out chat, hiding/filtering out some stuff, and display it by other means?
@tough abyss yes. That's why I made it not trigger that error by moving it to unscheduled...
I also already said that the undefined var is probably his error. Just read what I'm writing...
if any of the leads is not present in the mission, the variable will be nil and it will error out It's literally right there.
@tough abyss roleDescription is a good shout, I will give that a go if the other fix doesn't return any results. However bear in mind that I have some squad leader specific addActions down that have the conditions set to "squadleader" So unless I can get a "true" out of a (player = {certain_role}) then it doesn't really do much for me unfortunately
@still forum chill out man, I am still making my coffee ๐
Better make a espresso :triggered:
Thatโs what I am making
@still forum You are a champion, cheers mate. That worked perfectly
throws ๐ฉ at @remote basin
catches
Funny how commy came up with the exact same solution, in parallel to me on reddit.
Hi! I want to use the "playerConnected" missionEventHandler but I don't see any param for the unit the player is playing as. Does arma consider players connected as soon as they get into the lobby or after they chose slot and got into the world?
addMissionEventHandler ["PlayerConnected", {
params ["_id", "_uid", "_name", "_jip", "_owner"];
}];
it fires after receiving data but before they have a unit
I see... Is there anything I can use that fires after the player chose slot and is already playing?
I guess you can use the EntityRespawned handler
That might fire if the unit spawns by "respawning"
forceRespawn + EntityRespawned maybe?
alright, I will try that. Thank you all!
has anyone here tried to use weaponDirection to determine point of aim (small arms) and found it utterly unreliable? i always imagined it pretty solid (pretty sure i've seen ppl use it for all sorts of things that would require reasonable accuracy i.e. ace_laserpointer_fnc_drawLaserpoint). My experience with it; https://imgur.com/a/OxsbKYq
Hi. Is there a way (script command) to save a MP mission progress, user's collections and so on before a planned server restart and to restore al saved items after server's start if it was not implemented in mission iteselves?
Not that I know of. The mission should be in charge of saving indeed
@cursive whale maybe try to calculate all positions in world coordinates and convert to AGL only when passing to drawLine3D
@low birch save variables in server profile namespace or use database extension
@tough abyss dunno , the origin coordinate (getpos player) isn't really the issue it's that the weapondir vector doesn't match the weapon's pitch. suspect weaponDirection might pre-date IK and always assumes the unit is on a perfectly level surface. probably it needs a weaponDirectionVisual command.
@next scaffold we use a: foreach allunits command that checks if (typeof _x == "Classname" && iskindof Player) to give all players a new loadout according to the class they play
might be what you are looking for. fires up whenever you want and you can set the sleep command long enough to not cause lag
@cursive whale I didn't know that was unreliable, damn it I rely on that for some stuff. Going to have to look into it deeper when I get the chance. Thanks a lot for sharing.
@cursive whale maybe modded weapons dont work? but honestly ive seen a lot of stuff using it, works well
@cursive whale sorry, but how exactly to do that using the prifile nameSpace?
Can i just run in a Debug Console saveProfileNamespace; before and loadProfileNamespace; after server restart?
Ironsight, how come you don't useallPlayers
@digital hollow is refits all units with new loadouts, allows us to place zeus units and create custom factions without mods
Ah, not just players then, ok.
yeah but theoretically you COULD add that condition very easily
@low birch call saveProfileNamespace after you save a variable to it (profileNamespace setVariable [...]). You don't need to load, Arma does that by itself
@still forum thanks, will look on it
@cursive whale have you tried what I suggested?
@tough abyss No, not sure what you mean. Could you revise this along the lines you suggest?
AddMissionEventHandler ["EachFrame", {
_v = player WeaponDirection (PrimaryWeapon player);
_a = (GetPos player) VectorAdd [0,0,1.5];
_b = _a VectorAdd (_v VectorMultiply 100);
DrawLine3D [_a, _b, [1,0,1,1]];
}];
try using eyePos
@cursive whale
addMissionEventHandler ["Draw3D",
{
_v = player weaponDirection primaryWeapon player;
_posWorld1 = getPosWorld player vectorAdd [0, 0, 1.5];
_posWorld2 = _posWorld1 vectorAdd (_v vectorMultiply 100);
drawLine3D [ASLtoAGL _posWorld1, ASLtoAGL _posWorld2, [1,0,1,1]];
}];
@tough abyss Cheers, will give it a whirl.
It works
dang, it does, but i confess i don't understand the difference
It is simple, drawLine3D wants position AGL. when you extend vector and add it to position AGL with vectorAdd you get Position3D not PositionAGL
PositionAGL depends on terrain, Position3D does not
Hence discrepancies. In VR the terrain is flat so you will get it working either way
this is also the reason vectorDistance was added because distance was calculating wrong distance for Position3D
right so i was doing DrawLine3D [PosAGL, Pos3D... (or vice-versa?
great stuff m242 will try and use it for my "point a gun at a civilian to make it surrend" script
render position is terrain height + the z component in your position.
If terrain stays the same, then the only difference will be your z component. But if terrain changes, the difference will be terrain AND your z position. That's the issue
What M242 did was do all the calculations at 0,0,0 base first and then move them up to terrain level later
yeah something like that @cursive whale
Thanks man ๐
As you were everyone, weaponDirection not broken ๐ @tough abyss
bit bonkers though that DrawLine3D is relative to terrain height
wdym the code m242 posted does not depend on it
well i should say it works around the draw 3d dependency on posAGL
Anyone have experience with editing the 3den dialog display scripts? I am trying to hide specific attributes from a generated list, data fetched from config. The base game behaviour already has the ability to conditionally show categories depending on the condition state of the selected object, but I cannot find this script anywhere.
if(isServer) then
{
for [ {_i = 0}, { _i < count _allPlayers }, {_i = _i + 1} ] do
{
_PlayerName = name _allPlayers select _i;
player addAction [format["kill %1", _PlayerName], "mySkrip.sqf"]
}
};```
i dont know what im doing wrong it says ```Error name: type array, expected object location```
in line 6
name _allPlayers select _i;
commands that take one parameter have higher priority than commands that take two parameters.
You are executing
(name _allPlayers) select _i; and you can't plug array into name
That's also a superly overcomplicated way to do {} forEach allPlayers
And superly bad performing. That's the worst kind of loop you can choose if you want performance
Also why do you get _allPlayers variable even on non servers, when you are only gonna use it on server?
so how can i fix it ? by type name (_allPlayers select _i)
it should only be execute for the host
You shouldn't use the for loop at all
if (isServer) then {
{
player addAction [format["kill %1", name _x], "mySkrip.sqf"];
} forEach (call BIS_fnc_listPlayers);
};
I assume that action is supposed to kill a certain player.. How do you want to know which player was chosen if you don't store that info anywhere?
i havent thought that far ๐
Hint: Use the arguments of the addAction.
https://community.bistudio.com/wiki/addAction
k thx
Don't believe there's a setMagazineAmmo style of command. You can do ```sqf
_unit removeMagazine "30Rnd_556x45_STANAG"; // _unit must be local
_unit addMagazine ["30Rnd_556x45_STANAG", 15];
missed that thank you!
Can any of you guys see why this isn't working?
_fNames = [
"Mohammed",
"Omar",
"Ahmed",
"Ali",
"Youssef",
"Abdul",
"Yasin",
"Hamza",
"Haziq"
];
_sNames = [
"Abdullah",
"Khan",
"Al-Ghamdi",
"Alaoui",
"Khan",
"Ahmad",
"Ali",
"Khoury"
];
_fName = selectRandom _fNames;
_sName = selectRandom _sNames;
_sName2 = [" ", _sName] joinString "";
_wName = [_fName, _sName2] joinString "";
unit setName [_wName, _fName, _sName];
describe "isn't working"
My immediate guess is that unit isn't what you think it is
Or that you're not seeing the change because the effect is local
Oh, no it's some ACE3 issue. It works if I do name cursorTarget but not if I check responsiveness of the unit (using ace medical).
I'm testing in non dedi MP so I see all the effects!! ๐
ace has a special name variable
so that they can still retrieve it after unit died
Do you know if I can refresh that after changing the name of a unit?
Yeah, I found it too. Probably should learn to search before asking lol. Thanks! ๐
will this work?
//init
restart_time = (36060) //(3 hours)
restart_time_warning = restart_time - (15*60) // 15 minute restart warning
//restart script
if(isDedicated)then{
waituntil {serverTime > restart_time_warning};
systemchat "server restarting in 15 minutes!!!"; // will be set to public var
waituntil {serverTime > restart_time};
serverCommand "#restartserver";
};
restart_time = (36060) //(3 hours)
restart_time = 3 x60x60
idk why thats not shoing up right
really? x for multiply
just for discord
oh
restart not working?
i dont have a dedi to test atm
but it is posible to restar a server that way?
why not
ok thank you
but it is not the best way to go about it
for what im doing it will work
im making a database script that warns player of a save befor restart
you basically checking serverTime > restart_time_warning every frame for 3 hours
this is stupid
and wasteful
but it will work
i will change it i just wanted to know if it would work
@daring vault
```sqf
<code>
```
For proper code highlight, then you also don't need to replace any characters
_uid = getPlayerUID player;
"hello" remoteExecCall ["hint", _uid];
why don't working ?
because wrong parameter
read wiki
_uid wrong
Actually.. Your code doesn't make sense at all
hint "hello";
Here use this.
Why people attempt to use remoteExec for everything like it is some sort of magic answer to everything
There are atleast 3 things wrong with your code... okey 4.
Who can find more? the game is... Okey 5..
Who can find more than 5! The game is on!
"Why don't working" not is right
Yeah it is not JIP compatible should set 3rd param to true!
there is 1 thing wrong, _uid should be player, then it works
"works" is not "right" tho ^^
works is not wrong though either
no need to remote exec if it is for the actual player, so hint only
Not wrong.. But still stupid retarded
For some reason fired event handler returns null projectile when you launch flares from a jet, right now using nearestObjects as a workaround, has anyone else encountered this issue? maybe there is a better workaround than nearestObjects.
@rancid pecan if you just want to hint locally, drop remoteExec
@copper raven yep. Happens with grenades too
You could make one of those memes with the progressive brain images and the different ways of coding a way to hint hello to yourself lol

flares are scripted I think
@winter rose i don't want hint locally just example
private["_uid"];
_uid = [_this,0,"",[""]] call BIS_fnc_param;
if (count pb_spieler==0&&pb_spielstatus==0) then {
[[],"TON_fnc_game",false,false] spawn life_fnc_MP;
pb_spielstatus = 1;
};
if (pb_spielstatus==1) then {
_uidarr = [_uid];
_geld = [_this,1,0,[0]] call BIS_fnc_param;
if (_geld>=5000) then {
pb_spieler = pb_spieler + _uidarr;
[[5,"Du wurdest erfolgreich fรผr das kommende Spiel angemeldet!"],"life_fnc_pb_response",_uid,false] spawn life_fnc_MP;
} else {
[[1,"Du hast keine 5000 Dollar bei dir!"],"life_fnc_pb_response",_uid,false] spawn life_fnc_MP;
};
};
if ((pb_spielstatus==2&&count pb_spieler>=2)||(count pb_spieler==pb_maxspieler)) then {
[[1,"Leider hat das Spiel bereits begonnen oder die Lobby ist bereits voll, versuche es spรคter noch einmal!"],"life_fnc_pb_response",_uid,false] spawn life_fnc_MP;
};
[[5,"Du wurdest erfolgreich fรผr das kommende Spiel angemeldet!"],"life_fnc_pb_response",_uid,false]
BIS_fnc_param ๐คฆ
๐คข
[5,"Du wurdest erfolgreich fรผr das kommende Spiel angemeldet"] remoteExecCall ["life_fnc_pb_response",_uid];
yeah
you cannot remoteExec with a uid
why don't you use the script like it was given to you?
because new version life scripts remove life_fnc_MP
On point 3 on the forum
Just remove the getPlayerUID
And then have fun with your shit script garbage ^^
lol, not only is it life, it's german life.
Yeah german lifers are the worst
is life_fnc_mp a rehash BIS_fnc_MP?
yes
LOL
_uid is string, life fnc supports _uid?
lifers actually doing work? Doubts.
Doesn't seem so, something RealQuae invented
I feel dirty after reading this thread
RV devs should get a monument for making an engine that can take so much crap and still function
I saw someone else attempt to use serverCommand and it reminded me of my failed attempts at doing so.
I'm trying to make the server shutdown by script. So far I've got this
//adminPass.txt located in the arma 3 directory along with .exe, addons folder etc etc
test123
//My sick code
_pass = loadFile "adminPass.txt";
_pass serverCommand "#shutdown";
I'm able to do "#login test123" and successfully log in as admin on dedicated.
I'm able to watch "loadFile 'adminPass.txt'" using CBA debug console and it says "test123".
I'm able to do "#shutdown" in the chat box as logged in admin to shutdown the server.
I'm NOT successfull at shutting down the server when running my sick code on server, or local in dedicated.
I run client and server with -filePatching.
In server.cfg allowedFilePatching is set to 2.
All I get is the false output indicating wrong password and Failed attempt to execute serverCommand '#shutdown' by server.
Has anyone had success using the alternative syntax of serverCommand?
Does anyone know why it's not working for me?
In server.cfg allowedFilePatching is set to 2.
Don't do that, that essentially allows ever player to cheat
did you put a diag_log into your server code to make 101% sure that the _pass is correct?
It's just a test server ๐ Thanks for the heads up though.
I'll log and see what it says.
RPT says "test123" for _pass :/
even if I write "test123" serverCommand "#shutdown"; and execute globally it just returns false on debug console. I think something's fucky with serverCommand itself.
The password for #login is not the same as for server command. You know that right? Just making sure
I should have servercommandpassword set to the same as adminpassword
otherwise.. This will be a massive misstake by me lmfao
and execute globally why would you do that?
it has to be executed on server it says so on the wiki
Thanks @still forum
serverCommandPassword wasn't defined.
@tough abyss to remove any doubt that it's not executed correctly?
you want to see the result from server, exec global returns result from client, you are shooting yourself in the foot
at that point I was attempting to suicide bomb the whole thing
serverCommandPassword wasn't defined. From biki: password : String - password defined in server.cfg with serverCommandPassword param
Yep. That is correct.
Is there an easy way to batch unpack PBOs and unbinarize configs from a downloaded addon? Or do I need to do it all manually?
mikero tools probably deraps automatically
yeah they do
Awesome, thanks!
If you really need a lot of files unpacked you could use DokanPbo, that way you don't need to unpack anything shill
I'm getting a "type number, expected Bool" error on this, is my comparison messed up or something?
waitUntil {(endingTriggers == 2)};
are you sure you are getting the error on that?
wait no lol
maybe you are off by one or two lines
waitUntil {(endingTriggers == 2)};
if ((leloup_captured == true) && (militiacmdr_captured == true)) then
["End1",true,5] call BIS_fnc_endMission;
== true that is absolute nonsense
comparing a boolean to true does literally nothing
it giving me shit about it not being a bool
I had it set to 0 at start, then go to 1
true==true -> true
false==true -> false
you cannot compare boolean to boolean
because that's just retarded bullshit that makes no sense, so the game doesn't even let you
so what am I missing here?
I just told you
comparing a boolean to true does literally nothing
lemme try something
it returns the same as the input
oh gotcha
x==true is exactly the same as just x
x==false is the same as !x
If you'd read the wiki you'd know that https://community.bistudio.com/wiki/a_%3D%3D_b
Also your then is missing it's right parameter
read the wiki and look at how a if/then statement should look like
@still forum x == true wasn't valid last I checked
Yep.. That's what I just said
"error && type number expected bool"
if (leloup_captured && militiacmdr_captured) then {
["End1",true,5] call BIS_fnc_endMission};```
Oh, it Arma doesn't read 0 as false and 1 as true does it?
do the need quotes around them, like
militiacmdr_dead = "true";
or without quotes?
without... with quotes its a string
that's what I thought
I just sent you the wiki page
just read it
text with quotes around it is a string already, how would it ALSO be a boolean? that doesn't make sense
Arma doesn't make sense
it does for the most part if u read the wiki ๐ฆ
"I don't understand this" == "This doesn't make any sense"
Ok, got it working. Thanks for the help, even though it's like pulling teeth with some of you people
Anyone knows if it's possible to download animations for blender somewhere and use them in arma 3
== true that is absolute nonsense You lie! Look at the channel description example
Error: undefined variable here
you cannot compare boolean to boolean because that's just retarded bullshit that makes no sense, erm C++ lets you do that
Arma
why retarded
it makes perfect sense and it has its uses
I meant comparing boolean to a constant like true and false
You can do that in Arma too
still makes no sense
yeah comparing literals makes no sense but bool to bool is ok
ofc comparing a variable to a variable makes sense
I have seen people try to do that...
me too
Even worse.. I've seen people helping them because it caused an error for them. The solution was to use bool isEqualTo true
bool to bool is ok ... why not stick to logical operators as anyone would do?
Because you are an idiot maybe? Or too lazy to read the wiki or to learn how the basics of the basics work?
bool == false != true
I cant remember at this moment but I have seen some elegant uses in C++ where you compare bool to bool, if I remember I will post @languid tundra
If you find it, let me know ๐
if (shouldEngineBeRunning != isEngineRunning) then ...
There you have a elegant use that makes sense
if (valueThatShouldBeTrue == (true==true)) then.. //Just wanna REALLY make sure it's true
Ok, right, we don't have an XOR operator, so != comes in handy^^
someBool == someOtherBool is common, and needed. bool == true is stupid, and shows that someone either has some pretty shitty conventions, or don't understand evaluations.
The only time it makes sense, is in a language like C# where a var may be of type Object, thus not necessarily either true or false
Eg. object lol = 5; if (lol == true)
but at that point you aren't comparing bool to a boolean literal.
You are comparing a "thing"
Well, isn't something like bool == true used in hardware for amplifying the signal? ๐
I know, was more of a fun fact
||new features are cool /spoiler TEST||
The irony that you spoiled it with a spoiler
In C if statement accepts non-bools... so there are non-intuitive things everywhere
Well, bool is not even a real type in C
How to find this object in the editor? copy and paste it does not find it
Land_A_Pub_01
im assuming so you can place it?
class Land_A_Pub_01 in the search bar on the right panel
Found it! thanks.
@languid tundra It is in C++, though
Yeah, that's true for C++ and 0 for C ๐
#include <stdbool.h> check mate!
That doesn't make it a real type though. Just a hacky solution.
is there a variable for ACE's Take Prisoner? Captive doesn't seem to register for me
found it, but I can't get a waitUntil to trigger on it:
(militiacmdr getVariable ["ace_captives_isHandcuffed",false])
Nevermind
hello i have a problem i wanted to make a money pickup system for my server my i have a script error like that _amount is not a defined variable
_moneyObject = "Land_Money_F" createVehicle position player;
_moneyObject setVariable ["cashAmount", life_cash];
[_moneyObject, ["pickup money",
{
player playMove "AmovPercMstpSnonWnonDnon_AinvPercMstpSnonWnonDnon_Putdown";
_amount = (_this select 0)
getVariable "cashAmount";
hint format ["Money Taken: %1", _amount];
life_cash = life_cash + _amount;deleteVehicle (_this select 0);}, [], 6, false, true, "", "_target distance _this <2"]] remoteExec ["addAction"];
Your second line only sets the variable for the local machine...
@languid tundra second line ?
_moneyObject setVariable ["cashAmount", life_cash];
yea ?
I do not understand what does not work ...
_moneyObject setVariable ["cashAmount", life_cash, true];
That's what you need for it to be publicly available
You spoiled it ๐
Ya, my bad lol
lol
Been like 8 months since I've touched any sqf
@tough abyss thanks
@languid tundra sorry the next question I would seek
good i ask a question when i pick up the money from the players i kill it is still on it how to remove it?
The easy solution would be just to add an additional condition that checks whether _target is alive.
The more cleaner way would require some restructuring.
how could I start?
What about this part "_target distance _this <2"?
this part is used to see the target of the cash on the ground
not really...
it's the condition for the action to show up. Currently it shows up when the distance between _target and _this is less than 2 meters.
so just add an and plus your check that _target is alive.
@languid tundra
life_cash = life_cash + _amount;deleteVehicle (_this select 0);}, [], 6, false, true, "", "_target distance _target alive life_cash = life_cash + _amount _this <2"]] remoteExec ["addAction"];
wtf is that condition
Are you sure you know what you are doing? ๐
Well, at least you found the right command already: alive
okey ๐
_target distance _this <2
this is your first condition
your second one is the one with alive
you can look up the syntax in the Wiki.
alive cursorTarget; ??
I have the feeling you don't know what _target and _this are referring to
Checkout Parameters>Condition
no
the wiki shows the syntax and examples
Syntax:
alive object
SQF:
if (alive player) exitWith {};
Syntax is alive <object> not <object> alive
and _this refers to the unit that executes the action, while _target is the one to which the action is attached to.
So you got it wrong twice.
hoo okey
does an alive check even matter? life servers usually have a death screen so you cant use scroll actions anyway
so _this alive life_cash is good ?
i dont have life serveur
i create my custom KOTH
_this is refers to the unit
_target is my unit
so _this alive _target ?
no
alive _this
_target refers to _moneyObject cause thats what the action is attached to
because the syntax says so
okey
generally if a command only has one argument its on the right side. unary commands or whatever u call them.
and to take money out of the kill man i can do life_cash = life_cash - _amount ?
yes
Weird though that it's a global variable and not part of the unit's namespace...
what, set on the unit? if it dies u have to transfer it over to a new unit then... as a missionNameSpace variable it just works.
when the unit dies it must lose the money that it has on it
Agreed, it's actually a smart way to circumvent the need to handle respawns, but the disadvantage is that another client can't retrieve your value without implementing some kind of getter function.
when would someone else need to know how much cash u have?
Dunno, maybe an admin.
if it isnt meant to be public information he wont need to plan for it. anyway based off the variable being called life_cash i assume he is working off a life mission as a framework anyway so thats how its built
Damn life missions
what ever works for him ๐คท
no for my script
lul
I can have you test my server if you wan*
no life mission
my private mission KOTH
Would be probably quite a lot of work to reconstruct the server side part of a KOTH mission ๐
Nope
ok
if you want to test my mission say the month i show you i really work on a koth mission
I know code from life servers can get you quite some hate here, but as long as you are willing to learn coding, it shouldn't matter.
yes I took the arms shop and atm of life but it's really a mission koth
And you definitely need some basic background about scripting in general before we can really help you how to proceed.
but the server side is still closed source, isn't it?
is code good?
life_cash = life_cash + _amount;deleteVehicle (_this select 0);}, [], 6, false, true, "", "_target distance alive life_cash = life_cash - _amount _this _this <2"]] remoteExec ["addAction"];
no, no it is not
he is adding the action to all players though so doesnt technically need a target.
i just understood something explained to me @robust hollow that alive _this was to find out if my player was screwed then to take away the money i can do life_cash = life_cash - _amount
yes, thats correct but ur doing it in the condition of the action
the condition is the wrong place to be doing it
@tough abyss okey
And probably don't start with addAction and remoteExec right from the beginning. These are rather the trickier ones.
What did @still forum call it again? Magic Wand of life servers? ๐
@languid tundra ?
Nvm, I got something mixed up.
Well, that version would give you access to the return value, but a cfgFunctions version would be cleaner ofc.
Well, that version would give you access to the return value what?
I meant the issue with [A,B] remoteExec ["addAction",<target>]; is that you can't get the return value, while with @tough abyss solution you could.
That last sentence sounds like chemistry class. I'm way to wasted for this.
im still not following. remoteExec only ever returns a string or nil?
return value of addAction is what I mean, not remoteExec.
ahh
Lol good thread
thanks you @robust hollow @languid tundra @tough abyss i have solved my problem you are very good ๐
@tough abyss you got it figured out by now?
which part, the scroll bars as a whole or using a control group with ctrlCreate?
Make controls group, make structured text passing group as param, why the problem?
yea thats how it works.
using rsccontrols as the example you would do this:
private _ctrlGroup = (findDisplay 46) ctrlCreate ["RscControlsGroup",-1];
private _ctrlText = (findDisplay 46) ctrlCreate ["RscStructuredText",-1,_ctrlGroup];```
@languid tundra I probably called it retard club of bullshit garbage nonsense life server scripts written by idiots who don't understand a thing about scripting.
Life is pain
controls inside a ctrl group use coordinates inside the ctrl group. so x=0 and y=0 will line up with the top left corner of the ctrl group. if that makes sense
also those floats you add subtract will bite you in the butt later when you have displays with different UI size
it should be fine no matter the size unless ur doing some weird af positioning
well if you aim for inside viewport controls then it is ok it is just if someone has UI set to small it will be tiny in comparison with someone with large UI size where it will be huge
QS_ctrl_13 ctrlSetPosition [
0,0,
((ctrlPosition QS_ctrl_1) select 2) * 0.305,
((ctrlPosition QS_ctrl_1) select 3) * 0.7
];
should do it
make the height of the text control more than the height of the control group
i recommend just using ctrlTextHeight QS_ctrl_13 once you have set the text to it
๐
disableSerialization;
_disp = findDisplay 46 createDisplay "RscDisplayEmpty";
_ctrlGroup = _disp ctrlCreate ['RscControlsGroup', -1];
_ctrlGroup ctrlSetPosition [0.5, 0.5, 0.5, 0.1];
_ctrlGroup ctrlCommit 0;
_ctrlText = _disp ctrlCreate ['RscStructuredText', -1, _ctrlGroup];
_ctrlText ctrlSetStructuredText parseText format ["1<br/>2<br/>3<br/>4<br/>5<br/>6<br/>"];
_ctrlText ctrlSetPosition [0, 0, ctrlPosition _ctrlGroup select 2, ctrlTextHeight _ctrlText];
_ctrlText ctrlCommit 0;
might want to reduce the width on the text ctrl by the width of the scroll bar so it doesnt cover the last letter. other than that, looking good imo ๐๐ป
the x and y might visually shift on different ui scales. personally i use pixelgrid coords.
you could just do the safezone scaling like you have for the base ctrl. so whatever the result of 0.01 / safezonew is, for x you would do ((ctrlPosition QS_ctrl_1) select 0) + (n * safezoneW) and then it should move properly with different sizes ๐ค
Have you tried changing UI size? Try and see if it misaligns
it takes 3 seconds to go into options and change then change back
take a picture
what everything or just newly added ctrlgroup?
yeah so you need to start from scratch and rethink the whole approach
i say think pixelgrid, never had a problem with it (excluding 4:3 being a bitch to me a few days back)
?
_WoundedPlaces = (synchronizedObjects Bodybags);
// _WoundedPlaces returns
[Bodybag_1,Bodybag_10,Bodybag_11,Bodybag_12,Bodybag_13,Bodybag_14,Bodybag_15,Bodybag_16,Bodybag_17,Bodybag_18,Bodybag_19,Bodybag_2,Bodybag_20,Bodybag_3,Bodybag_4,Bodybag_5,Bodybag_6,Bodybag_7,Bodybag_8,Bodybag_9]
_WoundedPlaces sort true;
_WoundedPlaces;
//_WoundedPlaces returns
[Bodybag_19,Bodybag_10,Bodybag_11,Bodybag_12,Bodybag_13,Bodybag_14,Bodybag_15,Bodybag_16,Bodybag_17,Bodybag_18,Bodybag_1,Bodybag_2,Bodybag_20,Bodybag_3,Bodybag_4,Bodybag_5,Bodybag_6,Bodybag_7,Bodybag_8,Bodybag_9]
I forgot something? the array still not sorted
how do you expect it to sort objects?
how do you determine if one object is smaller than another?
by the number
Right. You don't.
https://community.bistudio.com/wiki/sort If you had read the wiki you'd see that objects are not supported
So what does support?
Read the wiki
๐
go with boundingboxreal if you want to sort by siz
They are identical objects will be the same size
Probably not. What are you trying to do?
How can I in a script create an array of object variable names? I think it might be a bad practise in itself but manually writing the array with names all the way to _num1000 seems a bit of work
Or... What's the most efficient to check an object's variable name in a mission, e.g. Catch all objects named "specialname_x" in an array
@knotty sun why would you need so many variables to begin with?
How about vehicleVarName?
Can you elaborate?
If you assign a global variable to an object in Eden, you can return it with that command.
And @winter rose it's a bit of an exaggeration, but might need at some point array with quite a number of mission objects
I'll research that one, thanks!
Catch all objects named "specialname_x" in an array
for that one you will gonna end up with call compile I fear
Hm. Could've sworn I saw something before that allowed partial match of the varname
That was years ago though
@knotty sun use an array?
just getVariable for all possibilities? ๐
I want to use an array Lou but I need to fill it, rather not manually
MATLAB made me a bit lazy in that regard
How are the variables set in the first place?
Well, then allmissionobjects + vehicleVarName and check if string is in string.
hi guys I'm trying to get a unit to fire at more than 1 target on a range and have the following that works but only fires at 1 target (t1 = target, s1 = unit & gl = game logic) null = s1 spawn {_this dotarget t1; sleep 0.5; while {alive t1 and alive _this} do {sleep 4; gl action ["useweapon",vehicle _this,_this,0]; }};
any ideas please
i've tried t1, t2 etc and ["t1", "t2"] but no joy
What 'in' command would I be looking at? The wiki for in doesn't say anything about strings or partial match
Only full match
find?
Ehhh... That finds something in an array does it not?
Which needs to be 100% match for what I can see
There is an alt syntax for strings
Ah never mind found that! Let's see if that works
||it does||
Which IDEs support SQF by the way? Been using notepad++ so far. Would like to use something that gives some more info on the code :P
vs code is the best so far imo
Ermagerd spoiler alert
I'll try that then
Any specific plugins?
Saw a few for sqf
I use Raven't SQDev plugin for Eclipse
Where is love for vim? ๐
... or nano
if the object variables are sequential then you could use a for loop
Well they're supposed to but the find way is the safer option. Never know if a mission maker fucks up
allright i want to change my escape menu like when i press escape i want an other dialog to pop up and when i press settings i want to view the settings
any ideas how ?
something like this https://www.youtube.com/watch?v=Du76sXPA764
the sqf thing by skacekamen
ive been breaking my head about it ๐ฆ
@ember verge you asked that before and I told you already
overriding
pressing a button
Game settings?
yes
like in the video there are buttons where you are able to get in to the settings and stuff
You need to hack game menu, what you asked is not what you actually want
nah not that i have a life server
and when the players press escape they will be able to choose a button
like a settings button
and when they press on it they would get directed to the settings
Not a simple task though
yep ๐ฆ
i didnt even get it to make it so far to open that menu when you press escape instead of the normal one ๐
What's the current state of the BIS tasks framework? I know that sometimes it gets desynchronized for JIP players. I guess it was never fixed.? Should I implement my own tasks framework?
does anyone know why a drone that is spawned via a script has no gps access? or is it normal for drones to not have a map?
nvm figured it out
Nighstalker, If its a one time thing you could loop through all mission objects at the start of the mission and check if their vehicleVarName contains a substring you define
any idea of adding pictures to rscbutton ?
how can i add a animation to a dialog like using ctrlCommit ?
any idea of adding pictures to rscbutton
you can use RscActivePicture and RscActivePictureKeepAspect
how can i add a animation to a dialog like using ctrlCommit
Apply the changes you want to do (position, fade, angle, whatever) and then ctrlCommit with a transition time greater than 0.
thanks do u know if i can test my dialog in the editor too like testing a ctrlMenu ?
yes you can
well, how ? ๐
set up a test mission with your dialog and any resources it uses. then load into the test mission and open the dialog...
okay last question should i have it in a .hpp or a .sqf ?
depends... if it is a dialog created with ctrlCreate then sqf, if it is creates as a config then .hpp
thanks
it says Resource player_inventory not found when i try to launch my dialog in typing []execVM "script.sqf" the script.sqf contains disableSerialization and createDialog "player_inventory";
Dialogs.hpp goes with this class player_inventory
{
idd = 1;
movingenable = false;
class controls
{
class escapeback: IGUIBack
.......
did you include Dialogs.hpp in the description.ext
yes
is the dialog written properly? the only reason that error would show up is if the dialog class isnt in the config
how would one press a button and add text to rscedit? ctrlsettext only adds wanted text once and can't be repeated
how would I repeat it
That just sets the text once
I need to be able to keep adding new text without deleting the previous one
basically dial a number
I'm not following
it appends new text to the current text on the control
he's probably meaning setting up the whole keypress event part
I'm kinda confused with this part, basically what I want to do is when you click a button #1 it will add #1 to a RscEdit, ctrlSetText adds #1 but only once, not repeatable, I need to be able to keep pressing the button and keep adding the numbers
yea, use what i posted.
first press will essentially do "" + "#1"
Second press will do "#1" + "#1" and so on
it will add more text to the rscedit instead of overwriting the text already there
The code Connor gave is exactly what you want.
ctrlText _ctrlText gets the current text from the control, and + will append ur new text to the end of it.
I'm not sure how to define the variables?
private _display = findDisplay <idd here>;
private _ctrlText = _display displayCtrl <idc here>;```?
yep working thank you ๐
This might be a weird assumption
If I add an array to the JIP queue, is it still being referenced from the queue, or does arma perform a deep copy?
a client cant refer to an array in the servers memory, so it is a deep copy in the sense that it is a new array in the clients memory
I mean in server's memory
So I add an array to JIP queue at the server. Modify the array. Someone joins. Which value will the client get? New one or the original one?
Got confused a bit... Do I get it right that the JIP queue exists only on the server (makes no sense another way) ?
You meant 'If you called remoteExec at client, you would need to rebroadcast it to update the server's JIP queue', right?
Is it possible to show entered text as hidden? For example in the rscedit I enter 1234 but it shows it as ****?
// on server
myArray = [1,2,3];
publicVariable "myArray";
myArray = [1,2,3,4];
// server: myArray returns [1,2,3,4]
// jip client: myArray returns [1,2,3]
does that make a little more sense?
Yeah makes perfect sense, thanks
@maiden warren it is possible but there isnt a setting for it no
It just has to be so complicated right ...
its not terribly hard to do
they couldn't just do it so we can do like "textHidden = true/false" ๐
Would you be able to give me a hand please?
@maiden warren here is an example. im sure it can be done better but this is the best i can come up with right now just to visualize the concept. run the code in editor to see it working https://pastebin.com/hYC67G49
Is there anyway to draw 3d areas? or walls or anything similar. Something maybe like the editing restriction for Zeus maybe
I think that is also a Model @fringe yoke
Try using simple objects
Wich reminds me..
I wanted to check out what one can di with simple objects ๐
So I have
Condition
Player in thislist
Activation
[objNull, player] call ace_medical_fnc_treatmentAdvanced_fullHealLocal;
Running in a trigger area over a hospital. My question is if I can run the same thing or something similar on a specific vehicle? SO basically a CBPS or something like? Idea is that the truck/ambulance can be driven to a point and be set-up with the same or similar function running. Note this is for a mp dedicated server.
@drifting copper
There is an event for getting in vehicles
You can check the type of the vehicle and then heal
I have tried this ^ Did not seem to work with ACE3
Is there a way to take weaponDirection and turn it into vectorDirAndUp
@peak plover just placed down a trigger and used attach too with acemed fnc activitation. Seems to work fine
I have a script that's called in InitPlayerLocal.sqf,
[] execVM "assignLoadouts.sqf";
and then in assignLoadouts I have
//give NVGs just in case you don't spawn with them
if (paramsarray select 5 == 0) then {
_unit addItem "NVGoggles";
_unit assignItem "NVGoggles";};```
But I'm getting _unit not found. I'm guessing I need a different method to get the unit running the script?
oh, this is an old mission I was working on and I'm trying to get it running
so it should be [_this] execVM
?
_this execVM
Can setWeaponReloadingTime not be over 1?
really? huh
[player,didJIP] execvm "initPlayerLocal.sqf";
Interesting, thanks
@radiant needle
https://community.bistudio.com/wiki/setWeaponReloadingTime
Description:
Sets states and/or makes an action of/on weapon. Reload time is between 0 and 1 inclusive, where 1 is 100% of maximum reloading time. ```
so no, no it cant be more than 1
actually not sure tbh, the way i read that is it cant.
Says it accepts number though, I would have thought that would allow over 1
well, it has to accept a number because 0-1 is numbers
i would assume between 0 and 1 is the range though
Well I guess that makes sense, as setting it to 0 works, but setting it to 10 doesn't
Weird that it would have that limitation
what's the easiest way to see if a side is dead for a Team Last Man Standing?
(playableUnits select {side _x isequalto <side here>}) isequalto []
๐คท
depends what happens to dead units after they die but playableUnits doesnt include dead units so if there are any of a side in the array theyre alive
They should be in spectator when they die
Is there a "OPFOR/BLUFOR wins!" end mission event too? I was just going to use the standard endings you'd put in description.ext and change it depending on who's still alive at the end
I usually do co-op missions, so this is pretty different for me
there are generic winner/loser debriefing classes not but side based i dont think
New question. Most of the things I have found on forums either does not work or as usual I have no clue what I am doing.
I want to make a vehicle a mobile spawn point using the respawn_west method. (do not like the respawn modules) Is it possible to attach the respawn_west to a vehicle to follow it or can I set the vehicle as a respawn point? And if so how would I implement it?
I would just update the spawn point to move with the vehicle maybe?
you would need to repeatedly set a new marker position @drifting copper
Do something like "every x seconds, getpos of the vehicle, setpos of the respawn"
Ref to my last question And if so how would I implement it? I am new to scripting and still very dumb with it
// run on server only
while {game active or whatever condition you want} do {
"respawn_west" setMarkerPos getPos myVehicle;
uisleep 1;
};
``` something to that effect
would this work for "all of BLUFOR is dead"?
["End1",true,2] call BIS_fnc_endMission};```
no because units doesnt take a side
waitUntil {({side _x isequalto west && alive _x} count allPlayers) < 1;};```
would do, though its just a different way of the same as what i pasted above with playableUnits
ahh gotcha
So I have a variable created inside the "Then" code of an "If" statement, how do I access it outside of that scope?
set the variable (or atleast initialize it with private) before the if statement
So even if it's just something like Private _Obj = [];
@robust hollow does this go in the vehicle ini or init.sqf file?
"respawn_west" setMarkerPos getPos myVehicle;
uisleep 1;
};```
yea @radiant needle
i cant say exactly cause i dont know ur mission setup, but after ur spawn vehicle is created you can spawn that code to run on the server only.
cool, will get some more googling done on implementing it. TYVM
wait, are players "units"?
yea
ok good, because I'm testing this thing out with AI, so I swapped the waituntil to allUnits
allUnits includes AI
cool
Is there a way to allow a loadout selection before the player actually spawns? I'm using default loadouts. I can randomize them just fine, just not sure how to let players choose them
you cant delay spawning but you can put the respawn marker out of the way somewhere and once the player chooses their loadout move them to the proper spawn area.
Ohhh that's a good idea.
I'm not too familiar with multiplayer. Right now I have units for the players slots. I'm assuming if I get rid of those units, the players won't spawn in until they choose a loadout and choose they're Respawn marker, right?
^their, it's 2am here lol
not entirely sure what u mean tbh
I know when you join some multiplayer games, you have to select your respawn point and loadout
yea, if ur talking about what i think ur talking about thats the BIS respawn system
In my unit's co-op games, we have our unit slots predefined, so we have to have AI there to spawn
we have to have AI there for us to spawn in as
you can disable AI so the unit slots are still there for players to use but wont have an AI unit spawned ingame
is that what ur getting at?
So for this multiplayer deathmatch thing, I don't need ANY AI on the map, just the respawn points
Negative
You need the base units for players to slot in as
Ok, Teizan understands me
How would you force a loadout selection? Just insta-kill them and let them respawn?
up to you really. dont need to kill them, just open the loadout ui when they load in
Oh, that's the answer I was looking for lol, how do you even do that?
uhh...... you open the loadout somewhere in the player init, probably near the end of it.
I'm looking for the command for opening the ui
createDialog
oh thanks
Wait so I have a bunch of loadouts set already in my random loadout script, it looks like I need to add these to my description.ext too, or can I reference them somehow? Also not sure how to find what the createDialog string needs to be for the loadout menu
case 0: {bluforloadout = ["B_G_Soldier_F","B_G_Soldier_TL_F","B_G_Soldier_AR_F","B_G_Soldier_M_F","B_G_Sharpshooter_F","B_HeavyGunner_F"] };
case 1: {bluforloadout = ["B_Soldier_F","B_soldier_AR_F","B_soldier_M_F","B_Soldier_TL_F","B_sniper_F","B_support_MG_F"] };```
...or can I reference them somehow
Depends on how ur system works but in theory you can put them whereever you want. there is no reason a switch like you have there wouldnt work
how to find what the createDialog string needs to be
its the name of the dialog class in your description.ext
Quick question all...
I want to have a civilian injured (using ACE Advanced Medical) when he is spawned in. I have the spawning handled (AIS Caching) but what I've found that should work doesn't.
[this] call ace_medical_fnc_handleDamage_advancedSetDamage```
That's in the INIT for the civilian I want injured, any pointers?
Connor, is there not a default loadout selection dialog built in I mean? I guess since I already have the loadouts laid out in that switch, I could just make a simple menu with the 5 different classes laid out on it
^ I'm gonna try that tomorrow, gotta get to bed. Thanks for the help
@little ether i think you might be missing a parameter in the first function call
ace_medical_fnc_handleDamage_advanced:
* 0: Unit That Was Hit <OBJECT>
* 1: Name Of Hit Selection <STRING>
* 2: Amount Of Damage <NUMBER>
* 3: Shooter <OBJECT>
* 4: Projectile <STRING>
* 5: Hit part index of the hit point <NUMBER>
* 6: Shooter? <OBJECT>
* 7: Current damage to be returned <NUMBER>
you go from 5 to 7, skipping the shooter object
ah okay so I need to define the weapon they're being hit by?
or the round I would suppose?
no, just another objNull should do cause the parameter isnt actually used in the script by the looks of it
[this, "body", 0, objNull, "Bullet", 0, objNull, Random 0.6]
Even easier! I'll report back in a second
No warning anymore however the AI is not being damaged, I'll have another look at my addon options maybe
Hello all. Does anyone know a way to unattach a waypoint from a vehicle via a script? I'm scripting some AI to get into a helicopter, then jump out and get into a boat, but it seems that even if I try to attach the subsequent waypoint to the boat it stays attached to the helicopter and that makes the AI get back into the helo again.
I've tried asimple "_wp waypointAttachVehicle ;" to reset it, but that obviously doesn't work. I'm not really sure why I thought it would, really...
BI Forum thread of my question for more information: https://forums.bohemia.net/forums/topic/221665-help-getting-ai-to-follow-scripted-waypoints/
@pale sundial you may need to use https://community.bistudio.com/wiki/assignAsCargo to change the target vehicle
Well this is the odd thing. They get into the helo fine, and if I don't tell them to get into the helo they get into the boat fine as the scripts stand. It's only if I try to combine the two in sequence that things much up.
Now that code is something I've not seen before. I'll give that a shot.
How i've understood it is that when you order them into a vehcile, that vehicle becomes "their target vehicle"
and it does not get overwritten and has to be unassigned
you can check what vehicle they are assigned to with this
That sounds right, yeah. I also think that perhaps the waypoint doesn't complete. I have another scripted waypoint for the helo to sling the boat and then drop it off at another location and I did notice that the AI likes to give constant orders to move to the boat it's already slung until I add in the next waypoint.
Regardless, I'll give leaveVehicle a quick try.
For the record, how do I use assignedVehicle again? hint assignedVehicle <group>?
@blissful sand and is that somehow arma related link?
well it works and yes the link is related to arma I want to make a zoo for arma and was wondering how to skin the models with a script
skin the models?
Isn't that essentially just "setTexture"?