#arma3_scripting

1 messages · Page 463 of 1

tough abyss
#

i have another function that calls the display 16999 and works so idk why this one doesn't want to work

#

the function is being called with the onLoad from the actual dialog that contains all the controls

robust hollow
#

change the empty array in onload to _this and then use _this select 0 which is the display?

robust hollow
#

also why not set the controls to fade=1; in the dialog itself then they load hidden and you only have to unfade them?

#

or fade=0; it goes the opposite way to the script command

tough abyss
#
onLoad = "[_this] call life_fnc_startupIdcHideAndShow;"```
robust hollow
#

onload = "_this call...

tough abyss
#

my bad

robust hollow
#

_this = [display]

#

(or [control] if used on a control)

tough abyss
#
onLoad = "_this call life_fnc_startupIdcHideAndShow;"```
robust hollow
#

yes. and then in the script _display = _this select 0;

tough abyss
#

Oh so I can set the attribute of each button as a fade = 0

robust hollow
#

yes.

tough abyss
#

okay thanks for that, Ill give it a go

verbal otter
#

👍

dry egret
compact maple
#

hello, is there a way to hide a button in a dialog by default ?

verbal otter
#

@compact maple buttonControl ctrlShow false;

robust hollow
#

or show=0; in the dialog config.

compact maple
#

Thanks, show is the attribute i was looking for. Because if i want a button to slowly appear, i have to use a func, but the func is executed after the display shown, so its crappy

late gull
#

guys, it's possible to override a CfgRoles ?

late gull
#

ahh, sorry didn't know that there is a channel for that 😄

gleaming oyster
broken forge
#

heya, how would i write an if statement with 2 inputs e.g.

then{
"WC1CR" addWeaponCargo ["M16",5];
}else{
"You need to set a base down before you can purchase this teritory";
}```
tough abyss
#

what code do i need in description.ext to have a lobby parameter that allows or disables revive

#

on the choice of the host?

#

It's the last script i need, but i can't find anything about that one

still forum
#

@broken forge exactly like you did. Maybe add more parenthesis

broken forge
#

kk

#

ah, bugger

#

i didnt put hint after the else

#

that's why 😄

#

nvm, still doesn't work

winter rose
#

@broken forge ```sqf
if (base == 1 && CP >= 1) then { (…) };

#

&& = and
|| = or

broken forge
#

ty

gleaming oyster
tough abyss
#

that's what i'v been trying

gleaming oyster
#

And...?

versed steppe
#

is it possible somehow to enable Post process effects below water (or in other words, delete the blueness..)

tough abyss
#

i was thinking about something simple like class Params

" #include "\a3\Functions_F\Params\revive.hpp"

#

i mean

versed steppe
#

want to make a submarine interior

tough abyss
#

respawn.hpp

#

but i'm not sure

#

if there is a hpp like that

#

for revives there is paramRevive, so i'm sure something similar must be out there

#

oh wait

gleaming oyster
tough abyss
#

Having an issue, Button Controls will not disable, despite being clearly told to. which is problematic because when I ctrlShow a new interface, the buttons from the previous interface can still be pressed if the position in which they were located beforehand is clicked.

#
_display = findDisplay 16999;
//background buttons
_keychainButton = _display displayCtrl 17015;
_messagesButton = _display displayCtrl 17016;
_gangButton = _display displayCtrl 17018;
_playerInventoryButton = _display displayCtrl 17019;
_licensesButton = _display displayCtrl 17020;
_adminButton = _display displayCtrl 17024;
_syncButton = _display displayCtrl 17017;
_marketButton = _display displayCtrl 17021;
_paypalButton = _display displayCtrl 17022;
_settingsButton = _display displayCtrl 17023;


//hide buttons from previous interface
{
    ctrlEnable [_x, false];
} forEach [_keychainButton,_messagesButton,_syncButton,_gangButton,_playerInventoryButton,_licensesButton,_marketButton,_paypalButton,_settingsButton,_adminButton];```
still forum
#

You have a syntax error there

#

CONTROL is not a number.

tough abyss
#

well i'm using the A3 wounding system script.

#

so for example, to hide the keychain button it would besqf ctrlEnable [17015, false]

#

with a ;

#

oops

still forum
#

Not what you are doing..

#

And you should use the control variant and not the IDC one

tough abyss
#
_keychainButton ctrlEnable false;```
#

Ahh I'm not quite following man

#

I just replace them with the idd's?

#

ahh gotcha, made it work

#

cheers

#

Dedmen so i could include the a3 wounding system sqf in the description. ext and create a line for it to either enable or disable it?

still forum
#

don't think so

#

you can retrieve the setting from the parameter via script. And then you have to check the setting before you enable the wounding system

tough abyss
#

I forgot to ask, to fade buttons in, it is the same rule in which idc's must be used right?

winter rose
still forum
#

Why are you so stuck on trying to use IDC's everywhere?

tough abyss
#

Man I honestly don't know. I was literally fine with them and then just hit a plateu of retardness, and now I can't interpret anything

#

I'm tempted to restart all my functions from scratch because they are just incoherent at this stage..

cosmic lichen
#

Don't use IDCs when you don't have to. It's easier to work with controls directly. Just my opinion.

#

I would not restart. Make it work first, then fine tune it.

austere granite
#

100% use controls

#

also because of our lord and savior controlsGroupCtrl

tough abyss
#

they are shown unless told not to

#

deleted that incoherent shit lmao

unborn ether
#

Lately im not even using controls idcs anymore, just setting -1 by default. I turn to using idcs when its some RscEdit which is widely used in a interface functions, just to make it easier.

tough abyss
#

How do you hide/show your selected interfaces?

unborn ether
#

What is selected interfaces?

#

If you are talking about ctrlShow or ctrlSetFade its all about controls of a display. Interface is a final instance of display/dialog along with all controls in it.

tough abyss
#

Like how would you show a specific control, if you don't know it's idd

unborn ether
#
_someCtrl ctrlShow (true|false);
#

or

_someCtrl ctrlSetFade (0..1);
#

ctrlSetFade will require ctrlCommit

tough abyss
#

and you would define _someCtrl to be linked with a specific idc?

unborn ether
#

Well

private _someCtrl = _someDisplay ctrlCreate ['RscText',-1,_someCtrlGroup];
_someCtrl ctrlShow false;

Doesn't use IDC exactly.

tough abyss
#

I'm honestly not advanced enough to grasp that way of doing it, I started this like a week ago

#

I'll look into ctrlCreate

polar folio
tough abyss
#

Like... why doesn't this work... sqf { ctrlShow [_x, false]; } forEach [17000,17013,17036,17062,17061,17060,17059,17058,17057,17056,17055,17054,17053,17052,17050];

still forum
#

because it is looking on some other display

tough abyss
#

What do you mean?

still forum
#

exactly that.

#

It'll do random confusing stuff where you'll just think "uhh.. What?"

tough abyss
#

so if I want to hide those idc's, what do I type

still forum
#

hide the controls.

#

get the controls into a variable.

#

and hide them

tough abyss
#

alright one sec

still forum
#

exactly like you did before with ctrlEnable

tough abyss
#

What is the syntax for getting the controls into a variable?

still forum
#

You've literally done that 2 hours ago...

rancid pecan
#

how can i add system date(Real Date) in ingame ?

tough abyss
#

Just gonna call it a night, thanks for your help boiz, will try to figure out this mess tomorrow aha xd night

broken forge
#
then{
"WC1CR" addItemCargoGlobal ["rhs_weapon_ak103", 1];
}else{}```
it's saying line 3 has a problem
still forum
#

yeah. That's correct

#

a string is not an object

winter rose
#

well, technically…

unborn ether
#

^ 👀

earnest path
#

Hey guys i have a weird problem I have the following UI element :

class RscExileXM8ListBox: RscListbox
{
    type = 5;
    style = 16;
    colorBackground[] = {0,0,0,0.3};
    colorText[] = {1,1,1,1};
    font = "RobotoCondensed";
    sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
    text = "";
    rowHeight = 0;
    colorDisabled[] = {1,1,1,0.25};
    colorSelect[] = {0,0,0,1};
    soundSelect[] = {"\A3\ui_f\data\sound\RscListbox\soundSelect",0.09,1};
    class ListScrollBar
    {
        color[] = {1,1,1,1};
        autoScrollEnabled = 1;
    };
    maxHistoryDelay = 1;
};

When i add list items with pictures all the pictures are black instead of the actual color they are and my scrollbars are white and look broken. Do you have any ideas?

broken forge
#
then{
"WC1CR" addItemCargoGlobal ["rhs_weapon_ak103", 1];
}else{}``` , yeah, i still don't get this
#

i tried Crate = "WC1CR"

brave jungle
#

Hi there guys, got a question about getVariable for first time players connecting to the server, if someone is free @ me

broken forge
#

and then replaced it with the "WC1CR" before the additemcargoglobal

still forum
#

A variable called Crate that contains a string is still a string and not an object.

#

You have to pass the object you want to add the item to

#

not a string

broken forge
#

so a string would be :

 crate = "[crate name]" createVehicle position player
