#arma3_scripting

1 messages ยท Page 340 of 1

half monolith
#

it work default action on ground, just not in air some reason

indigo snow
#

not in vehicles is what you mean

#

and vehicles function intrinsically different from infantry

#

it's not some reason, its two very different situations

#

you might as well just implement a fired event handler that deletes the projectiles and adds the ammo back

half monolith
#

yes. im just think there muct be something other than default action, use mouse in this condition. this could work, we are firing from ammocount not add a scripted missile.. we can give it a shot though ๐Ÿ˜ƒ

little eagle
#

No, you are wrong. There doesn't has to be another action.

#

There might be, but there doesn't has to be.

#

That is not how it works.

#

And I am pretty sure there isn't any.

half monolith
#

ok you are talking from speculation. i appreciate the help.

indigo snow
#

haha

#

commy doesnt talk from speculation

#

i can promise you that

little eagle
#

You are talking from speculation. I told you why that is bad.

#

Feel free to try all actions at once. I posted the list.

indigo snow
#

The only speculation would be that that list is fully complete ๐Ÿค”

little eagle
#

You could maybe ask @still forum to get a list from the source code maybe.

still forum
#

mh?

little eagle
#

But engine complete.

still forum
#

Looks quite complete to me

indigo snow
#

were wondering if firing a weapon in a vehicle might be a different action from firing a weapon as soldier

little eagle
#

The completeness was questioned.

half monolith
#

no i was questioning you

still forum
#

I'd say it's complete enough

half monolith
#

did i say anything about the website?

#

lol

#

try to create drama

#

And I am pretty sure there isn't any.

#

so you are not sure

#

speculation

polar folio
#

๐Ÿฟ did someone say drama?

little eagle
#

I'm pretty confident the list is not complete. But I am also confident that any missing action wouldn't help just as I am confident that all listed actions don't for this particular problem.

indigo snow
#

also, im not. im saying what commy says is truth, and your only option might be figuring out if theres a missing action that might help you

polar folio
#

so what is the approach? inputAction?

little eagle
#

I also am pretty confident that no one will come up with the magic answer. There isn't any. You can try all listed actions and maybe ask around for more. Nothing else anyone in this chat can do.

#

addAction

#

To block firing.

half monolith
#

its ok commy you were thanked. i said id try something else. and you accuse me of saying someone else work isnt complete.

little eagle
#

Doesn't work in helis when using manual fire.

half monolith
#

no i was asking if it was something different.

polar folio
#

oh that hack with the almost invis scroll action?

indigo snow
#

lol no one is dude

#

chill

little eagle
#

cptnnick was questioning if the list is complete afaik. Not UD1E.

polar folio
#

@UD1E#2095 what is the approach? addaction hack?

half monolith
#

The completeness was questioned. when he brought dedmen in. i didnt question completeness

#

right now yes

#

kk

#

method

little eagle
#

But cpnnick did...

half monolith
#

we have toyed with the mousedown as well

still forum
#

Working on it

little eagle
#

cptnnick - heute um 17:52 Uhr
The only speculation would be that that list is fully complete ๐Ÿค”

indigo snow
#

Yeah there should be new actions for the plane panels and stuff, no?

still forum
#

They are on the list @indigo snow

little eagle
#

Yes, there are very likely actions missing from the wiki.

polar folio
#

well all i can say is that that addaction hack has limits. weird ones. and also that the addaction mgiht have to be on the vehicle.

indigo snow
#

seen

#

expected them under plane, i guess

half monolith
#

is there a quick dirty way to push back what this key is doing?

little eagle
#

Key yes. Mouse no.

indigo snow
#

disableUserInput ๐Ÿ˜„

#

maybe activate a hidden dialog / control?

polar folio
#

what's the overall goal? like keep randos from firing door guns or something?

indigo snow
#

active dialogs take focus, but they likely block keyboard input too..

half monolith
#

no its a lock on script for pilots. problem is we get doubles when we fire on a locked target. one vanilla missile go straight, one goes to target.

indigo snow
#

why dont you modify the original missile?

half monolith
#

this the last "hurdle"

indigo snow
#

instead of spawning a new one

half monolith
#

to do which?

still forum
#

probably still not all actions though

indigo snow
#

or just delete the other one i guess

#

thanks @still forum

half monolith
#

@still forum ty

still forum
#

But I already found some that are not on the wiki

little eagle
#

What about disabling manual fire?

indigo snow
#

isnt that only for drivers to take control of turret weapons?

#

they might still have driver weapons

rancid ruin
#

๐Ÿ•ต๐Ÿฟ how do you find these things dedmen?

half monolith
#

we use manual fire so in case there is gunner everything can be normal

still forum
#

@rancid ruin Hex editor

indigo snow
#

'UseWeapon' < maybe?

still forum
#

Talking about that more specifically is forbidden

half monolith
#

just like only want to override key while we have locked target, other times not block key, so more vanilla

rancid ruin
#

i admit, i was just trying to get you banned

half monolith
#

im open to all suggestions ๐Ÿ˜ƒ

indigo snow
#

but uh the script itself UD1E, you create a second missile that you guide yourself?

#

why dont you guide the original missile?

rancid ruin
#

delete non-guided missile and go home early imo

half monolith
#

no its not "created" it comes from veh inventory.. on mouse mutton. pilot would lose every second missile..

indigo snow
#

do you spawn it in by script yes or no?

half monolith
#

no

indigo snow
#

where does it come from then?

#

who fires it?

little eagle
#
commy_disableManualFire = true;

addMissionEventHandler ["EachFrame", {
    if (commy_disableManualFire) then {
        private _unit = player;
        private _vehicle = vehicle _unit;

        if (isManualFire _vehicle) then {
            _unit action ["manualFireCancel", _vehicle];
        };
    };
}];

Untested.

half monolith
#

umm

#

pilot

#

fires

indigo snow
#

dude im trying to check if theres a better way to solve this problem instead of blocking input.

#

pilot fires but you wanna block that?

#

how come theres 2 then?

#

cant you just delete the original one and not remove a rocket from inventory when you spawn the other one in?

#

or guide the original missile?

half monolith
indigo snow
#

a video doesnt help me with questions about how your script works man

half monolith
#

this examle of doubling

rancid ruin
#

you know things are fucked up when you have to solve this with an eachFrame EH

indigo snow
#

how is the second missile actually entering the game world?

#

your script creates it, yea?

#

createVehicle or something or other?

half monolith
#

the script fires it but it is not created, it just goes by what is in the inv of current chopper. lol scripting a missile in in hindsight would have saved the week of getting each missile to work properly,

indigo snow
#

how does it leave the inventory of the vehicle and enter the game world

half monolith
#

