#arma3_scripting

1 messages · Page 420 of 1

still forum
#

Because it will execute only on thislist select 0

#

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

astral tendon
#

well, that code is in a repeatable trigger server only, so that JIP still will not apear in the thislist?

still forum
#

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.

astral tendon
#

Hum... so the JIP player that joins the server, spawns and hit that trigger just not exist?

still forum
#

At the point where a JIP player enters a trigger. he is already ingame and not JIPing

lone glade
#

much better than previously 😄

fossil yew
#

Metaphysics of arma

still forum
#

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?"

lone glade
#

ah shit forgot a case.

astral tendon
#

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

lone glade
#

no ded !

#

actually... now you're making me doubt

astral tendon
#

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;   
};
still forum
#

What do you want/expect the JIP thingy to do?

astral tendon
#

Teleport inside those vehicles if mets one of those conditions

#

off line testing works

still forum
#

That has nothing to do with JIP at all

astral tendon
#

but, add a player that joins later and the trigger farts

still forum
#

What does the JIP flag change on that?

#

Two possiblities.

  1. 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.
  2. 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
#
  1. 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

lone glade
#

true

still forum
#

You were already doing that in the removed line 59

lone glade
#

I also forgot to handle "empty" stats lists

astral tendon
#

the 2 will not happens, the teleport does work and keep the player in action afther die and spwan

still forum
#

Never said it doesn't work. Also never said anything about die/respawn

astral tendon
#

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

still forum
#

So.. Further confirming that the JIP flag is useless and does nothing than filling the JIP queue with useless crap

lone glade
#

the JIP queue exist to be spammed

still forum
#

👍

#

Everyone is doing that. So something has to be right on that

errant jasper
#

To be honest the JIP-ticket idea was right, but execution terrible.

still forum
#

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

lone glade
#

considering some people suspend init scripts.....

errant jasper
#

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..

lone glade
#

that's documented tho

errant jasper
#

Where?

still forum
#

I expect it to start after preInit and then keep on going till after postInit maybe even several minutes into the mission

errant jasper
#

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.

unborn ether
#

All JIP queue is done since getClientStateNumber passes value of 8

still forum
#

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?

errant jasper
#

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.

still forum
#

CfgFunctions also runs at preInit

errant jasper
#

Then simply things like: Can I expect a objects inititialization line to have been run before any JIP ticket involving it are run.

still forum
#

So defining your function for JIP in CfgFunctions or preInit doesn't matter

#

Oh yeah.. That's also a thing

errant jasper
#

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?

unborn ether
#

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

still forum
#

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

unborn ether
#

I do not guarantee that 100%, there's not much about it.

still forum
#

So if what you said would be true CfgFunctions also wouldn't work

errant jasper
#

Good to know.

unborn ether
#

CfgFunctions are done the time JIP is coming. That definitely that way, as any remoteExec'ed function from CfgFunctions is already present.

errant jasper
#

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.

lone glade
#

the fact that you're allowed to suspend init scripts is already an issue in itself....

still forum
#

You are not allowed in CBA land

#

Which I very much prefer

#

non-CBA land is so vague and glitchy

errant jasper
#

Suspend init scripts?

unborn ether
#

Yes, you can suspend init.sqf lol

errant jasper
#

Though you meant initiatilizon lines - my bad.

still forum
#

waitUntil for something happening after postInit in a postInit script. And experience the endless loading screen

#

Which is CfgFunctions fault btw

tough abyss
#

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

unborn ether
#

@errant jasper But why do you need something before JIP?

still forum
#

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.

errant jasper
#

@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.

lone glade
#

torndeco, "waiting for the server to be ready" shouldn't be a thing

#

because it makes 0 fucking sense

errant jasper
#

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.

still forum
#

Usual solution for that is to just put an indicator at the end of the JIP queue. A variable or a remoteExec code

lone glade
#

also for some godawful reason remoteExec in whitelist mode spams the JIP queue like a mofo

errant jasper
#
  • before running some other stuff
still forum
#

Have to take care of making sure it's always on the end though

unborn ether
#

^ Dedmen is right

lone glade
#

unless they fixed it, but it's a problem since 1.52 😭

errant jasper
#

@still forum How do you ensure your indicator runs last?

still forum
#

The thing you put onto the JIP queue last. Runs last.

#

It's executed in order

lone glade
#

you delete everything in the JIP queue after it taps forehead

unborn ether
#

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

peak plover
errant jasper
#

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"];

still forum
#

@peak plover Not good nuff :U

peak plover
#

I could eventually make clusters of clusters

still forum
#

👍

#

Make a clusterfuck

#

lul

peak plover
#

yeah that'd really make my code a complete clustefuck

unborn ether
#

@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.

errant jasper
#

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 😃

unborn ether
#

Well nothing is perfect for your needs.

errant jasper
#

Yes there is. But dammit now you made me want pepperoni pizza.

subtle ore
#

Pineapple pizza

lone glade
#

scripting: easy
finding the right shade of grey / proper way to highlight a title: hardest task ever

still forum
#

Intercept network is probably the perfect solution. It's opensource so you can do whatever you need

errant jasper
#

@subtle ore You know the saying, it it has fruit it must be dessert.

subtle ore
#

@errant jasper Nonsense, wine?

errant jasper
#

@subtle ore Did not see that coming. You have bested me.

still forum
#

apple pie is dessert?

subtle ore
#

😎 wine

still forum
#

Oh wine.. yeah.. that

#

That's a different wine tho

subtle ore
#

Apple pie is breakfast

lone glade
#

