#arma3_scripting
1 messages · Page 514 of 1
I want to create a zoo in arma and I want to use gif for the textures to give the animals more of a real look I am asking questions
@young current That leaveVehicle command looks like it works. I'll try it now in sequence but I think you may have just solved my problem!
@blissful sand you cant use gifs as textures
thats what I am talking about -- the question is how does one do that ? now you know why I I am in the scripting room -- think of the quality of the animations and depth of range to do that -- and it makes no sense that it can not be done -- therein the next question where would one start to look it making it work in development
its not doable in any performance friendly way
Ok, new problem: They get out of the helo and don't get back in, but now they don't board the boat. GIve me a moment to take a look at this.
script doing it constantly on mulitple characters at once would start to clog down your framerate
@blissful sand a local setObjectTexture in loops, yup
also each frame needs to be its own textures and materials
I dont know what kind of depth you think you could get out of it, but I dont think such works in Armas engine
@pale sundial assign the boat as the new vehicle?
@young current I think it would work, but each setObjectTexture is loaded in video RAM once and for all. If we are talking 5 frames it's ok, if we are talking about 30 frames × 10 different animals… ouch @blissful sand
exactly what I meant above
@blissful sand do you have an example from some other game where this has been done and what it looks like?
currently the waypoint toget them into the boat is:
_wp2 = splashdown addWaypoint [getPos splashdown_boat,2];
[splashdown,3] setWaypointType "GETIN";
_wp2 waypointAttachVehicle splashdown_boat;
//splashdown setCurrentWaypoint [splashdown,3];
I'm thinking of uncommenting the setCurrrentWaypoint command and seeing if that fixes things.
And I've just seen from my own script that I never assigned them to the vehicle.
#followme -- just thinking out loud -- the entire idea comes from wanting to control the frame rate of each image vs an environment variable - as to the 30 frame a second --- in most objects they are symmetrical therein a 15 frame at half second clock and it is not effected if also there is the trigger control and zone code to make sure gif is paused until seen or in frame -- also size of the animated textures are not that large -- example the rabbit moves a set way -- so where is the hair movement or the eye blink for the rabbit ? or the rabbit eating or for that matter even sound he makes as he hops past you -- regarding some other game that is my point I have never seen in first person this is why I am asking and I I do know its not rocket science to add sprite animation tools the question is would not the zoo environment be a best example to display the effects as the animals are the ones with the widest range of motion -- maybe the need to think of a suit of clothing for the soldiers that blinked is another way to think about it -- we add lights to things and control them -- why can me not control the layering of skins of models on the fly? -- thanks for listen --
the engine does not natively support textures with frames and that you can not change. so no real gifs can be used.
and you can not control tiny parts of the texture either as the models are not created that way
closest thing you will get to gif textures in arma is this kind of thing: https://github.com/ConnorAU/A3AnimatePAA
though as someone said above, its not the most performance friendly task
yeah for what he wants it to do its not going to work
anyone know of a quick way to check if a magazine is a rifle grenade round?
Ok, lets ask a quick stupid question and then I've got to go: If I want ot use assignedVehicle with a group how do I go about that? I've tried "_vehicle = assignedVehicle _group" and "_vehicle = assignedVehicle group _group" but it always throws the error that it's not expecting one. Don't tell me I have to do this for each person in said group.
also @blissful sand if you have not looked into what the textures for animals look like, here is an example from the Arma 3 rabbit
Demon bunny.
you would have to recreate this for each frame
@pale sundial
it needs an unit
you can use the leader for example
@rugged tangle https://community.bistudio.com/wiki/currentMagazine
https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3 <- is your friend
@young current I don't think that will help me? I'm trying to check which items in a player's inventory are rifle grenades
BIS_fnc_isThrowable will detect throwable grenades but what about rifle grenades 🤔
you need to get the list of stuff the unit is carrying and check that array list against what you want to find
what do you want to do to them?
I'd like to save every rifle grenade type the player has to an array
There is https://community.bistudio.com/wiki/BIS_fnc_itemType but I don't think this will work
what is the use of the array?
are you just counting how many there are or do you want to do something to the specific items
It's an automatic resupply feature. At mission start everything significant in the player's inventory is saved and then the script determines what supplies to provide in a resupply crate
It doesn't know how to provide rifle grenades yet
so you just need the count?
No, the exact types
As Arma does not have rigle grenades by default, are they just like any other magazine?
and what do you use to collect the other items
Sorry, by rifle grenades I mean the standard 40mm/UGL rounds
That are in vanilla also
ah ok.
so does this https://community.bistudio.com/wiki/itemsWithMagazines collect what you need?
Maybe. I was thinking since there is no easy to way detect if it is an UGL round, maybe just delete the magazines and normal grenades from the array
That should leave only the UGL rounds I think
you can test it against the UGL round classnames
Yeah but with mods that's a pretty big list 😛
I dont think there is any other way
for the engine a magazine is just a magazine
it does not separate them into rifle magazines and ugl magazines and so on
Yeah
I think I will try with itemsWithMagazines and try deleting everything else from that
That should be possible maybe
so you want just the grenades in the resupply thing?
Everything else I already got figured out. Just the damn UGL rounds left
Just primaryWeaponMagazine
it should already give you the grenade mags if the weapon has a launcher
and its loaded
Yeah but what if the player has more rounds of different types in his inventory
It doesn't provide those
Yes
Example: Player has HE rounds in his launcher + smoke rounds in the inventory. Ideally I'd like both of those to be provided
you should be able to read what magaziens the primary weapon can use from the weapon config on runtime and then compare those to what he has in inventory
if you want it to be as dynamic as possible
https://forums.bohemia.net/forums/topic/182482-config-value-to-script-variable/ something like this perhaps
Hi. what would i have to write if i wanted to read parameters from a config of an object within a subclass? Ive tried to learn anything from the wiki but the descriptions for the config commands are confusing to me. Only thing (i think) i got is how to get an objects class na...
{
_type = _x call BIS_fnc_itemType;
if (!(_x call BIS_fnc_isThrowable) && (_type select 1 != "Bullet")) then {
uglrounds pushBackUnique _x;
};
} forEach magazines player;```
this seems to work
@young current
uglrounds = (magazines player) select {!(_x call BIS_fnc_isThrowable) && ((_x call BIS_fnc_itemType) select 1 != "Bullet")};
but that has duplicates. Also global variables should have tags. So like zan_uglrounds to make sure that noone else overwrites your variables, because that's a hell to debug
Yup, will tag it OFC. Just a rough sketch 👍
Cheers Connor that works perfectly but how would I add that code to the existing RscEdit?
Without the need to create a new one?
ud save the real text to a variable instead of a second rscedit, but im off my pc now so cant do an example for that.
waitUntil {...};
//command is like
onEachFrame
//?
certainly not
@languid tundra waitUntil is not cycle?
Well, the code given {...} is cycled until it returns true.
The code is executed in scheduled env. Hence, you can't exactly tell when the next cycle starts. It strongly depends on how large the queue is.
@languid tundra thank you!
What's the difference between enableFatigue and enableStamina?
none, they are aliases now
https://community.bistudio.com/wiki/BIS_fnc_dynamicText
I imagine that the coordinates are effected by the user screen resolution right?
@astral tendon
It uses https://community.bistudio.com/wiki/ctrlSetPosition internally... so whatever applies to the UI coordinate system should also apply here
[0.5, 0.5] should be the center of the screen
How to get cube root of a number? There's only sqrt command
Use the power operator 😄
|| 27 ^ (1/3) // Returns 3 ||
Or you can use log/exp commands if you are a math guru
|| exp(ln(27)/3); ||
I'm guessing this would work for detecting and removing grenades in inventory? call BIS_fnc_isThrowable Would I want foreach magazine player, or are grenades called something else?
Ah, you can use power like that?
That's nice
I mean, I know you can do that but didn't know SQF supports it
For a multiplayer game, is it possible to do an addAction on each unit so they can select a loadout, then remove the addAction option so they can only use it once?
Yeah I see no problem with that
do i just put the addAction on the unit itself though?
player addAction ["a useless action that does nothing", {}]; oh, I guess you can
yes when you add an action to player on player's computer, it just appears on this player's scroll men u
ok, that's what I was thinking
if (paramsarray select 9 == 1) then {
{
_type = _x call BIS_fnc_itemType;
if (_x call BIS_fnc_isThrowable) then {
_unit removeMagazine _x;}
} forEach magazines _unit;
};
Looking at that script above, that ^ will remove throwable grenades but not UBGL grenades. What am I looking for to do that?
I want ALL grenades removed
What's the current good practice for initialization scripts in missions?
Is it possible that in MP player has spawned before server's init.sqf has finished running?
And should I therefore put my initialization into preinit?
if your server runs -autoinit and persistent=0 then no, the server init would most likely finish before any player connects, if not then it is possible i guess.
you can put ur server init wherever you want, unless it requires no players are connected it doesnt really matter does it?
I am just thinking, how do I not f*** up for sure with so many different situations like if the server starts with players already, or what if a player hosts it, or what if.... something else
So I thought maybe there are some basic rules I should follow
in ur server init set a variable at the end sqf missionNamespace setVariable ["tag_serverReady",true,true];and in the client init add a sqf waituntil {missionNameSpace getvariable ["tag_serverReady",false]}; or something like that.
It all depends on what ur mission inits actually do, for example one of my MP modes is designed for the server and client init to run at the same time for map voting purposes. It will specifically sit and wait for players to connect before proceeding.
Thx, thats a good idea
Maybe if I wrap all my init.sqf into isNil, it will solve this synchronization problem for me?
I'd use preinit but I think I can't access eden-placed resources (objects, markers) in it
run the code in preinit instead? preinit is unscheduled.
Any ideas on removing UBGL grenades? Or the launcher itself (without referring to a specific item)
@astral dawn yep it appears ur right on that one. postinit works but it is scheduled too so up to u really.
This should work @tough abyss (if non-vanilla and/or needed for other types of items, you can tweak the find) ```sqf
private _typesOfUGLs = magazines player select {_x find "UGL" > -1};
_typesOfUGLs = _typesOfUGLs arrayIntersect _typesOfUGLs;
_typesOfUGLs apply {player removeMagazines _x};
I want to make sure ALL grenades are removed, throwable and launched, using vanilla and RHS.
This works fine for throwable grenades but not UGLs
if (paramsarray select 9 == 1) then {
{
_type = _x call BIS_fnc_itemType;
if (_x call BIS_fnc_isThrowable) then {
_unit removeMagazine _x;}
} forEach magazines _unit;
};```
Then just append the _x find "UGL" > -1 check to your existing loop
Also, your _type is completely unused, fwiw
oh yeah, I copied from an earlier post
There also may be a config you can query that'll return something unique for throwable and/or launched grenades, but I'm not sure offhand
I want em both gone if the option is ticked, so it doesn't matter to me right now
where would I append that UGL line?
as an "or" next to the BIS_fnc_isThrowable?
Would probably be a good place; since that's what's determining if you want to remove the magazine
if (paramsarray select 9 == 1) then {
{
if ((_x call BIS_fnc_isThrowable) or (_x find "UGL" > -1)) then {
_unit removeMagazine _x;}
} forEach magazines _unit;
};```
that didn't seem to work
That will work for UGL grenades from vanilla. No clue on RHS
I tested with vanilla and it left my UGL grenades in my inventory
someone was having a similar issue yesterday finding ugl mags. here is dedmen's solution https://discordapp.com/channels/105462288051380224/105462984087728128/541597276041379890
Probably that magazines returns everything in lowercase; in which case you'd need to toUpper _x or look for "ugl" instead
so this is saying "if it's a magazine, but not a grenade or a bullet, then it's a UGL"?
pretty much yea
Ok, neat. I'm guessing because they're technically in a "magazine", finding one UGL round would return the whole stack of that type then
either that or gnashes check should work for vanilla mags but modded mags could possibly be missing UGL in their class name, this should catch them too.
I must be doing it wrong
if (paramsarray select 9 == 1) then {
_uglrounds = (magazines _unit) select {!(_x call BIS_fnc_isThrowable) && ((_x call BIS_fnc_itemType) select 1 != "Bullet")};
{
if ((_x call BIS_fnc_isThrowable) or (_x find "UGL" > -1)) then {
_unit removeMagazine _x;
_unit removeMagazine _uglrounds;}
} forEach magazines _unit;
};
Ohhh it's an array gotcha
So how do I run removeMagazine on each item in the array without a big clusterfuck of code?
or should I just run a forEach on it
private _ugls = (magazines _unit) select {!(_x call BIS_fnc_isThrowable) && ((_x call BIS_fnc_itemType) select 1 != "Bullet")};
private _handGrenades = (magazines _unit) select {_x call BIS_fnc_isThrowable};
private _allGrenades = _ugls + _handGrenades;
_allGrenades = _allGrenades arrayIntersect _allGrenades;
_allGrenades apply {player removeMagazines _x};
It removes duplicates
_arr = [1,1,2,2,3,3];
_arr = _arr arrayIntersect _arr;
_arr //[1,2,3]
gotcha
Works, but it still leaves a grenade loaded in the launcher
I see setAmmo....
guys i added trigger for rearm
but i dont wanna ream instantly so how i can slow that down ?
sleep
I'm pretty sure
I thought this would work, buuuuuut
private _ugls = (magazines _unit) select {!(_x call BIS_fnc_isThrowable) && ((_x call BIS_fnc_itemType) select 1 != "Bullet")};
private _handGrenades = (magazines _unit) select {_x call BIS_fnc_isThrowable};
private _currentMagazineDetail = (currentMagazineDetail _unit) select {!(_x call BIS_fnc_isThrowable) && ((_x call BIS_fnc_itemType) select 1 != "Bullet")};
private _allGrenades = _ugls + _handGrenades + _currentMagazineDetail;
_allGrenades = _allGrenades arrayIntersect _allGrenades;
_allGrenades apply {player removeMagazines _x};
};
Yeah, no
haha
currentMagazineDetail's return value is gibberish to removeMagazines
Oh, have to parse it out first?
Oh shit yeah it returns a string
The display name for the magazine I guess
currentMagazine looks like a ringer
I tried the above script I posted with currentMagazine instead of currentMagazineDetail and it broke the whole thing apparently
Does this make sense? I want to make sure that OPFOR and BLUFOR aren't the same
_BLUFORfaction = paramsArray select 6;
if (paramsArray select 6 == 12) then {_BLUFORfaction = floor(random 11);};
_OPFORfaction = paramsArray select 7;
if (paramsArray select 7 == 12) then {while { _OPFORfaction == _BLUFORfaction } do {_OPFORfaction = floor(random 11);};};```
yea, makes sense
you may consider doing something like this instead though, just so you dont need to keep looping until they dont match.
_OPFORfaction = selectRandom([0,1,2,3,4,5,6,7,8,9,10,11]-[_BLUFORfaction]);
the odds of it being an issue are low but this avoids the need for it all together.
that makes sense
for removing multiple items, isn't there a way to stack things so I can add multiple items to one line, like
removeItems player "ACE_morphine", ACE_elasticbandage";
Do I make it an array right there like this?
removeItems player ["ACE_morphine", "ACE_elasticbandage"];
no... the wiki would say so if it did. wouldnt make sense to anyway, thats what things like foreach are made for.
I was just wondering if there was an easier way than adding 10 removeItem lines
a loop
So make an array than do a forEach on it
{player removeitems _x} foreach ["ACE_morphine", "ACE_elasticbandage"]```
Ohhh that's easier than what I had in mind, thanks man
doesn't seem to be working right
{_unit removeItems _x} foreach ["ACE_morphine", "ACE_elasticbandage","ACE_packingBandage","ACE_fieldDressing","ACE_tourniquet","ACE_quikclot","ACE_epinephrine"];
if (paramsarray select 11 == 0) then {
_unit additem "ACE_morphine";
for "_i" from 1 to 3 do { _unit additem "ACE_elasticBandage" };
for "_i" from 1 to 3 do { _unit additem "ACE_packingBandage" };
_unit additem "ACE_tourniquet";
};
for context
the whole thing or just the top loop?
neither really
is _unit defined?
🤷 removeItem removes that specific item, removeItems "Removes all items with given template" so perhaps any items that inherit from the provided one? idk. try removeItem its what i would have used.
I just did, no luck, I'll try the line by line way
yeah, doing it line by line worked fine
🤔
I have these distances correct, checked in the console, but the removeAllActions doesn't seem to be firing:
//remove loadout switch if player moves too close to center of zone
_loadoutdist = _unit distance startingpos;
waitUntil {_loadoutdist < (zonesize select 0) - 15};
removeAllActions _unit;
you only check the distance once...
you need to do
waitUntil {(_unit distance startingpos) < (zonesize select 0) - 15};
Ohhh ok
Are you sure you didn't mess up locality of removeAllActions?
But most likely your code gets triggered before your actions is added as Connor said 😄
Also consider removing action by its id, not removing all of them, because some mods might add some actions to player
how do you get their ID?
Check addAction return value
The finishing touch: I need to make sure players are spawning inside of this boundary zone, not sure how to go about it
//move respawn points to opposing sides of battle zone
_bluespawn = startingpos getpos [zonesize select 0, random 360];
_dir = [_bluespawn, startingpos] call BIS_fnc_dirTo;
_dist = (zonesize select 0) * (2);
_redspawn = _bluespawn getPos [(_dist) - (10), _dir];
//move intial players spawns to same location
_emptyposwest = _bluespawn findEmptyPosition [2,20,"Man"];
_emptyposeast = _redspawn findEmptyPosition [2,20,"Man"];
{
switch side group _x do {
case west: {
_x setPos _emptyposwest;
};
case east: {
_x setPos _emptyposeast;
};
};
If they're outside the zone for 10 seconds they get killed, and some people take a bit to load in
try using inArea?
haven't heard of that one, I'll go check it out
how do you mean? It works whatever it is lol
switch side group _x do {
case west: {
_x setPos _emptyposwest;
};
case east: {
_x setPos _emptyposeast;
};
};```
doesnt have a closing bracket for the block... unless there is more under that snippet
oh yeah, it's in a forEach loop
i see 👌
where would be the best place to use inArea? I figure something like
_emptyposwest = _bluespawn findEmptyPosition [2,20,"Man"];
if _emptyposwest !inArea playZone..... something something
How would I loop it to keep searching until inArea == true?
while {_emptyposwest inArea "playZone" == false} do _emptyposwest = _bluespawn findEmptyPosition [2,20,"Man"];
dont compare a bool to a bool.
not a constant bool atleast
private _position = [0,0,0];
for "_i" from 0 to 1 step 0 do {
_position = _bluespawn findEmptyPosition [2,20,"Man"];
if (_position inArea _zone) exitwith {};
};
i would do it in a for loop cause if ur running unscheduled while will exit anyway after 10000 iterations
does "step 0" reset it to keep going back to 0 until it exits?
kind of. at the end of the loop code it does _i = _i + _step basically. so this would do _i = 0 + 0
right
I successfully made my first thing today and even though it's totally not a big deal I'm super proud of myself 😄 I've been playing a lot of KP Liberation single-player when my unit's not doing anything, but managing AI squadmates is annoying and tedious, so I made a system that gives me a "Reinforce Squad" action when one or more of my AI squadmates goes down, and activating it respawns the fallen squadmates at the nearest valid spawn point and sends them trekking back to my location. I still need to implement some sort of refillable ticket system and/or maybe a cooldown timer so it can't be abused
Congradulations, you've made your first step!
Next step: crash your game by messing up #include path 😄
lmao
Something broke. My mission gets stuck on the loading screen:
//move respawn points to opposing sides of battle zone
_bluespawn = startingpos getpos [zonesize select 0, random 360];
_dir = [_bluespawn, startingpos] call BIS_fnc_dirTo;
_dist = (zonesize select 0) * (2);
_redspawn = _bluespawn getPos [(_dist) - (10), _dir];
//move intial players spawns to same location
_emptyposwest = _bluespawn findEmptyPosition [2,20,"Man"];
_emptyposeast = _redspawn findEmptyPosition [2,20,"Man"];
{
switch side group _x do {
case west: {
private _positionwest = [0,0,0];
for "_i" from 0 to 1 step 0 do {
_positionwest = _emptyposwest findEmptyPosition [2,20,"Man"];
if (_positionwest inArea boundaryTrigger) exitwith {};};
_x setPos _positionwest;
};
case east: {
private _positioneast = [0,0,0];
for "_i" from 0 to 1 step 0 do {
_positioneast = _emptyposeast findEmptyPosition [2,20,"Man"];
if (_positioneast inArea boundaryTrigger) exitwith {};};
_x setPos _positioneast;
};
};
_rotation = [_x, startingpos] call BIS_fnc_dirTo;
_x setDir (getDir _x)+_rotation;
} forEach allUnits;```
It looks like there's an issue with your open/closing brackets
Wait nvm
The indentation in that paste is confusing
here's what I had: ```sqf
//move intial players spawns to same location
_emptyposwest = _bluespawn findEmptyPosition [2,20,"Man"];
_emptyposeast = _redspawn findEmptyPosition [2,20,"Man"];
{
switch side group _x do {
case west: {
_x setPos _emptyposwest;
};
case east: {
_x setPos _emptyposeast;
};
};
and here's what it got changed to:
```sqf
//move intial players spawns to same location
_emptyposwest = _bluespawn findEmptyPosition [2,20,"Man"];
_emptyposeast = _redspawn findEmptyPosition [2,20,"Man"];
{
switch side group _x do {
case west: {
private _positionwest = [0,0,0];
for "_i" from 0 to 1 step 0 do {
_positionwest = _emptyposwest findEmptyPosition [2,20,"Man"];
if (_positionwest inArea boundaryTrigger) exitwith {};};
_x setPos _positionwest;
};```
i reckon ur suck in the for loop
yeah that's what I assumed
Yeah step 0 is not going to advance the loop at all, what are you actually trying to do there?
it is supposed to exit once it finds a position inside the zone, which it apparently isnt finding.
Don't you need some sort of break equivalent to break out of the loop if you're not going to end it with the step/condition combo? (I'm brand new to SQF so I'm probably not being very helpful lol)
yea, exitWith
Oh, I see it now, my bad
exit the loop if the condition is met
gotta run out, I'll pester you guys about that when I return
does anyone know of a script for opening the nose or tail ramps on aircraft? specifically the c17, c5, c130 and russian and chinese equivalents
animateDoor would probably do it
how would that effect the other doors?
uhh, not at all if you dont specify them to be animated.
So I have kind of a general SQF question that tripped me up earlier. I have this function getNearestSpawn, that looks for objects that are designated as spawn points by the mission, builds an array of their positions, sorts them by distance to the player, and returns the first item in the array. But it's possible that this function could get called when there are no valid spawn points on the map, so in that case I was trying to just return false.
In another function, I tried to do a sanity check like this:
_spawnPos = [] call F_getNearestSpawn;
if (_spawnPos != false) then {
// do the thing
};
But the script was never making it past that conditional even though _spawnPos had an actual value. I ended up changing it to if (count _spawnPos > 0) and that worked, but I'm wondering if there was something weird going on with type coercion with the != false check, or if there's a better way to do that sort of check than what I landed on?
https://community.bistudio.com/wiki/a_!%3D_b
!= doesnt compare boolean, and comparing boolean at all is kinda pointless unless both are dynamic
you would have wanted something like this so if it was an array it would continue as normal
if !(_spawnPos isEqualType []) exitWith {};
Ahhh, okay
is there an elegant way to move a unit forward 10m using setPos?
_unit setpos (_unit getPos [10,getDir _unit])
hm ok
whats this animate door script?
https://community.bistudio.com/wiki/animateDoor
the door name (if it has one to animate at all) depends on the model so cant really help u there
Is there some controls style like CT_CONTROLS_GROUP that shows shild controls that are outside of its box?
Or maybe there is a better way to achieve what I want to do?
I need to add some statics and buttons to map display. I construct the layout in Arma Dialog Creator, but it exports the whole dialog as... a dialog. I can't create it as display/dialog over map display because the dialog/display will intercept input to map. So to overcome this I inherit from exported dialog class by turning it into a control of CT_CONTROLS_GROUP style, with x=y=0, w=safezonew, h=safezoneh. Now it's a transparent group box with my UI elements where I need them. It still intercepts map mouse input... so I tried to disable it with ctrlEnable false, static elements look fine, but now buttons don't work 😖
Or maybe I overlooked some flag which makes this group box show everything that is outside of its box??
why dont you just add controls to the map display?
I was trying to find a way where I can easily redo these buttons in the Arma Dialog Creator without manually copy-pasting pieces of code
it would need to be by script, but it would work. alternatively you can do createDialog with the map display open.
So that I only need to copy the .h files
Yeah I know that adding plain controls to map display works... if only arma dialog creator could export individual group boxes 😄
But createDialog will also intercept mouse input from the map because it's drawn at the top of the map?
to come back to the initial question for a second, to my knowledge there is no way to show controls outside the boundaries of its parent control group.
Also I would be able to close it with esk?
you can set a keydown evh to block esc
Hmm... let me try...
_display displayAddEventHandler ["KeyDown",{_this#1 == 1}];
No... createDialog over map intercepts scroll, mouse clicks on the map, etc
what was the desire for showing controls outside the parent boundaries?
The idea was this:
I inherit from the class inherited from export result of dialog creator. Dialog creator positions all the controls relative to safezoneX/Y/W/H.
So I'd create a group box (because it supports controls class inside it) positioned at [0, 0] which occupies whole screen. So all positions from the exported dialog would match the positions that I need.
Actually this has a flaw... if I set the group box position to [0, 0] it won't show controls that are supposed to be above [0, 0] and to the left of [0, 0]. Damn xD
yea. as annoying as it is, scripted buttons are the easiest way to go imo
Maybe I can iterate through the exported class manually with ctrlCreate? I'd just need to tell it to grab control class not from mission config root, but from elsewhere?
that would work, sounds like a bit more effort but definitely possible 👍
Hi all. There is a troubles in arma with displaying of remote objects (which was created on remote host): all modifications does applying on others hosts with big latency.
When host of object make position change of object or rotate it, other player see these only after several seconds...
How to fix this behavior and display all actions immediately? Like it works with guns and cars..
What do you mean Predator? What kind of objects?
sounds a bit like what happens with zeus objects. there is a slight delay between you moving an object and the new position/orientation broadcasting.
No @robust hollow it looks like ctrlCreate only accepts classes that are right in the root of config or mission config >_<
It looks like I will have to do it like this:
Check what config class given button/static inherits from (this resource must be in mission config) then use ctrlCreate on this config , then set other properties with ctrlSetXXX commands
oo yea i knew that, misunderstood what you said earlier 🤦
Unless there is a hidden way to tell ctrlCreate take config from elsewhere... 🤦
@astral dawn any custom object like this...
Is it depends of object class and cfg?
Look on the picture. When host of the object order character to land this object on the ground and change object pos set[2, 0], then this host see result immediately.
But other player can to watch result after a several second. Object stands in the air.
@wanton swallow different objects have different network simulation frequency, i.e. some update more often then the other. I take it that this is not PhysX object, as it doesn’t fall down if you setPos above ground?
Then it is not meant to be updated frequently
Must it object contain a correct config or what?
Ok thank you
Try some vanilla assets some are PhysX and see if they work better
Then you can rip off config from those
i have a script :
_loot = nearestObject [bot, "WeaponHolderSimulated"];
while {primaryWeapon bot == "" && handgunWeapon bot == "" } do {
sleep 2;
bot doMove (getPosATL _loot);
waitUntil {bot distance _loot < 6};
_box = (bot nearObjects ["WeaponHolderSimulated", 6]) select 0;
_boxContents = weaponCargo _box;
_weapon = _boxContents select 0;
bot action ["TakeWeapon", _box, _weapon];
sleep 2;
bot action ["rearm", _box];
sleep 5;
};```
the thing is if nearest Weapon Holder Simulated didn't exist (no container) unit start moving to nowhere and run far away on empty scenario, how can i make conditions right like if there is no weapon nearby?
uhm ... check if _loot is null or not?
like ... literraly do:
if isNull _loot exitWith { /* be done you foolish bot */ };```
yeah thank you it work )
in case somebody is bored, solve this in SQF:
But for multiples of three print “Fizz” instead of the number
and for the multiples of five print “Buzz”.
For numbers which are multiples of both three and five print “FizzBuzz”."```
no need to start the game for this one btw to test: https://discord.gg/4ngeFd just use the SQF-VM discord bot 😉
Quick double check past you all to check I'm not crazy... this should work in an AI's INIT right? To make them permanently stand up?
_this setUnitPos "UP";
nope; _this → this @little ether
Is SQF very hard to learn?
not really
@queen cargo this?
for "_i" from 1 to 100 do {
private _is3m = (_i % 3 == 0);
private _is5m = (_i % 5 == 0);
switch (true) do {
case (_is3m && _is5m): { systemChat "FizzBuzz"; };
case (_is5m): { systemChat "Buzz"; };
case (_is3m): { systemChat "Fizz"; };
default { systemChat str _i; }
};
};
👍 😉
I don't play the minify code challenge :p
@tough abyss not allowed indeed, but you can link to a hosting site as much as you like
Ahh, missed the last condition
ok ill look
because i started ydah
yday*
and am trying to make smth and idk if i have errors
https://prnt.sc/mggf93 if anyone sees any errors please let me know (idk if this whole thing will even work)
Missing ; after _configs
thank u
Even better to use pastebin and not pictures
What is the effective difference between getClientState "BRIEFING READ" and getClientState "BRIEFING SHOWN", aka pressing the continue button in a MP briefing? It seems to propagate certain things like player gear state to other clients. Is there any good documentation of this around? I am attempting to propagate the client gear state to all other clients while in MP briefing.
Sorry for that, it was just a picture I had laying around
is it possible to make a static object affect a players camo level the way putting on a ghillie suit does? Or at least affect detection in a similar manner?
no I dont think so
you can only block the line of sight
well trees/bushes and the sort do have a "see through value" that can be set in geometry lod named properties
for some reason my list is empty even though i have code to fill it with stuff
{
_name = getText (_x >> "displayName");
_classname = configName _x;
_index = _ctrl lbAdd(_name);
_ctrl lbSetData(_index, _classname);
} forEach _configs;
is smth wrong here
try it?
Run in the debug console without the controls stuff and you will find out
seems like the _name doesnt get the displayname
_ctrl lbSetData(_index, _classname);
this is wrong
_ctrl lbSetData [_index, _classname];
All list arguments in arma use square bracket lists, not parentheses/tuples/whatever
oh thta must be it
same thing with lbAdd, in normal languages you'd use func(args). In arma it's usually _target function [args]
alright thank u
is there a way to read/intercept incoming chat messages?
that display would only needed to be exposed (or more precisely its text control), no?
DisableChannel only works for player messages, doesnt?
I don't know if it's a normal text box control. I assume it's not
its not
I guess there is a reason why everyone has been failing to do what you are asking.
We got chat message sent eventhandlers which are also quite the hack.
I've set three jets to fly in formation, I've set their altitude to 2600. I've set to each flyinHeightASL 2600. Why are they flying up and down?
they avoid birds
@still forum Assuming they press enter and the dialog is closed, cant you say that the message has been sent? Seeing as how we have no control over lower level network stuff.
Ok. Do you also in this set of ehs have something that can parse the text that is being entered?
yes.
Woah. CBA?
yes...
Yes!
So no possibility to make those jets fly at constant altitude?
Im not an expert in this but you can pre-record vehicle movement
Wait, are they in same group actually?
no
never actually seen that
It's been in since tac ops
will try that , much appreciated
@young current Do you know off hand where I find the "see through value" for the geometry lod?
https://community.bistudio.com/wiki/Arma_3_Named_Properties#loddensitycoef
Determines how fast LODs are being switched. 0.1 means LODs will be switched very fast, 100 there will be barely no LOD switching.
viewdensitycoef is what you want, it seems
does anyone know why this will only work in SP:
MCSS_Guided_BulletHandler = {
private ["_var","_target"];
_veh = _this select 0;
_weapon = _this select 1;
_ammo = _this select 4;
_projectile = _this select 6;
_var = _veh getvariable "MCSS_C2_REMOTE_HANDLE";
_target = _var select 1;
if (isNil {_target}) exitWith {};
_vel = velocity _projectile;
_length = sqrt((_vel select 0)*(_vel select 0) + (_vel select 1)*(_vel select 1) + (_vel select 2)*(_vel select 2));
while {alive _projectile && alive _target} do
{
_dir = getPosATL _projectile vectorFromTo (getPosATL _target);
_vel = [(_dir select 0) * _length, (_dir select 1) * _length, (_dir select 2) * _length];
_projectile setVelocity _vel;
sleep 0.1;
};
};
_vehicle addEventHandler ["FIRED",{_this spawn MCSS_Guided_BulletHandler}];
ah there we go... another wiki page I need to book mark. Thanks
@young current viewdensitycoef is the winner
ah was close
@burnt cobalt where do you set the addEventHandler?
i hope i understand you correctly - the machine executing the addEventhandler command is the server in MP
everything fires, but any commands addressing _projectile have no effect
@winter rose
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Fired
When added to remote unit or vehicle, event handler will fire only if said entity is within range to the camera. Range is determined by fired ammo's highest visibleFire and audibleFire config value. In case of units muzzle attachment coefficients are applied too.```
the server may not have a "camera" I think (and that's a shame really)
which… makes me think that I rely on it in some of my missions
hmm i'm confused. it seems that it does fire, if I include systemchats like (str _projectile) remoteExec ["systemChat",0] , I do get those messages on my client
it's just that setVelocity does not seem to have an effect
but I would think the EH fires
What projectile is?
In SP it works with any projectile, in this case it's an attack heli's MG
correction, it does not work well with missiles
NK_giveGun =
{
removeAllWeapons player;
_ctrl0 = (findDisplay 9998) displayCtrl 1500;
if ( _ctrl0 lbText[lbCurSel _ctrl0] == "Mk18") then { player addWeapon "srifle_EBR_F"; _classname = "srifle_EBR_F"; };
if ( _ctrl0 lbText[lbCurSel _ctrl0] == "MK-1") then { player addWeapon "srifle_DMR_03_F"; _classname = "srifle_DMR_03_F"; };
if ( _ctrl0 lbText[lbCurSel _ctrl0] == "MXM") then { player addWeapon "arifle_MXM_khk_F"; _classname = "arifle_MXM_khk_F"; };
if (player hasWeapon _classname) then {hint "Success!"; };
closeDialog 9998;
};
I'm receiving a General error 😦 Anyone could help me out? sorry for bugging you all
Check syntax https://community.bistudio.com/wiki/lbText
ok fair enough xd
@burnt cobalt setVelocity works on local instance of object and some projectiles are local everywhere. Best thing is to replace fired projectile with custom of the same type then you get global object you can control from the same pc you created it on
i did try that before - somehow that made the bullet remove it's tracer and in MP the bullets went haywire
I will keep trying though - but I'm not just messing up locality or something?
Maybe you placed it backwards? You can’t see tracer if it is facing you
You need to store fired projectile type, world pos, vector dir and up and velocity and recreate it then set all that back, did you do that?
Did ya?
yes i did all of that
but still, what you say with the bullet ending up the wrong way makes sense with what I observed
which is weird because I though setVectorDirAndUp would prevent that
I'm having trouble firing this, syntax error? I cut out the identical middle cases to post
if (_loadoutParam >= 3) then
{
switch (side group _unit) do {
case west: {
_unit setUnitLoadout (bluforloadout select 0);};
case east: {
_unit setUnitLoadout (opforloadout select 0);};
};
hint format ["removing weapons, %1",player ];
removeAllWeapons _unit;
switch (_loadoutParam) do {
case 3: {
_unit addMagazines ["16Rnd_9x21_Mag",10];
_unit addWeapon "hgun_P07_F";
};
case 4: {
_unit addMagazines ["6Rnd_45ACP_Cylinder",10];
_unit addWeapon "hgun_Pistol_heavy_02_F";
};
case 10: {
_unit addMagazines ["LOP_10rnd_77mm_mag",10];
_unit addWeapon "LOP_Weap_LeeEnfield";
};
};
[_unit] execVM "equipmentRestrictions.sqf";
};
[_unit] execVM "equipmentRestrictions.sqf";
How do I make static text with vertical scroll bar if not all text fits into the box?
I know groups control has vertical scroll bar. Is it the only way to get vertical scroll capability?
Not a syntax error, but hint format ["removing weapons, %1",player ]; is gonna be gibberish
I just wanted a hint to see if it was even firing
@astral dawn you can perhaps try adding a VScrollBar to the text control in the dialog config, however i dont believe it will work. I would go the control group method.
@tough abyss What does your RPT say?
Thanks Connor. Arma Dialog Creator doesn't have group control support >_< meaning I need to mess with inheritence again... why is all UI such a pain in this game...
@ruby breach not much
"28 C:\Users\Owner\Documents\Arma 3 - Other Profiles\Axebeard\mpmissions\ACTION_Arma(Altis)_v10.Altis\initServer.sqf"
15:34:21 "58 C:\Users\Owner\Documents\Arma 3 - Other Profiles\Axebeard\mpmissions\ACTION_Arma(Altis)_v10.Altis\initServer.sqf"
15:34:21 "1 C:\Users\Owner\Documents\Arma 3 - Other Profiles\Axebeard\mpmissions\ACTION_Arma(Altis)_v10.Altis\initPlayerLocal.sqf"
15:34:21 [ACE] (common) TRACE: 378476 Reading missionConfigFile params: _paramsArray=[0,99,74,5,0,0,12,12,3,0,0,1,0] z\ace\addons\common\functions\fnc_readSettingsFromParamsArray.sqf:23
15:34:21 [ACE] (common) TRACE: 378476 ace_setting: _title=Medical Level, _settingName=ace_medical_level, _settingValue=1 z\ace\addons\common\functions\fnc_readSettingsFromParamsArray.sqf:32
15:34:21 [ACE] (common) TRACE: 378476 setSettingMission from paramsArray: _settingName=ace_medical_level, _settingValue=1, _return=true z\ace\addons\common\functions\fnc_readSettingsFromParamsArray.sqf:65
15:34:21 [ACE] (common) TRACE: 378476 ace_setting: _title=ACE Prevent Instant Death, _settingName=ace_medical_preventinstadeath, _settingValue=0 z\ace\addons\common\functions\fnc_readSettingsFromParamsArray.sqf:32
15:34:21 [ACE] (common) TRACE: 378476 setSettingMission from paramsArray: _settingName=ace_medical_preventinstadeath, _settingValue=false, _return=true z\ace\addons\common\functions\fnc_readSettingsFromParamsArray.sqf:65
15:34:21 [ACE] (common) INFO: Settings initialized.
15:34:21 [ACE] (advanced_ballistics) INFO: Terrain already initialized [world: Altis]
15:34:21 [ACE] (common) INFO: 40 delayed functions running.
15:34:21 "2 C:\Users\Owner\Documents\Arma 3 - Other Profiles\Axebeard\mpmissions\ACTION_Arma(Altis)_v10.Altis\assignLoadouts.sqf"
15:34:22 Mission id: 8ef004ae64bcc5c39b62638a8d9bcc80b56d74a7
That's the only script it identified, is it trying to tell me it's running twice or something?
"2 C:\Users\Owner\Documents\Arma 3 - Other Profiles\Axebeard\mpmissions\ACTION_Arma(Altis)_v10.Altis\assignLoadouts.sqf"
actually I got it working, I had to call the script that sets the initial loadouts right at the top of the the one I posted. Weird because that's supposed to be happening earlier anyway
is it trying to tell me it's running twice or something?
no, thats this debug log from yesterday telling you what line it made it to in the file
diag_log format["%1 %2",__LINE__,__FILE__];
@tough abyss I got it! I think I'm overcomplicating it quite a bit but I made designated functions to add and remove the EH, run it on every machine, and exit if the vehicle is not local. Works both ways, but I did actually go back to the deleting/respawning of projectiles - the tracer really disappears no matter where I look - it's strange, but since the 'guided' velocity creates a weird flightpath for the projectile i i almost prefer it this way
Do tracers need to fly at certain speed? Since you alter velocity maybe this affects it
Ugh... I'm trying to make my first addon (as opposed to a mission) and I'm having a hell of a time getting literally anything working. This is what I have right now:
// config.cpp
class CfgPatches
{
class AICnC
{
units[] = {};
weapons[] = {};
requiredAddons[] = {};
author[] = { "Spectre" };
};
};
class CfgFunctions
{
class AICnCLaunch
{
class AICnC_Initialization
{
class Init
{
file = "init.sqf";
postInit = 1;
};
};
};
};
// init.sqf
[] spawn
{
sleep 2;
while { true } do
{
systemChat "Init is working!";
sleep 10;
};
};
Trying to test it out by either starting one of the showcase missions or running a mission from the editor but I'm never seeing the "Init is working" system chat. What am I missing here?
file = "init.sqf";
the file path should also have your addon prefix
Ahhh okay... how do I set the addon prefix? Is it just the name of the directory/PBO in addons?
it can be whatever you want. what tool are you using to pack ur pbo?
The one that comes with Arma 3 Tools, Addon Builder
in the options menu set "Addon prefix" to whatever you want. for this test i say just use AICnC. then ur init file path would be file="\AICnC\init.sqf";
I want my players to start in a safezone until the intro cam is done (because AI). I have all units set to allowDamage false in my initServer, is initPlayerLocal an ok place to set allowDamage true again?
Or otherwise, how could I do a countdown to trigger it
u need to set allowDamage false one each player individually when they load in, not once on the server
@finite cloud how are you loading ur mod?do u have the right filestructure? @mod\addons\every.pbo?
Yeah, exactly that. I just added it as a local mod in the Arma 3 launcher
it is working for me, even in the main menu https://i.imgur.com/vxegO7F.png
yep. only edit was fixing the filepath
Did you use something other than AICnC for the prefix?
Well fuck me, I just changed the prefix to "test" and now it's working
🤔
I was worried about either a conflict with the CfgPatches class name or maybe just using capital letters so I figured I'd try that, before you answered my last
But no idea why AICnC worked for you but not for me
itl show a warning about duplicate class names.
Ahh okay, yeah I didn't get anything about that
Maybe it was just the act of deleting the old PBO and adding the new one that refreshed it or whatever
Idk, it works now so I'm happy, thank you so much!
👍
So I'm sort of looking for some advice on the logic here... in order to make the camo netting I've been working on function the way I want it to, I plan to have it switch the player to captive while they're within a certain range along with a sort of shot fired cooldown.
Is there a more efficient way of handling the shot cooldown than just using an eventlistener and starting a timer everytime the player fires a shot?
dont fully know what ur trying to do so not sure if this will apply to it or not but i usually do cooldowns just setting a variable.
eg: myCooldown = diag_tickTime + 15; // 15 second cooldown
and then check the variable anywhere else i need
if (myCooldown > diag_tickTime) exitWith {}; // not cooled down yet
I guess what I'm trying to figure out is a better way to initiate the cooldown than everytime the player fires a shot. It seems like that would unnecessarily gum up the works when you're not using the camo net
like I said though, I'm just looking at the logic of it all right now
would this be a spawned cooldown or something?
I'm not sure? I would think no... because then I could end up with hundreds or thousands running at once
I think the single variable you mentioned would be the best route and just resetting the count everytime
there is ways to avoid mass threads but anyway, still not sure im understanding the objective. im good for about 3 hours in the morning and then i progressively get dumber 😛
here is a way to prevent spawning loads of new threads:
// fire evh
terminate (missionNameSpace getVariable ["myThread",scriptNull]);
myThread = [] spawn {
uisleep 15;
/* stuff */
};
oh ok, I've never seen that before
Is there a way to get the "Ended" mission event to trigger? Or is there another way I can check when the mission ends? Because right now, no matter what I do the "Ended" event is never triggered
it should fire when you use endMission, BIS_fnc_endMission or the endmission cheat.
I tried that but it never fired, neither on the dedicated server nor on my local machine, even when I added the event handler mid-mission
The "EntityKilled" event works but for some reason the "Ended" one doesn't
this worked for me. the log is in my rpt. what are you trying to do with it?
addMissionEventHandler ["Ended",{
diag_log format["Ended: %1",_this];
}];
endMission "loser";
Mine is just this:
addMissionEventHandler ["Ended", {
diag_log "Mission ended";
//timestamp
TBT_const_extensionName callExtension ["missionEnded", [
time
]];
}];
I'll try it one more time without the extension call and see if that is the problem
Same thing, nothing on the rpt log. I can see the extension being loaded and all the calls and I have the log of all the calls made to it but the "Ended" event handler never runs
would it be possible to call the extension before you end the mission?
or, is it ending from all players dead or something like that?
Yeah, as long as it is called consistently before the end of the mission I don't really care about losing those last few seconds of data. It'll spam the log file with errors but I'm just trying to get it to work now
I've ended the mission with the default scenario end zeus module and by using the Achilles "Execute Code" module and calling endMission and with both the Ended event didn't get triggered
zeus module works for me too.
which it should, it uses BIS_fnc_endMission
are you sure the eventhandler is even being set?
Pretty sure, here's what I'm running on postInit:
["ace_unconscious", {
params ["_unit", "_isUnconscious"];
private _unitID = _unit getVariable TBT_const_unitIDVarName;
TBT_const_extensionName callExtension ["unconsciousStateChanged", [_unitID, _isUnconscious]];
}] call CBA_fnc_addEventHandler;
addMissionEventHandler ["EntityKilled", TBT_fnc_entityKilled];
addMissionEventHandler ["Ended", {
diag_log "Mission ended";
//timestamp
TBT_const_extensionName callExtension ["missionEnded", [
time
]];
}];
//WorldName, missionName
//No need for timestamp since it will be 0
TBT_const_extensionName callExtension ["missionStarted", [
worldName,
missionName
]];
[] spawn TBT_fnc_updateLoop;
I do get the EntityKilled event as you can see here: https://puu.sh/CHpQW/e21643a9aa.jpg
not sure what to say about that tbh. only thing i can think of is a conflicting mod but that doesnt seem to make much sense either 😕
Yeah, I have no idea why it wouldn't work. Could it be that addons aren't allowed to register that event for some reason? I've just tested it in SP and it worked fine
I don't understand why it wouldn't work on a dedicated server
does someone know how to block the tacticalview?
tried keydown and that works in some way...but if you bind the tacticalview to your mouse it will not block it
@junior stone
(findDisplay 46) displayAddEventHandler ["MouseButtonDown",{inputAction "TacticleView" > 0}];
have you tried something like this? it works for me.
@robust hollow MouseButtonDown does not override mouse action. inputAction also do not recognize some complex binds like CTRL+SHIFT+whatever
This being and issue since forever
aww rip. just noticed it isnt even spelt right in the snippet i posted so dont know why it appeared as working. ah well 🤦
a far less desirable alternative is to spawn something like this
for "_" from 0 to 1 step 0 do {
waitUntil {cameraView == "GROUP"};
player switchCamera "EXTERNAL";
};
i dont know if tactical view is the only view to use the name "GROUP" though.
can you pass a variable to something in description.ext, or have it read a variable? I have 2 endings "Opfor wins" and "Blufor wins" but I'd like to get it show the faction name I set earlier.
@tough abyss CfgDebriefingSections allows you to insert variables to each debriefing section
There are preprocessor macros like __EXEC available as a part of your description.ext
neat thanks
I'm getting a weird thing where a teleport script I wrote into an object init is only coming up as an option about 5m away from the object itself
Any ideas for how to fix it?
hey! Is there a way to force the player to only move his head (like he was holding alt) and then enable normal movement again?
@next scaffold You can use switchMove with an idle animation
I'm using that but the character is turning his entire body when looking around
NK_giveGun =
{
removeAllWeapons player;
_ctrl = (findDisplay 9998) displayCtrl 1500;
_gun = _ctrl lbText[lbCurSel _ctrl];
if ( _gun isEqualTo "Mk18") then { player addWeapon "srifle_EBR_F"; _classname = "srifle_EBR_F"; };
if ( _gun isEqualTo "MK-1") then { player addWeapon "srifle_DMR_03_F"; _classname = "srifle_DMR_03_F"; };
if ( _gun isEqualTo "MXM") then { player addWeapon "arifle_MXM_khk_F"; _classname = "arifle_MXM_khk_F"; };
if (player hasWeapon _classname) then {hint "Success!"; };
closeDialog 9998;
};
I get a generic error in expression. New to scripting so idk what i'm doing wrong, anyone could kindly help? thank u!
_classname is undefined
you are defining _classname inside the then {...} scope. And it then goes out of scope and disappears
Add a _classname = "" after your _gun definition
good point, I forgot abt that
_ctrl = (findDisplay 9998) displayCtrl 1500;
_gun = _ctrl lbText[lbCurSel _ctrl];
_classname = "";
According to in game, generic error is in this area
hm... now i gotta think how im gonna work this out, thanks a lot though
Read wiki <https://community.bistudio.com/wiki/lbText> waste of time, already told him before @still forum
how im gonna work this out The wiki tells you how. You just have to read
im sorry guys im new to scripting 😃
And you're never gonna stop being new if you don't start to read the wiki
I do read the wiki, just sometimes it's not directly clear to me
I got it right this time, sorry for any incovinience caused! 😃
just want to mention this here https://blog.codinghorror.com/separating-programming-sheep-from-non-programming-goats/
@tough abyss that is actually a serious problem
No, people not reading wiki is
But if you are talking about people not being wired correctly for programming, what can you do, not everyone is Picasso
Do groups maintain any sort of list of units they know about? I know you can check _group knowsAbout _unit, but is there any way to retrieve an array of units that a particular group knows about without looping through every unit in the world and making that check?
Yessssss thank you!
Be careful with the target age parameter
I found it more useful to query targets with any age, then filter out those are below threshold
If you ask this command to filter target age for you it does something wrong, don't remember what exactly
Gotcha
Does "age" in this case refer to how long the target has been alive, or how long the target has been known about?
Age is time since the target was last observed
Ahh okay
But t can be negative
But not lower than -1
-1 means the target is observed right now
Gotcha
Also side it returns is actually perceived side, so when AIs are not sure about unit's side they report civilian or unknown as I recall
Ooh okay, good to know
@tough abyss
b = 20
a is unknown
Because what if they were doing parallel assignment?? Doesnt compile xD
Is there any way to enable the multiplayer "Chat" command in a single-player mission? I'm using systemChat to log debug info and I'd like to be able to page up/down through the message history, but the "/" key doesn't work
Or maybe a better question: is there a better way to access the information I need than systemChatting everything? lol
diag_log
use program called snakeTail because it can live-update logs
that's how I do it
also consider installing Dedmen's armaDebugEngine... or how was it called.... to dump callstack/variable info on scripting errors
Notepad++ can also tail. I use BareTail for that tho
Why vectorUp of a bush is not normalised? vectormagnitude vectorup (nearestTerrainObjects [player, ["Tree","Bush"], 10] select 0); 1.23
why should it be?
Hi guys. Is there a more reliable way to save and load the inventory of a player when he joins/disconnects from the server, than getUnitLoadout and SetUnitLoadout ?
Because sometimes, getUnitLoadout between my client and the server, does not return the same result
cant say ive ever had that problem 🤔 if you feel better about it you can manually save a loadout with all the individual commands
well, actually my problem may not be related to getUnitLoadout.. I just tried to diag_log (getMagazineCargo backpackContainer unit) , and the output for client/server is different 😦
Which one is the correct then?
local
i put some magazines in a crate, then diag_log
the server still shows the mags in the backpack
is the server showing different items or no items?
so whats the difference between the two?
i have 0 mags in my backpack right now, logs are fine on the client (backpack empty), but the server still see the mags which i just put in a crate
How did you put the mags via inventory or script?
_who = if(isDedicated) then {"SERVER"} else {"PLAYER"};
diag_log format["%1 || inventory : %2",_who,(getMagazineCargo backpackContainer civ_6)];
exec global
Are you using mods?
What if you drag them
And how soon are you executing after you put them in container?
Does the server catch up eventually?
How many people on the server?
Maybe some mods spam network causing delay
What is FPS in the server?
same problem when i drag , i'm alone, it's a test server
1:10:45 "PLAYER || inventory : [[],[]]"
1:10:45 "SERVER || inventory : [[""RH_7Rnd_45cal_m1911""],[3]]"
seems to happen only with backpacks
Are they mod backpacks?
nope : "B_Carryall_oli"
I will test tomo
Are you going to save loadout in server's profile namespace or on client's profile namespace?
If it's broken on server side then you could send player's gear to the server when he disconnects, the nserver will save it
you mean with onPlayerDisconnected ? because that's what i do, and it's serverside so it's broken
Does it happen if you drop mags on the floor?
yes , same problem on the floor 😦
oh wait, looks like there is no event handler that runs on player's computer when he leaves the game? then I'm wrong, sorry
player setUnitLoadout [[],[],[],["U_C_Poloshirt_redwhite",[]],[],["B_Carryall_oli",[["30Rnd_556x45_Stanag",3,7]]],"","",[],["","","","","",""]]
--> diag_log ok on both client / server (3 mags)
--> drop 3 mags on the floor
--> diag_log ok on client (no mags), broken on server (3mags)
logs are ok on server after i execute
player setUnitLoadout getUnitLoadout player
Damn I'm pretty sure my friend made a properly working loadout saving when player disconnects, in Antistasi mission...
I'll check it in a moment
No it also uses getUnitLoadout, run on the server 😦
having no disconnect event on the client is what made me stop using disableUserInput during cutscenes
if the server craps out or kicked the player (I do that a lot for testing) then they're stuck
Haha
No disconnect event is a real trouble, I'm totally dissappointed now
Maybe you could make a fake one by attaching an event handler to some control or dialog?
yeah I was thinking a loop running that looks for serverName or something similar
some test that only works when you're connected to a server
No, but there are onUnload and unDestroy control event handlers:
https://community.bistudio.com/wiki/User_Interface_Event_Handlers#onDestroy
But I have no idea if they run when you leave the game
Worth a try
well, there is the "Ended" mission event handler. you could also do an "Unload" event on display 46 but i wouldnt think you can communicate to the server when either of those fire.
wouldnt be the most reliable method anyway, if a client crashes the event wont run.
I just made a video to show my problem : https://youtu.be/Rx_e_5aRPQk
🤷 just tried exactly how you did it, worked fine.
😩
I'm having an issue or maybe just some confusion about file patching. I'm trying to set up my dev environment so I don't need to restart Arma every time I make a change.
So, I turned on the file patching parameter, set up my P drive, made a link between my Arma directory and my work directory, and I'm now using mikero's MakePbo instead of Addon Builder. Now when I change something in the source code, I can see the new version in the Functions viewer in-game, but even after restarting the mission the changes don't seem to be actually taking effect. Am I missing something or doing something wrong?
Tried recompile button in functions?
But he said even mission restart doesn't help 🤔
NVM
If the functions are in mod it won’t help
Hmm, the Recompile buttons are actually grayed out, I didn't notice those before
You have to enable recompile then
How do I do that for a mod?
Maybe that's what you are looking for
https://community.bistudio.com/wiki/Arma_3_Functions_Library#Recompiling
also there is a recompile = 1; attribute in cfgFunctions?
I saw that, but I don't have a Description.ext because I'm building an addon :/
Oh! I'll give that a shot
I'm not sure cause never messed with addons
Woooooo that worked! Now I'm cooking with gas! Thanks 😄
Evening gents - how would I determine if a static weapon is a rocket/missile launcher?
With high probability you can't. Most likely you will have to just make an array of classnames(or better model names used by launchers).
I wanted to check for mortars once and found no way, had to make an array with class names
Does SQF have some sort of regex capability? You could check the config displayName for "launcher"
well there is a find command that works with strings...
argh
well there is configfile >> "CfgAmmo" >> _ammoType >> "effectsMissile"
maybe I can use that somehow, but I was hoping for something slicker - classnames are not going to be an option unfortunately unless I manage to gather every single classname in existance
@finite cloud you could implement one yourself 🤷♂️
https://github.com/kokke/tiny-regex-c/blob/master/re.c by porting this for example
I've got a in-editor trigger that works in single player and LAN to kill players who exit the area after a 10 second countdown, but it's not working on our dedicated server:
class Attributes
{
name="boundaryTrigger";
condition="not(player in thislist)";
onActivation=0 = [] spawn
{_rad = triggerArea boundaryTrigger select 0;
damagePlayer = true;
for [ {_i=10} , {_i>=0} , {_i=_i-1} ] do {
_str = str (format ["WARNING: %1", _i]);
titleText [_str,"PLAIN"];
titleFadeOut 0.5;
sleep 1;
if (player distance boundaryTrigger < _rad) exitWith {damagePlayer=false};
};
if (damagePlayer) then
{player setDamage 1;[player] execVM "ACEdeath.sqf"; };
};;
sizeA=50000;
sizeB=50000;
repeatable=1;
activationBy="ANYPLAYER";
};
id=74;
type="EmptyDetector";
};
edited for clarity
for anyone concerned, I am not sure if this is reliable but this is the best I can do myself. does not differentiate between AT and AA:
isStaticMissileLauncher= {
params ["_input"];
private ["_magazineArray","_return"];
if (typeName _input == "OBJECT") then {_input = typeOf _input};
if !(_input isKindOf "STATICWEAPON") exitWith {false};
_magazineArray = getArray (configfile >> "CfgVehicles" >> _input >> "Turrets" >> "MainTurret" >> "magazines");
_return = false;
{
_ammo = (getText (configfile >> "CfgMagazines" >> _x >> "ammo"));
_effects = toLower (getText (configfile >> "CfgAmmo" >> _ammo >> "effectsMissile"));
if (["missile",_effects] call BIS_fnc_instring) exitWith {
_return = true;
};
} foreach _magazineArray;
_return
};
i thought there would be something easy and effective 😄
isStaticMissileLauncher= {
params [
["_input",objNull,[objNull]]
];
if (isNull _input) exitWith {false};
private _type = typeOf _input;
if !(_type isKindOf "STATICWEAPON") exitWith {false};
private _magazineArray = getArray (configfile >> "CfgVehicles" >> _type >> "Turrets" >> "MainTurret" >> "magazines");
private _return = false;
{
private _ammo = (getText (configfile >> "CfgMagazines" >> _x >> "ammo"));
private _effects = toLower (getText (configfile >> "CfgAmmo" >> _ammo >> "effectsMissile"));
if (_effects find "missile" > -1) exitWith {
_return = true;
};
} foreach _magazineArray;
_return
};
Also its better to use object isKindOf typeName instead of typeName isKindOf typeName its more reliable
When you have object ofc.
ha! thanks @unborn ether I did not know that find command either 😃
RANDOM NOOB QUESTION: Is it possible that having:
execVM "MyScript.SQF" in the init.sqf can cause the script to execute every time a player connects? I'm almost positive it just runs once on loading a mission for the machine connecting/loading but I'm getting issues that seem to be caused by my scripts running multiple times. Just making sure I'm not retarded.
it just runs once on loading a mission for the machine connecting/loading
this is correct. init.sqf executes for only on the client loading in (and the server when it loads the mission), however to be clear that is every client, even jip. not just when the mission first loads.
Yeah, that's what I thought. I have an issue where I have code that just stops working out of nowhere. Not sure if it's maybe cycle limit being reached in loop? I read that certain loops have a limit to how many cycles they can do before they end.
i think thats only the while loop if ran in unscheduled, which execvm is not.
Even with eventHandlers, where they EH seems to just vanish from players. Seems to occur upon a player disconnecting.
Yeah in that case I'm not sure why a script would just stop working, aside from shit code breaking without errors
Oh well, thanks for the confirmations. ❤
Hi. How to force character walk without run?
I try to use this:
_person forceWalk true;
_person allowSprint false;
He cant to sprint but can to run after several steps. I need to force him walk without run.
_person forceWalk true; alone works for me. do you know if there is a conflicting script enabling sprint?
Character take some object in his hands and cant to sprint but can to run after several steps.
When he drop this object script do allowSprint true;
Cant sprint but can to run.
Description: Forces unit to walk even if run or sprint is selected.
I need persistent walk.
@violet gull this dont work...
[_person] spawn {
_prsn = _this # 0;
_forceWalk = _prsn getVariable ["forceWalk", 0];
diag_log "Start force speed";
while{_forceWalk != 0} do {
_prsn forceSpeed 0.1;
_forceWalk = _prsn getVariable ["forceWalk", 0];
sleep 0.1;
};
diag_log "End force speed";
};
player can to run W
I need Ctrl+C mode
[_person] spawn {
_prsn = _this # 0;
diag_log "Start force speed";
while{!isForceWalk _prsn} do {
_prsn forceSpeed 0.1;
sleep 0.2;
};
diag_log "End force speed";
};
_forceWalk is redundant, just use isForceWalk command
Returns true or false
Disable the unit's fatigue/stamina and forceSpeed to whatever too
I dont use forceWalk on this character, why isForceWalk should to return true....
If they go up hill, they will always walk (because Arma)
If you use forceWalk on a unit, isForceWalk will be true
Else false
_prsn forceSpeed 0.1; dont produce forceWalk..
Then use _prsn forceWalk true
If he doesn't walk, then something else is breaking it
Could be combat FSM, idk
_prsn DisableAI "FSM"
In a first i tried to use forceWalk, after a several steps character start to run...
_prsn forceSpeed 3;
_prsn forceWalk true;
Is it on a player or a unit?
It doesnt do anything for players
forceWalk
Description: Forces unit to walk even if run or sprint is selected.
Actually I think it does now
To force a player to walk, you can do player forceWalk true;
But it is a client-side command
Yes it is
So server cannot execute on a client, unless you use remoteExec
Why you talk about remoteExec. A question is "how to force player to walk"
forceSpeed
forceWalk
dont work 😦
IDK I've used forceWalk in my own little scripts to make players walk when injured and I had no issues. 🤷
ForceWalk:
Description: Force player to walk.
Example:
player forceWalk true
If you type forceWalk in the editor in init of unit, click in the command, and press F1
Forces unit to walk even if run or sprint is selected.
I can to disable sprint, but how to disable run
forceWalk should do exactly that
Did you see desc of a command?
IDK why it isn't working for you, that's weird.
Ya don't say
And I'm telling you forceWalk makes that shit not matter, you are forced to walk and cannot move any faster than a walk lol
I just tested it in the editor and it worked
Try doing it without your loop, just execute the command and try running/sprinting. It should work. If not, a script or mod is breaking it.
I tried it early. Character walk a several steps and then starts to run.
@violet gull yeah you right, in simple mission it's work correct.
@mild pumice yep broken as fuck
:shrug: just tried exactly how you did it, worked fine. you lie 👺 @robust hollow
🔥
noooo. i used the same bag, mags and log script.... didnt have the issue.
You use setunitloadout like he did? I dont think so because it is pretty much 100% repro
yes copied straight out of discord
what game version?
stable x64
what version number is it? @mild pumice is on 1.88.145285, I am on dev 1.91.145335
difference is i wasnt on the map he is on in his video, and i had no mods enabled.
Build: Stable
Version: 1.88.145285```
I guess we need second opinion
I tested on Altis
Don't think it matters, it is setUnitLoadout that is bugged
and doesnt matter if executed from client or server
It creates buggy backpack
but addBackpackGlobal doesnt
The fucking backpack if you drop it and pick up is still desynced with the server
weird 🤔
i kinda like that ||i just understood|| how ||spoilers|| actually are ||done in bbcode|| 😉
Spoiler Alert: ||use | |TEXT| | but leave the space inbetween those fancy vertical lines away ... cannot escape them sadly :(||
could come in handy
||you need to use two of em||
|| like this?||
||or /spoiler||
||Ok will now use for all my posts||
||redacted||
Okey CTRL+F5 fixes everything
I have a question about ACE fastroping and how i would go about applying it to a helicopter. Im currently trying to enable FRIES on konyo's 160th SOAR MH-47, seeing as it doesnt have support for fast roping by default. I tried adding it myself using this script in the init field;
[kyo_MH47E_base] call ace_fastroping_fnc_equipFRIES;
I have next to no experience with scripts, so i dont know what i am doing wrong. or if it even is possible.
is kyo_MH47E_base a variable pointing to the vehicle?
looks suspisciously like a classname..
I create, dialog, wait until it appear, start a cycle of processing of messages:
disableSerialization;
createDialog "MyGUI";
waitUntil {!isNull (findDisplay 51111);};
while {alive player && dialog} do {
if (!dialog) exitWith { /*action when exit!*/ };
//--some actions--
};
The menu is displayed, some actions are executed, but when you press Esc, the dialog closes and the code inside exitWith is not executed.
Where is the mistake?
&& dialog
lol schoolboy error ))
might as well put that exit code after the loop
@still forum what should i have in its place, i just assumed i should put the classname, i am not very well versed in this at all
any help is appreciated
where do i see the object name in the editor?
in init script it's just this
tried writing it like this
[_MH-47E (Hardcore)] call ace_fastroping_fnc_equipFRIES;
I just told you what to write
also if you want to write names. Names are text. Text in SQF is wrapped in quotation marks
"text"
can you write it so i can just paste it in, sorry if its annoying, but i dont get any part of this
equip fries? Frenchness intensifies
xd
welp
it just said the vehicle isnt configured for ACE fastroping
so i guess it was in vain
thanks for the help
thanks a lot man
what would be the best type to use when collecting all Supply boxes in a mission? sqf allMissionObjects "Type"
Can't really find a list of available Types
any crate in the category Supplies falls under that?
WIKI isn't too clear on that unfortunately
regarding how it is arranged I say it should be that yup
that'd be amazing. Any chance it supports mods too or just vanilla crates?
supply crates from mods*
I would say mods crates should inherit from it too, if they didn't mess up
hehe then i'll blame mod authors if it doesn't work 😄
that's the way to go :p
Backpacks might inherit from that too tho
Ah no. Atleast my backpacks inherit from ReammoBox not the futura variant
It's fine @still forum I check for vehicleVarNames anyway. Read that AllMissionObjects is very heavy on the CPU so thought I'd limit it as much as possible without losing funtionality
Could probably all be replaced by a CBA init EH 😄
entities return dead if needed
what is it a big sand box?
you clean up ruined buildings?
how
no what you do to them delete?
that is supposed to make it better?
why not replace with simple object
You should be able to just deleteVehicle craters and ruins. Atleast i've done that in the past
That makes sense tho 😄
Wait what ruins are we talking about, map or editor placed?
you can set pos map objects?
how do you move them
This is strange but then you have event handlers for that no need to allMissionObjects if you could just store the exact object in an array and then use that array
the ruin
there is EH
You ofc still need to check nearby players and such
but with EH you don't need to constantly call entities or allMissionObjects
The object itself notifies you when it spawns.
Instead of you constantly checking if anything has spawned
if you just hide ruin does it exist on JIP or also hidden?
then this would be my choice, hide and replace with simple object, ruins are great
gameplay
unless it is in some area no one ever going to go, then it wont hurt to keep it either way
There was a bug, when building was destroyed by script all JIP would see it being destroyed long after it was destroyed
without checking I would say it probably still there
hiding it and replacing was working fine AFAIK
by script
if it destroyed by game it syncs ok
Anyone knows if there is ANY docu on the CfgUiGrids class for custom UI elements for the Layout Editor? I am resetting variables which arma writes into the profilenamespace, these are defined in a sub class of CfgUiGrids. It all works fine but after relaunching the game it takes the old values from before the reset and i am not sure from where arma takes the original values.
what is the class?
Just the first iteration of new NATO stealth tech
how do you spawn it
What's the most occurring way a small pbo with basically only scripts causes the server to crash with only "Fault Address: XXXXXXXXXXX unknown module"?
weird. an inexistent #include file?
→ #arma3_troubleshooting
eh you might have a point there. Not an include though, just call to a mod that doesn't run in init.sqf
thought it fell under #arma3_scripting since it's probably a scripting issue or config.cpp
@winter rose turns out it was the hpp class (...) { preStart = 1; }; in the config.cpp. Did I make an error or is there another line to use to ensure that the mod itself executes the (...) functions when the mission starts?
which one comes first again?
do you have to start your game before you can start a mission?
Two different discussions and answers I'm afraid 😛
isn't MissionStart between pre- and postInit though?
nvm, upon
is it possible to script a uav to have exclusive access to just one player? say u got 3 players on bluefor, each with a darter. how can you make them exclusive plus when a player opens the uav terminal ui they only see 1 uav?
@lusty canyon I think that only works if you keep the darter local to that player
Where is your previous message that you posted? wanted to look up context but seems to be gone
remoteExec to _milo and not to 0
because you didn't add it to the JIP stack?
[_milo, (getMarkerPos "mrk_WPMiloJr")] remoteExec ["doMove", 0,_milo];```
Doesn't matter if there is no jip tho
well he mentioned hosting dedicated
And.. You don't need that thing on JIP either..
so I guess the mission starts before he joins?
It's a AI command, doesn't need to be recalled on JIP
Hm that's true though
multiplayer editor it works too?
_fnc_addarsenal = {
_obj addAction ["Open BIS Arsenal",["Open", true] spawn BIS_fnc_arsenal,[],1,false,false,"","",5];
};
[_obj,_fnc_addarsenal] remoteExec ["call",0,_obj]; // Alternatively "bis_fnc_call" ```
Unfortunately, this way the client on which it is executed, have no memory of the _obj. Is there a working alternative to ```sqf
remoteExec ["addAction",0,_obj];``` which doesn't allow a stack of JIP net IDs (e.g. multiple addactions)
you may want to execute ambientAnim serverside
The AI unit is serverside, that's why you remoteExec. But.. Why not ust execute that whole code serverside and get rid of all other remoteExec's?
it can be used for that
but you put 0 as target
which means execute everywhere
the _obj in my remoteExec ["call"], can I retrieve that in the client using _this since it gets sent alongside the _obj in the remoteExec params?
if you set it in the left argument, yes
[_obj, "mySound"] remoteExecCall ["say"];
[[_obj, 1], "BIS_fnc_setDamage"] remoteExecCall ["call"]; // fake func for example
@winter rose the allMissionObjects "ReammoBox_F" works flawlessly for the small crates! Any chance you know which one I need to include the helicopter DLC containers too? I found Land_FlexibleTank_01_F but I think that only goes for the flexible tanks?
just look at inheritance in config viewer
well that is the weird thing; it inherits from the same object type but the script doesn't "see" them
If I'm comparing two objects (units in this case), is it okay to use == or do I need to use isEqualTo?
doesn't matter
Would someone be willing to look over my logic here just to make sure I'm not making any dumb/rookie mistakes?
params ["_group"];
private ["_targets", "_side"];
_targets = [];
_side = side _group;
while { true }
do {
// Retrieve targets
_oldTargets = +_targets;
_targets = [];
_newTargets = [];
{
_target = _x select 1; // <OBJECT>
_targetSide = _x select 2; // <SIDE>
_targetType = _x select 3; // <STRING> class name
_targetPos = _x select 4; // <[x,y]>
_targetKnowledge = leader _group knowsAbout _target; // <NUMBER>
if ([_side, _targetSide] call BIS_fnc_sideIsEnemy)
then {
_targets pushBack [_target, _targetType, _targetPos, _targetKnowledge];
};
} forEach (leader _group targetsQuery [
objNull, // Ignored target <OBJECT>
sideUnknown, // Filtered Side <SIDE>
"", // Filtered class name <STRING>
[], // Filtered position (200m tolerance) <[x,y]>
0 // Max seconds since last seen <NUMBER> (0 = any)
]);
// Check each target for newness
{
_maybeNew = _x;
_isDuplicate = false;
{
_old = _x;
if ((_maybeNew select 0) == (_old select 0))
exitWith {
_isDuplicate = true;
};
} forEach _oldTargets;
if !(_isDuplicate)
then {
_newTargets pushBack _maybeNew;
};
} forEach _targets;
// Report new targets
if (count _newTargets > 0)
then {
{
// TODO: Report the new targets to friendly units within comms range
systemChat format ["New target found! %1 @ %2", _x select 0, _x select 3];
} forEach _newTargets;
};
};
stop using that private array crap and use the proper keyword
and use params instead of half a dozen of _x select
if !(_isDuplicate)
then {
_newTargets pushBack _maybeNew;
};
``` That spacing though
What's the proper keyword to use vs private? I'm not really sure why the private vars definitions, I've just seen other people do it, haha
private _var = val; should be used over private ["_var"]; _var = val;
And if you wanna use private. Then atleast do it completely. You private _targets and _side.
But what about _oldTargets, _newTargets, _target, _targetSide, _targetType and so on..
He copy-pasted the private keywords from something someone helped him with here iirc
So maybe I should back up here, what's the purpose of declaring private vars in a function anyway? If they're already local to the scope, what does it matter if they're public or private?
If you don't declare them private, then Arma will check if a variable with same name exists in a higher scope and overwrite that.
Meaning if you made a function that somebody else might call, you will overwrite his variables without telling him
Ahhh okay
Plus readability and performance bonus.
If you private it doesn't have to check if the variable already exists -> performance.
If you private you know that, that point is where the variable got created and that it doesn't exist prior to that -> readability
Gotcha, that makes sense
As for private keyword vs. private array, keyword is faster regardless of how many times you have to repeat it
keyword is free. private array is a command call
So, params vs select: Can I use params inside of any old array, not just a function declaration?
Keyword > command
Free vs not free == infinite% difference
Params takes an array as left side parameter.
If you don't supply it it automatically falls back to _this
so you can just _x params [...]
Ahhh nice, okay
// is faster than comment
Am I using any commands where I should be using keywords?
Yeah, I wasn't sure how to do that. I was originally just doing _newTargets = _targets - _oldTargets, but the problem with that is that everything but the first parameter could be different between checks for the same unit
_newTargets = _targets select {
private _newTarget = _x select 0;
(_oldTargets findIf {_x select 0 == _newTarget}) == -1
}
@still forum Would you be willing to break that down for me? I'm looking at the wiki entries for select and findIf but I'm not 100% sure if I'm following
select copies over all values where the code returns true.
findIf returns the index of the first found element or -1 if it didn't find it
So we are searching the first entry in _oldTargets that has the same object. And if we don't find any we return true, causing select to copy the current value to _newTargets.
If findIf finds the object, it returns something != -1 and the code will return false. Causing select to skip the value
So if the same value doesn't exist in _oldTargets, index == -1 returns true which adds the element in _targets to the new array
Got it
Thanks for your help!
how would I correctly initiate a nested array? It needs to store [ [ x, [y1, y2, y3], z ], [ x, [y1, y2, y3], z],...]. I currently use _array = []; _array pushBackUnique [x,y,z]; but the engine doesn't like inserting the 3-param element into it ```23:29:12 Error in expression < forEach _flags;
{
_saveData pushBack [typeOf _x,getPos _x,getDir _x];
} forEac>
23:29:12 Error position: <typeOf _x,getPos _x,getDir _x];
} forEac>
23:29:12 Error typeof: Type Array, expected Object```
That's not what it's complaining about
23:29:12 Error typeof: Type Array, expected Object
_x isn't an object and needs to be
oh it's not on about the array, but _x?
correct
aaaaah I see. I pushback one object, then pushback an entire array of 'em behind it. Should be appended then
@tough abyss The reason I used knowsAbout is because I'm going to pass that same value onto other friendly groups in the area with the reveal command
I'm doing the same as you actually, Spectre... be careful with knowsAbout because it only accepts local units
While it seems that these other commands accept units on all machines
Oooh, I didn't know that
Well, the unit who knowsAbout ... must be local
As on the wiki Multiplayer: who must be local, while target can be global.
I'm mainly doing this for the purpose of my own single player stuff, so it shouldn't be an issue at least for now, but I'll look into that eventually
Yeah then it's ok
and “targets” instead of “targetsQuery” target's doesn't return side, classname and pos. So he would have to get them seperately.
@queen cargo At Apple, we believe Everyone Can Code. And we truly mean everyone.... https://twitter.com/appleedu/status/1092810062597443585?s=21
Lemme quote Ratatouille: Everyone can Cook
But not Everyone should
I doubt everyone can cook
hot water into pot. noodles into same pot. Done. You can cook.
Being able to cook doesn't mean being able to cook good.
Nah some people cannot even do that
Okey yeah if you are blind and can't speak and have no arms nor legs then yeah. You can't cook.
Or a spoiled brat that never had to do anything yourself
@queen cargo BTW I am not endorsing this retarded statement by Apple marketing
Expected that @tough abyss 😂
disableAI everything. Then move it into the animation locally.
what do you mean by "transfering"?
It's definitely possible, but you might have to do it manually then if that func doesn't work
check the different animation commands, there are those that directly and immediately switch animations and those that allow the current animation to end and next one to begin after that.
Some animations are repeating and dont have any kind of blendind startup/end parts and some have those as separate animations
the all all animations
they all play the same
yes but all those animations are in the files
the functions are just to make their use simpler in some cases
and the functions use same script commands that can be used independently
you can check how the ambien anim function works in the ingame function viewer if you are interested in its behaviour
the functions use those same commands
playAction, playMove, switchMove etc
yes
functions are just ready made scripts
what animations are you trying to play?
is the script executed where the unit is local then?
a simple call is enough, no remoteExec. but the script has to be run where the AI is local, most likely the server for an AI
there is a separate function viewer too
there you go
need to make your own setup
If you use it on 20 units, 20 additional units (logics) will be created.```
→ Functions Viewer
top-left: global config file
then functions ^_^
switchMove ensures the animation is played, but without transition at all. Some animations have "begin" animation (such as salute, surrender etc.) while some only have the anim itself (e.g jump out of a vehicle)
the command AllPlayers, does it return a list of all players even for a server?
small issue of dead player being saved to a database 😄
yes. But as far as I heard at start of mission it lags a bit behind
allPlayers - allDeadMen then maybe
if (!alive _x) then {dont save maybe?}
There are enough Dedmen to need a script command?!
oh no I'm not saving the players. I used _arraytoSave - playableUnits at first to prevent AI being in there, but turns out dead people aren't counted under that anymore 😛
allDead seems like a better choice since it includes destroyed vehicles too
nearestLocation [ any position, ""];
``` returns nothing if the position is inside a military base? 🤔
or in a town?
is there a function that returns a name like "Kostas" or something?
name (nearestLocation [player, ""]) https://community.bistudio.com/wiki/name (That may not work based on notes (may need to use text instead), not sure though)
I'm using the text variant, but I get back ""
usually occurs in "unnamed" locations like military or something
maybe it's just a location without name? 🤔
Are you sure its returning the military location?
oi fellas. i accidentally wrote my problem in config_editing
tl;dr is - i have created a rsc layer and now i can't delete it anymore
stuff like "cutRsc ["","PLAIN"]" etc. does nothing
tried a couple different things, but i simply cant figure out how to delete that layer
(Asaayu) I wouldn't know, I get nothing back 😛
i'm calling it via "([] call bis_fnc_rscLayer) cutrsc ["lxHI_RscSensor","plain",0,false];"
this starts up the rsc layer, which has:
onLoad="['Init',_this] call (uinamespace getvariable 'lxHI_fnc_showSensor')";
and now my script will loop through it, which is what i want... except that i can't seem to stop it
[] call bis_fnc_rscLayer should return reference
if i put it in the debug console, i get 6
try 6 cutRsc ["","PLAIN"] then
wiki for igui mentiones ""someLayer" cutRsc ["RscTitleDisplayEmpty", "PLAIN"];"
[] call bis_fnc_rscLayer will generate new later number each time you need to either name it or store the return value
allCutLayers
Can the server determine which unit an admin occupies? 🤔
admin owner _unit
thanks @tough abyss stuff works. now i can start doing some real progress again.
oohhh shiny, thanks @tough abyss
nearestObjects returns every object right? Is there a way to only include objects that aren't part of the map?
nearestObjects returns every object right? no
sorry, every object within given range
no
hm then I may be formulating it wrong. Anyhow, I use the nearestObjects and it returns buildings that pre-exist on the map. Is there a way to remove these from the array resulting from nearestObjects?
Use filter so that buildings are not in the list
or use filter to return only buildings so that you could subtract them from the first array
can I cross-refence with allMissionObjects and check whether what was found in the array is also in the allMissionObjects?
wasn't sure whether to use that one or something get allMissionObjects to be the nearestObjects filter 🤔
there is also nearestTerrainObjects for map objects
hm so nearestObjects - nearestTerrainObjects would leave only objects placed in 3DEN or during the mission?
