#arma3_scripting

1 messages · Page 56 of 1

sullen sigil
#

"doesnt work" isnt very helpful for being able to solve that -- i dont know what code youve tried to execute nor the effect of what its running

gloomy spear
#
_t = 0; _p = 0; _r = 90;
this setVectorDirAndUp [ 
[sin _t * cos _p, cos _t * cos _p, sin _p], 
[[sin _r, -sin _p, cos _r * cos _p], -_t] call BIS_fnc_rotateVector2D ];
[this, ContainerHEMT] call BIS_fnc_attachToRelative;
#

all it does is just turn it

#

it doesnt attacj

sullen sigil
#

youre able to drive the truck away from it?

gloomy spear
#

not the first time, when i start the scenario its attached, but when i try to spawn it in again it doesnt attach

sullen sigil
#

how are you spawning it in again

gloomy spear
#

as a composition

sullen sigil
#

thats because compositions dont save init text iirc

gloomy spear
#

huh

sullen sigil
#

when spawned from zeus (which i assume is how youre spawning it mid scenario)

gloomy spear
#

but all my other compositions work

sullen sigil
#

nvm it does run init code tf

#

have you actually saved the most recent version of it

gloomy spear
#

yes

#

ill try again to be sure

sullen sigil
#

spawn it in 3den from the composition and tell me what the init says

gloomy spear
sullen sigil
#

the editor

gloomy spear
#

oh

#

says the same thing

sullen sigil
#

ok now try it in zeus after youve saved it again

gloomy spear
#
_t = 0; _p = 0; _r = 90;
this setVectorDirAndUp [ 
[sin _t * cos _p, cos _t * cos _p, sin _p], 
[[sin _r, -sin _p, cos _r * cos _p], -_t] call BIS_fnc_rotateVector2D ];
[this, ContainerHEMT] call BIS_fnc_attachToRelative;
sullen sigil
#

oh

gloomy spear
sullen sigil
#

its because ContainerHEMT is a global variable that isnt assigned to the one you spawn

#

duh pea brain kjw

#

private _truck = (getPosASL this) nearestObject "B_Truck_01_flatbed_F"; and then putting _truck instead of ContainerHEMT is a better approach

gloomy spear
#

alright

#

let me try this

#

thank you

sullen sigil
#

thats assuming that bit worked in the first place for you

#

(use getPosASL instead of getPos as getPos is position above highest surface beneath you)

gloomy spear
#

still doesnt work, i dont know why

private _truck = (getPosASL this) nearestObject "B_Truck_01_flatbed_F";
_t = 0; _p = 0; _r = 90;
this setVectorDirAndUp [ 
[sin _t * cos _p, cos _t * cos _p, sin _p], 
[[sin _r, -sin _p, cos _r * cos _p], -_t] call BIS_fnc_rotateVector2D ];
[this, _truck] call BIS_fnc_attachToRelative;
sullen sigil
#

does that work from the editor

gloomy spear
#

in the editor it just spawns it wherever, it only starts to do anything when i load the scenario

sullen sigil
#

yes

#

when spawned in the editor and you load in

#

does that work

gloomy spear
#

oh yes

sullen sigil
#

have you actually saved it properly as a composition again

gloomy spear
#

yes

sullen sigil
#

spawn one from a composition and copy paste what is in the init here

gloomy spear
#
private _truck = (getPosASL this) nearestObject "B_Truck_01_flatbed_F";
_t = 0; _p = 0; _r = 90;
this setVectorDirAndUp [ 
[sin _t * cos _p, cos _t * cos _p, sin _p], 
[[sin _r, -sin _p, cos _r * cos _p], -_t] call BIS_fnc_rotateVector2D ];
[this, _truck] call BIS_fnc_attachToRelative;
stray flame
#

im trying to apply a thing to an entire layer, is this the right way of doing it?

getMissionLayerEntities "UNSC Drake-Class Corvette" params ["_objects1"]; 

_objects1 apply { [_X, false, [3, -2, 2], 20] call ace_dragging_fnc_setDraggable; };
_objects1 apply { [_X, false, [0, 3, 1], 10] call ace_dragging_fnc_setCarryable; };

the thing im trying to apply to that entire layer:

[this_, false, [3, -2, 2], 20] call ace_dragging_fnc_setDraggable;
[this_, false, [0, 3, 1], 10] call ace_dragging_fnc_setCarryable;```
sullen sigil
gloomy spear
#

it does

sullen sigil
#

so you have 2 hemtts spawned?

gloomy spear
#

oh wait, now it also attaches when i spawn it from zeus. it just doesnt go to the spot i need it to be

gloomy spear
sullen sigil
gloomy spear
#

it stays where i spawn it, it doesnt go a specific place

stray flame
#

yeah it seems like it isnt. But I am not sure as the command itself has had mixed results thus far

sullen sigil
#

what is the command and what are said mixed results

sullen sigil
gloomy spear
#

i dont think so, if you mean where i spawn it i just spawn it on the ground

sullen sigil
#

no
in 3den does it look the same as it should when its spawned

weary smelt
#

Tested on malden, seems to work ok. Join-in-progress load time is about +20 seconds (about the same amount of time it took to execute). But when I tested on Altis it is significantly slower, and I mean it does each chunk slower, not just total time. Any idea why that is? Does the terrain grid have a higher "resolution"?

gloomy spear
#

it stays in the same spot yes

#

oh wait, no its not in the right position yet

stray flame
# sullen sigil what is the command and what are said mixed results
[this_, false, [3, -2, 2], 20] call ace_dragging_fnc_setDraggable;
[this_, false, [0, 3, 1], 10] call ace_dragging_fnc_setCarryable;

This is what I do to make objects un-carriable and un-draggable in ace. This has worked on my end when put into the init of an object, but when hosting a server, it seems local as other players see no effect from it. Therefore I intend to put it in a script and apply it to an entire layer at a time, as that way I dont need to repeat it like 100 times.

#

if I need to, I could remote-exec the script itself

#

However so far I am trying to get a functional script version of this that applies this_ as being an entire layer of objects

#

and thats where I now struggle

sullen sigil
little raptor
gloomy spear
gloomy spear
sullen sigil
sullen sigil
stray flame
#

you mean "this_"?

sullen sigil
#

yes

stray flame
#

thats fine, I know

sullen sigil
#

then why are you trying to use it in the function

gloomy spear
#

no, ive done

this attachTo [getPos this nearestObject "B_Truck_01_flatbed_F", [-1.22, -0.7, -0.3]];
_t = 0; _p = 0; _r = 90;
this setVectorDirAndUp [ 
[sin _t * cos _p, cos _t * cos _p, sin _p], 
[[sin _r, -sin _p, cos _r * cos _p], -_t] call BIS_fnc_rotateVector2D ];

to attach the planks to where they need to be once spawned

stray flame
#

its the effect I intend to replicate, I instead do this:

getMissionLayerEntities "UNSC Drake-Class Corvette" params ["_objects1"]; 

_objects1 apply { [_X, false, [3, -2, 2], 20] call ace_dragging_fnc_setDraggable; };
_objects1 apply { [_X, false, [0, 3, 1], 10] call ace_dragging_fnc_setCarryable; };
#

This, is what isnt working

#

I dont use this_ here for obvius reasons

sullen sigil
weary smelt
gloomy spear
#

because when i use the BIS it just stays where i spawn it and just attaches to the truck from there

sullen sigil
sullen sigil
little raptor
stray flame
#

I'll just run it and send a screenshot

stray flame
#

I should say its part of a bigger script. But the other things are not an issue, I can assure that. This is at the end, and is the part that causes problems

sullen sigil
#

my guess would be that it's because you're using _x and ace doesnt accommodate for that for some reason
but it should do thonk

stray flame
#

so this should work

#

but ace is being dumb

sullen sigil
#

does the same thing happen if you run the same code with this instead of _x in the init of an object?

sullen sigil
gloomy spear
sullen sigil
#

with what code

meager granite
#

Display will init at uncertain time, findDisplay will not work on same or even next frame.

stray flame
#

this is what I would run on a singular object.

[this_, false, [3, -2, 2], 20] call ace_dragging_fnc_setDraggable;
[this_, false, [0, 3, 1], 10] call ace_dragging_fnc_setCarryable;

I cant carry or drag objects in ace, but apparently others can. Therefore I belive its local

gloomy spear
#
private _truck = (getPosASL this) nearestObject "B_Truck_01_flatbed_F";
_t = 0; _p = 0; _r = 90;
this setVectorDirAndUp [ 
[sin _t * cos _p, cos _t * cos _p, sin _p], 
[[sin _r, -sin _p, cos _r * cos _p], -_t] call BIS_fnc_rotateVector2D ];
[this, _truck] call BIS_fnc_attachToRelative;
sullen sigil
#

not this_

weary smelt
sullen sigil
#

dont use this_

sullen sigil
stray flame
#

hm?

sullen sigil
#

use this

stray flame
#

right

sullen sigil
#

not this_

stray flame
#

would that fix the multiplayer issue?

little raptor
#

it's already optimal

sullen sigil
#

i have no idea what youre actually running as you seem to be flip flopping between this and _x

#

_x is what should be used with apply

stray flame
#

_x is used on a script,

this_ is used in a object init

weary smelt
gloomy spear
sullen sigil
stray flame
#

okay

sullen sigil
gloomy spear
#

yes

sullen sigil
#

because the planks wouldnt be on their side in zeus if you got rid of the vectordirandup part

little raptor
gloomy spear
#

they are on their side, they still just wont go to where to need to go

sullen sigil
#

are they attached

stray flame
#

if I change all the this_ to this, can I expect any actual improvement on my issues? as thus far ive not seen a difference between the 2 thises

gloomy spear
#

yes

sullen sigil
#

right so its a problem with zeus spawning

weary smelt
sullen sigil
#

likely due to the fact zeus compositions try to spawn everything on the ground iirc

weary smelt
#

At any rate, ty for your help

stray flame
#

discord is being really weird

gloomy spear
stray flame
#

no it just wouldnt let me write this_ for some reason

gloomy spear
#

oh damn, my discord just decides to restart every minute

sullen sigil
gloomy spear
#

alright

sullen sigil
#

then use

_myplank setPosASL (_truck modelToWorldWorld [thecoordinatesyougotbefore]);
//your attaching command here``` to position them properly with the zeus composition
gloomy spear
#