yiss, I think I got it

still forum
#

That is Wine Is Not an Emulator

subtle ore
#

🍷 , oh discord has one too

#

Not as cool as the emulator one

lone glade
still forum
#

Needs more shades

lone glade
#

I knew that was coming

still forum
#

You have a good ammo choice tho.

subtle ore
#

Alganthe, did you read my recommendations for changes weeks ago?

lone glade
#

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

subtle ore
#

Okay

errant jasper
#

Just don't make it configurable. I have enough trouble deciding between radial or list view for the interaction menues.

lone glade
#

use list

#

and you can have you own stats

#

example, want to show the range of TFAR radios? you can

errant jasper
#

Cool. Some kind of class added to the config, like dunno ACE_Arsenal_Info?

lone glade
#

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)

still forum
#

Custom controls group yet?

lone glade
#

nope, but you can replace mine by yours since it's event driven 😄

still forum
#

I'm done!

#

leaves

lone glade
errant jasper
#

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.

lone glade
#

the one thing I might do is make the window wider due to translations being ridiculously long in german

still forum
#

deutschübersetzungskünsterverwantwortlicher

errant jasper
#

That banana reminds me, I really need to make a minor mod that makes people trip when running over them.

peak plover
#

😂

#

Shoudl be a feature with ace

still forum
#

no

errant jasper
#

I actually tried it out some time ago, when I noticed, and was sad it didn't work like that 😉

still forum
#

Sounds more like a ABE3 feature

lone glade
#

yep, ABE3 feature

#

along with clippy

peak plover
#

Also eat banans to temprarily increase player advance fatigue

errant jasper
#

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?"

lone glade
#

"You're trying to commit a warcrime, would you like help with that?"

errant jasper
#

That escalated quickly

peak plover
#

OOh, very nice CBA updatate. 30 min ago

still forum
#

lia......... wait... lul

lone glade
#

RELIZ TFAR 1.0 ALREDI
this was your daily reminder

still forum
errant jasper
#

And afterwards make retransmit great again!

still forum
#

retransmit aka relay antenna is part of 1.0

#

so... it should already be great then...

errant jasper
#

NOICE 😄

still forum
lone glade
#

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

peak plover
#

saveProfileNamespace is a much more costly command 'tho

#

Freezes the game for a bit

still forum
#

@lone glade Maybe because some mod periodically calls saveProfileNamespace?

lone glade
#

no, doubt it

peak plover
#

@still forum that would cause lag

still forum
#

When opening esc menu maybe?

peak plover
#

I did it once a second and it became a laggy mess

#

Esc manu saves it afaik

lone glade
#

I noticed it when saving loadouts and deletintg them

#

the activity was 1:1 to what I was doing

peak plover
#

I think it updates it as soon as something changes

lone glade
#

it does for clients

peak plover
#

Not for server?

lone glade
#

no idea as I didn't test it

errant jasper
#

Maybe the file is modified using memory-mapping, and the OS only makes it looks like the changes are instant to the file?

still forum
#

Apparently not

#

as the thing I linked says

#

@errant jasper Nope.

young spade
#

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]];```
still forum
#

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

young spade
#

@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.

peak plover
#

I wonder what happesn when smoke runs out?

#

since it's attached to it. it might make it bug out

young spade
#

Happy to report back, if I get it working...

errant jasper
#

Guess you want something like:

  1. Attach Fired Event handler to player, that when a smoke grenade is fired
  2. waits for it to "stabilize" (not fly anymore).
  3. then move the helipad to its position.
thorn saffron
#

Maybe get near player and look for a smoke grenade and spawn a helipad on that

young spade
#

nearTarget feels like it might be looping quite a bit. Will check it out. Ta

thorn saffron
#

@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

young spade
peak plover
#

Is there a grenade throw eh?

young spade
#

yarp.

peak plover
#

That's useful, didn't know

unborn ether
#

Fired FiredMan FiredNear EVH triggers any projectile fired, since grenade is a projectile from a weapon called "Throw" it also does that

thorn saffron
#

@unborn ether Any idea how to get where the weapon impacted? Just curious

young spade
#

_list = [_xpos,_ypos,_zpos] nearObjects ["SmokeShellPurple", 50];

or is that just ammo?

unborn ether
#

@thorn saffron Gimme a sec

young spade
#

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;
};```
unborn ether
#
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:

  1. Don't spawn it for any projecile, its just an example, use a muzzle name or ammo name to separate it from all others.
  2. 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.

thorn saffron
#

maybe get the last know position, but I was just curious, so no need to bother with that

unborn ether
#

@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.

thorn saffron
#

but if you compare the position with the last check and it returns the same then the bullet has "stopped"

unborn ether
#

And if it doesn't?

thorn saffron
#

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

unborn ether
#

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%

thorn saffron
#

ah

long gazelle
#

Hey, does the basic else if work in arma scripting?

fleet wind
#

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
};
};

long gazelle
#

Ah.

#

Thanks.

fleet wind
#

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.

unborn ether
#

@fleet wind You'd better use EVH: Engine along with GetInMan and GetOutMan

fleet wind
#

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?

unborn ether
#

@fleet wind Those will cover any need you've described without scheduling a lot of things.

fleet wind
#

@unborn ether How will GetinMan help me i never want to check if a player is enters a car im confused.

meager heart
#

@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];
}];           
unborn ether
#

@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.

fleet wind
#

This is way to confuseing for me will have to put it on ice for now. Thanks for the help.

unborn ether
#

@fleet wind Once you get the EVH purpose, you'll be happy.