crate addItemCargoGlobal ["rhs_weapon_ak103", 1];```
?
still forum
#

yeah. for example

broken forge
#

cool

#

would there be any easier way to make an existing object into a string?

still forum
#

object into string.. or string into object?

broken forge
#

object into string

still forum
#

str _object returns a string representation of that object

#

str can be used to turn almost anything into a string

broken forge
#

huh, sick.

#

thanks!

fringe yoke
#

I was using this code here

class Extended_DisplayLoad_EventHandlers {
  class RscCustomInfoMiniMap {
    synixe_nogps = "params ['_display']; { if (isNull objectParent ACE_player) then { _x ctrlShow false; } } forEach allControls _display;";
  };
};

to prevent the GPS minimap from being used. I have just noticed today that it is no longer working, and the GPS can be opened again. Anyone know what has changed that would cause it to no longer work?

violet gull
#

Question: Is it possible to get the view LOD of a vehicle? (Vehicle interior LOD)

still forum
#

What do you mean by "get"?

violet gull
#

For example, I'd like to hide the view LOD for the client

#

"Get" as in store it in a variable or whatever. Is this possible or is it only done via config?

#

Scripting wise.

still forum
#

you cannot store a LOD in a variable

#

the clostest you can get to that is the OBJECT type

#

which is a whole object

#

You can't hide a lod generally

#

if you are lucky all the hiddenSelections for that lod are available in config and you can remove the textures. But I've never seen anyone do that

violet gull
#

Yeah, a lot of these vehicles seem to let you hide everything EXCEPT for the interior.

#

Oh well. Not a big deal, just messing around with it.

tough abyss
#

@still forum can you help?

#

Someone please?

unborn ether
#

@violet gull I want to know the purpose of that actions.

violet gull
#

It is for magical reasons. troll_trump

tough abyss
#

will sqf ctrlShow [_x, false]; just hide them, or hide them and disable them

robust hollow
#

it just hides it but if its hidden you cant click it so you could say its disabled i guess.

tough abyss
#

I see, thanks :3

tough abyss
#

Is it possible to remoteexec an execvm "scriptpath/script.sqf"; ?

icy light
#

Right so in the gui editor I press ctrl+s to export the code. That works great. Now when I close the game, and reopen it again, how can I load my gui that I was making? I don't quite understand. I'm using export classes as names if that matters...

meager heart
#

try this > ctrl+i > missionConfigFIle >> "yourDialogName"

icy light
#

my dialog name?

#

oh im not using any missionconfig file, im bulding a gui for a mod im trying to make

meager heart
#
[[<param>],"scriptpath/script.sqf"] remoteExec ["execVM"];
```@tough abyss
#

im bulding a gui for a mod
missionConfigFIle > configFile @icy light

icy light
#

Im a n00b. Im launching the game > editor > random map i pick > drop player > press esc > gui ediotor

meager heart
#

do you have config for your dialog ?

icy light
#

no

#

are you familiar at all with exile?

meager heart
#

no

icy light
#

well it adds a tablet to the game similar to an ipod.

#

im exporting the code, and putting it into that already written code as an addition

#

if that makes sense

#

essentially it's an "app" for the tablet they add to the game

meager heart
#

that dialog (existing one) has config ?

#

how you open that dialog ?

icy light
#

you export classes as names, copy, paste

meager heart
#

no dude

#

there is somewhere createDialog "someDialogName"; < check for that thing 😀

icy light
#

oh hell lol

meager heart
#

someDialogName < that is the name

icy light
#

perhaps i can ask another way... whats the easiest way from scratch to create a gui, and be able to open it again after restarting arma?

#

i tried to copy what it exported and press ctrl + o... that did nothing lol

meager heart
#

we have 2 options: config or dialogs/ui created with ctrlCreate... if second, that is just script and you can paste it into the console

#

for the first one, you will have to import it, to edit things

icy light
#

hmm. I thought there would be a way just to save it and reopen it

#

thats a bummer

meager heart
icy light
#

interesting, ty

#

might be a bit overkill, but it looks pretty good

fringe yoke
#

Is this missionNamespace global?

#

I had some weird behavior from a script today that was tested in SP and with only 2 MP players, acted really weird on a mission today with 18 players.

pine leaf
#

_message = _message + "<img image='https://i.imgur.com/1gP5rnQ.jpg' width='553' height='730'/>";

#

When i load up the server it says picture not found

#

Any ideas or edits i can make to the code for it to work?

#

unless i remove the width and height since its added in the picture already ?

#

For example <img image='https://i.imgur.com/1gP5rnQ.jpg'/>

robust hollow
#

you cant load external images like that

gleaming oyster
#

htmlLoad might work with ctrls for that kind of effect

#

but make sure it's allowed on the server

robust hollow
pine leaf
#

oh ok so .paa

#

so what i thought

#

does the .paa go in textures?

robust hollow
#

or jpg. it just must be contained inside your mission or mod. in your case i imagine its a mission

#

it goes wherever you like

pine leaf
#

ok cool

#

well try it out now

robust hollow
#

make sure you read that link, arma doesnt do html like ur expecting it to.

pine leaf
#

yeah i understand

still forum
#

@tough abyss No. I can't help with your 700 line crap script while my computer is turned off and I'm trying to sleep. And I personally also don't like people that just keep pushing as if their life depends on that script working.

brave jungle
#

Hi there guys, got a question about getVariable for first time players connecting to the server, if someone is free @ me

still forum
#

Don't spam.

#

You won't get a answer if no one knows the question.

brave jungle
#

I asked last night and just now @still forum . I presumed it got buried. Hardly spam.

#

Its not like i'm asking every hour in various channels

still forum
#

Yeah. I read it last night. And I also back then thought no one will answer. And no one did. as expected

little eagle
#

Now I'm curious what the question was.

brave jungle
#

Punny

#

Basically, when a player first connects, they need to run a welcome-esque script before being assigned a variable for them to skip this for future connects. So I have it working if you assign the variable to profileNamespace, obviously, but then comparing it to something that isn't there means it doesn't work. I understand this, it makes sense.

