#arma3_scripting
1 messages ยท Page 287 of 1
alright, I'm following
Also why do you publicVariable these lists?
publicVariable "BluforPlayers";
publicVariable "OpforPlayers";
Do clients need to have them?
no
BluforPlayers = [];
{
if(side _x == west) then
{
if(alive _x) then
{
BluforPlayers pushBack _x;
};
};
}forEach allUnits;
can be just
BluforPlayers = allUnits select {side group _x == blufor};
I thought I would at least need OpforPlayers to use it in fn_spawnEnemies
Where do you call spawnEnemies from?
choosEnemies
and this was originally because, I didn't know switch case could return
should use side group _x, so his system doesn't get shafted by friendly fire units dying.
it is already?
No you don't need OpforPlayers in spawnEnemies
side OBJECT is weird. side GROUP does what you'd expect
@little eagle
BluforPlayers = allUnits select {side group _x == east};
all set fam
That Killed event handler will not call when you execute spawnEnemies, only when they will actually die
Which will happen after you'll have OpforPlayers setup later in getUnits
And since its all going on in server you don't need to public variable anything, its just global array
I can combine the chooseEnemy and spawnEnemy now that switch returns the classname right?
I'd even go as far as putting it all right into getUnits
since you're not calling these functions from anywhere else anyway
gonna need some spacers
okay so got this in
private ["_bluforUnit","_classname","_LowerClassname","_caseResult","_markerPos","_newUnit"];
_bluforUnit = _this;
_LowerClassname = (toLower (typeOf (_this)));
private _caseResult = switch (_LowerClassname) do {
case "b_officer_f": {"O_Soldier_SL_F"};
case "b_soldier_sl_f": {"O_Soldier_SL_F"};
case "b_soldier_tl_f": {"O_Soldier_TL_F"};
case "b_soldier_uav_f": {"O_Soldier_UAV_F"};
case "b_medic_f": {"O_Medic_F"};
case "b_soldier_ar_f": {"O_Soldier_AR_F"};
case "b_soldier_aar_f": {"O_Soldier_AAR_F"};
case "b_soldier_gl_f": {"O_Soldier_GL_F"};
case "b_soldier_m_f": {"O_Soldier_M_F"};
case "b_soldier_lite_f": {"O_Soldier_lite_F"};
default { hint "Classname not valid"; "" };
};
if (_caseResult isEqualTo "") exitWith {};
_markerPos = getMarkerPos "Opfor_Start";
_newUnit = group OpGrpLead createUnit [_caseResult, getMarkerPos "opfor_start", [], 0, "NONE"];
_newUnit disableAI "MOVE";
[_newUnit] call missionStarter_fnc_loadoutApply;
if (MissionActive) then
{
_newUnit addMPEventHandler ["MPKilled", {if(isServer) then {OpforPlayers call missionStarter_fnc_remainOpfor}}];
};
zMod1 addCuratorEditableObjects [[_newUnit],true ];
zMod2 addCuratorEditableObjects [[_newUnit],true ];
zMod3 addCuratorEditableObjects [[_newUnit],true ];
Any code block can return btw
chooseEnemies
so now I put this in the forEach loop in getUnits
yes
and I gotta declare the private variables outside
which ones?
private ["_bluforUnit","_classname","_LowerClassname","_caseResult","_markerPos","_newUnit"];
Its alright, yes
Since recent Arma 3 versions you can private variables right in assignment
private _bluforUnit = _this;
oh you already had it for case result
Well either way works
(Though you don't really need to private anything in your case but lets not get into that for now)
?
BLUFOR loadouts need to be declared as functions to be remoteExec'ed to remote players
right right, so now that we've cut down on two files completely
BluforPlayers = allUnits select {side group _x == east};
Just noticed that in your comment to commy
east, not west\blufor
oops
Also if you read into vehicle creator I'm going to rewrite that with case statements anyway so no need ot look at it now
The only way to switch to a camCreate'd camera is using cameraEffect?
@meager granite ? You know?
Poor Sa-Matra needs a break
@tough abyss yes
Thanks!
the.... fuck?
the script remainingOpfor.sqf not found
this on the server log
dedicated server btw
I'm going to have a wild guess
and I searched my files there is nothing that calls this
CfgFunctions?
just remainOpfor
unless it's in the cache?
could that be?
nope, it still is coming up
whaaaat the fuck
are you sure you're not calling it as something like execVM "remainingOpfor.sqf" somewhere?
I just searched the mission directory, nowhere does it reference remain..... . sqf anywhere
whether it was remaining, remain, remainder, no such call for a file like that is found
oh fml
wrong version
how the heck did that happen
getUnits
BluforPlayers = allUnits select {side group _x == blufor};
{
_x remoteExecCall ["missionStarter_fnc_loadoutApply",_x];
if (MissionActive) then
{
_x addMPEventHandler ["MPKilled", {if(isServer) then {BluforPlayers call missionStarter_fnc_remainBlufor}}];
};
} forEach BluforPlayers;
goes to loadoutApply
_classname = toLower (typeOf _this);
//Blufor functions
hint "finding loadout";
systemChat "finding loadout";
switch (_classname) do {
case "b_officer_f": {[_x] call blu_fnc_squadLead;};
case "b_soldier_sl_f": {[_x] call blu_fnc_squadLead;};
case "b_soldier_tl_f": {[_x] call blu_fnc_teamLead;};
case "b_soldier_uav_f": {[_x] call blu_fnc_uavOp;};
case "b_medic_f": {[_x] call blu_fnc_medic;};
case "b_soldier_ar_f": {[_x] call blu_fnc_autoRifleman;};
case "b_soldier_aar_f": {[_x] call blu_fnc_asstAutoRifleman;};
case "b_soldier_gl_f": {[_x] call blu_fnc_grenadier;};
case "b_soldier_m_f": {[_x] call blu_fnc_marksman;};
case "b_soldier_lite_f": {[_x] call blu_fnc_scout;};
default { hint "Classname not valid" };
};
hint "loadout found";
systemChat "loadout found";
It keeps going to the default for some reason and all three messages are output so it's definately going through the scripts and no errors.
what is _x in loadoutApply?
you've put _x
obviously I need to not look at this code for a while
thanks buddy
it doesn't quite answer why it didn't find teh classname though
b_officer_f
when I manually did
Leader_1 remoteExecCall ["missionStarter_fnc_loadoutApply",Leader_1];
it worked
so it must not be getting called correctly if the function itself works now
BluforPlayers = allUnits select {side group _x == blufor};
this is the array that gets the units, maybe something is wrong here
independent
@GermanMason Mind you since a3 theres blufor opfor and independent too
As to why? Well in the past the independent faction was mostly a guerilla resistance faction.
Well nvm then I didnt know that
Also not why its called like that but why its not always referenced as guer or always referenced as resistance
Bohemia has had its inconsistencies in the past hehe
Maybe the string version as guer to match the other 4 letter words west and east...maybe they wanted it short like that
"RESIS" doesn't sound that nice
Idk man. BIS :p
Lol what? independant?
Independant is convenient when you're using side based scripts
good morning, and back to code
and nevermind that stuff up there, I got it working this morning
independent and resistance are scripting commands returning side data type
doesn't matter how you call them, nothing changed since OFPR
Anyone know why I can't load into lobby and RPT is saying: ExtDB3: Locked?
anyone?
never seen it before
I checked some of my own RPTs and it wasn't there
the only kind of lock that I could relate to getting into a lobby would be locking the server
Ye, I don't think ti's that
but I just can't get in
I see the 'group chat' thing show up
but I can't hjoin
can you login admin?
if you can see the chat you can login
so yeah I'm getting that too right now on my local dedicated server
I think something is going on elsewhere (see #arma3_troubleshooting)
all I want to do is troubleshoot and connect to my server, so I can troubleshoot a completely different problem -_-
Hey guys, this is probably a super stupid question but any reason why this doesn't work? ```SQF
_veh = vehicle player;
if (_veh getVariable ["Variable",false]) then {};
Mayby you shouldnt call the variable "variable", also there is nothing that happens if that is true
never a stupid question
What's not working? Throwing scripting errors?
only stupid answers
Im kinda confused as to what that is supposed to do because "then {};"
Sorry I wasn't clear, there aren't any script errors just it's not doing the stuff that is in the if statement if the variable is false
thats...
Because there is no code to execute after "then"
No, there is code, just that's not what im trying to figure out
Also, the if condition has to be true not false. Just in case that wasn't clear.
So how would i try and find if the variable was false?
Go into the debug console and check what getvariable returns
WITHOUT the "default" value
if !(_veh getVariable "VARNAME") then {};
It's called boolean logic: https://community.bistudio.com/wiki/!_a
that ! at the start will invert the logic so you can test if something in false (turning it into a TRUE and passing the if check)
omg i'm a bloody idiot, hahaah I'm sorry for wasteing all of you guy's time, 1am coding is the best haha
not used to staying up this late
Thanks guys
I'm an idiot xD
yw lol
What was it?
Lol
:S
I used to always stay up late before is started with school
cause my sleeping schedule was bad, but now it's not and it's a pain for me to stay up even to midnight
xD
Yep, just tested it was as simple as ! xD
if( !ONE_AM ) then { "It Works" }
If (daytime > 0.5 && daytime < 1.5) then {hint "Warning: Critical time has been reached"};
hehe
I think it is way past the critical stage for me xD
Worst part of staying up late is trying to go to sleep at 2am with code still stuck in your head
Better off not going to sleep... just keep coding.. ๐
What are you making Nicholas?
https://hastebin.com/ziqapubedu.cpp hay guys, my createEnemies function ain't giving the enemies loadouts, can't figure out why
sorry that one has the full getUnits function
but it's clearly spawning all the enemies so I don't think that's an issue
If anyone is trying to profile the performance of their SQF functions, here's a useful script: https://forums.bistudio.com/topic/201730-squeezing-the-absolute-most-performance-out-of-a-script-fsms-cba-state-machines-vs-loops-and-functions/#comment-3150131
The longer you spend talking to the CBA/ACE guys, the more they will tell you to evaluate things every frame, which I believe is good for mod performance but bad for system performance and CPU/FPS.
lol you are an idiot.
His post is basically correct
Some things in arma you can run in scheduled enviroment & you might want it to run slower if arma perfomance degrades. Not everything needs to be run each frame :P
The only issue is if you run multiple addons and aren't aware of how many spawned scheduled code running
If you wanna profile script performance diag_codePerformance is the better route IMO
The thread is literally about how you offload scripts into multiple frames and this dumb one liner reply claims how we would say to evaluate everything in a single frame.
Please don't bother replying if you haven't read everything.
Also there is no difference between "mod performance" and "system performance". That doesn't even make sense. It's just repeated talking points that have nothing to do with the topic.
Technically they could be defined as seperate but when one suffers both suffer
so the affect on both of them is the same exact amount
Which makes the sentence nonsensical. Thank you.
I mean, he's not talking about rendering a video file while running arma
unoptimized because I decided to calculate pi a milion times in my web browser
system performance succ
I did read the post. And i said his post is basically correct. Which it is
If the reply fit the original author post, i really dont care
But there is no need to call him stupid in a discord channel over it.
Just send him a PM or reply in the forum thread
Also he meant about doing something fast code wise at expense of other code running in arma engine.
i.e scheduled versus unscheduled enviroment (age old debate)
edit: No need to nickpick over engine terms, for someone that prob isnt a programmer etc
terms are important
otherwise you run the risk of misleading others and yourself
its not a bad thing to get better at
The longer you talk to fn_quiksilver, the more he will tell you to evaluate things in as many as possible spawn threads, which I believe is good for mod performance but bad for system performance and CPU/FPS.
Doesn't matter if the quote is accurately representing him, he is "basically correct", so shut up.
You got some issues... Anyway back to coding
That is basically what you told me.
Because you didn't even take the time to read the whole thread . Quote: I did read the post.
ยฏ_(ใ)_/ยฏ
No i basically defended him because you called him stupid (were he might not see it), over getting some engine terms mixed up.
When it was age old debate over scheduled vs unscheduled
Anyway if you wanna argue more over it. We take to PM, i prob should done that in the first place
Sorry, but I will continue to call out people that misrepresent me.
over getting some engine terms mixed up
When it was age old debate over scheduled vs unscheduled
Please don't bother replying if you haven't read everything.
I'm gunna shift this topic so hard you'll get whiplash
why cant you just "spawn" the code?
_newUnit = group OpGrpLead createUnit [_this, getMarkerPos "opfor_start", [], 0, "NONE"];
_newUnit call missionStarter_fnc_loadoutApply;
{
_x remoteExecCall ["missionStarter_fnc_loadoutApply",_x];
} forEach BluforPlayers;
excluding the locality of remoteExecCall these two should both work right?
Why would you want to create the enemy on the local machines of the player?
That seems counter intuitive.
remoteExec with _x as target
ya that applies the loadout to the unit
shouldn't _newUnit call missionStarter_fnc_loadoutApply; apply it to _newUnit
or are my arguments wrong
these are two seperate instances of calling the same function
I think it would be smarter to have the missionStarter_fnc_loadoutApply function forward to the local machine instead at the start of the function
isn't that what remoting to _x does?
if (!local _unit) exitWith {
_this remoteExec ["missionStarter_fnc_loadoutApply", _unit];
};
basically at the top of missionStarter_fnc_loadoutApply
That way the function works on every machine.
I was under the impression
{
_x remoteExecCall ["missionStarter_fnc_loadoutApply",_x];
} forEach BluforPlayers;
already send the function local to each player via targeting _x
Yes, but then you need to handle that every time you use that function
for blue and for opfor
with just three lines you make you function work no matter where it was executed
And then you dont have to worry about your other scripts.
it's okay if I leave it redundant though right?
It will leave your remoteExec redundant
because I don't wanna send the loadoutapplication for _x to more than _x
You changed your function from requiring local arguments to accepting remote arguments.
omg
Ok
Why do you remoteExec(Call) missionStarter_fnc_loadoutApply in the first place?
Do you even know why?
because the loadout has some local commands to the unit
Exactly
addWeapon requires a local unit (argument)
And since missionStarter_fnc_loadoutApply relies on addWeapon
missionStarter_fnc_loadoutApply requires a local unit too
It would be preferable if missionStarter_fnc_loadoutApply accepted non local (remote) units, right?
That way you wouldn't need to remoteExec(Call) it every time you try to use it in code.
Right?
do remote units include the server?
The player objects are remote objects for the server machine
I got that much, I was talking about AI
The AI's that belong to the server are remote units on the player machines
sorry
But you shouldn't even worry about AI vs player
missionStarter_fnc_loadoutApply should work for both
and no matter if it was called on the player machine or the server right?
ya
Now imagine this:
ready to use imagination
// missionStarter_fnc_loadoutApply
private _unit = _this select 0;
if (!local _unit) exitWith {
_this remoteExec ["missionStarter_fnc_loadoutApply", _unit];
};
//... proceed to do loadout stuff
Can you imagine what this would do if _unit was a player and if the function was called on the server?
This is why you remoteExecCall isn't it?
the server calls for the client
to run that function
Doesn't matter you can use remoteExecCall too
the server calls for the client
to run that function
Exactly. And that means that your missionStarter_fnc_loadoutApply function now accepts remote units and works just as well as with local units
So you don't need to worry about remoteExec(Call) ever again when using the function.
You made your function accept remote arguments or local arguments when it previously required local arguments.
The argument being the unit to dress up
okay one thing I still get mixed up, the diffrence between _this and _this select 0. if you pass the arguments like [thingy] you use _this select 0 but if you pass it like "thingy" or _thingy, basically just not an array, then it's _this. correct?
[1, "banana"] call {
_this select 0; // 1
_this select 1; // "banana"
_this; // [1, "banana"]
};
so if I did
object remoteExec ["missionStarter_fnc_loadoutApply", _unit];
then I would just use _this to reference "object"?
Yeah.
player call {
_this // player
_this select 0 // error: select needs an array and not an object
};
gotcha
On the other hand...
player call {
_this // player
_this param [0] // player
};
[player] call {
_this // [player]
_this param [0] // player
};
(Instead of _this param [0] one can also write param [0], because while the command works with any array, it will default to _this.)
right, just an array with the one item
I never have to worry about not passing single arguments in arrays (player call instead of [player] call), because I use this usually:
https://community.bistudio.com/wiki/params
Fixed: Negative ping value was displayed for some players in the MP lobby
Faster than light. The message arrives before it was sent. Why even bother sending it?
It will have been sent, but it's here already.
recieving n*2 packets, because it's already been sent
paste dump incoming
wat
discord fucking what are you doing
It keeps making new lings instead of sending
private ["_newUnit","_markerPos"];
_markerPos = getMarkerPos "Opfor_Start";
_newUnit = group OpGrpLead createUnit [_this, getMarkerPos "opfor_start", [], 0, "NONE"];
_newUnit disableAI "MOVE";
_newUnit setskill ["aimingSpeed",1];
_newUnit setskill ["aimingAccuracy",0.1];
_newUnit setskill ["aimingShake",0.1];
_newUnit setskill ["spotDistance",0.3];
_newUnit setskill ["spotTime",1];
_newUnit setskill ["courage",1];
_newUnit setskill ["commanding",1];
_newUnit call missionStarter_fnc_loadoutApply;
zMod1 addCuratorEditableObjects [[_newUnit],true ];
zMod2 addCuratorEditableObjects [[_newUnit],true ];
zMod3 addCuratorEditableObjects [[_newUnit],true ];
unit is spawned, with the correct classname too, but loadout function not applied.
there
[_newUnit] call missionStarter_fnc_loadoutApply;
instead?
I'll give it a whirl
don't know why because the unit is called from _this
it's what I thought
I dunno man maybe createUnit isn't assigning the variable right?
It should as long as you use that GROUP crateUnit syntax
Add some systemChat / diag_log to debug the variables
_newUnit = group OpGrpLead createUnit [_this, getMarkerPos "opfor_start", [], 0, "NONE"];
^ make sure _this is defined and it's what you want
also check the RPT file. maybe it's a follow up error and only the latest error is shown on screen, while fixing would require you to solve the first problem
I didn't think of checking rpt
but ya I usually have a bunch of system chats for debugging
I'm trying the alternate createUnit syntax now
that should tell you if a variable is defined
that reminds me, is there a client equivalent of an RPT?
the clients RPT
the script errors go so fast ๐ฆ
every machine has a RPT
Hey guys, in Blufor, is it possible to change for who group icons (the hexagons) are set?
I had a look for one, but couldn't see one - is it in a particular place for a client?
So they are only visible on other people with a certain variable on them
ya it's in your appdata
nice!
%LOCALAPPDATA%\Arma 3
Hey guys, in Blufor, is it possible to change for who group icons (the hexagons) are set?
it's a difficulty option
it's either all or none from what I've seen
11:55:19 A nil object passed as a target to RemoteExec(Call) 'bis_fnc_shownotification'
11:55:19 A nil object passed as a target to RemoteExec(Call) 'bis_fnc_shownotification'
11:55:19 A nil object passed as a target to RemoteExec(Call) 'bis_fnc_shownotification'
11:55:19 A nil object passed as a target to RemoteExec(Call) 'bis_fnc_shownotification'
11:55:19 A nil object passed as a target to RemoteExec(Call) 'bis_fnc_shownotification'
....
I think I found the problem
Commy! I found it!
shit doesn't exist
cool. gl with that. Ill be gone for at least 2 hrs
later
@plucky beacon No its not just a difficulty, there is some command for it just cant find what it is
isn't there a mod that hides the hexes behind walls?
it might be ace, I don't remember
@still forum - diag_codePerformance is definitely useful, but serves a different purpose than that script. If you're trying to find the runtime of a single function in isolation, diag_codePerformance does the trick. However, if you're trying to profile the execution of your application and find which functions are performance bottle necks, that's what the script is for (https://forums.bistudio.com/topic/201730-squeezing-the-absolute-most-performance-out-of-a-script-fsms-cba-state-machines-vs-loops-and-functions/#comment-3150131).
okay so the only thing I could think of is that the script works for blufor because they're all placed on the map by Eden and names. opfor units have names assigned to them like this
12:36:21 "This is the unit: O Alpha 1-1:3"
12:36:21 "This is the classname: O_Medic_F"
12:36:22 "This is the unit: O Alpha 1-1:4"
12:36:22 "This is the classname: O_Soldier_SL_F"
12:36:22 "This is the unit: O Alpha 1-1:5"
12:36:22 "This is the classname: O_Soldier_GL_F"
so do these names work as variables that can be passed? they contain a space which I know variables assigned in Eden can't do.
man I got it fixed but this is fuckin' weird why it works now
I can't apply the loadouts while spawning the enemy I need to apply loadouts after they all have been spawned
close enough I guess
No they don't, its just entity to string conversion
if vehicle has vehicle var name, entity to string conversion returns it instead of O Alpha 123 stuff or model name with memory address
So I should make something that names all of the units that are generated?
add logging everywhere
diag_log
and figure out what doesn't get executed while it should and vice versa
ya that's what I been up to
almost every command by now honestly
maybe not every but any of the ones that do something that could break
does diag_log even lower performance at all?
yes, it writes to hdd
If you add it in a onEachFrame EH, of course^^
You're supposed to take it out when you're done with debugging.
thats why -> "DIAG" for "Diagnostic"
diag_fps is usefull to make some code runs equal regarding fps.
rip
heck I don't even tag you and I have a million questions, lol
patience is a virtue
Well I'll just post it here, guys, I saw some mods can edit the main-screen wallpaper, like when you start the ArmA, that background, do you know how to replace it with a image by yourself?
edit the config for it
@little eagle where i can find the config
kinda inconvenient the log on the server doesn't have time codes
set the timeStampFormat option in https://community.bistudio.com/wiki/server.cfg
I wish you could turn them off in SP.
whats the diffrence between long and short?
the length?
๐
ya but how muuuuch
idk, try it
server explodes
short probably equals the client rpt
just the time
and full probably includes date
anyone fancy helping me confirm a graphics issue I'm having on my two nvidia cards? I ask in here because there's local exec sqf involved
DriftingNitro - Today at 11:31 PM
whats the diffrence between long and short?```
incl. Date or Time only.
thx
Hay Guys, how do i say that i want to open the menu name.hpp if(profileName != _this select 1) exitWith {
hint format["Your old nickname %1",_this select 1];
[format["For your key is fixed another nickname, enter your old nickname in the profile of the game!<br/><br/>Your old nickname <t color='#b20303'>%1</t><br/><br/>If you have any problems with the change nickname - refer to the forum <t color='#665bff'>vk.com/russlandlife</t>",
_this select 1],
"Registered nickname change",
"adopt"
] call BIS_fnc_guiMessage;
["NameExists",false,false] call BIS_fnc_endMission;
};
please put that in a code block
how? o.o
do triple backtick + sqf, then new line, then code, then new line, then triple backtick
like this
if(profileName != _this select 1) exitWith {
hint format["Your old nickname %1",_this select 1];
[format["For your key is fixed another nickname, enter your old nickname in the profile of the game!<br/><br/>Your old nickname <t color='#b20303'>%1</t><br/><br/>If you have any problems with the change nickname - refer to the forum <t color='#665bff'>vk.com/russlandlife</t>",
_this select 1],
"Registered nickname change",
"adopt"
] call BIS_fnc_guiMessage;
["NameExists",false,false] call BIS_fnc_endMission;
};
("")testtest("")
```sqf
if(true)then{};
```
==
if(true)then{};
idk sry. Can you just answer my question ๐
wow...
wew
so, how do i say pls open that and that dialog
?
You posted SQF code.. with a hpp filename in front of it. and called it a dialog and a menu. I'm confused
Life'r ยฏ_(ใ)_/ยฏ
I'd suggest hint "please open that dialog menu sqf thingy in that hpp file";
@meager granite the problem i was having with the camera on player head was related to Position AGL + relPos error on slopes! Fixed! Works perfectlly now!!!
Spectator mode with zoom!
Ok guys, i have a question. When i have a sqf. How do open as an example the dialog 88 that is in my dialog. Im scripting Tanoa Life
the dialog 88?
i want to create an dialog when they changed their names. I got everything working without an dialog. But i want it with an dialog
Anyone in here familiar with the gac_train script?
Our Father which art in heaven,
Hallowed be thy name.
Thy kingdom come.
Thy will be done in earth,
as it is in heaven.
Give us this day a way to open dialog 88
Amen
Cant you just answer my question ? ๐
I know its _create Dialog but i need the script for mp
I think there is a barrier for us trying to help you here, we really have no clue what you're talking about
omg, that was an example.
meh, nah. Good night. guys.
and the name is "88" it also could be "changenamedialog"
createDialog "88"?
makes an alien 3 joke
Father of the God of Zeus of Arma 3 of Arma 2... make me rich! ๐
ok, you know what. I done it ๐ go get on someone others nerfes
see you in a few hours/days when you will be back asking for people to get on your "nerfs"
haha. Sorry but i asked a normal question and i get something like pls god give us 88
" Discussion about anything related to Script creation and usage within game ... IF (script == true) THEN {chat here}; "
When i have a sqf. How do open as an example the dialog 88 that is in my dialog. Im scripting Tanoa Life
normal question
mazy you would have got way more help if you'd not mentioned the Life thing
a whole lot of people hate the Life crowd because they are lazy and steal stuff from people who aren't lazy
in future just say you're doing everything for a mil sim mission and then everyone will help you ๐
Meh I have no idea how I coudl help calling the name.hpp
what is the name.hpp?
I guess it's some kind of form / interface to change the name in the ext db for life - but that's all like a black box to me
aren't you the guy from 3 minutes ago who i told to pretend his questions aren't for Life?
are you gonna have to make a 3rd account now?
Nope that was @tough abyss
you're right, he disappeared just before you turned up
anyway go to pastebin.com and put your name.hpp contents in a new paste and share it here
giving people a filename isn't enough information for them to help you
lol just read up there
idk sry. Can you just answer my question
that's some sass
nice. was it you who wrote that surface type debugging snippet as well?
actually i think that was pennyworth
this channel should really start some kind of github gist account or something for collating/competing on different scripts
it was indeed pennyworth, and he's posted a few more cool ones recently
Honestly - who does not have some kind of file or file repository with small script snippets?
i was talking about one specific to this discord channel where people can collab/compete on the same idea/s
i somehow lost my old sqf snippets file, it was massive. got a new one up to 1.4k lines of random shit
do you comment each snippet with a proper title or are you ctrl-Fing for a function name which you think is in the snippet, like i normally do?
i'm like "i'm pretty sure it had an event handler in there somewhere" - ctrl-F eventHandler = 5000 results ๐ฆ
@rancid ruin sounds like a cool idea, what I meant was that everyone probably already has tons of stuff stored away in some file, so it might be worthwhile to swarm intelligence gather it in one location
that 0 = ... bit seems so wrong lol
cos i presume that doesn't actually redefine the number 0 to something
why does sqf allow/encourage that kind of behaviour lol
ah, i switched over to pushback about a year late, must've missed that
a year or so ago when they started adding shitloads of new functions i just stopped scripting for ages til they figured it out
@tough abyss It errors by design
count is expecting nothing or a boolean to return
So, not a bug
Is it somehow possible to use setObjectTextureGlobal on a unit in a way that their head / helmet get the texture applied to aswell?
TFW after a few hours you realize an _x should have been a _this
out of curiosity what do you tag your log outputs with to find them more easily. I personally do
|filename|--!--Message
format ["some var = %1", var] call client_log;
where client_log does diag_log with some prefix tag added
Or even more advanced way would to be have some logging extension to write logs into separate file or terminal window
interesting
hey, is there a way to swap a player's seat?
Like, trade seats?
Like If you're in a car, using MoveInCargo/MoveInDriver etc doesn't work
Oooh
you have to exit then enter, won't let you use those commands to move from say passenger to driver.
https://forums.bistudio.com/topic/103404-vehicle-moveincargo-position-indexes/ I looked this up, should be on the right track
have you tried using the alternate syntax?
Marker positions always are places to terrain height right? Even if i created it relative to another marker
Are there no commands to process or update visible text in a listNbox? Is there some trick to it? The only commands I can find are for invisible data.
train is coming along ๐ https://www.youtube.com/watch?v=NSUh5XAQORM
but can we attatche turrets to it and make a battle train
hehe
Here's a high speed tour of tanoa tracks: https://www.youtube.com/watch?v=6HfZYe-hZz4
that is very cool
and not many things to do with trains are cool, so congratulations
you have set a new level for train related cool things
is it a script or a mod? how does it work, roughly?
I have a problem with revive
Does/will ArmA 3 support Lua?
How to setup the following mission:
- each regular player spawns in and has one life then becomes spectator
- Zeus players work normally
how do I set that up
Well I'm a noob, but isn't that an option in the editor? Can't you just turn off respawn?
@finite mica
Yes but that does not work as intended
zeus players on dedicated servers would end up with broken interface
I have to get zeus to work normally, other players spectator mode works normally
What zeus are you using?
the virtual entitiy one
That gets bugged with spectator enabled?
I have not tried it in the last 3 months
But what bohemia writes on the tin very often does not work as intdended
no Lua, @finite silo , arma has it's own scripting language called SQF
Can someone point me to a good object ingame that can be used to show a custom image?
thanks
How to add a hyperlink to a briefing?
I recall this being possible in arma2?
I dont remember the syntax
@rancid ruin thanks, it's a script
At a high level, the script generates a node graph of the tracks (each intersection and end point is node) and then figures out the path in-between the nodes. This info is then used to position and move the train based on player input.
When train reaches a node, based on the direction of the train and the keys being held down by the player, the next node is selected based on the andke of the new path
Angle*
The camera is just a custom camera that orbits and follows the train
do you build the node graph at mission start or as it's needed?
can't wait to see the finished product
by the way you can use hideObjectGlobal to remove those objects on the track which you clip through
Good morning programmers
@meager granite Thanks, I saw lnbSetText, but it says it only sets invisible text in the BIKI description. I tried it and it didn't seem to work for the visible text. I've just resorted to removing the row and re-adding it for now. I'm still getting the hang of dialogs..
lnb text can be a bit wonky i've found
Dialogs are great in Arma actually, far more stable and predictable than anything else
It's frustrating that there still is no way to read the color of a control.
Or use multi-line tooltips.
what are you comparing them to exactly sa-matra?
Or rotate a control (I think)
cos they are basically unreadable compared to html/css
you can rotate picture controls now
but i think that's it
Compared to the rest of Arma.
oh right, yeah that's setting the benchmark pretty low tbh
"this is the least confusing part of arma"
Depends on, what you do ๐
I made my mission output ascii art in the log so I could find where the mission starts when scrolling through it
Hi friendas! Why the heli isPlayer vehicle player returns true? ๐ฆ
When the player is inside a vehicle.
If object is a vehicle, the test is done for the vehicle commander.
Check the notes on the wiki
@indigo snow opss.. so it's my fault. Thanks.
Always check wiki
Yes, i will.
just check for isKindOf "CAManBase" too and youll be good
@indigo snow yes, i changed if (isPlayer _guguUnit) then... to if (isPlayer _guguUnit && _guguUnit isKindOf "CAManBase") then...
@plucky beacon thanks!
put the code in a block
code
` = that thing under the squiggly line
https://i.gyazo.com/3953f5a0300e28d356a1da67c61efc16.png
nah it's to the left of 1 on first world keyboards
```
sqf
```
Like that Nitro? ๐
ya how do you post without the formatting
Magic!
fuck
( \ )
```
sqf
cool
I asked this yesterday but it was late at night, is the position of markers always forced to 0 terrain hieght?
Yep
k
you coulda tested that in 15 seconds using getmarkerpos rather than waiting a day bruh
well it actually returns a 2D position type, so it doesnt return any height at all. im assuming the setPos family of commands defaults to a zero for height index so youll get different results between the different Pos types (posATL, posAGL, etc)
Try to move a marker with setPos ๐
Im working on an mission, i want that when the mission end an outro starts. I got that working but now i have in my outro this code:
format[
"<t size='1.3' color='#00C10D'>Thanks For Playing!</t><br/>Good Bye %1 ! <br/><t size='1.1'>Data Synced And Gear Saved.</t>",_name],
0,
0.2,
10,
0,
0,
8
] spawn BIS_fnc_dynamicText;
How do i open a dialog now? with createDialog "outro";?
if your dialog is defined as "outro" yeah
ahh ok cool. How do i script it that the dialog "crashes" or like deletes itself within 20 seconds?
it's an exit code
don't forget the wiki exists https://community.bistudio.com/wiki/closeDialog
oh ty, ill safe the wiki
i dunno how you've made anything resembling a mission without bookmarking the wiki tbh m8
I bookmark commands I never heard of
@rancid ruin He took the ordinary Life-mission ๐
does anybody know if action name for weapon resing exist and if so whats its name
from input actions... I need to block it
@west lantern
keyDeployWeaponAuto[]={46};
keyDeployWeaponManual[]={};
ok but does it wurk 4 my lakeside terraen
_return = (_key == (actionKeys _x) select 0);
};
} forEach ['ReloadMagazine','Gear','SwitchWeapon','Diary','ingamePause','keyDeployWeaponAuto'];``` << lemme try that one
nope that didnt work
wait, what?
@west lantern
remove "Key" and also: sometimes they are not the same names.
guess Ill just block 46 then
Try "DeployWeaponAuto"
_return = (_key == (actionKeys _x) select 0);
Instead of "KeyDeployWeaponAuto"
What if it isn't the first element?
that was the next thing, i planed to mention ๐
you've already clarified they are pushing the button
hey not my script its tcb ais wounding
nah will try in a minute
also >> https://forums.bistudio.com/topic/161291-a3-wounding-system-ais-by-psycho/
- btw... ... ... wasn't there a EH bound to actions, so you can systemchat' em? hmm
๐ธ
If you check the keybinds: "key" -> remove it
Then it is (most of the time) the action name
The other thing is: Why taking the first entry of the Array? +what will be done with it?
schweet gracias, will keep that in mind until I invevitably forget and ask again, at which point you can surely tell me to go to hell
but Ive been there ๐
btt, thanks
Added a note to your username, qouting that sentence.
so Im famous now ๐ ยฏ_(ใ)_/ยฏ
I just clicked on your username and added something to "note", if you think thats famous. ... ... .. erm... ... ... "okay?" ๐
I dont do it for fame and glory anyway Ill just take the booze and the tits
nuff offtopic?
there's almost certainly a life server called booze & tits
posmgntngr789uetndraegdnfg
sorry, life "community"
eh no thanks will pass that Im sure theres better bar around, and if all fails I can go to mexico
ok hi
ah with ( )
i did without ๐
laptop01 getVariable [ "T8L_pvar_dataDownloaded", false ] OR DebugTest
This is a really weird glitch, it doesn't run the mission failure (sometimes) but when I reassign and restart the mission it immediately fails at the start. It's really weird. It happens even before the init according to logs
Anyway, 2nd question then.... i made a respawn script for specific squads (a few days back in #arma3_questions ). And i thought it would work, but the script only worked for me as host in multiplayer
You better try it, i haven't done much with Triggers, but that should do it.
params ["_unit"];
if (group _unit == sqd1) then {
_unit setPos (getPos AlphaSpawn);
}
else {
if (group _unit == sqd2) then {
_unit setPos (getPos BravoSpawn);
}
}
}];```
It only works for me (the host), but all other players will respawn on their corpse
Where is it beeing executed?
init.sqf
In the mission file?
yes
localization i guess ?
wait a sec, need to doublecheck my old files
Someone told me i should put it in a onPlayerRespawn.sqf file instead
initPlayerLocal.sqf <-- use that
player addEventHandler ["Respawn", {call cD41D_fnc_c_Handle_Respawn; true} ]; Thats what i executed from there (worked).
So something is odd with some other settings. Whats not working there?
you could also use the MPRespawn MP EH
wasn't there a downside to the MPRespawn?
Here's what i want to achieve:
I got 2 squads/groups in the mission. Sqd1 and Sqd2.
Both squads have a vehicle on which they respawn (AlphaSpawn & BravoSpawn).
The script works, but only me the host will spawn on the correct one.
so initPLayerLocal.sqf will work ?
I used it there, so i can say: It worked there.
nope
crap
What might fk you up is: Do you use RespawnTemplates by BI? (Description.ext stuff)
if i do "Open Mission Folder" from the editor, my windows explorer crashes and doesn't return ๐ฆ
just
respawndelay = 15;```
rgr
respawn = BASE;
//respawnDelay = 4;
respawnDelay = 1;
respawnDialog = 0;
respawnButton = 1;
respawnOnStart = -1;```
@rancid ruin The track graph is built if you get in a train that's on a track that hasn't been mapped yet
Train won't move until the graph is built
HI, anyone help me make the script file banplayer (Side server), the player shall receive a ban for one hour when triggered script [1,(getPlayerUID player),"60","Ban / 1h",_name] remoteExec ["fnc_banPlayer",2];
openMap [true, true];
//titleText["Select Blufor spawn point", "PLAIN"];
["Blufor Spawn",-1,0.35,5,3,0,787] spawn BIS_fnc_dynamicText;
["<t size = '2'>Select the <t color='#4286f4'>Blufor</t> spawn position</t>",-1,-1,2,3,0,791] spawn BIS_fnc_dynamicText;
clicked = false;
onMapSingleClick "'west_start' setMarkerPos _pos; clicked=true;";
waituntil {clicked};
["Opfor Spawn",-1,0.35,5,3,0,788] spawn BIS_fnc_dynamicText;
["<t size = '2'>Select the <t color='#a81212'>Opfor</t> spawn position</t>",-1,-1,5,3,0,792] spawn BIS_fnc_dynamicText;
clicked = false;
onMapSingleClick "'east_start' setMarkerPos _pos; clicked=true;";
waituntil {clicked};
openMap [false, false];
How do I cancel or hide the visibility of the dynamic text here? My best guess was using cutRsc on the resource layer but that didn't work.
maybe just call a BIS_fnc_dynamicText with " " or something
""
''''
knowing sqf it probably wouldn't kick out an error, it'd just guess what you wanted to do
No clue, test it out ๐
HI, anyone help me make the script file banplayer (Side server), the player shall receive a ban for one hour when triggered script [1,(getPlayerUID player),"60","Ban / 1h",_name] remoteExec ["fnc_banPlayer",2]; If somebody already has realized the help me pls
please help me make autobans via infistar or battleye command,
For example, when the player join the Triger that would be called the ban
you can ban people via script with https://community.bistudio.com/wiki/serverCommand
make server side
"myservercommandpassword" serverCommand "#beserver ban %1 %2 %3",_this select 0,_this select 1, _this select 2];
"myservercommandpassword" serverCommand "#beserver ban %1 %2 %3",[_this select 0,_this select 1, _this select 2];
and create ban.txt
operate on the idea?
@rancid ruin the problem in the first place is that they are overlaying each other even when I put them on the same resources layer so I don't think that would fix the problem
I did this in many ways, not what did not work
why not just create your own text control nitro
if you rock vanilla bohemia ui functions like that then your mission just ends up looking like every other mission anyway
it's like when everyone just uses hint...it looks shit and conflicts with everything else which uses hint at the same time
hmmkay
// serverCommand doesn't work for ARMA 3 as of 2013-05-16
// serverCommand format ["#exec ban %1", _playerID];
// serverCommand format ["#kick %1", _playerID];
and that I need to write? it works now?
well, figured out my drawLine3D problem (lines (and buildings and trees) had a one-pixel green/white halo artifact on them) ...the PP sharpen filter is trash
TIL _x playAction "AgonyStart" / "AgonyStop" is far better than using _x setUnconscious "true" / "false" (fooling around with BIS_fnc_holdActionAdd)
ragdolls are fun
Yeah true - but with ai caching and other stuff in MP it gets messed up, the agony animation stops playing
so I'm going with the "faking it" route - which sometimes works better
I still think ace should have ragdoll when you're unconcious, and I thought it did as a glitch right when Apex came out
I want to make a video game, but I'm thinking about making a large ArmA mod first, and then transitioning that (so then I'd have my assets and everything) into a standalone game. Is that a smart idea? Or should I just start directly with UE4?
just learn UE4 since the language and implementation is diffrent as well
gotta figure out how people make diolags that stick on the screen
maybe if I find a server that has a watermark or something
also a way to prevent exiting an interface with escape
if you just want to make 'a game' and only care about the game design part, then use anything - arma is good to mod a game into because it gives you the terrain and player controls, etc straight away
but if you care about HOW to make games, I'd suggest using UE4 or Unity because those take more work to get started but you'll learn things that you can take into future games
arma mods only help you with the arma engine
I went to see how KOTH did the watermark but it's all binarized, rip
oooh
I see, so then titlersc the class
gotcha
thanks silver
not really the purpose yet so nothin' to worry about
so rscTitles just looks like a lite dialogs.hpp
man dialogs are such an undocumented venture compared to everything else in arma
I actually was going to look at your KOTH Samatra but it's binarized :p
it's alright thjoguh
thanks
cutRsc does not use idd's. It uses layers, but w/e
I'm always open to explain how my stuff works if people ask
KotH player menu was a last minute thing, originally it went straight to settings with view distance
Only from alive vehicle
you need to move invisible unit into their seat
Pushing out from dead vehicles is very buggy
yes
hideObject, allowDamage false, enableSimulation false
I enable it before moving in
Actually, I don't even disable simulation
server_moveOutDeadUnit = (createGroup sideLogic) createUnit ["C_Man_1", [0,0,0], [], 0, ""];
server_moveOutDeadUnit allowDamage false;
server_moveOutDeadUnit hideObjectGlobal true;
server_moveOutDeadUnit addVest "V_RebreatherB";
{
if(vehicle server_moveOutDeadUnit != server_moveOutDeadUnit) then {
moveOut server_moveOutDeadUnit;
};
} call server_func_addOnEachFrame;
"publicVar_unloadDeadFrom" addPublicVariableEventHandler {
_veh = _this select 1;
_unit = server_moveOutDeadUnit;
{
if(!alive(_x select 0)) then {
switch(toLower(_x select 1)) do {
case "driver": {
_unit moveInDriver _veh;
};
case "commander";
case "gunner";
case "turret": {
_unit moveInTurret [_veh, _x select 3];
};
case "cargo": {
_unit moveInCargo [_veh, _x select 2];
};
};
moveOut _unit;
};
} forEach fullCrew _veh;
};
This is for alive vehicles only
Yeah I recall there was some issue with units dying out of air despite allowDamage false
so I give him a rebreather as a failsafe
Turret I assume?
Yeah I recall there was some issue with units dying out of air despite allowDamage false
This is still a thing. If a unit reaches 0 oxygen, they die no matter what.
0 oxygen and are underwater*
You can return true in HandleDisconnect to keep the unit, moveOut it and then finally delete it after it fully moved out
Probably deleting during ownership transfer messes things up in MP
The idea with moving out dead units from dead vehicles was to first move dead unit from dead vehicle into alive vehicle and then push it out from alive vehicle with alive unit. It leaves proxy of the dead unit in dead vehicle though
Can't recall if https://community.bistudio.com/wiki/deleteVehicleCrew is useful for any of this
Or instead of all this mess we should have command to move out dead or update moveOut to work with dead
https://community.bistudio.com/wiki/deleteCollection
When targetting ArmA 2 1.06 or newer, use hideObject instead. This function is a relic from dynamic building destruction development. It is left only for compatibility with scripts created before ArmA 2 1.06, and its functionality may be changed or removed in the future.
It is alias to hideObject now
I guess this is reference to OFP2 dynamic building destruction
That eventually made it to VBS2
i didn't, good idea to try it out
Also this dead unit from dead vehicle removal is not tested in MP, probably will be a big mess and might result in Object xx:xx not found spam everywhere
Apparently vehicles could be broken into parts too in OFP2
hideBody was an action some special ops soldier models had in A2. It no longer works in A3, probably due to ragdolls.
Considering how hard it was to run Arma 1 and 2 back when they released I can only imagine how terrible it would run in 2005
Because the dead Player/Corpse inside the Vehicle is an ProxyObject in the Vehicle itself. Means -> It would "hide" a part of the Vehicle.
Is there any way how I can find out which weapon is employed by AI against which type of vehicle? F.e. the will fire at a low flying or landed heli with regular rifles, but not at MRAPs like the Strider or Hunter
anybody know of a "get" equivalent to setWeaponReloadingTime?
There probably is not one. Seems the command does not change the general reload time, just adjusts a single reload so if you want to read the reload time of a weapon you probably need to read it from the weapons cfgweapons config.
bummer, I was hoping there would be a way to get the percentage of reload time of a firing cycle (not a proper reload)
trying to make my bolt action rifle eject a bullet casing at the right time in the animation, but I guess I'm going to have to hardcode it into the weapon config
thanks anyway
yeah, but animating a bullet ejection via the model.cfg would be a nightmare ๐
I'd much rather spawn a bullet cartridge particle via script, that way gravity will do the work for me
pretty much
though I'm sure I can just define it myself, since I don't expect anyone or anything to affect it
for bullet ejections? probably, but how would the game know at which point in the animation it should start playing?
I dont know but you could take a peek at the effects configs
though it might not be configurable like that now that I think of it
but you can tie your effect on the fired event as long as you can figure out at what time it should spawn
could just use a stopwatch to time it?
that's the idea ๐
I'll have to see how I can set it up individually for the reload and cycle animations, but I'm sure it's possible
whats the difference?
the animations are different, so one might have a slightly longer delay until the cartridge ejects than the other
can you use ammo count as if condition?
yeah, or I'll have to detect the reload action
I'll figure something, thanks for the help
gents, I am using AL however they're thinking this could be an 'Arma' error rather than a framework error, has anyone experienced the following before?
would truly appreciate your help
I would bet thats AL thing.
well the DLC could point to Tanoa, but then again such error does not appear without AL
does anyone have an example how to enable respawn on group and have respawn at base at the same time?
@west lantern as in a wave type respawn or only a single group respawns?
@fleet dagger single
in fact I want to have base respawn available at all times
but players are across the map and main base if far away, so I want players to be able to respawn on their own group members
with some limitations... like if enemy is 50m away from group member spawn is disabled
oh so like you want to replicate the battlefield type squad respawn?
class RscTitles {
titles[] = {notification,info};
class notification {
idd = 600100;
movingenable=false;
duration = 15000;
name = "Timer Bar";
fadein=0.5;
fadeout=0.5;
class controls {
class instructionsTitle: RscText
{
idc = 1010;
text = "This is a notification"; //--- ToDo: Localize;
x = 0.304062 * safezoneW + safezoneX;
y = 0.236 * safezoneH + safezoneY;
w = 0.391875 * safezoneW;
h = 0.066 * safezoneH;
sizeEx = 3 * GUI_GRID_H;
};
};
};
};
how do I call this using titleRsc or cutRsc,
600100 cutRsc ['notification','PLAIN'];
didn't work, unless I'm defining things wrong. this is all after I include defines.hpp.
try
1 cutRsc ["notification","PLAIN"];```
no dice
also:
name = "notification";
should the name be the same as the class?
it just says timer bar because it was copied
movingEnable = 0;
fadein = 0;
fadeout = 0;
name = "MyNotificationName";
onLoad = "uiNamespace setVariable ['MyNotificationName', _this select 0]";
onUnload = "uiNamespace setVariable ['MyNotificationName', displayNull]";
ya still no
hmm
I remember sa-matra saying something about the layer
but I can't find any mention of it on the wiki
onLoad = "uiNamespace setVariable ['MyNotificationName', _this select 0]; systemchat 'Its loaded';";
debugging time
As usual: Add systemchat everywhere and test, if its even loaded.
so it's loading, but missing
Check your .rpt
As i mentioned a few days ago: Some stuff is not shown inside Arma, when it comes to UI/Interfaces stuff.
10:54:28 Error loading control C:\Users\[user]\Documents\Arma 3 - Other Profiles\D%2eNitro\missions\Permadeath_Template-90.VR\description.ext/RscTitles/notification/controls/instructionsTitle/
๐
notification/controls/instructionsTitle/```
In **notification** the **control(s)** "**instructionsTitle**" has an error.
class instructionsTitle: RscText
{
idc = 1011;
text = "Select the Opfor spawn position"; //--- ToDo: Localize;
x = 0.304062 * safezoneW + safezoneX;
y = 0.236 * safezoneH + safezoneY;
w = 0.391875 * safezoneW;
h = 0.066 * safezoneH;
sizeEx = 3 * GUI_GRID_H;
};
uhmm... the idc? maybe?
class D41D_Teampoints_West: D41D_RscText
{
idc = 123456;
x = "0.85 * safezoneW + safezoneX";
y = "0.81 * safezoneH + safezoneY";
w = "0.0317 * safezoneW";
h = "0.033 * safezoneH";
sizeEx = Txt_Big; //calculated in seperate File
colorText[] = {0.5,0.5,0.8,1};
text = "100";
colorBackground[] = {0,0,0,0};
type=0;
style=2;
font="RobotoCondensed";
};```
thanks
Type & Style is missing, for example
Could be loaded by RscText (I repeat: COULD), but i wouldn't be so sure about it.
worth a shot, also easier to just have the style there directly
class D41D_RscText
{
type = 0;
x=0;
y=0;
h=0.037;
w=0.30000001;
style=0;
shadow=1;
colorShadow[] = {0,0,0,0.5};
font= "RobotoCondensed";
sizeEx = Txt_Norm;
colorText[] = {1,1,1,1};
colorBackground[] = {0,0,0,0};
linespacing=1;
tooltipColorText[] = {1,1,1,1};
tooltipColorBox[] = {1,1,1,1};
tooltipColorShade[] = {0,0,0,0.64999998};
};```
The RscText i used
It's saying I already defined it?
hang on I didn't grab the error
236 sizeEx = 3 * GUI_GRID_H;
237 colorText[] = {0.5,0.5,0.8,1};
238 text = "100";
```so it says 236 is already defined but that error wasn't there before so would it be talking about the color text?
Ctrl+F -> SizeEx
F3 a few times
After that:
Ctrl+F -> colorText[]
-continue blablabla
ctrl f?
oh on notepad
so basically from what I can gather the example you shared is under the impression the person doesn't already have a defines.hpp
Wondering if someone can point me in the right direction. I've searched google quite a bit but coming up with a lot of out dated results. Trying to find a simple way/script to create custom starting loadouts. A few I found work well after respawns but not the initial spawn.
Eden you can change the loadout though
there are respawnWithLoadout scripts
google for scripts that maintain the same inventory
all this talk about layers on the wiki and not one exaple about how or where to define them
@jade abyss This is weird, I tested it with frame and it make a frame normally, but the text doesn't appear and adding any of the parameters you have in your example make an error about being already defined. troubling this one.
No idea what you did, tbh. The example i gave you was a "standalone" version of it (it should show a Textbox in the bottom Right Corner)
The only thing that needed to be changed was "Txt_Big" in sizeEx
txt_big is still relative to thr ui size isn't it?
Its how i called my Textsize.
I defined them in another file.
#define Txt_Small "0.01 * safezoneH"
#define Txt_Norm "0.02 * safezoneH"
#define Txt_Big "0.03 * safezoneH"
#define Txt_VBig "0.04 * safezoneH"```
sizeEx should be fine then if it's not predefined
rrrright but what's the diffrence between
#define Txt_VBig "0.04 * safezoneH"
sizeEx = Txt_VBig ;
and
sizeEx = 0.04 * safezoneH ;
nothing
I just changed some Textsizes in several parts, so i didn't want to open all files again and again and again
just to change one number
Bottom Right
http://images.akamai.steamusercontent.com/ugc/262721277425316176/EA32B84E80F0F8337DB8AFAF10C6D2C46AC212C1/
They all had the same size. Instead of changing the SizeEx in every file -> I just changed it in one File.
I mean, that's great but I'd like to get the text working before I wrory about the size
And i gave you an example above, wich worked for me.
Okay I have the text appearing now, but the next issue is ctrlSetText
CtrlSetText [1033,"Select the Blufor spawn position"];
or
text CtrlSetText [1033,"Select the Blufor spawn position"];
unless RscTitles changes text diffrently
@plucky beacon dno if u got it fixed yet but that second syntax you tried is all wrong. Read https://community.bistudio.com/wiki/ctrlSetText
wiki is life
Hello Guys, i have a question. I want to make a script that the screen is black and a text apears. than the black fades out
How should i do that?
Like that? titleCut ["", "BLACK FADED", 60]; titleCut ["", "BLACK IN", 10]; ["core\ls\videos\vid.ogv"] spawn BIS_fnc_playVideo; titleCut ["", "BLACK FADED", 10]; titleCut ["", "BLACK IN", 10];
Okay so just edit titleCut to cutText?
okay ill give it a try
that doesnt work
It doenst fade
but isnt it seconds?
i want the black screen stay 1 minute
or should i go with sleep in between?
hmm, doesnt work
my code:cutText ["", "BLACK FADED", 5]; sleep 60; cutText ["", "BLACK IN", 5]; ["core\ls\videos\vid.ogv"] spawn BIS_fnc_playVideo; cutText ["", "BLACK FADED", 5]; sleep 20; cutText ["", "BLACK IN", 5];
@thin pine
From the Dialog Control wiki page
...do exactly same as different names in other controls. color[]=, colorText[]= ActiveColor[]=ShadowColo[]=
by recognizing a pattern controls are the parameters of the resource therefore wouldn't a conclusion be that text is a valid parameter.
Also
_control ctrlSetText "Hello world.";
isn't exactly what I call a thoroughly explained example
well imagine a control, lets say a RscText inherited control that displayed the text "foobar" - you could change that displayed text by doing sumn like; disableSerialization; _control = _myDisplay displayCtrl 1337; _control ctrlSetText "Hello world!";
Not sure what else you're trying to achieve with ctrlSetText ๐
well that's what I'm doing NOW thanks to the video I linked that showed me how to do it. And I can't contribute to the wiki because my account won't verify :P
my point being it's a poor example to have "_control" and not know how to initalize a control
if you're on about https://community.bistudio.com/wiki/Dialog_Control not including any dialog-scripting examples, I can agree yeah
You got me wondering if there are any pages on the wiki about scripting with dialogs. (Dialogs themselves can obviously work without any scripting)
I'll have a look
https://community.bistudio.com/wiki/ctrlSetText like this one?
That page is obviously just an info page for one of the -large- Control family set of commands
The additional info on that page doesn't show most of the other commands though, but here have a look at this one for example: https://community.bistudio.com/wiki/ctrlSetPosition
There's plenty of commands associated with Controls, so posting a "tutorial" on just one of them wouldn't be clever
are there reserved IDCs or IDDs I should avoid?
is there a range of safe numbers?
ok
class InstructionHud
{
idd=1235;
174 movingenable=false;
175 enablesimulation=1;
176 enableDisplay = 1;
178 duration = 999999;
179 fadein = 1;
180 fadeout = 1;
181 name "InstructionHud";
182 onLoad = "with uiNameSpace do { InstructionHud = _this select 0 }";
183 class controls
{
class structuredText
{
https://i.gyazo.com/ce0379020cd446fadef4b14a58f9c28e.png
wat
oh fml
=
================
===============
the fucking code block in discord highlighted it for me IN RED
@plucky beacon Isn't there JIP problems with using the Eden arsenal to change loadouts?
I think respawnOnStart command in the description has an option to help with that
I remember months ago trying loadouts in Eden. When I player JIP it caused everyone else's loadouts to do some crazy things. Reset to original loadout, double the amount of items within inventory, ect.
well Eden came out months ago didn't it? how long has it been out?
it did weird stuff when it first launched
can I put multiple structured text's in the same controls class?
What do you mean with "Same controls class"?
hang on let me whip up an example
You can only have one text for each control, but you can use </br> for newlines
Can I have multiple font sizes in the same string?
Sure
แดฎแถซแตแถ แตสณ โถ 12:34:56 แดผแตแถ แตสณ โต
basically like that
https://community.bistudio.com/wiki/parseText ya this shit
hmmmkay
Lol you can parse an image in the text?
weird
It's pretty cool.
I could put like a little icon on the ends too then
so what's the best way to calculate the center of the screen on the horizontal axis
I mean, a better question would be can I just take the window resolution and divide by 2
_x = call {_a = 1};
0:29:19 Error in expression <_x = call {_a = 1};>
0:29:19 Error position: <= call {_a = 1};>
0:29:19 Error Generic error in expression
this didnt throw an error some month ago, did it?
no
:/
interesting ^^
call {_a = 1}; works like a charm... just using the return value isnt possible
simply wrong
body: Code - A function body provided directly 'inline' or the String returned from the commands loadFile or preprocessFile.
meaning call "x = 3";
oh yeah
now i know
try sqf call {_a = 1; _a;} ?
-sqf
@ionic orchid yes
yep but i remember a time where this worked with _x being nil in my example
@deft zealot @still forum This has always thrown an error.
The assignment operator returns void and not GameValueNil. You looked at this before, dedmen.
I know. Didn't see it first.
Fixed the wiki example for call
vote 4 change ๐
I'd suggest to never end a function with an assignment operator. Basically the opposite of what you have to do in the editor, lol
thats it... but i doubt there are many ppl who know that ^
I like it. This makes sure there is always a need for SQF guru's ๐
Don't care if no one listens to me. I just say it to point fingers and say "told you so!" when shit collapses.
lol
@plucky beacon did you figure out your UI question?
ya, but I'm sure I'll have more later
oh wait, I didn't find out how to center an element
_configs = "true" configClasses (configFile >> "CfgVehicles");
_models = _configs apply {getText (_x >> "model")};
_models = _models arrayIntersect _models;
diag_log count _models;
spawnedScript = _models spawn {
_pos = (getPosWorld player) vectorAdd [0,60,20];
{
_obj = if ((_x select [0,1]) == "\") then {_x select [1]} else {_x};
dedmen_object = createSimpleObject [_obj,_pos];
systemChat _x;
sleep 0.1;
deleteVehicle dedmen_object;
} forEach _this;
};
Hah yeah... Arma can be fun.
Centering in an ui depends on the size of what you want to center
class vehFrame: IGUIBack
{
idc = 1;
x = 0.25 * safezoneW + safezoneX;
y = 0.25 * safezoneH + safezoneY;
w = 0.5 * safezoneW;
h = 0.5 * safezoneH;
colorBackground[] = {0.529,0.565,0.49,1};
};
this background size is half the size of the screen (w= 0.5 h=0.5)
so in order to center it, the x pos and y pos are .25 away from their respective screen edges
leaving 0.25 on the other side
This is from my UI tutorial https://youtu.be/nQygf2qKIU4
you can follow the link to the forum post has a dl
how do I get multiple RSC ont he same screen? they keep replacing each other even though I'm picking other layers
You're using createdialog/display or title/cutRsc?
I had identical IDs is why :P
ahh lol
what does the style parameter do for text? mine is set to 13 and I don't know what it means
pretty sure 13 is structured text
wait no type=13 is structured text
should read through the rest of his gui tuts, some really good info in there
nice!
slightly off center though :I I'll worry about it later
Positioning text correctly can be a real pain. I usually use a colored background on text ctrls until i get the pos right, also use the align commands text = " <t align='center'>Text Example</t> ";
Ouh BI :/ What shall we do with ya?
TestingFunction = {
if (true) exitWith {};
{call { call {call{}}}} forEach variableStuff; //repeat these 2 lines 12x didn't include all to keep message small
missionNamespace getVariable ["",{call{call { call {call{}}}} forEach variableStuff;}]; //repeat these 2 lines 12x didn't include all to keep message small
};
for [{_i=0}, {_i<1000}, {_i=_i+1}] do {addMissionEventHandler ["EachFrame", TestingFunction];}; //~760ms per frame
for [{_i=0}, {_i<1000}, {_i=_i+1}] do {addMissionEventHandler ["EachFrame", {call TestingFunction}];}; // ~47ms per frame
Why BI? why? I don't see any reason why you would compile an Eventhandler each frame instead of just storing the compiled code
I wrote it. After finding a performance bug in CBA which was not caused by CBA
Arma stores eventHandlers as strings at compiles them before executing.
yeah
not the stackedEH but the call calling the stackedEH script is
addMissionEventhandler all of them. also onEachFrame {} and other of these "one time" eventhandler script thingys
didn't check UI eventhandlers but I guess they are also affected
BIS_fnc_stacked eventhandlers are not affected because they are handled in script