subtle ore
#

The EVH passes information once it's fired

#

So that you can use the data in execution

fleet wind
#

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}}]

unborn ether
#

Its properly and better to

_vehicle addEventHandler ["Engine",{_this call yourFunctionName}];

OR

_vehicle addEventHandler ["Engine",{
    params ['_vehicle','_engineState'];
}];
long gazelle
#

Is there a way to get the player name when a player interracts with addAction?

meager heart
#

name (_this select 1)

unborn ether
#

@long gazelle Which player, your own player or some player that action is added to?

long gazelle
#

The action is on a laptop, and it should take the name of whomever interracts with it. My player or another player.

unborn ether
#

Well in a scope of whoever interacts with it, you can simply take player inside a addAction code block

long gazelle
#

Oh, no worries, I got it with sldt1ck's line.

unborn ether
#

And yes, better use profileName

#

As name sometimes returns Error: No Unit

long gazelle
#

Does profileName return any players name that interracts with the action?

little eagle
#

It reports the local profile name.

long gazelle
#

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..

little eagle
#

"title"?

fleet wind
#

What exactly are you looking to do? @long gazelle

long gazelle
#

To print a hintC with a tittle and text (with variables) in mp/dedicated server.

#

With remoteExec..

little eagle
#
[title, [content1, content2, ...]] remoteExec ["hintC"];
long gazelle
#

Ah

little eagle
#

Iirc remoteExec complains about TEXT type network serialization, but w/e. It should still work.

long gazelle
#

I'll try it out.

long gazelle
#
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?

peak plover
#

Does format even work like that what the fuck

little eagle
#

I didn't write anything with format.

long gazelle
#

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..

little eagle
#
[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 ^.

long gazelle
#

Not sure again if the format is necessary but it has been previously when I used hint with variables..

subtle ore
#

That's the point of formatting the string,
You cannot do :

_cookies = 1;
hintSilent "_cookies";

And expect a return of 1

little eagle
#

long gazelle
#

@little eagle Works great, thanks a lot. 😃

little eagle
#

yw

subtle ore
#

🍪 ?

little eagle
#
_cookies = 1;
hintSilent str _cookies;
subtle ore
#

Welp. Shows you were my head is at today

little eagle
#
1 = "_cookies";
hintSilent (missionNamespace getVariable str 1);
subtle ore
#

But...why...

little eagle
#

Revenge cookie.

subtle ore
#

At least make it oatmeal raisin :/

#

Chocolate is sort of gross

unborn ether
#
private _cookies = [0,0,0,0,0];
_cookies resize 0;
#

😄

subtle ore
#

@unborn ether You're evil WutFace

#

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?

astral tendon
#
["end_unsafe",true,true,false] call BIS_fnc_endMissionServer;

I cant make BIS_fnc_endMissionServer to end with out music

little eagle
#

Midnight, you can execute CODE with call.

subtle ore
#

Okay

little eagle
#
{systemChat str 1} call {
    call _this;
};
astral tendon
#

any fix for that?

subtle ore
#

Interesting, thanks commy

edgy dune
#

sooooo question, would it be possible to increase the height of the camera a player see through in 1st person ?

little eagle
#

No.

edgy dune
#

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

subtle ore
#

well cool down the garbage then

edgy dune
#

damn ur right

#

if(hot) then {cool};

subtle ore
#

Yep

edgy dune
#

thx

subtle ore
#

Np

little eagle
#

!hot

astral tendon
#

nevermind, i fix that by remoteExec

#
["end_unsafe",true,true,false] remoteExec ["BIS_fnc_endMission"]; 
subtle ore
#

Why

astral tendon
#

see above

unborn ether
#

Actually its somehow possible to change the 3rd person camera, i've seen some addon on armaholic doing that. Seek it.

narrow musk
young current
#

probably a side effect of the attachTo you are using

#

or whatever you use to force the sitting animation

narrow musk
#

attachTo yeah, unsure of how else to go about it tho.

astral tendon
#
publicVariable "PLayMarkaMusic";
PLayMarkaMusic = nil;

nil also effects the publicVariable?

narrow musk
#

Are you getting kicked for publicVariable?

astral tendon
#

What?

little eagle
#

No, Roque. You have to edit the global before sending it. And yes, in A3 you can send variables that are nil/undefined.

narrow musk
#

Sorry, didnt notice you posted above just thought you had trouble with getting kicked for pv.

astral tendon
#

So nil does not delet that variable if is set with publicVariable? so how i delet a publicVariable?

little eagle
#

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];
astral tendon
#

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

little eagle
#

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.

astral tendon
#
missionNamespace setVariable ["PLayMarkaMusic", nil, true];

So, just using this will do what i want?

little eagle
#

This will set the variable to nil on every machine. Dunno if that's what you want.

astral tendon
#

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

still forum
#

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

astral tendon
#

Well, that is what i undestand.

tough abyss
#

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

lone glade
#

get/setUnitLoadout is what you want.

tough abyss
#

does that work with the dynamic vehicle loadouts?

lone glade
#

oh, vehicles

#

no it doesn't

tough abyss
#

that'd make my day far easier than what's suggested on the wiki

#

oh shame

lone glade
#

you mean the pylon loadout?

tough abyss
#
_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;

lone glade
#

that's not the entirety of the code isn't it? I see a foreachIndex in there

tough abyss
#

it is

lone glade
#

oh, that's because you stuffed everything in a single line 😄

#

oh...

#

last foreach, _pylons is a string

#

remove the str before getPylonMagazines

tough abyss
#

