#arma3_scripting
1 messages · Page 560 of 1
not necessarily
if you save while the sleep is 99% done, and it then continues you might get same problem
fix is to check the return of list for nil
@still forum can you clarify? still quite confused. in particular I am working on a mpmission, for instance. are we better off with relative include paths?
i told you how you can find the complete path for your mission base. If you try that you'll see you get a couple different paths and cannot predict which one you'll get, meaning thats completely useless for you.
meaning yes, use relative paths
like if (isNull (list XXX)) then {false} else {(vehicle player) in list XXX};
not sure if its really null, i assume nil, yes it has to be nil.
fair enough, appreciate it.
well check for isNil "triggerName"?
🤔
no..
_list = list triggername;
if (isNil "_list") exitWith {false};
vehicle player in _list
Is there a boolean for whether a script is executed in the editor or in a hosted server? I wish to have my script automatically enable when I test a mission in Eden but disable when I host it normally on a server.
doesn't is3den check if in the editor, not in editor preview ? 🤔
that's perfect! it's odd that is3den returns false in preview but is3denMultiplayer returns true in preview. Nevertheless, it's nothing a simple not and or statement can't fix. Thank you.
@velvet merlin got it on my list (pun intended)
its only initialized after the first trigger sweep. Which is every.. 0.5 seconds or so?
.5, yep
can one check if code is correct/can be executed with https://community.bistudio.com/wiki/Exception_handling or some other way (without spamming the rpt)?
Does #include not work with __EVAL like #include __EVAL(someVariable)? Getting "preprocessor failed with error - empty file name"
Exception handling in scripts doesn't handle script errors
The variable being in parsing namespace? @plain current
yes, it's defined with __EXEC
_eval is looking for = before it
so there is no way to include a file based on script?
Maybe preprocessfile on condition
well yes but i mean based on a variable in script, eg _lastBit = "hpp\definedikcodes.inc"; evalThis = format["\a3\ui_f\%1", _lastBit]; #include __EVAL(evalThis)
I think include is processed before everything
ok, thanks
Let me just tell you, you are wasting your time trying to hack preprocessor
Give up and find another way
There are only handful of cases when macros actually useful, but if you can avoid, avoid
Is there a way to change the limit a cargo container can hold on mission load?
I am having some real trouble trying to figure this out :(
I am trying to give each of this kbTell command a variable so I can try and select one randomly when the .sqf is run any ideas how I achieve this? ```_A = prisonguard kbTell [player, "prisonchat", "PrisonGuard1"];
_B = prisonguard kbTell [player, "prisonchat", "PrisonGuard1"];
_C = prisonguard kbTell [player, "prisonchat", "PrisonGuard1"];
_D = prisonguard kbTell [player, "prisonchat", "PrisonGuard1"];
_guardchat = ["_A", "_B", "C", "D"];
selectRandom _guardchat;```
hello does anyone had a corrupted file after crash with notepad++ would like to recover one file if you have experience with that issue let me know
Trying this ```private ["_soundArray", "_soundToPlay"];
_soundArray = ["prisonguard1", "prisonguard2", "prisonguard3", "prisonguard4"];
_soundToPlay = _soundArray call BIS_fnc_selectRandom;
_prisonguard say3D _soundToPlay;```
@long glacier sqf prisonguard kbTell [player, "prisonchat", format ["PrisonGuard%1", ceil random 4]];
@long glacier In your first script, you have the variable names as strings. That won't pass the object and will only give selectRandom the ability to give you strings and not the object reference you're looking for
that too ^^
Rgr cheers guys, trying to find a way to get this kbTell crap to work on dedicated server
with remoteExec , haven't we been through this already?
Yeah I tried your solution and it did not work on server, worked in SP/MP again but not on server
and how did you add topic?
Yes
how
I will show you full script
This is in the init.sqf ```sqf
// add all random voiceovers
if (isServer) then {
prisonguard kbAddTopic ["prisonchat", "prison.bikb"];
};
if (isServer) then {
gateguard kbAddTopic ["gatechat", "gate.bikb"];
};
// select random voice over prison guard
prison_guard_voice_over = {
params ["_speaker","_voice_sample_name","_number_of_voiceovers"];
private _voiceover_list = [];
for "_i" from 1 to _number_of_voiceovers do {
_voiceover_list pushBack (format ["%1%2",_voice_sample_name,_i]);
};
[_speaker, [_speaker, "prisonchat", selectRandom _voiceover_list]] remoteExec ["kbTell", _speaker];
};
// select random voice over gate guard
gate_guard_voice_over = {
params ["_speaker","_voice_sample_name","_number_of_voiceovers"];
private _voiceover_list = [];
for "_i" from 1 to _number_of_voiceovers do {
_voiceover_list pushBack (format ["%1%2",_voice_sample_name,_i]);
};
[_speaker, [_speaker, "gatechat", selectRandom _voiceover_list]] remoteExec ["kbTell", _speaker];
};
@long glacier ```sqf plz
sorry was trying to figure out how to do that haha
```sqf
code
```
then this is my prison.bikb
class Sentences
{
class PrisonGuard1
{
text = "";
speech[] = {"\sounds\PrisonGuard_1.ogg", 2, 1, 20};
class Arguments {};
};
class PrisonGuard2
{
text = "";
speech[] = {"\sounds\PrisonGuard_2.ogg", 2, 1, 20};
class Arguments {};
};
class PrisonGuard3
{
text = "";
speech[] = {"\sounds\PrisonGuard_3.ogg", 2, 1, 20};
class Arguments {};
};
class PrisonGuard4
{
text = "";
speech[] = {"\sounds\PrisonGuard_4.ogg", 2, 1, 20};
class Arguments {};
};
};
class Arguments{};
class Special{};
startWithVocal[] = {hour};
startWithConsonant[] = {europe, university};```
yeah @long glacier you are using kbAddTopic on the server, not on the machine that has the unit
you could remoteExec it on all machines, "just in case"
So just take the add topic out of the if is server?
this is the code in my trigger sqf if (isServer) then { [prisonguard,"PrisonGuard",4] call prison_guard_voice_over; };
if you have isServer check in your trigger, why have it in the script?
No idea mate thought it helped the script run on dedicated
Should I remove those for local execution on players machines
thought it helped the script run on dedicated
no, really not ^^ it just re-does a check that haas already been made
Should I remove those for local execution on players machines
where? because your script doesn't run on any client here
is your trigger only "once" or "repeated"?
repeated
then it's not "great" because you keep adding and adding the same topic to the guy, it's not really a problem but let's say it is not ideal
keep your script server-side only
and whatever you need to do remotely, remoteExecute it
I am guessing I remote execute the trigger then instead of having he if is server check
Yeah I have
if the trigger is server-side only, you don't need isServer checks then
Yeah I have the server only check box ticked
then remove all of your isServer checks
ok rgr but will that potentially fix it for dedicated?
but I am using that already in the script right or do I need to also remote execute the trigger activation code?
you are not remoteExecuting the kbAddTopic, right?
this is your issue: only the server has added the topic, not the machine where the speaker is local
so you are basically telling the unit to say a sentence it doesn't know
Ahh rgr got ya
This better? 🤞 ```sqf
// add all random voiceovers
remoteExec prisonguard kbAddTopic ["prisonchat", "prison.bikb"];
remoteExec gateguard kbAddTopic ["gatechat", "gate.bikb"];
// select random voice over prison guard
prison_guard_voice_over = {
params ["_speaker","_voice_sample_name","_number_of_voiceovers"];
private _voiceover_list = [];
for "_i" from 1 to _number_of_voiceovers do {
_voiceover_list pushBack (format ["%1%2",_voice_sample_name,_i]);
};
[_speaker, [_speaker, "prisonchat", selectRandom _voiceover_list]] remoteExec ["kbTell", _speaker];
};
// select random voice over gate guard
gate_guard_voice_over = {
params ["_speaker","_voice_sample_name","_number_of_voiceovers"];
private _voiceover_list = [];
for "_i" from 1 to _number_of_voiceovers do {
_voiceover_list pushBack (format ["%1%2",_voice_sample_name,_i]);
};
[_speaker, [_speaker, "gatechat", selectRandom _voiceover_list]] remoteExec ["kbTell", _speaker];
};```
won't work ^^
😢
compare your
remoteExec prisonguard kbAddTopic ["prisonchat", "prison.bikb"];``` with my ```sqf
[_speaker, [_speaker, "gatechat", selectRandom _voiceover_list]] remoteExec ["kbTell", _speaker];```
from https://community.bistudio.com/wiki/remoteExec:
[<params>] remoteExec ["someScriptCommand", targets, JIP];
[_prisonguard, [_prisonguard, "prisonchat", "prison.bikb"]] remoteExec ["kbAddTopic", _prisonguard];```
almost
[_prisonguard, ["prisonchat", "prison.bikb"]] remoteExec ["kbAddTopic", _prisonguard];
ohh I was close 🙂
it's basically [<leftArguments>, <rightArguments>] of the command itself
rgr kind of makes sense now
e.g```sqf
[unit, 1] remoteExec ["setDamage", unit];
with pleasure!
I get less questions to answer if you understand how it works 😛
but also, you get to read and understand it and not provided with a plug & play "big code mess" so in the end, it's good
hmm nope
ohh rgr
it should work in all situations, so there might be an issue here
rgr I spotted something I will try again hopefully that was it
Ahh damm it is giving me errors on mission start line 3
bring it on
[_prisonguard, ["prisonchat", "prison.bikb"]] remoteExec ["kbAddTopic", _prisonguard];
[_gateguard, ["gatechat", "gate.bikb"]] remoteExec ["kbAddTopic", _gateguard];```
are the units defined there? _prisonguard, _gateguard?
Not in the script no they are named in mission in the variable field
ahh rgr I know this one because this means they are local to the script
like it is in the unit name
exactly
mega working now
noice!
Can't thank you enough mate 🙌
hehe you're welcome!! enjoy your game, and don't hesitate to come back in case of trouble
will do cheers
can I limit the radar range of an MPQ-105? Google only provides me with a sensor config reference
not by script afaik
Hello guys, I am new to making missions in Arma, although I love the game for many years. I kinda couldn't Google up anywhere if there is any possibility of making let's say one opfor and one bluefor unit guarding like a border line without shooting at eachother? Plus if I infiltrate the opfor side as an bluefor player and they see me, they try to take me down? I will be glad for any help, since I am trying to get my first coop mission working! :)
welcome to… the WIKI!
https://community.bistudio.com/wiki/Main_Page
and https://community.bistudio.com/wiki/setCaptive in particular
But the thing is - how do I make them shoot at me if they see me on their side of border?
you should make yourself enemy of both sides
either that, or make them part of the same group
so, either
- west vs east, east vs resistance, west vs resistance and
setCaptive - or west grouped to east (automatically friendly), enemy to resistance
@cosmic wedge before anything: what is the exact situation you are trying to depict?
Okay, I think you actually solved it for me. The thing is I am starting inside small hiden west outpost inside the east teritorry (that has been just detected and I need to escape), so I need the west to be friendly and east to be enemy. But on the border I need them to not shoot at eachother. But I think I will change it and make the starting point resistance, which will be friendly with west but not east, so east will shoot at them, but west will not shoot at me if I get to border.
yes
you can also use setFriend (both ways!) between west and east
Thank you mate for your help! 🙂
anybody can make if some one mouse wheel and choose(name is vote) vote it pops out right side to everyone
anyone can make?
i need help
Frown I don't think I understood your request, can you restate with more words?
I think he means if he clicks on a scroll wheel action it shows a hint to all players?
not sure if I'm supposed to ask in this thread, but my question is: Can I make editor previews from only my mod in some way, the BI wiki only gives factions as an example (and my Blufor is quite big)
Maybe through this? https://community.bistudio.com/wiki/create3DENEntity
You can script lots of stuff in 3den
The function has a 'mods' parameter
https://community.bistudio.com/wiki/BIS_fnc_exportEditorPreviews
wow that was right infront of me the whole time xD Think I get it, thanks!
Different hardware runs SQF with different performance. Can we maybe make some basic script and measure how fast it runs on different CPUs? Does it make any sense and is it interesting for anyone?
Although, I think it might only make sense to test that at 2-3 CPUs, the rest can be interpolated by looking at some other CPU single-thread benchmark
my Pentium III has issues running Arma 3 indeed
The more single core Mhz the better (for Arma).
Intel runs much better than AMD
Not sure about the newer Ryzen CPUs. Any experiences???
Anybody know how to enable zeus through the debug console?
Yes
https://gist.github.com/dedmen/3fa5f648631dd14a4173edea7580045e
clientside execute
@still forum Do I copy the text or?
I cant figure how to get this to work
copy paste, local execute, done
Doesn't seem to work then. I paste but the I can't go into zeus.
I just need it so I can unstuck a vehicle.
dunno then, worked for me last time i used it
Hi
How i can lock just one door of a building in multiplayer environment?
hi, what does google say about it?
Spoiler:```sqf
_theHouse setVariable ['BIS_Disabled_Door_1',1,true];
thanks snake can open it 😄 ? how i can get the door number i want to disable?
try & cry 😋
Added some missing params for titles https://community.bistudio.com/wiki/Description.ext#CfgSounds
Can’t say, don’t have that info
ok; I remember of that with the OFP:R campaign, would Viktor Troska narrate the font would be different
titles[] = {
0, <t color="#ff0000">Red text</t>,
1, <t color="#00ff00">Green text</t>
};```
I am amazed that it doesn't require another set of quotes around that
Because anything not a number is a string for config parser
I expected a parsing error actually!
is there a way to tell if an object is a helicopter or a plane? im using is kindof but only "Air" seems to work.
_object isKindOf "Helicopter"
_object isKindOf "Plane"
Those will work, see https://community.bistudio.com/wiki/ArmA:_CfgVehicles#Air_Class_Vehicles
ok ill try it again thx mate
curious, I've got a function that goes something like this:
params ["_array", ["_many", []]];
{ _x params ["_i", "_value"]; _array set [_i, _value]; } forEach _many;
_array;
The idea is that I want to "set many" in one fell swoop. However, I am finding that the array elements are resulting in any, which I am sure is incorrect. Example:
_x = [[1, 2, 3], [4, 5, 6], [7, 8, 9]];
[_x, [0, "test"]] call LINQ_fn_set;
I half expect ["test",[4,5,6],[7,8,9]], however, it yields [any,[4,5,6],[7,8,9]]. Ideas?
Oh wait, I think I spotted it,
_x = [[1, 2, 3], [4, 5, 6], [7, 8, 9]];
[_x, [[0, "test"]]] call LINQ_fn_set;
excuse me, I want to ask how to add a parameter to config.cpp in the module so that the vehicle can't be damaged after hitting any object? Thank you
anybody can make if i scroll the middle button and i click that it can move
i don't know how to move
pleaseee...
I think noone knows what you mean
no, but you could send a link to a picture here, for others to maybe help you with it
scroll
and click that
and
pop out like this
so i can't move like w a s d
click
but i want to move
☝️ 👍
mmm..
if some of player push PageUp button it events command #reassign and if PageDown just close Also it percentage 50%
some one can make script..?
help..
c++
Just make an array with all players that have voted for the restart. If the array is more than allPlayers / 2 then you got your 50%, don't forget to remove player that disconnected. Then use the serverCommand to restart.
c++
🤔
Excuse me, I have placed some AI in the editor and run it at the beginning of the task. How can I set the corpses to be automatically removed after these AIs die? Thank you!
Ok so exporteditorpreviews, checked out the BI wiki for it, but can't for the life of me get it to work for my mod only. according to the wiki '0 = [nil,"all",[],["My_mod"], []] spawn BIS_fnc_exportEditorPreviews;' should work, but it keeps giving me a no classes found. Probably missing something here xD
what kind of objects are you trying to find?
Everything, Gear, vehicles and units
@runic quest
Putting this into the init field for the Unit should work:
this addEventHandler ["killed", {deletevehicle (_this select 0)}];
Maybe you have to change this to _this. Not sure atm...
0 = [nil,"all",[],["My_mod"], []] spawn BIS_fnc_exportEditorPreviews;
This means:
- duration = 1 (default)
- type = all (so all objects in CfgVehicles)
- sides = all
- mods = "My_mod" (classname in CfgMods)
- addons = all (can be removed then empty)
And each objects has:
- scope = 2
- side is set
- CfgMods is set for mod where the object is set
- used model is not in blacklist (dummyweapon.p3d, laserTgt.p3d, HelipadEmpty_F.p3d)
- inherits from
All - object is not inheriting from blacklist (WeaponHolder, LaserTarget, Bag_Base)
So it should work like that, but it's giving me a no classes found error
Not sure what you mean by '- CfgMods is set for mod where the object is set' is that the dir="my_mod"; ?
no, it's:
class CfgMods {
class MY_MOD { // <-- this name
// variables
};
};
ok, that's set up correctly
hmm... I'm trying to do the same and I get the same issue...
aah well, got it in the end by doing 0 = [nil,"all",[west]] spawn BIS_fnc_exportEditorPreviews; and just deleting all the screenshots that aren't my mod xD takes a while but got there in the end
Hey, got a short question as well. I am trying to check if the Guards behaviour is set to combat, then wait 5 seconds and then check if the unit is still alive. Any ideas why it is not working?
alarmtr setTriggerStatements ["{behaviour Guard3 == 'COMBAT'; sleep 5; alive Guard3;}",
"handle_ = execVM 'alarm.sqf';", ""];
A trigger is essentially a codified loop, you can't (and wouldn't want to) put a sleep statement in there
your trigger condition is never true
trigger waits for true,
you return a piece of code
handle_ = thats useless
Just do :
"alive Guard3 && behaviour Guard3 == 'COMBAT'
that would be missing the 5 second delay though :/
Shouldn't use a trigger, then
just add sleep and alive check to the start of your alarm.sqf
okay, thx will give it a try ^^
@still forum @worn forge works perfectly fine now, cheers ^^
👍
Hello, I am trying to make a trigger that activates when there are more than 3 civies in the area, how do i set it up?
count thislist > 3 @ashen hawk
@winter rose Thank you SO much! 🙂
with pleasure 😎
so just a little PSA if you use https://community.bistudio.com/wiki/BIS_fnc_sideIsEnemy
if the first unit is setcaptive or civilian it will return EAST as hostile
it already mentions that in Side_Relations but man what a pain it was trying to work out what was causing this issue
a note should be added, indeed!
at least a reminder to visit the page. bad Guba is enemy to everyone
is there a way I can set a default value for a variable?
I have a script that runs several times and has two if statements. However if I place the _status = "free"; above the if statements the second if statement will not be executed because everytime the script runs, the _status variable will be reset
if (isNil "_status") then {_status = "free"}
thanks!
~~I am using DayZ Medics UAV script
tv setObjectTextureGlobal [0, "#(argb,512,512,1)r2t(uavrtt,1)"];
cam = "camera" camCreate [0,0,0];
cam cameraEffect ["External", "Back", "uavrtt"];
cam attachTo [uav, [0,5,0], "PiP0_pos"];
cam camSetFov 1;
"uavrtt" setPiPEffect [0];
addMissionEventHandler ["Draw3D"], {
_dir =
(uav selectionPosition "laserstart")
vectorFromTo
(uav selectionPosition "commanderview");
cam setVectorDirAndUp [
_dir,
_vUp = _vDir vectorCrossProduct _vSide;
];
};
But if you go into arsenal it breaks the display. I tried adding
[missionNamespace, "arsenalClosed", {
isNil {
cam cameraEffect ["TERMINATE", "BACK"];
camDestroy cam;
cam = "camera" camCreate [0,0,0];
// etc.
cam cameraEffect ["INTERNAL", "BACK", "uavrtt"];
};
}] call BIS_fnc_addScriptedEventHandler;
to init.sqf but can not seem to get it to work. Latter is found of a reddit post. Can anyone please advise?~~
Found a solution ^
Simply added sleep 5; execVM "screen.sqf";
So it is now
tv setObjectTextureGlobal [0, "#(argb,512,512,1)r2t(uavrtt,1)"];
uav lockCameraTo [tgt, [0]];
cam = "camera" camCreate [0,0,0];
cam cameraEffect ["External", "Back", "uavrtt"];
cam attachTo [uav, [0,5,0], "PiP0_pos"];
cam camSetFov 1;
"uavrtt" setPiPEffect [0];
addMissionEventHandler ["Draw3D", {
_dir =
(uav selectionPosition "laserstart")
vectorFromTo
(uav selectionPosition "commanderview");
cam setVectorDirAndUp [
_dir,
_dir vectorCrossProduct [-(_dir select 1), _dir select 0, 0]
];
}];
sleep 5;
execVM "screen.sqf";
Hello I need to know if AI is player controlled or server controlled in order to count it for some checks, is there a specific syntax to determine it?
isPlayer @slate sapphire !
I think I have to use local
I totally misunderstood the question, plz don't mind me
good that I don't use Headless client, cos I guess also headless client on server script is not local
my question was if there was a specific command to check if ai is player controlled
what do you mean by "player controlled"
the ai on player team the one you can give order f2 f3 f4 f5 etc.
ok that could work,
if I have 3 ai, on my group and I disconnect, isPlayer leader _myaiunit would return false right?
yeah
cos the leader/ai will be back on server
no
The locality of the leader has nothing to do with that
He might aswell be on another player, or the headlessclient
Yep
I need to determine if it's player controlling AI or not, cos when people disconnect with AI in town those ai are raising peace time in my warfare, so I want to remove that to save some annoying situation and count for peace time only ai that is player controlled
it count also the player itself right?
you mean if player is alone in a group?
then he is the leader of his own group. so yes
and if he is not alone in group, example ai are on different place not with him in the town range
I think it will still return yes cos he is still the leader of his own group if I got the logic of the command
unless ofc he is just as player in a AI group, with a AI leading the group
ok that's clear, but in my version all players are leaders of AI so it should work that way thanks
How do i call bis_fnc_arsenel_data. And access/change it in my mission
Errr i was gonna post a ss but no permission, basically its supposed to give me a list of whitelisted classnames according to a post on warlords forum awhile back by jezuro
If theres a way to blacklist instead that would be good to
Is it possible to use scripts to make a menu? if so, any pointers
like a clickable and interactable
Yes, it's possible - https://community.bistudio.com/wiki/User_Interface_Event_Handlers
There's also a GUI Editor you can use
how does one handle such things as "critical sections", i.e. where we want to modify state that is being operated on by "manager" loops.
puzzling through that, I cannot reduce it to fewer than two Booleans involved, one to signal a pause, the other to acknowledge paused. or, minimum, a flag, 0, 1, 2, etc.
would it be overkill to guard something like waitUntil { _semaphore == 0; };, then whichever are the critical operations, increment/decrement the sempahore signaling occupied or all clear?
Best way to achieve this... is to avoid scheduled code at all cost, otherwise you end up with asynchronous behaviour, lots of confustion, lack of debugging for such things, pain, suffering, etc......
But yes waitUntil can be used quite well for critical section
I've got myself some tools for synchronizing spawned threads:
https://github.com/Sparker95/Vindicta/blob/development/Project_0.Altis/CriticalSection/CriticalSection.hpp
https://github.com/Sparker95/Vindicta/blob/development/Project_0.Altis/Mutex/Mutex.hpp
https://github.com/Sparker95/Vindicta/blob/development/Project_0.Altis/MutexRecursive/MutexRecursive.hpp
All gathered mostly from this discord or forum
Was gonna use it for vehicle textures but perhaps engine solution would be better
interesting, so with BIS_fnc_spawnOrdered , that potentially averts mutex code from stepping on its interrelated toes?
my only critique of the interface is that it takes a function name. does it allow CODE? that would be great.
so BIS_fnc_spawnOrdered works like a queue into which you push code to be executed in sequence?
I've just realized that, or might be wrong
I think so, that's how i take it, with potential to isolate according to named mutex.
pushing args and a function name in the current name space.
but perhaps engine solution would be better
Multithreaded scripting language... 😢 😻
interesting, I suppose an uninterrupted scope is unavoidable... two concerns, 1. would need to relay any variables to parent scope. 2. introduces a _null variable, which is not the worst thing, if I were naming my variables _null. https://github.com/Sparker95/Vindicta/blob/development/Project_0.Altis/CriticalSection/CriticalSection.hpp
I like the mutex mechanism though, simple, effective, https://github.com/Sparker95/Vindicta/blob/development/Project_0.Altis/Mutex/Mutex.hpp
if I understand it correctly, just pass in the array which is tracking the mutex, etc.
can even wrap in a delayed try lock.
Q: where does _SQF_VM get defined? is that built in to A3?
Q: where does _SQF_VM get defined? is that built in to A3?
nowhere, no it isn't
That's from SQF VM (The emulator)
ah I see, looks like that is for internal testing then.
MUTEX_SCOPED_LOCK(mutex) is pretty sexy... Run some bit of code in the scope of a mutex. Sweet!
has great potential. I have a manager and need to inject change orders in. but I need to park the COs in queue until the manager is clear from whatever it wants to do.
Real quick question, so I am looking to rotate a object while using in game scripts or whatever. Under is the attachto line
x2 attachto [x1,[0,-1,-0.6]]
https://community.bistudio.com/wiki/attachTo has some comments about this.
- You can use
setDirto rotate the object relative to the attached object (0 is front, 180 rear) - You can use
setVectorDirAndUpto set the orientation
Seperate lines?
yes
Many thanks, time to make my genocide meme machine
Guys, is there a way of making a unit (in this case a hostage) getting in a enemy vehicle?
that hostage is already in an enemy truck and I'm having trouble even to get him out of it
@random tangle not enough information. off the cuff, sounds like maybe the hostage is not actually in your group and/or aligned with your side? other than that, your campaign mode supports capturing vehicles?
hmm
ok, I have a unit a hostage, he is in BLUEFOR. That unity is set captive and (ace) handcuffed in the back of an ural truck (OPFOR). That truck moves to an air port were I want that hostage to get in a plane.
I have it almost working except for the hostage
this is my current script. I execute that using a scripted waypoint
I remember there was a way to check what addon is the last to make changes to a class. However I just cannot remember what that command was and I my google-fu fails me yet again.
Thanks
@paper laurel you could use https://community.bistudio.com/wiki/BIS_fnc_transformVectorDirAndUp here it is in action https://youtu.be/FKGqBvYwlzg
@still forum thanks for your hint on isNil. Will this however reset my variable to nil once my script is run? My script is this:
/*
author: @Aebian
description: Airsupport script for my test mission.
returns: nothing
// [Vulture21CR, Vulture21, "KION", US_HeliPad01,"OnStatCampEast","US_PilotWait01", Engineer01, "US_EngineerWait01"] execVM "itsAebian\KI_AISUP.sqf";
*/
params["_group", "_vehicle", "_cond", "_helipad", "_prepos","_waitpos", "_engineer", "_engpos"];
(units _group) params ["_leader","_gunner"];
_status = nil;
if (isNil "_status") then {_status = "free"};
if (_cond isEqualTo "KION" && _status isEqualTo "free") then
{ // On station thingy
_status = "inAction";
_leader assignAsDriver _vehicle;
_gunner assignAsGunner _vehicle;
sleep 2;
[_leader, _gunner] orderGetIn true;
sleep 10;
_group move (getMarkerPos _prepos);
sleep 240;
_status = "missionCompleted";
}
else
{ // RTB
if (_cond isEqualTo "KIOFF" && _status isEqualTo "missionCompleted") then
{
_leader setBehaviour "SAFE";
_gunner setBehaviour "SAFE";
_leader landAt _helipad;
_leader land "LAND";
unassignVehicle _leader;
unassignVehicle _gunner;
_leader setCombatMode "BLUE";
_leader setBehaviour "SAFE";
_gunner setCombatMode "BLUE";
_gunner setBehaviour "SAFE";
_group move (getMarkerPos _waitpos);
_status = "readyFix";
_engineer move position _vehicle;
_engineer action ["repairVehicle", _vehicle];
sleep 250;
_engineer move (getMarkerPos _engpos);
sleep 40;
_status = "free";
}
}```
I defined the variable _status almost at the beginning
however It doesn't seem that I can leave out the assignment. Even when using private it wants a value
give it one?
when I set the variable it will override every time the script will be run
so nil is the only option
I'm not sure if this will affect the script aka if the variable will always be set to nil
wait, what is it that you want? If you want a private variable, make it private, else, make a public one?
no, what I want is a variable that is set only once to status free at the start of the script so that the first if gets executed. But then it will change so that the second if will be executed
so a global variable
@hollow lantern ```sqf
if (isNil "AEBIAN_FIRSTRUNDONE") then {
AEBIAN_FIRSTRUNDONE = true;
// firstRun
} else {
// secondRun
};
Hello. I have problem with createVehicle command executed by server, with classname O_Heli_Transport_04_bench_F. The helicopter behaves in a strange way, looks like problem with sync or simulation. Video for understanding: https://youtu.be/0c4jrDeYhiE. And if you will join as driver in helicopter before suspension goes in down position, then with a high probability there will be an explosion or a big jump. Any ideas how to fix it?
try to set velocity down maybe, to "init" the physics
I tried, it doesn't help
what if you create it 0.5m altitude?
same
welp
@winter rose hey, is it bad is I ask a question directly to you? haha, anyway, I'm trying to code a rescue hostage mission, just to understand the internals of arma scripting. It is a MP/SP mission (1 - 4 players) where you have to rescue a hostage before it gets in a plane and leaves. I'm having a issue with the hostage though, everything else is working quite well. My hostage is a bluefor civilian unit with setCaptive true and ACE handcuffs. I have used the extended 3den editor mod to place the hostage inside an opfor truck. The issue I'm having is that I cannot get the hostage out of the truck using commands, and I cannot order the hostage to get in the enemy plane too.
I have read the wiki on the commands list but I couldn't find any commands that work, I have tested a few (doGetIn, orderGetIn, commandGetOut, orderGetIn...). They only seem to work when the squad owns the vehicle
moveOut, unassignVehicle ?
oh, sorry I missed the notification
I haven't tried moveOut
unassignVehicle I don't know if it will work because the unit is not part of any squad that owns the vehicle
moveOut should do the job - else use action "getOut"
@winter rose well, Global Variable is fine, I added another param so I assign the variable via script execution. However the status will not be always nil at first. If the second run is completed it will stay on _status = "free" . What about that? My guess is that your code needs to look like this:
if (isNil _status or _status == "free") then {
_status = "free";
// firstRun
} else {
// secondRun
};```
correct?
I don't get it? is _status a provided parametre now?
well the script will run several times for several vehicles. One global variable doesn't make sense, I need many global variables then
so I just assign them as param so that this issue is solved
setVariable on the vehicle? e.g Aebian_init = true
that, or split your code in multiple scripts
or make a _mode param "init", "refresh", whatever
params["_group", "_vehicle", "_switch", "_helipad", "_prepos","_waitpos", "_engineer", "_engpos", "_status"];``` this are the params. This is how the script will be run:
```sqf
[Vulture21CR, Vulture21, "KION", US_HeliPad01,"OnStatCampEast","US_PilotWait01", Engineer01, "US_EngineerWait01", THEGLOBALVARIABLE] execVM "itsAebian\KI_AISUP.sqf";```
@hollow lantern isNil _status thats not how you use isNil
also, why do you check for _status
if (isNil _status or _status == "free") then {
_status = "free";```
then set it again?
+this should also pop up an error, btw
in your code that you posted above
_status = nil;
if (isNil "_status") then {_status = "free"};
that makes no sense, why check isNil RIGHT AFTER you've set the variable to nil? You already know its gonna be nil, you just set it to that.
isNil "_var"```
because the script will never run after status has been set as the variable is no longer is nil
global var
yeah your usage of a local variable that you intend to stay alive seems weird.
That only makes sense if its defined at a higher scope
I just need the _status variable alive
which is a legit thing to do, but noone will expect that, and such a thing should always be explained with a comment on it so that the reader knows whats going on
that's all
global var...
seriously, either make [arguments, blah, "init"/"update"], or setVariable on the vehicle itself
Yeah, or what lou said.
Lou* 👀
lOu
DSCHA! *bless you*
*Gesundheit
à vos souhaits
Englisch pls, not 🥖
you will be going through so much pain
sry loU
L.o.u = hello you
well, global variable fixed the issue. Only had to add sqf if (isNil "_status") then { _status = "free"; }; at the beginning of my script
Thanks guys
You say global var, but show a local var, hu? I am confused
it's in params @jade abyss
https://discordapp.com/channels/105462288051380224/105462984087728128/657611385823297591
params["_group", "_vehicle", "_switch", "_helipad", "_prepos","_waitpos", "_engineer", "_engpos", "_status"];
ah
is it possible to put text on billboards from a script
No
If you have textures with the text you'd like; or you somehow mod the billboard to be a license plate, yes. Otherwise, no.
okay Thanks
i could use some help/direction on how to determine a position on the side of an object that is opposite from the side the player is standing on. if that doesn't make sense, i need to tell an AI to go to the opposite side of an object that the player is standing on. looking for functions or existing solutions i can view and adapt.
Guys. I have a marker on the map, it has a variable. How do I get this variable on mouse hover?
@exotic tinsel direction from unit to object +180
or direction from object to unit, of course
with getPos, distance and direction you can make something working!
@fleet hazel you can't set variables on markers
@winter rose How to gain control of the marker?
@fleet hazel you told me you had a variable on this marker…?
else all marker commands, getMarkerPos, etc
https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3
ctrl+F -> "marker" -> F3 around
There are alot of commads for that (incl. examples)
Well, what he said. Also, there might be a "Markers" command category, check it out
@winter rose @jade abyss My goal. When you hover over the marker with the mouse cursor, a window will appear that describes what this marker is needed for.
"eachFrame" eventhandler, that checks for "getMousePosition", markerPos, mapToScreen (or however it was called)
+creates a ctrl ("window") with the text 🙂
Sounds easy, aye?
(not)
I don't know if a function already exists for this though
I'll try
objectName = name _this;
namestr = str objectName + "Has been spawned.";
hint namestr;``` Can you concatenate strings and variables in sqf?
Yes, it can. 🙂
easiest method is: namestr = format ["%1 has been spawned.", str objectName];
o.0 thank you.
I've been coding in JS, for like two weeks, been a few months without any SQF 😢 so I'm a little rusty.
known problem when you program multiple languages
Within my code: _this is the object, I assume is class name. To find the displayName I need to look into the cfgConfig. Specifically CfgVehicles so that script would look like: ```sqf
objectClassName = typeOf _this;
objectName = getText(configFile >> "CfgVehicles" >> objectClassName >> "displayName");
namestr = format ["%1 has been spawned.", objectName];
hint namestr;
Yup, getText() returns a string, awesome.
oops, I found an error. _this isn't the class name. 😢
_this is a magic variable
It's been defined, dw.
sorted.
yay! I know it's overkill. But I wanted to do some scripting 😉 https://cdn.discordapp.com/attachments/620394340748886016/657653391891234836/unknown.png
my only issue, is spawning another vehicle, when something is in it's way.
I'm sure you use createVehicle, which automatically finds a suitable spot to spawn an item (unless "CAN_COLLIDE" is set).
You could use nearestObjects beforehand to check if there are objects within a range.
_object = "some_vehicle";
_marker = "some_marker";
_radius = 10;
if (count (nearestObjects [getMarkerPos _marker, ["Vehicle"], _radius]) > 0) exitWith { hint "Can't spawn object." };
createVehicle [_object, getMarkerPos _marker, [], 0, "NONE"];
PS. not tested, but should give an idea on how to do it 😉
I don't know how the module it created. 🙂 not my creation.
I could make the vehicle disabledsim. and then enable sim, when there's no vehicle etc. https://cdn.discordapp.com/attachments/620394340748886016/657659886477377546/unknown.png
Thanks for the help.
btw, you don't need to str with format
Unless you want quotes around something, which obviously no one would want...
puts quotes around @plain current
Ah yes i do like some "quotes"
Double str str str for quotes around non strings
https://gyazo.com/1b5bb582111a1721a0fe03898a24d265
But do you "like" quotes, or do you like "quotes"?
"That is the real question" -Fini, 2019
Possible to do removePrimaryWeaponItem in cargo inventory ?
afaik no
in general its not possible to "remove" something from cargo inventory.. atleast not directly without workarounds
workaround for this is to grab weaponItems, remove all weapons, then readd all weapons with attachments with that thing you wanted not being readded
I’m looking for an #Arma3 script writer with experience publishing multiplayer game modes/missions. I have a couple items I want put out for the community, but need help cleaning up the code. 😅
so another cfgpatch for these weapons and just remove linkeditems 🤔
its a bit more complicated in my case, exile (persistence)
Hello,
Making a template tool in the editor. having a hard time getting Zeus modules to play nicely.
Entities are setting up correctly, however the module settings aren't being set.
https://github.com/56curious/VKN_Official_Mod/blob/master/VKN_Functions/Functions/fn_missionTemplateTool.sqf This is my code.
Are all vanilla modules setup to utilize set3DENAttribute or will I need to edit their configs to make them work?
How do I create a laser on an object?
No AI or anything, just spawn a laser on a given object
#define TEST 5
TEST;
'"';
TEST;
second TEST doesnt get resolved, '"' breaks preproc i suppose, do i not know something?
huh... it shouldn't break preproc, and never noticed it breaking on that
#define TEST 5
TEST;
'""';
TEST;
'"';
TEST;
first and second are correctly resolved, 3rd one however, doesn't get resolved
@slate cypress if you mean laserTarget, there is such an object that you can createVehicle (see Arma 3 classes on the wiki)
what was the kegeytegs tool for undoing .bin files? it was like unrap or derap or somethin but i can't find it cuz his websites gone down
i found it, it's "unrap"
Cfgconvert in arma3 tools.
Mikeros derap
Hi, quick question: this is the params array sqf params["_group", "_vehicle", "_switch", "_helipad", "_prepos","_waitpos", "_engineer", "_engpos", "_status"];
The last part is a global variable I handover to the script. I have this at the beginning of the script:
if (isNil "_status") then {
_status = "free";
diag_log "Setting variable to free status";
};``` What I noticed is that if I run the script a second time with that same variable name passed to the params it will again get set to "free" or at least the log tells me that. If I check on the variable via debug console it returns nothing. Is that intended behaviour or what's wrong?
As the script will be run for different vehicles I need a way to define the variable dynamically so I tried the method via params
_status from the params array is by default private, so no matter what you do, _status is a private variable inside that script.
So it depends on what you want to do; either set the status every time you call the script (in that case it should never hit the if (isNill "_status") statement).
Or don't use it as a parameter, and make it global through publicVariable
You are copying whatever value you had in your global variable, into _status.
Then you set _status to "free" and expect it to also magically update the global variable that the script never saw that it even exists...
I have nothing in the global variable I thought by specifying it there as param and with the isNil stuff I would set it
You are setting the local _status variable
It doesn't know anything about a eventual global variable that might have been somewhere at some point in time
If you want to use a global variable, then you have to use the global variable and write down it's name right there and then
I run the script like this: sqf [Vulture21CR, Vulture21, "KION", US_HeliPad01,"OnStatCampEast","US_PilotWait01", Engineer01, "US_EngineerWait01", KI_AIRSUP_VU21] execVM "itsAebian\KI_AISUP.sqf"; I expected that KI_AIRSUP_VU21 will be threated as global var
but I guess that's is wrong
_status = 1
Sets the variable "_status" to 1. That's exactly what the script tells the game to do.
Now you expect it to magically know about, and set "KI_AIRSUP_VU21" to 1. That clearly won't work.
I expected that KI_AIRSUP_VU21 will be threated as global var
It is, and it will be yes.
huh? I thought _status is just the reference to the param "_status"
There is no "param" that's not how that works
Here I'll write you a analogy
You take a picture of a house (that's your global variable that you read out)
You print it out and send it to your parents in the mail (your execVM)
Your parents take it out of the envelope and make a copy of the picture using their photocopier (that's params)
Now they take a pen and draw a huge duck onto the copy of the picture.
Is there now a drawing of a duck on the house you photographed in the beginning?
if you point it this way no. So param is a one way ticket but doesn't phone back?
All things in SQF are passed as reference yes, but it's a reference to the value that was stored in the variable, it's not a reference to the variable, the value has absolutely no idea where it came from
If you want to set a global variable, then you have to directly set it
MyGlobalVar = 5
my expectation in my head was: _status param gets KI_AIRSUP_VU21 as value, so the isNil function sets KI_AIRSUP_VU21 = "free"
MyGlobalVar is the street address of the house, and you set the house at that address to 5.
_status param gets KI_AIRSUP_VU21 as value
No. KI_AIRSUP_VU21 is not a value, it's a variable name.
It's not a house, it's a street address.
_status gets the value that was inside that variable at that time.
It gets a photo of the house that was at that street address at that time
you mean it takes the value from the var KI_AIRSUP_VU21 ?
yes
Script commands can actually not see variable names, they are long gone before the command is actually executed.
That's why you have to pass a string to isNil and params
params simply creates a private variable with the name _status and the value is coming from the variable you placed in the call.
if (isNil "Myglobalvar") then {
Myglobalvar= "free";
};```
No need to use Params for a global car. Simply directly work with the global var in your subscript
yeah but then I only have ONE global var
hmmm ok
So you don’t want to let the subscript change the global var?
Var1 = 5
Var2 = 7
[Var1, Var2] call {params ["_var1"]}
What call actually gets is [5,7] and it puts that into _this
It doesn't know where these numbers come from.
Params grabs the first value in _this and puts it into _var1
_var1 is now 5.
But neither _var1 nor params nor _this nor call know anything about Var1 ever having existed
@solemn token no, if the script will run again with another vehicle it shouldn't use the global var of the first vehicle
Why don't you just store your variable ONTO the vehicle? Like was recommended to you some 10 hours ago?
because then I'm always tied to the vehicle, I don't want it. I just want a simple one-line (the execVM part) and that;s it. I guess I fiddle around wit get/setVariable
Dedmen is 100% right.
Store the var on the vehicle then.
This would be the best / correct way!
But... Don't you right now just have one global variable per vehicle anyway?
my point is, if I run the script like this sqf [Vulture21CR, Vulture21, "KION", US_HeliPad01,"OnStatCampEast","US_PilotWait01", Engineer01, "US_EngineerWait01", "KI_AIRSUP_VU21"] execVM "itsAebian\KI_AISUP.sqf"; given the fact that the last part is now the globalVar name and it will properly set, then I don't need to touch the vehicle in anyway. Or I just read you wrong and you mean I should within this script just tie a globalVar to _vehicle
I meant like
_vehicle setVariable ["status", "free"]
And to read the current value you can just
Vulture21 getVariable "status"
I'll test this out, thanks for opening my eyes
Another hint could be:
Params [“_status“];
_status = +_status;
Will make a stupid copy of the param _status and NOT affect the Original one / global var
I find the get/setVariable much more sufficient. and it works right away thanks @still forum @solemn token @exotic flax
much more? The vehicle thing we talked about is get/setVariable too. Just as the missionNamespace stuff
I am reading from an array read from a config, but all booleans are being read as numbers, which i suspect is a parsing thing as I am using armake. What is the best practice to using a boolean in config arrays like this? Quote?
if (_value == "true") then {
_value = true;
} else {
_value = false;
};
};``` is this necessary?
_value = if (_value isEqualType "" && { _value isEqualTo "true" || _value isEqualTo "false" }) then (compile _value);
Something like that?
private _booleanValue = _value != 0
```sqf
// your code
```
@tough abyss
ok
lemme do one quick test
"hi world"
OwO it works
ty very much
// KP_liberation_clear_cargo is in other script
// KP_liberation_clear_cargo is one cargo cleaner condition set on the parameters
private _boatank = "LIB_LCM3_Armed";
private _boatruck = "LIB_LCM3_Armed";
private _truck = "LIB_US_GMC_Tent";
private _tank = "LIB_M8_Greyho";
private _area_check_Tank = missionNamespace getVariable ("boatank_");
private _area_check_Truck = missionNamespace getVariable ("boatruck_");
_inside_Truck = _boatruck inArea _area_check_Truck and _truck isVehicleCargo _boatruck;
_inside_Tank = _boatank inArea _area_check_Tank and _tank isVehicleCargo _boatank;
if (_inside_truck = false) then {
createVehicle [_boatruck, (_area_check_Truck select 0), (_area_check_Truck select 1), (_area_check_Truck select 2)];
createVehicle [_truck,(_area_check_Truck select 0), (_area_check_Truck select 1),( _area_check_Truck select 2)];
_truck setDir (getDir _area_check_Truck);
_truck setposATL (getposATL _area_check_Truck);
_boatruck setDir (getDir _area_check_Truck);
_boatruck setposATL (getposATL _area_check_Truck);
_boatruck setVehicleCargo _truck;
if(KP_liberation_clear_cargo) then {
clearWeaponCargoGlobal _boatruck;
clearMagazineCargoGlobal _boatruck;
clearItemCargoGlobal _boatruck;
clearBackpackCargoGlobal _boatruck;
clearWeaponCargoGlobal _truck;
clearMagazineCargoGlobal _truck;
clearItemCargoGlobal _truck;
clearBackpackCargoGlobal _truck;
};
sleep 0.5;
};
so I don't think the engine of the _truck wouldn't work.
I re-wrote the script with a few modifications
I tested and didn't work guess I still need modify this
= is assigning
I just read the RPT
if (something == false) wouldn't work
Use if (not something)
some variables aren't defined
also, private your _inside vars
here's a long shot... I would like to use a grid system that calculates a rough terrain type (surface calcs, building counts, etc) and an ability to draw a line between two points for intersection/grid counting. eg. line between one area and another area results in 3 of terrain type A and 1 of terrain type B.
Now creating the grids and labelling as specific terrain types is intensive, and cannot be done ingame. Is there an effective way to make a grid calc in game, or am I looking at an extension to handle this in a separate thread?
I experimented with wrp parsing but I couldn't get the types of nObjects to work properly. If i calc this with the surface types command and export it for use in a calc thread do you think this would improve performance enough to let me use it in game?
You may want to process it beforehand and export the data for the island in a sqf/txt file?
That, or startLoadingScreen/endLoadingScreen to only process data before playing
Sorry I am exporting this data, currently I am saving in config and reading from there in preInit. It is the searching of large arrays of grids that is too intensive. Comparing distances of X and Y elements in a large array is just not efficient.
CBA hashes are just matching/corresponding array sets correct? So it would help but only to a point in which an array becomes too large to filter right?
I don't know I don't use CBA *preparing for incoming stones*
is there a best practice for storing large datasets? particularly I wish to store around 10 elements of data about particular grids, with each being 50-100m, so for large maps this is obviously a very intensive operation.
is it possible to show a vehicle model in a Dialog Menu?
why there's no vehicle in vehicle script tutorial on youtube?
that's annoying
OH I THINK I'VE FOUND IT
no I didn't
Hi all, I am working on a little heli mission that gets the pilot to ferry AI groups from a base to a random location (original, I know). The way I want it to work, I create a group, then create units and assign to that group. Then, I get said group to board my heli. There are some other checks that basically track the flight and kick the AI units on landing at the LZ. All fine so far. But I am trying to delete the group the AI are assigned to, and then re-use the same group name on the subsequent cycles of unit creation. The issue I find is that on first go, everything works fine, but as I return to base to pick up the second bunch, only one of the units boards, the others do not react. My guess is that I am messing up the bit where I delete the group and then reuse the group. Here is the code: https://www.pastiebin.com/5dfe21781846c
If anyone could take a look and advise, I would be most grateful.
Apologies in advance, my skills are pretty shoddy..
@slim oyster so why does plain multidimensional numeric array not suit you? Or you mean, how to store it in a file or whatever?
Even if it's 50 megabytes of RAM, who cares... and if it's 50 megabytes of ROM (per island), who cares as well, since you are distributing it as an addon through workshop
@rough dagger I would use one group for chopper crew, another one for all the soldiers being transported by the chopper
create group with delete when empty flag
Hiya Sparker, thanks
Probably there isn't much value in managing resources that attentively, if game can do it itself
Also Pizzadox I like that grid idea, it's awesome I believe
getting that data and storing it is no issue, the issue is being able to use it efficiently enough for what I want... to evaluate neighbour grids and their qualities, most likely hash returns in a variety of data types, as well as a X/Y overlap system for virtual lines (this is just using the X and Y coordinates of the grid data elements with a bit of math)
Not an issue if the array is small enough, big issue if the array is very large
I believe you have something like... 2-dimensional array of arrays of flags describing terrain properties?
yes
Then I assume your access to this is a bunch of selects... nothing can be faster than that in SQF, I don't really understand....
why there's no vehicle in vehicle script tutorial on youtube?1
Because videos are a bad way of explainig text based things
@austere granite can you help me building one script or point me one script with create vehicle? and/or one with setVehicleCargo?
pls
no
AWN
ok
That'll do me save time
T_T
even tough I'm here because I'm free so...
I'm already spending time 😉
https://community.bistudio.com/wiki/createVehicle
https://community.bistudio.com/wiki/Arma_3_Vehicle_in_Vehicle_Transport
bunch of examples on those pages, for most thing there will be a useful snippet of code on the biki within the examples sections.
@slim oyster
but all booleans are being read as numbers, which i suspect is a parsing thing as I am using armake.
nope... Booleeans in configs don't exist. So you cannot read bools from config.
if (_value == "true") then {
_value = true;
} else {
_value = false;
};
->
_value = (_value == "true")
if (_value isEqualType "" && {_value == "true" || _value == "false"}) then {
->
if (_value in ["true","false"]) then {
CBA hashes are just matching/corresponding array sets correct? So it would help but only to a point in which an array becomes too large to filter right?
yes. But you could use a namespace.
Are you sure that is really the slow part? array selects are fast.
how to put a pre-placed trigger in the sqf script?
🤔
just like we place objects right?
//variable
private _i = 0;
//Vehicles
private _LCM3 = "LIB_LCM3_Armed";
private _M8_greyhound = "LIB_M8_Greyhound";
private _GMC_truck = "LIB_US_GMC_Tent";
//locations
private _in_area_tank = _LCM3 and _M8_greyhound inArea "checkAreaTank_0"; // Triggers
private _in_area_truck = _LCM3 and _GMC_truck inArea "checkAreaTruck_0"; // Triggers
//Set cargo functions
private _embark_M8_function = _LCM3 setVehicleCargo _M8_greyhound;
private _embark_truck_function = _LCM3 setVehicleCargo _GMC_truck;
// executing stuff
if (_in_area_tank = true and _in_area_truck = true) then {
setVariable [_i, 0, true];
} else {
};
if (condition) then {
execVM _embark_truck_function;
execVM _embark_M8_function;
};
am I doing it right?
still WIP
setVariable [_i, 0, true]; whats that supposed to do?
reset the variable value
that's like.. wrong on all accounts.
left parameter missing, _i is not a string, the true at end is nonsense for a local variable
🤪 oof
if (_in_area_tank = true and _in_area_truck = true)
= assigns a variable
== compares a variable.
I assume you want to compare here.
But comparing a boolean to true is nonsense too.
true == true -> true
if you just remove the comparison
true -> true
same result
aaaaaaaaaaaaaa that make sense
//Set cargo functions
private _embark_M8_function = _LCM3 setVehicleCargo _M8_greyhound;
wtf is that? setVehicleCargo doesn't return a function?
engine AI path is asynchronous right? There is no on demand pathGenerate?
@slim oyster yes
https://community.bistudio.com/wiki/setVehicleCargo
setVehicleCargo returns a boolean
also setVehicleCargo takes two objects (like the wiki tells you)
your variables there are strings though
private _in_area_tank = _LCM3 and _M8_greyhound inArea "checkAreaTank_0";
anddoesn't take strings
https://community.bistudio.com/wiki/and
and inArea takes a position, neither string (what your variables are) nor bool (what and returns)
https://community.bistudio.com/wiki/inArea
thank you again
I think I am going about my terrain grid/node parsing all wrong. If i collect data from a certain cellsize using mostly surfacetype commands, stick them as well as the 2D data in a cba hash, what would be the best way of finding nearby/neighboring grids of a certain element type?
finding neighbouring grids on the XY system is fine, just a name change based on the grids coords, but comparing elements of those grids requires multiple hashgets of those coord names, then a comparing command.
Is there a library of some sort that has a A* algorithm with multiple params, not just the distances/flat cost?
maybe an extension call to a library that generates a few paths based on some passed params/cost modifiers.
prefer forested terrain, avoid cells near roads, etc
in-game, there is a calculatePath stuff
yes with the EH return, but over long distances it seems to drop in quality of sampling, which makes sense of course
I assume there is a resampling over a certain distance or time, but with the EH we just get the one return
you can use it multiple times for small parts yourself (not that risky)
or you can code your own path yes (or find one that exists)
I would love to see the sampling for terrain that the engine pathing does, like some short distance stealth path generation
short distance stealth gen can somehow detect very small clumps of trees and bushes, which makes me wonder how small the sample area for a surfacetype or even object search is
this is possible in a debug build iirc
well, can't find.
So I am wanting to use
tv setObjectTextureGlobal [0, "#(argb,512,512,1)r2t(uavrtt,1)"];
cam = "camera" camCreate [0,0,0];
cam cameraEffect ["External", "Back", "uavrtt"];
cam attachTo [uav, [0,5,0], "PiP0_pos"];
cam camSetFov 1;
"uavrtt" setPiPEffect [0];
addMissionEventHandler ["Draw3D", {
_dir =
(uav selectionPosition "laserstart")
vectorFromTo
(uav selectionPosition "commanderview");
cam setVectorDirAndUp [
_dir,
_dir vectorCrossProduct [-(_dir select 1), _dir select 0, 0]
];
}];
sleep 5;
execVM "screen.sqf";
But it keeps on breaking Zeus camera? Locks Zeus to first person for some reason. Anyone maybe have an idea?
Hey guys, how are you? I'm still having a lot of trouble trying to make a hostage interact with an enemy vehicle... It seems no vehicle commands work if the vehicle is from the other team. The unit can't get in the vehicle and can't get out if I force it in.
they… can get out? get in, with commands (moveInCargo, moveInDriver, etc)
@random tangle
If I place my hostage (a captive soldier) in the enemy truck I want him to be, he leaves the truck as soon as the mission starts. If I use ACE to handcuff him he never leaves the truck, not even with doMoveOut
Maybe I should just change his team and work with that...
I don't think what I want to do is possible without hacking arma a lot
@winter rose I don't think the problem is ACE. I have removed the handcuffs.
I just can't get a unity from a side to stay on a vehicle from another side. I think this is a limitation, dunno
assignAsCargo doesn't seem to work too
Yeah, maybe I'll have to disable the unit ai
when in doubt, remove their brains - as a zumbie, you should know 😄
haha
this is my current setup
oh
no images here
hmm
I'm using this assignAsCargo zm_truck; on the civilian
ok, I'm on it, so:
you want a civilian to remain in a CSAT vehicle
yes
I just found out that I'm able to use ace captives to do that.
By using ace handcuffs he stays in the vehicle, then I use ACE_captives_fnc_doUnloadCaptive to unload him
it works
there is a load method too
well, no problem anymore then? 🙂
yeah, I got it to work using ace captives
and the hostage even has a handcuff
haha
but yeah, it works!
Thanks man!
Hi, trying to make a script to sit and get out of a seat without using ACE cuz its broken on my pack
this addAction
[
"Get in Pilot's seat",
{
params ["_target", "_caller"];
[_caller, "SIT_AT_TABLE", "NONE", arrow1] call BIS_fnc_ambientAnim;
call exit_seat;
},
[],
1, false, true, "",
"true"
];
exit_seat = {
leave = _caller addAction
[
"Leave seat",
{
params ["_target", "_caller"];
_caller call BIS_fnc_ambientAnim__terminate;
_caller removeAction leave;
},
[],
1, false, true, "",
"true"
];
}
this works apart from the leave seat action, it doesn't add the action unless i cancel the animation thru console?
change 1 line and add 1 line:
this addAction
[
"Get in Pilot's seat",
{
params ["_target", "_caller"];
[_caller, "SIT_AT_TABLE", "NONE", arrow1] call BIS_fnc_ambientAnim;
[_caller] call exit_seat;
},
[],
1, false, true, "",
"true"
];
exit_seat = {
params ["_caller"];
leave = _caller addAction
[
"Leave seat",
{
params ["_target", "_caller"];
_caller call BIS_fnc_ambientAnim__terminate;
_caller removeAction leave;
},
[],
1, false, true, "",
"true"
];
};
This should work
Does SetViewDistance go into description.ext?
setViewDistance is code to be executed within a script or init box of an object/unit
You can code a lobby parameter to set the view distance though, which can be done in the description.ext
@violet gull figured it out through what you said, used a game logic ty
I'm having issues with CfgRemoteExec, missions seem to be overriding the mods config definitions basically breaking mod functions, is there a way to set it up so they can co-exist other than manually adding the mods functions to the missions description.ext?
missions seem to be overriding the mods config definitions basically breaking mod functions,
Yep.
a way to set it up so they can co-exist other than manually adding the mods functions to the missions description.ext?
and: afaik nope.
another thing to note, setViewDistance has to be executed local to the client you want affected
Yeah :/
can someone explain why this isn't working? It's giving me a generic error in the expression
WHILE {alive this} do {
this disableAI "ALL";
sleep 3;
this enableAI "ALL";
sleep 3;
};```
I basically am trying to make the Pretorian (turret) fire in 3 second intervals
What is 'zero' for dateToNumber?
When I do dateToNumber [date#0,1,1,0,0]; it returns 1.58549e-008
Although for [date#0,1,1,0,1] it returns 1.91844e-006, so should be 'zero enough' 😆
@slow isle init boxes are unscheduled
Does this mean it's impossible to do what im doing with WHILE {} DO {} ?
Like what does unscheduled mean?
Whole frame stops until your code is done
so... should not make the frame wait for too long
also can't use sleep or any kind of suspension
@slow isle use spawn
👍 ill try
spawning makes your code run 'in parallel' with the game, so you can suspend your script, sleep, do whatever you want
oh okay
i understand now
makes sense
I dont understand this in the wiki page (1st given example):
_handle = [] spawn {player globalChat "Hello world!"};
What does _handle mean? and why is there an underscore?
it says it's an argument but how can that be an argument
can i just put "true" there?
_handle is so that you can terminate the script later (terminate command) or check if it has been finished running (scriptDone)
if im not using the terminate command do i just remove it
yeah just do arguments spawn {...code...}
but then you won't be able to terminate it ever
...because you don't know its handle
well, unless you exit it in the code you ahve spawned
okay in my case should i leave it there?
because im a bit confused, doesnt it terminate after it reads the script
oh also i want to make it loop so i should remove it?
when your while loop breaks, the script will terminte itself, because there won't be anything else after to execute
well If you say that you do not intend to use scriptDone or terminate, then you don't need to store the handle, so you can ignore it
okay spawn command worked i think
do i now put it in the while loop
because it's not looping
nope, you wrap the while loop with the spawn
this allowDamage false;
this spawn { // creates a "parallel code"
while {alive _this} do {
_this disableAI "ALL";
sleep 3;
_this enableAI "ALL";
sleep 3;
};
};
// init will end immediately after spawning, but spawned code will still run
nope, you're learning ^^
better look like a fool for 5 minutes for asking,
than act a fool the rest of your life 😄
well yeah 🙂
I'm confused
What's the command for skipping an element in forEach loop?
Like, if a condition is fulfilled, I want to skip the rest of the function and tell the execution to move to next element in array
Commands like breakOut etc seem to just exit the whole scope
What's the command for skipping an element in forEach loop?
doesn't exist (yet)
just wrap it in a if statement?
Ah, ok
@still forum would you be on to something? 😋
I believe endme would be a perfect name 🤣
_gun = ["rhs_weap_m4_carryhandle", "rhs_weap_ak103", "rhs_weap_hk416d10", "LOP_Weap_LeeEnfield_railed", "rhs_weap_pkm"] call BIS_fnc_selectRandom;
_this addWeaponCargoGlobal [_gun,5];
if ((_gun == "rhs_weap_m4_carryhandle") OR (_gun == "rhs_weap_hk416d10")) then
{
_this addMagazineCargoGlobal ["rhs_mag_30Rnd_556x45_m855_PMAG", 2 +random 9];
};
what is the issue with this?
it doesn't work
oh addWeaponCargo is for vehicles
what command should i use instead of it
addItemCargoGlobal?
ok
for random loot spawn
addWeaponCargo would work for a box
_gun = ["rhs_weap_m4_carryhandle", "rhs_weap_ak103", "rhs_weap_hk416d10", "LOP_Weap_LeeEnfield_railed", "rhs_weap_pkm"] call BIS_fnc_selectRandom; _this addItemCargoGlobal [_gun,5]; if ((_gun == "rhs_weap_m4_carryhandle") OR (_gun == "rhs_weap_hk416d10")) then { _this addItemCargoGlobal ["rhs_mag_30Rnd_556x45_m855_PMAG", 2 +random 9]; };
so this?
line returns!!
"box addItemCargoGlobal [item, count]"
exemple from BIS site
supplyBox addItemCargoGlobal ["optic_ARCO2", 10];
I guess it should be the variable name of the box
you did it?
yes
nice
well, it's one beggining
yes
I'm building up one small template for vehicle respawn module, and one trigger that checks if the two vehicles are inside, and if true, the setVehicleCargo is active at the two vehicles after respawning, and this is set to repeat.
init.sqf
[] call compile preprocessFileLineNumbers "functions.sqf";
functions.sqf
fnc_setVehicleName = {
params ["_veh", "_name"];
missionNamespace setVariable [_name, _veh, true];
[_veh, _name] remoteExecCall ["setVehicleVarName", 0, _name];
};
vehicle respawn module expresion field:
if ( isServer ) then {
params[ "_newVeh", "_oldVeh" ];
_name = vehicleVarName _oldVeh;
_newVeh setVehicleVarName _name;
missionNamespace setVariable [ _name, _newVeh, true ];
};
bargetruck is LCM3 (transport ship)
truck is GMC truck
trigger condition field:
bargetruck inArea checkAreaTruck;
truck inArea checkAreaTruck;
trigger activation field:
bargetruck setVehicleCargo truck;
and I'm getting one error but the mission works fine:
///RPT FILE///
Error in expression <ehicleVarName _name; missionNamespace setVariable [ _name, _newVehicle, true ]>
12:31:52 Error position: <setVariable [ _name, _newVehicle, true ]>
12:31:52 Error Reserved variable in expression
////PLS HELP///
_name cannot be any game command
if you try e.g player = 3 it will say nope the same
ask that one site, idk
by which magic?
I copy pasted the old script
¯_(ツ)_/¯
vehicle respawn module expession field:
if (isServer) then {
params [["_newVeh", objNull], ["_oldVeh", objNull],"_vehName"];
_vehName = vehicleVarName _newVeh;
[_newVeh, _vehName] call fnc_setVehicleName;
};
It was that old script @winter rose
on this site
player SetPos getMarkerPos "selectRandom [spawn_1,spawn_2,spawn_3,spawn_4,];"; I cant use this correctly
how are you supposed to write it
Q: say we have a definition,
#define WAIT_UNTIL_CONDITION(cond) waitUntil {cond}
Then we want to expand it,
WAIT_UNTIL_CONDITION(a && b && c);
I am assuming this would expand as waitUntil {a && b && c} ?
Thanks...
@modest temple
player setPos getMarkerPos selectRandom ["spawn_1","spawn_2","spawn_3", "spawn_4"];
Hello,
Making a template tool in the editor. having a hard time getting Zeus modules to play nicely.
Entities are setting up correctly, however the module settings aren't being set.
https://github.com/56curious/VKN_Official_Mod/blob/master/VKN_Functions/Functions/fn_missionTemplateTool.sqf This is my code.
Are all vanilla modules setup to utilize set3DENAttribute or will I need to edit their configs to make them work?
is it possible to make all classnames of a specific vehicle spawned non rearmable? asking because im trying to add thermonuclear weapons and want them to be one shot only
@tough abyss you could remove any rearm truck?
@winter rose that would be despised by 90% of players on warlords
Hehehe :p
👀 still on my grand quest of finding out how to do that AND blacklist arsenel assets, which is proving more difficult than i thought it would
Q: re addPublicVariableEventHandler, does not seem to be working. testing a MP mission on a local hosted instance. the only thing I can figure is that perhaps the event is "seen" as being sent/received by the same machine, which it is, and effectively getting dropped. how do we overcome this?
Hi,
i'm trying to prevent to put items into a specific container with putItem EH but don't work.
if (typeOf _container isEqualTo "Box_Wps_F") exitWith {false};
Do you want the container to be opened?
If you don't use InventoryOpened eventhandler
The container have to be openable for pick up items.
Well this makes some amount of sense, I suppose. Since I am self hosting / debugging the MP mission, it is both isServer=true as well as isDedicated=false. So, as I wondered, publicVariable in fact does nothing. Or it tries, but I am not connected as a true client in the client sense of the word.
yep, always have in mind that a server is not always dedicated
Does addPublicVariableEventHandler support more than one callback?
it says add not set right? so yes, it just adds a additional handler
I'm currently experimenting with a script to practice SQF. One thing I do not understand is that when I call the script, it is called four times since systemChat str count _this shows the value 4. Any idea why _this has 4 elements when called?
it is called four times
what?
_this contains the arguments that you passed
or the _this variable from the parent scope
it has nothing to do with how often its called
I have some complex functions which called with remoteexec(call), like [_veh,OT_fnc_engine] remoteExecCall ["call",2]; As I understand, it means it has to be executed only on a server. But clientowner command returns 2 for my player (host in local MP). Does it mean that the code will be executed on my PC too, {and how to avoid it}?
Ok, that makes _this more understandable. Is there a way to tell where the four arguments are coming from?
@unreal scroll if you're the server (in local mp you are the server) then executing on the server executes on you. Use -2 if you wanna execute on all clients, but not on the server. To fix this issue use a dedicated server.
In Overthrow mod on dedicated server I have a "general" player, which gets a serious perfomance hit comparing to other players. I assume some code is executed on it too.
Also, please don't do this: [_veh,OT_fnc_engine] remoteExecCall ["call",2]; making call available for clients is basically suicide, you are letting all clients execute any code on the server.
Do something like this instead: [_veh] remoteExecCall ["OT_fnc_engine",2];
If the mod is running on a dedicated server then there shouldn't be anyone with owner id of 2, it should only be the server. In MP hosted from the game client itself, the host prolly has client id of 2, meaning calls to the server would be executed on the host client.
Hi
Anyone know how if it's possible to transfer ground items to a container?
you would detect "groundWeaponHolder" with a nearObjects command, and get their content by e.g getItemCargo @tough abyss
You could get the existing items from the weapon holder with weaponCargo and itemCargo and then add them to the new container with addWeaponCargo and addItemCargo
also check the global versions of those commands for MP
Thanks for ur help
@plain current ninja'd
The itemCargo wiki page doesn't mention weapons, that's why i put weaponCargo separately, but addItemCargo page says it supports weapons too, so i'd assume itemCargo would return weapons as well?
getWeaponCargo would get them yes
well, weaponCargo too
when did all these commands appear? 🙀
I edited it, typed it wrong ^^ itemCargo might return weapons too
@smoky verge so basically an infinite tunnel for ~100m?
within viewlenght techincally,
singleplayer
I'm using this modular tunnel mod that is quite perfect for the job https://steamcommunity.com/sharedfiles/filedetails/?id=1682981940
What does it do, and what do you expect it to do?
This should make civilians afraid of west. If you want west to attack civilians, do it the other way around @modest temple
Hello, is there a way to return all entity attributes using https://community.bistudio.com/wiki/get3DENAttribute
I couldn't find anything (yet?) but the full list of attributes here nevermind
https://community.bistudio.com/wiki/Eden_Editor:_Scenario_Attributes
@brave jungle
yep, realised that too late -__-
But even tho
you can use https://community.bistudio.com/wiki/collect3DENHistory to go through all attributes, which you then can put in an array
Guess I was wrong... it only allows you to SET multiple attributes in one go, not retrieve them...
The list by BI doesn't have everything
Zeus modules for example
you can set them up
I have looked into the cfgs
tried a variety of options and nothing seems to work
@exotic flax I'll have a look
This is what I use currently https://github.com/56curious/VKN_Official_Mod/blob/master/VKN_Functions/Functions/fn_missionTemplateTool.sqf#L98
But it doesn't do anything
the cfgs lead to an object name, "all" as a string and forced a number bool
https://imgur.com/a/cweSbyR - example showing forced
Unless i'm wrong
I reckon it's predefined and ignores cfgs
better luck in #arma3_gui @tough abyss
no problem, close enough ^^
Is there a way to change the magazine reload time without modifying the config? I'm only aware of setWeaponReloadingTime, which is however for the ammo reloading time.
@winter rose if you do it the otherway around its clitchy
West just points guns at civs but dont actualy shoot
i want civs to be hostile so i can have players be able to pick up any uniforms in my survival sandbox
had this issue too @languid tundra, except that i wanted to get rid off reload time completely, it works. However, i don't think there's a command to do what you want though.
Second option specifically does
both do
if you are renegade it breaks groups
also doing pardon in ACE would break it
these are the only options you have in this game afaik
are there other ways to group than the normal group? like in scripting?
Why not just mod the uniforms to achieve what you want?
i have never packed addons and im trying to see if i can script around it
Always a first time to send you on the path to the Dark Side
@copper raven Actually, I also wanted to get rid of it for a possible VLS module. The long reload time makes it really unresponsive to users.
The only solution i found is, removing magazines and the weapon from a certain vehicle, then, adding magazines back, then the weapon. This gets rid off reload time for those magazines.
Hmm, I'll give it a try. ArmA was always about hacky solutions, especially when working with AI 😅
I had to do this, because tigris normally has 2mags of 4x titan aa, so if i wanted it to have 1 mag only without the hacky stuff above, the gunner would have to wait a pretty long time, before he could shoot.
@copper raven Thx, it works nicely. Noticed that it is essential to add back the magazine before the weapon to get it working.
yea, adding the magazine after the weapon, kicks in the reload time again, np.
@smoky verge on it 😉
you're probably doing more than me
@plain current
itemCargo might return weapons too
Items (first aid kit, map, watch) are weapons.
does anyone know of a script that replaces CUP Chernarus houses with their Enoch counterparts? I know there are addons that do this but I would like to integrate it into a mission
I'm sure it's possible to script it, but it will kill the server and clients due to how heavy it is.
The mod simply replaces the configs and won't impact at all
Basic Arma3 powered by BI https://community.bistudio.com/wiki/Arma_3_Revive Revive System
I want to make it invincible when the player is incompetent.
It looks like your system doesn't have that feature.
use allowDamage combined with lifeState @craggy bluff
Q: what do SQF functions return when they return "nothing"? is that nil?
yes
depends on what kind of "Nothing" you mean
can you show me a example of a SQF function that returns nothing? Besides a completely empty function, these do indeed return nil
_result = call { hint "hey there" };
_result should now be "Nothing", but valid
although I can't think of a reason to check if a result in this case should be checked for anything
what do SQF functions return when they return "nothing"?
that function you posted doesn't return nothing though, it returns what the hint command returns, which in this case is nil
thats my point, what is considered "nothing"
if "nothing" means a script that isn't intended to return anything special, then you can't say what it returns, depends on whatever command it executed last
if you mean a script that returns literally nothing, aka nil, which we usually call "nothing" then.. yes it returns that
objNull 😉 ?
unless a script ends with a = assignment, in which case it literally doesn't return anything and assigning the result will error
still bit confused with use of enableRadio, enableSentences and setSpeaker
enableRadio is basically for cutscenes and PvP only if you want to disable radio messages completely (protocol and convos) - text and voice (radio or direct/3d) - does not affect player chat (text or VON) (done via enableChannel or disableChannels in desc.ext - somewhat bugged tho)
enableSentences is for SP/COOP if you want to keep kbTell convos (wont mute all automated radio call outs though - bug?)
_unit setSpeaker "NoVoice" is if want to disable radio protocol (text and voice) - most reliable way one
custom mute mods if you only want to disable the audio/voice part of radio protocol
for MP you need to execute setSpeaker with delay and on all entities (players and AI) on all machines
{_x setSpeaker "NoVoice"} forEach allUnits;
[player,'NoVoice'] remoteExec ['setSpeaker',0,(format ['disableSpeaker_%1',profileName])];
and needs to be reapplied on respawn:
player addEventHandler ['Respawn',{[player,'NoVoice'] remoteExec ['setSpeaker',0,(format ['disableSpeaker_%1',profileName])];}];
hey guys i was just wondering if there was a script that would prohibit certain AI from firing at certain things
i'm making this Jakku battle in the game with the star wars opposition mod and the BLUFOR soldiers keep trying to shoot at the enemy turrets in the sky instead of the enemy on the ground infront of them
any scripts that would make this possible?
thanks in advance
constant forgetTarget. but probably requires config mod
disableAI "RADIOPROTOCOL"? @velvet merlin
@unique sundial thanks! so thats basically same as _units setSpeaker "NoVoice"?
No
"RADIOPROTOCOL" - Stops AI from talking and texting while still being able to issue orders Available since Arma 3 v1.95
isnt this the same?!?
same "outside" effect I suppose
i guess no as NoVoice allows AI to output text messages
This command was added because there were some inconsistencies/problems with doing it with available commands
noVoice + enableSentences maybe
@unique sundial allow in what sense? NoVoice uses RadioProtocolBase which has only empty classes and assignments. so not just the voice files removed like the said mods do
that aside i easily believe existing solutions had some loopholes, so the disableAI is a good addition. would be just good to exactly understand the differences - hence my testing and summary in here.
I dont remember exactly, maybe AI was still reacting to getting hit with hardcoded interaction, or something to do with orders the text might have appeared. I don't remeber and TBH I don't want to remember, whatever was the problem, you can avoid it by using new command., end of.
ok thanks. will do some testing and update the BIKI
nato vehicles sochor (weapon mine remove)
What is the way?
@winter rose I didn't understand.
I want to remove the mines from the sochor equipment.
it has mines in the inventory? clearItemCargo or clearMagazineCargo then
@winter rose That is not what I want.
Missile Type: Mines sochor
removeMagazine?
removeMagazine
https://community.bistudio.com/wiki/Arma_3_CfgVehicles_EAST for a list of magazines classes @craggy bluff
yes thank you
Hey guys. Just wanted to ask if anybody had a simple snow fall script that you can use in the debug console?
Yep I do. But no access rn.
I think google for "simple snow script" and check the A2 BIF thread for it, in the last post in the thread there should be a improved A3 version
Nah can't find it... Maybe I'm mixing that up with he breathing fog script
@orchid timber has the snowfall.sqf tho. Maybe he has some free time to waste to grab it
The only thing I don't like about these environmental ambiance scripts (dust, snow, etc) is that people complain about how it impacts on their performance, and doesn't affect enemy AI in any way...
If you use the good scripts you don't feel the perf impact. But AI yeah. But my snow script also causes dense fog, which does impact the ai
That's a good point, though Bohemia's implementation of fog... if you don't finesse the settings, you get the weird banding
Particle effects should be local to player, and if AI runs on the server, it won’t know
Well exactly, unless you use fog to create a blanket visibility restriction as well
as smoke is blocking AI vision, you should be able to do so too
however more meaningful is to use camoCoef
How to make a make a specific crate spawn specific items every 5 mins want to have special purpose gear inside but not alot at once so everyone just dosnt have the ability to take one immediately
do you want to… restrict its access?
In a sense yes
Basically its a warlords mission cant figure out how to restrict normal arsenel so i removed it and put down two virtual arsenels in both teams bases
Im going to have 2 sectors that spawn a box with special purpose gear and ghillie suits and it gets one of each every 5 mins
nvm i got it the script i made formyself was fine, i was overthinking the error i made and thought my script had 0 logic behind it when all i missed was an ; :C
-showscripterrors flag! :U
Yeah I just wanted some snowfall. The snowstorm is a little bit too much.
@still forum
Guy. Help. How to change player name in TFAR channel. In what file can this be changed
@fleet hazel quit tagging people please, the channel is for answering scripting questions
ok.
Help. How to change player name in TFAR channel. In what file can this be changed
and don't multipost 😁
is this a #arma3_scripting or a #arma3_config issue though? (I genuinely don't know)
How to prevent a whole classname from being able to rearm. Putting a script inside the innit wont work because warlords will spawn a new one without the innit. So im thinking i may need to use the classname and disable rearming in a new .sqf but not sure how to
just use CBA_fnc_addClassEventHandler
["CAManBase", "Init", {systemChat str _this}] call CBA_fnc_addClassEventHandler;
okay ill try it thanks
That's a scripting issue. But not with that attitude.
i feel like im not understanding something extremely obvious 🤪
Is it bad to call spawn inside of a spawn?
Like how would that work with the scheduler?
I'm creating an op for the Star Wars mod, and i'm trying to have a spaceship "warp" into the map
i think the best method to do it would be to use setVelocityTransformation, but i cant wrap my head around how it works
I need to unhide it, and have it move fast in a straight line and slow down to 0 which should be simple enough?
Is there a similar functionality to continue in c# for sqf? I could wrap my entire code in an if statement but it'd be cleaner to write my condition and then skip that iteration in the for loop
@tough abyss it pushes a new script onto the queue the same way. How bad it is, depends how clogged your scheduler is, and what the code does. The only reason you would want to do that is, if you wanted to run something in parallel to the current scheduled script.
@tiny wadi nope, is going to be added i think tho, was somewhere mentioned in this channel. wrapping into an if is the way to go atm.
rgr thanks
Would it be possible to emulate a min-heap in SQF?
looking for a way to reset damage done via ACE Advanced medical
I cant seem to find the correct function to call
@ornate prairie no Star Wars mod talk / mention here, as these mods are illegal.
Would it be possible to emulate a min-heap in SQF?
What?
@tiny wadi With https://community.bistudio.com/wiki/set should be possible. But you should just use https://community.bistudio.com/wiki/sort and be done with it.
@tiny wadi same way as it is done in non sqf Environment
yeah after going to bed I realize that was a dumb question lol, thanks though. Sort wouldn't work for me because i need to do it based on a cost function for each element in my array. its not based on indecies
Although I guess I could move my cost variable to the first element of the array and then use sort
sharp_fnc_orderBy = {
params [["_array", [], [[]]], ["_order", false, [false]], ["_selectorFnc", {_x}, [{}]]];
private _mapped = _array apply {[call _selectorFnc, _x]};
_mapped sort _order;
_mapped apply {_x select 1}
};
//Example
private _array = [[1, 2, 3], [4, 5, 6], [1, 2, 3]];
[_array, true, {_x select 1}] call sharp_fnc_orderBy // [[1,2,3],[1,2,3],[4,5,6]]
Have some problems with dedicated server. I want local garrison soldiers to launch flares on specific condition. I use the following code: ```private _me = player;
private _visibility = 1500;
private _men = (_me nearEntities ["Man", _visibility]) select {side _x isEqualTo west && {(_x distance _me < _visibility) or ((_x distance _me < (_visibility * 3 / 2)) && random 100 > 80)}};
private _leaders = ([_men,[_me],{_x distance _input0},"ASCEND",{handgunWeapon _x isEqualTo "LIB_FLARE_PISTOL" && {_x ammo "LIB_FLARE_PISTOL" > 0}}] call BIS_fnc_SortBy);
if (count _leaders > 0) then {
private _leader = (_leaders select 0);
_leader selectWeapon "LIB_Flare_Pistol";
private _dir = _leader getdir _me;
private _target = "Land_ClutterCutter_small_F" createVehicle (getPos _leader);
private _coord = [(getpos _leader select 0) + (50 * sin _dir), (getpos _leader select 1) + (50 * cos _dir), 150 + random 50];
_leader disableAI "MOVE";
_target setPos _coord;
_leader doWatch _target;
_leader doTarget _target;
[{
params ["_leader","_target"];
[_leader, "LIB_Flare_Pistol"] remoteExecCall ["fire",0];
_leader enableAI "MOVE";
_leader doWatch objNull;
deleteVehicle _target;
}, [_leader,_target], 8] call CBA_fnc_waitAndExecute;
}; It runs perfectly in local games, but when playing at dedicated server, the unit doesn't look up at the created target, and launches a flare straight before it. I can guess that one of the command doesn't work correctly in MP, but I've tried[_leader, "PATH"] remoteExecCall ["disableAI",0];
[_leader, _target] remoteExecCall ["doWatch",0];
[_leader, _target] remoteExecCall ["doTarget",0];``` with no luck.
Tried BIS_fnc_fire?
Not yet, will try.
@covert crow #arma3_config
How to add a .sqf file that changes the ammo of all vehicles of a classname?
If you have CBA, use XEH https://cbateam.github.io/CBA_A3/docs/files/xeh/fnc_addClassEventHandler-sqf.html
@copper raven im not too understanding of scripting i read that link and im still not understanding completely what its saying. Can i pm you my issue