#arma3_scripting
1 messages · Page 464 of 1
how do you retrieve the object?
with nearobjects
nearestObjects
client get an array that is correct
and server gets the same array but with null objects
what are the parameters you give to it?
same amount of items
(nearestObjects [[6646.56,6531.62,0.00143909], ["Land_sema1a", "Land_sema2a", "Land_sema3a", "Land_sema4a"], 500]);
@digital jacinth I implemented your Not printed because too long. Set variable '_debug_dumpFullArrays' to dump force printing.
nice
so i will just run your program alongside arma? So far i have not tried it out.
But last time it tried to print CfgFunctions init.. My game froze for like 3 minutes and then I aborted 😄
as on no real need so far
It's a mod. you load it like any other mod
ah, guess i need to ask my group admins to add a key then
Do you have TFAR? 0.9.12?
acre
aww 😄
no sneaking in something 😉
😬
@minor lance different versions of the map could be.. no.. Then it wouldn't return any objects.. null objects doesn't make sense. null means they don't exist anymore. and nearestObjects shouldn't be able to find stuff that doesn't exist.
yep it was that
I updated my map locally and not in the server
that usually happen in clients. When clients hhave different versiosn of a map, thay dont see animations correctly (Doors, etc)
https://cdn.discordapp.com/attachments/451451698947424268/453237325791625226/ArmaDebugEngine.zip here is the callstack dump on script error debugger mod thingymabob.
Have fun o7
jup
If you get a message about non-working stuff at Arma start then.... Everything is working 😄
https://i.imgur.com/Ujxw5x2.png ah yes, that seems to work
yeah. That's one of the two non-working error messages that are trying to tell you that everything is fine
They are also telling you that this mod has been made by me. Other people would probably fix that stuff 😄
I have another trouble... sorry hahaha
"Land_LampStreet_small_F",
"LampStreet_F",
"Land_LampSolar_F",
"Land_LampShabby_F",
"Land_LampAirport_F",
"Lamps_Base_F",
"PowerLines_base_F",
"LampDecor_F",
"LampHalogen_F",
"Land_LampHarbour_F",
"Land_objetivohabby_F",
"Land_NavigLight",
"Land_runway_edgelight",
"PowerPoleWooden_L_F",
"Lamps_Base_F",
"Land_LampStreet_F",
"Land_LampDecor_F",
"Land_LampHalogen_F",
"Land_PowerPoleWooden_L_F",
"Land_runway_edgelight_blue_F",
"Land_Flush_Light_green_F",
"Land_Flush_Light_red_F",
"Land_Flush_Light_yellow_F",
"Land_Runway_PAPI",
"Land_Runway_PAPI_2",
"Land_Runway_PAPI_3",
"Land_Runway_PAPI_4",
"Land_fs_roof_F",
"Land_fs_sign_F"
];
elec_farolas = nearestObjects [[worldSize / 2, worldsize / 2, 0], _tipos, worldsize]; ```
Having this array withh near 3000 objects
server does nothing and client does with this code
_x setHit ["light_1_hitpoint", 0.92];
_x setHit ["light_2_hitpoint", 0.92];
_x setHit ["light_3_hitpoint", 0.92];
_x setHit ["light_4_hitpoint", 0.92];
_x setHit ["light_5_hitpoint", 0.92];
_x setHit ["light_6_hitpoint", 0.92];
} foreach elec_farolas;```
any idea?
and both server and client arrays are 100% the same
hi all i am trying to set an alarm off to signify the end of a pop up target course. I have the targets stay down once hit until they are reset but would like an alarm to let player know they have hit them all (some are hidden in buildings) what I have tried...{_x setDamage 1; _x animate["terc", 1];} forEach (tgt1 + tgt2); ...ive tried different variables like "damage" & "getdamage" and ["tgt1" + "tgt2"] but still no joy. I am fairly new to scripting so pls forgive me if i'm well off? - any ideas how i could achieve this? thanks very much
I think this should do the work target animationPhase "terc"
{_x setDamage 1; _x animate["terc", 1];} forEach [tgt1,tgt2];
_targets = [target, target_1, target_2, target_3, target_4];
while {true} do {
_down = 0;
{
if (_x animationPhase "terc" isEqualTo 1) then {_down = _down + 1;}
} foreach _targets;
if (_down >= (count _targets)) exitwith {playsound "alarm"};
sleep 1;
};}```
@agile anchor Here you go, soryr i was doing some stuff
You need to put all targets in the array and the alarm would fire when all are down :p
@still forum thanks i'll try that & @minor lance does that script go in trigger activation box? thanks
For example, if you put it in the activation box it will check only when the trigger is activated
otherwise, you need to execute the code to start checking
@still forum that didn't work - thanks tho @minor lance so iput your script in the mission init so i loads straight away or in the trigger init so it waits for it? - sorry this scripting is a massive learning curve for me
Yep if you put that in the init it will inmediatly start checking if someone they are all down
if you want to restart it, just pasta the code inside the restartpart
If you put in the trigger, it will start checking when the trigger fires only, for example if your trigger is activated when a variable is equal to 1, if you put the variable to 1 it will start checking
@minor lance ok thnaks very much for your time i will give this a go
np!
@minor lance LEGEND! this works thanks you so much and for your time!
@gleaming cedar with UnitCapture and UnitPlay BIS functions?
I believe you would have to work the array itself
"Simple line of code"
🙄 , you will get nowhere with that mentality
And my statement still applies
you will get nowhere if you cannot learn how to do things on your own and not rely on premade BIS fncs
and when your idea isn't possible with BIS fncs (alone) you're stuck at ground zero
as a quick workaround, indeed use setAnimSpeedCoef before recording, then play and it should be fine
👍
Hey all, i wanted to ask, outside of the fuel parameter is there any way to get vehicle temperature and rpm? i know rpmRTD exists but am looking for universal rpm for vehicles and also if possible a temperature.
ugh im trying to make an AI vehicle with turret (SAW) chase the player but any time the turret wants to engage the driver stops. I need the vehicle to keep moving and firing at the same time...
i tried disableai autotarget, autocombat, set careless, use domove
car chase
yea mission, gonna force the players to follow a specific road
never used unitcapture il try it
lol k
anyone?
nope
why do people totally miss the concept of just asking your question instead of NEEDING to have someone reply to them every 5 seconds?
Someone willing to answer a question I have?
nope
no u
Someone willing to answer a question I have?
yes. that will be 50$
😂
#350 ©
btw, since we're at it… #MeToo = "Pound me too"
🙄
Has a lot of different names, but to me it will always be the "tic-tac-toe grid"
how to switch/toggle map texture on the map control ? (created with ctrlCreate... so no configs) 🤔
I don't think you can.
yeah... seems like not possible
Anyone familar with finding a building classname? For example House or Building, is there any other types?
What?
House_F
House_Small_F
Church_F
Church_Small_F
Ruins
Ruins_F
Wall
Wall_F
... for what purpose?
Trying to encompass basically all types of buildings for a loot script, it seems like sheds are excluded using just houses, buildings @little eagle
most buildings and houses work however
Is Alive mod dead? Adding data module to save state locally crashes the dedicated server.
Hey guys I am wondering if theres a script that will add a specfic item to the players inventory, like 5 extra magazines.
@lament grotto since you did not specify where the items should be added, i take it as "somewhere in the inventory"
params["_unit"];
for "_i" from 1 to 5 do {
_unit addItem "magazinesClass";
};
addItem will try to add the item to any equipment container the unit has equipped if there is room for it
Awesome thank you
@fossil yew You maybe should ask that in ALiVE Discord. ALiVE is not Arma. And a module that crashes your server isn't #arma3_scripting either.
@still forum np
If I addAction via remoteExec with flag for JIP, Can I also removeaction via remoteExec with JIP as well at a later point? Basically I have a one use action, that I want everyone to be able to do regardless of when they join the mission, until one person has done it and then I want no one else to be able to do it.
If the object is placed in editor you can just add the addAction to it in initplayerlocal.sqf. It is best to just set a condition which will just hide it after someone did the action. The issue can be that the removeAction command is removing the wrong action if there are multiple ones on it and because the ID of the addAction is local on each machine
@worldly locust you need the action ID to remove it. Considering the actionID is unique on every client. The answer is no
but why don't you just remove the addAction from the JIP queue instead if you want it to be removed?
I'm not sure what the "art of the possible" is here to be honest. I know what I want to accomplish and what I've done works but only for someone in the mission at the start and in the server when the action is triggered.
Why not simply store the action ID on the object locally. Then upon removal, each current client removes it using their local action ID, and the JIP ticket is also removed.
If there is a good way of doing this I'm open to alternatives
^ call a func that adds the action, store the ID then reuse it when you need to delete it
{ My_Action = player addAction...;} remoteExec ["call", 0, "My_action_remoteexecID"];
Then to remove it
{ player removeAction My_Action; My_Action = nil;} remoteExec ["call", 0, "My_action_remoteexecID"];
remoteExec ["", 0, "My_action_remoteexecID"]; //remove JIP queue entry
Howdy Arma junkies, does createVehicle param "can collide" changed to "can_collide" at some point ? found some pretty old script with this line > _bolt = createvehicle ["LightningBolt",_pos,[],0,"CAN COLLIDE"];
but it spams my rpt like crazy with errors saying "Error Foreign error: Unknown enum value: "can collide" and official bohemia wiki says it params should be "CAN_COLLIDE" with underscore 🤔
I cannot remember it ever being without space
🤔 I remember being able to remoteExec addAction and removeAction
Will look through the code in the evening
the issue isn't the RE^
@bright stirrup Ctrl+H CAN COLLIDE → CAN_COLLIDE ¯_(ツ)_/¯
and I always remembered them being with an underline^
yup, never was CAN COLLIDE
it's only recently (last year I think) that incorrect enum values would raise an error
Yeah, the ID. I don't exactly remember how I was doing it - I think the remove action was inside the script run from the addAction
But it remoteExeced the removeAction to all clients so that everyone's action got removed
maybe adding an action with a condition is the safest way; the action is still there but no one can activate/see it
Yeah I usually do that too
Okgood to know , thank you very much 😃
👍
private _configTiers = configFile >> "SR_CfgTiers" >> "Tiers";
private _tier = 1;
{
private _chance = getNumber (_configTiers >> str _x >> "chance");
if ((random 100) <= _chance) exitWith {_tier = _x;};
} forEach [1, 2, 3, 4, 5];
Bit of a logic question here. I'm trying to generate a random 'tier' between 1 and 5 based on certain percentages for each tier. But this isn't working properly and resulting in 1 too often.
use weighted random?
I remember those obscure commands but I don't remember enableSimulation huehuehue
private _configTiers = configFile >> "SR_CfgTiers" >> "Tiers";
private _values = [1, 2, 3, 4, 5];
private _weights = [];
{
private _weight = (getNumber (_configTiers >> str _x >> "chance")) / 100;
_weights pushBack _weight;
} forEach _values;
private _tier = _values selectRandomWeighted _weights;
Cheers @lone glade, I didn't even know that command worked like that. I'm pretty sure I've done it right.
looks good.
Just to settle an argument, which is more performant or is it negligible?
[] execVM "etc.sqf";
0 execVM "etc.sqf";
execVM "etc.sqf";```
All of them are dumb 😄
execVM loads, preprocesses, compiles the file every time
the last one is the fastest. But because of how slow they all are the difference is more than negligible
You probably can't even measure the difference
I thought as much, thanks
if it werkz on AI, it werkz on player - try not moving, also not putting this in the init field
please use
```sqf
```
for readability
I know, this is why I ask you to do otherwise
also, ```sqf
player switchMove "Acts_carFixingWheel";
tested right now in the editor
It could be that this animation you are picking animated the "weapon bone" as well. Besides it looks like it is the animation for "put weapon away, kneel down, fix wheel"
…maybe. script without mods, then add/use them in case of a problem
arma 3 has many animations which begin with the character putting away their main gun, as these animations are used in the campaign at specific points. Your best bet is to take a look into the animation viewer and maybe you'll find an animation set which does not switch to your main weapon in the end.
Even the ACE team had to do compromises with anomations, e.g. healing animations also suddenly select your main weapon as there is no other animation available. Weapon switching in arma is triggered when calling specific animations even.
try in the debug console
player switchMove "Acts_carFixingWheel";``` as well as ```sqf
player playMove "Acts_carFixingWheel";``` and **don't** push any button but 'Escape' to see the result
If I will run script in eventHandler(when Player enters vehicle) will it run locally?
Great :-) thanks
sorry to bother but I dont understand how should I use params in here:
this addEventHandler ["GetIn", {
params ["_vehicle", "_role", "_unit", "_turret"];
}];
Where should I put code in here that is executed when an event occurs?
this addEventHandler ["GetIn", {
params ["_vehicle", "_role", "_unit", "_turret"];
<your code here>
}];
this addEventHandler ["GetIn", {
params ["_vehicle", "_role", "_unit", "_turret"];
_vehicle setDamage 1; // here
}];
big thanks again guys 😃
maybe EH examples should include a // your code here idk
If you know the most basic SQF basics you should already know the answer. I think the wiki can infer that knowledge
Maybe, at first I thought that it is like in Java with multi arguments methods, and that code should be after }
And comma
I can give that EH is "advanced" SQF, but maybe, to avoid people thinking
player addEventHandler ["fired", { params ["_blah1", "_blah2"]; }];
systemChat str _blah1;
It may be obvious to us, but maybe not everyone
I agree that it's advanced level. We cannot explain the basics over and over again on every single wiki page
Those examples are for copy paste. The page is not for learning, but looking up stuff.
I thought we could 2 birds one stone here, // your code to select-replace and also learn. but I can agree it is "useless" here, you tell me
You could literally write down "put your code here" and people would still have no clue what to do. Just give up. Not everyone is cut out for this.
"your code"
It's probably a safe assumption that if someone is using the EH page to copy-paste and doesn't know where to put their code; they don't know enough to reliably be using EHs in the first place.
fair enough - I agree that usage should be found on the addEventHandler page
So I have added a script in for the invisible backpack and it seems to be working fine but is there somehow a way to remove the shadow of the backpack ?
would anyone here be interested in an addAction generator tool #arma3_tools
nearEntities or nearTargets, maybe?
do you mean "mod" instead of "script" ? These are very different things...
Can't find it in the internet: how do I make my heavily scripted scenario default save-compatible? Is there a list of all the things that are being or not being saved when I press the save button? And what are the initialization steps when I load a saved game?
all scheduled scripts and all global variables will be saved. And resume when loaded
usually you don't need to do anything to be save-compatible
And variables of objects set by setVariable?
And states of FSMs?
same
what should be taken care of is UI scripts (disableSerialization) and restarting them, if any
Ok, thanks, that's what I wanted to hear 👍 .
What if there is a certain state associated with the state of a GUI menu? Menu will be probably lost but how can we restore it? Does init.sqf or something like that get executed when I load a save? Otherwise it seems that context of the menu we've made will be totally destroyed.
init.sqf no, nor any init field - you're good on that aspect
menu, heh it's a bit deeper than that
yes I'm considering, what If I save during a GUI with a dialog with NPC
The dialog will not be restored
I don't even know if there is a eventhandler when a save is loaded. CBA has one though
there is
Hmm... then probably I should use enableSaving to disable saves when any GUIs are created.
Thx for the "Loaded" EH, that's probably what I was looking for!
If you remember an article covering these topics that would be helpfull as well.
beside UI, I don't think there is much to say. but if you encounter more data, we can create an article on the BiKi
Trying to spawn the “new” tank in a custom layout, any advice? https://paste.ofcode.org/BqDWKg5W5r2ab7EvBXCNPG
vehic = "O_MBT_04_command_F" vehic,["Grey",1],["showCamonetHull",0,"showCamonetTurret",0] createVehicle _pos; onMapSingleClick " "; openMap [false, false];
That is one single huge syntax error blob
😭 my eyes!
Hahahaha sorry guys, just trying to have fun with it.
I have my specialities but coding is not one of them 😅
Does anyone know where CBA and ACE save their local client settings? Tried google, and removing the whole mods and no bust. Something's corrupted somewhere.
profileNamespace
your player profile. My documents/Arma 3/<yourname>.vars.arma3profile
profileNamespace setVariable ["cba_settings_hash", nil];
saveprofileNamespace;
@tough abyss
thanks Commy
@still forum that'd also wipe my arma 3 settings, which i'd rather not do
@still forum any idea how to solve it?
don't know what you are trying to do.
saveprofileNamespace;
reeeeeeeeeeee
Probably
vehic = "O_MBT_04_command_F" createVehicle _pos; onMapSingleClick " "; openMap [false, false];
But I don't know what that array stuff in there is supposed to be doing
This ^ spawns a vehicle at _pos and closes the map and removes the click EH
How do you page to see if a waypoint is complete?
@still forum yup that one works perfectly but I’m trying to spawn the grey version
Exported it via attributes in the editor
I don't know how to apply the attributes stuff
You could export the paint job and other stuff in the Eden Garage
Then use BIS_fnc_initVehicle
And how can I integrate it in the code? I got it working for the jets but this seems a bit different
[
_veh,
["GreenHex",1],
["showTracks",1,"showCamonetHull",1,"showBags",1,"showSLATHull",1]
] call BIS_fnc_initVehicle```
That should do the trick
That's how it's exported from Virtual Garage
Thank you!! Do you just press “export” ?
Okido going to try to adapt this to my existing code. 😄
What's the appropriate way to do this?
[_G3, 1] setwaypointstatements ["True", "
_G2 addwaypoint [_this, 10];
_G3 addwaypoint [_this, 10];
_G4 addwaypoint [_this, 10];
_G5 addwaypoint [_this, 10];
_G6 addwaypoint [_this, 10];
_G7 addwaypoint [_this, 10];
"];```
Are the quotations messing things up?
Or the use of _this in the activation field?
Or something I'm not suspecting yet?
it would need global variables, not local ones ("_G2")
_this is also wrong https://community.bistudio.com/wiki/setWaypointStatements
Ah, yeah. That'll do it. Well, global variables can't be used in the current context.
Okay, well... how would I go about doing this as like a waituntil waypoint done situation?
you can setVariable on the group
set the waypoints on there. And then get them off the group again inside the statement
If it's global, I think that'll cause problems for me in the long run. I'll look that up.
What's the simple way to waituntil a waypoint is complete?
https://community.bistudio.com/wiki/waypoints doesn't cpomtaom tje wayüpomta my,pre
german is an interesting language 😛
I've read over that page. My scripting prowess isn't sharp enough to glean what I need from it.
you could perhaps use https://community.bistudio.com/wiki/setWaypointStatements or https://community.bistudio.com/wiki/setWaypointScript instead?
depending on why you need to use waitUntil of course
Hmm... I've already used waypointstatements, but waypointscript may work.
In what situation the isServer can return false even if i am playing on a dedicated server?
@astral tendon isServer only returns true on the server itself
on the left is the dedicated server setup
each square is a game instance so phsyically the game running on a PC
in that instance only inside the server's "box" it returns true
on the other hand when you directly host a game via "HOST GAME" in the multiplayer tab, you yourself run the server in the same game instance as the one youre playing in and people connect to you
in that case isServer returns true in the game instance the host is running
So, what else could be?, right now i am on a server playing my mission but many scripts with the isServer are not running
then it's an error in your script. simplify at most, then debug with something like
systemChat "execution";
if (isServer) then {
systemChat "I iz server KTHXBAI";
};
systemChat "executed";``` this will sort things out
Well, I dont have acess to the debug console in this server
Because those scripts run on a hosted coop game
I dont see how isServer would not work in a hosted game
I just read about the publicVariable page, if I undestand right that is unreliable for dedicated servers?
its not
« The data is sent consequently and reliably to all clients. »
See DreadedEntity coment
Local variables cannot be publicVariable'd.
By Local variables I tink he is not falking about the one we put _ on it
of course _variable cannot be broadcasted, and the fact it has been tested on a dedi doesn't change that. Don't worry, it works.
Because that returns a error anyway
@astral tendon if isServer returns false it is because it runs on a client, really.
maybe somewhere in your init.sqf you have a if (player == player) then { if (isServer) then {/* code */}; }; or something; if it is a dedi player will never be equal to player and only a client will pass through this condition
nothing like that
anyway, isServer returns false because the script runs client-side.
also, most of it are being called by initServer.sqf and then uses publicVariable to set to other players
I am using execVM for things that i want only the server to execute
…doesn't change a thing
check and re-check where it runs. isServer is a failproof command and is not at fault here.
if it is a dedicated server, the same as not alive objNull iirc
and the result is I don't know ¯_(ツ)_/¯
true, false or code error
↑ shouldn't run on a dedicated server
I just server exec'd alive player through debug on a dedicated server > returned false. Same thing with diag_log
interesting
isNull player should be true then.
So here is the thing, alive objNull is false, exiting your code.
then
if (!alive player or isNull player) exitWith {};
is the way to go for dedicated servers?
if (not hasInterface)
^ helps to know if you have a dedi or even a headless client
if (hasInterface) then { /* run the script */ };
the server shouldn't even start the script (if dedi)
In this case i need the sever to not exit it
and what if the server is non dedicated, and server's player is dead? Think of it.
What is this script that should run on everyone but only when player is alive or is server?
Its a cutscene
the server setup the players possition
Here is how it looks like when its a player hosted
if(backpack player != "") then {
unitBackpack player setObjectTextureGlobal [0, ""];
[unitBackpack player,0,""] remoteExec ["life_fnc_setTexture",RCLIENT];
};
if (uniform player isEqualTo "U_Rangemaster") then {
_skinName = "textures\cop_uniform.jpg";
if (LIFE_SETTINGS(getNumber,"cop_extendedSkins") isEqualTo 1) then {
if (FETCH_CONST(life_coplevel) >= 1) then {
_skinName = ["textures\cop_uniform_",(FETCH_CONST(life_coplevel)),".jpg"] joinString "";
};
};
player setObjectTextureGlobal [0, _skinName];
};
};```
Anyone know how i get add a hide shadow for the backpack?
pretty sure u cant unmodded
also using setobjecttextureglobal and then using remoteexec to do the same thing locally is a bit of a waste.
Well my original goal was to just get the backpacks invisible
nvm
Is there a way I can display an image in a listbox inline? (not setpicture, ive already used that for a picture at the beginning of the line I want to add another at the end)
Can that be used along with the setpicture on the right?
lbSetPicture is on the left, but both can be used at the same time afaik.
sweet! and I need jsut the path to the .paa?
Whether the picture is on the left or right, the path is exactly the same.
sweet exactly what I needed! ty
What the literal?
@shadow sapphire I wanted to write
Check if https://community.bistudio.com/wiki/waypoints doesn't contain the waypoint anymore.
@still forum, thanks!
oh my, I missed that 😄
Theoretical question:
Say if I play music from a car or something via say3D, and I want it to loop. What's the best way of doing this?
I was thinking that I'd have to use a while loop that sleeps for the duration of the music. Is there a better way?
yep!
create CfgSFX attachTo vehicle 🙂
https://community.bistudio.com/wiki/CfgSFX
↑ with that you can create an SFX object, attachTo, and it will be global (maybe the sound will not be perfectly MP sync, but still)
Ooh
And this is vanilla compatible?
Like, I can just have it in the mission file and that's enough?
Hmm, glancing through that, I would have to place it in description.ext?
Yes, okay, thanks 😃
_just loop it ™ _
BIS_fnc_loop intensifies
Yeah I discovered createSoundSource from the cfgSFX wiki
I assume the sound source can be "turned off" by using deleteVehicle?
I think so yes
Hmm. Nice, may be able to incorporate it into a functional radio for the grunts while they wait in their transport
I think I read somewhere long time ago that I need to wait for one frame after issuing uniform/inventory manipulation commands. Is it really so? I hardly remember what I was reading about.
@astral dawn What are you trying to achieve?
@astral dawn that's false
you, however, need to wait one frame after you killed a display / dialog to create a new one
otherwise the game will just crash, it can't handle deleting a display / dialog and creating a new one on the same frame.
Thanks. Wasn't sure if I've really seen it somewhere or it's an error in my memory. 😆
My immediate guess is that you're trying to execute it on a non-local object
local args, global effects
are you sure that's the correct hit name?
in the vehicles config
you click on things. And it shows you the config entries of what you clicked on
on the left side you want CfgVehicles and then the name of the vehicle
if you are sitting in the vehicle it should also be display on the bottom left.
so you can directly click on it
probably in the Hitpoints class in that vehicle's config
uhm..
I know when you DM me. You don't need to tell me that
There. Fixed
the arrows are too small
perfect
quick question, for a static deployed hmg would the turret path be 0 or -1?
i tried 0 when using addWeaponTurret but that didnt work so i'm assuming it's -1
@still forum Where are the wheels?!
lol found t is right b4 rdiver seet
Hey all, first time posting here.
I need some help with creating a trigger which produces an image on the players screen for a few seconds and plays some sound affects. Trying to produce a hallucination or flashback affect.
What I think needs to happen is to have in the trigger (on activation) null = [] execVM "images\flashback.sqf"; playmusic "example1"; or playsound "example1";
But I am not sure what to put in the flashback.sqf to make the image display. Any ideas would be awesome.
Do you already have an image?
@dull dock
"commy_hallucination" cutRsc ["RscTitleDisplayEmpty", "PLAIN", 0, false];
private _display = uiNamespace getVariable "RscTitleDisplayEmpty";
// kill duplicate vignette
private _vignette = _display displayCtrl 1202;
_vignette ctrlShow false;
// texture control
private _control = _display ctrlCreate ["RscPicture", -1];
private _width = safezoneW;
private _height = safezoneH * (getResolution#4);
private _left = 0.5 - _width / 2;
private _top = 0.5 - _height / 2;
_control ctrlSetPosition [_left, _top, _width, _height];
_control ctrlCommit 0;
_control ctrlSetText "<path_to_image>";
// fade effect
0 spawn {
sleep 10; // keep 10 seconds
"commy_hallucination" cutFadeOut 2; // fade for 2 seconds
};
Assuming the picture should cover the whole screen without being stretched.
@little eagle So the above lines would go in the sqf file and activated via a trigger with what I posted earlier?
Wherever you want the effect to be. It's universal.
The line 1 zero is the fade in duration. Could set that to 2 too.
Thank you so much, will give it a test when I get home from work.
@still forum To get what I just posted scheduler safe, what do you think about mass replacing all ; with , ?
@gleaming cedar https://community.bistudio.com/wiki/addAction
Absolutely there is, READ.
read with your eyes ffs
I just reread the page and it clearly says where to enter the maximum distance.
know versus know how to replicate?
yes and yes'
Then why not use the one that does?
i don't know what you're on about
use the animation viewer and find something that you think looks correct. Or find the one that is used for actions, then bam
Is it possible to texture vest without using mod??
No.
So the function canAdd only checks the inventory (Uniform, Vest, and Backpack) Is there a way to check if the item can be added in a weapon slot as well? For instance you are buying a rifle from a trader, it first checks your primary slot is open and checks if bag space is available? Or perhaps check one first then another?
Store the current one, add the one to test, check if it actually changed, remove it if so, readd the original.
There is BIS_fnc_compatibleItems, which reports all compatible items. Maybe check that, but make sure to check in a way that is case insensitive.
hmmm
"hmmm" ?
Well this code is running server side, and Im not sure how to store the current one?
I know this has been done, just not sure how to do it
Then use BIS_fnc_compatibleItems. That works without object to test on.
ty
private _isCompatible = (_gun call BIS_fnc_compatibleItems) findIf {_x == _optic} != -1;
Oh is this for buying an attatchment?
It is for checking if _optic is compatible with _gun.
What you do with that further doesn't matter.
Oh I only meant is there a way to check if the player has no weapon at all
That checking if the attachment is a bit deep
If the player has no gun, there is no gun to have any compatible optics.
I must have misworded it
Lets say you go to a trader and your uniform, vest, and bags are all full but you have no gun. If you run canAdd on a sniper rifle, it will fail
despite the fact that you could in fact add it to your primary weapon slot
wat
canAdd only works on persons, not sniper rifles.
player canAdd "srifle_LRR_F";
will fail if vest, uniform, and backpack are full even if you have no weapon
Then don't use canAdd. Think of something else.
yes.... that's normal
that command checks the player containers
weapon slots aren't containers
Hmmm
so then in turn, even if you did a check player addItem would fail because it wouldnt use the primary slot either correct?
what you want to use to add a primary slot item is, you probably guessed it, addPrimaryWeaponItem
right
addItem adds an item to the player inventory, again, containers
^
so if you run that code, does it fail if they have a primary weapon already or overwrite it?
overwrite it
ah, and the existing one is dropped or despawned?
it cease to exist
Sadly "" cannot be used to overwrite with empty slot.
it goes poof
ahh ok
*poof* lol
I don't think so.
it's very likely that it silently fails
Sadly.
ah right that makes sense
Rereading this, I have no idea why I thought this was about attachments. Guess I unconsciously found weapon slots to be trivial. :thonk:
A3 inventory belongs into the trashbin of failed designs.
The ui is alright, aside from us not having a way to remove glauncher mags for years, which is inexcusable.
But the way this stuff is all handled internally and how that is reflected in the scripting api is unbelievably bad.
10 year old code with band-aids strapped to it
also I hate myself for using pixel grid and right as I finish BI fix pixel rounding
safezone
safeZone 👌🏻
Ironically I came to like the pixel... well not the grid, but drawing one pixel wide lines is awesome for debugging, i.e. the mildots.
https://community.bistudio.com/wiki/ctrlSetPixelPrecision
cries in pixel grid
wait a second
actually pixel grid is still better since it doesn't have rounding
SAVED
since it doesn't have rounding
Tell me what 30 pixels divided by 7 are then.
anyway inventory scripting is such a clusterfuck
UI coordinates suck but at least it improved
inventory just got 500000 more commands to fix shit, but it's still gay as fuck
Who thought naming the launchers "secondary weapons" was a good idea? The pistols are secondaries if anything.
addPrimaryWeapon -> addGun
addSecondaryWeapon -> addLauncher
addHandgun -> addPistol
but man the time and economical constraints can be felt to this day
If you have "primary" and "secondary", why not use "tertiary" as well? 🤔
counter argument:
- dammage
😬
BI = bohemian Inconsistencies
I hate how Americans are in charge of emoji, so we do have a black female cosmonaut, but no (dam)mage.
🌚
topkek
dammage is just funny though
its not just really annoying super shitty design that needs about 5000000 commands to actually work
sldt1ck, that's creepy af
why is that a thing
(inventory)
why is that a thing
Cooperations in charge of language. Emoji are language.
why are skin shaded emojis a thing? Did people needed to feel special in their emoji language?
i'm still asking myself who are these citrus yellow people
also blob emojis -> everything else
GIB BACK BLOBS
Bl ob.
They're yellow, because normal people use white background, and white on white wouldn't stick out, obviously.
Rude,
he's right tho
Eh. We're about to argue preference
tbh I have some form of albinism and my eyes are extra goddamn sensitive to light....
its called being white
??
and my eyes are extra goddamn sensitive to light
That's just because you never leave the basement.
help, the germans are bullying me 😦
:tank:
Aren't you german alganthe???
He should've been...
I mean, if WW2 turned tides we would all be some german derivative
i'm french obviously
🏳
Well it's not very obvious
especially on his github page...
I should start making more typos and use a very thick frenglish accent when I talk to people
I'm sure i'd get kicked out of the unit i'm in under an hour
wait, wait I got an even better, idea, make aliases for all the command, in french
also use more oui and baguettes in chat
ouioui, the hero we deserve.
🥖
TIL ouioui is called noddy in english
🐸 🍗
💅
🐌
first thing in my mind when i see snail in chat, that how we call arty when you need 8 or 10 grid but map is 6 and no map tools
Because the artillerists are still trying to figure out how to punch in all those numbers?
yeah 😀
use landmarks and numpad^
that what is "ulitka" or snail https://gyazo.com/088cb785a6e3a36be50eb683e328a406
that when you have no map tools
same in irl also
just look at snail shell...so that why it's called like that 😀
Is there a command or CBA/ACE function that returns a random position within a circle around reference position?
Thanks
I've seen now getPos has a version. Oh.
I wrote this, when I was bored.
I actually managed to find this through search on Discord channel now, so it's very useful. Sorry for being too lazy to search before asking!
@little eagle The script you provided me for an image to flash up on the screen worked like a charm. Is it possible to do the same thing with a short video? Thanks again.
im having this weird ass problem where if I exit a driver seat while in
'setcaptive' , the vehicle turns from civilian to WEST
anyone got a clue how I can keep a vehicle civilian while i am in setcaptive?
lol this makes no sense, i put a civilian in the driver seat, deleted him, and now the problem is gone
_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;
}];
Why is this event handle not working on dedicated servers? this works on SP and Coop player hosted
where do you set it?
On a unit
…init field ? script ?
script
how is the script called?
the unit is created and then calls the script
SpawnUnitLeetCrew = {_Objectpos = getPosATL _this;
Sleep random 3;
_unit = group Opfour createUnit ["O_soldierU_F", getPosATL _this, [], 0, "CAN_COLLIDE"];
_unit execVM 'AiTargeting.sqf';
_unit execVM 'moral.sqf';
_unit setPos _Objectpos;
removeGoggles _unit;
[_unit] join grpNull;
lockIdentity _unit;
_unit call LeetCrew;
if (random 6 > 1) then {
_unit call selectrandom [GivePistol,GiveSMG];
} else {_unit call selectrandom [GiveRifle]};
[_unit, "NoVoice"] remoteExecCall ["setSpeaker", 0];
if (LevelDifficulty == 2) then {_unit execVM 'HostageSpoter.sqf';};
};
'moral.sqf' is were the EH is
cool, but where is this script called?
init.sqf , initServer.sqf , other event handler, etc? the EH should work, it sounds it is not called at all
is the unit created at least?
Yes it is
and other EH works
//unlimited magazines and roe
if (!isPlayer _this) then {
_this addEventHandler
[
"Fired",
{
_mag = _this select 5;
_unit = _this select 0;
_unit setVariable ["HasFired", true, true];
_unit spawn {sleep 5; _this setVariable ["HasFired", nil, true]};
if ({_x isEqualTo _mag} count magazines _unit == 0) then
{
_unit addMagazines [_mag, 1];
};
}
];
};
This one for exemple
This EH can accept a remote unit as argument however it will only fire when the unit is local to the PC this event handler was added on. For example, you can add this event handler to one particular vehicle on every PC. When this vehicle gets hit, only EH on PC where the vehicle is currently local will fire.```
That means???
can you provide a simple example mission on a hosting site? for people to try the issue
You can set up a Dedicated server for this test?
arma3server.exe?
I dont know how to do that, i give up on it long ago
I just had this isue in a server hosted from other people
¯_(ツ)_/¯
Well, RIP.
is there a way of using the chat box to send custom messages , i.e if I made a message box, and someone messages in a specific channel it would send to the messagebox ?
battleye can get chatbox message, so i guess this is possible but dont know how
@wary vine my group uses something like that, we just write stuff like #fp.whisper username my_message
is this with only cba ?
this requires CBA, yes
trying to figure out how to write code blocks in that nice coloured format
welcome to #info_help_tips . How may I help you?
like that:
```sqf
hint str player;
```
ok so my question is pretty fundamental ot arma, but i can't see an easy solution
@little eagle could work. If you wanna be really sure you grab SQF assembly and disassemble the script to check if all the Expression ends are gone. I would probably just isNil it.
it tries to do standard highlighting on unrecognized file formats
~10
@ player == player
hint format ["Player is %1", name player]
@winter rose haven't seen it yet. The library doesn't seem to be maintained anymore. No one is accepting my pull request for new sqf commands
no SQS support, I am sad 😢 😄
is there a way to check if a magazine is full on both pilot (turret -1) and gunner (turret 0) in a plane? so far i have tried using allturrets and magazinesturret and i can see al lof the mags, but they show als othe empty ones for plane pylon mags. I'm trying to check for full fuel drop tanks on both turrets
whe ni try to use (ammo >0) to check their content the empty pylons still return true
_magp = _unit Magazinesturret [-1];
hint str _magp; sleep 1; /lists the pylonmagazines even after tanks have been dropped/ fired
{
if ((_x) isKindOf ["uns_pylonRack_1Rnd_fuel_A1", configFile >> "CfgMagazines"] )then
{
if (_unit ammo "uns_FuelTank_Launcher_dl" > 0) then
{
_count_tanks = _count_tanks +1;
};
};
} foreach _magp;
hint format ["Pilot Tanks available: %1", _count_tanks]; sleep 2; //returns 2 for 2 empty pylons tha thave the drop tank pylon mag present (but empty)
weird huh?
is there a better way to gather a magazines array of only FULL mags?
https://community.bistudio.com/wiki/magazinesAmmoFull seems to be limited only to pilot (single seat) OR gunner (twin seat) turret path
https://community.bistudio.com/wiki/magazinesAmmo same limitation
ah this may help https://community.bistudio.com/wiki/magazinesAllTurrets
not spotted that before
do you want to check if they are full mags or if they didn't fire ?
i want to check if the plane has an "unfired" drop tank present
so the plane i'm testing (we have about 20 planes to add this function to) has a pilot and gunner. The gunner OR the pilot might get the drop tanks added, using the loadout editor, s owe must cater for both turrets
so i need to know how many full fuel tank magazines does the pilot have and same for gunner
i think i can do it by querying magazinesAllTurrets
also maybe turret index is wrong, we have bis_fnc_getTurrets and bis_fnc_allTurrets to get them
Hey fellas how can one set a custom attribute in the Mission/Scenario class and have it save to the sqm/execute even if it is the default value? I want to use the expressions from multiple scenario attributes to set values on every mission built in editor with this addon. I know that the Cfg3den Logic class always saves to sqm/executes regardless of the default value, but I can't find any class define that changes this behavior in the 3den configs.
index returns ok -1 for pilot and 0 for gunner. bot harrays are hinted correctly
i'll have a go with this and come back if still stuck
gl
magazinesAllTurrets would do it
_allmags = magazinesAllTurrets _unit;
//returns [["className", [turretPath], ammoCount, id, creator],...],
//e.g.
[["uns_pylonRack_1Rnd_fuel_A6", [-1], 1, 1], ["uns_pylonRack_1Rnd_fuel_A6", [-1], 0, 1] ]
//so
if( ( (_allmags select _i select 1) == "[-1]")
//==Error type array expected number, string
where i'm using _i to step from 0 to count _allmags
why the string of "[-1]"?
any idea what syntax to use to check the turret value?
these days for array comparisons just use _something isEqualTo [-1]
i tried -1, "-1" [-1] and "[-1]"
isEqualTo
magazinesAllTurrets select { (_x select 1) isEqualTo [-1] }
isEqualTo is your array comparison these days, in A2 days it was usually str both sides and then compare that i believe
tjhanks guys
i finished up with a long bit of code, but it seems to work ok
_allTurrets = [(typeof _unit), false] call BIS_fnc_allTurrets;
_seats = (count _allTurrets);
allmags = magazinesAllTurrets _unit; //returns [["className", [turretPath], ammoCount, id, creator],...]
_ct = count _allmags;
//check for fuel tanks
//pilot turret
if (_seats < 1) then
{
_count_tanks = 0;
_i = 0;
while {(_i < _ct) } do
{
if( ( (_allmags select _i select 1) isEqualTo [-1]) && ((_allmags select _i select 0) isKindOf ["uns_pylonRack_1Rnd_fuel_A1", configFile >> "CfgMagazines"] ) ) then
{
if ((_allmags select _i select 2) > 0)then // is the ammo full
{
_count_tanks = _count_tanks + 1;
};
};
_i = _i + 1;
};
// hint format ["Pilot Tanks available: %1", _count_tanks]; sleep 1;
};
//gunner turret
if (_seats > 0) then
{
_count_tanks = 0;
_i = 0;
while {(_i < _ct) } do
{
if( ( ( (_allmags select _i select 1) isEqualTo [-1]) || ( (_allmags select _i select 1) isEqualTo [0]) ) && ((_allmags select _i select 0) isKindOf ["uns_pylonRack_1Rnd_fuel_A1", configFile >> "CfgMagazines"] ) ) then
{
if ((_allmags select _i select 2) > 0)then // is the ammo full
{
_count_tanks = _count_tanks + 1;
};
};
_i = _i + 1;
};
// hint format ["Tanks available: %1", _count_tanks]; sleep 1;
};```
horrible to work out, but it does the job - for single and dua lseater planes who could have drop tanks mags loaded on either pilot or gunner stations
all of my fuel tanks on every plane i nthe mod inherit from class uns_pylonRack_1Rnd_fuel_A1
Guys, i just found this
if (!isServer) then{
[{systemChat "test"}] remoteExec ["spawn",2];
}; //nothing
if (!isServer) then{
[{[] spawn {systemChat "test"}}] remoteExec ["call",2];
}; // works
Seems that you cant remoteexec to the server the spawn comand but you can spawn from call, I tested it with local coop with another player (my self)
Some one mind add this the the spawn wiki page?
about the test, I use the global exec button on the editor debug console
Thats why the !isServer is there to avoid the server from execute that and only the connected player to use the remoteExec
spawn is a binary command, you lack the left parameter
[0, {systemChat "test"}] remoteExec ["spawn", 2]; // should work
@astral tendon
It did, thanks.
👍
How many variables in missionNamespace is too much? 10 thousand? 100 thousand?
why would you need 10 thousand or 1000 thousand?
if they are all of the same type just use one array
I am considering using an oop implementation which stored object members like myClass0_myVariable, myClass1_myVariable
"too much" doesn't really exist.
it's too much when your game crashes as it's out of memory
I am considering using an oop implementation
nope, just nope
You should keep them to the minimum possible
If you wanna use OOP then I guess you have to live with filling the namespace with a ton of crap
SQF isn't made for OOP.
why not?
other then memory, is there some threshold beyond which lookup time will be super slow?
you're just making your life harder with no additional benefits
Are you talking against OOP in general?
no, OOP in arma
Do you have any experience with OOP in arma?
it doesn't exist
OOP is a good thing. But SQF is just not made for OOP
You can fake it by building a bunch of workarounds which will make your scripts slower and use up more resources and be harder to write than just using non-oop
Yes I know it doesn't exist. I am just resolving object's members into missionNamespace getVariabe[_object + number + member - kind of thing.
I was looking at code34's repo and he has made quite a lot of things with his oop implementation
Compiles to full-speed SQF code That is my biggest problem with it. I need the best performance.
Yeah.. It's full-speed SQF. A big converluted mess of crappy and ineffective full-speed SQF.
it just doesn't make sense to use fake OOP
Why do some functions start with BIS_ and others do not?
BI usually tag their funcs with the prefix BIS_
Aren't all functions BI functions?
all functions in unmodded Arma are BI functions
the rest are.. well.. modded functions
well, missions aren't mods as far as I know ^ 😄
@dull dock
The script you provided me for an image to flash up on the screen worked like a charm. Is it possible to do the same thing with a short video?
No.
What's the general memory overhead when I create a variable in missionNamespace? For instance I create a number, then what extra memory will the game allocate for this variable? I'm still trying to figure out the borders of 'too much'.
So regarding BIS_ functions versus non BIS_ functions, something like setFuel I will not find an SQF script or entry in Function Viewer, but something like BIS_fnc_setFog I will?
setFuel is not a function. It's a command
length of the varname + 9
16 bytes
I think another 16 bytes.. not 100% sure.
and for number another 16 bytes.
Oh and the namespace entry is another 8 bytes..
@astral dawn
You can find a full* list of all commands here: https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3
Which is kind of better than an ingame viewer.
@still forum If the Number in Arma is single precision, it's 4 bytes... why 16 bytes for number? Or I didn't understand you correctly?
@still forum @little eagle Thank you. The differentiation between commands and scripts was the key. Commands are native code functions that are exposed by the engine to scripts. Scripts are script code functions that can use commands or other scripts. There's no source for commands because it is in the engine implementation. There is source for the scripts because there are script files and BI has exposed the script files in the Arma installation.
There is https://community.bistudio.com/wiki/supportInfo, but that doesn't explain usage, just lists the syntax in a complicated way.
@astral dawn 8 for the vtable. And 4 for the number. 4 padding
Any idea what the back story is for why BI started exposing higher level logic as scripts instead of commands (when)? Did they develop the script facility, create scripts themselves, and then realize it would be useful to modders/mission editors to expose the BI scripts as well? They could have implemented kept everything that is a BIS_ script as a command.
scripts are easier to write than commands
you need a engine programmer for commands. BI doesn't have as many of these
and some things are just so specialized that a command doesn't make sense
It's a scripting language. Functions and return values that you can change were added when they switched from SQS to SQF.
Thanks @still forum . Assuming I have even a 1 million of variables, and the average overhead (top value) is around, say, 32 bytes. Do you think that extra 32 megabytes for these global variables can make a lot of trouble for the game?
probably not
When I broke my memory allocator Arma crashed around a billion allocated values. That's just the lowest level values though.
which.. is resonable
But why would you want to create a million variables in the first place?
Read the discussion above please. Really I don't, just considering extreme cases.
Eh, you will never get OO to work in SQF. Many people tried and no one got anything to work that is popular, because it will always suck.
Yeah I see many dead projects trying to make OOP. I even made one myself a few days ago, lol.
Well it's totally doable. As I heard, they made C++ atop of C compiler and they were feeding the C++ output into the general C compiler. For the first iteration of C++ i mean.
It's not with SQF, because SQF is not C++. C++ can use C, but SQF can not.
It is, again, a scripting language.
mhm. SQF stuff gets broken down further into C++ and stuff, which is where i'd guess the OOP lies
The script gets interpreted by something written in C++, but that doesn't mean you can actually use C++ or C, which would be required for doing stuff like OO yourself.
For proper & fast OOP there needs to be a compiler so that you don't need to check things at run time a lot through super slow SQF, that's the problem.
I could make one theoretically
Just doesn't make much sense. IMO there is no need for OOP in SQF
If you really need it. Just write C++
Yes I've seen your Interept mod. Probably too hard for me personally because I will have to create a library for Linux as well.
Dedmen, you should've just put Intercept into CBA, so everyone was forced to use it.
I wanted to put the optional into it... But no one wanted it
not even you wanted it for full joystick hotkey support
But no one wanted it
You never made a pull request.
Oh.. Guess I'll have to fix everything up and do that then 😄
commy
alganthe
imagine the LEGENDARY levels of crying adding intercept to cba would create
And?
"but, but, but, my 'clientside' cba is borked"
It wouldn't be.
It will be optional tho
do it
So imagine we have a server hosted somewhere. And the hoster only lets us load missions and addons for arma (like Nitrado service does). Will I be able to run an Intercept+(Lua/Python) solution to run a scenario made with Intercept? I assume the hoster doesn't have to have Python installed.
I ran dll's on nitrado like.. 4 years back
might have changed
Intercept Lua/Python have the engines for these included
No extra dependencies needed
It wouldn't be. thanks 😃
It will be optional tho
Weak. You have the opportunity, so use it recklessly. If someone complains they can stop using CUP etc. lmao.
But we would need git LFS on CBA repo
really?
I don't want to clutter the repo with binaries
aaaaah, forgot about that
So... has anyone implemented a mission with Intercept?
mission no, extra stuff yes
ded made a perf profiler that is mighty useful
well, he used brofiler, but still 😛
brofiler is only the UI :U 🔨
I am not aware of a mission no
You cannot put dll's into missions. So that's not really attractive
and python/lua plugins aren't far enough because there are only a handful of people interested in python which all don't have time to dev on it. And for the lua one it's basically only me ¯_(ツ)_/¯
But theoretically! It's possible
I'd say my hashmap variable type is already enough
You can't really enforce static types on a dynamically typed language anyway
createNamespace
deleteNamespace
with <custom namespace> do
namespace.variable as alias for getVariable
such oop much wow
Oh. Can actually do that now. Since a month ago
namespace.variable = as alias for setVariable
you can do .variable custom syntax shit now?
createNamespace alt syntax to copy all variables from another one to emulate inheritance.
I can add commands yeah.. but I don't think . would work.. not sure
you can do .variable custom syntax shit now?
No.
Well I have a friend who was making a mission with Intercept actually. It was working but then he gave it up because of real life.
I could use # 😏
commy ruins my hopes and dreams
All this could be implemented in a week I'd say. But oh well, Arma is not OS.
You can do with in a day with intercept
Make the PR on CBA already dammit
SQF would be better than Enscript will ever be.
namespace.variable =
As setVariable alt will probably not work tho.
Even with Intercept.
well. Could build a custom compiler ¯_(ツ)_/¯
I mean, one could use to a different syntax too I suppose.
But this would be my ideal.
Maybe instead of with do, have using to change the namespace of the current scope.
how about set ?
namespace.variable set _value
Good enough I suppose.
Remind me tomorrow 5 PM to check if . could actually work
do it fgt
Yes! I will do it now! I will go to bed now
Remind me, is it using createNamespace command already?
If it's not nullary, add an unary ARRAY variant to inherit all variables from a parent namespace.
done
in
a
week
ffs
But nooo, we need another new unique language.
is what using createNamespace?
intercept custom command
nope. Because the hashMap is not a real namespace
Couldn't create namespaces yet when I made that
then put's a <name> variable into missionNamespace to store the namespace
Inherits all values from <parent>, best would be all future ones as well.
then put's a <name> variable into missionNamespace to store the namespace
Yeah.
Is there a way to set were the player is looking at? especialy verticaly
you mean, changing his camera? no way so far I believe
can't think of a way either
One kinda way i find is to make a camera and attach to the player, it is the far as I can go.
Is there a way to set were the player is looking at? especialy verticaly
No. And especially not. Sadly
with cutscene type animations/gestures you can control the head/camera I think
Has anyone seen another language with binary operators like SQF where parameters are passed in before the function call rather than after (like C and alll derivatives)? Specifically this construct of [param1, param2] call myfunc;
Deadfast had a mod on armaholic which was changing a 3rd person camera offsets. Not sure how exactly that one is coded, and if it works for first person, but thats real somehow.
@dry zephyr Every language with + - * and /.
@unborn ether But that is not the head, and was it even changing them while the game was running or just some config entries?
probably just extCameraPosition for the 3d person view, like in all other several millions addons since ofp 😀
^ yes that.
Hey guys! Sorry to bother, I have a bit of a question!
You know how you can set the Arma revive system through a mission editor, yes? Y'know, walk up to em and revive.
Is there a function/script that I can execute to revive them through the console or something? Sometimes, a player plays solo, and I like to bring them back up without having to get out of Zeus, run up to them, and revive them myself. There must be some kind of function or text I can put in, for example, Debug Console mid-game to activate a revive.
Delete your question in #zeus. This is the right channel for this I'd say, but people don't like if someone spams all channels.
Ah, sorry.
Done.
I've been trying to find the function.
I can only find the parameters.
@kind torrent
{ ["#rev", 1, _x] remoteExecCall ["BIS_fnc_reviveOnState", _x]; } forEach _guysToHeal;
@winter rose If I post that, it will revive the target?
if you set the target in _guysToHeal array, it's quite self-explanatory
Okay! I'm very new to any scripting stuff, so it's new to me haha
if you don't really know, you can replace _guysToHeal with allPlayers, it should do the trick
- allPlayers
it will "spam" the message to everyone, but it's not a big thing
Hm, I see. So long as they revive. I will test it now! If it works, I'll try to dissect the code to learn more about how it works!
I appreciate this a lot!
👍
it doesn't seem to revive ..
Nothing appears to happen.
@winter rose I take it that this is supposed to work probably in the functions/debug, but I notice that it's not reviving any! 😮
how do you execute it?
I've tried in the Debug, as well as target debug, player parameters, and such.
This is in Zeus. I'm sure it would work if it was in editor.
But my intent is to revive players remotely in the Arma Revive System, as opposed to going to player and reviving them with the hold action.
I thought you had debug console enabled. you would then need a script yes. is it your mission or the official one?
with "SERVER execution" ?
{ ["#rev", 1, _x] remoteExecCall ["BIS_fnc_reviveOnState", _x]; } forEach allPlayers; ``` right?
{ ["#rev", 1, _x] remoteExecCall ["BIS_fnc_reviveOnState", _x]; } forEach _allPlayers;
Yes.
Ohp.
yup.
np, happens 😄
tell me something I don't know 👀
no but seriously, no problem 😄 just try, and it should work
It works perfectly. ♥
Thank you! I'm going to do my best and learn how the code works!
welcome aboard!
😄 !
guys, i'm trying handle with hit points damage
theChoperer addEventHandler ["Dammaged", {
params ["_unit", "_selection", "_damage", "_hitIndex", "_hitPoint", "_shooter", "_projectile"];
if ((_unit getHitPointDamage "main_rotor_hit") > 0.89) then {
_unit vehicleChat format[localize "STR_main_rotor"];
["epicFail",false,true,true,false] call BIS_fnc_endMission;
};
}];
but now working when u lose the main elise?
like that -> https://gyazo.com/cdb64251cf5333ba07e4d3152ae91e3b
the whole mission it's here -> https://steamcommunity.com/sharedfiles/filedetails/?id=873225391
because the hitpoint is called hithrotor ^
you're trying to use a command that uses a hitpoint with a selection
so what's the issue?
try using handleDamage instead
it's like no damage received
ok, will test with HandleDamage
@lone glade worked, thx
hit point name is HitHRotor < main rotor, Yeiij
^ someone didn't read 😄
to get all hitpoints names you can jump in that heli and paste this into the console
copyToClipboard str ("true" configClasses (configFile >> "CfgVehicles" >> typeOf vehicle player >> "HitPoints") apply {configName _x});
oh didn't saw your answer lol
and getAllHitPointsDamage too
hitpitottube exists 👀
if CBA.canUseWeapon(SQF.player) && SQF.missionNamespace.getVariable("ShouldEquipBinoc") then
CBA.addWeapon(SQF.player, "Binocular", false)
CBA.selectWeapon(SQF.player, "Binocular")
end
This is so neat. It could be so much neater if more people would push me into finishing this stuff
Ugh. Discord LUA highlighting is ugly
ye
Thinking about a way to integrate CBA and other libraries and have it be easily accessible. I'd say this way works fine
And things like
SQF.player:getPosASL()
SQF.player:setPosASL({1,2,3})
or maybe even
local playerPos = SQF.player.positionASL
SQF.player.positionASL = playerPos * 2
That's cool
Can you explain to me please... I always wanted to know why couldn't they hide locality resolutions into the engine? HC programming just seems so hard for me if I consider different cases where I'd have to pass units around owners to handle them in a single script. People seem to run HCs on a single machine anyway.
because the client doesn't know who owns the object
because he generally doesn't need to. As the server does all the interfacing anyway
Ownership is like the (remote) computer/process who is processing the object and streaming data on it, right?
Hmm i think I see the problem... probably it's too hard to synchronize the main process and HC processes so that SQF code executed at the server produces synchronous results when targeting HC handled objects 🤔
HC is just a "normal" client.
yes. That's too hard. They'd also need to do it for every other normal client
But imagine that HCs are the same machine, then there's no more huge network delay between them
@little eagle Good point that all languages have binary operators with the math operators /*+-, but can anyone think of any other scripting or compiling language that states parameters before function execution like [param1, param2] call my_func?
the parameters in SQF are either 0. Or one after the command. Or one before and one after the command
command
command arg1
arg1 command arg2
That's all that SQF supports.
the calling a function has the parameters on the left side is just arbitrary. It just sounds more logical call function instead of function call
I wish it was call function [params] though (or something similar)
Current thing is just inconsistent
It is arbitrary in the sense that SQF arbitrarily uses that pattern, but arg1 and arg2 are not swappable. We can't do "my_func call [param1, param2]" and get the same result.
And that's interesting, because most (all?) other languages went with the (equally arbitrary) arguments after the function like the standard C my_func(param1, param2). Even when dealing with reflected or indirect method invocation in other languages, both args and function pointer go to the right of the equivalent to 'call'.
Hi, I am wondering about something. If I want to make a function that return me a 50 character string. What would be the best choice in term of performance, should I call that function client or server side ?
if you need it on clientside.. then calling it serverside doesn't make sense. Same as other way around
right, thanks you
any idea how to import a preinit EH to arma 3 without using CBA?
NO! NO LUA
please T_T
am bringing in an old function suite from FRL_missilebox (the GPS/INS targeting system Myke made - with permission)
it relies on a preinit EH
//old CBA versions - need to make work in vanilla Arma 3
class Extended_PreInit_EventHandlers
{
FRL_GPSINS_preinit = "call compile preProcessFileLineNumbers '\uns_missilebox_c\functions\fn_GPS_preInit.sqf'";
};
//old CBA versions - need to make work in vanilla Arma 3
class Extended_GetIn_Eventhandlers
{
class Helicopter
{
FRL_GPShideObject = "_this spawn FRL_hideGPSobject";
};
class Plane
{
FRL_GPShideObject = "_this spawn FRL_hideGPSobject";
};
};```
use CfgFunctions preInit
How do I measure CPS in ARMA? Some server monitoring projects measure it somehow but i can't find how to do it properly on my own.
what are CPS? Do you mean FPS?
execute diag_fps on serverside
or use #monitor chat command
No they mean CPS... Conditions per second. wait I'll give a link
you can freeze the game down to 0 fps and do millions of "conditions per second" or run the game at 500fps and do 0 "conditions per second"
How would that arbitrary completly useless thing help you to measure something?
I think that's used as a "how loaded is the scheduler"
I don't know! I see it somewhere and a friend of mine is saying that it is supposed to help us measure server load. I'm trying to understand it as well.
In several exile server discussions I can see people comparing CPS
You'd wanna use something like https://forums.bohemia.net/forums/topic/216745-a-tiny-script-to-measure-sqf-scheduler-load/
That is essentially what ASM's CPS means. Where cycles per second is not really a fitting name
as 1 frame == 1 cycle
so CPS == FPS
Well as I understand the CPS script author is probably doing the same but in the 'FSM evaluation' part of the game? And it is somehow supposed to be linked with AI performance?
FSMs are scheduled, they have their own part of the scheduler
Most AI stuff doesn't run in FSM anymore I'd say
^ it does
besides danger.fsm?
yep
Oh man...
ASM is doing this
{
if (alive _x ) then {
if (isPlayer _x) then { _Players = _Players + 1 }
else { if (local _x) then { _locAIs = _locAIs + 1 }; };
};
} forEach allUnits;
How is it supposed to accurately measure performance if it does that in a loop?
I think that's how it reports the amount of units to the extention
yes. It is.
that's a very ineffective way to do it
afaik someone made a rewrite of ASM. Keep forgetting where to find that
Hmm... there's a similar program which also measures CPS somehow, called 'Marma'
https://www.exilemod.com/topic/26-marma-server-monitoring-live-map-re/
don't use it
it's payware, it doesn't comply to EU standards regarding privacy and you can't delete your account
payware? sure? I tried it a little over a year ago. And didn't have to pay anything.
Didn't get it to work at all anyway
I got it to work, but it was so barebones it was laughable
I tried it upon release afaik
If I need something I still run ASM
I don't need to dedi test stuff anymore 😛
So... AI performance is locked to FPS, no need to use 'CPS' or anything like that. Can I sum it up this way?
Ok, thanks a lot! 👍
for the monitoring tools, imo the best > #monitords also it's %100 free, without registration and sms 😄
Welp, time to upgrade my rig to nuclear standards
Yes... #monitor is great but we were considering what can we use for remote-monitoring of both our windows and linux server... maybe just make an Intercept addon for that to generate a super-simple HTML page or something like that.
ASM, AFAIK, doesn't have 64 bit executable
Correct. But the rewrite I mentioned provides a 64bit one
Does compile script command do anything more than load the text of a SQF function into memory as a character stream for fast lookup of the script text later? Or does it store it in memory as a condensed text version, an intermediate non-text representation, or native code?
yes. It compiles it
to intermediary assembly code
that get's executed by the script VM
how u know that much about SQF @still forum
😃
i know, just respect my friend
hmm, i don't now how to say that expression in English
https://github.com/Killswitch00/asm-linux tried it does not work :/
worked fine for me a couple months back
64bit linux version ?
yeah
one sec I'll look
thx man
yeah. 24000
"64bit linux Arma Server doesn't exist" ... fixed it for you
64bit linux absolutely does exist 😉
How could I add a script to run for an object on JIP players through the debug console while the server is already up? I can't seem to think properly right now...
@cold frost there is no second one. You can only have one.
@warm gorge if (didJIP)...
@warm gorge See remoteExec and remoteExecCall, and its JIP parameter which can be an object
Yep just ended up using remoteExec, cheers
could someone help me with some Init code im trying to attach a barricade to a vehicle while retaining its x,y,z
Do you mean that you want the barricabe attached to a vehicle with their relative positions remaining the same?