if (_an=='CUP_M_Ataka_V_9M120_AT9_Spiral_2_AT') then
{
_LASER='LaserTargetE';
if (side player==west) then {_LASER='LaserTargetW';};// if need ???????
_lasew = _LASER createVehicle getposATL _t;
hint format["|Fire at LASER ATAKA| LockSystem: %1 Ammo: %2", _result11, _an];
_lasew attachto [_t, [0, 0, 0]];
systemchat 'Fire CUP_M_Ataka_V_9M120_AT9_Spiral_2_AT';
(vehicle player) fireAtTarget [_lasew, currentWeapon (vehicle player)];
0=[_lasew] spawn { sleep 10; deletevehicle (_this select 0); player commandchat (str (_this select 0)+ ' DEL'); };

#

sorry

indigo snow
#

createVehicle

#

aight

half monolith
#

this is example of the work around we came up with for ataka

indigo snow
#

so is the created missile always the same as the pilot has selected?

half monolith
#

yes

indigo snow
#

where is it removed from the vehicle magazine?

#

just dont do that

#

and delete the one the player fired

#

wait

#

that createvehicle doesnt do it, its the fireAtTarget bit yea?

#

delete the other fired missile and add it back to the player

little eagle
#

@rancid ruin Well, I searched for an eventhandler to fire when picking manual fire, but there was none.

half monolith
#

the create vehicle is for laser or whichever sensor

indigo snow
#

so either figure out a nice way to capture the missile the player fired, or delete it and add the ammo back

#

it works โ„ข

little eagle
#

You'll need to rethink your script, because blocking input is not possible reliably in this game. This is sad, but true.

half monolith
#

this could be an idea.

#

on this script im more of the tester, troubleshooter. the scripter doesnt have a3, he has a2, it is my job to find the differences.. we know this is no easy task.

indigo snow
#

pretty unique but ok

half monolith
#

yes

#

different.

indigo snow
#

just get him A3 /shrug

half monolith
#

toos in a lunguage barrier

indigo snow
#

youll be missing out on useful stuff like with the sensors

half monolith
#

and we a team lol

#

miss out?

indigo snow
#

A2 doesnt have it

#

and id assume the A2 guy wouldnt know how to use it

half monolith
#

yes i know since the update it put twist in this script

rancid ruin
#

can you really trust someone who's still running arma 2 in 2017? that's the real issue here

half monolith
#

he keeps up to date,

rancid ruin
#

he keeps up to date if it's 2007 yes

half monolith
#

i trust him, why wouldnt i?

#

we got sensors worked out.. some of those issues popped up immdiatly. had to change lock system because of it. he can move with the times lol.

#

script was born before jets..

#

i started on it with him after i "borrowed" and notice probs

#

we work together on the aas template, they have a server we have one

#

i offered to buy for him arma 3 he declined. no sure why lol..

rancid ruin
#

see, i told you he's not trustworthy

cosmic kettle
#

Well he could have a pc incapable of running A3, then again, my cheap laptop does so ...

half monolith
#

i think its bandwitdh im not sure, i not see how this would be much diff a2 but..

#

pc could also be a factor

#

but he also still play aas on a2, it seems there are just as many if not more a2 players

#

my goal with the template was to update to some of the bohemia functions that were not available when this was ported. playing helecoptors is just what we do when nothing to fix lol

#

is there no way to push back what they key is doing when press?. which action it revert to?

rancid ruin
#

what?

#

revert?

half monolith
#

bad idea

#

i will try suggestions, ty for the input

#

no pun intended

peak plover
#

Could I do code in structured text?

still forum
#

Not officially

peak plover
#

I'm doing a dialog similar to diary, where the contents can be edited and removed. I guess I'll just use createDisplay and make a different dialog defined for every entry

#

structured text with code/script would have been much simpler

rancid ruin
#

what about unofficially?

still forum
#

There were bugs and might still be. that allow code execution inside there. But nothing that might do what you want

peak plover
#

It's okay

rancid ruin
#

how does the debug console work? just call compile a string?

still forum
#

yeah

open tendon
#

Is there a way to force a specific object to render, independent of player view distance?

peak plover
#

like dis?

rancid ruin
#

well gosh darn, that's a new one to me

#

when was 1.68 released @peak plover ?

peak plover
#

I don't know

rancid ruin
#

so object setFeatureType 0 actually hides it or what?

peak plover
#

Disables feature

#

So... no

#

Ohh this was the update that brought dynamic simulation and good performance stuff

indigo snow
#

actually jets DLC to make it easier to lock on from very far

peak plover
#

I still need to make a script that's the same as dynamic simulation, but instead deletetes objects/units and saves their properties.

rancid ruin
#

couple of months old apparently. good to see they're still adding useful scripting commands

peak plover
#

More new and splendid features to the ever growing arma platform

subtle ore
#

splendid - jay on every new platform update lol

peak plover
#

Haha yeah ๐Ÿ˜„ And he's got that smurk on his face everytime he says it

subtle ore
#

Lol yep.

peak plover
#

I wish dynamic simulation had functions I could browse for inspiration for the grid detection system

open tendon
#

nigel, thats awsm

subtle ore
#

Are they not available? Maybe engine based hard code?

peak plover
#

I've thought of a few alternatives like attaching markers/triggers to players/units to avoid range checking. I wanna know how their grid system is like

subtle ore
#

Grid based, you mean like terrain grid based? Or sort of like multiple zone specifications?

peak plover
#

multiple zone spec

subtle ore
#

Yeah that'd be a cool concept

subtle ore
#

Ooohh...i believe that's only available in the debug exe or is it available in the regular client exe?

peak plover
subtle ore
#

There are commands and diag commands but no functions

peak plover
#

Shouldn't eat perf as much as lineIntersects

subtle ore
#

Thing is the alpha of the markers gets darker in areas with higher simulation afaik.

peak plover
#

That could be use to cache crap for EXTREME size missions

subtle ore
#

Yep

peak plover
#

I think what the dynamic simulation uses is hideObject/enableSimulation

#

I've had missions with a few hundred units with those before and performance was bad.

#

It's better to delete and save the data

subtle ore
#

What about recreating it when time comes to see the object?

peak plover
#

I don't have issues with that I got a few SSDs and I believe that if you preload the assets like the unit which will be created and all the items, no stuttering will be had. Just can't uncache more than a couple per frame

subtle ore
#

Well i wouldnt doubt perf issues even with just one.

peak plover
#

300 units with simulation disabled//30FPS
300 units deleted //60FPS

#

Pretty much the dream is combination of the both

subtle ore
#

Cool, where is the data being stored?

peak plover
#

array on hc/server

#

also allows for persistance

subtle ore
#

Sweet

peak plover
#

unit/object active <500m
unit/object checked for inPolygon <1800m //uncache if inPolygon based on player FOV
unit/object simulation disabled <2000m
unit/object deleted >3000m
also custom coef for different types. a distance could be based on view distance also coef for player speed / altitude based on object type
buildings etc would be ~1500m
small objects like beer cans ~50m

I have so many ideas for big missions so I will make something like this eventually, because It's either that or laggy mission, which is a no-go

#

There would have to be many checks and functions to ensure units would be saved correctly and could continue where they left from

subtle ore
#

It's an awesome concept so far.

peak plover
#

Gotta dream big ๐Ÿ˜„

subtle ore
#

Cans/small props should be closer like 15 or 25 in my opinion. Lol, sometimes too large of a goal. Since a big chunk of that mission would be in that caching concept of yours

peak plover
#

yeah exactly

cosmic kettle
#

I managed to create a rope between the 2 objects I wanted, making it seem the speakers are wired up.
Is there a specific reason why we have to convert an item to a vehicle just to create a rope between 2 non-driveable objects?
I feel like this would be an easy fix just adding the possibility, then again, I only have limited knowledge of what's going on UTH.
https://image.prntscr.com/image/8aNw3D-vR6a8a0RofkrnMw.png
^

firstOne = "ARM_rokit5car" createVehicle [(getPosATL player) select 0,((getPosATL player) select 1)+0.5,(getPosATL player) select 2];
secondOne = "ARM_rokit5car" createVehicle [(getPosATL player) select 0,((getPosATL player) select 1)-0.5,(getPosATL player) select 2];
secondOne setDir ((getDir firstOne)+180);
firstOne enableRopeAttach true;
secondOne enableRopeAttach true;
theRope = ropeCreate [firstOne,"TRS",secondOne,"TRS",20];
hint format ["Tried attaching rope from %1 to %2",firstOne,secondOne];
#

Oh thanks, I'll add that to my list of rules on ropes.

#

Yes, indeed, that's why I've gone through the effort of making non-drivable carX speakers.

#

Flagpoles are ThingX iirc?

#

It's a good thing to know the child object inherits.

#

Say, one was to attach a speaker to a car, and yet another one to a car... then connect both speakers, disconnect both cars and delete cars. would that work?

#

I understand the need for physX on parent, because the draggin etc.

#

but if both objects are static and will remain so, why not enable ropecreations between them?

#

I'm actually building speakers, mixing table and would like to wire them up.

#

So if the concept works, one could create all sorts of cables.

#

Chains, powerlines, ...

#

WIP, but imaging the jack on the end. I defined mempoints for both TRS and XLR and plan to make the cables as well.

#

The problem is not that, it lies in the creation of the rope.

#

One can't create a rope between 2 ThingX classes, the parent class has to be of class CarX.

#

And I'm unable to get around that. Maybe I'm missing something.

#

Everywhere I look, people use UAVs, Karts, etc...

still forum
#

@hasty violet That almost sounds better than ACE Nametags

peak plover
#

Ace has some really good nametags. FadeOnBorder is important

tough abyss
#

hey, is there someone here who would help me with some extDB3 scripting? I've got a few things written already but I am unsure how to proceed. Already asked assistance twice in the Exile discord, but so far no one has been able to help. If possible, assistance in PM to keep channels from spam ๐Ÿ˜ƒ

still forum
#

Do you mean SQF or SQL?

tardy yacht
#

@tough abyss I don't know what you mean.

#

I have a question of my own. I'm trying to sort an array of strings in alphabetical order. That works, but I have a second array that needs to be sorted out in the exact same order. How can I proceed? For example:

[["58001","911","12345","79302","98765"],["Jesus","Emergency","Original","Random","Original Part 2"]]

Should become

[["911","58001","12345","98765","79302"],["Emergency","Jesus","Original","Original Part 2","Random"]]
peak plover
#

Ohh

tardy yacht
#

Yes, yes. Got that one.

tough abyss
#

@still forum SQF mostly. SQL I have some experience with

peak plover
#
_array = [((_array select 0)sort true),((array select 1)sort true)];
tardy yacht
#

Wouldn't the indexes become completely unrelated?

still forum
#

yes they would

tardy yacht
#

Maybe I should change how I build my array.

#

Like [["NUM","NAME"],["NUM","NAME"]]

peak plover
#

Yeah

tardy yacht
#

Or ["NAME","NUM"] in my case so I can sort by alphabetical order.

peak plover
#

porbably easier

tough abyss
#

or maybe sqf _digits = ["xxx","xxxx"]; _string = ["xxx","xxxx"]; (do sorting here) _array = [_digits,_string];?

still forum
#
_newArray = [(_oldArray select 0) sort true,[]];
{
    (_newArray select 1) pushBack ((_oldArray select 1) select ((_oldArray select 0) find _x));
} forEach _newArray select 0;
#

that might do it

tardy yacht
#

@tough abyss that would still scramble the indexes.

tough abyss
#

hm yea I just saw only one part is sorted

peak plover
#

Ohh okay, you want a phonebook that is in alphabetical order

#

Makes more sense now

tardy yacht
#

@still forum honestly at that point I'll just change the way I build the array. There was no particular reason why it was built that way anyways.

still forum
#

Yeah. That's a better Idea.

tardy yacht
#

But still, thanks for your suggestions.

tough abyss
#

so, @still forum you know how extDB3 works or was it just a question earlier?

still forum
#

Was just a question. But if you are just asking about SQF I can probably help you.

indigo snow
#

[NESTED_ARRAY,{_x select 0},"ASCEND"] call BIS_fnc_sortBy @tardy yacht

still forum
#

If you are asking about extDB3 specifically you should maybe ask the Author directly in #arma3_tools. I don't see extDB3 talk in here that often so I'd guess there are not many "specialists" here.

tough abyss
#

could try, not sure Torndeco has that time for a starter in sqf/sql combinations ๐Ÿ˜›

still forum
#

Or you could just ask a more specific question here and see if anyone has the answer. If not you probably have to refrain to google or some extDB3 specific Forums or something like that

#

People tend to just ignore people who ask "Can someone help me with a something?" Because why bother asking what that something is. If you want a answer you have to ask a specific question.

tardy yacht
#

@indigo snow I'll have a look at that one if re-doing the way my array works is too much. Thanks!

indigo snow
#

Im also not quite sure what youre doing with it that needs sorting, but if youre adding them to a listbox you can always just sort the listbox after youve added all the entries or something

tardy yacht
#

Oh I can do that?

#

I might just do that then.

indigo snow
#

lbSort and lbSortByValue

tardy yacht
#

Just checked, lbSort does just what I need. Thank you for that.

indigo snow
#

cool. The function i linked earlier would work with your orginal array structure either, i just realized. The example i wrote was for nested pairs ([[name,num],[name,num],...])

tough abyss
#

well that's true @still forum but I was asking if someone had extensive knowledge and could help with a few steps in extDB3 SQF/SQL so I guess it's rather precise ๐Ÿ˜›

peak plover
#

Try forum thread for mods etc.

tough abyss
#

haven't found a forum for extDB3 to ask for personal assistance

still forum
#

@tough abyss torndeco is mostly around in #arma3_tools and extDB3 is a tool

tough abyss
#

seems a poor place to ask personal assistance without posting everything there first

#

other question, if I were to update the database with all current objects on map (buildings, vehicles, respawns, tasks) would it be wiser to wipe the database first and import all new or remove the objects in the database that aren't on the map and insert all objects on the map that aren't in the database?

still forum
#

you mean a update. Or the first push of data in the current run of the mission?

#

on an update you should generally only update. And not completly rebuild

tough abyss
#

yea basically a zeus has made an initial base somewhere and saved it to the database. Next mission this zeus deletes some buildings in the initial base and builds another somewhere else. One could wipe the data in the database first and then import the objects as if it were an initial build or one could check all objects if they are known in the database and delete/insert where necessary

(mission restart and possible server restart included)

peak plover
#

He asked is it better/smarter to
delete everything and recreate

#

Or updated old ones

still forum
#

I know what he asked.

peak plover
#

Ok, sorry my bad.

still forum
#

checking if objects are already in the database is probably quite processing heavy.

tough abyss
#

yea that's what I thought

still forum
#

How do you identify an "object" ?

#

by it's netID?

#

For updating or inserting objects you can just do a update_or_insert kinda thingy. Which checks the primary key and if it already exists updates the existing entry

tough abyss
#

hm no I was thinking of a function that finds all buildings that weren't initially on the map (the default map)

peak plover
#

Hmm, maybe check how wasteland does it, there are other mods that have done this and might have ran into the same question.

still forum
#

but for deleting objects you still need to check

tough abyss
#

put that in an array

#

and run the inserttosql script for the length of the array

#

AFAIK wasteland uses the server profile, no?

still forum
#

My preferred way would be to just use init and deleted eventhandlers on all the stuff

#

and then add them on init and remove on deleted

tough abyss
#

how would one add such eventhandler to objects build by Zeus? A persistently running script?

#

(or function)

peak plover
#

xeh

#

Are you using cba?

still forum
#

CBA XEH would be the easiest

tough abyss
#

well the modpack we use on the server contains CBA yea but I might try to let it run strict vanilla too

still forum
#

There is also a eventhandler for CuratorObjectCreated or Placed or something like that

tough abyss
#

if I use CBA on server, is it required client side too?

still forum
#

I think so.. yeah

#

You can just add that Handler in init.sqf to detect spawned buildings and then add the deleted EH to them

still forum
#

you also need to add the EH to all thingies that you load from the database at mission start

peak plover
#

You should also probobly detect all the map objects which are destroyed or damaged?

tough abyss
#

hm thanks I was looking to keep all functions in a server addon so I can deploy it on multiple servers and different maps at once without too much re-editing

still forum
#

Yeah.. Nothing stops you from doing that

tough abyss
#

@peak plover that even handler needs to be defined for every object right? How would that work for objects that are added during a Zeus op

still forum
#

@tough abyss I already answered that question

#

You can use the CuratorObjectPlaced eventhandler on the Zeus player

peak plover
#

Dedmen said


There is also a eventhandler for CuratorObjectCreated or Placed or something like that
tough abyss
#

hm let me look that thing up ๐Ÿ˜„

peak plover
#

How could you save destroyed buildings and stuff 'tho?

tough abyss
#

no hits on google

#

oh I am not concerned about the damage

still forum
#

No hits on google`?

tough abyss
#

if it gets damaged it'll be manually deleted anyway

#

no it gives me stuff about Malden

still forum
#

There is also CuratorObjectDeleted

tough abyss
#

and the question if I meant the same thing with spaces in between

still forum
#

And you add them to the Curator Logic so they might also fire serverside

tough abyss
#

okay I see different EH for markers and objects (I assume that's construction stuff and vehicles). Any way EH for respawns and tasks? Or just write a script that finds them all?

#

I can just use the EH to call the function that saves the object to the database?

still forum
#

Yes. Ofcause.. You can do anything you want in there

tough abyss
#

oohhh let's see how that works out

#

oh just saw I need to do it for 3 zeus slots. Can I write a function that runs at the init and adds the EH or will that not work server side?

still forum
#

In SQF you can do anything.. (almost)

tough abyss
#

except use player on server ๐Ÿ˜›

#

would this do it? sqf do { this addEventHandler ["CuratorObjectPlaced", { object_placed = call (fucntion) }]; this addEventHandler ["CuratorObjectDeleted", { object_deleted = call (fucntion) }]; this addEventHandler ["CuratorObjectEdited", { object_edited = call (fucntion) }]; this addEventHandler ["CuratorMarkerPlaced", { marker_placed = call (fucntion)] }; this addEventHandler ["CuratorMarkerDeleted", { marker_deleted = call (fucntion) }]; this addEventHandler ["CuratorMarkerEdited", { marker_edited = call (fucntion) }]; } for AllCurators;

#

will it also work for objects that are imported and placed by the server for the database?

indigo snow
#

is that supposed to be SQF?

still forum
#

it is SQF.

#

wait

#

LUL

peak plover
#

this is wrong

still forum
#

XD

#

@tough abyss That is not valid SQF. I don't know what the return values of your functions might be. You spelled function wrong.
Answer to your question. No. I already told you that before.

tough abyss
#

that (function) is just a placeholder @still forum

indigo snow
#

the entire structure of it is wrong im afraid

tough abyss
#
[what should this be then?] addEventHandler ["CuratorObjectPlaced", { object_placed = call Requiem_fnc_object_identification_created; }];```
#

how so @indigo snow

#

all functions return true

#

can change to nil too

indigo snow
#

how much experience do you have with SQF? I recommend looking up forEach on the wiki first.

still forum
#

@tough abyss If you already know what all the functions return. Why do you store the returned value?

#

And [what should this be then?] is wrong. That shouldn't be an array.

tough abyss
#

...

still forum
#

this is probably correct.

tough abyss
#

oh so that was correct

indigo snow
#

this only exists in init boxes

still forum
#

if you add it in the Editor in an Initbox then that is correct

tough abyss
#

hmmm

still forum
#

Which I suppose is exactly what you are doing for your Zeus modules

indigo snow
#

i can also guarantee you want _x there, though

tough abyss
#

no it's in a function actually that I want to run post-init

indigo snow
#

if you look up forEach

tough abyss
#

ah that may be the thing then

peak plover
#

{
_x addEventHandler ["CuratorObjectPlaced", { object_placed = call (fucntion) }];
_x addEventHandler ["CuratorObjectDeleted", { object_deleted = call (fucntion) }];
_x addEventHandler ["CuratorObjectEdited", { object_edited = call (fucntion) }];
_x addEventHandler ["CuratorMarkerPlaced", { marker_placed = call (fucntion)] };
_x addEventHandler ["CuratorMarkerDeleted", { marker_deleted = call (fucntion) }];
_x addEventHandler ["CuratorMarkerEdited", { marker_edited = call (fucntion) }];
} forEach AllCurators;

#

object_placed is wrong

still forum
#

Oh. forgot the forEach.. yeah the this was definetnly wrong then

tough abyss
#

ah I thought I could leave the Each out because it already had allCurators

indigo snow
#

object addEventHandler ["type",FNC_NAME] if you dont use the return anyway

#

no what

#

that wasnt a valid sqf structure at all

#

you cant just go make things up

tough abyss
#

following sqf mySoldier addEventHandler ["Killed",{hint format ["%1 was killed by %2",name (_this select 0),name (_this select 1)];}]

#

where the code that runs on firing lies between the { }

indigo snow
#

im familiar with it

tough abyss
#

then why is it wrong in this way?

still forum
#

your addEventHandler wasn't wrong. Besides the this

tough abyss
#

like to store the value to check if the function worked

#

like gradually checking if every script does its job correctly

still forum
#

@indigo snow object addEventHandler ["type",FNC_NAME] is a bad Idea performance wise. object addEventHandler ["type",{call FNC_NAME}] is much better

indigo snow
#

oh right since it stores the entire code type variable

#

good point

still forum
#

No.

indigo snow
#

ah?

still forum
#

Because it converts the code to a string and only stores the string and recompiles it before every execution

#

If it would use the code type variable the first variant would be better

indigo snow
#

it event converts to string internally? good to know, wouldntve thought that

#

sqs legacy i guess

still forum
tough abyss
#

@still forum for the issue of objects imported from the database, would a script that adds all those objects as editable to the Curator, allow the CuratorObjectEdited / Deleted to be fired?

still forum
#

the Curator eventhandlers are fired whenever a Curator does something

tough abyss
#

alright cool so that should be solved in that case

still forum
#

If the curator can't access the object then ofcause he can't delete or edit it

tough abyss
#

Answer to your question. No. I already told you that before. thought you meant with that the objects cannot be used anymore at all for database operations

still forum
#

Dedmen - Today at 12:23 PM
you also need to add the EH to all thingies that you load from the database at mission start

tough abyss
#

that's odd don't seem to find that message

#

ah there we go

#

search function to the rescue

#

can you explain me why the EHs must be added to the objects and not just the Curator? (This handler is supposed to be added to curator module, not player. - EH page you referred to)

still forum
#

Because that's how it is.

#

The curator Module IS the curator

#

The player just takes possession of it

peak plover
#

The documentation on curator modules and eh is plentiful. Grab a hot beverage and read it throughly. Take your time.

tough abyss
#

okay so the EH are only supposed to be added to the curator object (the curator module I assume). That isn't saved in the database, so that only needs the post-init function to add the EHs doesn't it

still forum
#

yes

tough abyss
#

aaah I thought you meant it had to be added to the objects (buildings and vehicles) that came from the database

#

how can I differentiate the object from being a regular construction object or a vehicle ? TypeOf/IsKindOf

#

I believe TypeOf is too specific for this?

cosmic kettle
#

typeOf will compare classnames, isKindOf will check if object belongs to the same subcategory.

tough abyss
#

hm so is there one suitable to determine if an object is a car or construction object (any other object that isn't a vehicle such as buildings, tents etc)

indigo snow
#

either grab a list of suitable base classes or check the simulation property in the config i guess

tough abyss
#

hmm that could be rather tricky if modded objects are involved :/

cosmic kettle
#

It will be even trickier to not whitelist if there are mods involved imo.

tough abyss
#

what do you mean with the whitelist?

cosmic kettle
#
_theWhitelist = ["typeName1","typeName2","typeName3"];
if (typeOf _objectTocheck in _theWhiteList) then {
  //code here
};
indigo snow
#

modded objects wil still have simulation entries and correct base classes

#

every infantry soldier will be a child of CAManBase

still forum
#

Suitable base classes are not tricky with modded objects. As they would also base their object off of a suitable base class.. Unless they are out of their mind

tough abyss
#

hmm would AllVehicles work? (Found that on a dump on base classes)

cosmic kettle
#

Guess you're right, so find out which ones you need then?

indigo snow
#

get the configParents from lots of objects and compare, i guess?

still forum
#

AllVehicles might work.

cosmic kettle
#

Yeah, best thing is to try it out and see really.

still forum
#

That contains a real ton of stuff though. Try it out

tough abyss
#

no documtation on it unfortunately (as far as I can see in the google results)

#

in the debug menu I try do {hint "Found";} forEach AllVehicles; I am missing a ; somewhere..

indigo snow
#

where do you keep getting do from

tough abyss
#

isn't that how it's supposed to be written?

indigo snow
#

also allVehicles is not a command or array

#

no

tough abyss
#

I see it most of the scripts using a forEach

indigo snow
#

not in working sqf scripts you dont

tough abyss
#
do {objectsToAdd = (entities "AllVehicles" - entities "Animal" - entities "RoadCone_L_F" - [Quartermaster,Quartermaster_1,Quartermaster_2,Quartermaster_3,artyMLRS,artySorcher,Quartermaster_2]); publicVariable "objectsToAdd";{_x addCuratorEditableObjects [(objectsToAdd), true]; } foreach allCurators; sleep 180;};};
``` Why does this work flawlessly then
indigo snow
#

im having issues reading that but freak accident?

#

do is a binary command accepting a construct on the left side and a code type on the right side

still forum
#

@tough abyss Because that's not the full code

indigo snow
#

ah i see it

tough abyss
#

ah must be the "while" that needs it

indigo snow
#

{_x addCuratorEditableObjects [(objectsToAdd), true]; } foreach allCurators;

still forum
#
do 
{
    objectsToAdd = (entities "AllVehicles" - entities "Animal" - entities "RoadCone_L_F" - [Quartermaster,Quartermaster_1,...]); 
    publicVariable "objectsToAdd";
    {_x addCuratorEditableObjects [(objectsToAdd), true]; } foreach allCurators;
    sleep 180;
};
};
#

That code still doesn't work after reformatting though.

tough abyss
#

yea missed a part of the code because I thought the do was linked to the ForEach

#

turns out it's for a while

still forum
#

Also this code is broadcasting a potentially HUUUGE array to all players. Although that is apparently not needed

tough abyss
#

and you're right allVehicles doesn't do anything

indigo snow
#

its a classname in the configFile

still forum
#

No one said AllVehicles doesn't do anything ๐Ÿ˜ฎ

tough abyss
#

in aforementioned script ๐Ÿ˜›

indigo snow
#

#define allVehicles vehicles ๐Ÿ˜„

#

anyway its a config entry

still forum
#

Ah.. Thought you were referring to entities "AllVehicles"
Yeah.. A non-script command is not a script command... Who would've thought.

tough abyss
#

vehicles includes a camping chair lol

#

but that's not gonna work for this

indigo snow
#

its a very high level one, yea

#

id use Thing or ThingX to check a chair against or something

tough abyss
#

guess I'll have to go with "Air", "Tank", "Car", "MRAP", "Truck", "Boat" and "Submarine" or something

indigo snow
#

MRAP isnt a child of Car or Tank?

#

theres also CarX, TankX and a few other for physX types

tough abyss
#

think a few mods have the category

still forum
#

MRAP is below Car afaik

indigo snow
#

this isnt about the categories you see in the editor

#

theyre separate from config (base)classes

tough abyss
#

okay so no MRAP then

indigo snow
#

you can set a plane to show up under tanks if you want

#

but in config the only plane that might be a child of a tank class might be the A10 ๐Ÿ˜›

tough abyss
#

what about the submarines, do they in "Boat"?

indigo snow
#

yea id guess, boat is top level for water stuff last i checked

#

best to check yourself tho

tough abyss
#

found these "Car","Ship","Air","Armored","Submarine","Autonomous","Support"

#

on the WIKI but is it an actual class or just a category name

still forum
#

Car Ship and Air are classes

#

rest probably category name

#

Just check ingame config viewer

#

it tells you everything

tough abyss
#

just did, they are vehicle classes

#

unfortunately mods use others hence need to be imported separately

#

is there a short command that could output all of those to a file?

cosmic kettle
#

diag_log

still forum
#

All classes? No. Entire config tree? no. But over 98% of that Data is stuff you don't want

#

I already told you. Grab a vehicle. Check config Viewer.

tough abyss
#

I know but the mods I use create a ton of other vehicle classes

#

okay maybe a question I should've asked earlier. Is it necessary to make a distinction between buildings objects and vehicles if I am not concerned with damage or lock status?

#

as both vehicle and building follow the same creation sqf _constructionObject = createVehicle [(_data select 1), _position, [], 0, "CAN_COLLIDE"]; _constructionObject setPosATL _position; _constructionObject setVectorDirAndUp [_vectorDirection, _vectorUp]; _constructionObject enableSimulationGlobal true; _constructionObject setVelocity [0, 0, 0]; _constructionObject setPosATL _position; _constructionObject setVelocity [0, 0, 0]; _constructionObject setVectorDirAndUp [_vectorDirection, _vectorUp]; _constructionObject setVelocity [0, 0, 0]; true

#

is there a thing as AllCurators for tasks and respawn points?

still forum
tough abyss
#

hmm so creating an event handler to store respawn points and tasks if not viable then

#

unless a respawn module placed by Zeus leaves a marker?

#

ooooh wait... it's an object too? Gotta find its class name then

#

@still forum would this work for the classification? sqf if (_x isKindOf "ModuleVehicleRespawnPositionWest_F") then { respawn_insert = call Requiem_fnc_spawn_insert; } else { if (_x isKindOf "ModuleTaskCreate_F") then { task_insert = call Requiem_fnc_task_insert; } else { object_insert = call Requiem_fnc_vehicle_construction_requiem_insert; }; };

still forum
#

Guess so... no

#

you still didn't understand how SQF works

#

too many ;

tough abyss
#

only after closing the else statement, right?

#

(and the function call)

#

correct now?

still forum
#

yeah

#

I guess that would work

tough abyss
#

awesome ๐Ÿ˜„

tough abyss
#

Does anyone have a script for suicidal ai?

peak plover
#

@tough abyss disableAI "AUTOCOMBAT"; setbehaviour "AWARE"; enableAttack false;

#

Then set a waypoint and let them rush it

#

Ohh yeah, suppression also causes them to lie down. setSkill ["courage",1]; helps a little with that

tough abyss
#

Thx

tardy yacht
#

Anyone of you know how to maintain a picutre's aspect ratio when used in a menu button?

peak plover
#

Hmm, is using control groups inside control groups broken?

#

I'm getting wrong positions even if I use normal positions

obsidian chasm
#

I wonder if anybody could explain to me why no matter what I put in the trigger, that it will only ever spawn the default vehicle?
https://pastebin.com/F1sS7aJx

spark cobalt
#

well I'm probably wrong here, but in most languages, you need to return for each case block, or it will go on to consider the next case, and the next falling through to the 'default'

#

don't know whether SQF switch is different somehow

#

ok, read the wiki, ignore me

obsidian chasm
#

it seems to work on my other server

#

which is why im confused

#

it works exactly the same way

spark cobalt
#

yeah, what I said doesn't seem to apply to SQF, there's an implicit break for each evaluated case

obsidian chasm
#

do you have a link to the wiki page youre looking at

#

please

spark cobalt
obsidian chasm
#

I believe I got around this last time by editing the mission.sqm

#

but for some reason any mission file I make, theyre just looking really odd

#

nvm, fixed it

peak plover
#

http://i.imgur.com/XrXcu8c.png
Using a control group inside a control group, can't get the X/Y to work.
If i use 2 controlgroups, the pink one is always on the bottom (no matter if it's defined before or after)

#

I need to either, fix X/Y of controlgroup inside control group
or
Make the pink control group always on top

little eagle
#

X,Y = 0,0 at the top left of the parents controls group for ctrlSetPosition

#

But not for ctrlPosition iirc.

peak plover
#

That didn't work when controlgroup inside a controlgroup

#

a control inside controlgroup works fine 'tho.

peak plover
#

Weirdly enough ctrlSetPosition 0,0 are not the parent control group coordinates

#

_textPos params ["_oldX","_oldY","_oldW","_oldH"];
_textPos = [
    (_oldX + 0 * (_GUI_GRID_W)),
    (_oldY + 0 * (_GUI_GRID_H)),
    5*(_GUI_GRID_W),
    5*(_GUI_GRID_H)
];
_textCtrl ctrlSetPosition _textPos;
_textCtrl ctrlCommit 0;

systemchat str ctrlParent _textCtrl;
systemChat str ctrlParentControlsGroup _textCtrl;

all correct

#

Except in theory I should not need the _oldX and should be able to use 0 and 0

#

NEVER MIND

#

Stupid me. I used safezoneX, (not 0)

#

And that's why my control group inside a control group would not work

#

Damn I was stubborn

zenith edge
#

is there a function similar to contains, aka check if string contains a specified string?

indigo snow
#

find, case sensitive

zenith edge
#

thanks

obsidian chasm
#

tfw you spell resistance wrong and wonder why you're getting errors

#

๐Ÿ‘Œ

little eagle
#

I always use resistance, because I can never remember independent vs. independant.

#

Like "pendant" ๐Ÿ˜

still forum
#

guerillia/gorilla/gourilla/gourillia/gurillia/gurilla/guerillia

little eagle
#

"resistance" is a term from physics, so I know how to write it by heart...

#

Gorilla warfare.

tough abyss
#

@little eagle: are you a physicist?

little eagle
#

engineer.

tough abyss
#

Cool.

#

Which field?

sand pivot
#

so apparently fired RPG warheads are local to the player that shot it whereas fired bullets are global!?
๐Ÿ˜•

still forum
#

Bullets are also local

#

One of Arma's problems that a lot of people complain about

sand pivot
#

standby again. sorry <face palm>

little eagle
#

Bullets are local objects and every machine owns one. Missiles are global objects and the shooter owns it.

#

owns one for every round fired*

sand pivot
#

weird.

#
op1 addEventHandler ["FiredMan", {_this execVM 'fireEH.sqf'}];
op2 addEventHandler ["FiredMan", {_this execVM 'fireEH.sqf'}];

// from fireEH.sqf
params ["_shooter", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle"];
player globalChat format ["shooter = %1  |  proj = %2", _shooter, _projectile];
#

when op1 shoots, both clients say a round was fired but bullets have different numbers

still forum
#

What's wrong with them having different numbers?

sand pivot
#

when op1 shoots a rpg, op1 has a rpg object but op2 has a objNull

#

nothing

#

the issue is the objNull on the rpg for everyone else (namely the server where i'd like to do the tracking)

#

i'm likely going to save the projectile to a more global varialbe space, or on the shooter, it's just annoying and i'm going to have to restructure a couple things

#

thanks for letting me cathartically vent.

#

slash confirm what i was seing

still forum
#

ยฏ_(ใƒ„)_/ยฏ

sand pivot
#

if ever there was an emojii for Arma scripting, thats it.

tough abyss
#

does anyone know where I can download Mikero's Tool (Eliteness)? WithSix, dev-heaven don't seem to work

#

need it to create a $PBOPREFIX$

still forum
#

You don't need Eliteness to create PBOPREFIX

rose hatch
#

^According to the forum thread

still forum
#

$PBOPREFIX$ is literally a text file

rose hatch
#

...Does the bis addon builder support $pboprefix$?

still forum
#

no

#

it has a special setting in the options

rose hatch
#

:/ didn't think so

still forum
#

it ignores the file. But you can set the prefix in the options

rose hatch
#

Yeah, but having a pboprefix is a tad easier than changing the options thing

little eagle
#

@sand pivot There is a bug where the fired eventhandler reports null for missiles fired from units on remote machines.

#
params ["_unit", "_weapon", "", "", "_ammo", "", "_projectile"];

// http://feedback.arma3.com/view.php?id=12340
if (isNull _projectile) then {
    _projectile = nearestObject [_unit, _ammo];
};
sand pivot
#

That's what i was thinking of trying. Thanks @little eagle

little eagle
#

It's the first thing I was taught by my SQF mentors.

sand pivot
#

I gotta remember to look in phab for these nuggets

little eagle
#

Imo this stuff belongs on the wiki, but KK would just delete it, so...

tough abyss
#

@still forum: more of a pseudo text file, since it has no extension.

still forum
#

Files don't need extensions you know?

#

That's just to help Humans to better differentiate

little eagle
#

A file without extension can be a text file. And I think most of them are.

still forum
#

on Linux files without an extensiona re probably a executable

little eagle
#

I see. I haven't gotten into Linux.

#

I write down stuff in random text files and never bother giving it the .txt extension.

still forum
#

I only do it because notepad++ adds it automatically if I don't

little eagle
#

Only if it's code. For the syntax highlighting of ST3.

still forum
#

I wonder why people consistently name their scripts .sqf. People don't give a shit about conventions. Or even people that are strongly against logical intelligent conventions still name their scripts .sqf

little eagle
#

I think the concept is weird. The filetype should be in a header and not the name.

still forum
#

I guess Lifers would be confused if people start to name their scripts .stuffzstuff

little eagle
#

They don't know any better and think it's needed. But I'd do it merely because of the syntax highlighting...

still forum
#

or fn_stuff.exe ๐Ÿ˜„

little eagle
#

The ultimate obfuscation is naming the script .paa

tough abyss
#

Would that actually work?

little eagle
#

We (BWA3) did this to hide a texture randomizer for a rare texture.

still forum
#

yes it would

#

Don't tell everyone your secrets ๐Ÿ˜ฎ

tough abyss
#

That's pretty cool.

little eagle
#

The benefit of naming it .paa was, that gitlab converted it to a 4kb text file dummy for the public repo automatically.

#

Since we don't OS textures and models.

still forum
#

Ahh :3 Neat

#

New Steganography scheme! Append encrypted zip files to textures and pack them in a pbo and publish it on workshop

little eagle
#

IP laws made numbers illegal. Think about it.

tough abyss
#

But is .paa faster than .sqf ๐Ÿค”

still forum
#

Yes!

#

because the letters are further up in the alphabet

queen cargo
#

so it is not only me who just now opened a beer tonight?

still forum
#

I drank over 3 liters of juice in the last 2 hours

queen cargo
#

sugar shock
youre still all in

little eagle
#

stupid A disappeared by lag

#

parma > param anyway

still forum
#

Take the M away

#

and then put it back

tough abyss
#

Wow, that's impressive, @still forum.

still forum
#

I think my brain is broken

#

I also ate too much.

#

I'll go to bed

little eagle
#

Good teamwork

queen cargo
#

i usually experience that when i drink 1.5l energy drink in ~30minutes

tough abyss
#

Can't be healthy ๐Ÿ˜ฌ

queen cargo
#

you get a sugar shock and the coffin is "killing" you ...
feels like you breath but no air is comming in

still ... getting work done better then without

still forum
#

Just disconvered our super market sells 2L bottles of energy drink stuff

queen cargo
#

would love that :(
our max is 1.5l

still forum
#

Need to try someday. #offtopic ๐Ÿ›Œ

tough abyss
#

Mean while I'm sitting here drinking nothing but water...

spark cobalt
#

on linux a file without an extension can be anything, linux doesn't need extensions, although they do help to provide clues to the file type so it doesn't need to probe the file to figure out what it's contents might be

#

oh ffs, f' you discord

rotund cypress
#

Hey, does anyone here have the default path for the grey version of the Gryphon jet?

#

I am trying to find it but can't

peak plover
#

gryphon? dlc? may still be ebo

still forum
#

Place gryphon in Eden. Right click. View in Config browser. Profit

subtle ore
#

is it possible to compile code during runtime with say a text field input?

dusk sage
#

Have you used the debug console?

#

Or are you wishing to prompt input from a singular script?

subtle ore
#

@BoGuu input prompt from a singular script.

#

I'm looking to allow the player to add their own task conditions.

still forum
#

@subtle ore Have you ever used Debug console? Because that's exactly what it does.

#

99% of Arma scripts are compiled during "runtime"

subtle ore
#

No. I think you're missing my point, probably not the correct words either. Control -> Inputted Code Via String - > Executed -> Task created with player's custom conditions

still forum
#

I'm not missing your point

subtle ore
#

Mis understanding?

still forum
#

No.. I don't think so

subtle ore
#

I don't wan't to give the debug console to anyone

still forum
#

I never said that

#

You want the player to be able to enter a script that will then be used as condition in a task.

subtle ore
#

yes

still forum
#

The debug console is doing the same. The player enters a script. Which then get's compiled and executed

#

So yeah.. It's possible

subtle ore
#

Okay, bear with me here. How might I go about that?

still forum
subtle ore
#

Okay, that works. Thanks.

still forum
#

then you can execute that and get the result true/false returned

#

Btw by doing that you are basically giving the Debug console to anyone who can enter code in there

subtle ore
#

Going to disclude anything that doesn't match up

still forum
#

so you are going to disallow call,compile,format and all the addEventHandlers? and remoteExec and endMission and.. stuff

subtle ore
#

Well no, that's like trying to compare something to all rather than what's needed. _str != "name" versus !(_str in ["1","2","3","4","5"];)

#

what's needed would be strictly something like alive getDammage and inArea type commands for tasks

still forum
#

So you want to write a script parser in SQF and pick out all the commands and check that against a whitelist?

subtle ore
#

sure you could say that

still forum
#

Have fun then ^^

subtle ore
#

Heh, thanks.

tough abyss
#

Not to mention players might execute code to assign value for a global varible to break a script etc
Will be nightmare to secure if its for any sort of public server. Better off to have pre-defined options imo

still forum
#

Midnight is going to forbid the assignment operator probably. so that's not a problem.. theoretically

tardy yacht
#

Been looking for solutions online but everyone does really weird shit: How can I put a texture on a button, and make the texture keep the correct aspect ratio?

tough abyss
#

hello lads if an event handler is attached to a zeus module server side, will it trigger when a zeus places something? The only thing I see in the logs are sqf 16:13:10 "Debug menu used!" 16:13:16 Server: Object 4:28 not found (message Type_127) 16:13:16 Server: Object 4:29 not found (message Type_121) 16:13:16 Server: Object 4:30 not found (message Type_114) 16:13:16 Server: Object 4:38 not found (message Type_451) 16:13:16 Server: Object 4:39 not found (message Type_121) 16:13:16 Server: Object 4:40 not found (message Type_114) 16:13:16 Error: Object(4 : 37) not found 16:13:17 Server: Object 4:48 not found (message Type_451) 16:13:17 Server: Object 4:49 not found (message Type_121) 16:13:17 Server: Object 4:50 not found (message Type_114)

#

whereas the function called using the event handler ran on the server by debug menu does create the expected message in the logs

still forum
#

If it doesn't work then it apparently doesn't trigger on the server

#

remoteExec ftw

indigo snow
#

if a player takes control, the zeus module will probably change locality to his client

tough abyss
#

alright thanks. Is there a way to call a function globally instead of on the server only/client only?

indigo snow
#

see Dedmen above, remoteExec

tough abyss
#

ah okay so gotta use it twice

#

thanks!

indigo snow
#

watch out with what data you send, dont send huge data bits

tough abyss
#

just a setVariable

#

and assignment of the event handler

indigo snow
#

setVariable already has a global flag

#

X setVariable [name,value,true] to broadcast to all clients and server

tough abyss
#

yea but in this case the server must first know it has to send it, via the event handler ๐Ÿ˜›

tough abyss
#

hm remoteExec still doesn't cause the logs

#

using addEventHandler ["CuratorObjectPlaced", { object_placed = remoteExec ["Requiem_fnc_object_queue_insert", 2, false]; }]; (because only server needs to do this)

little eagle
#

What is the question?

still forum
#

you are storing the return value of remoteExec?

#

the addEventHandler is running on the client?

tough abyss
#

runs globally

#

( , 0, true )

still forum
#

okey... mh

tough abyss
#

runs firstly on mission start, then everyone JIP

still forum
#

just put a diag_log right into the eventhandler to see if and where it executes

#

maybe it does actually execute on the server but you made a mistake elsewhere

little eagle
#

CuratorObjectPlaced only fires on the machine where the curator logic is local.

still forum
#

We know that. But where is that?

little eagle
#

The machine that has the player looking at the zeus interface.

tough abyss
#

okay, so that client must know what the function is, because the remoteExec on server only doesn't reacht the server for some reason (after placing 4 griffons)

little eagle
#

Everyone must know what the function is, otherwise remoteExec will fail on those machines that don't know.

#

remoteExec does not transfer the named function over the net. It would be very inefficient if it did.

tough abyss
#

it only needs to run on the server

little eagle
#

Like addMPEventHandler ...

still forum
#

@little eagle remoteExec tries to exec it on the Server. Only the server knows the function

indigo snow
#

then it should be fine right? server has function, client RE's to server

#

so something else is going wrong

little eagle
#

Yes, but idk what remoteExec on channel 2 does in SP.

tough abyss
#

it's for MP

little eagle
#

Are you testing in MP too?

tough abyss
#

yea

#

on a dedicated server

little eagle
#

And the problem is?

tough abyss
#

that the only thing in the function attached to the event handler is a diag_log with some text

#

which doesn't appear after placing objects

#

in the server logs

little eagle
#

You wrote:

#
addEventHandler ["CuratorObjectPlaced", { object_placed = remoteExec ["Requiem_fnc_object_queue_insert", 2, false]; }];
#

But there is the object missing on the left side of addEventHandler

tough abyss
#

let me post the rest, one sec

#
{
    _x addEventHandler ["CuratorObjectPlaced", { object_placed = remoteExec ["Requiem_fnc_object_queue_insert", 2, false]; }];
    _x addEventHandler ["CuratorObjectDeleted", { object_deleted = remoteExec ["Requiem_fnc_object_queue_delete", 2, false]; }];
    _x addEventHandler ["CuratorObjectEdited", { object_edited = remoteExec ["Requiem_fnc_object_queue_update", 2, false]; }];
    _x addEventHandler ["CuratorMarkerPlaced", { marker_placed = remoteExec ["Requiem_fnc_marker_queue_insert", 2, false]; }];
    _x addEventHandler ["CuratorMarkerDeleted", { marker_deleted = remoteExec ["Requiem_fnc_marker_queue_delete", 2, false]; }];
    _x addEventHandler ["CuratorMarkerEdited", { marker_edited = remoteExec ["Requiem_fnc_marker_queue_update", 2, false]; }];
    } forEach AllCurators;
    diag_log "Curators initiated";```
indigo snow
#

yea youre not sending any arguments with the function

#

how would the server know what object was actually created?

little eagle
#

?

tough abyss
#

the only thing that function does is diag_log "Object placed in queue"

indigo snow
#

ah right, i still had the object not found thing in the back of my head

tough abyss
#

haha np

little eagle
#

And that string doesn't appear in the servers RPT when placing an object with the zeus?

tough abyss
#

that is correct

#

the diag_log from the code above does appear

#

but the diag_log from the function does not

indigo snow
#

it appears on the clients?

#

diag_log "Curators initiated";

tough abyss
#

haven't checked but it does appear on the server

indigo snow
#

thats irrelevant

little eagle
#

Check if it appears on the clients.

#

The eventhandler has to be added on every machine.

#

Because it requires the logic to be local.

tough abyss
#

I do that with sqf engineID = remoteExec ["Requiem_fnc_curator_eventhandlers", -2, true]; diag_log "Gentlemen, start your engines!"; nil

little eagle
#
remoteExec ["Requiem_fnc_object_queue_insert", 2];

^ enter this via debug console (LOCAL EXEC) and see if it makes the string appear in the servers RPT.

tough abyss
#

(server takes a while to load)

little eagle
#

No hurry.

indigo snow
#

if youre restarting everytime, i dont think you have to to update a mission

tough abyss
#

what do you mean?

indigo snow
#

restarting the entire server or just the mission?

tough abyss
#

this whole thing is server sided PBO

little eagle
#

Oh boy.

tough abyss
#

so to update it, the server needs a restart

indigo snow
#

id do the dev work in a normal mission pbo, would save you a lot of time during dev

#

or look into filepatching

little eagle
#

Put your scripts into the mission.

tough abyss
#

wouldn't that later prevent the functions to be moved to the server pbo later?

little eagle
#

Why would you create that mess in the first place?

#

So, did the log appear on the clients?

tough abyss
#

hmm found some spam in it

#
    _x addEventHandler ["CuratorObjectPlaced", { object_placed = remoteExec ["Requiem_fnc_object_queue_insert", 2, false]; }];
    _x addEventHandler ["CuratorObjectDeleted", { object_deleted = remoteExec ["Requiem_fnc_object_queue_delete", 2, false]; }];
    _x addEventHandler ["CuratorObjectEdited", { object_edited = remoteExec ["Requiem_fnc_object_queue_update", 2, false]; }];
    _x addEventHandler ["CuratorMarkerPlaced", { marker_placed = remoteExec ["Requiem_fnc_marker_queue_insert", 2, false]; }];
    _x addEventHandler ["CuratorMarkerDeleted", { marker_deleted = remoteExec ["Requiem_fnc_marker_queue_delete", 2, false]; }];
    _x addEventHandler ["CuratorMarkerEdited", { marker_edited = remoteExec ["Requiem_fnc_marker_queue_update", 2, false]; }];
    } forEach AllCurators;
    diag_log "Curators initiated";```

```sqf
16:05:16 Error in expression <zeus_admin t allCurators>
16:05:16   Error position: <t allCurators>
16:05:16   Error Missing ;```
#

I don't know where the part of zeus_admin comes from

indigo snow
#

somewhere else

tough abyss
#

zeus_admin is nowhere used

indigo snow
#

its not appearing from thin air i promise you ๐Ÿ˜›

tough abyss
#

Search "zeus_admin" (0 hits in 0 files) searching in the folder that the functions are in

peak plover
#

search mission.sqm

indigo snow
#

zeus_admin might not be the entire term

tough abyss
#

haven't set it to match whole word only

little eagle
#

The t seems wrong.

tough abyss
#

yea but I have no idea where the zeus_admin or t comes from

#

it's not anywhere in the functions themselves

peak plover
#

diag_log str allCurators;

dusk sage
#

Is it just magic

little eagle
#

It's probably somewhere in the mission.

#

Or one of your scripts you delegate from that server addon to the clients.

tough abyss
#

@peak plover "zeus_guest","zeus_admin","game_master"

little eagle
#

Your problem seems to be that you're trying to find errors in the scripts, but the problem is somewhere in the way the scripts are executed (or not).

tough abyss
#

hmm alright ignore that error entry, it seems to originate from the debug menu, not the server addon

little eagle
#

You have to fix every script error or any other script may behave unexpectedly.

tough abyss
#

found it

#

17:10:18 "Gentlemen, start your engines!" on the server

#

but not on my client

little eagle
#

I don't know which script this is from. Is this good?

tough abyss
#

on the server yes

#

the lack of it on client, no

little eagle
#

What function does print this string?

tough abyss
#
engineID = remoteExec ["Requiem_fnc_curator_eventhandlers", -2, true];
diag_log "Gentlemen, start your engines!";
nil```
little eagle
#

