#arma3_scripting
1 messages ยท Page 465 of 1
i will give it a shot
Yes see the arguments of attachTo https://community.bistudio.com/wiki/attachTo
can i DM you some screenshots of what i have atm
Yes sure
Ok I think I understand what you are trying to achieve. So you are decorating some vehicles with other objects and want them to remain attached after mission start, right? I tried doing same and here's the code:
_dest = truck_0; //Replace truck_0 with the base vehicle to attach stuff to
_t = this;
_t_dir = vectorDir _t;
_t_up = vectorUp _t;
_t attachto [_dest];
_t setVectorDirAndUp[_t_dir, _t_up];
You must place it into the init field of all the objects you want to be attached.
Also name your base vehicle somehow, it was truck_0 in my case.
Heads up to any bis people
https://community.bistudio.com/wiki/sort - fine
http://community.bistudio.com/wiki/sort - redirects to http://vigorgame.com/wiki/sort which looks like something for e3
dwarden is investigating
fixed
@still forum Thanks and understood SQF -> compile > in memory intermediary assembly code (for future call and spawn). Makes sense given anecdotal rumor on forums or wiki (forget which) that, once compiled, script runs 20X faster on subsequent calls. Also means that SQF VM is really a virtual machine of sorts tapped into a native bridge to the engine code/functions. Makes me wonder if scripting commands (as opposed to scripting functions) are in memory as intermediary assembly code or as native code.
Is it possible use the draw3DIcon in such a way to have the text above the icon without it clipping if you get further away?
hello, is possible to detect lost connection on player?
handle disconnect saves the unit but is used on the only on the player assigned too and player disconected executes mostly code one time if one of your players leave the game possibly good for Player _insert_your_player_name left the server
But now i once again have a question... does somebody know more about the display id of the dynamic group framework?
Can the gap and input keys on the death menu be overridden?
Is there a list of all scripting commands anywhere, preferably in some easy, to parse format and with metadata anywhere?
Something like that yes, though I would prefer not having to download the HTML page for each command listed there
Well... you can brows it in arma 3 itself but i would not recommend it
If I needed say command and what version it was introduced in, or what the syntax is like
well those commands get huge if you want to explore them you have to search something what you want to do example creating a vehicle and get on the command of it
Specifically I am interested in what kind of "command" they all are, IE
A, a global variable, like "daytime" is
B, a unary function, like "abs" is
C, a binary? function like "min" is
@tight moat yes there's a command to output that
can't remember what it is tho, gimme 5s to find it
๐ฎ Thanks
I wonder if stuff like this is documented anywhere
? what stuff like this?
Like how SQF works in more details and how the types etc. are handled
How the engine parses the scripts and such
your best guess is the intercept repo on github
While I know of foxhounds grammar, a "formal" one from BIS would be nice as well
considering how long it takes for some stuff to be documented I highly doubt they'd do that
I don't think they just made up the language and went on from there though, but rather were working form some more formal definition when implementing it in the engine
@tight moat see Arma 3 IntelliJ plugin and related projects
"arma-intellij-plugin" I assume?
Thanks
damn cann i add a permanent eventhandler on an ui object even though it is closed i finally found the id of the dynamic group tool of arma 3
@dry zephyr
Well, C also has & | ^ >> << <= => == !=. I don't think binary commands are as rare as you think.
I think C classifies these as operators, not functions
@little eagle @astral dawn Yes, I think you are right about binary operators in C, but my primary question is about function/script calls. The benefit of the SQF approach is that it makes arrays a first-order concept and then doesn't have to come up with hacks like variadic functions to support n number of arguments/parameters. However, I can't think of another language were you can specify the arguments/parameters before the function/script name.
Functions specifically have their arguments on right hand side inside parenthesis in C, but SQF functions are different from SQF commands.
is there an easy way to make a "directional trigger"? Basically I want to be able to tell if a player is coming or going
Never mind as soon as I posted that I realized there must be a direction command
Hello everybody -- I want to try and make an XP system for Arma. Nothing fancy, but enough to prompt the ability to level up players, or at least have a value that can represent them.
Problem is. I'm .. super new at coding. Is this too much of a task to try?
I can't find anything else in the world that even has an XP system that I can learn off of.
money, XP, all the same...
xp is a value you want to store so you will want to look up how to store data in Arma on runtime and ways to distribute it when something happens
money is pretty much identical yes
depending how much you know about coding you might want to look up how armas scripting lanquage (SQF) works
Hm! Okay.
I'll look for a money script and try to learn how it works then! Thank you!
Then try to make my own haha
Man this is gonna suck. lol
Can you remove the SAM turrets from the UAV list? It's a real PITA to scroll through a bunch of SAM's and turrets just to get to the drone you want
how many sam turrets are there? 3?
Yeah but I have a whole bunch for base defence/carrier defence so there's like 15ish all lumped in with the UAV's
Anyone know of a civilian ambient spawner or civilian vehicle spawner?
I use Engima's Civilians and Traffic scripts, you should be able to find them fairly easily with a quick google search
JD, you can use https://community.bistudio.com/wiki/disableUAVConnectability
Iterate through each uav you want to block on each player.
Oh wow, I completely missed that, thank you
Hey guys do you have any idea how can you validate call compile "" . The example is if you have call compile "{true;};" this results in a variable with typeName "CODE" but if you call compile "" than the variable has no value and isNil, isNull, isEqualTo and typeName do not work on it
I think it throws Generic error in expression but i am not sure how to catch this and handle it gracefully
@earnest path typeName compile ""; returns "CODE" when run in debug console launched from editor (Tools menu). Do you really need call in front of compile?
The example is if you have
call compile "{true;};"this results in a variable with typeName "CODE"
@earnest path
No, it returns BOOLEAN (true) and not CODE.
Arg, ignore what I said. Yeah it's CODE.
To check the type, do isEqualType.
private _function = call compile "{true;};";
_function isEqualType {} // true
But may I ask why call compile and why double code brackets? The compile already replaces the outer quote marks with code brackets. It seems very wonky what you're doing.
@little eagle @still forum can you tell if its possible via sqf to read in the entries in the server list control, filter it and feed it back it? or is engine controlled idc behavior probably too tight there?
(we are looking ways to filter the server list to show only servers for a given mod/for the current active mods)
I think the server mod list is only shown when you click on the server. Therefore you would have to have your script click on all servers.
But I guess you could just name all of them [IronFront] and then filter the listBox like that as well. Iirc it should just be a simple ListBox.
yep only the name based filtering is feasible atm i think
i guess you could hide the normal server list listbox, filter its entries, show them in a new listbox, and keep the server list id/mapping to make sure to select the right entry in the hidden list when you click "join"
Maybe a dll could do something as well.
yes, but whitelisting by BE and all that
People should just stop using battle eye if it breaks their game. It's simple really.
So how do I properly debug script speed and performance?I've made a few things and I wanna do a run of optimize
unscheduled and dedmen brofiler?
i was thinking about handle lost connection with check when connection icon is lighting, is possible?
You mean the red chain?
I haven't seen that chain in ages. They may have got rid of it.
@little eagle I have a few strings in an array and depending on which one my script calls i have to compile and run the code. So say the string is "script_1" than i do call call compile "NGScripts_script_1" and that runs my script. If for some reason you put a wrong string for calling one of the script i would like to throw an exception and handle it by logging that the script that you are trying to run does not exist however the call compile "" does not yeld anything so i could not validate to throw the exception
@little eagle yes
Rollo, you should use missionNamespacte getVariable instead.
private _function = missionNamespace getVariable "NGScripts_script_1";
AH i see so than i can give the getVariable a default and validate on that default
You could try ctrlShown on the chain picture control, Chew, but if it internally uses fade and not show, then you won't be able to tell whether it is shown or not with scripts.
haha I didn't think of that one . Nice one man thank you !
@little eagle ok. Understand ty
call compile is bad almost every time.
Is it bad due to the ability to inject rouge code or just not performant enough
Mainly because it leads to hard to read code that isn't even faster or has any other benefits. It's inferior to other solutions and only wide spread because of copy pasting bad code.
Are there any script ways to check desync amount? That's still viewable in the Player list?
Not aware of any method.
Hmm
Btw if I try to send like a huge string as a publicVar, does it get split up according to server settings and then sent?
Also btw Thanks a lot for all the help here everyone has given here. I just realized I'm a lot better at scripting than I was a year or two ago
@dry zephyr that, once compiled, script runs 20X faster on subsequent calls. SQF cannot run uncompiled. It has to be compiled before it can run.
Also means that SQF VM is really a virtual machine of sorts Yeah. I have a open-source remake of the main VM central that takes care of executing the instructions.
Makes me wonder if scripting commands (as opposed to scripting functions) are in memory as intermediary assembly code or as native code. Don't understand what you mean by that.
There is a big hashmap of command->function pointer. When you execute a command the engine resolves the function pointer and executes the native c++ function.
Actually every of the about 7 instructions do that. Every instruction has a vtable with a Execute function in it.
@tight moat What info do you need? I can give you full command dumps with argument types but they don't include the version they were introduced as BI doesn't keep track of that internally.
@little eagle No, it returns BOOLEAN (true) and not CODE.. Nope. call compile "{true;};" Executes {{true;}} which returns code.
@peak plover So how do I properly debug script speed and performance? If possible then debug console. If it's already unscheduled then my profiler. If it's scheduled yeah.. well. Converting it into unscheduled will already make the script faster than scheduled. And if it's scheduled you usually don't care about perf that much.
I remember someone sayign something like The debug console thing is inaccurate
true. with too high/low numbers it get's inaccurate
Right
also the debug console thing checks after EVERY execution if the timeout is already over to abort early. which scews the results
you can use my profilers codePerf command though
profileScript [{code}, arguments for _this, number of runs]
But it doesn't abort if it runs too long. So be careful with "number of runs"
I'd rather get more accurate results tbh
output is [runtime in microseconds, runtime in microseconds as string, number of runs]
the string one is double precision microseconds.
Whereas the vanilla one is single precision milliseconds output
https://community.bistudio.com/wiki/ArmaScriptProfiler
Could that be added here?
yeah. I'll do it quik
Thanks
๐๐ป thanks
wohoo, new computer
Whoa, how new
#offtopic_hardware tell us :U
Pentium III 800Mhz, 128 SDR, GeForce 2?
Newest generation new, but not high end, because I'm a cheap fucker.
18:04:59 Wrong vertex mapping for person collision geometry found in a3\characters_f_epc\civil\c_nikos_aged.p3d. Selection 1c not found 18:04:59 Wrong vertex mapping for person collision geometry found in a3\characters_f_epc\civil\c_nikos_aged.p3d. Selection 2c not found 18:04:59 Wrong vertex mapping for person collision geometry found in a3\characters_f_epc\civil\c_nikos_aged.p3d. Selection 3c not found 18:04:59 Wrong vertex mapping for person collision geometry found in a3\characters_f_epc\civil\c_nikos_aged.p3d. Selection 4c not found 18:04:59 Wrong vertex mapping for person collision geometry found in a3\characters_f_epc\civil\c_nikos_aged.p3d. Selection 5c not found 18:04:59 Wrong vertex mapping for person collision geometry found in a3\characters_f_epc\civil\c_nikos_aged.p3d. Selection 6c not found 18:04:59 Wrong vertex mapping for person collision geometry found in a3\characters_f_epc\civil\c_nikos_aged.p3d. Selection 7c not found 18:04:59 Wrong vertex mapping for person collision geometry found in a3\characters_f_epc\civil\c_nikos_aged.p3d. Selection 8c not found
what is problem ?
Bad model by BI. Nothing you can do, except not use the object class with this model.
@rancid pecan It's not #arma3_scripting
what is problem ? It says it right there in the messages. Wrong vertex mapping for person collision geometry
poor nikos ๐
How can I kick and ban using an sqf function?
I want to interact with the functions with a dialog
How to control the sound of engine via script? Have tricky boat sequence AI cannot handle, so trying unitCapture/unitPlay. Scripted engine on to get basic engine on sound, but doesn't correspond to speed of boat. Vaguely understand sound system processes engine sound through several layers and can see RPM reported from sound controller does not change (always 200 when boat moves under unitPlay, goes to 900 when piloting as player), so the engine sound does not sound revved up.
Ancillary question - we have commands like getSoundController, but what is purpose of those if we cannot script or influence them?
There is no setter for this.
When units get out of a vehicle at a Get Out waypoint , they seem to run on foot to a default disembarkation point a few meters away (usually forward and left/right of vehicle depending on side exited?) before continuing to their next waypoint. Is it possible to have them walk calmly to this close disembarkation point instead of jumping out, running a few steps to the disembarkation point, then calmly walking to their next waypoint (assumes here that both Get Out and Move waypoints have speed mode set to Limited)?
Looks jerky when they come running out of the vehicle, then start walking normally.
nope, it's to avoid the next unit disembarking sending the previous one flying
same when they embark a vehicle, they line up about 5m away from the position then they proceed
@lone glade Thanks for explanation about avoiding collision.
dedmen_randomOrientation = coroutine.create(
function ()
while (true) do
coroutine.yield(math.random(0,360))
end
end);
function dedmen_vehiclePFH()
SQF.systemChat("dedmenlib setDir");
_, newOrient = coroutine.resume(dedmen_randomOrientation);
Dedmen_vehicle:setDir(newOrient);
end
function dedmen_preInit()
--https://github.com/dedmen/interceptTest/blob/master/interceptTest/main.cpp#L597
SQF.systemChat("dedmenlib preinit");
Dedmen_vehicle = SQF.createVehicle("B_Quadbike_01_F", SQF.player.positionASL);
SQF.events.PFH.dedmenlib = dedmen_vehiclePFH;
--if CBA.canUseWeapon(SQF.player) then
-- CBA.addWeapon(SQF.player, "Binocular", false)
-- CBA.selectWeapon(SQF.player, "Binocular")
--end
end
--SQF.events.preInit.dedmenlib = dedmen_preInit;
SQF.events.postInit.dedmenlib = dedmen_preInit;
How many people here prefer LUA over SQF?
Curly brackets > end.
^ same :/
lua comments trigger me
But the other binding is python and that isn't much better ๐
just gimme muh pyhthon reeee
python 2.x or 3.x^ ?
4.y
3 afaik
thank god
commy3
commy2.8
if (player call CBA_fnc_canUseWeapon) then {
[player, "Binocular"] call CBA_fnc_addWeapon;
[player, "Binocular"] call CBA_fnc_selectWeapon;
};
->
if CBA.canUseWeapon(SQF.player) then
CBA.addWeapon(SQF.player, "Binocular")
CBA.selectWeapon(SQF.player, "Binocular")
end
Not really sure which one I really prefer
Well.. Second is OOP.. Soo...
testing purposes
The cba namespace should inherit from the sqf one, meaning I can use usingonce at the top instead.
Can do things like
player setPosASL ((player getPosASL) vectorAdd [0,0,5]);
SQF.player.positionASL = SQF.player.positionASL + {0,0,5};
I looked for usable and very easy to wrap CBA functions.
The wrapper in the CBA library is
function CBA.addWeapon(unit, item, verify)
return SQF.missionNamespace:getVariable("CBA_fnc_addWeapon")(unit, item, verify or false);
end
What does addWeapon even do?
drops on ground if no space
Ah, I remember. That's actually pretty neat.
Should drop the old one instead though, but I guess that is not something doable in A3, thanks to cargo system api being shit.
I think I should also be able to do
SQF.missionNamespace.CBA_fnc_addWeapon(unit, item, verify);
No need to call a function or pass the var name as string
or
SQF.missionNamespace["My_fnc_func"](1,2,3)
Or variables on objects
SQF.player["myvar"] = 5
@Dedmen to your question C > SQF > anything else, though I'm led to understand you can't use C for mission building, so SQF for mission building if that is true. Otherwise, it's just more layers for things to go wrong. Everything is limited to the scripting commands anyway.
Is there a standard convention in EDEN for "thing to put down just to have a visual indicator of a named position you can get in script"?
@little eagle Noice.
Even if you don't want this. Guess it's educational on how to create a text control with fixed size regardless of ui size settings and monitor aspect ratio.
with all these commy3, commy 2.8 etc I wonder if you already did aโฆ commy'h'ngout
runs far away on holidays
@winter rose commander gang
wut? ^^'
Commander1, Commander2, Commander3
Oh yeah, I read that :) I just hope they don't catch me before the border
@still forum javascript arma lol D:
yeeh
Ohh btw you probably know this good. If I send a very big text through publicVarClient. It will cut it in many packets according to the server settings for network, right?
I mean like if I send a lot of data it will cause desync and shouldn't be done, right?
So I could write a script that splits the text up into many bits and then sends one per frame
one per frame might still be too fast
okay, but that would be the way to do it pretty much
It's something I might look into to do a database connection for some player stuff
So player asks server, server gets stuff from db and sends it via a couple of publcVarClient
about lua... was using it a bit in "some other game with editor", still have couple examples pinned in "some discord server" ๐
function onMissionStart()
SaveMenu = {
title = "Checkpoint",
items = {
MenuItem:new("1. Create a checkpoint", Pointer:new("SaveGame")),
MenuItem:new("2. Cancel", Pointer:new("CancelSave"))
}
}
dialog = Dialog:new("PDA", "pda.bmp", 256, 256, 10, 15)
Dialog:init(dialog)
Dialog:addMenu(dialog, "saveMenu", SaveMenu)
end
```that is simple ui thingy with 2 buttons ^
```lua
function onMissionStart()
local us = Spawn:CreateUnit("The USMC", "USSet", "USSpawn", "Target")
us.onSpawnedReady = Pointer:new("followPlayer")
Spawn:SpawnUnit(us)
end
function followPlayer(unit)
OFP:follow(unit.echelon, "player", "ADDTOEND")
end
```that is spawn unit, set formation and make him follow player ^
so lua vs sqf... i vote for sqf lol
(findDisplay 7300) displaySetEventHandler ["KeyDown","if ((_this select 1) isEqualTo 57 || (_this select 1) isEqualTo 1 || (_this select 1) isEqualTo 28) exitWIth {true}"];
help
(ใคยฐ_ยฐ)ใค fix
(findDisplay 7300) displayAddEventHandler ["KeyDown", {(_this select 1) in [1, 28, 57]}];
thx
UsingsetVelocity on a boat causes the camera to shake each time it is set and the player is nearby (but not in) the boat. Turning camera shake off in difficulty settings stops this from happening. Any ideas why setVelocity would have this effect and how it might be stopped without having to completely disable camera shake?
If I'm using this
[
"Draw3D",
{
alphaText = linearConversion[5, 50, player distance haloPlane, 1, 0, true];
drawIcon3D ["", [1,1,1, alphaText], haloPlane modelToWorld[0,0,2], 0, 0, 0, "HALO Jump", 1, 0.05, "PuristaMedium"];
}
];```
To put text over items in the game, where's the best place to run that from? At first I put it in the initServer.sqf but of course then it doesn't show up. Am I best to run that from initPlayerLocal.sqf?
ok initPlayerLocal.sqf works
#define MGVAR(NAME,DEF) missionNamespace getVariable ['NAME',DEF]
#define MSVAR(NAME,VALUE,PUB) missionNamespace setVariable ['NAME',VALUE,PUB]
private _myCar = MGVAR(ten_myCar,objNull);
MSVAR(ten_myPlayerGun,(currentWeapon player),true);
Does that make sense?
Looks more like they're just syntax indicators
Why would you do that and then ask if the syntax works?
Like, <var name here> etc
But the macro itself is unary.
Which could lead to precedence errors.
It should be wrapped into parenthesis to be safe.
#define MGVAR(NAME,DEF) (missionNamespace getVariable ['NAME',DEF])
like this ^
oohh right, makes sense thanks
Otherwise I don't really think the macro is needed. Itsaves you from typing two commands by having to write one. It's kind of lame.
What do you mean, looks a lot faster with macro to me
missionNamespace is typed with 6 keystrokes, getVariable with 5
This one has parnthesis you have to place. Maybe that works better with your setup, but still doesn't seem worth it to me.
also maybe just
#define MGVAR(A) (missionNamespace getVariable [A, objNull])
#define MSVAR(A,B,C) (missionNamespace setVariable [A, B, C])
name < that is command ๐ค
yeh, I'd personally like ABC as well. just for simplicity sake I used name and such
It's a part that is rarely read, so it can have simple abc ๐
ARG < also works
The setter needs no parenthesis imo, as it has no return value and should never be used like the getter anyway.
Would anyone know if theres a way to make the vehicle camo nets and slat armour appear ingame on the go?
In other words, is there like an init code I can enter onto a vehicle and make their nets show up
I think it is also better like when user writes "" himself, because sometimes it might be a reference like _myName
@kindred briar Try export from arsenal
*Garage
Ahh yes forgot about that! I'll have to give it a shot another time but cheers for the ide!
nigel, you could write:
#define MGVAR(A) (missionNamespace getVariable [format ["%1", A], objNull])
Maybe that'd help in your case?
so MGVAR("ten_mission_tickets",100)
would format work with that
I guess a even better way of doing it would be to have my own automatic prefix added to that
with format
or just
Similar to how like ace adds it's prefix
You mean the real GVAR?
btw is there any proper docs for preproc and macroses ? (i mean something usable in arma/sqf)
i mean... thanks, but is there anything except that one ^ ๐
It says pretty much everything there is to know though.
and will try to hold myself about __EVAL... pinky promise ๐
Good. It's shit.
is it possible to have an animated texture with setObjectTextureGlobal?
ye, that is the thing. I am not even sure if arma has support for keyframe textures
pretty much
No, paa.
animated textures is coming in probably next arma version. Or.. Animated UV sets.
swap 24 paa in a row, you got a video now /s
but not via setObjectTexture
By version you mean 1.84 or A4?
84
That's cool, Dedmen.
but afaik also done in model animations. I guess you could use animateSource to then animate textures. If the model has these animations defined
i hope they will add a flat square model which supports this then.
cough someone did some disco cube, that's like half way there cough
well yeah, i also did some disco thing a few years back, but that is not really what i want to do
http://diwako.net/snaps/dundundun.webm
Is there any way to know if a variable was public or not?
no
hey @little eagle I'm using the scripted lobby
I've got a question about it
Ohh nvm
So basically a new unit is created when the slot is changed
I have an issue where in another script I set variable to unit namespace
So when the scripted lobby does selectPlayer
It will not have any of my variables
How do I check if player is near a building? I have tried this: (player distance 'Land_PoliceStation') <= 15
if !((nearestObjects [player, ["Land_PoliceStation"], 15]) isEqualTo []) then {systemChat 'Policestation nearby'};
Sumtin like that maybe
Why ! after if
because you want to know if the player is near a building. Not if no buildings are near. that's why !
Hmm thanks. I will try.
also if this Land_PoliceStation is a placed object with a varname then it should be without the quotes
in your original
Looks like a classname
Ohh
Scripted lobby also means that all the eventhandlers are removed
So if I die, it won't run onKilled events
that's what i though, but it's not a vanilla class at least
we have onPlayerKilled/Respawn.sqf also, nigel
I used EH for mine
But I think it's best if I just run all initPost scripts i have again
That way it's all good
Cuz some scripts might be side specific etc.
SQF.systemChat(SQF.configFile.CfgVehicles.B_Quadbike_01_F.displayName:asText());
SQF.systemChat((SQF.configFile >> "CfgVehicles" >> "B_Quadbike_01_F" >> "displayName"):asText());
SQF.systemChat(SQF.configFile.CfgVehicles["B_Quadbike_01_F"].displayName:asText());
SQF.systemChat(SQF.configFile["CfgVehicles"]["B_Quadbike_01_F"]["displayName"]:asText());
:3
favourite?
should all be equal. But I'll profile
Also have new namespace stuff
SQF.missionNamespace:getVariable("CBA_fnc_currentUnit")();
->
SQF.missionNamespace.CBA_fnc_currentUnit();
SQF.missionNamespace.Myvar = 5
the most useful part about this probably will be that LUA is way faster then SQF basic ops
but it is lua afterall
so that is a nono
1: 0.0124ms
2: 0.0116ms
3: 0.0127ms
4: 0.0124ms
getText (configFile >> 'CfgVehicles' >> 'B_Quadbike_01_F' >> 'displayName') 0.0041ms
๐ Not quite there yet
mhh?
you mean speed of lua vs sqf?
should not gain anything at all in regards of calling actual SQF
but the complete rest will be faster
eg. instead of saving stuff in missionnamespace one could use a simple lua object which should increase the actual access-time by a dozent ms
1+2+3+4+5+6+7+8+9 SQF 0.003ms. LUA: 0.0028ms
with or without optimizer?
because lua should be faster
but lua again is not optimizing stuff
With Intercept+Lua will one be able to create a normal thread? I mean not spawn a thread in arma but create a thread in OS
yeah. But you cannot execute SQF commands from threads as SQF isn't threadsafe
could probably do something with coroutines
So I've heard a lot of times things like 'Life/Exile/whatever are overloaded with scripts and thus have low framerate'. What exactly do people mean by this? Do they have a lot of scripts unscheduled or?
Is there a way to smoothly change the direction a boat is pointed in while also setting its velocity? I found I could smoothly change the direction with setDir OR I could smoothly keep the boat accelerated with setVelocity in a straight line. When I do a setDir and then a setVelocity, even though I do the setVelocity AFTER the setdir the boat just spins in place. * Within onEachFrame on server.
Maybe you should look into playing a pre-recorded animation instead?
I never tried it but i think it's possible
And what's really interesting about that is that in watching some expressions in the debug console, the boat speed is about right (~28), there is non-zero velocity ([7.18655,3.51476,0]), and the engine has revved up. It just doesn't update its position.
@astral dawn I tried that and that does work to some extent, but then you can't control the engine noise to match the movement (can't change the RPMs used to change the engine sound for the sound processor) and I've read that the movement can be jerky in multiplayer.
I think I've read that for different kinds of objects the engine might skip frames before actually updating the position
Like projectiles are updated each frame, empty vehicles and such - not each frame
The jerky playback in multiplayer makes some sense if the prediction algorithms used by client use velocity to create smoother movement client side . Since unitPlay is just a set of positions, I'm guessing the client predicts it won't move because it's velocity is zero, then a server update comes in and it jumps it forward with the next position update that makes it through. Haven't tested this to see how bad it is, though.
Maybe make an AI drive the boat?
@astral dawn That makes sense about skipping frames before updating position, but the odd thing in my case is that I can make it rotate in place perfectly smoothly with setDir or move smoothly forward with setVelocity on each frame, but not both.
What if you use even frames for setDir and odd for setVelocity then?
The problem with AI in a boat is that they stop at every waypoint on the water and have trouble beaching. There's a velocity boost script that does a pretty good job of beaching, but I thought I could write a better boat driving AI to smoothly bring it into a beach... and I think I could within limits if I could change direction and velocity simultaneously.
@astral dawn, hah, I tried that, but...
Does it also look bad?
Sorry, was trying that again to make sure I remembered correctly.. it still just spins in place.
What do you mean by 'Spins in place'?
The boat sits in the water with engine going and creating wake effect, but instead of moving forward, only the direction changes, so it slowly turns to the right in the same spot.
What's really interesting about this is I don't do it within onEachFrame...
but instead do it with sleeps, it will move forward and turn. However, it's a bit juddery, thus I wanted to bring it into onEachFrame .
Well you said that you can make it either move well on each frame or make it rotate well on each frame, but not both. I assume there must be some number of frames you could skip to make it still work.
use setVelocityTransformation and you're done
Quite a cool command ๐
soooooo, I got a UI issue, I'm resizing my control, it's resized, but the game completely ignores that it's resized:
17:01:29 "1.812 panel filled [1.18371,-0.30303,0.454545,1.60606]" // original size
17:01:31 "4.115 left sel changed [1.18371,-0.30303,0.454545,1.60606]"
17:01:31 "4.115 control resized [1.18371,-0.30303,0.454545,1.56061]" // resize
17:01:31 "4.115 panel filled [1.18371,-0.30303,0.454545,1.56061]" // list filled
// doing the exact same thing a second time
17:01:59 "8.635 left sel changed [1.18371,-0.30303,0.454545,1.56061]"
17:01:59 "8.635 control resized [1.18371,-0.30303,0.454545,1.56061]"
17:01:59 "8.635 panel filled [1.18371,-0.30303,0.454545,1.56061]"
@lone glade Any code snippet on that?
those 2 files are the only places where ctrlSetPosition are used, well only the first one technically since the second one only has the macro defs
(I fixed it but I find it very weird)
so its TOGGLE_RIGHT_PANEL_WEAPON either TOGGLE_RIGHT_PANEL_CONTAINER macro, since yeah, only two of them contain ctrlSetPosition but the thing is there is no actual transformation to do it a second time since coordinates are relatively static:
_x ctrlSetPosition [\
safezoneX + safezoneW - 93 * GRID_W,\
safezoneY + 14 * GRID_H,\
80 * GRID_W,\
safezoneH - 28 * GRID_H\
];\
_x ctrlSetPosition [\
safezoneX + safezoneW - 93 * GRID_W,\
safezoneY + 14 * GRID_H,\
80 * GRID_W,\
safezoneH - 34 * GRID_H\
];\
well, yes
so go figure why this happens (not my gif)
https://gfycat.com/MassiveThreadbareDavidstiger
It just changes the height basically, but performing that twice will give no result, as there is no offset to transform to.
in theory
in practice the height change is completely ignored the first time
and I have 0 idea why, probably a bug with listNbox and some super specific stuff
Just curious why would you even use different size each time for that listbox, since theoretically it should be the same size all the time.
So it was that height diff right?
I went through so many designs it's probably a remnant of that
nope
I just disabled the resize for those 2
i'll never know why it happens ๐
๐
maybe the height diff is too small... I wonder
hm... maybe the resize is slow AF?
when resizing more aggresively the list doesn't get filled completely
@astral dawn I tried different frame intervals and it almost works if you do setDir every second frame (and setVelocity every frame), but still get little judders here and there. It might not even be noticable if not running at 120Hz, but AI moving boat is smoother.
@lone glade Thanks, I will look into setVelocityTransformation. The API is intimidating.
Can someone send me the scripts of arma 3 life? ๐ Im just kidding pls dont lol
@lone glade Have you ever tried the Bob example? He doesn't seem to climb the stairway of heaven, just falls back to ground and climbs in place.
i have read "Quicksilvers" name on some kind of Invade and annex mission ๐ค
i'm tempted to click again....
@lone glade ListBox family has an issue with that, if you resize an already filled element, it might not show up all rows properly at the bottom of the list.
huh, so that's it
Is there anyway to add text to a structured text control? Instead of replacing it entirely by using ctrlSetStructuredText? Seeming I'm using ctrlText to get the current text from the control, however that only gives me the text string, not including the structured text format.
@lone glade setVelocityTransformation suffers from the same problem as using keyframe animation - it doesn't simulate the boat going through the water and creating wake or revving the motor up
well, yes, the command ignores the waves and the engine
@peak plover
I'm using the scripted lobby
Cool. Ever tried it in MP with actual people?
Is the _thisScript magic variable defined in absolutely all contexts? I mean, does it exist in all event handlers, init.sqf, and everything else?
^ what is this variable returning (i'm trying to make a point here, go away ded) @astral dawn
'The called or spawned script handle from within itself.'
okay, what has script handles?
spawned scripts for sure have one
Thx, the description sounds strange to me, that's why I asked
So will it be scriptNull or just nil in an EH? And what if I remoteExecCall a script?
initServer, initPlayerLocal, initPlayerServer and Init.sqf are launched Scheduled, do they also have _thisScript defined?
Uh, allright... I was considering constructing a reentrant mutex based on _thisHandle, but if it doesn't exist everywhere I might abandon the idea
only spawn and execVM have script handles
No, That's what I wanna do right now
Cool. You're the first one I am aware of.
init.sqf has no script handle that could be terminated with terminate or checked with scriptDone.
I guys. If I know the ladder object in my mod, can I detect if a player is climbing it?
Im attaching a ladder to my vehicle, but also detaching and deleting it when the ladder is retracted. This can lead to undesired results if someone is climbing it while its being retracted
it says position right there... you put the position that you want exactly where it says.
My self driving boat turned rogue and started killing other boats. Then it came after me.
Dangers of allowDamage false and anything can be a waypoint.
https://image.ibb.co/eZk7Ho/indir.jpg
i want to know that how can i set that position at red circle?
@rancid pecan Take truck position and direction and then use manual distance offset to get position? I think the question would be what you want to do with the position once you found it - attach something? Have someone stand there?
trial and error.
@nocturne basalt you could check if the ladder is deployed via animationSourcePhase
derp*
hello, is possible to check player ping with script? Or get data from Rcon for use on script?
@rancid pecan you can figure out positions like this: in VR map put some tiny objects like circles/arrows, then take pos. of the car and pos. of these objects (better use posWorld), take their differences and you've got the offset
@lone glade no I'm thinking I need to force the player off the ladder if climbing it while retracting it
somehow
check for the closest player near the ladder in the ladder anim then force the drop action
ez
im not completly sure but wasnt zeus able to tell players pings ๐ค
@lone glade yeah that could work ty
got one more question for you guys. How can I reset my turret to its default position? reset to position 0
animateSource ["mainTurret",0]
does not work
guessing cause its not a user animation
You can't with scripting. There is no way to overwrite turret rotations with scripting.
but can I tell the AI to move the turret to 0?
doWatch
ty Ill give it a try
tank1 doWatch (tank1 getPos [10000, 90]);
This will make it look at 90 = east iirc.
awesome tanks
Tanks a lot
๐
How do I run script on players that respawn? I have Extended_InitPost_EventHandlers that looks like this:
class Extended_InitPost_EventHandlers {
class Man {
class faster_movement {
Init = "(_this select 0) setAnimSpeedCoef 1.125;";
};
};
};```
Howe'ver I noticed that after respawn the setAnimSpeedCoef resets back to 1. I want to set it back to 1.125 after respawn.
How could I determine if vehicle is AA using isKindOf?
@thorn saffron Hmmm. One can only wonder in both #arma3_scripting and #arma3_config
class Extended_InitPost_EventHandlers {
class Man {
class faster_movement {
Init = "(_this select 0) setAnimSpeedCoef 1.125; (_this select 0) addEventHandler["Respawn",{(_this select 0) setAnimSpeedCoef 1.125;}];";
};
};
};
I am almost positive there is a cleaner solution though
afaik just onRespawn = true; (not 100% sure)
@neon snow I think there's no reliable way for that. There might be some static manned/unmanned AAs, with rockets/guns/both. A hand-crafted array with classnames is better for that.
hmm too bad. But thank you ๐
I think I was trying to check if a vehicle is a mortar some time ago... ended up making an array
Is there way to tell a group after having scripted in some waypoint changes, "Your waypoints have changed, stop heading for your current waypoint that no longer exists and head for your new waypoints?"
if you delete previous waypoints, they will automatically follow new waypoints
also setCurrentWaypoint
@winter rose , @meager heart Thanks, knowing that they should immediately start following their new waypoints helped me persevere in figuring out why they weren't doing that (trigger/activation confusion).
I am looking to work with playsound3D but struggling with the syntax, say3d worked great but the issue is the addaction would only play the sound for the person who pressed it, i need it to play for everyone here is my current code
this addAction [ "Tornado Warning", {
S1 say3D ["siren", 3000, 1];
S2 say3D ["siren", 3000, 1];
S3 say3D ["siren", 3000, 1];
S4 say3D ["siren", 3000, 1];
S5 say3D ["siren", 3000, 1];
} ]
recommend or give copy: a script to make AI more responsive and intelligent? script for zeus without downloading mods, and if download needed, client side? want to pull a fast one on my group..
@thorn saffron why not use Extended_Respawn_EventHandlers? For example https://github.com/acemod/ACE3/blob/559a498e6d93243c79a6ce199e1803837a775aed/addons/refuel/CfgEventHandlers.hpp#L19
/*
this addAction [ "Tornado Warning", {
S1 say3D ["siren", 3000, 1];
S2 say3D ["siren", 3000, 1];
S3 say3D ["siren", 3000, 1];
S4 say3D ["siren", 3000, 1];
S5 say3D ["siren", 3000, 1];
} ]
*/
action_id = this addAction ["Tornado Warning", {
{[_x, ["siren", 3000, 1]] remoteExec ["say3D"]} forEach [S1, S2, S3, S4, S5];
}];
@limber tangle
@meager heart So this should make it so everyone on the server can hear it if they are standing next to the objects "S1, S2, S3, S4, S5"? ๐
yes
Thank you!
btw default max distance for say3D is 100 m, not sure about 3000
really new to scripting, trying to learn by putting together samples and trying to make sense of the individual components.
Added an 'addaction' to the init field of a stretcher prop, as following:
https://pastebin.com/U8D6nNE9
Trying to achieve:
- add action to stretcher, with a visible first aid icon visible on HUD. Text on actions menu should be red.
- the action should only pop when the player is close to the stretcher (within 1 meter). (CURRENTLY NOT WORKING)
- this should work in LAN / ethernet.
0 = this spawn {
private _stringText = "<t align='left' color='#FF0000'>Heal at Stretcher </t>";
private _stringImg = "<img image='\a3\ui_f\data\IGUI\Cfg\Actions\heal_ca'/>";
private _actionText = _stringText + _stringImg;
private _action = _this addAction [_actionText, {
params ["_target", "_caller"];
_caller setDamage 0;
hint format ["%1 HEALED!", name _caller];
}, [], 1, true, true, "", "_this distance _target <= 3"];
};
```into init filed ^ of your object
@tough abyss
Thanks sldt1ck!
the second question I had was to create a container that deletes all of the contents inside at regular intervals (every 300 seconds), in LAN/multiplayer.
need sort of a 'trash disposer' for unwanted loot
Sorry i'm asking around so much
Hey commy2, I didn't get my things with scripted lobby to work, because I've mostly ran things in a way that I know I can use postInit and stuff like that. So for scripted lobby, I'll have to rewrite a lot of things/start from scratch
@thorn saffron Script not config:
// init.sqf
["unit", {
params ["_new", "_old"];
_new setAnimSpeedCoef 1.125;
_old setAnimSpeedCoef 1;
}, true] call CBA_fnc_addPlayerEventHandler;
This way it works even when switching units, and it resets when you switch away from an old unit.
I see, nigel. Lobby would be definitely something you start with when creating a mission.
Yeah. I'll probably try it out for a simpler game mode. It's cool, but yeah, it has to be built from ground with scripted lobby in mind
@little eagle I wanted to everyone have faster movement, player and AI, all the time. It just feels better with slightly faster animations
Is there is no way to split a string using splitString with a keyword, instead of separate characters? Seeming on the wiki (https://community.bistudio.com/wiki/splitString) it says 'delimiters: String - one or more characters, each used as a separate delimiter.'. Is there any type of way around this, like using a specific syntax? Seeming I'm trying to split a string in half but only at the word "CONTROL".
if you want to split only once you can use a custom script with select and find
That is very true, idk why I didn't think of that. Thank's I'll play around with it ๐
Hi guys sorry to bring this back up but the first time round did not seem to fix the issue
the original post mentioned say3D and one of the members sent back a new line of code that was meant to help play the sound for all players on the server, but did not seem to work: here is the original and revised code:
/*
this addAction [ "Tornado Warning", {
S1 say3D ["siren", 3000, 1];
S2 say3D ["siren", 3000, 1];
S3 say3D ["siren", 3000, 1];
S4 say3D ["siren", 3000, 1];
S5 say3D ["siren", 3000, 1];
} ]
*/
action_id = this addAction ["Tornado Warning", {
{[_x, ["siren", 3000, 1]] remoteExec ["say3D"]} forEach [S1, S2, S3, S4, S5];
}];
how does it not work?
Is the sound only playing for the one that executed the action?
yeah only the player to execute the addaction hears the audio not everyone
not worried about JIP as everyone should be on the server before the audio plays anyway
the code looks correct to me
as a total noob at this am i required to keep in whats between the /* */ ?
i thought so
i saw mentioned playsound3D should be used but i believe it uses a different syntax, could this be the issue or should say3D still work?
say3D should definitely work. with the remoteExec it's executed on every player. And not just the one that executed the action
Only thing I can think of is if the objects were created locally by the executing player, and thus aren't AG. Otherwise it looks right.
extended eventhandlers work the same way for addons and mission config?
ye
Ohh hot damn
I thought for some reason they would not work like the same way.
Btw is there any macro decompiler other than loading into arma and saving a function as a variable (like cfgFunctions)
Using macros saves all the newlines from text editors or sth
Are there perhaps any tools that will run all the macro stuff when making the .pbo ?
macro decompiler What? You mean preprocessor out of arma?
keep in mind, GCC is not compatible fully with ArmA
And that on your screenshot is a preprocessor bug. Happens if you have a #include after a block comment which ACE and CBA do everywhere
"bug" ๐
pretty much the whole pre processor of ArmA can be considered a bug ...
that thing has more flaws then anything else
if it doesn't crash it means the prepro worked fine huehuehuehue
"oh god an error" proceed to shit itself - arma preprocessor
you also can just to string.replace(macro, expression) and it would work
does not means it would be a good idea to name it preprocessor
for some worse example flaws in the arma PP, try to nest #ifdef
if it still behaves as it does back when i tried to do this, you will get an empty file
Ohh, so include before the comment @still forum ?
ye
okay thanks
didn't know that
Also @little eagle I figure the best way to do scripted lobby is to have 1 postInit scripts that run when player joins the game.
And gameInit or sth like that which run when player clicks ok on the lobby and gets in the game
I think ace should work fine 'tho
@thorn saffron I see. I don't like midnights solution, because the respawn eventhandler triggers only locally, but the init globally. It would be wonky for remote respawned objects when they change locality. Unlikely, but you know.
class Extended_InitPost_EventHandlers {
class CaManBase {
commy_faster_movement = "\
params ['_unit'];\
_unit setAnimSpeedCoef 1.125;\
_unit addEventHandler ['Respawn', {\
params ['_unit'];\
[_unit, {_this setAnimSpeedCoef 1.125}] remoteExec ['call'];\
}];\
";
};
};
For a quick fix I made it so all my postInit functions get re-run, when player joins a slot from scripted lobby
But still, it's better to avoid issues just if I rewrite the postInit stuff into joinGame or sth
I've got a bit of a tricky challenge and need some advice; I'm trying to detect whether a helicopter (ideally this should work for any helicopter) is resting on the ground - by which I mean the landing wheels (or landing skids) have made contact with the terrain
my current approach is to iterate through selectionNames to determine which selections represent the wheels or the skids, in the hope that I could later on do a simple raycast to the ground to determine if the wheel/skid is touching it
(getPosATL helicopter select 2) < 0.2
however... wheel naming conventions aren't standardised, and skids don't show as selections
oh, I've tried the getPosATL method before, the thing is the threshold altitude depends on the model center's position
on some helicopters, 0.1-0.2 is fine, whereas others need up to a full meter
okey. There was some other getPos that returned the ground contact point height I think
@little eagle you know things
I was googling for that but the only mention of landContact (which I assume could be useful here) was as a parameter for selectionPosition, which isn't what I need
I'll admit this is a rather... tricky issue, which probably doesn't have a solution that covers all situations - but one can hope ๐
That would work if you know the name of the selection in the landContact lod
right, that was my thought, but I didn't get much further than that since I don't know the name of the selection for each helicopter
otherwise you probably could use the bounding box. If the lowest bounding box point is at ground level or below.. then.. on ground
hmm, that's a good idea
I'll see how that holds up
I was already doing some stuff with the bounding box to approximate the inertia for each axis of the helicopter, but the results were quite a bit off, so here's hoping this will do
if the bounding box is too big it might have the same issue as getPosATL
somehow I have a feeling that will be the case for retractable-wheel helicopters
since the wheel selections will be moving out of the initial bounding box (unless the model already has the gear lowered)
anyway, I'll give this a test, bbl
well, it works when the helicopter lands with all wheels touching the ground (or skids aligned to terrain), but if I'm hovering with, let's say the front wheels of a Ghost Hawk on a slight slope, the offset from the model center is enough to throw the altitude off by half a meter
even though I'm technically touching the ground
while this would probably not be dramatic for most applications, it's unfortunately not good enough for my use case... ๐
eh, I'll come up with something
isTouchingGround ๐ค
๐ค ๐คฆ
๐คท
Also useful when an AI car gets itself flipped over
commy breaking in
He's taking his time
throws paper
http://www.paperonline.org/ There. Have paper.
Paper is simply amazing!
Use less paper, save the world's forests!
@half inlet @still forum
oh, I've tried the getPosATL method before, the thing is the threshold altitude depends on the model center's position
This is badly worded. getPosATL reports as z the distance from the terrain at model center and the land contact LOD (not the model center). This would only be an issue with tilted objects...
That would work if you know the name of the selection in the landContact lod
right, that was my thought, but I didn't get much further than that since I don't know the name of the selection for each helicopter
There is no selections in the land contact LOD and there is no command to report points from that LOD. You're thinking of the Memory LOD and memory points. These are not memory points and cannot be retrieved with selectionPosition.
well, it works when the helicopter lands with all wheels touching the ground (or skids aligned to terrain), but if I'm hovering with, let's say the front wheels of a Ghost Hawk on a slight slope, the offset from the model center is enough to throw the altitude off by half a meter
Ah, so the problem is tilted objects specifically.
Can this wait approximately 2 weeks? Because I'd like to try a potential solution I have on a machine that can run Arma, and I will only have access to one in 12 days.
cannot be retrieved with selectionPosition.
Why does wiki list landContact lod as an example for selectionPosition then
Oh that optional parameter. Just sucks that there are no selections in that LOD to read.
@little eagle https://github.com/CBATeam/CBA_A3/pull/937 The road to correct error messages and debugability has begun!
Great idea to fix error messages after everything is written.
But atleast we can debug the scripts now. The VS Code debugger plugin is getting close
@little eagle sure, but I wouldn't worry about it if I were you, as the issue has already been resolved (via the isTouchingGround command, the existence of which I was not aware of ๐ )
that command does return true if even just one wheel is touching the ground, and it also works in slopes, which is precisely what I needed
@half inlet isTouchingGrouhnd has worked for me with a helicopter - I assume you read the notes about how it may not be trustworthy in some cases, like roof landings.
yeah, I've read those, but I probably won't be using it for roof landings
I'm using it to counteract a hardcoded AI behaviour where the helicopter pilot will reset its controls once the helicopter touches ground (even when the pilot is unconscious!), and it seems this also triggers on isTouchingGround
so I'm not bothered
Reset its controls?
I'm working on a very niche feature where I'm trying to override a lot of hardcoded AI behaviours
one of them is that when a helicopter pilot passes out (_unit setUnconscious true), his input controls will remain in whatever state they were in the moment he fell unconscious
until the helicopter touches ground, at which point the controls revert to 0
primarily, this affects the yaw input
Oh, so if he (AI algorithm) has full left pedal on and goes unconscious, the helicopter will keep spinning (receiving full left pedal input) until it hits ground?
exactly
Is that also the case if you disable sim enableSimulation false on the pilot?
I've already tackled that by making a yaw trim gauge that allows me to override his input, and achieve near-perfect zero input ๐
tbf, I don't know, because I don't want to use too many commands on the AI so as to prevent other features/mod interactions from breaking
I've already established that none of the disableAI parameters affect the flying AI behaviour, so I've decided to simply override the helicopter's motion entirely
Interesting. Having fought with the boat AI, I am sympathetic to anyone trying to outfox the AI.
oh, I've already achieved some fantastic results, let me tell you that ๐
I will definitely be posting a video once everything is fully functional
the results should be very immersive from an observer's perspective
Cool. I was disappointed that I could not control the specific impulses. I could take over the whole boat motion with setVelocity, but this had some issues in that it was jerky compared to the smooth movement of the AI (at 120Hz), even done each frame, and had to be done every other frame when changing direction with setDir. I would have much rather had scripting commands where I could say 'steering x to the left/right', 'increasing engine thrust', etc.
Basically playing the AI into the boat controls.
Sounds like you may have accomplished something like that with the helicopter if you are able to create yaw counteraction.
Also, setVelocity did not wave follow.
It would be a real bad day for passengers if the waves were whipped up. ๐
because setVelocity, as the name implies, sets the velocity, and thus completely overrides any external forces that may apply on it
Oooh. I'll have to take a look at those. I searched all kinds of keywords like thrust, rpm, engine, etc.
you should instead use forces and torque, that way you're playing on the same level as all other external forces that apply on your boat
Yes, totally understand. Thanks for the tip!
they're fairly new (ish), I would have used them sooner but I only came across them a couple months ago myself
I basically concluded that after I did everything with setVelocity, I had recreated the Keyframe Animation modules in EDEN. ๐ฆ
also, for someone like me who's coming from sandbox environments like Garry's Mod, these two commands open ArmA up to an entire world of possibilities ๐
might be the same for you
last month I whipped up a script that reduced the gravity of the car I was driving, allowing me to ramp off of cliffs and get some serious air
addTorque is cool and all, but can anyone explain this image to me? https://community.bistudio.com/wiki/addTorque
๐ค ๐ค ๐ค
and right now I just realised I now have all the pieces I need to turn a car into, say, a glider
or a helicopter
hah, yeahhh the image is rather misleading
The only difference, though, was that Keyframe Animation did not trigger wake or engine noise and revving. Whereas setting velocity did. Which is somewhat interesting because that means setVelocity and Keyframe Animation use different mechanisms to actually move the object frame to frame. Also unitPlay/unitCapture worked fairly well (only single player and localhost multiplayer testing), and created wake, but didn't rev up the engine (could turn on for engine noise, but didn't follow effective speed). So that is yet a different interaction with the physics/effects/sound engine!
the way I'm seeing it is you gotta take a vector, fill in the X, Y and Z with what torque you want to be applied on each axis of your object, vectorModelToWorld that because addTorque takes world coordinates, and bam
suddenly you can control your object's angular velocity
Agree that addForce and addTorque are going to open up new possibilities for me.
if you then need to get the angular velocity, you gotta deduce it from its vectorUp and vectorDir, along with some vector maths
How is the image misleading and not just wrong? That circle says "counter clockwise", but it's clearly clockwise.
left hand rotational system...
tbf, I only glanced at it for a few seconds, before realising I'm better off doing a lot of trial and error to figure it out
it's not the "norm", but nothing is stopping anyone from defining it this way
Oh, wow... this is allowing us to tap directly into Physx, at least in limited form - regards the NVIDIA docs link.
Have experience of that from Unreal.
X3KJ, please explain how that changes the directions clocks turn.
the one thing I really need next is to get an object's inertia as a vector
maybe also a angularVelocity or velocityAng command
but even without that I can already do a lot
oh thats what you mean... well yeah that does not make much sense
Should I trust the arrows (left hand rotation) or the labeling as ccw (right hand rotation)?
i would trust ingame testing
Well, it's impossible to say looking at it from the horizontal. If you looked up from the bottom it would be counter clockwise. If the top, clockwise.
It's a bad doc then.
a faulty one at least
the image makes 'sense', if you assume that you look from COM along the vector. It just shows that "clockwise" has no place in 3 dimensional space
@half inlet I don't see any likely suspects for angular velocity. Guess it depends on what you are getting velocity of and relative to what. The inertia piece is interesting because you reminded me that Arma prominently advertises Physx and I wonder if the inertia is being calculated against air/water resistance for slowing things down rather than a custom inertia fade off. I note there is also a setMass, which combined with addForce and addTorque could enable differences in the behavior of an object's response to forces (applied or environmental).
inertia is a property of the object, which would help me determine how much torque I need to apply a desired amount of angular acceleration
the image makes 'sense', if you assume that you look from COM along the vector. It just shows that "clockwise" has no place in 3 dimensional space
But it does. There's the right hand rule for this. It's just that the arrows on the pic don't match ccw rotation with right hand rule, and neither do they with left hand rule.
basically it gives you an idea of how big the object is, and how the mass is spread out across it
It doesn't look like the engine allows us to reach as deep as the collision model though as the disableCollisionWith specifies it is about vehicle collision and specifically not access into the Physx collision model, but that's OK given that we don't need exotic collision rules in something trying to simulate reality.
I see that center of mass can be adjusted programmatically as well,.
Understood on inertia - torque -angular acceleration. Well, look forward to whatever you are coming up with.
@little eagle just as there are right hand rule systems there are left hand rule systems
I know, but then it still isn't ccw rotation.
Try it.
Use left hand.
Arrows match.
Still cw, not ccw
I see what you mean, you're right
the arrow directions make it look like a left-hand system, but then the text saying "counter-clockwise rotation" would be wrong
kinda sounds like a #firstworldproblems deal to me ๐
It's one of those problems that made the first world as good a place to live in it is in the first place though.
no it works if you look from underneath
I'd agree, but I'm afraid our local channel police is about to step in and whack us on the fingers with a virtual ruler before telling us to head over to #offtopic_politics
which is what i said, look from COM towards the tip (bottom)
so I'll see myself out
no it works if you look from underneath
"We only left hand thread screws, boss!"
"No problem. Screw them in from the bottom"
๐ค
even if that worked it'd still be wrong
see, the thing about this image is that the perspective we're given implies we're looking at a cube from slightly above, as if it was resting on a flat surface infront of us
at least that's what we can deduce from the dotted lines
with this in mind, the circle is located in a horizontal plane, while the arrow is pointing upwards ("towards the sky")
what's wrong with you people?
if we now look down on the circle from a vertical point of view (though we are already looking at it from slightly above, but at an angle) we'd see that the circle's arrow is in fact pointing clockwise
that graph is clear guys
I dunno, I'm probably overexplaining at this point
well, yes
^
but it's clear nonetheless
clearly wrong ๐
ctrl + a
whoever made it doesn't know what a clock is
shift + delete
but it's still clear :kappa:
Bohemian clocks turn backwards.
the author's lack of understanding on clocks is very clear, yes
I don't understand why you are so confused @little eagle because, given your Sisyphus icon, you should be used to looking up hill, not down, in which case it makes perfect sense.
I'll show myself out.
aaaaaaand I'm out of here aswell before the storm hits
can an array be set as listbox data? lbSetData [100, _index, _MYARRAY] ? or will it only store a string?
well it was going to be an array of strings
Would there be a way to export data regarding ongoing server events? Ex. A text file is made every 4-12 hours with who shot who, who damaged who, or who killed who.
Yeah that's possible
got it working with respawn templates ?
Is there a way to turn on a vehicle damage light in the upper left HUD (like ENG to red) without also getting the cracked windshield that occurs? Setting hitpoint damage of engine to 1 in M-900 results in cracked windshield, but just want light on, not the cracked windshield effect.
Anyone in here looking for paid work? Not sure if this is the right channel, but send me a friend request, I have a full design document if interested
I got a mission with the scripted lobby up andrunning
๐
Scripted lobby?
@frank mesa wrong channel. #creators_recruiting
Cheers mate just found it
Can some one give me some suport about ACE?
Going have to be a little bit more specific that than!!!
Its broad but seens like ACE disable/remove some of my missions event handles, i would like to know what are they and how I can stop it from happen
User placed event handles
What is a "User placed event handle"?
addEventHandler
It is plausible, there are a few unprotected calls to removeEventHandler in the ACE3 code (https://github.com/acemod/ACE3/search?q=removeEventHandler&unscoped_q=removeEventHandler), basically just potential bugs, but no removeAllEventHandlers that I can see
for exemple
_this addEventHandler ["HandleDamage",{
_returnDamage = (_this select 2);
if ((_this select 4) in ["B_45ACP_Ball","CSW_Taser_Ammo"] AND currentMuzzle (_this select 3) in ["hgun_Pistol_heavy_01_F","CSW_M26C"]) then
{
_returnDamage = 0;
if((_this select 3) distance (_this select 0) <= 10 AND !(captive (_this select 0)) AND Alive (_this select 0) AND isnil {(_this select 0) getVariable "Tased"}) then {null = [(_this select 0)] execVM "TaserEffect.sqf"};
if((_this select 3) distance (_this select 0) >= 10 OR captive (_this select 0)) then {(_this select 0) setskill ["courage", ((_this select 0) skill "courage")+(_this select 2)]};
};
if ((_this select 4) in ["","GrenadeHand","mini_Grenade","rhs_ammo_mk3a2","rhs_ammo_m84"]) then
{
_returnDamage = 0;
if ((_this select 2) >= 7 AND !(captive (_this select 0)) AND side (_this select 0) != west) then{
[(_this select 0)] spawn {
(_this select 0) call VoiceBanged;
(_this select 0) setUnconscious true;
sleep 2;
(_this select 0) setUnconscious false;
sleep 4;
if ((animationState (_this select 0)) in ["unconsciousfacedown","unconsciousrevivedefault","unconsciousfaceright","unconsciousfaceleft","unconsciousfaceup"]) then {
[(_this select 0), "AinjPpneMstpSnonWnonDnon_rolltofront"] remoteExec ["switchmove", 0];
sleep 1;
[(_this select 0), "amovppnemstpsnonwnondnon"] remoteExec ["switchmove", 0]};
};
};
};
_returnDamage;
}];
this event handle is supouse to remove the granade damage and make the unit Unconscious, it works in vanila but not in ACE
also that pistol damage
that event handle is added when the unit is created
They don't remove it. The medical system overwrites your HandleDamage
only HandleDamage.
when that is added?
They both run and ACE applies its damage. If you want your own medical system then remove ACEs.
Yes, that what i am asking for people playing my missions, but they still insist
When ACE medical was added? January 2015. And even then it was only a port of CSE medical
for reference. ACE in general was created 8 days before medical was added
addons/medical/functions/fnc_handleInit.sqf line 20 shows them adding the HandleDamage event handler
In the past one way we dealt with specific issues we had with medical was just to open the PBO and edit the one or two files we had issues with and maintained patches that way. Saved us having to set up an ACE branch and build. PBO Manager can do the extract and reinsertion of the files.
Maybe add a delay i can override ACE medical?
yeah. If you execute your code one frame later that could work
But.. If you are trying to prevent the unit from being killed. Then that code won't help much if it's executed after the unit is already dead
what?
ACE will happily kill your unit in its handleDamage event handler so the only way to stop that happening is not use it all. You likely need to do substantial changes to the handleDamage of ACE/medical if you wish to use its other features while maintaining your own damage routines.
It is to prevent the unit from take damage from the granade
Both event handlers are going to run, yours stops grenade damage happening, ACE applies it. ACE kills your unit. Only really two options - don't use ACE medical or modify ACE medical so it doesn't do damage in the same way your mod doesn't. Variety of ways to do the later.
so how i can just remove that ACE event handle?
How do HandleDamage eventhandlers take effect? Does only the damage value of the last eventhandler apply and all prior ones are ignored? If so. Just add your EH last.
Now i tested, adding a 3 second delay does add my event handle and its effect, but ACE still enable its damage
How i can then remove the defaul ACE EHs?
You can't remove the EH after it was added
] BrightCandle: addons/medical/functions/fnc_handleInit.sqf line 20 shows them adding the HandleDamage event handler
You have to prevent the init EH from being added which.... You can't.
So change the init so handleDamage never gets added?
Without modifying the ACE medical pbo
Or don't run ACE medical, options haven't changed in the past 10 minutes ๐
I already asked them to give EH's handles even though they don't need them internally. But they didn't want because they don't want people to mess with it. And I understand that.
Although from https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HandleDamage it says "Multiple "HandleDamage" event handlers can be added to the same unit. If multiple EHs return damage value for custom damage handling, only last returned value will be considered by the engine."
Yeah ^ Exactly what I asked about
Make your mod dependent on ACE and you should get initialised later and thus later in the handler list and executed last?
adding the "init" eh in init/postInit instead of preInit like ACE does should be enough
So we are thinking about using "floating" camera for Liberation build system (instead of current system where item is placed in front of player) . Would it be feasible to integrate Zeus into our resource system or would it be better to write it from scratch?
so what i can do?
Well, I had to do that with brutal forรงe
sleep 3;
_this removeAllEventHandlers "killed";
_this removeAllEventHandlers "Hit";
_this removeAllEventHandlers "HitPart";
_this removeAllEventHandlers "HandleDamage";
_this removeAllEventHandlers "Dammaged";
_this removeAllEventHandlers "Explosion";
_this removeAllEventHandlers "MPHit";
Now my EH are working.
have you tried running tha on next frame instead of a 3 second delay?
Hi there, is there a way to remove specific items from Zeus that won't remove an entire add-on? I need to remove the exec module from the Achilles mod but not really sure how to.
I do know about removeCuratorAddon but it removes all the modules
@brave jungle see at the bottom
https://github.com/astruyk/Ares/wiki/Extras
I'll take a look
Freiheit
I think I understand that models consist of object geometry (.p3d), textures (.paa), and materials (.rvmat). There are two stories as to how damage appears (like cracked windshield on helicopter after being fired at). One is that there are three materials (_base, _damaged, _destroyed) and one is selected based on damage value of something (not clear here on why windshield cracks when engine is destroyed, for example). The other theory from @austere hawk is that there are detail maps (*_dt.paa) that are overlaid over the main texture.
My question regards scripting is is there any way to get access and control the textures and materials through SQF? getObjectTextures and getObjectMaterials seem to return only one texture (the skin texture) and no material as when called on an object like a helicopter. Is there a way to drill down into sub-components of the model and modify textures and materials of individual parts of a vehicle from script?
getObjectTextures and getObjectMaterials seem to return only one texture (the skin texture)
xMaterial reports the material, not a texture. Though the material technically contains textures I guess, e.g. the detail map.
My question regards scripting is is there any way to get access and control the textures and materials through SQF?
You can read the Wounds or Damage class from config and together with the damage of the selection, you can deduct which material is supposed to be shown at the moment. But no direct way.
Is there a way to drill down into sub-components of the model and modify textures and materials of individual parts of a vehicle from script?
No, there isn't, except from setHit(PointDamage). Give up now, tried before many many times.
This is what a material file looks like: https://git.koffeinflummi.de/bwmod-team/bwa3-public/blob/master/bwa3_eagle/data/bwa3_eagle.rvmat
nohq = normal ("high quality")
dt = detail texture
mc = mosaic texture
as = ambient shadow
smdi = forgot this one...
ti = thermal imaging
https://git.koffeinflummi.de/bwmod-team/bwa3-public/blob/master/bwa3_eagle/CfgVehicles.hpp#L263-287
This is how the game figures out which material to replace with which one.
@comm2 thanks - sorry, I meant getObjectTextures returns a texture (like ["a3\air_f\heli_light_01\data\skins\heli_light_01_ext_sheriff_co.paa"]), `getObjectMaterial just returns an array with empty string ("").
But I hear what you are saying. My annoyance is that setting certain things like avionics or engine damage up close to 1 results in the windshield looking cracked. It feels like it should be possible to have a broken engine, but clear windshield.
NORMAL, DAMAGED, REALLY_DAMAGED
Always N*3 groups.
My annoyance is that setting certain things like avionics or engine damage up close to 1 results in the windshield looking cracked. It feels like it should be possible to have a broken engine, but clear windshield.
That sounds weird. Sure the glass isn't damaged as well?
Yes. Try this on, say, an M-900 helicopter global var "heli":
heli setHitPointDamage ["hitengine", 1, false]; diag_log getAllHitPointsDamage heli;
The whole helicopter then looks like it was put through a blender, but the only damage showing in the hit points list is the engine at 1, everything else 0.
Even with true or just: heli setHitPointDamage ["hitengine", 1];
heli setHitPointDamage ["HitEngine1", 1];
heli setHitPointDamage ["HitEngine2", 1];
heli setHitPointDamage ["HitEngine3", 1];
heli setHitPointDamage ["HitEngine4", 1];
And this?
Well, that is interesting, because it sets the of the first 3 (the M-900 doesn't have a "HitEngine4" hitpoint) to 1 in the getAllHitPointsDamage list... and the helicopter shows no damage... but the engine is still functional and can be turned on (the gauges don't show ENG as red either).
Then I'm out of ideas.
Well.
Do you know which HitGlassN controls the windscreen?
heli setHitPointDamage ["HitEngine", 1];
heli setHitPointDamage ["HitGlass1", 1];
heli setHitPointDamage ["HitGlass1", 0];
Just not sure "HitGlass1" is the right one.
@little eagle "HitGlass1" and "HitGlass2" control the left and right hand side of the winshield. Setting either to 1 gets the effect on just that part. However, they stay 0 when "HItEngine" is set to 1, but they are still cracked. In fact, the whole helicopter goes into full damage appearance- body, rotor, etc. Even though everything but the engine hitpoint is at 0 damage.
https://community.bistudio.com/wiki/BIS_fnc_dynamicText
This command depends on the players interface size, is there a way to fix that so its fits to any size?
I use safeZoneX + safeZoneW
I think it's always full screen from safezone x to safezonex+safezonew
any exemple?
This menu is always the same proportion of my screen
No matter if I use small or large
It will always take up for ex. 30% of the screen
I mean, the script
x = GUI_GRID_X + (20 * GUI_GRID_W);
y = GUI_GRID_Y + (2 * GUI_GRID_H);
w = 19 * GUI_GRID_W;
h = 21 * GUI_GRID_H;
GUI_GRID_X = safezoneX;
GUI_GRID_W = (safezoneX + safezoneW)/40;
so x is always in the middle of the screen
As you can see from the image
_timeToMinutes = [_timer, "MM:SS"] call BIS_fnc_secondsToString;
_TimeLeft = format ["<t color='#ff0000' size = '.8' font='PuristaBold'>Hostages Will Be killed in:<br /><t font='LCD14'>%1</t>",_timeToMinutes];
[_TimeLeft,-0.99,-0.1,2,0,0,789] remoteExec ["BIS_fnc_dynamicText",[0,-2]select isDedicated, true];
how should i fit it?
I've been trying to find a script for me to allow cops to keep their gear after they die
@astral tendon You can create your own display and control or resource and do it
[_TimeLeft,(safeZoneX-0.2),(safeZoneY+0.4),2,0,0,789] remoteExec ["BIS_fnc_dynamicText",[0,-2]select isDedicated, true];
I come up with this
display and control or resource and do it
No idea what that is.
if you do -0.2 and +0.4
That won't work
Because depending on the screen the size is different
You have to calculate the size of the screen and get it inside of that
Since you guys are talking about positioning displays on screen, is there a way to do positioning such that a display or control would always align with the vehicle info cluster in the upper right that shows HULL, ENG, etc.? For example, if you wanted to add another indicator there that would look like it is part of that vehicle info cluster?
@dry zephyr check into UI_F pbo
I remember I resized the pip window before that was possible
But you need to do some tricky shit, and only if the ui element is defined there
If you can find the ui element in the game files, you can modify it, but I don't know exactly how. But that's a start
@peak plover - thanks, I was thinking of doing it via script, but you are right - people could have that turned off and if you started adding icons by overlaying with a display or control, it could look funny
@dry zephyr why is the "other theory" my theory ? Detail maps are overlaid over diffuse map yes, thats no theory. How do you define detail maps? By rvmat... which is where the 3 rvmats come into play (they can do more than just adding detail maps...)
@austere hawk referring to your post here https://forums.bohemia.net/forums/topic/188395-damage-textures-and-hiddenselections/ is where I got the *_dt.paa information from.
But the other information I have from places like here http://ram.wikia.com/wiki/Modding_Tutorials/Damage_Texture_Swap and commy2's
post above describe a system of three materials with different ending names like _base _damaged _destroyed.
there is no "other information". It all refers to the same system. I just didnt go at length to explain everything in that post
I guess my confusion is that a a *_dt.paa would be a fixed texture, not a material. If the damage appearance is based on choosing between three different materials specified for a part of the model based on the hit point damage value, what is the role of the detail map?
you can apply a dt map with an rvmat. There is no other way to do it
Ah, ok, think I understand now...
You are saying that it chooses one of the .rvmat materials - that .rvmat may choose to use a texture as part of its material calculations.
In which case, it could use one of the *_dt.paa textures in its internal config/logic.
if you look at a regular rvmat for a standard model with supershader (e.g. vehicle or handweapon) you see that rvmat has several stages. _SMDI (specular/gloss), NOHQ (normal), AS (ambient occlusion map) beeing primary one. But also option for DT and MC map (detail and macro). You swap material, so you can change any of those textures for a different one, or change it's appearance.
@austere hawk thanks, understood. Just wish I could change materials on the fly with scripting commands.
@dry zephyr Then there's nothing you can do about this.
@peak plover WORKING AS INTENDED*
yo server is a player too ๐
@little eagle, actually I found you can change the textures (and materials?) with scripting commands BUT it depends on the how the model is created. Specifically, if the model was created with hidden selections, you can change the texture (and material?) with setObjectTexture. For example, this changes the color of the everything on the exterior except the rotors and windows, and exhaust vent to red on an M-900:
heli setObjectTexture [0, "#(rgb,8,8,3)color(1,0,0,1)"];
Unfortunately, that is the only exposed hidden selection I've found on the M-900. However, a model better designed for scripting changes could I suppose allow changes of just about anything.
What's interesting is that damage effects still overlay the texture after you change it (like bullet holes still show after changing the helicopter to red). I'm guessing that is a material being applied over the texture and we might be able to change that with setObjectMaterial with an .rvmat file handy as that function wants a file path to an .rvmat file.
As for the rotors, windows, exhaust vent, I'm guessing those are defined internally as part of the model, have their own textures and materials listed for base/damaged/destroyed, and aren't exposed as hidden selections, so we have no way to change them from scripting.
@dry zephyr setObjectMaterial works properly only with materials that are predefined on the particular .p3d so it does not work well with just any custom rvmat.
also yes to what you wrote about parts that do not have hiddenselections
I told you to give up hours ago.
You could've watched a movie instead. Or gone out for dinner. Played a game, listened to music.
But nooo, you had to try.
@young current understood - I'm guesing some materials might work ok because they don't have maps or anything conforming to the model (really simple ones), but in general, if the material isn't designed for the model or part of the model, it's going to look awful.
yes I would advice against such actions
color you can already change with just textures
I dont really see why you would even want to touch the actual material
@little eagle if I had given up, I wouldn't have learned that changing model appearance from scripting is in fact possible, just within certain limitations, particularly with included models from BI that you can't get access to to make modifications to the hidden selection list, but with a community model or your own model, you could actually do a fair amount from scripting. I'd like more hidden selections on the included model like the M-900, but I think it's a fair balance since Arma isn't a general purpose game engine.
There is no reason not to be able to change all textures on the fly except lazy programming.
Is there a way to start Zeus in a mission where there is no curator module palced?
No, it's not. Obviously.
_test = "stuff";
{systemChat _test} remoteExec ["call",0];
How to send a local variable to the remoteExec?
private _test = "stuff";
[[_test], {
params ["_test"];
systemChat _test;
}] remoteExec ["call"];
because it's safer, faster and doesn't hurt
Why not private?
Is this supposed to be funny? Should I laugh?
Laughs in portuguese-BR
Hilarious
How can I improve the distance of the police siren
custom air horn kit with high psi pressure switch and bigger air tank... should work
what ?
your question is the same as "how i can make this better" ? i mean... people should somehow guess what you doing there and what is your problem
@little eagle Your point on not being able to change all textures on a model is lazy programming because all you really have to do to enable changing textures and materials on the fly is add a hidden sections block to your model class for named sections you must have created to apply different textures to certain parts of the model?
So if you call "backpackItems player" and there are other backpacks in the backpack it returns empty. Anyone know a fix for this?
ok ty
Hello, so, I have the following to revive all players using Arma revive system:
{ ["#rev", 1, _x] remoteExecCall ["BIS_fnc_reviveOnState", _x]; } forEach allPlayers;
However, and I've been toiling at this .. what do I do so it only revives a single player, likely the target player? I do have Target Debug. I've tried mangling it but .. it gets mangled.
you tried mangling it and it get's mangled?... Isn't mangling a bad thing? Why are you doing that?
For targetDebug you would ["#rev", 1, player] call BIS_fnc_reviveOnState via the Target Debug button (That's CBA btw)
Haha, when I meant mangling, I meant messing with the settings - I don't understand ALL of the settings.
Because I'm VERRRYYY new to coding.
Thank you very much for the help! I see that _x was a problem and the execcall was just unnecessary.
remoteExec does what it says. Execute something remotely.
But target debug automatically executes the script remotely already
Ahah! See, I didn't even know that! haha
Hey, Does anyone know of a script that can notify other players when your in range of them for PvP?
hmm, reading through the last couple posts here in #arma3_scripting I just realised you can put backpacks into backpacks, or uniforms into uniforms... or vests into vests... or anything into any other thing, really
what's more amazing is that containers are objects, and can still be accessed while they're inside another container
so I just realised it would be theoretically possible to move every item in an inventory into its own dummy container, allowing you to access each item individually - something I've been looking to achieve for over a year
ignoring the fact that you'd break a lot of things in the process (primarily engine-side interactions like first aid kits, magazines, grenades, etc.), this could turn out really useful for full conversion mods that want to make their own HUD and inventory system
dang, the implications of this are... considerable, imo
So we have an excel spreadsheet which we plug in some numbers and it returns a set of values based on some lookup tables essentially. Talking at most a couple of thousand rows of values.
For immersion reasons I'd like to add this into game as a dialog/tablet style interaction. A) is this viable from a "not killing performance" PoV and b) something that anyone can advise a better way of accomplishing?
it can be done, but you will have to create the function for every "input" you need
i dont know if this would be a performance killer, as its only a dialog...
I'm imagining that the lookup tables will need to be read into the memory, as arrays. And then looped through in sequence to find the one we are looking for.
Has anyone used the table control type (https://community.bistudio.com/wiki/DialogControls-ControlsTable )? It's only creating the first column for me, as if the row templates aren't applied or something
@peak epoch I looked at it once when it first came out, but gave up and went back to the manual RscControlsGroup approach.
What is your lastIDC set to?
i think i was using the wiki example, firstIDC = 42000; lastIDC = 44999;
That is a lot of columns
Not sure if that has to be precise or not... Can you have higher IDC for more columns but have amount that isn't ^^
@worldly locust if you're iterating through a lookup table, you're doing something wrong ๐
I've no clue what you're going to use your lookup table for, but if you want to be able to fetch some data via a key in ArmA, why not do so via a config entry?
class SomeLookUpTable {
thing1 = 0.1337;
thing2 = 42;
thing3 = "hello world";
// etc...
};```
Why are you iterating through a lookup table? You should be using a lookup table! :D
What?
@half inlet because such a thing is horribly slow
you could cache all that into eg. a location at mission start and use get-/setVariable on it
wasn't aware parsing configs is much slower than parsing variables from a namespace, but sure, that works too
not parsing
I was just answering to his last message: I'm imagining that the lookup tables will need to be read into the memory, as arrays. And then looped through in sequence to find the one we are looking for.
using the commands
the "looped through in a sequence" part had me confused, since he's trying to go for a lookup table (in which case you don't need to loop through anything)
there are moments you may want to loop through a map though ..
when you want to output all pairs for example
considering he want's to show a excel table ingame.. That's probably what he's trying to do
excel but in arma? that will go horribly wrong probably
though ... depends on the stlying
should actually be possible Oo
well, in that case setVariable is probably the best solution
still, excel could be done in ArmA
- editing
even functions could be done in arma
though ... i would just go straigth onto =SQFEXPRESSION
Sorry. I was unhelpfully vague.
I have 3 sheets of lookup tables. Based on user input we have to perform calculations to determine which row is correct on each table. It's not as simple as find x in the table.
can you give us an example of said calculations and what your data looks like?
Around 12 columns. Integers and decimals. It's a mortar calculator
From that it does a 9 step formula to get to a "this is the charge, elevation and bearing you need"
Obviously user has to enter in mortar position, target position, wind speed, direction etc.
@worldly locust Given that unitCapture/unitPlay is a thing (generates a lot of data), I think you'd be fine. You need an array of arrays [[row1a, row1b],[row2a,row2b]] Export from excel in CSV with quoted values, run it through something to add [ and ] at beginning and end of each line plus add [ and ] at start and end of file. Copy this into init.sqf in new mission for testing and assign it to a global variable. Then write your functions to take input and search through this array for the info you need to do the calcs. Present the results.
Optimize where it appears, privatize, and potentially compile into function(s) later.
Cheers. That's kind of what I expected. Will have a play about.
@worldly locust If you are willing to share the pattern (not the data or your custom calcs), let me know how it turns out as that could be a handy snippet to have around.
Once I figure it out sure.
ARMA 3 or Arma 3 (never "ArmA")
Check literally all official material.
Nowhere does it say "ArmA", except maybe on fanpages that are, surprise, wrong.
the launcher^
Someone explain to me what this has to do with scripting. Or indeed anything at all.
start the launcher and check the bottom of the dashboard page
they've infiltrated us commy
Reddog, in and find are case sensitive, obviously.
letter casing is my personal hellhole
@small iron ArmA 1 was called that. Since then it changed. So unless you're talking actually about ArmA. It's wrong. And talk about ArmA belongs to #end_of_life_arma
I c
``player addEventHandler ["InventoryOpened", {
params ["_container","_unit","_containerr"];
_unit = _this select 0;
_container = _this select 1;
hint format ["%1",_container];
}];``
but
``player addEventHandler ["InventoryOpened", {
params ["_container","_unit","_containerr"];
_unit = _this select 0;
_container = _this select 1;
_containerr = _container select 0;
hint format ["%1",_containerr];
}];``
don't working
where is problem ?
What is supposed to be happening that's not working?
Wait.. You pasted the same code twice. One.. Wait.. Wtf are you doing
why are you trying to read the parameters twice
And what is _container select 0 supposed to do? select doesn't work on objects
Please quote code correctly
```sqf
<code here>
```
player addEventHandler ["InventoryOpened", {
params ["_container","_unit","_containerr"];
hint format ["%1",_containerr];
}];
Are you trying to do that? Or what are you trying to do? I can't read your mind
Also why format even?
player addEventHandler ["InventoryOpened", {
params ["_container","_unit","_containerr"];
hint str _containerr;
}];
Is it possible to change visibility of items in 3den menu while in the editor? aka bypassing config scope entry?
specifically modules\cfgvehicles
๐ค
No
hi, please can someone spot the syntax error?
[EB_supportradio, [("<t color='#bbccbc'>" + "Daylight Lumes" + "</t>"), {"actions\fnc_call_lumes.sqf",0,20,true,true,"","true",2}]] remoteExec ["addAction"];
the first 0 is the param i wish to send to the script
adding this to the object in editor works fine.
ac1 = this addaction [("<t color='#bbccbc'>" + "Daylight Lumes" + "</t>"), "actions\fnc_call_lumes.sqf",0,20,true,true,"","true",2]
Can't see anything wrong
not used remote Exec much before
parameters to remoteExec are correct
Maybe addAction is just not remoteExec whitelisted?
might the yarrive differently? i.e. not _this select 3?
server/client RPT should be telling you if that's the case
according to wiki it's parameter 3
The action is added?
this select 3 works with the second case above
but for the remoteExec. Does the action actually appear?
yes, i see the action but nothing happens when selecting it