However how am I supposed to detect if a player has has a variable there or not? (I'm probably missing something here).

robust hollow
#

profilenamespace getvariable "var"
is it not as straight forward as that?

brave jungle
#

It just refuses to work within something like an IF or Switch_Do

still forum
#

it to something that isn't there means it doesn't work you mean comparing to nil?

brave jungle
#

I tried that aswell

#

Still nothing

still forum
#

Commands silently error and are skipped if you use nil

brave jungle
#

How do I insert code again?

still forum
#

How to check if he has the variable? isNil {profilenamespace getvariable "var"} -> doesn't have it

brave jungle
#

^^

#

three of a certain char right?

still forum
#

no.

#

Your variable name

brave jungle
#

no no how do insert code into discord

robust hollow
#

```

```

brave jungle
#

cheers

still forum
#

```sqf
```

brave jungle
#
    switch (profileNamespace getVariable "ReturningPlayer") do {

        case true:        {
        0 = execVM "Scripts\ZeusIntroReturn.sqf";
        };
        case false:        {
        0 = execVM "Scripts\ZeusIntroNew.sqf";
        profileNamespace setVariable ["ReturningPlayer",true];
        saveProfileNamespace;
        };
        case nil:        {
        scopeName "Failsafe";
        0 = execVM "Scripts\ZeusIntroNew.sqf";
        profileNamespace setVariable ["ReturningPlayer",true];
        saveProfileNamespace;
        };
        default {breakTo "Failsafe"; hint "Breaking to failsafe";};
    };

so where the condition is, I can work it around to work with isNil?

still forum
#

yes.

brave jungle
#

Right

still forum
#

nil won't work because the case will just be ignored

brave jungle
#

thought as much

still forum
#

or you could just use a default value of false

brave jungle
#

but just ekpt it there just in case

still forum
#

See how easy it is when you actually ask a question instead of asking if you could ask? You are just wasting your own time by not actually asking the question you want to ask

brave jungle
#

Sometimes people just give sarcastic remarks, so I just went to DMs, worked once or twice however

#

I just wanted a quick answer, not some lecture on it all

#

😛

#

not saying thats you, just re-read that

#

sounds bad

#

digs hole deeper

#

ty!

still forum
#

Just saying.. We could've solved that yesterday in a couple minutes.

brave jungle
#

Yeah I see that now haha

little eagle
#

If I were in charge of a script language, nil would work like you assumed it would.

#

That breakTo will not work btw.

brave jungle
#

First time use on that one

#

Need to read into it

little eagle
#

And a global variable without OFPEC tag is a terrible idea, and especially terrible in the profile namespace.

#

First time I use that one
Just ignore breakTo etc. existing. They're not needed, and only make bad looking code 99%* of the time (*always).

#

Not everything that exists has a use.

brave jungle
#

Oh, I see

little eagle
#

The 0 = should be deleted as well. Just pointless overhead.

brave jungle
#

yeah Dedmen told me that one, habit I think

#

I see it everywhere in the Biki too

little eagle
#

whistle

brave jungle
#

xD

little eagle
#

idk

#
if (profileNamespace getVariable ["commy_hasSeenIntro", false]) then {
    execVM "Scripts\ZeusIntroReturn.sqf";
} else {
    execVM "Scripts\ZeusIntroNew.sqf";
    profileNamespace setVariable ["commy_hasSeenIntro", true];
};

This is how I would write this.

#

Or maybe:

with profileNamespace do {
    if (isNil "commy_hasSeenIntro") then {
        execVM "Scripts\ZeusIntroNew.sqf";
        commy_hasSeenIntro = true;
    } else {
        execVM "Scripts\ZeusIntroReturn.sqf";
    };
};

If you want to be fancy.

brave jungle
#

Thank you commy 😃

inner swallow
#

i didn't know about with 😮

little eagle
#

when used in a do-construct in scripts with allowed suspension, an unexpected namespace switch could happen (see note below)

#

Another nice feature of the scheduler.

queen cargo
#

"feature"

#

just means namespaces are not saved permanent

#

in scheduler scopes

#

which is literally a bug

little eagle
#

Ask Dedmen, they are. But not read properly.

queen cargo
#

which is literally a bug

#

could not remember what was the cause

inner swallow
#

yeah i was just going through that page

#

seems safer to just use setvariable...

little eagle
#

Or

#

Stop using the shatuler

inner swallow
#

obligatory "how to i use sleep otherwise?"

errant jasper
#

Don't.

inner swallow
#

what do i use instead

#

inb4 PFEH

#

my context is mission scripts btw

#

not mods

errant jasper
#

event handlers

inner swallow
#

eh somethings are just way easier to do with triggers and scheduled scripts

#

if you want to end the mission 30 mins in, i don't see how you'd do that with an EH

#

or other such timed events

fringe yoke
meager heart
#

SuicideKing, if mission is nice, why you have to end it ? just keep playing... /s

still forum
#

@fringe yoke requiredAddons

little eagle
#

@fringe yoke Did you check the master config via config viewer? If your addon is loaded before ace_markers, your addon overwrites vanilla and ACE overwrites yours.

fringe yoke
#

I have checked master config, image attached

#

requiredAddons[] = {"ace_common", "ace_markers", "synixe_main", "synixe_common"};

little eagle
#

If the master config no longer says onUnload = "_this call ace_markers_fnc_placeMarker;", then that function will not be exeucted.

fringe yoke
#

It applies the marker rotation, which I am fairly sure is in the ACE code

#

My code is just

#include "script_component.hpp"

disableserialization;
params ["_display", "_closeNum"];

systemChat "synixe place marker";

and I don't get a systemchat message. It's got me quite confused

little eagle
#

Did you restart the game?

fringe yoke
#

Yes

#

A few times now

little eagle
#

Can you copy paste the master config?

fringe yoke
#

For the addon? or something else

little eagle
#

The master config is the config generated by the game on game boot.

fringe yoke
#

Like an all in one config?

little eagle
#

Yes.

fringe yoke
#

Sure

little eagle
#

And?

#

What does it say?

fringe yoke
#

onUnload = "_this call synixe_maps_fnc_placeMarker;"; is what the config has under RscDisplayInsertMarker

hollow lantern
#
    RIM7LB disableAI "AUTOTARGET"; RIM7LB disableAI "TARGET"; RIM7LB setCombatMode "BLUE"; 
    RIM7RF disableAI "AUTOTARGET"; RIM7RF disableAI "TARGET"; RIM7RF setCombatMode "BLUE"; 

    PhalanxRF disableAI "AUTOTARGET"; PhalanxRF disableAI "TARGET"; PhalanxRF setCombatMode "BLUE"; 
    PhalanxLM disableAI "AUTOTARGET"; PhalanxLM disableAI "TARGET"; PhalanxLM setCombatMode "BLUE"; 
    PhalanxCB disableAI "AUTOTARGET"; PhalanxCB disableAI "TARGET"; PhalanxCB setCombatMode "BLUE"; 

    RIM116LF disableAI "AUTOTARGET"; RIM116LF disableAI "TARGET"; RIM116LF setCombatMode "BLUE"; 
    RIM116RB disableAI "AUTOTARGET"; RIM116RB disableAI "TARGET"; RIM116RB setCombatMode "BLUE"; ``` So I tried to disable the CIWS on the USS Freedom so they don't shoot. That's not working.  Is there any specialty for this? I mean it seems to be no normal UAV AI as you can't control it via UAV terminal
little eagle
#

So maybe this only synchs the angle etc. to everyone else, and with this disabled, it still sets the marker as expected for yourself.

#

I know this was written by me, but it has been 3 years... :(

fringe yoke
#

With nothing in onUnload it will still create a marker

little eagle
#

Yep, the placeMarker event only adjusts the addtional parameters of the marker.

#

The creation itself is still by the base game.

#

What's the goal here?

fringe yoke
#

Unique maps, it was working fine using EHs, I was hoping this would be a more elegant solution

little eagle
#

"Unique maps"?

fringe yoke
#

Mainly support for objects as maps, so a laptop could have a map attached to it for players to view to see locations

little eagle
#

Honestly, I would just use a draw eventhandler doing icons and not use ingame markers.

#

@hollow lantern Just remove their ammo, or kill the drone AIs.

fringe yoke
#

That is how I am drawing them, the issue is grabbing the info from the marker they place in the map. It also needs to support markers from the editor and from briefing. I was using the CBA marker events, but they don't tell you who created a marker, just the marker name.

#

and get executed globally which was causing too many issues

little eagle
#

I think the marker name has the client id of the client machine in it's name.

fringe yoke
#

It does yeah, I was just hoping this onUnload would be a more elegant, performance friendly way to solve both issues at once

#

no luck so far

little eagle
#
["ace_markers_setMarkerNetwork", {
    params ["_marker", "_data"];
    _data params ["_markerClassname", "_colorClassname", "_pos", "_dir"];
    
}] call CBA_fnc_addEventHandler;

You can grab the additional info like this, iff you don't have the onUnload event disabled of course.

#

But this also will trigger for remote markers.

#

Should be a simple enough check though to just ignore markers placed by different CBA_clientId's.

hollow lantern
#

@little eagle I just did it with sqf <CIWS> setCombatMode "BLUE"; and that works flawless

little eagle
#

cool

icy light
#

I have the code : onMouseButtonDown = "_sTxt = lbText[1500, lbCurSel 1500]; hint _sTxt;"; And it works, but I have to click twice. Im assuming that its because its firing hint before allowing the return of lbText. Is there a fix for this?

little eagle
#

Maybe the selection switches after the MBD event.

icy light
#

Thats how it appears

little eagle
#

This is why you should use the lbSelChanged event instead.

icy light
#

Good suggestion. Will try that

#

I can use onlbSelChanged = ""; ?

little eagle
#

That wouldn't do anything.

icy light
#

nvm

#

got it 😃

#

ty

little eagle
#

yw

hollow lantern
#

what's the best solution to stop a group from moving around (formations I guess) without disableAI ?

little eagle
#

Uhm, attach them to a dummy object?

icy light
#

@little eagle do you have any experience with extDB2?

hollow lantern
#

wasn't there a parachute paradrop in the APEX campaign? How was that done?

storm crow
#

@icy light I wouldn’t recommend using extDB2, it has a quite serious security flaw. Anyone can drop all your tables whilst in-game if they know how.

still forum
#

That's not extDB's fault. That's your fault of missconfigured user permissions for the database user

storm crow
#

Hey hey hey, don’t shoot the messenger. It’s not really misconfigured user permissions since depending on the framework you’re using, you might require the drop permission.

still forum
#

Stored procedures all the way. And no rights other than executing these.

#

If the framework you are using is dumb. Then choose a different Framework. But that's not extDB's fault

storm crow
#

Blame Koil with his messy Nopixel framework, yucky.

icy light
#

@storm crow well im making a mod for exile, which uses extdb2.. what should I use?

storm crow
#

@icy light Personally, I would recommend extDB3 for better security and performance.

icy light
#

Well, IF i decide to go that route, is there any documentation on it? Like how to do a simple query?

#

Right now Im having to pick through existing code and reverse engineer the calls, its a pain

#

plus i reckon i will likely have to make it compatible with both so server hosts can use it

storm crow
icy light
#

awesome ty!

storm crow
#

Not a problemo

wary vine
#

BIS_fnc_holdActionAdd possible to change the button , cant seem to find it anywhere ?

robust hollow
#

the button to hold? copy the script into ur mission/mod and define the button you want

wary vine
#

yup was just thinking that xD

#

will probably put something in so i can just pass the dik code through with the function.

meager heart
#

there is also BIS_fnc_keyHold afaik with just display EH KeyDown

little eagle
#

Please don't ping me if you have a question that has nothing to do with me, thanks.

lone glade
#

^ can be read as "ping me"

little eagle
#

I answer if I know the answer, or know a way to get it.

edgy dune
#

so about SQF it self, is BI the only place where its used? or is SQF used in other places? What im getting at is, I was looking at pastebin and noticed that they had a SQF syntax highlighter and I was thiknig that it means that SQF is used outside of BI stuff, so I guess my question is, what else besides BI stuff uses SQF

little eagle
#

It is used in VBS too, which is made by BI Simulations, which is a different company. Otherwise no.

edgy dune
#

what does SQF stand for? I prob should have asked this question like 4 months ago when I started scripting XD

little eagle
#

I was looking at pastebin and noticed that they had a SQF syntax highlighter and I was thiknig that it means that SQF is used outside of BI stuff

#

No, that's just because KoffeinFlummi and I made the pull requests at the appropriate places a few years ago based on JonBons' syntax highlighting for Sublime Text.

#

what does SQF stand for
Status Quo Function, based on the older SQS - Status Quo Script, which uses a different syntax, but the same set of commands.

#

Point of SQF is, that you have functions with return values, instead of everything being a pseudo thread.

tough abyss
#

I want to check if a specific player is at a specific coordinate, and then if the condition is true, the rest of the function will start

#
private _posDefendant = [3638.17,13386.7,3.76691];
private _defendant = player getPos _posDefendant;

//bunch of checks
if (isNull _posDefendant) exitWith {["There is no defendant active in stand."] call life_fnc_notification_system};

if (playerSide != civilian) exitWith {["You are not a judge."] call life_fnc_notification_system};```
edgy dune
#

oh I see

tough abyss
#

or would sqf if (_defendant position != _posDefendant) exitWith {["There is no defendant active in stand."] call life_fnc_notification_system}; be correct?

cosmic lichen
#

It's very unlikely that the position of the player is exactly the same as _posDefendant.

tough abyss
#

Well in my script, the player will be teleport to the exact position, and their input will be disabled, so they can't move

cosmic lichen
#

I see.

#

Then why even check it?

#

Just execute the code after teleport

tough abyss
#

Well I forgot to mention actually, that this function above is for a judge menu dialog, that has a 'monetary fine' button, and will spawn the give ticket dialog that will only apply to the person on those coordinates

#

I am trying this with ```sqf
private _posDefendant = [3638.17,13386.7,3.76691];
private _defendant = player getPos _posDefendant;

//bunch of checks
if (_defendant position != _posDefendant) exitWith {["There is no defendant active in stand."] call life_fnc_notification_system};

if (playerSide != civilian) exitWith {["You are not a judge."] call life_fnc_notification_system};

//start funtion once checks have been passed

while ((_defendant position) == _posDefendant) do {
createDialog "Life_ticket_give";
["Please select the amount you wish to give the defendant."] call life_fnc_notification_system;

};

cosmic lichen
#

private _defendant = player getPos _posDefendant;

#

that's wrong

#

Also _defendant position != _posDefendant

tough abyss
#
if ((position player) != _posDefendant) exitWith {["There is no defendant active in stand."] call life_fnc_notification_system};```
#

Better?

#

How do I apply the function to a different player? I think my function will only effect the person executing it

cosmic lichen
#

Yes, better. You would need to remoteExec it or refer to the unit not the player.

clever mantle
#

I have a generell question about locality, what is the difference if you initialize a variable with private in front of it? I thought that wouldn't be necessary considering the underscore in front of the name would make the variable only accessible by the object or script... What is the difference between declaring a variable private and the _underscore method... Im fairly new to SQF btw

cosmic lichen
tough abyss
#

It privatizes it :3

little eagle
#

You cannot use == with positions, because positions are ARRAY's, and those are incompatible with the == operator.

#

You can compare ARRAY's with isEqualTo, but even a micrometer distance would result in the comparison evaluating to false. A very bad idea.

cosmic lichen
#

a distance check would be much better.

#

or inArea

little eagle
#

Yeah, point in circle, not point in point.

tough abyss
#

Would inAreaArray be better then?

cosmic lichen
#

((player distance _pos) <= 15)

little eagle
#

Why do you refuse to make a simple distance check? inAreaArray is more suited for whole arrays of positions and objects, not a single one.

#

You have to be careful with what R3vo posted, because _pos has to be in the AGL format for the distance command to calculate correctly. I'm not sure you made sure of that with your hard coded position. I'd use distance2D for simplicity.

#

private _posDefendant = [3638.17,13386.7,3.76691];
^ this is what I'm referring to. I don't know where this comes from.

tough abyss
#

I see. And that is the same position in which the player will be teleported and frozen

#

in regards to private _posDefendant = [3638.17,13386.7,3.76691];

little eagle
#

Joon, it still matters how you retrieved this position.

#

Where does it come from?

#

This somehow all doesn't seem right to me how you're using getPos here.

#
private _posDefendant = [3638.17,13386.7,3.76691];
private _defendant = player getPos _posDefendant;

The syntax is origin getPos [distance, heading], but _posDefendant in your example has 3 elements, not 2 (distance and heading). Seems broken to me.

tough abyss
#

I definitely need to revisit some things now.. I see what you mean. I will unscrew everything up first and get back to you with something

little eagle
#

Yeah, maybe describe what you're trying to do. I'm away 2 minutes getting my meal ready.

tough abyss
#

alrighty cheers, will do

#
/*
1) Player is teleported behind defendant podium stand.
2) judge decides through the 'impose sanction' dialog, to impose a monetary fine
3) Life_ticket_give dialog is spawned, and judge enters amount, and gives the ticket to the player that is behind the podium
*/
little eagle
#

@clever mantle I missed your question.

I have a generell question about locality, what is the difference if you initialize a variable with private in front of it?
Locality refers to the question of which machine controls a game entity in multiplayer. It has nothing to do with variables despite Global and Local variables being called the way they are. Don't think about objects at all, just about different script instances.

The underscore at the start of the identifier is what makes a variable a local variable. All others are global.
Global variables are available in all script* instances.
Local variables belong not only to one script instance, but specifically to a scope of the script. Scopes are everything enclosed inside curly brackets, i.e. functions and then-block in if-then-else control structures.
A local variable is only defined inside the scope in which it belongs to and all it's child scopes, but none of the parent scopes.

#

cont. after I check my meal....

clever mantle
#

@little eagle Thanks

tough abyss
#

@clever mantle You can also redefine _variable and change the value to something else throughout the script

still forum
#

same with global and privatized variables..

#

All others are global. This reminds me of why I hate Arma again...

little eagle
#

Please don't spam the chat while I explain.

still forum
#

whoever got the idea of local variables without underscore should be fired

little eagle
#

@clever mantle Every time you use the assignment operator without private, the game iterates backwards through all parent scopes of your current scope in the script instance. If it finds a variable with this identifier defined in the scope, it stops and overwrites the previous value with the new one. Only if no variable with this identifier was assigned in any of the parent scopes, the variable is set in the current scope.
The private assignment syntax is simpler. The game sets the variable inside the current scope and doesn't touch those with the same identifier in parent scopes.
This means that to get a script to work properly with all other functions that may be executed in the same script, the first time you create your variable you should use the private keyword for assignment. And you have to do that in the most outer scope you want to use the variable in.

still forum
#

The only place you theoretically don't need private is if you know 100% that you are the highest scope. Like init.sqf or eventhandlers or trigger code.
But in other places private makes your script safer and faster

little eagle
#

Another place would be in the main scope after spawn. To me that's too many exception from the general rule though, so for simplicity, I turn my brain on autopilot and always use private if I assign a variable for the first time. Kinda like declaring the variable in other languages, except internally for different reasons.

still forum
#

on the other hand. If you add it on the highest scope although you technically don't need to. The script still doesn't get any slower

little eagle
#

Yeah, you don't even lose anything. You have 3 keystrokes more with autocomplete, but at least you can easily see where a variable comes from if you have proper syntax highlighting in your editor.

tough abyss
#

Can you please define what input argument means? I am trying to better understand the use of params

still forum
#

(input argument) call my_fnc_script

#

You have 3 keystrokes more with autocomplete a intelligent IDE could auto-insert the private when you press = and the name wasn't defined before

little eagle
#

"input argument" sounds weird to me. You could call it argument or input, but not both at the same time. Redundant.

tough abyss
#

Got it from the description of params on the wiki xd

still forum
#

basically. It mean _this variable.

#

or otherwise the left hand side argument of params

tough abyss
#

When would you chose to use params []; over private [_blah,...]?

still forum
#

completly different things

tough abyss
#

Example 3. One other command that is capable of creating private variables is params

still forum
#

private [...] defines a bunch of variables as nil and privatizes them.. I would never use that because it's fkin expensive

tough abyss
#

wiki confuses things for me :/

still forum
#

params takes values out of _this. and assigns them to private variables

#

Here. A copy-paste from last week:

params ["_var"] is equal to

private _var = if (_this isEqualType []) then {
if (count _this > 0) then {_this select 0} else {_defaultValue};
} else {_this};

or private _var = _this param [0, _defaultValue]

where _defaultValue is nil in this case

tough abyss
#

So it allows you to apply a whole function to variable without having to write the script out?

still forum
#

It's just a command that does what that script does

#

it basically does that script, but in engine thus alot faster

tough abyss
#

@little eagle Don't worry about my court function brother, thanks though. It's clear to me that I need to revise and learn some things first aha

#

7:41 - 8:30

#

Is anyone able to explain this more clearly?

#

Goes through one ear and out the other

little eagle
#

That guy uses _this select N, which is pretty bad in 2018.

cosmic lichen
#

This video is ages old and he does not do tutorials anymore

lone glade
#

watching youtube tutorials isn't really the best way to learn

#

nor a good way to learn at all.

tough abyss
#

I know, but Trying to grasp the concept of params is my worst enemy atm

cosmic lichen
#

It depends, if they are up-to-date it's a way of getting started

lone glade
#

what's your issue understanding how params work?

tough abyss
#

How are they used? Why are they used? And a full example would definitely get me to understand

lone glade
#

params is a command, what do you mean "how are they used" ?

little eagle
#
private _fnc_print = {
    params [
        ["_string", "", [""],
        ["_useChat", false, [false]]
    ];

    if (_useChat) then {
        systemChat _string;
    } else {
        hint _string;
    };
};


["hello world", false] call _fnc_print; // prints "hello world"
["hello world"] call _fnc_print; // prints "hello world"
"hello world" call _fnc_print; // prints "hello world"

["hello world", true] call _fnc_print; // prints "hello world" in chat

Maybe playing around with this helps?

#

Just ask if you have a question about any specific line.

tough abyss
#

First of all, from what I can see a paramater has 3 elements, correct?

#

where does _useChat come from?

little eagle
#

In params? Usually yes. It can be also one or four or two, in which case every other parameter is a default value documented on the wiki.

#

_useChat is a variable defined by params.

#

In those last four function calls, the value is passed to the function. The first time it is explicitly set to false, in the last time it is explicitly set to true

#

And in the second and third case it is undefined, which means that params sets it to the default value false.

tough abyss
#

_fnc_print is a variable, and it is being called by the last four function calls

little eagle
#

Which is the first false after "_useChat" in params.

#

_fnc_print is a variable that holds a function, yes.

#

Only functions can be call'ed.

#

You can see that it is a function by the { } curly brackets.

tough abyss
#

mind is still blowing up ahh

little eagle
#

Maybe something simpler. You have to understand functions first, otherwise params makes not much sense.

tough abyss
#

ill re-read the wiki

#

it says it is out-dated at the top, is this true?

little eagle
#

I don't see a single time a function being assigned to a local variable on that page. It seems to me that the author didn't know that much either.

tough abyss
#

your code above is an inline function right?

still forum
#

It's just a normal function.

#

doesn't matter where it is

#

A inline function would be
_stuff = stuff call {function code} for me

little eagle
#

I don't think "inline function" is well defined.

#

Yep, Dedmen got it. That looks more like something that would be called inline function.

#

I think the author of the wiki tried to distinguish functions defined by your script from functions defined by the CfgFunctions framework.

#

But I would argue that functions defined by script are the most normal case of a function, so I would only qualify a CfgFunctions defined function with an attribute, i.e. "CfgFunctions-function".

still forum
#

a function is literally a CODE type variable.

#

No matter if local of global or from CfgFunctions or whatever

little eagle
#

Yes.

still forum
#

I'd say my above example is could get the special "inline" name because it's actually never stored in a variable

little eagle
#

Agreed.

tough abyss
#
//MyCode.sqf
params ["_parameterOne", "_parameterTwo"];
//Inline Function
myInlineFunction ={
    params ["_parameterOne", "_parameterTwo"];
};```
#

the function is using the same code as defined in params?

#

does it mean that it takes the params from params and puts it in the function

little eagle
#

The arguments are taken from the left hand side of the call command.

tough abyss
#

I'm not getting this, what should I do?

little eagle
#
[10,12,15] call {
    params ["_value1", "_value2", "_value3"];

    _value1; // 10
    _value2; // 12
    _value3; // 15
};
tough abyss
#

mhm I see whats going on

#

well in that code at least..

still forum
#

functions don't store anything of where they are defined. Many people often think local variables carry over when you define a function. Completly untrue

little eagle
#
private _function = {
    params ["_value1", "_value2", "_value3"];

    _value1; // 10
    _value2; // 12
    _value3; // 15
};

private _args = [10,12,15];

_args call _function;

Do you also understand that this is exactly the same?

tough abyss
#

how would _function know that the values are 10,12,15

little eagle
#

call tells it.

still forum
#

_args call _function; Because you give them to it

tough abyss
#

so then _function inherits the same values

little eagle
#

call has _args on the left hand side, and _args is [10,12,15] defined a line above.

still forum
#

whatever is on the left of call get's copied into the _this variable inside the function.

#

which is where params then pulls the arguments back out of

tough abyss
#

can you please provide a script example of lets say, setting the position of a player to 3 different locations

#

using params

#

if that makes sense

#

ill write one myself (or try to) and see how it goes

#
_positionPlayer = params {
_pos1; //[x,y,z]
_pos2; //[x,y,z]
_pos3; //[x,y,z]

};

_newPosition call _positionPlayer;```
#

just wrote this probs makes no sense at all

still forum
#

yeah. params doesn't take CODE

#

and _positionPlayer is undefined

tough abyss
#

hmm lemme retry

little eagle
#
private _fnc_updatePosition = {
    params [
        "_unit",
        "_position"
    ];

    _unit setPosASL _position;
};

private _target = cursorTarget;
private _targetPos = getPosASL _target;

[_target, getPosASL player] call _fnc_updatePosition;
[player, _targetPos] call _fnc_updatePosition;
#

Like this?

#

This swaps yours and your targets position.

tough abyss
#

if you were to swap `_target" with specific coordinates, would it be something like this: ```sqf
private _fnc_updatePosition = {
params ["_unit","_position"];

_unit setPosASL _position;

};

private _target = [x,y,z];
private _targetPos = getPosASL _target;

[_target, getPosASL player] call _fnc_updatePosition;
[player, _targetPos] call _fnc_updatePosition;```

#

or sqf private _target = getPos [x,y,z];

little eagle
#

That would error, because then _unit becomes a position and not an object, and therefore _unit setPosASL will error.

still forum
#

Just read

#

for one. setPosASL doesn't take Array on left side. But you are passing _target as first parameter which get's the left argument to setPosASL

#

second. getPos doesn't take array on right side. So you cannot do that

little eagle
#

^

tough abyss
#

well... params seems a bit adavanced

little eagle
#

setPos is explained on the wiki.

still forum
#

yeah. it is.

#

but it's still one of the basics you need to know once you write more stuff than just trigger or init box scripts

tough abyss
#

Do you believe I should revisit it and learn something else now, or keep trying to learn it

#

because I am honestly still lost with the idea

little eagle
#

You're lost by the idea of setPos?

tough abyss
#

params

#

setPos I understand, ive made some cute skydiving scripts with it aha

little eagle
#

Do you know what a variable is?

tough abyss
#

Yes

#

storage container for data

little eagle
#

params is used to assign a set of variables inside a function. The identifiers of the variables are written down after the params command, and the values are retrieved by whatever the arguments passed to the function by the call command are.

tough abyss
#
private _myMoneyBalance = {
params ["_balance1","_balance2","_balance3","_balance4"];
_balance1;
_balance2;
_balance3;
_balance4;
};


_myUpdatedBalance = [500,200,100,999];

_myUpdatedBalance call _myMoneyBalance;```
#

I'm gonna write whats happening please correct me

little eagle
#

Looks good so far.

tough abyss
#

The first part (everything above };, involves a variable which is defined as _myMoneyBalance. That variable holds four paramaters, that are not defined, because they will be defined later on. after the first scope, a new variable exists to set the four elements to [500,200,100,999]. Then this is initialized by calling the function that holds the paramaters.

#

I also don't understand why sqf _balance1; _balance2; _balance3; _balance4; is required?

#

wouldn't they need to be assigned to an empty string?

#

_balance1 = "":

little eagle
#

It isn't required, but the function should probably be doing stuff with them.

tough abyss
#

Now another question I have is, why would you want to do this?

#

couldn't you just redefine the variables later on?

#

_balance1 = 5000;

little eagle
#

So you can use the function in a lot of different places without having to rewrite the same code multiple times.

#

The function currently does nothing, because there is nothing relevant done after params.

tough abyss
#

Have you got a file I can look at that does this?

tough abyss
#

Actually, are you able to give me a real script idea to make, where I can try and use params

little eagle
#

Hmm, very bad at coming up with stuff like that.

tough abyss
#

I'll take anything xd

tough abyss
#
[] spawn { 
 
 
private _pos1 = [10,10,10]; 
private _pos2 = [222,222,100]; 
 
 
 
player setPos _pos1; 
sleep 3; 
player setPos _pos2; 
sleep 3; 
 
private _positionPlayer = { 
params ["_pos1","_pos2"]; 
_pos1; 
_pos2; 
}; 
 
_newPosition = [5000,5000,5000]; 
_newPosition call _positionPlayer;
player setPos _newPosition; 
 
 
}; 
little eagle
#

You may want to fill your function with some content, because atm this truly doesn't make much sense.

astral dawn
#

A little preprocessor question: if I have a macro like #define MY_MACRO(param) , can it take a multi-line statement as parameter, like a multi-line block of {CODE}?

still forum
#

yes

astral dawn
#

Hmm... going to check my macro further, thanks

astral dawn
#

I mean if I provide a multi-line statement as a macro argument, while you provide a macro which expands into a multi-line code. I'll show it in a second.

#

Allright, that's quite weird preprocessor behaviour.
So, this code:

#define SET_FUNC(funcName, funcCode) funcName = funcCode
SET_FUNC(myFuncName, {
    params["_unit"];
    _unit setDammage _dammmage;
});

Expads fine into this:

myFuncName =  {
    params["_unit"];
    _unit setDammage _dammmage;
};

But as soon as I add more than one parameter into the params block:

#define SET_FUNC(funcName, funcCode) funcName = funcCode
SET_FUNC(myFuncName, {
    params["_unit", "_dammmage"];
    _unit setDammage _dammmage;
});

It doesn't expand into anything any more. It's just all gone and only a ; is left:

;
little eagle
#

You cannot use an argument that contains , , because the comma is used to separate the arguments.

astral dawn
#

Oh that explains a lot, you are obviously right

little eagle
#
#define FUNC {\
    params["_unit"];\
    _unit setDammage _dammmage;\
}

#define SET_FUNC(funcName) funcName = FUNC

Could try this syntax.

#

Or maybe this?

#define FUNC {\
    params["_unit"];\
    _unit setDammage _dammmage;\
}

