#arma3_scripting
1 messages · Page 555 of 1
But thanks for the link, I can make the file and add the postInit = 1; attribute
and should just call that file and initialise the internal functions
Hey guys - I've got a mission that uses the eden smoke and fire modules, which is quite happy in local MP but when I launch it on our server, I get repeated spam of examples like
14:00:44 Creation of object L Effects:2 failed, state LOGGED IN
14:00:44 Client: Nonnetwork object 787d9fa0.
or
14:00:44 Creation of object 279095: smokegrenade_green_throw.p3d failed, state LOGGED IN
any suggestions?
I wonder if I might be able to spawn the smoke modules after the mission starts to see if that fixes it?
if so, I don't know what i'd use to script spawning a module :/
@grizzled spindle
I can make the file and add the postInit = 1; attribute
use preInit, that way you can use them in triggers and such.
Anyone got a way to impose gear restrictions based on role for the ACE Arsenal?
make a custom ace arsenal for each class, then make the action to open each arsenal only show if the unit has a matching variable name
@jaunty ravine ^
not sure if you can do that with ace interaction, but you can deffinately do it with vanilla addAction
so, I'm trying to kill the headlights on some vehicles.
getAllHitPointsDamage this return, eg,
..."hitturret","hitgun","#light_l","#light_l","#light_r","#light_r"],[..."commander_turret_hit","commander_gun_hit","light_l","light_l","light_r","light_r"]
setHitPointDamage ["light_r",1] does damage the light, but not destroy it, probably because there's two of them. setHitIndex [23, 1]; does kill them, if the index is right, but the index changes depending on the vehicle.
Is there a way to kill the lights without either nuking the whole vehicle or making a huge switch with individual vehicle indexes?
There's probably some easier solution like this switch Light off or smth
kill, as in "not being able to turn them on"
Hi all, we are looking into inidb2 and try to get it to work with the ravage and vandeanson's apocalypse mods (to save player stats, position, gear, placed structures, vehicles and other things) . If anyone is familiar with setting it up for a dedicated server and might have experience or info to share that goes above what is currently accessible on the BI forum and Youtube, we would greatly appreciate a knowledge transfer:)
We have some experience with it and partially working code atm. Feel free to PM me. Thanks!
Hi @winter rose , whats up? Wrong channel? 🤔
I would say it's a mix between #arma3_scripting, #server_admins and #creators_recruiting yeah 😅
It's a big request and "hiring" instead of the usual script help one can find in this channel 😉
@scarlet rain
(I don't know anything about inidb2, though)
Ah ok sorry for that
(nor server management 😄)
no problem, I get that it's a big topic - I was just afraid it would be a "hey I want it done so ping me" request; my bad if it felt a bit rude
Oh nono, doing it (myself) is 90% of the fun😂
Just looking for others that might try to do or have done the same, to share experiences
to be fair; the Forum topic of iniDBI2 has decent documentation, answers a lot of questions and someone even posted some tutorial videos on youtube for it: https://forums.bohemia.net/forums/topic/186131-inidbi2-save-and-load-data-to-the-server-or-your-local-computer-without-databases/?do=findComment&comment=3291704
I've never worked with it (or Arma and databases in general), but it doesn't look too complicated
Yep i am working with the information on the forum and the youtube videos (these are great)
Further customizing the tutorial example was also doable
And all worked well in hosted mp
Getting it to work on dedicated servers was my specific issue, and figuring out if it is an issue with the code or the setup of the dedicated server
@thorn wraith You could try forEach getAllHitPointsDamage, check for "light" in each hitpoint name, and then using _forEachIndexto setHitIndex.
And my partner in crime is looking into saving vehicles
Just a broad summary of the challenges we have, didnt want to go into too much detail here, again , ad it is quite a specific topic
Yeah, that's what I'm trying atm, @digital hollow . Thanks.
https://pastebin.com/7xPnuMYd
can anyone point me where i went wrong?
its creating the box with no problem but with default item, not the item that i wanted it to fill. And the the item can't be picked up by another player.
i call this function with
if (isServer) then {
["001","bgBox","Box_NATO_Uniforms_F", [9627.385, 10021.998, 0.190], 94] call HKB_fnc_supplies;
};
is this a locality issue? if i local exec it in debug console, only i can see the box with the correct item, and other player cant pick up anything from the box.
fyi, it is for a dedicated server environment
That depends on what HKB_fnc_supplies is doing. Sounds like it's using addItemCargo instead of addItemCargoGlobal.
@digital hollow i have already give the link there. The link is HKB_fnc_supplies. And yes, it is using addItemCargo instead of addItemCargoGlobal. But the remove item part also is not working properly since it spawn the box with default loadout in it.
Ah so i need to use clear global command. I will try that
The point I was trying to make is that HKB_fnc_supplies is not a vanilla function and no one knows what it does except you.
does the in command not work on strings ?
because I'm copying the _isInString = "foo" in "foobar"; from BIki into console , and the RPT is telling me
>
16:58:43 Error position: <in "foobar";
>
16:58:43 Error in: Type String, expected Array,Object,Location
16:58:43 Error in expression <_isInString = "foo" in "foobar";
>
16:58:43 Error position: <in "foobar";
>
16:58:43 Error Generic error in expression```
@digital hollow that is why i left the link to view the function so anyone helping can know
anyway, i think you are right without even looking at the function. i have to try it first
Ah, devbuild. figures.
If i check if isServer like this,
init.sqf :
if (isServer) then {
[] execVM "1.sqf";
}:
and in 1.sqf:
if (isServer) then {
[] execVM "2.sqf";
};
would the if (isServer) check in 1.sqf become redundant since it has been checked for on the init execVM?
yes
okay. thanks @still forum
how about this?
init.sqf
if (isServer) then {
[] execVM "1.sqf";
}:
1.sqf:
[] execVM "2.sqf";
2.sqf:
if (isServer) then {
[] execVM "end.sqf";
}:
Does the check in 2.sqf redundant?
Yes
of course
if your script only ever runs on the server, why would you check isServer?
so there is no way of getting out of the scope once inside?
unless you call 1.sqf from a client, no
"out of the scope" not really? I can't think of a way.. as execVM creates its own, new scope, without any parent scopes, completely detached from where it was launched
just to be sure, calling from client is something like addAction does?
usually. but addAction code can also be called by the server
well not scope exactly, but i guess the server environment.
addAction can be called by the server? i thought a player need to activate it? just like trigger?
An AI can also use actions
triggers also run on server
initPlayerLocal will only run on a client.. But I think headless client too
but i guess the server environment.
You can't switch environment without remoteExec
yeah i notice that trigger can be check isServer to make it only run once by the server. but i haven't figured out the addaction called by the server part
AI is considered server?
ahh... remoteExec yes.
Afaik you also have a checkbox in 3DEN in the trigger, to let it run server only?
AI is considered server?
no. Sometimes. Depends on where the AI is simulated
pre-placed AI from 3DEN is usually on the server (which might also be the client)
And Zeus AI is usually on the client using zeus
And AI groups with a player as leader are on the players machine
yes i can, but im trying to spawn the trigger via script since i dont want to place a lot of trigger in editor since i am making some sort of campaign-type mission
but wouldn't a headless client take over all of those AIs?
no
by itself a headless client is just a normal client which does nothing
there has to be some script that sends none/some/all AI over to it
oh i see
Hi @still forum I have a quick question about your intercept-database addon. I have been looking at it and it looks very interesting. We currently use EXTDB3 but as im sure you know it uses callextension and I have heard that doesnt help server load. The question I have is to use the intercept addon will the clients need intercept to join the server or does it work just serverside?
Hey guys, can someone help me with finding the relative direction between two coordinates?
The problem is, BIS_fnc_relativeDirTo and getRelDir require the first parameter to be an object.
The second problem is that I'm retarded and completely forgot school geometry. :\
Forgive me if im wrong, but if you already know the two coordinates, why not spawn a small invisible object at them, calculate the relative direction and then delete the objects?
You're not wrong but the function I'm writing will be running constantly and the object will have to be spawned in the player's view so I'm wondering if there are better options.
I mean, there are - finding an angle between two vectors is nothing new - but I'm struggling with writing it from the ground up atm
Was kinda hoping that there's a library somewhere where this function is already implemented
Actually, maybe I should check existing arma frameworks...
@tough abyss https://community.bistudio.com/wiki/getDir
Thing is, I'm looking for a relative direction between two points.
Oh
Right
A point has no direction
That's why the first argument has to be an object
Told you I'm retarded
Okay, I'm gonna try to pull it off with invisible object then
You could props use grasscutters for that
Made it work with air balloons with Show Model = false
Good enough I guess, thank you guys
@tough abyss you can also subtract the direction you have from the result
No need for an object here.
Just a quick one from mwe
_someArray = [["some","thing"], ["In an", "Array"]];
_curFnc = lbText [1500, lbCurSel 1500];
//find _curFnc in _someArray then return the nested array, i.e _curFnc is "some"
//_return = find "some";
//_return would then be a number you can just do select 1 to get "thing"
```Obvs the commented bit is sudo code for what i'm trying to do 🙂
Nvm I think I got it
do someone know how to make steps in the snow (basically just steps, no matter where)? I mean, when unit walks there are steps behind it. But i need to create them via command.
sorry. wrong keyword in google. Thx!!
God I sound like an old man
😄
@brave jungle
but you are an old man
_d=[player] spawn
{
params["_man"];
while {alive _man} do
{
{
hint format ["surfaceType=%1",surfaceType getpos _man];
if (typeOf _x == "#mark") then {_x enableSimulation false;};
} foreach (nearestObjects [_man, [], 3]);
sleep 1;
};
};
this is sweet
Hey guys. So I'm trying to run a script that will negate fall damage for specific units. I tried some stuff from some forums, but didn't really have any luck and just wanted to see if it was possible or not.
Fall triggers "" damage type in handleDamage EH, but so can do grenades and (to some extent) bullets
You would have to check with diag_tickTime if the "" damage is close to any other bullet/grenade damage or if it is "just" a fall
@brave jungle findIf
_index = _someArray findIf {_x select 0 == _curFnc} //Only first element in every subarray
_index = _someArray findIf {_x find _curFnc != -1} //Any element in subarray
returns either the index, or -1 if not found.
So _curFnc param [_index, []] returns either your ["some","thing"] or [] if not found.
UAV has a blufor AI inside it. I guess you might need to replace the AI 🤔
You can disconnect the terminal
https://community.bistudio.com/wiki/connectTerminalToUAV
https://community.bistudio.com/wiki/UAVControl
Maybe you can connect it to a opfor unit
The blufor crew is B_UAV_AI and opfor is O_UAV_AI
I guess you can find the AI with https://community.bistudio.com/wiki/crew
and then deleteVehicle it.
And then createUnit a new AI of the other faction, and https://community.bistudio.com/wiki/moveInDriver it into the UAV
Umm easy way is like spawn in example.(Nato Darter) and than hold Left CTRL and group it to 1 OPFOR AI. It should make Drone change faction from NATO to OPFOR
in a zeus case*
script way for that would be join.
join the AI inside the darter (via crew) into the group of a opfor unit
Hey is there a script to get all weapons of a faction?
Weapons are faction agnostic.
Dam
There are no config entries stating which faction a weapon belongs to (unlike uniforms)
I guess you could find all units of that faction which you can spawn using 3DEN. And then just collect all the weapons they spawn with
Oh yeah.
O awesome thanks ill try it out
Is it possible to disable friendly fire damage only for a group members (using ACE) ?
Solved:
player addEventHandler ["HitPart", {_this select 0 execVM "checkShooter.sqf"}];
params ["_target", "_shooter"];
Anybody know where I could find reference points for aircraft locations
for example I attached a camera
spy6 attachto [jet2, [0,0,0], "front"];
but front is clipping inside. I could adjust the location [0,0,0] but wondering what other labels would work besides "front" or "Back" and where I could find the list of available ones.
the available points are vehicle specific
I don't think there is a script command to retrieve them
i checked the fandom and stuff couldnt find it
No. Its encoded inside the model, which is binarized and you can't really look at
so you just guess?
Basically. If you read somewhere that some jet has a point with a specific name, you can try if it works on your jet too
You can unpack the pbo, and open the model file in Mikeros Eliteness which I think displays some of these points, not sure how many or if at all or whatever
i tried cockpit but no luck
I just adjusted the vector and I guess it works
i tried to put "back" instead of front
and the camera is still the same. So I dont think either are actual points
Uh.. I assume eye ? Thats it for weapon scopes I think
driver, cargo, PilotCamera_pos, doplnovani, codriver
try these
These are listed in the vehicle config for the A10 jet
?
?!
spy4 = "camera" camCreate [0,0,0];
spy4 attachto [jet1, [0,1,-0.7], "canopy"];
thats what I got so far and it works pretty good
ill check out these
spy6 = "camera" camCreate [0,0,0];
spy6 attachto [jet4, [0,1,1], ""];
and that works fine as a body cam if jet4 is the name of the guy
none of those other tags seem to work
spy4 = "camera" camCreate [0,0,0];
spy4 attachto [jet1, [0,1,-0.7], "canopy"];
spy5 = "camera" camCreate [0,0,0];
spy5 attachto [jet2, [0,1,-0.7], "canopy"];
spy6 = "camera" camCreate [0,0,0];
spy6 attachto [jet3, [0,1,-0.7], "canopy"];
works pretty well for anybody in the future
Hi. Have a question for the skilled scripters.
walks away
See u! 😄
What do you think, is there a hard technical restrictions in the engine to make a huge, solid single mission with approx. 40-60 hours of the seamless gameplay? Read somewhere that there's some accumulated errors that cause a memory leaks and no matter how carefully you delete unused entities, bodies, terminate scripts, e t. c. Sooner or later yo'll get a lags.
Doeas anyone have an experience with such things?
The deal is a seamless RPG-style gameplay represented as a single mission, not a campaign nor a MP mode.
Thank you if let me know with some proofs. It's realy interesting thing for me that I never deal with before.
'memory leak', not 'memory lick'
Sorry I just couldn't get by that...
Ahaha
Well I had a liberation/insurgency on my server running for about a week. But no constant players playing on it
I would strongly advice against it, lots of things can go wrong in 60 hours of play
I'd rather focus on implementing proper save/restore to be able to stop/resume the game at any point. Lots more work, but atleast always safe
Shouldn't the default save thing work good enough though?
That's the question.
not in MP
Sorry for my little rough upper intermediate 😄 The question is 'bout SP, just SP
Read about these errors somewhere on the BIforum, can't find where exactly
Do you mean RPG as in something similar to full on rpg games like skyrim?
Something like
Dialogues, quests, procedural generated enemies that are timely terminated/deleted/collected. But I just can't find any close example in a community made SP game modes. And that's another reason why I seriously doubt
I think 60-hour-long should be ok, just collect garbage (dead enemies and their dropped weapons)
is there any issue if i use normal mission folder rather than using pbo with dedicated server?
How do you load the mission on the server then? File patching?
pbo is a bit fussy when it come to testing in server, shut down the server, fix the script, repack the pbo then restart the server. 😩
My unit is using only unpacked missions and we never had any problems. (windows)
🤷
I'm not sure if i remember right but I recall that there migth some problems with that on linux.
@grave stratus
Create two arma profiles, run two arma instances with different profile names, test the mission by self-hosting from the editor from one profile, and joining with the other profile
@hollow thistle i've just tried it, some of the script doesnt work accordingly
@astral dawn i can run 2 arma instances?
Of course you can, why not
But only if you start them with different profiles
Check the launcher parameters
Becausei f their profiles are same, they can't access to the same .arma3profile files
i see
that is a better solution
don't need to use pbo. such a hassle
thanks @astral dawn
i thought it like some other game where you can only run 1 instance
You can also easily start dedicated with correct mods via launcher -server param
@hollow thistle noted. thanks
How do I detect if a static weapon gets disassembled?
According to biki, the event handler doesn't get the disassembled object's handle :(
this addEventHandler ["WeaponDisassembled", {
params ["_unit", "_backpack1", "_backpack2"];
}];
You mean it's not objNull?
Ugh... what the hell...
Indeed 🤔
Any idea how I can check if it's disassembled or not?
isObjectHidden returns false
if it's disassembled
_weaponListS = [];
_weaponAmmoListS = [];
{
if (side _x isEqualTo Resistance) then {
_wepClassS = primaryWeapon _x;
_weaponListS pushBack _wepClassS;
_WepAmmoClassS = (primaryWeaponMagazine _x) select 0;
_weaponAmmoListS pushBack _WepAmmoClassS;
};
} forEach allUnits;
_GunsCacheScav = nearestObjects [CentreMass,["Box_Syndicate_Wps_F"],6000,true];
_AmmoCacheScav = nearestObjects [CentreMass,["Box_Syndicate_Ammo_F"],6000,true];
_TheBoxS1 = selectRandom _GunsCacheScav;
_TheBoxS2 = selectRandom _AmmoCacheScav;
_TheGunS = selectRandom _weaponListS;
_TheAmmoS = selectRandom _weaponAmmoListS;
_TheBoxS2 addItemCargoGlobal [_TheAmmoS,(selectRandom [2,3,4,5,6,7,8,9])];
_TheBoxS1 addItemCargoGlobal [_TheGunS,2];
Sleep 2;
_weaponListN = [];
_weaponAmmoListN = [];
{
if (side _x isEqualTo West) then {
_wepClassN = primaryWeapon _x;
_weaponListN pushBack _wepClassN;
_WepAmmoClassN = (primaryWeaponMagazine _x) select 0;
_weaponAmmoListN pushBack _WepAmmoClassN;
};
} forEach allUnits;
_AmmoCacheNato = nearestObjects [CentreMass,["Box_NATO_Ammo_F"],6000,true];
_GunsCacheNato = nearestObjects [CentreMass,["Box_NATO_Wps_F"],6000,true];
_TheBoxN1 = selectRandom _GunsCacheNato;
_TheBoxN2 = selectRandom _AmmoCacheNato;
_TheGunN = selectRandom _weaponListN;
_TheAmmoN = selectRandom _weaponAmmoListN;
_TheBoxN2 addItemCargoGlobal [_TheAmmoN,(selectRandom [2,3,4,5,6,7,8,9])];
_TheBoxN1 addItemCargoGlobal [_TheGunN,1];
Sleep 2;
So this script for me works but. it comes up with an error
the error is undefined variable _WepAmmoClassN and _WepAmmoClassS
Use private 👀
the assembled mortar still exists
when disassembled
its hidden/simulation disabled though
OMFG thanks @tough abyss that explains so much..
We once disassembled a machinegun while a guy was still inside. We thought we packed him into a backpack.
Any idea how I can check if it's disassembled or not?
@astral dawn maybe bounding box? Cuz the collision gets removed when disassembled, so it might return 0 for the geometry bounding box?
@proud carbon if the weapon has no magazines loaded, then it won't return any magazines, and you cannot select the first one in the array as the array is empty
Hi all. I'm using Laxemann's fantastic script for ambient civs. The script checks on players in the game, and then spawns/despawns civs within a set boundary. There is an option to ignore certain players to keep the script running smoother - given that my unit plays as a team in close proximity, I don't need to script to check on every player. The script has the following code, and I've input all the playable unit variable names that i have placed in the editor. However when I run the mission, the script throws an error if any of the units are not players:
// Units the script will ignore
// Example: L_ambiDrive_blackList_players = [MyUnit1,MyUnit2];
L_ambiDrive_blacklist_players = [p2,p3,p4,p5,p6,p7,p8,p9];
Any thoughts on how I can just feed the current players, minus me?
allPlayers - [me]
finding me might be a problem, unless you know that you are always p1 and are always there
also allPlayers constantly changes when a new player joins/leaves
Yes I'll be there 🙂
Thanks mate
We'll be relatively consistent
Can i put that straight into the square brackets?
L_ambiDrive_blacklist_players = allPlayers - [p1];
One further question
I have an intel item in game, using ] remoteExec ["BIS_fnc_holdActionAdd", 0, intel1]; // MP compatible implementation
this is where the player has to hold space to interact with the object
On the "on completion" section of the script, I have added objective1adone=true ( { ["init", [intel1,"intel.jpg", "this is your itenl"]] call BIS_fnc_initLeaflet; objective1adone=true;},
I then have a trigger waiting to pick up "objective1adone", which triggers a completed task module
This works in SP testing, but doesn't seem to be working in Dedi testing
The script is placed in the initServer.SQF
Is this something to do with the variable objective1adone not being global?
intel*
publicVariable @tough abyss
Thanks mate so I declare it publicVariable objective1adone = true ?
objective1adone=true ( { ["init", [intel1,"intel.jpg", "this is your itenl"]] call BIS_fnc_initLeaflet; objective1adone=true;},
what? that looks like a syntax error
Sorry, ignore the first section of that
Complete code as it currently is:
[
intel1, // Object the action is attached to
"Hack Laptop", // Title of the action
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", // Idle icon shown on screen
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", // Progress icon shown on screen
"_this distance _target < 3", // Condition for the action to be shown
"_caller distance _target < 3", // Condition for the action to progress
{}, // Code executed when action starts
{}, // Code executed on every progress tick
{ ["init", [intel1,"intel.jpg", "Captain Hussein. We've pushed the AA patrol out to a vantage point South-East of the base. This allows us to cover the South-Eastern approach to the region; our Russian intelligence counterparts assess that this is the most likely route a potential aggressor will take to ingress the region. Regards - Sergeant Mohedeein."]] call BIS_fnc_initLeaflet; objective1adone = true;}, // Code executed on completion
{}, // Code executed on interrupted
[], // Arguments passed to the scripts as _this select 3
12, // Action duration [s]
0, // Priority
true, // Remove on completion
false // Show in unconscious state
] remoteExec ["BIS_fnc_holdActionAdd", 0, intel1]; // MP compatible implementation
Or you mean { ["init", [intel1,"intel.jpg", "this is your itenl"]] call BIS_fnc_initLeaflet; objective1adone=true;} is just your code?
please put code blocks into ``
or
```sqf
```
replace objective1adone = true
By
objective1adone = true;
publicVariable "objective1adone";
Thank you : - )
publicVariable broadcasts that variable to all other players+server
@tough abyss https://community.bistudio.com/wiki/publicVariable
with pleasure, the channel is here for that
Hmm. No luck 😦
In the trigger condition I have:
objective1adone
And in the initServer.SQF:
[ intel1, // Object the action is attached to "Hack Laptop", // Title of the action "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", // Idle icon shown on screen "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", // Progress icon shown on screen "_this distance _target < 3", // Condition for the action to be shown "_caller distance _target < 3", // Condition for the action to progress {}, // Code executed when action starts {}, // Code executed on every progress tick { ["init", [intel1,"intel.jpg", "Captain Hussein. We've pushed the AA patrol out to a vantage point South-East of the base. This allows us to cover the South-Eastern approach to the region; our Russian intelligence counterparts assess that this is the most likely route a potential aggressor will take to ingress the region. Regards - Sergeant Mohedeein."]] call BIS_fnc_initLeaflet; objective1adone = true; publicVariable "objective1adone"; }, // Code executed on completion {}, // Code executed on interrupted [], // Arguments passed to the scripts as _this select 3 12, // Action duration [s] 0, // Priority true, // Remove on completion false // Show in unconscious state ] remoteExec ["BIS_fnc_holdActionAdd", 0, intel1]; // MP compatible implementation
Just checked again and it works in editor SP and editor MP. Just not on dedi
Hey. I got a question. I'm working on a permadeath mission with radioactive zones. Currently I have it set up like this:
Trigger:
Cond: this && (player in thisList)
OnAct: { [_x] execVM "badtimes.sqf"} foreach thisList
With the script:
// Radioactive Zone
_unit = _this select 0;
Pcolor = 1;
Pbright = 1;
Pgrain = 0.005;
Pblur = 0;
Pdamage = 0;
Pstamina = 60;
while {alive _unit} do {
_unit call ace_medical_fnc_handleDamage_advancedSetDamage;
[_unit,selectrandom [0.2],selectrandom ["head","body","hand_l","hand_r","leg_l","leg_r"],selectrandom ["bullet","grenade"]] call ace_medical_fnc_addDamageToUnit;
"colorCorrections" ppEffectAdjust [Pbright, 1, 0, [1, 1, 1, 0], [1, 1, 1, Pcolor], [0.75, 0.25, 0, 1.0]];
"colorCorrections" ppEffectCommit 1;
"colorCorrections" ppEffectEnable TRUE;
"filmGrain" ppEffectAdjust [Pgrain, 1, 1, 0, 1];
"filmGrain" ppEffectCommit 1;
"filmGrain" ppEffectEnable TRUE;
"DynamicBlur" ppEffectAdjust [Pblur];
"DynamicBlur" ppEffectCommit 1;
"DynamicBlur" ppEffectEnable TRUE;
Pcolor = Pcolor - 0.04;
Pbright = Pbright - 0.03;
Pblur = Pblur + 0.1;
Pgrain = Pgrain + 0.0015;
Pdamage = Pdamage + 0.03;
Pstamina = Pstamina - 2;
sleep 5;
};
My question is; Where would I put a playSound if I wanted to have the player locally hear a geiger counter?
{ [_x] execVM "badtimes.sqf"} foreach thisList you are running your script N times, even though you only want to run it once, for the player
you run it for other units inside the trigger area too, but for these your script won't work at all as you are using local-only stuff on remote units
replace { [_x] execVM "badtimes.sqf"} foreach thisList with [player] execVM "badtimes.sqf"
you also want to make sure it doesn't fire again when the player leaves/re-enters the trigger
you can put your playSound anywhere
I assume you want the geiger counter sound to repeat, so place it anywhere inside your while loop
Mhm. I do want it to be repeated. As to simulate the damage getting worse overtime. Hence the sleep 5;
Every 5 seconds the player recieves the 0.2 ACE damage, until they get knocked out or die.
or would this cause for lag if x amount of players would be present?
Mhm. I do want it to be repeated. As to simulate the damage getting worse overtime. Hence the sleep 5;
the thing I talked about is a different kind of repeat
Get rid of the forEach
Ah, gotcha.
How does Arma handle the audiovolume of a sound? I have playsound just underneath "DynamicBlur" ppEffectEnable TRUE; but I don't hear it.
Gotcha
Thanks for the help Dedmen. Works like a charm now!
@tough abyss why don’t you put it in the initPlayerLocal.sqf and remove the remoteExec stuff just call the function with these arguments. Maybe I missed something you wrote before but I normally put it there and it works every time
How can I give a randomly spawned helikopter a variable name? I tried it using this in my init.sqf, but don't think it works.
_randomSpawn = [[710.365,1173.63,0],[1445.93,1673.6,0]] call BIS_fnc_selectRandom;
_veh = createVehicle ["CUP_O_Mi8_medevac_RU",_randomSpawn, [], 0, "none"];
_veh setVehicleVarName "heli";
@tough abyss like, myChopper ?
Yeah
instead of _veh
Oh, check.
So this:
_randomSpawn = [[710.365,1173.63,0],[1445.93,1673.6,0]] call BIS_fnc_selectRandom;
heli = createVehicle ["CUP_O_Mi8_medevac_RU",_randomSpawn, [], 0, "none"];
use
instead of that bis func
also you might wanna keep the setVehicleVarName, depends on what youre trying to do but doesn't hurt if its there
And PRIVATE your variables plz
Not sure what you mean by private it, but I'm a obvious newbie. So far, Got this with your help:
_randomElement = selectRandom [[710.365,1173.63,0],[1445.93,1673.6,0]];
heli = createVehicle ["CUP_O_Mi8_medevac_RU",_randomSpawn, [], 0, "none"];
heli setVehicleVarName "heli";
private is not that important for a newbie, but it may prevent further issues
Only the alternative syntax 2.
Not the string or array variants
maybe the page should make it more obvious that you're supposed to use "alt syntax 2" instead of the main syntax 🤔
It throws a fit over randomspawn. maybe I didn't understand how it works correctly.
Mhm
I suppose it should be _randomelement on the second line then?
And that worked.
In hindsight its always obvious.
Although, it doesn't assign a variable name for some reason.
meaning? if you do heli setDamage 0.75 it does damage the heli, right?
So owner of a unit I have just created within this frame returns 0, what's the proper way to get his owner?
That command only works on the server.
Yes I am a server in a MP game, my clientOwner is 2
Later when I look at the unit, owner cursorobject returns 2 🤷
I assume it's not initialized at this frame or something like that?
Oh, I see. You could try CBA_fnc_execNextFrame
Steps to reproduce if anyone would need it:
_guy = (group player) createUnit ["I_Soldier_TL_F", getpos player, [], 3, "NONE"];
systemChat (format ["Initial owner: %1", owner _guy]);
_guy spawn {
sleep 0.0001;
systemChat (format ["Later owner: %1", owner _this]);
};
Output:
Initial owner: 0
Later owner: 2
(someone should add this .... to the wiki I think 👀 )
Thanks Ampersand, I will find a workaround
Is there a way to disable the sirene on the ambulance?
@winter rose You set damage to 0.75, so 75%. It's not added, but set.
0 full life, and 1 destroy.
I have a question too about flags and event handler
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers
https://community.bistudio.com/wiki/BIS_fnc_addScriptedEventHandle
On my init flag, I've tested:
[this, "FlagAnimationDone", {
systemChat "FlagAnimationDone OLD";
systemChat (str _this);
}] call BIS_fnc_addScriptedEventHandler;
this addEventHandler ["FlagAnimationDone", {
systemChat "FlagAnimationDone";
systemChat (str _this);
}];
this addEventHandler ["AnimDone", {
systemChat "AnimDone";
systemChat (str _this);
}];
[this, 0, false] call BIS_fnc_animateFlag;
When I test, I got FlagAnimationDone OLD
But never the 2 others.
So my question, are there 2 different systems for Event Handler ?
@marble sigil … thank you? 😁
@marble sigil if you check https://community.bistudio.com/wiki/Arma_3:_Event_Handlers , you will notice that "FlagAnimationDone" is not a real Event Handler.
Yes it's not in the official list, but you can use specific event for specific (or custom?) objects
So it's really 2 different systems?
yes
Thx you @winter rose
How come this code doesn't add the second item to an arsenal? ( I perhaps should add that _commonBackpacksis used in an "if" statement )
_commonBackpacks = "rhsusf_assault_eagleaiii_ocp", "rhsusf_assault_eagleaiii_ucp";
Probably really simple, but I can't figure it out.
_commonBackpacks = ["rhsusf_assault_eagleaiii_ocp", "rhsusf_assault_eagleaiii_ucp"];?
Whole script:
_commonBackpacks = ["rhsusf_assault_eagleaiii_ocp", "rhsusf_assault_eagleaiii_ucp"];
if (typeOf player == "rhsusf_army_ocp_officer") then
{
[_this, [_commonBackpacks]] call ace_arsenal_fnc_addVirtualItems;
[_this, false] call ace_arsenal_fnc_initBox;
};```
Using the above code, neither of the backpacks show up.
Now that you've added [], what do you think [_commonBackpacks] resolves to?
rhsusf_assault_eagleaiii_ocp", "rhsusf_assault_eagleaiii_ucp"
But I could and probably am wrong.
[_commonBackpacks]
is now
[["rhsusf_assault_eagleaiii_ocp", "rhsusf_assault_eagleaiii_ucp"]]
ah...
Then another issue arises; If I want to add more backpacks on top of _commonBackpacks, how do I go about doing this?
Or is that simply not possible?
I'm pretty sure you need to do initbox before adding the items. after you init you should be able to keep adding whatever you want
Does setGroupOwner work with empty vics (or should setOwner used for that)?
Also on which client will a empty vic be local (last driver?)
It doesn't really state anything? The only issue I see that it requires a group instead of an object
what do you mean by
empty vic
? empty vehicle?
any way,
it requires a group instead of an object
you have your answer @oblique vale
Anyone know what this means? https://gyazo.com/70173c7304cba695c261fdae6c20c8ae
you are using a _variable name in a global context
Idk what that means sorry. How can I fix it?
now it says this tf https://gyazo.com/f449cb4316a3766b5aaee0f50ce5046d
Does anybody have experience with ground vehicle/turret launched missiles? There is a function for fixing the missile firing position, but I can't seem to make the whole setup work properly.
BIS_fnc_missileLaunchPositionFix is the function. I looked at he Nyx AA (small Indie tank) for reference on how it's done, but the missiles on my vehicle are all firing from where the missile_move memory vertices are.
Here's a quick video showing exactly what it looks like:
https://www.youtube.com/watch?v=Ib4upgUjYEQ
@oblique arrow Where will I put it? https://gyazo.com/3175a56c5e7ff85da00cac555403bcf1
I dont know a lot about arma scripting, but I feel like you have too many ;'s in there
ok
how the heck does this command work
seems magical but it doesn't seem to work with just a group of vehicles with a waypoint
ok nvm i somehow managed to set the fuel on the lead vehicle to 0
@oblique talon typically, you only use ; at the end of a line
Hope there's no rule against shameless advertising, but I made this script and I hope someone will find a use for it https://forums.bohemia.net/forums/topic/226197-tinter-furniture-mp-compatible-and-dynamically-spawned-furniture/
how do I add my functions to the editor function library? They're all in a single .sqf. Description.ext looks like,
class CfgFunctions
{
class MMF
{
class Mission_Maker
{
class soldiers {file = "MMF_fnc\MFF_functions.sqf";};
class mobileGroup {file = "MMF_fnc\MFF_functions.sqf";};
};
};
};
Which registers the names but doesn't populate the functions.
@hot kernel Are you sure it's the right folder?
Also you'll have to split the functions into different files
Looks to me like this is your approach: https://community.bistudio.com/wiki/Arma_3_Functions_Library#File_Path
In which case I'd guess the folder is wrong
Is it possible to get a units weapon object? I remember reading in ACE's overheating script its not possible but I wanted to see if that functionality has been added but I havent found anything yet
@jolly jewel , the one I posted above has a typo. After a bit of research I decided not to do this anyway
Alright, fair enough
I was half considering just recommending doing it the way I usually do, but I decided not to be lazy and actually try to fix your problem
I mean, it can be done but for my purpose it's not necessary-- we don't need the functions in the editor-- quite the opposite
@jolly jewel , out of curiosity what's the method you usually do?
@edgy dune , you mean like an object ID?
class cfgFunctions {
class tint {
class furniture {
file = "furniture\functions";
class dressDown {};
class dressUp {};
class translate {};
class updateHouse {};
class init {postInit=1;};
};
};
};```
does the file functions contain multiple functions? yes?
No, that's just that path
Every function in the folder will be named fn_[classname].sqf
oh, so loose files in that functions folder
Yeah you got it
thanks for helping me to understand
No problem!
@hot kernel like how player returns the player object and so u can thus use setvariable and stuff likd that
@edgy dune is that,
https://community.bistudio.com/wiki/currentWeapon
?
I don't think there exists a "weapon object" in the game code (Someone correct me if I'm wrong), but even if there did, there is currently no way to get it
@hot kernel that returns the class of the weapon, like for example i want to get the current weapon and say setvariable["is_jammed",true] or something like that
Also rip im on phone so sorry if format is bad
Say you're creating a mod, is there anyway within that mod to listen for default event handlers.. e.g. I want the mod to listen for onPlayerKilled and the execute code
Has any info on the spectrum device come out yet?
@edgy dune
Is it possible to get a units weapon object
no, it doesn't exist a weapon is not an object
@plucky wave just make a preInit script using CfgFunctions, and register that eventhandler
There is also CfgEventHandlers config class I think? not sure how useful that is
@still forum Can you elaborate when you say register that eventhandler? Got an example at all?
@still forum Do you have any idea on how to grab the selected values from a module?
yes. atleast I know that I would search in old ace/tfar code for it
I don't know how to do it right now
Can someone esplain me what I am doing wrong?
When I paste this code:
this addEventHandler ["Fired",{mortar_fired = true; _this select 0 removeAllEventHandlers "Fired"}]
I get "Error invalid number in expression"
What does this mean?
did you copy his code for the BI forums?
Yes, I've fund this code to use in the init of the unit.
Shouldn’t _this select 0 be surrounded by brackets?
Copy the code again from dicord thing you pasted above, and put it back into your script
Where did you copy it from? Looks like might contain bom chars
I just asked exactly that above.
BI Forum probably inserted errornous characters into it that you cannot see, but break the script.
The post that I've found is this: https://forums.bohemia.net/forums/topic/167316-detect-if-aircragt-weapon-fired/
I need only that when a specific mortar fires, it activate a trigger
Can't see any errornous characters in there
Maybe I've resolved this, instead of "_this select 0 removeAllEventHandlers "Fired"
I've used only "this removeAllEventHandlers "Fired"
no, you didn't resolve it
you are now just using a undefined variable
this doesn't exist in there
Well he’s putting it in the init of a unit right? So using ‘this’ is referencing the object of the unit
Which would work and remove the event handler from the object, in this case, the unit
So using ‘this’ is referencing the object of the unit
no it isn't
this is a local variable, and local variables don't carry over into new scripts, which is what addEventHandler is creating once the event fires
So if the unit is affected to other scripts, those will not work?
However seems that rewriting the code manually, fixed even the _this select 0 problem.
I dunno why it happen, even if it's identical the one I wrote here.
Thanks for the help however
You're right
The problem it's that I am slow to understand 🙈
Have anyone ever stumbled upon the possibility to change/increase the range of the “rearm” function with rearm vehicles ?
That would be a mod, or you can (maybe, and maybe barely) script it with a set repair cargo command and a distance radius
how to disable and delete a module? ModuleRespawnVehicle_F even afther being deleted with deletevehicle still active and spawning vehicles
Hi folks, I am still trying to get my head wrapped around MP scripting. I am including this [player, [missionNamespace, "inventory_var"]] call BIS_fnc_loadInventory; in onPlayerKilled and onPlayerRespawn, and it seems to work fine. However If I abort the mission as a player, then come back in, I lose my loadout (in me jimmies). How can I ensure the loadout is loaded after a player aborts and then returns to the mission? Thank you in advance for any help given 🙂
Restarting the server solves the problem, but is probably not the best solution..
random question: does the ACE grenade throwing trip the Fired event handler?
Does anybody have experience with ground vehicle/turret launched missiles? Asking again, in case the first time it was lost during fast-scrolling convos.
@thorn saffron I'd assume no
But afaik ACE has its own grenadeThrown/throwableThrown EH
I see, so I would need to track both EH if I want to be sure to catch the throw in the script
Hi all I just wanted to know how would I apply this script to an asset? I’ve never scripted before so I know nothing about this. I don’t know what files or anything to add this script too. Would be much appreciated if someone can help me and show me where to exactly put the script. Thanks so much!
That's not a script. That's a single function. Depends what you are trying to do and what you are animating. If you wanted to open a door for example, you could use a key event and do it from there. If it's a gate or something, an addAction could work.
single command*
@finite dirge Well I was told it was a script haha. It’s a building and I just want to animate the doors when opening them. There’s around 20-22 doors all together in the building. Any ideas?
Couldn't think of the word, was going to say "Engine Function" but that's not right either.
Doors should animate when you open them already, no?
@finite dirge For me on this building they are not opening or animating. It’s a very strange thing since it worked perfectly fine a couple days ago...
Something definitely went wrong somewhere somehow... still trying to figure out what I done to cause this.
If it's a modded building, you'd have to find the source from it's config to animate the door with animateSource.
You could open door #1 from a default building with this:
buildingName animateSource ["Door_1_sound_source", 1];
@finite dirge The config on the building is a .bin file. Any ideas how I can open this file and edit it correctly to add the correct scripts/commands to open and animate the doors??
Imthatguyhere I’m so sorry about this but I’m not sure how to use this? Is it an application I can download and I just upload the .bin file to it and it’ll convert it??? I’m so sorry about this. Thought I was annoying you so I didn’t want to @ you.
Yep.
CfgConvert is a command line tool for converting configs between text and binary representation.
It's a part of the A3 tools package.
hello guys, I'm looking for a function to get the actual in game overcast, does this exist ? getOvercast doesn't seems to exist !
Thank you
No problem!
@finite dirge Hi again, if I send you the config will you be able to help me figure this out. I don’t understand what I’m reading it’s so confusing haha. Is it ok if you can help me or are you busy?
Look at this.. https://gyazo.com/5a7d69f693b69117cdede97ad0e1020a
Also this. Anything I should change/add? https://gyazo.com/d078d60a21709c2049b00d3e0908e981
Seems to be setup already to open in some capacity. Are you sure your issue isnt that you disabled simulation on the building?
@finite dirge No I haven’t disabled simulation. Also in the PBO file is it ok to use the .cpp file instead of the .bin file?
Anyone else know why this could be caused?
@thorn saffron you don't need both EH since the Ace EH is a wrapper for the base eh it tracks ace throw + the other base fired events
Has anyone ever made a tool that will parse SQF arrays into something like a PHP or Javascript array?
there are multiple SQF parsers in multiple languages
also.. isn't javascript array same syntax as sqf?
and php too?
Not really
They have functions to say, explode which converts a string to an array using a delimiter but I have a few multidimentional arrays in a mysql DB that im wanting to manipulate
This was on the right track of what im looking for, but i guess he gave up: https://github.com/JABirchall/Arma3Array
lol
Trying again 🙂 Have anyone ever stumbled upon the possibility to change/increase the range of the “rearm” function with rearm vehicles ?
Could anyone help me with the syntax I need to determine the name and UID of the pilot of a named vehicle, in an MP setting? I have a heli called "transport1". The heli can be flown by any player, but there is a mission (within an addAction) that is attached to the heli itself. Once any player triggers the mission from within "transport1", I would like to ID the player's name and UID so I can link the outcome of the mission to an entry in a database.
I assume 'currentPilot' is part of the equation, but I'm just way out of my depth with the MP stuff
Question regarding Headless client. We've got one on our mission, I've assigned about 60% units to it, they drive around, receive waypoints, etc. But they don't engage players; they'll just drive around them. Any suggestions?
I haven't specifically; double clicking on the group shows they are in red for combat mode...
Nothing has been set which changes their friend status, but I'll check?
setFriend hasn't changed either, west and east still are unfriendly 🙂
I mean, headless inherits the mission file like everyone else, and it's set up there
@rough dagger getting that information is easy you can do it local and send it to the server if thats where you want to process it? there are a couple ways to do it... do you have a file to remoteExec to or a addPublicVariableEventHandler setup?
@worn forge i script my ai so cant be much help as placing units in editor is something i dont do but when i script them i also use the below which may be of some help
{
{
_x enableAI "TARGET";
_x enableAI "AUTOTARGET";
_x enableAI "MOVE";
_x enableAI "ANIM";
_x enableAI "FSM";
_x enableAI "COVER";
_x disableAI "SUPPRESSION";
_x disableAI "AIMINGERROR";
_x setCustomAimCoef 0.05;
_x enableStamina false;
} forEach _unit;
};
especially "AUTOTARGET"
Well right now, I spawn the unit on the server, then my hc unit manager process figures out which groups will get loaded to the headless client (I aim for 60%)... then when I want to transfer ownership of the group it just does
_group = selectRandom _opforGroupsServer;
_group setGroupOwner hcID;
I can't see how transfering group ownership would stop FSMs and such
"AUTOTARGET" - prevent the unit from assigning a target independently and watching unknown objects / no automatic target selection
Good advice, I'll check and see if somehow the AI settings are getting changed
Wow, that customAimCoef, they should have pretty laser like aim 🙂
gotcha so pre ownership transfer the ai behave as intended and only on transfer they dont?
lol yeh but i have human like ai (as human like as you can get) with other custom things here and there
Yes, pre-ownership I don't mess with any of the enableAI categories
They are literally driving around players like they don't exist
have you tried setFriend post ownership transfer
it just sounds like they see you as friendly
that or ai behavior is disabled
another one to ponder... knowsAbout
@frozen knoll thank you for the reply, I think I can do either option (mentioned above)... I don't 'think' it needs to use addPublicVariableEventHandler , as I can simply update the DB from the mission file, I just need to be able to extract the relevant pilot/player ID and Name..
@worn forge to add to your transfer code
_group = selectRandom _opforGroupsServer;
_group setGroupOwner hcID;
{_group reveal _x} forEach allUnits;
@rough dagger and another thing to help understand how to help you... when the player triggers the mission are they automatically entered into pilot seat or do they still have to enter pilot seat?
they are free to choose a number of heli options, each heli will hold a different type of mission
ok so they still need to enter the pilot seat... so when it triggers you would require a waitUntil... i will quickly type something up that may help
thank you !! 🙂
waitUntil {(driver transport1) isEqualTo player};
_vehicleClass = typeOf transport1;
_vehicleName = gettext (configfile >> "CfgVehicles" >> _vehicleClass >> "displayName");
_vehiclePilot = driver transport1;
_VehilcePilotName = name _vehiclePilot;
absolutely sound! thank you 👌 🙏
np
Would scripting be the way to change how the player can see from driving a vehicle in the 3rd person view?
I hope this is a quick easy question.
What happens when a character or unit dies? Specifically what parameters change?
How do you make an extension for the linux server? What is the naming?
I have tried web.so and libweb.so but neither work
.so and whatever the name you are going to call it.
While on Windows the extension name is case-insensitive, on Linux the extension name is case-sensitive and should match the name of the .so file exactly (minus ".so" part). Currently only 32-bit extensions are supported on Linux.
Hm, confused af then
Got it working after dependency hell, works great on Windows
works on Linux, but I get a segfault after it's ran
nice
yeah linux dependencies are a little more wacky
Needed to use a more recent version of Debian, they stopped updating gblic on stretch I guess
Now I just need to figure out why the damn thing segfaults after
Does addMusicEventHandler also have the _thisEventHandler variable in it self? Can't find it on the wiki on it's page.
Ow wait it seems to be passed into _this if I read it correctly.
Is there a way to retrieve the amount of subclasses contained in a given config class ? Something like :
class myClass {
class subClassX { };
class subClassY { };
class subClassZ { };
};
And then calling some kind of function/command so we get such a thing :
_amount = (missionConfigFile >> myClass) call WTF_fnc_CfgCount
Here _amount would be 3 of course
BIS_fnc_getCfgSubClasses
gives you an array, can count it or whatever you want to do afterwards
How ! I thought such a thing would have been included in the "See Also" section of BIS_fnc_getCfgData. Thanks !
yeah sadly the see also sections are a bit hit or miss when it comes to including all relevant pages
Categories are usually more reliable for "big population" ones - you cannot have everything in the See Also
Can anyone confirm that magazinesTurret still is bugged in A3?
In A2 it, smartly, returns Magazines which are empty. Which, of course, makes it utterly useless.
Really awesome: Apparently "Jirka" has fixed counting of 'virtual' in 2007, but forgot to add his line to the turret (i.e. the important) part of the command (l. 2154 cont.) Just wow.
*'virtual' magazines
Hello guys I'm trying to get this script to work https://cdn.discordapp.com/attachments/274298407445725186/637701000760918036/HcFwd.sqf
It's aim is to transfer unit from zeus to the HC but the RPT keep trowing errors at me :
"onEachFrame",
{
if (isPlayer) exitWith {};
if (_x in units group _HC>
19:13:33 Error position: <) exitWith {};
if (_x in units group _HC>
19:13:33 Error unexpected )
19:13:33 File mpmissions\__cur_mp.Altis\HcFwd.sqf, line 11
19:13:33 Error in expression <"HcFwd",
"onEachFrame",
{
if (isPlayer) exitWith {};
if (_x in units group _HC>
19:13:33 Error position: <) exitWith {};
if (_x in units group _HC>
19:13:33 Error unexpected )
19:13:33 File mpmissions\__cur_mp.Altis\HcFwd.sqf, line 11
if (!isServer) exitWith {};
_HC = owner "HC1";
waitUntil {!isNil "_HC"};
[>
19:13:33 Error position: <owner "HC1";
waitUntil {!isNil "_HC"};
[>
19:13:33 Error owner: Type String, expected Object
19:13:33 File mpmissions\__cur_mp.Altis\HcFwd.sqf, line 5```
any ideas ? 😗
command neeeds an argument
also don't add a EachFrame eventhandler, when it will never fire
actually. Show the script I don't really see what youre doing there? CBA eventhandler?
probably scripted eventhandler 🤔
Okey.
if (isPlayer) exitWith {}; what are you trying to do with that?
_HC variable will be undefined
local variables don't carry over to other scripts
also owner returns a number, and takes a unit not a string
you cant call group on a number
in general that whole script is argument type nonsense
please read the wiki pages for all the commands you use there
also there is no reason to call setGroupOwner if it was already set, I'd recommend you check first
waitUntil {!isNil "_HC"}; that will never work as the variable never gets changed
if (_x in units group _HC) exitWith {}; that should never possibly happen
setGroupOwner doesn't put them into HC's group
if (isNull _HC) exitWith{}; this is terrible, you should remove the eachFrame eventhandler if you don't want it to run
rather than skip every iteration
I recommend you just spawn a while true loop, with a sleep inside, instead of using onEachFrame
ok, will try it ! Thanks a lot sir ^^
Is it really bad to add lots of intenvoty items into cargo boxes/vehicles with script? Does it cause a lot of traffic or anything like that, or I can use that safely?
I'd guess... not much probably 🤷
Constantly wouldn't be great, but if you have to fill it you gotta fill it somehow.
How do I get a vehicle's readable name?
through config
cfgvehicles >> class >> displayName
@mint kraken sqf gettext (configfile >> "CfgVehicles" >> typeOf mySuperVehicle >> "displayName");
Thanks!
Would scripting be the correct place to ask the question of why the 3rd person view in a car would change
I assume it is the same person in each car?
@pallid finch vehicle config, so not scripting but more #arma3_config
I'm attempting to limit an arsenal based on a player's role description, my current code looks like this:
if (roleDescription player == "Player 1") then {...}```
However this code doesn't work.
Also tried with:
_playerRole = roleDescription player;
if (_playerRole == "Player 1") then {...}``` But to no avail, still does not work.
Anyone have any ideas on what I'm doing wrong?
first ensure you have the proper valuesqf hint roleDescription player
Yep, it's the right value.
Tried with just roleDescription player as well and it returned "Player 1".
Are you using ACE, @tough abyss?
Then I can't help unfortunately.
Wat is ace3
Realism mod for Arma.
Ohh
My friend he new to coding n he doesnt know much but
He is pretty good
For not knowing much
I want him to put a full screen NV screen
:/
🙁
@jaunty ravine hes working on a vanilla server
Can someone help out
Sorry but I'm not that good at scripting so I can't help.
is there a way to execute a .sqf with add action globaly on a dedicated server?
@tough abyss
isClass (configFile >> "CfgPatches" >> "ModName")
You have to manually look it up. Often the mod has a main or common pbo and you can use that.
@modest temple have you looked at ‘remoteExec’?
Is there a way to detect if a map/area near a location is desert/woodland etc?
Would want to:
- getPos of multiple objects
- then drawIcon3D on the locations of those objects
Currently got this but can't seem to figure out and get it to work on my own (also getting an error with the version below)
_positions = [BLUFOR_1,BLUFOR_2];
{_helipadPos = getPos _x;} forEach _positions;
drawIcon3D ["\A3\ui_f\data\map\markers\nato\b_installation.paa", [0,0.3,0.6,1], [(_positions select 0),(_positions select 1), 1], 0.8, 0.8, 0, "", 1, 0.0315, "PuristaSemibold"];
}];```
BLUFOR_1 and BLUFOR_2 are objects (**HeliHEmpty**)
Hey so I am having problems with getting an object.
_Obj1 = nearestObjects [_point,["rhsgref_ins_g_Igla_AA_pod","rhsgref_ins_g_ZU23"],10,true];
_Obj = (_Obj1 select 0);
_AAname = getText (configFile >> "cfgVehicles" >> typeOf _Obj >> "displayName");
_description = format ["There is AA at grid %1. Be careful, We really need it to be taken out. it should be a %2", _gridPos, _AAname];
can someone tell me what i am doing wrong?
if gives out no error
put systemChat/hint to get variable contents @proud carbon
when bringing up an error, it is good to know which. what is happening with your code @forest ore ?
https://community.bistudio.com/wiki/surfaceType @worn flame
thanks Lou. Such error:
drawIcon3D ["\A3\ui_f\data\map\markers\n>
14:49:20 Error position: <drawIcon3D ["\A3\ui_f\data\map\markers\n>
14:49:20 Error Type Any, expected Number```
Thanks Lou!
so it doesn't come up with the variable contents with hint
Syntax: drawIcon3D [texture, color, position, width, height, angle, text, shadow, textSize, font, textAlign, drawSideArrows]
_positions = [BLUFOR_1,BLUFOR_2];
{_helipadPos = getPos _x;} forEach _positions; // helipad is never used -and- is unusable```
```sqf
_positions = [getPos BLUFOR_1, getPosBLUFOR_2]; // correct``` @forest ore
then you don't get a proper result with your command @proud carbon
make sure that the array result is at least 1 item long
if (count _obj1 > 0) then { (...) };```
ok, it isn't 1 item long
_array = [1,2,3];
_array select 0 // returns 1
_array = [];
_array select 0 // returns nil```
does that mean one of my class types isn't there when i spawn it?
it means it doesn't detect with the class you gave it, either it is not present, too far away or the class name is wrong
(see https://community.bistudio.com/wiki/Array#Index_out_of_Range for previous nil reason)
how do i get better detection with RHS AA?
…script better?
well the error is occurring class "rhsgref_ins_g_Igla_AA_pod".
in the most stripped down version of this script (e.g in a VR environment) does it work?
same error.
maybe the class is wrong then.
use typeOf to get the object's class
oh wait
you are using nearestObjects
it must be the class after switching out a different class. the script works
is it empty by all means?
not with a different class
so I could use
_Obj = nearestObject [_point,["rhsgref_ins_g_Igla_AA_pod","rhsgref_ins_g_ZU23"]];
instead of
_Obj1 = nearestObjects [_point,["rhsgref_ins_g_Igla_AA_pod","rhsgref_ins_g_ZU23"],10,true];
Lou, switched to this as per your suggestion
_positions = [getPos BLUFOR_1, getPos BLUFOR_2];
drawIcon3D ["\A3\ui_f\data\map\markers\nato\b_installation.paa", [0,0.3,0.6,1], [(_positions select 0),(_positions select 1), 1], 0.8, 0.8, 0, "", 1, 0.0315, "PuristaSemibold"];
}];```
and now the error is
```15:04:48 Error in expression <s = [getPos BLUFOR_1, getPos BLUFOR_2];
drawIcon3D ["\A3\ui_f\data\map\markers\n>
15:04:48 Error position: <drawIcon3D ["\A3\ui_f\data\map\markers\n>
15:04:48 Error Type Array, expected Number```
Not much changed with the error except Error Type Any changed to Error Type Array
becausesqf [(_positions select 0),(_positions select 1), 1] would result in sqf [[0,2,3], [5,3,2], 1] and that is not a proper position array
you should dosqf _positions = [pos1, pos2, pos3, etc]; { drawIcon3D [/* blabla*/, [1,2,3], _x, /*blablabla*/]; } forEach _positions;
I don't understand this [1,2,3] _x
Is that supposed to be the position information or what?
you should keep your drawIcon3D format, but use the forEach's "_x" variable as the position - because you are coding for multiple positions
Sadly not following in this case so had to hammer up something
_positions = [BLUFOR_1, BLUFOR_2];
{drawIcon3D ["\A3\ui_f\data\map\markers\nato\b_installation.paa", [0,0.3,0.6,1], [(_positions select 0),(_positions select 1), 1] _x, 0.8, 0.8, 0, "", 1, 0.0315, "PuristaSemibold"];
} forEach _positions;
}];```
and with that getting an *Generic error in expression* .. error
of course 😄
addMissionEventHandler ["Draw3D", {
private _positions = [getPos BLUFOR_1, getPos BLUFOR_2];
{
drawIcon3D ["\A3\ui_f\data\map\markers\nato\b_installation.paa", [0,0.3,0.6,1], [(_x select 0),(_x select 1), 1], 0.8, 0.8, 0, "", 1, 0.0315, "PuristaSemibold"];
} forEach _positions;
}];```
does it look clearer to you, as the how and why?
All I can say that at one point I tried with [(_x select 0),(_x select 1), 1] but at the time only had _positions = [BLUFOR_1, BLUFOR_2]; and at in no point I did not come across to test with _positions = [getPos BLUFOR_1, getPos BLUFOR_2]; also.
A lot is much clearer now but would not have been able to arrive there on my own. Thank you so much Lou 🙏🏼
the thing is for _x to exist, you need a forEach! A simple example:
private _texts = ["a", "b", "c"];
{
private _text = _x;
hint _text;
sleep 1;
} forEach _texts;```
Question, I am defining some class event handlers, i.e. onLoad, right. they are defined in the public (client) scope, and they are being invoked when the event spawn calls them. That much is fine.
My question is to do with the module in which we actually declare the event handlers themselves. Am I right in thinking that any module private variables we might have declared are basically lost once that scope has vanished? Sans the public scope event handlers, of course.
If we introduced a sort of "keep alive", do nothing, "manager", basically a forever sleep, would that keep the private variables alive?
my goal there is, I am defining some cross-cutting variables such as tuple indices, IDD and IDC variables, along these lines. I do not want to incur a public variable pollution, necessarily, yet the variables have cross-cutting application for this particular set of event handlers.
I suppose another strategy might be to add variables on the dialog itself and manage them that way. Of course, the tradeoff then is that we are constantly getting them from the dialog namespace when we want to use them. Better than a public variable pollution, but still with the downside of having to query for them, when we could simply define them once.
thoughts? suggestions?
any module private variables we might have declared are basically lost once that scope has vanished
What do you mean 'module private variables'? Variables declared asprivatein some script?
yes, in the module scope. i.e. private _a = "..."; Public_Event_Handler = { /* do something with _a */ };
Anyway it's ok to store variables in missionNamespace of in any other namespace, just give it a not-too-generic name like mic_house instead of house
if you do
private _a = "123";
public_eh = { player setdamage 1; };
then it's same as if you did
missionNamespace setVariable ["public_eh", {...}];
hmm sorry I was reading your msg wrong
that's the same as saying public_eh = "..."; ?
yes you are right, _a won't be accessible from the EH
so you won't be able to /* do something with _a */
unless you store _a somewhere else
like on object to which you attach the EH
or in mission namespace
or anywhere else
thoughts as to the efficacy of introducing a do nothing "manager" to keep the private variables alive?
your idea with spawning a script which will never terminate and thus keep _a value alive will not work too, because when EH is called it won't have access to _a anyway
EH is called totally without any context (in other words, without any local variables), except for the variables passed to it by arma
even though the module would still be alive, the scope is still basically "visible" ?
what is a module really? what do you call a module?
i.e. tacking a waitUntil { sleep 10; false; }; at the end, or something like that.
self contained .sqf script
a spawned script?
well what I have said still is true, there is no way to pass any variable to event handler, only way is if you setVariable somewhere
okay, appreciate the insights. forming a strategy how to approach this.
typically... you add EH to a control, you can setVariable on that control
...you add it to an object, well you can setVariable on an object too
I am leaning that direction I think. perhaps with a modest API to set, get variable set tuples from the object.
thanks
can create a macro to replace the long setVariable with setv :p
#define SETV setVariable if you are lazy to type
another my favourite definition is
#define pr private
why does Lou dislike me 😮
(like me)
CBA use a lot of GVAR and similar macros which convert
myParams
into
sparker_moduleName_myParams
it's like moduleName_submoduleName_varName... don't remember but you get the idea
yeah, I've studied the ACE framework. it is an interesting approach, but goodness the decoder ring you have to wear. thank goodness it is well organized.
unfortunately the code base I am working from is not nearly so well thought through, but I get the idea.
Hi all, I return with another MP scripting question 🙂 ... I have various locations in my map, that should spawn activity when players are near, and despawn said assets when all players have left the area. Could someone advise on the best if () then {} syntax for this?
Thanks in advance
Doesn't the base game dynamic loading system do that?
Hello, I have a question about removing benches from MH-9 Hummingbird with this script: this animate ["addBenches",0]; Is there any way how to remove options to still jump on the bench even if it's removed?
the base game (should?) remove the action
@oblique arrow sorry, was that in response to my question?
yes it was; the quantity of items is not an issue before long, but the quantity of simulated items might be
did you look up the in-game dynamic system @rough dagger ?
Been reading the wiki page on scripting, does anyone know any more in depth tutorials on how to begin?
which one did you read?
The beginers one
link?
I have opened vsc before but didnt know enough to go any thing
Just finished reading that one 2
Just found the useful links section of the first article
Going to read the first couple of those
Have fun!
Thanks @winter rose
Any good apps to write on my phone while im away from pc
Android phone or apple ipad
Found one
Is it possible to change any of the properties of a particle after it's been droped?
drop, no
setParticleParams, yes
you set the particle param before dropping it, once dropped, it lives its life!
@flint iris lockTurret
thank you @cloud thunder
My file should be names fileExample.[what do i put here]
So the question I had was about remoteExecs to a server. If I remoteExecCall to a server will the game be frozen until that function is complete?
As in server side
I know this is true for clients
As per the remoteExec Wiki
My file should be names fileExample.[what do i put here]
doesn't matter. Just matters that you use the same ingame
If I remoteExecCall to a server will the game be frozen until that function is complete?
yes
@winter rose @oblique arrow thank you both and sorry for the delay in responding .. I should probably not try to resolve scripting problems while at work 😉 I will research the simulation link as suggested .. thank you
Thanks Lou, not surprising but disappointing still.. I was daydreaming of fading out particles smoothly as the player approached lol
Thanks @still forum
Anyway to remove object textures set using setObjectTexture?
is there a clean way of converting "#(argb,8,8,3)color(0.365,0.541,0.659,1,co)" to [0.365,0.541,0.659,1]
i got a hacky way,
((("#(argb,8,8,3)color(0.365,0.541,0.659,1,co)" splitString "(") select 2) splitString ")") select 0 splitString ",";
``` but then still have to parseNumber on it.
Is there any ways to stress test a mission/server that anyone knows about?
@wary vine You can use find and select to make something dynamic to always pull the color arguments from a string
Ugly example: (i.e, pre-coffee code)```sqf
private _string = "#(argb,8,8,3)color(0.365,0.541,0.659,1,co)";
private _start = (_string find "color(") + (count "color(");
private _end = _string find ",co)";
parseSimpleArray format["[%1]",_string select[_start,(_end-_start)]];
trying to get an AI controlled AWACS roam the sky. The Sabre E-2 works when I set the group of driver to careless and follows waypoints. The Unsung E-2 doesn't, it flies straight to the closest bogey or AA to get shot down. Both code are the same and include ```sqf
awacs setVehicleRadar 1;
(group driver awacs) setBehaviour "CARELESS";
with the E-2 being named awacs
any ideas what could be the culprit with the Unsung E-2?
@ruby breach oh shit, ty
@ruby breach https://gyazo.com/9fb57eb29e28296c34baedbc500a5978 was so I could change the transparency on the textures for the window tint 😉
is there a way to report the call stack from a function?
Is anyone aware of a way to instantly load a magazine into a vehicles weapon similar to how
https://community.bistudio.com/wiki/addWeaponItem
etc work for infantry?
is there a way to report the call stack from a function?
https://steamcommunity.com/sharedfiles/filedetails/?id=1585582292
adds a script commandade_dumpCallstackwhich will dump the stack to RPT
@dreamy kestrel
@ivory lake you just use addMagazine
load, as in, load it into the weapon
no delay, instantly. that'd just add it to the pool
that doesnt help either.
why not
because that just changes how many magazines from the vehicles config are available
I want to have a weapon that is loaded, or unloaded, immediatley change to another magazine
from my past use it reloads it
go into editor jump in a pawnee or any vheicle... deplete its ammo and put in debug
and its instantly good to go
thats not what I want
"instantly load a magazine into a vehicles weapon "
oh ok so what magazine
ugh why would that matter
Look, to explain what I mean. Say a tank is switching from AP to HE
I can find out the tank is doing this with a reloaded eventhandler, and I want to make the switch
instant
for infantry weapons you can do that by using what I said, addweaponItem etc
have you tried it by use of the SWITCHMAGAZINE action ?
or does it still play out animation ?
its the same as selecting the option in the menu yourself, so yeah
Best way to check side of a vehicle in game? Have tried using side _vehicle however this returns CIV for everything. Is there a way I can check CfgVehicles for isKindOf BLUFOR/WEST?
whats the most efficient implementation (mod or script) of 2d map unit markers/icons?
@plucky wave you should check for a vehicle's faction (maybe through faction, maybe through config)
All good, found a way to do it. If anyone is curious:
_type = typeOf _vehicle
if (getNumber(configfile >> "CfgVehicles" >> _type >> "side") == 1) then {
@plucky wave question, does sqf faction _myVehicle work?
_vehicles = vehicles;
{
diag_log faction _x;
} forEach _vehicles;
would return:
19:54:26 "OPF_F"
19:54:26 "OPF_F"
19:54:26 "OPF_F"
19:54:26 "OPF_F"
19:54:26 "OPF_F"
19:54:26 "UK3CB_ANP_B"
19:54:26 "BLU_F"
thanks! 👍
Is there an arma 3 extension for vsc
there are a few, search the marketplace for sqf and arma
https://i.imgur.com/ucHEabK.jpg adding particles to spice up the fog? yay or nay?
https://i.imgur.com/ODHrSLx.jpg comparison
Thanks @errant patio. And @still forum , its the thought that counts!😀
Can I position entities in the editor then add other things in the init file
sure
Lads i'm back in here again.
I'm trying to figure out how to use playSound3D to have sound cues based on activated triggers in multiplayer.
I've followed KK's guide and added
private "_arr";
_arr = toArray __FILE__;
_arr resize (count _arr - 8);
toString _arr
};```
to my init.sqf
Now, i have an item with an Addaction that sets a variable true to activate a trigger that should play a sound with
```playsound3D [MISSION_ROOT + "sound\EMERGENCY.ogg", spooker];```
in the OnActivation field. Spooker is the soundSource.
And ofcourse it ain't working. Anyone know where i'm screwing up?
did you try logging the final path, to make sure its correct?
hint (MISSION_ROOT + "sound\EMERGENCY.ogg")
systemChat (MISSION_ROOT + "sound\EMERGENCY.ogg")
diag_log (MISSION_ROOT + "sound\EMERGENCY.ogg")
whatever, just to check that the path is correct
ALRIGHT GENTS I'LL SEE MYSELF OUT. the soundSource was Spooker1
spooky
31st is behind the corner
@crisp turtle https://community.bistudio.com/wiki/getMissionPath game updated 30 minutes ago. You now have that
Maybe things have changed, but isn't the description misleading, because now you just shift the problem? How would playSound3D work with an absolute path in multiplayer now? Or does the calling machine stream audio to everybody else?
Similar with createSimpleObject suggested in the description. It makes sense such a thing requires an addon path?
I mean, its use makes sense to pass proper paths to commands with local effect, like drawIcon3D as suggested.
you mean for things that are global? I assume the game knows that a file is in mission directory and can correctly resolve it interally
Well, if true, then that would make setObjectTextureGlobal work for textures placed in missions folders now. One can only hope.
Though, IMO would make more sense for BI to just designate a particular pboprefix for the mission...
rather than parsing "clientA\path\to\mission\blah\blah" to "clientB\path\to\mission\blah\blah"
to just designate a particular pboprefix for the mission...
we have that.. its called cur_mp something
dunno how they broke that
It seems like the truck boxer is disappering from a distance of ~ 50m. If you zoom it it appears again. Also the 3d vehicleshop preview from altis life seems to be broken Is there any fix?
Hi guys
Is it possible to modify a value in the server.cfg by a script at the server start?
no
And to configure a value outside of the file?
_str = "[""hint """"hello world"""";""]";
_a = parseSimpleArray _str;
diag_log _a; // ["hint """"hello world"""";"]
Shouldn't this be equal to ["hint ""hello world"";"] ?
Ok i guess the behaviour changed... "Since Arma 3 v.1.95.145925 the command will tolerate extra spaces and supports single quotes"
the right syntax now seems to be
_str = "[""hint 'hello world';""]";
_a = parseSimpleArray _str;
diag_log _a; // ["hint 'hello world';"]
Okay so the params command https://community.bistudio.com/wiki/params was not introduced until Arma 3. Anyone know what people used for this functionality in Arma 2?
_this select 0,1,2...?
Hey guys just wanted to ask if it was possible to attach a camera to where Zeus is looking?
Would use it as a on the go cutscene module, showing a live feed of wherever the Zeus is looking for all players.
With the new change of createVehicleLocal being disabled for multiplayer is there a way to spawn a with createSimpleObject?
Im using
_light = createSimpleObject ["#lightpoint", getPosASL _proj]; or pos = player getRelPos [10, 0]; light = createSimpleObject ["#lightpoint", pos]; and nothing will spawn
Is it possible to make a helipad a place to change pylon loadout on planes ingame ?
is doing drawIcon each frame more efficient than using markers and reposition them?
It's stated everywhere on wiki that drawicon is not more efficient than markers, but less
Also note that drawicon either doesn'r work with GPS or needs special handling at least
@short vine
With the new change of createVehicleLocal being disabled for multiplayer
its not. For one thats a bug and shouldn't have happened, second you can just set "unsafeCVL = 1" in description.ext to enable it.
Anyone have Arma open right now?
Does
this = 123 work to set the global variable named "this" ?
this = 123;
systemChat format["%1",this];
//123
OHMAGAD 😄
I hope this still doesn't work though… are commands protected? sqf player = 123;
VERY good news 😄
I hope that this as a global var doesn't override the "this" in init fields for example
no
local local variable
yeah the missing underscore is a little unfortunate
Thanks @frozen knoll
Does anyone know if it's possible to get the unit of a player with the PlayerConnected missionEventHandler?
if it is in the EH vars, yes? if not, no 😄
Yeah... there are a lot of vars provided in the EH but nothing so simple as a '_unit' since... i'm fairly sure it fires before there is one. Unsurprising given its name :p
if there is a mission event handler that can give me the player unit after they've spawned in general that'd be better but that doesn't seem to exist? :/
ah wait yes, because a player connects but is still in the lobby
I guess if you put that in a waitUntil or something it might work
but then it would never return true if the player doesn't actually join the game and just leaves again.. i imagine that's bad
yep
waitUntil time > 60, huhu
you can waitUntil player units are one more, because it would replace an AI
PlayerConnected is triggered when someone joins the server (into the lobby), so there is no unit available till he/she selected a slot, went through the briefing phase and fully loaded into the game...
Init and/or Respawn are most likely what you should be looking at
If you're using CBA then use XEH init on CAManBase and check via isPlayer
👀
that looks promising
it doesn't seem to catch players that are there at the start of the game but that's easy to work around, thanks a bunch :D
You sure? XEH fires immediatly after unit is created.
Maybe it's not player controlled at server init for a moment... 🤔
well i only tested very briefly but i didn't see the systemchats i expected until after i disconnected my client and then reconnected them
Quick one, when trying to play a sound file from within a pbo (sound file lives within same .pbo as the function that is executing it) what is the correct file path you should use?
the one that works @plucky wave
Well.. I guess thats the question, which one works??
Ta
is it just me or has something changed in the engine regarding client object creation or effects (ie particlesource) ?? i have a whole anomaly system that doesnt do any effects since 1.96
createVehicleLocal was accidentally broken
is being worked on
temporary workaround is to add unsafeCVL=1 in description.ext
bug or feature?
Changed: createVehicleLocal was restricted in multiplayer - enterable vehicles, shots, explosions and similar are no longer possible to spawn (the old behavior can be turned on via "unsafeCVL=1" in the description.ext or server's config)
source: https://forums.bohemia.net/forums/topic/140837-development-branch-changelog/?do=findComment&comment=3360608
Ah OK they did it.thanks
its not really a bug and more somethign that wasn't meant to be pushed to stable yet
or atleast, not enabled like this
as far i know: "feature". you have two options... 1st - change your code to createSimpleObject or - if you can't do it - 2nd use unsafeCVL=1 in description.ext or server.cfg.
@exotic flax bug
its broken and was thus removed.
But it somehow got enabled in the build again. BI must've missed some commits
git blame 👀
@mild pumice thats a bug, it worked correctly in 1.94. I already forwarded it
Is it possible to disable the "All Players Died" mission fail with scripting?
add respawn to your mission
Well... a mission ends when there are no more units... no way to script that out...
Although you can disable the scoreboard, but no idea if that also disabled the "WASTED" screen
You mean in sp?
use HD to script death
HD?
all I know is how to change the debriefing texts: https://community.bistudio.com/wiki/Arma_3_Debriefing
right now i'm bypassing the entire respawn system using selectPlayer and it works fine, but it has to be done immediately or the mission fail sequence starts (even though the player is alive again)
@still forum hmm ok , so i'm not crazy lol thanks
playerKilledScript.sqs sort of things allow you to get rid of that behavior
Right there. Waiting for anyone at BI to take (prolly not gonna happen)
Can you make a command to tweak scheduler's time frame (3ms to something different)?
I neeed those milliseconds :3
Already exists
:O
You mean it's in your list to be pushed into the person who approves this at BI? (like the list above)
what's the command then?
😆 It's clearly not configurable and can't be used on a client
good nuff for me ¯_(ツ)_/¯
Isn't there a "download data" function from End Game, which is available for use in other missions ?
´nother one for the pros: ```
23:45:11 Performance warning: SimpleSerialization::Read '' is using type of ,'TEXT' which is not optimized by simple serialization, falling back to generic serialization, use generic type or ask for optimizations for these types
or to say it in different words, what can i do to find the cause?
Long Story short: use strings, not Text
Hello! Need to do the following: Server asks the specific client (id is known) to send to server the value of a certain variable. That variable (from acemod) is local to the client, so simple getVariable doesn't work. Sorry if it is complicated) i suppose I have to do several remoteExec or something like thah
Yes that's how you do it for the problem you described
recommended practice to add a sleep to any waitUntil condition that has non basic condition and needs no quick activation to the event?
wtf does this want to tell me ???
nothing. A note for devs.
@fleet bear remoteExec a script to the client, the script itself remoteExec's the variable back to the server.
@velvet merlin you mean if thats a good idea? yes it is
_conversation = [source,target,textSet,sentence,delay] spawn LIB_fnc_conversationHandler;
waitUntil {scriptDone _conversation};```
having a bit of a brain freeze here.. how to solve this with the new 1.96 check: Error Undefined behavior: waitUntil returned nil. True or false expected.
well, scriptDone should return a boolean whatever happens 😐
maybe use isNull instead @velvet merlin
I cannot see how that could return nil
if scriptDone returns nil, thats a bug
it should only return nil if _conversation is also nil, which in your example is only possible if LIB_fnc_conversationHandler is nil
hm will double check, but it worked pre 1.96
Does anyone know if SQF supports recursive functions?
What's why touching so old api just for sake of changing it is retarded. But what do I know 🤷
Does anyone know if SQF supports recursive functions?
yes it does.
thanks
Does anyone know if SQF supports recursive functions?
yes but stack overflow is a thing
is this script correct? it executes on the server on Eh EntityKilled
if (_killer == _victim) then {
_killer = _victim getVariable ["myRealKiller", _killer];} else {_killer}; ```
private _victim = (...)
@quaint ivy Example for recursive code: https://gist.github.com/X39/7bc5275d7b957b9fa8deeac038989414#file-xml_fnc_parse-sqf-L152
([] call _node inside of the codeblock from private _node = {...})
Thanks for the info, I just needed to know if it's possible to do it, not how to do it.
@still forum Seems it doen't work right.. trying to overcome ACE+ EntityKilled bug
can you show full code?
looks good
it works!))
Hey, i'm trying to create a script to search cars, i'm using the ace progressbar but the problem I have is that while the progressbar works the items are not added to the car, using this code:
if (_random > 90) then {
[3, [_target], {_target addItemCargoGlobal ["ARP_Objects_Weed_M", 1]; hint "You have found some illegal drugs on the backseat";}, {hint "Failure!"}, "Searching car"] call ace_common_fnc_progressBar;
};
Anyone has any clue?
the _target comes from code inserted into our spawning scripts
_action = ["sr_search", "Search car", "",{_target call fw_fnc_search;}, {true}] call ace_interact_menu_fnc_createAction;
[_veh, 0, ["ACE_MainActions"], _action] spawn ace_interact_menu_fnc_addActionToObject;
if (_random > 90) then {
[
3,
[_target],
{
_target addItemCargoGlobal ["ARP_Objects_Weed_M", 1];
hint "You have found some illegal drugs on the backseat";
},
{
hint "Failure!"
},
"Searching car"
] call ace_common_fnc_progressBar;
};
{
_target addItemCargoGlobal ["ARP_Objects_Weed_M", 1];
hint "You have found some illegal drugs on the backseat";
}
_target is not defined here
[_target] from the line above is passed to that script in _this
Correct usage would be
{
params ["_target"];
_target addItemCargoGlobal ["ARP_Objects_Weed_M", 1];
hint "You have found some illegal drugs on the backseat";
}
or (_this # 0)
In fact you're running into the same issue twice here
Yeah I was thinking that as well..
I'm already going wrong with calling the function right?
Yeah the parameters passed is also stored in _this
I call it with _target call ... should be (_this select 1) call ... right?
Arrays start at 0
right 0
I call it with _target call ... should be (_this select 1) call ... right? no.
_target is a parameter coming from the ace action
ok so I just need to define the parameter again in the code executing when the progressbar completes?
Yes, as Freddo posted. Just that
Hmm, I just seem to be getting generic errors
if (_random > 0) then {
[3, [_target], {
params ["_target"];
_target addItemCargoGlobal ["ARP_Objects_Weed_M", 1];
hint "You have found some illegal drugs on the backseat";
}, {hint "Failure!"}, "Searching car"] call ace_common_fnc_progressBar;
};