alright will do that. Thought setPylonLoadout accepted only Strings

lone glade
#

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.

tough abyss
#

if it tries to do that on let's say a car

#

will it error or just do nothing?

lone glade
#

it will error out, you can't do:
{} foreach "myArray"

#

foreach expect an array, it got a string, it's not happy

tough abyss
#

I didn't mean a string

#

I meant running the code without the str part on a car

lone glade
#

so, again, why do you think you need str ?

tough abyss
#

that was already removed from the code

#

I'm just wondering what happens if the new code runs on a cr

lone glade
#

they don't have pylons, so nothing

tough abyss
#

alright amazing

#

thought it might start throwing errors

fleet wind
still forum
#

Which issue?

#

Use breakOut/breakTo?

fleet wind
#

Ill give it a try

austere hawk
#

if bblabla true
{_breakout = true;}
if _breakout exitWith{};

fleet wind
#

sent you a (Dedmen) Pm of my issue

#

ill give it a try @austere hawk

still forum
#

Also... How about just not using a while true... But a while _variableThatISetToFalseWhenImDone

tame portal
#

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

fleet wind
#

Good point Dedmen

still forum
#

lul indeed

austere hawk
#

while {true} is infinity. You can't change infinity. So u rong

tame portal
#

programming philosophies

austere hawk
#

programming the meta

fleet wind
#

Wait wut A while statement only takes code not Boolean how can i make a variable that sets itself to false then ?

still forum
#

man....

fleet wind
#

Ooo no this is not good

#

Am i rally this stupid ? 😃

still forum
#

"true" is also a boolean

#

and while true like Optix showed above...

#

Do the same with a variable instead of "true"

indigo snow
#

The return value of the block of code is boolean

peak plover
#

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?

ionic orchid
#

I use winmerge for things like that

#

you can do file-file and folder-folder

#

(and its free)

hushed minnow
#

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?

peak plover
#

Thanks @ionic orchid

ionic orchid
#

no problemo

meager heart
#

Total Commander also, nigel

cosmic kettle
#

or any free git, for that matter.

pliant stream
#

or ps diff -ref @(ls -r a) -dif @(ls -r b)

thorn saffron
#

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.

still forum
#

@peak plover something with winDiff I think? AraxisMerge (I use that. Not free tho)

#

@hushed minnow yes.

peak plover
#

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

tough abyss
#

I like Meld merge (free), shame the windows precompiled version isn't updated anymore (but its just python ui program).

meager heart
#

^ also was some plugin for n++...to compare things

hollow lantern
#

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

fleet wind
#

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.

lone glade
#

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

fleet wind
#

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.

narrow musk
#

I use this on my server works fantastic, @chrome mason (credit to)

fleet wind
#

@lone glade Worked Thanks!

chrome mason
#

😉

still forum
#

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};
subtle ore
#

wtf is that

still forum
#

Some guy that apparently doesn't understand programming nor logic thinking

inner swallow
#

put it on the wiki quick

still forum
#

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.

astral tendon
#

Not everyone knows evreythig

lone glade
#

sounds like me when I learned about sqf

#

then I thought 10s and realized it was dumb

still forum
#

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

pliant stream
#

:shipit:

subtle ore
#

@astral tendon That isn't any excuse, the biki examples are better than this. bad practice.

astral tendon
#

Not aways the examples are that good.

subtle ore
#

nope

still forum
#

If example bad. Tell me or fix it yourself ^^

#

I'm sure nowhere on the wiki it says if true then true else false

subtle ore
#

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

meager heart
#

^ Nice code there 🐿

subtle ore
#

?

meager heart
#

Dedmen posted examples, Midnight ^

subtle ore
#

ah

hollow lantern
#

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?

astral tendon
#

Im guessing that you are the gunner right?

hollow lantern
#

no

#

I'm not part of the group

#

and not in the vehicle

#

in fact I'm even in another faction and miles away

astral tendon
#

Yeah, that is a problem, i never could figure that out

#

i use unitcapture now on

hollow lantern
#

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

unborn ether
#

oh wtf is that code?

pliant stream
#

hey no bullying

unborn ether
#

stop spamming 😄

lone glade
#

last message: 28mins ago

spamming
wut

unborn ether
#

thats just too personal, you dont get it 😉

astral tendon
#
 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"; ?

still forum
#

playersslots undefined?

lone glade
#

...

queen cargo
#

that is so horrible styled

still forum
#

while true never ever exiting?

lone glade
#

you can read that?

astral tendon
#

playersslots is a group

still forum
#

the indentation being complete garbage?

#

remoteExec'ing with JIP flag for.. no visibly good reason

astral tendon
#

so the while {true} dont let it read the rest of the code?

still forum
#

while true loops while true

