#arma3_scripting
1 messages · Page 487 of 1
You have infinite loop spawning infinite scripts
In playerInitLocal
That will soon deplete Arma of all resources
The sqf [] spawn { [ ["VR SYSTEM","Welcome to Wave Defence! Contact your Instructor to get your Loadout!",0] ] spawn BIS_fnc_EXP_camp_playSubtitles; while {CAP_WaitingWave} do { [ ["VR SYSTEM","Waiting to start the Next Wave. Contact your Instructor!",0], ["VR SYSTEM","Waiting to start the Next Wave.. Contact your Instructor!",4], ["VR SYSTEM","Waiting to start the Next Wave... Contact your Instructor!",8] ] spawn BIS_fnc_EXP_camp_playSubtitles; }; };?
While loop
When it runs, if it runs, it spawns millions of scripts
Very quickly
Maybe you forgot to add sleep to it
0 4 8 are timers between each title
I don’t see any timers
better just delete that thingy, make function for those messages and call it from your main loop on the server
You spawn that function
You can put elephant in it
It returns almost immediately and spawns another
And so on
Spawn returns handle immediately
It doesn’t wait for script to finish
Would that help?? idu ```sqf
[
["VR SYSTEM","Welcome to Wave Defence! Contact your Instructor to get your Loadout!",0]
] spawn BIS_fnc_EXP_camp_playSubtitles;
if (CAP_WaitingWave) then {
[
["VR SYSTEM","Waiting to start the Next Wave. Contact your Instructor!",0],
["VR SYSTEM","Waiting to start the Next Wave.. Contact your Instructor!",4],
["VR SYSTEM","Waiting to start the Next Wave... Contact your Instructor!",8]
] spawn BIS_fnc_EXP_camp_playSubtitles;
};```
No
Nope
Actually
You don’t understand what I’m saying
Updated
I don't need it to repeat.
I think three times is enough to prompt the player to know what to do.
Don’t put it in a loop if you don’t want repetition
I did want repetition.
But if it causes those issues, then I can just deal with it thwice.
getPlayerUID has troubles with player references? I made a remoteExec with player as an argument. Now params ["_player"]; getPlayerUID _player; returns an unexpected result. Read the doc but could not really realise if it is a problem or not
What is the "unexpected result"
@frigid raven Why not use _this lose the params
What remote exec look like
If the remoteExec passes Player, then isn't it _this?
Cap, that BIS function already has repetition built into it. No need to try and loop it
wait a sec if I do
{_x} forEach allPlayers
is _x == player ?
Yes
uh ok
allPlayer (as stated above includes HC)
Players and headless clients
thought it wouldnt have the UID property applied or something
Some _x might be player
wouldnt have the UID property applied wat
{_x} forEach allPlayers && isPlayer;```
Lolno
IsPlayer is Boolean you cannot add Boolean to array
{ _x; true; } count allPlayers select isPlayer
If I recall correctly
That is if I understand what you want to do
That code won’t run
{
if !(_x isEqualTo isPlayer) exitWith{};
_x ..blah..
} forEach allPlayers;```
allPlayers select {isPlayer _x};
= is assignment not equality
@ruby breach he still needs to do something with the array though so I guess thats why he wants to use a loop
🤦♂️ I’m outta here, see ya
bai @tough abyss
I'm not sure what xetra is trying to do with the list of players. I know Cap doesn't need a loop because he's using a BIS function with a built in loop/delay system
@ruby breach I sorted that out. But thanks.
maybe he just likes loops
Also I think doing sqf { isPlayer _x } count allPlayers works to
And I think its faster
no
no
no (i dont understand shit)
allUnits addEventHandler ["Killed", {
params ["_unit", "_killer", "_instigator", "_useEffects"];
sleep 2.5;
deleteVehicle _unit;
}];``` Does this work @meager heart
no
count doesn't return an array of objects
I mean count can return array no?
It just returns a number
Ok maybe you need to use apply with it then
updated
allPlayers apply {isPlayer _x} would just be an array of booleans
No I meant using count and apply
No I'm thinking of append actually
Just ignore me, I just stumbled in here. A couple of months since I did SQF. 😄
@drowsy axle dude, b4 you will use any command or function, just check wiki in case you forgot something/trying it for the first time, you will save so much time...
Okay. I will
@drowsy axle allUnits is an array, and suspension is not allowed in unscheduled, EVH code is unscheduled.
@drowsy axle And if you want to make a cleanup for dead bodies, you can use built-in cleaner Corpse & wreck management in description.ext or otherwise go thru allDeadMen with server-sided script.
Corpse & wreck management in description.ext
yes it's bretty gud https://gyazo.com/e6c113afb46a674c56de29459bc96b11 😃
using exitWith in a forEach works like a continue ?
in terms of java tho
or other languages that use continue in loops to skip to the next iteration
so it continues with the next aye?
{
_playerName = name _x;
if (player vehicle IsEqualTo "Tank") ExitWith{hint format["%1 has a Tank",_playerName]};
hint format["%1 has a Something",_playerName];
} forEach allUnits;```
It's a fucking example @austere granite chill
there is no continue
ffs
you'd want an extra scope
having _playerName is local
_>
having private _playerName makes it unable to change outside of the scope.
I don't know java, but I know some python which I guess is mostly the same anyway
lies
That's not the continue though
yea but it does what I want actually
That will BREAK it, not continue with the next element
@frigid raven the forEach isn't stopped.
so you... dont? want continue
oh
yes it is
It continues.
what?
no it doesnt
🍿
It diverts the if ()
you don't need to sit it out. exitWith exits the current scope. a forEach is one scope, using exitWith will cancel the entire forEach loop
it is NOT a continue like capwell is claiming
@austere granite proof?
LOL
Okay i can start up my game and proof it to you, if you promise to buy me some internet beer
I can't be arsed to boot up arma lel
but every element in forEach casts a scope?
It doesnt
I thought it was in it's own scope as well
1
{ if (_forEachIndex == 0) exitWith { } } forEach [1, 2, 3]
exitWith will exit current scope unless it returns true, which it'll create a new scope
will run it once, not 3 times
so... when I return true it will work like a continue?
What are you trying to do @frigid raven
because the ExitWith will work.. without a forEach
having a forEach over allPlayers - want to skip the loop if a player is not logged in (checking a variable)
logged in as admin?
Problem is that I dont want the code to be executed if the player hasnt logged in
no I tried some login feature with CBA Hashes
just scripting tryouts
doesnt matter for this issue
@frigid raven https://community.bistudio.com/wiki/admin
Having 3 players where 2 are logged in I want the forEach code just execute for the 2 logged in ones
ok forget about the logged in
2 players are cool
one is not
only run code for the cool ones
while forEaching over allPlayers
YEA I could filter the cool ones and make a forEach over this set
but I just wanna see if tehre is a continue thingie for loops
{
call {
if !(_x getVariable ["cool", false]) exitWith { };
// -- Do stuff for cool people
}
} forEach allUnits;
a more continue like thing would be breakTo
well ppl said exitWith will not do that
{
scopeName "continue";
call {
if !(_x getVariable ["cool", false]) then { breakTo "continue" };
// -- Do stuff for cool people
}
} forEach allUnits;
exitWith will break the current scope
you see how there's a call?
Meaning it's an extra scope
{
scopeName "continue";
call {
if !(_x getVariable ["cool", false]) then { breakTo "continue" };
hint "You are cool";
}
hint "You are NOT cool";
} forEach allUnits;```
woah labeled loops jeez
Well if it's incorrect it doesn't do what you said
It's a thing for you, to figureo ut why that edit you did is wrong
What does Break mean?
taken from: https://community.bistudio.com/wiki/breakTo ```sqf
scopeName "main";
while {true} do {
scopeName "loop1";
while {true} do {
scopeName "loop2";
if (condition1) then {breakTo "main"}; // Breaks all scopes and return to "main"
if (condition2) then {breakOut "loop2"}; // Breaks scope named "loop2"
sleep 1;
};
sleep 1;
};```
edit still wrong though
idc
lol
🍿
{
scopeName "continue";
call {
if !(_x getVariable ["cool", false]) then { breakTo "continue" };
hint "You are cool";
};;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
hint "You are NOT cool";
} forEach allUnits;``` is this a better edit?
So... a guy is cool,then that call is done... and what is it going to do? Going to tell him he's NOT cool
forEach person who is cool. Is told he is cool.
forEach person who is NOT cool. Is told he is NOT cool.
incorrect
Is that not how that works?
Cool people are also told they are not cool
Why?
Realistically, nobody is told anything because you're not broadcasting anything
kek
xD
@ruby breach woah Smartie McFly appeared
Because you're breaking to the scope, meaning it'll just continue
in the scope of continue, then the first thing there is going to be telling <nobody> that they are not cool
{
scopeName "continue";
call {
if !(_x getVariable ["cool", false]) then { breakTo "continue" };
hq globalChat "You are cool";
};;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
hq globalChat "You are NOT cool";
} forEach allUnits;```
What even started this conversation anyway.
Someone trying to use exitWith in a forEach?
😛
Extra was asking about a continue like thing in forEach loops
IM NOT CALLED EXTRA
X11 is a better name tbh
extra11 yes /s
but it conflicts with @queen cargo
yep
are you two clones?
mhh?
left the room
X39 is actually not conflicting in any way
i give up
It would have to be a separate thing
I've had too much to drink to try and explain things to Brainletwell
X39 is derived from my former nick Killer-X39
the Killer- part was dropped when it got popular with what i call "child culture" ... originally, it came from the first online game i ever played Breeed where you could play as literal killer robot online
Killer was the job to be done and X39 just the first 3 literals i hit on my keyboard
Lazy man's way of doing it: ```sqf
{
if !(skipThisIterationBool) then { };
} forEach [list]
{
scopeName "COOL";
call {
if !(_x getVariable ["cool", false]) then { breakTo "COOL" };
hq globalChat "You are cool";
};
} forEach allUnits;
{
scopeName "NOTCOOL";
call {
if (_x getVariable ["cool", false]) then { breakTo "NOTCOOL" };
hq globalChat "You are NOT cool";
};
} forEach allUnits;
Cleaner solution would be to filter your list prior to even doing the loop
{
hint "Hi Capwell how are you doing?";
} forEach (allUnits select { _x getVariable ["brainlet", false]})
sick edit
bulli edit
the edit was becaus ei forgot the actual select thing, not because bulli
I would never mess up a bulli
Who is this pointed at?
Are you telling @meager heart "Hi Capwell how are you doing?"
bc no variable is set
ok... i will probably leave o/
silly question but how would one script an information pop up when a player loads into a mission?
you know, there is a project around that allows you to use continue and makes SQF a whole lot saner to work with
(in case anyone is going to try it out or bitch about the code, use the rewrite branch)
^^
pff
typical noob https://github.com/X39/ObjectOrientedScripting
why write in SQF at all if you just could use some different language @halcyon crypt
this isn't my work but it started out in SQF as a proof of concept
moving to an actual transpiler is the idea at some point
🤷 OOS could use some love ... thing is: nobody really uses those things sadly ...
otherwise, OOS nowadays would be kinda bug-free and feature-complete
I guess they have similar goals but they both do their thing in different ways
result still will be the same
at max 4 people using that, where 3 are developing it and that single other one just randomly discovered it
😛
Started with scripting, continued with bullying each other, now ending up measuring dicks.
Typical #arma3_scripting
who's measuring dicks now?
escapes thru the window
@unborn ether #arma3_scripting is the discords Personal Drama channel
Though.. Probably will make what @halcyon crypt posted runable on sqf-vm soon ™
I already threw in the idea to use sqf-vm as an out-of-arma transpiler until there's a real one ^^
so +1 😃
with some modifications I guess because it's not really for outputting files is it?
You could output files already using the correct cmd parameters Plus the > operator (bash or power shell)
But there is no dedicates save to file method
nah that's fine
Though... Just like arma, it Supports extensions perfectly fine
Thus a normal file writing extension could do the Trick too
nah redirecting it to a file would be my use case anyway
heh, perfect (automated) testing environment
One of its usecases 😂😂
To get that sqf++ project running, I just need to know what commands are not supported in current head
what do you mean exactly?
all of A3's commands are supported by default
no configs or anything
it basically translates getPos(player()) to getPos player
SQF commands will be namespaced at some point though
Talking about sqf-vm
Sqf-vm does not provides All commands in arma yet
And it never will
gotcha, misread 😃
@tough abyss if it is only me developing, yes, never
Whatever the Player Position is
Stuff like worldname would require just a single command right now as it literally is some Spot where the proper Config Path is resolved
It won’t make sense
Getposasl would require map data, more complicated
Some commands need game engine
You need to add game engine too, don’t cut corners
And don’t forget time, date and setWind
No need for actual engine is the fun Part
Visual frontend is enough
Simulation not needed at All
With a visual frontend being optional (just like currently Config validation is) it also would still be able to use on non gui machines
And that is with the assumption that the ui is drawn at All
At some point you have to ask yourself what is it good for and then just develop it in that direction if you have limited resources
And drop the fancy useless crap
As I said
Single Person developing means sqf-vm will never reach all commands in arma
But right now it has 10% coverage
I can see people needing for development of extensions and unit testing it is actually quite useful
Dunno what else you can do with it that would beat firing arma
Ever have been in train having a horrible Laptop with you not capable of running arma properly?
This is like 5 ppl in the world have this problem
Can confirm am a person and have had this kind of situation
Unless you are on deadline developing for one of the life servers 😂
Already happened to me multiple times @tough abyss 😂😂 At conference same game
it's not an every day situation, but occasionally I'm away from my desktop for a while, but still like to be able to try a thing or two
Biggest plus though is indepth debugging capabilities without the need to run arma at All
Current snapshot of sqf-vm gets shipped with a debugger executable
You can try it if you want 🙈😂
-s Splendid mode 👌
--server actually
But good Suggestionen @meager heart🤔
at max 4 people using that, where 3 are developing it and that single other one just randomly discovered it
That one was forced to use it!11 and he kinda likes it now... 😔
silly question but how would one script an information pop up when a player loads into a mission
@ornate ridge like that > https://discordapp.com/channels/105462288051380224/105463244310728704/491933466749960212
tried that, didnt seem to work, but i'll give it another go
player spawn {
private _result = ["Are you sure?", "Confirm", true, true] call BIS_fnc_guiMessage;
if (_result) then {
_this call BIS_fnc_neutralizeUnit
} else {
["endDefault", false] call BIS_fnc_endMission
};
};
``` into ^ debug console @ornate ridge
Hey there, im rather new to scripting. can anyone help me translate a Dialog hpp script and use it as cutrsc? the script I found online locks the players movements
good morning buds
As i see theres some skilled guys online right now ill ask my little question here again.
I made a vehicle claim /locking addon.
Everything works except one thing.
When accessing a groundholder next to a locked vehicle you can access the inventory through the left list menu selecting container.any ideas?
"Locking"the inventory being done by find/closedisplay
@drowsy axle https://discordapp.com/channels/105462288051380224/105462984087728128/492435196407447552 0xDEAD means arma killed itself manually because of something. Would be nice if you could've screenshotted the actually useful error popup. Instead of the "Arma crashed" window with 0 useful information whatsoever.
too many virtual blocks requested == Out of Memory.
https://discordapp.com/channels/105462288051380224/105462984087728128/492450688878772227 Because params is more readable.
@frigid raven https://discordapp.com/channels/105462288051380224/105462984087728128/492450931070468127 No. Only one of them.
@drowsy axle https://discordapp.com/channels/105462288051380224/105462984087728128/492450958324793354 No it isn't.
@rotund cypress https://discordapp.com/channels/105462288051380224/105462984087728128/492451465403695105 no you don't.
(allPlayers select {isPlayer _x})
@frigid raven https://discordapp.com/channels/105462288051380224/105462984087728128/492468209077846016
no forEach doesn't care about what exitWith returns.. at all.. I don't know where @high marsh got that idea?
Just use a normal if statement.
https://discordapp.com/channels/105462288051380224/105462984087728128/492469414596444162 it will. It will exit the call'ed scope.
Man soo much dumb shit overnight.. You want a continue command? I can make you one !!!!111!!1
@halcyon crypt https://discordapp.com/channels/105462288051380224/105462984087728128/492495324712140820 have you ever tried all of Arma's commands? Even Arma itself doesn't support some of it's SQF commands.
@queen cargo https://discordapp.com/channels/105462288051380224/105462984087728128/492495759954935808 does not provide*
@sturdy cape use InventiryOpened EH and just override opening if one of the containers belongs to locked vehicle https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#InventoryOpened
Doesn't work as he already explained yesterday
Or if you are making a mod, just mod out the action
Also doesn't work.
Why it doesn’t work with EH?
He wants to lock the vehicle. Which works fine with InvOpened EH.
But if you open a ground holder next to the vehicle. InvOpened fires for the groundHolder.. But that one isn't locked so it's fine.
But now when the inventory screen is open you can switch to vehicle on the left side panel. And the EH doesn't fire again
so you just opened a inventory that you are allowed to open. And switched over to the inventory that you are not supposed to be able to access.
My only idea is modifying the Inventory display code. To run code when you click the button to switch to vehicle
I would guess he already tried that if he said that he tried the EH out and it didn't work for him
I expect people to read the wiki before asking 😄
But we all know every well that, that doesn't work usually
No he didn’t I’m sure, it should work, the second wh was added not long ago
It's still a bit shitty if you will be denied from opening inventory of container if locked vehicle is near.
You'd add an EH to the Crate button or whatever the text is, so it would close when they switched
Second wh is usually objNull. If you are close to another container it will be that container. When EH is firing you can override opening, so you check if any container belongs to locked vehicle, if yes —> override
@hollow thistle you have to be literally next to vehicle in reach of vehicle inventory
There is also nearestSupplies command I think?
Vehicle inventory should be in it when you are close
When testing my mission on the ingame host (not 3DEN) should it behave like on a dedicated server? Because some things to work on the host way which do not when I deploy on the dedicated
On hosted server host player is the server hence it cannot be like on dedicated when no player is server
u sure? thought only on 3DEN preview player == server
Yes I’m sure
Ok... if you kinda think you are not sure email me: ifnotsure@tell.me
Brb, writing an email
@frigid raven Eden multiplayer preview and hosted server is the same thing
When you click multiplayer preview it shows you the server hosting screen next
ffs I hate that - cant figure out dedicated probs that way always have to deploy the mission and restart server
painz
What?
what
I mean in preview all works fine - on dedicated it doesnt. It is a pain to figure out the problem on dedicated and test the fixes because you've to redeploy the mission all the time
Ah
Well... Like I said once before, implement it with the appropriate distinction in locality
For example, if (isServer) then { //stuff}; will work properly both places
Commands on the wiki usually tell you whether a command takes global or local arguments, and if it had global or local effects
That should indicate where to run what
But yeah, apart from that you have to reupload the mission, which is annoying indeed.
You can have mission unpboed locally and tweak it, just need server restart unless you have patching enabled. It is doable though a little less convenient than Eden, but if you keep in mind the differences you can do it all in Eden and just test on dedi
@tough abyss thats exactly what i am doing for the locking of the vehicles inv.the problem is that players can work around this by acessing a groundholder next to a locked veh and selecting the. Container in the left list in the gear dialog
I explained how you can tackle this
Ah sorry just got the notification for your mention,answered but the chat itself didnt load yet.now i see.mobile connections🙄
@inner swallow I never used isServer yet. I can't figure out what usecase I need it. I split my scripts into client and server side and keep them in different folders. When I have to run a script on both client and server I just use remoteExec with the specific flag tho
Your init scripts run on every client including server this is why you need the condition such as isServer or isDedicated or local
initPlayerLocal.sqf will run on the server, too?
No for dedicated yes for hosted
And yes if you are a host it will run on server which is you
yea I am aware of that
This is why you are having problems? You init server and init player local both run on your pc when you are host?
i'm assuming the code in initServer isn't being duplicated in initPlayerLocal?
at least, i'm hoping so 😄
Both int player local and init server are artificial constructs they are not called by the engine only init.sqf and init.sqs are true init scripts
If it is not working on dedicated, then one reason could be stuff in initPlayerLocal.sqf that should be in initServer.sqf
The other two are called from other scripts
Just what I wrote
yes but what is the point of writing it? initServer and initPlayerLocal run without any additional input
Both int player local and init server are artificial constructs they are not called by the engine only init.sqf and init.sqs are true init scripts
huh? Who calls initPlayerLocal then?
yeah exactly ^
Some script
init.sqf runs at the end, after initServer and initPlayerLocal
and it's perfectly fine to use the two separate ones
in fact it's probably a better idea to do that
cleaner
but one has to be sure that one is making proper assumptions of what can run on the server what can run on the client
Both called from initFunctions.sqf
http://www.catb.org/~esr/faqs/smart-questions.html Here is a good read for everyone who doesn't know how to properly ask a question. It's a bit long maybe...
A well asked question contains 89% of the answer
adwetch na waprosui.
Don't have russian keyboard here. That's what I learned in school. "The answer is in the question"
Hi
Can someone help me find flaws or better ways of doing a money system
I wanna make the money into a global and public variable <UID>_money
If money changes, it will run a function on the server to change it
So, what if I wanna buy something
I buy a rifle, it runs remote executes a function to check the money and then reduces money and remote executes a function back on the client
I feel like this might have problems, like it makes too much traffic
hmm
I imagine ~20 clients trying to transact ~10 times in the span of 15 seconds
so 13 transactions a second average?
Would there be any issues with this?
Like response from server would take long
etc
Any alternatives?
I can't think of a alternative besides handling money clientside
What are you building, a stock exchange?
How to disable the respawn button in the options menu via script?
cant find something like disableRespawn or such
I found snippets like
while {true} do {
_ctrl = (findDisplay 49) displayCtrl 1010;
_ctrl ctrlEnable false;
};
from 2013
hope there is a more hipster way already
doing it in a loop is a waste of time really.
respawnButton = 0; in the description.ext should do it.
In a script you could do something like this
//description.ext
onPauseScript="script.sqf";
//script.sqf
((_this select 0) displayCtrl 1010) ctrlEnable false;
There is no normal EH possible?
onPauseScript is the eh
yea
but I like to have my EHs tidy in one file
and not scatted here and there (description.ext)
not for this i dont think so
@tough abyss Reading into the Things you mentioned. Could i check for parentobject also? Or does editing the existing event handler to check for the nearsupplies also more sense?
@sturdy cape second weaponholder object returned by InventoryOpened if not null is the second container you see in inventory menu and can exchange with as well. If it is null you only have one weapon holder your inventory is connected to. If you go overriding event handler route you don’t need nearSupplies
AI UGL Ammo Swap
I can manually swap the ammo in an AI Grenadier's Weapon by opening an AI Grenadier's backpack and swapping the ammo in the UGL itself. He then fires the correct ammo.
Could someone offer a pseudo-code to writing this as a script -- eventually an addAction?!
Magazines Object returns an array of available magazines. There are just so many functions for someone who doesn't have years of experience with Arma scripting. ;0)
@still forum moved it here and clarified the query ;0)
So for some reason ctrlAddEventHandler isn't working, I looked at it, and it's returning -1, which should mean that it failed. Could someone help me with this?
Code is:
_return = _selectButton ctrlAddEventHandler ["onButtonClick",
{
diag_log "It works!";
}];
diag_log format["%1", _return];
I don't see any clarification on the query. My questions still stand
What do you want to do? replace the magazine in the UGL or in his inventory
@still forum
I would like to replace the ammo in the weapon from the ammo in the AI inventory (i.e. if he has it, he can now fire it).
There is no EH onButtonClick for scripted EH
what
There is ButtonClick
Check the wiki FFS
The wiki
Literally says to use onButtonClick
You lie
Add an event handler (User Interface Event Handlers) to the given control
Oh it's in another one
ctrlSetEventHandler says what I need
replace the ammo in the weapon from the ammo in the AI inventory You mean make him reload that ammo? @young spade
but ctrlAddEventHandler doesnt say it
It says there in an orange box
Only blind cannot see
Ok im blind then
https://community.bistudio.com/wiki/action
https://community.bistudio.com/wiki/Arma_3_Actions#LoadMagazine
Getting the correct muzzle might not be the most trivial thing
@young spade
ctrlAddEventHandler doesn’t say onButtonClick either
But it has a link to EH page with all EHs and it says it right there
I don’t know the reason BI decided to make these names differ, probably to keep Arma consistently inconsistent, but it sure is confusing to people that do not like wiki
@still forum
Thank you - I shall have a look at those refs. Much appreciated.
@tough abyss "User_Interface_Event_Handlers" page > https://gyazo.com/db7c926ca1ae947be631634cb03fa2f4
You're an hour late.
I'm not understanding this phenomenon. Cannons one through four are NATO Scorchers with NATO crews. Cannons five through eight are CSAT Sochors with CSAT crews. First of all, I discovered that while both cannons one and five would agree to fire at an empty target:
Cannon1 doartilleryfire [getpos Dummy, "32Rnd_155mm_Mo_shells", 2];
Cannon5 doartilleryfire [getpos Dummy, "32Rnd_155mm_Mo_shells_O", 2];```
They would refuse to fire at each other:
```SQF
Cannon1 doartilleryfire [getpos Cannon5 , "32Rnd_155mm_Mo_shells", 2];
Cannon5 doartilleryfire [getpos Cannon1 , "32Rnd_155mm_Mo_shells_O", 2];```
I could not decipher the reason, but I did find a solution in alternative syntax. This would work:
```SQF
Cannon1 doartilleryfire [Cannon5 getpos [1, 0 + random 360], "32Rnd_155mm_Mo_shells", 32];
Cannon5 doartilleryfire [Cannon1 getpos [1, 0 + random 360], "32Rnd_155mm_Mo_shells", 32];```
While this would not work:
```SQF
Cannon1 doartilleryfire [Cannon5 getpos [0, 0 + random 360], "32Rnd_155mm_Mo_shells", 32];
Cannon5 doartilleryfire [Cannon1 getpos [0, 0 + random 360], "32Rnd_155mm_Mo_shells", 32];```
What's more bizarre is that in all cases where they refused to carry out their fire mission, the NATO cannon one would always fire off one round, while the CSAT cannon five would refuse to fire completely.
Regardless, after finding this solution, I began attempting to have eight cannons fire upon each other with this block:
Cannon1 doartilleryfire [Cannon5 getpos [1, 0 + random 360], "32Rnd_155mm_Mo_shells", 32];
Cannon2 doartilleryfire [Cannon6 getpos [1, 0 + random 360], "32Rnd_155mm_Mo_shells", 32];
Cannon3 doartilleryfire [Cannon7 getpos [1, 0 + random 360], "32Rnd_155mm_Mo_shells", 32];
Cannon4 doartilleryfire [Cannon8 getpos [1, 0 + random 360], "32Rnd_155mm_Mo_shells", 32];
Cannon5 doartilleryfire [Cannon1 getpos [1, 0 + random 360], "32Rnd_155mm_Mo_shells_O", 32];
Cannon6 doartilleryfire [Cannon2 getpos [1, 0 + random 360], "32Rnd_155mm_Mo_shells_O", 32];
Cannon7 doartilleryfire [Cannon3 getpos [1, 0 + random 360], "32Rnd_155mm_Mo_shells_O", 32];
Cannon8 doartilleryfire [Cannon4 getpos [1, 0 + random 360], "32Rnd_155mm_Mo_shells_O", 32];```
Cannons one through five fired correctly, but three CSAT cannons animate a little bit, but then refuse to fire. Could anyone explain this or a solution to it?
I was originally conducting this experiment to see if artillery could be suppressed during a fire mission. The answer is no, they can not be suppressed during a fire mission conducted as described above.
maybe inRangeOfArtillery will helps, also 0 + random 360 > random 360
Well, the artillery pieces are all exactly two kilometers from their target. How might I apply inRangeOfArtillery?
I don't understand your tip on use of random.
inRangeOfArtillery > Returns true if all given units are able to fire at given position with given magazineType
Interesting, so it doesn't just tell you range, but if the target is valid at all?
position, not target
I don't understand your tip on use of random a random number plus zero is just the random number
Roger. Good tip, I think there was a typo, haha.
228 + 0 = ?
No, that makes sense, but 0 + random 360 > random 360 means zero plus random three sixty is greater than random three sixty, so I couldn't figure out what you meant.
The > in that sentence was intended to be interpreted as "change X to Y"
Makes sense, I've just never heard of or seen that.
--> for next time 😛
random - value from 0 (inclusive) to x (not inclusive)
technically though ... 0 + random <NUMBER> is way slower then just using random <NUMBER>
Sounds good. I've already changed it in my experiment.
it's the same as 0 + <random number>
yes
just that in SQF nothing gets optimized away
so you waste a full command cycles for personal style
GroundWeaponHolder GroundWeaponHolder_Scripted WeaponHolderSimulated WeaponHolderSimulated_single <- did i miss some of them here? thanks.
Weapon_Empty
––> is c++ operator
no it's not
i-- ?
i--?i-->1:i--<1
[spoiler] https://i.imgflip.com/2ig1d6.jpg
hello, is possible to get UI control type by script?
yes
Config commands
you need to know their config path tho
If they are config UI's...
https://community.bistudio.com/wiki/ctrlType well... That was easy
turns out CTRL+F works 😄
@still forum thank you men!
You should remember those by heart now!
@unborn ether "all" call BIS_fnc_exportGUIBaseClasses > https://pastebin.com/3wn5fG7B
can anyone help me out with the owner command for a script im working on
im getting an undefined variable when i use the setowner command
post the portion of the script where you use owner
```sqf
// code here
```
copy paste that ^
// code here
'''sqf
private ["_Veh", "_playerVeh"];
_Veh = _this select 0;
_playerVeh = _this select 1;
_playerVeh setowner (owner _tr_Vehuck);
'''
whoops
` < not > '
`
private ["_Veh", "_playerVeh"];
_Veh = _this select 0;
_playerVeh = _this select 1;
_playerVeh setowner (owner _tr_Vehuck);
ah
_tr_Vehuck = <value>
can it be any value?
yes
the value is the clientID?
so why dont i just use the value instead of defining _tr_Vehuck as a value
oh ok
Owner only works when it's ran on the server
Now, I'm a bit confused
You can run the following on all clients and server
private _owner = owner myObject;
On normal clients it would always be 0
On the actual server machine
i see
It would return an actual owner
well i just a owner
cause im trying to run an animation
via event handlers
and it needs to set an owner
if i get out of the vehicle
and back in it
setOwner also only works if you run it on the server
the event handler wont work
also
private ["_Veh", "_playerVeh"];
_Veh = _this select 0;
_playerVeh = _this select 1;
``` ->
```sqf
params ["_veh", "_playerVeh"];
```👌
so i dont need all that
yes
replace all that with that one line
ok
params ["_veh", "_playerVeh"];
_tr_Vehuck = "12"
_playerVeh setowner (owner _tr_Vehuck);
this looks right?
Hey, here's a really stupid question
are there objects that just don't work with synchronizedObjects?
I'm trying to use an invisible wall to fake interaction with a door
more precisely, I want to teleport players up the to the roof of a tanoa building
but synchronizedObjects returns an empty array [] 🤔
Even more interestingly, calling synchronizedObjects on the game logic entity it's synchronized to returns an array containing the invisible wall
any ideas how I could fix that or achieve something similar?
No it is not right, owner takes object not string
How are the chances the game just hates us all?
its just not our day
any way to get all items on a tree view ?
hello, got a question, is a https://community.bistudio.com/wiki/BIS_fnc_customGPSvideo actually working? i´m getting an error that RSC layer name cannot be empty string when i call it, in A3 the function is written a little bit different then in A2, the only parameter for it is just a path to video
do u have the gps layer opened?
yes
i remember that it was working in A3 alpha, as it was the last time i was using this, but now it doesn´t work
here u have the code
of the script
maybe can help u
any way to get all items on a tree view without do 300 loops?
hello, i have listBox filled data, but part of rows out of slider range. Is possible to change lb SliderRange?
@meager heart when i use on filled listbox - i take [0,0]
list box != slider...
also don't remember who was that (was so long time ago, almost like... 10 hours), but he said something about CTRL+F and it kinda helps in some cases
ok, discord not needed, just all the time press CTRL+F 😃 i was searching solution, but not find. That why i ask for help here.
🤷
I mean CTRL+F on the Arma wiki
https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3 -> CTRL+F -> Slider -> BAM!
i don't ask about slider i ask about slider in listBox. But for now i find solution
You mean your listbox content overflows so scrollbars appear? Resize list box with ctrlSetPosition
He means a slider in a listbox
exactly like he said 😄 https://discordapp.com/channels/105462288051380224/105462984087728128/492979370416275457
You know slider.. That thing to select a number between 0 and 1
I guess as an element in the listbox
I have not a slightest clue what they want tbh
Yeah not that sure either.. i don't ask about slider i ask about slider 🤔
type slider expected slider not a slider
I guess a screenshot of the problem would help
that was the screenshot https://imgur.com/a/7I40fAj
He already solved the problem anyway. But he doesn't tell us how
doesn't matter where the unit is
it teleports it into vehicle
look at "See also" for other slots
for AI you might want to assignAsCargo first
You can use CARGO placement
"CARGO" - The unit will be created in cargo of the group's vehicle, regardless of the passed position. If group has no vehicle or there is no cargo space available, the unit will be placed according to "NONE".
eh alright thought i could spare one step ^^
and sadly CARGO is not the solution for my needs but still thanks though
hey everyone
hey pal
#offtopic_greetings
hey ntsc
#offtopic_broadcast_standards
#offtopic_fakechannelnames
@dusky pier I see you typing for about 5min now... what is this craziness
@still forum , sorry was afk. I just added another listbox with ctrlTypes and added on this list EH , if i select in listbox with types - another list display all controls with that type. Got this https://imgur.com/a/EyY7BNi
@frigid raven just my bad English and nothing else 😄
@dusky pier 🦌
Which wiki page shows all parent classes for LandVehicle etc
nevermind found it
I'd like to find the child classes. How could I change this around?
fnc_printParents =
{
disableSerialization;
if (!isClass _this) exitWith {hint "Argument is not a config Class"};
private _parents = [];
while {!isNull _this} do
{
_parents pushBack configName _this;
_this = inheritsFrom _this;
};
reverse _parents;
private _tv = findDisplay 46 createDisplay "RscDisplayEmpty" ctrlCreate ["RscTree", -1];
_tv ctrlSetPosition [0,0,1,1];
_tv ctrlSetBackgroundColor [0,0,0,0.5];
_tv ctrlCommit 0;
private _path = [];
{
_tv tvAdd [_path, _x];
_path pushBack 0;
}
forEach _parents;
tvExpandAll _tv;
};
(configFile >> "CfgVehicles" >> "ALL") call fnc_printParents;```
finding all child classes theoretically would require to iterate through literally all child classes of those in the same layer as the parent class
Hmm arma's format command looks very primitive 😕 guess if you want any C style formatting you'd do your own magic with round and other functions; or even write that all into a minilibrary if you really need that so much
wonder what happens if I just let it puke out floats like those created by random()
varis if you want C++ try Intercept
When you learn different language and it doesn’t look like c, what do you do?
Complain loudly of course! 😁
Strangely most languages look like C - even PERL reminds you of C a lot when I write it
google lolcode
@tough abyss Intercept looks interesting though often an overkill I guess... all I want to do is write server side debug logs for now 😁
@tough abyss not learn the language
I tried myself on ELISP - since I use emacs and haskell
Fun but... not very motivating somehow 😄
In sqf once you realise there are only 3 types of commands and the type of argument should match, there is nothing else to it
🤷♂️🤷♂️ If there is a method for it use it @drowsy axle
hi, anyone knows how lbdrop event works ?
lddrag event seems ok, but lbdrop is not handle
Fired on: Drag & drop operation finished.
What is the best way to get the position on the floor of a building? I am using 'BIS_fnc_buildingPositions' and create a groundweaponholder on that position. But it is below the floor level on the actual ground. Is there a way to circumvent that?
Thought about ASL/AGL conversion but that didnt solve it either. Just adding a certain height makes weapons floating or still under the floor for different buildings...
just setPosATL for your weapon holder, maybe
that is looking quite good. Thanks
ok just fix the wiki for lbdrop
player spawn {
private _buildings = (_this nearObjects ["Building", 100]) apply {_x buildingPos -1} select {count _x > 0};
private _posList = selectRandom _buildings;
private _holder = "WeaponHolderSimulated" createVehicle [0, 0, 0];
_holder addWeaponCargoGlobal ["launch_MRAWS_green_rail_F", 1];
_holder addMagazineCargoGlobal ["MRAWS_HEAT_F", 1];
_holder setPosATL (_posList select 0);
};
```this ^ https://gyazo.com/40c349db1a96664d02655e1d8ef6cadf
@knotty mantle
@rocky mortar Drag&Drop EVH are weird sometimes. There was a situation where I couldn't fire LBDrag even if listbox is canDrag = 1;.
: //
it seems to be relative to control groups that act like layers
when a control is inside a control group, lbdrop can be fire only at control group level
i dont know how to retrive that this specific control should be the destination only from the cursor pos
controls groups weirdness © (always there) 🤷
:X
So far I didn't find how to grab controls by mouse pos.
Besides adding a damn MouseEnter over every possible control, which also doesn't always trigger for some reasons.
Nice fix, it basically said the same thing only without link
Wreck is also a vehicle, if it has storage on it - it will be accessible.
No you just don't add cargo global, vehicle should have inventory storage.
Props are still a part of CfgVehicles and if you make maximumLoad? > 0 then it should have a gear, #arma3_config knows it better tho.
Anyways forget about vanilla wrecks.
I was talking purely in the context of vanilla wrecks. The opposite could he the case for mods.
Still you can use addAction for that purpose, create a WeaponHolder below a player on use and fill it instead.
class Intel {
file = "Intel\Server";
class showIntelProgress {};
class addRandomIntelItem {};
class updateIntelProgress {};
}
class Intel {
file = "Intel\Client";
class deliverIntel {};
class initIntelmaster {};
}
I want to have two separate folders but keep the parent class name. Is it possible that way? Or do I have to rename them to like Intel_Server and Intel_Client ?
I want to have two separate folders but keep the parent class name
like that, maybe >
class Intel {
class showIntelProgress {file = "Intel\Server\showIntelProgress.sqf";};
class addRandomIntelItem {file = "Intel\Server\addRandomIntelItem.sqf";};
class updateIntelProgress {file = "Intel\Server\updateIntelProgress.sqf";};
class deliverIntel {file = "Intel\Client\deliverIntel.sqf";};
class initIntelmaster {file = "Intel\Client\initIntelmaster.sqf";};
};
```check the files names ^ @frigid raven
Yea I see but well I stay with the other approach just naming the parent Intel_Client etc. I think
works as well
up2u
Hello guys, so i have a little issue, so i have an MP Mission for a dedicated server, thing is i wana put an intro video (i know how to) but thing is i just want it to be shown to players at the start not JIP or if possible players that join within the first 30 or 60 seconds, is it possible?
@late gull https://discordapp.com/channels/105462288051380224/105462984087728128/493179324934127626 Yes. #arma3_config and making a mod. Not possible via script.
@golden storm
serverTime, no?
no
players that join within the first 30 or 60 seconds
I'm like... 99% sure he means after missionStart.
Not after last server restart
Also serverTime has sync problems... Which overcomplicates everything
so time usage would be server-side
oh, and I realised just now that serverTime was about restart, and not a synchronised time
didJIP + read variable... (variable was set on the server after mission start) 100%
but just time also should work 👌
well, isn't time starting at zero for JIP players too?
yep ^
so server-side:
sleep 60;
DontShowIntro = true;
publicVariable "DontShowIntro";```
and client-side:
```sqf
if (not isNil "DontShowIntro") exitWith {};```
yeah, something like that
Hmmm so trying to solve the aforementioned intro problem [he] came up with this:
Init.sqf:
if (isServer) then {
[] spawn {
sleep 60;
DontShowIntro = true;
publicVariable "DontShowIntro";
};
}
if (hasInterface && isNil "DontShowIntro") then {
intro_video = [] execVM "intro.sqf";
waitUntil {scriptDone intro_video};
};
Intro.sqf:
cutText ["","BLACK FADED",2];
0 fadeSound 0;
0 fadeMusic 0;
enableEnvironment false;
enableRadio false;
intro_done = false;
sleep 2;
private _video = ["video\intromedio.ogv"] spawn BIS_fnc_playVideo;
sleep 5;
waitUntil {scriptDone _video};
cutText ["","BLACK FADED",4];
enableEnvironment true;
enableRadio true;
12 fadeSound 1;
12 fadeMusic 1;
sleep 4;
cutText ["","BLACK IN",2];
sleep 4;
intro_done = true;
Yet it will still not play the intro video, anyone has any idea?
I'm guessing it has to do with this part:
cutText ["","BLACK FADED",4];
enableEnvironment true;
enableRadio true;
12 fadeSound 1;
12 fadeMusic 1;
sleep 4;
cutText ["","BLACK IN",2];
sleep 4;
intro_done = true;
but im not sure
No? 😢
if (isServer) then {
[] spawn {
sleep 60;
DontShowIntro = true;
publicVariable "DontShowIntro";
};
}
Is missing ; at the end of isServer part - syntax error. Secondary, be sure that sleep 60 means that one minute after post-init is passed - you disable showing your intro since
if (hasInterface && isNil "DontShowIntro") then {...}
Is telling that. I'm not sure anybody will be fast enough to join to actually see some intro.
//--- initServer.sqf
[] spawn {
sleep 60;
missionNamespace setVariable ["var_skipIntro", true, true];
};
//--- initPlayerLocal.sqf
[] spawn {
if (missionNamespace getVariable ["var_skipIntro", false]) exitWith {};
cutText ["","BLACK FADED", 2];
enableEnvironment false;
enableRadio false;
0 fadeSound 0;
0 fadeMusic 0;
sleep 2;
["video\intromedio.ogv"] call BIS_fnc_playVideo;
cutText ["","BLACK FADED", 4];
enableEnvironment true;
enableRadio true;
12 fadeSound 1;
12 fadeMusic 1;
sleep 4;
cutText ["","BLACK IN", 2];
};
```something in that direction, maybe ^ @golden storm 😃
8:51:48 Suspending not allowed in this context
8:51:48 Error in expression <1s;
_object setVariable ["effects",[]];
sleep (4 + random 20);
};>
8:51:48 Error position: <sleep (4 + random 20);
};>
8:51:48 Error Generic error in expression
[] spawn {
"test_EmptyObjectForBubbles" createVehicle [0,0,0];
};
🤷
the game get stuck at this point
Should i open an issue? or wut?
You can't have suspension in unscheduled environment. The error says it all @late gull
what about spawn?
That's not what it's throwing errors for
spawn will send the code to scheduled enviroent
in your spawn code there is no suspension
i think these are internal erros from that bubbles
I don't think so, it would give which script was throwing errors. I don't think you have the entire error pasted
mate, which script is the error coming from?
[] spawn {
"test_EmptyObjectForBubbles" createVehicle [0,0,0];
};
no script, just run that in console xD
I think it might be a invalid way of creating the object, it doesn't seem to be properly working with createVehicle yes. Submit a ticket if you feel 🤷 @late gull
oki, ty
Good day beloved ppl with knowledge I gonna drain
@late gull Some mod has an init eventhandler on that. And it's bugged.
there is no "internal code" that can throw "internal errors" inside createVehicle
it's an engine command
throws knowledge at @frigid raven's head and severely injures him
knowledge was very effective
@still forum I'm able to reproduce with vanilla?
Then it's the "vanilla" mod
😃
🤔
Can confirm, vanilla Arma, latest update, same error when creating the "test_EmptyObjectForBubbles" vehicle.
afaik after this > "Tweaked: When test_EmptyObjectForBubbles, test_EmptyObjectForFireBig and test_EmptyObjectForSmoke are deleted, all their emitters are now deleted automatically"
that thingy broken ^
(sitrep v1.72)
was using this test_EmptyObjectForSmoke after that disaster ^ and was no issues 😃
so... no bubbles anymore...
Heh,
is it possible to reference local client when passing code to remoteExec?
[format["%1",player isEqualTo objNull]] remoteExec["hint",_owner];
Returns true,
_owner is just clientOwner from playerConnected EH
clientOwner should return the local ownerID
Otherwise just execute code and use https://community.bistudio.com/wiki/remoteExecutedOwner
I need object reference like player gives me, remoteExec is targeting the correct player just fine.
also clientOwner and _owner param from the playerConnected eh is the same...
correct, player does not have a valid object reference though. That is what I am saying
Yes, slide dick I am using pc eh
Eh. Such hacky.
@high marsh you started seeing dicks too often in places where is none... i hope you're fine and still not on the dark side 💐
@meager heart okay, slight tick.
if(isServer) then
{
removeAllMissionEventHandlers "HandleDisconnect";
removeAllMissionEventHandlers "PlayerConnected";
addMissionEventHandler["HandleDisconnect",
{
params["_unit","_id","_uid","_name"];
profileNamespace setVariable[_uid,getUnitLoadout _unit];
saveProfileNamespace;
diag_log format["%1: %2",_name,profileNamespace getVariable _uid];
}];
addMissionEventHandler["PlayerConnected",
{
params["_id","_uid","_name","_jip","_owner"];
diag_log format["%1: %2",_name,profileNamespace getVariable _uid];
{
if(clientOwner isEqualTo _owner) then
{
[_x,profileNamespace getVariable _uid] remoteExec["setUnitLoadout",_owner];
};
} forEach allPlayers;
}];
};
No dice
Data from rpt:
"Bryce: [[""arifle_AK12_GL_F"","""","""","""",[""30Rnd_762x39_Mag_F"",10],[],""""],[],[],[""U_B_CombatUniform_mcam"",[]],[],[],"""","""",[],["""","""","""","""","""",""""]]"
Mission id: 797973cdff8b483c11a4bc7e809873c67f8eab8a
"__SERVER__: <null>"
"Bryce: [[""arifle_AK12_GL_F"","""","""","""",[""30Rnd_762x39_Mag_F"",14],[],""""],[],[],[""U_B_CombatUniform_mcam"",[]],[],[],"""","""",[],["""","""","""","""","""",""""]]"
Unaccessible
"Bryce: [[""arifle_AK12_GL_F"","""","""","""",[""30Rnd_762x39_Mag_F"",14],[],""""],[],[],[""U_B_CombatUniform_mcam"",[]],[],[],"""","""",[],["""","""","""","""","""",""""]]"
ggwp
@meager heart clientOwner could be different from _owner, some weird behaviour on hosted, see note on biki
How to make an AI throw a chemlight_red?
make it play the throw animation and spawn a chemlight infront of it
clientOwner could be different from _owner, some weird behaviour on hosted, see note on biki where? never met that behaviour
forceWeaponFire with "ChemlightRedMuzzle"
clientOwner could be different from _owner, some weird behaviour on hosted Well... It should be
on hosted clientOwner returns the server's id
and _owner is the ID of the connected player
if they are the same then something is seriously wrong
@high marsh on PlayerConnected the player object might not exist yet
might be better to use respawn eh
The object exists but it is not player yet
I have an issue when using the Respawn event. I have a marker on the map called prison. I want my player to get ported there on respawn.
_player setPos (getPos prison);
Using this snippet. Debugging it shows me:
14:17:26 (0:00:05) DPL.PRISON - DEBUG! old_pos: [10,10,0]
14:17:26 (0:00:05) DPL.PRISON - DEBUG! new_pos: [12049.5,12604.3,0]
Tells me that I am using this command a bit too soon. What would be your clean approach to handle this situation?
Because the player is not send to the new_pos I forget to say
"too soon" ? what does that mean?
You mean something else is porting it back after you port it?
No. I respawn and the logic runs successfully and also the debug msg appear to be right - so getPos on player actually yields the position of the prison but the spawned player is still on his old position
Running the same script in the debug console after spawn it finally works
Gives me the hint of a timed dependency when setting the player position within a Respawn Event
or wait...
Well just spawn your script and sleep one or two seconds?
The param _unit... is it the new spawned player reference or the dead one?
because the scnd param _corpse is refererring to the corpse tho. Therefore I thought _unit is the new spawned one hmpf
ah k I think I got it
I have overwritten the _unit param by the Respawn event with player as I called my EH script
therefore it still referred to the "old" player before the respawn
Is that true that Agents consume less performacy than normal units? and is there any prof of it and documentation?
@frigid raven pass position as the return value of the Respawn EH, it will spawn unit there, no need to setpos
Yes to agents consuming less
any details on that "a error"?
The example is quite old SoldierWB could be a Arma/Arma 2 thing
Its says generic error
agent = createAgent ["B_G_Soldier_F", position player, [], 0, "FORM"];
also makes a generic error but creates the agent
createAgent ["B_G_Soldier_F", position player, [], 0, "FORM"];
Making it like this stop the error
and it returns Agent 0xf97760c0
So..
createAgent ["B_G_Soldier_F", position player, [], 0, "FORM"];
doesn't work,
But
createAgent ["B_G_Soldier_F", position player, [], 0, "FORM"]; works fine?
🤔
no, i removed the "agent ="
Well duh
seems like i cant name the Agent 0xf97760c0
yeah, thats right
agent47 = createAgent ["B_G_Soldier_F", position player, [], 0, "FORM"];
it works.
can you change the exemple?
I will ye
WTF!? Congrats on discovering the error 👍
Might as well update it with A3 class, Dedmen
what error?
that someone forgot a _ at the example?
It's just an example and it still works like that. It shows you how the command can be used
It throws error therefore it has error
You probably forgot when once upon a time you were learning sqf.
Nothing is worse than an example that doesn’t work
No I don't
before I was learning SQF I understood the basics and knew what a variable assignment is
It's really not that hard ^^
is there a way to check in the debug console or somewhere in game if my function it's listed and compiled?
pls dont say using [] spawn :p
I... didn't...
haha nice
oki ty
What abilities does cfgFunctions have over a "variable" function?
none
cfgFunctions are also "variable" function
there are no non-variable functions
cfgFunctions is just a list of files that the game should compile
instead of doing it manually
what?
In terms of load order
no
preInit > mission.sqm > init.sqf > postInit
no idea what you mean with loadorder of description.ext?
do you mean scripts or objects or what?
Well i'm assuming that the description.ext is ran before init.sqf
Okay.
mission.sqm is read first. Then description.ext
I might switch over to cfgFunctions.
that's a good idea
😛
easier to keep everything organized
Yeah it is. But it "was" unnecessary when my scripts wouldn't work.
What would be the best way to preload script-selected images as soon as possible? As far as I remember trying to display non-loaded images on UI makes title display disappear until they load.
Preload on different display, wait a little then create main display which should display these?
Speaking about title displays here.
Looking for ideas or experiences with this.
preloadTitleRsc?
I assume it preloads config-defined assets only, I need to preload script-selected images, I can't have all possible images mentioned in the config from start.
in the past people just displayed it offscreen to preload it
Yeah that's what I'm going to do, I wonder if preloading images like this on different title display will not cause my target title display to disappear until images are loaded.
I just saw a vid on youtube where sb. had a smartphone item and was taking pictures with it. Can these picture held as items? Like giving to another player and he can look at it? Or like storing them in the actions of a computer prop to view them there? Just having ideas...
hmm maybe something with Leaflets
I am trying to convert local rotation to global rotation and it is proving far more difficult than I thought it would be
if I manually rotate an object along it's own x axis by 90 degrees, how would I be able to calculate the same global value that it would create?
for example, say I am trying to rotate 100 different objects with their own random x, y, and z rotations by 90 degrees on each of their own individual axis
@late gull yea that'll do
I had an idea where there is a "ghost" camerman that cannot be seen that takes pictures if your unit's run through a trigger
And I wanted those pictures to be seen by the players
hypothetically that would be possible?
🤔
With custom extension probably
meh alright
clientOwner could be different from _owner, some weird behaviour on hosted, see note on biki
On hosted server there could be some inconsistency between clientOwner, owner and object creator id, especially in missions started from save. On the dedicated server this command however works reliably.
```can't see here something about `clientOwner` `owner` vs player connected eh _owner param ^ @tough abyss
also i thought we was talking about dedicated only...
addMissionEventHandler ["PlayerConnected", {
diag_log _this;
diag_log clientOwner;
}];
21:34:47 [2,"76561198045255537","sldt1ck",false,2]
21:34:47 2
local host ^
on hosted clientOwner returns the server's id and _owner is the ID of the connected player if they are the same then something is seriously wrong 🤷
Have you tried to load from save?
And do you know what is object creator ID and how it works?
nope about save... 😃
Ok ehm I have a new confusion here
No confusion allowed
player setVariable ["logged", true];
[player] remoteExec [{_player getVariable "logged"}, 2] // returns false
it's is a bit trimmed and not semantically right because params etc. is missing
player setVariable ["logged", true, true];
In fact I just wanna know if a player object when used as argument on a server side call - is it's variable state delivered as well?
oh
gonna read for that now
varspace setVariable [name, value, public]
https://community.bistudio.com/wiki/setVariable
it is local without third param.
What is actually happening with public true?
does it deliver the variables state when used as argument?
just curious
I guess it does the same as: https://community.bistudio.com/wiki/publicVariable
Public variables are also persistent
RemoteExec is not by default
I’d ban the use of public variables
There is nothing remoteExec cannot do
But is more flexible and secure
Does anyone know if it would be possible to directly rotate an object on it's own local axis?
Like in eden you can toggle between local and global coord space for the translation/rotation widgets
local and global axis do not exist, what you have in eden is when widgets > X points to the east aka "global" or X points to the right of the object aka "local"... 😃
and yes it is possible to rotate any "editor placed" object...
lest say... with this > https://community.bistudio.com/wiki/setVectorDirAndUp
@runic surge
local and global axis do not exist, what you have in eden is when widgets > X points to the east aka "global" or X points to the right of the object aka "local"
that's what I mean
and yes it is possible to rotate any "editor placed" object...
yeah but I'm trying to rotate and object relative to itself
where [0, 0, 0] would be it's default 'local' position, and [90, 0, 0] would rotate it along it's own x axis by 90 degrees
I am trying to do what the widget does (e.g. rotating the object 90 degrees on its x axis) but through scripting and for multiple objects
also setVectorDirAndUp works relative to world rotation like all the other rotation related commands
maybe just setVectorDirAndUp or vectorDir + setVectorDir
also setVectorDirAndUp works relative to world rotation like all the other rotation related commands
yes "like all the other rotation related commands"
did you tried just getDir and setDir ?
those work for the Z axis which I could use to align the rotation to world space rotation and then maybe reset the orientation after I have changed what I needed to but I haven't tried that just yet
wait nvm that wouldn't work
not sure what I was thinking there
_object setVectorDir [sin 45, cos 45, 1];
//--- the same as
_object setDir 45;
also we have BIS_fnc_vectorDirAndUpRelative that is vectorDirAndUp of object A relative to object B...
Floating point precision loss visualisation https://twitter.com/d_m_gregory/status/1044008750162604032?s=21
Pretty good
also we have BIS_fnc_vectorDirAndUpRelative that is vectorDirAndUp of object A relative to object B...
I am attempting to set the relative rotation with 1 object and combining the returned value with the values that are supposed to pitch the object forward still just rotates along the global x axis
I'm not sure what your getting at but I'm trying to rotate the object on an axis that stays aligned to the object
also that is interesting @tough abyss
Before Rot: 13.928, 343.723, 197.378
After Rot: 288.941, 16.661, 197.012
This is before and after manually rotating the x axis 90 degrees with the widget and local coord space toggled on
I am simply trying to find out if this is possible to accomplish with just scripting
Does anyone know of any methods of detecting people that spoof UIDs? Had a bunch of people coming on my server recently and spoofing their UIDs to other players or admins and breaking everything
The obvious solution would be to check GUIDs, but I haven't found any way of doing so with scripts
Also have issues with the same cheaters coming and sending vehicles flying with no script logs whatsoever as it's apparently a "memory editing" cheat
Any script related solutions that can be used to detect this?
_x setVectorUp [cos (getDir _x + 90), -sin (getDir _x + 90), 1 / (tan 90)];
I think this might work
nvm it is only partially right
hello my beloved brothers
Fetch their uid server side & crosscheck with what they report @loud spruce
https://gist.github.com/X39/709ecbf88c5fda594586c9b995c8c6a0 might be helpful for that
@queen cargo what can it be used for ?
thank you
Maybe there is more context to that
Just to clarify - that dude use global vars everywhere.
Context is now known to you 😄
What has global to do with private?
@coral lynx depending on the usecase, that might actually be correct
though... i doubt that you never would have the need for private variables at all
but when not including magic variables, there are plenty of usecases where you can live without them entirely
just that the mentality he has ... is complete and utter bs
Apart from some weird avoidance of spaces between command and arguments I don’t see anything extraordinary, and he does use private. Now let’s have a look at your code. @coral lynx
everytime i see some arma life code ... something dies inside of me ... so horrible by design
You didn’t see original DayZ mod code?
things i never want to see: life code, dayz code, my old XMedSys code
but in case you are ever bored as fuck and got way too much time on your hand, feel free to do a code review on this @tough abyss 😃 https://github.com/X39/Project-Alcatraz/tree/master/x39_xmed_scripting/ClassTransition
i may even get this done at some point in time ....
probably when arma 4 launches
someone is working on arma 4 cherno cti framework atm... so...