#define SET_FUNC(funcName,funValue) funcName = funcValue

SET_FUNC(blah,FUNC);
astral dawn
#

Yes, or like this: it's in SQF code not in a config or smth like that.

SET_FUNC(myFuncName, _myFunc);```
My idea was to make a macros of this kind for multi-line functions, but I found a workaround with two macros: one for the start and one for the end of a function definition.
little eagle
#

Does it have to be a macro? Sounds like something more suited for script.

astral dawn
#

Most likely yes... I was trying to make an OOP implementation like oop.h by code34, so I needed a macro for defining methods of my class.

tough abyss
#

I just read that you should use BIS_fnc_loop instead of a while loop. Is this true?

little eagle
#

No.

#

Definitely not.

#

Where did you read that?^^

tough abyss
#

watched* I mean

#

he says people use while loop when they get lazy lol

little eagle
#

Stop watching youtube videos.

#

lol

#

99% of while loops are not needed, and replacing them with BIS_fnc_loop (discount PFH) is just as bad. The rest 1% are never what you're having in mind either.

tough abyss
#

Gotcha, thanks

#

Do you think just reading and analysing script is good for practise

#

even if you have no idea what is happening*

little eagle
#

Personally I learned the most by trying. The debug console is a nice tool for that, because you can paste and live edit code while the mission is running. With CBA mod you have the extended debug console where you have a bigger box and previous and back buttons, and the View fields are not as wonky.

tough abyss
#

Did you try anything specific?

little eagle
#

About everything, because I still do, always something new to learn, and been doing it for 5 years <.<

tough abyss
#

How often were you looking at the wiki?

lone glade
#

you can never be too sure of a command syntax, use the wiki

tough abyss
#
private _courtRoom = [3626.4,13377.6,3.00143814];

if !(alive player) exitWith {["How is this possible?"] call life_fnc_notification_system};
if (playerSide != civilian) exitWith {["You are not a judge."] call life_fnc_notification_system};
if ((primaryWeapon player != "") || (handgunWeapon player != "")) exitWith {["You cannot go on duty whilst you have a weapon. This is against the law.",false,"fast"] call life_fnc_notification_system;};


["Your shift will begin in one minute. You will be spawned in the judge's lobby to commence your awaiting trial."] call life_fnc_notification_system;

sleep 60;

player setPos _courtRoom;

["Your shift has started, please make your way to the court room to attend your given trial."] call life_fnc_notification_system;
#

For some reason this teleports the player immediately, rather than waiting 60 seconds.

still forum
#

Is that maybe unscheduled? you cannot sleep in unscheduled. How is that script executed?

tough abyss
#
class judgeOnDuty
  {
    displayName = "JUDGE";
    onCall = "[] call court_fnc_judgeOnDuty;";
    image = "judge.paa";
    conditions = "license_civ_judge";
  };```