That is the value of the function, but what is it's identifier? What is it's name?

tough abyss
#

it's function run postInit

little eagle
#

postInit okay

#

From the addon or the mission?

tough abyss
#

addon

#
        {
            file = "JSFAR_LIBRARY\Requiem";
            class startengines {postInit = 1;};
        };```
little eagle
#

Then this function is never executed on the clients.

#

Therefore the string will not be logged on the clients.

tough abyss
#

-2 would be everyone but the server I read

little eagle
#

But the diag_log is outside of the remoteExec.

#

And that only runs on the server.

tough abyss
#

oh yea I must be mistaking the diag_logs

#
diag_log "Curators initiated";```
#

this should appear client side but doesn't

little eagle
#

Yeah. This string will only run on the server.

tough abyss
#

as a part of sqf { _x addEventHandler ["CuratorObjectPlaced", { object_placed = remoteExec ["Requiem_fnc_object_queue_insert", 2, false]; }]; _x addEventHandler ["CuratorObjectDeleted", { object_deleted = remoteExec ["Requiem_fnc_object_queue_delete", 2, false]; }]; _x addEventHandler ["CuratorObjectEdited", { object_edited = remoteExec ["Requiem_fnc_object_queue_update", 2, false]; }]; _x addEventHandler ["CuratorMarkerPlaced", { marker_placed = remoteExec ["Requiem_fnc_marker_queue_insert", 2, false]; }]; _x addEventHandler ["CuratorMarkerDeleted", { marker_deleted = remoteExec ["Requiem_fnc_marker_queue_delete", 2, false]; }]; _x addEventHandler ["CuratorMarkerEdited", { marker_edited = remoteExec ["Requiem_fnc_marker_queue_update", 2, false]; }]; } forEach AllCurators; diag_log "Curators initiated";

