#arma3_scripting
1 messages ยท Page 421 of 1
No.
oh i see that's just something you came up with
That's something I'm coming up with right now
if (cond1) then {
} elseif (cond2) then {
} elseif {cond3} then { //cond will not be evaluated if any of the above statements triggered.
} else {
};
idk switch on true seems cleaner no?
switch on true seems cleaner than a genuine if then elseif else?
or jumptable in the case of contiguous integers
switch (true)
{
case a: {}
case b: {}
case c: {}
default {}
}
seems less noisy to me
And as a coder that knows other languages with proper if then elseif else structures you also prefer the switch on true?
this is sqf we're talking about, not c
Yeah? And?
in sqf the switch looks cleaner to me
idk i think i barely ever used it
if a then
{
}
elif b then
{
}
elif c then
{
}
else
{
}
i guess this isn't too bad either
I can give you both elseif and elif
maybe it was just your disgusting brace style that was putting me off haha
i don't really care, i'm just an armchair designer here i don't actually do any sqf anymore
Also my implementation still leaves room for idiots to do stuff like
if (cond1) then {}
elseif (cond2) then {}
else {}
elseif (cond3) then {} //will never happen
;
https://github.com/dedmen/Intercept_CBA/commit/7ae31455b9d25e60630c0eb49783aae505e8c329
And done. Doesn't support if (cond) then yet though. Either need to #define the if away or use (cond) then variant
Had the idea 42 minutes ago
And now it's done. Why doesn't BI give us such nice things :U
whats with the names? do you just pull a random naming convention out of a hat for each symbol? :D
Especially performance as you can do elseif {} which won't execute the condition if it doesn't get to it
what symbol? what names?
i see snake_case, PascalCase, camelCase, and some weird combos Pascal_snake, camel_snakeCamel, camel_SnakePascal
Intercept is snake_case. I use camelCase and uppercase CamelCase for classnames and other global names
alright fair enough
if (cond1) then {
} elseif (cond2) elseif (cond3) elseif (cond4) else {
};
Please don't do that.
seems legit
if (cond1) then {
block1
} elseif (cond2) then {
block2
} elseif (cond3) then {
block3
} else {
block4
};
Dunno how what you posted would work, Dedmen.
why
Lack of then-blocks.
Is one statement allowed without 'then'
Ah you mean my last post?
My bad
I mean in elseif: you can have a following statement without bracket?
Like in C/C++
It works because elseif returns elseIfType and also takes elseIfType.
the elseif add's the condition for the next statement into the array of statements.
and the then then pushes the code to the last added statement
@errant jasper Not possible because SQF
It's something I don't like about C tbh.
Okay. I see. But basically the same practical effect, of what you posted earlier with the sequenced elseifs
The condition check just returns false if a statement doesn't have code
you don't like if (foo) bar(); ?
so elseif (cond) elseif (cond) both conditions would automatically be false and they don't do anything
So what's wrong with:
if (cond1) then {
block1
} elseif (cond2) then {
block2
} elseif (cond3) then {
block3
} else {
block4
};
???
nothing
k
tl;dr
To be clear I am talking about this part: } elseif (cond2) elseif (cond3) elseif (cond4) else { .. Which works because of the weird implementation of having a goddamn type, elseIfType, used for optional branching.
I could fix that by having elseIfTypeWithoutCode elseif BOOL return elseIfTypeWithoutCode and elseIfTypeWithoutCode then CODE return elseIfTypeWithCode
That way a elseif without code is an invalid argument for the next elseif
But too lazy
So am I correct in that: if (cond1) then { BlockA} elseif (cond2) elseif (cond3) elseif (cond4) else {BlockB}
Then BlockB will only run if all conditions are false?
And if cond4 is true then nothing happens?
no
the conditions without a code will automatically be false
Because there is no code so they are kinda invalid
That's equal to
if (cond1) then { BlockA} elseif (false) then {} elseif (false) then {} elseif (false) then {} else {BlockB}
and that's equal to
if (cond1) then {BlockA} else {BlockB}
So it will run if cond1 is false. The remaining conditions do not matter?
it will go through and stop at the first condition that evaluates to true
The else statement is implemented same as a
elseif (true) then {BlockB}
I understand (probably)... Think I will just stick to my regular patterns..
Is there a recommended ratio between setObjectViewDistance and setViewDistance values (except former being less than latter)?
Think what values are preferred are quite personal. Up to 5km's I actually prefer they are identical.
Are you playing with ACE? Then you can just set the maximum, and people can run with their own settings, limited by the maximum.
Yes, I am. Just wandered if it ever makes sense to make them different. From the performance perspective.
Lowering the objectViewDistance does give better performance.
The drawback is ofc you are looking down unto that empty valley that actually has houses.
Yup. And I think that goes for units too. Enemy might be there but it's not to be seen. ๐
Why don't you just let the player decide?
^ That like cheating in pvp
is having better hardware cheating?
yes
And just because you don't have the money to buy a better graphics card that means everyone else you play with is always cheating
Nah, this is a philosophical chat, I am not talking about restricting anything. My mate and I were actually talking about how other games put a static image of "horizon" instead of just drawing everything and I was wondered if something like that can happen in Arma.
Arma uses "fog" outside of viewdistance
and there is that object view distance limit which makes sense but always hard to put an exact number on it
But there are practical problems of having too large a max viewdistance. Team mates with worse computers will not be able to see what you see. And too large view distance might confer wrong sense of security, because the server will only properly send network information about objects using its own viewdistance.
"properly" means far away objects might lag behind about a second or so
(object) view distance is calculated in 3D? For example if a plane flies above 2000m while object view distance is 1000m, he will just see the terrain?
They will still be there and visible. So I don't see a wrong sense of security
yes @fossil yew
In helicopter/plane I usually crank it to the max even if fps go down to 10
how can you play like that?
carefully ๐
It's possible ๐
Atleast helicopter if I'm only the gunner
Plane and helicopter pilot get's a little harder
in a2 was dinamic vd script...
ACEX also has one afaik
wtf kind of error is this arma:
Error in expression <gunDisplay setPosATL (house modelToWorld [-2.2 + (-0.2 * _size), -3.>
19:43:40 Error position: <modelToWorld [-2.2 + (-0.2 * _size), -3.>
19:43:40 Error Type Number,Not a Number, expected Number
sounds like NaN
_size may be nil
I'll look into it, just threw me off. So is it a number, or no? ๐
maybe type is number, but it's not a real number
it is, but it isn't ๐
So, a fake one ๐
yeah, it's a fake
I had a scalar that returned true for type checks, didn't provide any errors, but it wasn't equal to itself
-oo, oo etc are not in R
that was a gigantic PITA to find out
Sounds like fun lol thanks for the help
@tough abyss Have to be careful reading that. It's type is Number,Not a Number and it want's Number
Ahh, that helps.
I don't know where BI got the idea to name the NaN type Number,Not a Number... But I also don't know where BI got alot of their other ideas
Ya, should really be NaN
i'd say lost in translation
otherwise modelToWorldVisualWorld is even worse than I thought.
and in case you're wondering, yes that's a real command, as well as modelToWorldWorld
modelToWorldModelWorldWorld ?
modelToWorldWorldWorldVisualWorldWorldVisualWorldVisualASL !
gib a visual one, so:
modelToWorldModelVIsualWorld
if I were to call a function with a paramater in format 0 = [param1, param2, nil] call <function> and in this script assign the 3rd parameter _s = _this select 2; how can I use an if-statement that runs a piece of code only if the 3rd param has not been passed as nil?
that's not how you call funcs
tag_fnc_function*
remove the 0 =
Uh.. you use isNil ??
yep
To check if it's nil?
but it still tries to run the code that's in the if-statement
And that's exactly how you do it
Maybe you want https://community.bistudio.com/wiki/!_a then?
that's the current if statement: sqf if(!isNil _s) then { [ _v, _s, true ] call BIS_fnc_initVehicle; };
You should check the isNil wiki page ^^
or { }
Because that's also not how isNil works
thanks @peak plover I mixed up the info on the wiki. I'll give that a shot ๐
@still forum what do you mean? Should it be if ( !(isNil '_s')) then ....?
nah, it checks if the var exist
also nothing stops you from using properly named local vars
name them properly for your own sanity
or just use params
to detect if a parameter was not passed I usually use scriptNull as default value
also you can do if !(isNil "...")
if !isnil '_s' then {}
missing round brackets ^
Also why are you using ' instead of " ?
because "funs"
don't need no parentheses
I know about those brackets it was about the formulation of the if-statement ๐
if(!isNil "_setup") then {
[
_vehicle,
_setup,
true
] call BIS_fnc_initVehicle;
};```
splendid, running tests now
Either I am missing something, or people intentionally put misleading code on the BIKI
The only comment, part 1 at https://community.bistudio.com/wiki/BIS_fnc_initVehicle . Seems that is a glorified way to simply get nil.
call compile to get a variable..
seriously?
What mindless piece of stawhead idiot is that guy?
_getVariableOrNil = {
if (!isNil (_this select 0)) exitWith {
call compile (_this select 0);
};
nil;
};
wow
just, wow.
What?
What are you talking about? If I look at that wiki page there is nothing like that on there
Don't know at all what you mean.
๐
Don't know how I managed to overlook that. I usually check every edit
mNS getvar on a local var ๐ค
Oh crap.. you are right
I'll just remove the whole comment as it actually makes absolutely no reason to be there
๐
Good job. At least the comment will no longer confuse non-scripters trying to use the function.
I think this is a worse version of RETNIL.
So:
if (!isNil "_var") then {_var}
Needed in scheduled environment, because just using _var would error if the variable is undefined.
Can you use it in a sentence give an example? I assume there would be more than just _var, a side effect also?
Let's assume you have a function that reports a return value.
So the function ends with _return, right?
But _return might be nil/undefined.
Your function would work fine in unscheduled environment.
But it would error in scheduled environment.
Ah okay, I see now
So instead of writing the last line as _return, you'd write RETNIL(_return).
RETNIL is just a macro which is essentially what I wrote.
I mean seriously. Any coherent reason why scheduled environment would behave different, except related to scheduling?
They just set the "nil is error" flag
actually doesn't have anything to do with scheduled vs unscheduled
Unscheduled probably doesn't have this because of bwc.
it's a flag that happens to be set for scheduled but not for most unscheduled scripts
Nothing guarantees that, that won't change
How/where is this flag set?
How do you explain code inside isNil not erroring if it's a flag? Does the command unset the flag?
Yes it does
krgr
It launches a new script instance with that flag disabled, and then executes that instance in unscheduled
So it is a flag you have no direct control over, that certain commands toggle, and also typically set in the scheduled environment?
disabled you mean.
spawn launches a new script instance with that flag enabled, and then pushes that into the scheduler array
yes
Saw that while writing last message
@errant jasper yep
I think it's quite consistend as in enabled in scheduled and disabled in unscheduled. But we all know BI
Maybe?
Or maybe let's not continue the BIS insanity, and have commands that toggle either on or off, instead of only one way xD
I don't know if I can easily toggle that at runtime
That's true. But more as a general principle to strive for.
Well, if isNil and spawn can, why not a command like disableSerializtion? Maybe not easy with intercept.
They can because they pass the flag along when creating the script instance
Yeah. "not easy" was what I meant. Sure it's possible the hard way
Ah forget that
It's right next to enabledSerialization
It only annoys me when I write something for CBA and then it breaks when someone tries to use it in init.sqf and the like.
serializationEnabled/canSuspend/localOnly/undefinedIsNil are all next to eachother
localOnly?
undefinedIsNil = true -> empty variables become nil.
undefinedIsNil = false -> empty variables error
Yep. Have the same thought. Don't remember, checking right now what it does
canSuspend should atm be always the same as not undefinedIsNil.
I can also change canSuspend at runtime and set it to true for unscheduled scripts XD
Wonder what would happen
localOnly is https://resources.bisimulations.com/wiki/privateAll
Though it seems a little different
localOnly set's all variables as if they have a private
privateAll is attached to a scope?
in VBS it also reads all variables as "private" and doesn't see higher scopes
in VBS yes. In SQF it's attached to the script instance
Oh.. localOnly also makes global variable assignments private variables I think
Meaning myVar = 1; after that myVar is nil
urg
because of missing _ it reads from missionNamespace instead of local scope
localOnly is never used, right?
true. Always set to false
Better leave it that way. It sounds horrid.
That's so dumb.. It could be so awesome if it was properly implemented
there is the global flag per script instance.
And there is a local flag per variable assignment.
That get's set if you use private keyword and it starts with _.
Global flag missing the _ check makes that whole thing kinda useless
Can anyone help me out, looking for a script to adjust player loadout and rank dependent on UID?
What do you need?
Most basic script basics? You should probably watch some tutorial on the youtubes or read the wiki instead of asking us.
youtubes is very badz sometimez dedmen
Is there any possible way to discover a code block of EVH that was already assigned?
No.
discover a code block that was assigned
"discover" ? "code block"? "assigned" ?
@still forum you talking to me? ๐ถ
yes
@little eagle Awesome, ty
So basically when player logs in, script runs to determine UID and assigns a loadout and a rank depending
script runs to determine UID You mean a single call to getPlayerUID
Yus please
You want someone here to write the whole script for you? Or give you hints about what commands to use? Or explain you the basics of scripting?
Could someone do the code for me? Iโm in work currently
since you're at work you won't mind paying for the time it takes to write the script i'm sure
#350
$20/h pls
stop being bad cup oneoh
i'm keeping it real
no pain, no gain right ๐
#creators_recruiting People here write their own code mostly.
๐
@chrome nebula You can then wait a couple hours or days and see if anyone here is bored enough to write a script for you for free.
Or you can learn how to script and ask for advice/help in here
on the other hand if you wanna learn this is the place
There are people here that are willing to teach people all of the script basics instead of just linking them to a tutorial?
well, once in a blue moon yes
linking is more likely to happen
Did I hear selling code? ( อกยฐ อส อกยฐ)
๐
OPTiX awakes from his slumber
well, Iโm happy to learn?
here are some of the components you will need on your quest
if setUnitLoadout getPlayerUID == { then }
extra hints in DLCs, cost is #350 each
forEach
forEach? Why
Assuming he does it in initPlayerLocal there is only one player to check
{call compile "yourcode"} forEach allMissionObjects "";
here's what you should do: get a book on C or another real language, work through that and when you've got a good grasp of everything, come back and you'll have no problem writing this sqf crap
yes good advice, go learn c and then come back and write this script
That is what scripting languages are for. So you have to learn C first.
if you learn assembly first then your SQF scripts will be much faster as well
oneoh basically posted everything one needs.
I guess this a scripting question (as i dont know much about programming), but here goes: Ryan's Zombies mod used a module to spawn zombies, is there a programming reason for Arma devs not to implement such a thing for units?
D-did I write something false?
yea this gommy guy is full of ๐ฉ
i know this is your greatest fear commy but no i was just being an ass lul
@rancid ruin But you first need to take a special class in SQF Assembly
No, you can write modules to spawn units, and that has been done before.
@rugged prairie lazyness?
I think we scared him off
it's not reasonable to expect a noob to learn asm and c this fast
Yes SQF Assembly exists.
And yes. Writing assembly manually can make scripts faster
Well.. You don't know how intelligent the noob is
No one wants or needs to make something like that fast. oneoh posted the parts needed, and if one reads the wiki, one can figure out how to write it.
well no i forgot these components [ ]
we should crowdsource an sqf tutorial, like with chapters and shit'
and " "
but then again, arma 4 and enscript
whats this arma 4? some hoax i bet
this channel should've had a weekly scripting challenge for years now...i suggested it ages ago and it's a good idea
- some kind of community blog
i will like the part when you have to explain someone why Enscript looks like C++ and then has keywords like "expands"
You can compare that forum to a life forum or the steam workshop though.. So you know how good that's gonna be
@rancid ruin make. Give Ideas. We'll solve challenge and write blog about ideas
wat
I have lots of in-depth knowledge crap that I just puke into this channel which then get's forgotten
Give me a place to do stuff in and I'll do :U
How about armablog.blog
Maybe own page on BIKI. Many years ago I found Sickboys note's here quite useful: https://community.bistudio.com/wiki/6thSense.eu:EG
what about armablog.blog.blog.blogspot.blog
Actually very bad idea.. A .blog domain is 30โฌ
holy moly
a .ovh domain is just 1,19โฌ
.tk is free
doyouknowtheway.sqf
just make a bunch of articles on the BI wiki
one per chapter and add a link easily viewable on the landing page
wikis are dogshit for browsing
ACE3 wiki then ๐
@rancid ruin I'll happily pay for that domain. If it's not unreasonably expensive like .blog or .xxx
Nah, most wikis just have terrible search, and poor layout for long term reading
plus we get versionning
i like sqf.enlighten.me
but none of these are onsolvable problems
then we can reuse it for enscript
Also github for the thingy like on ACE wiki is quite nice
oh yea those blog websites with like 60% empty space and like 5 random links to posts are much better than wiki
tbh you could just use github pages + jekyll for a cms
something like https://randomascii.wordpress.com/
that's all free
With the same kind of deep programming knowledge ๐
people could submit PRs for blog posts or whatever
If you give me ideas about what to write about I'll do that
how to abuse array refs with pushback / append / any command that modifies the array instead of returning the modified one huehuehuehue
beginners guide. server-client relationship. remoteExec. what is doable with scripting and what is doable with configs.
armablog.art XD
Or armablog.tech for just 47,99โฌ
I certainly won't be writing a beginners guide
i would do github pages cos it'd be easier for collaboration
make a orga
with a wordpress blog or something you'd have to set up multiple users, worry about security, php, etc, fuck that
i would offer to host it but i don't trust that my server wouldn't be hacked by arma cunts
if dedmen writes a blog we will need a blog explaining his blog
shared arrays are abuse? wtf
you mean 17 page tutorial
the fuck is .wang
Is my.wang available?
some demain he bought
I recently bought an .io domain. Still quite expensive.
You can transfer my.xyz for just 3806,80โฌ
sqf.bible
I think sqf.github.io is short enough to not need a domain
its avaialble for 140โฌ
yep ded
people will find it via hyperlink anyway
the community just needs something like KK's blog, only better, and active in 2018
we're in danger of losing knowledge or just not sharing it
Hm... There is a sqf.something domain still free. Wondering if I should buy it
I already have a 6 letter domain that I can use for shortlinks
don't bother man, it's hassle
money, domain privacy, less open
breath in
RELIZ TFAR 1.0 ALRADEE
breath out
this was your daily reminder
i guess if you just point whatever.whatever to a github page then it could be useful
I'm buying man. 1โฌ in the first year. I'll use it for my sharex image uploads and make the main page a redirect to the blog
I hope this is the right channel to ask this, but how do I add Zeus to myself via the debug console? The mission I want to do this in is TRGM2. I've tried the assingCurator with my player ID, but I should spawn the module itself first probably, and I have no clue how to do that.
Nah, I was eating ๐
sorry no this is the arma blog channel
you can spawn the module with createUnit not the most trivial thing to do though
why not open the mission in editor and place a Game Master module with owner your player UID or logged admin?
Going back to the spawn module question, is there a performance difference (between a module vs a spawn script)?
Because I do not own this mission, it's simply downloaded from the workshop, and I dont trust my players to not fuck up vehichles, and the Zeus would be the fastest way to fix mistakes :D
a module is just a script anyway, just added in a more editor friendly way afaik
you can still open up the mission if you know where to find it
modules are kinda just a more streamlined way of doing things
somewhere in /workshop
if you play it, it's physically on your PC @tepid mist just gotta know where to find it and open it with a PBO manager
true but I think it's easier to have that script already been done at mission init than deploying it everytime with the debug console
I'll try to find it, otherwise I'll figure out the createunit command, thank you!
I usually just write in the rules, you fuck a vehicle up without valid reason, you're off the server this month
reasonable
especially on the I&A missions... 50% of the people there has no clue what they're doing
sounds like you don't have a clue what you're doing as well tbh
what do you mean
Thanks for the clarification Dedmen. I'm going to read up a bit on it.
I now own sqf.ovh \(O_O)/
sqf-mastery.dedmen
no such tld
yea good luck with that
didn't the xyz domains explode in their price? I think I saw it for like $7 a year on Google Domains quite some time ago
yeah
well partly. Some names are insane
others are like 8โฌ
still expensive compared to the 1โฌ for .ovh or 4โฌ for .de
.fun 1 dollar ๐คท
I'd expect ovh to be more expensive as OVH is the only registrar of ovh domains
is that a donate button I see there? ๐
#realShit
What is ovh?
some shitty tld
privately held company for webhosting and stuff
french CDN / VPN provider / ISP
didn't they also host ArmA 3 servers?
OVH gave away 2 free .ovh domains to everyone with an account when they first got control of the tld
ovh host about 30% of the internet in europe probably
yeah. I got two back then
Gotta catch the bus. back in 30 minutes
oneoh get the github orga online. I'm in writing mood
german supplex the bus*
gotta write that code!
private _duration = 5; // Duration (seconds)
_duration = _duration * 100;
for "_i" from 0 to _duration do {
uiSleep 0.01;
_ctrlProgressBar progressSetPosition (_i / _duration);
_ctrlTextTitle ctrlSetText format ["%3 (%1%2)...", round (_i * (100 / _duration)), "%", _title];
if ((!alive player) || {!(call _condition)}) exitWith {_fail = true;};
};
This doesn't seem to progress for exactly the specified seconds. Am I doing this wrong?
0.01+time commands take, but should be negligable.
at first glance seems correct.
Alright cheers, yeah it was only slightly off, was just curious why
why not while ?
it's impossible to sleep for an exact duration, this is not just an arma thing
also uiSleep in for loop...
what you'll want to do is sleep in some increments and keep checking if it's yet time to invoke the action you want to perform
then each time you invoke the action you reset the timer
are all integers in arma floats? or?
okay
@meager heart Does a for loop over a while in this case really make much of a difference?
while = oneachframe, not sure about for
that's not correct at all
@still forum Sleep can sleep anywhere between the specified time and several hours
@warm gorge
bad discord
woops guess I had it mixed with waitUntil
while = oneachframe, not sure about for Uh.. no
for == if
nothing in scheduled is each frame
anyway the whole premise is flawed. what you want is something like this ```
total = total time to wait
interval = time between actions
start = current time
end = start + total
while (current time) < end
sleep for some small duration x, such that x < interval
if (current time) - start >= interval
perform action
start = start + interval
private _interval = 0.01;
private _start = diag_tickTime;
private _end = _start + _duration;
while {diag_tickTime < _end} do {
uiSleep _interval;
if ((diag_tickTime - _start) >= _interval) then {
_ctrlProgressBar progressSetPosition ??;
_start = _start + _interval;
};
};
I believe I've converted your pseudocode correctly, just not sure how to go about actually progressing the progress bar. @pliant stream
>= _interval doesn't really make sense if you already sleep for >= _interval time
though if you increment start... uh
do you need to update a hundred times a second?
increase interval to 0.1 and sleep 0.01
or 0.03, whatever floats your boat
for the progress pos.
totalTime = _duration
elapsedTime = (diag_tickTime - _start);
And then you can calculate how many percent are done and use that for your progress position. And get rid of the if check
yea just do ((current time) - (start time)) / duration to compute the elapsed ratio
private _start = diag_tickTime;
private _end = diag_tickTime + _duration;
while {diag_tickTime < _end} do {
uiSleep 0.01;
private _progress = ((diag_tickTime - _start) / _duration);
_ctrlProgressBar progressSetPosition _progress;
_ctrlTextTitle ctrlSetText format ["%3 (%1%2)...", round (_progress * 100), "%", _title];
if ((!alive player) || {!(call _condition)}) exitWith {_fail = true;};
};
Awesome, got it working. Cheers guys. Appreciate it! ๐
is there a way to set the spawn point in the vehicle be disabled when it is full?
@warm gorge about loops http://killzonekid.com/arma-scripting-tutorials-loops/ ๐
When I tested it a while ago
I got faster results using time instead of diag_ticktime
Just curious, trying to help a mateout here, what, scripting wise causes the most fps drop?
bad scripting
too much scripting
I think.. crashing the game causes the biggest fps drop
Or does anyone know something that causes a bigger drop?
uninstalling arma
or even worse, turning your monitor off
ALL the frames are gone now huehuehuehue
you can't do that via script tho
make a UI element that flashes very fast and changes color
can't see the frames = no frames
Or just make a UI with thousands of empty frames
_f = { _this call _this };
_f call _f
So increase the frame rate
this should do the trick
{ _this call _this } call { _this call _this } isn't that elegant
now to just remoteexec on all clients
squint wat
agree
asking what makes the most fps drop just doesn't make sense anyway
so why even try to answer
I don't usually work with createTrigger and I am running into some issues after spawning them server-side.
west_spawn_zone setTriggerStatements ["this && (local player) && (vehicle player in thisList)", "nul=[thisList] spawn EH_fnc_inSafeZone;", "nul=[thisList] spawn EH_fnc_outSafeZone;"];
According to documentation, editor based triggers are only created on the server (they were working fine with above when placed via editor) but now they are being created server side, they don't want to work. I believe it has to do with the condition statement using local player and vehicle player in thisList, but it isn't acting in the same fashion as before.
Thoughts?
wrong
XD
wait 5s
well local player can obviously not work serverside
there is no player. nor can a player be local to the server
triggers are created on all clients unless specified otherwise for editor triggers
unless he himself is the host
Well, I understand that logic for sure, but how can I get past the locality issues if I am spawning it on the server only versus editor based before?
make it a non server only trigger / change the statements ?
"local player" only works for clients, which doesn't work if the trigger isn't present there.
I understand, I am just wondering how to distribute that to clients without spawning a new trigger for every client
spawn just one global trigger?
Well that is what it is doing now
you drop the trigger and ask here for something similar
And it is publicVar'd
you want players to not be able to fire within the safezone right?
It is for a mixture of things
I don't see how publicVar is relevant?
use isPlayer to check if a remote unit is a player
You can't publicVar a trigger
Yes, you can.
i mean you can pubvar the variable with the trigger reference
exactly.
tr = createTrigger ["EmptyDetector", _somePos];
publicVariable "tr";
which doesn't exist on the client
Well, its referencing a trigger, if you want to get picky
and it doesn't exist on the client
so all you are doing is transmiting a null object
that one is global eaglebyte ^
I guess all this is wrong then? killzonekid.com/arma-scripting-tutorials-triggers-v3/
by default createTrigger creates it on all clients unless specified otherwise
"A single server trigger can be used by all clients as well as the server"
yes
but, again
it's your statement that is the issue
the trigger works fine, the code in the condition field isn't
in your case it would only work on non dedi MP on the host machine
Yes, I understand that. I was wondering if someone with more experience in creating triggers via script may know how to replicate an editor placed trigger to a scripted one with the locality intact.
Again, why keep trying to use triggers?
Because I want to avoid this: "A trigger should only be created on the server to avoid barrage of dead triggers on client disconnects"
you can use isPlayer to check if any unit is a player, so you dont need to use player
@tough abyss I think you missunderstand that sentence
I may, that is why I am asking for clarification ๐
haha yes
Does the trigger work if you reduce the condition to something simpler?
Your nul= is also complete bullshit
completly useless
When placed in the editor it doesn't want to accept it without that
Useless, yes, but won't work without it
Yeah. That's because of a stupid bug in editor code text fields that BI doesn't want to fix
Only applies to the edit box though. nothing else
It works just fine without it
it's because of how the editor text fields (and also debug console afaik) are processed
Arma just doesn't let you enter it into the text box. Your custom script trigger isn't a editor text box though
this is an exciting friday night
It's friday?
sqf-vm still seeks support in its c++ branch https://github.com/X39/sqf-vm/tree/cpp/sqfvm-cpp
i know you want it ๐
@rancid ruin what's happnin
nothing lol
i just realised it's friday night and i should do something
but i can't even be bothered to play a game or anything
let alone go out and do things
you say that like i've made a blog on github before
i'm just good at telling people what to do
why bother to make a blog at github?
free, easy to collab
version control
host it yourself and ... just do it
hell ... i created a simple blog software for my page twice already Oo
github pages are free
You obviously didn't read our conversation about it @queen cargo
nope
the idea is to have a community arma blog kinda thing
@lone glade do you know how to do it?
KK style but for everyone to contribute (within reason)
Or do we have to get bux?
something that would requrie a way to suggest new papers with admins cross-reading them?
@still forum get bux, I did it once but it's been more than 2 years
i think you just create a repo and then attach a github page to the repo
Everyone should be able to contribute, but everyone should also be able to critique on what everyone
I remember it being very straightforward and pretty well documented
i think you'd need some kind of curation or you'd have noobs posting bullshit
the one issue we have with the ACE3 wiki is that you basically need WSL to build the site locally, otherwise you'll have to deal with ruby fuckery on windows
Seek for help has been dispatched towards people that know how to do this stuff
You can just read the markdown tho so...
Most stuff won't change on the site. And articles are written in markdown right?
yes
i'm experienced with wordpress and i host plenty of sites but i'm not exactly a well rounded web dev @still forum
although it's not rocket science
Same for me
but we use some html classes for sorting articles and other stuff such as "notes"
We'll just wait for bux to setup the basics for us now ^^
there's also the whole "is it where I want it to be"
ruby gems on windows can just go eat a dick
it's version hell 2.0
html classes?
class htmls
</school>
ye sasseh boi
so ... requirements would be:
- Basic page to read through the articles
- Ability to comment on articles
- Ability to login with eg. github (OAuth) to contribute articles
- Ability to review contributed articles before publish
or did i missed something?
i just googled html classes, i thought i'd missed something
basically a github repo which auto deploys changes
lol pls use this jekyll theme for it http://jekyllthemes.org/themes/windows-95/
loads the shotgun
bitch please: https://blog.fefe.de/
way better
x39 i might i consider contributing to sqf vm if you fixed them headers and shit ๐
lights up a torch
not even sure what you mean with fixing headers
commandmap is already moved into its own header
the weird #ifdef _HEADER stuff
probably will never do
feel free to "fix" it
i personally do not get annoyed by this like you are
and i do not see any reason why i should waste my time on changing something i am fine with
also i yet have to reject a PR for reasons like this
3 contributors
mhh? @rancid ruin
i'm just messing with you. hard to reject PRs when you aren't getting any ๐
hard to get PR at all
fire department, QUICK
๐
well looking at jekyll, i don't like many of these words
let's not forget @little eagle wise words:
commy2 ๐ฉ - Today at 7:19 PM
SQF is fine. People won't suddently start writing solid scripts just because we change to something else.
words like ruby and gcc
hehhehehehe
what is static analysis????
using sqf-vm you theoretically could write whole real programs using SQF
i'm checking the docs page out and it has "previous" and "next" buttons - on the docs page i mean wtf
@rancid ruin github takes care of building the site
making jekyll work on windows is what versionning hell looks like.
just would require some comands for it to work
sure github takes care of it, but for local tests.... shudders
how do i create via script a spawn point module like we have on the editor?
I need to dynamically create a delet it.
spawn point module? you mean a respawn position?
[west,_YourCoolRespawnPointPosCoolThing] call BIS_fnc_addRespawnPosition
^ that
and if you assign it to a variable, use that info for the reverse
check the parameters for it
the _YourCoolRespawnPointPosCoolThing is what?
๐
Local? so the PC that make the spawn possition is the only that can spawn in it?
5s, i'll post the parameters
warning a bit large
/*
Author: Karel Moricky
Description:
Add a respawn point.
It's recommended to call the function on server only.
When called on client during briefing, the position will broadcasted correctly.
Parameter(s):
0:
NAMESPACE
SIDE
GROUP
OBJECT
1:
STRING - marker
GROUP - group leader (use grpNull to dynamically use player's current group; useful when it changes frequently)
OBJECT - object in which or around which players will be respawned
ARRAY - precise position
2 (Optional): STRING - respawn name, can be text or link to localization key
Returns:
ARRAY in format [target,id] (used in BIS_fnc_removeRespawnPosition)
*/
That is one large boi
yes he tall
but anser me, does that means being local that mean only the PC that make it is the only who can see and spawn?
If you pass a an object instead of missionNamespace or side
X39#2180 Problem with sqf-vm is the lack of syntax checking. I was excited to use it, but if it canโt catch my errors and bugs as well as arma can, then I am better off sticking to arma.
well it's not feature complete is it
if you want syntax checking then use the SQF linter
Thatโs why we will use intersharp kek
Need to test porting types
btw you are very welcome in intercept slack
@river meteor SQF-VM has syntax checking
but it does not implements all types yet
which is why it cannot catch all your syntax errors (simply because it thinks stuff like loadfile is a variable instead of a command) but rather says unknown command
however, using eg. arma.studio, you will be able to lint your code files
I just realized that the intercept logo being a squirrel biting a nut is oddly fitting...... for you ded
huehuehue
furry n' all dat ๐
๐ค
Intercept-Squirrel incoming?
looks better than LUA on first look
don't let your memes be dreams
that is an actual scripting language
which is what i always think of when seeing that logo
yes, it is
but lua is plain C
squrrel requries c++ iirc
lua has a really good vm though
optimized in literal ages of work
hey don't disrespect c
@river meteor https://forums.bohemia.net/forums/topic/203020-armastudio-the-open-source-community-made-ide-for-arma/ here
not like it gets much love nowadays from me ... but as nobody is really interested in it as it seems, why bother to work on it (it is working though)
squirrel lang actually looks very enscript like...
it is literally based around C family
@rancid ruin bux just said he'll help with the basics
i'ma finish reading about jekyll later and see if i can help somewhere along the way
like, some kind of decent index page or categorisation system would be useful
rather than just a stream of random blog posts
damn
arma3 account did nothing since 2013. And back then it only forked a dayz repo without ever contributing anything
I asked github support if they can give us the name
So, the synchronizeObjectsAdd dont really work with spawn modules, they do synchronize but the spawn point is not set to it.
im doing something wrong?
Allright i am trying to add a array of items into a listbox (dialog) I have tried this code { lbadd = [1500, _x] }forEach ["Test1","Test2","Test3"]; But i get this error Error reserved variable in expression
the idc is correct and i have no clue if it makes a diffrence but the dialog is created above that code and its all in a function.
Anyone here have extensive knowledge about admintoolkit 2.2? I have a quick question
http://www.squirrel-lang.org/squirreldoc/reference/language/classes.html Looks really nice. I think that would be quite good for arma
I don't know what admintoolkit is soo...
ask question
wait so what is the command for adding things in to ListBoxes then ๐ฌ
it is @still forum
even worse: it is simple to implement
only problem i have with it is the threading of them ... but i cannot remember what the actual problem was (just that i did not liked how it was solved)
Theading and suspending looks very weird
but I don't think that would really be used for Arma scripting
iirc it is also extremly limited and not actual threading
more like the arma suspension thingy
pause main context and continue the other context
coroutines. yeah.
Why was my message removed?
Lok
if it was red @echo nest, it was not delivered correclty
Ok thx
whole syntax is @still forum
and people barely know about squirrel
Also heard about it for the first time today
When I tell admin tools to spawn an item. Nothing is spawned. Anyone have any ideas?
That is very specific.
found it randomly when i was searching for LUA alternatives
Is the admin toolkit like unofficial toolkit what is that
It's an admin tool for exile
Should better ask in exile forum then
Try exile discord
Everyone there just responds with"buy infistar". And I'm not gonna spend 40$ for something I might not use after 30 days
Just thought I'd give this discord a try.
I just want an admin tool. Don't need anti cheat
Just use the debug console
Does that have teleport and item spawn?
it has literally everything that's possible
You can teleport and spawn items with it but you have to type in the code manually
That's ok. I'm gonna google it now
is there a way to detect if there is a music playing?
@still forum in lua you can make a class implementation through meta tables
yeah. but seems kinda ugly doesn't it?
But I think the lua C++ bindings that exist make implementation easier
as such easy to use bindings don't seem to exist for squirrel
It works
Class someclass = class(โsomeclassโ)
SomeClasse:method()
Self.someVAr = โโ โ global class usable variable
End
Never used squirrel
C++ has some binding with c# through clr hosting but for some reason arma didnโt play nice with it, at least for me. Idk what lua uses but I assume just doFile with exposed functions
Or luaBind if iirc
squirrel was posted by me @tough abyss
Ah my bad
anyone know how to change the color of a checkbox??
remoteExec ["BIS_fnc_holdActionAdd",[0,-2]select isDedicated, true];
What does that [0,-2]select isDedicated does? also, in MP another action apears
it checks whether it is running on a dedicated server. If it is it execs the function everywhere but the server. Otherwise it runs globally.
@astral tendon select 0 for false, 1 for true
False or true for what?
@astral tendon as with all mystries in life, check the BI Wiki ๐ https://community.bistudio.com/wiki/select
isDedicated can be true or false
and select uses a boolean value like this: true => 1, false => 0
what about that [0,-2]? and why check the isDedicated here?
Hum... dont really get it, what is that option anyway?
targets (Optional): [default: 0 = everyone]
Number - Only 0 and 2 are special. When 0, the function or command will be executed globally, i.e. on the server and every connected client, including the one where remoteExec was originated. When 2, it will be executed only on the server. When 3, 4, 5...etc it will be executed on the client where clientOwner ID matches the given number. When number is negative, the effect is inverted. -2 means execute on every client but not the server. -12, for example, means execute on the server and every client, but not on the client where clientOwner ID is equal to 12.```
like i said, check the wiki ๐
Select selects one value from the array [0,-2] based on the boolean isDedicated
https://community.bistudio.com/wiki/BIS_fnc_holdActionAdd
The second exemple is not like the Syntax
oh i see
So if the if the environment is not a dedicated server, it remoteExecs to all clients
if it is a dedicated server, then it only runs for clients
(this way, it works on local hosted servers too)
So the BIS_fnc_holdActionAdd is Local?
you know i'm going to ask you to check the wiki again ๐
probably is, i don't know for sure
its just addAction
Because later i had a problem that every player that joins created a new action
depends on where you're running the command from
you'd run that from the server, once
I need to test this again but first it was from the unit init, now i put on a SQF with a variable
if you run it from the unit int, then either don't use remote exec
or use if (isServer) then {do stuff}
because unit inits run for every machine
and you don't want that in this case, since then every machine remote execs it to every mahcine
Interesting, what about units variable that some times JIPs do not carry over?
not sure what you mean
Lets say, i make a unit with the name TestGuy
A command like
if(alive testguy) then{hint "he is alive"}
then start the game wtih a host and a client
then the client disconnect and connect again and nothing happens or gets a error of undefined variable
That usualy happens to me
depends on where you're running the command maybe
Were could i get that error?
although shouldn't, alive takes a global arg
if you call that comand from client and never public variable, it will never be in JIP @astral tendon
same goes for server
although a unit var shouldn't need that?
such things as unit variables are not existing
i mean, you name a unit something
Also, when i talk about variable i talk about the variable we give on the editor
the unit names are nothign but global variables
however ,they should be globally available
That also happens to other objects
what is described above should actually never happen
either user error or some bug you discovered
if you create an environment that you can share to test that bug, BI surely will fix it
In the case of the remoteExec command originally pasted above, it has its JIP flag set to true, so JIPs will get it fine if only executed from the server.
I already fixed most of the problems by avoid use variables that clients need to read
if that was a week later i could ship my mission file for those testings
Allright its me again.... When i try to add a simple _unit addaction ["Test Plz",{[_this select 0] call JaM_fnc_selectstyle}]; it gives me awarning saying it (the function) may not be declared. Am i doing something wrong when i define them ? http://prntscr.com/i9dyf2 http://prntscr.com/i9dyie
Ok, you can check if they loaded correctly buy clicking the functiosn button under the debug console (in 3den ctrl + d)
On the top left choose missionConfigFile in the functions browser
Your path is wrong
Wait
nvm
class pooPoo{
class kaka {
file = "functions";
class gaga{};
};
};
//
call pooPoo_fnc_gaga;
only errors rly matter are the ones in arma
@peak plover can you skip the first tagg thing ?
Check the functions library in-game.
How would i do that?
in editor
CTRL D
and functions
It's a button on the bottom
Then when it opens
Top right EDIT LEFT
Switch to missionConfigFile
could you answer my question @fleet wind?
_unit addaction ["Test Plz",{[_this select 0] call JaM_fnc_selectstyle}];
your JaM_fnc_selectstyle is correct
only thing matters is that there is a file located at /functions/fn_selectstyle.sqf
if it is, it probably is a text editor warning you refer to and not some ingame error (because it would be new that ingame anything is erroring at all when undefined variables are used)
Yes sorry @queen cargo i get an error in game with one of my 3 functions Error undefined variable in expression
double check that you can load the file functions/fn_selectstyle.sqf in the editor
BTW how often do people use LOCATIONS?
depends on what you mean with using
CTRL D does nothing in editor ....
oN the top
Tools > debug console
*tools > functions
That one exists too
nearestLocation [[0,0,0],'u_installation']
I just checked and there's tons of location types in the vanilla game
I wanna abuse some of them
And create my own locations
Just wondering if anyone else does that so I don't conflict
tools > functions viewer?
Yeah
The middle selection on top left is the tag thing
make a screenshot of the error msg @fleet wind
I am really that stupid lul let me test
how do i pass a crew to a seat to a gunner?
npnp
those issues are usually the once that slip through with ease
like we have on the action menu
just next time open up with the exact error msg in the very begining @fleet wind ๐
Will do boss lol Sorry to waste your time
any ideas?
not really sure what you actually want to do
A code to pass from a passager seat to the gunner, like we already have on the action menu
with the addaction condition checking that you are currently not in the gunner slot already (gunner vehicle player != player)
moveInGunner do not work when the unit is inside of the vehicle
first moveout then movein
_this = vehicle player;
moveout player;
player moveInGunner _this;
Im using this but i feel that is a litle wrong
you can add a comment "dirty" if it makes you feel better
_thisIsWrong = vehicle player;
moveout player;
player moveInGunner _thisIsWrong ;
ABout the location question
Invisible
Name
im using these classes to create locations and use them for myself
But my question is, would this ever interfear with anything?
Hey guys. Is it possible to get the location of a smoke?
Yes.
depends if you mean position or the location it's closest to
both are yes but both are done a bit differently
I'm looking for a gun run to be made on the pop of yellow smoke.. (would be funny if the AI popped yellow smoke)
ofc
Yea A-10 brrrrrt
what else would he mean, bob in his cessna? huehuehue
Wtf, okay well you're creating the smoke in the first place. So...
haha lol
Yes, Alganthe
wait, I have better
like.
private _coolSmokeIGuessIDunnoThisIsLongVariableName = "SmokeShell" createVehicle getPosATL _vehicleThingy;
_pos = getPosATL _coolSmokeIGuessIDunnoThisIsLongVariableName;
I present to you the hog wild van:
https://www.youtube.com/watch?v=71qj_AAw248&feature=youtu.be
the bestest at close ground support ๐
๐ฑ
How would I spawn a the gun run module from zeus? (without the use of zeus obvs)
Would that be possible?
Any reason why zero CfgCloudlet classes are working with a particle source set by setParticleClass ?
absolutely none?
Nope, not a single one works
how do you know it doesn't work?
Nothing Visual after object is created, nothing seems to be returned after creation either
are you using a particleSource class ?
Yes, is there other ways to create it?
don't think so.
Huh, weird.
I feel like arma is trolling me
It probably is
config entry:
tabs[]= {[], [0]};
retrivieval:
(getArray (_x >> "tabs")) params ["_leftTabsList", "_rightTabsList"];
error:
if (count _ri>
5:54:31 Error position: <foreach _leftTabsList;
};
if (count _ri>
5:54:31 Error foreach: Type String, expected Array
5:54:31 File z\ace\addons\arsenal\functions\fnc_compileStats.sqf, line 70
TYPE STRING
STRING
0_o
(https://www.youtube.com/watch?v=xYDr0SKi30s&feature=youtu.be) Here is an example of your "BRRRT Gunrun smoke" (Me flying around in A-10, Ejecting and shooting smoke shells)
Nope ๐
fn_smoke =
{
params[["_vehicle",objNull,[objNull],1]];
for "_i" from 0 to 5 do
{
_vel = velocity _vehicle;
("SmokeShellYellow" createVehicle getPos _vehicle) setVelocity[_vel select 0,_vel select 1,_vel select 2];
};
};
player addEventHandler["FiredMan",
{
[(vehicle player)] call fn_smoke;
}];
Excuse the crappy code, it's getting late
The velocity change isn't the smoothest in the slightest or in the right direction for that matter but it's okay I gues
it's no biggie tbh
Well you gotta get that realism packed in
GG
absolutely GG:
code:
private _tabs = getArray (_x >> "tabs");
private _leftTabsList = _tabs select 0;
private _rightTabsList = _tabs select 1;
TRACE_3("tabs test", _tabs isEqualType "", _leftTabsList isEqualType "", _rightTabsList isEqualType "");
return:
6:12:29 [ACE] (arsenal) TRACE: 0 tabs test: _tabs isEqualType ""=false, _leftTabsList isEqualType ""=true, _rightTabsList isEqualType ""=true z\ace\addons\arsenal\functions\fnc_compileStats.sqf:61
Lool
guess i'll just use compile and add a comment ....
ยฏ_(ใ)_/ยฏ
fuck it, two config entries and call it a day
uhm ... wut?
you rly wanted to create a single array for two tab lists?
should work though unless config issue ... but still ... wut?
they're stored as fucking strings
missing []?
"Theoretically you should have used SQF-VM to check that" > You're starting to sound like Dedmen
Or Commy for that matter.
you are wrong @subtle ore
they sound like me back when i was more active
@signal peak supports config parsing using parseconfig__ and mergeconfig__
that's on you ยฏ_(ใ)_/ยฏ
so ... tabs[] = {{"something"}, {"something"}}; is not working? @lone glade
I haven't tried using code brackets for sub-arrays
uhm ... what did you used then?
tabs[]= {[], [0]};
so ... tabs[] = random; will not error out
wut
da
fuuu
anyways ... it will work if you use the correct syntax @lone glade
true, I shouldn't have used logic there ๐
I figured out that was the correct syntax since it didn't crash or error out
welp, good news is that it works, bad news is that I have to convert all of my stats and write the API to add / remove them later on ๐ญ
I swear @still forum why'd you have to point out the flaw of the old system
oi fellas. got a question- maybe someone can help me with it. I'm connecting to a uav via connectTerminalToUAV, then i'll show the feed with showUAVFeed true -- it's all fine and working, BUT it'll connect me to the driver. instead, what I want to have is the feed from gunner perspective locked to a target. anyone got thoughts about this?
you can try lockCameraTo...