#

dialog button

still forum
#

yeah. That's unscheduled

#

easiest fix is to replace onCall = "[] call court_fnc_judgeOnDuty;"; by onCall = "[] spawn court_fnc_judgeOnDuty;";

covert crow
#

hey guys

tough abyss
#

ahh, ok cheers mate

covert crow
#

whats the required version atm?

#

or most recent ver of arma?

#

nvm

winter rose
#

1.82

covert crow
#

just googled - yeah ty

#

"Tag\AddonName\music\filename2.ogg" - Do I have to specifiy this like for example to specifically the folder name?

tough abyss
#
while {_time > 0} do {
hint format ["Your shift will begin in %1 seconds.", _time] call life_fnc_notification_system;
sleep 1;
_time = _time -1;
};
#

Can someone check this for me xd

covert crow
#

heh enjoying life?

still forum
#

What is there to check on that?

#

looks fine

covert crow
#

tracks[] = {MyMusic1,MyMusic2}; - Mymusic, is that the filename* that will show up on the GUI?

winter rose
#

see Description.ext wiki page for cfgMusic

astral tendon
#

Do you guys have a idea how I can get units array from the player FOV?

covert crow
#

wait if something is arbitrary, does it mean no touching?

#

okay this is very rough

#

but I have completed the config? what now?

