#arma3_scripting
1 messages · Page 521 of 1
yes
Unless enableFatigue is local then you need to remoteExec
Also I think it has been deprecated and stamina is what is left
{
if ( name _x == "DrunkDwarf" ) then {
[_x, false] remoteExec ["enableFatigue", _x];
};
} forEach allPlayers;
by "local" do you mean things that are on the client only?
so would getVariable/setVariable be an example of that too, if i'm looking for a variable set for that client?
for example:
player getVariable "score";
with score being a variable set on the client, the above command returning for my user if run with local exec.
Depends on how you set the variable
If it is local then you could only read it on client you set it on
I think i understand, thanks
Okay so the 5 thing was just weird. I left the editor and went back in and suddenly itt was workiing right.
the wiki says whether arguments are local or not
often says
Is there something wrong with
params [
"_placeboA",
"_placeboB"
];
_styleOpen = "<t size='1' font='PuristaSemiBold' color='#58D3F7'>";
_styleClose = "</t>";
_target addAction [
format ["%1Base%2", _styleOpen, _styleClose],
{
[
_this select 0, _this select 1, _someArray
] call func;
}
];
yes
addAction ["",{ /* stuff */ }]```
the addAction argument is an array, not code. the second element of the array needs to be code or string, not the code the action should execute. also _someArray isnt defined but i assume thats just for the example.
it looks fine, aside from the already mentioned _someArray and func (hopefully) being an example varname too.
I get told that _someArray is undefiined iin the recieviing func
good. because it is.
where in here do you define _someArray?
{
[
_this select 0, _this select 1, _someArray
] call func;
}
Sorry, I leftt that detail out
// Establish Array
_someArray = [
["_tpNodeBase", "Base" ,2],
["_tpNodeRange", "Range",2],
["_tpNodeExplosives", "Explosives" ,2],
["_tpNodeIsland", "Island Runway" ,2],
["_tpNodeUSS", "USS Freedom" ,2],
["_tpNodeRGS", "RGS Posidon" ,2],
["_tpRandom", "Random" ,2]
/* Value 2 = coordinates */
];
you should paste exactly what ur working with otherwise whoever is helping has to piece together.
Sorry, I try to simply it so sundry things are cut out
But ill stick to stiiickiiing all of it next time
Pastebin
Okay guys.
So since _someArray is defined
Where am I going wrong since im being told its undefined?
it isnt defined
not in the action
the action executes in its own script instance, it cant use local variables defined in the script that added the action. (assuming _someArray is defined outside the action)
I see
So then how would I pass on an array?
Perhaps:
_target addAction
[
format ["%1Base%2", _styleOpen, _styleClose],
{[_this select 1, _this select 2] call RGTA_fnc_teleportPlayer}, _someArray
];
?
you had it there before you deleted the message 😦 though you will need to use _this select 3 inside the action to use the array.
Oh my bad, didnt think II had done something right for a change
Okay cool, thanks a lot. Im sure this is all very menial.
Would select 3 be going after select 2?
I thought that would tthen select the 2nd param?
params ["_target", "_caller", "_actionId", "_arguments"];
does SQF have something like continue for loops?
not to my knowledge. closest thing is to put your loop code in an if statement.
@fringe yoke What do you want to do ?
just something like ```sqf
{
if (something about _x) continue;
_x setDamage 1;
} forEach allUnits;
Invert the condition (opposite to what you would need to call continue for) and put the code in the if, and there’s your continue.
Is it possible to remove the smoke particle effect from a campfire?
you might be able to remove the particle effect from the config file with a mod.
Is there an easy way just to recreate the fire particle effect, and the sound?
yea
createSoundSource ["Sound_Fire", getPos _fire, [], 0];
for the particle effect i'd take a look at the fire module function.
So effects is "SmallFireF"
Why do I keep getting generic error in the expression error? Im trying to write a waitUntil loop that checks if the vehicle cargo (VIV stuff) is empty. (count (getVehicleCargo _craft)) == 0; does work on its own and returns true if the cargo hold is empty, but when I put it into the waitUntil it stops working.
if (count (getVehicleCargo _craft) > 0) then {
_craft setVehicleCargo objNull;
waitUntil
{
sleep 1;
(count (getVehicleCargo _craft)) == 0;
};
};
are you running that script in unscheduled environment?
you mean the console? Yeah
debug console is unscheduled. sleep & waituntil only works in scheduled (spawn/execvm) environments.
btw is this correct?
if !(ALIVE(_craft)) exitWith {};
depends what the alive macro does.
well it checks if unit is alive
@copper raven that's what I'm doing now, just was hoping for something cleaner
hey, silly question but. how do i set a task state to succeeded once a fuel truck has been destroyed?
You can use a trigger that is activated when the truck is destroyed
In a script you can use https://community.bistudio.com/wiki/setTaskState
i'm seeing if i can go script-free in this mission
I don't think you'll be able to go entirely script free, you can create a blank trigger and have it activated when the vehicle is destroyed
In the activation use something like
!alive myvehicle
Is there any way i can set vehicles as medical by classname ?
same with repair vehicles
talking about ace of corse
myvehicle setVariable ["ACE_isRepairVehicle", true]
Pretty sure it's the same thing for medical
were should i put that init ? first time working with ace after the modules are gone
I think i explained to stupid.... I have multiple vehicle spawners and only a few vehicles are meant to be medical..... i was wondering if i can configure all vehicles with a certain class to be medical like in the modules some months ago
Only option I think is to set the variable ace_medical_medicClass to 1 for the vehicles when they spawn: sqf (_vehicle getVariable [QGVAR(medicClass), getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "attendant")]) > 0
The code in fnc_isMedicalVehicle.sqf only checks that now
If you have your own mod, then you can mod the config for certain vehicle classes that you want to set attendant = 1;
@thin pond https://github.com/CBATeam/CBA_A3/wiki/Adding-Event-Handlers-to-Classes-of-Objects maybe this could be useful if you use cba.
edit: You obviously use cba if you are using ace...
addaction to class is an amazing tool which gives players the possibility to rely that a certain object will always be a teleporter or shop or arsenal etc and you can customize said actions in a centralized script.
also its Zeus compatible if you want to spawn in more shops etc.
what again was needed to have scripts be recompiled and devleoped at runtime?
Description.ext allowFunctionsRecompile = 1 - was that all?
filepatching
if you want to connect to a server ^
yeah
Is there anyway to check if objects variable is public to clients?
other than testing it on a client and sending the return value to back to server
That won’t tell you if it is public only that there is a variable with the same name and possibly the same value
So.. when my functions are actually changing in the Ingame-Functionviewer shouldn't they actually apply this "added" functionality when I press "recompile" ?
I really have a terrible time getting this to work
Yes
wtf
why does it work now
it like took 5min until the change really arrived??!
fucking hell - forget it. I am going crazy it seems
Get a faster pc
@tough abyss https://www.3dmark.com/spy/6417129
This is my rig
If I go faster I travel back in time
Maybe you already do, 5 min in the past that would explain it
God I hate you clever clogs
could I use a simple trigger to turn off setcaptive on a unit, so as the enemy will start shooting back once they escape a area?
Yes.
would it just be unit name, setcaptive false
it is, stupid me, I wasn't syncing the unit to the trigger
Thank you for the Yes, Lou, I wasn't hunting all over why it wasn't working when it was just me not finishing my work
@still forum trigger statements are not cached any more, so your trigger condition is now recompiled every time, congratulations everyone!
Aren't they stored as code internally?
Guess you have to stop writing shit code now
and stop complaining about like 0.2 milliseconds compilation time every 0.5 seconds
Who knows instead of leaving an option, all improvements that some clever guy added, got hacked in their entirety. So yeah, it is not just trigger statements
Some "improvements" that some guy made that caused a terrible memory leak got reverted yes.
A bug was fixed. o no.
the cache could have been limited as well, so after it reached certain size it could have started overwriting it from the beginning
A bug was fixed you call it a fix?
reverting something is not fixing, it is just undoing it
reverting a bugged feature is fixing a bug yes
there are many different ways that could be fixed.
BI just doesn't have the programmers to do it differently. So if you wanna. Send them a application and move to czech
wow if only everything was "fixed" this way we would still live in caves
jup
Complain to BI management for not assigning more engine programmers to Arma 3. But don't complain to me for getting a terrible memory leak fixed
So if you wanna. Send them a application and move to czech please do not be this naive
I think I get something wrong with scopes somehow. I have the following function call:
[_reconDestination, _taskId, "RECON"] call coopr_fnc_createTaskMarker; // _reconDestination itself came from params
Then in my fn_createTaskMarker I have the following:
params [["_position", objNull],
["_taskId", ""],
["_taskMarkerType", []]];
if (_position isEqualTo objNull) exitWith { ERROR("_position was objNull") };
if (_taskId isEqualTo "") exitWith { ERROR("_taskId was empty string") };
if (_taskMarkerType isEqualTo "") exitWith { ERROR("_taskMarkerType was empty string") };
if (isServer) then {
switch (_taskMarkerType) do {
case "RECON": {
DEBUG2("destination: %1", _reconDestination); // _reconDestination was never declared in this scope nor the params have a variable called that way
_reconTaskMarker = createMarker [_taskId + "_marker" + "_area", _reconDestination];
_reconTaskMarker setMarkerSize [300, 300];
_reconTaskMarker setMarkerAlpha 0.5;
_reconTaskMarker setMarkerColor "ColorRed";
_reconTaskMarker setMarkerShape "ELLIPSE";
DEBUG2("recon task marker created: %1", _reconTaskMarker);
};
default {
// other stuff
}
};
} else {
SERVER_ONLY_ERROR;
};
My log statement happily tells me
[Server] COOPR.TASKS.debug - destination: [16589.5,11179.8,0]
Now what I don't get is how does _reconDestination received its value here? Is the scope where the function got called still valid for called functions? Since I asummed private variables are only available in their scope and are not delivered to the next nested function scope.
private variables don't overwrite parent scopes
still carry over to lower scopes though
Ok so then the value is doubled here as _position and _reconDestination
If you do _reconDestination = 5 inside createTaskMarker you will overwrite the one in your parent function
yes
Why you default taskmarkertype to []?
Anyway to trigeer a sound every time a lighting strike plays? I want to add my own thunder claps
@sinful flame not sure there is an event handler about thunder (maybe), but taking the problem from the other end you can create a Zeus lightning yourself and play sound whenever you create it
Ahh Good idea. Thanks What command do I use to do that?
createVehicle with the lightning classname, that I don't remember of course
seems to be "Lightning_F"
Try Lightning1_F and Lightning2_F, should work
NP, Thanks I will check it out. I wish Arma could support ambisonic files.
So in editor I can toggle foliage. Can I do that in game via script
like grass? setTerrainGrid 50;
hideObjectGlobal ?
Or setTerrainGrid
Needs to be executed for each player if you're going to want to use setTerrainGrid. Local effects
Or, if you want to consistantly apply this across missions. You can also set it on server and have it be applied to the player that way
If you hit control G in editor you'll see what I mean
like it even removes leaves off of trees, without getting rid of the trees themselves
G isnt doing anything 😟
Control+G
oh hey thats cool
@KarelMoricky
13 Apr 2016
@DejanJankovic20 I'm afraid it's limited to the editor, there are technical reasons which prevents us from making it a full feature.
you can get close to it with this sort of thing
https://forums.bohemia.net/forums/topic/202639-altis-with-no-vegetation/?do=findComment&comment=3161436
but it hides trees completely so not exactly the same.
anyone know of the top of their head what could be causing
4:55:02 [88059,142.857,2292.06,60.426,[Agent 0x356a4140],"Cock_random_F",[4793.96,552.461,0]]
4:55:02 [88059,142.857,2292.06,60.426,[Agent 0x7430c0c0],"Sheep_random_F",[4699.35,1094.74,0]]
4:55:02 [88059,142.857,2292.06,60.426,[Agent 0x12bf4100],"Hen_random_F",[4014.53,689.683,0]]
4:55:02 [88059,142.857,2292.06,60.426,[Agent 0x3cb20140],"Sheep_random_F",[3775.54,1367.08,0]]
4:55:02 [88059,142.857,2292.06,60.426,[Agent 0x3137c180],"Goat_random_F",[4744.45,1074.46,0]]
``` but for all objects, it looks similar to cba's logs, so not sure if it could be something to do with that
looks like you're creating some animal objects
@still forum Sorry for personal mention, but that's pretty delicate question about engine. Is there any "normal" scripted way to detect client connectivity loss in <10s, without constant remoteExec ping-pong. Maybe some utility commands that shows that behavior to base off? Thanks.
uhm ... why would you want to do that @unborn ether ?
@queen cargo Disable keyboard inputs on some value threshold, until back to normal.
for what reason
You want to run check on client to see if it is lagging?
There has to be something you can set in server config to purge bad clients
Hi all ..is there a way to find all the mod used by a client ..via script ? thx for your replies..
not this one..maybe like cba,ace, etc
thx dude..it's the way !
@tough abyss Yes there is kickClientsOnSlowNetwork[] but I don't need exactly to purge people and honestly it's not really reliable. Last time I've used that - they were reacting pretty incorrect with MaxPing and not really smart. I want people to be locked temporary not to throw them out for any single ping packet over that value.
Yo boys !
Does doArtilleryFire execute locally or server side ?
@quartz coyote If there is no mention of argument or effect - usually that's AL EL
And not server-only too.
Okay thanks
Trying to work on a new script, My objective is to give everyone within a 20m radius a black screen for 2 seconds EXCEPT the person who ( For example ) Clicked the addaction. how would i go about executing this script onto people?
Which part of it are you having trouble with? The entire concept could look like addAction > blackout.sqf > check distance of allPlayers > use something like titleText for black screen
i'm having trouble with the executing it to everyone within the radius except for the person executing it
like how do i make the "Executor" exempt from the script
_allplayersWithin20m - [player]
Could you brief me on how to incorporate this within what i want?
use select alternate syntax 5 to get the players that are within 20 meters allPlayers select {_x distance _caller < 20}
Thank you 😉
@unborn ether scripted way to detect client connectivity loss no
on serverside*
on clientside.. Maybe you can detect the text UI element that get's shown
Like, send serverTime to fill text control and then compare it on client with current serverTime?
don't know if current serverTime keeps updating when you get no messages
would ofc be awesome if it didn't
hi anyone know if its possible to make ListNBox row colors like this https://gyazo.com/963c1f9b9c125c1ddd6086e0f0be053f
@still forum No, serverTime is not synced. Seems to be once client recieve it it goes on its own.
Rip
Did any public Zeus servers go down lately because they were all locked for me
Fuck wrong channel
(delete your messages before you repost in the right channel)
any help?
guys i did this a long time ago but i forgot
its about server and templates
how to make that when i enter to the server i need to choose template what i want ?
Unlike CUP, it just changes the lighting color and not the darkness or anything else. Subtle effect, but makes a huge difference
how much?
Hello, how can I stop an AI unit firing after commanding it with commandFire
Try setCombatMode to hold fire
Is there a script I can use to have a heli start the rotators when I’m not in it? I’m trying to simulate where an emergency call has gone out and the heli is now just waiting for the passengers.
engineOn
Thanks
Also how would I go about having a unit have his pistol holstered until he is in contact.
I seem to remember a script for it I just can’t remember it.
I figured it out. But I am trying to change the waves of the ocean. I’m trying to make them bigger, is there a specific script I can use?
you cant
the maximums are set in terrain config
more wind should make the waves as big as they get I think
Really? I read on a forum that this one guy did it, but he never used any code. I was hoping there are bigger waves because I got some warships and I’m trying to have them go through a storm. I found this, and I’m running it through the console it executes but nothing happens
WaterMapScale = 20;
WaterGrid = 50;
MaxTide = 0;
MaxWave = 0.25;
SeaWaveXScale = "0.1/50";
SeaWaveZScale = "0.1/50";
SeaWaveHScale = 100;
SeaWaveXDuration = 30000;
SeaWaveZDuration = 30000;
yeah that wont do anything
if you have the link to that forum post paste it here pls
What do you mean by run time?
Crap, ok well thanks.
hello, guys, do you know any way to get rifle reloading time instead of this?
getnumber (configfile >> "CfgGesturesMale" >> "States" >> (gettext (configfile >> "CfgWeapons" >> _cmuzzle >> "reloadAction")) >> "speed") * -1
this one works well on some weapons (like the most of rhs), but others return strange numbers like 0.37 (bis mx)
The speed value there is the speed at which the animation plays rather than how long it will take to complete the animation
Anyone know if its possible to make the commander and gunner viewpoints viewable from the passenger seats of a vehicle?
that... might be possible. Ideally a config approach would be best rather than a script approach for that, but I'm not sure if it will let you apply the same optic to the cargo spots.
just a quick one, just trying to create a list , but the pictures arent quite lining up because the image isn't actually centered, is there a way around this, without hardcoding every single image https://gyazo.com/88e3311cde5d2d1c925e77e95152f97c
Is it possible to load a file into arma's config during a mission?
@wary vine display the image using a structured text control with align center attribute.
valign isnt a valid attribute
check the wiki 😉
🤔
it is on there in multiple places
not sure how ive never noticed that before
i must not have looked at this page since before KK rewrote it in january 🤷
anyway, is the image itself just not centered or is it how it shows on the control? may need to make it taller
then the others wouldn't fit, from what i have seen most images are centered, just this one so far xD
@vapid crypt thanks for the hint, do you know how to find the time animation will take?
@late silo if I understand what you ask right, then no. But if you explain what you are trying to do might find better answer.
@leaden venture you have to explain more what you mean by that.
@young current
You know how if you sit inside one of the Marshalls crew seats, you can push the MFD cycle mode keys and see the passenger count, then the Commander optic, then the gunner optic? I'd like to enable that for passengers
So that passengers could see what the commander sees? Or use the optics independently?
Hello everyone! I have some problem with understanding ACE3 scripts. I see this class in ace_mk6mortar addon, in CfgVehicles.hpp:
class GVAR(rangetable) {
displayName = CSTRING(rangetable);
condition = QUOTE([_this] call FUNC(rangeTableCanUse));
statement = QUOTE([_this] call FUNC(rangeTableOpen));
icon = QPATHTOF(UI\icon_rangeTable.paa);
exceptions[] = {"notOnMap", "isNotInside", "isNotSitting"};
};
How i can determine params in _this variable? Where i can find it?
on the ace wiki
I'm assuming you are talking about a ACE interaction. You didn't say that. but the code looks like it
Yes, you are right. Sorry for my inaccuracy. Thanks! 🤗🤗🤗
Is there a way to make a vehicle be controlable through the uav terminal ? like a blackbird ?
you can use remoteControl script command for similar control, but I dont think you can use the default UAV terminal stuff on non UAV vehicles
do note that every UAV/UGV has invisible hidden AI units in them
that the terminal then controls
already found out... only possible through config.... thanks anyways
Hey guys, I'm having a little trouble. Forgive me if my scripting looks stupid, I'm a novice. :P
For context, I'm intending to make a script that has a laptop with several options on it. You scroll on the laptop, and it has several addActions on it. One of those addActions enables a lot more addActions, giving you options to harm and heal yourself. It's all part of medical training.
The problem is that the addActions aren't actually appearing. Through using hints, I have determined that the first script successfully passes True to the script below, so I don't believe that's the problem.
selfMedicalActions.sqf
/// Passing "True" from "Terminal.sqf" when "Self Medical" addAction is selected by the player.
_enableSelfMedical = _this select 0;
/// Variables
private ["_assignDamage"];
/// Determining if _enableSelfMedical is true when ran
{
if (_enableSelfMedical = True) then {
player addAction ["Damage Head: Light", {_assignDamage = 0;}];
player addAction ["Damage Head: Heavy", {_assignDamage = 1;}];
player addAction ["Damage Torso: Light", {_assignDamage = 2;}];
player addAction ["Damage Torso: Heavy", {_assignDamage = 3;}];
player addAction ["Damage Left Arm: Light", {_assignDamage = 4;}];
player addAction ["Damage Left Arm: Heavy", {_assignDamage = 5;}];
player addAction ["Damage Right Arm: Light", {_assignDamage = 6;}];
player addAction ["Damage Right Arm: Heavy", {_assignDamage = 7;}];
player addAction ["Damage Left Leg: Light", {_assignDamage = 8;}];
player addAction ["Damage Left Leg: Heavy", {_assignDamage = 9;}];
player addAction ["Damage Right Leg: Light", {_assignDamage = 10;}];
player addAction ["Damage Right Leg: Heavy", {_assignDamage = 11;}];
player addAction ["Remove Self Medical Options", {["False"] execVM "Scripts\MedicalTraining\selfMedicalActions.sqf";}];
}
// Removing the actions when the "Remove Self Medical Options" addAction is selected by the player.
else {
player removeAction DamageHead:Light;
player removeAction DamageHead:Heavy;
player removeAction DamageTorso:Light;
player removeAction DamageTorso:Heavy;
player removeAction DamageLeftArm:Light;
player removeAction DamageLeftArm:Heavy;
player removeAction DamageRightArm:Light;
player removeAction DamageRightArm:Heavy;
player removeAction DamageLeftLeg:Light;
player removeAction DamageLeftLeg:Heavy;
player removeAction DamageRightLeg:Light;
player removeAction DamageRightLeg:Heavy;
player removeAction RemoveSelfMedicalOptions;
};
your remove action stuff is clearly a syntax error
also you cannot access local variables from other script
you are setting _enableSelfMedical to true, not checking whether it's true
You can find out yourself that the local variables inside the addActions cannot possibly work by just thinking how that stuff is executed time wise.
You create the _assignDamage variable in your script. Then add the action. Then your script ends. _assignDamage goes out of scope and disappears
now half an hour later someone executes the action..
Cannot possibly set a variable that has been deleted half an hour ago
Hi people!
So, I'm working on a warlords mission, and I have tweaked the units on the map a bit in terms of gear. They initialize correctly on mission start, but after respawn the custom gear is replaced with the generic gear the unit has.
So, with some help I've worked out that I need to include a onPlayerRespawn.sqs in the missions folder
But I can't find any documentation on how to set that up.
Mission is pvp, with players on both opfor and blufor. How can I make that script so that on respawn a blufor player gets his gear, and an opfor player gets his gear?
If you create a file called onPlayerRespawn.sqf in the root directory of your mission along side your mission.sqm That file will be run when a player respawns and it also has some parameters passed to it but I can't quite remember what they are exactly. @sonic slate
Its the same as a normal sqf file but is only called when a player respawns and only on their client.
How to differentiate sides then?
PlayerSide will return either east or west and you can check against those
Thanks, I'm very new to scripting, so this helps a lot
Switch(playerSide)do{
Case west: { bluefor script };
Case east: { opfor script };
}
Something simple like that will work for you.
And allows for you to easily add more sides if needed
Thanks a lot!
👍
So there is no need to call the script from missions.sqf or description.ext?
onPlayerRespawn.sqf is executed automatically on the client where the respawn happens, from what I know
Yes as @round scroll said
removeGoggles player;
player will be defined as the client local when executing onPlayerRespawn.sqf
Makes sense
it is unsdefined as it should be on the server
How about AI players though?
AI are created on the server
If you want to execute a script when creating AI, you'll need to do it when creating.
Their locality changes when the player controls them and when the player disconnects. When the player disconnects they're back on the server
There is a specific event handler that fires when this event occurs
:+1:
How to know if a vehicle was fliped over?
No commands or functions, you're going to need to write your own solution
vector commands have some help with this
@astral tendon I wrote this a month ago
https://github.com/Sparker95/Project_0/blob/development/Project_0.Altis/Misc/fn_isVehicleFlipped.sqf
well it has some commented things inside it, don't remember what exactly I was doing :D
actually you need to check roll, isTouchingGround, and canMove
I think arma returns canMove = true for flipped tanks, don't recall it correctly, so I had to check roll manually
Can anyone assist me with a script? Most of its written with help of another, he's not around atm, and I'm unsure how to continue testing what the issues is. I'd appreciate anyone if they'd offer their help. Just PM and I can paste it there. The script will addAction to laptop to cause damage to a helicopter, but there are 4 helicopters to choose from and 3 respective damages to pick from
Hello all.
Can't figure out how to write this.
Can someone help me with the logics ?
{
_x setDamage 1.0;
_idiotName = name _x;
{
private _size = 1 * (getResolution select 5);
[format["<t size = '%2' shadow='1' align='center' font='PuristaBold'>%1 was killed in <t color='#004399'>BLUE</t> Respawn Zone</t>",_idiotName,_size],-1,0.885 * safezoneH + safezoneY,15,1,0,4001] spawn bis_fnc_dynamicText;
} remoteExec ["bis_fnc_call"];
} forEach ((list SpawnProtectW) select {side _x isEqualTo opfor});```
obviously my _idiotName var isn't getting the name of the player
does it disp.. AH I see
Pass it as arguments to the call
Local variables don't carry over to different scripts running on a different machine
https://community.bistudio.com/wiki/BIS_fnc_call
Use the syntax. Not the alternative syntax
and pass the name as argument
ok so I got this far
{
_x setDamage 1.0;
{
private _size = 1 * (getResolution select 5);
_this = name _x;
[format["<t size = '%2' shadow='1' align='center' font='PuristaBold'>%1 was killed in <t color='#004399'>BLUE</t> Respawn Zone</t>",_idiotName,_size],-1,0.885 * safezoneH + safezoneY,15,1,0,4001] spawn bis_fnc_dynamicText;
} remoteExec ["bis_fnc_call", _x];
} forEach ((list SpawnProtectW) select {side _x isEqualTo opfor});```
But am sure i'm getting the position of my _x wrong. i'm getting mixed up about the fact that it's remote exec-ed
I don't really see the difference
_x is now undefined
and why are you setting _this
you set the target parameter of remoteExec to _x
But I told you to set the parameters of bis_fnc_call
Ok i'll try again
{
_x setDamage 1.0;
[_x, {
private _size = 1 * (getResolution select 5);
[format["<t size = '%2' shadow='1' align='center' font='PuristaBold'>%1 was killed in <t color='#004399'>BLUE</t> Respawn Zone</t>",name _this,_size],-1,0.885 * safezoneH + safezoneY,15,1,0,4001] spawn bis_fnc_dynamicText;
}] remoteExec ["bis_fnc_call"];
} forEach ((list SpawnProtectW) select {side _x isEqualTo opfor});```
did I do it write ?
yep
cool ! Thanks
Hey guys, I'm fairly new to scripting in Arma, and I'm trying to add intel to an object; I've got the intel part down, I'm placing it in theinit of a whiteboard, but I want the object to stay there. Any advice on how to do this?
@devout harness what you want is a information pannel, that kind of thing ?
I've got the popup now, like "Intel added: [intel name]", I would just want the object that 'contains' the intel to remain
you will need to explain better, was is exactly you are trying to do ?
What do you mean by "remain"
When you pick up intel, it gives you the popup, opens the map, and deletes the object that had the intel
But I want it to get the pop up, open the map, but keep the object that had the intel in the game
[ this ] call BIS_fnc_initIntelObject;
if (isServer) then {
[
this,
"RscAttributeDiaryRecord",
["UAV Instructions","These Docs outline the enemies defenses",""]
] call BIS_fnc_setServerVariable;
this setVariable ["recipients", west, true];
this setVariable ["RscAttributeOwners", [west], true];
};
Ahhhhh
So it's in that BIS_fnc_initIntelObject that it probably tells it to be deleted when the intel is found
indeed
Hey guys, I have been trying for about 5 hours yesterday night and today to get this script to work that probably should not be that hard, but I am greatly inexperienced when it comes to scripting. So I am trying to make a Unarmed Opfor AI surrender when a certain opfor AI gets killed. I have a trigger down that has the following condition: !alive Guard; This seems to work when I set the activation to end mission, but that is not my goal. I have tried using setCaptive and playAnimation
Vanilla or with Mods?
mods
so like this?: man1 setCaptive true; ?
I have tried that and it does not work
in the "on activation tab
Using ace3 or not?
yeah
would that just be: man1 ace_captives_setSurrendered or would you have to add a something else?
It's all in the link i send you
I do not know some of the things there because like I said earlier, I am very new to this
if (_pecentage) then {
//stuff
}
I need to do a random possibility with variable percentage, so the higher percentage the more it has a possibility to it be true, how I do that?
I already have my _pecentage setup.
[man1, ace_captives_setSurrendered, _reason? ("SetSurrendered")]
not sure what reason is
@split ice ["ACE_captives_setSurrendered", [_unit, true], _unit] call CBA_fnc_targetEvent
hmm, can't seem to get this to work
Try random 100 < _pecentage @astral tendon
@Slav ["ACE_captives_setSurrendered", [man1, true], man1] call CBA_fnc_targetEvent; doesnt work?
Hi again,
I am having problems with the ppEffectCommit command. If I set the value to 0 or to 3 it doesn't change a thing. the effect will appear instantly... Can anyone help ?
private _hndl = ppEffectCreate ["WetDistortion", 400];
_hndl ppEffectEnable false;
_hndl ppEffectAdjust [1, 0, 1, 4.10, 3.70, 2.50, 1.85, 0.0054, 0.0041, 0.05, 0.0070, 1, 1, 1, 1];
private _hndlClrCorr = ppEffectCreate ["ColorCorrections", 1500];
_hndlClrCorr ppEffectEnable false;
_hndlClrCorr ppEffectAdjust [1,1,0,[0, 0, 0, 0],[1, 1, 1, 0],[0.299, 0.587, 0.114, 0],[-1, -1, 0, 0, 0, 0, 0]];
[...]
_hndl ppEffectEnable true;
_hndl ppEffectCommit 3;
_hndlClrCorr ppEffectEnable true;
_hndlClrCorr ppEffectCommit 3;```
Can I just give myself Zeus abilities by script or do I have to add a module to the map, etc?
@quartz coyote you are enabling effect that has some default values already applied when created this is why it is instant
you need to find default setting that doesn't look different from normal screen and set it with 0 delay then adjust it to the final values and then commit with time needed
Okay thanks @tough abyss
@astral dawn you can
I guess that's the way 😮 https://forums.bohemia.net/forums/topic/185927-zeus-without-module/
i have something strange going on,i have an object that is created as a reference for effect sources and i want it to disappear on an event.everything works but it wont deletevehicle or hideobjectglobal it (server execution) any known problems deleting objects in MP or whats wrong theere?=
I haven't worked with effects, but deleteVehicle accepts non-local objects. Are you sure that you have a valid object handle and that it's not objNull?
no its even been found by nearestobjects select 0
Is effect object createVehicleLocal?
@tough abyss nope normal createvehicle
i create it with this here sqf _burp_sphere = createVehicle ["Sign_Sphere25cm_F", [getposATL _anomaly_object select 0,getposATL _anomaly_object select 1,1], [], 0, "CAN_COLLIDE"]; _burp_sphere setObjectMaterial [0,"A3\Structures_F\Data\Windows\window_set.rvmat"]; _burp_sphere setObjectTextureglobal [0, "tzr\tzr_images\01_burper.jpg"];and trying to delete it with sqf deleteVehicle _anomaly_object; [_burp_sphere, true] remoteExec ["hideObjectglobal", 0]; deletevehicle _burp_sphere;but no sucess
and if you create it and then instantly delete, does it still stay around @sturdy cape ?
You should not remote execute global command globally. What madness is this?
it was just an experiment,doesnt work either with just hideobjectglobal nor with deletevehicle only
@astral dawn and no,its the same
its like theres some dark force acting^^
well, if you try to not set its material, or not set its texture?
anyone know why, if i set a mouseExit eventHandler on a control that is the same width then the controlsGroup containing said control. If i enter, works fine from any direction, if i exit, works perfect in any direction but to the right. unless I make the controls group slightly bigger then the control
I can only assume that its because the control group may be expected to be larger than the control itself. Having it the same size could be expected to produce unknown results. But, thats just a guess based off what you said as I don't remember where I saw that.
So im trying to create a script to send a message out to everyone on a server when someone loads a specific mod, Personal Arsenal in this case, we can get it so it end mission for said person but we are trying to convert it to say "this person is loading Personal Arsenal"
This is the script so far:
if( isClass(configFile>>"CFGPatches">>"PA_arsenal"))then{
["Dovev_SEH", "onPlayerConnected", {
_notFound = true;
_player = objNull;
while {_notFound} do {
{if (getPlayerUID _x isEqualTo _uid) exitWith {_player = _x; _notFound = false}} forEach playableUnits;
sleep 0.2;
};
[_player, "Player " + _name + " Has Personal Arsenal Loaded","BIS_fnc_log"] call BIS_fnc_MP;
}] call BIS_fnc_addStackedEventHandler;
};```
So... is this a question or a statement? Is there something which doesn't work or works not as you expected?
Also you should not sleep inside event handler, why do you absolutely need to sleep for 200 milliseconds there?
Well im not 100% great on scripts so i took a few that i knew about and put them together. the sleep part i forgot to remove but for some reason the
}] call BIS_fnc_addStackedEventHandler;
};```
just doesnt want to work at all.
the prior part works fine
We can it to find the mod and all but just cant get it to announce it server wide
It's also recommended to not use BIS_fnc_mp, use remoteExec / remoteExecCall instead
I've never used BIS_fnc_mp but it seems like your paramteres are wrong
[params, functionName, target, isPersistent, isCall] call BIS_fnc_MP;
So how would i go around doing it through the remoteexec? as i have barely any experience at all using that command
(format [" %1 is using the arsenal mod", _name]) remoteExec ["diag_log", 2]; something like that should make server write the string to diag_log
so it formats the string on client, and asks server to write the pre-formatted string to diag_log
never tried BIS_fnc_log 🤷 I guess you can adapt it to bis_fnc_log
so just to confirm
enableSaving[false,false];
if( isClass(configFile>>"CFGPatches">>"PA_arsenal"))then{
["Dovev_SEH", "onPlayerConnected", {
_notFound = true;
_player = objNull;
while {_notFound} do {
{if (getPlayerUID _x isEqualTo _uid) exitWith {_player = _x; _notFound = false}} forEach playableUnits;
};
(format [" %1 is using the arsenal mod", _name]) remoteExec ["diag_log", 2]};
};```
is that correct?
remoteExec part should work I guess, I am not sure about the rest
like, where is _uid coming from?
You remote exec from server to server, huh?
what _player is for? it is assigned but never used
actually what the while loop is for? has no purpose
Running it on the server makes no sense
running it on client won't work
is that correct? hell no
Oh yeah it looks like onPlayerConnected is run on server, I thought that it runs on players, lol
allright I was a bit wrong about _uid, it is a special magic variable
https://community.bistudio.com/wiki/onPlayerConnected
@nimble raven
params ["_id", "_uid", "_name", "_jip", "_owner"];
Comes with onPlayerConnected. Also if you are running this on server, you ask a server configFile not clients. If you run this on client, you ask your clients configFile but making diag_log to its RPT will give you zero informativity. You need to place EVH on client side, and then report that to server via remoteExec, but do not allow diag_log plain execution - that's an easiest way to let somebody kill your server with RPT spam, make some function to process data.
Not really, those params are part of mission EH PlayerConnected which is like onPlayerConnected is server only event so no idea how you think it will work on client
Can't I post screenshots in here?
nope. you're not special 😢
My mum said I am
Any tip to make the driver not hold the brakes? hes unit capture is going backwards
Can you explain?
You order the unit to move but he is still standing at one place?
The driver is setCaptive ?
😕
I use unit captrue and the vehicle hold the brakes and just keep sliding.
@astral tendon unitCapture/unitPlay is recommended to use only with air vehicles
Try setDriveOnPath or other commands
Hi guys. Can I get both players and AI to stay inside a vehicle even when ejectDamageLimit is reached? I wanna prevent them from disembarking automatically
@nocturne basalt https://community.bistudio.com/wiki/setUnloadInCombat
wait, no
https://community.bistudio.com/wiki/allowCrewInImmobile there, there it is @nocturne basalt
I think it's only meant for damaged tracks and wheels (can't move) but still worth trying?
yeah I tried that. they are still bailing once the damage value gets to 0.99
but then it's about to explode anyway, right? maybe you could hide them or delete them 🤔
oh wait, you need it for players too, sorry
yeah
I am planning on adding an eject feature though. could auto eject and move crew inside escape pod instead maybe
maybe that'll work
I have a slighty complicated (for me) scriptlogic to get done.
Given:
An Array of 10 Markernames
Requirement:
Mentioned markers are all in a slightly narrow area - so they also overlap each other or in other words, the center of some markers is within the area of another one.
Those markers who overlap to others should be removed so in the end there only exist markers that cover an area on their own.
My Problem:
I was not able to find functions like nearMarker where I might could compare the markerPosition against since the functions do not exist. I found nearEntities or nearObjects but markers do not count to those types do they?
Any ideas how to get this logic done?
if three markers overlap each others, which one do you want to keep?
my overall question is: why on Earth would you need that at first hand 😄
if three markers overlap each others, which one do you want to keep?
The newest one
allMarkers to get all markers.
then get their position and filter them to be in a certain area
then you do the rest
so...
getMarkerPos markerA isInArea getMarkerPos markerB
nope
yea that doesnt make sense
https://community.bistudio.com/wiki/inArea
plus you would need to check the markers borders, not their center
I like need the stuff markerName setMarkerSize [a-axis, b-axis] is setting
IDK if you use only round circles or ovale ones, etc?
if circle, you can use distance
position and position, simply check if it is over the marker's radius yep
thx buds
👍
@winter rose yeah but then I wont be able to get out manually before its destroyed. And the AI seems to disembark anyway
Does anyone knows a script to change the tanks ammo rack in game?
all tanks
by ammo rack do you mean the ammunition they use?
Yes?
It was just odd way to say it. In any case yes, you can alter the ammo loadout with commands
but what ammo the tank can use depends on what weapon it has
Is there any script biuld to do that like ACE does with pylons?
there might be but I dont know any.
Would anyone tell me how I could store everything in the foreach braces in this script in a smaller form and call for each group individually as they spawn, rather than all at once?
how can i make it easier for ppl that join my server to get into my discord/ts/site?
i can add stuff to clients map:
player createDiaryRecord
[
"Diary",
["Server Links", "url/here"]
];
they still have to manually type it tho so:
- copytoclipboard doesnt work, any CBA fnc, or other means?
- how can i make the above JIP?
https://community.bistudio.com/wiki/openYoutubeVideo
will not get better without extension
you also can let the player copy stuff to clipboard via a textbox
though.... unless your url literally is some unicode garbage, all should be fine
avoid urls like jhg7rppohv78.to in general though
How to lock the usage of the UAV terminal to the UAV operator only?
@queen cargo textbox? how? (im no good at ui controls too much magic numbers)
@astral tendon there is this: https://community.bistudio.com/wiki/disableUAVConnectability
its close (u can foreach allplayers - uavoperator) but not what we really want which is making a uav object exclusive to a player regardless of terminal items
you already solved the riddle yourself, UI stuff
isInArea
Already tried that, it gets defeated if the player gets another terminal.
@shadow sapphire
_x addeventhandler ["Handledamage",{
if (_this select 2 > 0.8) then {
_unit = _this select 0;
_unit setunconscious true;
IndiCasualties pushbackunique _unit;
};
}];
pushbackunique returns index of inserted element, which will affect how much damage the unit _x will get. if IndiCasualties array has just one element, the index returned will be >=1 which means insta death for other units running this EH. On top this event handler fires for every selection, i.e. multiple times. No idea what you are trying to do, but this is a poor piece of code you have there
I'd like more information if you'd be willing to share it, but I've tested the code and what you're saying definitely does not happen.
What happens is that units that are critically wounded are placed in an incapacitated state and added to an index, then an AI medic rushes over to treat them in the order in which they were added to the index. In single player, it works flawlessly as of the last time I tested it.
Once again, I value your input regardless, @tough abyss.
I don't think I can help you to make it better than works flawlessly
Well, it doesn't seem to work in multiplayer, but also I didn't post the script for critique, I posted it because I'm wanting to know if it can be placed into a variable or some other way to shorten it and call it as groups are spawned.
@shadow sapphire are you looking to have it work only when you spawn units in your script, or are you expecting Zeus to be able to place down any random unit?
If its just your script spawns, you can assign the code to a variable that can then be used like a function.
ie
{
_gearhandle = _x execvm "Gear\AAF.sqf";
waitUntil {scriptDone _gearhandle};
if ((_x getunittrait "medic") && {"Medikit" in items _x}) then {
[_x, IndiCasualties] execVM "Combat Medic.sqf";
};
_x addeventhandler ["Handledamage",{
if (_this select 2 > 0.8) then {
_unit = _this select 0;
_unit setunconscious true;
IndiCasualties pushbackunique _unit;
};
}];
} foreach units (_this select 0);
_x deletegroupwhenempty true;
};
_HQ = [_Base, INDEPENDENT, ["I_officer_F","I_medic_F","I_officer_F","I_soldier_UAV_F"],[],["LIEUTENANT","PRIVATE","SERGEANT","PRIVATE"],[],[],[],180] call BIS_fnc_spawnGroup;
[_HQ] call _applyMedicalScript;```
@vapid crypt, awesome! Perfect! I'd love it if it would happen when Zeus plopped down his stuff, but it's ultimately not necessary.
or alternatively, you can also shorten your spawn calls as well, but applying different variables becomes a bit harder.
{
_gearhandle = _x execvm "Gear\AAF.sqf";
waitUntil {scriptDone _gearhandle};
if ((_x getunittrait "medic") && {"Medikit" in items _x}) then {
[_x, IndiCasualties] execVM "Combat Medic.sqf";
};
_x addeventhandler ["Handledamage",{
if (_this select 2 > 0.8) then {
_unit = _this select 0;
_unit setunconscious true;
IndiCasualties pushbackunique _unit;
};
}];
} foreach units (_this select 0);
_x deletegroupwhenempty true;
};
for "_i" from 1 to 6 do {
_units = [_Base, INDEPENDENT, ["I_officer_F","I_medic_F","I_officer_F","I_soldier_UAV_F"],[],["LIEUTENANT","PRIVATE","SERGEANT","PRIVATE"],[],[],[],180] call BIS_fnc_spawnGroup;
[_units] call _applyMedicalScript;
};```
If you ever wanted to go further into Zeus handling, you can use event handlers such as https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#CuratorGroupPlaced
Thanks for the link!
The coment of Ffur2007slx2_5 has a wrong exemple because of hes “quotes” are givin erros, can some one edit it?
is it C_man_p_begger_F specifically? Use a different classname is all you need to do. Its perfectly valid if you have a unit with that classname.
See the example section for a different classname that will work.
the problem are the quotes, and as it was happening to me I was running is circles trying to figure what was wrong in my script and I was victim of bad exemple and other missions makers may give up on the command and not use it.
ah, you mean the specific ASCII character used in it. Yep, I see the problem now. That is rather unfortunate its in there like that.
ayee, skid menu david 👋
Déjà-vu😂
hello can someone tell me how do i get AI to GetIn player vehicle ? i am creating a scenario where i have to pick up some AI and drop off to another location in a plane
created task for player to go pick up AI but the AI just stands close to the plane and wont get in
Are you using Waypoints @nimble echo?
You can use a Hold Waypoint - make it Waypoint Activation synced to a Skip Waypoint Trigger (that activates when Player is Present), and then tag the player vehicle with a Get In waypoint.
@runic sandal, rude.
@nimble echo Some experimentation may be required with the getting out part though.
Would need to get this to work somehow: when there are more than 0 on the side west AND zero on the side east OR zero on the side resistance the do magic but what I have now is failing:
({side _x==west} count thislist > 0) && ({side _x==east} count thislist == 0) || ({side _x==resistance} count thislist == 0)
What to do differently?
!purgeban @runic sandal 0 Ban evasion ref D: 415967863409737731 B:1158994
*fires them railguns at @runic sandal* Ò_Ó
@forest ore tried wrapping the first two conditions together?
(({side _x==west} count thislist > 0) && ({side _x==east} count thislist == 0)) || ({side _x==resistance} count thislist == 0)
also though it wont fix your issue you could look at using countSide instead of count with condition.
Wow that guy is pathetic. He got a warning on BIF yesterday and was told to not attempt that stuff again.
His answer to that is that he posts on BIF again even though he was told not to. And ban-evades in discord to ask the same question again.
he used that discord account a couple of days after his first acc got banned here 😦
guess he gave up for a few weeks
So does the stuff after || substitute everything what is before it or just the side _x==east part?
x or y
x || y
If not x. Then maybe y. If not y either then false
If you see him again. Please ping me @robust hollow
He got banned on BIF now too
is what i pasted above ^ 😦
Or
x && (y || z)
whatever you want
imho I tried the x && (y || z) version but that did not work or then I just had it wrong to in the first place.
I had it like this
({side _x==west} count thislist > 0) && (({side _x==east} count thislist == 0) || ({side _x==resistance} count thislist == 0))
Btw.. findIf
You are always iteration through the whole list. Even if you have a match on first result already
Couldn't you also instead of the or at the second. Just do
({side _x==east || side _x==resistance} count thislist == 0)
?
Will need to try that. I had something similar at one point but guess I had it typed up all wrong
(thislist findIf {side _x==west} != -1) && (thislist findIf {side _x==east || side _x == resistance} == -1)
findIf could indeed be more efficient in my case. Will try that!
edit: and works very well. Thanks for the suggestions Dedmen and Connor as well!
Why not countSide?
ayo has anyone here figured out how to combine the spectator and respawn menu templates
ive been googling but
seems to no end 😦
It would seem that the EntityKilled mission event handler does not concern players. Someone would have some idea why it is like that?
I mean if I as a player kill an AI this EH does what you script it to do but the same does not happen to me if an AI kills me
Stating something as a fact doesn’t make it so. I bet your code is bugged
I bet you do
What is this script then missing or has bugged then that it removes weapons from killed AI but not from killed player
private _soldier = _this select 0;
if (_soldier isKindOf "Man") then {
_soldier spawn {
sleep 0.1;
removeAllWeapons _this;
};
};
}];```
https://community.bistudio.com/wiki/removeAllWeapons Argument local.
I assume that script runs on server? players are not local to server
It is true that the script will eventually be run on dedi but currently I am testing it by creating a MP session through the in-game editor. Shouldn't the script work there since my local PC is the server and the player as well 🤔
probably
Just add some logging and see what actually happens
don't make up rumors and guess around. just check.
Any of you guys know of cell phone/telephone animations?
there are none
there are very very very little new animations made
due to reasons I wrote down for you on the #arma3_animation
Hello 😃
It is possible to do a forEach on a array like this ?
{
} foreach _myArray select 3 == true;
So basically do the statement if the current element select 3 is true
Are you trying to modify the array?
Nope, just want to execute the script if the third element is true
Oh maybe with a for instead ?
if(_myArray # 3) then
{
//execute script
};
Lmao time to go to bed, thats so obvious, thanks
Sometimes it just so hard to think xD
:+1:
Would someone tag @me if they know any easy way to transfer a group of AI to a specified headless client? Thank you.
@shadow sapphire https://community.bistudio.com/wiki/setGroupOwner should do that 🤷
@astral dawn, thanks! That should do it, but I have had a terrible time trying to learn how to reference the headless clients for this very command in the past.
So, here's what I'm trying to do. I'm making a mission and want to fly the players into an area with extremely aggressive AA (They'll be with other AI planes that get shot down). I've reached the limits of what default Arma AI can do. I want these AA units shooting at them from max range continously, but setting them to red, datalinked with a radar, fire at will, etc, max skills, ain't doing it. Thoughts, suggestions?
@frigid raven worldSize?
hi guys. Im trying to get animationSourcePhase from a UV animation, but it always returns 0 even though I know its animated. any ideas?
@quaint oracle reveal, fireAtTarget?
Anyone knows how to update text/string for one specific row in custom GUI?
https://community.bistudio.com/wiki/lnbAddRow
I can add picture, set invisible text/data etc. but i can't find a way to update visible text to specific row.
EDIT: nevermind, it just worked now. I have no idea why and how, refresh all rows do the work.
@winter rose legend
\o/
@nocturne basalt wrong animation name maybe?
hm no. but Im supposed to use the animatonSource name right? not the animation name?
hi. got some problem with EntityKilled event
addMissionEventHandler ["EntityKilled",
{
params ["_killed", "_killer", "_instigator"];
systemChat format["%1 - %2", side _killer, side _killed];
}];
Got
WEST - CIV
but it should be
WEST - GUER
check before kill entity via "side cursorTarget" - its ok, GUER. but on handle its CIV
WTF? Any idea?
even WEST - sometimes shows as CIV
@nocturne basalt yes animationSource
but you apparently need a fake model.cfg animation that uses the same source for it to work right
or so I understood at elast xD
makes sense. when I needed to check a value of a vanilla animSrc before, I needed to make a dummy animation for that too where I just moved a single vertex around
@lofty spear as I know, when something is destroyed in arma, it switches side to civilian
maybe if you do side group _killed instead 🤔
As I know, killed soldiers are ungrouped not instantly, but after a bit of time 🤔
it sometime show wrong side even for me, not WEST - but CIV also
@astral dawn thx, i'll try this
if my suggestion doesn't work, you would have to write initial soldier's side somewhere, maybe in a variable assigned to him, like _soldier setVariable ["initialSide", side _soldier] or smth like that
@astral dawn looks like idea with group work
sometimes %)
i'll use variable instead
thank you
then make sure you write the variable and read it on the same machine, if you write it locally
or write it globally
no problems, it's perfect then
i thought you might write it on client respawn and read it on server's event handler, then there might be problem if you do that incorrectly
is there a way to remove the cutText initial fading?
cutText [text, type, speed, showInMap, isStructuredText]
what speed value do you use?
At the bottom Krzmrzl sais this
The value for speed has to be greater 0. If 0 is used as speed the default value (1) will be used.
If you want to create an "instant" effect you can use a really small value (e.g. 0.001)
that is for the last fading when the text is fading out, not in.
well it says at wiki that speed is for fade in, so IDK, I actually never worked with cutText, so I thought you might have overlooked the wiki note 🤷
@astral tendon what effect are you using with cutText?
"PLAIN DOWN"
So how long the fade in takes if you set 0.01 speed
So all good then, this is what you wanted?
No, I cant even see the text
@shadow sapphire how do you work with your HCs then? I think if you have placed some HC modules on the map and names them somehow, you should be able to do ownder HC_1 or something like that, no? Alternatively you can find out owner ID of headless clients when they connect and store them in some array at the server
So far for me, naming things headless clients in the editor does not allow me to leverage those names. There could be something else that I’m doing wrong, but so far that’s never worked.
Your idea about capturing their owner ID as they enter the server sounds like something that I wish had been suggested months ago. Ugh! That’s genius. Unfortunately, my scripting skills aren’t strong enough for that straight up, but I’m going to take a note and get back to you if I figure out how to do it, @astral dawn!
well that should be done through connection and disconnection event handlers
@astral tendon then the only option left is to make custom Rsc where you can set all speeds and use cutRsc
It turns my screen black.
…isn't that what you want ?
oh, wait. you want a "PLAIN" effect, indeed. my bad for misreading.
I just would like to display the text with out fading, im using the text every second to update the message, but its blinking
Yeah he just corrected himself - "PLAIN"
How does a for loop work if one of the numbers isn't whole, like for example :
for "_i" from 0 to 2.41 do {};```
Would it only go up to 2 or go up to 3 or not work at all?
Put systemChat str _i in it and see for yourself
I imagine it's whatever amount it takes from 0 to the first step.
Hey guys, quick question. What's the best way to spectate someone? I have a list of players online and I want to spectate the one that I chose? Ive been looking at BIS_fnc_EGSpectator but I don't think that is what I'm looking for
That's what you're looking for, you can select from all units and players if you'd like
So instead of putting
["Initialize", [player]] call BIS_fnc_EGSpectator;
I put
["Initialize", [_playerChosen]] call BIS_fnc_EGSpectator;
will it work?
Sure, not sure if the function takes global args though
the first command I put was the example on the wiki
second one my example and idk if it will work
Hey, anyone know of an easy script that holsters a weapon by key press
couldnt seem to find one that worked
?
holsters a weapon where?
isnt there just a keybind for that
lower weapon or something like that
Lower weapon is double tapping left control by default, but I believe grim is talking about shouldering your weapon
soo, we've been having this issue for a while now
getting this error
Error reverse: Type Number,Not a Number, expected Array
on this code
if !(_unitAssignments isEqualType []) then {
_unitAssignments = [];
};
reverse _unitAssignments; // must remove in reverse order
how is that even possible 🤔
maybe it was nil somewhere in the path
The code is fine the error is elsewhere
it's saying specifically that reverse is expecting an array but it wasn't
I would suggest you to load Arma Debug Engine and see what's going on at this error, but unfortunately I can't 😄
Maybe it is NaN which happens elsewhere because there is nothing wrong with code you’ve shown
Have you tried to systemChat the value of _unitsAssignments just before reverse?
I've added some logging and playing the waiting game currently
@tough abyss you were right, is was trying to reverse a scalar NaN according the diag_log 😛
took ages for it to pop up :/
Yo, I am working on an Airborne FTX where my guys get dropped using the RHS paradrop feature, I wanted to have an enemy APC (BRDM) in the mix but the pilot breaks course and flies low if there is an APC on the map.
Is there any script to make my pilot ignore enemies on the map by chance?
@bronze swallow you can try to set the behaviour to careless, https://community.bistudio.com/wiki/setBehaviour and set fly in height to your minimum altitude, https://community.bistudio.com/wiki/flyInHeight and fly in height ASL so it doesn't follow contours: https://community.bistudio.com/wiki/flyInHeightASL
I've got FlyInHeight ASL on
Just need him to not break flight pattern because there is a BRDM 5km away
I will try this, thank you.
Hey. Could someone help me whats the best way to allow 3rd person view on a hardcore server?
It's an Exile server
Is it your server?
Yes of course.. I mean allow 3rd person in vehicles
whats the best script for that
You need to allow 3rd person in server settings and restrict it for persons on foot, you cannot allow it for vehicles only if it is restricted in server settings
what would be the best script for that then
There is no good script all scripts are hacks more or less successful. Google maybe
don't understand why
if (player distance pz_com < 30) then {...};```
the condition doesn't work. when, as
```sqf
waitUntil {player distance pz_com < 30}; ```
works
@cedar heart not the same innit? You check once in the 1st and check continuously in the 2nd
@tough abyss hmm ok. thank you for the explanation
Hey, guys, does anyone know if i can track player using a person turret in a vehicle?
What do you mean track?
i mean something like```sqf
if ((vehicle player != player) and !(currentmuzzle player in weapons vehicle player))
may be script method i dont know
You want to know if player is in ffv position in vehicle?
see what's going on at this error, but unfortunately I can't Oh right.. I knew I forgot something.
Hey guys, I've been looking into it but no success so far. How can I rename or disable some of the options available when the Pause Menu is active (OnPauseScript bla bla bla)?
...and yada yada
Okay, does anyone know the idcs for the ctrl on Pause Menu options?
You need to find the display. Then find the control you want to disable.
No. You can grab a "AiO" config and look it up
manually
I don't know of any public list
What do you mean by AiO if I may ask?
"All in one"
But I wrote it in quotes up there
because I meant you to google it exactly like that
"Arma AiO config"
oh, ill look into it, thanks!
Hi all,
👋
i'm trying to find out if a particular building is destroyed, as its part of the mission. ive got as far as assigning the array of close buildings myBuilding = nearestterrainObjects[[[1907.03,5713.65,0]],[],5];
but when I try to find is it alive with
!Alive myBuilding Select 0
the building is the only one in 5 meters, so it should be the correct one. what does myBuilding Select 0 return?
you can alsp get the buildings ID with the old editor (press control+O on the island selection menu), there is show id button
id would be the variable name of the building
AFAIK
Not sure if alive works with buildings
In arma, when a building gets destroyed, the game moves the old building under the ground with an animation, and it has damage 1.0, and it stays there. Then it creates a new building with another model (model of a damaged building). It stays on the ground.
@tame axle you can use diag_log to print it to the RPT log, and see for yourself what it returns
ok sorry for the wrong info, here is the id usage:
(getpos _pos) nearestObject 190609;
Using object id is unsafe please do not suggest this
Thanks partyzan, but several posts point to the 'nearestterrainObject' as being most reliable.
I think easiest method is checking
typeOf (myBuilding select 0)
I assume that changes to a damaged variant if it's damaged
@Dedmen It is giving me an elements error, needs 3 got 1. So im guessing it its not gonna write to the hint window, its not going to the diag_log also.
uh
what are you actually executing?
the diag log is not what's failing there
it doesn't need 3 elements. That is probably some command that takes a position
hint str(mybuilding select 0)```
🤔
guys, can you tell more about the unsafe id's?
Made some progress,
myBuilding = nearestterrainObjects[[1907.03,5713.65,0],[],5];hint str(mybuilding select 0)
Had too many braces....
but only returning [] your radius is 5 m
yep, we rely on building IDs for ALiVE terrain indexes and whenever these change (often when a terrain is updated) we have to re-index the terrain to fix the IDs
kinda annoying but it's fairly automated so not that big of a deal for us
@tough abyss had ....select [0], changed to select 0. But not returning the building details. will try to make the radius bigger. Not giving error now.
you should check if returned array is not empty then select
@tough abyss bigger radius now got a return
the object ids are not realible if map is still in development
oh there was more text here
¯_(ツ)_/¯
carry on
OK got this out
17:12:03 "66208: concrete_smallwall_4m_f.p3d"
this is an array so how can I check if its destroyed. ?
nearestTerrainObjects sorts by 3D distance, if you don't pass a special parameter to it to sort by 2D distance
and your blown up house can be 10 meters under the ground
ok then its a string
because you did str
ah indeed.
you can just try alive <your object here>
and see if that works. I assume not though.
Is "smallwall" really the building you wanted tho?
@still forum yeah, I haven't focused on the actual object yet, but your suggestion sounds good,
also, why not nearestBuilding(s?) ?
@astral dawn Yes I can see finding this particular building will be a challenge...
just make the function sort by 2D mode
nearestTerrainObjects [position, types, radius, sort, 2Dmode] you see the 2DMode parameter?
you will easily see then WTF is going on with arma handling of destroyed buildings
as I remember arma creates a new building object even when, like, a wall of house breaks, but I am not sure
Doesn't it just move it below the map and spawn the ruin?
AFAIK yes
Cracked it.
This in the mission init. Allowed me to narrow in on the building, and know which place in the array list. (In my case it was 0)
myBuilding = nearestterrainObjects[[1910.5,5713.64,0],[],5,true,true];
{diag_log str(myBuilding Select _forEachIndex);} foreach mybuilding
Now in the trigger condition...
damage (myBuilding Select 0)==1
Thanks for the input @astral dawn @still forum @tough abyss
fyi you can just use _x instead of myBuilding Select _forEachIndex
@digital hollow nice👌
damage (myBuilding Select 0)==1 could just !alive (myBuilding Select 0)
@tough abyss Cool. Think damage might give more flexibility , but I guess Boolean is quicker to process.
if (primaryWeapon player isequalto "XXXXXXXXXX") any chance i cant add 2-3 items with classname to this our would i need to make a seperate one for each weapon ?
if (primaryWeapon player in _weapons) then {doSomething};```
ah nice thankyou
also is there a way to define "no weapon equiped" within the "_weapons "?
""
Just to be on the safe side, you likely want to use toLower or toUpper as in is case sensitive. e.g. toLower(primaryWeapon player) in ["arifle_mx_f",""]
I dont exactly know what you mean but here is my script https://pastebin.com/E9r9A0Gp
works perfectly in SP not tested on dedicated tho
its excecuted through addAction
What's the best way to narrow down sqf _closeGuys = nearestObjects [player, ["Man"], 1500]; to only OPFOR units?
use nearEntities first
then use SoldierEB instead of Man
as your type filter
Ex:
_blufor = player nearEntities["SoldierWB",1500];
_opfor = player nearEntities["SoldierEB",1500];
Ok cool SoldierWB is part of the class right? So that'll work for modded units as well
In most cases I believe so, if not then you may have to patch it if you are making a mod. Else, get the mod maker to fix it.
Awesome thank you that's exactly what I needed
:+1:
nearEntities is ALOT faster than nearObjects when testing with supported nearEntities types like units.
How often do you execute it @leaden summit ?
At the moment every 10 seconds
NearEntities might be ok but if you find it struggling with big radius you might want to just loop via interested players and check the distance
Ok I might drop the radius anyway it's really just a horrible hacky way to fix something I don't like about ALiVE garrisoning
Trigger is another way of checking presence of units of particular side
Hey just saw this in the wiki sqf while {_a =_a + 1; _a < 10} do {...}
Is that essentially a counted loop? ie it'll just run 9 times
looks to be, yeah
cool thanks
Anyone know if there is a command like addmagazinecargoglobal but also takes ammoCount like addMagazine does it?
Holy shit im blind, as always im thankfull for the help dedmen
does anyone know if you can get the status of all the AI behaviours?
like the ones you can disable/enable with disableAI and enableAI
Does anyone know a workaround on setObjectTextureGlobal not working properly on dedi servers?
I've added a skin to an outfit yet it only displays for me
What path do you use for the texture?
"images\skin.paa"
It displays just fine for me but not others. If others use the outfit tho, it works
for them only as well though
Hi everyone! How i can cancel "unconscious" animation?
Do you mean the falling over of units when they get shot?
That might be ragdoll. Don't know if you can cancel that
Probably can try forcing the unit into a different animation
So i can't escape from ragdoll?
There is no command to stop a ragdoll. There is a hardcoded time delay until it stops
But maybe you can just playMoveNow the player into a standing animation
not sure if he'll be able to control his body then though
Cause i try to experiment with can with 10^6 kg mass and attaching them to unit for force ragdoll 😁
But the problem is that i can't set timer for this process
I once wrote a script command that let you force players into ragdoll.
https://www.youtube.com/watch?v=xVwp_9rVGLk
Broadcasted live on Twitch -- Watch live at https://www.twitch.tv/dedmen
But yeah. Can't set timer. It's hardcoded. I looked into that too.
And than i try to get the unit to ragdoll after current ragdoll ends
But after 2 or 3 ragdolls my player get into "unconscious" animation (checked by animationState player). And he didn't want to wake up 🙃
https://community.bistudio.com/wiki/setUnconscious set to false?
if works for a very small time, i want try to make it for custom timer
there is a really buggy way to perma ragdoll, I am usingit in a private mod of mien to just fling myself across the floor. You basically apply setUnconscious over and over again.
the result is you wobble around the floor, kill all kinds of walls and small objects and then are a vibrating mess in the end
So using forced ragdoll with object of using "setUnconscious" can't make forced ragdoll correctly?
well you just reapply it over and over. it may look like a ragdoll on others players end if they are 50 meters away.
any closer and they see the vibrating of the ragdoll and can tell that person is still alive.
for example how koth and some life mods do it, you actually die, but people can revive your corpse
that is the most reliable way in making a "perma ragdoll"
@digital jacinth but this dead people are in animation, not in ragdoll, is it?
no they are dead, as dead as a unit can be in arma
so they are ragdolled and in no animation
i made a mod which makes units go into custom animations after ragdolling. that is also "as good as it gets" right now
I see them, if works like Russian AK rifle - reliably and efficiently
But if you come closer to this unit - you can understand, that he alive, not dead
yup
And its a little cheat for detection unconscious players
i tied to mitigate in pestering Kola in making more animations, so therea re around 20 now in total.
so it gets a bit harder to spot
Ok, i understand
And last question for this topic - is any way to detection start and end of ragdoll process?
start is always when you setUnconscious to true, end can be detected with animationstate change EH
@tough abyss how do you set the texture?
It's in "uniformskin.sqf and i execVM the sqf
Execvm from where
@digital jacinth thx for discussion and also for your work🤗
assigngear.sqf
And assigngear.sqf you execute from?
can i come back to you once im home? sorry for the inconvenience
No problem
I googled setObjectTextureGlobal issue and some people had it in the past but solution seems weird
@tough abyss So this is how it goes: uniformskin.sqf > assigngear.sqf > init.sqf where its executed this way:
if (!isDedicated) then
{
waitUntil {!isNull player};
["InitializePlayer", [player]] call BIS_fnc_dynamicGroups;
sidePlayer = side player;
fnc_addRadio = compile preprocessFileLineNumbers "addradio.sqf";
fnc_assigngear = compile preprocessFileLineNumbers "assigngear.sqf";
After that, another sqf file is executed
wait maybe the !isDedicated is fucking it all up 🤔
but according to wiki it shouldnt
Is there a way to know what box can be sling loaded?
question, is it possible to detect a reload of a gun(primary / secondary) on start of the reload since the eventhandler reloaded triggers only when its done ?
Problem is the Take eventhandler fires when you drag and drop a magazine in the player inventory on the weapon mag slot and i need to setvar to disable another function in that time.
You still did not show where the functions are executed from, all it shows where they are defined which is horribly insecure and error prone @tough abyss
im confused myself, so dont worry about it
Okay, when using forEach allPlayers; how do I get the ClientID? is that _x? or what syntax would I use to get the ClientID of _x?
owner _x?
cheers, i'll try that
Server only
Understood, yeah
I've another related query, say I want to set up a onPlayerDisconnected {} event for my dedicated server, I assume I just execute that as "server exec" from my debug console as an admin, and it'll set up the event? I assume the event stays after I disconnect? is there somewhere else I need to put this script?
You might want to use mission event handler PlayerDisconnected instead as it is stackable. And yes setting it on the server will make it stay if server is dedicated
Excellent, thank you
🤔
Does anyone know of a script that respawns Huron and Taru pods in a similar way to how vanilla vehicle respawn works?
Help I need a second pair of eyes on my code to check if i'm not missing something :
if (_unitsDone isEqualTo (count _allESMUnits) && count _allESMUnits > 0) exitWith {};```
So if _allESMUnits returns 0 then my output is "false" correct ?
ouf perfect
thx
Okay so I've got this piece of code here that checks twice (at two different stages) if all players are ready.
But I also want it to take into account the fact that if no one is on the server, then it carries on.
while {true} do {
private _allESMUnits = playableUnits;
private _unitsDone = {_x getVariable ["loaded", false]} count _allESMUnits;
if (_unitsDone isEqualTo (count _allESMUnits) && count _allESMUnits > 0) exitWith {};
sleep 0.25;
};
Intro_Start = true;
publicVariable "Intro_Start";
while {true} do {
private _allESMUnits = playableUnits;
private _unitsDone = {_x getVariable ["introDone", false]} count _allESMUnits;
if (_unitsDone isEqualTo (count _allESMUnits) && count _allESMUnits > 0) exitWith {};
sleep 0.25;
};
Intro_Passed = true;
publicVariable "Intro_Passed";```
how would I change my code
it would do that without the && count _allESMUnits > 0 wouldnt it?
mmmh that's also what I thought but since it isn't something I can actually see because i'm not myself on the server I dunno how to test it
shouldnt need to test it. if no one is connected, playableUnits will be [] and so the empty array count is 0. _unitsDone will be 0 because its also counting the empty array.
ah you're right
thanks
hadn't thought about that
Working as intended ! Thanks Connor
Ah found a weird thing
looks like Intro_Passed never get's to "True"
why would that be ?
error in my code crashing the script instead of continuing ?
do you have -showScriptErrors flag enabled?
to see if your errors show up top left of the screen (white on black)
did you make the same change to that condition to allow 0 units?
while {true} do {
private _allESMUnits = playableUnits;
private _unitsDone = {_x getVariable ["loaded", false]} count _allESMUnits;
if (_unitsDone isEqualTo (count _allESMUnits)) exitWith {};
sleep 0.25;
};
Intro_Start = true;
publicVariable "Intro_Start";
while {true} do {
private _allESMUnits = playableUnits;
private _unitsDone = {_x getVariable ["introDone", false]} count _allESMUnits;
if (_unitsDone isEqualTo (count _allESMUnits)) exitWith {};
sleep 0.25;
};
Intro_Passed = true;
publicVariable "Intro_Passed";```
is Intro_Passed set false anywhere in a loop or something? perhaps try adding logs through that script to see how far it gets before stopping
Huuuuuuuuuuuuu hold on
rebooted my server and now it looks like it's working
wtf
i'll do more tests
nope rebooted again and not working anymore
both vars are initialized in initServer.sqf
missionNamespace setVariable ["Intro_Passed", false, true];
missionNamespace setVariable ["Intro_Start", false, true];
omg found my mistake
ok i'm my own idiot
sorry
what was it?
hum ... actually I have no clue
thought i'd found what was the problem but ends out not
i'm lost
still looking
would there be another way to check if a server is empty ?
the way ur checking shouldnt be the problem
I remember now why we'd put && count _allESMUnits > 0
It's because without, the check would end before players had finished loading the map. It would act like no player was in the slots before we'd even launch the game
so you dont want it to continue when there are no players connected?
Well... I'd like it to halt and check if payers are connected and have intentionally started the mission, but also want it to bypass the check if no players are connected and that server is set to autoinit/persistent
That's what making it so dumb
i dont think you're going to get it both ways.
Maybe delaying the execution until the mission actually starts?
maybe I misunderstood the problem but if the mission started and there are 0 players is because the server launched with auto init and thus you can bypass the check
Any chance i can add multiple conditions to ´´´IF´´´ ?
ah okay was unable to find it.... can i extend it to more than A and B ?
you can do it as many times as you need
a && b || c
(a || b) && (c && d)
mix and match however you need. just gets harder to read the more you add.
i only need 3 at max so thats enough thanks
also ist there any chance i can excecute commands like player addBackpack and player linkItem within then i know i can put it between the
bracket but i want it to look a bit cleaner... if possible
not sure what you mean exactly
if (but condition here) then {player addBackpack "Backpack"; and player linkItem "Item";}; thats how i do it now but i wonder if can do it looking something like this if (but condition here) then {_items}; item = [player addBackpack "Backpack"; and player linkItem "Item";];
item = should be _items sorry
you're wanting to call another function from the if statement?
when if is present then excute functions definded in _items
private _addItems = {
// addBackpack
// linkItem
};
if (condition) then _addItems;```
nice thats what im looking for..... testing it no
Hey guys i need help. What do I need to do to make an objective complete after doing a certain action like killing something
_unit = param[0];
//_unit = _this select 0;
if ((uniform _unit) isEqualTo "U_B_CTRG_Soldier_F") then
{
_unit setObjectTexture[0, "images\ctsfo_co.paa"];
};
hey ive been told I should try to do this and remoteExec it to all clients for the skin to apply but I get _unit undefined issue
Anyone know whats wrong?
why not use setObjectTextureGlobal?
because its fucked and only shows it locally when hosted on dedi server
the whole point of the global command is for it to work globally.............. but ok.
_unit undefined suggests you havent defined _unit, sooooo, have you defined _unit?
I know that the global one is meant to do that, but when I use it it only displays the skin for yourself, others cant see it
tbh idk if _unit is defined anywhere since this is a solution i've received from someone, if you can enlighten me that'd be appreciated
show where you remote execute it
in init.sqf:
if (!isDedicated) then
{
waitUntil {!isNull player};
["InitializePlayer", [player]] call BIS_fnc_dynamicGroups;
sidePlayer = side player;
fnc_addRadio = compile preprocessFileLineNumbers "addradio.sqf";
fnc_assigngear = compile preprocessFileLineNumbers "assigngear.sqf";
fnc_texture = {_this execVM "uniformskin.sqf"};
[player] remoteExec ["fnc_texture",-2];
isJoining = false;
execVM "briefing.sqf";
execVM "unitmarkers.sqf";
[] execVM "anticheat.sqf";
//execVM "uniformskin.sqf";
[] call compile preprocessFileLineNumbers "defineclasses.sqf";
// Add mitsnefet handling for IDF.
if (attackerFaction == 0) then
{
[] call compile preprocessFileLineNumbers "mitsnefet.sqf";
};
sleep .01;
execVM "roundclient.sqf";
};
you dont do it as a jip message
so that is a problem but honestly doing it as a remoteexec seems like so much more work compared to just doing
if ((uniform player) isEqualTo "U_B_CTRG_Soldier_F") then
{
player setObjectTextureGlobal[0, "images\ctsfo_co.paa"];
};
which has no reason not to work globally and for jip.
@robust hollow thats exactly what I did but skin only shows for you
I had that script like that and then just used execVM where it was needed
yet it only shows for you, others see the outfit normally without any applied texture
Hey! I'd like to open BIS_FNC_Garage onto a specific vehicle to allow a user to change the vehicle appearance (camo, etc). How do I do this using call bis_Fnc_garage?
@robust hollow and how do I make it as a JIP message? add true after -2? im still struggling with remoteExec's so far
@tough abyss
You should do a remoteexec to set the texture in initserver.sqf using -2
and true, yes
RemoteExec is a pretty cool command, I'll try and break down the parameters of it for you.
I don't have initserver.sqf just init.sqf
is it necessary that its in initserver.sqf?
We want the server to tell all JIP players to change the skin of a unit, right? Otherwise, every person who joins will tell all th other players to set the skin again whenever someone joins, recursively. We don't want that
Yes
Otherwise, you are storing a remote exec call inside of every machine that joins
Players 1 and 2 are in game, they do init.sqf and its a JIP command.
Player 3 joins, he sends the JIP command to players 1 and 2 and runs it himself.
Player 4 joins, he sends the JIP command to players 1 2 3 and runs it himself.
Its not a good practice
You need to be very careful with how you control your remote exec, especially with JIP commands.
alright, the issue is that this mission file is not made by me, im editing it to my needs. It has initplayerlocal and init.sqf but not initserver.sqf, if I make initserver.sqf, do I just add the
fnc_texture = {_this execVM "uniformskin.sqf"};
[player] remoteExec ["fnc_texture",-2, true];
in there?
Players aren't gonna have fnc_Texture. Try using remoteexec to set the texture directly.
So something like
[player, [selection, texture]] remoteExec ["SetObjectTextureGlobal", -2, true]
But it looks like someting like if (local this) then {this setObjectTextureGlobal [0,"mypaafile.paa"]};
Will work just fine
dont RE setObjectTextureGlobal 😱😱
RE the local version of it right?
RE is RE. it executes the given command or function on the provided targets. setObjectTextureGlobal has a global effect though, so using it in RE will tell everyone to tell everyone else to set the texture to the given filepath.
Connor's right, don't RE setobjectextureglobal
Just use setobjecttextureglobal in init.sqf, ensure that your usage is correct
ill look into it right now
but thing is I had it in init.sqf
with execVM uniformskin.sqf
and uniformskin.sqf is this:
if ((uniform player) isEqualTo "U_B_CTRG_Soldier_F") then
{
player setObjectTextureGlobal[0, "images\ctsfo_co.paa"];
};
use debug console and execute the setobjecttextureglobal part
see if it works
yeah it is,
Try executing it with debug console without that, just in mission. If that works, then you can work your way backwards to getting it to run when you want.
Great, now you can work backwards and see if your conditional check works
this is honestly triggering the fuck out of me
Well, that's the process
Then you get better.
But if anyone else is online. I need a way to get BIS_FNC_Garage to enable for one vheicle, or at least a way to add specific parts to vehicles through garage. I'd like to add Slat-Cages to the AMV-7, but i only know how to do it through the UI
Does anyone know how to create modules via sqf script? Basically I want to be able to create a support requester module, a few providers, and sync them together with a group by script rather than having to do it in the editor all the time.
there is a neat biki article about that @sly mortar https://community.bistudio.com/wiki/Modules
that is literally step-by-step
That describes creating "modules" in the context of addons. What I am looking for is a way to create an editor module as you would in the editor, but via script instead.
In the editor, when you place a "module". For example a support requester module. You just click and place it. I would like to be able to do that via script.
so you want to know, how to place those modules via scripting and not how to create one
Yeah, so I can call it like a function in sqf when I need to rather than having to do it in the editor manually.
that is a different story indeed, but the procedure is the same
read the article, it remains relevant
just that you now have to do a few things on your own rather then letting the game do it for you
a module is essentially an empty game object (forgot the name and cannot look it up as i am at work)
the parameters are set on it via setVariable iirc
links can also be done via scripting (there are commands for that)
I think I saw a way someone did it by creating a Logic with createUnit then set the type with setVariable. But I can't recall the exact syntax.
and in the end, you thenn pass that game object to the method set in the modules config
It's mentioned in the comments for createUnit, not sure if it works for all modules, or requires more stuff to work with certain modules. https://community.bistudio.com/wiki/createUnit
private _grp = createGroup sideLogic;
"ModuleSmokeWhite_F" createUnit [
getPos player,
_grp,
"this setVariable ['BIS_fnc_initModules_disableAutoActivation', false, true];"
];
Do you want to do it in-editor? or ingame?
Via script, not in the editor.
Not sure if createUnit works properly in editor
Well.. You are in #arma3_scripting so that answer is kinda useless ^^
how can I get array of all units in trigger area?
thisList in the trigger code contains all units
Not sure if createUnit works properly in editor afaik it works just fine