#arma3_scripting
1 messages ยท Page 297 of 1
good news is the extracion works
bad news is i cant find the vehicle name lol
@plush cargo is that by chance a boat push back script?
oh wow
to find what side of the dock you're on and which direction to turn/push you
that looks good
need a bit of help pulling out the name i need to finish this script
_Raider_1 = [];
_extractChopper_1 = [];
if (isServer) then {
_Raider_1 = createGroup WEST;
_extractChopper_1 = [getMarkerPos "extractionSpawn_1", 0, "B_Heli_Transport_03_F", _Raider_1] call BIS_fnc_spawnVehicle;
//Extraction Waypoints
_wp = _Raider_1 addWaypoint [wp_POS, 0];
_wp setWaypointType 'MOVE';
_wp setWaypointSpeed "FULL";
_wp1 = _Raider_1 addWaypoint [position ab1, 1];
[_Raider_1, 2] waypointAttachVehicle vehicle ab1;
_wp1 setWaypointType 'MOVE';
_wp1 setWaypointSpeed "FULL";
};
later on in the script im using
_car = _extractChopper_1 select 0;
but its returing undefined
only returing undefined when its on the dedicated though
@dry egret You assign it in an if (isServer) block, so it's only defined on the script running on the server. if you try to access it on a client, it'll be undefined. Make sure to use an if (isServer) check when you read it too
how do i pull out the name so that i can access it on client then
If you need to access it from any machine, assign it to a global variable instead, then broadcast it to clients
if (isServer) then
{
// Assign global variable a value on the server.
GlobalVariable = 1337;
// Broadcast "GlobalVariable"'s current value to all other machines.
publicVariable "GlobalVariable";
}```
publicVariable will send the value to all other machines, and have them assign it to a global variable on their end also named GlobalVariable. You need to call that every time you change its value. It also handles joining players, so if you call publicVariable, and someone joins after that, they'll get the most recent broadcast value
_Raider_1 = [];
_extractChopper_1 = [];
if (isServer) then {
_Raider_1 = createGroup WEST;
_extractChopper_1 = [getMarkerPos "extractionSpawn_1", 0, "B_Heli_Transport_03_F", _Raider_1] call BIS_fnc_spawnVehicle;
extractChopperGlobal = _extractChopper_1 select 0;
publicVariable "extractChopperGlobal";
//Extraction Waypoints
_wp = _Raider_1 addWaypoint [wp_POS, 0];
_wp setWaypointType 'MOVE';
_wp setWaypointSpeed "FULL";
_wp1 = _Raider_1 addWaypoint [position ab1, 1];
[_Raider_1, 2] waypointAttachVehicle vehicle ab1;
_wp1 setWaypointType 'MOVE';
_wp1 setWaypointSpeed "FULL";
};
_car = extractChopperGlobal;
like this
yes. not sure what BIS_fnc_spawnVehicle returns, since I've never used it. But if it's an array with the first element being the chopper, then yes
yep thats what it does
the mission is does not support JIP < not a badass at arma scriping
lol
single mission no respawn 3 revives
@dry egret Here's an example where the server decides when enemies will arrive, and then informs all clients about it.
init.sqf (executed on all machines when the mission starts):
if (isServer) then
{
// Decide a random time enemies will arrive at.
TimeEnemiesWillArrive = 60 + random 300;
// Tell clients which time was chosen.
publicVariable "TimeEnemiesWillArrive";
}
else
{
// Wait for the server to tell us at which time enemies will arrive.
while { isNil "TimeEnemiesWillArrive" } do
{
sleep 0.1;
};
};
// Executed on both server and clients.
hint format ["Warning! Enemies will arrive in %1 seconds!", TimeEnemiesWillArrive];
hello, I had a quick question. I'm trying to pull an array of just rifles from the CfgWeapons. I've tried using CfgClasses in combo with InheritsFrom . But it always returns a blank array. Any ideas?
(configFile >> "CfgWeapons" >> weaponClassname >> type)
primaries are 1
if (!isClass (_weap >> "LinkedItems")) then
{
if (count(getarray (_weap >> "magazines")) !=0 ) then
{
if no linked weapons is a base weapon(no attachments) no magazines will stop vehicle weapons from showing
What about looking for a rifle base specifically?
what's weaponClassName pointing to exactly?
thats the config location you need to get the weapons class name in there some how
Jeez man, I don't know. I was hoping to streamline it a bit. I want to be able to find every config entry that is a rifle.
figured that, was just giving you what to filter for when doing it
You should be able to do that with configClasses . I'm just not sure as to why not. But I guess that works.
you can give me a minute
_baseRifles = "((configName (_x)) isKindof ['Rifle', configFile >> 'cfgWeapons']) && // is rifle
(!isClass (_x >> 'LinkedItems')) && // does not have attached items
(getnumber (_x>> 'scope') == 2)" // is accessible
configClasses (configFile >> "cfgWeapons");
_weapNames = [];
{
_name = (getText( _x >> "displayName"));
_weapNames pushBack _name;
}forEach _baseRifles;
hint format ["%1",_weapNames];
I thought isKindOf only applied to vehicles, and such?
anything with a parent cfg i guess
I appreciate the guidance, I'm starting to get on track now. Thanks.
Ah yes, now every damn rifle is there. Sweet! ๐
np
I fucking hate how they removed the delay from AI commanding
huh?
It was so awesome in previous arma games to yell "FIRE!" to your AI gunner, and then see him fire a missile
Now, he fires at the same time you start yelling FIRE, so it sounds like you're dictating what he's doing instead of commanding him
Especially with AT or AA units, you give them a target, and then when you yell FIRE, they fire before you barely start saying it, and the boom from the missiles firing are so loud you can barely even hear you say it
It's just so dissatisfying
I would imagine so.
It'll still delay if you select everyone, though.
does anyone know how to find the gear up/down anims in config?
trying to force gear down for vehicles respawning on a carrier
Yay, bug free now lol
_class = typeOf _veh;
_pos = getPos _veh;
_dir = getDir _veh;
_veh setVariable ["RespawnInformation",[_class,_pos,_dir],true];
_veh addEventHandler ["Killed", {
_veh = _this select 0;
_array = _veh getVariable "RespawnInformation";
_class = _array select 0;
_pos = _array select 1;
_dir = _array select 2;
_newVeh = _class createVehicle _pos;
_newVeh setDir _dir;
hint "New vehicle deployed";
_delay = [_veh] spawn {
_veh = _this select 0;
waitUntil {((getPos _veh) select 2) < 5};
sleep 5;
deleteVehicle _veh;
};
_recall = [_newVeh] call fnc_respawn_veh;
}];``` any insights as to why this isn't working?
seems the variable isn't being set
tested the createVehicle section, and for some reason it's not working with the CUP harrier
killed eventhandler only runs on the machine, where the killed vehicle is local.
it's being called serverside
Why is Draw3D sets _this to "nothing" and since when it has been happening? ๐ค
No parameters to pass in that eventhandler
Same for onEachFrame
Probably since draw3D exists.
You never noticed that draw3d has no parameters?
Don't mix draw3D with drawIcon3D ๐
Literally string "nothing" gets passed as _this
setTriggerActivation takes only one string?
That's some troll level shit from draw3D
Literally string "nothing" gets passed as _this
Oh, wow
So not
_this = nil
but
_this = "nothing"
?
Hey, what should Draw3D pass as arguments?
Nothing.
Alright.
yes, string of "nothing"
Oh wait, its not string, its nothing datatype
typeName _this => "NOTHING"
str _this => "nothing"
I wonder if this is the only place where you can get this data type
You can't compare it with ==
isEqualTo returns false
against itself, same variable even
Arma ยฏ_(ใ)_/ยฏ
isNil "_this"
should report true
Good.
nope, isNil returns false
Another value that was previously config only that can now be set by script:
class UserActions {
class Rope_show {
displayName = "$STR_BWA3_Rope_show";
onlyforplayer = 1;
position = "rope_control";
radius = 2;
showWindow = 0;
condition = "this animationPhase ""hide_rope"" > 0.5 and player == cameraOn";
statement = "this animate [""hide_rope"", 0]; playSound3D [""A3\sounds_f\characters\stances\lift_handgun.wss"", objNull, false, AGLToASL (this modelToWorld (this selectionPosition ""rope_control"")), 0.50118721, 1, 20];";
};
position =
What about:
isNil {_this select 0};
?
CfgVehicles
Inside the vehicles
Its not array, _this is nothing
transferred to the server and become visible to everyone
does not apply to #lighpoint and stuff like that
There's an eh for disconnect right?
Are 3rd persom camera positions config based?
No, it's the "camera" selection in the soldier model
it's somewhere above the head
memory LOD
Erm, yeah. Its local, so no data on the Server. So it doesn't "appear" out of nowhere
Are 3rd persom camera positions config based?
Config array of extCameraPosition
Center might be defined in model though
@plucky beacon
Dang, i wamted to see about getting a fixed 3rd person camera on jets
hi there, any one can help me to understand why the dam AI is not jumping(parachuting) out from vehicle?
waitUntil { _veh distance _position < 400 };
private _count = 1;
{
unassignVehicle _x;
_x action ["Eject", (vehicle _x)];
[_x] allowGetIn false;
hint str _count;
_count = _count + 1;
sleep 1;
} forEach units _grp;
instead of parachuting the choper/plane is landing
does it work without the waituntil?
it worsk good, it show me how many times is executed with the _count
I know arma's AI like to request leaving a vehicle which is probably why it's landing
They don't like to be forced out of anything without being on the ground
if i do the same with crew they jump, why not happening with cargo?
Any answer I have to that won't be helpful
;p
is making me crazy
umm, maybe they dont like jump without parachute, will try :p
YES! they jump out with parachute xD
lol, did you try to kill them?
jaja, i guess they get parachute :p
I still think it's weird they wouldn't follow commands to eject
they do, they ask pilot for land xD
technically i guess
(To the CBA folks) I'm trying to add an addAction in XEH_postInit.sqf, it's not working. What am I doing wrong? ```SQF
#include "script_component.hpp"
player addAction ["<t color='#228B25'>Debug Menu</t>", QFUNC(openDebugMenu)];
Is postinit local? I never knew
every machine
@tough abyss
Add
diag_log [player, QFUNC(openDebugMenu)];
And check RPT what it writes.
Is this what you were asking for, @little eagle? ```SQF
19:13:48 [0,40.931,0,"XEH: PreStart started."]
19:13:49 [0,41.361,0,"XEH: PreStart finished."]
19:13:52 SimulWeather - Cloud Renderer - noise texture file is not specified!
19:13:56 SimulWeather - Cloud Renderer - noise texture file is not specified!
19:14:03 Loading movesType CfgGesturesMale
19:14:03 Creating action map cache
19:14:03 MovesType CfgGesturesMale load time 540 ms
19:14:03 Loading movesType CfgMovesMaleSdr
19:14:04 Creating action map cache
19:14:19 MovesType CfgMovesMaleSdr load time 15695 ms
19:14:49 Starting mission:
19:14:49 Mission file:
19:14:49 Mission world: VR
19:14:49 Mission directory:
19:14:53 Attempt to override final function - bis_functions_list
19:14:53 Attempt to override final function - bis_functions_listpreinit
19:14:53 Attempt to override final function - bis_functions_listpostinit
19:14:53 Attempt to override final function - bis_functions_listrecompile
19:14:54 Attempt to override final function - bis_fnc_missiontaskslocal
19:14:54 Attempt to override final function - bis_fnc_missionconversationslocal
19:14:54 Attempt to override final function - bis_fnc_missionflow
19:14:54 [2438,106.509,0,"XEH: PreInit started. v3.2.1.170227"]
19:14:54 [2438,107.109,0,"XEH: PreInit finished."]
19:14:56 [2440,108.63,0,"XEH: PostInit started. MISSIONINIT: missionName=, missionVersion=12, worldName=VR, isMultiplayer=false, isServer=true, isDedicated=false, CBA_isHeadlessClient=false, hasInterface=true, didJIP=false"]
19:14:56 [2440,108.677,0,"CBA_VERSIONING: cba=3.2.1.170227, "]
19:14:56 [2440,108.684,0,"XEH: PostInit finished."]
Doesn't look like your script was executed at all. Did you add it to the config?
Config: ```hpp
#include "script_component.hpp"
class CfgPatches {
class ADDON {
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
author = "Neviothr";
requiredAddons[] = {"3den"};
};
};
#include "CfgNotifications.hpp"
#include "BaseDefines.hpp"
#include "DebugMenu.hpp"
class Extended_PostInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_postInit));
};
};
lol
btw., if you already set up all the #includes, you should probably switch to TRACE_N / WARNING / ERROR / LOG etc. for debugging instead of diag_log
I'm just converting an existing addon of mine into, I guess, "CBA standards". So everything works, it's just a matter of moving stuff correctly. ๐
It's a pain to set up, but a bliss to work with.
isn't there a script that you can press a thing to ragdol
it does something with setvelocity
In mine I gave them dead animation and disable input or something
Display with mouse which also blacks out the screen since I removed the black overlay from vanilla while unconscious (ugly)
Just need to remember to block the ESC with a keyhandler... I bring up a copy of the pause menu.
Does anyone remember when Apex came out and Ace unconcious made characters ragdoll instaed of awkwardly flops into a static pose on the ground?
but way less interesting, immersive, or fun
best performance is vanilla
for the short time the bug was present I remember one guy getting knocked unconcious and falling off a balcony breaking his neck
it was fuckign incredible
inefficient code?
I know, basically I'm saying I want it back
#ragdollsMatter
It's also incredibly immersive to breach a building and get knocked on your back by a bullet
https://upload.wikimedia.org/wikipedia/commons/6/64/Ragdoll_from_Gatil_Ragbelas.jpg ragdoll is a cat apparently
I wish it did that in vanilla
high enough caliber and Ace will do that too, I think if you adjust the damage coefficients
@tough abyss It's not a matter of efficiency. There was no other way before setUnconscious.
And it still is like this, because the ACE Medical rewrite isn't finished.
oh it's being rewritten?
You forget that we make an addon and no mission. The mission can have respawn timers of any value.
So I'm guessing the rewrite will include this new feature or as an option?
It's being rewritten for over a year now.
No, it will always use the ragdoll effect. No option.
it's that unpredictable?
?
oh read that wrong
It works pretty nice.
I don't even know what's missing at this point.
I did a whole lot of the low level internals, but that has been months.
I was pretty ... busy during last fall.
But not much happening since last summer anyway.
It's open source. It's just that there were that many scripters in milsim and now Arma 3 is old.
And Im still working on that CBA settings system.
Do you need some larger scale testing of the new ace medical?
It's weird. I wanted that to be simple and easy to use, but many people want all kinds of features and now the ui looks bloated to me.
The hardest part is to stop making features xD
Don't ask me, I'm not in the loop.
The hardest part is working yourself through the spaghetti code.
I'm trying to do better at commenting my work myself
so other people could potentially use it
I wish I owned fraps so I could make jpg's.
there we go
Is it just me or does this look bloated?
the checkbox ruins the balance
put that at the bottom
it's actually a good question, what is the test checkbox for?
It's not a matter of order. I can add these settings dynamically
I think if you put enough spacing in between settings you could make it pretty long
#ifdef DEBUG_MODE_FULL
["Test_Setting_1", "CHECKBOX", ["-test checkbox-", "-tooltip-"], "My Category", true] call cba_settings_fnc_init;
["Test_Setting_2", "LIST", ["-test list-", "-tooltip-"], "My Category", [[1,0], ["enabled","disabled"], 1]] call cba_settings_fnc_init;
["Test_Setting_3", "SLIDER", ["-test slider-", "-tooltip-"], "My Category", [0, 10, 5, 0]] call cba_settings_fnc_init;
["Test_Setting_4", "COLOR", ["-test color-", "-tooltip-"], "My Category", [1,1,0], false, {diag_log text format ["Color Setting Changed: %1", _this];}] call cba_settings_fnc_init;
#endif
I wonder if I could get rid of the checkmark / cross by colorising the "medium" or "high" in green or red.
Can you change the color of listboxes?
The color of the text I mean.
let's try I guess.
if you can change it in buttons you can probably change it in listboxes
hmm, I need to dynamically change this. What a pain in the ass.
Question:
I can modify dialogs defined in dscription.ext using ctrlCreate, but if a dialog is defined in config class - it does not work (even if dialog from description.ext is 100% equal to the one from config)
Is there a property which should be defined in config for dialog class to create new controls for it?
yes, I do as well, but I want dynamic dialog and create controls with the script
dynamic diolags how so? you mean using ctrlsettext and stuff?
ready figured it out, I need to wait till display inits, I was getting displayNull
ahh putting a good old waituntil
well what dafuqdidudo
waitUntil may behave weirdly in unscheduled environment
It errors out
Whenever I put a waituntil in a function it...
that
I guess that's the terminology
you can't suspend commands in a unscheduled?
That's what I thought
maybe I didn't use parenthesis
isNil {
waitUntil {true};
systemChat str 1;
};
this works apparently
isNil is to ensure unscheduled environment
That is not unscheduled environment necessarily
0 spawn {
call {
systemChat str canSuspend;
};
};
true
0 spawn {
isNil {
systemChat str canSuspend;
};
};
false
I guess waitUntil can be used in unscheduled without error as long as it reports true the first try.
Which means it does nothing in that case.
The script that runs from addAction is scheduled.
Maybe you're thinking of that
lol
isNil {
waitUntil {random 2 < 1};
systemChat str 1;
};
50% error
QS, the condition runs unscheduled and the action runs scheduled
just to fuck with ya
literally
KK uses isNil to enforce unscheduled environment in his new Utilities stuff.
So I guess it's official API now.
isNil // visual bug workaround
{
_checkbox = [_functionDisplay, "RscCheckBox", ["","",0], [0.27,_nextItemY,_chkX,0.03], [1,1,1,1], [1,1,1,1], str _date, true, _ctrlGroup] call _fnc_addControl;
_checkbox setVariable ["_date", _date];
_checkbox ctrlSetEventHandler ["CheckedChanged", "
Nice info @little eagle
instead of waitUntil {!(isNull _display)} I ended with storing display id in uiNamespace from onLoad event, and then call the required controls creation from the same onLoad EH attached to dialog or display
That is definitely the way to go since that works better with savegames and all that.
Oh that reminds me I figured out my problem with the mission failing even after resetting the mission.
When the timer was over it remotely executed to -2 (allplayers) to run the mission failure sequence. I looked at my other mission failure scripts and saw they all remotely executed to all machines (0) so basically the missions was repeatedly ending because the server itself didn't end the mission
silly me
Another question, setting a "KeyDown" EH to a control, everything working fine besides one thing: I cannot override the KeyDown event, regardless wether EH code returns true or false - keyDown is not overridden as expetced
is not it supported for controls?
only display can have keyDown
seems so
kinda like how the return value of the config version of handleDamage is ignored
weird, I am trying to limit the number of symbols user can enter to the editbox
any ideas?
just use ctrlSetText on the edit box and remove the last char if it was illegal
not very beautiful of course, but seems no other options
It's very beautiful
overriding keyDown event would be more neat but ok, gentlemen do not argue about personal preferences ;)
_
|==My joke ==>
^everyone's head
// keyDown
params ["_control"];
private _string = ctrlText _control;
if ((_string select [count _string - 1]) in ILLEGAL_CHARS) then {
_control ctrlSetText (_string select [0, count _string - 2]);
};
beautiful and simple
if ((count ctrlText _editbox) > 100) then
{
...
_editbox ctrlSetText (_text select [0,100]);
}
yes, looks ok, thanks @little eagle
You can probably abuse ctrl + v though. Not sure.
let me try
@little eagle o protect from ctrl + V just add keyUp event with same cleanup routine
works like a charm
just tested
// keyDown
params ["_control"];
_control ctrlSetText (ctrlText _control splitString "@/ยง%" joinString "");
I do not need a filter
@/ยง% being the illegal chars in one string
It is a feedback ingame form, user can put anything but limited to number of symbols
Oh, like only 100 characters
ctrlSetText on the edit box is the solution
I guess for mission it is much better, that user suggests something ingame rather than go to forum, register login, find the right thread etc
@little eagle I ended up with it, thanks again
there is on one problem with it
count "Test" (english letters) returns 4
count "ะขะตัั" - russian letters, returns 8
so we should count not string directly, but do count toArray _string, then it works ok
kyrillic
yeah
It's because of UTF8 or something
toArray makes the trick
For the first time since I started I can say that there are no current bugs in my projects. At least until I do testing with a larger group.
hey everyone, I can't seem get this to work: https://community.bistudio.com/wiki/BIS_fnc_showRespawnMenuDisableItem
keeps throwing me a error "undefined variable _listing"
or it just wont work at all, it's random.
you in game right now?
if you are go to function viewer and find that function, find out what _listing is trying to get
Yes, okay. Will do.
if !(uiNamespace getVariable ["BIS_RscRespawnControlsSpectate_shown", false]) then { switch true do { case (_list == BIS_RscRespawnControlsMap_ctrlLocList): {_array = BIS_RscRespawnControls_positionDisabled}; case (_list == BIS_RscRespawnControlsMap_ctrlRoleList): {_array = BIS_RscRespawnControls_roleDisabled}; case (_list == BIS_RscRespawnControlsMap_ctrlComboLoadout): {_array = BIS_RscRespawnControls_loadoutDisabled}; };
looks like this is the culperate
the uiControl is defined, (uiNamespace getVariable "BIS_RscRespawnControlsMap_CtrlRoleList" in the params
yessssssss
not sure if this is intentional or not but using flagtexture
set it setFlagTexture '\ART\ART_Flags\Data\Flag_red_CO.paa';
but when retrieving with flagTexture the name comes back with no cap (art\art_flags\data\flag_red_co.paa)
the flags are in game magazines as well , sharing the same texture so when removing a flag from a pole I want to get the flags texture and use configclasses to find the right flag item and add to inventory
any ideas?
commands find and in are case sensitive
https://community.bistudio.com/wiki/toLower @plush cargo
Aaye case sensitive
ty
How can I turn this
_flag addAction ["<img image = '\ART\ART_Flags\Data\Flag_red_CO.paa'/>",
into this
_flag addAction ["<img image = _texture/>",
use either format or string addition.
_flag addAction [format ["<img image = '%1'/>", _texture],
thanks ๐
thought i tried that dont think i had the quotes here '%1' was messing with it forever
Yep, Its easy to forget about these when formatting strings within strings using format
I just do:
_flag addAction [format ["<img image = %1/>", str _texture],
Usually
afair setFlagTexture works only on server, not sure it will work via addAction
According to the wiki, setFlagTexture only works on the machine where the flag object is local, but has global effects.
https://community.bistudio.com/wiki/setFlagTexture
Since the code block of addAction is executed on the client that used the action and the flag as neutral map object is most likely local to the server, I'd say you need to use remoteExec if you want to get it to work in MP.
Oof getCursorObjectParams looks damn powerful
Worked out great so far will mess around with remoteexec in mp later today .
https://youtu.be/sn2R8A69NB0
is there a way to trigger HandleDamage or handleHit by setDamage/setHit (or any other damage changing command)?
No.
anyone ever used BIS_fnc_lerp? i want to lerp 1 to -1 over a course of 10 seconds. i would i do that?
the heck is lerp
change one value to another over time. got it working. was jsut a brain fart on my side
function not in wiki, rip
/*
Author: Nelson Duarte
Description:
Linear floating point interpolation
Parameters:
_this: ARRAY
0: Value A
1: Value B
2: Interpolation speed
3: Delta time
Returns:
NUMBER
*/
params [["_a", 0.0, [0.0]], ["_b", 0.0, [0.0]], ["_speed", 1.0, [0.0]], ["_deltaTime", 0.0, [0.0]]];
private "_result";
_result = 0.0;
if (_a != _b) then
{
_result = (_a * (1.0 - _deltaTime * _speed)) + (_b * _deltaTime * _speed);
};
_result;
bis_fnc_lerp
linearConversion [0, 10, _time, -1, 1]
I think you have to switch around -1 and 1.
can you explain eahc parameter. i have a nice function that uses it but i don't fully understand how to set speed and stuff
mainly last two params
oh
when _time is 0, result will be -1, when time is 10, result will be 1
in my example
might aswell use that
just gonna leave that here https://www.youtube.com/watch?v=pd-2WQzoG48 (WIP)
lovely @queen cargo
@queen cargo amazing work
I saw a video of this a couple days ago doing something on Tanoa
Is there scripts out there for TFAR radio jammers?
I'm sure there is a script for TFAR radio jammers somewhere ๐ But I don't know where. Could ask in TFAR discord.
I wanna be all dramatic in a mission where everything goes kkkkk kshhhhhhh
watching your goofy video of driving cars off ramps
you can set the receiving distance down.. That would make most stuff go kkkkk ksshhhhhh Unless you are that far away that you don't receive anything anymore
same effect is fine
Damn, @queen cargo. That's nice.
Hay daheck did you use in this video here? https://youtu.be/b1oi_jLnTMM to reset your curator on respawn bug xD
You know what a useful tool would be, some way of seeing players client fps to know who's suffering
because most people are usually fine but one guy gets the short straw and can't handle particles or something
Ya could run a script on each client broadcasting diag_fps to the server periodically. Then have the server send that data to the server admin/zeus that requires it.
that's what I was thinking
[] spawn {
while {true} do
{
uiSleep 5;
_fps = diag_fps;
_fpsString = str _fps;
[_fpsString] *remote exec something something to zeus that displays 3d text over the players head*
}
}
just setVariable public the fps on the player object
Draw3D eventhandler on the zeus machine that iterates over allPlayers and reads the fps with getVariable
uiSleep is pointless in MP btw.
You cannot suspend the mission anyway
or slow down / speed up
for obvious reasons
rip slow motion missions
If someone is having framerate stuttering though would their simulation be running slower?
Yeah, but uiSleep would still be the same
uiSleep is exactly the same as sleep, but not affected by pausing the game
Since you cannot pause the game in MP (pressing esc let's it still run), it makes no difference.
The only thing you do by using uiSleep is confuse others and yourself and maybe imply things that aren't true.
makes no difference, except for the first 5 seconds of the mission I guess.
I just think that there is no reason to "remoteExec" anything.
It's 2 scripts supplying each other with information via setVar and getVar
One script to constantly update the fps and synch it with everyone else
just working with what I know, never used setvariable
And one to draw the values each render frame with whatever magic you choose.
I know I at least to do it in missionnamespace
can you set local variables public?
[] spawn {
while {true} do {
sleep 5;
player setVariable ["my_fps", floor diag_fps, true];
};
};
pfft
Then on the zeus machine;
{
_x getVariable "my_fps";
} forEach allPlayers;
yerp
What's the differance between remoteExec and remoteExecCall?
Hmm, alright. Thank you.
It's more that remoteExec spawns in the scheduled environment, and remoteExecCall in the unscheduled.
So for executing a function like spawn where sleep etc is needed youd use remoteExec, and remoteExecCall for the other ones
remoteExecCall is pointless for commands and only really useful for functions.
I'm not at a computer that can run Arma right now so just sorta writing this on a whim
{
["uniqueID", "Draw3D",
{
if (my_fps<20) then {
drawIcon3D
[
"\a3\ui_f\data\map\mapcontrol\taskiconfailed_ca.paa",
[1,1,1,0.5],
getPos _x,
1,
1,
0,
parseText format["<t size='1.25' font='PuristaLight' color='#ff0000'>FPS: %1</t>", my_fps]
];
}
else
{
drawIcon3D
[
"\a3\ui_f\data\map\mapcontrol\taskiconsucceeded_ca.paa",
[1,1,1,0.5],
getPos _x,
1,
1,
0,
parseText format["<t size='1.25' font='PuristaLight' color='#0004ff'>FPS: %1</t>", my_fps]
];
};
}] call BIS_fnc_addStackedEventHandler;
}forEach allPlayers;
That's my guess at least
draw3d and not eachframe to remove the stuttering
also, use one eachframe handler and that iterates over allPlayers
uhmm
okay
wouldn't that just be over the whole thing?
onEachFrame {
...all the stuff in here
};
?
It says you should use: https://community.bistudio.com/wiki/Arma_3:_Event_Handlers/addMissionEventHandler#EachFrame
it just says eachframe is a stackable version of oneachFrame
Yea and that you ruin everything by using onEachFrame command
oh
But you want this one: https://community.bistudio.com/wiki/Arma_3:_Event_Handlers/addMissionEventHandler#Draw3D
Not EachFrame
I think I follow now
{
addMissionEventHandler ["Draw3D", {
if (my_fps<20) then {
drawIcon3D
[
"\a3\ui_f\data\map\mapcontrol\taskiconfailed_ca.paa",
[1,1,1,0.5],
getPos player,
1,
1,
0,
parseText format["<t font='PuristaLight' color='#ff0000'>FPS: %1</t>", my_fps]
];
}
else
{
drawIcon3D
[
"\a3\ui_f\data\map\mapcontrol\taskiconsucceeded_ca.paa",
[1,1,1,0.5],
getPos player,
1,
1,
0,
parseText format["<t font='PuristaLight' color='#0004ff'>FPS: %1</t>", my_fps]
];
};
}];
} forEach allPlayers;
I know it's missing the allPlayers, I'm reading back what you said
there
nah
the amount of allPlayers changes all the time in a MP session.
So just have one draw3d handler that iterates over the allPlayers
btw. wasn't draw3D the better solution, instead of onEachFrame?
Sure, that's what we're using now.
ye
yee
this would print (count allPlayers) times for only the local player (getPos player) . and my_fps is undefined (diag_fps)
WIP
kk, missed then.
I guess I'm just unaware of how drawIcon3d works
I got mixed up between the each frame and draw3d so I was still thinking "wouldn't want to check allplayers on eahc frame, that'd be awful"
btw. that might be easier to handle: (no stackedEH needed)
MyTag_MyName = addMissionEventHandler
["Draw3D",
{
hintsilent format["TickTime:\n%1",diag_TickTime];
}
];```
To remove:
```sqf
removeMissionEventHandler ["Draw3D", MyTag_MyName];```
Don't mix draw3D and DrawIcon3D! They are not the same ๐
I thought that's what was going on dscha?
addMissionEventHandler ["Draw3D", {
{
_playerFPS = _x getVariable ["playerFPS",50];
if (_playerFPS <20) then {
drawIcon3D
[
"\a3\ui_f\data\map\mapcontrol\taskiconfailed_ca.paa",
[1,1,1,0.5],
getPos _x,
1,
1,
0,
parseText format["<t font='PuristaLight' color='#ff0000'>FPS: %1</t>", _playerFPS]
];
}
else
{
drawIcon3D
[
"\a3\ui_f\data\map\mapcontrol\taskiconsucceeded_ca.paa",
[1,1,1,0.5],
getPos _x,
1,
1,
0,
parseText format["<t font='PuristaLight' color='#0004ff'>FPS: %1</t>", _playerFPS]
];
};
} forEach allPlayers;
}];
that plus a script that runs on every player that sets (player setVariable ["playerFPS",diag_fps]) every few seconds
what's that 50 do?
StandardValue
oh
If no Var set -> use that (50 in this case)
You can dooo what you want
That would always show that the player has bad FPS. which I'd call unusual. but whatever
I can do anything Dscha?
I haven't said that.
so this would be on players
[] spawn {
while {true} do {
sleep 5;
player setVariable ["playerFPS", floor diag_fps, true];
};
};
proably initlocal
Use tags for global variables like this
initPlayerLocal.sqf yeah
I can see BI eventually adding a command named playerFPS and then your stuff errors out, because you didn't do good work.
global variable -> tag
like: DNI_PlayerFPS
Watch me just start replacing all my variables with DNI_...
which I probably should if they're not local
Allcurators says it returns a list of curators, but does it return the curator module owners or the modules.
So
if (player in (bis_fnc_listcuratorplayers) then {stuff?}
uhh yeah
But that only works after curators are initialized
waitUntil {
private _hasCurators = (count allcurators) > 0;
private _hasInitializedCurators = (count (call BIS_fnc_listCuratorPlayers)) > 0;
private _curatorsInitialized = !_hasCurators || _hasInitializedCurators;
((time > 2) || _curatorsInitialized)
}
Rip
Never heard of doing so
@tough abyss isnt the sun just skybox?
because if it was, just take the vector and lengthen it by smthng like 20000000000
16:25:48 Error Type Text, expected String
16:25:48 Error in expression <S: %1</t>", str _playerFPS]
];
}
else
{
drawIcon3D
[
"",
[1,1,1,0.5],
getPos _x,>
16:25:48 Error position: <drawIcon3D
[
"",
[1,1,1,0.5],
getPos _x,>
wow that's a lot of shit broken
gives you a pretty decent position of it
as said: lengthen the vector
0 is your current player
ohh ... ye.
did not slept much ๐ but think it was possible either via command or via config
what the heck is Type Text, expected string. I thought string was text.
ye
parseText format["<t font='PuristaLight' color='#0004ff'>FPS: %1</t>", str _playerFPS]
parsetext returns Text. Text is formatted text like you use in diary entries and stuff
Text != string
so do i need to str?
@tough abyss If youre up to a bit of math and dont care about being super accurate: https://stackoverflow.com/questions/8708048/position-of-the-sun-given-time-of-day-latitude-and-longitude
str did it, thanks dedmen
I suspect it would be accurate enough for a shadow guess
is there a way to make 3dtext dissapear when you're far enough away?
or should I say, how difficult is that
the icons? Add a player distance _x check
Don't think so
if (!isNull (findDisplay 312)) then (curatorCamera distance _x) else (player distance _x)
cuz pseudosqf ๐
lol okay just checking
Just because I'm bored. This gotta confuse people just starting out at scripting:
_if = [if call { alive player }];
_codes = { "alive" } else { "dead" };
hint ("You're " + (_if select 0 then (call ({} else {_codes} select 1))) + "!");```
But a very complex way of doing it ๐
damn right about that
if(alive player) then {
hint "you're alive";
} else {
hint "you're dead";
};
another way of showing how you can abuse SQF
In a very aids way xD
hint (["you're dead", "you're alive"] select alive player);
I knew commy would come and make better code xD
It's probably harder to comprehend for a beginner.
Better = make me ashamed to call myself a "Developer", and making me re-learn the code from scratch xD
Subjective objective
You shouldn't be writing convoluted code
Don't think you need to relearn to be able to write it
๐
Developers developers developers developers
There are objective reasons for either, but which of these reasons convince you for either method in the end is subjective.
This FPS debugger is great, now I can tell what players are having a difficult time playing
can I use exitwith in an event handler?
@plucky beacon tan
waaaat
it is a command
๐ thanks
dangit I need to inverse the log
time to brush off the calculus
get my ti-84
@plucky beacon what are you trying to do?
my arma mathed too hard
hand on I'll show ya
max X is 60 max Y is 1
the closer the X is to 1 the closer Y is to 1
but it's a curve because I don't want it to really ramp up until it's below 20
trying to simplify the math though
_calc = (((_playerFPS^(-0.6))*5)-0.4);
so far this formula is working pretty well
turns the letters red when it starts fropping from 20-12, then it stays fully red
does the same for opacity too
ah so you're just trying to find a polynomial that makes a nice colour relative curve?
does SQF support domain restriction?
domain restriction?
I suppose it would using if statements
y = 2x+2, while x:1 < x < 5
makes a line from coordinate (1,4) to (5,12)
might be what you're looking for
ah sweet
Brace auto completion is the devil's work ๐ก
true
@plucky beacon I had a similar headache to the one you had the other day
was using trig to make an attack script that would flank
LOL
ya that's a doozy
luckily all mine is doing is outputting the number itself not having to translate it in the game space
@knotty rune not if you're fast at typing?
sucks that 2D coodinate spaces suck for that sort of thing
@plucky beacon I type up to 850 characters per minute. I hate brace auto completion
convertng from polar > 2D is painful
I guess you're right, if you don't type fast
anything that isn't predictable is a problem
Notepad ++ master race here
Visual Studio code isn't an issue fo rme
the arrow keys and hit enter for autocomplete is perfect for typing fast
poor drifter is going to have a mention and be confused
rip
Hmm
does using 'deleteWaypoint' stop the AI or do you have to issue a stop command to them too?
hmm
@nocturne iron They'll still move to it
okay
Thx
any reason why ```sqf
/*
'fnc_wp_pause' by shifty_ginosaji
Caches waypoints for input group in a variable assigned ot the group
0 = Group(TYPE = GROUP)
USAGE:
_handle = [(group this)] call fnc_wp_pause;
*/
_grp = _this select 0;
sg_wp_info = [];
{
_wp = _x;
_index = (_x select 1);
_pos = waypointPosition _wp;
_behaviour = waypointBehaviour _wp;
_combatMode = waypointCombatMode _wp;
_completionRadius = waypointCompletionRadius _wp;
_description = waypointDescription _wp;
_formation = waypointFormation _wp;
_speed = waypointSpeed _wp;
_statements = waypointStatements _wp;
_timeout = waypointTimeout _wp;
_type = waypointType _wp;
sg_wp_info = sg_wp_info + [[_index,_pos,_behaviour,_combatMode,_completionRadius,_description,_formation,_speed,_statements,_timeout,_type]];
hint str _x;
deleteWaypoint _x;
} forEach waypoints _grp;
_grp setVariable ["sg_wp_info",sg_wp_info,true];
sg_wp_info = [];``` is cracking it every time I try to call it?
cracking?
could you color code that?
how do I do that? sorry
edit it. put sqf as the first line
yay colors
looks nice
@nocturne iron Any additional info?
calling it in the debug menu as stipulated by the directions in the header
I mean, is there any more info in the error?
Nope
does it not mention script?
The error is apparently here though _handle #= [(group this)] call fnc_wp_pause;
Generic error in expression
I see
you're not returning anything
last statement is an assignment, which does not return a value
last statement in the function, that is
Yeah
sg_wp_info = [];
Thanks
I wish Eden had live edit like the old 3D editor
@plucky beacon The old 3D editor allowed you to preview, and then open the editor interface to spawn things, etc. then you could exit to reset and go back to the original mission
was this lik early eden editor?
the sketch one
Made a video tutorial for accessing it in ARMA 3 a few years ago https://youtu.be/7OEfR7N8L0g?t=14
in ARMA 2 it could be accessed by Alt+E from the menu, but that was removed in ARMA 3
I personally didn't use it much
Too much of a hassle except when you're making fine-detail templates
well, what do you know.. it still works. and it's still there. and it's been improved since my tutorial ๐
actually, it's not been improved. quite the contrary. it doesn't work at all now, since spawning a center is broken
I guess they started working on it again, and then scrapped it altogether to create Eden
It had some nice things. Like instant preview, without having to wait for a loading screen
and god, the ability to switch between rotating and moving entities without having to let go of the mouse button first -.-'
I miss that so much from the 2D editor
๐ฎ
Same method works to load the old 2D editor ๐ It's still there too! http://i.imgur.com/UUoowye.png
well would ya look at that
Its interface was much better
and a lot of the functionality too
Much less clunky than Eden
Despite it having its faults
The exit to editor button is broken now, though, so after each preview you have to restart the game
๐ฆ
oh, nevermind. killing yourself allows you to return
Like VR
Aw
I wish they could emulate the 2D editor in the eden 2D
would just complete everything
@nocturne iron Well, you can switch to 2D by pressing M
but the functionality is the same as in 3D mode
The real change was in how sqm files are made
It was a rewrite of how it's compiled
How do I execute code only on a certain client in MP?
Global & server are pretty self explanatory, but not local.
@compact galleon that's what I'm talking about, if the functionality was like 2D
target would be something like a vehicle/player's name? @tough abyss.
Ok, thank you.
@tough abyss You mean from the console?
No, from a script.
Was there a more precise time than diag_tickTime? (tickTime = 1.23 || 1.23456 would be nice to have)
I've been asking for diag_deltaTime for quite a while
I just noticed, that diag_TickTime goes back to 0.123456, so should be enough, tbh.
(when compared to eachother)
than*, Dscha. than*
๐
Is there a way to test locality stuff in MP with only 1 person?
Start Arma 2x
+disable all SecurityStuff on your local Server (iirc also BE)
I gave up on this and bought me a Latop that can start Arma ๐
Would steam even let you do that?
Start the Exe directly
Hm, alright. Thanks.
You can join your own local hosted MP game via the LAN tab if you start two instances of Arma 3.
Or even launch a dedicated server instance and have 2+ clients connect
Does anyone know if allDead returns curator logic entities (for dedicated zeus slots)?
Probably not
I dont think curator logics are dead entities. To retrieve the curators you'll probably need https://community.bistudio.com/wiki/allCurators
allCurators returns the curator modules though.
I'm trying to pinpoint the cause of a bug I've experienced in the past regarding BIS_fnc_createTask (so I can make a proper bug report) where dedicated curator units wouldn't get the task if the owner was set to "true"
And right now as far as I can tell, when the owner is set to true, it grabs a list as allUnits + allDead
Which seems to exclude the curator logic entities
Talking about "VirtualCurator_F", not "ModuleCurator_F"
with ModuleCurator_F being the curator module that allows any unit to enter the zeus interface (assuming that unit is assigned to a module)
VirtualCurator_F is the logic unit placed down when you intend to have a unit only access the zeus interface
which is then usually linked to a ModuleCurator_F
entities "VirtualCurator_F"
?
Yeah so that should work. Making the bug report now.
As it stands right now BIS_fnc_taskCreate doesn't include "VirtualCurator_F" in the list of playable units when using "true" as the owner
bug report? oO
So when creating a task with "true" as the owner, units that are dedicated zeus slots will be skipped
Because it doesn't iterate through logic entities
Right now it just does this to check for player units
(allUnits + allDead) select {isPlayer _x}
So you basically can't assign tasks to dedicated zeus players via BIS_fnc_taskCreate.
Unless you explicitly tell it to use that object
So
true
doesn't work
But this does:
[true, zeus_unit]
Assuming the playable logic is named zeus_unit
Which runs into it's own issues if there's no zeus
The true option of BIS_fnc_taskCreate skips dedicated zeus players.
Wich is okay, tbh.
No one ever thought about it, so there is no intention to be found.
Not always is the Zeus stuff needed in allDead/AllDead.
RIght
"probably" intended (i would say yeah)
Ideally the fix would be to update the function to iterate through "VirtualCurator_F" (along with it's side-specific subclasses) when using "true" as the parameter
I've made the bug report anyways with what i've figured out about it so far.
64 bit dropped !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ๐
deep breath AHHHHHH
https://community.bistudio.com/wiki/Arma_3_Dynamic_Simulation Anyone have any decent examples?
im going to assume it's server side command
alright thank you
sooo does dynamic simulation make unit caching systems obsolete?
https://community.bistudio.com/wiki/enableDynamicSimulation
Description:
Enables or disables Arma_3_Dynamic_Simulation for given non AI object
And below Parameters:
object: Object or Group
strange
Characters Infantry units (default: 500m). Set to a reasonable distance, player should not see disabled infantry units.
Sounds like best for units in builldings or behind terrain.
yeah
Infantry in the open is a problem. If it is disabled, player will see them from a distance frozen, not playing any ambient animations. Try to avoid it, especially if player has optics
^from this page https://community.bistudio.com/wiki/Arma_3_Dynamic_Simulation
you can set what wakes things up from disables simulation as well
very cool
setDynamicSimulationDistanceCoef
so the main thing is having evaluating what unit to cache all done engine side with that grid resolution stuff, right? the effect would still be the same as enableSimulation and hideObject?
Sets the path to follow for AI driver
myVehicle setDriveOnPath [[1000,10,1000],[1100,10,1000]]
Probably not hideObject, although ideally this would be coupled with some eventhandlers to customize it... Probably not the case.
object and terrain view distance at 2k , ultra settings and 60fps and no stuttering on zoom ๐
@plush cargo NICE!!
~40 on a roof in georgetown with same settings but no stuttering on zoom, i am a happy boy
anyone who working BIS_fnc_traceBullets? im not working now
nah it was kinda mistake
setDriveOnPath: https://gfycat.com/EducatedFatalGrouper ๐
kewl
what happens when you do it to air vehicles
if you set the driveonpath to a vehicle will it chase it?
so many questions
Air vehicles ๐ฎ Attaching colored smoke particle emitters to the wings and letting AI make stunts ๐ฎ
You found the fatal flaw in the system, Nitro.
16 bit was a better time, tho
any asm alternative?
Free alternatives? mARMA is one
Way to report all controls of a controls group?
private _ctrlSettingGroupControls = configProperties [configFile >> configName _ctrlSettingGroup >> "controls"] apply {
_ctrlSettingGroup controlsGroupCtrl getNumber (_x >> "idc")
};
this is ugly
BluforPlayers = allUnits select {(side group _x == west) && (typeOf _x != "B_UAV_01_F")}; this should return all units that are west and not a darter right?
yep
I guess this works too:
allControls ctrlParent _ctrlSettingGroup select {ctrlParentControlsGroup _x == _ctrlSettingGroup};
what would you do without us commy
I want all sub controls of a controls group
To disable them with ctrlEnable false
Because apparently disabling the controls group has no effect on the sub controls.
... which was not part of my plan.
Can I enable players to enter spectator mode without having to log out? (similarly to how you enter zeus mode)
sure
use the egspectator
["Initialize",
[player, //unit being initialized
[West], //sides that can be spectated
false, //can AI be viewed
false, //can free camera be used
false, //can 3rd person be used
false, //show focus info widgets
false, //show camera button widgets or not
true, //Show controls helper widget
true, //whether to show header widget
true //Whether to show entities/locations lists
]] call BIS_fnc_EGSpectator;
@little eagle I number put all my ctrls in groups of idcs like one group is idc 220-230 and next is 240-250 and then use this
_fnc_TabHidenShow =
{
params ["_hideCtrls","_showCtrls"];
_display = findDisplay 850000;
_cntHide = count _hideCtrls;
if (_cntHide == 0) then // want to close all apps
{
_allCtrls = allControls _display;
_allCtrls deleteRange [0,9]; // don't delete background ctrls
{
if (ctrlShown _x) then
{
_x ctrlShow false;
};
}forEach _allCtrls;
} else
{
for "_i" from (_hideCtrls select 0) to (_hideCtrls select 1) do
{
ctrlShow [_i, false];
};
};
_cntShow = count _showCtrls;
if (_cntShow > 0) then
{
for "_i" from (_showCtrls select 0) to (_showCtrls select 1) do
{
ctrlShow [_i, true];
};
};
};
you can tie this to an addaction or something and have them exit when pressing escape key using
["Terminate"] call BIS_fnc_EGSpectator;
@loud python did ya get that before the text block Soolie put up xD
sry ๐
still think discord should have code in a scrollable box
agreed
@plucky beacon Thanks ๐
@plush cargo You're not using controlGroup controls.
My controlGroups consist of a whole bunch of controls, but I ctrlCreate multiple of these controlGroups.
All sub controls obviously share idc's with their counterparts from other controlGroups of the same type.
(findDisplay 46) displayAddEventHandler ["keyDown",
{
_key = _this select 1;
if(_key = 0x01) then
{
["Terminate"] call BIS_fnc_EGSpectator;
};
}];
is this how you do keydowns?
also how is that an integer
_DikCode= _this select 1; // integer
so that should work though
You probably have to add the keyhandler to the spectator display.
oooh
Not the mission dsplay
so a waitUntil{!isnull (findDisplay whateveritisforspectator)}
guess so
Just gotta find out what display the egspectator uses
class Extended_DisplayLoad_EventHandlers {
class RscSpectator {
Nitro = "_this call compile preprocessFileLineNumbers 'initSpectatorDisplay.sqf'";
};
};
//initSpectatorDisplay.sqf
params ["_display"];
diag_log [_display];
_display displayAddEventHandler [...
Needs CBA, but this way you don't need to ask every frame if the spectator thing is opened.
I hope RscSpectator is the correct one. It's idd 3000
I wish I had arma installed on this comp to see the functino viewer
so where does the extended handlers and stuff go
description.ext:
class Extended_DisplayLoad_EventHandlers {
class RscDisplayEGSpectator {
Nitro = "_this call compile preprocessFileLineNumbers 'initSpectatorDisplay.sqf'";
};
};
The other SQF thing is just a file you point to with this ^ config
params ["_display"];
diag_log [_display];
_exitHandler = (_display) displayAddEventHandler ["keyDown",
{
_key = _this select 1;
if(_key = 0x01) then
{
["Terminate"] call BIS_fnc_EGSpectator;
(_display) displayRemoveEventHandler ["KeyDown", _exitHandler];
};
}];
that's what I had
How does Params work anyway?
There is no need for the waituntil {!isnull (_display)};, because it's guaranteed to exist.
IIRC using hex numbers will be slower than decimal
need those extra nanoseconds
๐
but how do I convert it to a decimal
0x01 = 1
lol
you enter it into the debug console watch lines is what I do, lol
bottom of page it has reg nums
oooh it's at the bottom
The actual way to use these is:
#include "\a3\ui_f\hpp\defineDIKCodes.inc"
if (_key == DIK_ESC) then {...
i dunno but it works
params ["_display"];
diag_log [_display];
#include "\a3\ui_f\hpp\defineDIKCodes.inc"
_exitHandler = (_display) displayAddEventHandler ["keyDown",
{
_key = _this select 1;
if(_key == DIK_ESC) then
{
["Terminate"] call BIS_fnc_EGSpectator;
(_display) displayRemoveEventHandler ["KeyDown", _exitHandler];
};
}];
couldn't you also include in int he description.ext once?
or does that not work that way
No.
_display is undefined in the eventhandler script
luckily you can retrieve it from the passed arguments:
_display = _this select 0
(findDisplay 46) displayAddEventHandler ["KeyDown"," hintSilent str (_this select 1)"];
for key code
that's what _key is for
i meant just to test what key is what num
Nah, just use DIK_XX and if you don't know XX, then look it up here: https://community.bistudio.com/wiki/DIK_KeyCodes
oooh
They are self explanatory most of the time
F-key = DIK_F
Tab key = DIK_TAB
etc,
Gotta love DIK keys
๐
EG spectator display is findDisplay 60492
private _hasMissionSQM = call {
private _control = (findDisplay 0) ctrlCreate ["RscHTML", -1];
_control htmlLoad "mission.sqm";
private _return = ctrlHTMLLoaded _control;
ctrlDelete _control;
_return
};
Anyone know a less shitty way to do this?
that's a thing?
quick question: does anyone know why "set face" dont work with all faces? for example when i use: set face "williams" i just get the default face when loading the mission.......
i mean i use : this setface "williams"
Would a simple loadFile work? @little eagle
loadFile does make an error pop up
is there a command to make a hint dissapear immediately
hint "";
^
huh I thought it would just bring up a box
nope
@tough abyss Is it safe to use loadFile on machines without interface? Cant use dialogs / controls there, but pop ups don't exist either.
I mean, if you want a box: hint str("");
Updated ViM-SQF syntax file to latest dev version
https://forums.bistudio.com/forums/topic/194626-vim-sqf-sqf-syntax-highlight-for-vim/
Supports:
Arma 3 commands
Functions from BIS, CBA, ACE, CUP, TFAR, ALIVE
quick q, does anyone know the number of the map control?
If the file does not exist, does it crash or something?
thx
i tried this setface "williams"; ..... still default face?
I wonder what mods got upgraded yet
I thought the map was display 12?
_map = findDisplay 12;
_map ctrlCreate ["RscTree", 2103];
_tree = ((findDisplay 12) displayCtrl (2103));
_lbposX = 0.765 * safezoneW + safezoneX;
_lbposY = 0.725 * safezoneH + safezoneY;
_lbwidth = 0.2015 * safezoneW;
_lbheight = 0.2125 * safezoneH;
@tough abyss setFace does not work from the init box directly. Try:
0 = this spawn {
_this setFace "williams";
};
any known scripting changes that would cause a crash with this (since 1.68)?:
Exception code: C0000094 INT_DIVIDE_BY_ZERO at 026FC05C
sounds like something divided by zero
thanks ๐
1/0 doesn't crash arma usually
just gives a script error (same in 1.68)
Try it without dividing by 0
i don't know what is dividing by 0 is my issue
@vapid frigate when does it happen? is it MP? as soon as you connect?
nah, it's in a custom script.. but it's a big one
so was hoping it was a known issue before i start eliminating stuff
yeh i know how to debug it, was just hoping i didn't have to
will report back when i work out what command's been broken
unless there's actually break points i don't know about?
Heh, I wish
narrowed it down to something to do with deleting ui controls
seems like this line crashing ctrlDelete ((findDisplay %1) displayCtrl 1261);
Hi all,
is there a way to uniqly identify objects in player inventory, say some commands output weapon and magazine id
for example
currentMagazineDetail player
//"6.5 mm 30Rnd STANAG Mag(30/30)[id/cr:10000061/0]"
// pressing R to reload magazine, now output is
//"6.5 mm 30Rnd STANAG Mag(30/30)[id/cr:10000062/0]"
Weapons don't have id's. At least there is no way for us to read them.
Syntax:
container weaponAccessoriesCargo [weaponId, creatorId]
Parameters:
container: Object - cargo container
[weaponId, creatorId]: Array
weaponId: Number
creatorId: Number
Return Value:
Array - [silencer, laserpointer/flashlight, optics, bipod]
I seen somewhere in one's command output, but could not find it
Weapons don't have id's. At least there is no way for us to read them.
pity
I am afraid no way to script kind of unique items, maybe just like ot is done for radios in TFAR
tf_fadak_1 ... tf_fadak_1000
found the crash.. you can't delete a control from inside it's mousebuttondown(at least) event handler
repro (worked in 1.66):
disableSerialization;
sleep 2;
createDialog "RscDisplayCommon";
_dialog = findDisplay 999;
_control = _dialog ctrlCreate ["RscButton", 420];
_control ctrlSetPosition [0,0,1,1];
_control ctrlSetText "CRASH";
_control ctrlCommit 0;
_control ctrlAddEventHandler ["MouseButtonDown", "ctrlDelete ((findDisplay 999) displayCtrl 420)"];
};```
Why would you do that?
close something when you click on it?
If you wan to close it, then close the display.
Controls shouldn't be deleted when the display is still shown.
worked fine before 1.68 and in a lot of other circumstances where i'm doing it
just not in that event
Try with 32 bit exe, but I don't think it was good design to begin with.
it's basically working around the fact that you can't stack dialogs
so it creates/deletes controls on the 1 dialog instead
_control ctrlAddEventHandler ["MouseButtonDown", "[] spawn {ctrlDelete ((findDisplay 999) displayCtrl 420)}"];
is a workaround
if you shouldn't delete controls, there shouldn't be ctrlDelete ๐
The right way would be to create all your controls when you open the display
And then to ctrlShow false what should be hidden
And ctrlShow true what should be shown
ctrlEnable too etc.
that would be bad design in my case because i don't know how many controls there are till it's running
and it changes dynamically
ctrlCreate and ctrlDelete sort of changed the possibilities
that would be bad design in my case
Objectively wrong.
My ui didn't break with an update. ๐
touche
What you're doing the the equivalent of changing the size of an array while iterating through it.
Maybe that even is exactly why it crashes, who knows.
it only crashes 64 bit
just tested
it's a common thing in other languages (winforms, xaml, etc) to delete/create controls.. i don't see why it's bad design in arma
well other than the INT_DIVIDE_BY_ZERO
create them when the menu is opened (onLoad etc.) and then ctrlShow or ctrlEnable them.
I hate how this server removes all the features that makes Discord better than IRC
it has custom dropdowns too
so 1 for each allowed item.. 10+ for each category where you can have multiple things
i did try the 'old' way before.. using built in combo boxes and such.. was too slow
All I'm saying is, that deleting a control from inside one of it's eventhandlers is bound to break at some point.
yep, that point is 64 bit ๐
Changing a lot of things and some of it very low level like 64 bit will expose a lot of these things.
oh wow. 7:30 am
Shows.
@vapid frigate How do you display logo and grey interlacing behind the character?
Object with texture behind I suppose?
yeh the background is about 10 of those flat plane objects (to make it big enough
Looking at that white border on bottom of the logo