#arma3_scripting
1 messages ยท Page 545 of 1
[center, radius, index, name]
you are setting radius
also, index and name are optional
Maybe setCurrentWaypoint
Ok, so say that I want to put a uniform on a player that interacts with an add action. What param would I have to use to make it refer to them when the uniform/gear is being placed on them?
What do you mean by "param" ?
I want to make it that when A script is called through a player interacting with and addAction, the script knows what player called it.
Check addAction documentation on wiki
[
"<title>",
{
params ["_target", "_caller", "_actionId", "_arguments"];
},
[],
1.5,
true,
true,
"",
"true", // _target, _this, _originalTarget
50,
false,
"",
""
];```
_caller would be the param you are looking for,-
Ok, thanks
You're welcome.
ok ```sqf
waitUntil { sleep 1 ; units _playerGrp findIf { not (_x in _extractHeli) } == -1 };``` is breaking my script
i riped this out and the chopper now hits all its waypoints
make sure _playerGrp and _extractHeli are defined and correct. The code looks fine.
_playerGrp = group player;
_crew1 =[];
_extractHeli =[];
//Spawns INvisible landing pad Near player
_extract = createVehicle ["Land_HelipadEmpty_F", position player, [], 20, "NONE"];
sleep 0.5;
_mk1 = createMarker ["extractmarker", _extract];
_mk1 setMarkerType "hd_pickup";
//spwans extraction Chopper
_crew1 = createGroup WEST;
_extractHeli = [getPos heliPad,0,"B_Heli_Light_01_F", _crew1] call BIS_fnc_spawnVehicle;
sleep 0.5;```
are you variables set to private?
its all in the one script
Doesn't matter, always set them private
isnt that what _ means
_var means local variable.
private _var means local to this scope
it's an array with [heli,crew,group]
See return value https://community.bistudio.com/wiki/BIS_fnc_spawnVehicle
-showScriptErrors + wiki is the winning combo ๐ฏ
i have the show script erros box ticked i wasnt getting any error the chopper just wouldnt move
private _extractHeli = ([getPos heliPad,0,"B_Heli_Light_01_F", _crew1] call BIS_fnc_spawnVehicle) select 0;```
Because it will not show an error
in can work with vehicles but also with arrays
Ask BI why the mix an array command with vehicle stuff...
I mean, I could think of many things that we could ask BI as to why they are the way they are lol
๐
fuck it got it wroking now ended up using sqf waitUntil {({_x in (crew _extractHeli)} forEach units _playerGrp)};
no that doesn't work
just worked
nope
forEach returns the result of the last iteration
You are checking if the LAST unit in the players group is in the helicopter
even if all other members aren't inside it
count would be what you want, findIf even better
findIf was just fine.
Just use the code Lou posted to get the helicopter instead of the array with crew and stuff.
ok i think i understand that code now
Is there, or will there be ever, a scripted way to create a directional light source?
@exotic flax there is none, and very unlikely
im hesitant to just slap code in that you guys give not because its wont work but because you cant really learn by being given the answers
@exotic flax maybe (but I just though of that)
create a spotlight, enableSimulation false, and hideObject
but I reaaally don't think it will work.
And is there another method to get directional light? I've seen some stuff where a hidden vehicle (with headlights) got attached to a unit, but that doesn't seem to work very well
@tough abyss You don't have to slap it in. Just ask, if there's anything you don't understand.
@cosmic lichen your English, for example ๐
I recommend you slap your fingers for not following the tempo ๐
wtf. I should look at what I am writing ๐
It's not the fingers that need a slap. It's the brain.
hits head
now I have a headache
so let me get this right
thanks to the waitUntil, findIf keeps looping through my group array looking for units not in the chopper and returning a 0
wouldnt it terminate after the first unit enters the chopper
It exits when it finds the first unit which is not in the chopper.
ohhh _x in extracHeli so it has to get that result for each right
Because you negated the condition with NOT
ohhh _x in extracHeli so it has to get that result for each right Yes, exactly.
Yes. That's confusing in the beginning.
() are just brackets. They do that same as in algebra.
clutter things
() are just brackets. They do that same as in algebra. I TOOK TRADE MATHS
(and also prioritising stuff, they do have a use ^^)
who needs maths when you can program a calculator ๐
Nothing better than having a calculator program during a test which solves the task in 30 seconds for which your class mates need 30minutes
Will never forget that moment when I finished first, 40 minutes before the official ending ๐
I think graphical calculators these days have some sort of 'exam mode' which locks you out of certain areas
so no more Doom on my calculator? ๐ฆ
These days maybe, mine if probably 10 years old or so.
Got a ti 82+
And they haven't changed much since.
lol il never forget the look on my manufacturing teachers face when gave us a huge like 30 page work book that was supposed to last us entire semester, pulled an all nighter handed it back to him the next day completed!!
@cosmic lichen calculator bro
Apparently the Ti-84+ isnt allowed to be used here anymore with exams, just did a quick google and it was the last year
pffft i have one of those calculator watches
New version has 'required exam mode' but that's maybe just for the Netherlands. I imagine it would lock you out of using programs or something like that.
@winter rose You're just jealous.
what, I have a Ti82? I meant we are calculator bros!
๐
Truth be told, programming that calculator for exams probably tought me more than visiting 5 lessons.
ok wtf now my script picks me up and flies me to debug corner even though thats not where the marker for that waypoint is
lol
"debug corner" always makes me giggle
markerPos "nonexistant" will always be 'debug corner'
ohh ok marker name was incorect
yep there ya go
https://pastebin.com/XdfWdVDh Feedback appreciated.
Script works on DS but I am not looking for optimisations.
@cosmic lichen perhaps add a parameter to force the unit to stay in the animation, so that it can be used as static animations. Or make it so that the unit returns to its position and restarts the animation the moment it is safe again.
because nothing is worse than a guarding unit who goes on a rampage and never comes back for duty ๐
ok were do i find the names for things like smoke grenades and chem lights
@exotic flax That's planned. Firstly I wanna get the basics working
cool thanks now i have smoke where my chopper is going o land
The question I have is if I should use a unique JIP string and use that to remove the remoteExec from the queue once the animation was exited.
well, using the unit object already makes it unique
Right. Forgot about that.
how do i set up an event handler so that when its triggered it runs my script
yeah but where do i put my code in this
this addEventHandler ["Fired", {
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
}];```
Between the {} or call your function instead.
after the params but before }];
this addEventHandler ["Fired", {_this call your_fnc_youWant}];
For calling a function. Params is in the code, but after would be fine, yes.
ah yeah im not up to making my own functions yet
i can barely manage a script
so sqf p1 addEventhandler ["Fired", {p1, "SmokeshellBlue", insert script here}];
this addEventHandler ["Fired", {
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
//your script here
}];
You are missing { in your message I think.
ahh ok but a smoke grenade dosent have a muzzle
You aren't defining those things, they're already defined
No
You use them in your code. _unit is the unit that fired. _weapon is the weapon he fired, etc
Those are all the things passed by the event into your code.
fack it its late im tired il just leave it as a damn radio activation i cant be assed at the moment XD
still its working now
so i can just rip it out and stick it in my other missions now
XD
does anyone know how I can have the player's inventory carry through to the next mission in my campaign?
Create functions to save and load it. Then save it to the profile or a database with a mod/extension.
how do i add my custom music into a multiplayer mission? and is there any restriction on filesize for it?
https://community.bistudio.com/wiki/playMusic
https://community.bistudio.com/wiki/Description.ext#CfgMusic
Not sure on the filesize thing.
so would I use parsingNamespace or profileNamespace?
Profile.
alright that's what I thought
so it says the inventory isn't found, this is just because im going right into the second mission right?
What do you mean?
im working on the second mission of the campaign and when i play through, it says the inventory isn't found
im assuming this is just because since i didn't play through the first mission it has nothing to load
I am working on a pvp mission, and have a perpetual problem with "error no unit" . it shows up in the killkeed, it seems to happen midgame, (a player that starts with a known name, will turn into error no unit) . i think this comes from calling name on a dead unit, and after a player receives the error no unit, it is not able to be reversed without them leaving?
i suppose my question is if this is indeed the case, and if anyone knows any work arounds. ive had this issue for a year, over several missions. i am setting a name and side var while the player is alive.
remove it by event handler on death, add back on player respawn.
We've been having that exact same issue in the unit I'm in for quite a while now, and multiple people have asked that same exact question multiple times and nobody answered. So I assume it's something that you can't do anything about, you just have to hope it happens later in the mission and it arma doesn't want to crash your server that time
Hey there is there a way to increase quality/resolution of live feed created using BIS_fnc_liveFeed ?
i do believe it is an engine problem , it even has effect on the players sidechat.(they seem to lose side too but im coming from a place where , it wasnt a problem, ever, so i do believe it can be worked around.
Yeah, I'm 99% sure it's a problem in the engine itself too. The last time I looked at the log file when that happened I noticed it started spamming that right after a group of units got garbage collected (Or the zeus deleted them) and those exact 4 units were being reported as not having a name. The solution then would be to not delete units, but that's not something we can do.
The only difference from your case to ours is that I can't remember if the units were players or not, so I'm not sure how that affects it. We only notice that it is spamming the RPT after the server has crashed, so we can't pinpoint the units that are causing that while it is happening
i have seen it happen on ai once in my travels, but it is the same, it ends up being a player, but who, and , not even really able to do anything with that person in our admin consoles.
Is there a way to detect a player's Arma 3 unit? For example, Player 1 is in (for example) the 1st Infantry Division, and so he gets a certain loadout, but Player 2 loads in and is part of the (also for example) 2nd Infantry Division, so he gets a different loadout
Thanks for the fast response
@oak parrot you can also give the players units specifiv names in the editor and directly call them in your scripts.
or their groups
The main usage is for joint operations (the two units I used for examples are not the two units that are doing it)
To significantly cut down time for loadouts and etc
People like to play dress-up
yeah
use a custom ace arsenalo reduced time too
quite easy to set up as well, time of setting up depends on how many different items you want in it
That may be worth looking into as well
or combine both (like i do). spawn loadout has uniform and bandage shit and some grenades but no weapon, that is chosen in the custom ace arsenal. its fast, fool proof and player still get to choose a bit.
hello
does anyone know why this happens?
i'm trying to make AI get in player's vehicle using this script
{
_x assignAsCargo (vehicle player);
} forEach units _group;
(units _group) orderGetIn true;
but for some reason when i'm as the commander, gunner or passenger of the vehicle and the engine is on they get in position to get in, but wont get inside,
Are they the same side as you?
yes they are
they get in once in change seats to driver
or if i get in driver turn the engine off and get back as commander
or just using the script when the mission starts and the vehicle has not started by the other crew member
https://i.imgur.com/c9993Ob.jpg they just stay in there and follow the vehicle to stay at that same distance from the door
On my server the map cursor isn't showing the gridref and elevation asl for some reason, we haven't purposely removed it and don't know what could have removed it
Hello I'm having trouble with BIS_fnc_holdActionAdd
Getting "error params: type number, expected bool
this is my code
removeallitems _fobcrate;
private _alliesNearby = [];
{
// _x is a magic variable see https://community.bistudio.com/wiki/forEach
if ((side _x) == (side player)) then {
_alliesNearby pushBack _x; // If sides are the same, add man to array
}
} forEach (getPos player nearEntities ["Man",25]);
[
_fobcrate, // Object the action is attached to
"Deploy FOB", // 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","leader _caller == _caller","count _alliesNearby > 2", // 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
{execVM "${scripts\FOB.sqf}"}, // Code executed on completion
{}, // Code executed on interrupted
[], // Arguments passed to the scripts as _this select 3
5, // Action duration [s]
0, // Priority
true, // Remove on completion
false,
true // Show in unconscious state
] remoteExec ["BIS_fnc_holdActionAdd", 0, _fobcrate]; // MP compatible implementation ```
I can't figure out which param is a number and would need to be a bool
this is the params for this function
title,
idleIcon,
progressIcon,
conditionShow,
conditionProgress,
codeStart,
codeProgress,
codeCompleted,
codeInterrupted,
arguments,
duration,
priority,
removeCompleted,
showUnconscious,
showWindow] ```
I know @still forum ๐
what can't you figure out? everything is listed on there
why it's giving me: error params: type number, expected bool
theres only 3 bool in the function and I have them listed
so then some parameter where you have a number, should be a bool
your execVM there is wrong syntax btw
you are two arguments off
yeah the // arent exact
your 5 is where removeCompleted should be
you have 3 parameters where the comment says "condition for action"
but it's 2 conditions, and codeStart there
&&
I feel stupid now, Thanks @ruby breach and @still forum
Also, how could I make it so that the sectors in SC are capturable in a certain order and not all at once?
disable simulation?
anyone has any idea on the error i'm experiencing?
@tough abyss I think this is a problem with the game as I have experienced this exact problem during a BI campaign mission. Get out of the vehicle and they will get in
demn, they i will have to limit the script so it only activates when player is driver
then*
It happened when I was commanding the marshall on the Steel Pegasus Campaign. I went to extract the wounded and they wouldn't get in.
So yeah
@tough abyss might be worth shooting a ticket over to BI since you have the exact faulty code.
Oki doki will try that
Soo, anyone tried setMissileTarget and other new commands? tried to use them with Fired eventhandler, none of them works
@neon snow of which missile are you trying to set the target?
Hey, excuse me, I want to ask you, when I am copied by shift + R, I can't switch the voice channel (team channel, direct communication, etc.) so that players can't communicate after being arrested by the police. I want to solve this problem, how to operate it?
question would this be a way to get a random spawn
_spawnLocation = selectRandom ["marker1", "marker2", "marker3"];
[ getMarkerPos _spawnLocation, EAST, ["TK_INS_Bonesetter_EP1", "TK_INS_Soldier_2_EP1"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;```
Im having trouble adding in music into my game. I've done the description.ext and placed my music into a folder with the .ogg files in it, but for some reason the command I run on a trigger in game doesn't play the music track that I've defined.
@frozen gull throw up your script plz
{
tracks[] = {};
class Track01
{
name = "SUPER MEGA ACTION";
sound[] = {"\sound\Track01.ogg", db+0, 1.0};
duration = 147;
titles[] = {0,""};
musicClass = "Action";
};
class Track02
{
name = "Eerie";
sound[] = {"\sound\Track02.ogg", db+0, 1.0};
duration = 360;
musicClass = "Stealth";
titles[] = {0,""};
};
}; ```
thats my description.ext
remove the \ from before sound
kk
oh no sorry my bad thats not it
but the code that i run on trigger activation is
playMusic ["Eerie", 0];
the triggers all set but the music doesnt play when the trigger is activated
no my music is on full volume
have you tried turning up the sound of the sond
gimme a sec
Hey, excuse me, I want to ask you, when I am copied by shift + R, I can't switch the voice channel (team channel, direct communication, etc.) so that players can't communicate after being arrested by the police. I want to solve this problem, how to operate it?
nah didint work
give us a sec il test it on my end with a song i have
ah ok @frozen gull for what ever reason it wont work direct from trigger instead do this
whats this for @silk carbon?
@extDB3;@life_server are server mods
ahh right
@frozen gull in the trigger put ```sqf
execVm "music1";
next open up a note pad and paste this in an put in ```sqf
playMusic "Eerie";```
save as music1.sqf as file type all files
kk
and stick that sqf in your mission file
@frozen gull so hows it going
@frozen gull me stupid trigger has to be sqf execVM "music1.sqf";
not working even with the code you've used
hmm ok
@frozen gull ```sqf
class CfgMusic
{
tracks[]={};
class Music1
{
name = "Eerie";
sound[] = {"\sound\track2.ogg", db+5, 1.0};
};
};```
try replacing your second song with this
@frozen gull in your description.ext
@silk carbon i havent a clue bout server stuff sorry
@silk carbon quick google search pulled this up https://community.bistudio.com/wiki/Arma_3_Dedicated_Server
still not working
:|
omg
i think i figured out why
this is annoying
Anybody have a fix for ace3 medical with ryanszombies infection module? Zombies wont resurrect with ace 3
Oh thank u sirs
@frozen gull what was it
nah it still doesnt work but i just found out that my desc.ext had a missing letter within the filename
your files are ext and sqf right
yep
strange the code i gave you and how to run it should all work it does on my end
@frozen gull are you running -showscriptErrors
no but i managed to get it to work for now
the music finally was being shown within the trigger effects, after i fixed my misspelling for the desc.ext file
ok
oh are you trying to get it to show up in the music part of the triggers options
no but thats whats currently working right now
ah cool
yeah the way i was showing you it should just instantly play the music the instant you hit the trigger
you did put sqf execVm "music1";
in the onAct. field right
yea i did
Is there a way to stop BIS_fnc_holdActionAdd from fading away when the duration used is long?
What do you mean? Just the unit being created? Take the array and make the selectRandom on an array of arrays.
If you mean the created group, put the vars in the array.
anyone here knows how to check if high command is active?
can someone help me to figure out how to check if a control exists
is there any way to find what index select random choses
Add a number that you can read that matches the index or make a function to loop the array and find out where it ended up. Not directly to my knowledge.
damn
You could make your own function to do this and then store what index it chose. It wouldnt be as fast though.
came out with this ```systemChat format ["%1",isNull (finddisplay 15001 displayCtrl 3000)];
returns false
when the control exist
any help
has anyone made a script to detect if a player is aiming down sights? I know cameraView works but I want it to trigger when the camera transition starts, not after its finished (which is only when cameraview works)
using set3DENAttribute ["init",/*code*/] will sometimes result in call{call{/*code*/}} has anyone else experienced this?
get3DENAttribute "init" works fine and always returns call{/*code*/} but the 3den editor init box shows call{/*code*/} instead of just /*code*/
I'm using create3DENEntity to make a respawn position module. I am able to set the attribute name correctly, but not the side.
_RespawnPos = create3DENEntity ["Logic", "ModuleRespawnPosition_F", _position];
_RespawnPos set3DENAttribute ["name", "defaultRespawnPosition"];
_RespawnPos set3DENAttribute ["Side","1"];
Is my code. I also tried setting the variable upon mission start, but that also didn't work. _RespawnPos setVariable ["Side","1"]; //only thought is i'd need to wait for the mission to start
Any thoughts on setting a default side?
@dim kernel you called it isNull, so no it is not null
Do modules with a function listed under their class run that in a scheduled environment?
dont you guys know if its possible to reduce intensity of campfire flames? Or isnt it possible to set wind strenght at specific place? (like in trigger for example)
@crude needle more details?
@lucid junco you could use setWind with a trigger yes, but it would be global
@winter rose have some example? i have no idea
@still forum In the config file, the class for the specific module has directly under it the function it uses when activated.
Not sure if this is just used for info rather then directly on what function the module uses. I'm trying to ensure it runs un-scheduled from this module.
{
...
function="function from cfgFunctions";
isTriggerActivated=1;
...
class Arguments
{
...
};
...
};```
I know that it does run scheduled currently. I was curious if it was possible to even change that with a module setup in this manner.
So you mean a config property which you can set to call the code?
Never heard of it.
You could use canSuspend along with a exitWith to execute the function correctly
I'll give that a shot.
How make delayed paradrop with setVehicleCargo?
I want to drop vehicle every 4 seconds.
Store all the vehicles you loaded in an array and loop, with a sleep of 4 seconds, through dropping/unloading all of them.
But how to use sleep? I
As far I know, I can use it only in scheduled environment.
Right?
I Made some functions, but all of them are executed using "call".
So use it inside spawn
hmmm high command modules don't have a lot of documentation it seems
Yeah they do not.
so how would one use a sound defined in the CfgSounds class in the description.ext with the BIS_fnc_showSubtitle style of subtitles? From what I've seen BIS_fnc_EXP_camp_playSubtitles seems like the most likely answer but looking at the wiki I don't see where in the command it plays the sound.
I believe you would play the sound and run that simultaneously.
I'm working a script to calculate the yaw and pitch to make attachTo work on the head. I believe I have all the values correct (using eyeDirection), but I'm not sure how to change the yaw and pitch of an object.
Currently I use BIS_fnc_setObjectRotation, but for some reason this doesn't seem to work (the object moves, but not in sync with the head). And since the documentation is very limited I'm not getting any further...
Is there someone who has experience with calculating and using yaw and pitch on objects?
@exotic flax setVectorDirAndUp maybe?
BIS_fnc_setObjectRotation uses setVectorDirAndUp with some additional functionality. However since I have no idea how these values work, I can't tell the difference...
@distant hazel the script from Killzone is designed to use within the game (from server to server), and not in the launcher
The launcher itself already has the functionality to directly connect to a server, however that can't be done with sqf (as far as I know, since I don't believe the launcher is running any engine related stuff)
He's not talking about the launcher, he's talking about the main menu or ARMA once you launch it.
How to force the player to close the inventory?
Nope, did not worked
What about player action["Gear", objNull];?
eg. ACE disables all dialogs when you are unconscious with
while {dialog} do {
closeDialog 0;
};
For just the inventory all you need to know is the correct ID of the inventory dialog
@astral tendon This is a script which will close the inventory when opened by a player (found in a vanilla mission):
// Detect when the player accesses the inventory
BIS_lacey addEventHandler [
"InventoryOpened",
{
private ["_unit", "_container"];
_unit = _this select 0;
_container = _this select 1;
if (typeOf _container != "GroundWeaponHolder") then {
// Player has opened the inventory of an object
BIS_inventoryOpened = true;
// Detect if the player has the crate inventory open
if (_container == BIS_crate) then {
[] spawn {
scriptName "init.sqf: crate open control";
private ["_invIDD"];
_invIDD = 602;
waitUntil {!(isNull (findDisplay _invIDD))};
BIS_crateOpen = true;
waitUntil {isNull (findDisplay _invIDD)};
BIS_crateOpen = false;
};
};
};
}
];
You sure about that?
above will check if someone opens the inventory through a crate (so not pressing I).
Simply using closeDialog 602; should close it manually
Since when are error file paths are cut off? And why?
Before
13:35:51 File D:\Documents\Arma 3 - Other Profiles\Sa-Matra\mpmissions\KingOfHill_1944.iron_excelsior_Tobruk\client\c_fl_playerLoadout.sqf, line 1222
Now
0:48:04 File D:\Documents\Arma 3 - Other Profiles\Sa-Matra\mpmissions\KingOfH..., line 152
@exotic flax Not accurate: https://i.imgur.com/T623P8v.png
Using the action I posted earlier with an evh like you posted may work.
I was attempting to avoid player to use enemy ammo box
kinda like side locking it.
true... been a while since I worked with dialogs ๐
@astral tendon in that case the event handler should be a very good start, and that in combination with finding and closing the dialog/display
does it possible to change the sky in arma 3? make a "skin" into the sky ?
a texture, or Something like this?
not without creating a new terrain config and sky textures
also you cant post pictures. only links
we can put a texture for the sky when we create map?
if you know how to make them and use them in config
Ok, perfect, thank's !
is there a way to get 3den category checkbox open/closed states? cbChecked is always displaying true
and ctrlShown/ctrlVisible is always showing true
Is there any guide about init files? I want to know, what thing I can put in what files, good and bad practices, optimalisation, call, exec, spawn, remoteExec and so on. For I know about BIS wiki.
@pseudo kernel it is run on every machine, don't put bad code in it, close the door when you're done and you'll be fine
See also Code Optimisation and Mission Optimisation articles, they may help you too
Where can I set a garage customisation script? @winter rose in terms of on the wiki
"Vehicle Appearance" i mean.
sorry, what?
Never mind. I found this: https://forums.bohemia.net/forums/topic/224041-release-vehicle-appearance-manager-gui/
I didn't get the "term of wiki" part
nevermind. its fine.
Please don't cross post. I answered wherever else you posted it with a snippet of code.
dont know if that even belongs here but i have a GUI related question.i have a gui set up in an addon but when i createdialog from a server plugin (client function of course) it says "resource "dialog_name" not found.why?
Regarding all my previous issues with 3den dialogs, to get proper command returns you need to wait 0.11, after the 3den 0.1 exec time. Who knows...
Are any of the Achilles mod makers in this discord? I'm looking for some help in making a module that spawns an object under the cursor.
0 spawn {
while{alive blah} do {
_pos = screenToWorld getMousePosition;
"Rabbit_F" createVehicle _pos;
};
};
I'm not having any luck with this.. I'll copy pasta what I have and hopefully someone can tell me where I went wrong.
{
_objects = ["Land_Money_F", "Land_Tablet_02_F", "Land_Laptop_03_black_F", "Land_MultiScreenComputer_01_black_F"];
private _object = [_logic, false] call Ares_fnc_GetUnitUnderCursor;
private _dialogTitle = "Test Spawn Object";
private _dialogOptions =
[
["Object", ["Money", "Rugged Tablet", "Laptop", "TriScreen Computer"], 0]
];
_dialogResult = [_dialogTitle, _dialogOptions] call Ares_fnc_showChooseDialog;
private _dialogCount = count _dialogResult;
if (_dialogCount == 0) exitWith {};
if ( _dialogCount == 1) then
{
private _type =_objects select (_dialogResult select 0);
_object = _type createVehicle (position _object);
[_object, false] remoteExec ["enableSimulationGlobal", 2];
_object setPos (position _object);
[[_object], true] call Ares_fnc_AddUnitsToCurator;
};
}] call Ares_fnc_RegisterCustomModule;```
Who can tell me how to write a log log in the database SQL so as to query the records of player's related operations? Thank you very much.
https://i.imgur.com/r0CkBsm.png is the position of the vehicle group indicators something hidden by arma or is there an actual way to get its position from vehicle to vehicle?
Edit: the image is every selection name with all of its lod varients
selectionPosition @tough abyss
yah that would be how i got all those other positions
@tough abyss Does boundingCenter return group indicator PositionRelative?
I doubt it but can check, for cars the indicator is at the front of the vehicle by the engine/dash https://i.imgur.com/cY3geox.png
no bounding center is not even close
Ah, shame!
!purgeban @dusty trench 14d spamming, mass crosspost
*fires them railguns at @dusty trench* ร_ร
Excuse me, there is tazed in my script, which means that I can stun or kill people by installing acc_pointer_IR or removing acc_pointer_IR. Now I want to add it to my mouse wheel (mount, unload) how do I do, thank you!
addAction and addPrimaryWeaponItem @runic quest !
This is my addPrimary Weapon Item. I put it in funtion, but I don't know how to write addaction. I don't know, right?
@winter rose I tested it, but it didn't work.
https://community.bistudio.com/wiki/addAction for reference
How are the Eden function tooltips generated?? The editor tooltip for remoteExecCall is funcName remoteExecCall [funcParams, targets, jipID] but funcName and funcParams should be swapped?
in-game doc, dismiss ๐
instead of Germans ๐
Wait, so Humans were harmed in the production of Arma 3 ๐ฎ
ARMA 3 is human tested unfortunately. Many humans were harmed. 
How does one make it so an addaction is only useable inside a vehicle?
want to add a heal action though you can still use it outside the vehicle
cursorTarget addAction["<t color='#00FF00'>Heal</t>", {vehicle player setDamage 0}]
add some "guy in vehicle" as action condition
!(vehicle player isEqualTo player)
isNull objectParent player``` ๐
Opposite if you want to see if they are not on foot, but that works.
not*
not isNull objectParent player```
wasn't there some weird thing such as `player in player` or something?
figured it out vehicle player addAction["<t color='#00FF00'>Heal</t>", {vehicle player setDamage 0},[], 0, false, false, "", "_this in _target"]
specifically "_this in _target"
Hello guys. I wonder, how hard is it to script the spectrum scanner device to work like in the contact campaign?
Like, make some objects 'emit signals' which I can 'scan' and 'analyze'?
(make a spectral peak appear on the screen when I point at something)
Oh nice, thanks man!
How to change a map flag texture to a custom one?
thats a map flag texture?
Like, I want to change the flag to another country that is not on the main game
but is for the map, not the flags in game.
You mean a marker, then? not a flagpole object?
Yes the marker
Thats really too much stuff for that.
You can bring a horse to the riverโฆ! ๐
You can bring a horse to the Vet and drip-feed them water though. So anyone want to do that here 
This page could use a update to the magazine, seems like its a A2 magazine
this one as well.
Why's that?
@astral tendon the example is still good, we don't rewrite all pages according to the most recent game
m16 seems kinda missleading to undestand that it has to be the weapon to add the magazine
M16 is OFP-era, and back then most of weapon classnames == magazine classnames
In order to avoid confusion, these examples should be changed yes
I have a RscCombo Control which is filled by elements
private _rolesCombo = _loginDialog displayCtrl GUI_ID_LOGIN_CHARACTER_CREATION_ROLE_COMBO;
// init the role selection combobox
{_rolesCombo lbAdd _x} forEach _roleNames;
When selecting an element and accessing the lbCurSel current index it always returns -1.
private _selectedIndex = lbCurSel _rolesCombo;
What might be the problem here?
I have an event handler attached to that RscCombo:
_rolesCombo ctrlAddEventHandler ["LBSelChanged", { call coopr_fnc_selectRole}];
Is there something like "consuming" the event and therefore not changing the selected index? I doubt that but meh SQF...
Whole code here: https://pastebin.com/agmTfSDA
You are not passing the parameters to coopr_fnc_selectRole it should be _this call coopr_fnc_selectRole;
Quick check
//side lock
SideLockVehicle = {
params ["_vehicle","_sideToLock"];
_vehicle addEventHandler ["GetIn", {
params ["_vehicle", "_role", "_unit", "_turret"];
if (side group _unit != _sideToLock) then {
moveOut _unit;
};
}];
};
_sideToLock will not pass to the event handle right?
yep, will stay out of it
@cosmic lichen The seletRole functions works fine. _this will be given to the handler implicitly. You can always access _ctrl as a parameter in a control handler func
Right. I am just used to writing _this always.
So I changed to this
SideLockVehicle = {
params ["_vehicle","_sideToLock"];
_vehicle setVariable ["SideLocked", _sideToLock, true];;
_vehicle addEventHandler ["GetIn", {
params ["_vehicle", "_role", "_unit", "_turret"];
if (side group _unit != (_vehicle getVariable "SideLocked")) then {
moveOut _unit;
};
}];
};
But the GetIn event handle only fires were the vehicle is local, in case of a change in locality (Other player enters the vehicle) does it fires?
see wiki?
" It can be assigned to a remote vehicle but will only fire on the PC where the actual addEventHandler command was executed. "
Do I need to add this event handle to all players?
@frigid raven The script you posted. From where is it executed? It says on mouseButtonDown in the functions header.
its coming from another dialog. If you click on an empty character space it opens the character creation dialog. The logic for that creation dialog is the one I posted
yeah - the combobox itself does work all the way. When refering to it in the selectRole handler I can access it's index without a problem
sec code incoming
@astral tendon well yes, else "it will only fire where the command was executed"
As you can see I do the same here like in the posted code before
And there it works fine
private _selectedIndex = lbCurSel _ctrl;
returns the correct number
But when using in here: https://pastebin.com/agmTfSDA it does not
What does DEBUG2("role %1", _rolesCombo); return a line before you wanna return the index?
sec
22:27:46 (0:00:15) [Server] COOPR.LOBBY.debug - roleCombo Control #1303
22:27:46 (0:00:15) [Server] COOPR.LOBBY.debug - index -1
22:27:46 (0:00:15) [Server] COOPR.LOBBY.debug - roleName
22:27:46 (0:00:15) [Server] COOPR.LOBBY.debug - role []
DEBUG2("roleCombo %1", _rolesCombo);
DEBUG2("index %1", _selectedIndex);
DEBUG2("roleName %1", _roleName);
DEBUG2("role %1", _roleId);
@cosmic lichen all debug statements
The same debugs in coopr_fnc_selectRole
22:29:54 (0:02:23) [Server] COOPR.LOBBY.debug - roleCombo Control #1303
22:29:54 (0:02:23) [Server] COOPR.LOBBY.debug - index 2
22:29:54 (0:02:23) [Server] COOPR.LOBBY.debug - roleName Engineer
22:29:54 (0:02:23) [Server] COOPR.LOBBY.debug - role coopr_role_engineer
here it works
uff
Only difference is that I pass _loginDialog to the button control
_rolesCombo setVariable ["_params", [_loginDialog, _rolesHash]];
_rolesCombo ctrlAddEventHandler ["LBSelChanged", { call coopr_fnc_selectRole}];
Yeh I am confused as well
Something that happend to me recently was a non private variable overwriting my var. Can you check that?
Nevermind. You've already logged the vars
hm
actually good point ๐ค
well I have no non private vars
but I deactive the selectRole handler
and see what happens
nah did not help
what the actual hell is going on there
ye thx anyway!
anyone know if its possible/know how to to change the value of enableDebugConsole ingame using the debug console
mission default is set to 1 on the quick hosted scenario me and friends play on
don't really want to unpack scenario to change it
as it is an entry in description.ext you can not change it ingame ๐ฆ
thought so
worth a shot though :v
Is there a "correct" or easy way to add event handlers or scripts to cfgAmmo projectiles? I can always pull it from a fired EH but I was wondering if there was a better way to do it
@cosmic root no better way
The better way is using the config/mod only ammo eventhandlers
Not really documented that well.
you have fired and AmmoHit in the CfgAmmo's Eventhandlers class
do note ammoHit seems to be limited to mines... atleast when I last tried it was
Hmm, not super helpful. But I do appreciate the effort ๐
ok yeah I just looked it up, yeah, mines only for ammohit, BI didn't want to implement it at all
but it got put in for mines, VBS has it for all CfgAmmo
Also, just out of curiosity, can I get an opinion on this technique? I think it's clever, if a little hacky. But I'm scared there is something I'm missing that makes it terrible.
[{
params ["_args", "_handle"];
_args params ["_mortar", "_posArray"];
//This works in a hacky sort of way
//We passed an array to this PFH, since it is passed as reference we can update that array with set
//This creates a pseudo global variable that can be update each frame with the mortars position
//And if the mortar is gone we still get to keep the variable until the EH is removed
if (!isNull _mortar) exitWith {{_posArray set [_forEachIndex, _x]} forEach getPos _mortar};
systemChat format ["Final Position: %1", _posArray];
}, 0, [_mortar, [0,0,0]]] call CBA_fnc_addPerFrameHandler;
Essentially abusing the fact that arrays are passed by reference to create a pseudo global variable for a PFH to track the position of a projectile.
you should remove the eventhandler if mortar gets null
Yeah, That's further down. I just only wanted to include the relevant bit
I'm also checking for a "#crater" object when doing what I need to do. I don't know if that is a reliable means to ensure the round impacted. I imagine it is though right?
you could do _args set [1, getPos _mortar] for more perforceperformance.
perforce? there are still people who use that stuff?
๐
Is there a function that only returns what a given unit has in it's launcher slot? Or generally testing whether a unit has a launcher?
hah, here I was mistakingly assuming secondaryWeapon would return the handgun
Thanks @winter rose
@uneven torrent that would be handgunWeapon, thanks to their introduction order in the series ๐
What is the diff between ComboBox and ListBox again?
@cosmic lichen just a heads up for that error with the combo box selected index. The Control was disabled by ctrlEnable and only enabled at the end of the script. Therefore the call for the index was done while the control was still inactive. As a user testing the feature like me you could not realized that because it all happened in a blink of a second.
Is it necessary to ctrlEnable false a control if it already has been ctrlShow false made invisible?
you may still have focus on it, idk
oki
I want to have a stance animation where the character actually holds a rifle ergo his whole equipment.
This is what he does atm: https://imgur.com/a/qH9xX55
I changed the animation to this:
[player, "GUARD", "FULL"] call BIS_fnc_ambientAnim;
But it seems he is not reacting to changes.
I have this camera setup here:
private _playerDirection = getDir player;
private _camPos = [COOPR_LOBBY, 5, _playerDirection] call BIS_fnc_relPos;
private _cam = "camera" camCreate _camPos;
_cam camSetTarget player;
_cam cameraEffect ["External", "FRONT"];
_cam camCommit 0;
Does this somehow prevent animations from working?
I would say no?
hm
do someone knows why some animations works different way then the others? like i have this one "InBaseMoves_assemblingVehicleErc" when use playmove or switchmove, nothing happens. Also other animations via playmove are playing good but when i want to cut them like this way civ1 playMove "AmovPknlMstpSnonWnonDnon_AmovPercMstpSnonWnonDnon"; they also wont stop. But on the other hand with same usage few other animations will stop..... Im confused. Cant see any rules in this mess ๐ some advices?
Guys, any way to disable UXO of cluster bombs? After several hours of multiplayer, server is full of that crap all over the map, and it starts to eat performance.
Thats what I already do for all kind of stuff like weaponholders.
Thought there was a more intelligent way
I have these different cutText statements
cutText [_saveText1, "WHITE OUT", 1.0, false, true];
sleep 1;
cutText [_saveText2, "WHITE OUT", 1.0, false, true];
sleep 1;
cutText [_saveText3, "WHITE OUT", 1.0, false, true];
sleep 2;
The thing is it starts to blink for every cutText. I want the first one to white out and for the rest just to display text on that "white curtain".
PLAIN does not work because it removes the white. And I was not able to find a WHITE attribute which just makes the foreground white. Any ideas?
Maybe I need to work with those cutText Layers
๐ค
Maybe play with some post-processing effects to make the background white and use the PLAIN cutText.
Yep different Layer's will work too. 
how can i make independents enemy mid-mission
addRating so they become ENEMY?
will i have to execute that on every member of side?
Hi, i am trying to make a launcher (weapon) that when dropped on the ground, turns into an explosive (magazine).
I have a seen a similar thing done with the 3cb tripod bags that when dropped via the inventory menu, turn into actual tripods that you can make static weapons from, although the 3cb files and locked down.
@waxen tendon On the server for every unit . Probably best to try setFriend: https://community.bistudio.com/wiki/setFriend
@next moss Check the groundweaponholder for the weapon, remove it, add the mag.
fiddling around with getting all pointer attachments from cfgweapons into an array.how do i do this ? is there a type name?
Like all of the possible ones, or just compatible for a specific weapon?
all of them
Hmm. I can't think of a specific class or anything they inherit from off the top of my head. Maybe someone else will.
slot is 301,maybe i can get it through that
@frigid raven Thanks for the headsup.
How to make the player go to the respawn screen with out have to kill him?
I need to add a redeploy action
I think that is not possible @astral tendon
you have to kinda create your own "Login" / "Role Change" Dialog or whatever
Does anybody know if there is a way to prevent a Dialog from being closed by the ESC key ?
I have a mandatory Dialog that should only be closed if some things have been set up
My real problem is the dead body it makes, I tough It could have a more clean way than move in to the possition [0,0,0]
you can create a new unit - switch teh player to that one and deleteVehicle the old unit
private _oldPlayerUnit = player;
private _playerGroup = createGroup [west, true];
private _newLoginUnit = _playerGroup createUnit ["B_diver_TL_F", _somePosition, [], 0, "NONE"];
selectPlayer _newLoginUnit;
deleteVehicle _oldPlayerUnit;
oof i'm finally finishing some functions related to units (getting in/out) of vehicles including one that takes parachutes from the vehicle inventory and distrutes them between units before making them eject from the plane/heli
How to disable lose condition when tickets reach zero?
I was looking for a script to have dialog trees
something like multiple choice conversations
I've seen something similar in spyder's modules
I'm not begging for someone to make it I'm just curious if there was already one around
Does anybody know what the IDC of the main menu is?
I mena the name for it
so I can open if via createDialog <name_of_main_menu>
I only found createDialog 'RscDisplayInterrupt' so far which is a different main menu (with return to eden editor button)
Try hunting through a config dump and see if it's there.
I think I just found out that it actually is the right one - but was wrongly invoked
Needs to be a display and not a dialog.
there createDisplay might work
@frigid raven
Not sure if this is right... Found in AIO config.
RscMainMenu
will try
That actually looks like it is for the Commanding Menu. ๐
gosh so many false information via google
yeh @untold copper it opened like "nothing" for me
@frigid raven Ach! Sorry.
Hello, I have this script that was working fine as a .sqf in mission folder, but now that I put it as a function, it does not anymore...
part 1 ``` fobcrate = 0;
publicVariable "fobcrate";
fobcratespawner_1 addAction
["Spawn FOB crate", {fobcrate = "B_CargoNet_01_ammo_F" createVehicle position player; clearWeaponCargoGlobal fobcrate;
clearItemCargoGlobal fobcrate;
clearBackpackCargoGlobal fobcrate;
clearMagazineCargoGlobal fobcrate
}];
//
fobcratespawner_2 addAction
["Spawn FOB crate", {fobcrate = "B_CargoNet_01_ammo_F" createVehicle position player; clearWeaponCargoGlobal fobcrate;
clearItemCargoGlobal fobcrate;
clearBackpackCargoGlobal fobcrate;
clearMagazineCargoGlobal fobcrate
}];
//
fobcratespawner_3 addAction
["Spawn FOB crate", {fobcrate = "B_CargoNet_01_ammo_F" createVehicle position player; clearWeaponCargoGlobal fobcrate;
clearItemCargoGlobal fobcrate;
clearBackpackCargoGlobal fobcrate;
clearMagazineCargoGlobal fobcrate
}];
//
fobcratespawner_4 addAction
["Spawn FOB crate", {fobcrate = "B_CargoNet_01_ammo_F" createVehicle position player; clearWeaponCargoGlobal fobcrate;
clearItemCargoGlobal fobcrate;
clearBackpackCargoGlobal fobcrate;
clearMagazineCargoGlobal fobcrate
}];
//```
part 2 // [ fobcrate, // Object the action is attached to "Deploy FOB", // 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 "(leader player == _this) && (count units group _this > 1)", // Condition for the action to be shown "_caller distance _target < 10", // Condition for the action to progress {}, // Code executed when action starts {}, // Code executed on every progress tick {_this call PRA3_Fob}, // Code executed on completion {hint "FOB Deployment Interrupted!"}, // Code executed on interrupted [], // Arguments passed to the scripts as _this select 3 5, // Action duration [s] 0, // Priority true, // Remove on completion false ] remoteExec ["BIS_fnc_holdActionAdd", 0 , fobcrate]; // MP compatible implementation
it gives me an error at the last line
What's the error?
1 sec ill get it
@frigid raven The only other possible entry I see is: RscDisplayMainMenuBackground .
16:15:48 Error in expression <,
true,
false
] remoteExec ["BIS_fnc_holdActionAdd", 0 ,>
16:15:48 Error position: <remoteExec ["BIS_fnc_holdActionAdd", 0 ,>
16:15:48 Error Type Number, expected String, Bool, Object, Group
16:15:48 File C:\Users\Antoine\Documents\Arma 3 - Other Profiles\AtlasTheCarry..., line 20
I have looked at the wiki and the syntax is exactly like on there
dosent = 0; means that it is a globalVariable?
@frigid raven
https://forums.bohemia.net/forums/topic/191737-updated-all-in-one-config-dumps/?do=findComment&comment=3371924
Searching through "1.94.145903 release pre-hotfix no-contact vanilla".
@vague harness No? Having no _ in the front did and the publicVariable broadcasted it. You just set it to contain the integer 0.
@untold copper ah ok thx
I tought _object was to make it private
_ makes a variable local, private makes a local variable private
@ruby breach gotcha
in my case since "fobcrate" is reused in another script, it is correct the way it is?
just remove fobcrate = 0;
If it's already set and broadcasted, drop that and the pubvar.
Reused?
in another script I use the pubvar fobcrate to delete the object
let me explain, basically,this is the script that spawn a crate with and action
second script deploys a fob with respawn point and deletes the object that was used in the first script
Where are you actually linking an object and that variable? An action?
yes
When you do that, do the pubvar.
do I have to write it in everyscript or it's already known by the server?
If you declare a public variable once (in this case, you're declaring a variable assigned to an object), you can use that variable over and over again to reference that object until the object is deleted
Is there a specific reason you are using Public Variable for this anyway? Why would all clients need to know this object?
@ruby breach so I do not have to do fobcrate = nil; if it is deleted?
@finite dirge don't know, it's an action that players need to have on the crate. Do I need server or public?
I also don't get what you are doing with the remoteExec. You are trying to exec on the fobcrate object?
It's for it to be MP and JIP compatible. That's what I read on the wiki.
Yah, you need to run it on all players to add it to that crate, but your target is the crate.
yep
like I said, was working fine until I put fobcrate=0; I guess
gonna test it now
My recommendation is to rewrite this. You should use the addAction to run a function to make the crate and then remoteExec the holdAction to all players for that object. No global vars or pubvars involved, just the one remoteExec.
Yes. More functions isn't the issue, network traffic is far worse.
Alright
Made 2 separate functions, exactly like when I first posted the scripts, but now it says that "fobcrate" is undefined
can I addaction to an array of objects or it needs to be 1 object?
One object, but you could use a foreach/count
publicVariable "fobcrate"; fobcrate = 0;
Why?
testing forgot to remove it
Also:
This command broadcasts a variable to all clients, but as soon as you change the variable again, you have to use publicVariable again, as it does not automatically synchronise it.
So you have to run it every time you update that variable and want it synchronized. Which is why I gave you the alternate way.
how do I create a game logic object using sqf?
I tried "Logic" createVehicle position cursorTarget but it doesn't work
I think it's createUnit for logic
Logic createUnit [ "LocationArea", getPosATL _sectorArea, [], 0, "CAN_COLLIDE" ];
@loud python
Is there a way to return to the main menu by script? Like the thing the Pause Menu button Abort does but only as script execution?
What's "LocationArea" though?
Any alternative ideas?
Actually, this may be an X-Y question
what I want is to lock an NPC in place
so I was going to just attach it to a game logic object
maybe there's a better way though
disable simulation leaves the NPC completely static
I want the NPCs to move around a bit
otherwise it just looks awkward imo
That's a bit more complicated, yeah.
also AI is already disabled, but players can push NPCs around
You could try disableAI.
and it's kind of a problem when a store NPC can be pushed out the window and falls off the building xD
I'd try if disableSimulation and switchMove work together, but I don't think it does.
How about having stuff like tables, walls, or something all around him with disabled simulation?
Effectively fence the AI in so it can't be pushed around.
Worst case scenario you can do some brute force BS and just force him onto XYZ coords every few (insert time interval)
I just tried attaching an NPC to a game logic object and it works
it still does the usual things but can't be moved
so I guess I'mma go with that
but how do I spawn game logic objects from sqf?
or is there some other, more convenient type of object I could use?
Worst case scenario, invisible helipads can work just as well.
yeah, probably
Or an object that is visible in theory, but the Z coord is so low that it's under the ground.
kind of a hack, but it should work
Then play with the Z value on the attachTo.
seems to work
this attachTo ["Land_HelipadEmpty_F" createVehicle position this]; this disableAI 'MOVE'
any idea how I can rotate the helipad to face the same way as the unit without using a temporary variable?
ah, but that's the problem
Or the other way around.
then I need to save the helipad in a variable first xD
That's the first solution comes to mind, with my not-so-recent experience.
Not if you name it in the editor...
(Which yes, is a variable, technically, but well)
but it doesn't exist in the editor ๐
sigh
I want a one-liner that I can put in a units init field
I should've assumed as much.
but I can just hide it all away in a script
You're creating it via what, createUnit array?
I was just wondering if it's possible to do that in point free style
nope, the unit is in the editor
Because if so, and if I remember correctly then object = createUnit yaddayaddayadda...
Same for createVehicle.
You should be able to straight up name the created object with the command.
my problem is
this attachTo [
createVehicle ["Land_HelipadEmpty_F", this, [], 0, "CAN_COLLIDE"] // Can't setDir on this because it's not in a variable
]; this disableAI 'MOVE'
wait, setDir wouldn't happen to conveniently return the object, right?
this attachTo [objectName = createVehicle; objectName setDir (getDir unitname)]?
Return value nothing.
Nope, sorry.
I dunno, it's getting too late and I have to work tomorrow.
Try if what I just wrote solves your trouble, if it doesn't, I'm honestly at a loss as to what might work.
I just had a bad idea
I can use a forEach loop with a single element like a let block in other languages xD
it works though ๐คท
{ _x setDir getDir this; this attachTo [_x] } forEach ["Land_HelipadEmpty_F" createVehicle position this]; this disableAI 'MOVE'
oh, but it seems the attachTo option doesn't work after all
for whatever reason the characters animations move at like 1 frame per second when it's attached
so in the ghosthawk
the copilot seat is taken as turret
and one of the turret sids is considered gunner
the left side to be exact
is that a bug?
@snow blade every frame
quick question
is it possible to actually revive a dead unit?
if not, is there an easy way to create a new one with the exact same equipment, face, etc.?
hmmm...
is there a way to access the content of a units init field ingame and run that on another unit?
What camera effect is the proper one without those black stripes on the top & bottom - these cinema effect things... ?
I want to get rid of those
Any idea why sleep 0.1 throws a "generic error in expression"?
it's inside an event handler
wrapping it all in a spawn {} fixed it, thanks ๐
didn't suspect that at first because I assumed it'd throw a more specific error when attempting to sleep in the wrong place
anyway, I'm stuck again ๐
_target = param [0, objNull, [objNull]];
_name = param [1, "repsol", [""]];
_init = param [2, {}, [{}] ];
_target setVariable ["name",_name];
_target setVariable ["init",_init];
//_target call _init;
[_target, _init] remoteExec ["call",0,true];
_target addEventHandler ["killed", {
_this spawn {
_target = _this select 0;
_class = typeof _target;
_pos = getpos _target;
_dir = getdir _target;
hint ("Se han escuchado disparos en la gasolinera de " + (_target getVariable "name"));
sleep 0.1;
_target enableSimulation false;
sleep 1;
for "_i" from 1 to 5 do {
_target hideObject true; sleep 0.2;
_target hideObject false; sleep 0.2;
};
deleteVehicle _target;
hint "Manolo ha muerto";
sleep 3;
_new = _class createVehicle _pos;
_new setdir _dir;
[_new, _target getVariable "name", _target getVariable "init"] execVM "manolo.sqf";
}
}]
the problem is the following:
that script is called manolo.sqf; so it calls itself on a respawned unit
and, in theory, should hand the _init variable through to the new instance of itself
now, the _name variable does get passed through, but _init doesn't
and I really don't see why
in the units init field, the script is called with [this, 'foo', {this addAction ["foo", {hint "bar"}]}
the first unit does have the "foo" action
when it gets killed and a new unit is created, it doesn't have the action anymore, but it does also respawn when killed and have the correct name set
Hello, everyone. I'm running Altis Life 5.0. I want to know how to add a second bank (small bank) to the map. Do you have any relevant tutorials or links? Thank you very much.
I don't understand arma anymore
_target setVariable ["DTI_init",_init];
hint typeName (_target getVariable "DTI_init"); // WORKS -- Prints: "CODE"
[_target, _init] remoteExec ["call",0,true];
_target addEventHandler ["killed", {
_this spawn {
_target = _this select 0;
// ...
hint typeName (_target getVariable "DTI_init"); // FAILS -- Does nothing
// ...
}
}]
@high marsh extra } where?
It's a nested code block
params[
["_target",objNull,[objNull]],
["_name","repsol",[""]],
["_init",{},[{}]]
];
the script itself uses param, but the block in spawn only has one parameter and it's always there, so there's not really a need for it
you're taking multiple parameters. You don't need to always use all of them
what exactly are you getting instead of:
this addAction["foo",{hint "bar"}]
So you're not getting the action? this isn't a valid reference to the player calling it
when calling it in the script, it has no idea what that is.
I get the action at first
then I kill the unit and it respawns after a while
the new unit gets the same event handler, so it also respawns, but it doesn't get the action
I've narrowed it down a bit though:
the parameter works fine; if it gets passed a code block, it runs it, because it works the first time
immediately after setting the "DTI_init" variable on _target, getVariable returns the correct value, as is expected literally right after setting it
but inside the event handler, the exact same code returns nothing
so somewhere along the way the variable "DTI_init" just disappears from the object
because the variable is gone with the object that was killed
it's not the same object
objects change when they're killed?
player object is a new object yes
note that, at that point, _target is the old object and _new the newly spawned one
ยฏ_(ใ)_/ยฏ
player has nothing to do with it; it's an AI unit
of course it respawns as a new unit
๐คฆ
but as I said, the _target variable still references the old object
the new one is saved in _new
anyway
the problem seems to be that the object loses the variable at some point
possibly when it dies?
The game shouldn't just drop variables on an object just because it dies, right? RIIIIGHT?!
I want to die
I DELETED the object a few lines ago
so the error isn't that init doesn't exist anymore
the error is that name still exists
I might have looked that way sooner if it hadn't randomly found the other variable
FFS I don't understand arma
Thanks for the help anyway though
A AI unit driving a vehicle in stealth behaviour have more chance to get stuck than driving in careless behaviour?
I prefer to use stealth behaviour but i fear AI will get stuck too often (using careless so).
But there are some bad things like vehicle lights on at night.
can BI attribute values for entities be given expressions/property values? The config has been updated for them properly but the expressions are not added to the mission file nor are they being activated on mission start
specifically the state attribute category ones like UnitPos, Init, etc
How can I detect multiple waitUntil conditions at once? I'm airdropping 5 vehicles at a time, and because the terrain below might be uneven, I don't know which one will touch down first. However, I need to execute some code on each vehicle as it touches down. waitUntil is the simple solution, but can't operate on each vehicle at the same time.
you can spawn multiple script threads to handle them, see https://community.bistudio.com/wiki/spawn
@slim oyster that worked great thanks! learn something new
I've got it working for five individual vehicles. Now, I'm unsucessfully trying to loop it in one block of code.
veh_array = [veh1, veh2, veh3, veh4, veh5];
{
["_x"] spawn
{
_sleepTime = _forEachIndex;
sleep _sleepTime;
_dropDir = getDir transport;
_x setPos (transport modelToWorld [0,-20,-5]);
_x setDir _dropDir;
sleep 1.5;
_chute = createVehicle ["B_Parachute_02_F", [0,0,0], [], 0, "FLY"];
_chute setDir _dropDir;
_chute setPos (getPos _x);
_x attachTo [_chute,[0,0,0]];
waitUntil {(getPosATL _x select 2) < 1.01};
detach _x;
_x setDamage 0;
deleteVehicle _chute;
}
} forEach veh_array;
tells me waitUntil is returning nil. What am I doing wrong?
Can anyone confirm that "checkAIFeature" actually works in the second syntax on the wiki? It produces an error for me and appears to not be implemented as documented.
https://community.bistudio.com/wiki/checkAIFeature
Specifically using this format produces a "missing ;" error:
_unit checkAIFeature "MOVE"
@mortal wigeon _x is unkown
Ah yes, figured that out. I've restructured the block of code as follows and get a new error:
{
[_x] spawn
{
_this setDir (getDir transport); // <--ERROR: TYPE ARRAY, EXPECTED OBJECT
_this setPos (transport modelToWorld [0,-20,-5]);
sleep 1.5;
_chute = createVehicle ["B_Parachute_02_F", [0,0,0], [], 0, "FLY"];
_chute setDir (getDir transport);
_chute setPos (getPos _this);
_this attachTo [_chute,[0,0,0]];
waitUntil {(getPosATL _this select 2) < 1.01};
detach _this;
deleteVehicle _chute;
_this setDamage 0;
};
sleep drop_int;
} forEach veh_array;```
add params ["_vehicle"]; before that error line
The issue is, that _this currently is not _x but [_x]
Than you can use _vehicle instead of _this
So I need to tell it how to refer to _x, it's not implicit
Well it is, but then you need to use (_this select 0) instead of this
you can also try to do _x spawn { _this setDir....}
ahhh so the argument is passed as an array
Yes
Not much to understand. Everything you pass to spawn is stored in _this
If you pass it as array, _this is an array
omg it's beautiful and works
thanks ๐
Two more things. Make sure to set your local variables to private by using private _chute
And add a tag to your global vars like veh_array -> Jester_veh_array
OK
Is there a way to prevent an animation from actually moving the character?
I have an animation that moves him slighty
when repeated he is moving away from his camera position
how do i get the side of the uniform a player is wearing. im using this but it keeps returning 0 for all types of uniforms.
hint str getNumber (configfile >> "CfgWeapons" >> uniform player >> "side")
That's because you are loading a mod which makes uniforms available for all sides
@frigid raven attachTo another object ๐
Or reset its position every time
@still forum im not setting that anywhere unless using this on the arsenal causes it.
0 = ["AmmoboxInit",[this,true]] spawn BIS_fnc_arsenal;
@winter rose will try that
are you loading any mods?
try looking into uniforms mo.... Why are you looking in CfgWeapons? uniforms are vehicles
@still forum
i have no thrid party mods. just our server side one and we dont do anything complex like mess with uniform side modification. also i tried both cfgvehicles and cfgweapons.
this is the code im tyring to get to work. the previous code i posted was from testing
if ((getNumber (configfile >> "cfgvehicles" >> uniform _player >> "side") != 1)) then
you can check modelSides array
that says which sides can pick up and wear the uniform
how do i get the name of a uniform? this doesnt work because uniform returns a string
name uniform player;
nvm found this
getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "DisplayName")
ok thats not working, how do i get the name of a uniform? not the type but the name?
uniform player?
that gives type
Instead of typeOf _vehicle, I mean
Check the config viewer to see the name property on uniforms
im using this and its not working.
private _uniform_name = toLower (getText (configFile >> "CfgVehicles" >> uniform _player >> "DisplayName"));
what function tells me the config file type?
uniform player gives you the config type
but displayname might be in CfgWeapons entry
i tried CfgWeapons too in that code i posted. no luck.
nvm cfgweapons does work i had a syntax error
Can I select something like objNull as player ?
I want to deselect my player from a current unit so I can remove it. But I haven't anything to substitute the player control for some time
@frigid raven yes.
is there anything happening bady when doing so?
shouldn't
selectNoPlayer is SP only, maybe try selectPlayer objNull
Scrat wants to know your location ๐ฐ
// setup lobby agent
private _playerGroup = createGroup [west, true];
COOPR_LOBBY_AGENT = _playerGroup createUnit ["B_diver_TL_F", getPos COOPR_LOBBY, [], 0, "NONE"];
DEBUG("lobby agent was created");
COOPR_LOBBY_AGENT setUnitLoadout EMPTY_LOADOUT;
// to prevent lobby players from syncing
COOPR_LOBBY_AGENT setVariable [COOPR_KEY_PLAYER_LOGGEDIN, false, true];
// remove old character
private _oldPlayerUnit = player;
selectPlayer objNull;
deleteVehicle _oldPlayerUnit;
DEBUG("old character has been destroyed");
COOPR_LOBBY_AGENT setPos getPos COOPR_LOBBY;
DEBUG2("lobby agent for %1 spawned in lobby", getPlayerUID player);
This is my problem atm. This is the spawnToLobby function. I want to destroy the former player unit and have the player selected as objNull. COOPR_LOBBY_AGENT is just a showcase unit for the character selection. I let it play some animations and so on.
What happens here is that the _oldPlayerUnit is not destroyed.
@winter rose ๐ฌ low one
So when I logout in my mod the old player character/unit is still there. It has not been destroyed ๐ข
are you sure that selectPlayer objNull does indeed select no player?
it worked when I did this:
// remove old character
private _oldPlayerUnit = player;
selectPlayer COOPR_LOBBY_AGENT;
deleteVehicle _oldPlayerUnit;
DEBUG("old character has been destroyed");
But that is not an option since I can not play animations when the AGENT is the player - or I just don't know how to properly
I don't know if you can deleteVehicle the player (but I don't see why not)
@winter rose no unsure
A deleted player unit will stay visible until that player has disconnected.
means that selectPlayer objNull had no effect
I think I spawn a stone and make this the player
lol
4ever...
no way
the clients will end up with 100 clones when logging in and out all the time ๐
maybe I should drop a bomb every 10seconds at [0,0,0] ๐ค
delete and move
so that the unit will disappear on player disconnection?
well, move then delete
where did you get the "a deleted player unit (โฆ)"?
selectPlayer doc
bottom note
no wait
deleteVehicle doc
Multiplayer:
A deleted player unit will stay visible until that player has disconnected.
mybe I just use hideObject
hopefully it won't simulate collisions that way
hideObject did the job
Funny, I don't see it in deleteVehicle doc (on mobile)
I have an IntelliJ Plugin for SQF - it will show doc when hovering over keywords
there it is shown - the plugin is fetching the html from that wiki site - maybe the text is hidden via css/html on the browserpage
@frigid raven
Guys, has anyone thought on increasing tank smoke effectiveness via scripts?
The bird's eye view on the approach:
- Script activates either via the tank's
incomingMissileor AT'sfiredEH - During the missile flight, scan if tank has deployed smokes
- If smokes detected - make something with missile
The trickiest part here - is detection of the deployed smokes. I can't imagine any ways to check if tank is into smoke area, except querying smokeshells nearby tank via nearEntities or analogical commands. Taking into account missile speeds, the check has to be done either each frame e.g.waitUntil or using a loop without a delay.
The issue here - is that approach would work in single player, but not in MP, where there are dozens of missiles fired.
Anyone has ideas how it could be dealt with?
anyway no I did not tested since I am good with another solution
@frigid raven Ah ok. It probably downloads a copy of the wiki that's old or been edited since. I think that plugin has a button to take you to the actual wiki page.
yeah it does and it's the same you guys are looking at
Any idea how to get rid of those blank planks on the top and bottom when using the camera?
while {true} do {
_isInWater = surfaceIsWater getPos player;
if (_isInWater) then {
hint "In Water";
} else {
hint "Not in Water";
};
};```
Anyone know why this wont run forever?
only runs for a second
@frigid raven see showCinemaBorder
i have hacker using scripts to cheat on my server, any way to catch him? he bypasses battleye filter, can i use to script to detect script?
@winter rose worked Thx!
He could easily kill your script threads even if you tried to do anything with scripts. Watch and ban him when he acts is your best bet.
got a problem with the Nimitz plane initialization when zeus spawns a plane on a hosted server (dedicated not tested, local no problem). The code looks like this: ```sqf
// Written by TeTeT for Nimitz
params [["_plane", ObjNull]];
if (isNull _plane) exitWith { diag_log "planeInit Nimitz: null _plane"; };
if (!local _plane) exitWith { diag_log "planeInit Nimitz: !local _plane"; };
if (_plane getVariable ["TTT_catHook", false]) exitWith {};
_plane setVariable ["TTT_catHook", true, true];
diag_log "planeInit Nimitz: before syncCatapult";
[_plane, ObjNull] remoteExec ["TTT_fnc_syncCatapult", 0, true];
diag_log "planeInit Nimitz: after syncCatapult";
[_plane] remoteExec ["TTT_fnc_syncTailhook", 0, true];
[_plane] remoteExec ["TTT_fnc_syncFuelAction", 0, true];
[_plane] remoteExec ["TTT_fnc_syncIflols", 0, true];
diag_log "planeInit Nimitz: initialized plane!";
_plane;```
the diag_log lines are all shown in the rpt, but the critical line [_plane, ObjNull] remoteExec ["TTT_fnc_syncCatapult", 0, true]; seems to be ignored in the case of Zeus spawned plane
the script is called from the init event handler
when I use debug console and execute locally [(vehicle player), ObjNull] remoteExec ["TTT_fnc_syncCatapult", 0, true]; the catapult sync works
prolly the plane is not initialized yet, as described somewhere on the wiki regarding the init eventhandler or it's a locality issue
@plain current thanks, but the following code seems to work: ```sqf
diag_log "planeInit Nimitz: before syncCatapult";
[_plane, ObjNull] remoteExec ["TTT_fnc_syncCatapult", 0, true];
[_plane, ObjNull] call TTT_fnc_syncCatapult;
diag_log "planeInit Nimitz: after syncCatapult";
is there something with remoteExec and zeus spawned units?
when I use createVehicle the init eh seems to be executed: sqf p = "B_Plane_Fighter_01_F" createVehicle (getPos player); p setPosASL [getPos p # 0, getPos p # 1, 17.5];
That's odd. 0 should still run it on all clients.
@plain current you were right, the plane seems to be not complete yet when spawned via zeus, the following code seems to work: ```sqf
diag_log "planeInit Nimitz: before syncCatapult";
[_plane] spawn {
params ["_plane"];
sleep 1;
[_plane, ObjNull] remoteExec ["TTT_fnc_syncCatapult", 0, true];
};
// [_plane, ObjNull] call TTT_fnc_syncCatapult;
diag_log "planeInit Nimitz: after syncCatapult";
seems like a race of some sort
is there a scripting way to increase the item cargo space of an ammobox?
setUnitTrait "loadCoef" for a unit, but for a vehicle I don't know, I think not
I just want to prevent overloaded Ammoboxes when players want to put items back into it
no need to justify it ^^ but IDK if it is possible, unfortunately. maybe someone else here knows
I hope so. ^^
@tawdry harness
In non-scheduled environment, while do loop is limited to 10,000 iterations, after which it exits even if condition is still true. In scheduled environment no such limit exists.
https://community.bistudio.com/wiki/while
so use
[] spawn {
while {true} do {
_isInWater = surfaceIsWater getPos player;
if (_isInWater) then {
hint "In Water";
} else {
hint "Not in Water";
};
};
};
Hi,
probably a very simple question:
I want to use Grumpy Old Man's Aircraft Loadout (https://forums.bohemia.net/forums/topic/204747-release-gom-aircraft-loadout-v135/) in every singleplayer mission on every soldier so I can modify air loadouts on the fly.
I'm a super script noob, but I managed to modify the variables to my liking. However I can't figure out how to correctly call the script. I use several mods (like MCC) that run on every mission. But I don't know how to replicate its behaviour.
I tried to use this tip: https://steamcommunity.com/app/107410/discussions/0/35221031836000477/#c2765630416818239773
But it seems I won't be able to load the description.ext which contains the links to the subfolders.
Anyone here that can guide me? I googled around a bit, but can't find a solution.
Many thanks ๐
sweet thanks so much
Hi, I have placed a house on my map but I cannot open the door, there isnt even an option. But when I place it using eden builder, i can open it. How do I fix this
(I placed the house in terrain builder and exported the .wrp)
๐ #arma3_terrain , the house object itself seems to be fine
what about its scripts or whatever
you placed the house in the Eden *editor?
placed the house on eden, exported to terrain builder. exported the .wrp . Packed the pbo and opened back up on eden editor. THe house is there, but it cannot be opened
if it is a Vanilla Arma 3 house, yep, I believe it goes to terrain builders. It may be a config issue, or something like that
It isnt a vanilla arma house
I don't know, but it is not a scripting issue
Oh okay, I appreciate your help.
Sorry about that, I don't know anything about terrain creation
Has anyone had experience with this tutorial? http://killzonekid.com/arma-scripting-tutorials-uav-r2t-and-pip/
I have been trying to to get it to work in my mission and it has just been incredibly noisy.
I can get the modifications to the script in a postbin if you want to look at it.
looks like you changed the (argb,512,512,1) part
unfortunately changing it back to 512x512 did nothing :/
I am using helicopters for BIS_fnc_moduleCAS. There is condition at the end waituntil {_plane distance _pos > _dis || !alive _plane};. The distance variable _dis is set to 3000, so in case of helicopters they do not reach that far after shooting, so they are stuck in air waiting for that condition. Any proposal how to order helicopter to fly away using BIS_fnc_moduleCAS any other than create my own CAS script ?
Is there a global condition somewhere in the function that you could reference?
I suppose it would be possible to reference a variable if there is one, then calculate where the front of the chopper is, create an invisible helipad 3km in front and doMove the helo onto it.
its possible change this animTextureNormal via script
placeCharge = {
if (_actionShowing == 0) then {
_actionShowing = 1;
c4 = [];
player addAction ["Place Charge", {
_actionShowing = 0;
player playActionNow "PutDown";
_c4 = "DemoCharge_Remote_Ammo_Scripted" createVehicle position player;
_n = count c4;
c4 set [_n, _c4];
player addAction [format ["Detonate Charge #%1", _n + 1], {
(_this select 0) removeAction (_this select 2);
(c4 select (_this select 3)) setDamage 1;
}, _n];
player removeMagazine "DemoCharge_Remote_Mag";
(_this select 0) removeAction (_this select 2);
}];
};
};``` Anyone know why the _actionShowing var isn't being changed back to 0?
is it cos its in a function?
_actionShowing is not defined in this scope, yes
ok so how would i make it so that it does actually change the variable?
this is called from a while true loop
Make it a global or object variable I suppose
i thought of that but making it a public variable sends it to every client on a server?
which would be bad
@tawdry harness global variable != publicVariable
just use setVariable on the object, don't make it public, and it's good
is it possible to create a zeus using the debug console?
(not using eden editor)
yea, just create the curator module and assign a unit to it
How would one do that 
How to have multiple destinations per one task ? BIS_fnc_taskCreate
BIS definition of what a task is implies one or zero destinations. However, you can have a parent task.
hmm, so break it to sub-tasks I guess :/
I mean possible there are various workaround... I believe the description can be structured text. So a single task could contain hypertext to markers instead... Or maybe the execute tag works so the text could contain words that toggle the various destinations ... at locations <execute expression='["MyTask", getMarkerPos "the_village"] call BIS_fnc_taskSetDestination'>village</execute> .....;
Do the EHs and object namespace vars get transfered to the new unit after respawn?
I believe the EHs does, but not actions or namespace vars
So I would have to transfer those via onPlayerRespawn
I believe so, yeah... Though I would recommend only copying those variables your scripting administrates... Otherwise other scripts breaks.