little eagle
#

this should appear client side but doesn't
Yes.

#

And what is the name of the function you just posted?

tough abyss
#

fn_curator_eventhandlers.sqf

little eagle
#

Requiem_fnc_curator_eventhandlers
?

tough abyss
#

Requiem is the tag

little eagle
#

Sure. A functions name is Tag + _fnc_ + function name

tough abyss
#

then it's correct right?

little eagle
#

Is Requiem_fnc_curator_eventhandlers defined on the clients?

tough abyss
#

hm no

little eagle
#

Then remoteExec will fail on the clients.

tough abyss
#

should I make it remoteExec [ {_x addEventHandler etc etc etc ];?

little eagle
#

remoteExec only transfers the functions identifier as string ("Requiem_fnc_curator_eventhandlers")

tough abyss
#

and then just go for a call

little eagle
#

And the executes it from the mission namespace.

tough abyss
#

to let the server run fn_curator_eventhandlers

little eagle
#

If the function is undefined, nothing happens.

tough abyss
#

so if I were to revert to a simple call for the fn_curator_eventhandlers, then in that function use remoteExec for the event handlers?

little eagle
#

?

tough abyss
#
remoteExec ["{
    _x addEventHandler ["CuratorObjectPlaced", { object_placed = remoteExec ["Requiem_fnc_object_queue_insert", 2, false]; }];
    _x addEventHandler ["CuratorObjectDeleted", { object_deleted = remoteExec ["Requiem_fnc_object_queue_delete", 2, false]; }];
    _x addEventHandler ["CuratorObjectEdited", { object_edited = remoteExec ["Requiem_fnc_object_queue_update", 2, false]; }];
    _x addEventHandler ["CuratorMarkerPlaced", { marker_placed = remoteExec ["Requiem_fnc_marker_queue_insert", 2, false]; }];
    _x addEventHandler ["CuratorMarkerDeleted", { marker_deleted = remoteExec ["Requiem_fnc_marker_queue_delete", 2, false]; }];
    _x addEventHandler ["CuratorMarkerEdited", { marker_edited = remoteExec ["Requiem_fnc_marker_queue_update", 2, false]; }];
    } forEach AllCurators;
    diag_log "Curators initiated";", 0, true];```
#

would that work?

little eagle
#
Requiem_fnc_curator_eventhandlers remoteExec ["BIS_fnc_call"];

You could do this ^ to execute a function on machines regardless if it is defined.
But note that the whole function will be transferred as longish string, which is pretty bad for connection. Red chain etc. when you abuse it.

#

would that work?
No, you need to at least escape the quote marks in strings.

tough abyss
#

hm true

#

so it'd be way easier to put into init.sqf instead of the addon?

little eagle
#

Definitely.

#

There is no benefit in using a server only addon for this. It only creates trouble and headaches.

#

Everything you can do with a server only addon, you can do with a mission... And you don't have to worry about locality and race conditions (as much), because all scripts are transferred before the mission starts on the client.

tough abyss
#

I tried to make it all server side so I could just create a small base on a new map and not having to transfer all the scripts to the mission pbo

#

and saving to database later, doubt it works for a client

little eagle
#

Make a template mission then. That only has the scripts and maybe the lobby units.

tough abyss
#

question in-between, if the log shown a Object not found (Type_XXX) would that interfere with anything?

#

ah there we go

#

it's spamming the diag_log after I spawned a composition

#

working ^^

#

now if I were to pass an argument (the placed object) to the server, how that go? as _x is taken by allCurators

little eagle
#

Ignore the object not found stuff.

tough abyss
#

alright thanks

little eagle
#

The placed object is passed in the _this ARRAY variable. You pass _this via remoteExec.

tough abyss
#

okay cool!

dusk sage
#

Object not found (Type_XXX) is a serious issue, take it seriously

tough abyss
#

{
    _x addEventHandler ["CuratorObjectPlaced", { object_placed = _this remoteExec ["Requiem_fnc_object_queue_insert", 2, false]; }];
    _x addEventHandler ["CuratorObjectDeleted", { object_deleted = _this remoteExec ["Requiem_fnc_object_queue_delete", 2, false]; }];
    _x addEventHandler ["CuratorObjectEdited", { object_edited = _this remoteExec ["Requiem_fnc_object_queue_update", 2, false]; }];
    _x addEventHandler ["CuratorMarkerPlaced", { marker_placed = _this remoteExec ["Requiem_fnc_marker_queue_insert", 2, false]; }];
    _x addEventHandler ["CuratorMarkerDeleted", { marker_deleted = _this remoteExec ["Requiem_fnc_marker_queue_delete", 2, false]; }];
    _x addEventHandler ["CuratorMarkerEdited", { marker_edited = _this remoteExec ["Requiem_fnc_marker_queue_update", 2, false]; }];
    } forEach AllCurators;
    diag_log "Curators initiated";```so like that?
dusk sage
#

It's BI's way of showing they don't give a fuck ๐Ÿ™ƒ

tough abyss
#

hahahaha

little eagle
#

_this already is an array. No need to put it into another one.

tough abyss
#

okay updated code above

little eagle
#

lgtm, but I have no idea what these globals are for.

tough abyss
#

oh the object is passed to a global array for SQL database actions

little eagle
#

That is not what you're doing here.

tough abyss
#

no, but that's done by other functions

little eagle
#

Then what are these globals for?

#

remoteExec reports nothing with the not-JIP version.

tough abyss
#

the server doesn't JIP, does it?

little eagle
#

The globals make the script look more complicated than it has to be.

#

The server can not JIP.

tough abyss
#

then why is the JIP false wrong?

little eagle
#

Idk, it's your script?

#

I would leave it out entirely.

tough abyss
#

I am just curious if it made a huge difference ๐Ÿ˜›

#

alright

little eagle
#

Well, the result will be the same, but you already have issues with the script so in my opinion, the scripts should be written as simple as possible.

tough abyss
#

what issues would be arising?

little eagle
#

Like you can add commy = false; in between every line and it wouldn't change a thing, but

#

Why?

peak plover
#

How to
recompile functions compiled in CfgFunctions in mission description.ext?

little eagle
#

The issue could be that the one that has to look at the scripts later might be unnecessarily confused about what is happening here.

indigo snow
#

Restart mission @peak plover

#

Theyre compileFinal'd

little eagle
#

Which is pointless when you don't cache them, but not surprised.

peak plover
#

Will hyperlinking in structured text open in steam overlay? Can it be forced to not?

oak marten
#

Hi! this can work with say3D instead of playSound? playSound "contact"; call BIS_fnc_MP; I want that a soldier walk and sing but can't be hear in all map, only near.

#

from say3D "sign"; call BIS_fnc_MP;

little eagle
#
"contact" remoteExec ["playSound"];
oak marten
#

with say3D?? "contact" remoteExec ["say3D"];

little eagle
#
[from, sound] remoteExec ["say3D"];
oak marten
#

Bis_fnc_MP say that its deprecated, but I read this From version 1.50 the function bis_fnc_mp will use the engine based remote execution. This will positively affect its performance, namely processing speed and amount of transferred data. Then, its deprecated or is recomended to performance?

little eagle
#

It is deprecated and was changed to use the same method to not be a total performance hog.

#

There is no reason to use the function.

oak marten
#

ok, thanks @little eagle

scarlet spoke
#

Does setvariable with the global parameter onyl support missionNamespace or are the other namespaces also supported?

little eagle
#

Only mission namespace.

still forum
#

Objects are also supported

little eagle
#

^

still forum
#

if they are global

little eagle
#

Also GROUP

#

But, note that groups are very wonky at mission start.

#

They are local things at the start and then get replaced by the global one later or something like that.

#

So variables might go AWOL when set that way at the mission start...

still forum
#

TEAM_MEMBER probably works to.. But let's not get into that region

little eagle
#

Not mentioned in the wiki. TEAM_MEMBER tho ๐Ÿ˜›

scarlet spoke
#

Thx ๐Ÿ˜ƒ

peak plover
#

mission parameters can be code or a variable as well?

#

Essentially settings file, in which you change all the parameters default values

indigo snow
#

Only integer numbers

peak plover
#

Any workarounds ? I guess parameters can't be added later on etc....

#

class p_respawn_type
{
    title = "Respawn Type";
    values[] = {0,1,2};
    texts[] = {"Instant Respawn","Wave Respawn","Timer Respawn"};
    default = 0;
};

into


class p_respawn_type
{
    title = "Respawn Type";
    values[] = {0,1,2};
    texts[] = {"Instant Respawn","Wave Respawn","Timer Respawn"};
    #define RESPAWNS_SETTINGS_PARAM_TYPE
        #include "settings.cpp"
    #undef RESPAWNS_SETTINGS_PARAM_TYPE
};
//in settings.cpp

#ifdef RESPAWNS_SETTINGS_PARAM_TYPE
    // Respawn type mission parameter default value
    default = 0;    //Default respawn Type; 0 = insta, 1 = Wave, 2 = Timer
#endif


#

bad idea ?

indigo snow
#

Its a config, its immutable once processed

#

What would that include accomplish?

peak plover
#

yes, but this will allow for all settings to be in one file

indigo snow
#

My wifi didnt load it in at first, sorry

peak plover
#

I don't want to go through 5 different files every time I want to change settings and parameters for the mission

#

1 file to rule over all settings

indigo snow
#

Why not #define them all in a central file once and use macros?

peak plover
#

That would work?

indigo snow
#

Why not?

#

Just #include that central file

peak plover
#

Can I use that file for other settings past pre-processor later as wel?

indigo snow
#

You can #include in any file

peak plover
#

as in #include settings.cpp
and then use the macro in SQF

#

Is macro ok with that 'tho?

indigo snow
#

Includes normally use the .hpp extension as convention

#

With what?

peak plover
#

me using it in a regular function

indigo snow
#

Uh yea ever looked at cba macros?

peak plover
#

That's a mod

indigo snow
#

FUNC() and all?

#

Still files

peak plover
#

Do they all funky in the mission ?

indigo snow
#

As long as theyre in files and you #include them you good

peak plover
#

๐Ÿ’ก

#

Thanks

indigo snow
#

No call compile "#include hhh" shenanigans

#

Heck ive seen people #include their mission.sqm in their description.ext

#

Dont ask me why but ive seen it

little eagle
#

Sounds so dumb it might just work.

indigo snow
#

It works, mission.sqm follows the same config structure after all

#

I just dunno what youd ever use it for

queen cargo
#

worked*
unless you save your mission unbinarized

indigo snow
#

Fair

delicate totem
#

I think you need quotation marks around the variable name.
private "_entity";

#

I'm not super great at coding but that was the first thing that jumped out at me. The next thing is line 209,
} count _entities;
should that be
} foreach _entities;?

robust hollow
#

if its only doing it once i would think its the quotes.

if the var is defined before you private it and if you private it without quotes it does this:

private _entity;
// Error type number expected array, string```

but if it were a string it would do this:
```_entity = "_somethingClever";
private _entity;
// ^ == private "_somethingClever"; (i think)```

your options with private (according to the wiki) are:
```private _var = data;
private "_var";
private ["_var1","_var2",etc];```
still forum
#

@hasty violet Because you are not initializing a variable. You are setting them to nothing. Which is still undefined. You have to initialize to something private _entity = objNull
the private keyword is only a modifier to the assignment operator (=) if you don't have an assignment then the private keyword won't work.
And if it's not a keyword then the game thinks you probably meant to call the private command with a variable as argument
Don't use private "_entity" that's slower and will also initialize to nothing
@delicate totem count does essentially do the same as forEach just without _forEachIndex thus being a little faster

still forum
#

explain what?

#

Please don't bother BI employees for stuff that the community can help you with. Would you prefer them to work on the Game and fix bugs. Or to help you with your unability to google?

sick oar
#

Need help with vehicle respawn module, vehicle wreck dissapears when module is set to preserve wreck

little eagle
#

The two @ mean, that you tagged a whole group of people, not someone names "Biminions". Check out the discord's member list over there >>>

cosmic kettle
#

Dear Bohemia Interactive Studio, please allow some sort of lightweight rope creation between two static objects for decorative purposes. Thank you Bohemia Interactive Studio, Amen.

little eagle
#

TIL:

private _display = allDisplays;
createDialog "RscDisplayEmpty";
_display = (allDisplays - _display) select 0;

^ this works to get the display. Might be interesting to someone only doing missions, not addons.

still forum
#

BIS? BI simulations?

#

What display @commy? current one in foreground?

little eagle
#

The RscDisplayEmpty you just created.

peak plover
#

That's acutally quite useful

shadow sapphire
#

Has anyone writtin an in-game scripted mortar/artillery calculator? I've written a browser calculator that people can use from their phones, but it only has values for the mortar at present.

peak plover
#

How do I delete all controls from a control group / retrive list of children to a certain control

#

@shadow sapphire ace3?

sand pivot
#

i am seeing references on forums that you can't edit the direction of a turret via scripting, is this correct?

halcyon crypt
peak plover
#

Thanks

shadow sapphire
#

@peak plover, need it in script form, no mods. Maybe I'll have to check how theirs works and get inspired that way, though.

peak plover
#

Exactly

halcyon crypt
#

kinda weird there is no command to get Control children but there is a command to get a Control's parent ๐Ÿค”

peak plover
#

I guess I would have to loop through all controls and then select the ones that are gucci

halcyon crypt
#

yeah

cosmic kettle
#

@little eagle Thanks for the reveal function- hint, the chess pieces now get recognized way faster.
Am also looking for a way to allow players to interact with a 2D chessboard instead (and sync the 3D movements); to consider personal preferences.

peak plover
#

Works great, thanks marcel ๐Ÿ˜„

pulsar anchor
#

Hello math guys ๐Ÿ˜‰ do you have a better way of calculating the steepness of a hill?

My code (currently not sure if its rigth)

vectorUpToDegree={
_u = surfaceNormal position player;
_v = [_u select 0,_u select 1, 0];
90-acos((abs(_u vectorDotProduct _v))/(([0,0,0] vectorDistance _u)*([0,0,0] vectorDistance _v)));
};

#

and for testing
0 spawn{
while {true} do
{
hintSilent str call vectorUpToDegree;
};
}

peak plover
pulsar anchor
#

it uses isFlatEmpty

#

thats not what I want. I want the degrees

little eagle
#
acos (surfaceNormal _origin vectorDotProduct [0,0,1])

???

pulsar anchor
#

alrigh. That was the Question

#

thx ๐Ÿ˜ƒ

little eagle
#

Hmm, preview of SVG doesn't work in discord.

#

But essentially this. b is [0,0,1], a is the surface normal and phi is the angle you want I think.

#

a not c, derp

#

That is not a command, nick^^

indigo snow
#

Mobile discord...

#

Didnt load your answer in

#

Can be even easier i think.

little eagle
#

Really? How?

indigo snow
#

atan(surfaceNormal select 2)

#

iirc

little eagle
#

hmm, wait I need paper.

indigo snow
#

I have it on my pc but phone atm

pulsar anchor
indigo snow
#

Youre already helped by the fact theyre directional vectors of length 1 so you can cheat a lot

little eagle
#

You don' t need to normalize the vectors. They already are unit vectors.