#arma3_scripting
1 messages ยท Page 382 of 1
Okay, was trying hint format on _mapRoadDir while waiting, got "scalar" returned when the error popped up?
Otherwise you will diag log the very first thing
Scalar means some numeric value. How did your code look like ?
I'll try _connectedRoad with diag. I just put this in: hint format ["%1",_mapRoadDir]; and it was returning xxx.xxx numeric values (dir's) as I drove around activating triggers, but when the error popped, it returned "scalar"....
Okay, so here is what I'm getting from my .rpt file after adding
diag_log _connectedRoad;
_mapRoadDir = _roads g>
23:51:27 Error position: <_connectedRoad;
_mapRoadDir = _roads g>
23:51:27 Error Undefined variable in expression: _connectedroad
23:51:27 File X:\Users\XXXXX\Documents\Arma 3 - XXXX\missions\Tanoa.Tanoa\Map_Scripts\Map_Vehicles.sqf, line 216
23:51:27 Error in expression < = _roadConnectedTo select 0;
Connected road is undefined then
Not all roads in arma are connected sadly
That's not the error of the hint or diag log
But how you handle the rest
You need default values and checks for the data
I'm using a setup script to search for "streetlamps", when found, it then finds nearRoads and places a trigger on that road section. When the trigger fires, it runs the vehicle spawn script, which is where I have the vehicle orientation problem. Sounds like I need to add a search that discards roads that are not connected, skips placing a trigger.
K, I'm off. Thanks for the help!
With _roadConnectedTo select 1 you have the same error ?
Im gonna make a .sqf with a list of events in my mission to progress with objectives and stuff, were should i put the scripts i made? im bilding a coop mission.
goodmorning everyone
does anyone know why player attachTo _obj basically disallows any movements
lol ๐ TZ
I mean, can't rotate head
can't go in 3rd person
ok so I do need to use proxies
what kind of physx simulations exist beside carx or tankx
that's why I'm using proxies
but I need a "flying object" so if I use a proxy I need a Car or similar, which is a thingx object and will fall to the ground
I have a custom object with a cargo proxy in it
I'm thinking that mybe a weapon allows cargo proxies
I mean, can't rotate head <-- not true. you can rotate head and aim to a limited extend but the rest of the body is static
it changed from arma2 to arma3
sure you cant move
but you can turn your head
and aim within the confines of the floating zone
anyway what are you trying to do there ?
you mentioned a custom object, cant you add a person turret to it ?
this what I'm trying to do
this is the object in OB
it has 2 cargo proxies
I need basically for it to "fly" following a track"
and allow soldiers to get in as cargo
no drivers
and no, I can't move my head nor point my gun for some reason
I'd configure it as FFV
what is an FFV?
basically the requirements I'd have (if feasible)
- do not fall (no gravity)
- allow cargo in it
- if I could leverage some arma mechanism to sync in MP, good, otherwise I'll deal with local vehicles
FFV is the new A3 mechanic where you can fire from inside vehicles
e.g. shoot out from the back of a truck
it allows looking around and aiming (and shooting)
if youre making a custom object id just do that
im not entirely at home with vehicle creation, look up the appropriate channel in here
also known as personturret ๐
I don't want them to get up, just stay seated
they can be seated
kif only attachTo worked simply
you can have them in pretty much any pose for that
e.g. RHS has cars you can sit in the passenger seat and shoot out of the open window
the benches of the littlebirds
its all entirely documented
and im decently sure theres FFV samples in the samples toolbox
btw. pretty much all skilifts nowadays have safety bars
oh, thats really thin
can you use an iterator in a forEach loop?
... _forEachIndex?
๐
_cnt = count arrayName
{
name = "Soldier" + _cnt;
_cnt + 1
} forEach arrayName
_cnt = count arrayName
{
name = format["Soldier%1", _cnt + _forEachIndex];
} forEach arrayName;
why _cnt ?
just _forEachIndex should suffice
if the array is length 8, he wants to start at 8 from the example
im not sure that was intentional
welll, thought process was
I need to know the amount of entries in the array (so count)
Then i want each soldier to have a Soldier1 / Soldier2 / Soldier 3, so i reuse count
well im sure you can modify the snippet, then
MATLAB proves superior yet again
and you dont need to know the count for that
i mean all in all the conclusion is just use _forEachIndex
sure, starts at 0 though
yes but the first one will be Soldier0
ugh
adding 1 wastes precious nanoseconds after all
whats the point of these names anyway ?
_forEachIndex +1 will create 1, 3, 5 i guess?
no
oh wait
youre just raising it by one, you dont/cant modify that index
Just for the record, i'm not really a programmer/coder by any mean
dont have to be, it just requires some logical thinking ๐
yeah, that is quite flawed in my head
i did a python practice once and just wrote a brute-force to come to the solution
Anyway, the question was to edit this script:
to replace _markername = "marker" + str(floor(random 500)) + str(floor(random 500));
i see
_distance= _mkrX;
if (_mkrY > _mkrX)
then {
_distance=_mkrY;
};
just do this
_distance = _mkrX max _mkrY;
same result
also
_size = _boundingBox select 1;
_size resize 1.5;
this is very very wrong
resize is used to change the number of elements in an array
and there is no such thing as a half element
1.5 would be between elements, it should refer to the comma
@Arkensor#0120 Scalar means some numeric value Not quite.. Actually means the opposite.
No numberic value. A nil that should've been a number but for some reason isn't.
That was kinda what I wanted to say with "some" but your explaination is way more precise XD
You can say that no number.. is some type of number yeah ๐
`while { alive _unit } do
{
_unit reveal _target;
_unit doTarget _target;
waitUntil { _unit is facing target command }; // howTo
_unit fire (currentWeapon _unit);
sleep 30;
};`
use intersect ? ๐
Did I just read Intercept ๐ฎ I think I have to get my eyes checked
should be it? > waitUntil { lineIntersects [ eyePos _unit, aimPos _target] };
my point is to waitUntill _unit is aiming to _target and then fire. If I setTarget then unit is firing to ground and not pointing to target
maybe:
_weaponDir = _unit weaponDirection (currentWeapon _unit); waitUntil { lineIntersects [ _weaponDir, aimPos _target] };
you can also use the weapondirection, multiply it by the distance between the two units, add it to the position of the _unit
and check how far that projected point is from the target
not really for this case
but it allows you to get a number how close the unit aims to the target
also, there is this : https://community.bistudio.com/wiki/aimedAtTarget
not sure if kks comment still applies
how come that enableSimulation false also disables all animations?
isn't that supposed to just deal with physx and collisions?
No. Simulation is supposed to deal with Simulation. As the name says
is there "skip" / "continue" command for skipping loop in while if condition is met ?
while { _i < 20 } do { _i++; if (_i == 15) then { skip stuff }; do stuff };
in a while loop you can use exitWith, to exit the current iteration
if you want to exit the while loop altogether, you need to nest two exitWith iirc
How use Registered Functions of Intercept @still forum inside sqf ?
Just checking
if (!alive testguy) then {hint "RIP"};
if (!alive testguy) exitWith {true};
};```
this waitUntil will terminate once the test guy die right? or the code still runing somehow?
if (!alive testguy) exitWith {hint "RIP"; true};
}; ```
a little bit more correct ๐
You can choose the 100% waitUntil will exit.. Or the "Maybe I dunno.. It probably does I guess.. sometimes.."
@little oxide thanks
why adding an if inside there, to be extra super sure?
i did that because i am going to use this kinda of thing to check many others
but wait, that means once that waitUntil is meet all codes bellow will execute?
because this is inside of a .sqf
yeah
your first stuff too
your exitwith stuff, will just go out of the waituntil, he will finish the script
i tink i cant use that
becasue i will use this same .sqf file to put other events to check
Yes.. waitUntil.. waits.. Until... and then continues. Just like Sleep does.
What did you think it does?
Execute only the code i put inside of the scope, not everyting bellow it.
๐ฎ okey... Well now you know better
@astral tendon wait until is a sort of loop that loops until its condition is met
Afterwards, code just executes normal
Yes, i see the problem. i am going to need to use other thing. because that also holds any code bellow it.
[] spawn {
waitUntil ...
}
why do people even try to put everything in a single file ?
โ ๐
that works thanks.
Yeah, a lot more organized with multiple files
if more than 20 lines of complexity, then put it to separate file
Tell that BI ๐
player distance intel <=34
i can check the distance of a object that have a varible but how about check the side of it?
i wanna check if there is opfour around the intel
that also means it can be allot of enemys around that
trigger
also, objects don't have sides (well they do, side empty but that's another topic)
is it normal that onEachFrame runs even when the game is in pause mode?
that's kind of weird
you can have stuff move around while pausing, and it has physx disabled which is really weird
well
even the clutter stops being animated in pause menu in SP
so I wouldn't definitely have expected that
except you run with -noPause
If you try to create a vehicle or location while the world doesn't exist.. The game crashes.
ยฏ_(ใ)_/ยฏ
well that is understandable though ๐
Ok I managed to make my cablecar guys, believe it or not
really happy about it
one question I have though is to switch from my onEachFrame approach to something AI controlled with https://community.bistudio.com/wiki/setDriveOnPath
so that it will be automatically sync'ed
{alive _x} count units
How do i run that in a array?
like {alive _x} count units [group1, group2, group3]
Just add them together...
You really need to study how variables and operators work
Control structures as well
i did in other way around
[] spawn {
waitUntil {
if ({alive _x} count units WareHouseGuys_1 ==0 AND {alive _x} count units WareHouseGuys_2 ==0 AND {alive _x} count units WareHouseGuys_3 ==0) exitWith {hint "All Clear"; systemChat "yup, they are dead"; true};
};
};```
Yes, its urgly but as long it works...
I can't seem to have the addPublicVariableEventHandler fired on change of a variable
I have
"testvar" addPublicVariableEventHandler {
hint format [
"%1 has been updated to: %2",
_this select 0,
_this select 1
]
};
and
testvar= [1,2,3];
publicVariable "testvar";
Same client?
@tough abyss https://community.bistudio.com/wiki/getCargoIndex
It is, depending on what you do might be useful as well
Yes, exactly.
In your case fullCrew might be better then, since engine forms the array, bit faster
@tough abyss Yeah, found out about the forest path problem with Tanoa while testing today. Also found that airport tarmacs are and issue, as well as the small bridge between Georgetown and Saint-Julien (Georgetown side land connection not connected), and both ends of long bridge connections between Balavu Island and Katkoula Island are not connected. Thanks for the _filteredRoads, I'll play around with that and see what I can do with it.
They are not connected to anything. When I run the following and place markers, it shows all airport tarmacs as not being connected. _thisMapCenter = getArray (configFile >> "CfgWorlds" >> worldName >> "centerPosition");
_roadList = _thisMapCenter nearRoads 30000;
{_roadConnectedTo = roadsConnectedTo _x;
if (count _roadConnectedTo > 0) then {
_roadList = _roadList - [_x];
};
} forEach _roadList;
have a screen shot, but can't upload to this channel.
oh, wait, just found the screenshots_arma, will drop there...
You'll sometimes find connected roads in the same locations as the individual tarmac roads too.
Like, 2 sets of roads with different purposes in the airports. Not sure why but it's pretty common.
@a_shrubbery#4915 "centerPosition" isn't what it advertises itself as btw
you should use worldSize/2 if you want the center of the map
"centerPosition" is just a position that can be set anywhere depending on how the terrain maker was feeling that day
what is a reasonable interval for the use of publicvariable?
don't use it and use the third param of setVar
any reasons?
the good things abount publicVariable is that you can have a listener addPublicVariableEventHandler
with setVariable you need a custom loop to see whether a variable has changed.
no
you can use the same listener for setVariable
a reasonable interval is "not dozens of times every frame"
i'd say what's reasonable depends on what youre doing
what variable would you need to broadcast so often and why ?
is it something all players constantly see and need to be updated on ?
i am setting the position of local objects oneachframe.
i then broadcast the "official" position computed on server to ensure everyone is sync'ed
obviously can't use setpos on global objects oneachframe
so that's how i am dealing with it
hmm
what kind of objects ?
and you can do that on global objects, but its best to do that where the object is local
i'm having a custom vehicle, a cablecar chair
there are 30 of them going around in maps
so they need to follow a very precise track path
everything works
oooh that
i guess i would only broadcast an integer that specifies the position along the track
might even be worth a try to use servertime for that
are you using https://community.bistudio.com/wiki/setVelocityTransformation for it ?
anyway.... if all the cablecars are local objects
i think you'd run into a problem when people get into them
as in becoming invisible for everyone else
will see soon
no I'm not using velocitytransformation
I could have...
do you happen to know whether createVehicleLocal does create a vehicle on a dedicated server?
I wouldn't know how to use servertime for that though
basically, determine how long a cablecar needs to complete the track
and then divide (mod) the servertime by that
_i = (serverTime mod _tracktime) / _tracktime;
that should give you a value between 0-1 that indicates the position along the track
and yes createVehicleLocal can create a vehicle on the server
but then it is only on the server
yes that's what I'm doing
and without creating vehicles
but no servertime
i send position info every x seconds
because it's not 1 track, it's a series of them
anyway thanks for the suggestion, definitely one of the things I considered too
isnโt servertime a completely broken command
I was told to use CBA_ equivalent
is it still ?
(which I don't remember)
CBA_missionTime yea
yes that one
the diff is very low from my tests
if you have cba available Iโd use that
it's a terrain
oh
I'd rather not have such a dependency but... maybe
serverTime is only slightly "broken" Just read the wiki page.
ok ๐
does anyone know if unitcapture / unitplay work well in MP with units on cargo?
should be ok as long as you run it where the vehicle is local
damn, back to square 1
btw this is how it looks now
video demo: https://cldup.com/G_ulhzWHMe.mp4
all works good in SP and in MP
EXCEPT the issue i'm trying to solve
which is: each player can enter as cargo
BUT obviously the other players enter their own vehicle which are all locals
so you seem them floating next to the vehicle
the other option is to make a real floating vehicle (mass = 0)
then make it global and should sync
however... what happens if you have 60 of these vehicles around? I'd be concerned about FPS
(in a line I'll need around 60 chairs)
Is there anyway to have a unit from a group look into a direction that works 100% of the time.
currently trying with_unit setFormDir 45; _unit setDir 45;
But some units of the group are just looking a bit off. But while I give everyone it's own group its perfect.
Why do you want it down to that precision though?
Even so, visually that wouldn't make a real difference
So they immediately turn to form direction?
Well the thing is they are not all looking the same direction they are trying to look to the right direction. But it's off by some degrees.
By how much?
But yea trying to make sure they look out of the window. But some of them have their back to the window.
@subtle ore yea it's random.
What I'm seeing is that they all look different directions.
but some of them are just way off.
Well I've cancelled their formation movement with doStop but their directions are still off.
and doWatch needs position, I guess I could use a relPos.
and do 100 meters.
Random
@tough abyss Center of building? How would you do that?
BuildingPos is for entrances
Isnt it?
Well I'm giving them the right direction but even if I give them new directions with debug console they just ignore that and go back to whatever they had first.
They get set to that direction but then turn back.
which is the formation direction I'm guessing.
lol thanks but I've made that already XD
was about to test.
@tough abyss used that before but I'm planning on using it to fill a whole town.
And if I give everyone it's own group it will go over the limit.
๐
k the doWatch thingy worked.
Jup
well they shot at me (turned around)
I don't care if they don't go back to the position afterwards but I'll try and see if that happens.
ah no I'm only putting a squad in each building.
Not filling all buildings, only the selected types ones.
In the end they all die so it doesn't matter ๐
the thing is that once they're allowed to path again, your framerate just dies
@distant egret dont underestimate the performance impact a lot of groups have
it can be quite significant
groups are fine, it's the AI and their pathing that take the cake
I made this change to move away from single units groups. So I can populate more of these buildings. So in the end it's a gain.
it's much worse the more units you have
its not just the pathing imho
basically : boring = good fps
they can't configure their server.cfg, those are lagfest in every video i've seen
or they're running on potato servers
tomorrow is the CUP join op btw
potato servers for virtual potato farmers... sounds about right
it's sickening
hmm
well, good for them, at least it's not the horrors i've seen, also yeah, that's what the 12 year olds get off of, all that "code mumbo jumbo"
๐คฆ
In the meantime... ACE:
Hey! I mad a fix that increases fps by about 5!
A: good work
B: great
C: cool.
also.... eventhandlers !!
throws poo poo at @tough abyss
event handlers!
Does anyone know if it's possible to move the text's position in BIS_fnc_typeText2?
Just pre/append some whitespace?
Good idea.
How do I add an empty line to structured text? ["", "<br/>"] doesn't cut it.
it's not working with a crane.
if I remove lines 41 & 42 at least it does not disappear instantly, but it starts rolling on its own endlessly
bouncing
nevermind.
I DID
IT DOES NOT WORK
๐
I even have a mission file pasted for you, ok I'm sure you have better things to do
believe it or not, not really new to scripting
thank you for your help anyways.
is there a way to detect if the waypoint is activated?
anybody in here interested in some fun sqf-project?
only requires sqf skills and a basic understanding of REST and some magic commands not yet existing in my sqf-vm ๐ ๐ ๐
But behold, those who join might get crazy and doom their sanity
It is kind of a contract with the devil
You seem to be starting projects every other day...
Not really starting that project
Just some random idea floating around in my head involving networking, the sqf-vm project, a JSON parser in sqf that needs to be written and the discord bot
ArmA 3's engine is poo poo... SQF itself I still stand by being a large part of the problem.
EH's are executed on 1 core.
called unscheduled code runs on 1 core
virtual machine (scripts) run on 1 core.
Is there a way to tell if a player is looking at another object?
I thought I could use something like lineIntersects with the eyePos but that doesn't seem to work
What does lineIntersects return?
(lineIntersects [eyePos player, eyePos _x, player, _x])
Essentially
if they are ont he other side of the wall
false
if they aren't, true
and I thought this woulda pply to playermodels
but it doesn't seem too
How would you do it?
@tough abyss
yeah
still doesn't work with playermodels though..
how would you tell if a player is looking at something?
Gun or player?
player
I need to tell if they're looking at a certain player
(Just in visible eyesight)
run all the time or just once?
cursorTarget ?
no like
if they are in the screen
I would use cursorObject to tell if they were where I was looking
What is the object they are looking at?
So you want to know if a player is looking at a player?
by creating an image with a rscTitle using worldToScreen
I want to know if a player can see another player anywhere on screen
to sort between nearestObjects and what is actually in front of them
otherwise the text doesn't hide when you look away and it cloggs the screen
So this will be running all the time?
You want to find a players position in the screen convert it from screen space to world space
Then place an "icon" or something on that player?
DrawIcon3D ?
ugh
I have the text
that's not what I'm aslking
the script is working
I wrote it
Not detailed enough.
but I can't differentiate between the people behindme and those in front
i understand what youre describing
this is what I've been saying for the last 5 minutes lol
but i dont think its feasible
^
I have seen people who have done it
Who?
because they have had like names above heads
and when you look away they disappear
I've sorted LOS, but I need to sort on screen
If they walk away they will disappear
but not if I look away from them
also dont let the server be the one executing the LOS script youre using
so you're saying relative direction right?
Yes relative direction you can even use getDir with x,y
to determine from x -> y
As I said your "specifications" are vague and not sufficiently detailed.
Break the problem down more.
They're pretty descriptive
...
I've explained it about 10 times
but w/e
I'll just figure it out
What is hard to get about this exactly
How to differentiate whether an object within 5 metres is on the screen or off the screen
pretty descriptive
If you know english
Distance is easy.
๐คฆ
Can you read lol?
Of course distance is easy
5m is an exampel
Read the second half of the sentence
Can't be bothered work it out yourself.
Sure, I just thought some people might have ideas seeing as it's been done before and it would save me time
Got it
Haven't done arma 3 scripting in a while. The benefits vs cost were minimal.
https://community.bistudio.com/wiki/BIS_fnc_isInFrontOf there's better ways but this will probably suffice
dw I sorted it
I guess there is no way via scripting to reduce the loading time of a vehicle weapon?
Hey, is there a way to turn a players saturation up via script or mod config? I think the game looks way nicer with saturation so want to push it to my mods as a preset
@tough abyss pretty much all script languages run single core
Also... Sqf-vm has not much to do with arma besides the languages it is sharing
@hasty violet No
Well, if you run the code defining it, it will redefine it with the same code
I thought by inline you mean ABC = { hint "hello"; };
Compile and compilefinal are to create code out of it
The moment you got a code element you... Well.. Got runnable code
It's going to compile/define whenever you run compile or something like that. After that the stuff is in memory (if you saved it in for example a global variable)
In case you are a curious how it more or less is working, sqf-vm project of mine mimics Armas language and has some similarities
Hello guys, i want to display in a listbox the list of all the players but not the player that open the menu.
should i proceed like this ?
} forEach allPlayers - entities player;
allPlayers - [player]
@still forum - I found out that one can actually change the text's position with a 2nd and 3rd arguments, only it's not documated anywhere. ```SQF
[
[
[_missionName, "align = 'right' shadow = '1' size = '0.7' font='PuristaBold'", "#0086f4"],
["", "<br/>"],
[_date, "align = 'right' shadow = '1' size = '0.7' font = 'PuristaLight'"],
[_time, "align = 'right' shadow = '1' size = '0.7' font = 'PuristaMedium'"],
["", "<br/>"],
[_neareastLocation, "align = 'right' shadow = '1' size = '0.7' font = 'PuristaLight'"]
], -1, 1.5
] spawn BIS_fnc_typeText2;
Would anyone mind adding that to the biki?
๐
@tough abyss Not only position, there is couple more
//--- all params
private _data = param [0, [], [[]]];
private _posX = param [1, 0, [123]];
private _posY = param [2, 0, [123]];
private _alignBottom = param [3, true, [false]];
private _rootFormat = param [4, "<t >%1</t>", [""]];
private _abortParams = param [5, [], [[]]];
private _abortCond = param [6, {false}, [{}]];
private _playSounds = param [7, true, [true]];
Interesting ๐ค
Has BI a keydown eventhandler list?
I mean, when the player press your key "weapon hold lower" (standart is 2x ctrl left) can i use a code for that? when he doing the "action" ?
actionKeys afaik
but it's kinda broken due to key combos
see commy's comment on that page for more explanations on how it's broken.
good day, can any one help me, i need a script that can make the fatigue and stamina more than the normal vanilla stamina, so i can run longer, but not turned off ?
hi so will this make me run longer ๐ ?
but still have the stemina
do i add this in initplayerlocal
private _stamAdd=11;
private _stamInt=4;
while {true} do {
if (speed player >0) then {
_cStamina=getStamina player;
player setStamina (_cstamina + (_cstamina/_stamAdd));
};
sleep _stamInt;
};
this is probably terrible example, ive never messed with stamina, but it should do.
hi thanks, wher do i add this ?
initplayerlocal
ok let me try
that works realy grate thanks. do i ned to add this to the onPlayerRespawn
also
nope
ok
@copper raven you stil here, what about if i want to setCustomAimCoef and setUnitRecoil Coefficient how can i set that up for players dont have that sway on the gun but still have it
sorry my english ๐
you dont want players to have weapon sway?
yes, but not like the vanila one, its alot of sway
now that i can run longer the sway was really bad when you lose your breath
so you want to decrease sway when player is about to run out of breath?
yes somthing like that, more stady aim
so the xcope dont keep jumping around like it do now
scop
I am trying to create an addon that has a GUI component I am following the guide at https://community.bistudio.com/wiki/Dialog_Control#Dialogs
I have the Example 1 code in my description.ext file and through a script I am calling
waitUntil { !dialog };```
however I am geting the error `Resource MyHelloWorldDialog not found `
Can anyone help me?
Hi, how would I call a certain script for only players that JIP?
I'm looking at the onPlayerConnected function and I'm not sure if that runs for everyone as soon as they connect or whether it's just JIP players
I can't remember if it's AL or AG, but better be safe and check only on the local machine
Hmm , how would I normally use that function? I rely a lot on examples unfortunately
if (didJIP) then ...
Oh, that's easy then
if(_jip){
// Code here for jip maybe?
};};```
Hmm
What would be the difference between that one and
if (didJIP) exitWith
{
[] execVM "jip.sqf";
}
I don't know try them both i guess
still ned some help on my sway problem ? any one ๐
No experience with that, sorry
no i gat it from @copper raven thanks man
how can i add a simple script in my mission to make the suicide belt to blow up? with an alluah akbar sound to it ?
and if there is any scripts that can do this let me know thx.
why don't you look up how to do it yourself? @[CK]TimRambo#5535
spawning an artillery shell on yourself and playing a sound is easy to do in rv
i already have a model just need a script that make it so it has a deadman button and other stuff
http://steamcommunity.com/sharedfiles/filedetails/?id=1139058244
but its like ehm ya lol
and made with good taste.
Hi! I'm attempting to do this: https://community.bistudio.com/wiki/Arma_3_Unit_Insignia
and no insignias pop up, even when testing in single player nor multiplayer
I just throw this into the unit's init right? [this,"111thID"] call BIS_fnc_setUnitInsignia;
try [player,"111thID"] call BIS_fnc_setUnitInsignia; in debug console
Output is false......?
That does appear to be the case
Just tried to run it on an APC and still gives the same output
[apc1,"111thID"] call BIS_fnc_setUnitInsignia;
only applies to uniforms
Can't do it on vehicles?
no, that's the unit squad xml logo
Damn, so this isn't a means to override the squad xml logo?
technically you can replace it by something else or add it yourself, but it's a PITA
(on vehicles)
On a Scale from 1 to 10 it's a "Banana".
๐ค
Ok tried with https://community.bistudio.com/wiki/setAmmo thats obviosly not the one. Is there a way to reduce to reload time of a vehicle weapon somehow?
via scripting I mean
force user to reload? I just want to acomplish that a weapon that takes 6 seconds between fired again (cause of realod) just needs 1
for e.g.
action
@tough abyss >via scripting I mean
@tough abyss no. It doesn't have anything to do with characters. I said vehicle weapons
I just want a vehicle weapon to be faster reloaded than normal
either by AI or by player
Is there a way to cancel a sound in the middle of say3D? I want to cut it halfway through if the sound is turned off instead of finishing the sound it is on
Make some local entity say it and then delete the entity?
I came up with something. One other question, why does serverTime have a different value on player and server?
how can I check if a cargo index is free before using moveinCargo?
@cerulean whale Read the wiki page for serverTime. It's weird.
Yeah I just did before you sent that @still forum Makes more sense
Umm, one question, I'm using createSoundSource to stop me from having to spawn everything @meager granite but if I wanted to locate all nearby soundsources using nearestObjects what would I do? ```
nearestObjects[player, [""], 10];
Cheers
I tried typeOf _sound; which returns "#dynamicsound" but when I try ```
nearestObjects[player, ["#dynamicsound"], 10];
Any ideas/
?
nearestObjects doesn't search trough all entity lists.
Dunno which command uses which lists. And those lists have no official name. Might want to try to use allMissionObjects and some kind of sorting technique with apply [_x, _x distance _origin] and sort.
has anyone made an offline archive of the wiki? I'll be w/o internet for a few weeks and could do with one
Hi all - anyone know a solution to this: https://forums.bistudio.com/forums/topic/211743-dialog-transition-cut-off-point/
@obtuse cosmos Place the controls inside a control group
Or if you want to be really sneaky:
Put a controlgroup onto your background
then put another controlgroup into that controlgroup
and then put your controls in that uppermost control group
this way you can move the uppermost control group to the left, it will cut off where the lower control group ends and you will only need to move one control (being the upper control group)
Alright, thanks @tame portal
Can't do the controls on background with controls group, already got one for the tiles effect - unless you can have more than one?
You can create as many as you want as far as I know
Inside: class controlsBackground {};
?
rgr
I've done it inside the controls for now with RscControlsGroupNoScrollbars - will try this first
The issue with entire thing is that map doesn't get cut off by controls group
Even more, iirc it always uses screen coordinates instead of relative group ones
Did something similar years ago, had to make map appear and disappear instantly unlike everything else:
https://www.youtube.com/watch?v=YyBo4Ksfz_Y
What I mean is that if you'll have it inside controls group, map will not be positioned relative to group unlike all other controls
hm
Anyway, try yourself and you'll see what I mean
But in general although you can display controls over map, it can't be cut off inside controls group
I saw
also, the map is fucked up
- Some invisible padding
- When I move it to the left, it goes down to the left side as well
nvm
idk
I only changed code to: ```
((_display displayCtrl 900) controlsGroupCtrl _x)
It has same h values too
Fixed the transition with it going left and down, forgot to change one part, my bad, the issue shown on pic though, idk why that is
so how to i select a random entry from the config so that i get one of he possible infantry groups of a faction for example?
just like this?
_randomgroup = selectrandom[configfile >> "CfgGroups" >> "East" >> "CUP_O_Tban" >> "Infantry"];
@still forum Perhaps a dumb question, is there something preventing LR channels being synced when respawning, when it works for our SR? This is about TFAR, in case it isn't obvious.
thanks
define "synced" ? and "works for SR" ?
Let me get the actual code, give me a few minutes So I'm not just talking out of my ass
https://github.com/A3Antistasi/antistasiofficial/blob/master/AntistasiOfficial.Altis/cba_settings.sqf We have the SR working correctly, but LR is not synchronized. Perhaps this would be a better question for CBA devs?
Perhaps a better question to ask, will SR and LR be synced to side automatically in the 1.0 update?
Most likely TFAR being shitty. Probably not.
Just released a new version a couple minutes ago that probably fixes that
Where?
And in regards to probably not, are you referring to the synchronization to side automatically?
frequency syncing is just broken... It doesn't even work at all when you Respawn I think.
Where TFAR versions are always released. Github.
can i do it like this?
_randomgroup = selectrandom getArray (configfile >> "CfgGroups" >> "East" >> _faction >> "Infantry");```
with variables in the path?
yes
wtf
15:13:11 [ACE] (arsenal) TRACE: 191575 mass: _class=AN/PRC-343, _mass=8, _maxLoad=8, typeName _mass=SCALAR, typeName _maxLoad=SCALAR, _mass == _maxLoad=false z\ace\addons\arsenal\functions\fnc_updateRightPanel.sqf:35
What's the proper way of using remoteExec and hint format ["%1", player]?
@tough abyss the easiest way to do this would be to create a function
but you can just do
[str player] remoteExec ["hint",?]
but that would send the str from the remote executer
Good thinking, thanks @simple solstice!
fixed:
code
TRACE_6("typename tests", typeName _maxLoad, typeName (progressPosition _loadIndicatorBarCtrl), _maxLoad, _maxLoad == 40, (progressPosition _loadIndicatorBarCtrl), (progressPosition _loadIndicatorBarCtrl) == 0.8);
_maxLoad = _maxLoad * (1 - (progressPosition _loadIndicatorBarCtrl));
TRACE_3("after multiplication", typeName _maxLoad, _maxLoad, _maxLoad == 8);
_maxLoad = parseNumber (_maxLoad toFixed 2); // Required to avoid an issue where even though the typename returns "SCALAR" it doesn't act as one.
TRACE_3("after fix", typeName _maxLoad, _maxLoad, _maxLoad == 8);
debug log
15:56:04 [ACE] (arsenal) TRACE: 29680 typename tests: typeName _maxLoad=SCALAR, typeName (progressPosition _loadIndicatorBarCtrl)=SCALAR, _maxLoad=40, _maxLoad == 40=true, (progressPosition _loadIndicatorBarCtrl)=0.8, (progressPosition _loadIndicatorBarCtrl) == 0.8=true z\ace\addons\arsenal\functions\fnc_updateRightPanel.sqf:26
15:56:04 [ACE] (arsenal) TRACE: 29680 after multiplication: typeName _maxLoad=SCALAR, _maxLoad=8, _maxLoad == 8=false z\ace\addons\arsenal\functions\fnc_updateRightPanel.sqf:28
15:56:04 [ACE] (arsenal) TRACE: 29680 after fix: typeName _maxLoad=SCALAR, _maxLoad=8, _maxLoad == 8=true z\ace\addons\arsenal\functions\fnc_updateRightPanel.sqf:30
_randomgroup = selectrandom getArray (configfile >> "CfgGroups" >> _side >> _faction >> _type);
keeps returning me null, but i see that _side is "West", _faction is correct and _type is infantry
because there's no arrays there
or East, CUP_O_TK_MILITIA, Infantry
it's only subclasses under there
oh... so what do i need to do to get an array with the group types from the factions?
("true" configClasses (configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry")) apply {configName _x} as an example
it will return
["BUS_InfSquad","BUS_InfSquad_Weapons","BUS_InfTeam","BUS_InfTeam_AT","BUS_InfTeam_AA","BUS_InfSentry","BUS_ReconTeam","BUS_ReconPatrol","BUS_ReconSentry","BUS_SniperTeam","BUS_InfAssault","BUS_ReconSquad"]
ah cool. thanks!
i guess i still nee dthe "getarray" bit?
no you don't
just replace "West" "BLU_F" and "Infantry" by your local vars
("true" configClasses (configfile >> "CfgGroups" >> _side >> _faction >> _type)) apply {configName _x}
with:
_side = "West"
_faction = "BLU_F"
_type = "Infantry"
will return the same array that I posted above
configClasses returns all the subClasses that have the condition return true, in this case all of them since the condition is "true"
Apply changes an array, in this case the array that configClasses returns, we're replacing each index (which are config path at this point) by their config name
Using the Binarize option to create my .pbo seems not to include my \functions folder so I get a lot of Script addon\functions\fn_function.sqf not found errors
Building without the binarise option and it will work fine
check the exceptions iirc
do you mean Exculusion pattern list filename? if so that is using default
no, the binarize log
errors should be printed there, you can have syntax error that trip binarize but not anything else
ah i got it. was lacking an extra set of brackets. thanks alganthe
is there a way to make mines not explode when in contact with a civilian? or a especific team or unit?
nope
or at least a script to desarm mines?
enableSimulation false?
maybe
you could disable them for specific sides then.
that does not really work in the way i want
the mine still triggers but does not explode
I'm not really familiar with them, but I'm sure you can find a way.
other way around is to make the unit invunerable and across the mine field, but that will be akward
now why are there mines then? just out of interest
the objective is to cross the mine field with a mine detector and get on the other side, and then the IA must follow you
but you know how reliable IA is.
yeah i see...
from biwiki:
Vanilla AI already avoids vanilla mines placed by their own side.
Make sure to eitherย revealย the mines to your preferred side or place the respective mines from the correct side.
ย
Cheers
well, then it would defeat the porpuse of the mine detector
the player must find the way into the mine field
Then the IA must across
well, i will just delet the mine field once the player across, seens the only way.
also from BIForum:
this enableSimulation false;
null = this spawn {
ย ย ย private _position = getpos _this;
ย ย ย private _explosion = "R_60mm_HE";
ย ย ย waitUntil {sleep .5; triggerActivated mytrigger};
ย ย ย private _bomb = createVehicle [_explosion, _position,[], 0, "CAN_COLLIDE"];
deleteVehicle _this;
};
what's a reliable way of checking how much time passed since mission start
diag_tickTime
biki is scarying me that time can desync under heavy load
This command will return time since last client restart as float. However because of Number format used in Arma, the more time has past since restart the less precise the returned value will be. is this something to worry about in a 3h period?
@subtle ore diag_tickTime is time since game start.
not "since mission start" as requested
Sorry blanked me for some reason
ยฏ_(ใ)_/ยฏ
Any clues as to why I'm getting the following error 20:49:56 Error in expression <nt = 'PuristaMedium'"], ["", "<br/>"], [_locationText, "align = 'right' shadow => 20:49:56 Error position: <_locationText, "align = 'right' shadow => 20:49:56 Error Undefined variable in expression: _locationtext 20:49:56 File x\nev\addons\debug_menu\functions\fnc_missionInfo.sqf, line 41 with the following code? ```SQF
// Get current location text
_neareastLocations = nearestLocations [getPos player, ["NameCity", "NameCityCapital", "NameLocal", "NameMarine", "NameVillage"], 10000];
if (_neareastLocations isEqualTo []) then {
_locationText = "In the middle of nowhere";
} else {
_locationText = format ["NEAR %1", toUpper text (_neareastLocations select 0)];
};
// Output
[
[
[_missionName, "align = 'right' shadow = '1' size = '0.7' font='PuristaBold'", "#0086f4"],
["", "<br/>"],
[_date, "align = 'right' shadow = '1' size = '0.7' font = 'PuristaLight'"],
[_time, "align = 'right' shadow = '1' size = '0.7' font = 'PuristaMedium'"],
["", "<br/>"],
[_locationText, "align = 'right' shadow = '1' size = '0.7' font = 'PuristaLight'"]
], -1, 1.5
] spawn BIS_fnc_typeText2;
@tough abyss whats is -1 and 1.5 for?
To changet he location of the text.
@subtle ore - Only 1 out of 7 arguments of BIS_fnc_typeText2 are documented.
I see.
That's why you should use private
private _neareastLocations = nearestLocations [getPos player, ["NameCity", "NameCityCapital", "NameLocal", "NameMarine", "NameVillage"], 10000];
if (_neareastLocations isEqualTo []) then {
private _locationText = "In the middle of nowhere";
} else {
private _locationText = format ["NEAR %1", toUpper text (_neareastLocations select 0)];
};
See your problem now?
Nope ๐
you don't?
I'm failing to understand how private changes anything here.
It is defined inside the if scope.
If you leave that scope it's undefined.
^
If I have a private would that mean that _locationText will not "escape" the if scope?
Sure
That's the opposite of my intent.
Sets a variable to the innermost scope
private _bob = "bob";
if (BOOL) then {
_bob = "bill"
};
in this case _bob is now bill
Should I be declaring my vars before the if block?
yes
Well I mean, you can
private only work on new scopes within the current scope, it doesn't define it for the previous scope for very obvious reasons
if (_neareastLocations isEqualTo []) then {
private _locationText = "In the middle of nowhere";
}
is in a new scope
feel like I need to wash my hands after
if(true) then {
};
Declaring before if block worked. Thanks folks ๐
yeah, but why?
Asking the important questions.
Because... _locationText was "tied" to the main scope with private, and didn't only change in side the if block... I think... maybe...
Some times it takes me a while to understand what I'm writing.
But why is that important?
Because _locationText needs to exist in the main scope in order to be used there?
I'm trying really hard here ๐ฆ
Because otherwise it's present in the if?
because otherwise it's only present in the then or else blocks
Because _locationText needs to exist in the main scope in order to be used there?
``` @lone glade - pretty much?
yep
is there a way to place a dialog in a specific spot even if the player has different Interface Sizes?
I've created a dialog with safezones and so on, but changing the Interface Sizes, my dialog position seems changing
yes, use the pixelGrid system with pixelGridNoUIRescale
How about
private _locationText = if (_neareastLocations isEqualTo []) then {
"In the middle of nowhere";
} else {
format ["NEAR %1", toUpper text (_neareastLocations select 0)];
};
? @tough abyss
hell, there's a better way even
private _locationText = [format ["NEAR %1", toUpper text (_neareastLocations select 0)] , "In the middle of nowhere"] select (_neareastLocations isEqualTo []);
@lone glade thanks bro, tomorrow I'll give it a try
so it has to be like this? h = ICONH * safezoneH * pixelGridNoUIRescale;
pixelGrid commands have to be used with pixelW and pixelH
ah ok
you can use safezones on top of that, for example:
safezoneH + (1 * pixelH * pixelGridNoUIRescale)
no, it's a system for positioning the controls / dialogs
you can (and should) use it with safezones
it's pixel precise, which is very nice.
ok, so safezones and pixelGrids should be use together to have an UI based on all the players resolutions, right?
thanks
Thanks @still forum, I'll be sure to try it tomorrow!
Hello. I've created this simple script to lock gate for anyone apart from west side. And it works perfectly on my local test server. But if I put it on my live one nobody can open the gate. Can anyone tell me why? Thanks.
if!(playerSide == west) then {this setVariable ['BIS_Disabled_Door_1',1,true]};
I'm putting this code inside gates init on eden editor.
delete the true at the end of your setvariable @native siren
@little oxide Thank you it worked ๐
Trying to make unit rotate turret 45 degrees left from vehicle orientation while maintaining 0 turret elevation, using lookAt but can't figure out how to calculate Z to look at. Any ideas?
eyepos maybe?
Hm
Nope, using Z from eyePos doesn't work, elevation ends up being different for different vehicles
I also tried using memoryPointGunnerOptics memory point from the turret, no luck either, various elevation depending on the vehicle
45 degrees doesn't need to be precise really, I just need perfect 0 elevation
Tried using lookAt entity instead of position, same thing
Well, looking at very distant point (modelToWorld [-1000,1000,0]) leaves elevation almost at 0 due to distance, still not a perfect solution though.
I can't test this at the moment, but would this work? https://pastebin.com/raw/B2zc3wwB
yes, altho you're missing a bracket on the third line and need to privatize that var
_chicken
Second addEventHandler array element lacks curly brackets
ah yes, that too
Can an object be created on a local machine in multiplayer game but not sent to all clients?
my chickens wont attach ๐ฆ
ur params is one early for _projectile
you are missing mode
params ["_unit","_weapon","_muzzle","_mode","_ammo","_magazine","_projectile"];
@robust hollow thanks. If I use deleteVehicle on the local vehicle. Will I be running into any problems with the netId being persistent?
the netid of local objects in mp is always "0:0".
local objects as in created with createvehiclelocal
so that means no matter how many are created it won't be a problem. Correct?
you can create as many objects as you like with createvehiclelocal, you just cant refer to them by the netid because they dont have one.
Thanks @alganthe#8904.
myString = str (10) + str (10)
My output is "10""10" Why isn't it "1010"?
switched to
myString = format["%1%2",10,10];
str 10 + str 10
is
"1010"
If not then you made a mistake.
Is there an equivalent setter to this getter? https://community.bistudio.com/wiki/currentWeaponMode I'm trying to force single shot only
what is the reverse of "in"? like "!in"
!("STRING" in ARRAY)
thanks
is there no way to add a magazine without triggering the reload timer or shorten it for units <--- (important)
I tried addWeapon and all the addXXItem for primary secondary and handgun as well as try to reduce the reload timer to 0 using setWeaponReloadingTime
but apparently it detects the muzzle but fails to change the reload timer :/
the only way to avoid that is adding the mag in one of the player's containers before using addWeapon buuuut it doesn't work for bigger mags (not enough space)
like rockets and belts
add a fake backpack and remove it afterwards
way too fucky and if the player has a backpack it won't help either
altho seeing your rocket slide off the tube is fun:
https://imgur.com/xVJqMzh
it's kinda annoying that you have to wait for the "reload timer" which is longer than the fucking animation
oh itโs for when selecting a new item?
yep
in vanilla you don't get the weapon loaded if there's not enough space in your containers
you also can't switch mags on the fly
Just checking if there is anyway to replicate this requested feature?
https://feedback.bistudio.com/T76514
afaik the only way is adding it before the weapon and thatโll require the fuckery
eh, i'll keep it like this, it's better than having to add the rocket to your backpack, exit arsenal, load it and reenter arsenal
```This addaction ["Secure intel",{deleteVehicle intel}];````
this object got its simulation disabled, does it still work on a coop when a second player use the action?
bunch of issues here, "intel" is a pretty bad name, at least use a tag.
I suppose you placed this code in an initBox? if so, is it on the player or object?
because it's super generic, something, somewhere in missionNamespace might use that varName
you don't have to get errors for it to be a bad variable name
Nevermind.
you should probably test things yourself before asking other people
especially when you are around.
Some people are dumb
Everyone is dumb unless proven otherwise
Prove it Dedmen, 1v1 me bro
Maybe he did that because he found that you can't compare a boolean to true
And failed to realize that comparing to true doesn't make any sense
I see a lot of people doing that
Working on something for a long time.. Means your code is most likely shit
Because there were a lot of new things in the last 6 years
if you are still stuck with what we had 6 years ago your code is gonna be a useless pile of garbage
Hey folks, I've been digging through MCC in order to find a way to create an item shop with would use same mechanics and resources as MCC does. MCC already has the Vault feature with handles buying and selling guns using Valor. The only thing that really needs to be done is to make it possible to add items to the vault in the editor.
What I discovered is that MCC is running a script with adds an item highlighted in the shop menu, to the vault. What I would like to do is have a script that reads the content of an ammo box at the start of the mission, creates an array of all the items, and then runs that MCC script on each of them to add them to the vault.
In theory this should add the items from a box to the shop/vault and MCC mechanics would take over from there.
Would be nice if you could set up couple of boxes, not sure how to tell the script to use them yet, sychronisation? Or maybe every box with specific phrase (MCC_shop_inventory_[number])
if(DAC_Basic_Value > 0) then {exit}; Like.. WTF is that supposed to be?
hahahahah digging through MCC
exit is a >10 year old SQS only thing. And he is using it in a SQF script
if he want's to exit he has to use exitWith which probably didn't exist back then
or breakOut
That code is broken.
He want's to exit if DAC_Basic_Value > 0 But what he does is nothing and just continue running.
So don't tell me he knows what he is doing
He might have known what he has done in his SQS script 5 years ago.
or he didn't want to update DAC, simple as that
But 5 years later. And in SQF. It's just bullshit
If that is a SQS script the format thing might make sense. But afaik waitUntil is a SQF thing isn't it?
Some people also think MCC is amazing.
Some people think the BI Arsenal is amazing.
Depends on what you mean by "amazing" I guess.
at least he private his vars
I won't even start talking about that "code"..
Why do people capitalize "true" and "false", but nothing else? Where does this come from?
?
#define 0 false
#define 1 true
using 0 and 1 as numbers would actually be more efficient
That is a stupid idea alganthe, and you know it.
time to have the scope talk again
I wonder what ancient magic is behind this one: waituntil {((getdir DAC_StartDummy) > 170)};
and that's exactly why you privatize ALL local vars
People not using private are dumb.
because finding those issues is ulcer inducing
_this
I right now can't think of any programming/scripting language where local variables don't carry over to lower scopes
magic vars don't need it
๐ : what was the fart emoji again?
Besided if you "call" a real function.
๐จ
๐ ๐จ
does that include emojis?
Alganthe, I want to inform you that you used the plural incorrectly.
You'll have plenty space if you just use 2 "characters"
xD
wrong
AI spawning/patrolling/garrisoning and spawning camps that also spawn camps, also had some other features like arty but those have been broken since arma 2
#1 dad
oh god that xkcd sums up my development style w
I need to disableSimulation on a vehicle that is without cargo, so I wrote:
_chair enableSimulation false;
_chair addEventHandler ["GetIn", {
params ["_chair"];
_chair enableSimulation true;
systemchat "ENABLED!";
}];
_chair addEventHandler ["GetOut", {
params ["_chair"];
if ((count (crew _chair)) == 0) then {
_chair enableSimulation false;
systemchat "DISABLED!";
};
}];
so when I get in, "ENABLED!" is showed. When I get out, "DISABLED!" is too. If I re-enter though, the GetIn is not fired anymore. Any ideas?
no but why would that work instead
@candid jay locality changes
_chair is a global object created on server
maybe I could try enableSimulationGlobal instead
when you get into a vehicle
except that I've shut down the pc for tonight
into the vehicle as cargo though.
not as driver
oh
well you could try using getinman
assign it to the player
and check whether the entered vehicle is _chair
if so do what you want
Comment out the enableSimulation lines (both) to see if that interferes with it.
Maybe some bad script interfering with this one by using removeEventHandler with the wrong id or even removeAllEventHandlers.
maybe it is a locality thing.
apparently locality changes even if only cargo gets in
โUnits or players entering or exiting a vehicleโ
but then I donโt get why GetOut is called.
Free code snippet for spawning VR Room at any position:
I used it to make this in a classic Altis Life server back in the day (lost the deathmatch code though, but shouldn't be extremelly difficult to recreate)
Enjoy!
DAC....
DAC makes a servers FPS tank.
DAC was integrated into I&A for a long time.
@icy raft Do you need that many spawns?
3 spawns nested inside each other?
I&A code makes I&A code worse
Made the script in 20 min so yeah