x = -1.293 y = -0.619 z = 2.297

stray flame
sullen sigil
stray flame
#

because regardless of it this_ was written improperly, it still applied to this

sullen sigil
#

probably the _ after causing problems but it really shouldn't do

stray flame
#

okay, beyond that

stray flame
sullen sigil
#

its a local function

stray flame
#

gotcha

stray flame
#

but I dont intend to remoteexec every single object individually with this command

gloomy spear
#

happening*

sullen sigil
#

that runs for every person when they join if its a call

#

ignore me before with performance issues i was thinking of remoteexec as ive been dealing with stupid people using that when they dont need to

stray flame
#

alright, I will try to get to writing that then

sullen sigil
gloomy spear
#
_myplank setPosASL (_truck modelToWorldWorld [-1.293, -0.619, 2.297]);
private _truck = (getPosASL this) nearestObject "B_Truck_01_flatbed_F";
[this, _truck] call BIS_fnc_attachToRelative;
stray flame
#

alright

sullen sigil
gloomy spear
#

ah

#

right

sullen sigil
#

do you have script errors turned off?

gloomy spear
#

you make a good point

gloomy spear
sullen sigil
#

you also dont define _plank there

#

replace that with this

sullen sigil
gloomy spear
#

this is not where it is in the editor

sullen sigil
#

yes thats because you didnt set the hemtt to be 0 height

#

wait no

#

3den measures height above terrain not sea level mb

#

one moment

gloomy spear
#

no worries

sullen sigil
#

ok take 5 from the z coordinate

gloomy spear
#

its late for me, im barely here myself lol

#

so -3?

sullen sigil
gloomy spear
#

well im not 100% sure but i am pretty sure that the reason i can no longer see the plank is because its under the map

sullen sigil
#

uhhhhhh ffs

#

one moment then

gloomy spear
#

youre good

sullen sigil
#
private _truck = (getPosASL this) nearestObject "B_Truck_01_flatbed_F";
this setPos (_truck modelToWorld [-1.293, -0.619, 2.297]);
[this, _truck] call BIS_fnc_attachToRelative;```
#

try that copy pasted

#

plank init

gloomy spear
#

magical experience lol

#

hold on i think i might know a trick to get the coordinates

sullen sigil
#

that trick should've been the trick notlikemeowcry

#

try take like 1m off the coordinate height until you get something you like i have no idea why its not working and thats probably the simplest way

#

if you want to get the height properly you can put it over the pond in the top right and do the same trick there just for up and down

gloomy spear
#
truck worldToModel getPosATL plank;
[plank, truck] call BIS_fnc_vectorDirAndUpRelative;
#

using this i should get the coords

sullen sigil
#

getPos not getPosATL but on vr terrain makes no difference

#

but probably yes

#

im quite tired right now my own code isnt working properly even though it should be

gloomy spear
#

[-1.21997,-0.699878,-0.308341]
[[4.09273e-012,1,-2.79397e-009],[1,4.09273e-012,-4.38325e-008]]

[-1.32996,-0.699879,-0.308341]
[[4.09273e-012,1,-2.79397e-009],[1,4.09273e-012,-4.38325e-008]]

[-1.42993,-0.69988,-0.308342]
[[4.09273e-012,1,-2.79397e-009],[1,4.09273e-012,-4.38325e-008]]

#

done it for all three planks

sullen sigil
#

just to confirm truck isnt the box on the back of it right

gloomy spear
#

yes!!! its the truck

sullen sigil
#

bruh moment

#

oh my god

#

that'll be why it was being dumb

#

what

#

youre confusing me

#

hang on

gloomy spear
#

sorry im tired

sullen sigil
#

ill test myself

#

this might just be a vanilla hemtt moment

gloomy spear
#

the HEMT is named "truck"and the three planks are named "plank1" "plank2" and "plank3"

sullen sigil
#
systemChat "balls";
systemChat str (getPosASL this);
systemChat str (this modelToWorldWorld [0,0,0]);```
just *doesn't run* on the hemtt when in its init field ![notlikemeowcry](https://cdn.discordapp.com/emojis/724201124369793068.webp?size=128 "notlikemeowcry")
gloomy spear
#

do i just copy and paste?

sullen sigil
#

the coordinates that you got yeah use those as setPos worldToModel (coordinates here) and vdirandup

sullen sigil
#

think I'm not understanding how models work or something there but in my head they should both be the same

meager granite
sullen sigil
#

I will print this out and frame it

#

in altis we trust

meager granite
#

Needs some color correction first

#

I tried to magic wand select the water in photoshop but its so tiresome, often includes sandy beaches in it, can't do that properly manually

#

Might have to do per pixel height check in game and generate mask off that to color the water

sullen sigil
#

i would offer to try edit but i dont think paint.net would be able to handle it

meager granite
#

Dont bother, generating mask from in-game height data will produce accurate result without manual labour.

#

Though I don't care anymore, abandoned the idea for its usage.

#

Also had an idea to use actual sat textures in game instead of assembling it outside of the game into a big texture.

frank mango
#

Thats a road, a beach and the water.

#

It's very very faint to work out what is what from here.

#

and the wand regards it as one thing.

meager granite
#

Yeah, its useless to do that manually, better to just generate a mask off actual height data

frank mango
#

^Just reinforcing that, literally no point trying on that download!

#

But, if you want a map, without proper colours. its good.

meager granite
#

Didn't bother to correct it with a proper heightmap mask.

meager granite
#

ctrlSetScale on RscControlsGroup doesn't scale controls inside it thronking

ivory locust
#

Why isn't getMissionLayerEntities working

#

I'm using strings that are present in getMissionLayers and it's returning empty for every layer

winter rose
#

To be used when the scenario is running, not in the editor workspace.

kindred zephyr
#

Good evening/morning/ afternoon everyone.

Particles created using particle emmiters have limitations?

I was wondering that since it looks like some particles behave weirdly when using billboard against spaceobject and viceversa, same when trying to apply colors to some of the particle types, it looks like some particles like sparks have force colorations?

kindred zephyr
mortal saffron
#

Could someone help with the following addaction on an object, calling a script. Was working in MP in the editor:

#

if (local own) then { [this, ["Release Black K9",{execVM "scripts\BlackK9script.sqf";},nil,1.5,true,false,"","",3,false,""]] remoteExec ["addAction",0,this]; };

#

"own" is the name of my unit who id like to be able to call the addAction, only

ivory locust
ivory locust
vast wharf
#

Alright question: you know how in the showcase mission for the Art DLC, a helicopter lands exactly in the middle of a smoke grenade, and doesnt take off immediately?
How do I do that? Because AI will instantly take off after landing on smoke for some reason

abstract gorge
#

class CfgSentences
{
class ConversationsAtBase
{
class Briefing
{
file = "brief.bikb";
#include "brief.bikb"
};
};
class ConversationsAtObjective
{
class Complete
{
file = "objective1.bikb";
#include "objective1.bikb"
};
};
class ConversationsAtObjective2
{
class Complete2
{
file = "objective2.bikb";
#include "objective2.bikb"
};
};
class VisualContact
{
class SquadChatter
{
file = "eyesoncamp1.bikb";
#include "eyesoncamp1.bikb"
};
};
};

Can any body possibly tell me why this wouldn't work? when i go to activate the third script under squadchatter, i get a no entry cfgsentences SquadChatter error. Been pulling my hair out, its just the same as the top portion but extended i thought correctly.

modern meteor
#

After spawning the crew of a vehicle, how can I set their audibleCoef and camouflageCoef?

modern meteor
#

Never mind, it's working now.