queen cargo
#
 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
    };
 };```
still forum
#

and true is true

queen cargo
#

fixed

still forum
#

and doesn't magically go false

little oxide
#

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 ?

still forum
#

depends.

astral tendon
#

Also, my notepad++ dont like spaces for some reason.

queen cargo
#

use something different then

still forum
#

just use ; instead of spaces then

little oxide
#

depends of what ?

#

If i need it, a lot of times ?

still forum
#

yes

#

and how often it changes

subtle ore
#

(that have alot player on it like 200 player) what are you a lifer?

little oxide
#

No, thinking, about, optimization, in multiplayer environment

astral tendon
#

i thouhg that only waitunitl stop the rest of the code.

still forum
#

waitUntil is basically the same as while

#

Well... Actually not but....... Kinda maybe a little somewhat similar

subtle ore
#

it's still pretty convoluted, a while loop inside a waitUntil

still forum
#

A loop that infinetly loops can never exit. That should be kinda obvious @astral tendon

little eagle
#

My god. Good thing I don't check this channel every day anymore.

meager heart
#

😄

still forum
#

true

#

Wish I could do that too

astral tendon
#

That did not look verry obvious to me, all i know about it is that it loop things in the {}

unborn ether
#

@astral tendon Nice Neverending story there bro 😄

still forum
#

lul that pun 😄

#

Read the wiki page about while

astral tendon
#

😂

still forum
#

It'll tell you everything about how it works

#

And I hope it explains it well....

little eagle
#

If only while would behave the same in scheduled and unscheduled environment.

unborn ether
#

@little eagle unsheduled while is just a pu33y

still forum
#

Not a bad idea

#

Would teach some people some lessons probably

little eagle
#

I don't use while that often. All my loops are forEach.

#

Just because it's the most optimal loop for SQF.

still forum
#

unless count and unless Intercept

rotund cypress
#

For loop is pretty good to

still forum
#

Not the for array one

unborn ether
#

@little eagle well forEach requires a static array

still forum
#

it doesn't

little eagle
#

Yes. But in this game you almost always walk over arrays.

lone glade
#

I use while in only one place in unscheduled

still forum
#

You can modify the array you iterate inside the forEach just fine

#

It get's a little jumpy. But as expected

rotund cypress
#

You shouldnt

little eagle
#

Please don't. Even if it works, keep it readable.

unborn ether
#

@still forum isn't something like deleteAt or resize will break the iterator step?

rotund cypress
#

Because of mutability

#

+array instead

still forum
#

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

little eagle
#

Sounds broken to me.

still forum
#

Completely logical

rotund cypress
#

It is definitely broken

lone glade
#

sounds like sqf to me 😄

rotund cypress
#

Its SQF

#

Please never

still forum
#

Completly logical if you know how the implementation works 😄

#

I think my intercept forEach would crash if you modify the array while iterating

little eagle
#

SQF is fine. People won't suddently start writing solid scripts just because we change to something else.

lone glade
#

and one more addition to my collection 😄

rotund cypress
#

No, but maybe it will be a bit better

little eagle
#

I fear it'll be worse.

rotund cypress
#

Oop etc will be nice

lone glade
#

lower level languages = more chances for lifers to fuck it up

little eagle
#

The more freedom you give them, the more they can fuck up.

rotund cypress
#

Tbh they should just introduce c# scripting support in the new game

lone glade
#

enscript you mean

rotund cypress
#

No c#

lone glade
#

I think you meant javascript*

#

🛫

rotund cypress
#

/giphy god no the office

lone glade
#

honestly I kinda wish they do it

#

just to see what the community "produces"

unborn ether
#

Something default like 50m nearestObjects in onEachFrame?

little eagle
#

Yes.

pliant stream
#

@unborn ether foreach doesn't use iterators

#

with static typing most of those shitty scripts wouldn't compile in the first place though

little eagle
#

SQF doesn't have static arrays. Still, forEach is by far the most common loop. Like at least 9 out of 10.

ionic orchid
#

_forEachIndex is what seals the deal for me

still forum
#

What if I can give you a forEach with _forEachIndex that's still 2x as fast as count?

#

Do I get a cookie?

astral tendon
#
count crew heli2 

How do i count only alive units?

lone glade
#

{alive _x} count crew heli2

unborn ether
#

@pliant stream 😐

#

And I wonder how those arrays alloc is freed then tbh.

pliant stream
#

what are you talking about

#

it's a simple vector

still forum
#

What do you mean with "freed"

#

It's a refcounted pointer to a vectorish array (which is why you can "copy" arrays by reference)

unborn ether
#

Well static arrays are freed automaticly, where dynamic are left on the heap.

still forum
#

What?

#

No....

pliant stream
#

i get the feeling you don't really know what you're talking about

#

why "vectorish"? iirc it's exactly like a vector

still forum
#

It's not a std::vector. It's a custom implementation of a dynamically resizeable array.

pliant stream
#

i didn't say std vector, but conceptually it's the same

still forum
#

Yeah. That's why vectorish ^^

unborn ether
#

so thats vectors?

pliant stream
#

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

still forum
#

Nope they don't have that

#

The full implementation of their array is in Intercept

pliant stream
#

yeah i know, it was just a hypothetical example

#

i had to implement their array vector once too for some arma 2 stuff

unborn ether
#

@Dedmen so thats vectors, not arrays?

still forum
#

What's vectors?

pliant stream
#

an sqf array is implemented as a resizing array, aka a vector

still forum
#

There are no static arrays in SQF if that's what you mean

barren magnet
#

@still forum i would suggest config arrays to be static though

unborn ether
#

Just curious if making array-vector nil or [] clears it.

still forum
#

@Arkensor#0120 No

barren magnet
#

😦

still forum
#

@unborn ether Just like with any other variable.

jade abyss
#

@barren magnet

barren magnet
#

if you make it = [] its empty

jade abyss
#

@still forum Highlightnoob 😛

barren magnet
#

if you nil it its nil

#

arma is not type safe

still forum
#

Assigning a variable deletes the old value.

#

so array = [] will delete the old arrays buffer if there are 0 other references to it

barren magnet
#

@still forum how exactly do i modify a config array ingame then once it has been parsed ?

still forum
#

Intercept?

barren magnet
#

also what about final

still forum
#

No.

barren magnet
#

nah intercept is not default arma

still forum
#

Nothing in SQF is static.

#

Aka static in memory

#

everything is dynamically allocated.

barren magnet
#

how can there be something static in the memory?

still forum
#

compiletime stuff is static

barren magnet
#

Nothing in ram is static

#

poof

still forum
#

The ram itself is static

unborn ether
#

@still forum No, i get what happens on SQF, do that really happen in C++ level?

still forum
#

It's a static piece of glass fibre with silicon chips on it

#

@unborn ether What happens?

barren magnet
#

but whats in it is not static at all

still forum
#

The array getting deleted when there are 0 references? Like I just said. yes.

unborn ether
#

@still forum Fine.

pliant stream
#

@barren magnet do you actually understand c++ storage durations

barren magnet
#

Yes but what has that to do with this?

unborn ether
#

@barren magnet I'd better listen to Dedmen at this point, he definitely knows what happens in Arma 3

barren magnet
#

I did not argue his point

pliant stream
#

you were talking about configs being static

#

were you referring to the static storage duration

barren magnet
#

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

still forum
#

There is no way to change them from SQF code.
Missing the ability to change something doesn't make it static though

barren magnet
#

nothing to do with intercept 🌈 or anything else

still forum
#

Also you can update config after game start with diag binary

barren magnet
#

again thats not everybodys default arma

unborn ether
#

No, those configs are not static because

#

I've seen some mergeConfig stuff.

#

It works on DEV and works on-fly.

barren magnet
#

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

unborn ether
#

compileFinal is a loopy i believe

barren magnet
#

to not mess with it / deny yourself to accidently modify it without throwing errors

#

Thats why i suggest scripting solutions, beside the obvious use intercept 🌈

unborn ether
barren magnet
#

(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?

unborn ether
#

It was not related to MP of your server

#

But that config namespace is not static. (?)

austere hawk
#

arma3diag.exe is SP only iirc -> all diagnostics commands are also only SP

barren magnet
#

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"

still forum
#

How did you get to SQF engine backend talk about how arrays work.
To how to make "static"ish values in SQF frontend?

barren magnet
#

I do not get your point there ded

still forum
#

As I don't get yours

jade abyss
#

Then ask him?

still forum
#

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

barren magnet
#

Oh well i see

still forum
#

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.

little eagle
#

You can compileFinal strings to code, but not arrays.

barren magnet
#

yes indeed

#

was pseudo code @little eagle

#

but yes too

little eagle
#

There is nothing static about it though.

unborn ether
#

As i told, i think is just a scripted loop of compiling something from that string.

still forum
#

No... not at all

#

It set's the final flag

#

That setVariable and = check before assigning

#

and deny assignment in case it's there

pliant stream
#

lol scripted loop

#

must suppress... urge... to bully...

still forum
#

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.....

little eagle
#

:>

pliant stream
#

🤔

jade abyss
#

e.g.: eventHandler @pliant stream

#

addAction

still forum
#

you have two trollfaces that are both :trollface: but are different?

pliant stream
#

yes i'm well aware

lone glade
#

EHs are the worst offenders

barren magnet
#

What a trigger with an inarray inside that checks for comile final in a while loop within a while loop ?

jade abyss
#

@still forum

still forum
#

Me

barren magnet
#

hes magic

lone glade
#

him

jade abyss
#

Yep

little eagle
#

:magic:

still forum
#

(∩`-´)⊃━☆゚.*・。゚

