#arma3_scripting
1 messages ยท Page 275 of 1
Is it possible to set a background of a RscActiveText?
With Style = ST_PICTURE
What's the command to hide the frame around an RscText (with Style ST_MULTI) or an RscEdit?
I've tried all these ```SQF
colorBackground[] = {0,0,0,0};
colorActive[] = {0,0,0,0};
colorBackgroundActive[] = {0,0,0,0};
colorBackgroundDisabled[] = {0,0,0,0};
colorDisabled[] = {0,0,0,0};
colorFocused[] = {0,0,0,0};
colorShadow[] = {0,0,0,0};
colorBorder[] = {0,0,0,0};
That is sadly obvious in hindsight. I'm still thinking in a round compass way, not just flat numbers :/
define "frame" @cerulean whale
Nevermind, I finally see what's happening... since I have two 'on target' states, since one is complete the other feedback is overwritten for the first case.
Is it possible to set a background of a RscActiveText?
With Style = ST_PICTURE
Does it support it?
I'm note sure
Looked at the root configs?
no actually not
What does that mean?
Display options:
0 (ST_LEFT): Text is left-aligned.
1 (ST_RIGHT) : Text is right-aligned.
2 (ST_CENTER): Text is centered.
Nope no textures
Nope
You can use inherited structure to achieve it.
Cancel button uses RscActiveText
in the arma 3 menu
What do you mean by inherited structure?
All GUI data is inherited data structures
Meaning one thing inherits the characteristics of the next.
It's an OOP thing.
class RscActiveText
{
deletable = 0;
fade = 0;
access = 0;
type = 11;
style = 2;
h = 0.05;
w = 0.15;
font = "TahomaB";
sizeEx = 0.04;
color[] = {1,1,1,1};
colorActive[] = {1,0.5,0,1};
colorDisabled[] = {1,1,1,0.25};
soundEnter[] = {"",0.1,1};
soundPush[] = {"",0.1,1};
soundClick[] = {"",0.1,1};
soundEscape[] = {"",0.1,1};
text = "";
default = 0;
shadow = 0;
};
Base class
class ButtonOK: RscActiveText
{
idc = 1;
x = 0;
y = 0;
w = 0;
h = 0;
default = 1;
};
ButtonOK inherits from RscActiveText
So all the characteristics in RscActiveText are basically placed into ButtonOK
Oh yeah now I see what you mean yeah i have that for everything
colorActive you possibly could use an image.
Those buttons is all made with RscActiveText
What I want to accomplish is a background on each button
Background colour
No
or do you want a color always?
Colour always
What color did you set it as?
1,1,1,1
So white?
You do know you have to go back to the main menu
to reload GUI yes?
GUI data is stored in UI-namespace
So go back to the server-browser
page
then reload the mission.
IF on your local listen server
Yeah GUI is stored UI-Namespace
Yes
Yeah just said it cause you said it was black above xD
ye ๐
Reload the mission?
actually
Make sure you have it.
Didn't add the [] array definer?
๐ฆ
Considering european country
because they're a czech company.
Yeah
All the naming for body parts are also in czech
ye
One more thing
ctrlSetFade 1
does that fade to visible?
or is 0 doing that?
cant find fade
Found it
I hate the wiki
Damn rabbit hole
_ctrl ctrlSetFade 1; // hides the control
_ctrl ctrlSetFade 0.5; // control is 50% visible
_ctrl ctrlSetFade 0; // control is fully visible
You also have to ctrlCommit
But it seemed to fade the control to invisible
controlName ctrlCommit time
_ctrl ctrlSetFade 0; // control is fully visible
Thats confusing.
1 == Alpha 100%
normally.
0 == 0% Alpha
so alpha 100 is totally invisible then
instead it's 0% == 1;
100% == 0;
BI why can't you keep a "standard" of design.
facepalm
Yeah
So whats happening here is
_ctrl = _display displayCtrl _x;
_ctrl ctrlSetFade 0; // Fully visible
_ctrl ctrlCommit 5; // Commit change in 5 seconds
_ctrl ctrlSetFade 1; // Fully Invisible
So you need this.
_ctrl = _display displayCtrl _x;
_ctrl ctrlSetFade 1; // Fully Invisible
_ctrl ctrlCommit 5; // Commit change in 5 seconds
_ctrl ctrlSetFade 0; // Fully visible
@rotund cypress
ye trying now
// -- Display Control
_ctrl = _display displayCtrl _x;
_ctrl ctrlSetFade 1;
_ctrl ctrlCommit 3;
_ctrl ctrlSetFade 0;
} forEach [ 1231323, 123123, 123132, 123124 ];```
This just makes it invisble after 3 secs
and now its not doing anything
// -- Display Control
_ctrl = _display displayCtrl _x;
_ctrl ctrlSetFade 0;
_ctrl ctrlCommit 3;
_ctrl ctrlSetFade 1;
} forEach [ 1231323, 123123, 123132, 123124 ];```
...
_ctrl = _display displayCtrl _x;
_ctrl ctrlSetFade 1; // Fully Invisible
_ctrl ctrlCommit 5; // Commit change in 5 seconds
_ctrl ctrlSetFade 0; // Fully visible
1 == Invisible
that made them invisible
0 == Visible
its very weird
ArmA 3 always is.
Use pseudo-code
Thats what I'd do.
It makes you life so much easier.
It speeds development period.
You end up with a better result in the end
if you mock up what you need to do in natural english.
forEach [Player name And FPS] in list
add to ClientFPS list
if Client is in FPS list.
Delete client from list
add updated entry to list.
I needed to make a comparison between the 2 values
Instead of 1
Comments are not necessarily psuedo-code
See how that contains keywords?
forEach [Player name And FPS] in list
add to ClientFPS list
if Client is in FPS list.
Delete client from list
add updated entry to list.
Reversing certain things also helps as forEach syntax in "true" languages.
Has a lot of functionality.
PHP vs ArmA 3 ForEach
PHP eats arma 3 alive.
Yeah.
Pseudo-code is helpful. Only language thats comparable to A3
is C-code
Hell you can even make structs in A3
C is closest to SQF
It's why with code.
*3 backticks c *
" `c
you can use keywords in discord
to syntax highlight.
cs after the beginning 3 backticks == C#
cpp after the beginning 3 backticks == C++
js == JavaScript
java = Java
etc.
I read the GUI in arma 3 using C++ highlighting.
and description.ext's
Whats the quickest way to replace an entry in an array @tough abyss
python for example has .insert([index],value] method.
Whats A3 equivlent ?
Why couldn't BI have just made accessing Indexes this syntax ?
Array[index]
Instead it's this screw-nuttery. _array select _something
They have to be special
I found out today there is a cheat menu on multiplayer servers that anyone can access
sigh
so stupid
It's not that good but can be used for duping if done right. https://community.bistudio.com/wiki/ArmA:_Cheats#GETALLGEAR
Place items on ground, end mission before SQL saves
and it bypasses handleDisconnect
Just listen for onCheat
Executes custom statement when player enters GETALLGEAR cheat (see: GETALLGEAR).
onCheat = "_this kick player ";
@rotund cypress I used a similar thing but did it slightly diferently. @tough abyss that only works for GETALLGEAR, not things like ENDMISSION which is used to dupe
What did you do differently @cerulean whale
You know if you want to be an ass?
and stop the server
BIS_fnc_shutdown;
xD
Hooks the exit button
I just have no idea why they would put that in their game on MP. Saved Data to SQL, Logged to RPT, Broadcast. Kick from game. I am also just running the Shift + - through my keyHandler
@tough abyss You can't run that through this menu though, can you?
Yeah
Everyone and the server.
It's kinda funny haha
But ben
/*
Author: Karel Moricky
Description:
Shut downs the game.
Parameter(s):
NOTHING
Returns:
NOTHING
*/
//--- Open options menu (forces to return to main menu)
ctrlactivate ((finddisplay 0) displayctrl 102);
//--- Close options menu
(finddisplay 3) closedisplay 2;
//--- Activate exit button
ctrlactivate ((finddisplay 0) displayctrl 106);
hahah
It's funny to use on hackers.
@cerulean whale If you kick them, its the same as using the cheat
I did that to a hacker once.
It was funny.
He was trolling our server so I used remoteExec from the server
And closed him and his game xD
@rotund cypress Yes and no, I am saving to the SQL first. I use the kick to make sure they don't access anything first. but I save to SQL before that
Why not just block the key with the script I made?
Ah key handler
Solves all your problems
Shift + Minus
Yes, but I also want to do some research into how many people use it and such.
Plus kicking lets all the kids know not to use it haha
Well with this menu they CANT use it
And if you just stick a logging thing in there you can log it aswell
But if you let them use it, they can still combat log and shit silently without you ever knowing about it
Unless you log that aswell
But this will just prevent it completly
Do you guys know if you can use BIS_fnc_MP ?
I dont think you can anymore
to remoteExec BIS_fnc_shutdown ; ?
Probably not
Another issue though @rotund cypress The guys who I am doing it for aren't very good with SQF and such, I don't have time to walk them through setting crap up
*uses it on self for amusement
You dont need to lulz
Why don't you just remoteExec it? @tough abyss
Just stick it in there ๐
Trying now.
I gave them your thing and they said "What do I do with this" xD
Then you tell them this: just copy and paste it into initPlayerLocal
Sounds like an OnKeyPressedHandler
Yeah.
Trying out BIS_fnc_shutdown; on my server.
I will so roflol if it causes my entire game to shutdown
Wonder if it would even invoke on the server-side
As the dedicated has no GUI
Can you remoteExec a function via UID? If I wanted to execute it to one client would I just use remoteExec ["Function", UID]? or would I have to define the UID within the function and execute globally?
or I could just make a small group of functions to do it
and names. next to the IDS
I'll just make a function for it
global exec it with two parameters, player name you wnat to execute and what function
global remoteExec to check for the first param, then execute it for that player
[] remoteExecCall ["BIS_fnc_shutdown",hackersID,false];
And being executed server side.
It won't be restricted.
So use it for your own amusement
If your worried you can also check the player executing it is a valid UID
stored in a cfg file
Hmm
Looks like it's been disabled.
I'll see if I can get it work by correcting the GUI ID references.
Yeah the wrong IDC's
I can actually get this to work again ? Nope Access Protected for a Reason @cerulean whale
All button classes have an access layer allowed of = 0;
If you're familiar with that @cerulean whale
Welp I found out how to remote crash arma 3
@rotund cypress Might want to patch this one.
I love symbolic links
Hooking my github into the symlink back to a set of files I can live edit
and reflect the changes in the original file folder without all those files being present in that folder
any clues on how to get enemy vehicles to respawn with AI in?
BIS_fnc_spawnGroup ?
Stupid question
how can I compare a previous value to a new value in a publicVariable?
["Player: Mr-Bob","FPS: 99"]
Need to look at the next index
If Mr-Bob matches MR-bob
replaces the FPS: with the current FPS
But any references I make are always back to Clientmsg
which never has a "stored" previous value
the only way I can think of doing this is using an array.
guys I have a new question
is there a way to make an enemy sit down but let him get up if he feels the need to? (If he hears shots, sees an enemy, etc.)
in other words, when his behavior changes from safe to combat/aware
@tough abyss Did you just say C is the closest to SQF?
Also can you elaborate on your question
I.e context
@loud python _unit playAction "SitDown";
not sure when they get up though, I don't deal with AI
@dusk sage Same problem as yesterday.
Clientmsg - [
["Player: Mr-Bob","FPS: 99"],
["Player: Mr-catman","FPS: 79"]
];
Problem is finding the entry of the player
then looking ahead, to say does the FPS match, or not?
If it does, don't do anything
if it changed then updated it with the most recent record.
Only problem is my array is double nested.
so I need to retrive the entry, then look inside that entry for players name then look at FPS entry.
IF it matches do nothing
if it matches remove that record and update it.
So I need to know the current record
and previous record
Check if they are equal
but having the variable simply recieving the msg is not enough. I need a way to store the previous and compare it to the current @dusk sage
So I already know my requirements
Like I said yesterday, you should look at the array search method I sent you @tough abyss
Your previous value is already in the array, everything you need is there
If you know the index of the array, you can check the value as need be
Wierd question why havn't they made a new varient of find that allows for searching an array in an array?
I mean, a scripted implementation is trivial, is there truly a need?
Then again, there is dozens of useless or unneeded commands
I just thought having it engine native might? Make it faster?
Of course
much like deleteAt deleteRange ?
ohhhh.
I now realise what function you wrote.
Linear search.
Yes at the top of the hastebin
yeah I copied it.
If will return the parent index
Can't get any simpler
Adding anything more would be unneeded
I was trying to do some overly complicated way.
The hastebin should have contained the exact implementation you wanted
If you only want to update if the FPS has changed, just check the first index of the found array
Yeh, as I wrote
And if they weren't found, pushBack their new array
are inline functions worse or better than Functions-as-files?
I changed the method after first sending it, so make sure it was a forEach, not count
You must understand that 'functions as files' just end up as code within a variable
Albeit, compileFinal'd with some header inserted
But it hasn't answer the other question
What is the best way to compare 2 values?
2 different values?
feed them to an array?
One the changes compared to another.
PV_array = [1,0];
then that PV changes
and is recieved by PVEH
I was having trouble simply being able to compare a time dependent variable.
That PV changes?
I couldn't do this. Such as assigning a _temp = (PV_array select 0);
You know the new values from the PVEH args
then doing an _temp isEqualTo (PV_array select 0)
The old values are in the array
Using the hastebin I sent you before
You'd do something like
if !(_newFPS isEqualTo (clientFPS select _index select 1)) then {use set}
Where would you assign _newFPS?
Yeah you just answered my question.
The only way to keep track of previous values
is to use an array correct?
@dusk sage
Well if you want to store both their name and FPS, then an array is preferable
Doing _name = rebind to other variable doesn't work
One of the key differences with an actual programming language
You've lost me there
1 number or variable object is not the same as another.
๐ค ?
Unless you explicitly made it so.
It's got to do with memory locations and object declarations
I'll give an example.
nvm I was wrong.
>>> id(name)
1663710992
>>> id(othername)
1663710992
>>> id(1)
1663710992
>>> id(1)
1663710992
>>> id(2)
1663711008
>>> id("1")
19452640
>>> id("1")
19452640
ID's referencing memory addresses
What is this in sorry?
Python
But back to my original statement
The thing I needed to keep track of previous and current values was an array.
So this.
find_index = {
params["_toFind", "_array"];
private _ret = -1;
{
if (_toFind in _x) exitWith {
_ret = _forEachIndex;
};
} forEach _array;
_ret;
};
Pythons id() doesn't given you a memory address
Yeah it does
99% sure it doesn't
Yes if you read what every comment says
It tells you it is not a memory address
It is just int that's guaranteed to be unique
Ah I see only applies to small ints
then breakout the loops. when you find the index.
I am still going to get myself a data-structures and algorithms book
Algorithms start to get really icky in certain languages ๐
Doesn't surprise me.
Are you experienced in any languages?
It's why they reduce it to Discrete math.
No.
I've tinkered with Python,
C
C++
C#
Oh god
That isn't a good mix to keep switching between ๐
Not sure which one I should stick with?
@tough abyss I made a system for remoteExec by name. Better than the concept I came up with. .
@meager granite that works exactly as I want it to, thanks ๐
any idea what's wrong with (behavior this != "SAFE")?
because apparently that is missing a )
oh, okay
thanks xD
damn, even GCC gives more meaningful error messages =/
๐ญ
0 = [] spawn {while (behaviour this == "SAFE") {sleep 1}; hint "Asset Activated";};
What have I done wrong this time?
0 = [] spawn #{while (behaviour this == ... missing ;
while { code } do { code }
thanks
dealing with AI is annoying...
can I use selectWeapon to have an enemy switch to his handgun or is there a better way?
Did anyone find out a way to log the "ENDMISSION" for combatloggers?
damn, even GCC gives more meaningful error messages =/
Nailed it @loud python
@steel mantle I just use a script to block the menu, log it, save their data, then ban / kick them xD
Is there a way to make a RscButton have a picture background?
Not that I'm aware of
@steel mantle Stick this in initPlayerLocal https://hastebin.com/ruzuwiwali.cpp
You can just block it through that
so the key wont actually work at all
so @cerulean whale how are you banning them then from in-game? ๐คฃ
I have it setup for a 24h ban if the spam it xD
It's a DB thing
I do all whitelisting / bans through DB, unless they are for hackers and the like, then I use RCON
but you can't initialise if you're banned
k
im sure its better to ban people for using something that is just easy to block so you wont loose players, good thinking!
Lol, It's only if they spam it
haha
they get warnings
and It's blocked anysway
im sure its great to even let them spam it
Because I've seen people get around keyDown handlers that block something
Any way to detect setDamage with an eventHandler? Doesn't seem possible, but you guys might have some ideas
damage player?
can you elaborate a bit on that?
what you actually want to do? @stoic sphinx
well you COULD periodically check for the players health, but that would be quite a hack
Or just take note of when you use setDamage
@rotund cypress I'm trying to detect when a zombie hits a player. The zombie uses setDamage to hurt the player
Its fine now, I've used AnimChanged
If you coded the setDamage, you always know when setDamage has been used
Does anyone know what the difference is between RscListNBox and RscListBox?
@stoic sphinx another way would be to modify whatever script calls setDamage, but that might come with it's own set of problems. Maybe you could contact the author of that script and ask them to add hook to let you run some aditional code? (I am assuming it's not your own code, otherwise you could obviously just add your code after the setDamage)
Wrecked
@rotund cypress @cerulean whale Thanks allot ๐
Thanks guys
I saw that scriptname could be used in dialogs aswell, but I cant find any information on it. I can only find coverage on scriptName command in SQF
What is it used for?
spawn handles?
_handle = [] spawn xxx;
So you mean I could name the dialog "dialog"
and then open the dialog through [] spawn dialog; ?
Where did you read it could be used in dialogs?
And no, you can't load the dialog like that, it's not an SQF file
I've seen both scriptPath = ""; and scriptName = "";
In dialogs before
I'm pretty sure I saw it when I looked through Bohemias code
I know it can be used for scripts
xD
Think you're confusing things
Unless you have an example of this
re scriptPath, see https://community.bistudio.com/wiki/Script_Path
class Display3DENTutorial: DisplaySimulated
{
idd = 318;
scriptName = "Display3DENTutorial";
scriptPath = "3DENDisplays";
^^^
Sort of
Well I know where it's used, I just don't know if it has a practical purpose
๐
BIS_fnc_initDisplays uses both of them
Yeah it's not something people need to concern themselves over, it's just part of how BIS does their dialogs
What is it used for though, if you know? @native hemlock
if (cheatsenabled) then {
_scriptName = _class;
_scriptPath = _path;
uinamespace setvariable [
_scriptName + "_script",
compileFinal (
format [
"scriptname '%1'; _fnc_scriptName = '%1';",
_scriptName
]
+
preprocessfilelinenumbers format ["%1%2.sqf",gettext (configfile >> "cfgScriptPaths" >> _scriptPath),_scriptName]
)
];
};```
Does it have to do with that?
To get the scriptname from the dialog and the like turn it into whatever + _fnc_scriptName?
Something like that. I don't fully understand it, but BIS_fnc_initDisplays compiles UI scripts that aren't listed in CfgFunctions and saves them to UI namespace. It also adds a header to the files like CfgFunctions automatically does that sets the scriptName of the file.
Oh ok I see
commy probably knows
I mean
If you look at it
It's nothing unfamiliar
It's doing as you said, CfgFunc headers
Then is grabbing the path from a config
Yeah cfgScriptPaths
So it would really be the same as CfgFunctions
But a different way
And I think they use it because then it's faster to load all controls
Because everything is loaded on mission startup once
And then everything is already loaded when you need to open it
So it's a tiny bit faster
IIRC
is there a CLI way for me to connect to an Arma3 server while the game is running ?
Basically a way like steam://connect=<IP> that works? Since that method apparently only works for Valve owned games like CS:GO but not for Arma 3 ๐ฆ
or should I rather ask that question in #arma3_questions ?
You can do a similar thing at @summer valve I can't remember it though, it's been ages since I saw something that did it
@cerulean whale I spent some time looking around but neither the steam documentation nor the community wiki was helpful :/ Do you remember which program used that similar method?
Is there a limit to how many scripts can be execVM'd at the same time?
nevermind, was encountering issues with call functions taking forever due to a packed init
@nocturne iron Just spawn a VM script every 0.5 second
s inside scheduled environment and watch the FPS
and count(diag_activeSQFScripts);
Anyone know how to make a button have a picture as the background? I've been messing around with it all day but to no avail
Is there a way to disable group images for arma xml groups or whatever they're called? Like the images that shows up on clothing and vehicles.
MaxCustomFileSize = 0;? @rotund cypress
Not quite sure, but that should work
But may kick people
Anyone know if the flyInHeightASL command is bugged again with loiter type waypoints? I know after the intial implementation it was bugged for loiter type waypoints (the main time you would wanna use it) and they had fixed it but it seems to be bugged again in my mission.
@summer valve It should work, both game and Launcher handles this. The exact form is this: steam://connect/<IP>:<GamePort+1>
@summer valve The trick with this steam protocol command is that you have to specify the server exactly, because Steam have to look it up to first to determine what game it is and then start that game. The other thing is that it will obviously work only for the games that are available through Steam server browser (so it won't work for LAN), otherwise Steam can't determine what game it is. And please note that the port you have to specify is not the game port, but the Steam port (which is always game port + 1).
Actually looks like flyInHeightASL is just straight up broken now, with the Yabon's at least.
use BIS_fnc_Flyby watch your ambient plane crash into the ground if the height isn't > 400M
Watch what happens
Man that was a pretty sweet month or 2 there where UAVs were actually usable from a mission makers perspective.
@tough abyss I usually do that but I am doing a complicated show / hide system. I will juat add a show / hide thing to picture as well
hmm @tough abyss I may still need your hand. Let's say the server IP is 91.121.245.93:2302.
If I run steam://connect/91.121.245.93:2303 the server information is getting displayed correctly, but the game is also trying to use port 2303 to connect which obviously fails (-> Connecting failed.)
Running steam://connect/91.121.245.93:2302 won't retrieve the steam server information as you said
commy probably knows
: )
@dusk sage I only want to limit it for a certain faction, not for everybody
Yes, @little eagle! Do you know why BI uses functions like BIS_fnc_initDisplays and scriptname and scriptpath in all their displays?
To execute some additional SQF that runs for the display
it's their framework
unfortunately not usable by modders, since the folder paths are hard coded to BI pbos
CBA has displayLoad event handler for all of them though
@little eagle But you can use onLoad and unLoad eventHandler?
yes
"Local" EventHandler work with units?
Does anybody know if there's an event handler or some other sort of hook to execute code when a slingloaded vehicle is released? (for example, to add a parachute)
RopeBreak EH?
that would trigger with any rope, wouldn't it?
so it could lead to problems with mods that use ropes
yeah, possibly
"Triggered when a rope is detached from an object.
In the case of sling loading, this event handler must be assigned to the helicopter and will trigger for each detached rope. "
in that case it's just a workaround for what I want
it would work, but could lead to problems with mods, which is undesireable
I personally use the ropeAttach in order to check if a vehicle is in the list of whitelisted vehicles to slingload, but as greenfist ropeDetach or whatever its called should work fine.
What is it that you want to do?
by the way, are there no global hooks other than the few .sqf files you can add? like, an event handler for any sling load release, not just for a certain vehicle
You can add it to a vehicle when it's spawned
@rotund cypress I want to add a parachute when releasing a slingloaded vehicle from above a certain height
How are you spawning these vehicles because the EVH can be attached then.
pretty much like when dropping a loaded vehicle from a blackfish
the event handler has a flaw though, that it triggers for all ropes, even if it has nothing to do with slingloading
What other ropes is there than Slingloading ropes?
for example, what if some mod decided to use ropes to simulate refueling?
not sure if that will ever happen, but that's not the kind of unsafe code I want my missions to have
Well you can make some checks
let's assume there's a few more mods: slingloading for blackfish, air refueling and either as a mod or as a script in the mission file the parachute thing
I'm guessing you are making a Wasteland similar feature to airdrop. Then you can just make a variable when it is starting and then if that variable is false on ropeDetach then you dont add a parachute in the EVH
if the blackfish now attempts to refuel, upon releasing it would suddenly be attached to a parachute
Not if you set a variable
And only to add that parachute when that variable equals to true
what if you're refueling while slingloading something? xD
Look, I know it's fairly safe code
I just don't like it
it goes against my coding phylosophy to write ode that "probably won't cause any problems"
I agree with what you say there, but I'm out of options then I'm afraid. Are you certain that it could be done at the same time? Why don't you make a check to see if its slingloading and then you'll just make it unable to fuel at the same time.
Problem solved then.
Otherwise I don't see any other option really.
That was just an example, I'm not actually dealing with any mod of that kind
but it illustrates the problem I have with that workaround
there might be other similar situations that I'm not even considering right now
Well, you will burn yourself out if you sit and think of 100 different ways it could fail. I mean, it's good but you can't catch them all in some situations.
I will probablt end up just using the ropeBreak event handler, but I will need to take a shower after implementing that because of how dirty I will feel
OMG, LMFAO
It's so lovely to see some people think like that and really think about beautiful code, but how some people who just blazantly write dirty and shit code without giving a f***
I bet arma 3 would have less memory leak problems if no dev ever thought "This isn't technically 100% safe but I bet it won't ever actually cause problems"
Probably
Question, easiest way to detect if player has entered a firefight? Either shooting or getting shot at?
with AI I'd say check the behaviour
don't think that works with players though (probably not)
will firedNear detect being shot at from 1km from a sniper though?
or from 500m from an HMG
Not necessarily I believe.
or a tank, or artillery, etc.
that's the thing, it could either be the bullet passing by the object, or being fired near the object
But it is mostly for triggering some ambient noise during a mission (intense music playing...) lol
that would make quite a significant difference
then maybe use a detected by trigger?
Intense music won't need to play when they are getting sniped at, but more a high pace, close encounter
pfff... I had this great idea of calculating shots per second that are passing the player, building an average over a minute or so and choosing the music based on that
then I remembered: sqf
yeah such a feature would have to be coded into the engine to work
hey, there's another task for BIS
make a combat intensity variable/function
_intensity = [] call BIS_fnc_firefightIntensity;
and maybe a combat distance one as well
diag_log format [%1, _intensity];
IT'S OVER 9000!!!!!
possibly throw in some more data like What side is the unit fighting against, are they using silencers, etc.
Yep
I guess I should write all this stuff down and make a megathread on the forum xD
haha
in fact, I am doing that right now xD
๐
Don't forget to leave a message on the post so other people see you agree ๐
Does anyone know if there is built in functionality to color terrain squares on the map?
I haev seen a lot of missions and official screenshots using it, but I only managed to do it manually by creatin markers and moving them into position.
Is there automated functions for that?
Hey guys, I'm trying to create a camera over this position _cam = "camera" camCreate [ 0, 0, 0 ]; _cam camSetTarget [ 3770.76, 12796.1, 300 ]; _cam camSetRelPos [ 3770.76, 12796.1, 300 ]; _cam cameraEffect [ "Internal", "Back" ]; _cam camCommit 0;
Although it's not creating it at that position
Thanks garrett.
This made it for me
_cam = "camera" camCreate [ 3770.76, 12796.1, 100 ];
_cam cameraEffect [ "Internal", "Back" ];
_cam camCommit 0;
It sets it relative to the target
Although it doesn't set it to the point I want
So if you want it 10m to the N of the target, do camSetRelPos [ 0, 10, 0 ];
I mean it's not pointing towards the direction I want it to point
What you are doing is setting the pos to say [10, 10, 10]
If you set relative pos to [10, 10, 10]
Your final position will be [20, 20, 20]
Get it?
Kinda, but it's not pointing towards the direction I want it to point at
How do I solve that?
_cam camSetTarget player;
_cam camSetRelPos [0, 0.5, 1.5];
_cam cameraEffect ["internal", "back"];
_cam camCommit 1;
player setRandomLip true;```
Example code
Okey, how do I define pitch and direction though?
Is there a way I can block a dialog from being closed with escape without making it a title resource?
I have an array in an .hpp file. I want to try and generate a random number between x,y (math.random basicaly) how would i do so within the HPP file
You can.
But it still requires SQF
arma 3's new random syntax will allow you to do that.
Which has been integrated into BIS_fnc_randomNum;
@tough abyss
[firstnumber,lastnumber] call BIS_fnc_randomNum;
Oh wow.
there is an actual SQF syntax highlighter in this discord....
danke
@tough abyss how do you do it? with `?
3 backticks the sqf `
Hang on
Wonder if there is a way to escape them
\` sqf
Grr....
```sqf ```
[1,1337] call BIS_fnc_randomNum;```
O
Yep
Just as a reference for anyone
A single backtick first
then space and another space
escapes the backticks embedded
sqf
The first space and backticks escapes the code.
@dusk sage You've converted me
I love ATOM editor
It's syntax highlighting is easy on the eyes.
@tough abyss AMIRIGHT!!!
What did you use before?
I mean, that is so beautiful https://gyazo.com/f93b5d52e923fbb88229dbe51c115c92
I mean, Atom is life, Atom is love
When I switched over when it came out, I was instantly in love.
I used to use Sublime Text 2 / Poseidon
Is it still updated by the ACE team?
Nah you can use C++ syntax hightlighting for logs.
If I knew how to I'd write my own syntax highlighter for RPT syntax
Must have packages
custom-title
file-header
file-icons
file-types
git-plus
language-arma-atom
minimap
pigments
project-manager
That is not what I'm talking about, but RPTs will load shit slow in Atom
Been through the settings to find out why?
No
Just probably because Atom has some memory leaks and is generally slow at opening things
And RPTs are big
Which Atom can't handle
How long did it take?
Try opening mission.sqm and see how long it takes
Some caching method or memory access control
And also, reading RPTs is better with SQF SH then C++ SH
Yeah Atom can be really slow to open large logs (200k+ lines), and sometimes will just fail
I use NPP for RPTs, but will look into that link you just sent
Looks neat
@dusk sage scratch that it's deprecated.
I'm making my own Syntax highlighter for NPP for RPT
Hmmm
@rotund cypress I can recreate Atoms tidy syntax highlighting using N++
Welp I've hacked together my own syntax highlighter
High command
I believe.
@tough abyss https://community.bistudio.com/wiki/High_Command
how do i get a list of all locations on a map?
or all locations of a type
there is nearestlocations but i want all cities and villages
hey does anyone know if i can force a interaction key in ACE3 ?
(as a sidenote, ACE3 while not on Discord, is on Slack, they can almost assuredly answer if nobody speaks up here) ๐
okay again thanks ๐
np ๐
@dusk sage What do you thinkof my syntax highlighter?
Closely emulated Atom editor
With a few differences.
@dusk sage Do you know how to get the styler in Notepad++ to match part of a word?
Does it support RegEx parsing?
would'nt it be effiecent if you just spawned the ai then set their gear?
@hasty violet Define dynamic scripts?
Hey! Just checking if anyone has found a way to disable right mouse button input and override it with a scripted action?
Oh god...
I hate DAC
yes there is, write your own library.
Use markers
Make mission devs use markers to initialise AI
It's what I did for our community.
Does it support RegEx parsing?
No idea sorry @tough abyss
I didn't realise DAC was still around
Making Zeus listen for the marker name
and spawn the AI dependent on the marker type
"Yummy" more like performance hogging.
I&A removed DAC for a reason.
bohemia build in core functions actually do.
BIS_fnc_spawnGroup
BIS_fnc_spawnUnit etc.
Fairly rudimentary.
No.
But AI caching you can do in the editor
using simulation manager.
or you can use ai_cache script
We just use ALIVE
And hook alive and profile a group from BIS_fnc_spawnGroup
@ALIVE can handle headless clients etc.
And the reason DAC has an issue
with HC's is because it's so monolithic.
and so dense, improving performance by replacing old code systems with new is a headache.
Been there tried that.
I just said to our community nope.
No more.
@young current Yes I managed to override it
Without usinganymods
You need to use:
(findDisplay 46) displayAddEventHandler ["MouseButtonDown", "_this execVM 'client\player\interact\hunter_mouseclick.sqf'"];```
this way I was able to block any weapon fire input for my hunter when he is disguised
the event handler also has a value for which mouse button
Is there a way to make a HMG shoot at a specific location?
https://community.bistudio.com/wiki/doSuppressiveFire
takes a position
Fixed: Next target action would cycle only through enemy vehicles
Added: A new "Deleted" Event Handler
Tweaked: Vehicles without waypoints should no longer start their engines in the beginning of scenarios
wow these some are quite old issues and wishes
seems like @lavish ocean was heard after all ๐
can AI run out of ammo and how can I give a HMG infinite ammo?
they can, just use setAmmo every once in a while
new in dev
b:GROUP deletegroupwhenempty BOOL
b:OBJECT setfeaturetype SCALAR
u:creategroup ARRAY,SIDE (was just side)
u:isgroupdeletedwhenempty GROUP
@finite mica I've been experimenting with this waituntil {!isnull (finddisplay 46)}; _WalkerGunControl = (findDisplay 46) displayAddEventHandler ["MouseButtonDown","_this select 1 call WalkerGunnerControls_Fnc;false;"]; But it does not override the default action, at least no when in vehicle. I received a hacky workaround for left button disabling, but right button still does both the binded action and what my function does.
It seems pretty much the same as yours but can't disable the binded action.
How can I prevent a snippet in initPlayerLocal from running on JIP players?
Oh wait... Didn't check the parameters... [player:Object, didJIP:Boolean]
hey guys, sice i didnt get any response in animation_makers I will try my luck here. Anyone who knows how to write config for animations ? I got something, but can't make it working. Probably needs just a quick fix.
@regal ore #arma3_animation is the relevant thread, people just seem to be in the middle of something..
Anyone knows why this doesn't work in initPlayerLocal:
if ((_this select 1) == true) exitWith {hint "YOU ARE JIP"};
whats the _this thing?
is it a numerical var?
perhaps try a == 1
I usually dont trust the bool in arma, I always use 1 and 0
does it spit out an error?
related to params?
//missing param error in editor can be safely ignored. Does not appear in MP
if (isMultiplayer) then {
0 setFog [((paramsArray select 3)), 0.1, 0];
};
in my mission I had to bracket this because it would report params error
Hmm.
error type bool
it does not like your bool it appears
or that variable does not really exist yet
try running this code in the developer console after the mission is fully loaded, perhaps that helps
I has to be run from initPlayerLocal for the params though.
And I'd assume the params should exist when it initialises.
all I know is that in that stuff I pasted, in my own initplayer, these params throw an error
but only in editor
I'll make some tests on a proper server.
Might be editor exclusive error as you're saying.
or just test in MP in editor
you can swithc in what mode it does that
and for me any params error usually disappears in mp
cannot compare against a bool just use if ( _this select 0 ) exitwith {...
reminds me of one funny piece of code i once saw in java if (x == true) {return true;} else {return false;} ๐
in SP you can simply define params array yourself at the beginning, load it with default values or whatever you like
I'll try that SaNiC.
[this, "HitRightHand", 0.5, false] call fnc_setHitPointDamage; anyone knows why it doesn't work?
Nobody knows what fnc_setHitPointDamage is
Doesn't that function just set damage to a body part?
who knows
It's not something from the base game. It would have a less shitty name in that case
yea, true
HitRightHand isn't even a hitpoint in soldiers
Maybe RHS hitpoint?
idk
Creates (or returns if it already exists) trigger with size of map
because articles are overrated
(not talking about fnc_setHitPointDamage)
@left helm Incorrect.
Booleans can now be compared
True isEqualTo False
It can compare Arrays, Scripts and Booleans (alive player isEqualTo true)
Also for people who don't know
May want to try the proper case sensative version to ping him
Seems there are two of us
```sqf ``` to display syntax highlighting in SQF
@thick lintel
Sorry Sanic.
Meh no worries was just mildly confused for a moment
Yeah sadly the memeification of this name has caused all sorts of weirdness for me on that.
Matches Sanic or SaNiC ? Who do you want then gives you a choice?
Well the second one is the guy who was talking in here. I pinged him already though.
Hey guys, can anyone help me figure out how to return an array of sector names?
Parameter(s):
0: BOOL
Returns:
ARRAY of OBJECTs```
That seems to be the function where it is done, but I can't figure out how to write the string that gives me the array properly
@burnt gale Do you want a specific side?
_arrayOfObjects = [true] call BIS_fnc_moduleSector;
oh I think that might work, thank you
@tough abyss Indeed, finally a proper binary comparison ๐
what would be the quickest way to make sure a certain player is not on
i suppose i can do getPlayerUid and check if it is not equal to the player uid i have. but where would i go after that
(ran server side)
well
if the player is online (need a possible way to detect if the player is online so why not UID)
then i need it to not execute certain code
so
{ getPlayerUID _x isEqualTo "SomeNumber" then { do nothing } else {kick (this select 0)}; } forEach allPlayers;```
but im not sure how to make it not do something (new to the sqf life)
You can just leave it blank
if !(player here) then { all code }
no need for an else if only one case gives results
! makes true false and false true
this would work then { if!(getPlayerUID _x isEqualTo "SomeNumber") then { kick (this select 0) }; } forEach allPlayers;
kick is also not a valid SQF command, youd need the serverCommand thing
also what is this select 0, normally this only exists where it is a sngle object
in the init field in the editor
^ the default code is kick (this select 0) which works
my issue is i dont want people to be kicked when a certain player is on
so i need a way to make sure this player isnt on then it can kick
this select 0 kicks via slot
Are you trying to run this from onUserConnected in the server.cfg?
onDifferentData
I don't think you can use normal scripting commands from there
damn
Does anyone know any way i could attempt this. Would hate to turn of verify signatures for such a thing
Hey guys having a lil scrip problem here, I want to set the default ownership of ModuleSector_F using the following lines class CfgSectorPath {
class path_0 {
class sector_14 : sector {
dependency[] = {"base_west","sector_13"};
designator = "A";
here
class CfgSectorPath {
class path_0 {
class sector_14 : sector {
dependency[] = {"base_west","sector_13"};
designator = "A";
would it be using this?
//--- Set side
if (typename _units == typename sideunknown) exitwith {
_logic setvariable ["owner",_units,true];
true
};
if so, what do I replace in there to set it to a specific faction?
NVM I figured it out
@tough abyss Thanks!
What is the best way to create an entry point for your mods scripts while starting a dedicated server? This means the scripts must run just after you startup the dedicated server, not during the mission. I want preferably a non-hacky way of initializing resources via a dll, such resources are too expensive to instance everytime a mission starts.
i have some compiled functions in my code, i want to dynamically create a call on this functions. _compiledfunc = str format["create%1",_selectedgroup]; [_group, _pos, _nbUnits, _radius] call _compiledfunc; how do i get the string _compiledfunc treated as the global variable the functions reside in?
sorry for my bad english - i maybe use the wrong terms to describe what i try to do.
missionnamespace getvariable is also not working - i miss something here _selectedgroup = hexGroup; _compiledfunc = {missionnamespace getvariable (str format["create%1",_selectedgroup])}; [_group, _pos, _nbUnits, _radius] call _compiledfunc;
what is working is if i write createhexGroup instead of _compiledfunc; directly
i think you want call compile format
mhm - if i'm not completely wrong call compile format will not help here. i don't format the code here. i want to format the global variable name which holds the function and call this global variable.
@tough abyss CfgFunctions with preStart = 1; (not preInit) or alternatively CBA preStart XEH.
oh thanks commy
ok - i solved my problem - was an issue with parenthesis and object types
How do I create a waypoint for a unit that was created using createVehicle?
[_group, _pos, _nbUnits, _radius] call (missionnamespace getvariable format["create%1",_selectedgroup]);
worked
ModParams - Undefined or empty mod directory
what is Arma trying to say?
I get this times 13
Hey commy2, your solution is working great, but I get this seemingly benign set of errors:
"0:16:45 Error in expression <",_x] call bis_fnc_logFormat;
_function = [] call (uinamespace getvariable _x);
0:16:45 Error position: <= [] call (uinamespace getvariable _x);
0:16:45 Error Generic error in expression
0:16:45 File A3\functions_f\initFunctions.sqf, line 490"
Nothing out of the ordinary, and script entry is succesfully run. No crashes either.
that is what I was worried about
I don't know why that would happen though. Sure you're not on dev for 64 bit or something?
nope, I will fiddle around