#arma3_scripting
1 messages ยท Page 346 of 1
TL;DR: Script turns lights off and on, but shouldn't turn back on if damaged. Not sure if it'll work, never used getHitIndex before.
@rotund cypress param not params
@waxen tide param/params is faster than select and gives you the advantage of optimally defining default values and checking the type you're selecting from an array
*optionally
i see. thanks you two!
@spice kayak
When you damage the lightpoint of a lamp via script, use a value like x.936482736482
Something that is very unlikely to occur when you shoot it
It uses 0.97, or is that not specific enough?
When you heal the lamps again, just check if the damage hitpoint is that specific value, if it isn't, don't heal the lamp
I'm sure something like 0.9755 is specific enough
Very unlikely to happen naturally
It saves you the hassle from setting a variable and so on
And then the night when people play it, it happens haha.
@tame portal params not param
Workaround but still better than wasting resources
But yeah, I'll give that a try. But what I've written should work?
@rotund cypress He's selecting a single element from an array -> param
Multiple elements -> params
Param is essentially the same as select
And also
As long as you are turning a parameter into a variable you should use params
Unless its not at index 0
omgomgomg IT WORKS
I swear to God I'll go to your house and throw at it with eggs @rotund cypress
:gun:
Sorry, but that was like, 5 hours of constant back and forth testing, giving up, eating lasagne, testing, etc.
It wasn't even good lasagne :(
@spice kayak Working like intended?
@rotund cypress I use param for single values to select since I think private _variable = xxx looks more explicit
@spice kayak cheeky workaround 101
Meh was always kind of broken
I'd Personally add a small delay though when damaging alot of lights
Especially when it's across the whole map lol
If you don't put in a sleep and it's running on the server all clients will go ham and drop to 0 FPS for some time lol
But that heavily depends on the number of lights your damaging
Ah, it's only a small EMP, so it's not too bad. I think maybe 6 lights at most, so it's not too bad.
I would love to get them to flicker before going out and back on though.
I feel that would be too much effort unless I figured out functions, or a way to make what I've written as a function.
Hmm
I think flickering would only be OK to a certain extent
Since changes via setHitIndex are globally synchronised
However I don't think turning it off and on 4-5 times in a second or so will make your server explode
Should be fine
Like, on (default) -> off (1 second) -> on (1 second) -> off (30 seconds, actual EMP) -> on
@tame portal "param/params is faster than select" wrong. Wouldn't make sense that a function that does more takes less time
In its basic form it has proven to be faster to me
@spice kayak count me interested... will you be sharing this script? :D
Would there be anyway I can turn what I've written into something like,
EMPon;
sleep 0.2;
EMPoff;
sleep 0.2;
EMPon;```
@still forum :>
Well, it's mostly on the wiki, I've just modified it slightly haha.
Copied from KillZone Kid's comment down below, modified to act as a personal, one time only EMP which will only turn off / on lights that aren't already destroyed. https://community.bistudio.com/wiki/switchLight
@spice kayak if you want to make it a script to publish I suggest you pull the list of lights to damage only once and then pass it to your on off function
Do you want to publish it as a pbo?
Publish? Like, workshop or something? I'll end up exporting it to MPMissions at some point, yeah, but not publishing it.
Hm then one simple function should be enough
I'd personally pass it a list of lights to turn off/on and whether to turn it off or on
Yeah, I'm working on re-writing it right now to see what I could do with it.
Though it is 2am.
ArmA doesn't know sleep
So, I've got an idea of what I want, I'm just not sure how to do it in arma terms.
Hope this makes some sense https://hastebin.com/uqusaridik.sqf
I'm just not sure how I'd do that bottom part. I don't know how to call upon things like that.
Oh.
'I don't know how to call upon things like that'
Couldn't have been more obvious.
Thank you.
๐
So far this script has had more sleep than me...
Time to see the errors!
Okay, errors where I didn't expect any. Line 2.
Fixed it, and god damn, it's actually pretty damn amazing looking.
@tame portal but then you are compromising unnecessary performance AFAIK
any way to have cd like behavior for configFile? Like configFile >> "Class1" >> "Class2" >> "Class3" >> .. >> "some_attribute_of_class2"
Explain better
You can do configFile >> "Class1" >> "Class2" >> "Class3" >> .. >> "some_attribute_of_class2" already
really?
yes.. exactly like that.. That's how you access config values
so the .. goes back up 1 level?
no
the .. didn't mean "etc" ๐
I wish, I only have access to the full path
_var >> "Class3" and _var >> "some attrib"
I get a full path like configFile >> "Class1" >> "Class2" >> "Class3" and I need to access some attributes of "Class2"
Here you guys go - the EMP flickering in action! No need to watch any longer after the lights go out. That was me just jumping up and down in celebration before realising I forgot to stop recording https://www.youtube.com/watch?v=DP1U6irG16g
str the config path and then some plitstring magic
but i guarantee theres a better way to set up your structure
so you wont need this in the first place
@halcyon crypt What do you want to do
get the parent config class of a config class
not parent from inheritance but actually config path
like with cd you can do cd .. and it goes back up a level ^^
configHierarchy is the way to go then
Thanks for all your help, @tame portal :D It's working beautifully. Decided to try it on La Trinite, and oh my. Not too bad on the performance either!
private _parentConfigs = configHierarchy blabla;
private _parentConfig = _parentConfigs param [(count _parentConfigs) - 2, configNull];
Something like that.
On mobile atm
@spice kayak no problemo
just realized we store the config path as [bin\config.bin,[3,4,2,2]] so I can just select my way to it ๐
getText ((configFile >> "CfgGroups") select 3 select 4 select 2) >> "the_attribute";
and yes that path is generated at runtime so the indexes are fine ^^
Okay, JTAC script still in planning, need someone to check my thinking.
At the start, 9 radio triggers are set up (one for each 9line section) with "this AND BaseMenu == 1" for activation, and BaseMenu set to 1 in the init of the mission.
Each section then, one step down, sets BaseMenu = 0 and ThatSectionMenu = 1, with subsequent menus using their own menu variable for activation. (HeadingMenu == 1, Friendlies == 1, etc)
At the last section of each menu, on acting, sets SectionMenu to 0 and BaseMenu to 1.
This is all accomplished by each step doing a series of SetRadioMsg and SetTriggerConditions ["this AND SectionMenu = 1", "Dir100 = 3", ""] style rewrites for these same 9/10 radio triggers.
My problem/question is, will resetting to BaseMenu reactivate the base menu trigger conditions? Im suddenly wary that ill have to just face it and make a tree of triggers for each one.
My alternative plan was a single repeating trigger on MenuReset == 1, running a script that restores the radio triggers, but its being a pain in programming [""this""] etc.
Does anyone here know if it's possible to change the size of a #lightpoint?
Right now it's just a round object...
Could I use basemenu1 = triggerstatements radiotrigger1, then later do Radiotrigger1 settriggerstatements basemenu1?
Guh, why do i insist on having insights at work and not at the keyboard t_t
Really sorry this probably isnt the correct place although i cant find the link to this discord if somebody could quickly share it. sorry to be a pain,.
@rotund cypress i dont think you can change the size of the sphere itself no.
@narrow musk discord.gg/arma
@atomic epoch what do you mean its invisible?
You can't read it to find the errrors that would stop it compiling
umm, can u write the code in a text editor and then paste it in? what situation are u in where this is happening?
How do you find out what is wrong in a piece of code that you can't check for what's wrong and that you also can't look at?
Are you serious?
That's like asking "How to know if Schrรถdingers cat is alive or dead without observing it"
lol
If you can't read/edit the code anyway... You couldn't fix that code anyway if you could find out what the problem is
Put a magic number at the start of the script
then check via string comparison
How would that work? A magic number? what?
Put something at the start of the script
and after decrypting just check if your script starts with that something
if it doesn't then decryption failed
I guess that could work. But it would make the encryption very weak A hacker would only need to brute force one character (which would have to be in plain text) to unlock the whole text.
ive never used this before so i dont know, but wouldnt u be able to use a try catch to just not show the error? https://community.bistudio.com/wiki/try
@robust hollow no.
try will still give an error if it compiles incorrectly
But a hacker can look at the decrypted code.. Or he could compile it and see when it doesn't fail compiling
so that wouldn't actually make any difference
your encryption is weak enough already
and would a "asdwer3456bFASF$Q%ยงT" at the start of your script really scream "I'm successfully decrypted!!" ?
Any code that decrypted would be stuck inside a spawn scope, I don't see how a hacker can look inside those
how would you do it?
Hook the compile function and log everything passed into there
I don't see how a spawn scope can be looked into
Or just use my script debugger and add a breakpoint on new script threads
Or just set the callback for the BE script scan and let it send the scripts to me
As I said.. You apparently have no Idea about Hackers ^^
I know how I would an sqf from a script, but none for looking inside a running spawn
You have 0 chance to protect anything that is available on clientside against a real hacker
๐๐ป
Well, I guess that makes us both
And ftw, there are no real hackers in Arma 3
Only scripters
scriptkiddies
So if you want to 100% protect something.. Don't have it land on clientside.
Otherwise.. Stop caring about how good your encryption is.. Because you don't stand a chance against a real Hacker
what?
Are you serious? XD
You are telling me I don't exist?
ur a scriptkiddie ๐
Ok, lets say you on a server
Show me something I could'nt so using script commands, and I'll believe you
๐ Nah.. I'm fine with you staying in your weird world ^^
But.. Google "Intercept" or "ArmaDebugEngine"
Would can they do?
I googled "Arma 3 Intercept Hack". It shows a bunch of videos showing "hacks" from script injectors. But nothing impressive. These "hacks" are just script commands from Arma
Never said that was a Hack
Then "Intercept" is nothing of intrest to me
So.. If it is a real Hack and not some script kiddy crap it's not of interest.
#offtopic btw
If intercept doesn't do hacks, then why are you mentioning it to me?
Like I said, there are no real hackers in Arma 3. Only script kiddies
"If it is a real Hack and not some script kiddy crap it's not of interest" - So yes, because there are no real hackers in Arma
i assume uve only been hit by script kiddies?
In arma 3? sure. If you honestly believe you've been hit by a "real" hacker in arma, you are mistaken. Script kiddies don't deserve such a title
That's all they are, script kiddies
Hacking by using script commands from the engine to "hack"
Last "hack" i saw was someone using an A2 'nuke' hack... but the script is broken in A3, all it did was shake the screen and give us a neat orange filter.
This is so ridiculously funny ๐
Kinda wish I knew the filter code, tho, it was a good effect :/
@atomic epoch I don't only believe that there are real Hackers. I know that there are. Because I am one of them
That nuke still uses script commands. A combination of BIS_fnc_MP, createVehicle, drop, filter, and there you have: Nuke Hack. All of which still use script commands.
I don't think I have a screenshot of my ESP
@still forum , yes you could very well be a real hacker. But inside of Arma 3, your just a script kiddie. Using script commands to ruin a server is not a hack
I did have dreams of using the arsenal Import function to like, this allowdamage or this addaction.
I'll make a screen of some of my code
:\ take it to PM
ESP can easily be recreated with script commands using getpos player and draw3D.
http://prntscr.com/gdfoo0 There. Part of my ESP. Now please shut up or go to #offtopic_arma
Kinda pointless though. Its easy to recreate your "hacks" with normal script commands. Your just overworking yourself. Any hack you can ever do, will always be limited by what script commands can already do. Not impressed
So.. You are saying everyone that is doing something that could be done with existend or non-existend script commands without using scripts in any way is still a script kiddy
And you are saying because my native hack can somewhat be build using scripts that I am limited to script stuff only? Your logic is messed up man
Because a car is made of metal it can't move because metal can't move by itself?
This is a fun read ๐ฟ
ESP is nothing to be proud of. And yes, anything you can do, can already be done inside the Arma 3 Engine.
๐
But as I said.. I'll stop now. You stay in your own delusional world
How can you make a SQF->C++ Binding with only scripts? Tell me that
Delusional? No, your just giving me somethign to learn.
I think weve confirmed that nothing client side is safe by now, to return to the original topic.
There is not much going on here right now.. So.. I guess I could have some fun with some random idiot ๐
using scripts inside of arma isn't really even what script kiddie means, as long as you write the scripts
"script kiddie" refers to kids who try to attack things who have no real knowledge on what they are actually doing, and who are just following guides and using pre-built tools
BIS_fnc_scriptKid takes args _rage, _noGF (default: false)
coincidentally I had an attempted script kiddie compromise of my web server yesterday
My "script kiddie" interpretation is someone who finds ands uses random scripts/hacks/whatever they stumble upon
That's also my definition. Just copies stuff without making anything himself
๐
@still forum thats probably the most organized ive seen ๐ฎ i just throw everything in dllMain
I started out with that.. But that project is now a little over 2 years old
ah
and as I added different rendering engines and stuff that became a liiittle to cluddered
judging by the work @still forum has been doing I'm pretty sure he fits the "hacker" definition quite well
the positive version that is
๐
There is a unwritten rule that you are not a Hacker unless a Hacker calls you a Hacker
By that definition I think I'm actually not one.. Not sure
that's the same thing as a good programmer calling another programmer a good programmer
quite unlikely to happen ^^
Hey guys, if I want to hide the default player marker on map, the red one which shows where you are, how can I do that? I checked difficulty options but I can see no such option.
mapContent=0; should do it, it hides other map markers tho, like spotted units.
Already have that, but still shows
oh, maybe im thinking of something else ๐ it is in difficulty i know that much
So if I have a gun on the ground, how do I find out what it is? trying to typeName into isKindOf doesn't work because typeName just returns "OBJECT"
Speficially I want to take the gun from the ground and put it into the player's hands.
@chilly hull just delete the gun, and player addweapon?
I intend to, but I first have to find out what type of weapon it is.
if it is in a weaponholder you can do weaponCargo box which returns ["arifle_MX_F"]
if it is an actual weapon object you do typeof object which returns "Weapon_arifle_MX_F"
This is waht I want to remove https://gyazo.com/1324ea073ce6cc1271b00d07cdbdecab
@rotund cypress can only be done through the difficulty settings
groupIndicators = 0; // Group indicators (0 = never, 1 = limited distance, 2 = always)
friendlyTags = 0; // Friendly name tags (0 = never, 1 = limited distance, 2 = always)
enemyTags = 0; // Enemy name tags (0 = never, 1 = limited distance, 2 = always)
detectedMines = 0; // Detected mines (0 = never, 1 = limited distance, 2 = always)
commands = 0; // Commands (0 = never, 1 = fade out, 2 = always)
waypoints = 0; // Waypoints (0 = never, 1 = fade out, 2 = always)
tacticalPing = 0; //Tactical Ping (0 = disabled, 1 = enabled)
visionAid = 0; // Vision aid (0 = disabled, 1 = enabled)
mapContent = 0; // Extended map content (0 = disabled, 1 = enabled)
Does ShowcommandingMenu not function all the time? I have a radio function that on activation is supposed to keep the menu open, but it closes anyways :/
Any tips for selectPlayer? I can't get it to do anything even in a sp environment
Okay, can anyone think of any reason why this wouldn't be updating?
bravoUpload = 0;
[] spawn {
while (bravoUpload < 100) do {
if (bravotriggered == true) then {
bravoUpload = bravoUpload + 1;
};
sleep 0.5;
};
};```
have you checked if bravotriggered changes to true with a debug output?`
Yup, that outputs as true.
bravoUpload just simply isn't changing from 0, for whatever reason.
put a debug output inside that if statement to see if it changes there?
while {} not while ()
@spice kayak what editor are you using?
notepad++
if you type "while" in it and hit tab for autocomplete it gives you:
while {/* condition */} do
{
/* STATEMENT */
};
kinda hard to fuck up then
Oh, nice. I might have to.
But it wasn't the {} / () that borked it. I don't think it liked the true/false statements. I've gotten one of them working, just not the other, despite being identical.
well while () doesn't work so at least you have one error fixed
sqf syntax highlight in discord sucks btw.
Yeah, for some reason, it wasn't working when they were inside the same [] spawn {}; function.
Once each was in it's own, it worked.
well spawn adds scripts to the scheduler, it doesn't gurantee the scripts are executed in the order you schedule them at all. can bite you in the butt.
if you rely on a specific execution order you need to make sure that your previous script executed
Yeah, that might have been the case. Thank you.
if you check the biki on spawn it shows how to check if a script is done with the handle and scriptDone
Oh, nice.
There's actually one more thing you might be able to help me with.
I've got this bit of code, executed on the server for the second operator. However, there might not always be an operator, and I'm pretty sure if I leave the slot empty when I play as MP, I get an error because the unit doesn't exist.
[] spawn {
while {alive pOperator2} do {
if (Op2empUsage == 0) then {
pOperator2 removeAction 0;
};
sleep 1;
};```
Let me just check that once more though.
I know it's something simple, but for some reason, my tired mind is drawing blanks.
Actually, I didn't get an error this time around. Well, that's nice!
Oh yup, got it again. Undefined variable "pOperator2"
well just check if pOperator2 exists
if yes, execute your code
if not, don't
you can even check if a variable is undefined with isNil
[]spawn {
if (!isNil pOperator2) then {
while {alive pOperator2} do {
};
};
};````
That also would give me errors. I feel like an idiot right now, because I know it's something I've done before.
if that code is executed on the server then removeAction wont do anything?
It does.
isNil takes a string as an argument
!isNil {myvar} ?
!isNil "myvar"
well he referenced the variable directly
just giving him a solution, not a whole lecture on the command
also while {!isNil "pOperator2" && {alive pOerator2}} do {};
Sorry, I've gotten it fixed :)
do modern IDEs check for undefined variables? i mean if you simply never define a var in your project, an IDE could catch it right? it identifies vars for syntax check anyways?
shuts up
I want to display a short text on the screen while the player talks to an NPC. hint is too subtile, titletext is too small and formating doesn't work (yet?), hintC takes player control which isn't wanted. Anything i'm not aware of?
SystemChat
cutRsc
make your own hud resource and display that instead
Easiest way would be to use systemChat or sideChat
Well shit. Now my scripts are making the game crash.
well something could be spamming the chat and then systemchat would scroll away? that doesn't seem ideal
i'll look at cutRsc i guess
thx guys
too many virtual memory blocks requested for me anyway.
Can someone take a look at the different scripts I've written to see why this might cause crashing? Because it's not giving my any specific errors, I'm really not too sure where to look :(
init.sqf: https://hastebin.com/fohirumiba.sqf
serverScript.sqf: https://hastebin.com/exededopuv.sqf
operator1Script.sqf: https://hastebin.com/qohiboxulo.sqf
emp1script.sqf: https://hastebin.com/ubanuvobik.sqf
Okay, hosting as MP works, but the FPS is literally 0. Something is causing a hang, I'm just not sure what.
run it through a profiler
Yeah, I think I might have found it. I didn't have a sleep command on a looping script.
For something that was meant to +1 every time it looped, yeaaahhhh.
if (bravotriggered) then {
I did initially try using boolean but was getting errors with true/false, so I used 1/0 instead. I'm not sure if that would work if it's a number, would it?
sure as long as you declare it a number before loop runs
Oh, neat. I originally thought that would only work with true/false statements. Thank you.
is grabbing stuff from the cfg files all the time expensive performance wise?
yes
you could make a function that caches the result in a variable after your first request
well i wrote a script to generate a list of all cities, towns etc on the map and then keep that to use it in various places, and i was wondering if that even makes sense
is it smarter to store such things in multiple arrays, and then do selectRandom (townarray + cityarray) or should i use a multidimensional array and throw cities and towns for example in the same array but with a category attached?
selectRandom (townarray + cityarray) concating arrays is not free. So doing that often is not a good idea
If you never need seperate arrays for them then just keep them in one array
Okay, this is strange. I have one variable called emp1Charge, yet it seems to have two values.
different namespaces?
This is the script this certain player is running. Basically, if their charge is lower than 100, it'll add 1 charge every cycle. Once the charge is at 100, it'll stop adding up, and instead add an action if that action wasn't already there. Down the bottom, there is a hint that displays the charge level. https://hastebin.com/ojelugevad.sqf
This is the script the addaction runs, which should reset the charge back down to 0 once it's executed, and allow the action to be removed. https://hastebin.com/axucixequl.sqf
I don't think so.
well i need both. occasionally i only want towns, but occasionally i want both towns and cities. the question is: fetch partial information from a large multidimensional array, or occasionally concatenate them. i only do it for starting a mission every few minutes so i guess its no big deal.
multidimensional then
ok thanks
@spice kayak So That are your scripts.... And that is what you are doing.. whats the problem?
i fetched all the locations from cfg yesterday and there are millions of small hills inside
The problem is, when the charge is at 100 and the action is added, when I execute the script, the charge value is set to both 0, and 100 at the same time.
there is no "at the same time" in sqf
If I use systemchat locally to get value of the charge, I get it counting up again, which is what it should do, but on the hint, it's still displaying 100, while every second, adding the action again and again.
so, it's like operator1Script is stuck on it thinking it's 100, so it's adding the action again and again, yet the part that increases the charge knows it's below 100, because it's slowly increasing it from 0 again.
just out of curiosity: i was under the impression the scheduled environment exists so scripts could run multithreaded and thus in parallel?
yes, scheduled. but why does it exist then? just to avoid exceeding the execution time inside one frame?
yes
i see, thanks
@spice kayak
if (emp1charge < 100) then {
emp1charge = emp1charge + 1;
} else {waitUntil {emp1charge == 0};};
maybe that helps
I'm now trying to add it to the same [] spawn {}; instead of in seperate ones.
it can't increment anymore till it's back at 0
But it does reset when the script runs, but it doesn't for the hint and the addaction segement.
That was the issue.
ยฏ_(ใ)_/ยฏ
Something has to reset the variable to 100 again in the hint
There are no different namespaces here
Yeah, but if I use systemchat to get the variable, it says it's not 100, which is correct.
It's like, at some point, one variable becomes two. I know that can't happen, but it seems that way.
Oh, systemchat is typed in the debug console.
parsetext format is quite dumb.. formatText
Formattext is returning normal strings
Okay, even weirder. I've increased the amount it adds every cycle, from +1 to +5. Now, systemchat is showing it go up in increments of 5, yet the hint is only going up at 1 every cycle.
The fuck, game.
Thank you, I figured that much :P
Npnp
You can use arma.studio with Dedmens debugger to debug your script
More indepth
https://community.bistudio.com/wiki/getArray AND I USED PUSHBACK /me goes re-write stuff from yesterday
So, I think I figured out the hint part anyway. For some reason, it's using both emp1charge, and operator2's emp2charge.
So the reason why the hint was flicking back and forth was because it was switching between emp1charge and emp2charge.
And the reason why it was thinking I was at 100 was because emp2charge was at 100, so it would add the action for me, but emp1charge was reset when the action was used.
Weird, I'm not sure why there is the conflict between the two.
Fixed it. For some reason, I had emp1[stuff] in the emp2script, which shouldn't have ran anyway, but still.
@queen cargo "Formattext is returning normal strings"
https://community.bistudio.com/wiki/formatText
"Structured Text"
Still having a bit of glitchy hint stuff. If I've got one unit executing their own hint, with their own variables, and then another unit with their own hint, with their own variables, it shouldn't be conflicting, should it?
only one hint can be displayed at a time
doesn't it make more sense to extract location information from the cfg rather than using nearestLocations to map the whole map? but then the return type isn't of the type Location i guess.
Isn't parsetext completly different from formatTextT?
I guess it makes some sense. But from config is harder I think
@peak plover parseText turns string into text
formatText is like format but returns text instead of string
well i figured out how to do it and make a nice array, but to turn that into locations i can only think of abusing nearestlocation again
No. I'm joking
Thanks
Why is text and string even a thing
Do you mean, one hint over every player, or one hint per person?
literally just wrote something with parseText format a few hours ago ๐
Because I know the latter one.
Yeah, but, if one machine executes one hint, and another executes their own local hint, there shouldn't be a conflict, should there?
I've had missions before where one team gets one hint, and another team gets a different one.
nope, local effect
no conflict*
But if antoher script uses hints (some mods do) it will overwrite ๐
But for some reason, on this one, despite being two different units with their own local script running their own hints, Im' getting conflict.
@tame portal Because they are totally different things in the backend. Text is compiled. String is just a string of characters
Yeah but it's still... weird
@spice kayak if you do hint "1"; hint "2"; then only 2 will be visible because it will replace 1 instantly.
@spice kayak One hint per UI
I personally would have made all functions that need text compile the string when required
@spice kayak try putting systemChat _text under the hint. See what pops
I think it's because I'm hosting it.
good for debug
@spice kayak Are you alone in MP? or with someone else?
You are alone.. Who is the other Player getting the hint then?
๐ฉ
"despite being two different units with their own local script running their own hints"
You are alone. Tell me how one person == two seperate persons
Another unit is getting the hint.
How?
Or, should be.
non-player units don't get hints. If they unit is local to you (client and server) you will get it instead
yeah, I get that, I just meant, I told the unit to run the script, which is why it might be having conflicts for me, the host.
loading into MP from editor.
This means you are both server and client, at the same time
Yeah, that's what I was getting at before.
You are the Unit. So you are running the script. So you are getting his Hint
You can't test Multiplayer MP stuff when you are alone.
Because Singleplayer is by definition not Multiplayer
Yeah, that's what I was thinking as well. Least now I have more clarification on that fact.
I admit, I love running around and seeing all the lights flicker off and back on again. It should make for an interesting mission, hopefully.
Nice, I wish more people put decent missions on workshop ๐
Ha, yeah, 'decent'
It's mostly just for my group, so I doubt I'll release anything I've made.
@tame portal everything is pretty much on 0 however, I still see myself
Because, there are so many communities that have stuff like trouble in terrorist town, etc. But mostly these are kept inside the house ๐
I like learning and checking out other missions/scripts for inspiration
Any script/funtion libraries that exist?
Well, maybe i'll share it once it's done.
It's kind of like Splinter Cell's MP, with Agents vs Guards. The Agents have a rechargable EMP, silenced pistol, tripwire mine and some smoke grenades. The guards have an SMG with a flashlight and some armor. The objective is to upload intel to two different laptops. Once that's done, Agents win. Guards win by killing all agents.
This is the EMP in action, including the flickering. I've now added a sound to it, that isn't in the video sadly. https://www.youtube.com/watch?v=P0UxzikV0KM
See, that sounds awesome. I wish there was like a google docs or sth, that everyone could add their creations to via google forms or sth ...
be it scripts, missions etc... Or something similar to ai script/mod list
@spice kayak that's really awesome
Ha, thank you. I've been working on getting the EMP side of things working for a few days. Only today have I actually made a mission around it haha.
My main issue is, I normally don't have people to test with until it comes mission night, in which case it'll more than likely break, and everyone would be disappointed :C
Oh my, the guards should totally have clem lights.
How would I add more items to this line
if ("Exile_Headgear_GasMask" in (assignedItems player)) then
I basically want to add more gasmask items to the exile radiation script
if ("Exile_Headgear_GasMask" in assignedItems player || {"Mask2" in assignedItems player}) then
@chrome nebula
if ("Exile_Headgear_GasMask" in assignedItems player || {"Mask2" in assignedItems player} || {"Mask2" in assignedItems player} || {"Mask2" in assignedItems player} || {"Mask2" in assignedItems player} || {"Mask2" in assignedItems player}) then etc
|| = OR
AHHHH
You can also write OR, but don't do that
WHAT?
OR WHAT?
Why not if ((goggles player) in _masklist) then {}
Could do as well
Well, he is not using goggles though
He is using assignedItems
assignedItems notes:
Arma 3, version 0.70 - headgear and goggles are not present in returned array now.
source: https://community.bistudio.com/wiki/assignedItems
I've played it, last I remember the gasmask was in goggles
@rotund cypress
I'm getting an error
13:43:07 Error in expression <all ExileClient_gui_gasMask_toggle;
};
};
ExileLastStatUpdate = diag_tickTime;
t>
13:43:07 Error position: <;
ExileLastStatUpdate = diag_tickTime;
t>
13:43:07 Error Missing )
13:43:07 File mpmissions\ExileBlank.DSR_Chernarus\Overwrites\ExileClient_object_player_stats_update.sqf, line 176
13:43:07 Error in expression <all ExileClient_gui_gasMask_toggle;
};
};
ExileLastStatUpdate = diag_tickTime;
t>
13:43:07 Error position: <;
ExileLastStatUpdate = diag_tickTime;
t>
13:43:07 Error Missing )
13:43:07 File mpmissions\ExileBlank.DSR_Chernarus\Overwrites\ExileClient_object_player_stats_update.sqf, line 176
This is my code
if ("Exile_Headgear_GasMask" in assignedItems player ||
{"Masque_Metalhead" in assignedItems player} ||
{"H_ALFR_Gasmask" in assignedItems player} ||
{"avon_ct12" in assignedItems player} ||
{"avon_ct12_strapless" in assignedItems player} ||
{"avon_SF12" in assignedItems player} ||
{"avon_SF12_strapless" in assignedItems player} ||
{"avon_fm12_strapless" in assignedItems player} ||
{"avon_fm12" in assignedItems player}
then
{
if !(ExileClientGasMaskVisible) then
{
true call ExileClient_gui_gasMask_toggle;
};
if (alive player) then
{
if (diag_tickTime >= ExileGasMaskNextSoundAt) then
{
playSound format ["Exile_Sound_GasMaskBreathing0%1", 1 + (floor (random 2))];
ExileGasMaskNextSoundAt = diag_tickTime + (2.2 + (random 1));
};
};
}
@chrome nebula Error Missing ) you are missing a )
And it's VERY easy to spot in your code
That's how I've felt all day!
God, today I was stuck on how to figure out if a unit exists :/
On that note, almost done BABY http://i.imgur.com/0MZ1Vqo.png
Yeah, I suck at names
ยฏ_(ใ)_/ยฏ
If i find a few more ways to shorten this script it will disappear
How would I take a starting position (XYZ in an array), a direction, distance, and altitude, and turn it into another position (XYZ) to move a gamelogic to?
I'd take a look at getPosATL and setPosATL on BIwiki, that's probably what your looking for
That'd do for altitude, but that's probably the easiest part :/
modeltoWorld with some maths involved?
Or positionrelative
Oh yeah modelToWorld then, misunderstood original bit ๐
That's fine, I'm reasonably sure where I'm heading with this, but past experience has shown that throwing it out here usually results in an obvious 'Oh just use 'FindThatPoint' function, it's right on the wiki..'
X2 = (getpos Start select _1) +(Dist) cos (Dir)
Haha well the wiki is good ๐
Oh god trig ๐ซ
Trig can be useful ๐ love it
I know, I know... I'm not shy of maths, but it's never been my strong suit.
Especially introductory algebra. No clue why, just couldn't wrap my head around it.
StartPosX = [getpos Start] select 1
Correct?
array = [[1,2],[2,2],[1,2],[2,2]];
How do i select each element from that array where the first element is 1 ?
a select {_x select 0 == 1}
Thanks!
Hey my dudes, I've been stuck on the same problem for a little over a day now. I have a cellphone with working contacts and messages lists. When you go to your conversations list, you see the person's number (or name if they're in your contacts) and on double click, it opens a new dialog. This dialog lists the messages between you and this person, and has a reply button. When I press the reply button though, I can't seem to find a way to pass the number's variable to my reply script.
Here's how it goes:
Conversations dialog -> double-click conversation in list, spawns script -> script gets the lbData (number) and stores in _num then opens new dialog and uses the number to populate the messages list -> onbuttonclick calls other script <- thats who I need to send the variable to.
I could probably make the variable a global one, but I'm sure there's another very simple way to do it. I'm probably just missing something big time.
fn_openMessages.sqf
disableSerialization;
_num = lbData [5050,(lbCurSel 5050)];
createDialog "phone_messages";
_list = CONTROL(6000,6050);
_messages = { if ((_x select 0) isEqualTo _num) exitWith { _x select 1 }; } forEach dript_phone_messages;
if (isNil "_messages") exitWith {};
{
_msg = _x select 0;
_label = if (count _msg > 15) then { (_msg select [0,15]) + "..." } else { _msg };
_list lbAdd _label;
_list lbSetData [(lbSize 6050) - 1,[_msg,_num]];
if ((_x select 1) isEqualTo 0) then {
_list lbSetPicture [(lbSize 6050) - 1,"sent.paa"];
_list lbSetPictureColor [(lbSize 6050) - 1, [1,0,0,1]];
}
else {
_list lbSetPicture [(lbSize 6050) - 1,"rec.paa"];
_list lbSetPictureColor [(lbSize 6050) - 1, [0,1,0,1]];
};
} forEach _messages;
set/getVariable on the dialog
so like
phone_messages setVariable ["number",_num] ?
Oh I think I found it I need to grab the dialog through findDisplay
That works
Neat
Thanks, again.
I'm gonna have to start crediting you somewhere on my server if you keep this up ๐
What are variables that I get with _this when I use buttonSetAction
And how do i find documentation on this?
_buttonCtrl buttonSetAction "
systemChat str _this;
";
๐คฆ
returns ""
_buttonCtrl ctrlSetEventHandler ["buttonClick","
systemChat str _this;
"];
// control
I feel like buttonsetaction is bad and ctrlSetEH should be used instead ๐
A note from buttonsetaction to ctrlSetEH would be cute
I know this is the wrong chat, but I did not get any answer in Battleye so wil try here as well.
Hey, does anyone know what this means exactly?
23:47:33 BE protection kicked in for player id=1805870767, name='SimZor', msgType=372
Its a compile function i am remote executing globally
Battleye log
26.08.2017 23:47:33: SimZor (ip:2304) 6015f94cf68fcb43378a31eb574f6aed - Compile Block "fnc_compilerequest ["skipTime 5","SERVER"]"
Just wait on BE channel. This is not instant chat.
(findDisplay 12 displayCtrl 51) ctrlAddEventHandler ["Draw","
(_this select 0) drawLine [
getPos player,
[43.343434,53.555553,0],
[0,0,1,1]
];
"];
what does _this store?
I don't follow
Partial JTAC success so far - I have a reasonably accurate orienteering script, though it's buggy as hell on certain paths (one trigger was setting my hundreds of meters to 0, constantly, which isn't fun when 90% of the tree requires Dist100 == anything but 0). All I need now is some way of using marking systems (smoke? Laser is easy I think), and actually spawning the airstrike.
what was the variable/function/command to get the currently controlled unit again? basically wanting to have something work with zeus remote control also. i remember the solution vaguely but forgot to implement it when it came out
isPlayer?
bis_fnc_moduleRemoteControl_unit = _unit;
_unit setvariable ["bis_fnc_moduleRemoteControl_owner",player,true];
ah. i think that's it
possibly this too? https://community.bistudio.com/wiki/cameraOn
Don't think so
Every plane I spawn nosedives :/ I can't seem to fix this one up.
NVM, kinda fixed it with a KK script.
apply some velocity
Problem is the spawn direction is variable :/
apply velocity in dir vector then
vectorDir _plane
this too https://community.bistudio.com/wiki/vectorMultiply
also this if you want modelspace
https://community.bistudio.com/wiki/setVelocityModelSpace
I think I got it with a KK script, KK_fnc_setDirFLY
I think I borked the math, tho... 90 degrees is still due north :/
using ctrlMenu:
Do I just add a EH to check if mouse is not on the menu or clicks elsewhere?
what's ctrlMenu?
just noticed yea
Input heading 180, target set to 270... yeah, I screwed up the math somewhere :/
@badbenson#0154 But your code worked, plane at least flies in at 180.
TGT setPos [(IP select 0)+DistTotal*(cos DirTotal),(IP select 1)+DistTotal*(sin DirTotal),0];
protip: when your units don't spawn and you can't find any issue, check if your cleanup deletes them right after they're spawned
Hah, had that happen ๐
Anyone here know exactly when the missionnamespace is created when joining into multiplayer
When your group gets created IIRC @spark phoenix
Thanks, will look into that then
Quick question
Whats the easiest way to find out what name to use in the requiredAddons[] field in the CfgPatches
for something like HLC for example
@Kegan Hollern#7401 Way before preInit
Is your question when missionNamespace get's cleared? I think on Serverjoin. Slot selection.
I can check when exactly tomorrow. PM me so I don't forget
If someone catches you doing something like that.. Just say you are using Intercept to do magic ๐
Not really the same thing, but sure
it is the same
๐
_returnValue = if true then {true breakOut "main"} else {false breakOut "main"}; would not make sense @queen cargo
However in other languages you would have to use return
Here you don't, so it's not the same thing
SQF is working with scopes
Exactly
breakout is the closest relative
However, if I don't want to exit the scope, I don't use breakOut
I just leave the value I want to return
closest relative != same thing
there is no same thing thats the oint
Exactly, yet you said it was the same ๐
closest relative
realises addAction has a return value
So, any public server use the switch server yet?
Could transfer players when there's a restart...
Or link to other servers by the same community through the briefing(map)
how bad is waitUntil performance wise? Is there a lazy version of it?
not bad ๐
waitUntil has specific use, if used for intended purpose it's good
If you just want to loop 'tho. Using while is 0.0001 ms better in 10000 iterations ๐
lol
Never use while unless you got a condition other than true
please elaborate
Yeah, use while {isNil "myLoopExit"}instead of while {true}
for performance reasons, that is?
Yes
OEF is most likely the best for not using SQF power
Because it does not check any conditions and waste any time whatsoever
whats OEF
On Each Frame
for > while
Most of the time as well
Even if you have a condition
Better to use exitWith or breakOut
well i only need to check on something every, say, 5 seconds.
Cause if you have a while loop it will check the condition each iteration
While a for loop is faster
It does not matter what you use, they will all constantly check if it's been 5 seconds yet...
oh.
@peak plover What do you mean by that?
Unless you have >1000 loops like that it won't matter 'tho
It will
sleep _x; will cause the script to suspend and be checked if it's sleep is done yet
Did anyone here mention sleeps? @peak plover
What does that have to do with anything? ๐
so whats the most performance efficient way to check on a condition in a not terribly accurate (time wise) manner?
No, if you run nothing else (vanilla, no scripts) you might get some slowdown with a few thousand loops VR
use event driven scripts intead of sleep
I am talking about getting your result the fasest way
Not about slowing anything down
so, event handlers?
if you want to sleep 5 seconds the fastest way just use sleep 4.9
No matter how few loops you have, for will always be faster than while loop
"event driven scripts" ...
if you add those "event driven scripts" with a condition, the condition is checked just like normal
best way to just loop stuff is spawn
only exception is tiem critical stuff
I mean if possible eventhandlers that already exist
and pretty mcuh nothing anyone here codes is time critical enough to be placed in onEachFrame
how do i loop with spawn?
@queen cargo then you have those servers where something you spawn will be executed in 5 seconds because the scheduler is full of crap lol
@waxen tide sqf [] spawn { while {condition} do {code}; };
#howtonotmanage
@tame portal stop using faulty code and that wont happen
@queen cargo dont tell me
that is the point
it is hard not to do so
that is why you barely find good running missions
@peak plover i spawn a lot of civilians and i put a long dialogue on them with addAction. depending on some conditions, the dialogue takes different turns and triggers events. I don't need instant responses, the player needs to read the answers anyways.
sorry my internet crapped out. @peak plover i asked about waitUntil because i want to stall the dialogue and only advance it based on conditions
Ahh okay, so _text1; sleep 5; if (player isStillListening) then {_text2};
kinda like that?
well a bit more complex, but roughly, yes.
the dialogue has 3 stages. i want to offer an addAction that advances the dialogue, to stage 2, then 3 and stop the npc for a short while each time the player talks to him (the npcs walk around) then the player has a bit of time to continue talking, if the player doesn't the npc walks off. also if some condition is triggered (the npc gives the right answer (he gives random ones) then change the dialogue back to stage one and stay at stage one without advancing (stage 1 is just variants of "hi")
Is there a way to disable arma 3 cheat menu/shift minus?
basically i would like a universal structure for the script that is flexible and allows adding stages and removing stages at any time while also evaluating multiple conditions. and all of that with not really exact timing, there is lots of sleep(5); in the scripts to prevent players from spamming options anyways.
I don't think using sleep in less than 10 loops will cause you any noticable frame drop in your case
Don't addActions check every frame anyway?
i really don't want to waste any performance as long as i don't need to sacrifice a living being to optimise my code a bit
i remove the addaction as soon as the player used it, and then do most of my stuff, and then create a new action. also i reduced the radius for them to trigger but i'm not terribly sure that feature works yet.
Yeah, addAction checks every frame and does not use the scheduler. So it freezes EVERYTHING, checks all addactions, continues
jesus.
there might be a group of players in combat while i spawn the civilians to be questioned by a different player group. so i sure don't want the civilians to be a performance toll.
I reckon that if performance is your primary concern...
You'd probably be better of using a loop that checks a simple condition and then displays a HUD element saying (space to talk) when you are close to someone who you can talk to and then do more complex checks...
instead of using addaction
But then agian
BAN premature optimization
Make something that works, don't overthink too much, then once it's done. Fix performance if needed
I run into the same trap as you all the time, takes me forever to get anything done ๐
Also if you use ACE3 use ACE interaction instead, because it only checks conditions when you are holding down the menu key
well another big concern is that i nested way too many loops for that dialogue
Yeah, try to keep it simple
I found that after writing something, taking a minute to look at the code and write comments will help me find a couple of errors or allow me to make some things better
Anyway I hope you get to the goal you aim for ๐
if performance is your primary concern.... itยดs arma
maybe i should write a generic dialogue function but then dialogues are complex.
which given the scale it actually runs pretty well
@waxen tide depends you can push the text you want and make the player belive he has a choice when he doesnt
you can introduce slight changes without need to have completly diferent branches
i'll complete what i got and then you guys can take a look and yell.
ok only if i can just look and not yell
Consider doing what you do now with ~0.01ms less performance vs spending a week doing something bigger and ~0.01ms better perf ๐
say3D and playSound works for CfgSounds but I'm wondering what plays anything under CfgSFX?
Is there a way to disable arma 3 cheat menu/shift minus?
how do I check if a player is in gunner seat?
Make a keydown eventhandler, then do a case for shift + - key and if they press it do some code to deny its function @grizzled spindle
gunner vehicle isEqualTo unit
im 90% sure simply denying the keypress doesnt stop the cheat menu. I flick disableUserInput off then back on and it stops the cheat menu. problem with it is you have to add the evh to every display if you want to completly disable it
@robust hollow if (gunner vehicle isEqualTo player) then{ would that work
if you replace vehicle with the vehicle ur checking yea
(findDisplay 46) displayAddEventHandler ["KeyDown", "_this call somefunction"];
That'd be your display eventhandler to aim to block the shift- thing
Then make a case for whatever number - is on German keyboard, check if shift is there, then disable user input or whatever you wanna do @grizzled spindle
If _handled is true before going thru, cheat menu won't open
At least that's what I think ๐
@robust hollow so "if (gunner (vehicle player) isEqualTo player) then {" works if your the gunner of a helicopter or car. how would i check if your on a bench of a heli or shooting from a qilin?
perhaps this would be better if you're checking multiple seats.
https://community.bistudio.com/wiki/fullCrew
What's your script that's called? @grizzled spindle
Like it needs to take parameters correctly etc so you can check for shift and the keycode
Like that bit of code I put in is an example, and is no way near the whole thing you need, just a starting point ๐
So maths isnt my strong suit. I have a starting point, a heading and a distance. I tried using trig (cos and sin, etc) but im getting wonky results - 90 degree headings returning dead north, so on.
Is there an easier way of finding the target location from that data?
Like, an invisible circle of DistTotal radius, a ray set on DirTotal, and the coordinates of their intercept?
well, if im understanding you right you could do something like this. there is probs a better way but im not the smartest so heres a simple fix:
_head = 60;
_dist = 5000;
obj setdir _head;
_dest = obj modelToWorld [0,_dist,0];```
Would that work for a gamelogic/marker, though?
I had considered it, but I second guessed myself, assumed it wouldnt function for things that cant normally move :/
modeltoworld only works for objects, but id like to think its the easiest way about getting ur destination pos.
Does anyone know whether there is a way to have a classname of for example a weapon and get the corresponding CfgPatches config entry in which the weapon classname has been defined?
Hrm... i could get away with VR objects.
For example you define a class for a music track in CfgMusic and your addon is called
class CfgPatches {
class MyMusic {
units[] = {};
weapons[] = {};
requiredVersion = 0.1;
requiredAddons[] = {"A3_Music_F"};
};
};
"MyMusic", and lets say you define a track called TrackA inside it
Is there any way to get from TrackA to the config entry "MyMusic"?
In this example:
class CfgPatches {
class MyMusic {
units[] = {};
weapons[] = {};
requiredVersion = 0.1;
requiredAddons[] = {"A3_Music_F"};
};
};
class CfgMusic {
tracks[]={};
class TrackA {};
};
configSourceAddonList (configfile >> "CfgWeapons" >> "arifle_Katiba_F") = ["A3_Weapons_F_Rifles_Khaybar"]
that return is the patch
is that what ur after @tame portal ?
' looks like fly feces
@peak plover wat
I'm using strings inside strings, ' looks like a housefly took shit on my screen...
can i compare the content of one variable with the name of another?
yea? content isequalto 'name'?
I'm all the way at```sqf
" "" ' hey ' "" "
:O
string inside eventhandler inside an eventhandler
yes it does?
_ctrlMenu ctrlSetEventHandler [""mouseExit"",""
_this spawn {
disableSerialization;
systemChat str 'MouseExit';
params ['_ctrlMenu','_index'];
(_ctrlMenu getVariable 'menu_info') params ['_buttonCtrl'];
ctrlDelete _ctrlMenu;
_buttonCtrl ctrlShow true;
};
true
""];
I can't mouseExit: (
killfocus works...
am I doing something wrong?
what kindof ctrl r u doing it on?
class menus_template_listBox
{
access = 0; // Control access (0 - ReadAndWrite, 1 - ReadAndCreate, 2 - ReadOnly, 3 - ReadOnlyVerified)
idc = 1011; // Control identification (without it, the control won't be displayed)
type = CT_LISTBOX; // Type is 5
style = ST_LEFT + LB_TEXTURES; // Style
listbox
Probably does not support it?
dont think so
i dont have it working on a list box either, but it does work on buttons so it must be a special one.
Hmm, it would be very nice to have ;9
mouseMoving
and
!(_this select 3)
``` works :0
This is awesome!
finally a nice list
_dropList = [
"Respawn Player",
[0,1.3,5,1],
{
private _array = [];
private _nil = {
private _value = _x;
private _name = name _value;
private _toolTip = ('Respawn ' + _name);
_value = str _value;
_array pushBack [_name,_value,_toolTip];
false
} count PLAYERLIST;
_array
},
{[_this] call respawn_fnc_respawn}
] call menus_fnc_dropList;
Adding a list has never been this easy ๐
@robust hollow how would i use fullcrew (example)
look at the wiki link i sent.
just fullCrew vehicle which returns all occupied seats,
or fullCrew [vehicle,'seat type'] to return all occupied seats of that type,
or fullCrew [vehicle,'seat type',true] to return all seats with unoccupied seats showing objnull as the occupant.
im not looking for open seats, im looking for seats a player can shoot from
and to see if they are in it
how would that go into a if statement
if statement requires a boolean
something like this idk?
_isTurret = false;
{
_x params ['_unit','','','','_turret'];
if (_unit isequalto player) exitwith {
_isInVeh = true;
_isTurret = _turret;
};
}foreach fullcrew[vehicle,'Turret'];
if (_isInVeh && _isTurret) then {};```
How would I go reversing an array? I have tried reverse, but it doesn't seem to work:
_array = [["ASDASD","ASDASD"],["ASEEFD","GREWSFG"]];
systemChat str _array;
systemChat str (reverse _array);
_array prints as "[["ASDASD","ASDASD"],["ASEEFD","GREWSFG"]]"
reverse _array prints as nothing.
No RPT errors, no debug errors.
systemChat str _array;
reverse _array;
systemChat str _array;```
Finally solved my directional problem, got my Cos and Sin backwards. Which is weird because I'm like 90% sure math doesn't work that way, but whatever, it passes.
Does anyone knows how to handle a disconnect on the client side? I.e. if local client drops, execute a code before dropping completely.
(like a last message to the server before disconnecting)
@thick sage try endDefault evh on client
handleDisconnect etc need to be added on server
@rotund cypress Please don't tell a SQF beginner that he could use an OEF instead of an endless for loop. Those are completly different things and quite hazardous for beginners.
@grizzled spindle I think it's called onCheat in description.ext. Just check description.ext wiki.
Also please don't spam.
@peak plover you can use CODE in eventhandlers... You don't need to use strings. But keep in mind that they are only stored as string internally (https://feedback.bistudio.com/T123355)
@thick sage You can't rely on that. If client's game crashes or he ALT+F4's or he losses connection that script might not run.
You can just attach a script to the ABORT button in the Menu.
@spark phoenix Read my message about missionNamespace?
I think right after you click continue after slot selection. Also missionNamespace is not created. It is there from game start on. It only get's cleared when you end/start a Mission.
@still forum he was asking to disable the cheat itself, not run a script when it happens.
And that's what I told him.
He needs to add a keydown evh on all displays and block it
Atleast I heard somewhere that onCheat can return a value
Or block user input when it happens
It does not work to use onCheat to disable it
I spent a day on trying different things before I came up with a good solution in onkeydown evh
Okey I looked a bit. keyDown handler and just open steam overlay using https://community.bistudio.com/wiki/openYoutubeVideo and game will reset cheat code and forget about it
Thanks Dedmen!
Very good stuff, So instead of huge block after EH, I shall insert a call function
Welp. Trying out my very own parameters for the first time. Fingers crossed!
Config : some input after EndOfFile.
Would help if I added parameters to the right description.ext...
Yeah, still that error. I don't see anything wrong with my formatting though.
you have a } too many
@still forum https://community.bistudio.com/wiki/ctrlSetEventHandler string only ๐ฆ
did you test? Mh.. Well.. still if you "_this call myFunc"
Yeah, it's still A LOT better that way
It says type code expected string
I guess ctrlSetEH is old
or something
Also means I can put stupid comments now
Code is more organized as well ๐
what the real
_ctrlList ctrlSetEventHandler ["LBSelChanged","call menus_fnc_listEHLBSelChanged"];
causing a crash...
Maybe I fggd sth up?
do you have a ctrlRemoveEventHandler in there?
nah
what the real
_ctrlList ctrlSetEventHandler ["LBSelChanged","call menus_fnc_listEHLBSelChanged"];
_ctrlList ctrlSetEventHandler ["mouseMoving","call menus_fnc_listEHmouseMoving"];
``` both cause crashes for some reason...
if (_inside) exitWith {};
systemChat str 'mouseMoving';
//(_ctrlList getVariable 'menu_info') params ['_buttonCtrl'];
//_buttonCtrl ctrlShow true;
// delete the control
ctrlDelete _ctrlList;
if the exitWith runs no crash, so it's either the comments or ctrlDelete...
probably ctrlDelete, because it's on same frame
yeah.. ctrlDelete
Makes sense imo. Reported a similear bug over a year ago
That's very interesting
I guess whatever is iterating over the set EHs loses track of the control e.g. null pointer or whatever and crashes
kinda yeah
They iterate over each EH. without checking if the Control or the EH itself has been deleted already
A very dumb mistake and can be fixed with one line of code that I can write in 5 seconds
Either way, I've not been this excited about a function in a while, THIS IS FUN!
Still... Unfixed and ignored by BI for over a year
pity
I will utilize the shit out of this control ๐
Hi all,I tried to make a civilian unit join a west group, the purpose of this is changing unit's side.
Unfortunately, now the 'side player' command returns 'WEST' , but instead playerSide still returns 'CIVILIAN'. How do I know exactly which side is the unit on?
https://community.bistudio.com/wiki/playerSide
Dr_Eyeball
playerSide also shows your starting side, even if your side changes to enemy due to a bad rating. In that case, playerSide != side player.
Also fun stuff:
Can't store code into profilenamespace, because it gets executed when you launche the game
wut? Are you sure? That's new to me
If it does, just store it as a string then
14:34:54 Global namespace not passed during: (isNull getAssignedCuratorLogic player)
14:34:54 Error in expression <(isNull getAssignedCuratorLogic player)>
14:34:54 Error position: <isNull getAssignedCuratorLogic player)>
14:34:54 Error Local variable in global space
Originates from
[["Become Zeus","player remoteExec ['zeus_fnc_srvAdd',2];",[{(isNull getAssignedCuratorLogic player)},{false}],true],[player]] call menus_fnc_registerItem;
which saves the array to profile namespace as
unit_menu_items = [[{(isNull getAssignedCuratorLogic player)},{false}],true],[player]],[["Respawn Plugin","call respawn_fnc_menu",[{true},{false}],true],[player]]]
I guess I have to string the stuff I want to save
CBA/ACE have that problem when you push craptons of shit into profileNamespace
Well, my situation got so bad that when I load any of the showcases, there is no AI, it's all broken ๐
str when saving and compile when grabbing, I guess...
This is actually very bad...
Someone cloud exploit this and ruin others games completly, just by having them connected on the same server...
Which is just scary to know...
you guys seem like smart people can you help me out please
If I have an independent run a script local to them, but contains something like this, would it still work, or no?
{
if (((side _x) == West) && (_x distance (getMarkerPos "emp1Marker") < 100)) then
{
_x removePrimaryWeaponItem "acc_flashlight";
sleep 0.1;
_x addPrimaryWeaponItem "acc_flashlight";
};
} forEach allUnits;```
I'm sorry, but I'm not sure.
well what does the wiki say?
I haven't really played around with local/global executions. WHich two commands were you referring to? The remove/add commands?
Well, I'd guess Object for both would have to be global.
As to the string, I'm not sure, I'd say local, but local to the object.
the wiki page displays locality on the top left
A(letter) and E(letter), standing for Argument and Execution
I'm sorry, I don't think I actually see that on the wiki page for me.
Oh, sorry, you're right.
The specific page I was on didn't.
Sorry. The arguments are local for both.
yea
so if the script is running on a single client only, it work for units local to his client
so not other players, ai on the server, etc
That makes a lot of sense. I wa sn't too sure when I added the forEach allUnits part. I thought that might somehow change it.
@shadow valley No we can't. Because we don't know what you want
sorry ok so my game keeps crashing when it launches, with the error memory cant be read
No we can't. And that's totally not #arma3_scripting
So, to fix that, a function and remoteExec would work?
Ya
So, like this?
LightsOut = {
if ((_x distance (getMarkerPos "emp1Marker") < 100)) then
{
_x removePrimaryWeaponItem "acc_flashlight";
sleep 0.1;
_x addPrimaryWeaponItem "acc_flashlight";
};
};
[] remoteExec ["LightsOut", west];```
If you wanna flicker em, wouldnt actions work better than adding / removing?
I think theres actions for lights on and off
Sadly that doesn't work on players :(
If it's the command I'm thinking of.
enableGunLights "This command can be used to force lights on, but not to force lights off. "
Unless the later comment corrects that.
I admit, the only reason why i went with removing and adding them is because I didn't think enableGunLights would work.
Oooh, that works in debug console.
Hang on. With what I sent just before (the last script, using remoteExec, would that work with _x? I know there is a certain word for the target variable that passes over, but I can't remember what it is. I don't think it's _x though.
_this is the word I was thinking of. Duh.
is there any hidden action to script weapon deployment?
i suspect one can use this, but would need to know how to:
https://community.bistudio.com/wiki/Arma_3_Actions
@still forum didn't you have access to all commands and what parameters they take?
_text = "Hello";
_this addAction ["Hi", {hint _text}];
// Error :
'hint |#|text'
Error undefined variable in expression _text
Yes. I do. https://community.bistudio.com/wiki/Arma_3_Actions Is only one command though.
@waxen tide _text is undefined.
well, i know. is there any way to get that variable into the code scope of addAction?
make it a global variable
compile a formatted string
move the text into the code by using format
dont even need to compile even
format ["hint %1",str _text] should have to correct amount of quotation marks, iirc
_text = "Hello";
_this addAction ["Hi",format ["hint %1",str _text]];
I generally setVariable stuff onto the object the action is added to, if i need extra variables. You might prefer that, also.
I'm still looking for a way to move the action menu title from middle of the screen to the side...
addAction, more like waste of 0.001ms action
If there isnt an rsc for it youre probably just fucked on that
... ๐ฆ
hmm
textDefault
is the image
is
text="$STR_ACTION_FLAPS_UP";
the thign that shows in middle or are they same (middle and side)
What if I put a couple of new lines into every text...
arent there x/y you can manipulate?
nope, most gui elements allow movement, but action menu and jets dlc huds don't
Can't rescale / move
It's so annoying.
- deploy weapon on car
- look around
- (middle of screen) GET IN AS DRIVER[STEERING WHEEL]
Why...
If it was disabled on ADS, i'd be happy...
@still forum there seem to be new ones in your list but also some missing that i know work
like surrender https://community.bistudio.com/wiki/Arma_3_Actions#Surrender
is your list directly from the source?
my list was from current 1.72 binary
I only exported from one function. Might be that they are split into multiple
I'll see what I can do
awesome! thanks
Surrender is a hotkey I think
DeployWeaponAuto
DeployWeaponManual
ยฏ_(ใ)_/ยฏ
ยฏ_(ใ)_/ยฏ
I answered. I dunno ^^
But if they exist. Then that's their name
deployment was added with marksman. Try looking into marksman dlc files
Actions are not in any "dlc files"
hmm i don't see those DeployWeaponAuto and DeployWeaponManual in your second link
@still forum
Yeah.. But I found them elsewhere ๐
ok ๐
i guess one can "simulate" keyboard actions with the action sqf command
hence why surrender worked
Yep. And I've sent you the name of the deploy keyboard action
i will try and hope i can get the DeployWeaponManual to work :S
seems like the whole action system is a big mess...
It is one of the things that are there since OFP
and they seem to have reinvented it for every new installment and kept the old one
anyway thanks for investigating!
aUnconscioush_0 db 'UnconsciousHead',0
aUnconsciousb_0 db 'UnconsciousBody',0
aUnconsciousa_0 db 'UnconsciousArms',0
aUnconsciousl_0 db 'UnconsciousLegs',0 ```
๐ค
Well shit. Apparently the EMP to turn out the lights by damaging them, only affects the person who executes the script.
I dun goof'd on that one.
I open full virtual arsenal with player addaction, like this:
player addAction ["Arsenal", {["Open",true] spawn BIS_fnc_arsenal;},.....];
and I want to remove mortar bagpack (e.g. "B_Mortar_01_weapon_F") from full virtual arsenal. how to? ๐
yeap, I read it but most say whitelist script. still don't know how to. I just thought single command line using BIS_fnc_removeVirtualBackpackCargo can solve it, but still don't know. @tough abyss
Sorry again, so when I realized the addAction script to damage objects was only working locally, I decided to try remoteExec, however in doing so, the action activates immediately and without my action. Might I ask what I'm doing wrong here?
pOperator1 addAction["EMP Charge", {execVM "emp1Script.sqf";} remoteExec ["BIS_fnc_call", 0],nil,6,false,true,"","true",0];```
Got something working? Nice!
Yes, got rid of the add actions from middle of the screen
This was my wish for like ever ๐
Oh, nice!
How did you achieve it in the end?
Actions reads
textDefault
If it's "" it will use text instead
so using textDefault="<br/>"; Means no ugly action in the middle of the screen ๐
I'm trying to understand params, maybe someone can clarify this to me. I'm wondering where bis_o1 comes from and what it means? Also i am wondering where i could read up stuff like this and if it is always the same pattern.
_unit addAction ["Action", "script.sqf", ["arg"]];
// script.sqf
params ["_object", "_caller", "_id", "_args"];
systemChat format ["object : %1", _object]; // C Alpha 3-1:1 - object the addAction is attached to
systemChat format ["caller : %1", _caller]; // bis_o1 - ???
systemChat format ["id : %1", _id]; // 0 - id of addAction ?
systemChat format ["args : %1", _args]; // ["arg"] - argument passed
@peak plover can you not just set showWindow value to 0?
bis_o1 is https://community.bistudio.com/wiki/setVehicleVarName
default vehicleVarName because you didn't give it one in the editor
@grand berry Nope, that does not remove texts from middle of screen
I thought that was the purpose of that param - what does it do if not that?
No clue, but I set it 0 and it didn't remove. left it on 0 'tho...
@peak plover would bis_o1 turn into something unique per player in multiplayer?
Whatever you set it as in the editor
You can set a name for units
And i think bis_o1 is dynamically created, so its always different
oh, i see, so it entirely depends on the unit object and i can attach whatever i want to each unit?
Yeah?
Yes
anyone here could check what this outputs?
systemchat diag_tickTime;
for "_i" from 0 to 10000 do {};
systemchat diag_tickTime```
normal perf. test of the middle part is also acceptible
@spice kayak You are not remote execing the right thing
pOperator1 addAction [
"EMP Charge",
{execVM "emp1Script.sqf";} remoteExec ["BIS_fnc_call", 0],
nil,
6,
false,
true,
"",
"true",
0
];
you didn't remoteExec the script in the action. Instead you remoteExec'ed the script and added the returned value as a script to the action