lone glade
#

:mathemagics:

jade abyss
#

The almighty Dschasanosaurus Rex

barren magnet
#

ffs the daily dose of dschas name changes

still forum
#

Get a new daily dose in one hour

barren magnet
#

noice

little eagle
#

MaDschangasaurus.

lone glade
#

did I provide ded's daily reminder today....

barren magnet
#

ha

lone glade
#

I guess I did

still forum
#

yes

#

Did you know that the cannot hear someone bug has been fixed?

lone glade
#

did you know THAT YOU HAVEN'T RELIZ TFAR 1.0 YET?

still forum
#

That was a lethal double dose

#

dead man

barren magnet
#

rip

lone glade
#

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

barren magnet
#

params?

still forum
#

Always.

lone glade
#

have you heard of our lord and saviour params?

barren magnet
#

bis_fnc_param > PARAMS

#

triggered

lone glade
#

which is a wrapper for params now 😄

barren magnet
#

wtf is that thing

pliant stream
#

whats the point of params

still forum
#

What? A rapper?

pliant stream
#

i never used these fancy arma 3 shit

lone glade
#

....

still forum
#

Jack the rapper?

lone glade
#

burn the heretic

barren magnet
#

wtf

inner swallow
#

I'm not a rapper

still forum
#

@pliant stream It takes params out of an array. Replaces multiple private _var = _this select x with just _var

barren magnet
#

its so fast

jade abyss
#

Jawoll

lone glade
#

and also has built in type check and default values

barren magnet
#

gotta go fast

#

and default values

pliant stream
#

do you often need type checking?

lone glade
#

yes

#

ohgod yes

barren magnet
#

every time

lone glade
#

not everytime

barren magnet
#

EVERY TIME

lone glade
#

but anything that you expect someone else to use

still forum
#

Well I prever to just tell idiots that pass the wrong types to fuck the crap off

lone glade
#

yep

still forum
#

Some other people prefer warnings and default/fallback values tho

#

Crazy people these must be

pliant stream
#

so do you have polymorphic parameters or is it just to check the types anyway?

little eagle
#

Stop making up words.

still forum
#

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

pliant stream
#

🤔

queen cargo
#