lone glade
#

@astral tendon you couuuuld draw a triangle that extends to the limits of the map and get whatever is in there and then check for visibility

#

but that's very wonky

hollow thistle
#

Whats bad about BIS_fnc_loop ?

still forum
#

not necessarly bad... Just if you are using it you are either searching for a CBA PFH alternative because you don't have CBA. Or you have some logic error in your script

little eagle
#

Most likely the latter.

unborn ether
#

@astral tendon

allPlayers select {([objNull, "VIEW"] checkVisibility [eyePos player, eyePos _x]) > 0};

But I cant really remember at which FOV it will struck, so you might see units in a back of your head. Check it out

#

Anyways that still will require some additional checks afterwards.

thorn saffron
#

whats the classname of a GBU you can use setDamage on? I've been told its a separate thing from a normal GBU

little eagle
#

What made you think there is one?

unborn ether
#

@thorn saffron Projectiles are vehicles too, so any of them can recieve setDamage.

hollow lantern
#

anyone can tell me why my addAction variable isn't global? ```sqf
params[ "_cond", "", "", "_cond"];

ACIWSOFF = 1;
publicVariable "ACIWSOFF";

ACIWSON = 1;
publicVariable "ACIWSON";

if (_cond isEqualTo "CIWSON") then { // Enable CIWS

    Mk29LB setCombatMode "RED"; 
    Mk29RF setCombatMode "RED"; 

    PhalanxRF setCombatMode "RED"; 
    PhalanxLM setCombatMode "RED"; 
    PhalanxCB setCombatMode "RED"; 

    Mk31LF setCombatMode "RED"; 
    Mk31RB setCombatMode "RED"; 

     ACIWSOFF = CIWS_Laptop addAction ["Turn CIWS OFF","itsAebian\CIWS\ciws.sqf","CIWSOFF"];
     CIWS_Laptop removeAction ACIWSON;

[
["CIWS ON","font = 'PuristaSemiBold'"]
] execVM "\a3\missions_f_bootcamp\Campaign\Functions\GUI\fn_SITREP.sqf";

}

else

{

if (_cond isEqualTo "CIWSOFF") then { // Disable CIWS    

Mk29LB setCombatMode "BLUE"; 
Mk29RF setCombatMode "BLUE"; 

PhalanxRF setCombatMode "BLUE"; 
PhalanxLM setCombatMode "BLUE"; 
PhalanxCB setCombatMode "BLUE"; 

Mk31LF setCombatMode "BLUE"; 
Mk31RB setCombatMode "BLUE"; 

ACIWSON = CIWS_Laptop addAction ["Turn CIWS ON","itsAebian\CIWS\ciws.sqf","CIWSON"];
CIWS_Laptop removeAction ACIWSOFF;

[
["CIWS OFF","font = 'PuristaSemiBold'"]
] execVM "\a3\missions_f_bootcamp\Campaign\Functions\GUI\fn_SITREP.sqf";

}

} ```

#

I'm certainly not sure how I can script this better =/

hollow thistle
#

If by global you mean not available to every player it is because you execute it locally.

#

You should look into remoteExecCall

hollow lantern
#

well the thing is that the actions are not getting removed and added

hollow thistle
#

IMO it would be a lot cleaner if you would set variable ciwsOn on laptop object and add 2 actions on it. Then use condition param to display on/off action.

hollow lantern
#

would it? currently I just execute ["CIWSOFF"] execVM "itsAebian\CIWS\ciws.sqf" at the initServer.sqf But I will try that

hollow thistle
#

If you initialize add action on server it will be not visible to clients. You need to remoteExec it as i said earlier.

#

addAction must be executed on client machine.

hollow lantern
#

its a local mission

#

so it works

#

the thing is that the action will not get removed

#

I don't have problems with locality or so

hollow thistle
#

k.

hollow lantern
#

so just because its in a sqf named initServer.sqf it's not the locality issue

#

but I'm not sure how the condition thingy works

#

at the addAction part

hollow thistle
#

Still adding and removing action is unnecessary hassle if u can use condition param imo.

hollow lantern
#

so the question here is: What do I need to add into my SQF to trigger yes or no

hollow thistle
#

its a string of code that must return true if action should be visible.

hollow lantern
#

yeah but still don't get it. My action just executes the SQF and passes an argument along, which then does the switch if on or off

#

and I'm not sure I my SQF needs to return anything so that the addAction will be invisible

#

because my goal is that if the CIWS is ON then only the OFF-Action is showing

#

and vice-versa

#

ah

hollow thistle
#

You could do CIWS_Laptop setVariable ["ciwsEnabled, false], then add 2 actions to CIWS_laptop make one for enabling and one for disabling.

#

And as condition for enable action do '_target getVariable ["ciwsEnabled", false]'.

#

And for disable action '!_target getVariable ["ciwsEnabled", false]'.

#

I'm not sure how to put "" inside a string in SQF 😄

winter rose
#

↑ ↑ ↑ ↑ ↑

hollow thistle
#

is 'string' a valid string?

little eagle
#

Yes.

hollow thistle
#

So what i suggested should work then.

winter rose
#

yup

errant jasper
#

Yes. You put double-quotes in strings like this:

"My ""quotes"" are here"
hollow thistle
#

But if are using apostrophe there is no need to escape I guess.

#

Also escaping quote with quote 🤦

winter rose
#
"this is a 'valid' string"
``````sqf
'this is a "valid" string'
``````sqf
"this is a ""valid"" string"
#

wonder if '' escapes as well, never used it

hollow thistle
#
'is ''this'' a valid string'

these are all single quotes btw ^^

winter rose
#

can't confirm, I am a firm believer of the superiority of double-quote master race :-p

#

"string"
'c' 'h' 'a' 'r' ¯_(ツ)_/¯

errant jasper
#

I mostly use single quotes, but that's leftover from other languages where double quotes might be slower, since it has special interpolation rules.

winter rose
#

PHP

gleaming oyster
#
player addEventHandler["FiredMan", 
 { 
  _this spawn 
  { 
   params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle"]; 
   waitUntil{speed _projectile > 10}; 
   _velocity = velocity _projectile; 
   _direction = getDir _projectile; 
   _b = "Rabbit_F" createVehicle (getPosATL _projectile);
   _b setPos (getPos _projectile);
    deleteVehicle _projectile;
   _b setDir _direction; 
   _b setVelocity[(_velocity select 0) + (sin _direction * speed _projectile),(_velocity select 1) + (cos _direction * speed _projectile),(_velocity select 2)]; 
  }; 
 }];

Sloppy code, but for anyone who wants to laugh a bit.

errant jasper
#

Lol - brief laugh-emoticon there xD

winter rose
#

@errant jasper Son, I am disappoint 👀 😄

hollow thistle
#
`js interpolated ${var} strings ftw`
``` 😄
winter rose
#

C# does it now, too

errant jasper
#

I try to forget PHP..... One day I might sleep again, but still now my past keeps me awake

winter rose
#

echo htmlentities($_GET['page']);

hollow thistle
#

@gleaming oyster wait what. Is this replacing bullets with rabbits?! 🐰

winter rose
#

ooouh yeah 👍

hollow thistle
#

🐇 ⬅ 🔫

#

I've seen too much. 👀
Time to go to sleep.

errant jasper
#

That last setVelocity seems strange? You take the existing velocity (in m/s), and then add the velocity in km/h except for Z-component.

winter rose
#

i would setVelocity velocity bullet?

errant jasper
#

Exactly, but I might be misunderstanding the intention.

#

So a velocity of [1,2,3] --> [1 + 3.6, 2 + 7.2, 3]

#

Or in other words, the X and Y components gets multiplied by 4.6. I am guessing it is an accidental way to adjust for the probably larger air resistance of rabbits.

#

Hashtag Arma-RabbitStudies

unborn ether
winter rose
#

I did _b setVelocity (_velocity vectorMultiply 0.5);

#

back in my days, I shot M1A1 from M4 in Arma 2, and I also made frag artillery by splitting a bullet into 10 grenades… bored in the editor®

#

FYI, rabbits ricochet

meager heart
#

500+ new messages 👀

little eagle
#
commy_fnc_changeProjectileDirection = {
    params ["_projectile", "_azimuthAdjust", "_altitudeAdjust", ["_speedAdjust", 0]];

    // get old direction vector
    private _vdir = vectorNormalized velocity _projectile;

    // get azimuth and altitude angles and apply adjustments
    private _azimuth = ((_vdir select 0) atan2 (_vdir select 1)) + _azimuthAdjust;
    private _altitude = asin (_vdir select 2) + _altitudeAdjust;

    // get new direction vector (this is a unit vector)
    _vdir = [
      sin _azimuth * cos _altitude,
      cos _azimuth * cos _altitude,
      sin _altitude
    ];

    // get best up vector
    private _vlat = vectorNormalized (_vdir vectorCrossProduct [0,0,1]);
    private _vup = _vlat vectorCrossProduct _vdir;

    // get new speed vector. Keep total speed, but change to new direction. Yay for vector commands.
    private _velocity = _vdir vectorMultiply (vectorMagnitude velocity _projectile + _speedAdjust);

    // set projectile direction dir and up. Projectiles are long objects, especially with tracers, so it would look dumb otherwise.
    _projectile setVectorDirAndUp [_vdir, _vup];

    // set new speed vector
    _projectile setVelocity _velocity;
};
#

My version, @gleaming oyster

gleaming oyster
#

Heheheh. Nice commy.

little eagle
#
commy_aiDispersion = 0.2;

commy_fnc_aiDispersion = {
    params ["_unit", "", "_muzzle", "", "", "", "_projectile", "_gunner"];

    // only for ai, commented for debugging
    //if (isPlayer _gunner) exitWith {};

    // dispersion projected on circle one meter away
    private _radius = tan commy_aiDispersion;

    // seeds to make this the same on all clients, todo find more randomized algorithm
    private _seed1 =  _unit ammo _muzzle;
    private _seed2 = 100 - _seed1;

    // find random position in that circle...
    [0,0] getPos [_radius * sqrt (_seed1 random 1), _seed2 random 360] params ["_posX", "_posY"];

    //... and then calculate their azimuth and altitude angles
    private _azimuthAdjust = atan _posX;
    private _altitudeAdjust = atan _posY;

    [_projectile, _azimuthAdjust, _altitudeAdjust] call commy_fnc_changeProjectileDirection;
};

