#arma3_scripting
1 messages · Page 420 of 1
So it will only execute if that guy JIP's which is not possible
Because when he JIP's he is a new unit. Thus he can't be that unit that was in thisList a couple minutes ago
well, that code is in a repeatable trigger server only, so that JIP still will not apear in the thislist?
It's just not possible
The JIP'ing player would have to have existed earlier before he joined
You can't exist on a server before you even join obviously.
Hum... so the JIP player that joins the server, spawns and hit that trigger just not exist?
At the point where a JIP player enters a trigger. he is already ingame and not JIPing
much better than previously 😄
Metaphysics of arma
Though I guess if you have AI enabled and the JIP player takes possesion of a AI that was in thisList earlier it could work. But do you really want some player that might be 2km away from some vehicle be teleported into that vehicle he might have been near an hour or so ago?
"Oh my game is lagging. I'm gonna rejoin quick" <rejoins> "What? Why am I suddenly in a vehicle over 3km away from my team?"
ah shit forgot a case.
@lone glade
https://github.com/alganthe/ACE3ganthe/commit/26d74528fa9e7a0f928b69aa582870a66ecf52d4#diff-0abe01cbd43b14f0badec5b3d1714c05R58
if (true && _condition) then XD
Well, the teleport is when he spawn, go to the armory, a hint apears that he just needs to leave the base to teleport and then depending on how far the mission goes we weill be either teleported to a humvee with a .50, on a predeterminated area in the mission or on a blackhawk wtih a minigun
If you really wanna know
hint "Teleporting...";
if (!triggerActivated CarsComeIn) then {
[thislist select 0,car_1] remoteExec["moveInGunner",thislist select 0,true];
[thislist select 0,car_2] remoteExec["moveInGunner",thislist select 0,true];
[thislist select 0,car_3] remoteExec["moveInGunner",thislist select 0,true];
[thislist select 0,car_4] remoteExec["moveInGunner",thislist select 0,true];
};
if (triggerActivated heliland) then{
[thislist select 0,heli1] remoteExec["moveInGunner",thislist select 0,true];
[thislist select 0,heli2] remoteExec["moveInGunner",thislist select 0,true];
[thislist select 0,car_1] remoteExec["moveInGunner",thislist select 0,true];
[thislist select 0,car_2] remoteExec["moveInGunner",thislist select 0,true];
[thislist select 0,car_3] remoteExec["moveInGunner",thislist select 0,true];
[thislist select 0,car_4] remoteExec["moveInGunner",thislist select 0,true];
};
if (triggerActivated CarsComeIn AND !triggerActivated heliland) then {
{_x setpos (getpos teleportpossition)} forEach thislist;
};
What do you want/expect the JIP thingy to do?
Teleport inside those vehicles if mets one of those conditions
off line testing works
That has nothing to do with JIP at all
but, add a player that joins later and the trigger farts
What does the JIP flag change on that?
Two possiblities.
- You have AI enabled, aka when a player disconnects he will leave a AI soldier back, and when he rejoins he will join into his old body.
In that case he will be teleported back to the vehicle if he used the teleportation atleast once. Instead of spawning back at the same point where he disconnected. - You don't have AI enabled. In which case the JIP flag won't do anything besides filling the JIP queue with crap that won't ever do anything
- is useless. And 1. is even worse.
Imagine you teleport at mission start. Then you play for 2 hours and walk a couple kilometers away. Want to rejoin quickly and instead of being with your troop. You are now a couple kilometers away from them. Back in that teleport vehicle and you need to do something to get back to your troop
@lone glade
{_x ctrlSetFade 1} forEach _controlsArray ?
It will be slower but that code has so many almost equal lines that could easily be shrunken down with that
true
You were already doing that in the removed line 59
I also forgot to handle "empty" stats lists
the 2 will not happens, the teleport does work and keep the player in action afther die and spwan
Never said it doesn't work. Also never said anything about die/respawn
Plus, the host may disable AI not knowing what it does and may turn the mission sideways
so i am trying to not depend on AI for that
So.. Further confirming that the JIP flag is useless and does nothing than filling the JIP queue with useless crap
the JIP queue exist to be spammed
To be honest the JIP-ticket idea was right, but execution terrible.
I don't know how else I would have done that
Besides trapping you in a loading screen till all of the JIP queue is done
considering some people suspend init scripts.....
And so many things left undocumented. Like when does it run, pre-init, init, post-init. If init then how related to other stuff, etc..
that's documented tho
Where?
I expect it to start after preInit and then keep on going till after postInit maybe even several minutes into the mission
So you need everything that gets invoked to be defined at preinit time, so you can't even define them from preinit since you don't know which runs first. At the same time everything that depends on JIP-invocations, need to wait until at least post-init is done.
All JIP queue is done since getClientStateNumber passes value of 8
You can do stuff at preInit though. If it's unscheduled you are guaranteed that no JIP messages will be able to arrive while your scripts execute. Or what do you mean?
I mean when my stuff is to be defined for instance. It seems BIS only "gurantees" the JIP-system to work if you put everything that can be called into CfgFunctions.
CfgFunctions also runs at preInit
Then simply things like: Can I expect a objects inititialization line to have been run before any JIP ticket involving it are run.
So defining your function for JIP in CfgFunctions or preInit doesn't matter
Oh yeah.. That's also a thing
Maybe I am making this more complicated, but:
A. JIP-tickets might get processed already at preInit time, right?
B. I run something at preInit that defines some functions
Will B run before A, for example - so that the function invoked by JIP is actually defined?
Well as in experience all JIP is somewhere between Functions with preInit attribute are called and init.sqf is executed, not sure in what order
Afaik they get processed after preInit
So it's not possible to get a JIP message before preInit
As I said. CfgFunctions is preInit too
I do not guarantee that 100%, there's not much about it.
So if what you said would be true CfgFunctions also wouldn't work
Good to know.
CfgFunctions are done the time JIP is coming. That definitely that way, as any remoteExec'ed function from CfgFunctions is already present.
But it just shows so much left unclarified. I mean to make reliable concurrent system, like simply multiplayer logic, you need to be able to sequence code correctly, and that is difficult if you do not know when it runs.
the fact that you're allowed to suspend init scripts is already an issue in itself....
You are not allowed in CBA land
Which I very much prefer
non-CBA land is so vague and glitchy
Suspend init scripts?
Yes, you can suspend init.sqf lol
Though you meant initiatilizon lines - my bad.
waitUntil for something happening after postInit in a postInit script. And experience the endless loading screen
Which is CfgFunctions fault btw
Really not BI problem if you code something badly, some people will have waitunit in their init lines i.e waiting for server to be ready
@errant jasper But why do you need something before JIP?
Imagine a world where you could just say "execute this when that JIP variable has arrived" instead of "Pause everything till that variable arrives"
Oh.. wait.. CBA.
@unborn ether I need to ensure whatever is called by for JIP is defined. We now established (at least for my benefit) that preInit is one way to do that.
torndeco, "waiting for the server to be ready" shouldn't be a thing
because it makes 0 fucking sense
The other side is ensuring that every client is up to date (JIP or not), and that might for JIP's case need to be sure that all JIP tickets have been processed.
Usual solution for that is to just put an indicator at the end of the JIP queue. A variable or a remoteExec code
also for some godawful reason remoteExec in whitelist mode spams the JIP queue like a mofo
- before running some other stuff
Have to take care of making sure it's always on the end though
^ Dedmen is right
unless they fixed it, but it's a problem since 1.52 😭
@still forum How do you ensure your indicator runs last?
you delete everything in the JIP queue after it taps forehead
You can update JIP queued message if you pass 3rd arugment as not-empty string. This will override existing message, Example:
0 remoteExec ["someFunc",-2,"uniqueID"];
// 5 minutes later
1 remoteExec ["someFunc",-2,"uniqueID"];
Will replace the first JIP-message
Using clustering with 1000 thing
Went from ~8 seconds to ~0.3
https://i.imgur.com/2k2oKPA.png
Overriding puts it last? That would also be my guess, but I don't like guessing.
So for a server just do: time remoteExec ["someFunc",-2,"uniqueID"];
@peak plover Not good nuff :U
I could eventually make clusters of clusters
yeah that'd really make my code a complete clustefuck
@errant jasper You can do whatever, but 3rd argument passed as non-empty string is an unique id of that message, and gets replaced whatever was there, and whoever send that before.
Yup. It is fortunate that I always wrap by network code, so I only have to add it one place.
A lesson CBA taught me.
Usually it is also CBA that I wrap 😃
Well nothing is perfect for your needs.
Yes there is. But dammit now you made me want pepperoni pizza.
Pineapple pizza
scripting: easy
finding the right shade of grey / proper way to highlight a title: hardest task ever
Intercept network is probably the perfect solution. It's opensource so you can do whatever you need
@subtle ore You know the saying, it it has fruit it must be dessert.
@errant jasper Nonsense, wine?
@subtle ore Did not see that coming. You have bested me.
apple pie is dessert?
😎 
Apple pie is breakfast
yiss, I think I got it
That is Wine Is Not an Emulator
https://imgur.com/a/hT2Id
thoughts on the shade of grey used?
Needs more shades
I knew that was coming
You have a good ammo choice tho.
Alganthe, did you read my recommendations for changes weeks ago?
yes, but I also got other input and decided to stick with this
i've done multiple iterations of it, this is the better one
Okay
Just don't make it configurable. I have enough trouble deciding between radial or list view for the interaction menues.
use list
and you can have you own stats
example, want to show the range of TFAR radios? you can
Cool. Some kind of class added to the config, like dunno ACE_Arsenal_Info?
no, it's an array created in preInit
one stats array for each "tab" (outside of the 3 mag ones that are regrouped into 1)
Custom controls group yet?
nope, but you can replace mine by yours since it's event driven 😄
also conditional stats, stats that appear only if the condition returns true, such as:
https://imgur.com/a/gka6G
Good idea on the radio range. I would force that integration to my regular gameplay. Am sick of acting radio relay because the others picked crappy radio.
the one thing I might do is make the window wider due to translations being ridiculously long in german
deutschübersetzungskünsterverwantwortlicher
That banana reminds me, I really need to make a minor mod that makes people trip when running over them.
no
I actually tried it out some time ago, when I noticed, and was sad it didn't work like that 😉
Sounds more like a ABE3 feature
Also eat banans to temprarily increase player advance fatigue
Can you add it by monkey-patching.
Clippy could be cool addition to ACE when on Cadet-difficulty. "You cannot fire because your weapon jammed - do you want some help with that?"
"You're trying to commit a warcrime, would you like help with that?"
That escalated quickly
OOh, very nice CBA updatate. 30 min ago
lia......... wait... lul
RELIZ TFAR 1.0 ALREDI
this was your daily reminder
And afterwards make retransmit great again!
retransmit aka relay antenna is part of 1.0
so... it should already be great then...
NOICE 😄
https://github.com/CBATeam/CBA_A3/issues/873#issuecomment-359293998 nice info for all the people that say you don't need saveProfileNamespace
last time I checked, so 2 months ago anytime a value changed in profileNamespace the file was written
it might be different for servers, but that's what I observed for clients
@lone glade Maybe because some mod periodically calls saveProfileNamespace?
no, doubt it
@still forum that would cause lag
When opening esc menu maybe?
I noticed it when saving loadouts and deletintg them
the activity was 1:1 to what I was doing
I think it updates it as soon as something changes
it does for clients
Not for server?
no idea as I didn't test it
Maybe the file is modified using memory-mapping, and the OS only makes it looks like the changes are instant to the file?
Thought this might work (SP/Recon games). Could someone help.
Intention is to move a invisible helipad to the location of a thrown purple smoke grenade.
It would be intended to change location with every thrown grenade.
I put below in the helipad init (named 'helipad').
smoke attachTo [helipad,[0,0,0]];```
Could be that they scheduled a asynchronous file write if you just let it automatically save but they do a synchronous one with saveProfileNamespace
You want to attach a helipad to a smoke grenade.
And your code spawns a smoke grenade and attaches it to a helipad
@still forum OK will try again. Good job I draw pictures for a living ;0)
Actually I want to thow a smoke and then 'jump' the helipad to it's location.
I wonder what happesn when smoke runs out?
since it's attached to it. it might make it bug out
Happy to report back, if I get it working...
Guess you want something like:
- Attach Fired Event handler to player, that when a smoke grenade is fired
- waits for it to "stabilize" (not fly anymore).
- then move the helipad to its position.
nearTarget feels like it might be looping quite a bit. Will check it out. Ta
@young spade I know alive has the smoke marking, you could try taking a look how they made it
I'm not familiar with the fired event to say if it would be possible to track the smoke using that
nearestObject may work better https://community.bistudio.com/wiki/nearestObject
Is there a grenade throw eh?
yarp.
That's useful, didn't know
Fired FiredMan FiredNear EVH triggers any projectile fired, since grenade is a projectile from a weapon called "Throw" it also does that
@unborn ether Any idea how to get where the weapon impacted? Just curious
_list = [_xpos,_ypos,_zpos] nearObjects ["SmokeShellPurple", 50];
or is that just ammo?
@thorn saffron Gimme a sec
Fired ``` and FiredMan``` EVH are unit specific.
Better (maybe) to look more genarlly for an odd ammo - hence Purple Smokes.
Clipped code
_smokeCnt = 0;
while {_smokeCnt == 0} do {
_smokeArray = ((position player) nearObjects["SmokeShellGreen",50]);
_smokeCnt = count _smokeArray;
if (_smokeCnt > 0) then {
_smoke = _smokeArray select 0;
_smokePos = position _smoke;
_lz = "HeliHEmpty" createVehicle (position _smoke);
};
sleep 1;
};```
player removeAllEventHandlers "FiredMan";
player addEventHandler ["FiredMan",{
params ["_unit","_weapon","_muzzle","_mode","_ammo","_magazine","_projectile"];
_projectile spawn {
private "_position";
while {true} do {
_position = ASLtoATL (visiblePositionASL _this);
if ((speed _this) < 0) exitWith {};
if (!alive _this) exitWith {};
if (isNull _this) exitWith {};
};
systemChat str(_position);
};
}];
Where systemChat - do what you need, you have the end position.
NOTICES:
- Don't
spawnit for any projecile, its just an example, use a muzzle name or ammo name to separate it from all others. - Works fine for grenade, not bullets. Bullets have an ability to ricochet and so, sometimes don't stop at the point where it hits.
As for bullets, well no idea, since isTouchingGround doesn't really react on them in any point.
maybe get the last know position, but I was just curious, so no need to bother with that
@thorn saffron You can't know it since, you need a condition where you stop seeking it.
@thorn saffron If bullet ricochets, speed is still > 0, its alive and not null.
but if you compare the position with the last check and it returns the same then the bullet has "stopped"
And if it doesn't?
If it didn't stop, then the position will be different on and the comparison will return false, and you can keep the check loop going
My personal dilemma was at the point when the bullet ricochets. I wantted to get actual position of the hit, not the end position of a bullet life. I found no actual way to get this triggering properly at 100%
ah
Hey, does the basic else if work in arma scripting?
a else if will have to look something like this ```sqf
if (side _caller isEqualTo west) then
{
//code will run if _caller is in bluefor
}
else
{
if (side _caller isEqualTo east) then
{
//code will run if caller is in opfor
}
else
{
//code wll run if all else fails
};
};
May of been a bad example but hopefully you get the jazz
Its me again... How can i make this code work the problem i have is i am not 100 % sure on how to do several conditions for a if and how to check is something is equal to anything in a array. The comments in here should explain most of it the _MatTrg is a trigger spawned in earlier ```sqf
_AcceptedCars = ["C_Offroad_01_F","C_Offroad_02_F"];
while { true } do
{
if(_caller inArea _MatTrg ) then //this while lopp checks for _caller every 3 seconds dont know if there is a more effective way to do it.
{
hint "You have arrived to the pick up zone please back up towards the object and turn your engine off"; // instrusctions
_vehType = typeOf vehicle _caller; // will be used to check if car can carry product (Has to be a hemmt offroad or van Not in place) I check it here incase caller changes vehicle on route and this is when he enters trigger around pick up object.
_veh = vehicle _caller; // to have a refrence of isEngineOnOn
}
else
{
if(_caller inArea _MatTrg && _vehType == _AcceptedCars && isEngineOn _veh == false) then // so what i am trying to do here is check if player is in the area AND veh type is one of the vehicles in a array AND isEngineOn _veh needs to be false.
{
hint "Loading started"; // hint
// More code will be added
}
else
{
if (_vehType
!= _AcceptedCars) then {
hint "You do not have one of the accepted cars";
};
sleep 1;
};
};
};
Simpley what i want to do is check if a player is in the area if thats true hint some instructions. And if the player then turn his car off and has the correct car a code will run (Will attach a object to it) and if the car is wrong it will hint that.
@fleet wind You'd better use EVH: Engine along with GetInMan and GetOutMan
Have no clue on how to use any of that... Better get reading the wiki then i suppose... So it not possible to do it this way?
@fleet wind Those will cover any need you've described without scheduling a lot of things.
@unborn ether How will GetinMan help me i never want to check if a player is enters a car im confused.
@young spade
player addEventHandler ["Fired", {
private _unit = _this select 0;
private _nade = _this select 6;
_nade spawn {
waitUntil
{
sleep 1;
((velocity _this select 2) == 0);
};
_helipad = "Land_HelipadEmpty_F" createVehicle (position _this);
};
_unit removeEventHandler ["Fired", _thisEventHandler];
}];
@fleet wind For the first place it will help you manage adding and removing Engine EVH, which is only added to a vehicle. Yes, adding and removing EVH in another EVH.
@fleet wind This way you DONT need to seek vehicle, as you have it GetInMan and GetOutMan returns.
This is way to confuseing for me will have to put it on ice for now. Thanks for the help.
@fleet wind Once you get the EVH purpose, you'll be happy.
How would it roughly look? (I have very limited experience with EHs) so add all event handlers at the top of the script and then use them however later on or? and to add a Engine EH would that look like this _EngineStatus addEventHandler ["Engine",{if (_caller inArea _Mattrg) {//run this code}}]
Its properly and better to
_vehicle addEventHandler ["Engine",{_this call yourFunctionName}];
OR
_vehicle addEventHandler ["Engine",{
params ['_vehicle','_engineState'];
}];
Is there a way to get the player name when a player interracts with addAction?
name (_this select 1)
@long gazelle Which player, your own player or some player that action is added to?
The action is on a laptop, and it should take the name of whomever interracts with it. My player or another player.
Well in a scope of whoever interacts with it, you can simply take player inside a addAction code block
Oh, no worries, I got it with sldt1ck's line.
Does profileName return any players name that interracts with the action?
It reports the local profile name.
Ok..
Also, how do I get a title out with remoteExec ["hintC"]?
I can get the text out even formatted just fine but can't manage a title.. Didn't find anything that would clear it by googling it either..
"title"?
What exactly are you looking to do? @long gazelle
To print a hintC with a tittle and text (with variables) in mp/dedicated server.
With remoteExec..
[title, [content1, content2, ...]] remoteExec ["hintC"];
Ah
Iirc remoteExec complains about TEXT type network serialization, but w/e. It should still work.
I'll try it out.
format [["title%1", var1],["content %1 content %2 content %3 content %4", var2, var3, var3, var5]] remoteExec ["hintC", _target];
So I had it something like this, didn't work?
Now I'm assuming my variable positioning is all wrong but wanted to ask you guys.
So what's wrong in this line?
Does format even work like that what the fuck
I didn't write anything with format.
I'm not sure. 😄
format ["content %1 content %2 content %3 content %4", var2, var3, var3, var5] remoteExec ["hintC", _target];
This did work for me..
[format ["title%1", var1], format ["content %1 content %2 content %3 content %4", var2, var3, var3, var5]] remoteExec ["hintC", _target];
I suppose this could work ^.
Not sure again if the format is necessary but it has been previously when I used hint with variables..
That's the point of formatting the string,
You cannot do :
_cookies = 1;
hintSilent "_cookies";
And expect a return of 1
❓
@little eagle Works great, thanks a lot. 😃
yw
🍪 ?
_cookies = 1;
hintSilent str _cookies;
Welp. Shows you were my head is at today
1 = "_cookies";
hintSilent (missionNamespace getVariable str 1);
But...why...
Revenge cookie.
@unborn ether You're evil 
So how would i go about executing param code inside a script?
I understand that call compile will execute the given code correct? String or curly bracket to string?
["end_unsafe",true,true,false] call BIS_fnc_endMissionServer;
I cant make BIS_fnc_endMissionServer to end with out music
Midnight, you can execute CODE with call.
Okay
{systemChat str 1} call {
call _this;
};
any fix for that?
Interesting, thanks commy
sooooo question, would it be possible to increase the height of the camera a player see through in 1st person ?
No.
fuck
cuase there is tihs helicopter type vic and the camera location is hot garbage,but if it was placed like half a meter higher it would be much better
well cool down the garbage then
Yep
thx
Np
!hot
nevermind, i fix that by remoteExec
["end_unsafe",true,true,false] remoteExec ["BIS_fnc_endMission"];
Why
see above
Actually its somehow possible to change the 3rd person camera, i've seen some addon on armaholic doing that. Seek it.
Anybody good with animations, allows you to sitdown but cant look around or anything. https://pastebin.com/ZQ9WBd6s
probably a side effect of the attachTo you are using
or whatever you use to force the sitting animation
attachTo yeah, unsure of how else to go about it tho.
publicVariable "PLayMarkaMusic";
PLayMarkaMusic = nil;
nil also effects the publicVariable?
Are you getting kicked for publicVariable?
What?
No, Roque. You have to edit the global before sending it. And yes, in A3 you can send variables that are nil/undefined.
Sorry, didnt notice you posted above just thought you had trouble with getting kicked for pv.
So nil does not delet that variable if is set with publicVariable? so how i delet a publicVariable?
It will undefine it, but only on the one machine. Everyone else will still have it defined.
PLayMarkaMusic = nil;
publicVariable "PLayMarkaMusic";
This way it's undefined everywhere.
Or just like this:
missionNamespace setVariable ["PLayMarkaMusic", nil, true];
sorry, i did not get that, but how does change the order will still undefine it? are you not define it aguain?
i was planing to use nil later when we reach one part of the mission
that was only a example
You have to synchrinize the variable again after undefining it. Otherwise it will only be undefined on the machine that set it to nil, but retain the old value on all other machines. There is no other way to explain this.
missionNamespace setVariable ["PLayMarkaMusic", nil, true];
So, just using this will do what i want?
This will set the variable to nil on every machine. Dunno if that's what you want.
Well, this is what i need.
if (!isNil "PLayMarkaMusic") then {"Marka" remoteExec ["playmusic"];};
if (!isNil "Loop") then {Loop = addMusicEventHandler ["MusicStop", {"loop" remoteExec ["playmusic"];}];
"loop" remoteExec ["playmusic"];};
if (!isNil "helirideMusic") then {"heliride" remoteExec ["playmusic"];};
this is at onPlayerRespawn.sqf
I made it so players that joined later still play the music once they respawn
So..
You want to "delete" a variable. So you can check it using isNil
But setting it to nil is not what you want?
So you want to "delete" a variable but deleting it doesn't do what you want. I don't understand
Well, that is what i undestand.
is there an easy way set dynamic loadouts after a respawn? E.g. extract the loadout, apply it after spawn? I've tried some lines from the wiki page but I get an "Array, Expected Object" Error
get/setUnitLoadout is what you want.
does that work with the dynamic vehicle loadouts?
you mean the pylon loadout?
_v = _this select 0; // vehicle
_pylons = getPylonMagazines _this;
_pylonPaths = (configProperties [configFile >> "CfgVehicles" >> typeOf _v >> "Components" >> "TransportPylonsComponent" >> "Pylons", "isClass _x"]) apply {getArray (_x >> "turret")};
{ _v removeWeaponGlobal getText (configFile >> "CfgMagazines" >> _x >> "pylonWeapon") } forEach getPylonMagazines _v;
{ _v setPylonLoadOut [_forEachIndex + 1, _x, true, _pylonPaths select _forEachIndex] } forEach _pylons;```
is called passing 0 = [this, 0] call XXX_fnc_XXXX;
that's not the entirety of the code isn't it? I see a foreachIndex in there
it is
oh, that's because you stuffed everything in a single line 😄
oh...
last foreach, _pylons is a string
remove the str before getPylonMagazines
alright will do that. Thought setPylonLoadout accepted only Strings
getPylonMagazines returns an array of strings
you're turning that array itself in a string
which breaks foreach and is clearly not what you're intending to do.
it will error out, you can't do:
{} foreach "myArray"
foreach expect an array, it got a string, it's not happy
so, again, why do you think you need str ?
that was already removed from the code
I'm just wondering what happens if the new code runs on a cr
they don't have pylons, so nothing
How can this issue be sorted http://prntscr.com/i8d5m2 ?
Ill give it a try
if bblabla true
{_breakout = true;}
if _breakout exitWith{};
Also... How about just not using a while true... But a while _variableThatISetToFalseWhenImDone
or my patented solution
while {true} do {
private _exit = false;
if (player == (leader player)) then {
if (time > (5 * 60)) exitWith {_exit = true;};
};
if (_exit) exitWith {};
};
lul
Good point Dedmen
lul indeed
while {true} is infinity. You can't change infinity. So u rong
programming philosophies
programming the meta
Wait wut A while statement only takes code not Boolean how can i make a variable that sets itself to false then ?
man....
"true" is also a boolean
and while true like Optix showed above...
Do the same with a variable instead of "true"
The return value of the block of code is boolean
Kinda dev question, is there a program or a way to quickly check for changes between similar folders?
Folder a has 10 files, folder b has 5 files. I want to see if the overlapping files from a and b have changed?
I use winmerge for things like that
you can do file-file and folder-folder
(and its free)
Hey #arma3_scripting , Just wanted to ask about game saving and loading, Does arma save script states? as in, If i spawned a infi-loop checker, will the game save that?
Thanks @ionic orchid
no problemo
Total Commander also, nigel
or any free git, for that matter.
or ps diff -ref @(ls -r a) -dif @(ls -r b)
How do you open the Arsenal combined with the garage like the one you can use in "VR Arsenal"? The only code I found is opening the arsenal or garage separately.
@peak plover something with winDiff I think? AraxisMerge (I use that. Not free tho)
@hushed minnow yes.
I got 1 copy of the files where only 50% of the files exist
I only want to update those 50% not add new ones
Basically a update, that replaces all functions and all settings files are not changed
I'll give those a go
I like Meld merge (free), shame the windows precompiled version isn't updated anymore (but its just python ui program).
^ also was some plugin for n++...to compare things
Question: A Humvee is not moving when the teamleader of the group is not at the gunner seat. Can I prevent this?
I mean atm there is another guy at the gunner seat of the same group but its not the leader. The leader sits right front of the Humvee
I have used a getvariable command it all works. But it returns [//a object variable] How can i get rid of the []? If that makes sense.
why does it do that in the first place?
but back on the topic, remove the brackets when using setvar / use param to retrieve the content
I have no clue when i tried to figure it out i hinted the variable first in the original scope and it returned without [] and then when i used getvariable it did not work.
Use param allright thanks ill look into it.
To merge and view exact differences in files https://sourcegear.com/diffmerge/
I use this on my server works fantastic, @chrome mason (credit to)
@lone glade Worked Thanks!
😉
Prepare yourself guys
// Set platoonVariables
private _platoonAlpha = if (_setPlatoon == "alpha") then {true} else {false};
private _platoonBravo = if (_setPlatoon == "bravo") then {true} else {false};
private _platoonCharlie = if (_setPlatoon == "charlie") then {true} else {false};
private _platoonRanger = if (_setPlatoon == "ranger") then {true} else {false};
private _platoonMedical = if (_setPlatoon == "medical") then {true} else {false};
private _platoonTraining = if (_setPlatoon == "training") then {true} else {false};
private _platoonS3 = if (_setPlatoon == "s3") then {true} else {false};
wtf is that
Some guy that apparently doesn't understand programming nor logic thinking
put it on the wiki quick
Here is the rest of it
(_player) setVariable ["CAV_isCavTrooper", true];
(_player) setVariable ["CAV_isAlphaUnit", _platoonAlpha];
(_player) setVariable ["CAV_isBravoUnit", _platoonBravo];
(_player) setVariable ["CAV_isCharlieUnit", _platoonCharlie];
(_player) setVariable ["CAV_isRangerUnit", _platoonRanger];
(_player) setVariable ["CAV_isMedicalUnit", _platoonMedical];
(_player) setVariable ["CAV_isTrainingUnit", _platoonTraining];
(_player) setVariable ["CAV_isS3Unit", _platoonS3];
I want to save which class you are. So instead of just saving the class that you are I'll just save a bool for each possible class.
Not everyone knows evreythig
Sure. Not everyone knows everything.
But you only need basical logical understanding to see that if true then true else false doesn't make sense
Original question was about diagnosing an error where a bool was passed to == which as we all know doesn't work
:shipit:
@astral tendon That isn't any excuse, the biki examples are better than this. bad practice.
Not aways the examples are that good.
nope
If example bad. Tell me or fix it yourself ^^
I'm sure nowhere on the wiki it says if true then true else false
i have a few times
no it doesn't, if you look at what i said: biki examples are better than this. implying that there is no excuse to be better
or to learn rather
^ Nice code there 🐿
?
Dedmen posted examples, Midnight ^
ah
can someone tell me what I need to do in order to force an AI group to move with their vehicle? Its a M1025A2 HMWVV with M2 on it. But the Gunner is not the Teamleader, since the leader sits front right. But unless I move the leader in the gunner seat nothing moves. But I don't want to move him into the gunner seats, any ideas?
Im guessing that you are the gunner right?
no
I'm not part of the group
and not in the vehicle
in fact I'm even in another faction and miles away
the problem is that the gunner is normally the leader of the vehicle
I'm just unsure howto change that
that I'm not the gunner isn't the problem
oh wtf is that code?
hey no bullying
stop spamming 😄
last message: 28mins ago
spamming
wut
thats just too personal, you dont get it 😉
waitUntil { if (
triggerActivated win)
exitWith {
{_x spawn SpawnUnit_CIV_No_PATH
} forEach nearestObjects [Cut_Food_guy, ["sign_arrow_f"], 100];
{_x allowdamage false} forEach units playersslots;
{_x setDamage 0} forEach units playersslots;
sleep 1;
{moveOut _x} forEach units playersslots;
hint "1";
while {true} do {
sleep 1;
{if (stance _x != "STAND") then {_x playActionNow "up"}} forEach units playersslots;};
hint "2";
{_x setVelocity [0, 0, 0]} forEach units playersslots;
while {true} do {
if (!(weaponLowered player)) then {
player action ["WeaponOnBack", player];};
};
hint "3";
"" remoteExec ["playmusic"];
[[], "scene.sqf"] remoteExec ["execVM", 0, true];
sleep 8;
hint "4";
"win" remoteExec ["playmusic"];
sleep 3;
hint "5";
["end_unsafe",true,true,false] remoteExec ["BIS_fnc_endMission"];
true};
};
Why is it stoping at hint "2"; ?
playersslots undefined?
...
that is so horrible styled
while true never ever exiting?
you can read that?
playersslots is a group
the indentation being complete garbage?
remoteExec'ing with JIP flag for.. no visibly good reason
so the while {true} dont let it read the rest of the code?
while true loops while true
waitUntil {
if (triggerActivated win) exitWith {
{
_x spawn SpawnUnit_CIV_No_PATH
} forEach nearestObjects [Cut_Food_guy, ["sign_arrow_f"], 100];
{ _x allowdamage false } forEach units playersslots;
{_x setDamage 0} forEach units playersslots;
sleep 1;
{moveOut _x} forEach units playersslots;
hint "1";
while {true} do {
sleep 1;
{
if (stance _x != "STAND") then {
_x playActionNow "up"
}
} forEach units playersslots;
};
hint "2";
{ _x setVelocity [0, 0, 0] } forEach units playersslots;
while {true} do {
if (!(weaponLowered player)) then {
player action ["WeaponOnBack", player];
};
};
hint "3";
"" remoteExec ["playmusic"];
[[], "scene.sqf"] remoteExec ["execVM", 0, true];
sleep 8;
hint "4";
"win" remoteExec ["playmusic"];
sleep 3;
hint "5";
["end_unsafe",true,true,false] remoteExec ["BIS_fnc_endMission"];
true
};
};```
and true is true
fixed
and doesn't magically go false
For a framework, that have alot player on it like 200 players, it's better to put a variable in global, or when trying to get this variable use remoteExecCall ?
depends.
Also, my notepad++ dont like spaces for some reason.
use something different then
just use ; instead of spaces then
(that have alot player on it like 200 player) what are you a lifer?
No, thinking, about, optimization, in multiplayer environment
i thouhg that only waitunitl stop the rest of the code.
waitUntil is basically the same as while
Well... Actually not but....... Kinda maybe a little somewhat similar
it's still pretty convoluted, a while loop inside a waitUntil
A loop that infinetly loops can never exit. That should be kinda obvious @astral tendon
My god. Good thing I don't check this channel every day anymore.
😄
That did not look verry obvious to me, all i know about it is that it loop things in the {}
@astral tendon Nice Neverending story there bro 😄
😂
If only while would behave the same in scheduled and unscheduled environment.
@little eagle unsheduled while is just a pu33y
I don't use while that often. All my loops are forEach.
Just because it's the most optimal loop for SQF.
unless count and unless Intercept
For loop is pretty good to
Not the for array one
@little eagle well forEach requires a static array
it doesn't
Yes. But in this game you almost always walk over arrays.
I use while in only one place in unscheduled
You can modify the array you iterate inside the forEach just fine
It get's a little jumpy. But as expected
You shouldnt
Please don't. Even if it works, keep it readable.
@still forum isn't something like deleteAt or resize will break the iterator step?
Depends on how you define "break"
If you delete the current element. You will automatically skip the next element
and go to the one after the next on next iteration
Sounds broken to me.
Completely logical
It is definitely broken
sounds like sqf to me 😄
Completly logical if you know how the implementation works 😄
I think my intercept forEach would crash if you modify the array while iterating
SQF is fine. People won't suddently start writing solid scripts just because we change to something else.
and one more addition to my collection 😄
No, but maybe it will be a bit better
I fear it'll be worse.
Oop etc will be nice
lower level languages = more chances for lifers to fuck it up
The more freedom you give them, the more they can fuck up.
Tbh they should just introduce c# scripting support in the new game
enscript you mean
No c#
/giphy god no the office
Something default like 50m nearestObjects in onEachFrame?
Yes.
@unborn ether foreach doesn't use iterators
with static typing most of those shitty scripts wouldn't compile in the first place though
SQF doesn't have static arrays. Still, forEach is by far the most common loop. Like at least 9 out of 10.
_forEachIndex is what seals the deal for me
What if I can give you a forEach with _forEachIndex that's still 2x as fast as count?
Do I get a cookie?
count crew heli2
How do i count only alive units?
{alive _x} count crew heli2
What do you mean with "freed"
It's a refcounted pointer to a vectorish array (which is why you can "copy" arrays by reference)
Well static arrays are freed automaticly, where dynamic are left on the heap.
i get the feeling you don't really know what you're talking about
why "vectorish"? iirc it's exactly like a vector
It's not a std::vector. It's a custom implementation of a dynamically resizeable array.
i didn't say std vector, but conceptually it's the same
Yeah. That's why vectorish ^^
so thats vectors?
vector in c++ parlance usually means a resizing array, to differentiate from a fixed size array, not necessarily the std vector
suppose they used a sbo vector then you might call it vectorish i guess
yeah i know, it was just a hypothetical example
i had to implement their array vector once too for some arma 2 stuff
@Dedmen so thats vectors, not arrays?
What's vectors?
an sqf array is implemented as a resizing array, aka a vector
There are no static arrays in SQF if that's what you mean
@still forum i would suggest config arrays to be static though
Just curious if making array-vector nil or [] clears it.
@Arkensor#0120 No
😦
@unborn ether Just like with any other variable.
@barren magnet
if you make it = [] its empty
@still forum Highlightnoob 😛
Assigning a variable deletes the old value.
so array = [] will delete the old arrays buffer if there are 0 other references to it
@still forum how exactly do i modify a config array ingame then once it has been parsed ?
Intercept?
also what about final
No.
nah intercept is not default arma
Nothing in SQF is static.
Aka static in memory
everything is dynamically allocated.
how can there be something static in the memory?
compiletime stuff is static
The ram itself is static
@still forum No, i get what happens on SQF, do that really happen in C++ level?
It's a static piece of glass fibre with silicon chips on it
@unborn ether What happens?
but whats in it is not static at all
The array getting deleted when there are 0 references? Like I just said. yes.
@still forum Fine.
@barren magnet do you actually understand c++ storage durations
Yes but what has that to do with this?
@barren magnet I'd better listen to Dedmen at this point, he definitely knows what happens in Arma 3
I did not argue his point
you were talking about configs being static
were you referring to the static storage duration
i am not referring to anything like that. i was referring to that people cant change a config ingame once it has been parsed. so if you want a static array and work on it without hurting your data you can getArray config >> meh and be happy
There is no way to change them from SQF code.
Missing the ability to change something doesn't make it static though
nothing to do with intercept 🌈 or anything else
Also you can update config after game start with diag binary
again thats not everybodys default arma
No, those configs are not static because
I've seen some mergeConfig stuff.
It works on DEV and works on-fly.
also i think a compile final doge_array = [1,2,354,5] is pretty much as static as you get in arma
for using it because you want it to be statis for your scripts
compileFinal is a loopy i believe
to not mess with it / deny yourself to accidently modify it without throwing errors
We are in #arma3_scripting not #icanchangeanybitinyourramifiwantto
Thats why i suggest scripting solutions, beside the obvious use intercept 🌈
(which btw you should really give a try)
Command is only available when using Arma 3 Diagnostics Exe on Dev-Branch. hmmmm
how does that play out on my mp server?
It was not related to MP of your server
But that config namespace is not static. (?)
arma3diag.exe is SP only iirc -> all diagnostics commands are also only SP
You guys are missing the point of "I am a normal arma user, normal arma3.exe, no intercept 🌈, on my little mission for me and my buddies"
Thats the only thing that matters for me in regards to "How to make something static ingame"
How did you get to SQF engine backend talk about how arrays work.
To how to make "static"ish values in SQF frontend?
I do not get your point there ded
As I don't get yours
We talked about Backend c++ datatype for SQF arrays not being static.
And then you started talking about config stuff being "static" although they use the same non static array type that SQF uses
You just jumped to a completly different topic
Oh well i see
No. In the backend (Which we were talking about) nothing is static.
Yes in the frontend there are some things that you cannot change which you could call "static" indeed.
You can compileFinal strings to code, but not arrays.
There is nothing static about it though.
As i told, i think is just a scripted loop of compiling something from that string.
No... not at all
It set's the final flag
That setVariable and = check before assigning
and deny assignment in case it's there
A loop recompiling that always would kill your fps to <0.5fps
We can be happy that BI doesn't do such stupid things as recompiling code everytime you try to call it...
Oh wait.....
:>
🤔
you have two trollfaces that are both :trollface: but are different?
yes i'm well aware
EHs are the worst offenders
What a trigger with an inarray inside that checks for comile final in a while loop within a while loop ?
@still forum
Me
hes magic
him
Yep
:magic:
(∩`-´)⊃━☆゚.*・。゚
:mathemagics:
The almighty Dschasanosaurus Rex
ffs the daily dose of dschas name changes
Get a new daily dose in one hour
noice
MaDschangasaurus.
did I provide ded's daily reminder today....
ha
I guess I did
did you know THAT YOU HAVEN'T RELIZ TFAR 1.0 YET?
rip
all that's left for ace arsenal is the "first timer" screen telling you to read the goddamn wiki and documenting stats / stuff that I missed
params?
Always.
have you heard of our lord and saviour params?
which is a wrapper for params now 😄
wtf is that thing
whats the point of params
What? A rapper?
i never used these fancy arma 3 shit
....
Jack the rapper?
burn the heretic
I'm not a rapper
@pliant stream It takes params out of an array. Replaces multiple private _var = _this select x with just _var
its so fast
Jawoll
and also has built in type check and default values
do you often need type checking?
every time
not everytime
EVERY TIME
but anything that you expect someone else to use
Well I prever to just tell idiots that pass the wrong types to fuck the crap off
yep
Some other people prefer warnings and default/fallback values tho
Crazy people these must be
so do you have polymorphic parameters or is it just to check the types anyway?
Stop making up words.
Like. You can specify that the first parameter can either be a string or bool. If not throw warning and set the variable to default value instead
🤔
SQF stayed the same @pliant stream
thank you @little eagle
only new command
or specify that X array needs to be N indexes
but if the user violates your api contract then it's their fault?
i mean i can understand it in debug mode...
yes. And they get a warning
it's buzzword town
no contracts
just command
instead of a script error and a broken everything
"api contract" jesus <<<< yes
api is buzzword? 🤔
though ... they are ensured via assert stuff usually
arma public inconsistency
Bohemian Inconsistencies*
No that's an ABI then
hey, that's not nice
this is bullying
mean
cyber bullying
LOL
I smell bullying here
much bulli
@shut flower C# stuff is working 😄
tested a few test wrap functions and all sucess
going to start wrapping intercept funcs
if this works completely I will kiss your feets
well its working beutifully in my tests 😄 (C++ Native > C# Managed)
I could help out with wrapping functions if you're interested
just push it to github
👍 will get it uploaded as soon as I setup a few more things
best way to prevent dependencies would be to deploy this as a shared project
wait, this is not possible for cli
nv,
nvm
wait I don't really know if this is possible
needs to be investigated
Well currently there are 3 libraries i have.
- InterSharp.dll (What Intercept loads)
- InterSharpWrapper.dll (Loaded from InterSharp.dll, wraps native code to be usable in C#)
- InterSharpManaged.dll (Loaded from InterSharp.dll, C#, loads other C# addons present with x directory)
the wrapper is written in which language?
C++ CLR
merging dependencies is quite a shitty task
Well... Technically i can reduce it to two dlls
I can load mixed CLR
So Wrapper and what Intercept loads can be the same
you don't even need two
you can mix it up into one
but still a dll dependency
clr can load in intercept lib directly
does intercept come in the static library variety
well yes i guess you could even remove the base C# dll
then you can just link intercept into your native/clr dll and reduce it to total one dll + user plugin
you can do all of those tasks into one clr dll, no need for a c# dll
and call it Intercept.NET... what if the user wants to do VB huh?
die painfully
right well I can deal with that stuff later or some of you people can help. for now i want to get it out lol
how can I grab the texture a vehicle uses after init, with the texture applied in the editor (i.e. not the default thing)?
getVariable "texture"?
I think i can answer your question but could you rephrase it a bit, @tough abyss ?
I'm not 100% sure what you mean
Although by "texture applied in the editor" you mean via virtual garage, you can just export it to clipboard after applying it.
yes but I'm looking to make it more general. Something that finds the texture (so I can later apply it after some stuff happens)
HorribleGoat's suggestions finds all associated onces but not the one that's currently on the vehicle
InterBasic is a good idea
we just provide raw bindings that all return wrong values
in hope the user switches to a real programming language
Dim iDontLikeYour As String = "Attitude"
god
DIM OUT OF HERE
this reminds me of the first versions of playerindex
with this buggy server side tool
that even crashed the server
Step 1.) Place vehicle in editor, random skin
Step 2.) Function finds texture that has been applied
Step 3.) Functions sets the texture back upon respawn
@inner swallow better?
Vb eww
wont be of much help to you guys in that lol
I think you can even use this binding in vb
should work
there's no difference between a vb and c# assembly
i mean as in the language. no clue how it works lol
the question is if it is possible to reference cli dlls
the point is that if you expose some CLI api, any CLI language can consume it the same
As Costura is even able to merge mixed-mode assemblies this wrapper could be awesome to use
@tough abyss thanks. if getObjectTextures doesn't help, maybe you can use setVariable to store the texture path as a string? And then on respawn querry it again. That's my best guess, maybe someone else comes up with a better way. Not experienced with vehicle respawns.
And when .net standard adds support for mixed mode assemblies we can even develop c# dlls for linux
I've tried the getVariable "texture" with _v getVariable "texture" but nothing is returned
except perhaps an error in the RPT
if getObjectTextures doesn't work the object doesn't support custom textures.
_v being the object
because that means the object has an empty hiddenSelections array
getObjectTextures does work of course
but it doesn't give me the specific one that is applied
which is what I'm attempting to retrieve
it does tho, it gives you all of them 😄
if you want the one that is applied BI randomization I can check if they store it somewhere
applied throught the virtual garage
garage*
oh yes true
you can retrieve it via a 3DEN attribute
so in that sense I already know what is applied, but I want to fetch it regardless and apply it to objects wherever the function is called upon
the applied texture, is it saved to the object or is it applied to the object upon init?
latter would explain why the getVariable doesn't yield a value
upon init afaik, i'm trying to find where the attribute config is to check
would be a shame if we can't retrieve the texture of the vehicle. Means it's always reset upon 'respawn'
oh, if randomization is enabled it is
no, it's present too in 3DEN
well, it's not really in 3DEN but more in the vehicle config, which the garage ignore on the first spawn
I've been looking at BIS_fnc_initVehicle but that won't really help here either, would it? unless it can be reversed to give me the texture it applied
ah, found it, here's the expression from the 3DEN attribute, that's what happen to your vehicle
expression="if (local _this) then {if (isSimpleObject _this) then {_this setVariable ['%s',_value]} else {([_this] + _value) call (uinamespace getvariable 'bis_fnc_initVehicle');};};";
reminder: BI code.
one thing I don't get is that it's supposed to be used for anims
the texture attribute doesn't have any expressions, meaning it doesn't do anything....
#BIMagic
i'll check the sqm to be sure
huh, it does change something but it's engine read afaik.
Shame... Guess variable can't be retrieved the way I implement the texture
question
"Fin_tricolour_F" createUnit [position _this,(group _this)];
``` if I place this in zeus on a server,it spawns 1 dog per person for somereason
any ideas why?
it spawns a dog btw 😛
@swift ferryenai#3053 Global exeuction?
Are for loops incrementing from 0 to the max in ms / seconds or just as fast as possible?
_i is set to 0
...code is executed
_i is incremented by 1, _i = 1
...code is executed
_i is incremented by 1, _i = 2 ... etc
if you will use step that will defines the value by which the variable is incremented every loop...
..so after code is executed
_i is incremented by <step_value>... default is 1
@subtle ore so as fast as code can be executed
yes...
@tough abyss#3205 تحتاج إلى التحدث باللغة الإنجليزية هنا
@edgy dune everyone runs it
Mhm, I was telling him
ah. Thanks.
Is there some sort of (preferably official) grammar and/or specification for the SQF language anywhere? I already know of foxhound.international
Biwiki ?
"grammar" 🤔
@tight moat Yes. The stuff from the foxhound page.
No there is nothing better because his stuff is correct.
@little eagle https://foxhound.international/arma-3-sqf-grammar.html
I had to google it and it looks correct. And the page about local variable scopes talks about params. Good enough for me.
SQF only has one keyword—private—and it was added only very recently Well he is kinda very wrong here... But I guess it doesn't matter
Eh, details. Would you count assignment as a keyword?
private was not added. It was just a rename of local and local was for sure not added recently
Yea, yea, we know. And it's been there for ages.
{
}
forEach
So much wasted space. It hurts.
Just noticed that the if is actually completly useless but because of BI's bad implementation we cannot remove it to improve performance
BOOL then ?
yeah
Instead of if BOOL returning a special boolean with a special typename
and <special boolean with a special typename> then CODE
Just make BOOL then CODE
I was thinking about this years ago, but it would hurt readability.
@wraith cloud Because I would have to move to czech, currently am in an apprentice ship for the next two years, they don't have a open position.
if never made much sense in any language if you think about it. 🤔
But in compiled languages it atleast doesn't hurt our precious performance
True. Yet all scripting languages I can think of use if (or ? for SQS).
Do you see any reason why adding BOOL ? CODE : CODE would break existing scripts?
I think ? is free in SQF, but it may break SQS.
: you'd have to overload, but CODE : CODE should be free too.
Isn't it
? BOOL: CODE
in SQS though?
hm...
I'm not sure, I never used it much for obvious reasons.
No shouldn't break it
And idk if intercept added command even affect sqs.
then makes it quite readable and easier to understand for noobs
I guess they do though. as else and such are also the same in SQS and SQF
I'd say who cares, but stuff like start.sqs use it for the game loading images.
Also it's super unreadable.
Here's my idea.
Add
BOOL then CODE/ARRAY
in addition to
IF then CODE/ARRAY
And just add
#define if
in the header file script_component.hpp
😄
Why not?
Sounds like the simplest solution and wouldn't hurt readability.
Ofcause I don't have Intercept_CBA handy here... I'll clone it and do that
See? I can still think right even after doing nothing for 5 weeks.
Is cba intercept live already?
https://github.com/dedmen/Intercept_CBA/commit/95942999db611a53adaef9644ab78f4482e1f1d7
There ya go. I also just had another idea.. I'll see if I can get that working
Btw what does then ARRAY do when you only have one code element in the array?
call ([{}, {}] select condition) is not good enough?
Ewwwww
I think you will like my new idea when it's done. Already know how to do it. Implementing right now
Btw what does then ARRAY do when you only have one code element in the array?
Errors iirc.
Can you tell if a scope was opened by call vs. then, forEach etc.?
why do you even want that
I'm still thinking about a return command that would exit the scope like exitWith, but actually the one that was executed by call instead.
oh that makes sense
Go up the callstack till you find the next call and then jump out of it and push return value onto sack
Yep.
Don't see why that wouldn't work
does the callstack store that information
But I'm not 100% on... ^ exactly that
callstack stores source position. So if I reaaally need to I can just make a string match and see if it's a call
🤔
I think it would be a useful and easy to handle behavour of return in SQF. call is not often used inside functions.
And if it is, it's mostly for local functions... At least when I write something. Dunno if people actually use local fucntions that much.
arsenal uses it quite a lot
BI?
but not for stuff that you would want to return from
no ACE
Biggest problem is probably cleaning up the stack on your way to the next higher call
As each scope leaves stuff on the stack
breakOut/To do it.
A4 we should just add scopeName "main"; to the compile wrapper of PREP.
¯_(ツ)_/¯
is then precence lower than others. Or is else precendence higher than others?
anyone tried to make an r2t bigger than 512 and had it work?
Ugh.. So my idea doesn't work yet. You can't specify precedence in intercept yet
Still reading foxhound.international
What actually happens is that else is given a higher precedence than the then operator. The two code blocks are passed in and are returned as an ElseType object, which the then operator can then selects from once the condition is evaluated.
Noooo! It's not an ELSE. It's an ARRAY that looks like [CODE,CODE].
🤦
if (cond) then {} elseif (cond2) then {} else {};
That is using an ELSE type though
call {
if (cond) exitWith {};
if (cond) exitWith {};
if (cond) exitWith {};
if (cond) exitWith {};
if (cond) exitWith {};
};
🤷
No. Not anymore
never else