SQF stayed the same @pliant stream

barren magnet
#

thank you @little eagle

queen cargo
#

only new command

lone glade
#

or specify that X array needs to be N indexes

pliant stream
#

but if the user violates your api contract then it's their fault?

#

i mean i can understand it in debug mode...

barren magnet
#

yes

#

YES

lone glade
#

stop making up words

#

"api contract" jesus

still forum
#

yes. And they get a warning

lone glade
#

it's buzzword town

queen cargo
#

no contracts
just command

pliant stream
#

making up words?

#

what are you daft

still forum
#

instead of a script error and a broken everything

barren magnet
#

"api contract" jesus <<<< yes

queen cargo
#

ignore him

#

contract is the actual correct wording for theese kind of things

pliant stream
#

api is buzzword? 🤔

queen cargo
#

though ... they are ensured via assert stuff usually

still forum
#

arma public inconsistency

lone glade
#

Bohemian Inconsistencies*

still forum
#

No that's an ABI then

tame portal
lone glade
#

hey, that's not nice

pliant stream
#

this is bullying

little eagle
#

mean

tame portal
#

cyber bullying

obtuse cosmos
#

LOL

unborn ether
#

I smell bullying here

subtle ore
#

much bulli

tough abyss
#

@shut flower C# stuff is working 😄

#

tested a few test wrap functions and all sucess

#

going to start wrapping intercept funcs

shut flower
#

lol

#

is it on github already?

tough abyss
#

not yet

#

going to wrap all the stuff and release a proper SDK

shut flower
#

if this works completely I will kiss your feets

tough abyss
#

