#arma3_scripting
1 messages Β· Page 563 of 1
python is easier
easier*
ah yes
does the CYCLE waypoint needs a certain distance to the first wp in order to form a "loop" ?
it will take the closest (including "WP 0", which is group's starting point) @hollow lantern
alright so im using the vanilla respawn system, and i want to respawn with only 1 available loadout, how can i do that?
but for everybody, all the roles, just doesnt change the roles or traits, just what you spawn with
Hi,
My problem is i want to remove all items from a backpack in a cargo.
my approche get all backpacks names, delete all BPs from cargo, and add all BPs form name list.
But the new added BP still contains the items that the deleted one had bevor.
Can some one explain me this ?
my test code:
_test = {
params [["_container", objNull, [objNull]]];
if (isNull _container) exitWith { systemChat "Cargo isNull"; false };
systemChat "start";
_containerBackpacks = (backpackCargo _container);
sleep 5;
systemChat "Delete";
clearBackpackCargoGlobal _container;
sleep 5;
systemChat "Add 2 times className Backpack";
{
systemChat str(_x); // <- className ( not object )
_container addBackpackCargoGlobal [_x,2];
} forEach _containerBackpacks;
systemChat "Done";
};
[cursorTarget] spawn _test;
@tough abyss
After the skipTime exercise there just earlier, are you now ready to go in the deep end? Here could be something to get you going for respawn loadouts ππΌ
https://www.youtube.com/watch?v=Tmwt2lO2Iv0 ("[How To] Arma 3 - Custom Respawn Loadouts")
At least it works now π
it works to a degree. all my info and what i want is on there, just not the marker (on the cutrsc)
As mentioned before: Test with Vanilla Markers (check if they are on the normal Map ("M")), then exchange with yours.
Then you know: It's a marker config thingy.
Do you resize the map or move it around, with a script?
it is centered to the players location
The RscMapControl is... erm... kinda strange. Let's say it this way π
_control = _display displayCtrl 23539;
_control ctrlMapAnimAdd [0,0.15,getPos player];
ctrlMapAnimCommit _control;
Nothing else? No ctrlSetPosition stuff?
no
You mean the marker? I'd see it with my current ZL
if you reference this image https://gyazo.com/ebc4c343dcbb83e4c7b9eeda3eee4138
@forest ore there has to be an easier way..
i have like 11 classes in my mission i have to do that for all of them?
There usually is at least couple of ways to achieve something but without diving head-on it's really difficult to tell what is the best or easiest or shortest way.
i think i know a way
*magic*
so the respawn just uses the default loadout of the unit
what if i create a custom unit on the orbat creator and equip it with what i want the respawn clothes to be
orbat creator?
from alive
That's something ALiVE, that ORBAT
yeah, but i can change the units equipment straight from the orbat thing
thing is i dont even know how to spawn the custom units i created
I'd take a guess this here is for general Arma scripting so not many might be too familiar with how ALiVE ORBAT creator works or how it is possible to spawn custom units made with ORBAT.
If you'd insist on using ORBAT creator then it might be better to look help from ALiVE's forum (http://alivemod.com/forum/) or their Discord (which by the way iiiis??)
it just seems like something that should be complicated to do
why should it be so hard to edit the respawn loadouts, should be in the respawn module itself
there is usually a world between what should be and what we have
welcome to coding/Arma/coding Arma/Arma coding
also maybe this should not be your primary concern during your mission development; you can put it on the todo list and come back to it later
@tough abyss
You could also check the "Loadouts and Roles" section in the wiki, see: https://community.bistudio.com/wiki/Arma_3_Respawn#Loadouts_and_Roles
With a quick glance it would seem that it is possible to declare a custom loadout in description.ext
nah i barely understood it
@tough abyss Once you export the units/factions/whatever from ORBAT, you want to make a mod for your new units.
Then reference the class name(s), from within the configs that you have created.
Make a mod? Wym?
With ALIVE, there are things that can be scripted and things that have to be a mod.
Making new factions is a script
Making new groups is a script
Making new units is a mod
The easiest way to create "new units" is to take existing ones but completely change their loadouts. The players would be none the wiser.
Alright, so i edit the units loadout, how do the changes go into effect?
If you were to edit the unit's loadout using arsenal, they will retain the changes and start the mission with the equipment you gave them.
@winter rose fine, I bet this distance however is to long? The marker at the top is the "last" waypoint. The marker at the bottom is the location of the "first" one. https://i.imgur.com/Y7GFs9M.png
Damn, alright then thanks man
Hey i dont wanna change my factions units tho just incase alive spawns them in with nothing ( i want the loadout to be a jumpsuit with nothing) so i can just take a unit from a dif faction, change the loadout, spawn it in and make him playable and then go into attributes to assign that unit to my faction correct?
@hollow lantern given A β B β C waypoints - C being the "CYCLE" waypoint
if the B β C distance is the shortest, it will go back to B
if the C β A distance is the shortest, it will loop to A
Using Alive or no?
@winter rose 4 to 1 seems the shortest distance then https://i.imgur.com/dDt0ewl.jpg
I don't get it?
my question is if waypoint 4 who is set to CYCLE will connect to 1 or if the distance is to far away
to 1 yes
no matter the distance, only >the closest<
if you are not sure, you can still add a normal waypoint on 4, and add a 5th that would be "CYCLE" right on location 1
true, I'm about to test this out with only 4, but other Arma scripting test distracted me LOL
in Eden, you will see a small line as to which waypoint the Cycle will pick
That's why I have a testing VR environment where I can place scripts/stuff I want to test before putting it in a live mission.
This way I know it works on it's own without issues of other stuff being in the way. If it doesn't work in the live mission, it has to be something else that the script/feature I added π
when you scroll wheel on a targetbootcamphuman_f you can see a scoretable of whos shot it. is there a way to reset that? I can't find anything in the biki and at this point my only course of action is to delete and respawn the object.
@opal mulch try allVariables theObject on it to see BIS vars
thanks
yo lou, do you know how i could get allMarkers to show on my cutRSC? Everything works great except the markers dont show on it
Lou*
nope, IDK
(not because you didn't capitalise π)
I really don't know much about GUI
Oh, oky
Use ctrlCreate or something along those lines
@opal mulch you can most likely do something like
// _target is target object
['resetShootersData', _target] call BIS_fnc_target;
I'll try that, thanks a lot!
Can @winter rose please come to isle 3, can @winter rose please come to isle 3, thank you
*grumble* always in the middle of my showβ¦
ah, no can do - will have to wait for when I am home π
I'd wish Arma would have an SQF debugger. You start a script, set a debug point and can then check values in variables and such
Google arma dedmen debugger
I have an sqf debugger Β―_(γ)_/Β―
He's a bot that purges bots...
But thanks for the tip
And there also is sqf-vm with a theoretical Debugger
I am not entirely sure if this has an actual use case, but today Ive set myself a challange. It turned out uglier than I hoped π€
https://gist.github.com/Bloodwyn/ff8fd940f064fd321757468b47c5a5ba
Anyway to spawn Radio Transmissions(contact DLC) mid mission say through a trigger? So they dont always appear?
Also is it possible to attach that transmission to an object.
And there also is sqf-vm with a theoretical Debugger
sqf-vm's debugger is even less theoretical than the arma one
Anyone know why the waitUntil doesn't work since it seems to instantly activate whatever code is after it
_wp = (group _plane) addWaypoint [_vehicleDropPos, 0];
_wp setWaypointStatements ["true", "_waypointCompleted = true; hint 'Completed';"];
waitUntil {_waypointCompleted isEqualTo true};
_waypointCompleted is a private variable that only exists in the wapoint's statement @tawdry harness
MyGlobalVariable = false;
_wp = (group _plane) addWaypoint [_vehicleDropPos, 0];
_wp setWaypointStatements ["true", "MyGlobalVariable = true; hint 'Completed';"];
waitUntil { MyGlobalVariable };
@still forum but way less complete π π
debug_console extension is the best debugger
Ahh awesome thanks but now I get Error Generic Error in expression and the error looks to be at the ```sqf
waitUntil {waypointCompleted};
@winter rose
you didn't set it to false before @tawdry harness
the name of the person is the players name
so can't be changed, unless someone changes his/her name
hmm ok. More of a question directed towards Dedmen (TFR), I have seen some servers changing their teamspeak name when they join a server with tfr automatically.. any idea how to do that?
But there tfr name doesn't change to their ingame name (like it usually does), it is predefined by the server
That's part of the TS plugin, which takes the in-game name and sets this as the TS name.
or better said; the mod takes the name of the player (with profileName), sends this to the mods dll, which in it's turn sends it to the (local) TS plugin, which then modifies the name.
ok and can i adjust that to for example, just generate a random string of numbers and letters ?#
as far as I know that option does not exist
which wouldn't make sense either to have different names in-game and in TS
@still forum can you confirm this? because i have seen it
Grez I know it doesn't make sense, but it has a purpose for what I am looking for
Wouldn't setting the playable unit variable name in the editor works ?
Damn... So there's no point setting a variable name for playable units ?
there is; you need it to reference specific units in scripts
it shows that the name send to TS is the profile name
name player will return profileName in MP for real players
Couldn't I just change the else statement and add a selectrandom statement above or is that stupid
For what I am trying to do
in that case you'll need a modified version of TFAR
Ok I understand now. Thanks for the guidance Grez
@cold mica I changed the unit loadout and i spawned the unit in and nothing changed, am i supposed to take the edited config somewhere or something??
Does somebody know if it's possible to detect if the player is in ragdol?
if !(alive player) then {}; ?
or check this article by KK: http://killzonekid.com/arma-scripting-tutorials-forced-ragdoll/
@tough abyss What config? Are you spawning in a unit via Alive or editing an already existing unit?
alive doesnt work here, as player will ragdoll for example from cars without dying
such a pain this whole ragdoll
@ebon citrus it's not possible (unless you get selection positions and compare them to "normal" positions but that would be a heck of a hassle)
yeah, i figured as much from my own research. Welp, i guess i cant get ridd of cars driving over players
what do you mean?
the ragdolling of players after they are driven over by cars is causing issues with my mission
deleteVehicle
ragdolled AI atleast has "unconscious" anim state
yeah last i checked that was the ragdoll 'animation' but im not sure how reliable it is
so i can pick upo the animationstate and then switchmove
do you think switchmove will override "unconscious" ?
well, one way to find out
shame, doesnt look like it does
don't get run over
seems to be the most appropriate answer? if it's an AI vehicle, make a check for player's distance, and setVelocity 0?
I don't know how much unit stop true/false works on vehicles, but it's a lead
@ebon citrus
driving over people as well π€£
Β―_(γ)_/Β―
it's not that the players will suffer much from getting driven over, they are in godmode, but they can get stuck in weird places
better environment design should be in place, i guess
you could also add a check for player/any unit's distance in front of the vehicle, so it would be more "realistic" with the driver's field of view
@cold mica an already existing unit, i dont really care just tell me what to do to spawn any unit with a custom default loadout lol
create a new unit with custom loadout, and then spawn it...
All I know is that you can spawn a unit in the editor and edit the loadout using the arsenal.
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#MPRespawn
on respawn, setCustomLoadout
or make loadout in Arsenal, export with getUnitLoadout and use setUnitLoadout on unit you spawn
@exotic flax ive tried like multiple times lmao
obviously wrong because it didn't work π
im sorry
i ment i tried the orbat thing not the code
also where do i put that code
how do you spawn the unit?
re spawn
sigh i have no idea what you said earlier
editor? script? respawn templates? zeus?
or make loadout in Arsenal, export with getUnitLoadout and use setUnitLoadout on unit you spawn
export with get unit loadout?
???
! ! !
go to the wiki and read the documentation of those functions
and no offense... we really try to help you, but we can't explain complex solutions if you don't understand the basics
dude i dont code and i can tell this is some backwards shit
why isnt it do this when this
because Arma
and since we have no idea what you want, we also can't give a clear solution
i want it to work like antistasi
a basic loadout so when you respawn you go to a crate and get your custom loadout
... which took a full team with experienced developers to build... and you try to make something similar, alone and without experience
nahh man basically
this is my problem
i spawn the units in which will be the players
they spawn in and they make their custom loadout and save it etc
and then they respawn and their loadout when they spawn is the default loadout of the unit im using
which is immersion breaking
language, btw
so i thought of two ways to fix this, either change the default loadout of the unit itself through orbat or something like what you said
I can already think of 4-5 solutions, which all require scripts
Changing default loadout of the unit through orbat is not the easiest solution.
ik its just a workaround so i dont have to script
I would suggest to take a look at this:
https://community.bistudio.com/wiki/Arma_3_Respawn#Loadouts_and_Roles
i have but that would require to script in every single item
Oh, that's impossible. You will need to script for something that specific.
there has to be a simple script that calls on a pre selected loadout
Get the mod 3den enhanced and you can copy and paste loadouts.
when i export the mission will my friends need to download that mod to play it too?
No, it is clientside
alright ill test this solution
but bugged, so could become a dependency...
I whole-heartedly disagree. I have been using it for nearly two years and have had no issue with it.
I already had it a few times that I manually had to remove it from mission.sqm due to some unknown reason
What were you trying to do with it when it became a dependancy?
there has to be a simple script that calls on a pre selected loadout
Yes, but you still have to either use a default loadout, or define one π
no idea where it came from... probably due to settings or a module which got embedded. Although removing the dependency didn't break a thing
or an object which is normally not available
You are able to copy a loadout you made into text then paste it for https://community.bistudio.com/wiki/Arma_3_Respawn#Loadouts_and_Roles
One more time! π₯³
so on player respawn, call this loadout
I do not understand you.
All I know is that 3den enhanced can be used to copy a loadout and paste it into your description.ext for https://community.bistudio.com/wiki/Arma_3_Respawn#Loadouts_and_Roles
and addEventHandler "Respawn"
onPlayerRespawn.sqf
@exotic flax not especially, from what I understood there are multiple loadouts for multiple units
dude i think im starting to get it
its like the laptop thing, basically you go into the mission folder and you name a text folder the thing that will be called when a certain thing gets executed in the game
for example i put the skip time thing in my init for the laptop and named the folder skiptime in the mission file
and then in the text folder i put in the script that i wanted to happen
am i right?
if the script is build for that, yes
Too many things, use stuff sometimes
okay i put onPlayerRespawn.sqf in the mission folder what do i do now lmao
and start with something simple without the fancy stuff that even hardcore developers have issues with
if it wasn't hard you would be able to do it...
@tough abyss this is why we tell you to read to learn
please tell me you don't expect us to do all of it
All these links are a godsend.
Of course, I must suggest again that this is the exact thing I have used and still use to create the antistasi-like respawn system:
https://community.bistudio.com/wiki/Arma_3_Respawn#Loadouts_and_Roles
like... I have 15 years of programming experience, and even I've spend 2 weeks on figuring out how to handle the respawn stuff (with some special sauce)...
i looked at that like 12 times i still dont know what to do with that link lol
You look at the code in it and play with it until you understand
Or ask what part specifically confuses you.
its really not that hard
i looked at that like 12 times i still dont know what to do with that link lol
...
dude in the first moment i thought of an easier way
The orbat way?
That is not easier, you'd need to package an entire mod for it.
has to sure! Which one? Tell us
i know but still i thought of one xD
a workaround
im sure i can think of something
Go ahead, then let us know when you find so I can update the wiki
Alive Orbat creator works fine for creating faction mods, but it doesn't magically create everything you want
can i add the medic trait to a unit?
_unit setUnitTrait ["medic", true];
Yes, open the attributes of a unit and there will be a checkbox for it.
ah there we go
Both are viable solutions.
Wait, they added a checkbox?
imwe going to fix it
might be 3den enhanced thing
ACE thing isn't it?
but hawky has it anyways so they will see it any way.
@exotic flax idk about we all you did was tell me how hard it was for "an experienced team of coders" to do xD
I explained every part of doing yourself, and giving you links to where to find more information... and all you give back is "it's not hard, but I have no idea what you're talking about"
you know bill gates once said
shhhhh you're not Bill Gates
if you want something done efficiently, have someone lazy do it, hell find an easy way to do it
im the lazy guy here
Self awareness here
im not just smart enough to learnt the code see.. im smart enough that i dont have to..
just cause a rich guy said it doesn't mean it's true. A lazy person just doesn't get stuff done.
Ofc, in the 19 years of OFP and ARMA modding there has never been any other lazy coder...
geniuses can be lazy
lazy doesn't mean genius π
Be nice to nerds. Chances are youβll end up working for one.
In the end; read the wiki and learn from there. If something is unclear or gives problems, this Discord will be your best friend.
fixed it.
enlighten us
right, so i wanted the guys to spawn with nothing but the crye uniform right
and it was based on the default loadout of the unit
can i send screenshots here?
no, but you can link to a hoster ninja'd
i'm willing to learn
on the right you see the slots for me and my friends playable characters
the way its supposed to work is they start, they choose their loadouts with the crates and everytime they die they go to a crate and they load their loadout
thing is.. whenever they respawned the respawn system would spawn them in with the UNITS original loadout
immersion breaking, so i didnt wanna code
what i did.. i spawned in a survivor, close enough to the original jumpsuit, and as for the medics and engineers? ill apply those traits to every one of the survivors and name them that
praise my awesomeness. i just out bill gatested all of you
when i set a player to "player setUnconscious true" they lose their group icon, is there a way to turn it back on?
@winter rose @cold mica @exotic flax
so in the end you didn't get what you want, didn't learn anything, and are still not a multi-billionaire... Well done Bill Gates π€£
i did get what i want
when you respawn in you do it with nothing but a jumpsuit, the exact loadout i wanted
now i dont even have to code to remove the other original loadout, actually not even a single line of code
@exotic tinsel setUnconscious shouldn't change anything other than the animation of the unit. So it shouldn't affect anything else, unless there's another script which is tied to the players state.
there's a ton of buggy stuff with setUnconscious
so is there a way to turn the icon back on. i cant find a function call
lmao, whatever works for you
groupIcon is the thing for HC iirc
^
biki doesn't mention that π€
shhhhhh the wiki is fiiine
im kinda sad nobody noticed how i managed to do what everybody said i couldnt lol
The smartest way would have been to use "prisoner" unit and add them weapons at the beginning of the mission
.... simply placing the unit you want in 3den would have solved that, but you wanted something completely different...
so no... not impressed
Respawn would have respawned them without weapons
Hawky Today at 5:09 PM:
"and then they respawn and their loadout when they spawn is the default loadout of the unit im using
which is immersion breaking"
Reading between the few lines here@tough abyss how about this:
in the mission folder create a file called onPlayerKilled.sqf and in that file add the following line: player setVariable ["Saved_Loadout",getUnitLoadout player];
also in the mission folder create a file called onPlayerRespawn.sqf and in that file add the following line: player setUnitLoadout (player getVariable ["Saved_Loadout",[]]);
Now the players will spawn with the gear they had when they died
nah i dont want them to respawn with the gear they died with too that would kill immersion
... it's what you said what you wanted... and now not anymore?
Reading from all what you have written so far I took it that was JUST what you were looking for
removeAllWeapons unit π
but then they would spawn with helmets body armor etc
removeVest, etc
Anyway you got what you wanted, good
damn your not wrong
you're*
nahh man basically
this is my problem
i spawn the units in which will be the players
they spawn in and they make their custom loadout and save it etc
and then they respawn and their loadout when they spawn is the default loadout of the unit im using
which is immersion breaking
see guys that was the easy way to script it
// config A
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(framework\XEH_preInit));
disableModuload = true;
};
};
// script B
if (isMultiplayer) then {
[] spawn {
call EFUNC(code,setRespawnLoadout);
};
};
// script C
_loadoutNames = ["respawn"] call FUNC(getActiveLoadouts);
if (count _loadoutNames > 0) then {
_loadoutNames apply {
[missionNamespace, _x] call BIS_fnc_addRespawnInventory;
};
};
yeah the custom loadout is the jumpsuit with nothing haha
THAT is how you use custom loadouts π€£
dafak
it works with RespawnTemplate, sets insignia based on rank (which is in name of player), sets traits (medic/engi/sniper/etc) based on selected loadout and handles custom loadouts in ACE... oh, and a script to fix the position of items in gear π
but that's all written out in about 15 different scripts
ngl, all this argument actually gave me new scripts on handling respawn and I am thankful for that.
hayyy cmon this wasnt an argument lmao
something took you two weeks to figure i out i did it in 3 days without coding a thing haha
granted i wanted a default unit that had nothing on him but yeah
so much time spend on something that could have been solved in 5 minutes...
im just glad that it's solved
up to the next problem!
Next problem:
Asmodeus said this as a solution:
in the mission folder create a file called onPlayerKilled.sqf and in that file add the following line: player setVariable ["Saved_Loadout",getUnitLoadout player];
also in the mission folder create a file called onPlayerRespawn.sqf and in that file add the following line: player setUnitLoadout (player getVariable ["Saved_Loadout",[]]);
I want to use this. However, I want to getUnitLoadout when they first spawn rather than when they die. How would one do this?
I would setVariable the unit "originalLoadout"
and on respawn, setUnitLoadout (unit getVariable "originalLoadout")
If it has never been saved before how does one get it? Seems though that Lou is onto something there π
Is there a way to attach a trigger to an object via scripting? I.e. I am trying to attach a trigger to all medical containers that would execute the ACE heal function in a liberation mission
setVariables are transferred from dead unit to respawned unit afaik
@autumn nexus create a trigger and attachTo
Is when they first spawn here the actual first ever (initial) spawn?
So I would put a trigger down in editor, and then could script said trigger to be attached to any medical container?
no
create a trigger for each box
even though⦠it seems heavy. what are you trying to achieve?
Are you asking me @winter rose ?
No, when the player spawns, Asmodeus
What Iβm trying to do is every time I build a medical container in liberation, there is a trigger in the area around it that invokes the ace heal function
no, what you are trying to achieve is a heal function everytime you get close to a medical container
triggers are not especially involved π
Ok, well then yes, thatβs what Iβm trying to figure out lol
see createTrigger and forEach @autumn nexus
Ok
Now, I apparently did not understand what @cold mica was trying to convey but I hope Lou's suggestion was already enough π
I mean, what do you want to achieve with "getUnitLoadout when they first spawn rather than when they die"
It's a common problem so I don't blame you.
My desire is simple:
Players begin a mission with an already spawned unit which has a custom loadout. Different units have different loadouts i.e. medic has medic loadout, rifleman has rifleman loadout.
I wish for players to respawn with their exact loadout that they had when they first began the mission in their respective unit.
I also wish to do the above using event scripts.
unit setVariable ["SAG_loadout", getUnitLoadout unit];
and apply it on respawn (EH)
And thanks Uncle for taking the time to explain your desire in detail
Thank you for helping it make a habit.
And thank you Lou for the instructions. Forgive me for not understanding it fully earlier.
I will attempt to play with Lou's suggestion when I get home. I will return here if something goes wrong.
noooooβ *ahem* you're welcome anytime! π
So I could use some help with something, I have this:
currentEnemy = [enemySpawnPos, 0, enemyType, groupAlpha] call BIS_fnc_spawnVehicle;
And I need to select the vehicle in the created array, so I tried this:
waitUntil {((_this select 0) !alive currentEnemy) || ((_this select 0) isNull currentEnemy)};
But I get an error when running it, missing ")".
First time I'm trying my hands on "_this select 0", never tried getting info from an array before.
private _myVehicle = currentEnemy select 0
currentEnemy is an array, so you "select" its first element
Yeah, never knew how to do that though, thank you for the help! π
Why use "private" btw? isn't "_" enough?
not "always"
imagine your code being { _myVar = 1; hint str _myVar; }
good, working
but if you do
_myVar = 0;
call { _myVar = 1; };
hint str _myVar; // hints 1
Yeah, the same as hint "1"
it's not about this, it's about variable scope π
see https://community.bistudio.com/wiki/private for more info π
welcome!
π
Is it not possible to ```sqf
waitUntil {visibleMap};
I'm working on a script snippet to have one AI type ignore others. I'm new and suspect that getting the targets and applying forgetTarget is what I'm looking for. The syntax is still greek π This is where I am:
_protected = ["I_E_Scientist_Unarmed_F","I_E_Scientist_F"];
_aggregation = [_this,"","","",""] targetsAggregate _selected;
{
if (_selected isKindOf _protected) then {
onEachFrame {_zombie forgetTarget _protected};
} forEach allUnits;
my target selection doesnt seem to be proper
@mortal nacelle no idea what that "TFR" that you're asking me about is, nor what I have to do with it?
You could setBehaviour "CARELESS"? @grave lotus
Would that work in regard to only the two unit types declared in _protected?
ie careless to them, but not others
not exactly. but if it is a zombie, it doesn't have a gun so you should move it with move commands?
the goal would be to have them aggro everyone other than those classes called out in the _protected array.
basically making those in the array invisible to the zeds
Please tell me a way to find out the list of all killed players by a certain player. Like that list on the debriefing window?
I wish there was some kind of vanilla solution. Without handlers
I think it's something at engine level, but if anyone knows a command or a variable, it would be cool.
you may need to look up how the debrief dialog works in the configs
and where it pulls its info from
im still having a hard time figuring out how to attach a trigger area to all objects of one type. I am trying to attach a trigger to all huron medical containers that would execute the ace heal function when a player is within 5 meters
trigger would heal peeps even if helicopter is flying @autumn nexus
i have it setup in all my missions in a 3x3x3 trigger that only heals folks within that trigger
the problem is in liberation, the containers are dynamic where you place them, not necessarily preplaced like in a normal mission @winter rose
@winter rose Do you know how I can get a variable to store only once? E.g. I am trying to generate a random string everytime someone joins the server, but the function generates an infinite number of strings per person. How would I get it to only generate one and then stop?
call the function once? @mortal nacelle
See allMissionObjects, createTrigger and forEach @autumn nexus
Is it possible to make a script with "BIS_fnc_taskCreate" repeat itself to create more tasks but with different objectives depending on the code?
I'm wondering since I have no idea if you can duplicate the TaskID
I'm trying to make a script that spawns enemies dynamically, assign a task to destroy them, then have the script re-run when enemies are dead, creating a new task etc.
_var = player getVariable ["key", ""];
if (_var isEqualTo "") then {
_var = "random_string";
player setVariable ["key", _var];
};
Run this when a player joins and it will only run once.
PS. written on mobile so not tested π
How do one make an "elseif" statement in SQF?
Just "else if"?
you don't, without special mods that you won't want to use
there is no else if in normal sqf
π
if (1 > 0) then { "It's true" } else { "It's false" }; ???
but no elseif
best solution is using switch
I have elseif :D
if (1 > 0) then {}
elif (1 == 0) then {}
elif {1 < 0} then {} //lazy eval
else {"bonk"}
But I doubt I can pitch that to BI
I also have things like
_bool then {code}
getting rid of the if, not sure what use that really has tho π
adding more confusion to new scripters? π€£
Heya everyone,
Pardon if I am in the wrong subchannel.
I would like to change the light intensity/brightness of editor objects (eg Land_Camping_Light_F ).
The setLightBrightness and setLightIntensity commands change only light sources, I think.
What scripting command changes the lighting on an object such as this?
for normal objects you need to modify the config to change the lights
I am looking for a script which will keep my ai group together, example if I decide to do halo jump out of a plane they will jump with me, or if i teleport to another area they will also teleport
would also be good if I could enable or disable this function in a menu scroll option
best solution is using switch no
@still forum whatβs it like for performance? Can it beat call + multiple if exitWith
not according to Code Optimisation
hello, i got an idea but i dont know if it would work ! Can I put _myLocal = myEdenVar or myEdenVar2 in a sqf
to use _mylocal to call either myEdenVar or myEdenVar2
Am i pushing it if i ask you to explain it ?
like select (alive player); ??
why isnt there a number after select ?
[value1, value2] select false β will select first value
[value1, value2] select true β will select second value
because false and true are counted as 0 and 1 (for the select only)
βββ for the select βββ only ^^
so your code will select the globalVar1 if the player is dead and globalVar2 if he s alive ?
yep
and the private allows you to add two variables in one new ?
I'm reading it rn
I'm just not sure that i understand what "private your variable to this scope" means
like even in english
see https://community.bistudio.com/wiki/Variables#Scopes then π
local variables in a script always has to started with an underscore
In functions you should additionally mark variables as private using the command private
that is weird ^^ but i got it now
@unique sundial
whatβs it like for performance? Can it beat call + multiple if exitWith
didn't test.
only real special thing is that it creates a struct that stores if a condition already returned true.
all further elif/else/then are just ignored in that case, but still iterated over.
it should be close to call+exitwith.
I'll test quick
the reason why private _myLocalVar = [globalVar1, globalVar2] select (alive player); is a fonction is because of the select ?
_myLocalVar will be whatever globalVar1 or globalVar2 are, if it's code, it will be code, same for number, string, ...
its not a function
Not a function ?
So why do I need private ? It s written that i should add private if it s a function
Where am I missing something ?
It s written that i should add private if it s a function
Where do you see that?
you should generally add private to all new local variables you declare
to not overwrite any variables with the same name which were declared before yours
In the variable wiki page bellow the first example
Ok so it also works for variables and not only functions ?
Yeah but functions can uses variables right ?
it is that if NOT used in a function, and you call this function, this call may override variables you set in your script
Oh ok
So what dedmen is saying is that basically you don't know so just add private so you won't get screwed when _ is not enough ?
Now this calls to another question
Why not define all variables as public
Be sure that they all have different names ?
if they really all have unique names, and you are sure your function will never be called more than once.
Then you can do that, though you'll pay a small performance penalty
Pay performance penalty
Yeah sounds like arma
Unique names, I understand
But never be called more than one ?
well if your function is called twice, and they use the same variable names. they'll overwrite eachothers variables
local variables yes
@unique sundial
if (false) then {1}
elif {false} then {2}
elif {false} then {3}
elif {true} then {4}
else {5}
0.0839ms
call {
if (false) exitWith {1};
if (false) exitWith {2};
if (false) exitWith {3};
if (true) exitWith {4};
5
}
0.0553ms
soo.. not faster currently. Not sure if the perf hit is my fault and if I can fix it π€
Don't think I can make it much better.
Main problem is that i went the lazy-eval-by-default route, and thus all elseif conditions are code, which need to be called. I think thats the main impact.
lol, forget it. non-lazy eval works too π Haven't touched this in too long.
but that just gets it todwn to 0.0735
If then else alone is a bit of a drag
https://github.com/dedmen/Intercept_CBA/blob/master/src/SQFExtension/Utility.cpp#L607 code is up here.
the elif's have higher precedence to execute before the first then.
So basically
elif/then/else blocks at the end execute first to build the struct, then the first then executes and iterates through the other conditions from below, if the first one didn't match
just building the struct is already 0.0627ms
so thats where the perf problem is, I'll doctor around a little
maybe... testing performance with debugger and script profiler loaded doesn't make that much sense π€
call exitWith from above: 0.0069ms
elif from above 0.0078ms
I wonder if profiler or debugger is the one wrecking my perf..
~10 times slower? that's a lot π
Well I have profiler on full blast, including engine profiling from testing stuff a few days ago :D
only debugger loaded gets them closer together to 0.0081ms and 0.0093ms π
profiler loaded on minimal mode
0.0287 for elif
0.0095 for call
why does it impact my stuff more than the call :U
profiler says median 7.88us for elif
median 7.87us for call.
The rest is profiler overhead :D
So.. according to profiler they are on-par :U
no idea who to trust now, but I guess TLDR, the perf difference is so small its negligible
So maybe its viable afterall π€
Smith ΠΡΠ΅ΡΠ°, Π² 22:28
Please tell me a way to find out the list of all killed players by a certain player. Like that list on the debriefing window?
I wish there was some kind of vanilla solution. Without handlers
I think it's something at engine level, but if anyone knows a command or a variable, it would be cool.HorribleGoat ΠΡΠ΅ΡΠ°, Π² 22:36
you may need to look up how the debrief dialog works in the configs
and where it pulls its info from
I founda3\ui_f\scripts\GUI\RscDisplayDebriefing.sqf, but i can't see any code about kill list... Does someone know where is it?
I'd assume thats in engine
^
yep, in engine
Is no way to get this list?
aside from recording it yourself, or reading the text out of the debriefing dialog, probably not
Itβs sad. Thanks guys
Hi. Is there a way to know if the mouse (cursor) is currently on a dialog ?
thanks!
whether on a dialog.. uh..
I guess there is a way to retrieve x and y position of a dialog ?
And his height, width ?
found it
Hiya, I'm trying to load a cargobox into a vehicle using ace cargo and using this line in the boxes' init:
[box1, veh1] call ace_cargo_fnc_loadItem;
https://ace3mod.com/wiki/framework/cargo-framework.html#44-load-cargo-into-vehicle
just like in this example, but nothing happens. Anyone got a clue for me?
what vehicle is is?
cup datsun, there is enough space in the target vehicle
already tried with vanilla vehicles, same thing there, so the fault is likely mine and not ace's
Why box1 as a string?
oh wait, that was me trying different stuff when it didnt work the first time, but same result with no " "
is your box named box1 and vehicle named veh1
apparently the box was standing ever so slightly too far away from the vehicle to be loaded, strangely enough adding a 'true' bool as third param doesn't change anyhting about that opposed to what's described in the wiki entry :I
thanks for taking your time guys
was it just true or "true" you used?
true
maybe some other spelling error, now it works
nahh, Ive had the vehicle locked still when I tried adding the third param, vehicle has to be unlocked
Does anyone have any idea why keybindings break when I add 219 into the keybinding (Left windows key). Using a switch then case xx: { //code}; but everytime I add 219 it all breaks and no errors at all. Read the code many times over again and there are no issues with the code. Is there something special I need to do with left windows key?
idk but you could go through the ace framework on github and look at how they did it
they probably use CBA things actually
they fo
aside from recording it yourself, or reading the text out of the debriefing dialog, probably not
Can developers add into game some command which can show all killed objects by player?
LikekilledUnitsBy OBJECT
could probably, but... No don't think so
that killed recording system thingy is probably not usable enough for such a general command
and if you want that, you can just record that data by yourself already
Do you think anyone can to make system kill recording better than game developers? :)
Ok :)
quick question there, I have a custom Eden attribute defined that way :
class GSRI_frigate_attribute_addWeapons {
displayName="$STR_GSRI_frigate_addWeaponsTitle";
tooltip="$STR_GSRI_frigate_addWeaponsTooltip";
property="GSRI_frigate_addWeaponsProperty";
control="Checkbox";
expression="_this setVariable ['toto',_value,true]";
defaultValue="true";
};
It works just fine in Eden, as the checkbox is properly displayed with the correct name, tooltip and default value. Similarly, displaying the IG config viewer shows that the attribute is correctly added. However, when I run the mission, there is no variable "toto" in the object's namespace. I'm probably missing something very obvious but I can't put my finger on it. Any idea ?
Also as my config is properly interpreted I think it's more a scripting issue, but I can move this question to #arma3_config if needed
@rustic plover Try this http://www.armaholic.com/page.php?id=34541 or http://www.armaholic.com/forums.php?m=posts&p=197562#197562. Edit it a bit if you want to access and record kill data
Is it possible to attachto objects so that they stay locked together in relative posistion if the source object is moved? The stuff on my table needs to move along with table π
depends how the things are moved
attachTo is not very good for that kind of stuff
its pretty basic
is there a better function to use?
I have a moveable table and need the laptop on it to remain connected when the table is moved. right now it stays if table gets translated
somehow I need to lock them together as a single entity
attachTo will simply attach an object to another, making them unusable, but will stick when the base object is moved.
However there are objects which don't properly work (could be due to missing memory points)
@coarse schooner thanks, but I wanna integrate it with ACE spectator. I don't need a kill feed. I have written own script already
ill test some more. the 'table' i used was one of the rugged generators... makes sense that it might not have a memory point. ill try a table and see if that helps.
it's usually the case with smaller objects, so it could also be the laptop π
when googling for a solution I came across feature requests for grouping objects π That would be nice π
@grave lotus how are you moving the object?
I'll need to check how antistasi is handling the HQ object addaction for move. That may be the key.
Thanks for that π
what command is used when a player hits abort on a multiplayer server? im trying to duplicate that effect and i dont want to use endmission or failmission or forceEnd. they dont have the same effect.
i just want to send them back to the lobby.
As far as I know (and can find) there's no function which you can simply call to send someone back to the lobby.
player setdamage 1?
maybe with some UI button click
I know that KK has a script on his blog which automatically lets the player exit the server completely (and then login on a new server).
when the player aborts they just see screen with task status. but when you end the mission for them they get a success or fail message and they can navigate to the tasks status screen. how do i get them to task status screen with out the success or fail message and music?
or drop a link to point me in the right direction
this is the script by KK to switch servers, and does some closeDisplay and ctrlActivate magic to move around the UI: http://killzonekid.com/farewell-my-arma-friends/
rgr, thx mate @exotic flax ill dig in to it
Does anyone know of a way to remove grass within a certain area, without using multiple of the pre-included grass cutters to cover it?
I have over 10,000 grass cutters in my mission to remove grass in a specific area, and the grass cutter objects seem to be causing a large frame drop (having tested the mission a couple times both with and without grass cutters)
It would be easier to set a script to remove all grass within a certain radius, or perhaps within the region of a trigger
disable grass completely or make a bigger grass cutter object
How could I make a bigger grass cutter object?
That's essentially what I'm wondering
think you can use hide terrain objects in an area of type
can you? I could have sworn I tested that
grass are not regular objects, but clutter embedded in the terrain
@eager prawn create simple objects for grass cutter, will save you tons of perf
I have all my grass cutters set as simple objects
in short; the ClutterCutter object is a flat plane without textures
Still causes a frame drop apparently
@eager prawn can you remind me in about 10 hours? I can probably figure out a bigger grass cutter for you. But might be limited to 50x50m
@still forum that'd be great, thanks. Will try to remember π
obj side limit is 50m?
No. Not really. I don't know how they work, so I don't know what limits there are
But 50x50 is minimum that I know should be possible
is there a way to change surface type? once you know what kind of grass you want to hide?
https://community.bistudio.com/wiki/surfaceType
@eager prawn or whom ever is trying to help him
The returned surface type is a config name used in the terrain (so the list on that page might might be different on non-vanilla terrains)
you can't change the terrain with a simple function
large area
what about a loop that says if in area then set player setTerrainGrid x.
on all players
nvm im dumb
10000 objects means youre doing it wrong
youll need to make a new terrain if you want that big changes
actually... setTerrainGrid might work, although it will look terrible
true on both accounts
that massive edits are as far as I know not meant for scenarios
I've got 40,000-ish objects total
as you have noticed the amount of objects starts to bog it down
Yup
yea that is a lot
Indeed it is
That said, it's the easier path to go down compared to making a whole new terrain just to get rid of grass
Β―_(γ)_/Β―
unless it makes you lose 20fps
how big are the grass cutter objects you have now?
the largest ones provided by CUP
Off the top of my head, seems like maybe a couple meters across
ah
10x10 if I'm correct
10x10 meters?
well definitely would be good idea to get yourself bigger ones
50x50 at least
larger ones might work too
If it's 10x10, I definitely don't judge size right in Eden π
But yeah, mainly doing it for the airfields
would cut few thousand right off the bat
Oh easily
50x50 would cut off probably 90% of them
I got this far by doing packs of 100 grass cutters in a square
and then copy pasting them across the area
π
yea
tb?
they were replied to in #arma3_terrain , tis but a crosspost
@sonic linden delete dis π«
I'm implementing a killfeed and attempting currently, from addMPEventHandler I'm pulling 'name' and 'distance' from 'killed' - I don't see in the wiki what else I can pull from the eventhandler for meta data. I'd rather use a unit type than the specific unit name. Is there a list of the retuns that I've missed?
MpKilled passes the Killer Object as the 2nd argument, you should be able to get all info with that
if I say the actual 'typeOf' - that should return the next tier up from name, correct?
didn't get that?
typeOf will return the class name of the object.
If you want to know what kind it is, or if it's inherited from something, you should use isKindOf
I feigned ignorance so you would type for me!
funny! I'm looking into reducing the amount of grass cutters, like Hawkins. I'm planning on using Land_ClutterCutter_large_F and my research is not over. I look forward to seeing Dedmen's response!
oops
thanks for the classnames, makes my work faster
you're welcome!
Take a second to appreciate the name "ClutterCutter"
this is what I gathered from a google search, this is from 2013:
//null=[objectname,86,45] execvm "cutter.sqf"
_trig = this select 0;
_xpos = this select 1;
_ypos = this select 2;
_start = getpos _trig;
waitUntil {not(isNil "BIS_fnc_init")};
for "_x" from -_xpos to _xpos step 4 do {
for "_i" from -_ypos to _ypos step 4 do {
_newpos = [ (_start select 0) + _x, (_start select 1) + _i, 0];
if ( [_trig, _newpos] call BIS_fnc_inTrigger) then {
null = createVehicle ["Land_ClutterCutter_large_F",
_newpos, [], 0, "can_collide"];
};
};
};
omfg, that's actually terribly simple
and yes that 50x50 limit that I mentioned is a thing
I can make square 50x50m p3d
but first need to finish my food
Copy that. thanks!
the large one seems to be 10m circle
5m radius
@opal mulch @eager prawn cluttercutter p3d, should be spawnable via createSimpleObject.
Size is 36m from center so 72x72m
π
thats atleast the recommended roadway lod limit, maybe bigger works too not sure
cool!
Ok so there is a common thing that I want to be able to do and that is lock down the AI with a bipoded weapon to say like hold down a street. Now I have tried different commands and look at this extensively and csnt find anything on it. So can anyone help?
doStop myUnit ? @vale panther
@winter rose the thing I'm really looking for is would tjat deploy their bipod and say shoot 'more actuality' (sorry if miss spelling) I do not know if that is even possible.
(accurate?)
you can't deploy AI's bipod afaik
disallow the player from opening/closing the ramp on the blackfish. how would i do that?
@still forum thanks! So just copy the vanilla cluttercutter config, replace the p3d file, and PBO it? Or are you saying actually include this in the mission directory and spawn it?
I haven't used createSimpleObject before (outside of the "simple object" tickbox in Eden)
uh.. yeah you could... do a config replace
if you wanted to
Or are you saying actually include this in the mission directory and spawn it?
that was my idea, but yours would work too
Isn't there a problem with p3ds in mission files atm. Or am I misremembering a conversation here
For CreateSimpleObject
with sig verrif yes
Ah yes, that was it
I have returned with a new problem. I have several units with the following in their init:
First Unit Init
unit setVariable ["B11_loadout_00", getUnitLoadout unit];
Second Unit Init
unit setVariable ["B11_loadout_01", getUnitLoadout unit];
Third Unit Init
unit setVariable ["B11_loadout_02", getUnitLoadout unit];
The issue: I want every unit to respawn with their appropriate loadout. However, I am not sure how to do this. All I know is I have to use below in onPlayerRespawn.sqf
player setUnitLoadout (player getVariable ["Saved_Loadout",[]]);
Well your onrespawn looks correct
But in your code above you set a variable with a different name
Seems like it should be same name?
It should be different. I saved different loadouts on different variables.
No.. according to what I'm seeing. It should be the same
Try using the same. And then be amazed that it's working somewhat. (Should use local check.. but whatevs)
π€ I shall attempt your suggestion
Whatevs?
Evening guys what's up ?
I m looking at the format page on the wiki and I can't understand the %1 (or any number) !
Is it how you're supposed to call a variable ?
%1 (and %2, %3 etc) means "take the first argument of the following arguments"
format ["%1, %2, %3, %1!", 'A', 3, player];
// returns "A, 3, Hhaine, A!"
Mhhh ok but then why not use select 0
β¦?
Like I m basically selecting values in an array right ?
it's faster to format than do ```sqf
hint ('A' + ', ' + str 3 + ', ' + str player + ', ' + 'A' + '!');
so yeah, it's element 1, element 2, etc
it helps a lot for translations, for example
// Stringtable.csv
STR_Hello,Hello %1!,Bonjour %1 !,
``````sqf
hint format [localize "STR_Hello", name player];
English only please Lou!
Okkkk then you store it in an other file and can easily call whatever language you want
language + parameter yes
stringtable.xml normally for languages
yep (both are still supported in A3)
Sorry, missed your csv reference... but going forward the xml format is probably better and more easily read
I have gotten something wrong, Dedmen. The unit respawns with his original unit's loadout rather than the one in "Saved_Loadout"
U sure on respawn is running? Tried adding a diag log?
Made sure that saved loadout is not actually the same as "original loadout"?
I suspect that it is. I'm testing it out rn
Your code sets the loadout in init, which is what I understand as "original loadout" the one that it spawned with
onRespawn indeed does get executed. Now I just have to test out if "Saved_Loadout" has the correct items. Is there a way to "print" the contents of a variable?
print format ["My var: %1", your_var];
For diag_log use:
diag_log your_var;
//or
diag_log format ["My var: %1", your_var];
Thank you very much, time to delve deeper into these shenanigans of mine.
Is there any way to determin if a vehicle is safe to spawn at a position before actually using createVehicle?
I'm making a feature to choose to spawn planes in random hangars around base, but some of the plane options are bigger than the hangars, and I'd like to not have to write specific exceptions
Well I use bounding box and lineIntersects-kind-of-commands for that
I guess that would be your choice too
I figured as much, never used them before so they are a little intimidating to me
Although biggest drawback is that bounding boxes are all weird in this game
Some are extremely big for some units
See https://github.com/Sparker95/Vindicta/blob/development/Vindicta.Altis/Location/isPosSafe.sqf for inspiration... but mine ignores houses specifically, you will have to change that
You could just specify an array of aircraft that do fit and do a selectRandom of those alone
Alright, after some messing around, I have found out that
unit setVariable ["Saved_Loadout", getUnitLoadout unit];
is not working out well for me.
When I run
diag_log (unit getVariable "Saved_Loadout");
and check RPT, it returns Nothing. This means that I am not setting the variable properly. Where am I doing this wrong?
what is unit?
is it a local variable? is it a global variable? is it the name of an unit?
I placed it withit the init of a unit, thus I would assume it is the unit itself.
you need to use this
It is wrong to assume this. With SQF and Arma it's better never to assume.
now i realize I should have used this, huh?
yeah
Thank you, I'll try it out with this
I have used this in place of unit. It works nearly flawlessly. Now the only issue l have is the following error:
Error in expression <>
Error position: <>
Error Local variable in global space
Does anyone know what this error means?
What are you doing then?
This occurs right after respawn.
I understand that you run this in the init field: this setVariable ["Saved_Loadout", getUnitLoadout this];, right? But you are also running the logging part?
The diag_log part?
yeah
I removed it after my first Error in expression After a few restarts of the mission, the error still appears
So your diag_log is in the init field as well or where?
Can you just show full code please?
I will show you the full code momentarily.
_test <-- This is the name of the unit
init
this setVariable ["Saved_Loadout", getUnitLoadout this];
onPlayerRespawn.sqf
systemChat "Loading Loadout...";
removeAllWeapons player;
removeGoggles player;
removeVest player;
removeUniform player;
removeAllAssignedItems player;
clearAllItemsFromBackpack player;
removeBackpack player;
player setUnitLoadout (player getVariable ["Saved_Loadout",[]]);
systemChat "Loadout Set!";
_test <-- This is the name of the unit
Okay you have your answer then
In SQF there is a convention that local variable names start with _
When arma reads unit's name field, it sets _test to unit's object handle in missionNamespace. missionNamespace is where arma has non-local variables.
And non-local variables don't start with _
just rename _test to testUnit or anything
Understood, I removed the variable name of the unit.
Is sqf _thisreally sqf thisin your script, cause it should be the former
It's inside the init of a unit so I believe it should be this instead of _this, no?
Well, however it is meant to be, it works with this just fine.
https://community.bistudio.com/wiki/Magic_Variables
According to this page, this calls the object of the unit.
Oops... you are correct too and I had my second brain fart today π
(Removing _test fixed the error, btw, thank you Sparker)
using selectRandom in a config to get a new image each time, excpet it's the same 3 images out of 7 every time
any suggestions on getting more random results
__EVAL(selectRandom BACKGROUND_IMAGE);
which config? mod config or description.ext?
Mod
adds image onto the start up screen
https://github.com/56curious/VKN_Official_Mod/blob/master/VKN_Misc/config.cpp#L293
you get 3 random images though?
but just always one of the 3
so the selectrandom is working somewhat?
maybe you're just unlucky with randomness
the same with my loading screens (same system) 
nevermind it's 2 images only
2 and 6
out of 8
every time
one or the other
can you use functions in a mod config using __EVAL or __EXEC?
Probably not, functions are loaded way after the config
Thought as much
in a description.ext you can use mod functions defined at preStart in ui/profile Namespace
hmm, not sure what else to do about this randomization problem then
depends when the config entry is read, i can imagine loading screen being read after prestart
From what I remember of my previous tests it's shown after prestart yeah
Is there a link anywhere here for the latest AllInOne config
on the BIF forum thread that has all of them
thx
Guys. How to find out the fps server?
the server's FPS? @fleet hazel
from a 1s Google Search:
https://forums.bohemia.net/forums/topic/172468-get-server-fps/
Does anyone know of a way to get the servers current FPS? Ive been looking around and I found a function to get clients average FPS: https://community.bistudio.com/wiki/diag_fps I have been unable to get the server FPS, possible?
thn
Don't know if this should be on scripting or editor_arma3 but I'll try here.
I recently tried to export an SQF from a mission I made in the editor but unfortunately it doesn't seem to work. A friend of mine helped me find the issue, a layer that wasn't completed, but the modules in the SQF still don't seem to work. Any idea why that is? Can modules simply not be saved with this process?
if (_layer16458) then {
_item19042 = (group (missionNamespace getvariable ["BIS_functions_mainscope",objnull])) createUnit ["ModuleEffectsPlankton_F",[15231.5,14137.4,68.792],[],0,"CAN_COLLIDE"];
_this = _item19042;
_logics pushback _this;
_logicIDs pushback 19042;
_this setPosWorld [15231.5,14137.4,0.000335693];
_this setVectorDirAndUp [[0,1,0],[0,0,1]];
_this setvariable ["BIS_fnc_initModules_disableAutoActivation",true];
};```
This is one of the modules.
What do you mean by "still doesn't work"?
modules should be saveable
Can anyone guide me to a tutorial of sorts? Honestly I have no idea what I'm doing and these modules won't show up...
@cunning crown The modules don't actually appear after I executed the SQF in the debug console. Everything else does though.
From to wiki:
Of you want to place a module withΒ createUnit, you have to ensure that the module gets activated automatically by settingΒ BIS_fnc_initModules_disableAutoActivationΒ toΒ false,Β e.g:
Yeah
Awesome. Appreciate the help I'll try it out now.
Ah shit. Still doesn't seem to want to show up haha.
Also, I don't know if BIS_functions_mainscope is the right thing
So that should be changed as well?
///////////////////////////////////////////////////////////////////////////////////////////
// Module activations (only once everything is spawned and connected)
if !(isNull _item18813) then {_item18813 setvariable ["BIS_fnc_initModules_activate",true];};
if !(isNull _item19042) then {_item19042 setvariable ["BIS_fnc_initModules_activate",true];};
if !(isNull _item19066) then {_item19066 setvariable ["BIS_fnc_initModules_activate",true];};
if !(isNull _item19067) then {_item19067 setvariable ["BIS_fnc_initModules_activate",true];};
Found this further down.
I'll see if I change these it will work.
Nothing.
I don't know if BIS_functions_mainscope is the right thing
it is
I wish I could post the entire thing here with pastebin but it's so big I'd need pro lol
Here is the "Logic" section of the SQF where all the modules are though.
Sorry to derail but is there a way to determine I am inside the briefing map at the beginning of a mission through code?
https://community.bistudio.com/wiki/getClientState @vocal spade
Oh! Thanks a lot
Bump
*Boop* your nose
π
Hi folks, is anyone aware the mechanics for how Arma calculates score? That is to say - it seems to keep track of how many infantry and air/ground vehicles a player has destroyed, and I would like to access that information...
no can do, but you can build that array yourself with event handlers
I have done, but it is not accurate. I have a "killed" eventhandler on vehicles, and a player will kill the vehicle, but not receive the appropriate credit for it.
Β―_(γ)_/Β―
ikr
but nope, no direct access.
stupid arma is stupid
no u π
π
What do you mean with not getting credit for it?
Attach "MPKilled" to all vehicles and units, add to some array serverside and publicVariable it on changes (most simple setup)
a spawned endless loop then can keep some ui updated all the time (with sleep 5 or something among those regions, only needs spawn, sleep, while do and ctrlSetText)
mods can/will affect it too
especially if they make no attempt to have the game think the person responsible is the one who killed it and just for example, setdamage 1 them
affect* (verb) vs effect (noun) plz
Well that's my next avenue, if "Killed" eh is unreliable, I'll have to rely on MPKilled or MPHit, although it's trickier because in MP eventhandlers the code is run on every machine... so I think you have to limit it with if (owner _unit == clientOwner)
if killed is unreliable MPkilled is too
That's my fear. But yet arma score tracking keeps a perfectly accurate record
Wait, i thought you said the issue was it wasn't keeping score?
Oh no, game keeps score fine, if you bring up the score table it's accurate. In a perfect world I would like to find those results in whatever variable arma is using and use that information instead of creating my own variable
so whats the issue then? are you saying that even though the person who killed the vehcile receives score for it, in the killed eventhandler it doesn't return them?
Yep. Player will kill a vehicle (not just mobility kill - it will be destroyed) and the code in the "Killed" EH won't fire, and yet the score table will show them having killed a vehicle
looking for a script to create a green, toxic looking mist effect for a small area and if possible green puddles too, internet wasnt very helpful yet
handleScore doesn't tell me what was killed, just the score amount, so I can't work backwards to know what happened
But thanks
are you running anything like ace?
nope, vanilla
The server adds it when the unit gets spawned
well the eventhandler is local so if you're expecting the client to see it that's probably your issue, if you're doing it from the server using MPKilled instead is a better option probably
I'll try it that way, see if it works
Thanks for thoughts and advice, peeps.
@fervent kettle your starting point will be https://community.bistudio.com/wiki/ParticleArray and it will be a deep dive for you π
just found out that alias had a script but it only comes with white fog, hopefully i can change the color somehwhere
yeah changing the colour should be 'easy' as far as particle editing goes
'''''''easy''''''''
green puddles might be a lot harder - there's pond objects in stuff like cup terrains but i dont know how well it goes with spawning them and I don't think it'd be easy to change their colour
its not necesary tho, i`d be happy if i had the green mist xD
Does attachTo not work for simple objects?
Additionally is there a reliable way to attachTo the center of an object? boundingCenter seems to be incorrect
what about⦠trying (crazy, I know)
π
The reason i'm asking.... is because i'm trying and although it attaches properly, it doesn't follow position when moving the target object
then I suppose the attachTo "places" it, but then simulation doesn't follow (given it is disabled)
@austere granite if you are moving your object with setPos* then the attached object will always stay still, with or without simple objects
AdantehToday at 6:16 PM
The reason i'm asking.... is because i'm trying and although it attaches properly, it doesn't follow position when moving the target object
No PhysX, no updating of attached Objects :sad:
I just found that out, a couple days ago
Constantly spam attachTo, while moving the Object @austere granite
So I would like to make AI do the custom walk animations but when they do it, using Polpox's artwork supporter, they don't move anywhere, just walk in place. How do I fix this?
eh, guess I'll just have to do a attachTo on my object i want to "attach" instead. Any idea on the other question Dscha?
Additionally is there a reliable way to attachTo the center of an object? boundingCenter seems to be incorrect Basically for my mod right now im using drawLine3D, but switching over to a animated model instead
x and y are fine, but the height seems wrong. Also tried offseting with boundingCenter and stuff like that, but can't seem to figure it out
And using the bottom, instead of Center?
boundingBox, lowest Z coords should be the same with normal model
you mean bb select 1 select 2 right? yeh thats not it either
(boundingBoxReal _object) params ["_p1", "_p2"];
_height = (_p2 select 2)-(_p1 select 2);
_p1 = _p1 vectorAdd _bb_center;
_p2 = _p2 vectorAdd _bb_center;
_box attachTo [_object, [0, 0, ((_p2 select 2) - (_p1 select 2)) - _height]];
this seems correct
Yeah
wait
_height = (_p2 select 2)-(_p1 select 2);
((_p2 select 2) - (_p1 select 2)) - _height```
????
var is replaced in between, just only dropped the lines that matter here
Yeah, confuz0rd me.
ehhhhhhhhhhhhhhhh.... its different for terrain objects, 10/10
π
_box setPosASL (AGLtoASL (_object modelToWorld [0, 0, _attach_height])); with the same works, and I guess i need to do it in a loop anyway, woohoooooooo
Hi guys π
I was wondering if you have any idea how to exclude the "XXX was killed by YYY" message from the chat.
I know I could achieve this via difficulty settings but I want to be able to override those, anyone knows if it's even possible?
|| I looked into hiding the chat altogether before realizing that I'm actually going to need it π BIG BRAAAAIIINNN ||
only possible through difficulty setting
you can't edit any of those system messages
Hello there,
Is there a command to create an intel as createDiaryRecord does for the diary
create an intel?
As explained in the link provided by tankbuster, a entry that players can get with an addaction !
It's just a question out of curiosity !
The one I think of may come frome Achilles though
@finite sail can the function you provided in a standart script ?
I'm struggling a little with your english, mate. I've never used the function, but it seems that it places an addaction on an object with when used by the player can create a diaryentry
Can I use it in anyname.sqf ?
yes
Ok will try this then ;)
if youre in a multiplayer environment, you need to run it on the server
but i would check to see how that locality os going to work if you're using an adaction
as addaction is a local. don't know how this function handles the creation of the addaction in MP
Mhh I 'll experience localities for the first time then ! Thanks for helping :)
hehe good luck
my motto is, if the script doesnt work and it isnt a typo, it's always locality that's breaking it
BTW, please let me know how you get on, I'm planning to use this system myself soon too
ooooo wow, blue screen of death.. it's like i'm 20 again
good job i haven't just spent best part of a grand on a new pc
oh.... wait
For locality, see the wiki π
https://community.bistudio.com/wiki/Multiplayer_Scripting
@astral dawn
At dedicated server I also cheat a bit, and use startLoadingScreen (which increases scheduler limit from 3ms to 50ms) for a while if the queue of threads gets too big.
have you tested that? afaik startLoadingScreen just does nothing on dedicated
If I have a variable var that is a number str(myvar) returns my variable as a string.
Is there a similar command to input a string and that returns a number ?
parseSimpleArray
or that π
Ok will try ! Thanks to both of you !
@still forum
have you tested that? afaik startLoadingScreen just does nothing on dedicated
Yeah it boosts it to 50ms per frame on dedicated server too, I tested it with a custom script
I run game w/ -filePatching, but cannot rebuild my PBOs by MakePBO, it say 'Permission denied'. Did I something wrong?
Did you close the game? Otherwise the files are locked since Arma is using them
I enabled -filePatching for not doing it
File Patching allows you to change the files in an addon while the game is running, requiring only a restart of the mission. This makes it great for debugging, as it cuts down the time required between tests. Note that this only works with PBOs created using MakePBO, which build.py uses.
It's from ACE wiki
It allows you to work on mods without making a pbo first.
Allow the game to load unpacked data.
At least that's how I use it
I cannot to run the game without PBO from the official launcher... How are you do it?
I have both the pbo and files from the pbo together
you cannot replace pbo's
filepatching loads files from game directory in an unpacked state, if they are there
so youd want a Arma 3/z/ace/addons/common/XEH_preInit.sqf for example
For me it looks like this:
/mods/@my_mod/addons/something.pbo
/mods/@my_mod/addons/something/files
okay, thanks
What is faster, putting code directly into the mission box or having it in a script elsewhere and calling it from the missionbox?
mission box?
Did nameSpace setVariable ["myVar",true,2] ever work in single and multiplayer (server) or am I misremembering?
Hello I feel quite stupid as I must be doing something wrong.
I am trying to get the AI to fire at a position on a script while he is in a machine gun turret.
null = {gunner1 dotarget wreck2; sleep 0.5; while {!alive wreck2 and alive gunner1} do {sleep 4; gl action ["doFire",vehicle gunner1,gunner1,0]; }};
No errors or anything but he just stands there doing nothing in the turret.
is the wreck vehicle alive?
gunner1 dotarget wreck2;
sleep 0.5;
while {!(isNull wreck2) && {alive gunner1}} do {
sleep 4;
gl fireAtTarget [wreck2, currentWeapon gl];
};
};```
where are you executing this?
for now in the debug console to test
the end goal was to have it on an addaction and call it as a script
so that I could have multiple men shooting weapons at targets and turn them off again
as a script from an addaction you won't need to have a spawn in there, it will run unscheduled already
so as an sqf it should look like this?
gunner1 dotarget wreck2;
sleep 0.5;
while {!(isNull wreck2) && {alive gunner1}} do {
sleep 4;
gl fireAtTarget [wreck2, currentWeapon gl];
};
};
sleep 0.5;
while {!(isNull wreck2) && {alive gunner1}} do {
sleep 4;
gl fireAtTarget [wreck2, currentWeapon gl];
};```
could try using the doSuppressiveFire command as well
revealing wreck to gunner, etc
since you are using a vehicle you could also utilize the https://community.bistudio.com/wiki/aimedAtTarget command with a waituntil
no error so far using your last one wait out
arma takes a while to load π
huh no errors but he still just sits there
wonder if its a line of sight issue? is that a possibility
sadly thats not the issue and the doSuppressiveFire did not seem to work
I just need him to shoot straight ahead lol
hey I got it to work! @slim oyster
i placed an invisible unit and he fired at it! π π THANK YOU now I just need to make it so it can turn off and and give my unit unlimited ammo and im good, thank you again
oh there is a minor issue
they stop firing, and both have unlimited ammo or so they should as I putsqf this addeventhandler ["fired", {(_this select 0) setvehicleammo 1}] in the init of each unit and the vehicle (the machinegun turret) to be safe
so they stop supressing
is there a way to make it so the script loops?
wtf I had it and then is suddenly stopped working
make it 2
The Eventhandler should also fire all the time that unit shoots, as long as it doesn't change locality.
I am using MacRaes sitting script. Have some chairs down on the carrier though when you use the action it drops you into a sitting pose 5 meters below deck into the water instead of the chair position.
Has anyone found a fix for this? I tried setting a solid object underneath the chairs and also tried setting the axis
The script probably uses wrong height