<OBJECT> addEventHandler ["Fired", {call commy_fnc_aiDispersion}];

Combined with this ^ to make the AI fire like drunk.

meager heart
#

private _seed1 = _unit ammo _muzzle; < is that to make seed the same for all pc's ? 🤔

little eagle
#

Yes.

#

So the bullet flies to the same direction everywhere.

meager heart
#

you are sqf hacker dude 😀

icy light
#

Hello all. Im needing a point in the right direction. I have items in a listbox populated from mysql. How would I go about allowing users to buy the item? Something like Client request to buy item id 123, Server says ok then deducts the money they have, gives them the item and updates the database. Ive found a few things but they are vague. Any help please?

#

Well when I say populated from mysql, its an array stored in a missionNamespace variable as an array

leaden summit
#

So I know I can add _this setvariable ["ace_medical_isMedicalFacility", true]; to the Edit Terrain Object module to make a building an ACE medical facility. I'm just not sure if I have to use the Global Object Init which exec's the code everywhere or if just the server will do. Can anyone clarify for me please

unborn ether
#

@icy light You need to create module, that will take responsibility for chains to write/read the data, like with DB or missionNamespace. It will tell which item to put/take, how much money you should give/take and etc.

icy light
#

ty

tough abyss
#
[] spawn { 
 
  if (playerSide == civilian) then { 
      if ((primaryWeapon player != "") || (handgunWeapon player != "")) exitWith {hint "You are not allowed weapons!"}; 
  } else { 
      hint "Go ahead son."; 
  };  
};```
#

This doesn't hint sqf hint "Go ahead son."; if the player has no weapons

robust hollow
#

is the player a civ? if they have no weapons itl hint nothing because there is nothing there to be hinted.

icy light
#

When using remoteExec, what is the root location? Like how do I set the path to the file on the server?

robust hollow
#

to a file in a mod? "mod prefix\rest of the path"

icy light
#

oh right so its the actual root of the server install then?

robust hollow
#

i dont think i know what you mean. is the file in a pbo?

icy light
#

no

robust hollow
#

so u enabled filepatching and its external like that?

icy light
#

ok if i have a file located at c:\arma\server\ @mymod \file.sqf how do I call that with remoteexec?

#

my main problem is I cant get cfgFunctions to work no matter what I do so I have to full path everything

#

Ive been trying for over 2 hours to call 1 script with cfgFunctions, cant fix it so i just call everything by full path

#

since it apparently doesnt work

robust hollow
#

cfgfunctions would need it in a pbo i would have thought. i dont know for sure tho so 🤷

icy light
#

well that is

#

are you able to voice? i'll legit pay you if you can help me get cfgfunctions to work

robust hollow
#

oh, yea it does seem to work.

#

"\@mymod\myscript.sqf"
thats what i had.

icy light
#

right if you cant voice give me a minute to type out

#

myfolder is located in the mission folder (that i pack into pbo)

#

I have a file called fn_runme.sqf located in myfolder\Functions\fn_runme.sqf

#

there is my cfgFunctions.cpp that is included via description.ext

#

I try to call it with ["blahblah", (lbData[1500, lbCurSel 1500])] call CyFs_fnc_runme

#

doesnt work

#

ive tried calling it as CyFs_runme CyFs_fn_runme nothing

#

please help me 😦

#

what am i doing wrong?

#

no errors in client or server rpt either is the worst part

robust hollow
icy light
#

ok

#

whats the proper way to call it?

robust hollow
#

CyFs_fnc_runme

icy light
#

IT WORKS!!!!!!!!!

#

so what was I doing wrong?

#

you added class Functions... is that the folder name or just any name?

#

FINALLY!!! TYTYTYTYTTYTYTYTY

robust hollow
icy light
#

oh nice!!!!!

meager heart
hollow thistle
#

👀

winter rose
#

tough abyss
#

For some reason auto spacing isn't working anymore for me in atom?

#
if (blah blah blah > 29347982) then {
do this;
do this;
};

if (blah blah blah > 29347982) then {
    do this;
    do this;
};

#

what happens vs what I want

late gull
winter rose
#

ha ha: which one?

late gull
#

any of these

#

seems like a JIP problem

winter rose
#

Error Undefined variable in expression: bis_rscrespawncontrolsmap_display no, it doesn't

late gull
#

and random, sometimes work, sometimes error

winter rose
#

Error Undefined variable in expression: _list
Error Undefined variable in expression: bis_rscrespawncontrolsmap_ctrldetailscontrolsgroup
Error Undefined variable in expression: _display

all these are script errors
a workaround would be waitUntil !isNil "BIS_rscrespawncontrolsmap_display" and so on

late gull
#

but why that happen randomly? :S

winter rose
#

maybe a race condition.
also,
'/CfgRespawnInventory/B_Soldier_A_F.vehicle': Missing ';' prior '}' ↑ correction needed here

late gull
#

ups, didn't saw that :p

#

i have to run the server and give it like 5 minutes

#

if i join just on start the error wont happen

winter rose
#

if it errors in SP, it will eror in MP
clean your code first.

late gull
#

not using SP

#

only dedicated server

winter rose
#

you code specifically for a dedi?

late gull
#

yes, kinda

#

most of the code wont work on sp

winter rose
#

…don't.
why would you want a mission you can't run in SP or in hosted MP?

#

and how is it easier

late gull
#

ah yes, it works also in hosted mp

#

but not sp

meager heart
#

seems like everything from respawn menu with some errors, maybe respawn templates are messed up in description.ext or they added wrong/not added at all ?

late gull
#

maybe those semicolons

#

but i don't think so, happened sometimes without those semicolon errors

meager heart
#

how many player sides in that mission ?

late gull
#

1

#

WEST and AI EAST

#

as always xD

#

no error now

#

can you guys clarify me about JIP?

#

when it's considered to be JIP

#

i know it's join in progress

#

but how much time asfter mission start it's JIP?

winter rose
#

if you are not in the briefing on mission start, I believe it is considered as JIP

#

check with didJIP

late gull
#

umm ok

#

so if i have no briefing, it's always it's jip

winter rose
#

persistent mission?

late gull
#

yes

#

well i guess yes xD

#

it's a kind of domination/invade and annex

winter rose
#

I believe a persistent mission start only on first player connection? I may be wrong though.

but anyway, any client connecting after mission start is technically a JIP

late gull
#

nope, starts by it self

#

never wait for player

#

ok, ty

meager heart
#

btw maybe you have there respawnOnStart enabled, but there is no players at start > nope, starts by it self > never wait for player

late gull
#

i have respawnOnStart to 1

meager heart
#

there your trouble

late gull
#

but this has nothing to be with mission start or not

meager heart
#

you said there are no players at start

late gull
#

to 0*

#

0 - Dont respawn on start. Run respawn script on start.

#

it's required for respawn menu

meager heart
#

it's required for respawn menu
no it's not

late gull
#

yes, otherwise you respawn with the selected unit/slot loadout

#

and you respawn in the place the unit is

#

so no sense adding respawn possitions + inventory

#

well, that's my opinion

meager heart
#

that mean that you don't have loadout for mission start/b4 first respawn, but not that any from respawn templates required respawnOnStart enabled 😀

#

you can add inventory b4 repawn

late gull
#

yes, true, not required

#

but btw, i just double check, and i have it to 1 xD

#

but this is stil not a problem

meager heart
#

set it 0, just to test for those errors from respawn screen 😀

late gull
#

let's see

#

idk why i change it to 1, i know the best it's 0 in there (in this case)

#

but it's working with 1 also

#

wew, yes

#

i get error with 0

#

and no respawn menu

meager heart
#

was no respawn, so no respawn menu...

late gull
#

yep, but error there

#

or warning maybe

meager heart
#

is it the same spam with everything from the respawn screen ?

#

inventory also ?

late gull
winter rose
#
11:07:02   Error Undefined variable in expression: _detailslist
11:07:02 File A3\functions_f\respawn\fn_showRespawnMenuInventoryDetails.sqf [BIS_fnc_showRespawnMenuInventoryDetails], line 241```
woops, BI
#

waitUntil { player == player }; maybe, really dunno

meager heart
#

or time > 0

late gull
#

so they are not my errors huh?

digital jacinth
#

Out of curiosity, is there a try catch in sqf? I normally never need it, but now I have the problem that a function in a mod might just kill itself and I would like to catch that.

winter rose
#

there is, but it doesn't catch code exception as you might think

digital jacinth
#

of course. The problem is the function expects a location or object but it gets an array instead.

late gull
winter rose
#

if (result isEqualType []) then { ["received a pos instead of a location"] call BIS_fnc_error };

#

@digital jacinth

digital jacinth
#

ah, so you cannot differentiate between the different "expections" (i am too used to java here) but just a general "oops that did not work". that is luckly fine by me

winter rose
#

no, only exceptions that you create

digital jacinth
#

oh

#

i doubt acre has a throw in their functions

winter rose
#
try {
   if (_this == 0) then { throw "hey, you tried to divide by zero!"; };
   1/_this;
}
catch
{
   hint _exception;
}
digital jacinth
#

Well, guess that won't do then sadly

winter rose
#

nope, I don't remember seeing someone using it tbh 😄

meager heart
#

The problem is the function expects a location or object but it gets an array instead.
params ? 😀

digital jacinth
#

I have not debugged into ACRE for now as the error happend yesterday evening during a play session. Some people reported a script error within an acre function, I yet have to get their log files to check what is going on exactly. One thing I wanted to do was to circumvent the issue by creating my own signal calculation which instead just returns the best quality possible values instead of nothing.

still forum
#

🤔 If my debugger would dump a full call-trace with local variables in case of any script error... That would be nice right? 🤔

digital jacinth
#

in this case, yeah since I suspect either a faulty params or some funky append to an object