well its working beutifully in my tests 😄 (C++ Native > C# Managed)

shut flower
#

I could help out with wrapping functions if you're interested

#

just push it to github

tough abyss
#

👍 will get it uploaded as soon as I setup a few more things

shut flower
#

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

tough abyss
#

Well currently there are 3 libraries i have.

  1. InterSharp.dll (What Intercept loads)
  2. InterSharpWrapper.dll (Loaded from InterSharp.dll, wraps native code to be usable in C#)
  3. InterSharpManaged.dll (Loaded from InterSharp.dll, C#, loads other C# addons present with x directory)
shut flower
#

the wrapper is written in which language?

tough abyss
#

C++ CLR

shut flower
#

merging dependencies is quite a shitty task

tough abyss
#

Well... Technically i can reduce it to two dlls

#

I can load mixed CLR

#

So Wrapper and what Intercept loads can be the same

pliant stream
#

you don't even need two

shut flower
#

you can mix it up into one

#

but still a dll dependency

#

clr can load in intercept lib directly

pliant stream
#

does intercept come in the static library variety

shut flower
#

yes

#

with headers

tough abyss
#

well yes i guess you could even remove the base C# dll

pliant stream
#

then you can just link intercept into your native/clr dll and reduce it to total one dll + user plugin

shut flower
#

you can do all of those tasks into one clr dll, no need for a c# dll

pliant stream
shut flower
#

die painfully

tough abyss
#

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"?

inner swallow
#

I think i can answer your question but could you rephrase it a bit, @tough abyss ?

#

I'm not 100% sure what you mean

inner swallow
#

Although by "texture applied in the editor" you mean via virtual garage, you can just export it to clipboard after applying it.

tough abyss
#

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

tame portal
#

InterBasic

#

@shut flower

shut flower
#

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

tame portal
#
Dim iDontLikeYour As String = "Attitude"
shut flower
#

god

tame portal
#

DIM OUT OF HERE

shut flower
#

this reminds me of the first versions of playerindex

#

with this buggy server side tool

#

that even crashed the server

tough abyss
#

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

shut flower
#

I think you can even use this binding in vb

tough abyss
#

should work

pliant stream
#

there's no difference between a vb and c# assembly

tough abyss
#

i mean as in the language. no clue how it works lol

shut flower
#

the question is if it is possible to reference cli dlls

pliant stream
#

the point is that if you expose some CLI api, any CLI language can consume it the same

shut flower
#

As Costura is even able to merge mixed-mode assemblies this wrapper could be awesome to use

inner swallow
#

@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.

shut flower
#

And when .net standard adds support for mixed mode assemblies we can even develop c# dlls for linux

tough abyss
#

I've tried the getVariable "texture" with _v getVariable "texture" but nothing is returned

#

except perhaps an error in the RPT

lone glade
#

if getObjectTextures doesn't work the object doesn't support custom textures.

tough abyss
#

_v being the object

lone glade
#

because that means the object has an empty hiddenSelections array

tough abyss
#

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

lone glade
#

it does tho, it gives you all of them 😄

tough abyss
#

hahaha in that sense yes

#

but still doesn't tell me which one of them is applied 😛

lone glade
#

if you want the one that is applied BI randomization I can check if they store it somewhere

tough abyss
#

applied throught the virtual garage

lone glade
#

garage*

tough abyss
#

oh yes true

lone glade
#

you can retrieve it via a 3DEN attribute

tough abyss
#

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

lone glade
#

gimme 5s if what I'm thinking about would work 😄

#

a shit, it doesn't :/

tough abyss
#

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

lone glade
#

upon init afaik, i'm trying to find where the attribute config is to check

tough abyss
#

would be a shame if we can't retrieve the texture of the vehicle. Means it's always reset upon 'respawn'

lone glade
#

oh, if randomization is enabled it is

tough abyss
#

unfortunately there is no randomization in place, only the virtual garage

#

in 3DEN

lone glade
#

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

tough abyss
#

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

lone glade
#

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....

tough abyss
#

#BIMagic

lone glade
#

i'll check the sqm to be sure

#

huh, it does change something but it's engine read afaik.

tough abyss
#

Shame... Guess variable can't be retrieved the way I implement the texture

edgy dune
#

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 😛

subtle ore
#

@swift ferryenai#3053 Global exeuction?

subtle ore
#

Are for loops incrementing from 0 to the max in ms / seconds or just as fast as possible?

meager heart
#

_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

subtle ore
#

Gotcha, thanks.

#

😂

meager heart
#

yes...

dusk sage
#

@tough abyss#3205 تحتاج إلى التحدث باللغة الإنجليزية هنا

cedar kindle
#

@edgy dune everyone runs it

still forum
#

@tough abyss @dusk sage #rules. English only.

dusk sage
#

Mhm, I was telling him

still forum
#

ah. Thanks.

tight moat
#

Is there some sort of (preferably official) grammar and/or specification for the SQF language anywhere? I already know of foxhound.international

meager heart
#

Biwiki ?

young current
#

probably same stuff there as in foxhound page

little eagle
#

"grammar" 🤔

still forum
#

@tight moat Yes. The stuff from the foxhound page.

#

No there is nothing better because his stuff is correct.

young current
little eagle
#

I had to google it and it looks correct. And the page about local variable scopes talks about params. Good enough for me.

still forum
#

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

little eagle
#

Eh, details. Would you count assignment as a keyword?

still forum
#

private was not added. It was just a rename of local and local was for sure not added recently

little eagle
#

Yea, yea, we know. And it's been there for ages.

#

{
}
forEach

#

So much wasted space. It hurts.

still forum
#

Just noticed that the if is actually completly useless but because of BI's bad implementation we cannot remove it to improve performance

little eagle
#

BOOL then ?

still forum
#

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

little eagle
#

I was thinking about this years ago, but it would hurt readability.

still forum
#

@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.

little eagle
#

if never made much sense in any language if you think about it. 🤔

still forum
#

But in compiled languages it atleast doesn't hurt our precious performance

little eagle
#

True. Yet all scripting languages I can think of use if (or ? for SQS).

still forum
#

Do you see any reason why adding BOOL ? CODE : CODE would break existing scripts?

little eagle
#

I think ? is free in SQF, but it may break SQS.

still forum
#

it already exists in SQS

#

almost ~Exactly like that~

little eagle
#

: you'd have to overload, but CODE : CODE should be free too.

#

Isn't it
? BOOL: CODE
in SQS though?

still forum
#

hm...

little eagle
#

I'm not sure, I never used it much for obvious reasons.

still forum
#

No shouldn't break it

little eagle
#

And idk if intercept added command even affect sqs.

still forum
#

as ? BOOL is a unary operator and BOOL ? CODE would be binary

#

I also don't know.

peak plover
#

then makes it quite readable and easier to understand for noobs

still forum
#

I guess they do though. as else and such are also the same in SQS and SQF

little eagle
#

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

still forum
#

😄

little eagle
#

Why not?

still forum
#

Yeah.

#

also thought about the macro way to hide the if

little eagle
#

Sounds like the simplest solution and wouldn't hurt readability.

still forum
#

Ofcause I don't have Intercept_CBA handy here... I'll clone it and do that

little eagle
#

See? I can still think right even after doing nothing for 5 weeks.

peak plover
#

Is cba intercept live already?

still forum
#

It works

#

not included in CBA or ACE yet

peak plover
#

okay

#

otay

still forum
#

Btw what does then ARRAY do when you only have one code element in the array?

pliant stream
#

call ([{}, {}] select condition) is not good enough?

still forum
#

Ewwwww

#

I think you will like my new idea when it's done. Already know how to do it. Implementing right now

little eagle
#

Btw what does then ARRAY do when you only have one code element in the array?
Errors iirc.

still forum
#

Good. Mine just returns nil then.. ¯_(ツ)_/¯

#

Erroring isn't fully implemented yet

little eagle
#

Can you tell if a scope was opened by call vs. then, forEach etc.?

still forum
#

Yuck...

#

Might theoretically be possible. I should have access to the callstack

pliant stream
#

why do you even want that

little eagle
#

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.

pliant stream
#

oh that makes sense

still forum
#

Go up the callstack till you find the next call and then jump out of it and push return value onto sack

little eagle
#

Yep.

still forum
#

Don't see why that wouldn't work

pliant stream
#

does the callstack store that information

still forum
#

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

pliant stream
#

🤔

little eagle
#

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.

still forum
#

arsenal uses it quite a lot

little eagle
#

BI?

still forum
#

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

little eagle
#

breakOut/To do it.

#

A4 we should just add scopeName "main"; to the compile wrapper of PREP.

#

¯_(ツ)_/¯

still forum
#

is then precence lower than others. Or is else precendence higher than others?

little eagle
#

else is higher

#

then is a normal binary, and if is a normal unary afaik.

ionic orchid
#

anyone tried to make an r2t bigger than 512 and had it work?

still forum
#

Ugh.. So my idea doesn't work yet. You can't specify precedence in intercept yet

little eagle
#

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].

still forum
#

🤦

#
if (cond) then {} elseif (cond2) then {} else {};

That is using an ELSE type though

peak plover
#
call {
    if (cond) exitWith {};
    if (cond) exitWith {};
    if (cond) exitWith {};
    if (cond) exitWith {};
    if (cond) exitWith {};
};
#

🤷

still forum
#

No. Not anymore

peak plover
#

never else