#arma3_scripting
1 messages ยท Page 314 of 1
Just that it automtically look up onPLayerRespawn if that file is in the directory
It's not the same thing.
commy2, explain more if you can.
You can have infinite respawn eventhandlers and even remove them mid mission, while the file is either there or not.
Also I think the file runs in scheduled environment so you might have to take care of race conditions.
And the file is not possible to use when you're making an addon.
No reason to have the file though
Essentially the same thing though
The handler is exactly the same
Runs on when you respawn
Conclusion from me: setup the eventhandler with addEventHandler
and don't use the file
params ["_unit"];
_jetType = selectRandom ["I_Plane_Fighter_03_AA_F","I_Plane_Fighter_03_CAS_F"];
private _SPAWNPOS = getArray (configFile >> "CfgWorlds" >> worldName >> "centerPosition");
private _jet = createVehicle [_jetType, _SPAWNPOS, [], 3500, "FLY"];
_unit moveInDriver _jet;
_SPAWNPOS = getPosASL _jet;
private _jetvelocity = velocity _jet;
_SPAWNPOS set [2, 1000];
_unit moveInDriver _jet;
(vehicle _unit) setPosASL _SPAWNPOS;
(vehicle _unit) setVelocity _jetvelocity;
this is what iam using
so your recommendation is using eventhandler for it?
onPlayerRespawn is an eventhandler
It's just two different ways of using it
But yes, use addEventHandler command to add eventhandler to mission
kk,will see what i can do
What is the point of setVelocity here?
But it will just set the same velocity as it already has?
no, as i asid not finished
The vector would be rotated, Sim
yea
Ah ye ok, didnt think of that
I'd keep using _jet instead of (vehicle _unit)
see,sometimes it bugs out with a player, and setVelocity would fail
so for that , iam using (vehicle _unit)
happens for clients tho
not host
Don't see how that would fix anything.
idk, seems like it doesnt fail anymore after i started using
(vehicle _unit)
Hope scripting
It wouldnt change anything
Your player is always a vehicle
It would give same result
It's as effective as sugar pills are.
Hahah
@copper raven Essentially what the vehicle addition to player does is that if you are in a vehicle, it returns that vehicle
If you are not in a vehicle, it just returns the player
So at the end of the day, it's the same thing
If you just wait until your player is in the vehicle, it will be fine
Also, use the vehicle as Commy said
Then your problems should be solved
also one more question,
_allWeapons = "true" configClasses (configFile >> "cfgWeapons");
_weaponArr= [];
{
_weaponString = configName (_x);
_parents = [_x,true] call BIS_fnc_returnParents;
if ("Rifle" in _parents) then {
_weaponArr append [_weaponString];
};
}forEach _allWeapons;
some weapons are bugged/broken
using this to get a randomweapon, to add to groundweaponholder, and some weapons either dont have sound, or dont have animation, etc, is there any way to exclude them?
Well in CfgWeapons there are also base classes and pre equipped weapons.
Of course some of those cannot be used or shouldn't be used.
so is there a possible way of exluding them?
maybe using isKindOf condition, but dont think it would work
The whole BIS_fnc_returnParents thing is a bit messy.
would still use "Rifle" so doesnt matter
wait
private _allWeapons = "getNumber (_x >> 'scope') == 2" configClasses (configFile >> "CfgWeapons") apply {configName _x};
_allWeapons = _allWeapons select {
_x isKindOf ["Rifle", configFile >> "CfgWeapons"];
};
I guess
sec,gonna test it
checked alot of buildings, seems like thats it, didnt find any broken weapon
thanks
or maybe thats just luck ๐
there is also pushback
It will not work with base classes, that's for sure.
Yeah, append [element] is weird.
they spawn as invisible, without icon in inventory, when equipped , there is no sound when shooting/no animations etc, and weapons are invisible while holding
(tbh. i never used append)
Rare compared to pushBack, but sometimes you need it.
I found "append" in this beauty: https://github.com/CBATeam/CBA_A3/blob/adc70c538d47deb92958f20d84f3fb270a190761/addons/xeh/fnc_preInit.sqf#L95
Where do you see a bad one liner?
the _allWeapons code above probly should be a 1 liner for performance.. don't need the select, just the 2 conditions for configClasses
private _allWeapons = "getNumber (_x >> 'scope') == 2 && (configName _x) isKindOf ['Rifle', configFile >> 'cfgweapons']" configClasses (configFile >> "CfgWeapons") apply {configName _x};
if (_x select 0 == "") then {
if (_x select 1 == "preInit") then {```
2 of them @little eagle
๐
ha... i found something most retarded today.
Inside a config MACRO was something like this
parameter = __EXEC(_dam = 0; while {_dam < __VAL__} do {_dam = _dam+1}; _dam)
No idea what they were smoking. ..
@jade abyss
Nothing woring with this control structure:
if () then {
if () then {
} else {
};
};
@thick oar looks strange
@little eagle
Thats... no. Just no. Thats torturing.
Actually it's
if (cond1) then {
if (cond2) then {
...
};
} else {
...
};
What else do you suggest?!
sometimes its even necessary cause u can't evaluate 2 conds in 1 if clause if they are dependent from each other
if()then
{
if()then
{
//code
}
else
{
//code
};
};
OR
if()then
{
if()then {//ShortCode};
else {//ShortCode};
};
other question; is there a big performance difference between missionConfig crawling to get values out of a custom config or is it faster to select from an array out of a sqf-function?
((cond1) && {then;true}) || {else}
โ proof, that dedmen loves to walk barefoot on Lego. Damn masochists.
How is that any different aside from different formatting style?
And the last one is pure cancer
Googol, define "missionConfig crawling"
Dedmen has a point. if-then-else is so 2016
(cond) && {then; true} || {else}
is the way to go
/s
@little eagle
well for example using:
getText(missionConfigFile >> "licenseConfig" >> str(playerside) >> _x >> "icon"); //defined in the licenseConfig.h
to get the iconpath or
_x call bla_fnc_iconpaths; //defined in a switch-case structure
both variants return the string to the icon path
probably the mission config one, but depends on how many of them exists and I can also think of a faster method than both.
unfortunately, no
How often do you use bla_fnc_iconpaths per client per mission?
*fortunately
fixed
xD its just an example we had this once in a mission
do you think of saving into ram and selecting with indexes?
Well if you only need one icon per mission per client, then it doesn't matter
Then you can use whatever you want and it wouldn't make any difference worth worrying about.
well the icons are added to a listbox, there are 150 entries of licenses
// init
My_Icons = createLocation ["Name", [0,0], 0, 0];
My_Icons setVariable ["icon_name_1", "icon\path\1.paa"];
My_Icons setVariable ["icon_name_2", "icon\path\2.paa"];
My_Icons setVariable ["icon_name_3", "icon\path\3.paa"];
// mid mission
My_Icons getVariable "icon_name_1"
You cannot get faster than this, but it's obviously not worth to create the namespace and set all the variables if you only use it once.
This uses C++ hash stuff.
so do you think its more efficient to just create a variable and safe every entry into this variable as array, just with pushbacking?
and afterwards selecting with find?
*save
No, that would be slower than what I wrote.
But again. If it only chooses one or like ten icons per mission, who cares. Choose what you're most comfortable with. This one is the fastest you can get.
thanks for your advice commy
is there a way of rotating a moving jet mid air?, tried this:
_velJet = velocity _jet;
_jet setDir 180;
_jet setVelocity _velJet;
but jet doesnt stay on its velocity, it uses the velocity on previous dir, i would need to rotate vector or something?
using createVehicle , jet spawns with dir==0(north), but i need it to face 180 (south)
Because velocity is in 3 parts, designated towards a direction.
This is for adding speed on the current direction. So do some math on reversing it. I can't think math right now haha
_vel = velocity _vehicle;
_dir = direction _vehicle;
_speed = 10; comment "Added speed";
_vehicle setVelocity [
(_vel select 0) + (sin _dir * _speed),
(_vel select 1) + (cos _dir * _speed),
(_vel select 2)
];
Couldn't you just multiply the current velocity in the [x, y, z] directions and do [-x, -y, -z].
From the original velocity (speed in direction)
Like this:
_vel = velocity _vehicle;
_vehicle setDir 180;
_vehicle setVelocity [
-(_vel select 0),
-(_vel select 1),
-(_vel select 2)
];
@copper raven
will try
180 is trivial, but for rotating the velocity vector around an arbitrary angle I'd convert the vector to polar coordinates first.
private _velocity = velocity _vehicle call CBA_fnc_vect2Polar;
_velocity set [1, (_velocity select 1) + 180];
_velocity = _velocity call CBA_fnc_polar2Vect;
there. rotated arbitrarily.
Still no idea if this exists as BIS function.
its CBA fnc
you can do it with getpos
origin getPos [distance, heading] (Since Arma 3 v1.55.133361)
actually thats the overall position.. would need to subtract the origin pos then
I think you can hack that together, wait
obviously won't work with the inclination angle
But the plane shouldn't dip anyway, so...
[0,0,0] getPos [speed, 180];
Yeah, but also convert kmps to mps when using the speed command
not sure what that will do with height actually
z is 0 as the plane flies straight.
might need to set it to 0 or it's previous z velocity anyway
depending on the effect you want
alright gonna hop on arma, will let you know if i get it to work
_speed = vectorMagnitude velocity _vehicle;
_vehicle setDir 180;
_vehicle setVelocity ((vectorDir _vehicle) vectorMultiply _speed);
i guess that should work too
@vapid frigate works like a charm, thanks guys
yeah, lol. Sometimes it's simple.
Y'all got any ideas on why this just shows the rsc but doesn't set the structured text but when I wait a bit and then run the script again, it adds the text to the existing rsc? I'm completely lost
disableSerialization;
params["_structuredText"];
_lc = uiNamespace getVariable ["Alert", displayNull];
if(isNull _lc) then {
3 cutRsc ["Alert", "PLAIN"];
};
(_lc displayCtrl 1100) ctrlSetStructuredText parseText _structuredText;
try
...
_lc = uiNamespace getVariable ["Alert", displayNull];
waitUntil{!isNull _lc};
3 cutRsc ["Alert", "PLAIN"];
...
The layer maybe conflicts with something used by the base game.
that's an infinite loop?
the waitUntil
Alert probably won't exist until after cutRsc
Okay, then:
_MaxTime = diag_tickTime + 5;
waitUntil{ (!isNull _lc || _MaxTime < diag_TickTime) };
_lc will never change..
only if you setVariable
If the Dialog sets the Var, then yes.
Maybe there is an onLoad eh in the cutRsc config thing
but i think the onload doesn't run immediately
It does, Lecks
oh ok
: D
onLoad = "uiNamespace setVariable ['Display_HUD', _this select 0]; ";
onUnload = "uiNamespace setVariable ['Display_HUD', displayNull]";```
Example is from an RscTitles dialog config
That onUnload is super pointless
either way,waitUntil{ (!isNull _lc || _MaxTime < diag_TickTime) }; isn't useful :). it's like doing waitUntil {false}; or waitUntil {true}
dafuq?
waitUntil{ (!isNull (uiNamespace getVariable ["Alert", displayNull]) || _MaxTime < diag_TickTime) }; would wait until it exists
_lc is defined onLoad in my case.
You don't even need all of this
params["_structuredText"];
private _lc = uiNamespace getVariable ["Alert", displayNull];
if(isNull _lc) then {
3 cutRsc ["Alert", "PLAIN"];
_lc = uiNamespace getVariable ["Alert", displayNull];
};
(_lc displayCtrl 1100) ctrlSetStructuredText parseText _structuredText;
There, fixed
I'll try that ๐
thats assuming you're doing onLoad = "uiNamespace setVariable ['Alert', _this select 0]; ";
Yes.
Thats what he wrote
Yup
Also using plain numbers like 3 will probably conflict with some layers used by the game or mods.
So I should probably change that to like "alertLayer"?
Yeah.
Aaalright
Something unique.
BI uses BIS_fnc_rscLayer to generate a new layer and that starts at 0 and increments.
And there are like 10 of these for PP effects, so 3 is definitely already taken by something else.
Thanks for the help, works like a dream โค
yw
Hello, i would like to get a random position in marker or trigger, i tried using BIS_fnc_randompostrigger,but its not accurate enough is there an alternative?
also trigger or marker is rectangle, not ellipse
How is a random position not accurate enough?
selects one outside marker etc
read bis forums, also found ppl with problems on bis_fnc_randompostrigger
_position = _origin getPos [_radius * sqrt random 1, random 360];
Random position around "origin" in "radius"
z will be always 0, perfect for PosATL
i was trying something like that, but it becomes ellipse if you use radius,i want rectangle
yes.
The sqrt is just so the points aren't more likely to be at the center of the circle.
rotated rectangle...
So you have the w and h of the rectangle, right?
yea
And the X and Y represents the center of the rectangle? Or an edge?
center, the position of it
hey guys, is there a way to get the type of road or the width of the road?
been looking around on the forums and documentation but couldnt find anything
I will think about something, eXel. Maybe someone else is faster...
kk, please ping/pm me then.
markerSize works aswell doesnt it?
well bis_fnc_randompostrigger accepted both, marker and trigger,atm in my sqfs i have markers, but if trigger is easier we can do trigger
marker it is
i only need to return a and b from random position, iam using createvehicle with "fly" dir doesnt matter either
commy_randPosRectangleMarker = {
params ["_marker"];
private _position = markerPos _marker;
private _direction = markerDir _marker;
markerSize _marker params ["_width", "_height"];
_position = _position getPos [2 * random _width - _width, _direction + 90];
_position = _position getPos [2 * random _height - _height, _direction];
_position
};
I love this new getPos syntax, lol
Tested with:
("marker_1" call commy_randPosRectangleMarker) inArea "marker_1"
and it always reports "true"
damn
y not Trigger?
wrong code, but still always "true"
๐
Well it's easily rewritten for a trigger, but it would look different ofc.
๐คฆ
ยฏ_(ใ)_/ยฏ
We all need a button for you.
O.K. whatever
Everytime we make a joke, we press that button. For you, just for you, will popup a big fat sign with "WARNING: JOKE INCOMING" ๐
Beautiful code. The best. Tremendous success.
_marker="mymarker";
_position=[_marker] call commy_randPosRectangleMarker;
can i call it this way?
Now let's look at the inevitable abomination that bis_fnc_randompostrigger is...
dunno,wouldnt have used it, since it was only option i found on forums ,so gave it a try, and it didnt work out
([markerPos _marker] + markerSize _marker + [markerDir _marker, true]) call BIS_fnc_randomPosTrigger
meh
I think that is how it would be used, but the result is wrong
_marker = "marker_1"; (([markerPos _marker] + markerSize _marker + [markerDir _marker, true]) call BIS_fnc_randomPosTrigger) inArea "marker_1"
reports "false" 80% of the time : (
Yeah, very inaccurate when a >> b
running b >> a on mine same thing tho
I placed a red transparent marker on the map and did:
0 spawn {while {true} do {sleep 2;
player setPos ("marker_1" call commy_randPosRectangleMarker);
}};
Fun to watch where it teleports me on the map.
Seems to work. At least for me
Kappa
using
_marker = (_this select 0) so i dont need to rename mkr over and over again, passing with ["mkrname"] call commy_randPosRectangleMarker;
is there any way to move the GPS or any Arma-Overlay to another position through commands in a mission?
probably not,only by hud LO
i might be wrong but i guess i have seen this before on another server, but i can't remember the name ๐ญ
lol
private _display = uiNamespace getVariable "RscMiniMap";
{
(_display displayCtrl _x) ctrlSetAngle [random 360, 0.5, 0.5];
} forEach [13301, 13302];
This is the ultimate troll move.
private _display = uiNamespace getVariable "RscMiniMap";
{
private _control = _display displayCtrl _x;
ctrlPosition _control params ["_posX", "_posY"];
_control ctrlSetPosition [- _posX, - _posY];
_control ctrlCommit 10;
} forEach [13301, 13302];
I can move parts of the GPS with this ^ code, but the map control doesn't move.
I think this was some kind of limitation for map controls.
If they use BIS_fnc_displayLoad, yes
BIS_fnc_initDisplay* I mean
so this would work? i don't understand, is this a solution or a joke xD
Well it moves part of the thing, but the map is still locked in place.
private _display = uiNamespace getVariable "RscMiniMap";
{
private _control = _x;
ctrlPosition _control params ["_posX", "_posY"];
_control ctrlSetPosition [- _posX, - _posY];
_control ctrlCommit 10;
} forEach allControls _display;
This code moves it completely
I just forgot one...
Seems logic...
Good
lol
It's a compliment, no?
It is! Thanks for your help tho. We will try this out and give response here...
The challenge now is to figure out WHERE to move it. I just inverted X and Y
Ah, seems like map controls don't move when you move their controls group.
Entry #127 on today's glitch list.
If I have a dialog in a GUI editor format, how would one import that again to gui editor?
Never did that
Like in the array type
Would it be Ctrl + O maybe? But then what would I name that file?
never mind
lol
Clipboard ๐คฃ
You need to copy the the code of your GUI dialog in to your clipboard, then open the GUI editor again and it woll be appear
Yep as I wrote above, but thanks anyways ๐
Same second ๐
๐
Anyone know how to get this count playableunits trigger to work correctly?
Currently have this -
https://puu.sh/vzCU9/79fbbf9ff4.png
This has worked in the past for previous missions but now I can't seem to get it to activate, changing the percentage doesn't do anything either
Trying to get it so the mission ends once a certain percentage of players have entered the area
are switchableunits also playable units?
nvm i guess it should count them twice both times anyway
if you want to use actual players, allPlayers might work better than (switchableunits + playableunits)
fast question, so im going to use _handle = [] spawn life_fnc_copLoadout; to spawn civ in police gear but i want to save the civ gear they have on, do i use [] call SOCK_fnc_updateRequest;?
nobody knows what those functions contain so it's not really possible to answer that question @tough abyss
That's one way yes @tough abyss
Although if you're spawning something to add gear, make sure that runs before you try update them (i.e use call if you can)
wait so what script is used to load your gear from the database?
Wrong Discord for this stuff mate
executing a code for everyone in the server, but not guy who called it, how to do it?
tried something like this:
_timer= [200,150,100];
_type= selectRandom _timer;
_pname= name player;
[[[_type, _timer,_pname],"timer30.sqf"],"BIS_fnc_execVM",true,true] call BIS_fnc_MP;
i tested this with my friend, when he calls script, on my screen and on his screen his name appears, but i dont want him to get the exec, even doe he calls it.
the ```sqf
[[[_type, _timer,_pname],"timer30.sqf"],"BIS_fnc_execVM",((((true)))),true] call BIS_fnc_MP;
dont think that true should be there, the one i highlighted
from wiki
Boolean - true to execute on each machine (including the one where the function was called from), false to execute it on server only
(including the one where the function was called from)
i dont want this ^
BIS_fnc_MP is deprecated, you should look to use remoteExec instead
thought so
anyone know how to get synchronizedObjects of an object (not unit)?
When using remoteExec, note the wiki for targets: https://community.bistudio.com/wiki/remoteExec
When number is negative, the effect is inverted. -2 means execute on every client but not the server. -12, for example, means execute on the server and every client, but not on the client where clientOwner ID is equal to 12.
so i have to return the id of each player then? so i could restrict one?
yeh problem is clients don't know IDs
in that specific case @copper raven , it might be easier to just check the player name in timer30.sqf (if (_name == name player) exitWith {};)
don't think there's an easy way to do it from clients
If you're RE'ing from a client, you may use https://community.bistudio.com/wiki/clientOwner
remoteExec ["...", -clientOwner]
etc.
oh nice.. didn't know about that command
1.56, too new for me
๐
Also, make sure you don't execute it on the server if it isn't needed. Further, create a function, don't use execVM! Especially if you wish to whitelist in the future, oh the possibilities..
_caller= clientOwner;
[_type, _timer,_pname] remoteExec ["fn_execTimer", -_caller, ""];
?
have todo some tests
or as you said, shouldnt use _caller, just -clientOwner instead
Doesn't matter, but there is no need to make another variable
yeah.
ok made a test, i dont get the message anymore on my screen, but gotta wait for friend to come up so we can test, if he gets the noti
On hosted server there could be some inconsistency between clientOwner, owner and object creator id, especially in missions started from save.
"could" lol
never fixed -.-
i start this script from the initplayerocal.sqf. _unit is a player. it works fine first, but it doesnt run anymore after respawn.
_unit = _this select 0;
while {true} do
{
if ((cameraview == "External") && (isNull objectParent _unit)) then {
_unit switchCamera "Internal";sleep 0.5;
};
sleep 0.5;
};
its just kicking people out of 3rd person, when they are on foot. (i allow 3rd person in vehicles)
i thought the while loop would be running on the player regardless of their death, until they leave the server
could the script throw an error if the player is waiting for respawn?
Try changing _unit to just player. That object reference might be lost when the player dies for some reason
@proven crystal I assume you understand what I mean?
yep, will gie that a try. thanks
@little eagle the getpos script you posted yesterday, is there a way to select random position in the marker, but also make sure that the distance is atleast 5km away from players, so if i was in marker, and there is a player1 let say, i would you like to spawn a player2 atleast 5km away from player1
commy_randPosRectangleMarker = {
params ["_marker"];
private _position = markerPos _marker;
private _direction = markerDir _marker;
markerSize _marker params ["_width", "_height"];
_position = _position getPos [2 * random _width - _width, _direction + 90];
_position = _position getPos [2 * random _height - _height, _direction];
_position
};
this one
sorry for ping, just wanted to ask
Sure, but that would be more math. You trying to kill me?
no ๐
Math is life
thinking about adding some sort of radius of 5000 around selected pos, and checking if there are any other players in the radius of him
roll a position, check if the result is near any of the players, if it is, roll again
just make sure the marker is larger so you don't roll forever
_list = nearestObjects [(position player),["Plane"], 5000];
hint str(_list);
_pos= [_border] call commy_randPosRectangleMarker;
_checklist= (_list select 0);
while {!isNil "_checklist"} do
{
_list = nearestObjects [(position player),["Plane"], 5000];
_checklist= (_list select 0);
_pos= [_border] call commy_randPosRectangleMarker;
};
cant get this working
_list does return a plane in range of player, which is a10, but then i get undefined var _checklist,even doe first object in _list arr is a10 id
EDIT: got it working, thanks
@warm gorge now it sort of works, but it always brings me back into the first person view of the dead body of my first death.
maybe i gotta update the applied unit inside the loop instead...
@proven crystal Sounds like you havent updated all instances of _unit to player.
while {true} do
{
if ((cameraview == "External") && (isNull objectParent player)) then {
player switchCamera "Internal";sleep 0.5;
};
sleep 0.5;
};
Is that what it looks like now?
yep, works now
sweet
does nearObjects return hidden Objects? because either it doesn't or I'm doing something wrong
on a trigger: { _x hideObjectGlobal false; } foreach (this nearObjects 20);but when activated nothing happens
what's the main way to hide range on personal and squad waypoint, but still show the arrow?
only seem to be coming across things to hide it entirely
Probably because there is no main way.
So i'm guessing ill have to go with custom drawing while hiding the engine waypoint?
I guess that would work. drawIcon3D
Okay thanks, i'll go that route then. Just wondering if i was overlooking something and seemed like a familiar problem
I've never heard of a way to remove just the numbers. But that doesn't mean it's not possible.
Is there any way to convert a number to a string while avoiding scientific notation
Nevermind, found BIS_fnc_numberSafe, however doesnt seem 100% accurate
toFixed
Can get additional accuracy compared to str or format
HOWEVER
all SQF numbers are still single floating point thingies, so there will always be inaccuracy with large numbers
Oh nice, didnt know of that. Fairly new ccommand. Yeah I read something about that, sucks it has to be like that. Cheers tho
Does anyone know how I would go about getting a picture like this added to my addon. Like a picture that can be seen when launching the game and being on the main menu. http://i.imgur.com/c2Lvuu4.jpg
Take a look at Exile. They defined the mission that is run in background while beeing in main menu and this mission just plays a background video (but a picture would be possible too). I currently cant tell you how to exactly do that.
need debug scrit to tell all ai to setCombatMode "red"
in sqf this gets really easy to do with positions, too.
_centroid = (_pos1 vectorAdd _pos2 vectorAdd _pos3) vectorMultiply (1/3);```
hey guys!, just a question, where do i find the cfgvehicle classnames of the different parts of the USS Freedom?
typeOf cursorObject
aight, umm where do i input it? eheh, do i input it on the init field of the carrier or on the debug console?
thanks man! ๐
cursorObject doesn't make much sense outside of debug console (mostly)
one more question, where do i unput the NearestObjects command?
hey all, trying to make a system to allow a more structured and GUI-based mission voting system to pick the next mission. Does anyone have any insight into this? I'm doubting this can be done in SQF, and I'll likely have to make a DLL and try to get documentation or something from BI
@dusk plume https://community.bistudio.com/wiki/Extensions
@still forum Thanks, I've looked at that before. Is there something specific in there you're refering me to? I know how to write DLLs, but no for specifically managing a server
You can manage the Server over RCON if you have Battleye enabled
anyone know if it's possible to make a generic scenery object work with 'synchronizedObjects' ?
like what it is specifically that allows it to work with units/modules
or any other way to get synchronizedObjects of non-units? (they seem to link in 3den)
When I create a Taru via createVehicle with "FLY" selected, it spawns in the air - but then immediately nosedives as the engine hasn't turned to full speed yet. Even giving it a setVelocity of +50 upwards, it'll just nose down and eat pavement :/
@manic sigil does it have crew when it spawns?
Actually, I've done this before using:
[([getPos player select 0, getpos player select 1, 500]), (random 360), "O_Heli_Attack_02_F", EAST] call BIS_fnc_spawnVehicle;
This article is where I read about this before:
http://www.armaholic.com/forums.php?m=posts&q=24018
But I believe it needs to have an enemy somewhere on the map first before running that command or it spawns without crew.
and then crashes.
I'm reasonably sure it has crew... but I'mma add some code to throw a pilot in, just to check.
I'll be dipped. Apparently createVehicleCrew solved it - though it was turning and acting like it had crew trying to save it from becoming a lawn ornament before.
Anyone able to help with Lecks' question above around synchronizedObjects?
This is something that we are both working on and we are stumped.
Issue is that using synchronizedObjects doesn't work on objects, but if an object is syncd to a person or module, that code will show that the object is synchronized, but not the other way round, and not between two objects.
If someone also has a workaround it would be appreciated as well.
The use-case is to link a non-unique object to another non-unique object, where the former is used as a visual reference for players to know where a vehicle is about to spawn, and the latter object is used with ace_interact to initiate the spawning of a vehicle to the former-objects location.
can you use locations? they are pretty diverse
don't think they're visible in 3den, so you couldn't sync to them?
oh well it's not really a scripting question then
care to elaborate?
https://cdn.discordapp.com/attachments/233754011235385356/307797190263439361/unknown.png this is the problem we're having
and if another non-unit/module object is used instead of player, can't seem to get the synced objects at all
that screenshot doesn't work for me, but i just tested synchronizedObjects with locations and it works
that doesn't really solve the issue though.. need something with a model
screenshot is synchronizedObjects player = [pad1], synchronizedObjects pad1 = []
you could just use setVariable on locations to refer to the other objects/players you're actually interested in
locations are under the systems section in eden if you wanna test
hmm not sure what you mean. simplest example is we want to link a helipad > a sign
im not sure how you could do that with a location (unless you scripted it individually for each one)
what's the end goal? do you really need to sync?
for our mission makers to be able to set up whatever combination of vehicle 'pads' with signs that open an arsenal type thing to spawn stuff on those pads
via an ace action on the sign(s)
if it was just a one off could easily 'hard-code' it with script, but trying to make it more intuitive
does ace or the arsenal rely on the syncing system?
no
like i'm just thinking you might be better to use locations, then create the pads on the locations via script
logic things like locations are pretty powerful
Are you suggesting that we could use a location, then as part of the locations init it places a visual reference?
yeah exactly
run a script on init which goes over your custom locations and does what you need doing
yeh ok, could do the same with a module
only issue is there's no visual representation in 3den
well maybe an icon or something
but you place locations in eden just like any object though?
yeh, they'd just be an icon though?
you wouldn't be able to show the sign/helipad?
yeah i guess, is that a big deal?
i'm still so used to doing everything in 2D view ๐
would be much better if it was showing the 3d object
but starting to think it's not possible
basically need a module/vehicle combined
just because syncedObjects doesn't work on vehicles
(or location/vehicle combined)
it doesn't seem like it'd be that hard to solve via scripting
i would just compromise and go without seeing the objects in 3D view in eden personally
yeah.. wonder what it is that makes it work with modules but not vehicles
must be the 'simulation' i guess
I suppose we should whack in a feature request then
i would wait and see if anyone more knowledgeable comes up with a better solution first
Cheers for the help in the meantime oneoh.
can see in the mission.sqm that it is syncing them properly
just no way to read it ๐ฆ
can we read values direct from mission.sqm like you do with vehicle configs?
you can read classes from description.ext for sure, i don't know about the sqm though
You can not (without unreasonable effort) unless they are 3den attributes in which case you use getMissionConfigFile.
That may help as well. We were looking at using 3den attributes to create a unique ID for each of these visual representations. That way, we could use something like nearestObjects to find the objects in the area, then read the unique value from 3den attributes to uniquely identify them.
what
there is a whole lot of back-story here
Or did I just say something that is not possible... I do that at times.
"the unique value from 3den" threw me off
So we were planning on using an object like Sr_border to show people where a vehicle will spawn, then somehow linking multiple of these boxes to a sign (Land_InfoStand_V2_F) with a bunch of ace_interact options on it.
We were trying to use synchronize to link the pads to a sign, but that doesn't work between two objects.
For a mission?
Well, you can synchronize, but synchronizedObjects doesn't work
was just having a play with it, it looks like if you add simulation = "invisible"; then synchronizedObjects works
so just need to find a simulation type with a model that it works on
For mission makers, but using scripts to simplify it, so they don't need to cut and paste init scripts
or fill in unique names for everything
Ok, that sounds good Lecks. Might solve the issue
hmm, what I would do is to modify the eden editor scripting to support this. has a lot of nifty eventhandlers including synchonising objects. But I probably have a bit more experience than...
These ace_interact options would be filled in dynamically, so that we can link different versions of Sr_border, some for land vehicles, some in the water for boats, etc.
anyway, all that aside. That is something that I have no experience in... ๐
that might be a good approach commy2 (assuming i can't find a suitable simulation that just does it)
setting 3den attributes in syncing event handlers
yeh was just looking at that, think it might be the way to go
And the meta data could be stored in an dummy 3den attribute with invisible unselectable control in a random category xD
will make it look like normal objects/syncing to mission makers
Eden is nice, but it's scripting is something for... creative minds
I have no idea what
class: Config - connection config class
is
but if this all works like advertised, then it should be possible.
maybe it's whether it's a group or synchronization
i assume the EH would work for both
Yeah, but didn't know these have classes
yeah me either.. probably a new one just for 3den
cfg3den > connections > group/randomstart/sync/triggerowner/waypointactivation
@little eagle regarding your suggestion of using event handlers, how would you serialize the objects in a manner that can be read ingame? would have to give all the relevent objects a unique ID or something?
or can you use get3denEntity during init or something?
I'm sorry to be asking again, but does anyone know how I would go about getting a picture like this added to my addon. Like a picture that can be seen when launching the game and being on the main menu. http://i.imgur.com/c2Lvuu4.jpg
You mena like alive?
Is dead bodies not coming out of vehicle wrecks a known arma bug? I dont have remains cleanup enabled, so it wouldnt be that.
@queen briar i think you would modify the config for the main menu (not sure what it's called.. RscSoemthing)
@warm gorge Yes. You must place a unit in the Seat (and delete it afterwards again), to kickout the dead unit.
So in my case, in my vehicle wreck cleanup script, just loop through it's crew and put in a dummy AI for each dead unit before deleting it?
For example, yes.
Alright ill give that a go. Always been a pain cause youd have a crashed vehicle and only the pilot would come out in most cases, or sometimes the missing bodies would only show for the pilot that gets revived, very weird. Cheers anyways, hopefully it works ๐
@vapid frigate Did you get my part about using a dummy 3den attribute?
{
if(!alive (_x select 0))then {
_tempUnit = DS_civGroup createUnit ["C_man_polo_1_F",[0,0,0],[],0,"NONE"];
switch(_x select 1)do {
case "driver": {_tempUnit moveInDriver _vehicle;};
case "commander": {_tempUnit moveInCommander _vehicle;};
case "gunner": {_tempUnit moveInGunner _vehicle;};
case "turret": {_tempUnit moveInTurret [_vehicle,(_x select 3)];};
case "cargo": {_tempUnit moveInCargo [_vehicle,(_x select 2)];};
};
deleteVehicle _tempUnit;
};
} forEach (fullCrew _vehicle);
You reckon that will work @jade abyss
Be aware that the returned role may or may not be in lowercase. E.g. it's "driver" for the driver, but "Turret" for turret units.
switch is case sensitive
Didnt know there was an easier way to do it, is there?
+i would do it the other way around ->
https://community.bistudio.com/wiki/allTurrets
https://community.bistudio.com/wiki/turretUnit
When deleting a car -> Check all Turrets (and also Cargo!)
OR:
crew
Careful.
{if(!alive _x)then{deleteVehicle _x}}forEach (crew _Veh)```
Something like that.
careful?
The cargo index reported by getCargoIndex is different from the one used by moveInCargo
The one of moveInCargo is shifted by the number of FFV slots
fullCrew handles this, yeah, but then why use allTurrets for the turrets?
That should do it
Not needed anymore, haven't thought about fullCrew ๐
btw
can you assign an Action to a dead person? @little eagle
like _DeadUnit action ["moveOut",Vehicle];
Yeah I chose to use fullCrew cause it has all the features to decide on where to place the temp unit, as in each role, cargo position, turret position etc
Probably, but it would not be accessable when the dead one is inside a vehicle.
@little eagle yeah, by that you mean for a unique ID? (+ another variable for linked IDs) ?
Yeah, Lecks. Something like that.
I'll take a look. Maybe you don't need to keep track of the given ids.
Otherwise this might also need a mission attribute taking care of these.
(HL if something needed, back in OB)
might be a good time to try out the CBA hashtable
There is something in the mission.sqm already
class Connections
{
class LinkIDProvider
{
nextID=1;
};
class Links
{
items=1;
class Item0
{
linkID=0;
item0=2;
item1=1;
class CustomData
{
type="Sync";
};
};
};
};
But no idea how to access that later in the mission.
yeah, but you can't really read it from in a mission ๐ฆ
yeh i can't test right now, but i think that only works in 3den
Only inside 3den
Goto methods when wanting to serialize an object is BIS_fnc_objectVar and BIS_fnc_netId
planning to use that + ConnectionChanged3DEN
But none of them survive 3den
might really be the best to have your own custom ids and keep track of the last one given via a mission attribute.
then iterate through allMissionObjects at the start once.
OH
I found it
get3DENEntityID
Returns unique index of an Eden Entity. This number remains the same even after saving and loading the scenario.
Now how to use this inside the mission / preview ...
One Eden attribute that stores the 3DEN Entity ID on the object
One Eden attribute that stores all 3DEN Entity IDs of the connected objects
yeh i think i'm going to have to do that (or some other hash/unique id)
Then iterate through that once at mission start
in this case could make a hash from the position pretty safely
np, thanks for advice
Can 'isTouchingGround player' sometimes return inaccurate results? Im trying to use it in a parachute script, but sometimes, only sometimes, it seems to be returning true as soon as the player ejects out of the vehicle even know they are in the sky
Did you answer your own question?
Yeah I was more asking if anyone else has experience similar issues before
Or would know a workaround
You have provided no repro.
The comments here: https://community.bistudio.com/wiki/isTouchingGround
suggest that the command is pretty shit
could probly just use (getPosATL _unit) select 2 < 1
what i did was to check the unit's animation
But what if you land on the roof?
hmm yeh true
Apparently isTouchingGround player should always report true for units inside vehicles
And units inside a parachute are inside a vehicle
because parachutes are vehicles
sort of makes sense.. they're 'not falling'
It's even worse
If you are using this command as a validation method, it should not be the sole thing you are checking for, as the result is often inaccurate. For example, it returns false for some helicopters when landed on the roof of certain buildings, and it always returns false for boats, even if they are beached.
In addition to previous statement: That behaviour is true, simply because isTouchingGround applied to a player unit (or any unit) is frozen to a last state when unit enters vehicle. To get proper return from this command you should go for units vehicle:
This command returns always true if the falling object is attached to some other object with the command attachTo, like for vehicle air drop with parachute.
seems like a pretty broken command
but also seems like you can achieve something less broken with some pretty simple scripting
I guess. As long as the z in PosAGLS is greater than like 0.1, the unit should be falling
I can show you the code I have now. Basically it gives the player a parachute, then ejected them out of the vehicle and has a waitUntil {isTouchingGround player} before giving them back their original backpack. But the issue is it seems to skip this check and remove their parachute and give back their backpack before they even touch the ground
i checked that the unit isn't in that HALO animation last time i needed to do something similar
You should probably check if the parachute touches ground and not the player
aren't parachutes automatically deleted when you land?
Yeah
maybe check and wait until the parachute dies
check until the backpack becomes ""
Yeah that probably would work. Btw this is what I have now: https://pastebin.com/ub25SyV9
Should work too
player action ["Eject",vehicle player]; <- moveOut maybe better
iirc "eject" had an issue, but i can't remember what it was
hint "You're not high enough to use this" ๐๐ฟ
lol
if(((getPos player) select 2) < 100)exitWith{hint "You're not high enough to use this";};
->
if(((getPosATL player) select 2) < 100)exitWith{hint "You're not high enough to use this";};
you know, i wish BI had just done javascript style === instead of isEqualTo command
There is no getPosAGL command
The whole check for deleting the parachute is unnecessary.
It sometimes takes a while to delete tho
But yeah, I guess its not really that neccesary
waitUntil {!(typeOf vehicle player) isEqualTo "Steerable_Parachute_F"}
wouldn't that do it?
@little eagle *atl
Or just wait until the backpack is "" ...
Dscha, ATL runs into problems with landing on buildings
And water
First line, Commy
Yes
He is checking if he is high enough
with getPos (as you just sayd) its possible that he can't jump, beacuse a high building is below him.
Can happen.
Depends on what you want I guess, but ATL sucks for jumping over sea
ASLToAGL getPosASL
; )
Not needed
@warm gorge Hope you remember to remove all the preeqipped backpack items in your function.
Ah true ill add that in
Alright I updated the script. Had to add 2 waitUntils tho, the first one waiting until the parachute is actually open
waitUntil {(typeOf (vehicle player)) isEqualTo "Steerable_Parachute_F"};
waitUntil {!((typeOf (vehicle player)) isEqualTo "Steerable_Parachute_F")};
A trigger with condition 'heli in thislist' and onAct 'deleteVehicle heli' should remove a helicopter that flies through it, right?
don't forget about those ppl that forget to push the button too shadowranger
that would keep running forever for them
When creating a briefing you have the option to use various tags like br or marker and such.
But how does one use the gear tag? The wiki says it requires a unit id. But what is that so called unit id?
Also what does the gear tag do?
Is it showing the inventory of that unit?
@vapid frigate So I should just add a !alive player check into the waitUntil?
that should work i guess
Okay, partially working... does deleteVehicle not work on script-spawned vehicles?
it does work on them
I can't seem to get it to, though :/ I have a helicopter spawn in, create a pilot for it, move a crew into cargo (specific units, cant spawn), where it unloads them, then moves to a bugout position... all that works, but the delete script just doesn't go off, unless there's a dead body in the back that one time.
The trigger has been various things, currently it's Opfor Present / this and (helit in ThisList) / helit deleteVehicleCrew pilot; deleteVehicle helit;
Got it - bloody thing was stopping well outside the 100m trigger zone.
Stupid self-preserving AI :/
//position
_pos= [_border] call commy_getRandomPosMarker;
_list=[];
_checklist= "notnil";
//checks in radius of 5000 for jets
while {!isNil "_checklist"} do
{
_pos= [_border] call commy_getRandomPosMarker;
_list= [];
_list = nearestObjects [_pos,["Plane"], 5000];
_checklist= (_list select 0);
};
if (isNil "_checklist") then
{code}
so i have a=10 b=6000 marker setup, so script works good, if there arent any jets in radius of 5000 of _pos, then do code, but then , sometimes a position is like 10km away from AO, because marker is big, and selected position meets condition of 5km nojets, so what i want is like "spawn jet 5km away from any other jets(if there are any at all) to closest position, meaning that it would select position atleast 5km from other jets, and not more than 5.1km from other jets lets say. Maybe its complicated, but thats probably the best i can explain. Better example would be like, lets say there are no jets in air, only me, so i would get spawned in front of marker, closest position to AO, and not at the back of marker. Like i dont want it to spawn it at the back of the marker if there is no reason to, i just want to restrict like
if (_posDist >= _closestJet && _posDist <= 5100 && isNil "_checklist")
^ that obviously wont work, but just an example what i want, the reason i want this, is because i tried this with a friend, so even doe iam like 20km away from his spawn, he gets spawned far away like 10km away, in the back of the marker, so its kinda boring to fly those 5 kilometers, where you could be spawned in
Hello, Does someone have a link to some Multiplayer Timer countdown ? (my problem is with syncing every player to the time so it ends at same time for everyone)
If you are using CBA then CBA has a time synchronized between everyone
No mods
@quartz coyote you mean like, with sleep command or something?
Yeah
I have one working but it is based on "time" var so if the script isn't stated for all at same time... then is dosn't end at same time for everyone
so you change your time var into some random time?
so you want something like this?
sleep _someRandomTime
and you want random time to be same for everyone but random?
No, start time is defined by param1 and end is 0
i think youre looking for https://community.bistudio.com/wiki/publicVariable
the problem is that it's in a MP environnement, so I can't flood the game with publicVariables
run the timer serverside. make the clients send a request of the current time to the server. then the server remoteExec's back with the current time
@tough abyss Could you have a few minuts to jump in my Teamspeak to Explain ?
{
_displayName1 = getText(_x >> "variable");
_control1 lbAdd format["%1",(localize _displayName1)];
_control1 lbSetData [(lbSize _control1)-1,_x];
} forEach _licenses;
diag_log format["licenses config: %1",_licenses];
diag_log format["Displayname config: %1",_displayName1];```
Output of diags
21:19:35 "Displayname config: any"```
For some reason I can't get the displayname to be retrieved from my missionconfig licenses.
As it comes back as any.
People here that have experience with this ?
Well did you define it?
It gives any because _displayName1 is defined within the scope of the forEach. I'm guessing you're using this https://github.com/AsYetUntitled/Framework/blob/master/Altis_Life.Altis/config/Config_Licenses.hpp
So then you're trying to localize the variable, when you should be trying to localize the displayName
Oh yeh sorry
The displayname
didn't work neither
I tried variable later on but same any
Expecting it to maybe work then you know ;D
The listbox has been defined yes
So that should work fine.
For some reason the displayname don't come up with the real name.
Yet I get the array of all the license names
getText(_x >> "variable");
And then I try to get that text
It being displayname then
But it doesn't matter either they are both text values
Just weird it can't get the text displayname variable for all the licenses categories. ๐
@frank ruin I'm a little confused by what you mean. This should work though
_licenses = "true" configClasses (missionConfigFile >> "Licenses");
_displayName1 = ""; //this would need to be defined here for it not to print "any"
{
_displayName1 = getText(_x >> "displayName");
_control1 lbAdd format["%1",(localize _displayName1)];
_control1 lbSetData [(lbSize _control1)-1,_x];
} forEach _licenses;
diag_log format["licenses config: %1",_licenses];
diag_log format["Displayname config: %1",_displayName1]; //only prints the last thing in the forEach
I define displayname1
_displayName1 = getText(_x >> "displayName");
As such
For each license >> get me displaynam
Yes but it prints any for the diag_log because it's defined inside the forEach loop.
As an example:
call {_a = 2};
diag_log str _a; // "ANY"
_a = 0;
call {_a = 2};
diag_log str _a; // "2"
๐คฆ
or rather, even if it still doesnt, there is more wrong than that
_displayName = M_CONFIG(getText,"VirtualItems",_x,"displayName");
_control lbAdd format["%1",(localize _displayName)];
_control lbSetData [(lbSize _control)-1,_x];
_icon = M_CONFIG(getText,"VirtualItems",_x,"icon");
if (!(_icon isEqualTo "")) then {
_control lbSetPicture [(lbSize _control)-1,_icon];
};
} forEach _shopItems;
Worked fine ๐
Same concept.
oh yes everything inside that block works
But then for items insteado of licenses
but the forEach throws up a new scope
and all variables defined only inside that scope will not exist once you exit that scope
anytime you change a variable inside {} and wanna use it afterwards, you have to make sure its defined outside of that {}-scope too
mm
How would I get it then so it defines and runs all the license names in the listbox
you tried to log a variable that only existed inside of the foreach scope
everything inside it works (probably). Look at penny's code snippet to see how you could still log the last iterated displayName
But I would still need the foreach to run
to cycle through the license list
How can I store it then.
if you want to use a variable outside of the forEach scope, you have to define it once before you open that scope.
see the past examples we gave you
Now I get
22:55:51 "Displayname config: STR_License_Pilot"
As response
But it's not filling the list
It's getting the correct variable though now
I'm not that well versed to tell you if your listbox stuff is set up correctly, but i doesn't look immediately wrong to me.
try reading up on the wiki for that and filling up some dummy listboxes, e.g. starting out simple.
Well I did controls are also correct
Input is correct though now
23:01:10 "Displayname config: STR_License_Boat"
23:01:10 "Displayname config: STR_License_Pilot"
23:01:10 "Displayname config: STR_License_Truck"
23:01:10 "Displayname config: STR_License_Firearm"
23:01:10 "Displayname config: STR_License_Diving"
23:01:10 "Displayname config: STR_License_Home"
23:01:10 "Displayname config: STR_License_Oil"
23:01:10 "Displayname config: STR_License_Diamond"
23:01:10 "Displayname config: STR_License_crate"
23:01:10 "Displayname config: STR_License_Copper"
23:01:10 "Displayname config: STR_License_Cocaine"
23:01:10 "Displayname config: STR_License_Heroin"
23:01:10 "Displayname config: STR_License_Marijuana"
23:01:10 "Displayname config: STR_License_Rebel"
23:01:10 "Displayname config: STR_License_Assassin"
23:01:10 "Displayname config: STR_License_meth"
23:01:10 "Displayname config: STR_License_explosive"
23:01:10 "Displayname config: STR_License_blackm"
23:01:10 "Displayname config: STR_License_Pilot"
23:01:10 "Displayname config: STR_License_CG"
23:01:10 "Displayname config: STR_License_Pilot"
23:01:10 "licenses config: [C:\Users\Gebruiker\Documents\Arma 3 - Other Profiles\RPGforYOU\missions\outlawedvet1234.Altis\description.ext/Licenses/driver,C:\Users\Gebruiker\Documents\Arma 3 ```
_control1 = CONTROL(3300,3304);
lbClear _control1; //Flush the list.
class LicenseInfomationList : Life_RscStructuredText {
idc = 3304;
@tough abyss Did you get the supportinfo dump yet? I had this: https://pastebin.com/mLbP94hA
(tab separated)
Cheers for the people spending time to explain me.
I got it working now suprised it was such a stupid thing. ๐
I solved it otherwise
I just passed the classname
Instead of the entire CFG path
Works now
All the hassle resulted in it working at least.
is there a maxlength value for the RscEdit?
whats the diff with [_this select 0,1] and [_this select 0,0]
One has a 1 and the other has a 0
good detective work
lol what does that mean tho?
I believe this is what we'd call a multi dimensional array correct?
It's a one dimensional array, but I guess those are multidimensional arrays too in a way.
_this = ["banana"];
[_this select 0,1] // ["banana",1]
[_this select 0,0] // ["banana",0]
nothing more. Should be easy to understand if you know how arrays work.
๐คท
Yeah, the difference is 1 and 0, no matter how you look at it
@subtle ore multidimensional would be [[1,2], [1,2]] (2 dimensions)
which this could be.. can't tell without know what's in _this select 0
@ Lecks#0253 correct, my bad. Looking at it on mobile is hard to do lol, especially with no code fornatting
Is there a command for printing out the current version of arma I'm on?
productVersion
Anyone knows how to make a MP Countdown Timer synced to all players (no mods) ?
So I had a similar sort of question a few days ago, but it was the other way around. Is there any way to avoid scientific notation with parseNumber?
Nvm sorted my issue out
@quartz coyote A couple people mentioned how you can do it yesterday
@quartz coyote Run this on the server only:
server_fnc_runCountdown = {
_countdownTimer = 90;
GAME_START = false;
publicVariable "GAME_START";
while {_countdownTimer >= 0} do {
format ["ROUND STARTS IN: %1", _countdownTimer] remoteExec ["hintsilent", -2];
_countdownTimer = _countdownTimer - 1;
sleep 1.2;
};
GAME_START = true;
publicVariable "GAME_START";
};
[] spawn server_fnc_runCountdown;
Thanks @tough abyss I'll look into this
Questions: Why would one ever need to use publicVariable? What's the differance between a public var, and a global var?
Oh, that explains it. Thanks.
Check the wiki @tough abyss
PublicVariable just broadcasts the variable to all clients
I did, @queen cargo. But @still forum explained it much better.
Yeah, its a bit confusing sometimes ๐
But it is not correct @tough abyss
The variable Is only synchronized between clients when you invoke PublicVariable
If you change the value again, you have to PublicVariable it again
I understood that part.
Hard not too, really: ```
Posted on 3 Aug, 2006 23:03 -
Hoz -
This command broadcasts a variable to all clients, but as soon as you change the variable again, you have to use publicVariable again, as it does not automatically synchronise it.
Does "valign" work in ctrlSetStructuredText?
_ctrl ctrlSetStructuredText parseText format["<t align='center'>%1</t>,"Text];
yeah i know, but this does only center the text x-axis but not in the y-axis
Config:
class MyTag_RscStructuredText
{
class Attributes
{
font = "RobotoCondensed";
color = "#ffffff";
colorLink = "#D09B43";
align = "left";
valign = "middle";
shadow = 1;
};
};```
afaik nothing more.
uh wait
*updated config-example โ
Okay, so i gotta use the Config instead of sqf ๐ - it was worth a try
Why don't you just try <t valign='middle'>"TEST</t> ???
didn't work
You used "ctrlSetStructuredText parseText " ?
Because from what i read here:
https://community.bistudio.com/wiki/ctrlSetStructuredText
It should work
_inlineText ctrlSetStructuredText parseText "<t align='center' valign='middle' size='0.9' font='PuristaLight' shadow='0'>Inhalt</t>";
didn't work
Then, you got your answer =}
valign does not work with ctrlSetStructuredText
I tried it over and over again and it didn't work for me.
That doesn't mean it doesn't work
๐
So again -> It's arma'd.
(btw. Commy: That was a joke)
I ended up moving the whole control down.
Make your own control ยฏ_(ใ)_/ยฏ
It is my own control. But I had to move it
class MyTag_RscStructuredText_centered
class MyTag_RscStructuredText_Top
class MyTag_RscStructuredText_Bottom
Dscha, I had to use ctrlSetStructuredText, because it's dynamic (and colored), but as soon as I used the command, the valign broke
Probably should create a ticket.
Or change the wiki
why is copyFromClipboard disabled in MP?
Think it was for 'security'
yes the wiki says as much, but what exactly would the attack vector be then
just been discussing the rug dsai system in the arsenals on the forums and wonder if anyone knows of a way to run a script when a player enters the arsenal, via learn-arsenal?
Main menu arsenal.
And I don't think there is a way. I mean, you could alter what the script of the button, but it wouldn't survive the mission start.
Maybe check the mission name in a CfgFunctions preInit function.
If the mission name is the one of the arsenal, then do stuff.
Does anyone know how to spawn blood? (Like the one you can see being "dropped" by wounded soldiers ect)
@rancid pecan Real time in what regard? Do you just want a clock in that format or actually have a mission running at your PC time?
thank you ๐ but you private message
Back to my problem: Spawning blood
http://killzonekid.com/arma-extension-real_date-dll-v3-0/ > how to add statusbar ?
lol
First off, this can be done with extDB
Second: you get whats returned, add it to status bar
I am presenting to the world a SQF parser and analyzer for Atom (editor). Modders from Exile started using it with very cool results, and I expect that this is helpful to some of you. https://forums.bistudio.com/forums/topic/204193-sqf-parser-and-static-analyser/
does magazineCargo not work on GroundWeaponHolders? any alternatives?
@hallow spear Of course they do, are you in MP or SP?
singleplayer
take another look, the syntax may be incorrect ๐คท https://community.bistudio.com/wiki/addMagazineCargo
Oh, and make sure it's local
i messed up.. thanks for confirming its function
Yep.
I have this while loop going. How do I break it from an addAction?
_cond = true;
_this addAction ["Break loop", {_cond = false}];
while {_cond} do {stuff};
Can it even be broken from outside the loop?
The addAction's code is probably be executed in a different scope so _cond isn't defined.
cond = true;
_this addAction ["Break loop", {cond = false}];
while {cond} do {stuff};
That should work, but if you're going to do it like that you should at least tag the variables
That's exactly my problem. I need this snippet to be able to run on several objects.
The condition must be _local, or else all the loops will break.
setVariable on the objects?
Hmm... Yes, that's probably a good idea.
@jovial ivy Thank you
if you are still using notepad++, I recommend trying out Atom + ACE plugin (colors) + linter-SQF (show errors)
if you are using atom i recommend trying notepad++
i use that with the style configurator preset "Deep Black" @tough abyss
yeah i updated notepad++ to the latest version cos of someone in here
nearly lost all my preferences and shit
my sqf definition xml doesn't have all the latest commands but you can add them pretty easily
no problem
yeah go on then
have you split them all in to the different groups nicely?
security reasons
not sure i bothered when i added the last ones
oops wrong chat
@rancid ruin, is notepad++ able to achieve this? http://imgur.com/a/1vLXm
like this @tough abyss http://i.imgur.com/MOBzUWv.png
i dunno @thick sage, but a linter for a scripting language useful for only one purpose isn't enough to make me switch to atom ๐
ah, sure! If you use texpad++ for other things too, then of course you should keep using one and just one.
mine is missing a load of them @tough abyss but the ones i do have are split in to different groups which are styled differently e.g http://i.imgur.com/Fo7MXep.png
i normally just add them one by one as i use the new command and notice it's not styled properly
i just followed on from the original grouping scheme, can't remember where i got it from
BIS and CBA functions in 3rd group, normal functions in 2nd group, sides in 5th, etc
When remoteExec is executed globally, does the server handle running it on everyone? Or the client executing it? Because with a high traffic server, I want to know if its worth confining remoteExec calls to as little amount of players as possible, if it is handled by the server, to help with performance
"premature optimization is the root of all evil" - Donald Knuth.
but remoteExec should be used in limited circunstances, typically when you want machine X to tell server to tell machine Y to run Z
Well on a server that has struggled with script lag, I dont know if it makes much of a difference to change for example global death messages, to for example only players within a certain distance
Yeah that too
{
if(player distance _x < 150)then {
[player,'AovrPercMrunSrasWrflDf'] remoteExec ['switchMove',_x,FALSE];
};
} forEach allPlayers;
Not sure if it makes much of a difference, but I do it like that now
Compared to your method ^
select is much faster than foreach i thinks
Ill give it a benchmark later
@pliant stream copyFromClipboard is disabled in MP because a hacker could steal anyones clipboard content. Did you ever have anything sensitive in your clipboard by playing Arma? If yes then you know why it's disabled
@warm gorge Your version will be performing much worse. For one an if in a loop is slower than using the select method. Second you are sending a remoteExec message for every player to the server. Quiksilvers variant sends one remoteExec command with a playerlist
i don't see it... you'd have to be able to execute arbitrary scripts on the target client
alright i can see how the server owner could abuse it
i don't know about how the a3 remotexec thing might have screwed things up, but at least in a2 far as i can see, in order to execute arbitrary scripts on a peer client, the target would have to have some code in place to do that
access to clipboard data isn't allowed in web browsers either, unless there is user interaction
hello, is there a way of playing animation in a row? Like a playlist.. One animation after another.
I tried writing the animation commands in the order I want but it will just play the first one and not continue.
you could maybe use waitUntil
like, make unit do animation x, waitUntil unit animation is not x, change animation to y...
first you want to wait, with timeout, for the action to start
playMove / switchMove then waitUntil animationState is not the animation you're playing
i'm not sure that's the best way to do it, maybe someone else has a better way, but that's what came to my mind first
ok I got it, thanks
the animations are kinda sucks though, he's doing a moonwalk lol
if the animations weren't wonky it wouldn't be arma
@tough abyss use playMove. You can stack animations with that IIRC
how are people doing respawn in single player these days? what's the best solution?
Is there a certain animation config value that determines whether it is compatible with playMove or needs switchMove?
ArmA.Studio 0.2.6331.26237 got released
check #arma3_tools or #production_releases for further informations
Anybody in DevBranch, who can check/confirm that diag_toggle "hitpoints"; doesn't works?
Does anyone know how to make a variable from a script be used in a config?
if (!local _this) exitWith {};
_vests =
[
"V_Chestrig_rgr",
"V_Chestrig_khk",
"V_Chestrig_oli",
"V_PlateCarrierIA1_dgtl",
"V_HarnessOGL_brn",
"V_HarnessOGL_gry",
"V_BandollierB_cbr",
"V_BandollierB_rgr",
"V_BandollierB_khk",
"V_BandollierB_oli",
"V_TacChestrig_cbr_F",
"V_TacChestrig_grn_F",
"V_TacChestrig_oli_F",
"V_TacVest_blk",
"V_TacVest_brn",
"V_TacVest_camo",
"V_TacVest_khk",
"V_TacVest_oli"
];
_vest = selectRandom _vests;
_this addvest _vest;
I want _vest to be used in a config to give a unit a vest, instead of adding it like it does in the code above ^^
That doesn't work.
Welp, okay. ๐ Thanks
_pilot disableAI "PATH";``` I tried to stop AI from moving its plane. It does not work. Even when ``disableAI "move"`` it still moves the plane... Any ideas?
@queen cargo Congrats on release and thank you. Great tool!
@hollow lantern You could try removing fuel
@peak plover na, plane will be catapulted from the carrier it needs fuel! but... AI is to dumb to stay on the catapult line ๐
Hey, anybody know the changes from extdb2 to extdb3 off the top of their head?
It's been a nightmare updating.
/*
author: @Aebian
description: Launch script for AI catapult start from USS Freedom
returns: nothing
created: 2017-05-02
// _null = [KI_plane02P,ki_plane02,Catapult3] execVM "scripts\ki_launch.sqf"
*/
params["_pilot", "_plane", "_catapult"];
_pilot disableAI "PATH";
_carrierObjects = Freedom nearObjects ["Land_Carrier_01_hull_07_F", 100];
CarrierPart = _carrierObjects param [0, objNull];
_carrierPartCfgCatapult = configfile >> "CfgVehicles" >> "Land_Carrier_01_hull_07_F" >> "Catapults" >> _catapult;
CarrierPartanimations = getArray (_carrierPartCfgCatapult >> "animations");
[CarrierPart, CarrierPartanimations, 10] spawn BIS_fnc_Carrier01AnimateDeflectors;
sleep 14;
[_plane] call BIS_fnc_AircraftCatapultLaunch;
sleep 2;
_pilot enableAI "PATH";
sleep 8;
[CarrierPart, CarrierPartanimations, 0] spawn BIS_fnc_Carrier01AnimateDeflectors;
``` Do I need to do something special with _catapult in order to use it in the ``configfile`` part? I always get a undefinied variable error
No, the error is most likely something else.
_catapult is indeed undefined though.
How do you call the script? The example looks wrong
Catapult3 most likely has to be a string. With quote marks. "Catapult3"
Any reason why CarrierPart and CarrierPartanimations are global variables?
burp
๐
Attempting to connect to database"
Error in expression <ult == "") exitWith {
};
if ((_result) < 60) exitWith {
Error position: << 60) exitWith {
2017/05/02, 13:39:13 Error <: Type String, expected Number,Not a Number```
if(_result == "") exitWith {
};
if (_result < 60) exitWith {
["The extDB version is outdated"] spawn server_fnc_log;
[Format["The extDB version was %1", _result]] spawn server_fnc_log;
};``` What... Is it looking for _result == nil?
You check whether result is an empty string, and then if it's less than 60..?
Yeah, that makes no sense. The return value of callExtension is always a string.
"50" < 60
doesn't work
parseNumber ?
Well
@unreal siren look at the example files on extDB3's bitbucket.
I'm trying to update from extDB2 to extDB3, one of the changes on an altis life github for said progress was to remove parseNumber
callExtension always reports strings, but you cannot use > etc. on strings obviously.
They also ```
//Replaced
"9:ADD_DATABASE_PROTOCOL:%1:SQL_RAW_v2:%2:ADD_QUOTES",
//with
"9:ADD_DATABASE_PROTOCOL:%1:SQL:%2:TEXT2",
Don't know anything about that, but your script error is pretty obvious.
Alright, gotcha. I'll revert that change.
The example files tells you what to write to make it work.
So look between the altis life github, the extDB3 example files/documentation and your current version and figure it out.
There is also an altis life discord I believe, so feel free to ask them pros
The way quotation wrapping happens changed for certain data types. Take a look at the extDB3 wiki to see what is wrapped exactly (things like enums for parseNumber) @unreal siren
Awesome, will do.
How would I create a script that on AI death that another unit is created standing in his place? I believe I need to use addEventHandler or something so that it isn't constantly running on all AI.
https://community.bistudio.com/wiki/disableUserInput is there a version of this that prevents the use of everything but the escape menu and looking around?
I'm not aware of one, but you could easily produce those results with keyDown
I mean, do a keydown handler for every control?
Main display?
you mean display 46 or something?
Do you want to disable the mouse too or only keys?
firing weapon still allowed?
You can combo keyDown with something to stop shooting
well the mouse event handlers can do that
Yeah. Keydown that reports true, unless the keycode was 0x01