still forum
#

Are you using Battleye?

digital jacinth
#

nope

still forum
#

:3 Maybe I can get it done today.. I'll try

meager heart
#

btw any eta on new brofiler version, Dedmen ? 😀

still forum
#

Currently everything I want implemented is implemented and released. Do you need some feature?

lone glade
#

current one without the instruction showing up work fine

#

didn't test the "fixed" one with em'.

meager heart
#

had couple crashes also, for the features idk... something for "extended debuging" maybe

still forum
#

It's still a profiler and not a debugger. The debugger is currently being worked on by others

lone glade
#

and it's very good at what it does

still forum
#

That callstack idea is neat

Unknown error in expression
Error at L15 (z\ace\addons\common\XEH_preInit.hpp)
Callstack:
    [] L7 (z\ace\addons\common\XEH_preInit.sqf)
    [CBA_fnc_preInit] L109 (x\cba\addons\xeh\fnc_preInit.sqf)
        _x: ["", "preInit", {call compile preprocessFileLineNumbers "z\ace\addons\common\XEH_preInit.hpp";}, true, []]
#

that's how it will look when it's done

#

full callstack on errors. With local variables into RPT

still forum
#

Okey. I think it's done. But I'm at work and can't test. Who wants to help me with that? :3

digital jacinth
#

i am at work as well, plus i got no one from my group to reproduce the bug I am hunting

astral dawn
#

Dumping all the private variables is an awesome idea!
The only tiny problem is with nils since in arma when something is nil it doesn't exist.

still forum
#

No not a problem. I differentiate between nil and "doesn't exist"

#

so this will still print nil variables. Like when you do private ["_myVar"]. It does exist, but it is nil.

still forum
#

Okey I found someone to turn on my home PC so I can test myself now via Teamviewer 😄

astral dawn
#

Oh allright, i thought that nil and doesn't exist are the same

thorn saffron
#

@unborn ether For some reason setDamage seems to not work on projectiles when I tried to destroy them that way, I could only do so by smashing them into an obstacle.

digital jacinth
#

in the sense on how you use it in script it is the same as you just ask isNil '_myVar'. Just there is still some memory allocation somewhere for this variable.

#

at least that is how i think the interpreter does it

still forum
#

People think of "nil" == "doesn't exist" because if a variable doesn't exist the script engine returns nil. Because it HAS TO return something.
And if you set a global variable to nil it's usually also deleted to save memory. But you usually don't notice that in scripts. Only way to detect that is by using allVariables on a namespace to see if a variable exists

digital jacinth
#

so a private variable exists until you leave the scope, be it filled with a value or not

still forum
#

yeah. private variables don't delete themselves when you set them to nil.

little oxide
#

so if I set a global variable to nil, it's will be deleted to JIP queue ?

digital jacinth
#

variables are always local unless you publicVariable it

still forum
#

If you publicVariable a globalVariable that's nil. Then yes. It will be removed from the queue

#

Atleast that's what I expect...

#

Ohh man... printing local variables is a bad idea if something inside CfgFunctions init triggers. Because it has an array with all CfgFunctions in it.. And turning that into a string to dump it out....... Well...

digital jacinth
#

Probably should add exception for this case.

still forum
#

But how.. I can check for array length. But what if the array contains a few sub-arrays. But these arrays are huge.
I could just not print the code but instead print a {code} placeholder. But people might want code variables in their callstack..
I'll just add a length check and don't print arrays with more than 50 elements. 🤞

astral dawn
#

Can you make your program check for existance of a special private variable which will indicate that the user wants all the private variables printed anyway?

still forum
#

uhh... theoretically yeah.. But at that point you might aswell just use the full blown debugger

astral dawn
#

I can imagine something failing once a week, for that case that would be a nice option

#

Oh wait, probably your solution requires some debugging build anyway

still forum
#

nope

#

well it requires the mod to be loaded

#

Automatic crash reporting would be nice. Create a dump of the callstack. And you can register your PREFIX_fnc_func prefix and the crashdumps will be uploaded and sent to you 🤔

#

Though... That's not the full callstack. There are parts missing :U

thick ridge
#

Would be great if there was a way to disable a global object from syncing its position/direction/velocity to other clients.

lone glade
#

eeerm

#

it's already possible^

thick ridge
#

How?

winter rose
#

enableSimulation?

lone glade
#

^ disableSimulation and that

winter rose
#

unit enableSimulation false, disableSimulation doesn't exist ^^

#

…unless it's a config entry?

lone glade
#

nah

#

it's mostly me trying to type on discord while playing an other game 😛

winter rose
#

can relate ^^

thick ridge
#

ah, let me clarify - disable pos/dir/vel syncing to other clients, but leave all other simulation enabled.

#

e.g. getting in a vehicle with simulation disabled does not usually end well for the player.

#

also, not sure if the comment on the enableSimulation wiki page is correct, but someone said: "After using enableSimulation false or enableSimulationGlobal false on an object, setPos will still update its position across the network in MP."

thorn saffron
#

Does anyone know the classname for the GBU you can use setDamage on? I'm working on a hard-kill Active Protection System for vehicles and right now I'm forced to smash the projectile int an invisible blocker object to detonate it. I do not want to just spawn a tiny explosion effect, I want to detonate the projectiles right and proper away from vehicle.
setDamage does not seem to work on rockets and such.

winter rose
#

@thick ridge yes, setPos will update position once

thick ridge
#

(asking because of Advanced Train Simulator mod - would be great not to have to use local objects for all of the train cars)

verbal otter
#

i'm starting function with spawn, try'ed call but every time i get cicle, function run every frame. But i'm want to single start function and get result. Cicle not defined on script

modern snow
#

Hi,
I have this error, and hope that you can help me.: Error Generic error in expression
My code:

hint _job; ```

You can see my ``` _str ``` here: https://imgur.com/a/1lk9nUq
still forum
#

@modern snow post the full error from RPT

#

@verbal otter post the script

modern snow
#

Error:

16:26:24   Error position: <select 0;hint _job;closeDialog 0;>
16:26:24   Error Generic error in expression```
thorn saffron
#

Interesting, it seems that that triggerWhenDestroyed = 1; is the thing that allows you to detonate stuff via scripts. I need to check what happens if I add this to the core missile, rocket and shell, just so everything else just inherits this.

still forum
#

so what is the content of _str? It sounds like it should be a string. And string select 0 is invalid afaik

modern snow
#

@still forum I can't select something if it's a string?

still forum
#

Man.. you should really use isEqualType and params @verbal otter That would make that script half as long

#

and Tags for global variables

#

the Find = true; at the end is invalid @verbal otter

#

you cannot do that.

verbal otter
#

i use to waitUntil {Find};

still forum
#

You cannot set a variable that has the same name as a command

verbal otter
#

hmm,i will change script structure 😃

#

@still forum ty

still forum
#

call compile format is also a big no-no. If you use that then you did something wrong.

verbal otter
#

i get array from database

still forum
#

Ah. So it's an array?

verbal otter
#

thank you! i don't see that command

#

but still getting cicle on my function

#

disabled waitUntil

still forum
#

are you sure it's inside your function?

#

not that you are calling the function itself? multiple times

verbal otter
#

no, i start function and cicle starts

still forum
#

Well there is no loop (That's what "circle" is called) inside your script. Also you were talking about a waitUntil. I don't see that anywhere?
Either you didn't send the full script. Or your issue is not inside the script. Because there is nothing in there.
Not even the stuff from your logs that you posted before are in there

verbal otter
#

i start it from debug console

#

waitUntil function was it another script where i called this

#

but nothing changed

winter rose
#

cicle (cycle) or circle?

still forum
#

Wait..

verbal otter
#

there is server part:

still forum
#

You said the circle starts when you do

[2,[]] call recept_framework;
// OR
[2,[]] spawn recept_framework;

But before you told me you use

// run: 
[2,[]] spawn rt_frame;

What now?

#

recept_framework or rt_frame, waitUntil that doesn't exist. Debug logs that don't exist.

#

You're not making any sense

verbal otter
#

changed fnc name

#

oh

#

get info and send back to client

still forum
#

what is that? Is that TON_fnc_rt ?

verbal otter
#

i this sctipt

still forum
#

If so then yeah. It calls your recept_framework which then calls TON_fnc_rt again which then calls recept_framework again and so on.

verbal otter
#

on server side TON_fnc_rt

#

recept_framework on client

#

^^ recept_framework

still forum
#

What? But before you posted that rt_frame function. Which you then renamed to recept_framework and now suddenly recept_framework is a completly different function again?

#

And why is recept_framework calling itself on private _curLevel = [4,_craftXp,_craftLevel] call recept_framework; ?

#

There you have your loop. It's calling itself

verbal otter
#

hmm

#

will try disable

thorn saffron
#

Ok, so adding triggerWhenDestroyed = 1; to the missiles and stuff and using setDamage 1 causes something really weird. The projectile model is destroyed, but the projectile itself is still going, just invisible and it explodes on hit as normal.

lone glade
#

delete it ^

thorn saffron
#

@lone glade I'm working on a hard-kill Active Protection System for vehicles and right now I'm forced to smash the projectile int an invisible blocker object to detonate it. I do not want to just spawn a tiny explosion effect, I want to detonate the projectiles right and proper, just away from a vehicle.

verbal otter
#

@still forum thank you a lot!!! for now function work without loops 😃

lone glade
#

well, yes taro

#

but kill it THEN delete it

thorn saffron
#

@lone glade Tried, I do not get the explosion.

spark cobalt
#

destroy, sleep, kill?

winter rose
#

sounds like a normal day to me

thorn saffron
#

@spark cobalt Neither destruction, nor setDamage causes the projectile to explode midair like I want it to

still forum
digital jacinth
#

that all logs into the rpt file even if loggin is disabled?

still forum
#

nope. It calls diag_log

#

so if diag_log wouldn't log. That also wouldn't

digital jacinth
#

aight

minor lance
#

Hello! Anyone now why aon object for player is a normal object but for server is OBJNull?

#

Thay both have the same addon

#

with the object

digital jacinth
#

you are spawning the object with createVehicleLocal