#arma3_scripting
1 messages Β· Page 8 of 1
And if it's confusing then it's probably not wrong where you think it's wrong :P
"executed on the server level"
you run it multiple times on the server then
Should have been just the once - though to be fair, it's a friend hosting so dunno if he multi-clicked.
YES
@granite sky you pointed me in the right direction, it saved
i still need to fix that code spaghetti but at least it now saves, thanks a lot man
Dang... worked with testing just the helipad portion, then we tried the whole thing again and got nesting trucks T_T Aight, I'll have to make a loopback server and test it a little more.
Hello, question:
When I use
HVT_1 switchMove "Acts_JetsMarshallingStop_loop";
The unit gets out of the animation after 1 second for some reason, is there a way to make it stay in the animation until it is tied up by ACE?
Probably best to remoteExec the command to ensure it runs on all the necessary machines. Per the wiki page, the animation change will only be temporary if the command isn't run where the unit is local.
You can also try HVT_1 disableAI "ANIM" to prevent the unit from deciding to do something else.
The unit gets out of the animation after 1 second
per wiki:
When the argument is remote, the animation change on the executing PC is only temporary.
I secondremoteExechere. Since it takes a local argument you can reference the unit object i.e. ```sqf
[HVT_1,"Acts_JetsMarshallingStop_loop"] remoteExec ["switchMove",HVT_1];
if you are testing in SP this is not the issue though @versed belfry
I was testing in SP, will test all of those tho just to be sure
remoteExec will just yield the same result in SP
Will try local host and when I have the time dedicated server
introducing the MP aspect shouldn't fix anything if it doesn't work in SP
Fair tho I've got nothing better to try beside the solutions above
so might as well try something
100% wasting your time π
have you tried switchMove and "anim" disable as suggested?
[HVT_1,"Acts_JetsMarshallingStop_loop"] remoteExec ["switchMove",HVT_1];
[HVT_1,"Acts_JetsMarshallingStop_loop"] remoteExec ["playMoveNow",HVT_1];
^ this could also be worth a try
Yep trying right now, seems to work, just need to check if the tied up animation will also work.
It works :D
Thanks a lot ^_^
I have a simple script where I am trying to figure out function libraries, and I have functions.hpp file and a description.ext file set up, and in the main file I have fn_tdm.sqf. I want to figure out how to call this file, so in the my functions file I have class CfgFunctions { class tdm{}; };. I think this will work bc it doesnt come up with error file not found π€ . When I use [] spawn TAG_fnc_tdm; it comes back undefined? Any idea? I am very new so if I am missing something dumb dont feel bad to call it out
your structure is invalid, see example https://community.bistudio.com/wiki/Arma_3:_Functions_Library#Function_Declaration
Do you need a class TAG and class description for it to not be invalid?
yes, otherwise nothing will load
substitute the tag with your own tag https://community.bistudio.com/wiki/OFPEC_tags
Script functions\TAG\fn_Category.sqf not found - Returns when I rename the inner class to class tdm {};
from description.ext: <ROOT>\Functions\Category\fn_functionName.sqf
either adapt the folder structure, or you can provide your own with the file attribute, https://community.bistudio.com/wiki/Arma_3:_Functions_Library#Attributes
how does your config look? it seems wrong from that error message
description.ext i meant
and functions.hpp, contains what you just sent?
yes the first one I can resend it
so you end up having, class CfgFunctions into class CfgFunctions
remove this class, and leave the include
Comes back with the same error as before
did you reload the mission?
also is it exactly the same error? it should show correct path atleast now
different -> script functions\Category\fn_tdm.sqf not found
yeah, so now as i've said previously, you either adapt your folder structure, or in the category class specify it explicitly with file = "myfolder"
the implicit path is root directory (where your description.ext is)/functions/CategoryName (the one you specify in the class declaration, inside the tag class)/fn_functionName.sqf (in this case fn_tdm.sqf)
So I made a folder called functions and included file = "functions"; and it worked out! Thank you so much for bearing with me @copper raven
Is there any code to verify the integrity of pbo? Some cheaters cheat by tampering with the pbo of the arma3 ontology.
I want to verify by executing code (similar to right-clicking on the launcher to verify game integrity)
well all you can verify is a checksum, that's about it (done by the server anyway iirc)
unless you have a reference pbo then you can compare the binary i guess (nevermind i missread what you wrote)
(that's obviously outside sqf)
don't post those links here
ok
correct. those dont belong here. you can however report such things to BI support email
im trying to ban a player via script if reconects too many times
im using a connected evenhandler
addMissionEventHandler ["PlayerConnected", {
params ["_id", "_uid", "_name", "_jip", "_owner", "_idstr"];
and using the _idstr value in:
_serverCommandPw serverCommand (format ["#exec ban %1", _idstr])
on the console i have this log:
Successfull attempt to execute serverCommand '#exec ban 1658287821' by server.
But for some reason it doesnt ban the player, #kick with uid seems to work fine but cant meke it work with ban
already tryed with:
id uid name and idstr
try string and use uid
format ["#exec ban ""%1""", _uid]
edited, missed the hash
should be in the battleye folder iirc
its on profile folder π
banned yourself? π
it's more effective use kick instead of the ban ... if you use battleye or not, just set the kicktimeout to missionend or serverrestart
i dont use battleeye, but this is for isolated events, so it wont be a problem.
ppl keep connecting after its kicked for bad connection so... i ended up with the jammer
well that's even more useful for you
https://community.bistudio.com/wiki/Arma_3:_Server_Config_File check kickTimeout you can ensure they will not be able reconnect for e.g. 3 minutes
yea, that timeout will be better for sure
the advantage is it works like #lock for the userID, so it's not tanking server
is it possible to get the contents of editor object init field with script?
if mission.sqm is not binarized you can parse it manually and read it
after v2.10 update you can just use loadConfig
Hey, sorry for the simple noob Q;
I was wondering how to pass a var from one script to another, neither of which calls the other.
Two scripts being called from Activation / Deactivation of a trigger, generating random RGB values on the first, need them in the second.
Both scripts are just changing the texture of another object, if I can store the value in that object as raw data that will work.
If it's local on a client you could use global variables or like you said store data on the object via setvariable.
If it's all done on the server you can also use global variables on the server or other stuff like the different namespaces
I'm not familiar with namespaces, but I couldn't use a glovar here because there's more than 1 of the trigger+object I'm making and they need to work independently / each have unique random RGB data
@runic quest if youw ant to prevent cheating, turn on battleye
Yea then use setvariable, easiest way.
rgr, thanks again!
hi how do i fix white screen slideshow that is not showing the actual images
Β―_(γ)_/Β―
moar details please! ^^
hold on wanted to show what in game is like and regular and its uninstalled itself
how do you use them? where do you set them up?
everything is set up on eden and im using it as a campaign brief
by script?
by the module for ace
buttonSetAction doesn't seem to be working on my RscButtonMenu, Is there a different function or am I just not doing this correctly?
buttonSetAction [127, "[] spawn client_fnc_createNewCharacter;"];
do you have the control's reference?
What do you mean by that? Sorry
I wonder where do you run this code, if you can add code to UI config, etc
I figured it out there now, Sorry to bother!
a mistake somewhere?
Yep, wrong IDC, that was from a test init.sqf in an editor mission from local. Forgot to update when I moved to the server!
ah ok ^^ good catch!
Is it allowed to send decently long issues in here or should I pastebin it?
Everything is laid out in there,
the db cannot call compile it due to the error at the top
and I know the code is horrendous, definitely cleaning this up after lol
Alright, no more exploding trucks or !exploding helipads, for the moment.
Next challenge, getting my addActions to fire properly in a multiplayer setting.
9:30:23 Error in expression <[1,[["76561198119367976",""XTW5554"",100.00,2000.00,"Wayne Payne"]]
``` the `""string""` thing
thats just how the DB pulls it, I have no clue how to fix it from the inserting side...
the citizenid was added recently, before all of this worked fine,
does it happen to be for a l*fe server?
if so, check their discord (listed in #channel_invites_list)
_shopname = format["%1's Store", _name];
used to be:
_shopname = format["%1's Store", name _player];
_statuses = [[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],100,100,100,0,0,0,[0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],0,[0,0,0,0,0],["nobody",0,"no reason","NO DATE"],[_citizenid,"0"],0];
used to be
_statuses = [[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],100,100,100,0,0,0,[0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],0,[0,0,0,0,0],["nobody",0,"no reason","NO DATE"],[_uid,"0"],0];
its not Altis Life RPG, its a different base...
its written off of rpframework, which hasnt been touched in years
Im just completely lost here, :/
hi lost, I'm dad!
that's database, ask rpframework something? with a bit of luck, even a l*fe server may know
yeah worth a shot, thank you
Scrap getunitloadout, it can't detect used magainzes properly if you have more than two used magazines. So free ammo for the player π
Will do, thank you
Anyone aware of any common functionality (CBA/ACE/RHS or core Arma) that creates objects of type Logic with arbitrary locations and sides?
β¦createUnit?
I mean stuff that's actually using it. We have some odd Logics popping up and I'm pretty sure it's nothing in our code.
bis_fnc_ambientAnim does it
If you're using a Zeus mod like ZEN or Achilles that might also use logics for some things
yep, and I intend to have it use only ONE logic for all anims soon\⒠(most likely⦠2.12 if it happens)
Oh, that'll be fantastic
I swear that yes indeed
Any chance you could touch on this while you're in there? :D https://feedback.bistudio.com/T164264
might even use that opportunity to add animation presets too, if we could use some new ones
ye
Nice
hmm, there is one use of ambientAnimCombat deep in the codebase :P
Doesn't look like it's called though.
We have a lot of code that's basically checking whether there are units of a particular side within a radius. I'd rather not have to do a select { typeOf _x == "Logic" } on all of them.
So you actually wrote some code for arma π
I wrote my own (hopefully future) BIS_fnc yes
and for perf reasons, I have a better version of BIS_fnc_ambientAnim using setPosWorld and only one Logic object to lock this
I hope you wrote it from scratch.
I believe I did (from scratch, not the artisanal version :-p)
that or I rewrote so much that it's not even the same thing anyway π but ofc still takes the same parameters etc
I am sad you even asked π π
to improve the performance of missions using it
if you break something.... π¨
I want to fix functions, I won't be adding any new ones for now (afaik)
if I can add stuff though, it's open bar! π
Not sure you can actually "fix" that function with all the hardcoded offsets
or did you add like all other "sittable" items with offsets?
(it is not confirmed yet but) I could add more offsets etc!
I at least fixed the "1 anim = 1 Logic" which is actually QUITE helpful (and iirc already used in my LM_CAAS mission ;-)
it is made so to ensure the unit does not move away (pushed by a vehicle, sitting on a chair, etc)
I know. π
is there an easy way to hide a vehicle's muzzle flash when its turned into a simple object?
Yes, check the biki
_tank hideSelection ["zasleh", true];
_tank hideSelection ["zasleh2", true];
This is the muzzle flash
Not sure if it's called that way for all vehicles though, probably not
yeah it didn't work, I thought there is like a way to get a list of animations responsible for the flash?
or selections? idk what causes the flash on the simple objects
You can get all selections with selectionNames, but that's not really helpful.
I wonder if the BIS_fnc functions handle muzzle flashes
still doesn't help much
because we don't know the selections
Would need to check simple object data in the object. Perhaps selections to be hidden are defined int here.
vehicle muzzle flashes are animations
you can hide it by setting the animation phase to 0 (or was it 1?)
yeah but is there a way to filter these animations?
check the config
I'm looking at the properties
but I can't find an array that has to do with animations?
To be honest I'm very clueless about animations and their phases, so I'm probably looking for the wrong thing
then find the muzzle flash
_cfg >> "Turrets" >> _turretName >> "selectionFireAnim"
hide it with this
It works
But
If its a tank
It will have the commander HMG firing too
Went i to the tank's config
Under turrets, there is only mainturret
There is no commander turret?
So how do I find its
selectionFireAnim property?
For the sub turret
Nvm found it
alright another question so I can finialize this, best way to snap the simple object to the ground?
of course we will use _Object setVectorUp surfaceNormal position _Object; to help with that
_object setPos getPos _object;
```_the trap is setup, let's see if he bites_
quick hide
see https://community.bistudio.com/wiki/Arma_3:_Simple_Objects#Scripted_Framework ?
BIS_fnc_createSimpleObject
or manually
BIS_fnc_simpleObjectData
BIS_fnc_adjustSimpleObject
they say these should not be used in MP?
where, beside BIS_fnc_replaceWithSimpleObject?
well I guess that's right
but how would BIS_fnc_adjustSimpleObject help me avoid floating objects?
use the create fnc?
i will check how they set the simple object position in that function
they use BIS_fnc_simpleObjectData return value π
hm nothing much, I guess I will put it in the floating object init
yeah I tried using the function with the object
[typeof this, getPosWorld this, getDir this] call BIS_fnc_createSimpleObject
it floats
yep
this also happens with the bar gate from vanilla arma 3
What does boundingCenter return for these things?
[0.00160265,0.0532498,0.500746]
For the plane?
yes
Yeah no idea then.
not a vanilla asset though π so try in a vanilla context to be sure to at least script it right π
I tried the bar gate
and H block watchtower
then fix the code π
tried it with BIS_fnc_createSimpleObject
the bar gate floats
you may have wrong value input, what do I know
This one
[typeOf this, getPosWorld this, getDir this] call BIS_fnc_createSimpleObject
```meh
try```sqf
["wantedType", getPosWorld _helipad, 45] call BIS_fnc_createSimpleObject;
It works but why does it work?
this doesn't work for planes?
it works for everything
you should also check the main config
for driver
the plane has no turrets configuration
can you write a path?
wrong something π
I said main config
_cfg >> "selectionFireAnim"
oh alright thanks
Hrn... my scripted trigger keeps resetting it's statements to ["true","",""] :c
how's your code?
are multiple ctrlCommits a bad thing?
it says all that? π
IDk, you tell me π
https://community.bistudio.com/wiki/ctrlCommit
well, no, no problem doing so π
why, what would you fear?
I fear the control would go crazy, if I call ctrlCommit before another ctrlCommit has finished
https://sqf.fini.dev/convert
uses them quite a lot if you use the "hpp to sqf" conversion option, so I don't think they are bad
SQF Converter. The best Arma 3 SQF tools out there!
ah Idk about that
empty code!
I should test that in the editor but got lazy π
no
great thx leo π
Does anyone here have much experience with particles/Blastcore? I love Blastcore's smoke/fire effects when a vehicle is destroyed, and want to use that effect for some burning oil wells that are a) permanent for as long as the mission is running, and b) visible from further away/larger (that one's less required). Does anyone know a good way to attach this effect to another object/play with the parameters on it?
probably not what you're looking for, but this will give you a basic idea of how to build your own emitter script -> https://community.bistudio.com/wiki/Particles_Tutorial
are projectiles that are launched from multi-tube launchers removed or moved from the muzzle position after launch ?
the projectile always seem to originate at the same position when drawn in a fired EH, but the actual missile flies away from a different slot. very noticeable on Cheetah and Tigris
red is the actual projectile position and direction drawn from the fired EH, but it's actually "launched" from the right bay ....
I think there is a script that runs on fired event that adjusts missile position
i'll adjust my EH a bit and track it the first 10 frames and see what happens
fired = "[_this select 0,_this select 6,'missile_move','MissileBase'] call BIS_fnc_missileLaunchPositionFix; _this call (uinamespace getvariable 'BIS_fnc_effectFired');";
RHS BM-21 probably works differently because it's made out of 40 pylons :P
interesting, didn't even think of looking at the vehicle if it had any magic done on it. TY π
i noticed somethinig, i try to track the times a client connects to the server, but noticed that Mission Event Handler "PlayerConnected", is executed every time the player goes from roleselection to the mission...
if i abort -> select a role -> continue , the event handler code is executed, how i can filter that, and only count it when a player is connected ?
what does "connected" mean to you here?
when a player join the server
there is a new eh for that
https://community.bistudio.com/wiki/Arma_3:_Mission_Event_Handlers#OnUserConnected
I mean, they're already connected to the server when they're in role selection...
yea, but i want to count how many times you join the server, and not how many times you change slots borting and selecting a new role.
"PlayerConnected" eh is triggered when you join the mission, not when you join the server, ill try with "onUserConnected"
onUserConnected triggers earlier than onPlayerConnected, I think.
yea, that might be a problem, but nothing that a waituntil cant do π ( inside a spawn)
spawn + getClientState I guess, yeah
I might be misreading you anyway. If the goal is to trigger once when the player first reaches the role selection screen and not again until disconnected, onUserConnected should be ideal.
does anyone have experience with the preprocessor commands ?
#if __has_include("\z\ace\addons\main\script_component.hpp")
// File exists! Do something with it
#endif
im trying to setup a file to load a config if 2 if statements are true
I was wondering if i could use
_count_
and if the count reaches desired # load the desired config.
maybe there would be a better way to do it , im not sure.
@half monolith ```cpp
#if CONDITION_1 && CONDITION_2
// load config here
#endif
ty π
would i need brackets at all ?
#if __has_include("\z\ace\addons\main\script_component.hpp") && __has_include("\z\ace\addons\main\script_component.hpp")
// File exists! Do something with it
#endif
this is basically what im trying to do if i am able to use multiple conditions i wasnt aware && was an option !!
You don't need parentheses if that's what you mean
the way i have done it above is throwing an error to load the mission in editor.
should i define vars instead ?
Hm
&encountered instead of =
thanks for your time
preprocessor command cannot be multiline
you need to escape it with \
in the file it is one line this is just how discord made it
this is beyond sqf lol.. seems only few know it
ok. try wrapping the whole condition in ()
Weird, I'm getting issues with #if as well
if it still doesn't work then maybe Arma doesn't support it
break it into multiple ifs
#if cond1
#if cond2
#endif
#endif
#if __has_include\z\ace\addons\main\script_component.hpp")
#__count__
#include "acestuff.cpp"
#endif
#if __has_include("\z\rhs\addons\stringtable.xml")
#include "rhsstuff.cpp"
#__count__
#__count__
#endif
#if __count__ = 1
//load ace arsenal
else
//load rhs arsenal
#endif
#if __count__ = 3
//load combined arsenal
endif
this was my idea, but i have no idea if this is how count is used
just this isn't working for me
#if __has_include("\z\ace\addons\main\script_component.hpp")
#define HAS_INCLUDE true
#endif
mikeros explodes
I'll see
#if __has_include\z\ace\addons\main\script_component.hpp")
also that's wrong anyway
#if __count__ = 1
so is this
I guess && isn't supported in #if after all, huh
I'd break it into multiple #ifs as leopard suggested
seems mikeros, my version at least, thinks #if isn't even a valid preprocessor macro
yeah like I said it's old
this "Seems" to be working but i do not have everything loaded to fully check it, i have just used the same file 2x.
i really appreciate the help guys, was stumped on this , hopefully this will be the answer
Ah I see, #if was only added to the BIKI in feb. 2021, makes sense
and yeah that should work fine
assuming no errors elsewhere
it loaded and ran fine with the includes i have and the two ifs on top of each other so i assume its good, but this is arma
if i can get this to work i can remove it as a param in the lobby hopefully
for reference does anyone know how count works in these files ?
You mean __COUNTER__?
I'm trying to populate the map with old blood pools, but I also need to resize with setObjectScale, so I tried to create simple objects with the model and texture of the blood pools. Here's the issue:
private _model = "a3\props_f_orange\humanitarian\garbage\bloodpool_01_large_f.p3d"; //model path returned by getModelInfo
private _texture = [0, "a3\props_f_orange\humanitarian\garbage\data\bloodpool_large_old_ca.paa"]; //texture path returned by getObjectTextures
private _crater = createSimpleObject [_model, [0,0,0]];
_crater setObjectTextureGlobal _texture;
_crater setPosASL _posASL;
_crater setDir (random 360);
_crater setObjectScale (0.4 + random 0.2);
setObjectTextureGlobal doesn't seem to have any effect and it always creates a "new" looking blood pool. I don't want it to explicitly look like blood, I want the dark splotch of the old blood texture. Is my method just not going to work?
["a3\props_f_orange\humanitarian\garbage\data\bloodpool_large_old_ca.paa"] this is the getObjectTextures return
Use alternative syntax. First one can't be retextured.
that won't work unless it got fixed, or i think it was #ifdef 
what alt syntax?
oh perfect thank you
Hi, can we disable the "onsingleclick" on the map to order "moveto" pos ? Because when i'm using the map and i'm commander it is always sending a "Move" order so it's annoying
private _agent = createAgent [typeOf _realUnit, _pos, [], 0, "CAN_COLLIDE"];
_agent spawn {
while {alive _this} do {
sleep 0.5;
_this moveTo (getPosATL player);
};
};
``` is this incorrect? Why is the agent not moving?
Alright, just starting to dip my toes into proper Addon making.
I've taken my project thus far, split the whole sordid stack into proper fn_ files, and generated a config.cpp. However, for the life of me, I can't seem to get it to register where the files are; every build I've tried has ended with 'Script addons\functions\fn_AirborneTrigger.sqf not found', and the config viewer populated with blank classes.
@manic sigil How is your CfgFunctions set up?
To shorthand it;
class cfgFunctions
{
class SRD
{
class functions
{
file="addons\functions";
class AirborneTrigger;
}
}
}
The addon folder is only about that complex; @MFAIO\addons\functions is where the files are all located, save for config in addons.
try this
class CfgFunctions
{
class SRD
{
class functions
{
tag="SRD";
file="\addons\functions";
class AirborneTrigger;
};
};
};
No dice :/
I even commented out the other functions; if I can get even one working, I'll at least be on the right track.
Hmm
Just to be clear and sure; the file in @MFAIO\addons\functions is named 'fn_AirborneTrigger.sqf'
missing the {} after the function name.
Although I have no idea if that's strictly required.
I had one previously, with description = "what the function does" and preInit = 1;
Same result.
I think you're a folder short though. The standard addon setup is @modname\addons\addonname\functions, with a CfgFunctions inside each addonname folder and a path starting at functions.
each addonname folder gets compiled to a PBO and so the structure remains the same.
Sounds arbitrary, but who am I to judge? So I need to fit another step in, ala @MFAIO\addons\newFolderHere\functions?
That could be the problem
is it possible to make the weaponInfo and stanceIndicator settings client side somehow?
they are set in the server settings
Hrn, well, at least I know that it's registering my different PBO updates. When you say a CfgFunctions inside each folder, do you mean a whole CfgFunctions.cpp/hpp, or just a class level in the config.cpp?
Is there an accurate way to determine the size of an explosion?
Right now im getting the explosion using nearestObject with the filter of #explosion
Or really any information about the explosion I guess
Finally T_T
class CfgFunctions
{
class SRD
{
tag="SRD";
class functions
{
file="@MFAIO\addons\Reinforce\functions";
class AirborneTrigger;
};
};
};
Im guessing pushing to PBO is supposed to be a last step, since it takes way longer to test changes?
If you enable filepatching then it doesn't make a lot of difference.
As long as you don't need to add a file or change config anyway.
Oh? With filepatching, do I just recompile in the config viewer?
I don't know. I just restart the mission which automatically recompiles.
It's a lot faster than restarting Arma at least.
As Ive experienced t_t
How do I prevent a unit from getting in/out of a vehicle on its own? Disabled ai "ALL" and it still jumps in a seat when I bring it near a vehicle it's assigned to
disabling simulation helps but then animations don't work
it also gets out when shot at
no ai mods
could lock the vehicle
then unlock when you actually want it to get in/out
there might be a better way though, dunno
I'm trying to have the player pick up the unit, place it in a vehicle, and drive away
the issue is the unit jumps back in whenever it's unloaded
using my own script not ace or anything
perhaps unassignVehicle
no problem
can you make button the default button so that it accepts enter press?
or do I just use event handler?
Found it! shortcuts[] = {DIK_RETURN,DIK_NUMPADENTER}; π
you probably mean functions viewer?
recompiling functions in an addon is sadly not that easy. the functions path is baked into the pbo which you would have to rebuild for which you would have to restart the game. but you could just symlink your functions folder to a new empty mission and recompile from there. for that you need a description.ext with the following line: allowFunctionsRecompile = 1;. Now you can recompile using the mission path like so:
TAG_fnc_fncName = compileScript ["functions\fn_fncName.sqf"];
Afaik, this solution does not even benefit from -filePatching as local missions should not be requiring that. If you have -filePatching, you can simply put your folder(source folder) with corresponding file path relative to Arma 3 root folder(so I put my non-pboed versions into arma 3 root using symlink[you can just have original there, matter of preference]) and all the changes I made is directly updated into Functions Viewer. allowFunctionsRecompile = 1 allows me to recompile using the buttons in Functions Viewer or I can also use BIS_fnc_recompile if I am too lazy to do it for each test. Therefore I do not really see the point of symlinking to a mission as well as compileScript usage as well as the usage of compileScript line. Thus I believe it is in fact easy to recompile functions in an addon. π
Yes, of course T_T
I got it figured, at least for now; unpacked my files into a singular mission so I can easily edit and tinker, packing is a finalizing action.
I'm trying to use the select {_x > #} on an array of arrays, passing a variable (which is a number) to #, but it's just not taking :/
RecruitCount = ([typeOf _helicopter,true] call bis_fnc_crewCount) - (count crew _helicopter);
spawnArray =
[
["vn_b_men_army_16", _helicopter, "AB"],
["vn_b_men_army_06", _helicopter, "AB"],
["vn_b_men_army_07", _helicopter, "AB"],
["vn_b_men_army_10", _helicopter, "AB"],
["vn_b_men_army_12", _helicopter, "AB"],
["vn_b_men_army_09", _helicopter, "AB"],
["vn_b_men_army_03", _helicopter, "AB"],
["vn_b_men_army_16", _helicopter, "AB"],
["vn_b_men_army_06", _helicopter, "AB"],
["vn_b_men_army_07", _helicopter, "AB"]
];
filteredSpawnArray = spawnArray select {_x > recruitCount-1}
Or if there's some way to iterate down the spawnArray for recruitCount number of times, that'd work too.
idk what that's supposed to mean
_x is an array
so _x > _number is meaningless
spawnArray select {_x > recruitCount-1}
do you mean you want to selectrecruitCountitems of the array?
as in recruitCount times?
Yeah, in the Array article they have an example of using select {_x >3} to parse every element from select 3 and up.
Buuuuut reading the Select article, I found a much better solution of just select [0, recruitCount]
an example of using select {_x >3} to parse every element from select 3 and up.
that's not what it meant
I guess :/
it meant select every _x that is > 3
...
it had nothing to do with index
aw feck yeah that tracks
It's a search function, ah.
filter
Yeah, that.
can you make control initially invisible via some config class property?
fade
ah, Im using ctrlShow in script but that probably isn't same as fade?
Hello, I have a doubt maybe any of you could answer.
Can "DefaultAction" be used with the
Action
command or the only alternative to this is using
player Action ["UseWeapon", player, player, 0];
```?
What's the goal for you?
@kindred zephyrβ
make the player shoot without the user input at set times.
but I just found that
player fire (currentMuzzle player);
works for what i was looking for.
i need focus player's map, when he open it on specific position (marker), how can i do it?
what do you mean by "focus player's map"?
Center on marker
For example, my position on right upper corner
But when i open map, it zoom and center on specific position
Marker, for example
using the Map event handler
https://community.bistudio.com/wiki/Arma_3:_Mission_Event_Handlers#Map
you can do things
Im found it, but i have no idea how can i catch map ctrl
https://community.bistudio.com/wiki/ctrlMapSetPosition
I know about EH. My trouble in understanging, which commands i need to use for focusing map π
ah! then, to get the map, use findDisplay 12
then use mapAnimAdd and mapAnimCommit
https://community.bistudio.com/wiki/mapAnimAdd
https://community.bistudio.com/wiki/mapAnimCommit
k, let me try
wait, actually mapAnimAdd etc does not need the display at all π
It works, thanks for help
w/ pleasure!
Does sqf say3d function attach created sound to the object? https://community.bistudio.com/wiki/say3D If not, what is the best way to play 3d sound attached to an object (to simulate sound generated by the object like a vehicle engine)
Yes
But if u attach say3d to ur radio, u can't stop music without deleting object
The best way - creating invisible helipad and attach it to ur radio, after that attach say3d to ur helipad
I think now you can delete a sound, because now say3d does return a sound object
thanks anyway
there is one more thing, can this really only play a single sound from single source?
does it also mean it will stop the sound currently playing?
you have to create multiple objects if you want to play multiple sounds at the same time
https://community.bistudio.com/wiki/say3D see example 2
(you don't need to use an invisible helipad)
Well && is not a thing, so you not being aware of it makes sense.
Well of course mikero explodes. Mikero doesn't know what mod you may have potentially maybe loaded at some arbitrary time later in some other program. It can't binarize that
nested if's is the way to go
I figured if you're using __has_include on external mods then the idea is not to binarize.
yeah binarizing and trying to do runtime checks doesn't make sense together
class CfgSounds
{
class longone
{
name = "longone";
sound[] = {"sounds\longone.ogg", 1.8,1};
titles[] = {0,""};
};
class fear-not-brothers
{
name = "fear-not-brothers";
sound[] = {"sounds\fear-not-brothers.ogg", 1,1};
titles[] = {0,""};
};
};
whats wrong with this? im getting odd errors
- not allowed
thank you π
is there a script that make AI pilots just do a transport unload 100% of the time regardless of nukes dragons and shit flying at em ect.
ive done autotarget combat ect turned off
ffs they just land for 1 sec and take off agin
this was working 40 mins ago i dont understand why
why the hell are they just tapping the floor then taking off
12 hours wasted ffs
Did you give them a transport unload waypoint?
yea
i dont understand this,,, they where working fine, then i moved it like 1cm back down, and they have the invis heli pad ect
I had this working earlier, so I feel like I'm missing something obvious. Helicopter should be tailing whoever is carrying hostage until it dies, but the helicopter just hovers downward to its flyInHeight and doesn't move.
finalHeli enableSimulationGlobal true;
finalHeli hideObjectGlobal false;
finalHeli flyInHeight 50;
finalHeli setPilotLight true;
{
_x setCombatMode "GREEN";
_x disableAI "LIGHTS";
_x disableAI "AUTOCOMBAT";
} forEach crew finalHeli;
0 spawn {
while {alive finalHeli} do {
driver finalHeli doMove (getPosATL vehicle hostage);
sleep 1;
systemChat "Final heli move order";
};
};
``` here's the setup. any ideas?
getPosATL vehicle hostage definitely returns a position
and finalHeli is defined
I also tried replacing driver with crew since it takes an array as well
resolved, helicopter can adjust to flyInHeight without pilot simulation enabled
I am not sure I understood the problem or the solution π
I was duped into thinking the helicopter pilot's simulation was enabled because the helicopter changed altitude to meet the flyInHeight threshold, so I just manually enabled simulation
Makes sense, I hadn't considered the binarization aspect at the time. It was just meant to be test of #if, not code I'd actually use in a mod.
so the nested ifs did work and i am using has_include but it didnt work as desired. its basically my description file and it throws error because it sees too many class arsenalconfigs
i ended up putting the if statements right in the arsenal for weapons backbacks items and mags, for each class.
it works for all mods concerned.
i did pack it with mikeroo it did take a minute..
it works dedicated as well
-Z=[i].wss,[i].ogg,[i].jpg,[i].sq* -X=*.txt -M -N -P
those are my packing params.
now someone can tell me why its a bad idea π
that would beβ¦ not scripting π
setMass propagation somehow so slow that it's much faster to remoteExec the damned thing.
One of those "why the hell is ACE doing that... oh".
hello people very good evening by chance you know some script to create a garbage box to put equipment inside and disappear
Yes sir!
You should use the ContainerClosed event handler π
PS: don't crosspost, thanks
sorry for the spam and in the form of a script how would it be to put it inside a box or another item you want
Can i create with Arma 3 script a PIP camera and a PIP monitor that shows what the camera is seeing?
As i understand you can use any box. Then you just put items inside it, when you close the box inside items disappears.
The ContainerClosed event handler can be used to delete items when the container (the box) is closed by player.
Yes
Just need to use a render texture on the monitor that links to the PIP camera
There is any game vanilla object that already have it?
also this, i suppose (although i don't know if things have changed since KK posted that) http://killzonekid.com/arma-scripting-tutorials-uav-r2t-and-pip/
Amazing! Thanks @south swan !
If it says you have duplicate classes, the tool is either bad or you indeed have multiple classes.
Could post your config in #arma3_config
But i heard mikero doesn't support #if? So its probably bad tools fault
But was workaround, just don't have multiple classes, put the if inside the class
how would i place the playSound3Ds position
whats the line to put in the config to make a the dress thermal proof? can anyone send me the wiki of that, trying to work on smth
better use say3D
but if you still want to use playSound3D, place an object in 3DEN, select it, then open the console and run this:
getPosWorld (get3DENSelected "object"#0)
afaik it's not something you put in config. it depends on the materials that are linked to the model
https://community.bistudio.com/wiki/setObjectMaterial though π€ If the custom texture can be applied to hiddenSelection, then can the custom material be as well?
it seems to work with the vanilla rvmat files, applying the vest rvmat onto the person makes their uniform have funny texture in visual and no thermal signature in TI
seems to work on my machine. I've copied the vanilla uniform rvmat to my mission folder, changed the texture in StageTI block to "#(argb,8,8,3)color(0,0,0,0)", applied that in-game with setObjectMaterial and got myself a normal-looking uniform that's black in TI
- You would need to have unpacked game files.
- Make sure the uniform has a hiddenSelection (i.e. with
getObjectMaterials _unithttps://community.bistudio.com/wiki/getObjectMaterials, the returned array shouldn't be empty). - Find a proper .rvmat file (i.e.
"a3\characters_f\blufor\data\clothing1.rvmat"seems to be it for the BLUFOR units i check). I'm not sure if there is a proper way of finding the exact thing, though. Maybe starting with the location of textures listed ingetObjectTextures _unitwould work. - Make a copy of the .rvmat file in your mission folder.
- Open the freshly made copy, find
class StageTIpart in it and change the contents totexture="#(argb,8,8,3)color(0,0,0,0)";. - In-game run
_unit setObjectMaterialGlobal [0, "clothing_noTI.rvmat"](with"clothing_noTI.rvmat"being the name of edited .rvmat file).
Wiki pages to read: https://community.bistudio.com/wiki/setObjectMaterialGlobal, https://community.bistudio.com/wiki/Thermal_Imaging_Maps, https://community.bistudio.com/wiki/Procedural_Textures#Color, https://community.bistudio.com/wiki/Super_shader
How can i remove messages like "idunnoplayer connected" from systemchat?
thanks
Not the best code but works π°
addMissionEventHandler ["HandleChatMessage", {
params ["_channel", "", "", "_text"];
_ltxt = toLower _text;
if(_channel == 16) then
{
{
if(_ltxt find _x > -1)exitWith{true};
} forEach [
[localize "STR_MP_CONNECTION_LOOSING", " "] call BIS_fnc_splitString select 3,
[localize "STR_MP_VALIDERROR_2", " "] call BIS_fnc_splitString select 2,
[localize "str_mp_connect", " "] call BIS_fnc_splitString select 2,
[localize "str_mp_connecting", " "] call BIS_fnc_splitString select 2,
[localize "str_mp_disconnect", " "] call BIS_fnc_splitString select 2
];
};
}];
not all objects support hidden selections materials
such as Viper/CTRG units
clearRadio if you mean clear the chat
i've just tried and "O_V_Soldier_Exp_hex_F" does, though
as in applying aaa setObjectMaterial [0, "a3\characters_f\blufor\data\clothing1.rvmat"] makes it shine in TI :3
no
more details pls
also not #arma3_scripting so go there β #arma3_config
ill post something this afternoon, if you dont mind looking. things "work" but, mikeroos didnt like it.
packed under protest, but no error.
I am no mod maker, only scripter/mission maker I'm afraid ^^
no need for mikero tools packing then, just save with Eden?
ive never tried editor pbo.
i like the compression with mikero
try it then.
π i will
ill show a config in the other channel in a bit
I have question about ending mission. this is the code I have: ```sqf
["Victory"] remoteExecCall ["BIS_fnc_endMission", _side];
// Rest will lose
{
["Defeat"] remoteExecCall ["BIS_fnc_endMission", _x];
} foreach _eneSides;
["Victory"] remoteExecCall ["BIS_fnc_endMission", 2]; // End game, must have end type specified
is that the correct way to end mission? I was thinking of putting something else for the server than "Victory"
victory should ideally be detected server-side
you can set whatever you want on the serverβ¦ but keep in mind that a server can also be a player π
(also β)
```sqf
// your code here
hint "good!";
```
β
// your code here
hint "good!";
it's all server code. When I put "Victory" for server (target 2) i think it may make all clients to end in "Victory"
if it is server-side, don't remote exec on the server? π€¨
it is just one extra step for nothing?
oh yeah good point have to change that
["Victory"] remoteExecCall ["BIS_fnc_endMission", _side]; // winners
["Defeat"] remoteExecCall ["BIS_fnc_endMission", _eneSides]; // losers
if (isDedicated) then
{
["ServerEnd"] call BIS_fnc_endMission;
};
@proven charm β
is ServerEnd special end for the server? i was thinking how to make it so that ending mission in dedicated wont effect client endings
no, define one in your Cfg
or use "Victory", whatever floats your goat π
and it doesnt affect clients?
no
great, i will take your word for it π
I learn from the mistakes other people make following my advices
thx π
@tough abyss when/if you have the time π€
Can't use camSetFov / camCommit or camPrepareFov / camCommitPrepared on PIP cameras? There is no change on zoom.
you can
can confirm, works on my machine.
Can also confirm it should work
well there's no reason it shouldn't. "PiP" is just a framebuffer
Indeed
Thanks, i must be doing something wrong.
Though the last time I checked the "aspect ratio" setting for r2t is broken for some reason
So that's fun
Then again so is a lot of the procedural texture stuff
Hey! Anyone would be familiar with a way to make a drone class harder to spot for AI?
How hard are you talking? Just 'easier to sneak around', or 'will not notice at all?'
I'm looking for the former but I'd settle for the latter π
you can either setCaptive (they will eventually notice it and look at it, but never consider it an enemy)
or use setUnitTrait for camouflage (IF it works for vehicles π¬)
Ah totally didn't even consider setcaptive
Will tell you guys if unit traits are effective
Didnt know about setUnitTraits, but was thinking setCaptive, maybe with a proximity trigger to keep anyone from being cheeky if they realize the power they wield.
hideObjectGlobal will make it pretty hard to spot :P
I mean you DID say you'd settle for them not noticing at all so...
traits don't work, captive does. I think no one is surprised but thought someone might wanna know 
thanks for confirming π
"Man, moving things to functions is going great, but it keeps throwing errors about undefined variables everywhere it didnt before, I should ask if anyone has any tips on how to avoid it."
...
"Maybe 'don't preinit your functions if theyre not supposed to run independently'."
"don't split what is supposed to be together?" :p
hello my fellows has anyone got a clue how to find where the impact of a projectile landed (grenade launcher shell probs)
don't ammo have event handlers now or is it 2.10?
i believe thats in 2.10 but im probably wrong
indeed
yeah just found that too
im trying to find the position of where a GL shell landed so i can set the players velocity for some arbitrary number in that direction
hmmm, i wonder if when i find a projectile via "Fired" EH and add a "Deleted" EH for it - would the second one fire properly?
what about "Hit"/"HitPart" EH @sullen sigil
from what I think I understood, you don't want to add an event handler on all ammo, you want to know "by what and where the player has been injured"?
nope, GL shell fired from player's launcher (will probably be custom gl shell) which lands and players velocity is set in that direction
basically a grappling hook
β¦ah
in the future please do tell when you plan "away from the usual features" kind of things π
I would say wait for 2.10 (or dev in DevBranch) because you need precision for that (that, orβ¦ use an awful onEachFrame π¬)
HitPart would be what I want wouldn't it be as that returns bullet impact right
for when 2.10
Be fair, it all works as intended, just doesnt like being told to find a vehicle that doesnt exist yet π
Is it not possible to fire a vehicle or something π€
I heard end of this month
I need to create a rope from the player to that direction so I'll need a vehicle at some point anyway
use the fired EH, replace ammo with your own object that is not an ammo, reuse the same velocity, ????, profit?
and then just figure out how to attachto wherever it collides with an object/terrain or something?
or would i want to freeze it when its velocity reaches 0 or something
something like that, the old and ugly onEachFrame
or, dev in Dev and wait for a month to release
HitPart is 2.10?
ah, the Projectile one, yes
are you releasing tomorrow that you cannot wait?
no i just have an incredible amount of free time right now
then go Dev? π
you'll be ready for the future and won't dev twice
unless you absolutely don't want to miss 1 week of public release then want to rewrite everything once again π
old and ugly waitUntil is fun :3
i think it'll probably be easiest if i just do it in dev branch for what im trying to do
What would be they DIk keycode for "CTRL + P", i can't find anything or any explanation how to calculate it π€
don't you try override the DLC popup π
Not my goal, i have a function where players can share notes and that's on CTRL + P.
So i want to display the proper keycode in a keybinds menu
https://gyazo.com/e19eb6cf036e62458b5cddb720a45507
I realised you could combine them because there is this "0x1D130023" for CTRL + H.
inb4 in-game matrix printer
i dont need to switch out of dev branch if i want to go play on multiplayer right
you do
sadness
https://dev.arma3.com/dev-branch
Multiplayer is not compatible with main branch. You will not be able to play on main branch servers, thus restricting you to a smaller range of testing servers.
time to force everyone in my unit to start using dev branch
but you can have both parallel with some SteamAPI magic I don't know
its fine i'll just end up forgetting every time
Dumb question im sure, but how absolutely necessary is it for your grappling hook to have ballistic physics?
how can you get less necessary than completely unecessary
it just needs to be fired from a GL
then fire and trace a straight line with lineIntersect commands? π
Custom blank ammo, onFired, move to cursorobject sort of thing?
Not cursorobject but i cant recall the proper command for 'where you are aiming'
not screenToWorld either
lineIntersectsSurfaces
having the actual gl projectile still "launch"/be visible would be nice but its not the end of the world if it doesnt
more thinking setvelocity in the direction of the "end" so that you've got momentum but effectively yes
I'm using CBA so I can use the invisible target vehicle for attaching the rope to and such
Yeah, that looks about right, I tinkered with it all of once when I was prototyping a shoulder-mounted grenade launcher/power armor type thing.
I'm unsure how I'm going to manage the precision part though
I've managed to attach a vehicle to any projectile but it's offset and I'm also 90% sure this is an awful way of doing it
Did this ever get fixed to work with Steam Guard?
no idea
for the HitPart EH I want to add that to the projectile don't I as that gets damaged upon impact?
use Deleted if you go for the projectile EH
so I want to grab the position, freeze the vehicle and set its position to the position returned in Deleted right
I guess?
goated
then rope create and setvelocity in that direction
this is easier than i thought
coolbeans now for the physics
does anyone know how to get rid of the initial funkiness
with collisions
Define initial funkiness and post your code
here
im not doing anything script wise to cause the movement
player addEventHandler ["Fired", {
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
if (_magazine isEqualTo "OPTRE_3Rnd_Smoke_Grenade_shell") then {
_projectile addEventHandler ["Deleted", {
params ["_entity"];
_entityPos = getPos _entity;
_Handler = createVehicle ["CBA_B_InvisibleTargetVehicle", position _entity];
_Handler setPos _entityPos;
player allowDamage false;
_daRope = ropeCreate [_Handler, [0,0,0], player, [0,0,0],500];
ropeUnwind [_daRope, 20, 5]
}];
};
}];```
slightly changed the code but it still behaves the same
First thing is for the love of all that is holy do not use getPos or position
Or setPos
You should use either ATL, ASL, or World positioning based on what the commands you're using expect
In your case
createVehicle expects ATL positioning
So use getPosATL
And setPosATL
and replace position with getPosATL too right
Not sure why you even have that to be honest
When _entityPos already has the same value
Good
And if it still acts weird it's probably due to your rope commands
In which case you'll need to tweak them
you can but it gets funky
I imagine physX isn't fond of it yeah
Either way the getPos/setPos thing is important to remember for the future
For almost all intents and purposes they are not the correct commands to use for positioning
yeah youve already told me when i was making my voice activated mines i was just being dumb
No worries
i cannot put a sleep command between the rope being made and it being shortened
welp
still complaining suspending not allowed in this context
_handle = 0 spawn {
player addEventHandler ["Fired", {
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
if (_magazine isEqualTo "OPTRE_3Rnd_Smoke_Grenade_shell") then {
_projectile addEventHandler ["Deleted", {
params ["_entity"];
_entityPos = getPosATL _entity;
_Handler = createVehicle ["CBA_B_InvisibleTargetVehicle", _entityPos];
_Handler setPosATL _entityPos;
player allowDamage false;
_daRope = ropeCreate [_Handler, [0,0,0], player, [0,0,0],50];
sleep 3;
ropeUnwind [_daRope, 5, 5]
}];
};
}];
};``` updated code
you need to spawn inside the EH, not when you add the EH
after the params and then you need to pass the params to the spawn as arguments (another params inside the spawn) as well
Right at the beginning of the deleted event handler
Do _this spawn {
Then params in that
Code in most event handlers automatically runs unscheduled
Meaning the spawn has to be in the actual event handler to make it scheduled
player addEventHandler ["Fired", {
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
if (_magazine isEqualTo "OPTRE_3Rnd_Smoke_Grenade_shell") then {
_projectile addEventHandler ["Deleted", {
_this spawn {
params ["_entity"];
_entityPos = getPosATL _entity;
_Handler = createVehicle ["CBA_B_InvisibleTargetVehicle", _entityPos];
_Handler setPosATL _entityPos;
player allowDamage false;
_daRope = ropeCreate [_Handler, [0,0,0], player, [0,0,0],50];
sleep 3;
ropeUnwind [_daRope, 5, 5]
};
}];
};
}];``` so like that right
Yup
roger
You should indent the code inside the Deleted EH by another layer, to make it easier to read
unsure if the sleep is working one moment
im working on the debug console right now so its a bit of a pain
i probably shouldnt be doing that
ah yeah funkiness isnt caused by shortening the rope like i thought
it still happens
Could largely be due to the fact that units in arma are kinda psuedo-physX objects and not true physX
Hence dragging them with a rope is a bit weird
What you could do is reel the player in with setVelocityTransformation instead of actually relying on the rope
And just use the rope as a visual effect
i dont know how to disable the rope physics
Me neither but perhaps you don't need to
ive seen things like this done before with the actual ropes as their physics so i think its just working around arma funkiness somehow
I think the normal method is to attach a helper object to units and attach the rope to that, but whether that enables pulling units with a rope is another matter.
i'll give something like that a go one moment
setVelocityTransformation + visual rope sounds like a good plan here.
i'll try the attaching method for the sake of it
Alternatively simply fling the player so quickly to their destination that they can't even see that no rope was involved :)
i was thinking that initially but i want a slower ascent
Understandable, mostly sarcasm
Lolwut
yeah
my thoughts exactly π
i'll try set it to one just placed in eden
works fine
If the cone is attached to the player then yeah, it won't be moved by the rope, because it's under the player's physics authority
can i attach the player to the cone instead
Yes
works much better but the player cant move or anything so
time to use an onEachFrame to set the players pos to the cone's pos
I mean unless you really need them to be able to do stuff mid-flight, just detach them once they're within x metres of the target position/when x seconds have passed, and they'll be able to move again
showMarkerNameFunction = {
if (!visibleMap) exitWith {};
private _display = findDisplay 12;
private _mapCtrl = _display displayCtrl 51;
waitUntil { (markerType (ctrlMapMouseOver (_mapCtrl) select 1)) != "" && (markerType (ctrlMapMouseOver (_mapCtrl) select 1)) != "empty"};
hint str ( markerType (ctrlMapMouseOver (_mapCtrl) select 1));
waitUntil { (markerType (ctrlMapMouseOver (_mapCtrl) select 1)) == "" || (markerType (ctrlMapMouseOver (_mapCtrl) select 1)) != "empty"};
[] spawn showMarkerNameFunction;
};
Whats wrong? No errors, just code wont work
I do indeed want them to be able to do stuff mid-flight
@rough summit where is it running from and why is it calling itself recursively
Running after map opening
before visiblemap check
sleep 3
So, recursively, because after first cursor on marker hover i need to hint different marker
without map reopening
Why not just start a loop upon map opening that terminates upon closing
This is not proper usage of recursion
is using distance a sin as well or is that fine
No that's fine just make sure you need scalar distance and not vector
roger doger
I dont want to rehint same marker name
If u still hover cursor on marker u gets a ton hints
I don't see how looping would cause that any more than your current solution
Your current code is basically just a less efficient loop that clogs up the call stack
should i also be concerned about the auto offset with attachTo being weird or is it normal
What is your decision?
My decision is that you should use a loop rather than recursion and show me what the debug console code you're running is
@sullen sigil That's normal
showMarkerNameFunction = {
openMap true;
sleep 3;
if (!visibleMap) exitWith {};
private _display = findDisplay 12;
private _mapCtrl = _display displayCtrl 51;
waitUntil {(markerType (ctrlMapMouseOver (_mapCtrl) select 1)) != "" && (markerType (ctrlMapMouseOver (_mapCtrl) select 1)) != "empty"};
hint str (markerType (ctrlMapMouseOver (_mapCtrl) select 1));
waitUntil {(markerType (ctrlMapMouseOver (_mapCtrl) select 1)) == "" || (markerType (ctrlMapMouseOver (_mapCtrl) select 1)) != "empty"};
[] spawn showMarkerNameFunction;
};
My debug console code
@sullen sigil anything that suspends needs to be scheduled
roger
Nvm, i found my trouble
Did you?
as in: not actually calling it at all?
i forget spawn function with loop π
I think looping it when it's already recursing on itself is redundant
In fact you may well forkbomb your game
Either loop it internally or externally
And get rid of the recursion
I dont understand how can i do this
How u can create repeatable hint for different markers without loop?
I'm not telling you to not loop it
while {visibleMap}?
I'm telling you to use an actual proper while loop instead of having the function call itself
I can't help much in terms of actually writing code since I'm on mobile atm
And I don't know enough about your use case to suggest how to do it in detail
talking of loops i think ive done a boo boo with my waitUntil
ropeUnwind [_daRope, 20, 2];
_RopeLength = ropeLength _daRope;
waitUntil { _RopeLength < 3};
ropeDestroy _daRope;
``` heres the snippet related to it
oh i thought it was updating when it called
Before the check
Not the destroy
But the variable sure
Only the code in the waitUntil gets run every check
roger
Just make sure it still ends with the condition
Also keep in mind
If you're not gonna use that ropeLength var for anything else you should probably just use the length command in the check directly
Will optimize the waitUntil a bit
not sure what you mean by that
saves a fraction of millisecond on every run
oh as in dont have _RopeLength at all?
ye, waitUntil {ropeLength _daRope < 3}; No variable assignments = no wasted microseconds
roger doger
for some reason thats making the rope spawn at debug
cone
never mind thats a mod conflict
no its not wtf
sprinting at all makes you and the cone go to debug
At the end of the day it's more about code cleanliness than micro-optimization
But an optimization nonetheless
As for the sprinting thing
i think it might be sprinting before the EH is passed
nope just sprinting at all
its spawning the cone at the debug corner i think
no its attaching to the debug corner rather than the position of the impacted shell
player addEventHandler ["Fired", {
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
if (_magazine isEqualTo "OPTRE_3Rnd_Smoke_Grenade_shell") then {
_projectile addEventHandler ["Deleted", {
_this spawn {
params ["_entity"];
_entityPos = getPosATL _entity;
_Handler = createVehicle ["CBA_B_InvisibleTargetVehicle", _entityPos];
_Handler setPosATL _entityPos;
_playerPos = getPosATL player;
player allowDamage false;
_ConeBoi = createVehicle ["RoadCone_F", _playerPos];
_InitialRopeLength = player distance _entityPos;
player attachTo [_ConeBoi, [0,0,0]];
_daRope = ropeCreate [_Handler, [0,0,0], _ConeBoi, [0,0,0],_InitialRopeLength+10];
ropeUnwind [_daRope, 20, 2];
waitUntil {_RopeLength = ropeLength _daRope; _RopeLength == 2};
sleep 8;
detach player;
ropeDestroy _daRope;
deleteVehicle _ConeBoi;
};
}];
};
}];
``` thats the latest version of the script
i should probably take another punt at indentation on that one moment
nope thats indented fine afaik
its not doing it when i dont move sometimes too wtf
insert a systemChat str _entity and systemChat str _entityPos in the Deleted EH after those things are defined and see what it says
wait its not because the params are above the spawn is it?
No, the only param you're referencing inside the spawn is being passed into it using the _this and second params
<NULL-object> and [0,0,0]
is this happening every time you try or only sometimes?
It's possible that sometimes the projectile has already been deleted by the time you get around to referencing it
Try putting the getPosATL outside the spawn (but still inside the Deleted EH) and then passing that into the spawn
That way it will be done a little faster
so have "_entityPos" inside of the params right?
and still in the unscheduled
_projectile addEventHandler ["Deleted", {
_entityPos = getPosATL _this select 0;
[_entityPos] spawn {
params ["_entityPos"];```
gotchu ty
doesnt return an array but i can just use _entity with params ["_entity"] before, right?
What?
it expects a string for _this select 0 but the EH only returns _entity
its fine the rope bit is working now time to stress test
it seems to be working
_this select 0 is the exact same as the first variable set by params
params just maps _this indices onto private variables
its working all good now, just needs refinement and such
as for how to do that refinement.... im not sure
I want a menu or script I can place in a entity to act as a recruitment point for AI squad members , like how KP liberations does it. Does anyone have an idea or a script I could use for our community?
I mean that could be something as simple as an addAction or as complex as a custom gui
how on earth do i pass a local variable through an EH
setVariable
if mission EH then its args
does that not make it global
does what make what global? 
setVariable make the variable global
it depends on what you set the var on
im just trying to pass a rope name through an EH
what EH?
Deleted
use setVariable then
_obj setVariable ["someVar", _var];
_obj addEventHandler ["Deleted", {
params ["_obj"];
_var = _obj getVariable ["someVar", 0];
}];
where is params ["_obj"] coming from
oh wait im blind
forgot you can do that
doesnt seem to work
player addEventHandler ["Fired", {
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
if (_magazine isEqualTo "OPTRE_3Rnd_Smoke_Grenade_shell") then {
_playerOrigin = getPosATL player;
_playerOriginPos = createVehicle ["CBA_B_InvisibleTargetVehicle", _playerOrigin];
_projectileRope = ropeCreate [_playerOriginPos, [0,0,0], _projectile, [0,0,0], 50];
_projectile setVariable ["_ddd", _projectileRope];
_projectile addEventHandler ["Deleted", {
params ["_entity", "_projectile"];
_projectileRope = _projectile getVariable ["_ddd",0];
ropeDestroy _projectileRope;
relevant bit of code
params ["_entity", "_projectile"];
where did you even get _projectile from?
Deleted EH only has 1 params
also are you running v2.10+?
yes i am
hold on im confused for this one second
how are you using _obj before _obj is brought as a param
im confused
i need it as _entity for later on
then use _entity instead
oh ADT is throwing a false error
player addEventHandler ["Fired", {
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
if (_magazine isEqualTo "OPTRE_3Rnd_Smoke_Grenade_shell") then {
_playerOrigin = getPosATL player;
_playerOriginPos = createVehicle ["CBA_B_InvisibleTargetVehicle", _playerOrigin];
_projectileRope = ropeCreate [_playerOriginPos, [0,0,0], _projectile, [0,0,0], 50];
_entity setVariable ["_ddd", _projectileRope];
_projectile addEventHandler ["Deleted", {
params ["_entity"];
_projectileRope = _entity getVariable ["_ddd",0];
ropeDestroy _projectileRope;```
its complaining that its a number not an object
my mod never throws errors
does your mod have better config viewer
ADT is my mod
it's right
_entity is not defined
_projectile setVariable ["_ddd", _projectileRope];
_projectile addEventHandler ["Deleted", {
params ["_entity"];
_projectileRope = _entity getVariable ["_ddd", objNull];
ropeDestroy _projectileRope;
oh i made a mistake before
its working now π
my bad
now i need to figure out why this cone isnt spawning on my position
seems to be spawning off to one side
that's due to createVehicle
wait itll probably fix when i switch it to the target thing
no it didnt
bruh
meh i'll just set pos manually
ADT looks pretty neat, alas I've not used it yet
hello its me again how do i make a script end if a criteria is not met
if !(your_criteria_here) exitWith {};
anyknow know this code?
this setPos [_pos select 0,_pos select 1,(_pos select 2) + 7000];
ah so not terminate
exitWith is for the current script scope, terminate is for another script you've saved the handle of
looks like bad code
_pos = getPosASL this;
_newPos = _pos vectorAdd [0,0,7000];
this setPosASL _newPos```
Looks like someone didn't know about vectorAdd lol
don't use setPos unless you need PositionAGLS (niche)
is there a way to hide physx objects or does hideObject work on them too
wiki is unclear
hideObject will work
π
Don't forget that hideObjectGlobal must be executed only on the server. Executing it only elsewhere, or executing it elsewhere and on the server, will not work.
epp how do i fill it out correctly?
its removing the collisions
Don't use setPos unless you're competent enough with SQF to explain in intricate detail the difference between all of the different positioning types and are able to explain why your specific use case requires positionAGLS
honestly when it comes to localisation im a moron
none of this is mp tested yet
Assuming you want it to fulfil its original purpose (moving an object 7000 metres into the air) just replace this with the variable name of the object. If you want it to do something else, it would be useful to know what.
its a drop ship for space marines
are you using the wiki
This is a fairly simple piece of code and you should be able to figure out how it works by quickly looking up the commands used on the wiki.
im a very simple person. but thanks for the help π
This piece of code alone is not a dropship for space marines, and I do not know how it fits into the larger system of a dropship for space marines. I cannot build a dropship for space marines for you, and I cannot troubleshoot such a system based only on this piece of code.
All this does is take an object and add 7000 metres to its altitude.
anyone aware of how to hide an object but retain its collisions
Doesn't work like that
The best you can do is use setObjectTexture or setObjectMaterial on it (with an invisble texture/material)
Hiding objects effectively stops rendering them including their collisions
i hope cones have hiddenselections
unless theres base game invisible objects
surely
you can potentially make your own if this is for an addon
can it be used in a trigger?
needs to just have physx and be invisible
idk much about modding in objects but can't you use the cone as a base?
The code mentioned before? Yes, but you must make sure the trigger only triggers once (e.g. server-only trigger) otherwise the altitude will be 7000 x number_of_connected_machines in multiplayer
ARGB refers to transparency doesnt it
Alpha (transparency), red, green, blue
ok so i want to set alpha to maximum transparency then
A can sometimes be brightness though, setting it to 0 doesn't necessarily make it invisible
For procedural textures it's ARGB
Ah right
its referred to ARGB in the code I think but is actually written as RGBA
either way i'll figure it out
this spawn {sleep 1; _this spawn WBK_DropPodLaunchSequance;};
thats another code but it starts instantly
That is in fact correct
But if you can apply a texture, just do setObjectTexture [0,""]. No texture means invisible
You can always try something that isn't a cone. There are plenty of small PhysX objects in Arma.
Doesn't work in MP
aaa
And isn't really meant for use outside of 3DEN
It does work in MP but only in very specific circumstances (i.e. not these circumstances)
i know it works in some instances
Yeah, you can do it to simple objects, but you have to remoteExec the hell out of it
ive got huge doors that were rescaled but im not sure how
If it requires like an onEachFrame remoteExec I don't count that as working
That's just a kludge
It only requires onEachFrame if the object is mobile. If it's just a static object that doesn't move or anything you only need to do it once. It's fine for props, floors, walls etc.
Fair enough
I do hope we eventually get stable object scaling supported
Has quite a few possibilities
Almost certainly never going to happen in A3. setObjectScale is the extent of that initiative. It is a native feature in Reforger/A4 though.
theres a tiny portable radio which i could try and just put inside of the player
I was thinking you could find an object that responds more helpfully to setObjectTexture. Then you won't have to worry about hiding it.
how on earth do i add 1 meter in the Z direction to a variable