#arma3_scripting
1 messages · Page 546 of 1
is say3D broken?
WHen I try to play my ogg, it's all garbled and the .lip doesnt seem to work
most likely corrupt
when you say "garbled", some sound comes out or not?
yes, but it sounds really quick and misses chunks
should I try a specific sample rate/format
ah! which unit is saying it?
Ogg is just the container format, so maybe try saving it with a different codec also if nothing else works.
yeah but, a soldier or a virtual entity?
an actual unit
can you playSoundit?
just noticed I was set to 96000 sample rate, let me try bouncing it down to 44.1 and trying again
yyyup
Does Arma use 44.1 or 48k?
44 iirc, but I might be wrong
Wait what... it's not in the biki 😿
all I found was https://community.bistudio.com/wiki/Multiplayer_Custom_Sounds_Tutorial
44.1
@cosmic lichen for biki maintainer STAT!
yeah, let's all blame R3vo for the lack of wiki!
Wait... what 🤣
I am disappointed that you have not memorized every biki page by now... what else do you have to do? I mean...
one less responsibility on my shoulder @restive leaf 😄
weird when I try playSound it says sound not found
something wrong somewhere ¯_(ツ)_/¯
Oh nvermind it works with the class name, but not with the name = name
sound is fine
What's the name = ""; used for?
okay
it's funny you even had a sound.
I actually had it correct in my addAction
but yeah, playSound is 100% fine, say3D or say2D is the glitchy audio
oh huh, I deleted the .lip file and now it works
but the lip syncing obviously doesnt
does your unit have… an identity?
I had a crazy issue about sound that would randomly accelerate/slow down/Mickey Mouse voice ; deleting the .lip or reencoding sometimes made it better, but on some other occasions it went off again.
The thing was: I created a Logic to be "HQ", but you have to set an identity, else it is randomly decided… and the pitch with it!
He's placed through editor
then… that shouldN'T be the issue 😄
Lets see what the chsnces are I get kbTell right the first time
well at least that works
weird that .lip works fine for kbTell but not say
@radiant needle kbTell automatically uses setRandomLip if no valid lip file is found
Is Fired/FiredMan EH supposed to fire on placing of C4?
I would say "yes", but testing would be required to be sure
It's the "put" weapon that is used. Same for grenades with "throw"
Why @tough abyss?
no throw triggers FiredMan and Fired
I think placing of C4 used to trigger those EHs too
not anymore
oh, ok
Placing of mines as well cannot be detected now
Must have got broken when the mine detection and all that crap was tweaked
and the "put" EH is about placing items in ammobox, not using mines/placeables
I would say it is a bug that needs to be reported
Need confirmation that it was working before
It was, check the forums for "mine placing detection", this EH was used
Just tested it is working in SP for me but not on dedicated
(sorry to ask but) did you mind the locality well?
Ok found the problem
if you give yourself backpack in arsenal and add c4 in it, it never triggeres the event handler, but if you spawn explosive specialist, it does
how weird
Hmmm… weird indeed
I accuse you of inventing problems!
little help plz https://pastebin.com/07kcXj86
script to long to fit in chat
nothing is happening
when i test it
nvm im just a facking idiiot and forgot to save it as an sqf XD
Ah ok. You may want to drop the global vars and just either pass the array through the spawn or just do it in the spawn. No reason to not have private variables there.
yeah im also getting an undefined variable error at line 40
line 41 undefined variable in object mapper
would the manned aa units be causing this
sigh fixed it objectsMapper not objectMapper
@finite dirge thanks for the help
I guess it might fall under here too
is there a quick command to render all objects on the map as editable by zeus?
https://puu.sh/E6yV9/c4e50b5595.png i found this in the mission file but it doesnt seem to be doing anything
What's the best way to compare to multiple values? Basically I want Code A if var is == 100, Code B if var is < 100 && >= 50, Code C if var is < 50, etc
and if all are true you want it to be true and if one of them fails you want to return false?
@dim kernel You need to add headers as separate controls
private _grp = createGroup sideLogic;
"BIS_fnc_moduleCurator" createUnit [
getPos player,
_grp,
"this setVariable ['BIS_fnc_initModules_disableAutoActivation', false, true]; this setVariable ['owner', '#adminLogged', true];"
];
not really sure if this would actually work
What would be the best way to have an event occur every hour of in-game time?
Hi all,
I'm trying to disable the popup targets with
{ _x addEventHandler ["HitPart", {(_this select 0) select 0 animate ["terc", 1];}]; } forEach _allTargets;```
But executed on server-side or on Client-side, it doesn't work 😦
It works in local hosting
But not on Dedicated server
Hitpart works only where shooter is local. Also you are not disabling anything in that code
@tough abyss okay so this EH isn't the solution
also, I know I'm not "disabling" anything ... just stopping the animation in a precise phase
{ _x setVariable ["nopop", true, true] } forEach _allTargets;
here you go
there is also "popdelay" variable you can use to set longer delay
What would be the best way to have an event occur every hour of in-game time?
make extension callback every hour
@radiant needle sqf [] spawn { while { uiSleep 60 * 60; true } do { // something }; };
could be 1 hour 17 minutes for what we know
@tough abyss adapt to your public
not a fan of having scripts sitting in scheduler for very long
also, I don't know if uiSleep skips the same as time
it's not affected my accTime if that helps
@quartz coyote doesn't 😄
uiSleep is supposed to be the "real time", the game being paused or not. I don't know if it is affected by a "scheduler skip", that happens when the scheduler is overloaded and a simple sleep 1 can be transformed into a "wait 30s"
yes that's what I said... uhm 😄
Both can take more time if scheduler is overloaded.
One is just "sleep in simulation time" and uiSleep is "sleep in render/real time"
there are many things that are "supposed to" but don't in Arma as well as "not supposed to" but do 😂
weeeeeell, it wouldn't be Arma without these!
Though, my head is still full of hair and that's my pride 😁
once you learn to control the rage
private _grp = createGroup sideLogic;
"ModuleCurator_F" createUnit [
getPos player,
_grp,
"this setVariable ['BIS_fnc_initModules_disableAutoActivation', false, true]; this setVariable ['owner', '#adminLogged', true];"
];
got zeus module spawning to work yay
I kinda feel stupid. I fill a combobox with data and afterwards try to get it again. In the logging you can see that there is no data inside of it. I doubled checked the doc for the lbSetData command. I think I use it the right way.
Anyway this is the (un)logic:
lbClear _rolesCombo;
{
_rolesCombo lbSetData [_forEachIndex, _x select 0];
DEBUG3("data set index %1: %2",_forEachIndex, _x select 0);
_rolesCombo lbAdd (_x select 1);
} forEach (call coopr_fnc_getRoles);
DEBUG2("data get index 0: %1", _rolesCombo lbData 0);
DEBUG2("data get index 1: %1", _rolesCombo lbData 1);
Logging:
11:49:36 (0:27:22) [Server] COOPR.LOBBY.debug - data set index 0: Groupleader
11:49:36 (0:27:22) [Server] COOPR.LOBBY.debug - data set index 1: Medic
11:49:36 (0:27:22) [Server] COOPR.LOBBY.debug - data get index 0:
11:49:36 (0:27:22) [Server] COOPR.LOBBY.debug - data get index 1:
I guess it's a stupid mistake I can't see cause my focus is too narrow already 😄
coopr_fnc_getRoles returns [["Groupleader","Groupleader"],["Medic","Medic"]] (don't mind the double wording in the array - that is on purpose)
@south bloom you are already executing setVariable on every PC and JIP by placing it in that init expression, there is no need to also make it public. You are creating network nightmare by doing that
not to mention that when JIP joins it will overwrite the current value and set it to default everywhere. This is awful way of coding MP
Try this instead
private _cur = createGroup sideLogic createUnit ["ModuleCurator_F", [0,0,1], [], 0, "none"];
_cur setVariable ['BIS_fnc_initModules_disableAutoActivation', false, true];
_cur setVariable ['owner', '#adminLogged', true];
@frigid raven so you set data on non existing row then you add the row, pretty cool
oh I see
You might want to read wiki on lbAdd and what it returns, and what lbSetData takes as index
So first lbAdd has to be called
what I said above
having a bad day buddy 😄 ?
Sorry I forgot I should ignore you 😂
DrArma 🙄 😒
@tough abyss ah thanks i have 0 experience with arma scripting :v
that looks waaay cleaner tho
where can i find a list of classNames?
@waxen tendon what kind of classnames do you trying to find?
vehicles?
it might be the helpful to you
@waxen tendon this? https://community.bistudio.com/wiki/createVehicle/vehicles
classnames of SimpleObjects
yes all those classnames in vehicles can be created as simpleObjects
ah yes, didnt notice that, thanks!
_listChangelog ctrlEnable false;
remove color text listbox
solution?
I need to not click on the list
_listChangelog ctrlShow false;
``` ?
this hide....
I have a lot of units, variable: un0, un1, un2, un3, un4, un5 ...
how to find them and add them to an array?
un + index?
You could do that too
call compile format ["myArray pushBack un%1", index]
_allSimpleObjects = allSimpleObjects[] ;
_allHelipads = _allSimpleObjects find "helipad" ;
{call "tripleR.sqf"} forEach _allHelipads ;
```this works?
no
you have four errors:
allSimpleObjects**[]**
find
nothing call "tripleR.sqf"
call "tripleR.sqf"
I am on mobile, I cannot write the solution easily but please look up the wiki to know how these commands work
allSimpleObjects[]
not an error
find
not an error
nothing call..
not an error
call "tripleR.sqf"
error
@tough abyss here will help you @waxen tendon
@waxen tendon what is "helipad"? is it a class, it is a variable name, what is it?
variable name
https://community.bistudio.com/wiki/allSimpleObjects @Example2 says _allSimpleObjects = allSimpleObjects [];
Yep, my bad on this one. allSimpleObjects [] is fine.
If you know the helipad classname you could use it here
you can get object by simply getting the value of "helipad"
_helipad = missionNamespace getVariable ["helipad", objNull];
if (!isNull _helipad) then { _helipad execVM "tripleR.sqf" };
you cannot have multiple objects with the same variable
ok
thanks
Yeah, i get it now
previously when i asked how can i search stuff without writing a searching algorithm from scratch i got answered find
i.e i want to find all helipad* objects
i guess i cant do that
is there a function for that
you can but it will be awkward with simpleObjects
You can try
{ [missionNamespace getVariable _x] execVM "tripleR.sqf" } forEach (allVariables missionNamespace select { _x select [0, 7] isEqualTo "helipad" });
thanks! @tough abyss
i am having some problems packing a bunch of missions into a mod. They dont show up under multiplayer after I loaded the mod. I am sure I am overlooking something basic. Is there any open source projects on github that does this so I can have a look?
Basically I am tired of manually update all 14 missions through eden everytime I fix a bug, so I want to pack them up in a mod.
Hello. I need some help with a simple script that detect a set of clothes and replaces the textures of said clothes. Problem is that I don't know how to refer to these AI in the script. if((uniform _x isEqualTo "U_I_E_Uniform_01_shortsleeve_F") || (uniform _x isEqualTo "U_I_E_Uniform_01_F")) then { _x setObjectTextureGlobal [1, "\A3\Characters_F_Exp\Syndikat\Data\U_I_C_Soldier_Para_1_F_2_co.paa"]; _x setObjectTextureGlobal [0, "\A3\Characters_F_Exp\Syndikat\Data\U_I_C_Soldier_Camo_F_1_co.paa"]; };
The "_x" being the AI in question. This script works fine on players if "_x" is changed to "player". I just don't know what I should use so it replaces the AI's textures instead.
Any help would be appreciated.
forEach allUnits?
@winter rose call compile format ["myArray pushBack un%1", index]
seriously? getvariable??
@still forum OFP old-school, boiii 🤟
@winter rose Where would I put foreach allunits though? Thanks for the reply btw.
huzzah i did it i made a set of scripts that allow you to split a rifle squad in half add them to high command and have them join again later HUZZAH
now i can use actual fire team tactics
and the other team will have some what of a brain
@twin steppe
{ /* your code*/ } forEach allUnits;```
im actualy quiet proud of my little fire team script
i managed to get it working by myself
@winter rose Appreciate the help. Worked like a charm.
player setPos (getMarkerPos "RALLY_RED")
What to do if I want to increase the z axis of the postion to 2500
Store the marker pos, use the x and y positions, then use 2500 as z in an array
player setPosATL ((getMarkerPos "RALLY_RED") vectorAdd [0, 0, 2500])
setPosATL should be your choice actually.
Fixed.
Thanks.
wasd with AI in driver seat isnt working in multiplayer?
depends on the role you have. If you are gunner or commander, yup, only passenger, nope.
My project was always a mission, now it's turning into a mod since i'm in need of original content. Where can i begin to understand how to create new classnames for building objects and magazines? Thanks!
I plan to create food objects as magazines.
And other things, like a ceil building object.
First of wrong channel. Check out #arma3_config and #arma3_model for your new assets. But why do you wanna add a food object as a magazine?
so it goes into the inventory I suppose
not even gunner/commander is working
specifically on prowers and qilons @winter rose
Strange.
If he's using Epoch then food items have to be derived from CA_Magazine to be usable... Same with some other mods I think
I had to provide new definitions (with permission) from MattAust for his Australian food and drink for an Epoch Australia server back in the day
But on rereading he is creating his own mod... so maybe so he gets the count class variable in a magazine?
Is there a way to use -filePatching with an absolute path or does the addon have to be inside the "Arma 3" folder? Creating a shortcut doesn't seem to work to trick ArmA into using another directory 😦
creating a shortcut will never work - but you can use symlinks instead
MKLINK [[/D] | [/H] | [/J]] Link Target
/D Creates a directory symbolic link. Default is a file
symbolic link.
/H Creates a hard link instead of a symbolic link.
/J Creates a Directory Junction. <---- that's what I typically use and it seems to work. Not sure if it's the correct way though...
Link Specifies the new symbolic link name.
Target Specifies the path (relative or absolute) that the new link
refers to.
(in the command line of course)
Nice that works
Is there a list of available materials somewhere
Do I mis-understand the purpose of addWeaponWithAttachmentsCargo? I thought it would add the weapon, "with" its specified attachments, to cargo - not add the weapon "and" it's attachments (aka one item in inventory not one weapon + one item for each specified attachment)
It creates the weapon with pre-attached attachments
The command was specifically created because that was previously impossible. If you want to add attachments into a container separately then you can do that.
Hmm okay must be an error in something I'm doing then. Because I'm not getting it created with pre-attached.
Thanks, I'll debug further
show me the line of code
There's no 'continue' command to skip to the next itteration of a loop without executing the statements after that continue command in SQF right?
oh I know I've done it in the past by simply making a boolean variable and checking for that after where I want a continue but it'd be much easier to just type continue; and not have to worry about it
I think I can push that forward, I'll put that on my list
that'd be nice, thanks
hey so
If I wanted to run a script that would add everything in the mission to the editable objects list for zeus
how'd i do that
so like
curatorModule addCuratorEditableObjects [[_allMObjects =allMissionObjects "All";],true ];
?
you never scripted?
curatorModule addCuratorEditableObjects [allMissionObjects "All", false];
Not really no, I'm just desperately trying to find a fix for zeus not working the way it used to
So then if I wanted to get it to check again every minute or so, throw in a sleep for 60 seconds or whatnot?
How it used work that it doesn’t work now?
So, the mission I have; modded warlords to have zeus for shits and giggles, and it would constantly track everything in the mission as editable objects and update it constantly
it doesn't do that anymore; it doesn't even register any objects as editable
I think there was an option somewhere in the editor with a checkbox to do just that but cant remembver
so i dont know if i have to have it scripted in now or what
You could only edit objects you put down with Zeus or objects you added to Zeus editable objects since always. Maybe you remember it wrong
Well whatever was going on it worked like that
and opening the mission file in the editor breaks it
so I don't know whats going on
The only way it can break mission when you open it in editor if you edited mission.sqm manually. If you did, then all bets are off.
Well, not break break it, just, it doesn't have the list of editable objects update every 60 seconds like it used to
but i've run every file through comparison tools and there's not a difference to be seen so my last bet was the script to do it
Sorry I don’t understand what you mean, forget I asked
https://puu.sh/E6YKu/300001d797.png this, what this guy was talking about. I cant find the setting in the editor anymore and wanted a script to replicate it
ah fuck i think i know what it was, i used to have 3den enhanced and forgot to install that. this is thepart of the mission file it kept removing
I dont know if that helps explain the issue or not
I can see that it is mission.sqm on the screenshot, hence you are on your own
well i got it working
Hello, i am trying to write a code that create a task, and upon tigger activation, it will show some text and create second task.
It seems that the create task part is successful, but it is like the trigger is not doing anything.
i use helipad invisible for taskLoc and SPY1 is the name for Lucy.
there is no script error shown when i ran it in MP
Even though you created trigger that is global the params you set on it are not, so it may activate on server but on clients it won’t. You can add your second task into onActivated statement if trigger no need for waitUntil it is activated, it is trigger after all, designed to trigger statement on activation
what do you mean by the params is not global?
sorry my scripting skill is pretty basic
For example if you look at https://community.bistudio.com/wiki/setTriggerStatements it has 2 icons AG EL which means you can apply this to any trigger object local or remote but effect E will be local, means effect will be applicable to server only since you execute it on the server only
Sorry I can’t help you more, just google locality
weird question
i actually understand about locality
What do you mean normal
i am trying to make a trigger that is only activate once on a server, should not i execute it server only?
because i used this execution before and it works well
You can’t control player default camera with cam commands
Means you created cam with camcreate
You can cancel effect to return from it
oh wait, i only used it for creating task before this, so i should seperate trigger creation for isServer command?
i mean, i dont need to use isServer for creating trigger
@tough abyss just one more question, if dont use isServer for trigger creation, wont the trigger get activated everytime a client triggered it?
_cam = "camera" camCreate [position player select 0, position player select 1, 2];
_cam camSetTarget player;
_cam cameraEffect ["internal", "BACK"];
_cam camSetPos [15492.3,698.813,15.0197];
_cam camCommit 6;
waitUntil {camCommitted _cam};
player cameraEffect ["terminate","back"];
camDestroy _cam;
justgiving me a general expression error
Theoretically, but you can’t just remove it and be done with it, your whole code needs to be adjusted to this as well as trigger should be created local in this case
CameraEffect expects camera for once not a player
I am somewhat understand locality, its just i am not sure whats go where
Thanks @tough abyss i will try adjusting the code
this doesn't make any sense
is there an issue with the actual BIS function?
nevermind
im using integer for a boolean
🤔
¯_(ツ)_/¯
Always blame BIS first
pmsl
hey @tough abyss i have a question
my shot seems to be going on forever
would you happen to know why that is
Shot?
Open it up in notepad or function viewer and see what it does
Then open the code in notepad or the function viewer and see what it does to do that
Hey! Is it possible that directChat command doesn't exist despite all others?
We have groupChat, sideChat ...
is there anything similar?
You approach the NPC, select some action on him, he "replies" in old RPG style games
Voiceovers are too expansive...
(in terms of creating them)
hint or theres some other thing that pops up text on the screen
cant rememeber what it was
something to do with cutscenes maybe
dont think theres much options really
kbTell
https://community.bistudio.com/wiki/BIS_fnc_showSubtitle
Though they are kind of awkward without sound.
kbTell is voice-over isn't it?
Yes.
and subtitles.
Don't need to have a voice file so far I know. But ask @winter rose Master of awesome voice acting 🙂
haha thanks @cosmic lichen 😄
You don't need a sound file to use kbTell, even though it might trigger a warning in the logs (that I am not sure)
You could also create a custom channel, or use globalChat (which is local) - you would only have "CIVILIAN" as speaker's name though
What is the difference from ctrlAddEventHandler and ctrlSetEventHandler?
One keeps alive after the control is closed, the other dies when control is closed?
set is not stackable, add is stackable
when using setTriggerStatements, do i need to put (') on the beginning and end of every command? or just put those multi commands in a single set of (')?
i think i have a bracket problem
{
switch (_variant) do
{
default { _pylons = ["PylonRack_12Rnd_missiles","PylonRack_12Rnd_missiles"] };
case "HellcatGun": { _pylons = ["",""] };
case "HellcatAA": { _pylons = ["PylonMissile_1Rnd_AAA_missiles","PylonMissile_1Rnd_AAA_missiles"] };
case "Hellcat20MM":
{
_pylons = ["PylonWeapon_300Rnd_20mm_shells","PylonWeapon_300Rnd_20mm_shells"];
_customCode =
{
_veh setAmmoOnPylon [1, 1200];
_veh setAmmoOnPylon [2, 1200];
};
};
};
};``` Has stopped working after one of the recent updates (Can't be specific, noticed it stopped working in the past 30 days. What in the code has stopped working and is no longer supported?
Before if a player chose the Hellcat 20mm they'd have the 2400 rounds as indicated by _veh setAmmoOnPylon, however that stopped working. They spawn with the default amount which is 600 rounds (2x PylonWeapon_300Rnd_20mm_shells)
commands like setAmmoOnPylon, setMagazineTurretAmmo are now capped to the magazine ammo count, appereantly "a measure against cheaters"
Well, that's no fun. It really limits the customizability for our servers.
Bohemia should at least list those as "deprecated" on their documentation website.
Is there any way we can bypass that?
You mean the wiki maintained by the community?
Perhaps, I'm looking at this in particular: https://community.bistudio.com/wiki/setAmmoOnPylon
Anyways. I'd love to know if there's a way to bypass it. For our game mode and style, default pylon values are really wack.
Hmm, would adding multiple magazines actually do the trick, you guys think? So say instead of the above, could have 3 magazines of 300 rounds for each pylon, which would then result a total of 2400 rounds.
Yea, its all about playing with magazines now
Would've been great to have it as a server side setting atleast, really sucks to get capped
Yeah.
It drastically affected us because a lot of our premade loadouts that are made available in a in-game vehicle store got suddenly changed. So it greatly affected the balance that we wanted and visualized on our server. Especially when we run a wasteland server that has 80 players on it every day.
Thiscode = {systemChat "A";} codeArray = [code,code,code,code,code]; uses less resources than thiscodeArray = [{systemChat "A";},{systemChat "A";},{systemChat "A";},{systemChat "A";},{systemChat "A";}];?
When I'm using private _variables do I need to consistently refer to them by private _variable as opposed to _variable?
Example:
private _role = assignedVehicleRole _x;
if (private _role select 2 == "Cargo") and. . . .
i cant enter zeus after respawning, how do i solve this?
my description.ext
respawnButton = 1;
respawnDelay = 5;
respawnVehicleDelay = 20;
respawnTemplatesWest[] = {"Counter"};
respawnOnStart = 0;```
and i t doesnt even show my time counter when respawning
@mortal wigeon you normally use private keyword once when defining the variable for the first time
@grave stratus respawn is either number or string with the name, not string with the number https://community.bistudio.com/wiki/Description.ext#respawn
it is said here https://community.bistudio.com/wiki/Arma_3_Respawn#Respawn_Types
Type is represented either by respawn ID, or by its name.
i have changed it to BASE and my respawn works fine now, but it still doesnt solve my issue of not being able to enter zeus after respawning.
How can I detect if a number is even or odd?
Right now I'm using this to detect even/odd of _index:
if (round (_index / 2) == (_index / 2)) then {_door = 1;} else {_door = 2;};
Which works, but seems really clunky.
but still the zeus thingy still not solved
Guys, anyone knows if triggerAmmo needs ammo to be local?
@mortal wigeon ```sqf
["Odd","Even"] select (_index % 2 == 0)
@grave stratus no crossposting (#rules), please delete in #arma3_scenario
sorry @winter rose i didnt know where this zeus problem need to go to.
#arma3_scenario would've been the correct channel already. Your stuff has nothing to do with #arma3_scripting
your description.ext excerpt might be #arma3_config at most. but description.ext is #arma3_scenario too
@still forum lol. i guess i'll delete here and repost it there.
anyway, i am trying to make a script that spawn a box and add items in it, i am trying to universalize it (i wonder if that is the correct term 😅 ) The box spawned fine, but im having trouble seperating the item for each boxes.
i know that the code currently will add items to both boxes
i guess i'll delete here and repost it there.
you already got your answer here tho
you can use a switch
@still forum no i didnt? i cant enter zeus after respawning
switch (_marker), if you want different boxes per marker?
you got a answer, tho didn't solve the problem I guess
i got my answer for my another problem.
i want same box with different items in it per marker
im guessing i just need to use the box name
oh i cant do that either, i will get an error
As I wrote, use switch
//Weaponbox.sqf:
_marker = _this select 0;
_this = "Box_NATO_Wps_F" createVehicle getMarkerPos _marker;
clearWeaponCargo _this;
clearMagazineCargo _this;
switch (_marker) do {
case "eqbox1": {
_this addWeaponCargo ["SMG_05_F",5];
_this addBackpackCargo ["Mal_AssaultAT_WD",10];
};
case :"eqbox2": {
_this addWeaponCargo ["arifle_AKM_F",5];
_this addBackpackCargo ["Mal_Carryall_WD",10];
};
}
Also it's a bad idea to reuse _this there as the variable usually has a special meaning (arguments passed to function)
ahh i wrote it as case 1: and case 2: it didnt work 😓
in this case where is i pass _this as name of marker & box on execVM, is it a bad idea?
it wont conflict with other _this on other scripts right?
should i just use if with the box name instead?
it doesn't cause any conflicts here
case 1 won't work as your marker name is not a number
should i just use if with the box name instead?
Why? the switch is perfectly fine and makes more sense
also your box doesn't have a name
i know it works perfectly, it is just that i didnt get why did you mention it is a bad idea to reuse _this
it doesn't break anything
but _this means "arguments passed to this function" EVERYWHERE else. Except in your script. There it means "arguments passed to this function" until line 2 and after that "the box that I spawned"
So you have a variable with 2 different meanings in your script.
And one of the meanings is counter to what everyone else expects
ahh, so it is better if i change the box variable name to
_wpbox= "Box_NATO_Wps_F" createVehicle getMarkerPos _marker;```
and in weaponbox.sqf :
```switch (_marker) do {
case "wpbox1": {
_wpbox addWeaponCargo ["SMG_05_F", 5];
_wpbox addMagazineCargo [30Rnd_9x21_Mag_SMG_02", 100];
};
case "wpbox2": {
_wpbox addWeaponCargo ["arifle_AKM_F",5];
_wpbox addBackpackCargo ["Mal_Carryall_WD",10];
};
};```
so now that _this has only 1 meaning now right?
yes
and it's also clear that the _wpbox variable contains a box, just by reading it's name
nice! thanks @still forum . I thought i was looking like a advance scripter re-using _this 😂
excuse me ! i want to ask a question please. Does database SQL correspond to exdb3 or life_server?
So, reading the wiki, am I right in interpreting that the owner command (https://community.bistudio.com/wiki/owner) only works when run on the server? Is there an equivalent that is run on any client?
only works when run on the server
no.
On server machine, returns the ID of the client. Otherwise returns 0.
It also works on non server, there it always returns 0.
Is there an equivalent that is run on any client?
No
for what do you need ownerid on a client?
I'm checking the locality of an item in game. Specifically an ammobox. I have a function that is run on the server only, and changes the inventory of the specific object. So, I transfer the item to the server before doing stuff to it
It's a Zeus module I'm writing, so it'll always be local to the Zeus client on creation
if you want to check if it's local use local
Hold up. I'm going about this all the wrong way. Where's my rubber ducky...
@still forum hi Excuse me, the information in the database SQL table is similar to https://github.com/AsYetUntitled/Framework/blob/master/altislife.sql. If I want to write a server log in the database, can I connect to the server only by writing the corresponding code in sql? Thank you.
connect to what server?
the database doesn't connect to your server, the server connects to the database
@still forum That's right, because I want to write a log in it so that I can record the player's operation information more easily, instead of using the complicated RPT to view, so what I want to ask is that I need to change the code in those files.
you probably need to create a new table to store the log stuff in I would assume
What do you mean by this? Just write the corresponding code in the SQL table, and modify the file in life_sever?
no idea how life stuff works
why not ask in a life forum?
This is the #arma3_scripting channel for Arma scripting. SQL database stuff is frankly out of scope
Hi guys! Trying to place a hp bar over my units. It works but with modelToWorld command the parts of the hp bar are offsetting in the 3d world. I need it to offset to the screen coordinates. What is the best way of doing that? Thanks.
Oh, worldToScreen should help I suppose.
modelToWorldVisualWorld (to make sure it doesn't lag) combined with worldToScreen
And it shouldn't be an 'drawIcon3D` anymore after that. right?
When I'm using world coords with a icon3d my progress bar spreads by 3d coordinates, it looks superawkward
It rotates whith camera when I'm moving mouse cursor
Is there a function to check if building position is reachable by foot (there is path to position) ? Some of building positions in CUP buildings are inside texture/building, I want to filter them out of all possible building positions.
e.g. buildings Land_Mil_House_no_interior_dam_CUP and Land_Mil_House_no_interior_dam_EP1_CUP have 2/24 reachable positions, rest of them are inside building with no way to reaching them.
Maybe contact CUP team and ask them to remove those positions?
@tough abyss I already submit ticket to their tracker, in mean time I am searching for solution to resolve it (find some workaround). I managed to create config for such buildings, but I don't want to spend my summer to searching for unreachable positions manually]
Maybe can do something with lineIntersectsSurfaces, I would imagine normal would be pointing in the wrong direction if you are inside the object
So I'm getting an error
addAction ["Teleport", {player setPos (getPos object)}];
Is coming back with an error that the init field is missing a ;
addAction cannot be added to nothing
Don’t you love that 😀
is there any pre-defined script that allows you to copy one vehicle inventory into the next
How can i create an array of marker that have similar names?
Only thing that is different is the ending number for example: [east_marker_0,east_marker_1,east_marker_2,east_marker_3....].
I want this to work with any amount of markers placed.
format
format ["east_marker_%1", _number] then just get your number into _number. Maybe with a for loop
I had the wiki page for format open, i just don't really understand what %1,%2 and so on do. Is that just where the variable is entered? And in case of %2 it would be a second variable added to the string?
_1 = "That";
_2 = "would";
_3 = "be";
_4 = "correct.";
format["%1 %2 %3 %4",_1, _2, _3, _4];
Just do this then ("east_marker_" + str yournumber)
Thanks for the help, i will try to figure it out 🙂
I try to rotate my picture here but fail hard on it. ctrlSetPosition and a ctrlCommit 1 afterwards have worked however.
_perk1 ctrlAddEventHandler ["ButtonClick", {
params ["_ctrl"];
DEBUG2("%1 pressed", _ctrl);
_ctrl ctrlSetText "\x\coopr\addons\rpg\data\images\perk-sixth-selected-256.paa";
_ctrl ctrlSetAngle [25, 0.5, 0.5];
}];
The controls style is style = 48;
The doc says Procedural textures filled controls do not rotate. which I can't apply to my control class since I do not fully understand the meaning of that hint
Say I want to make all map rotation mission. I want the player to own both DLCs, Apex and Contact because those maps will be in rotation and also because there will be less cheaters who can afford to buy both DLCs after getting banned. So, when rotation comes to maps like Stratis and Altis, how to make sure those without Apex and Contact cannot join
How can I detect a co-pilot? driver, commander, and gunner all return false for the copilot of the CUP C-130
currentPilot
AFAIK that returns the pilot not copilot
then turretUnit
if (testVehicle turretUnit [0] == player) then. . . .
Successfully detects player as copilot. Thanks @tough abyss !
i have a issue here, any help is greatly appreciated.
i have set up missions and now moving to trying out a setup for wasteland, i gathered my files from GitHub and noticed that the garage is not working. i play on wasteland servers and seen they are working so im guessing it is a script issue.
https://imgur.com/a/PAX9kUx
this is what it is set to be and i talked to a guy that helped set up servers and he said i have everything correct as far as he can tell.
anybody have any idea how to detect if an object was hit by a bullet? the "Hit" and "Dammaged" EHs aren't helping me any as I'm probably not doing enough damage to the object when shooting it. But the amount of damage doesn't matter, I just want to know if the object was hit or not.
what kind of object?
other than those eventhandlers there is no other way
so possibly your object has something preventing those working right
Does anyone know of a way to add items to specific player containers when creating respawn templates?
As far as I can tell, I can define items I was to add to a respawn template using
Weapons[] = {};
Magazines[] = {};
Items[] = {};
Equipment[] = {};
But cant figure how to add to vests and backpacks specifically
additemcargo
Example
this addbackpackcargo ["Backpack",3];```
Same thing with itemcargo, only Itemcargo is for optics, vest, ect.
Hmmm
The wiki description does not seem to suggest this solves my problem
But I will give it a go thanks
Hang on
Nope
Apologize, I might have read your problem wrong. You looking to add items to crates, or add items to a player?
class CfgRespawnInventory {
class Rifleman {
// Here goes items included in respawn template
};
};
So instead of just defining items I would like the role to include, I would like to take it a step further and define which item goes in which container. That being the Uniform, Vest and Backpack.
In the example, items are just added to whatever container it fits in first.
Ah
I don't know if you can do it through just that function.
You would have to hand crank it like arsenal does.
Im thinking exporting through Arsenal works nicely
Makes use of the AddToVest and AddToBackpack commands
I just have no clue how I would go about making that work for Respawn Templates
Do you want players to be able to switch roles mid-game/
mmm, only way I know of is making a mod, but I'm more of a modder then a scripter.
Yea I thought of that too
If I could define all of these roles and loadouts in a mod then I could just call the unit classes alone
How much of an undertaking would it be to make a simple mod, atleast for now, that contained some basic things like a Faction, roles, perhaps some insignia. Is it something someone could just dive right into or do I need to make some larger considerations?
Not silly hard, it's just connecting the proper dots. Lots of tutorials either give you too little or too much info.
I suggest you read through this, then watch a tutorial video, but ignore everything in the tutorial video but how they make the folders and such 😛
See MenuInventory, CfgRespawnInventory and BIS_fnc_addRespawnInventory
But between MenuInventory and CfgRespawnInventory you can do what you want without a mod ```hpp
class CfgRespawnInventory
{
class Blufor1
{
displayName = "Light"; // Name visible in the menu
icon = "\A3\Ui_f\data\GUI\Cfg\Ranks\sergeant_gs.paa"; // Icon displayed next to the name
role = "Assault"; // Optional, see CfgRoles
// Loadout definition, uses same entries as CfgVehicles classes
weapons[] = {
"arifle_MXC_F",
"Binocular"
};
magazines[] = {
"30Rnd_65x39_caseless_mag",
"30Rnd_65x39_caseless_mag",
"SmokeShell"
};
items[] = {
"FirstAidKit"
};
linkedItems[] = {
"V_Chestrig_khk",
"H_Watchcap_blk",
"optic_Aco",
"acc_flashlight",
"ItemMap",
"ItemCompass",
"ItemWatch",
"ItemRadio"
};
uniformClass = "U_B_CombatUniform_mcam_tshirt";
backpack = "B_AssaultPack_mcamo";
};
class Blufor2
{
// Alternative configuration pointing to a CfgVehicles class. Loadout will be copied from it.
vehicle = "B_soldier_AR_F"
};
};```
Okay so how do I take that ^
And arrange the items into specific containers?
@restive leaf
Ah... you want the same initial loadout on each respawn?
Or changeable on each respawn?
And would they respawn back at base?
Please don't ping me if you are not going to hang around for a response. I'm going for food now
Oh I didnt ping to gain your attention xD
Pppsh, if you gotta do shit then do it.
But yes, respawn is "BASE"
Also respawn on start
Not made it out yet... so same loadout as at start? @real moat
i want to create a trigger where it spawn a marker and after 5 minutes i want to delete it but i have error in generic expression when i put in command sleep 300;
trigtask setTriggerArea [3, 3, 0, false, 3];
trigtask setTriggerActivation ["WEST", "PRESENT", false];
trigtask setTriggerStatements ["player distance PERISIK1 < 3",'
_supplymark = createMarker ["supplymark", respawnmark_2];
_supplymark setMarkerType "hd_flag";
_supplymark setMarkerText "Bekalan";
sleep 300; // <---- Generic Error In Expression
deleteMarker "supplymark";
deleteVehicle trigtask;',
""];```
So the placed units have nothing. No loadouts, no groups, nothing.
The flow is you load in, select a spawn, select a role, select a loadout.
Question is: using "MenuInventory, CfgRespawnInventory and BIS_fnc_addRespawnInventory" how can I define specifically which container in the loadout, has what items.
you need to put it into a scheduled environment by using spawn.
- A scheduled script has an execution time limit of 3 ms before being suspended to the benefit of another script until its turn comes back. It is a bit slower than unscheduled but suspending (sleep, waitUntil) is allowed.
- An unscheduled script is not watched and will run without limitations. It is recommended for time-critical scripts, but suspending (sleep, waitUntil) is not allowed!
so i need to create the marker outside of the trigger?
@real moat class Inventory in the player entry in mission.sqm, very basic example: hpp class Attributes { isPlayer=1; class Inventory { class vest { typeName="V_Rangemaster_belt"; isBackpack=0; }; class backpack { typeName="B_Carryall_oli"; isBackpack=1; class MagazineCargo { items=1; class Item0 { name="Chemlight_red"; count=1; ammoLeft=1; }; }; class ItemCargo { items=1; class Item0 { name="Medikit"; count=1; }; }; }; map="ItemMap"; compass="ItemCompass"; gps="ItemGPS"; }; };Tested and works, never actually used before. May need additional stuff for respawns but I know that... Suggest searching for it for longer examples, unless you can wait until tomorrow and I will send you a full example in PM...
Love ARMA... Learn something new and cool every day!
🤔
Now I am going for food
Go for it
Guess you knew about that then @high marsh Never needed it... not even on MILSIM servers...
https://steamcommunity.com/sharedfiles/filedetails/?id=1668061136 (Item Clothing Config Mod). I wrote this specifically for that reason
Albeit, it has no mission support as of right now. It works with any configuration
should i use spawn with triggerActivated?
Anyone knows why lockCameraTo does not work anymore? Worked before but all the sudden stopped working. Camera is created, however does not look down to the surface (where A_CAMP_MIDDLE_POS is located) :
A_screenR setObjectTexture [0, "#(argb,512,512,1)r2t(ascreenfeed,1)"];
/* create camera and stream to render surface */
cam = "camera" camCreate [10272.3,10329.8,60.0];
cam cameraEffect ["Fixed", "BACK", "ascreenfeed"];
cam lockCameraTo [A_CAMP_MIDDLE_POS, [0]];
/* make it zoom in a little */
cam camSetFov 0.1;
/* switch cam to thermal */
"ascreenfeed" setPiPEffect [2];```
But this is vanilla ARMA @high marsh and you just need an initplayerlocal for respawns (I think you need the latter)
Right, but the same exact thing could be achieved vanilla.
Right. Scripts.
No mission.sqm and a script for respawns and the OP wanted to avoid a mod!
There is zero point in hammering out each object's inventory in mission sqm
"the OP wanted to avoid a mod!"
Mod in what way? The entire damn thing is contained in a mission
You could do this without A MOD.
🤦 I know, I said I wrote this as a result of having the same issue. The same exact concept applies in a mission script. No mods.
Oh... damn... you were agreeing with me..?
Yes. It's a gigantic waste of time to be applying all of the inventories through mission sqm alone th ough.
Agreed. I would have suggested Arsenal scripts based on saved loadouts and the roles, but the OP asked for an alternative
Thus me spending half an hour delaying going for food and learning something new 😉
And testing to make sure it worked
Eh. I would approach it with mission configs. I like those. Mission config -> Unit type -> Does this type of inventory exist in config (like vest items) -> Wooho, apply the vest.
Seems complicated for a small MILSIM with a few roles but also sounds interesting. Care to share an example, and how it's implemented?
Because your mod concept does not work in a mission cause you cannot reconfig CfgVehicles unless you do it in a mod... sure you could do it with a lot of scripting, but given you can just set roles in mission.sqm and assign loadouts and have this in an initplayerlocal.sqf for respawns (this bit I have to test)? ```sqf
waitUntil {!isNull (findDisplay 46)};
missionNamespace setVariable ["SpawnData",[getpos player,getUnitLoadout player]];
player addMPEventHandler ["MPRespawn", {
_parameters = missionNamespace getVariable "SpawnData";
_respawnLoadout = _parameters select 1;
_respawnPos = _parameters select 0;
player setUnitLoadout _respawnLoadout;
_respawnPos
}]; ```
class CfgMilsimRoles {
class rifleman_1 {
vestItems[] ={
"BlahBlastProtector"
};
};
};
params[
["_unit",objNull,[objNull]]]
];
/*
let's assume the classtype is "riflemnan_1"
*/
#define getRoleCfg(unitclass,var) var = missionConfigFile >> "CfgMilsimRoles" >> unitclass
#define getRoleArray(cfg,array,var) var = getArray(missionConfigFile >> "CfgMilsimRoles" >> cfg >> array)
getRoleCfg("rifleman_1",classType);
getRoleArray(classType,"vestItems",vestItems);
{
_unit addItemToVest _x;
_unit canAddItemToVest _x;
} count vestItems
You can in theory override mod configs by having the function search mission config for the class first, and then if it it doesn't exist there then use the config values.
of course you can't use it for anything that has properties in the vanilla game like weapon configs
but for anything custom you can
with my example above, any unit that has the classname "rifleman_1" for example will receive the loadout
and realistically, if it doesn't exist in config it doesn't get added or changed. So you can roll with whatever you need to change just in config
cfgToUse = nil;
if(isClass(missionConfigFile >> "CfgMilsim")) then {
cfgToUse = missionConfigFile >> "CfgMilsim";
} else {
cfgToUse = configFile >> "CfgMilsim";
};
That's very cool if it works. But for the OPs situation the mission.sqm and initplayerlocal may be easier
\ ¯_(ツ)_/¯
easier to control and you can make changes without any modification of script. It does work, have used it a few times before.
Sorry. You did say "in theory" I misunderstood that. But always remember that earlier posts may be answering a specific question from someone
Hell, if you really wanted to you could even point to global vars for changes during runtime. But that gets all too needless.
This is one way to go about it.
Yeah. And all answers have now been lost 😂
Saves you time in the longrun, but if this is still too much then I guess you could just grind out the mission.sqm
I am definitely gonna be using your stuff for something I need to do. Thanks 👌
As I said. Every day I learn something new
And LOL, saw that 😂
😮
So @real moat a couple of different methods to achieve what you need above. With all things in ARMA there is always a way and often more than one. Mostly...
Daaamn, I dont know how you arrived on that arrangement, but it looks pretty solid.
I will certainly give that a try @restive leaf, thanks a bunch man.
May I PM you if I run into any issues?
What is the best practice for hooking module functions? Say if I want to make a modular hooking of a module that adds multiple attributes from different components/addons?
Hmmm perhaps I should also just put more context out there.
Because if there is a better way of doing this, I am all ears.
Its just that still amateur with my sqf knowledge.
Okay so just for context:
In the unit, we would like to not have to use the lobby for role selection essentially. Ideally, most slots in the lobby would be generic, bar medics and engineers. The reason for this is that we'd like to work on a non-fixed team basis and the composition of the roles would change heavily from mission to mission.
So instead of having to arrange the composition in the editor every single time, we'd like to have it that you're picking your role through the loadout selection essentially. From there you'd be checked and assigned to a team depending on the composition and turnup for the mission.
Lets say last moment, co decides he wants an FSG, well instead of potentially not having FSG roles in the lobby to begin with or having to back out to get it, he just needs to tell a group to respawn and pick the corresponding role by means of loadout.
Not necessarily my first decision, but it was what people wanted, along with the functionality of being able to pick the spawn location using the same menu UI. So yea, that is why I went with this method. Hopefully that clears things up, but if anyone has a better idea of how to achieve this, please do shoot it my way.
_Group setBehaviour "CARELESS";
_wp =(group driver (vehicle (leader _Group))) addWaypoint [(getpos _helipad), 0];
_wp setWaypointType "TR UNLOAD";
_wp2 =(group driver (vehicle (leader _Group))) addWaypoint [(getpos EnemyAirSpawn), 0];
_wp2 setWaypointType "move";
_wp2 setWaypointCompletionRadius 100;
_wp2 setWaypointStatements ["true", "
_vehicle = (vehicle this);
{_vehicle deleteVehicleCrew _x} forEach crew _vehicle;
deleteVehicle _vehicle;
"];
My problem is that the AI just hover over the helipoint and then he is like: https://i.imgur.com/R9I0OBs.jpg
Then leave and never landed and droped the trops, in my first test it did worked and now he just refuses to land again.
@astral tendon how do you make the code colorized?
add the ```sqf
oh okay thanks
if (isServer) then {
[ WEST, "Task_001", ["Bunuh Musuh di Jalan ke Kamenka dan", "Clear Jalan.", "Clear"], taskLoc, TRUE ] call BIS_fnc_taskCreate;
trigtask = createTrigger ["EmptyDetector", getPos PERISIK1, true];
trigtask setTriggerArea [3, 3, 0, false, 3];
trigtask setTriggerActivation ["WEST", "PRESENT", false];
trigtask setTriggerStatements ["player distance PERISIK1 < 3",'
supplymark = createMarker ["supplymark", respawnmark_2];
supplymark setMarkerType "hd_flag";
supplymark setMarkerText "Bekalan";
deleteVehicle trigtask;',
""];
};
[] spawn {
if (triggerActivated trigtask) then {
sleep 10;
deleteMarker "supplymark";
};
};
it seems that the script if working fine except that it does not delete the marker, where did i go wrong?
i wanted it to delete the marker after 10 seconds
you can put the sleep and deletemarker right in the trigger statement within a spawn
depending on where/when you execute that spawn with the sleep in it, it will check if trigtask is triggered, and if it is, sleep 10 seconds and delete the marker
if it is not triggered at the time you execute that spawn, it wont execute the code inside the if () then {} check
you could use waituntil, or put the spawn within the trigger statement
@slim oyster i will try it with waituntil
"supplymark = createMarker ['supplymark', respawnmark_2];
supplymark setMarkerType 'hd_flag';
supplymark setMarkerText 'Bekalan';
deleteVehicle trigtask;
[] spawn {
sleep 10;
deleteMarker 'supplymark';
};",
""
];```
or
waituntil {sleep 0.1; triggerActivated trigtask};
sleep 10;
deleteMarker "supplymark";
};```
The second route spawns a new script thread that will continuously check if trigtask is triggered... while the setTriggerStatements simply executes that code which includes a new thread to wait and delete the marker. Spawning a thread to check if a trigger is triggered is redundant
well yeah i use triggeractivated because i use spawn outside of the trigger commands
thanks @slim oyster it works perfectly now
no problem
@tough abyss
So, when rotation comes to maps like Stratis and Altis, how to make sure those without Apex and Contact cannot join
Add something in the optional contact dlc part to requiredAddons in the mission. That'll be easy for contact, Apex not sure, but I assume there will be atleast one CfgPatches in apex that only owners have.
Is there a way to properly description.ext all of my functions to be included in the functions viewer if some of them look like this ?
Yeeeeeaaaaas.. kinda.. look at the script behind CfgFunctions. functions_f/something/initFunctions.sqf
The function viewer afaik reads the functions from variables, you can probably just inject your stuff into there manually.
@hasty violet
@hollow lantern before you claim it worked before, have a look at the wiki https://community.bistudio.com/wiki/lockCameraTo which clearly tells you the argument is UAV and not a camera object
@still forum danke
You won’t be able to inject anything because functions are compiled before everything. If you want your mission functions appear in function viewer add them to description.ext CfgFunctions
yes you can inject functions that weren't defined previously
Though that only really works if functions viewer reads from the variables that initFunctions leaves. Instead of config directly
I looked into that some 3 years ago, don't remember
Is there a way to damage a unit without shooting it but still hitting the HandleDamage EH?
Except of pushing unit off the roof 🙂
@dull drum doesn't the EH fire if u hit the unit with a car? or explosions? or something like that
@dull drum set the velocity down 😄
It does, @plain current . But RZ zom ies are hitting with set damage and I have no idea how to get them hit with velocity
unit1 setVelocity [0,0,-10e10]```
But i only need to got it a bit with a zombie attack punch :)
super punch
One punch!
@winter rose the fun part is that it really helped. Looks clumsy though when the attacked unit tries to hit the ground, but technically it works 🙂
To reply to @young current about my object question, I'm building a prop hunt knock off for some simple fun for muy clan. The objects are just random props
I think I'm gonna have to do some jury rigged way with a "fired" eh and just wait till the bullet is deleted and detect the closest object to it, hoping it detects an object attached to a player
Quick question:
https://community.bistudio.com/wiki/getMissionPath
On the wiki this says it was introduced in the dev version.
Is it now also in the normal game or still only in the dev version?
not yet. I think
current version is 1.94
dev is on 1.95
and next stable release is 1.96 where that command should get into main game
@tough abyss I looked at the wiki and yes it claims UAV there, hence it worked at some point I'm pretty certain of it. But anyway, how else would I lock the camera? rn it is just looking straight forward where it has been created
The command works but it works with UAV, scripted camera is not UAV
If you want to control scripted camera look at gazillion of commands that start with camXXXXXX
@dull drum you could also create the smallest ammo and make it a tiny velocity to simulate a bullet hit
Zombies don't shoot, they are just waving hands doing setDamage 🙂
In case of ammo I should give them invisible guns or something.
Totally unrelated: I have a UI Dialog with some controls inside. It showed them by Draw3d EH. I'm trying to change controls position dynamically but it just stuck in place. I even changed the [x,y,w,h] to get them from the sqf var, but still no luck. Only reload moves controls.
Like x = "missionNamespace getVariable 'TEXT_POS' select 0";
But when TEXT_POS changes nothing is happening
(missionNamespace getVariable ['TEXT_POS', [0,0]]) select 0``` just to be sure
yup, select
also, yes, you would have to ctrlSetPosition - from what I know, x/y/w/h don't update themselves if you "simply" update a var, it's set on dialog opening
Well, it worked in the script that I robbed of this functionality 😦
actually it worked wit ctrlSetPosition
which failed in my script so I moved to the variable option
I'm no expert ¯_(ツ)_/¯
What do you mean by reload? Mission reload or reloading the UI resource?
Because changing TEXT_POS to whatever won't change anything at all while the UI is opened, it's not constantly going to look at what its config entries are and then constantly readjust by pure magic
anyone can guide me whats he best approach to include a variable inside a string? I tried this: sqf _screen setObjectTexture [0, "#(argb,512,512,1)r2t("_feed",1)"]; seems not to work. the variable is just a value from a params array
normally the string would be one solid thing like sqf _screen setObjectTexture [0, "#(argb,512,512,1)r2t(feedname,1)"];
format @hollow lantern
format ["#(argb,512,512,1)r2t(%1,1)", "feedname"]
Kinda-popular mission framework breaks ACE and CBA.. what might be the cause?
Oh
{
removeAllMissionEventHandlers _x;
} forEach [
'HandleDisconnect',
'EachFrame',
'Draw3D'
];
uh.. okey then...
oh, lol wats the framework called
I'm already throwing enough shit at that guy for his abominable code, so better not name him 😄
You are doing Life support now?
oh okay thats understandable. I thought everything else was nice code but that. Here I thought u couldnt break ACE or CBA
what would cause a Zeus mission that works fine when tested my local dedicated server (Win), to not work properly on the remote Linux server, exact same file and mods
hmmm I wonder if there is something like setAperture available just for a specific created camera . https://community.bistudio.com/wiki/Category:Scripting_Commands seems not have a code for this.
Wherever the camera is local to I assume.
well said camera is created and then displayed on a rugged screen using r2t, so not sure if that works but I'll give it a try
Ah, that maybe not. You might use ppEffects iirc? Wait, maybe not.
that's my code for displaying camera data on a screen:
params ["_screen", "_feed","_pos", "_target", "_effect", "_aperture"];
_screen setObjectTexture [ 0, format ["#(argb,512,512,1)r2t(%1,1)", _feed]];
/* create camera and stream to render surface */
_cam = "camera" camCreate _pos;
_cam camSetTarget _target;
_cam cameraEffect ["INTERNAL", "BACK", _feed];
_cam camCommit 0;
_cam camSetFocus [-1, -1];
setAperture _aperture;
/* switch cam to thermal */
_feed setPiPEffect [_effect];```
that aperture obviously doesn't work as expected
I just didn't remove it while pasting the code
I am pretty sure it is touching HDR so it's a "general" setting yeah
it is, sadly
does anyone know what this means
Fault address: DA8BAFD1 00:DA8BAFD1 Unknown module```
@hollow lantern you can set variety of PiP effects with https://community.bistudio.com/wiki/setPiPEffect
This newbie have a question. :/
I would like to know is it possible to make all server users are using same modified config with out the mods
I don't think it's the smart way or easier way but, i really want to know about this
A mod is short for modified config, so if you are using modified config you are using mod, so no you can’t use modified config while not using mods (unless you are on special branch of Arma not available to public)
how can i make an ai bloody but have full health?
sethitpointdamage on legs mayb
in short: you can't
but you can probably give it veeeery little damage
na, looking to keep the bloody uniform on unit even though at full health. im trying to see now how to use getObjectMaterials on ai uniform. then i might be able to do setObjectMaterial when they get healed up
How can I get the position of a waypoint?
You can apply bloody texture and material with setObjectXXX @exotic tinsel
@austere granite if UI redraw is not available how to explain this?
https://www.youtube.com/watch?time_continue=6&v=5E5pORdj6oA
http://killzonekid.com/arma-scripting-tutorials-gui-part-5/
Another question: I'm writing a paradrop script. When I eject the infantry out the back, the distance at which I do it has a huge effect on the way the pilot flies. If I eject them close (15m) he tries to pull up and fly away from them, screwing up the drop pattern. If I eject them far away (40m) he ignores them and stays level. Is there a way to make the pilot ignore them either way?
@tough abyss any idea on how i figure out what texture to apply for each type of uniform?
Look up in unit/uniform config, those bloody textures are listed somewhere
GameLogic vs Invisible Helipad performance?
I can use both to setup invisible scripts, which is better?
helipad better
game logic is simulated
just delete the object once script is executed?
in the second example script here https://community.bistudio.com/wiki/calculatePath
what is the (_this#1) we're iterating over?
it doesn't quite explain that and i've never seen a # in sqf other than as part of a map object's ID
yeah but what is that?
_path
ohhh
ahh hash is the new select?
no
oh my god
oh my customer?
it's just a ugly alias that conflicts with preprocessor and only does a few things that select does
["A","B",["C","D"]]#2#0; //C leave sqf for a while and it always gets worse
anyway that calculatePath looks like a good function
i wrote something that did the exact same thing a few years ago by spawning an invisible enemy with a super high animation speed lol
@winter rose with a script like this one can make UI dance
HB_HBAR ctrlSetPosition [(random 1), (random 1)];
HB_TEXT ctrlSetPosition [(random 1), (random 1)];
HB_HBAR ctrlCommit 0;
HB_TEXT ctrlCommit 0;
I bet yes 😁
The above, I'm using the object for both init box and to reference later for distance
@tough abyss Yes, I'm already using that, that however has nothing to do with Aperture and I can't set it using setPiPEffect
@dull drum
dynamic text changing you will have to do it with onLoad and ctrlSetText combination.
In general you should jus script those UIs anyway, its a lot more versatile
Might take some more thinking originally, but you can do everything you want for a UI through scripts these days in A3 so imo its a lot better to just go with that, unless you want them to be 100% static (which you dont)
ctrlSetText works without ctrlCommit that's true.
Color and position as I found could be set dynamically with ctrlCommit, so it's fine.
Somehow I tend to keep basic UI settings in cfg, minding that now I can operate them how ever I want after.
{
private _pos = getMarkerPos _x;
private _target = ([_pos,0,"sab_boat_freighter_o", WEST] call bis_fnc_spawnvehicle) select 0;
private _ehKilled = _target addEventHandler ["killed", "deleteMarker _x"];
} forEach _eastMarker;
Not sure why it does not delete the marker when i kill a unit. I already tested with a hint message if the event handlers are working and they do.
okay... so,
I want civilians to have a unique ID(Like, ID Card with info) / Identity, and some other meta-data.
For example, given a mission I want to pre-create a roster of about 100 possible identities. When a civ spawns, means TBD (could be enigmans, could be ambeint module, could be eden placed) then the civ should randomly pick a ID from the list of identities, and if that ID is not being used in the active mission, they become that person (set identity, addItem ID with info, etc).
I have some ideas for implementation, but wanted to consult you guys to see if anyone has any ideas, or maybe can help me see some pitfalls.
My priamry idea is a array of identity properties,
[[ id, identity, face, voice, isDead, isWanted, isWhatever ], [...]]
_id select random arrayOfIds;
- if id in use, select another
- else add id to in use list
- return the id
Once we have the id, we set all props on the civ, add inventory items, and build them (id badges with fields script or something)
My question is I have seen a mod like this, Advanced Civ Interaction, however it's grossly broken and ID's never match the NPC, and can be diffrent for each person checking the ID of the civ!
My first guess would be, to keep a list of civ units with ID's active, and spawned, on the server, and keep the meta-data vars their.
idk tho.
Not sure how this interaction needs to happen.
_ai setVariable ["id", "1234]
_aiMetaData = [_ai getVariable ["id", 0]] call fn_getAiData;
so, I keep the id assigned on the civ, and then wehn I need the identity info I can make a call to the list of id's on the server, this can be used to then pop any gui elements I need on the client?
Sorry folks, at this point I a rubber-ducking.
Is there a BIS_fnc_rscLayer thing that kills rscLayer by name? 🙂
Explain what you want to do
I generate health bars for ai units (both friendly and enemy). Each healthbar is a rsc Layer and a dialog + control inside. When units die I want to get rid of everything including their rsc layers.
What's the best way to keep an AI steady? I have a gunner with an HMG behind a rounded sandsack barrier. After enemy contact the gunner just does a 360 all the time and with it sometimes is way out of the barrier and could be killed easily. I still want him to shot targets, just not look around as the only entrance where enemies would be is at the gate where I had him looked with doWatch
not sure if disableAI would fit here
disable movement on him, try that.
He should still be able to aim, I think.
Not sure for statics, but I use it for snipers allot.
ah ok, thanks
And it looks fun, @hearty plover
https://monosnap.com/file/KV0pc5XDec2t9ZYl0tKJfYVOkkfNrG
The main pain in the ass now is that some bars are staying on the screen after unit is dead. And it looks like it draws also the player's one, which I strangely can't get rid of.
@hearty plover I think that should work: "PATH" - stops the AI’s movement but not the target alignment Available only since Arma 3 v1.61.
lets see
Please let me know.
Thank you for testing it.
Sounds like you should revist the logic that controls when they draw and when they remove @dull drum , maybe take some steps back out and focus on the life-time of the bar again.
It's not just you! forums.bohemia.net is down. 
and so is the wiki
D:
works again
It was up the whole time for me, i was browsing wiki the whole time. ^^
Is it possible to attach something to a specific bone on A3 character using a command?
Is getPlayerUID the same for two arma clients with different arma profiles but same steam profile?
Yeah that's what I also thought, thx
@thorn saffron yes, see attachTo
WIll object attached to memory point will copy the direction of the bone?
nope
Can u add controls to a ControlsGroup control via script?
No
U sure about that?
ty
hello nice gentlemen
on the apex protocol lobby there is a thing where if you hover over the image it blurs the image, is this a built in scripting command or is there some trickery going on here? I am curious on how to reproduce this, thx
@tough abyss isn't it the blurred image in paa on top of the other?
Why not?
Hello, I am looking for a script. I need an object to rotate around its axis 360° and start again. Will drop 5€ paypal to whoever helps me with this.
what type of object, which axis, how smoothly
throwing the money card might also be considered tacky.
@flint iris I might be interested, but not for money
send money first, I help later 😄
What axis and what object? Also, in a permanent loop?
It will be a vehicle and preferably by 1° every 0.1s so it will look smooth.Axis will by x
Basically will be something with setDir
I see
so a carshow spin.
Yep
oh but X-axis would mean its spinning forwards
you might want to consider making a object with slow non-stopping spin animation and attaching the object to that
it would not have to be managed by the script constantly
"Zebra_CarShow",
"onEachFrame",
{
params ["_vehicle"];
private _dir = getDir _vehicle + 0.2;
_vehicle setDir _dir;
},
[VEHICLE_VAR_NAME_HERE]
] call BIS_fnc_addStackedEventHandler;```
If performance is important you might want to consider @young current suggestion.
To increase the speed, change 0.2
hey guys, quick question regarding remoteexec.
I have a curator module and want to unassign the module from the owner.
it seems to work when the mission is locally hosted but not on dedicated.
Can you please help me set this up correctly?
Variable name of the curator module is KLT_moduleZeus
KLT_moduleZeus remoteExec ["unassignCurator",0,false];
Where do you execute the command? unassignedCurator is supposed to be executed on the server and should be mp compatible.
I execute it locally from a ace self interaction
//Remove zeus 2
zeus_remove_two = ["Disconnect Zeus","Disconnect Zeus","",
{hint "Disconnecting zeus 2..."; //Debug
zeustwoBusy = 0;
publicvariable "zeustwoBusy";
I_amonlist = 0;
remove_action_2 = 0;
KLT_moduleZeus remoteExec ["unassignCurator",0,false];
},{remove_action_2 == 1}] call ace_interact_menu_fnc_createAction;
[player,1,["ACE_SelfActions"],zeus_remove_two] call ace_interact_menu_fnc_addActionToObject;
I see
KLT_moduleZeus remoteExecCall ["unassignCurator",2];
Set the server as target by replacing 0 by 2.
See if that works.
Did try it to only run on the server before but there was no difference...
I did try it just before you posted and now it works.
I forgot the [] around KLT_moduleZeus. 🤦
//Working
[KLT_moduleZeus] remoteExec ["unassignCurator",0,false];
Im going to set it to run only on server. would it be better to use remoteExecCall instead?
I always prefer call over spawn.
We don't need suspension for that code so we avoid it.
@obsidian violet The brackets are optional and only need to be used with multiple parameters
Not sure if that's the issue.
it could be that when you exec that code KLT_moduleZeus is unknown since it local to the server only.
Optional or not. It did make the difference somehow since its working after that change.
But as I said, It worked when it was hosted locally the way it was before but not on dedi.
Now it works on both 🙂
Maybe because the array is passed to remoteExec instead of evaluating the variable first and then sending the value to remoteExec. wild guess
Maybe someone with more knowledge can clarify @winter rose @still forum
w8 wat?
so sqf KLT_moduleZeus remoteExecCall ["unassignCurator", 2]; doesn't work but sqf [KLT_moduleZeus] remoteExecCall ["unassignCurator", 2]; does?
That's what @obsidian violet said
"hello" remoteExec ["hint", -2, "some_JIP_ID"]; from biki example
yep, as I am used to do
sooo explain yourself @obsidian violet , why did you break it?
Nearly have not changed to remoteExecCall yet.
so following
//Does not work on dedi but do work locally.
KLT_moduleZeus remoteExec ["unassignCurator",2,false];
//The change - Does work locally and on dedi.
[KLT_moduleZeus] remoteExec ["unassignCurator",2,false];
If I remove the brackets it does not work anymore. Something is weird here... need to check it even further. Thanks for your help guys. main thing is that its working.
@hearty plover so nope, the auto-rotating gun stops when issuing disableAI "WEAPONAIM"
it's not path or move related
sounds logical if the AI stops aiming it?
yeah, my point was that I had an gate entry I want to cover with the gun, however AI moved 360 around with the gun once an enemy was present and the sandsack barrier was not covering him once he moved out of it. AI looked at a completely different direction where no enemy would appear.
even while I ordered a doWatch at the gate
didn't came across a solution to that other then disabling the WEAPONAIM
do someone know if possible to delete roads via script in mission?
is there a way to log every script that is executed?
More a #arma_battleye question, but sure. Change your filter to just be 1 ""
Wouldn’t this log every script statement rather than every script?
@lucid junco hideObject, but you will have harsh cuts in the road
Maybe because the array is passed to remoteExec instead of evaluating the variable first and then sending the value to remoteExec. wild guess
That's impossible @cosmic lichen
You cannot pass a variable to anything
is there a way I can put a variable name on a vehicle I spawn in the mission
@still forum Do you have an idea why ```//Does not work on dedi but do work locally.
KLT_moduleZeus remoteExec ["unassignCurator",2,false];
//The change - Does work locally and on dedi.
[KLT_moduleZeus] remoteExec ["unassignCurator",2,false];``` That happened?
"but do work locally" already means that remoteExec understands the parameters
maybe something wrong with the function itself
what does "does not work on dedi" mean?
or rather "do work locally" mean? unassignCurator is a server only command
why would it work locally
Maybe he means in the editor
@winter rose correct, when I said locally its a started mp game in the editor.
I can send over what I got later.
it does work the way it should now. Must be something with the function like dedmen said, when im using the same line for other functions it works like it should, with or without brackets.
no i mean function, not command
though at that point I didn't realise that unassignCurator != call, and that KLT_moduleZeus != CODE
I have a question about how to write an EXE program to connect to the database and write the corresponding functions in the EXE program to more easily and intuitively rewrite player data. Thank you
@still forum Yes, I want to use an EXE program and write corresponding tables to represent the corresponding functions, intuitively rewrite it, and connect to the database through config.
Check stackoverflow
I've been messing around with the Civilian Presence module released with the Tac-Ops update, however It doesn't seem to despawn the units when I get out of my trigger zone (which is synced to the presence module). Does they despawn gradually/ after a few seconds ? Thanks for any help
I did see that it doesn't spawn or despawn when in LOS of the player, however would that count Zeus as well ?
@winter rose can you send me some script which works? thought road ingame is not object 😕 https://community.bistudio.com/wiki/nearRoads And for me hideobject dont work
that's what I had in mind, I thought it would work
{ hideObject _x } forEach (player nearRoads 100);```
Were can i get a list of all ACE variables to edit? especially the ones related to action range
@astral tendon nowhere. Go through the code manually
nearestTerrainObjects?
{
_x hideObjectGlobal true;
} foreach (nearestTerrainObjects [(getPos _target),["ROAD","MAIN ROAD","TRACK"],500]);
@lucid junco
will try
thx
@winter rose @hasty tundra no succes
i think i tried some variations of this already
Does ace makes the MBT kuma malfunction its coaxial? im having that by just firing a little
the coxaial reloads afther a few shots
10 rounds magazine
really?
yup, due to videogames bringing gun violence they had to tune it down for the USA market
🙄
next patch brings flower picking 😄 💮
We need the bolt action glock to bypass those laws
joke aside, IDK Ace a lot. isn't it some overheating of some sort? any other mod?
im just using RHS and its compacts and ACE
that does not happens 100% of the times
also, that malfunction happened in the tank campain
I wonder if remoteExecuted functions are executed in order on the remote machine?
If I do
... remoteExecCall ["fnc1", ...];
... remoteExecCall ["fnc2", ...];
Does arma guarantee that fnc2 is be executed after fnc1 on the remote machine?
I would say "don't count on it"
maybe make another function to call it in order locacly?
If you run two of them on the same target, it should queue them, but as Lou said, don't count on it.
You mean the note with the orange exclamation mark? This note deals with a bit different topic.
it should
☝ …but don't count on it yeah 🙂
call func1; call func2; // func2 will always execute after func1```
I am takling about that note.
Ah I see the difference
yup
Sorry for that.
Yeah it doesn't correspond to my question though, I am talking about two remote calls on a remote machine
remoteExecCall might queue them as @finite dirge stated, but further stress test is required (or dev insight)
Yeah thanks guys
We know so far that remoteExec is reliable, although no info if it also works in order 🤷
It does from my experience in the hated Life Community 
remoteExec wouldn't be in order, remoteExecCall should be, but if you want it guaranteed, use remoteExec and some logic or pass a var to a loop or something you have as a worker to handle that if it's something constant.
Yeah I meant the remoteExecCall all the time, not remoteExec.
Thanks for the info!
_coreTemp = 37;
systemChat "Worked";
onEachFrame {hintSilent str getPos player; _playerPosY = hintSilent str getTerrainHeightASL (position player);};```
Hello all, I am struggling with this basic little script. I want the game to give back the player position each fame and the hintSilent str does this good enough. But I want to store the players height each frame so it can be used else where. Anyone know how this can be done?
@crisp cairn you should use a global variable, onEachFrame works in its own scope
also, sqf private _myPrivateVar = "value";
Ta mate, so
onEachFrame {private _playerPosY = getTerrainHeightASL (position player);};
Within each frame?
Nope, a global variable 😉
WEL_playerTerrainHeight = blah```
You mean a global variable? Public variables are ones on everyclient broadcast with publicVariable or setVariable
er, yes! global
let me facepalm while I get back to you
never said "public", totally never said that
(edited)
ssssssh don't ruin it 👀
anyone good in math ? I have a problem with relative/world position between objects and the attachTo command
I use BIS_fnc_attachToRelative to attach the car to the object while keeping its orientation
but i need to attach it to a specific memory point, otherwise the car doesn't follow the object's animations
and this method can't do that
the code of attachToRelative :
params ["_obj1", "_obj2", ["_visual", true]];
private _orient = _this call (missionNamespace getVariable "BIS_fnc_vectorDirAndUpRelative");
_obj1 attachTo [_obj2];
_obj1 setVectorDirAndUp _orient;
So what i need is this
_obj1 attachTo [_obj2, [0,0,0], "attach"];
But i need to know how to calculate the pos to put instead of [0,0,0]
So what is the question?
i need a script which attach obj1 to obj2 on a specific memory point without changing the pos and orientation of obj1
Ah
selectionPosition to get memory positions of objects
worldToModel to get the relative position of obj1
attach obj1 to obj2 without changing the pos ... of obj1
Must be a mistake in your sentence? 🤔
no why ^^'
vectorDotProduct with [-1,-1,-1] to make the relative pos negative and then _memPos vectorAdd _dotProduct
And attach to the result
There you go
Then the object should be attached to the memory pos without moving the object
Yeah ok, so you need an offset from the memory point, in model's space, my mistake
Dont have a pen and paper and writing this on my phone since im at a party, so no clue if that'd work and unable to test
Ugh isn't there an SQF command to get position of a memory point of an object? 😮
^^ selectionPosition to get memory positions of objects
ah yes!
I'd assume that you need to:
selectionPosition to get memory position in object1's model space
then worldToModelVisual object2's pos into object1's space
substract the two and you get the offset
I think... 🤔
If obj1 is the main object and obj2 is the one being attached then yes
ah damn... yes, I mixed them up 😕
_memPos = _obj2 selectionPosition ["attach", "Memory"];
diag_log ["_memPos",_memPos];
_objRelPos = _obj2 worldToModel getPos _obj1;
diag_log ["_objRelPos",_objRelPos];
_finalPos = _memPos vectorDiff _objRelPos;
diag_log ["_finalPos",_finalPos];
_obj1 attachTo [_obj2, _finalPos, "attach"];
19:38:31 ["_memPos",[-2.64375,0.136325,-0.59973]]
19:38:31 ["_objRelPos",[-0.215332,0.427734,-0.891212]]
19:38:31 ["_finalPos",[-2.42842,-0.291409,0.291482]]
Sure
instead of getPos you should use getPosWorld
getPos's Z coordinate is relative to terrain or objects or whatever
_finalPos = _memPos vectorDiff _objRelPos;
maybe the other way around?
objRelPos - memPos
is there a way to check by script if a unit is behind a bush/tree/etc. ?
Hmm how do you define 'behind'?
I think there should be a way, yes
do you need to check only bushes and trees specifically?
or also buildings, cars...?
@astral dawn it almost works when switching _memPos and _objRelPos
https://i.imgur.com/bbxaW4i.png
it's just the Z, i tried getPosWorld but it puts the car in the sky
Ahh what the ...
https://community.bistudio.com/wiki/worldToModel
position: Array - world position, format PositionAGL or Position2D 🤦 🤦
(I assumed worldToModel to accept world coordinates)
@frigid raven intersect and its variants
AGL makes that even more complicated as you have two reference systems.
One is the height above the terrain of the source position, and the height above the terrain of your model 🤔
you can workaround by doing a vectorDiff after a modelToWorldWorld
And that way work with world coords
_objRelPos = _obj2 worldToModel (ASLToAGL (getPosASL object _obj1));
maybe this can work...
I was hoping for a _unit nearbyBush _radius 🤣
Is that talk about attachTo and keeping the object in the same position as it was before?
yes
Because that thing we solved right here a few weeks ago
Ok then I screwed the context
that's it + link it to a memory
you are probably overcomplicating things then
Our solution from a couple weeks ago was very simple
😦