drifting portal
# meager granite Display will init at uncertain time, `findDisplay` will not work on same or even...
[] spawn {


    TestCam = "camera" camCreate [1494.88,5775.99,1.594];
    TestCam cameraEffect ['Internal', 'Back', 'ui2t_r2t_test'];

    laptop setObjectTextureGlobal [0,'#(rgb,1024,1024,1)ui("RscDisplayEmpty","ui2t_display_test")'];

    sleep 5;

    with uiNamespace do {
        
        _display = (findDisplay "ui2t_display_test");

        _picture = _display ctrlCreate ["RscPicture", 1201];
        _picture ctrlSetText "#(argb,512,512,1)r2t(ui2t_r2t_test,1)";
        _picture ctrlSetPosition [0.27852 * safezoneW + safezoneX, 0.357 * safezoneH + safezoneY, 0.309042 * safezoneW, 0.341 * safezoneH];
        _picture ctrlEnable false;
        _picture ctrlCommit 0;

        displayUpdate _display;

    };


};

Tried this one, (findDisplay "ui2t_display_test"); returns Display #-1, still can't see the RscPicture on the UI to Texture.

#

Does Display #-1 mean I can't edit it? not really sure (findDisplay "ui2t_display_test") displayCtrl 1201 returns Control #1201

meager granite
#

Basically:

ui2texture triggers r2t render, but this happens after ui2texture already finished drawing the display

#

Twice as in again on next frame

proven charm
#

I'm trying to save unit loadout to config but I don't know which syntax is allowed. then I ended up something weird, the config variable is without quotes but it can still be read as string (getText). I mean this: ```startingLoadoutWest = [[],[],[],["U_B_HeliPilotCoveralls",[["FirstAidKit",1]]],["V_DeckCrew_yellow_F",[]],[],"H_HelmetCrew_B","",[],["ItemMap","ItemGPS","ItemRadio","ItemCompass","ItemWatch",""]];

meager granite
# drifting portal ```sqf [] spawn { TestCam = "camera" camCreate [1494.88,5775.99,1.594]; ...
[] spawn {
    TestCam = "camera" camCreate [1494.88,5775.99,1.594];
    TestCam cameraEffect ['Internal', 'Back', 'ui2t_r2t_test'];

    laptop setObjectTextureGlobal [0,'#(rgb,1024,1024,1)ui("RscDisplayEmpty","ui2t_display_test")'];

    sleep 5;

    with uiNamespace do {
        _display = (findDisplay "ui2t_display_test");

        _picture = _display ctrlCreate ["RscPicture", 1201];
        _picture ctrlSetText "#(argb,512,512,1)r2t(ui2t_r2t_test,1)";
        _picture ctrlSetPosition [0.27852 * safezoneW + safezoneX, 0.357 * safezoneH + safezoneY, 0.309042 * safezoneW, 0.341 * safezoneH];
        _picture ctrlEnable false;
        _picture ctrlCommit 0;

        _test = _display ctrlCreate ["RscText", -1];
        _test ctrlSetPosition [0,0,1,1];
        _test ctrlSetFontHeight 0.1;
        _test ctrlSetText "It works!";
        _test ctrlCommit 0;

        displayUpdate _display;
        onEachFrame {
            displayUpdate (findDisplay "ui2t_display_test");
            onEachFrame {};
        };
    };
};
#

Modified your script

#

If you'll remove that onEachFrame bit, you'll only see "It works" text

#

Alternatively you can try display that r2t somewhere on UI so texture loads, then by the time ui2texture display renders the texture is ready

#

ui2textures are pain in the ass to use unfortunately

#

Full laptop screen for u2t is [0,0,883/1024,1] btw

pulsar bluff
#

ill let you guys do the r&d and ill come in the 2nd wave once u know what works and whats broken 😂

meager granite
pulsar bluff
#

jks i probably wont use ui texture ever

#

does it work on control objects, like ctrlmodel

meager granite
#

Didn't try, I bet it does

pulsar bluff
#

you are trying a pretty gimmicky thing though, like a map on a billboard. something simpler like a menu on a billboard would probably be less glitchy

#

a simple text box vs a map control

meager granite
#

You likely can render any complex UI into a texture and then have it inside control object, iirc controls inside objects were very limited in how they work.

pulsar bluff
#

if i try anything, it will be to first put the escape menu onto a texture

meager granite
#

Now control object only has to display RscPicture which draws ui2texture texture

#

You can make modern shooters 3D UIs, have it wiggle as you run, etc.

pulsar bluff
#

actually i need to learn how to script “wiggle”

#

i have a 3d model on screen but it looks 2d cause no wiggle

meager granite
#

Have it move a bit with camera movement or rotation

#

Take velocity or position delta distance, % modulo it and then feed into sin for a smoother movement, something like that

modern meteor
#

How can i spawn a flying object at a certain height (800m) via script?

hallow mortar
#

createVehicle

modern meteor
#

Thanks, I am trying to spawn it 800m above the player

drifting portal
drifting portal
#

so you are telling me you found this fix by trial and error or you already knew the behaviour beforehand? (just curious)

#

also I should not forget to thank you

meager granite
#

Both expecting how engine works and trial and error

#

ui2texture requires plenty of preloading and frame by frame fuckery to work reliably

drifting portal
#

damn and I just thought I would use ui to texture to revolutionise my scripts

meager granite
#

Make a function that preloads images by demand, have some control outside of visible screen and set pictures that you want to preload there

drifting portal
meager granite
#

Some kind of delay is needed

#

That u2t display only inits after the engine tries to render the texture, which happens after unknown amount of frames after you set the u2t texture.

#

What I mean by unknown is that if you set it to an object that's outside of your view distance, display won't init until your camera is close enough so object tries to draw that procedural texture

#

Solution: Make your own display which calls your function with onLoad event handler.

#

So you don't have to sleep or guess anything

#

Sending arguments into u2t displays can be done through global variables

#

description.ext:

class MyU2T {
  onLoad = "call myUI2TextureOnLoadFunction";
  ...
}
```Scripts:
```sqf
myUI2TextureOnLoadFunction = {
    params ["_display"];
    private _my_name = displayUniqueName _display; //Will be ui2t_display_test in your case
};
#

There is a bug with u2t always rendering in 1:1 regardless of actual texture resolution, you'll need to have ui2texture inside ui2texture to overcome that

#

This is going to need more frame by frame and preloading mess because inner u2t displays try to access non-0 mipmaps of textures displayed in them for some reason

drifting portal
#

now I'm scared of using u2t

meager granite
#

This is my ticket regarding mipmaps, repro can be used as an example of how to bypass non-1:1 aspect ratio limitation by using u2t inside u2t

#

The general fix for mipmap errors is to preload all textures on UI beforehand

drifting portal
#

Probably I'm not understanding how calling this function can cause the engine to initialise the u2t?

meager granite
#
  1. You apply your u2t somewhere
  2. Once engine decides to draw it (after unknown amount of time), it will create display and call this event handler
#

You don't have to sleep or check if each frame

#

Then from there you can work with controls inside u2t display

modern meteor
# hallow mortar `createVehicle`

Still struggling to spawn an object 800m above the player. This is the code I have so far:

hawkeye = createVehicle ["B_UAV_02_dynamicLoadout_F", getPosWorld player, [], 0, "FLY"];
_grp = createVehicleCrew hawkeye;
_wp = _grp addwaypoint [getPosWorld player, -1];
_wp setWaypointType "LOITER";
_wp setWaypointLoiterRadius 50;

But how can I set the heights above the player?

hallow mortar
#

(getPosWorld player) vectorAdd [0,0,800]
Note that the "FLY" mode creates the vehicle at a default height. You should instead use the "NONE" or "CAN_COLLIDE" mode, and give the vehicle a starting speed boost with setVelocity.

drifting portal
proven charm
fluid wolf
#

Man I hate Remoteexec... can someone help me figure out what's wrong with

["dropships1", true, 0] remoteExec ["playsound", 0];```
proven charm
#

that runs the sound on server too which isnt good

fluid wolf
#

well currently it doesn't run the sound at all

#

ATM I am the server so I need it to play to the server so I can test it first, then I'll run it on -2

proven charm
#

have u tried that the sound plays at all?

#

in client

fluid wolf
#

yes, I can get it running using just playsound but something in how I've written it there seems to be busting it...

#

I needed an extra set of Brackets, found it.

#
[["dropships1", true, 0]] remoteExec ["playsound", 0];```
#

Man remoteexec gives me a headache

cosmic lichen
hallow mortar
#

It's because remoteExec is [leftArg,rightArg], and for playSound you need to send just the right argument, which is an array itself. Your first try was being interpreted as [leftArg,rightArg,thirdArg], which doesn't make any sense.

fluid wolf
#

Ahhhh ok. I get it now. Thanks

meager granite
proven charm
meager granite
#

key = "value";?

proven charm
#

yes

meager granite
#

key = "value ""quotes"" string";

proven charm
#

i had problem putting str (getunitloadout player) in to the config

#

so i did (str (getunitloadout player)) regexReplace ['"', "'"]

#

to get a proper string

meager granite
#

str str getUnitLoadout player

#

another str doubles the quotes

proven charm
#

oh

meager granite
#

str getUnitLoadout player:

[["arifle_MX_GL_F","","","",["30Rnd_65x39_caseless_mag",30],["3Rnd_HE_Grenade_shell",3],""],...
````str str getUnitLoadout player`:

"[[""arifle_MX_GL_F"","""","""","""",[""30Rnd_65x39_caseless_mag"",30],[""3Rnd_HE_Grenade_shell"",3],""""],..."

proven charm
#

that's a lot of quotes 😯

#

i think I prefer this for now "[['arifle_MXC_F','','','',['30Rnd_65x39_caseless_mag',30],[],''],[],['hgun_P07_F','','','',['16Rnd_9x21_Mag',16],[],''],['U_B_CombatUniform_mcam_vest',[['FirstAidKit',1],['30Rnd_65x39_caseless_mag',2,30],['Chemlight_green',1,1]]],['V_BandollierB_rgr',[['30Rnd_65x39_caseless_mag',3,30],['16Rnd_9x21_Mag',2,16],['HandGrenade',2,1],['SmokeShell',1,1],['SmokeShellGreen',1,1],['Chemlight_green',1,1]]],[],'H_HelmetCrew_B','',[],['ItemMap','','ItemRadio','ItemCompass','ItemWatch','NVGoggles']]"

meager granite
#

Will work until you'll have some string with ' in it

#

Just let the engine handle it

hallow mortar
#

I don't think item classnames can have ' in them

proven charm
#

hmm well its for loadouts only

meager granite
#

Well, up to you

proven charm
#

what was interesting to me (dont know if its feature or not) was that this formed a valid string: startingLoadoutWest = [[],[],[],["U_B_HeliPilotCoveralls",[["FirstAidKit",1]]],["V_DeckCrew_yellow_F",[]],[],"H_HelmetCrew_B","",[],["ItemMap","ItemGPS","ItemRadio","ItemCompass","ItemWatch",""]];

#

notice there is no start or end quotes

meager granite
#

Formed where?

proven charm
#

config

#

then getText

meager granite
#

Where do you output your config to?

proven charm
#

the debug console..

meager granite
#

What did you execute there?

proven charm
#

just getText

meager granite
#

Strings always appear with quotes in debug console output, you probably did something else

proven charm
#

dunno this is what I did ```loadouttest = [["arifle_MX_ACO_pointer_F","","acc_pointer_IR","optic_Aco",["30Rnd_65x39_caseless_mag",30],[],""],[],["hgun_P07_F","","","",["16Rnd_9x21_Mag",16],[],""],["U_B_CombatUniform_mcam_tshirt",[["FirstAidKit",1],["30Rnd_65x39_caseless_mag",2,30],["Chemlight_green",1,1]]],["V_Chestrig_rgr",[["30Rnd_65x39_caseless_mag",5,30],["16Rnd_9x21_Mag",2,16],["HandGrenade",2,1],["B_IR_Grenade",2,1],["SmokeShell",1,1],["SmokeShellGreen",1,1],["Chemlight_green",1,1]]],["B_Carryall_mcamo_AAA",[["Titan_AA",3,1]]],"H_HelmetB_light","",["Rangefinder","","","",[],[],""],["ItemMap","","ItemRadio","ItemCompass","ItemWatch","NVGoggles"]];

#

in console: player setunitloadout (parsesimplearray (gettext (missionconfigfile >> "loadouttest")))

winter rose
#

doesn't setUnitLoadout take config?

south swan
#

Syntax 1 of setUnitLoadout takes an array. Syntax 3 takes config classname from CfgVehicles, Syntax 4 takes config blobdoggoshruggoogly

hallow mortar
#

That's kind of a weird way of putting it into config though. Normally you'd lay it out as a class loadouttest { ... structure, rather than that variable-style loadouttest = [array]. I'm sort of surprised it (apparently) works.

proven charm
#

loadouttest is string, thats the point

#

atleast thats what getText returns

hallow mortar
#

Yes but why do this, when you could use the much more readable actual config class structure and not need to worry about all this getText stuff

proven charm
#

you mean for the setUnitLoadout ?

hallow mortar
south swan
#

linking non-standard optics, for example, doesn't look easy with setUnitLoadout config blobdoggoshruggoogly

proven charm
#

right. its because I prefer the copy-paste solution. putting it in class maybe tricky to some modders

winter rose
#

tanking the operation's perf and disallowing other systems from accessing a somewhat known data structure

#

(and potentially breaking your description.ext in the process, mind you)

little raptor
#

See BIS_fnc_unitCapture

little raptor
#

getPosASL uses the land contact pos

sullen sigil
#

ah -- i assume in the model the suspension or something means the hemtt is further up?

little raptor
#

[0,0,0] is the center of the model
Obviously the land contact of land vehicles is their wheels (if they're upright ofc)

#

Which is below the center

sullen sigil
#

oh i thought the center referred to erm

#

the icon bit in 3den

#

dont know why

#

probably my half past midnight brain

little raptor
sullen sigil
#

the what

#

oh the axis movement thingy

little raptor
#

Press 2 or 3 meowsweats

little raptor
sullen sigil
#

ditto for rotation 🤷

lethal dew
#

any ideas on how to slow down each for a certain job explicitly created vehicle, on entering a specific location, without much boilerplate, anyone?

manic sigil
#

Question's a bit unclear; what exactly are you trying to achieve?

lethal dew
#

Basically this (not tested yet, but you might get the idea)...

FDM_scheduleRegularSpeedlimitCheckAtLocationForVehicle = {
    params["_vehicle", "_locationReferencePoint" /*OR JUST LOCATION DATATYPE??*/, "_validDistance", "_speedLimit"];

    Discard = [] call FDM_fnc_increaseSpawnedWorkerthreadsCounterValue;

    while { !isNull _vehicle } do {
        Sleep 5;

        _vehicle limitSpeed -1;
        if (_vehicle distance _locationReferencePoint < _validDistance) then {
            _vehicle limitSpeed _speedLimit;
        }
    };

    Discard = [] call FDM_fnc_decreaseSpawnedWorkerthreadsCounterValue;

    FDM_Output = true;
    FDM_Output
};

...which would be spawned along with each created vehicle, the vehicle has to pass n Checkpoints that could be anywhere on the map. This function posted here checks for 1 and only 1 location which is fine to me right now. However, I am seeking to avoid this kind of solution because of several motivations, like keeping spawned (custom) continous logic at the possible bare minimum.

I am fairly unexperienced with SQF itself, so any other idea on a solution that might be better than this did not come up to me yet...

winter rose
sullen sigil
#

daft question but should call not be used with compile inside of it?
nvm i found out the answer straight after you just dont use curly braces

spiral sundial
#

How would I go around to attaching the turret of FV-720 Mora to the hull of a Marshall? I managed to remove the turret from the marshall but I dont know how to remove the hull from the Mora

hallow mortar
#

You can't really

lethal dew
# winter rose for your information, `Discard = [] call`: `Discard =` is useless and can be rem...

At first glance, sure, but this is because I in principal like to avoid writing functions that do not return anything, so I just keep this as a placeholder in case I want to be reported about the ending of a function if otherwise it would just end up quiet. So I try to make sure each of my functions returns at least a boolean, some of them gets "discarded" for now, until I really want to know. Overall that's the idea.

hallow mortar
# hallow mortar You can't really

You might be able to hide the textures for the hull and tracks with setObjectTexture (assuming none of them are shared with turret bits) but it'll still be there, just invisible

hallow mortar
lethal dew
#

Yes you are right, it's just a habit from other languages.

spiral sundial
lethal dew
#

I am a peasant, peasants like habits. At least they say so.

hallow mortar
# spiral sundial How do people make these compositions then? They just hide the hull via the text...

They hide the hull by making the textures invisible, and it works out OK because the Rhino hull is about the same size as the Marshall hull, so it's close enough to completely inside it. (You can see the shadows on the sides where it clips through a little bit) The Mora hull, I think, is slightly wider, so you'll have those bits of Mora hull hanging out the sides where they can be shot or bump into things. You can check the size to be sure, though.

sullen sigil
#

setObjectScale and have a tiny turret notlikemeowcry

spiral sundial
#

and create a landship

#

tiny gun somehow still firing 120mm shells

#

I really need to learn some scripting because I love creating compositions

sullen sigil
#

step 1 of learning to script is learn how to read the wiki

spiral sundial
lethal dew
#

I am pointing at you because I remember you had a good idea in the past already 🙂

#

How about writing custom events, is that even possible?

winter rose
sullen sigil
#

for worldToModel to later be used to modelToWorldWorld I should be using ASL position in the first instance right?

#

oh im having pea brain it should be setposworld

#

but thats also not solving my problems thonk

sullen sigil
#

_createdObject setPosWorld (_shipHelperObject modelToWorldWorld (getArray (_partsConfigPath >> _iteratedClass >> _x >> "position"))); //Set object position.
where position is attained from_shipHelperObject worldToModel ASLtoAGL getPosASL _createdObject thonk

winter rose
lethal dew
#

Would you show me the part where it tells how to create own custom events?

winter rose
#

which should be renamed Related Functions btw

sullen sigil
#
[missionNamespace, "myfancyeventname", {systemChat "hi everyone";}] call BIS_fnc_addScriptedEventHandler;
[missionNamespace, "myfancyeventname", [myarguments]] call BIS_fnc_callScriptedEventHandler;
//systemchats hi everyone
#

dont need to use missionnamespace either

lethal dew
#

What do you mean exactly by "myfancyeventname" ?

sullen sigil
#

the name of your event

#

like the default bi ones

#

"Fired" and so on

#

just prefix them with your tag

#

so "maxron_blewselfup"

lethal dew
#

How do I create one like "Fired" and register it?

sullen sigil
#

the first function

#

you dont need to "create" one you just call one with a name

#

so (it doesnt) but in the backend the game will have
[missionNamespace, "Fired", [/*whatever the args are*/]] call BIS_fnc_callScriptedEventHandler;

#

for all intents and purposes

#

and that will make all the added event handlers of type "Fired" run their code

winter rose
#

you can't have a "onUnitPutLeftFootDown" out of the box
you can script an event and trigger it, yourself, on your conditions ↑

lethal dew
#

I am afraid I don't get it. Can you show me an example please?

sullen sigil
#

so if i want to do something and then have an event that happens when that thing is done it'd be something like erm

player action ["SwitchWeapon", player, player, 299];
[missionNamespace, "KJW_SwitchedWeapon", [myarguments]] call BIS_fnc_callScriptedEventHandler;```
and then elsewhere in an object's init
```sqf
[this, "KJW_SwitchedWeapon", {this setDamage 1;}] call BIS_fnc_addScriptedEventHandler;```
hallow mortar
#

BIS_fnc_addScriptedEventHandler creates a "listener", which listens for mentions of the name you give the event.
BIS_fnc_callScriptedEventHandler is what you use to mention the event and activate the listener.

sullen sigil
#

So when the first bit of code is ran the bit in the added handler will run

#

all adding an event handler really does is just shove the code into a list of executions to get ran when the event happens

manic sigil
#

This is why I ask people to elaborate on their intent, tends to lead to better feedback :p

lethal dew
#

Understood, thank you everyone.

#

Only that's the exact same way of logic to handle my outlined problem I outlined already. Any further ideas much appreciated.

sullen sigil
#

what is the problem

lethal dew
#

To reduce code

sullen sigil
#

what

lethal dew
#
    while { !isNull _vehicle } do {
        Sleep 5;

        _vehicle limitSpeed -1;
        if (_vehicle distance _locationReferencePoint < _validDistance) then {
            _vehicle limitSpeed _speedLimit;
        }
    };

My basic question was if there is a better builtin solution or not?

sullen sigil
#

erm
trigger areas?
_x limitSpeed -1 in a foreach of all vehicles in thislist

lethal dew
#

Only at runtime spawned vehicles and of them only specific ones.

sullen sigil
#

set variable -> check variable

#
{
  if (_x getVariable ["MySpecialCarVariable", "Default"] isEqualTo "butts") then {
    _x limitSpeed -1;
  else {
    systemChat "something";
  };
} forEach /*your array of things here*/```
spiral sundial
#

Is there a way to reduce opacity when using this setObjectTextureGlobal [0, "#(rgb,8,8,3)color(0.3,0.3,0.3,0.1)"]; ?
I know the "0.1" stands for opacity, but it doesn't seem to be working. Changing the value simply makes the colour darker or lighter, not more or less opaque. A higher value makes it white, a lower value makes it black. How could I reduce the opacity to let more of the original texture show through?

sullen sigil
#

rgba not rgb

spiral sundial
#

It just removes the color and keeps the original texture

#

while on another vehicle it says couldn't load texture

sullen sigil
#

model may not be set up to accept transparency then

#

i believe

spiral sundial
#

I'm just using vanilla quad bike and a zamak

sullen sigil
#

then probably isnt set up for transparency

tough abyss
#

where Do I execute the "setTimeMultiplier" command while in game?

sullen sigil
#

debug console

#

well
anywhere as you can see on the wiki

tough abyss
#

ah ight

#

is this correct "setTimeMultiplier 2" but i did "local exec" and its not workign for some reason

sullen sigil
#

look at your watch

tough abyss
#

k will do

#

time has been stopped this is good i think but lemme see will the Ai move or do stuff cuz thats what im trying to stop

#

ye ai still moves around and does stuff

#

k i figured it out

#

ty for help

manic sigil
#

Yeah, not really going to stop the AI. Though I'm wondering if you can mass enableSimulation pause and unpause the AI without issues...

sullen sigil
#

would make the zeus spawned units have simulation unless you ran it frequently

#

which erm
dont

winter rose
#

you could "pause" game in MP withsqf { _x enableSimulationGlobal false } forEach (call BIS_fnc_listPlayers); and "unpause" with```sqf
{ _x enableSimulationGlobal true } forEach (call BIS_fnc_listPlayers);

sullen sigil
#

allUnits no?

winter rose
tough abyss
#

hmm

sullen sigil
#

HC is an agent isnt it?

winter rose
#

headless client

sullen sigil
#

if not just a simple hasinterface check

winter rose
#

also don't forget virtual slots like spectator

sullen sigil
#

i dont believe in those

winter rose
#

amma make you 🔨

sullen sigil
#

spectating is for cowards

#

real people engage in WAR!

winter rose
#

real people avoid war, unless it is in game

sullen sigil
#

sidenote:

private _thisisaposition = logichelper worldToModel ASLToAGL getPosASL rayshield;
private _thisisanotherposition = logichelper modelToWorldWorld _thisisaposition;
private _thisistheproperposition = getPosASL rayshield;
[_thisisaposition, _thisisanotherposition, _thisistheproperposition]``` returns an array with the last two positions being the same. that's good. however when i take the first array and put it into a config and then use
```sqf
_createdObject setPosASL (_shipHelperObject modelToWorldWorld (getArray (_partsConfigPath >> _iteratedClass >> _x >> "position")));```
inside a foreach of config classes (basically just creates an object and sets it to that position), it puts it on a completely random arse position relative to the model
sullen sigil
winter rose
#

he's avoided my trap… he's good

sullen sigil
#

position[] = {132.993,86.5781,-41.131}; //Model coordinates in ASL. object worldToModel getPosASL thisobject. and systemchat confirms it

#

confirmed that the vectordirandup and so on of the spawned model is identical to the one that i did even though that shouldnt matter and it is

winter rose
#

worldToModelVisual perhaps, but especially you worldToModel an AGL pos

#

make temp vars when in doubt

#

wait, no
that is ok

#

OK, my attention span is below 10s now.

sullen sigil
#

its very confusing I've 0 clue why it's doing this notlikemeowcry

winter rose
#
//Model coordinates in ASL. object worldToModel getPosASL thisobject
```yeah that's not that
#

(also your transparency s****s 😛)

winter rose
sullen sigil
spiral sundial
#

I found this interesting command from a composition.

[this,[0,"\a3\supplies_f_enoch\ammoboxes\data\ammobox_eaf_co.paa"]] remoteExec ["setObjectTexture",0,this];

This makes the respective vehicle a greenish color with some texture to it.
I assume that this command works much like the color-changing command I mentioned above, but instead of a color, it uses the texture of an item, specifically an ammo box.
Is there a way I could find the name of such textures to apply them to other vehicles? It seems like a great idea to bypass the flat aesthetic of using RGB, since textures come with, well, texture (dirt, scratches etc).

sullen sigil
#

so ignore that note im using logichelper worldToModel (ASLToAGL (getPosASL rayshield))

hallow mortar
sullen sigil
#

is that better

winter rose
#

make
temp
vars

and debug them to check the difference

sullen sigil
#

i have
its the same

#

its getting the right array from the config -> its applying it to the right model -> its doing the wrong thing

winter rose
#

setPosWorld ← setPosWORLD

#

in "_createdObject setPosASL"

sullen sigil
#

already tried

#

same thing

winter rose
#

then IDK, your system is cursed and you should play Squad

sullen sigil
#

it's outright on the wrong side of the model

#

in every axis

spiral sundial
#

How can I get the texture path of an object? (not vehicle)

sullen sigil
#

but not even by the correct amount notlikemeowcry

sullen sigil
sullen sigil
#

oh yeah i forgot that exists

spiral sundial
#

the wiki is like reading alien language

sullen sigil
#

it tells you

#

give it an object

#

it will return the textures

spiral sundial
#

Where do I write this?

#

object's nit?

#

init*

sullen sigil
#

debug console it assuming you want to note down the paths

#

or just use config viewer if you dont want to script

spiral sundial
#

The what now

#

I had no idea a 'config viewer' existed

sullen sigil
#

you have a find in config viewer button appear on everything you right click in 3den notlikemeowcry

spiral sundial
#

getObjectTextures Box_T_East_Ammo_F is what I typed... doesnt seem to do anything

sullen sigil
#

thats the classname not the variable name

sullen sigil
# sullen sigil sidenote: ```sqf private _thisisaposition = logichelper worldToModel ASLToAGL ge...
private _alpha = logichelper worldToModel ASLToAGL getPosASL rayshield;
private _bravo = logichelper modelToWorldWorld _alpha;
private _charlie = getPosASL rayshield;

private _delta = (logichelper modelToWorldWorld (getArray (configFile >> "CfgKJWCapitalShips" >> "Venator" >> "shipParts" >> "weakPoints" >> "sideShield" >> "position")));

[_alpha, _bravo, _charlie, _delta]``` returns `[[132.993,86.5781,-41.131],[4525.25,1123.88,77.119],[4525.25,1123.88,77.119],[4525.25,1123.88,77.119]]`. 
`logichelper` is replaced with a vehicle of the exact same class with the exact same vectordirandup and position asl ![notlikemeowcry](https://cdn.discordapp.com/emojis/724201124369793068.webp?size=128 "notlikemeowcry")
winter rose
sullen sigil
#

i'll change them to single letter ones in a moment

winter rose
winter rose
sullen sigil
#

there is that better for you lou

spiral sundial
#

But the writing / other details of the texture are there

#

so it was applied

sullen sigil
#

show what youre trying to apply

winter rose
#

^

spiral sundial
#

I need to upload pics to a website and send links

sullen sigil
#

you can upload here

#

oh no you cant

spiral sundial
#

No way I've been sending links for like more than a year

#

I am getting the texture of this

spiral sundial
sullen sigil
#

fucking discord update

sullen sigil
#

of course it wont

#

thats not how textures work

spiral sundial
#

Because I have a composition from steam which does the exact same thing successfully

spiral sundial
# spiral sundial

for "_i" from 0 to 3 do
{
[this,[_i,"\a3\supplies_f_enoch\ammoboxes\data\ammobox_eaf_co.paa"]] remoteExec ["setObjectTexture",0,this];
};

sullen sigil
#

yeah
its a different box with a different texture on a different vehicle

#

(And sets the texture quite poorly)

spiral sundial
#

I am trying to modify texture / colour of a bunch of vehicles

#

to create a faction

sullen sigil
#

theres 10 better ways to do that

#

starting with just retexturing them properly

spiral sundial
#

Applying a texture seems to be the more detailed option, while using RGB gives a very flat result

sullen sigil
#

alternatively you can use the uiontexture bits added in 2.12 to recolour tetures iirc

sullen sigil
#

Not a recommended method of doing this though

spiral sundial
#

The thing is I want to make it a composition instead of a mod, so changing the actual textures is something im trying to avoid

#

Since I am trying to keep it fully vanilla

sullen sigil
#

what you are trying to do is not possible aside from uiontexture stuff

spiral sundial
#

I just wish I could use RGBA instead of RGB. It would solve everything

#

all I need is to let some of the original texture show through for detail

sullen sigil
#

no that would make the textures slightly see through

#

use the wiki link i sent you

spiral sundial
sullen sigil
#

the linked part i sent you

spiral sundial
#

Cause this is what I was already using

sullen sigil
#

no its not

#

oh

#

that bit is

#

but the part i sent you isnt

spiral sundial
#

UI on Texture?

sullen sigil
#

yes that is the part i sent you

spiral sundial
#

I dont get how it works

#

renders a UI display?

sullen sigil
#

on the texture

spiral sundial
#

whats a UI display

sullen sigil
#

anything you like

#

including a slightly translucent pink

spiral sundial
#

yea idk what any of this means

#

How do I turn this into a color..

sullen sigil
#

that is a colour

spiral sundial
#

Which part

sullen sigil
#

the rgb bit

spiral sundial
#

Yea but where do you set the values?

zinc edge
#

The numbers after rgb i believe

spiral sundial
#

RGB values go from 0 to 1

#

so it can't be 1024

sullen sigil
#

setObjectTexture

spiral sundial
#

thats resolution

sullen sigil
#

thats the menu screen on a plane

#

all you need is a black ui element

spiral sundial
sullen sigil
#

yeah because its not translucent hmmyes

#

use a translucent ui element and you can change the colours of it

spiral sundial
#

I've got no clue how to do that or what to even type

#

I am parallel with programming or scripting

#

what even is a translucent ui element

#

and where do I find it

sullen sigil
#

a ui element that is translucent

#

and you make it

spiral sundial
#

well how

spiral sundial
#

Yea idk, this is beyond me

sullen sigil
#

like i said, the best way is properly retexturing them

spiral sundial
#

I need to install like 2 or 3 new programs just to change a texture

sullen sigil
#
_myobj setObjectTexture [0, "#(rgb,1,1,1)text(0,0,""Caveat"",0.3,""#13534018"",""#ff0000"","""")"];```
#

use the wiki example for text on texture

spiral sundial
#

Do I copy paste this into init?

sullen sigil
#

no you use this not _myobj in an init

winter rose
sullen sigil
winter rose
#

@spiral sundial don't use that.

spiral sundial
#

This looks the exact same as RGB command I was already using just more complex to write

sullen sigil
#

do use that its the only way to accomplish what he wants to how he wants to

#

what have you written in the init

spiral sundial
sullen sigil
#

no copy paste everything in the init of that

spiral sundial
#

that is everything though isnt it?

sullen sigil
#

you didnt copy paste it

#

open the init

#

ctrl + a ctrl + c then ctrl + v in here

spiral sundial
#

this setObjectTexture [0, "#(rgb,1,1,1)text(0,0,""Caveat"",0.3,""#13534018"",""#ff0000"","""")"];

#

Actually no my bad

#

without the _

#

just "this"

sullen sigil
#

clearly youre retexturing that from elsewhere then if its actually applying

#

_this doesnt work in object init

#

only this

spiral sundial
#

Yeah, thats what I am using

spiral sundial
sullen sigil
#

try it on the black wasp

spiral sundial
#

same thing as on the quad

sullen sigil
#

no thats preserving the texture underneath

winter rose
#

have fun

sullen sigil
#

anything to procrastinate from my broken model coordinates lou

spiral sundial
#

Its not preserving the details

#

like dirt, screws etc

#

which is what I was talking about

sullen sigil
#

it is

spiral sundial
#

Its just a flat colour

hallow mortar
#

It's not preserving the texture underneath. setObjectTexture completely replaces the existing texture.

sullen sigil
#

that is detail

hallow mortar
#

The details you're seeing there are from the secondary texture used to fake 3D stuff on a flat surface.

sullen sigil
#

is it actually

#

omg

spiral sundial
#

Yea its quite the difference

sullen sigil
#

you can use alpha anyways

#

just how you use it ive no clue

spiral sundial
#

I tried with the previous RGB command at the start, but it seems it didn't want to work

sullen sigil
#

you need to use #rrggbbaa

#

wait no

hallow mortar
#

Unfortunately it's not possible to preserve the dirt/etc on most vanilla textures because they're not a separate layer, they're baked into the main texture, which setObjectTexture completely replaces. Some mod/CDLC assets have them as a separate overlay, but vanilla has never used that method.

sullen sigil
#

quaddie setObjectTexture [0, "#(rgb,8,8,3)color(1,0,0,0.1)"]; accomplishes this

#

but yes what nikko said

#

i did tell you this is the worst way to do it

spiral sundial
#

and thats the command I changed "rgb" to "rgba" in

#

unsuccessfully

sullen sigil
#

yeah you dont

#

quad bike doesnt support transparency in the texture

#

most if not all vanilla vehicles are the same

sullen sigil
winter rose
#

then make it so

#

torturing someone else is not going to make it happen

hallow mortar
# sullen sigil is it actually

It's called a normal map. It creates fake bumps in a surface that can catch light and induce shadows, without having to add complexity to the model itself. It only affects lighting and can't be used for colour and real textures.

sullen sigil
sullen sigil
#

TIL

hallow mortar
#

You're also torturing other people by not turning off ping on reply

spiral sundial
#

is there an abnormal map? oldman

sullen sigil
#

there needs to be a default setting

#

i have however made some progress

#

i realised i can just get the model coordinates after its spawned and just ignore the fact it doesnt work how it should do
-132.993,-40.631,86.0781 -- with new method
132.993,86.5781,-41.131 -- with old method thonk

sullen sigil
#

the only difference is the method at which theyre both spawned one is at runtime and the other is createVehicle then setposasl

#

guess im creating an export coordinates function

spiral sundial
#

Interesting...

I tried the RGB values 0.119, 0.119, 0.95

In a photo editing software, its a sandy color. In arma 3 its a light indigo color

#

🤨

#

Oh I see why

#

0.95

#

should be 0.095

sullen sigil
sullen sigil
#

It seems to be the case but it makes no sense to me thonk

#

like
they seemed to get flipped in MODEL space
HOW?!?!

winter rose
#

your model is on the side

#

or
something else

sullen sigil
sullen sigil
#

I have honestly never been so befuddled and bemused

spiral sundial
#

How can I get rid of this MG's stand?

sullen sigil
#

does it have a hiddenselectionstexture for it

spiral sundial
#

Probably

sullen sigil
#

its a yes or no question

spiral sundial
#

Well I dont know how to check

sullen sigil
#

config viewer i told you

spiral sundial
#

Which bit do I look at in config viewer?

sullen sigil
#

hiddenselectionstextures

hallow mortar
#

Rightclick on object > view in config viewer > scroll the main panel until you get to H

spiral sundial
#

This?

sullen sigil
#

ok what are their names

spiral sundial
sullen sigil
#

this setObjectTexture [1,""];

#

run that in init and see if it hides the stand

spiral sundial
sullen sigil
#

do what the error message is telling you about

spiral sundial
#

It hid the machine gun

#

not the stand

sullen sigil
#

try replace 1 for 0

#

but i doubt it

spiral sundial
#

Oh god why does it have parts of the machine gun also

spiral sundial
sullen sigil
#

there you are then

#

thats the best youll be able to get

spiral sundial
#

Guess I'm removing the optic

hallow mortar
#

Why are you doing this hacky sand-coloured texture on the quad bike when there's already a sand-coloured quad bike in the game?

spiral sundial
#

Because I am recolouring multiple vehicles and it would look weird to have a quad bike with a different camo

sullen sigil
#

consistency ig

hallow mortar
#

god if there's one thing I really wish we'd got in Contact, it's a basic green skin for all the CSAT vehicles

sullen sigil
#

mood

frank mango
#

Iirc Real engine does add a woodland version to the vanilla factions

spiral sundial
#

Is there a way to change the color of an object instead of a vehicle?

winter rose
#

same - if they have selections, use them
otherwise no

hallow mortar
#

Objects are just vehicles you can't drive

spiral sundial
#

Well the command from vehicle doesnt work on object

sullen sigil
#

then it probably doesnt allow retexturing for that selection

hallow mortar
#

It does if the object has texture selections configured. This is also true of vehicles, it's just more common for vehicles to have selections.

sullen sigil
#

config viewer is your friend

spiral sundial
#

or I will just have a wooden post

spiral sundial
sullen sigil
#

yeah

#

cant retex it then

spiral sundial
#

God I wish I knew how to do modding

#

it would make things so much easier

#

than having to use tree trunks as machine gun posts

sullen sigil
sullen sigil
#

The game can recognise it's from a config when it's like 3 variables later? notlikemeowcry

#

I've also just made an export function that works fine without needing to flip anything around thonk

winter rose
#

it's just that the game code is written to use Z as the middle value and not the last as in SQF

sullen sigil
#

wait what

#

hang on i think im being pea brain

winter rose
#

basically - flip your values and you're good

sullen sigil
#

i've got a function to export it for me it's chillin now

winter rose
#

coolio

sullen sigil
#

still dont quite understand as the coords were being exported in the same way but im just getting coords after the helper object has been created relative to that instead so

#

means i have to restart 3den for each object which is motivation to not put like 50 on them 🙂

winter rose
#

can't read that sentence

sullen sigil
#

all i did was get the coordinates after i had created the helper object
for some reason that works
but the helper object had the same position and vectordirandup as the one before

#

it also wasn't just flipped z and y it had negatives etc being messed with and so on -- entirely the wrong axis i think. nbd now, solved 🤷

drowsy geyser
#

does anyone know what this errmsg means? i already fixed line 283 and everything is fine but im still getting this msg

cosmic lichen
#

post the description.ext

winter rose
drowsy geyser
#

there was a double , and i removed it, saved it and uploaded the mission again but still the same issue, i test in mp host

granite sky
#

If you upload the thing then someone will probably spot the error within ten seconds.

#

I would guess an array that's missing a comma between entries but parsers often don't trip up at the point you'd expect.

drowsy geyser
#

the whole description.ext?

granite sky
#

I'd recommend just pastebinning the lot as the error might not be close to the parser failure.

#

Often happens when you have a bracket mismatch.

drowsy geyser
#

okay

tender fossil
# drowsy geyser okay
"faceSurvivor2Healthy",
"faceSurvivor2Injured"
"faceSurvivor2Stunned",
``` There's a missing `,` there (line 287 in pastebin)
#

It should be ```"faceSurvivor2Healthy",
"faceSurvivor2Injured",
"faceSurvivor2Stunned",

drowsy geyser
#

omg i looked a million times 😅

#

thank you

tender fossil
#

Np

sullen sigil
#

Is there any difference between
missionNamespace setVariable ["myvarname", 10]; and
myvarname = 10;? thonk

tender fossil
sullen sigil
#

Yeah reason I'm asking is default value of setVariable is pretty useful but wondering if using one over the other is a bad idea

tender fossil
#

Make a function that sets the variable KEKW

sullen sigil
#

KJW_CapitalShips_Ships = if (isNil KJW_CapitalShips_Ships) then {[]} else {KJW_CapitalShips_Ships}; notlikemeow

tender fossil
#

Well, jokes aside, it sounds silly (and often is) but making everything your own function – and actually using those functions everywhere in the code – gives you a centralized point to change the core logic of the function if needed. Though, it's more useful with e.g. statically compiled languages because in that case your code editor/IDE starts nagging instantly if you change the function params' type or count. I have no idea what it does from performance's perspective in SQF if you compile the functions

sullen sigil
#

i have no idea either it'd just be nicer to have
KJW_CapitalShips_Ships = missionNamespace getVariable ["KJW_CapitalShips_Ships",[]]; than that ugly conditional

#

but it doesnt sound like a good idea to me for some reason

tender fossil
sullen sigil
tender fossil
#
["yourVariable", 10] call KJW_setVar;
sullen sigil
#

one function to make a single line of code look nicer 🤔

#

ive done worse things before

#

now this has to be the daftest question I've asked
how do you find what an EH has been added to from within the EH? I'm running _x addEventHandler [...] and unsure how on earth I would find what _x is within the code I'm running

#

yeah so all ehs pass the object theyre assigned to as a parameter hmmyes

ivory locust
#

Working on a quest framework in Intercept, all you have to do is define points of interest in the editor, then define init and helper functions that run at the start, and alongside the quest

sturdy ice
#
mortar_men_1 doArtilleryFire [getmarkerpos "fire_1_1", "vn_mortar_m2_mag_wp_x8", 1];
mortar_men_2 doArtilleryFire [getmarkerpos "fire_1_2", "vn_mortar_m2_mag_wp_x8", 1];
mortar_men_1 doArtilleryFire [getmarkerpos "fire_1_3", "vn_mortar_m2_mag_wp_x8", 1];
mortar_men_2 doArtilleryFire [getmarkerpos "fire_1_4", "vn_mortar_m2_mag_wp_x8", 1];

sleep 30;

mortar_men_1 doArtilleryFire [getmarkerpos "fire_2_1", "vn_mortar_m2_mag_wp_x8", 1];
mortar_men_2 doArtilleryFire [getmarkerpos "fire_2_2", "vn_mortar_m2_mag_wp_x8", 1];
mortar_men_1 doArtilleryFire [getmarkerpos "fire_2_3", "vn_mortar_m2_mag_wp_x8", 1];
mortar_men_2 doArtilleryFire [getmarkerpos "fire_2_4", "vn_mortar_m2_mag_wp_x8", 1];

this stuff works but it will always throw an "suspending not allowed in this context. its an sqf execute with execVM by a trigger

#

so the second half wont be executed

wind hedge
#

any idea why this crashes the game sqf _group addEventHandler ["Fleeing", { params ["_group", "_fleeingNow"]; if !(_fleeingNow) exitWith {}; private _units = units _group; private _leader = leader _group; private _targets = []; _targets = _leader targets [true, 300]; private _outnumbered = false; if (count _targets > (count units _group)*2) then {_outnumbered = true;}; private _surrenderCandidates = []; if (_outnumbered) then {_surrenderCandidates = _units;} else { _surrenderCandidates = _units select { (alive _x) && !(captive _x) && !(lifeState _x isEqualTo "INCAPACITATED") && (fleeing _x) && (isNull objectParent _x) && (count (magazines _x) < 2 || damage _x > 0.3 || _x != _leader || random 100 < 50) }; }; if (_surrenderCandidates isEqualTo []) exitWith {}; private _selectedCan = selectRandom _surrenderCandidates; [_selectedCan] joinSilent grpNull; _selectedCan doWatch objNull; private _newGroup = group _selectedCan; _newGroup setGroupId [format ["%1 SURRENDERED",name _selectedCan]]; _newGroup enableDynamicSimulation true; _newGroup deleteGroupWhenEmpty true; _selectedCan triggerDynamicSimulation false; _selectedCan setUnitPos "UP"; if isMultiplayer then { [_selectedCan, ""] remoteExec ["switchmove",0]; [_selectedCan, "AmovPercMstpSsurWnonDnon"] remoteExec ["playMove",0]; } else { _selectedCan switchmove ""; _selectedCan playMove "AmovPercMstpSsurWnonDnon"; }; _selectedCan setCaptive true; _selectedCan disableAI "ALL"; }];

sturdy ice
#

execVM by a trigger

#

but i observed that only the first two doartillery fire are shot

tender fossil
#

Or well, execVM'ing. Yes, paste the exact code. Maybe triggers don't allow scheduled code, someone else knows better probably

sturdy ice
#
execVM "scripts\mortar_1.sqf";

tigger is set to activation OPFOR type Present

little raptor
tender fossil
wind hedge
little raptor
#

it's easy to see that it may cause an infinite recursion

#

an infinite recursion in SQF doesn't usually crash the game, because its "stack" is the heap (your entire RAM), while the stack of Arma itself is just ~1 MB (usually)

spiral sundial
#

How to fix this?

sturdy ice
sturdy ice
spiral sundial
#

yeah

sullen sigil
#

disable simulation as is caused by object collision

spiral sundial
#

I did

sturdy ice
#

toggle these two

sullen sigil
#

that doesnt have an influence at runtime

sturdy ice
#

they auto align your stuff to surfaces

#

then you can clip him into it

sullen sigil
#

place a game logic at the position you want the unit to be then attach them to it

spiral sundial
# spiral sundial I did

however I can't disable the simulation on the player, only on the bench, because then he stops doing the animation

sullen sigil
#

thats the only way to avoid that

little raptor
#

you can attach him instead

spiral sundial
#

I havent had much success with attaching things to objects

#

They seem to reset their placement

#

I tried attaching grafitti to a building and it rotated 90 degrees, all of it

sullen sigil
#

BIS_fnc_attachToRelative

spiral sundial
#

Yes thats what I use

sullen sigil
#

do either have simulation disabled

spiral sundial
#

both

sullen sigil
#

enable it

wind hedge
#

I added a spawn in there to see if that helps with the crashes

#

Will try now

spiral sundial
#

Without attach command:

sullen sigil
#

is it a simple object as well

#

or local only

spiral sundial
#

Neither

#

I dont have option to make it simple object

sullen sigil
#

place it down again and only have that function in the init of it

#

dont change anything else

spiral sundial
#

doesnt work

#

the only thing that seems to fix it is not attaching it

sullen sigil
#

how are you calling the function

#

screenshot the init

spiral sundial
sullen sigil
#

screenshot the init

spiral sundial
#

Its what I just said tho...

sullen sigil
#

whats the classname of the graffiti youre using

wind hedge
spiral sundial
sullen sigil
#

and the house?

little raptor
spiral sundial
sullen sigil
#

attached it just fine 🤷

#

[this, pqeokpk] call BIS_fnc_attachToRelative;

spiral sundial
#

Identical to what I did...

sullen sigil
#

send a screenshot of your 3den setup

spiral sundial
#

what do you mean 3den setup

sullen sigil
#

how everything is placed in 3den

spiral sundial
#

Im using 3den enhanced mod

#

which adds more options

sullen sigil
#

show me how it is placed in 3den

wanton swallow
#

How to determine name and type of terrain object? How to separate trees from rocks?

spiral sundial
#

the attributes tab or what?

#

Be more specific

sullen sigil
#

no

#

everything

#

a screenshot of the objects

#

in 3den

spiral sundial
sullen sigil
#

right

spiral sundial
sullen sigil
#

so when i said enable simulation on the house

#

that wasnt an optional part

#

and on the graffiti

spiral sundial
#

yeah it works now

#

but can I not do it with disabled simulation?

#

I wouldn't like to have it turned on

sullen sigil
#

no

spiral sundial
#

I dont see why disabled simulation would have any effect on attaching

sullen sigil
#

because you disable the simulation derpWolf

spiral sundial
#

So what?

#

The command says to attach it regardless of which way its facing

#

or the simulation

sullen sigil
#

no it doesnt

#

Attaches object 1 to object 2, while preserving object 1 initial position and orientation against object 2.

#

it doesnt say anything about simulation there

#

i also told you to have simulation enabled on the both of them

spiral sundial
#

But why does the simulation matter?...

#

I dont understand

#

Why would it affect the orientation

sullen sigil
#

because its no longer simulated

spiral sundial
#

But the model is still there

sullen sigil
#

how do you expect the engine to do a calculation on something it is no longer simulating

spiral sundial
#

The model and collision is still there though

sullen sigil
#

if youre not going to read what is being said to you then youre not going to get very far

#

you were told to have simulation enabled on them both and you said it made no difference when clearly that was not the case

spiral sundial
#

I am reading I just have no clue what you mean by "its not being simulated anymore"".

#

Does the attach command not work on the 3d model?

#

Why would it be affected by simulation

wind hedge
# little raptor monitor the number of scheduled scripts

We really need more info on those new group event handlers, the _fleeingNow for example it doesn't say if it only fires once and until the group is no longer fleeing or if it fires continuously during the group's having fleeing=true etc etc.... the same with all the other EHs... _enemyDetected, fires only once until i changes target? etc etc

sullen sigil
#

because the object orientation, position and all of that is no longer being simulated by the game

spiral sundial
#

How does it retain its orientation and position then if I place it down?

#

if its not simulated

#

shouldn't it always revert to a defeault one?

sullen sigil
#

no

#

its no longer being simulated

#

not its being simulated to be [0,0,0]

spiral sundial
#

So how does it retain the position & orientation its placed in then?

#

its being simulated until it isnt?

sullen sigil
#

it is simulated -> its position and orientation is set -> its no longer simulated -> its init code is ran

spiral sundial
#

Right so its simulated initially and then it isnt anymore

sullen sigil
#

no its never simulated at a point you can access

spiral sundial
#

But you just said thats the first step

sullen sigil
#

in the engine

spiral sundial
#

Yes, and I place the grafitti in the engine also. Why does it change its orientation compared to engine?

sullen sigil
#

you cannot access the point its not simulated if you select simulation disabled in the attributes and dont put it in the init
and even then that also doesnt work

sullen sigil
spiral sundial
#

So why does it go to a 'defeault' position like I showed?

#

Shouldn't it just remain the same way I placed it down

#

what is it orientating against

#

if there is nothing

sullen sigil
#

because that is the way the function is made

#

you are welcome to create your own

spiral sundial
#

😐

#

object not simulated; retains orientation
object attached to non-simulated object; resets orientation

winter rose
#

simulate - attach - disable simulation

#

nah?

sullen sigil
#

that doesnt work i tried that before lou

#

dont know why but it just gets reset straight after

winter rose
#

or attach-detach - it's not like the house is going to move, no?

sullen sigil
#

although I wonder if you could waituntil scriptdone thonk

#

let me try that real quick

spiral sundial
#

If I place this down on a slightly uneven terrain, I want it to retain position relative to the house

#

Right now everything is flat

#

but its hard to find such a spot on a real map

winter rose
#

you use attach because the house moves?

sullen sigil
#

the house doesnt actually move you just place it in a different orientation?

south swan
#

house with disabled simulation at that

sullen sigil
#

which the game... also accommodates for?

spiral sundial
#

Ive only used like 3 commands in my life which I copy pasted

south swan
#

so, back to basics. What were you trying to achieve?

spiral sundial
#

Just putting some grafitti up on a house's wall

#

and making this small base indestructible

#

to be a safezone

south swan
#

then place graffiti in world and don't bother with attaching. House isn't going anywhere. Graffiti doesn't go anywhere.

spiral sundial
#

Do I have to disable damage?

#

Can you blow up grafitti or something?

sullen sigil
#

if simulation is disabled, no

sullen sigil
#

but ive not given it much thought 🤷

#

Has anyone managed to make AI use direct fire on indirect fire vehicles? Kind of trying to do something similar right now but can't figure anything out notlikemeowcry

ivory locust
#

@little raptor Can you elaborate on how you're calling sqf from a queue in on_frame? I'm getting a crash whenever I do anything in that function.

Edit: Nevermind, I got your bound function method working in on_frame.

exotic flame
#

Is there any way to disable RMB zoom ?

frank mango
exotic flame
open fractal
exotic flame
#

definitely not

weary smelt
#

Hey boss. I did some more testing on different maps. Both Altis and Tanoa get me kicked off for "BattlEye: Client not responding" before the script finishes executing (this is in multiplayer environment, executed server-side). This is with the 512 chunk size. I'll do some further testing with a lower number and report back my results.

grizzled cliff
#

i am a god...

#

at least when it comes to sqf

#

:D

weary smelt
#

For Altis, 256 worked best.
For Tanoa, had to get down to 128.
For Malden & Stratis, 512 was fine.
For Livonia, 512 worked, but my client froze up.