#arma3_scripting

1 messages · Page 603 of 1

faint oasis
#

i don't understand why we can't get the player camera it's very strange

faint oasis
#

and can we create a camera for the player and keep the "player moving" ? because when i create a camera i can't move the player

winter rose
#

maybe by playing with switchCamera and remoteControl @faint oasis

unique sundial
#

you should be able to move player when camera is created, of course depends on the type of camera, some take control of the movement keys

winter rose
#

it's cameraEffect ["internal", back"] that takes the controls away

unique sundial
#

You're right

_cam setDir getDir player;
switchcamera _cam;```
winter rose
#

ooooooh nice trick

faint oasis
#

@unique sundial thx i will try

surreal anvil
#

So what happens with that script? It creates a camera that follows the player around?

winter rose
#

no - your PoV remains on the camera, while the character you control gets away from it

surreal anvil
#

Oh

faint oasis
#

@unique sundial do you know how to get the player camera as object ? because i have tried : _cam = "camera" camCreate (player modeltoworld [0, -5, 2]); _cam setDir getDir player; switchcamera _cam; but i can't fire with my weapon i can only move so how to do the same thing as a player cam ?

unique sundial
#

i dont know

faint oasis
#

@unique sundial oh ok thx

unique sundial
#

and no need to tag me with every reply

faint oasis
#

yes i'm sorry

still forum
#

No need to DM me either

forest ore
#

Is it possible to do switch-do inside if-then ? Am testing with this sqf if (side _unit == WEST) then { switch (true) do { case (_index == 0): {hint "It is WEST SIDE index 0!"}; case (_index == 1): {hint "It is WEST SIDE index 1!"}; default {}; } } else { switch (true) do { case (_index == 0): {hint "It is ANY OTHER SIDE index 0!"}; case (_index == 1): {hint "It is ANY OTHER SIDE index 1!"}; default {}; } };
but not achieving desired results

still forum
#

sure it is

#

switch (true) do {
case (_index == 0)
I hope thats just some "show whats intended" code and not actual code, because that'd be pretty stupid

forest ore
#

kk thanks ded for the quick reply and uhhh don't know what to say to your remark 😰 😄

winter rose
#

switch _index → case 0 / case 1 ^^

forest ore
#

Lou, can you please elaborate on that? Am getting already mixed here what to put and where..

#

oh you mean just directly sqf case 0: {hint "It is WEST SIDE index 0!"}; ?

still forum
#
 switch _index do {
  case 0: {hint "It is ANY OTHER SIDE index 0!"};
  case 1: {hint "It is ANY OTHER SIDE index 1!"};
 default {};
 }

This is how switch/case is supposed to work, and works in most languages.
It accepting a boolean and conditions as cases is a SQF specialty

#

not to mention it adds a lot of unnecessary overhead

forest ore
#

ahh ok, brilliant and now got the hang of it with that example 🙏🏼

hollow thistle
#

It accepting a boolean and conditions as cases is a SQF specialty
not only

slender schooner
#

it accepts basically anything, booleans, strings, ints, probably also floats

still forum
#

It literally takes the type called "Anything"

sonic thicket
still forum
#

yes

sonic thicket
#

That sucks, i just started out arma scripting so I havent memorized or even seen most of the commands yet

#

Is there any alternative library?

sonic thicket
#

haha, well yeah that works i guess. Thanks 🙂

#

I've tried finding a solution but is there a simple way of checking whenever A player is in a vehicle rather then checking if the vehicle has a player ?

#

as everything I have found so far revolves around the vehicle

grim coyote
#

See ObjectParent

sonic thicket
#

Oh thanks, that is useful for a number of things 😄

grim coyote
#

You can also use this:

if (vehicle player != player) then {hint "Player is in a vehicle"};
sonic thicket
#

Oh i see, i've tried that one before but it appears I fooled myself with a typo, thanks 🙂

#

due to some scripting the zombie spawn script I have keeps putting spawns in queue whenever the player is in a vehicle and spawns then all at once when the player steps out. Im happy to have tested that as I really didnt saw that one coming lol

#

almosth done replacing ravage zombies with ryan zombies 😄

#
  • screamers added
sinful axle
#

I have a trigger activated by the presence of one unit. It's supposed to show titletext to the unit that activates it and not globally. How would I go about this? Thanks!

grim coyote
#

For that you should use getoutman eventhandler @sonic thicket

sonic thicket
#

Oh, i meant I have that and wanted to get rid of it 😛

grim coyote
#
player addEventHandler ["GetOutMan", {
    params ["_unit", "_role", "_vehicle", "_turret"];
        call spawnZombies
}];```
sonic thicket
#

so adding in this check it makes sure the spawnscript doesnt queues up spawns

#

thanks for the tip though 🙂

sonic thicket
#

So, it feels like if variables are not carried from one container to the other container.

if (vehicle _randomPlayer == player) then {
        systemchat "Defined";
        _typezombie = [1, 2, 3, 4] call BIS_fnc_selectRandom;
        systemChat (format ["%1",_typezombie]);
} else {
        systemchat "Defined";
        _typezombie = [1, 2, 3, ] call BIS_fnc_selectRandom;
        systemChat (format ["%1",_typezombie]);
};

systemChat (format ["%1",_typezombie]);

Displays:

1
any

while it should be

1
1

What am i missing?

still forum
#

you are setting the variable in the inner scope

#

it goes out of scope and gets deleted

#

then you try referencing a now deleted variable in a higher scope

#

we should have a pinned message about variable scope

sonic thicket
#

all right so it is what I suspected

still forum
sonic thicket
#

Thanks 🙂

wary vine
#

anyone know of a work around for really quiet say3D sounds when inside a vehicle in first person ?

sonic thicket
#

I am everything but a expert, let alone a novice on this but have you tried adusting the soundvolume? E.G. db-10 in the description.ext ?

    class sound
    {
        name = "sound";
        sound[] = {"\sound\sound.ogg", db-10, 1};
        titles[] = {1, ""};
    };
wary vine
#

but my thought it it would then make the sound even louder on the outside

#

it seems to only happen in 3rd person

#

1st is quiet inside a vehicle, 3rd is loud.

sonic thicket
#

_vehicle say3D ["sound", 200, 1];

is noticible on 200m, perhaps change that to let's say 3m? see if that works out

#

I do hope i am correct on that one ^

wary vine
#

its set to 20m right now, because we want to hear it outside, but not louder then the inside aha

sonic thicket
#

I have only used it for sirens so far and ganking demon zombies which all come from far, I can notice the distance having an effect on sound volume but I am not sure on how that works when working with short distances

wary vine
#

i was going to try other methods, like playSound3d, but wiki seems to be down

#

bc, im pretty sure playSound3d has an isInside param

sonic thicket
#

web archive, gotta love this age we live in 😄

wary vine
#

Yeah aha

#

seems like ill have to get the path from the config,

#

rather then the sound class

warm iris
#

I wonder if such a thing exists, looking for a script that can draw a line that follows a unit (player unit) is this a thing thats a possible, and b exists?

winter rose
#

Yep and maybe

warm iris
#

oh

warm iris
#

Any pointers on how I could do it?

winter rose
#

Is it a marker thing, or a 3D line you want?

warm iris
#

A 3D/2D mapline, that just shows where the unit has been

#

Just some way to trace where the unit has been, nothing like ultra fancy

winter rose
#

map? You can e.g drop a dot every meter/second 🙂

exotic flax
#
prevPos = false;
while {true} do {
   newPos = getPos player;
   if (prevPos) then {
      // draw line between newPos and PrevPos
   };
   prevPos = newPos;
   sleep 1;
};
#

probably not the best solution, but it should work without a lot of overhead

#

and depending on map or 3D you need to add the proper code to draw the line(s)

winter rose
#

while {} do {}

exotic flax
#

sorry, have 3 other languages in my head thonk

still forum
#

prevPos = newPos;
setting bool to vector

exotic flax
#

only first time; doesn't break anything

#

and yes, it should all be private vars...

winter rose
#

on second loop, boom?

#

if (position) // boom

#

@exotic flax no excuses, go to bed 😄

exotic flax
#

I'm fixing the offline wiki 😛

timid niche
#

When’s the new update being released?

#

Waiting for that connectToServer

still forum
#

what do you want to use it for

timid niche
#

Simply for a main menu

winter rose
#

(in the next 1 or 2 months I suppose)

still forum
#

ok. Will be a while still. but the older script method will keep working

timid niche
#

Yeah aight

#

Btw regarding rules in monetization

#

Must it be a website post when it comes to the monetization program or could it be a discord post?

still forum
#

post?

timid niche
#

The monetization program

still forum
#

yes

#

what post

timid niche
#

Could it be a discord message/post instead of on a website

still forum
#

I don't understand what you mean

#

the monetization program is not a "post"

warm iris
#

@exotic flax sorry, what do I put this in?

timid niche
#

Aight nvm don’t think u get me

digital hollow
#

How does canVehicleCargo work? Is it possible to calculate the result without spawning an instance of the cargo?

still forum
#

yep, as I just said I don't ^^

timid niche
#

Ahah yeah aight

still forum
#

@digital hollow maybe by spawning simple object

#

but you need the object present somewhere

exotic flax
#

@warm iris Depends, you can add it in the units init field, in the mission init files or in a function which gets called for each unit/player

digital hollow
#

Ok. createSimpleObject doesn't seem to return the correct result, but createVehicleLocal seems to be good enough.

warm iris
#

Apparently its got a generic error in expression

exotic flax
#

well, it was a quick version which needs to be extended (and fixed) based on your specific needs

warm iris
#

Time to fiddle! Literally just to draw a line (or markers every so often) to follow where a unit has been. Hoping it'll be simple

#

Also odd, seems like its not been done yet, at least from what I can find realtime tracking yeah, tracing a units movements, no o-o

exotic flax
#

for most people it's not needed, because the current location is what matters

warm iris
#

Yeah, it is a bit of an odd'un but its for a point, ish. Not got much of a clue where to start tho

exotic flax
#

and having lines all over the map (or worse, in 3D) can be very distracting while playing a mission 😉

warm iris
#

Yeah, that was the issue but it's at least for small scale, if it was big scale it'd be tonnes harder

crude vigil
#

If you use decaying lines it would be better in such scenario.

#

say, you will only keep an history of lines for past 10 mins

exotic flax
#

that would require to store all points for 10 minutes, which can be a lot... especially if you want to do it for all players, it would mean thousands of locations to be stored

warm iris
#

At the minute, I'm trying to get a line that stays forever to follow 1 unit (as its a group, I really am only focusing on the group leader) or for it to place dots every 10-30 seconds

exotic flax
#

dots are easy, simply use createMarker and setMarkerType, which will put a dot on the map for everyone

warm iris
#

Slot it into the previous code I'm guessing?

#

I'm also guessing to do it for more than 1 unit attempt to convert it to use a variable name?

exotic flax
#

not needed, because every unit will run the code for itself (but will put dots on all maps)

warm iris
#

Is the bi wiki down?

exotic flax
#

yes

warm iris
#

I also cant really see how I'd slot this in tbh

exotic flax
#
[] spawn {
  while {true} do {
    _tmpMarker = createMarker [format ["dot_%1_%2_%3_%4", profileName player, (getPos player) select 0, (getPos player) select 1, (getPos player) select 2], player];
    _tmpMarker setMarkerType "hd_dot";
    sleep 1;
};

Try this in the init field of the player (not tested)

warm iris
#

Its not having it, for no reason apparently

exotic flax
#

errors or just not doing anything?

warm iris
#

Throws up a box that just says Init :

crude vigil
#

that would require to store all points for 10 minutes, which can be a lot... especially if you want to do it for all players, it would mean thousands of locations to be stored
@exotic flax That would be up to how you want to script it, usually this sort of features take point A and B over a fixed time, so you would not add a line for each moment but per 1-2 min(just an ex, up to scripter) , because you do not need precise movement, you just need a rough idea. Of course I assume he just wants to give a rough idea what the player has done recently and not something detailed.

exotic flax
#

hmm... I do see the issue, although it's a bit annoying because you need the spawn to use sleep, but the init field doesn't seem to like that (and I can't check the wiki/forums for a better solution atm)

#

because if I run the following in the console it works (it adds a dot every second on the map):

[player] spawn {
  params ["_unit"];
  while {true} do {
    _tmpMarker = createMarker [format ["dot_%1_%2_%3_%4", name _unit, (getPos _unit) select 0, (getPos _unit) select 1, (getPos _unit) select 2], _unit];
    _tmpMarker setMarkerType "hd_dot";
    sleep 1;
  };
};
#

trying to run the same script in the init field breaks...

warm iris
#

That works however

#

thanks for helping out

molten roost
#

How does remoteExecCall work? Cant use wiki atm 🙁
My guess ["param_1", param_2] remoteExecCall somefunction; would work in theory?

#

or if someone has a quick example to provide, it would be much appriciated

exotic flax
#
["param_1", param_2] remoteExecCall ["someFunction"];
still forum
#

[leftparam, rightparam] remoteExec ["functionname", target]

flat elbow
#

how do I keep a plane that is supposed to fly in the same position in-air?

#

ie i want the players to parachute but as they aren't exactly bright they take time and if the plane moves they will miss the landing area

exotic flax
#

I believe _vehicle enableSimulation false will do the trick

flat elbow
#

iirc that made the player vision black and there were no engine sounds

exotic flax
#

well, with simulation it will try to fly (or drop down), without simulation it will stay in place but without any fancy stuff like engines

#

but perhaps there's another solution I don't know

#

although something I did in a mission was simply kicking all players out of the plane the moment it was at the drop zone

flat elbow
#

i wonder if i can place an invisible object, then attach the plane to it

#

heh the wiki gives 502 bad gateway

exotic flax
#

yup, wiki (and forums) are down at the moment

flat elbow
#

yep it seems attachto do the work

digital hollow
#

Is there an fnc for finding the point on a line closest to another point?

winter rose
#

Yes, but biki down

warm hedge
#

*Up

winter rose
#

Of course it is up, because it has to be down to be up -again- (sentence not to be used outside of context)

digital hollow
#

Any leads on that fnc? =)

winter rose
#

@digital hollow BIS_fnc_nearestPoint 🙂

ebon citrus
#

@digital hollow yeah, it's called vector math

#

Or arithmetic geometry

#

Pick your poison

winter rose
#

the best thing is you only have to (have someone to) figure it out once - then all you need is to use this function

short sparrow
#

Hi, There is a way to get the current ip and port of the server that I am connected? Thanks

winter rose
#

not through scripting afaik

flat elbow
#

is the combat patrol module used by players, AI or both?

#

i want the AIs to randomly patrol an area without laying down the possible paths myself so i'm wondering if this does the job

hallow mortar
#

The Combat Patrol modules are related to the multiplayer Combat Patrol mission type, not to actual patrols

flat elbow
#

is there a module that do the same that you know of?

#

the old man modules seems interesting but i can't find any tutorial on how to use them

hallow mortar
#

You could try looking under the Site modules, but they work by spawning units rather than giving instructions to existing ones.

#

The Old Man modules were added quite recently and don't have complete documentation. There's also some risk of problems when using them in multiplayer since they were designed for a singleplayer scenario.

dusky cairn
#

Hi, I'm trying to get some soldiers to train at the shooting range. I would like the code to work in multiplayer but I'm new and I don't understand everything.

warm hedge
#

Check the pinned message to formatting

#

No need to remove the entire post though...

abstract shuttle
#

Sorry, just not wanted to spam 😄

warm hedge
#

Edit your post is always your friend 🙂

abstract shuttle
#

Hi there! I tried to use this code to make a camera circle around an object...
Now I got the problem, that the camera is automaticly adjusting its height related to the ground.
I want it to be at the same height all the time.

Camrunning = true; // set to false to stop the camera
_radius = 50; // circle radius
_angle = 180; // starting angle
_altitude = 10; // camera altitude
_dir = 0; //Direction of camera movement 0: anti-clockwise, 1: clockwise
_speed = 0.02; //lower is faster

_coords = [cameratarget, _radius, _angle] call BIS_fnc_relPos;
_coords set [2, _altitude];
_camera = "camera" camCreate _coords;
_camera cameraEffect ["INTERNAL","BACK"];
_camera camPrepareFOV 0.700;
_camera camPrepareTarget cameratarget;
_camera camCommitPrepared 0;

while {Camrunning} do {
_coords = [cameratarget, _radius, _angle] call BIS_fnc_relPos;
_coords set [2, _altitude];

_camera camPreparePos _coords;
_camera camCommitPrepared _speed;

waitUntil {camCommitted _camera || !(Camrunning)};

_camera camPreparePos _coords;
_camera camCommitPrepared 0;

_angle = if (_dir == 0) then {_angle - 1} else {_angle + 1};
};

Thanks for your help! 🙂

dusky cairn
#

do you know how to loop this animation ?

#

willie playMove "AmovPercMstpSnonWnonDnon_exercisePushup";

warm hedge
#

Use animDone EH

dusky cairn
#

Right at the end?

warm hedge
#

Huh?

#

Do you know what EventHandler is?

dusky cairn
#

I started yesterday trying to create a mission. I never tried before

#

I'm just trying to do something clean

tame portal
#

You can play an animation and add an eventhandler to the person doing the animation to execute code once the animation is done

#

this way you can execute code exactly when its done and just play the animation again

dusky cairn
#

I think it exceeds my current level of programming

tame portal
#
this playMove "AmovPercMstpSnonWnonDnon_exercisePushup";
this addEventHandler ["AnimDone", {
    params ["_unit", "_anim"];
    
    _unit playMove "AmovPercMstpSnonWnonDnon_exercisePushup";
}];
#

try that

dusky cairn
#

thanks

tame portal
#

and if it works try to understand it 😄

#

actually, since your unit is named willie

dusky cairn
#

yes i will read in detail all this

#

🙂

tame portal
#

it has to be ```sqf
willie playMove "AmovPercMstpSnonWnonDnon_exercisePushup";
willie addEventHandler ["AnimDone", {
params ["_unit", "_anim"];

_unit playMove _anim;

}];```

warm hedge
#

In Development Branch (for now), is there anyway to detect all addons (pbos) from a MOD/DLC?

still forum
#

no

#

you can iterate CfgPatches

#

and use maybe configSourceMod to get back to the modlist thing I added

warm hedge
#

Hmm maybe that'll do

sonic thicket
#

I am probably missing something big here, my own theory is because the "rain" & "overcast" are executed from the wrong script or need a attachment to an object but I cant figure it out.
Could someone tell me why the following script in init.sqf does not work:

if ((rain >= 0.6) && (overcast >= 0.6)) then {
systemchat "RainOvercast";
};

I remember it working when i finished that script but have made some changes since then

#

rain & overcast are both set at 100%

#

and if I execute it in-game it works

winter rose
#

systemChat may not be ready, be sure to have some delay first

hallow mortar
#

What happens if you introduce a sleep 0.1; immediately before that in init.sqf?

sonic thicket
#

That is extremely strange, I am sure I did tried that. However... it worked, not sure what went wrong the previous time I tried that

#

Thanks 😄 I've been working on it for a couple hours already haha

#

Ahh, something is wrong with the "while {true} do {" string in which the if ((rain >= 0.6) && (overcast >= 0.6)) then { resides

winter rose
#

…rephrase plz?

sonic thicket
#
sleep 0.1;
systemchat "1";
while {true} do {
        systemchat "2";
        if ((rain >= 0.6) && (overcast >= 0.6)) then {
        systemchat "3";
        };
sleep 600;
};

It activates the "1" but neither the "2" and "3"

#

Oh! now it did activate the 2

winter rose
#

(```sqf)
well, it should yeah

sonic thicket
#

but not the 3 lol, well getting closer and closer

#

ill simplify the script, its probably something further down

unique sundial
#

systemchat those rain and overcast values before the while otherwise you have to wait god knows how long at 5min intervals

sonic thicket
#

figured it out, the script didnt worked because of a rogue "

#

it was in a hidy hidy spot

flat elbow
#

i placed a marker with alpha 0, then in a trigger i call it with APCMarker setMarkerAlpha 1; but the marker does not appear 🤔

hallow mortar
#

the marker name should be a string

#

"APCMarker" setMarkerAlpha 1;

#

also, when doing things with scripting, make sure you turn on "show script errors" in the launcher options

flat elbow
#

🤦‍♂️

#

how does remotexec determine if the parameters i am giving have to be put before or after the command itself?

still forum
#

[before, after] remoteExec..

flat elbow
#

there are two ways to call it, one is param1 sideChat param2 the other is [param1, param2] sideChat param3

#

but i guess [param1, param2] sideChat param3 is still a param1 sideChat param2 for the engine maybe?

astral dawn
#

there are only three cases
command
command arg1
arg1 command arg2

#

but i guess [param1, param2] sideChat param3 is still a param1 sideChat param2 for the engine maybe?
yes, left argument is an array, right argument is... whatever param3 is

still forum
#

one is
[param1, param2] remoteExec
other is
[[param1, param2], param3] remoteExec

flat elbow
#

now i have it clear

#

is there a way for format to print just part of a string? i have a device (microDAGR from ACE) that wants the input of a position as 0XY0ZT but the getpos gives me XYRF,K ZTOP,Q so i want to prepend 0 (and i can already do it) but limit the print to 2 character (XY and ZT) and discard the rest

astral dawn
#

could you give example? format is not very clear

#

but yes you can use select on a string to get part of it

flat elbow
#

sure, i have a vehicle that is at let's say 9874,3 N 1586,6 E

#

the microDAGR wants the waypoint as 098 015

#

so i have to sidechat "0" + getPos obj select 0 + " 0" + getPos obj select 1 but also trim the getPos return

astral dawn
#

if it's indeed what you need, then yes, you can use select

flat elbow
#

with C i would printf %1.2s

astral dawn
#

oh wait, you want a different precision

#

there is a command for that

#

toFixed 2 I think

flat elbow
#

uhm no? the numbers are before the decimal not after

astral dawn
#

🤔 I read your message as %1.2f thinking you needed a float format, sorry

flat elbow
#

CBA rescued me:

X = [str (getPos APC select 0), 0, 2] call CBA_fnc_substr; Y = [str (getPos APC select 1), 0, 2] call CBA_fnc_substr; [Angel1CoPilot,"The APC have landed in a wrong position, new position 0" + X + " North 0" + Y + " West"] remoteExec["sideChat", 0];
still forum
#

format is more efficient than string+string+string+string+string

#

I don't really understand how your code makes sense

flat elbow
#

mmh what part bothers you?

still forum
#

the microDAGR wants the waypoint as 098 015
those are grid coordinates.
getPos doesn't return grid coordinates

#

mapGridPosition APC
returns for example 098015
then you split it apart into X and Y and done.

flat elbow
#

i'm feeling stupid now

#

like, really stupid

still forum
#

The getPos position of
600x500 might be grid 060 050 yes..
but your code also causes position 60x50 -> 060 050, although its really 006 005

#

(not actually the correct math, but you get what i mean)

sonic thicket
#

How would one go about moving trees? ( wind effect ) im trying to figure out how it's done and possibly increase it under some circumstances

still forum
#

engine does that, based on wind strength

#

more wind, more tree movement

sonic thicket
#

Thanks 🙂 time to find the ceiling of that function

still forum
#

I've seen completely flattened trees 😄

flat elbow
#

if you use a vietnam map the trees might even speak 😛

#

on that note it would be interesting to know if you can technically make the trees lose the foliage or it's part of the model and you cannot

still forum
#

part of model

flat elbow
#

can you swap the model during runtime?

exotic flax
#

It's part of the model, although you can fake the effect with leaf models as particles 😉

still forum
#

A mask to hide leaves would be interesting, or to change color of leafs 😄

#

You could theoretically swap the model, but custom spawned models might not have the wind effect

hallow mortar
#

Defoliated trees probably wouldn't move too much in the wind tbh

#

The real tree wishlist item is being able to choose which way they fall when destroyed via script

flat elbow
#

can't you offset the base when you destroy it and physix will do the job?

still forum
#

tree's are not physx

flat elbow
#

you destroy it then you manipulate the rotation and the orientation, sounds like doable

still forum
#

Trees have no velocity

sonic thicket
#

Hmm, whatever command i put in it gets automatically overwritten by the default weather, I have no idea on how to turn that off

hallow mortar
#

Note: I am not actually trying to do it. It would be useful for some things like the Achilles nuke and other scripts that simulate environmental damage, but I'm not personally doing anything with trees.

still forum
#

Changing vectorDir would change the direction it falls to tho

sonic thicket
#

I've used a combo of the following commands;

0 setWindForce 1;
0 setWindStr 1;
setWind [10, 10, true];
faint oasis
#

hi, i have a little question ? can i launch a script as "eventhandler init" but not when the mission is launched but when i'm in the 3den editor ?

sonic thicket
#

Is there a way to go past 0 setWindStr 1; and basically do 0 setWindStr 2; ?

#

lol SetWind [50000,90000,true];

If i only knew how to make that last longer then .5 sec

sonic thicket
#

Well, ace weather was the culprit

winter rose
#

. . . oh, really? mods have an impact? -___-

blazing quiver
#

does anyone know if the driverless/1-man tank script is no longer working?

winter rose
#

…which one?

digital hollow
#

The Tank DLC one?

winter rose
#

@digital hollow wat? which one?

tough abyss
#

Anyway to force collision between AI and an editor placed object?

smoky verge
#

like an object with no collisions and an AI?

tough abyss
#

Like a wall for instance. Typical behaviour with AI pathing will cause the AI to move through walls/doors/fences. Pretty much any object other than terrain. I want to AI to be able to path but not travel through objects.

#

I vaguely remember a command existing for it but I can't find anything.

winter rose
#

setBehaviour "safe" ?

tough abyss
winter rose
#

oh, a unit, not a vehicle.

tough abyss
#

Yes sorry.

smoky verge
#

on a similar note
is there a way to not have collisionchecks with a vehicle?

tough abyss
#

Yeah disablecollision

smoky verge
#

that disables the collision but does it disable the collisioncheck aswell?

tough abyss
#

Oof, actually I think that command can only be used with specified objects anyways.

smoky verge
#

yeah I need it between vehicle and static prop
and its just causing me frameloss

tough abyss
#

You would probably be able to accomplish something with Intercept C++ but I think we're out of luck with SQF and collison/pathing changes.

#

But I'm sure someone has a solution.

smoky verge
#

not sure honestly
I'd be fine with the collisions to be completely missing
my problem is that an helicopter is going through various collision checks without ever colliding with anything
and the checks seem to brutalize framerate

tough abyss
#

You could do it the hard way and just make it a unitCapture.

smoky verge
#

though exactly of that
but I'd still have to fly through it and unitcapture records only during frames

#

and even then I'm not sure if there will still be collision checks during unitplay

tough abyss
#

I don't believe so but I've never tested it. Should be pretty easy* to debug.

smoky verge
#

no idea how

tough abyss
#

line intersects maybe.

smoky verge
#

plan c would be to unitcapture without the objects that cause issues
and then add the objects
but I'm clueless on wheter I'll hit anything during recording

warped shuttle
#

Does anyone know how to get an array of Turret units like assignedCargo?

tough abyss
#

I wish there was a "ExplosionNear" event handler.

smoky verge
#

does it count as collision if I'm not actually colliding?

tough abyss
#

I don't believe so Sanchez.

#

But if you just assign that EH and have it pop a hint when it's fired then you will know.

#

In the event that it's still firing and your framerate is better during the unitCapture that would be a solid indicator as well.

#

A system log would be better than a hint though if you've got a lot of potential collisions.

smoky verge
#

yeah
so annoying though

warped shuttle
#

@tough abyss I've tried, but this is not what I'm looking for as it returns the unit's role and path.
This one is ... _turret = assignedVehicleRole vehicle player; hint str _turret; //["Turret",[0]];

tough abyss
#

What is your desired output?

warped shuttle
#

@tough abyss
Self-resolved. Thanks for the suggestion and help.

_Turrets = allTurrets _vehicle;
_units = _Turrets apply {_vehicle turretUnit _x};
hint str _units;//[Alpha 1-1:1,Alpha 1-1:2,...]
torpid quartz
#

hey i'm trying to lock at door at the start of the mission with this code

build1 setVariable["bis_disabled_Door_5",1,true];

that seems to work.
how would i unlock it as this one i run on another trigger doesn't unlock it.

build1 setVariable["bis_disabled_Door_5",1,false ];

I'm down with it just swinging open, better than nothing.

carmine sand
#

Not sure if its this

build1 setVariable["bis_disabled_Door_5",0,true ];

hallow mortar
#

Yes, 1/0 is the lock state. The true/false part controls whether the variable should be broadcast globally (so you want it to be true)

slender schooner
#

is there a way to exit the game via command?
Like, close the game if the command gets executed?

robust hollow
#

possibly this

ctrlActivate(findDisplay 0 displayCtrl 106);
{_x closeDisplay 2} forEach allDisplays;
#

it "clicks" the exit button on the main menu, but it doesnt seem to take effect with other displays open.

slender schooner
#

i see, gonna try it later

digital hollow
#

@winter rose

tank script
I was just saying they can 1-man without a script now =p

carmine sand
#

@winter rose
I was just saying they can 1-man without a script now =p
@digital hollow how?

digital hollow
#

You just be group leader and press wasd

carmine sand
#

Thats not the solution i need tbh.. i want it as before in OFP like the T-80 auto. My mod doesnt need 3 crews for any tank vehicles, isnt needed and some game perfomance can be safed too with 1-man controlled tank/vehicle

umbral nimbus
#

is the DoWatch command not usable for Helicopter gunners?

#

It works fine for tanks

#

tried with both normal AI and an agent

#

(tried that on both Tank and Helicopter)

still forum
#

@timid niche if you can, please test if connectToServer on dev branch works as you want it to work, once its out its hard to fix.
Only had one tester so far

timid niche
#

Sure ill test it

#

@still forum should it work with localhost?
Or does it require an actual ip like 127.0.0.1

still forum
#

domains work too

#

#IHope

timid niche
#

Well ill try with 127.0.0.1 cause didnt work with localhost

still forum
#

it should atleast go into the connecting screen, and then probably fail if domains don't work

timid niche
#

Seems to go to loading screen but doesnt actually connect with either

still forum
#

port and password correct?

#

maybe just try a non localhost 🤔

timid niche
#

Aight just a moment

#

still doesnt seem to work

still forum
#

how do you call it? ui button click eventhandler?

timid niche
#

Yeah

#

ctrl evh

#

buttonClick

still forum
#

guess I need to test that then

digital hollow
#

I can't seem to hide or visually break the main rotors on the Mi-24 from either CUP or RHS. Anyone know how to do that or a Hind mod with rotors that break?

torpid quartz
#

Thanks @carmine sand @hallow mortar

sonic thicket
#

Hey guys, i am trying to spawn a zombie_walker ( which is part of civ ) and force it under the flag of independent with the following code:

_ryanzombies = creategroup independent;
_zombie = _ryanzombies createunit ["zombie_walker",position player,[],0,"form"];
_zombie addEventHandler ["FiredNear", { _zombiegroup = group _zombie; systemchat (format ["%1",_zombiegroup]);}];

Then when i fire near I still got C Alpha-something in the sidechat.
What did i miss?

crude needle
sonic thicket
#

I've been fiddeling around with that but it spits out generic errors;

_ryanzombies = creategroup independent;
_zombie = _ryanzombies createunit ["zombie_walker",position player,[],0,"form"];
_zombie joinSilent independent;
_zombie addEventHandler ["FiredNear", { _zombiegroup = group _zombie; systemchat (format ["%1",_zombiegroup]);}];
crude needle
#

Wrong syntax.
[_zombie] joinSilent _ryanZombies;

#

not

#

_zombie joinSilent independent;

sonic thicket
#

ah ofcourse, makes sense

#

god, even while being in the same group the nutheads still attack each other

winter rose
#

Scripting issue I guess

#

(from the mod)

sonic thicket
#

yeah, ryans zombies mod is very weird when it comes to that

#

there is just no way to communicate with anything that happens within that mod. I thought ravage had the better spawn system and ryan had the better zombies but I am starting to doubt this

surreal anvil
#

Hi guys, me again. Back with another question about holdActions, but this time it's when it's run on a server. It works in singleplayer and LAN multiplayer, but not on a server for some reason?

So the issue we get is that we get three of the same action on the computer it's supposed to be on, and none of them actually do the full thing they're supposed to do. No errors, it counts down to one, but then nothing happens.

This is the important script for the computer:

[  
 manual_override_computer_six,             
 "Initiate Detonation Sequence",            
 "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",   
 "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",   
 "(_this distance _target < 3) && ((missionNamespace getVariable ['actionCompleteSix',false]) isEqualTo true)",        
 "_caller distance _target < 4",        
 {},               
 {},               
 {0 = [] spawn { 
 hint "WARNING! DETONATION SEQUENCE INITIATED... PLEASE STAND BACK..."; 
 
sleep 7; 
hint "THREE..."; 
sleep 1; 
hint "TWO..."; 
sleep 1; 
hint "ONE..."; 
sleep 1;
hintSilent "";  
explosiveSix1 setDamage 1;  
sleep 1;  
explosiveSix2 setDamage 1;
sleep 1;
explosiveSix3 setDamage 1;
sleep 1;
explosiveSix4 setDamage 1;  
explosiveSix5 setDamage 1;
sleep 1;
explosiveSix6 setDamage 1;
};},      
 {},               
 [],               
 2,               
 0,               
 true,              
 false              
] remoteExec ["BIS_fnc_holdActionAdd", 0, manual_override_computer_six]; //Adds the new hold action to the computer
#

It's saved as a composition, so it's identical to every other test case we've done so far

#

Another piece of information is that the script's in the init for the computer, not in a .sqf file

winter rose
#

and that's why you have dupes.

surreal anvil
#

Hm?

winter rose
#

init field runs for every machine, connected or to be connected
remoteExec × players number + 1 (server) = number of actions

surreal anvil
#

... Ah. Didn't know that. I'm assuming that could be leading to the script not executing properly in the next step either?

#

Since I have three of them and none of them execute properly

winter rose
#

dunno

surreal anvil
#

... Is there a way around this without putting it into a .sqf? The point is to make it easier for mission makers to implement the script.

winter rose
#

sure, remove the remoteExec usage

#

adding the action is local
but
the init field is executed on every connecting/connected machine
therefore
the action is added to every machine

surreal anvil
#

Ah, so go for "... call BIS_fnc_holdActionAdd" instead?

winter rose
#

just that, yes

#

also, no need for 0 = , this is an Editor field limitation
and no need to spawn the action code as it is already spawned

surreal anvil
#

Thanks, Lou. I'll try these suggestions out and come back with the results 🙂

#

Do all players get access to the holdAction even if it's run this way?

winter rose
#

every single one of them.

sleek token
#

is it possible player connected missioneventhandler is completly broken in SP ?

winter rose
#

yes?

#

not "broken", just not fired

#

(mayhaps)

sleek token
#

well it does fire

#

but arguments are out of order

winter rose
#

huh?? 😄

still forum
#

sounds possible

sleek token
#

sometimes there are no arguments passed at all 😄

still forum
#

whats the exact name of the eventhandler?

#

its not PlayerConnected

sleek token
#

"PlayerConnected"

still forum
#

huh

sleek token
#
{
    diag_log "Client connected";
    diag_log _this;
}];```
still forum
#

can't find any usages of that

sleek token
#

well it is what i noticed trying to make some scripts sp compatible to let users work on editor stuff without problems

still forum
#

lol

sleek token
still forum
#

Ah, need to disable whole word filter 🧠

#

ah no actually, only called in one place, no argument orer mnixups+

sleek token
#

i will try a workaround with advanced params stuff xD

params [
    ["_id", 0, [0]],
    ["_uid", str random 100000, [""]],
    ["_name", "Singleplayerman", [""]],
    ["_jip", true, [false]],
    ["_owner", player call BIS_fnc_netId, [""]]
];
#

okay it doesnt work because at position _uid a boolean is passed

#

welp

still forum
#

impossibru

sleek token
#

arams [
["_id", 0, [0]],
["_uid", str r>
20:49:03 Error position: <params [
["_id", 0, [0]],
["_uid", str r>
20:49:03 Error Params: Type Bool, expected String

still forum
#

┬─┬ ノ( ゜-゜ノ)

west grove
#

hmm anyone knows the stringtable names of the months by chance?

#

january, february, etc

still forum
#

@west grove synixebrett has a stringtable browser

#

@sleek token youa re misisng one arg

west grove
#

what's that

still forum
#

google

west grove
#

this dude?

still forum
#

ye

west grove
#

he has like a million repos 😄

west grove
#

thanks

winter rose
#

wowww, useful!

sleek token
#

@still forum ? _idstr but it is at the end

#

does it matter?

still forum
#

id, uid, name, jip, playerid, struid

#

you no have playerid after jip

#

Ye I just posted that link Lexx

west grove
#

oh right, i just saw the github link :>

sleek token
#

i refered to it as owner :>

still forum
#

no

#

wrong order then

#

wiki

params ["_id", "_uid", "_name", "_jip", "_owner", "_idstr"];
you
["_id", 0, [0]],
["_uid", str random 100000, [""]],
["_name", "Singleplayerman", [""]],
["_jip", true, [false]],
["_owner", player call BIS_fnc_netId, [""]]

sleek token
#

defuq. to sum up. There is nothing wrong with the eventhandler, i executed the code inside it from a differend location. That is way there is no parameter passed

winter rose
#

🔨 grrr debug first before calling for a game issue :@

sleek token
#

well totaly didn't see that remaining code puzzle

winter rose
#

heh, happens.

sleek token
#

never clean up your code... :<

winter rose
#

you almost went on my paddlin' list, up with people that say the game is broken then tell you at the end "oh yeah, I also use X mod" :@ :@ :@

sleek token
#

hehe at least i am not using any mods right now 😛

winter rose
#

you better! 😄

surreal anvil
#

I return! This time, a completely unrelated question. I'm gonna make a script that decreases the AI skill of all EAST units when their leader dies. I've found the BIS_fnc_EXP_camp_setSkill function that I think should work, so I've written the following:

if (!alive enemyGeneral) then {

[EAST,0.1,0.1,0.4,0.4] call BIS_fnc_EXP_camp_setSkill;

};

My question is.... How do I check if it actually works?

winter rose
#

systemChat "it works, britneys!"; ?

surreal anvil
#

Oh yeah, but that just checks if the code reaches that point, not verifying that the skill levels actually change. Is there a way to check that?

winter rose
#

at one point you have to trust the code… and if you don't, read the function to see what it does?
otherwise, you can check that a specific unit has its skill altered

surreal anvil
#

Trust? hisses

#

But yeah, point taken. ^^ thanks for the tips

flat elbow
#

never trust the code, not even your own

#

-Cit.

winter rose
#

random features intensify

hallow mortar
#
systemChat format ["Skill is %1",(myTestUnit skill "general")]
surreal anvil
#

Oooh, thanks

#

I found a way to check it though. Go into zeus, pull a unit's skill slider up to 1, shoot the general, check that same unit's skill. It had moved, so it works. 😄

surreal anvil
#

Right, so. Back to the holdAction situation I'm in. The script works on the server now. All the way up until I want the explosives to go off. It does the countdown, which is executed in the same code block, but the explosives don't actually, well, blow up.

{
hint "WARNING! DETONATION SEQUENCE INITIATED... PLEASE STAND BACK..."; 
 
sleep 7; 
hint "THREE..."; 
sleep 1; 
hint "TWO..."; 
sleep 1; 
hint "ONE..."; 
sleep 1;
hintSilent "";  
explosiveSix1 setDamage 1;  
sleep 1;  
explosiveSix2 setDamage 1;
sleep 1;
explosiveSix3 setDamage 1;
sleep 1;
explosiveSix4 setDamage 1;
sleep 1;  
explosiveSix5 setDamage 1;
sleep 1;
explosiveSix6 setDamage 1;
};

I'm not getting an error that it's not finding the explosives objects, so I'm unsure what's causing it at this point

winter rose
#

yeah, what are your explosives?

surreal anvil
#

I'm using Explosive Charge (DemoCharge_F)

winter rose
#

they won't explode on setDamage - use "DemoCharge_Remote_Ammo_Scripted" (maybe triggerAmmo works, don't know)

#

@surreal anvil ↑

surreal anvil
#

.... But it works in local multiplayer angry huffing

winter rose
#

really? funny

surreal anvil
#

It works in singleplayer, local multiplayer, but not on the server. I'll give it a go with that script instead

crude needle
#

Globals defined in the editor using the Variable Name field do not propagate to clients automatically.

winter rose
#

huh, they do? or at least, they should

surreal anvil
#

huh

winter rose
#

@surreal anvil
oh I get it
you didn't publicVariable after creating them on the server?

#

you create them with createVehicle right?

surreal anvil
#

publicVariable the explosives? I did not

#

Oh

#

No

#

They're created as a custom composition that a mission editor plonks down. It contains the computer, a man with the keycode holdAction, and six explosive charges with premade variable names

#

Then they can move the bombs around to where they want them to be

crude needle
#

@winter rose I believe it is restricted to static object globals not being broadcast/read from the mission file by my testing. AI are available, however.

winter rose
#

I believe there was a bug with simple objects, but that's it 🤔

surreal anvil
#

Shouldn't the script be complaining that it can't find the objects if they're in the wrong scope, though?

#

So uh. Did I stumble upon a weird one?

winter rose
#

definitely 😄

crude needle
#

I'm not privy to the debugger's internals. Definitely don't always get error reporting for undefined variables in certain situations.
@surreal anvil
The quick check in your case would be to run:
hint str (isNil "explosiveSix1"); on the client and see if true comes up. Then you know you need to make that var available to the clients.

#

Sandbags show up so I suppose it's just explosive names that don't get networked. thonk

surreal anvil
#

😦

#

I just want explosives to go boom when I click a button

#

Is that too much to ask?

#

But yeah, I'll use that script and see what it returns

crude needle
#

As Lou said, make them publicvariables. Easy fix.

surreal anvil
#

Okay. I spawn an explosive in the editor, I change its variable name. How do I make it public from there?

crude needle
#

Somewhere on the server, run publicVariable "myExplosiveVariable"; for each of the charges.

Could put it in the init field of each of them as:

if (isServer) then {publicVariable "myExplosiveVariable"};
surreal anvil
#

Oh, that's really useful

#

And then I call them as "explosive1 setDamage 1;", right?

crude needle
#

Yeah.

surreal anvil
#

Thanks, I'll give it a try! Can't do it tonight though, the server's busy, but I'll get back to you if it worked or not

#

Appreciate the help a bunch, once again

hallow mortar
#

The idea that editor-placed variable names are not global seems quite bizarre

#

every client should be loading the mission.sqm that tells you about the variable names

#

I'm aware that editor callsigns aren't global, but variable names? what a weirdly basic thing to break and never fix

surreal anvil
#

Right?

crude needle
#

It would appear to be just that explosive block at the moment. I had trouble with it in a mission I was making and just confirmed only that block had the issue. Need to test more.

surreal anvil
#

So the block I picked mainly due to its modest explosion radius happened to be the very one that currently has issues. Cool

crude needle
#

Seems like anything of the "mineBase" class is subject to it, at least that's the commonality I've found. Whether it is intentional or not 🤷‍♂️.

surreal anvil
#

Well, I'll get back to you guys with the result of our testing, probably tomorrow

uncut sphinx
#

are variables publicly setVariable'd on a unit available to JIP players?

still forum
#

ye

uncut sphinx
#

i.e. if I set a variable on a unit and a player later JIPs into it, will that variable be present on that player's client?

still forum
#

If the unit was a AI and never despawned, yeah, should

uncut sphinx
#

ok

#

thanks

gloomy aspen
#

Hey guys, where/how in this init script would I add cuttext to fade in from black for 5 seconds?

this addAction ["Enter Galley", {player setPosATL (getPosATL galley)}]

#

Looked cuttext up on the BIKI but cant quite figure it out

fair drum
#

what's the page I should go to to learn about using classes for setting up a bunch of dialog?

astral dawn
fair drum
#

i mean for dialog for just quickly referencing stuff. I heard you could create a class of ingame radio texts you want to use then call them so you don't have to have a separate sqf for every single one.

digital hollow
#

I think you're talking about triggers using Radio Alpha/Bravo/etc Activation.

fair drum
#

nah, something with class cfgs and stuff

#

idk why I'm drawing a blank. let me see if i can figure out how to use search well enough on discord. this was weeks ago

#

i found it...

params ["_case"];
switch _case do {
case "event1" : { dialogue, sleep etc. };
digital hollow
fair drum
#

So would this be a good start? I would then add more params and stuff?

["dialog1"] execVM "script.sqf";

params ["_truckTrigger","_survivorTrigger"];

switch _truckTrigger do {

    case "dialog1" : {
        [Headquarters,"Looks like some sort of battle happened here. There are 5.56mm magazines on the ground. Nato?"] remoteExec ["sideChat",-2,true]
    };
};

switch _survivorTrigger do {

    case "dialog2" : {
        [natoSoldier,"Namalsk, get to namalsk"] remoteExec ["globalChat",-2,true];
        sleep 3;
        natoSoldier setDamage 1;
    };
};
digital hollow
#

switch is for choosing between different values (cases) of a single variable. What you have now you should just do

if (_truckTrigger isEqualTo "dialog1") then {
};
fair drum
digital hollow
#

Look at Example 2 and make your stuff like that.

fair drum
#

okay

fair drum
#
params ["_dialog"];

switch _dialog do {

    case "truckFound" : {
        [hq,"There must have been some sort of battle here. Look, 5.56mm magazines on the ground. NATO?"] remoteExec ["globalChat",0,true];

    };
    
    case "soldierFound" : {
        [natoSoldier,"Namalsk, get to Namalsk!"] remoteExec ["globalChat",0,true];
        sleep 3;
        natoSoldier setDamage 1;
    };
};

something more like this then.

unique sundial
#

why do you need JIP flag? it is a message that is relevant only at the time of sending it

winter rose
hallow mortar
#

wow, that Conversations system looks absolutely hateful

winter rose
#

it is nice though… but requires the will to setup a full system for "some" sentences

Using BIS_fnc functions, voices play themselves in order, waiting for the previous one to end - no "sleep 3" etc

empty holly
#

Can anyone help me with this script? Its meant to make a zeus and add me as the curator, but when I do, when I oepn up Zues, and try to double click a unit to edit its properties nothing shows up, and modules from Zeus Enhanced just stay there and dont have their pop up either, however, if I do it through the editor instead of an SQF, it works fine. Here is the script

{if ((name _x) == "Agent34") then {charac = _x; publicVariable "charac";};} forEach allPlayers;
moduleGroup = createGroup sideLogic;
publicVariable "moduleGroup";
zeus_module = "ModuleCurator_F" createUnit [getPos charac, moduleGroup, "charac assignCurator this;"];  
publicVariable "zeus_module";```
It used to work fine like a charm but recently after I got back from a 2 week trip out of town, it started giving me this issue, I've tried past scripts and running it past TypeSQF to check the syntax but I cant find anything. I'm not sure what the count in tbe debug console means but it always gave me a 3/10000. I ran this on a singleplayer scenario using Local Exec
cosmic lichen
#

you have to also assign all Event handlers IIRC

#
private _zeusModule = (creategroup sideLogic) createUnit ["ModuleCurator_F",[0,0,0],[],10,"NONE"];
player assignCurator _zeusModule;
//Add Interface EHs (Workaround)
_zeusModule addCuratorEditableObjects [entities "", true];
_zeusModule addeventhandler ["curatorFeedbackMessage",{_this call bis_fnc_showCuratorFeedbackMessage;}];
_zeusModule addeventhandler ["curatorPinged",{_this call bis_fnc_curatorPinged;}];
_zeusModule addeventhandler ["curatorObjectPlaced",{_this call bis_fnc_curatorObjectPlaced;}];
_zeusModule addeventhandler ["curatorObjectEdited",{_this call bis_fnc_curatorObjectEdited;}];
_zeusModule addeventhandler ["curatorWaypointPlaced",{_this call bis_fnc_curatorWaypointPlaced;}];
_zeusModule addeventhandler ["curatorObjectDoubleClicked",{(_this select 1) call bis_fnc_showCuratorAttributes;}];
_zeusModule addeventhandler ["curatorGroupDoubleClicked",{(_this select 1) call bis_fnc_showCuratorAttributes;}];
_zeusModule addeventhandler ["curatorWaypointDoubleClicked",{(_this select 1) call bis_fnc_showCuratorAttributes;}];
_zeusModule addeventhandler ["curatorMarkerDoubleClicked",{(_this select 1) call bis_fnc_showCuratorAttributes;}];``` That's the way I used to do it. No sure if there is a better one by now
austere pendant
#

i got a bit of a problem with play music script or activation idk what its called
i have this in a description.ext
class CfgSounds
{
sounds[] = {};
class music1
{
name = "music1";
sound[] = {"\sounds\HALO.wav", 300, 1};
titles[] = {0,""};
};
};

and
this in an objects init
h1 addAction [ "halo 3 music?", {
h1 say3D ["music1", 1000, 1];
} ];

i also have a folder called sounds and the location fine. i get no error but yet im hearing nothing and i checked the sound file its self and it sounds fine

fair drum
#

Does it work with say2d?

austere pendant
#

the action works its jsut the music it doesnt work

unique sundial
#

volume is too loud it won’t play

#

1000 is stupid loud

#

try 5

thorny ferry
#

So I'm currently trying to understand locality with event handlers. As far as I can tell it looks like the only event handlers that I need to treat specially are "Hit", "Killed", and "Respawn". Let's assume I am running a dedicated server with a script TAG_fnc_server_script that only exists on the server. If I run this on the server (where player is a player unit):

player addEventHandler ["Respawn", {
    params ["_unit", "_killer", "_instigator", "_useEffects"];
    [_unit, _killer, _instigator, _useEffects] call TAG_fnc_server_script;
}];

Then am I correct in assuming that the event handler will never fire because it only fires when local to the player?

unique sundial
#

try addmpeventhandler mphit mpkilled mprespawn

tough abyss
#

I read from the community wiki mission optimisation page https://community.bistudio.com/wiki/Mission_Optimisation that using while is likely bad scripting

This script here I use is designed to prevent people from loading unwanted items from Warlords arsenal and loadouts

_uniform spawn {

    waitUntil {!isNull (uiNamespace getVariable ["BIS_fnc_arsenal_cam", objNull])};
    
    while {!isNull (uiNamespace getVariable ["BIS_fnc_arsenal_cam", objNull])} do {
    
        if ("RHS_Podnos_Gun_Bag" in  backpack player) then {
       removeBackpack player; " RHS_Podnos_Gun_Bag";
     cutText ["<t color='#ff0000' size='2'>THIS BACKPACK IS NOT ALLOWED!!!</t><br/><t color='#FFFFFF' size='1.5'>PICK A DIFFERENT ONE...", "PLAIN DOWN", -1, true, true];
     };```

Is it logical to think if I add a sleep people can exploit the sleep to load unwanted items? Or is my concept of sleep (which i believe to just be a delay before the script runs again) incorrect. If anyone has a better direction for this script can it be recommended?
unique sundial
#

use arsenalrestricteditems[] ={} mission param to restrict unwanted items in loadouts

thorny ferry
#

@unique sundial So something like this?

player addMPEventHandler ["MPKilled", {
    params ["_unit", "_killer", "_instigator", "_useEffects"];
    [_unit, _killer, _instigator, _useEffects] remoteExecCall ["TAG_fnc_server_script", 2];
}];

Will that event trigger for every pc though? So if there's 3 players connected the server script gets executed 3 times?

unique sundial
#

you don’t need remote exec

#

read description

#

it fires globally

#

it fires once on every pc and server

#

better option is to use mission event handler entitykilled

thorny ferry
#

Oh ok, I understand what you're saying. So since the server script only exists on the server will it will only get run there?

unique sundial
#

you need if (isServer) then {...} to run on server only

#

it runs globally but only on server isServer is true

thorny ferry
#

Ah ok that'd work.

unique sundial
#

if you add missionEH entitykilled on server only you get server only execution

thorny ferry
#

Ok so I can use EntityKilled and EntityRespawned to replace their respective events but I still need to be able to execute an event for "Hit" on the server, which I take it can be accomplished using MPHit and addMPEventHandler.

austere pendant
#

thanks @unique sundial will try

tough abyss
#

doing what killzone said, I looked into Mission params in the wiki, and guessed part of the issue Im having now is I dont know what classname to put the mission param in. How would I properly search for which I need?
atm im using

{
arsenalrestricteditems[] ={RHS_Podnos_Gun_Bag};
};```

And also a screenie of the error ivemade https://gyazo.com/9b407f6b77d062723bba3b6ea1c82a9d
austere pendant
#

oof wont work

tough abyss
#

I had it similar to that before but wait, so the reason it wasnt working originally was because i forgot to put quotations around the classname? 😠

winter rose
#

that too yeah.

tough abyss
#

🤔 still borked nothing happens

winter rose
#

¯_(ツ)_/¯

hallow mortar
#

It doesn't appear to go into any class. You just put that line on its own outside of all classes.

stone totem
#

Hey Guys,
I could need some quick help cause somehow I cant find the command on the BI-Wiki.
I would like to negate the "isEqualTo" Command ....

I did it this way, but I dont find this very elegant

    if [((driver (vehicle driver)) isEqualTo player) == false] then {
#

hmmm ok. and now i need to find out how to do quotes in discord 😉 .... ignore "´please 😉

warm hedge
#

== false <- get rid of this

stone totem
#

ok. thats what my question is a about. but how do i negate the logic then?

#

the goal is that I want to get the people in the vehicle that are NOT the driver 🙂

warm hedge
#
  • Check pin message to format
  • !(false) or not (false) is true
  • if takes no array but boolean
stone totem
#

ok thanks !( ) will help 🙂

#

I think from there I can go on. Thanks for your help.
Also thanks for the hint with the pinned-messages

viral basin
#

hey there, is there any way you can modify the URL attribute of a RscButton via SQF?

robust hollow
#

i dont believe so.

ebon citrus
#

Not available, no

viral basin
#

okay thank you

winter rose
#

what is the format/path for A3 particles?
e.g \A3\data_f\ParticleEffects\Universal\Universal?

#

it seems so
"\A3\data_f\ParticleEffects\Universal\Universal"

warm hedge
#

Yes, without extension will work

empty holly
#

@cosmic lichen Quite odd, it used to work just fine without it, thanks for it anyways, I'll try it now

#

Wow, it worked, thank you so much!

cosmic lichen
#

yw

winter rose
#

huh, since when can't you eject an AI helicopter cargo mid-flight 🤔 while the player can

#
_x action ["eject", vehicle _x]
```I'll use `moveOut` \=|
winter rose
#

arrrrrrgh, the helicopter lands to allow units to come back in, even if they were unassignVehicle'd…!

#

even when leaveVehicle'd, too

hallow mortar
#

Welcome to helicopter AI hell

#

Trying to have helicopter transport interactions of any kind is a nightmare. It doesn't ever get any better.

#

Fun fact: getting out of an AI helicopter that's idling on the ground causes it to immediately lift straight up 25 metres before coming back down. That's if you can get it to land at all; another favourite helo pastime is hovering over a completely clear LZ going up and down forever without landing

exotic flax
ebon citrus
#

@winter rose i just spawned the AI outside the helicopter in flight and deleted them from the seats

#

But im notoriously pissy about the AI and AI-commands and tend to try and avoid them whenever possible

open hollow
#

hellooo anyone knows how to change what coordinates are showed on the GPS ?

#

all this display and title effects thing is kindda hard :c where i can find some documentation to understund it?

hallow sphinx
#

is there a script out there to keep players map markers to each other and then share the map marker threw an interaction ect.? (bad description)

open hollow
#

@hallow sphinx if you draw in "direct comunication" only people arround you can see what you drew, you want that or something more "global" ?

hallow sphinx
#

i want to limit drawing on the map to be seen only by the person who draws it and an interaction to share what he has drawn on the map threw interaction if possible threw mods or a script

open hollow
#

you can limit it in that way, and then save and broadcast your marker to all the other players, the only problem i see... i dont know how lines work

#

if can be stored and draw again in some way

ebon citrus
#

@open hollow the 3d model or the display?

open hollow
#

@ebon citrus the display, where grid is shown

#

both map and "minimap"

ebon citrus
#

I think there's already a script running that updates it

#

So if you change the value, you'll be competing with that other script

#

Your best bet would be hiding the original ones and then creating your own one in its place

#

What exactly are you trying to accomplish @open hollow

open hollow
#

jamming gps basically

ebon citrus
#

Yeah, then youre best off doing what i said

#

The other option is to replace the gps with a "broken" gps item

#

Or "jammed" gps item that doesnt function as a gps

#

This would make it not possible for players tp use gps functions

open hollow
#

yea... thats a good one

vernal dust
#

hello all, would anyone be able to help with the radioChannelCreate? I cant for the life of me get a CustomChat script to work

#

if anyone can help

copper raven
#

Well without your code, I doubt anyone can help you

vernal dust
#

all i have is the basic

#

_unit customChat [1, "Hi, I am a custom chat message"];

#

not sure how to even start to use the other RadioChannelCreate

copper raven
viral rivet
#

@vernal dust if you mean creating a tfar channel on teamspeak there's a task force radio module in the editor. just double click it. put the info in. make sure the ts channel name matches the channel you designate in the module

#

if that's not what you mean then disregard

still forum
#

What? no he doesn't mean that

#

what he means was posted right above your message, 4 hours ago

hidden talon
#

could I easily set the size of a trigger to match the size of a pre-placed marker in a short and similar way to this? since getMarkerSize returns [x, y] size and setTriggerArea's parameters use [x, y, angle, isrectangle] i thought i could do something like "_trg setTriggerArea [(getMarkerSize "mrk1"), 0, false];", but this throws an error saying it expects 5 elements but only 3 were provided

cosmic lichen
#

Try

_trg setTriggerArea [(getMarkerSize "mrk1") select 0, (getMarkerSize "mrk1") select 1, 0, false];

@hidden talon

hallow mortar
#

You can also use markerDir to dynamically fill in the third value

hidden talon
#

thank you @cosmic lichen, works great now

#

@hallow mortar markerdir isn't needed for what i'm doing though, just the marker x and y scale

barren spire
#

what is the correct way to rearm a vehicle?
setVehicleAmmo can only remove magazines from the gunner, and setVehicleAmmoDef 1 correctly restores full ammo but leaves the gun inoperable until you switch seats / get out and back in

proper sail
#

addMagazine / addMagazineTurret

barren spire
#

alright, I'll try that

spark turret
#

does sqf have some kind of list function?

#

i would like to avoid having a multi level array

astral dawn
#

Hmm what do you mean?

spark turret
#

i worked on a strategic map long ago that creates coloured markers according to terrain type, and i want to revitalize that. each marker needs to store information, like trees, houses, units etc. best would probably be to create a marker class with fields that hold that info, but i want all markes in a list where i can access the marker and the info.
in the past that was a huge multi level array

#

but i have come to like c# lists recently so i was wondering if sqf has that too

astral dawn
#

list is a map string -> something, right?

#

you could create some dummy object and use setvariable

spark turret
#

thats actually a good idea

astral dawn
#

you could use my OOP and treat all these elements as OOP objects 😜

spark turret
#

whats oop

astral dawn
#

😮

spark turret
#

orkisch orgasm puppet

astral dawn
#

you said you were doing C#

#

in C# everything is OOP 😄

spark turret
#

no, i play around in unity and my knowledge isnt very deep

#

ah object oriented programming?

astral dawn
#

well, object-oriented programming

#

sure

spark turret
#

so wdym use your oop?

winter rose
#

list is a map string -> something, right?
That would be a dictionary in C#

astral dawn
#

well I have some macros which simulate OOP in SQF and it suits your task (or pretty much any task)

spark turret
#

hmmm

#

elaborate pls

#

or do you have somewhere to check that stuff out?

astral dawn
#

this one is a class of a map marker which creates some marker and allows other stuff to happen with it (like having overlayed markers) and store extra data

spark turret
#

wait i know that

#

where do i know that from

#

looks sick. even has a mouseOver function

astral dawn
#

yes it becomes bigger when you hover mouse over it so you can click on it, it's clickable... but anyway it's just an example, that adds general OOP capabilities

spark turret
#

does it support square markers?

astral dawn
#

All markers are square 🤷

#

I mean those which are icons 🤔

spark turret
#

im using square area markers

#

lets see if i can find a screenshot of the old program

astral dawn
#

the MapMarker class I gave is just an example of generic OOP capabilities (objects, inheritence, variables, etc)

#

I didn't mean to relate it to your problem really

spark turret
#

is it possible to expand the fields?

#

and methods?

#

sorry, your OOP markers is far beyond anyhting i have coded in sqf

astral dawn
#

expand like... what?

spark turret
#

add new fields and methods

#

with a child class f.e.

still forum
#

each marker needs to store information, like trees, houses, units etc. best would probably be to create a marker class with fields that hold that info
just create a location for each marker, locations have a namespace that you can store variables in

astral dawn
#

Of course, you code your own class like in C#, add your own methods and variables like in C#, inherit from other classes like in C#, there are even variable attributes like in C# 😄

spark turret
#

cool

astral dawn
#

just create a location for each marker, locations have a namespace that you can store variables in
I suggested that already. Actually if you use CBA, it has a handy function for it CBA_fnc_createNamespace

spark turret
#

location != marker?

still forum
#

yeah

#

createLocation vs createMarker

#

but locations can have icons too? I think? but only a limited set

#

I suggested that already.
you suggested dummy objects, which would be quite inefficient compared to locations

spark turret
#

i will need dummy objects anyways for visual presentation

#

so probably location + square area marker

#

lol wth is that for a field: fakeTown

astral dawn
#

you suggested dummy objects, which would be quite inefficient compared to locations
yes you are right, I forgot that

#

although there is also createVehicleLocal

spark turret
#

now, if i have dummy objects anyways, do locations offer an advantage that justifies adding them anyways?

still forum
#

although there is also createVehicleLocal
thats the inefficient thing I was talking about

spark turret
#

my dummies will be map markers, not vehicles

astral dawn
#

Yes? Even local?

still forum
#

Yes... As I said..

spark turret
#

well its still a ton of vehicles

#

imagine one vehicle for each gridsquare times 10

still forum
#

do locations offer an advantage that justifies adding them anyways?
basically zero cost? And having one location per marker is easier to code than choosing a random one of these objects that you place for visuals

sturdy sage
#
_var = "";
_var params [["_scope",0,[0]]];
_var

Gives error: type string expected number. Shouldn't it just default to 0 and not give any errors? Or am i using this wrong?

astral dawn
#

Well you didn't say why, I thought that only network traffic will be different, but you ahve the source code, not me 😄

still forum
#

@sturdy sage should print error AND default to zero I think.
zero is also default when undefined is passed

sturdy sage
#

Nah just gives empty string

still forum
#

@astral dawn objects are rendered, simulated, culled, seen by entities, iterated over as nearby objects, network traffic just goes on top for non-local objects

#

@sturdy sage yes because thats what _var is, check _scope variable

sturdy sage
#

Oh oops i forgot to change that

astral dawn
#

@astral dawn objects are rendered, simulated, culled, seen by entities, iterated over as nearby objects, network traffic just goes on top for non-local objects
That's good to know. I doubt it would make much difference unless he created an amount of them comparable with objects from the map, right?

sturdy sage
#

Ok yeah its returning 0 now. Hm didn't expect it to also complain with script errors, need something different then

still forum
#

I doubt it would make much difference
As far as I understood he's talking about hundreds, not dozens

spark turret
#

im gonna fill the complete map with markers 100m side length

#

so for 10x10km thats 100x100 markers

astral dawn
#

One object per 100x100 meters, that's average density of takistan desert I guess 😄

still forum
#

terrain objects are much different from non-terrain objects

astral dawn
#

In which way?

#

Are they not rendered, not simulated, not culled, not seen, or not iterated?

still forum
#

If you are far away, they don't even exist.
They are not really simulated, no network traffic

astral dawn
#

Hmm interesting

#

So basicly in his scene he will always have 10 thousand extra objects?

still forum
#

yeah

spark turret
#

nice

astral dawn
#

🦆

spark turret
#

now make a loop that checks all 10k objects each second

astral dawn
#

Yeah I am starting to worry about my own code then 😅😅😅meowhuh meowtrash notlikemeow

spark turret
#

luckily that uncalled for. terrain info wont change as settlements and mountains odont suddenly appear

still forum
#

if you need to check them periodically, you'd have to build a system that prioritizes them, instead of just blindly iterating over all of them while 90% of them either don't matter or do nothing

spark turret
#

and for dynamic information like garrison im gonna have the unit check their quare, not the square check for unit

astral dawn
#

So... it means that objects like fences or similar placed in editor add more load than same objects which already were there at the map?

#

Server still must simulate these fences from the map?

still forum
#

objects like fences or similar placed in editor add more load than same objects which already were there at the map?
yes

#

Simulation for static fences is not that expensive tho, but yeah they are always there

spark turret
#

how performance heavy is it to have fields that dont change in MP.

#

?*

#

like, is there an advantage to keep the number of fields low?

astral dawn
#

what fields?

spark turret
#

the variable fields

#

like setVariable

astral dawn
#

they are called variables here, not fields (in conversations and in SQF commands too)

#

If they don't even change and they are public, then they are only broadcasted to client when he joins

#

So I'd say impact is around zero

still forum
#

variables don't impact performance if they just lay around in memory

#

Only when you get/set them, then the size of the hashtable might make a difference depending on how far it is from being rebuilt

winter rose
#

How is a logic impacting performance though? It doesn't have an AI, but is still created with createUnit and can use waypoints…

still forum
#

logic is simulated, more than objects even. It does have a AI brain actually.

#

but I don't think it actually does anything

winter rose
#

ouch, so it should not be used for modules? Or are modules something else?

still forum
#

modules are logics yeah

#

I don't know why they use that

#

simple invisible "Static" objects would be better

#

such as the object CBA uses/used for its object type namespace

winter rose
#

Ctrl+H "Logic" -> "HeliHEmpty" ^^

astral dawn
#

It's very strange considering that logics are used in BI code sometimes

#

in BIS ambient anim code for instance

winter rose
#

Every module is one, and yeah I was about to reference ambientAnim too

still forum
#

I'd guess its legacy, as logics have simulation

#

and if you have a couple dozen it really doesn't matter enough

vague geode
#

Is it possible to add markers to the drop down menu on the map and to make markers turnable?

hallow mortar
#

Through mods, yes. Adding markers would be a config thing; I think ACE has turnable markers but it's a bit of a hack.

tough abyss
#

Hey everyone,
I'm trying to set the condition of a trigger to only activate when a player is NOT in a vehicle and in the trigger area so it's not accidentally triggered by someone flying over it.
The trigger will also set off another trigger and wait for the player to leave the area where it set off the first trigger.

Enter Trigger (Name: enterArea)
In the first trigger when the player gets to the area, I set this as the Condition: (isNull objectParent player) && (player in thisList);

Leave Trigger (Name: leaveArea)
In the second trigger, I have this set as the Condition: triggerActivated enterArea && !(player in thisList);

But for some reason it triggers BOTH at the same time and doesn't wait for the player to leave the trigger area. Both triggers are overlapping each other with the leaveArea trigger slightly larger.

Anyone know what's wrong?

#

DERP please disregard my idiocy I fixed it....

#

I had a duplicate trigger (leaveArea) which I copy pasted elsewhere on the map as "backup" in case I accidentally screwed up the triggers...

#

I deleted the duplicate leaveArea trigger and it's fixed. facepalm

exotic flax
#

there are a couple of things you can try:

  1. use the 'deactivation' field to run a script when the player leaves the area again (only runs after it has been activated)
  2. to fix the fly-over version; set the height of the trigger to 5m or so
#

keep in mind that 1) only works when the trigger is set to "repeat"

tough abyss
#

Can't use option 1 since my trigger needs to be triggered only once. I'll do your second option though. Make things easier.

cosmic lichen
#

in BIS ambient anim code for instance
@astral dawn
They are used there to attach the unit to it and since logics have simulation, the animation will play fluently. Unfortunately BIS_fnc_ambientAnimations has never gotten a rewrite for better performance.

spark turret
#

okay so:

  • logic modules have an AI brain
  • HeliHEmpty is logic
    what haha
#

that sounds like some whacky stuff

winter rose
#
  • HeliHEmpty is logic
    empty helipad is not a logic @spark turret
spark turret
#

Ctrl+H "Logic" -> "HeliHEmpty" ^^ -> so its listed as logic?

#

still, locations are logic modules arent they?

winter rose
#

no no, I meant "replace logic usage in code by empty helipad"

locations modules are logics, yes. locations themselves, no

spark turret
#

ah now that makes more sense

winter rose
#

Ctrl+F is search,
Ctrl+H is search & replace :p

spark turret
#

yeah i know it just didnt klick

still forum
#

still, locations are logic modules arent they?
editor categories don't say much about the type of object

winter rose
#

we could save visual editor mission performance by replacing most modules with locations 😄

#

do it!

#

a quick fix could be to disable their simulation - scripts would run, get/setVariables would work, but AI would stop 🤔

still forum
#

most modules are literally just scripts that execute once

#

you could just adjust the script and have them delete themselves after they are done

winter rose
#

no, you could 😄

#

(tbh, I would place that in the low priority rn - partly because I don't use that many modules, and also because 1000s of modules is the minority)

#

oh man I want my emoji now 😆

#

meaning dadjoked or wiki'd 😁

spark turret
#

how do simple agents differ from regular AI?

#

are they worth using for like a civilian crowd?

winter rose
#

no combat AI afaik, simpler FSMs

tough abyss
#

Hey guys me again! facepalm notlikemeow

Goal: Have a certain screen show a random picture.

Issue: Always just show's the first option in the array (Computer_Monitor_1.jpg).

private _ScreenArray = [
"Images\Screens\Computer_Monitor_1.jpg",
"Images\Screens\Computer_Monitor_2.jpg",
"Images\Screens\Computer_Monitor_3.jpg",
"Images\Screens\Computer_Monitor_4.jpg"
];

_ScreenTexture = selectRandom [_ScreenArray];
Screen setObjectTexture [0, _ScreenTexture select 0];

Note: Object/Monitor/Screen is called "Screen"

winter rose
#

selectRandom _ScreenArray

tough abyss
#

Does anyone know how to actually select a random one?

winter rose
#

I am from the future

tough abyss
#

_>

#

Trying now

#

No brackets then

still forum
#

selectRandom [_ScreenArray] selects a random element out of the array [_ScreenArray]
The array [_ScreenArray] has a SINGLE element, and that is _ScreenArray if you select a random element out of 1 total elements, you can only get one element out, always the same

winter rose
#
_ScreenTexture = selectRandom [_ScreenArray];
Screen setObjectTexture [0, _ScreenTexture select 0];
// turns into
Screen setObjectTexture [0, selectRandom _ScreenArray];
tough abyss
#

D'oh

winter rose
#

you randomly selected from [ [tex1, tex2] ]
which returned [tex1, tex2]
and did a select 0 on it
which returned tex1

spark turret
#

it returns a simple number, which seems abstract

#

7680 for bukovina.

winter rose
#

width = height afaik

#

ah no, this number is half the diagonal

spark turret
#

alright

winter rose
#

wait - I don't remember
not saying anything now

spark turret
#

lol

winter rose
#

🔇

spark turret
#

you could be right about the square side length

#

map is roughly 7.5 km on the sides

#

yup mapsize returns the side length of the square map in meters. 15360 for chernaus.

#

@winter rose care to update the wiki?

winter rose
#

I will (when I can)

#

updated @spark turret

spark turret
#

cool beans

spark turret
#

how do i stop markers or location symbols from scaling with map zoom?

#

i found a solution that adjusts markers scale to zero out the zoom level but that seems performance heavy

old juniper
#

Has anyone got any experience with Sarge AI, or had it working recently, I'm trying to drop it into a scenario but it keeps throwing up "Undefined variable in expression" Errors, I'm asking here as the author seems to have dropped off of the forums and Github

wet shadow
#

@spark turret KillzoneKid is your best bet. AFAIK there is no eventhandler for map zoom change so a loop makes sense.

spark turret
#

actually KillzoneKid used draw eventhahndler

wet shadow
#

That shouldn't be too bad then performance wise

spark turret
#

well

#

i have a couple more markers than usual

#

so it puts me at 8 fps lol

wet shadow
#

Easy solution woud be to only resize the markers when the map is opened, not every frame

#

Or have like a user action available on the map screen that runs the resizing function at the players discretion

spark turret
#

well i dont need super fancy markers, small area markers will do i guess

#

they dont scale by default

still forum
#

so it puts me at 8 fps lol
it should only do resizing if you change the zoom, meaning lag spikes but overall fps staying same

wet shadow
#

I am looking for a way to detect if the string content is a number (without any letters mixed in). So for example:

"3" //This is needed to return true
"b3c" //This is needed to return false
"banana" //This is needed to return false

I am having trouble coming up with suitable ideas. typename will obviously only return "STRING" so its a no-go. parseNumber will convert any letters mized in into numbers as well which I do not want. call compile cannot process anythign random like "b3c" so its useless. Any tips will be appreciated.

still forum
#

parseNumber
str parseNumber _x == _x
"3" -> parseNumber -> 3 -> str -> "3" -> "3" == "3" -> ✅
"3abc" -> parseNumber -> 3 -> str -> "3" -> "3" == "3abc" -> ❌
"b4nana" -> parseNumber -> 0 -> str -> "0" -> "0" == "b4nana" -> ❌

#

might cause issues with numbers with many decimal places, depends on what input you expect

#

or splitString, remove all numbers and if there's stuff leftover, its wrong.

_x splitString "0123456789."

"3" -> []
"312.34234242" -> []
"3242342.31432 abc" -> [" abc"]

array not empty, its not a number

wet shadow
#

The first apporach has a problem with zeroes if one is the first character

str parseNumber "0a" == "0" // will return true

still forum
#

No it won't

#

My code will do
str parseNumber "0a" == "0a"
but the str only returns "0" which is != "0a"

wet shadow
#

Oh yeah sorry my mistake

exotic flax
#

Doesn't parseNumber only return the first occurrence of a number in the string? (as stated on the wiki) or has this behaviour been changed?

still forum
#

parseNumber only works if string starts with number

#

otherwise 0

arctic lake
#

Hello,im a noob when it comes to any sort of scripting and i hope that you guys could assist me with your knowledge 🙂 Im trying to trigger a show/hide module by interacting with an npc.Is there a way to use the addAction with this or do i need a proper script?

exotic flax
#

although BIS_fnc_parseNumber seems do the job to identify numbers (even when stringified)

wet shadow
#

That is actually technically true, although its is looking for a number, string, code or config. The only problem with that is my aversion of having unnecessary errors in my logs.

still forum
#

BIS_fnc_parseNumber was made for a different purpose

#

BIS_fnc_parseNumberSafe does that splitString trick I mentioned above

#

BIS_fnc_parseNumber won't do the stuff mentioned above, it will just error

wet shadow
#

@arctic lake The module only hides the unit models and disables simulation. You are better of using enableSimulation/enableSimulationGlobal and hideObject/hideObjectGlobal commands.

arctic lake
#

@wet shadow I set up my whole mission with the modules since im doing a "wave defend" type deal😅 .My hope was that im able to talk to an npc to start the whole thing(wich is to trigger the show/hide module that sends the first wave in).And im sorry if this is not the right place to seek help for this kind of thing.

raven sluice
#

Upon recommendation, bringing this discussion here: is it possible to make ammunition that tracks infantry?

Basically, if I can just get a rocket to track infantry, that would be good enough, and I can make all of the other adjustments there...

still forum
#

sure you can

#

just update direction every frame

smoky verge
#

that seems expensive

#

wouldn't need to update velocity aswell?

wet shadow
raven sluice
#

Let me put it this way, I want to be able to shoot smoll rockets moving at barely 70 m/s, fires at about 500rpm, and tracks infantry targets

#

And use it as a primary and/or secondary weapon

#

And they will be ponk.

wet shadow
#

@arctic lake You can't easily interact with editor modules while in-game. Hence the scripting commands instead.

raven sluice
#

@wet shadow So then how do I make that work?

wet shadow
#

Its an example mission, not sure what else to tell you.😅

raven sluice
#

Worth mentioning:

#

(^this guy is a noob^)

#

So I should ask instead, How do I Use it in the first place

wet shadow
#

That was just an example of user made homing script. Making a custom weapon config is far more difficult task.

raven sluice
#

I've actually got some experience with the latter though.

#

I can pretty much make everything I mentioned here:

Let me put it this way, I want to be able to shoot smoll rockets moving at barely 70 m/s, fires at about 500rpm, and tracks infantry targets
And use it as a primary and/or secondary weapon
And they will be ponk.
With the exception of how to make the rounds target infantry

young current
#

I don't think you want to script it

#

Not going to be MP friendly

wet shadow
#

Assuming you dont want to make a whole new projectile I'd use a 'fired' evenhadler to do whatever, in this case spawn the rocket when firing.

raven sluice
#

That's why I went to #arma3_config First! xD Then they told me to go here!

#

And actually, I will be making a whole new projectile

young current
#

Yes well they did not quite understand what you wanted

#

Projectile matters very little

raven sluice
#

Yes well they did not quite understand what you wanted
Fair.

young current
#

The config of ammunition and weapon define the flight characteristics

raven sluice
#

Yeah. I just need to figure out how I can get weaponLockSystem to lock onto squishy smoll bits of flesh.

distant egret
#

Any way to remove the bullet points from the hintC command when using the 2nd syntax?
Or an alternative way to achieve an similar UI without the bulletpoints but with an continue button?

#

I want to use structedText btw, so first syntax isn't available.

exotic flax
#

instead of using an array on the right, simply use a string with <br /> for linebreaks.

#

so something like this:

_texts = [
   "some structured text",
   "more text"
];
"title" hintC (_texts joinString "<br />");
distant egret
#

It would still show the first bullet point

#

That's what I'm trying to get rid of 😛

sinful axle
#

Hi all, can I get some help on a simple script i'm working on but I'm a noob so having trouble. How do params work? Let me explain further. I have a trigger set up and in it I have an addaction that runs a script. This script is supposed to teleport the player using setPos to a marker whose name I want to be able to control as an argument in the addAction. Now, I don't know how to use addaction properly to set that argument and I don't know if my script is setting the params correctly

#

I can paste my code if needed

warm hedge
#

You should to paste

sinful axle
#

this in the trigger

#

player addAction ["test TP", "teleport.sqf", "marker1"];

#

this in the script

#
params [_destmarker];

player setPos (getMarkerPos _destmarker);
#

without the '

still forum
warm hedge
#

Check pinned message to formatting

still forum
#

channel description to find out how to properly do formatting

#

params takes a string in the array, you are not giving it a string, you are missing the quotes

sinful axle
#

so, "_destmarker" instead?

still forum
#

yeah

#

and need to add some placeholders

sinful axle
#

Alright let me wrap my head around it

#

I thought 4th element was priority?

warm hedge
#

He meant not argument

distant egret
#
params ["","","","_destmarker"];

player setPos (getMarkerPos _destmarker);

since you don't need _target, _caller, _actionId leave them empty.

sinful axle
#

Oh, thank you so much

#

and the stuff i put in the trigger is okay?

warm hedge
#

Seems fine

sinful axle
#

Also the reason we're leaving the 3 empty ones is cause addaction already has params built in, correct?

distant egret
#

is it an singleplayer mission?

sinful axle
#

Multi

#

I made sure condition is player in thisList

#

Hoping it runs locally

warm hedge
#

...Oh, wait isn't

distant egret
#

make sure trigger is not only server executable, should work then

still forum
#

I thought 4th element was priority?
huh? what does that mean?
Also the reason we're leaving the 3 empty ones is cause addaction already has params built in, correct?
no, its because you want the 4th argument. if you leave 3 empty, the next one will be 4

sinful axle
#

Yeah, that's what I meant

#

And I misunderstood thinking elements were the things in the syntax

still forum
#

params just grabs values out of _this, what _this will contain depends on what calls that code and what it passes to it

sinful axle
#

in this case _this grabs values from addaction?

#

So _this select 1 would return player?

#

Sorry if these are stupid questions this is my first foray into code of any sort

distant egret
#

it would return the caller so in a way yes.

sinful axle
#

Yes, exactly. Thank you!

still forum
#

_this doesn't grab anything. Its just a variable.
addAction sets _this, _this is just a variable, usually an array that contains parameters that were passed to a function

#

addAction is passing 4 parameters, that it puts into _this variable, that you can then read

sinful axle
#

Got it, thank you

spark turret
spark turret
#

how do i make a loop skip one iteration?

#

i cant remember the command

winter rose
#

in C#, continue
in SQF, wrap with if

spark turret
#

if (true) continue {}; ?

#

i think you mean wrap the whole code into an if statement as you cant skip

winter rose
#

yes

jade abyss
#

continue?!

winter rose
#

THERE IS NO CONTINUE IN SQF

exotic flax
#

if then continue

spark turret
#

no, doesnt work

#

just tried it

winter rose
#
for "_i" from 0 to 10 do
{
  if (_i != 3) then {
    // do stuff
  };
};
spark turret
#

yeah that works.

#

umm so for locations, setVarialbe doesnt have a public? boolean. are they public by default then?

winter rose
#

it has

spark turret
#

it throws an error if i give more than 2 values

#

Syntax:
varspace setVariable [name, value]
Parameters:
varspace: Namespace, Object, Group, Team_Member, Task, Location, Control, Display - variable space in which variable can be set

winter rose
#

ah, true:

missionNamespace, Object or Group

#

then it is local by default

spark turret
#

meh

#

how do i get it to be public?

winter rose
#

remoteExec

spark turret
#

oh cmon really

winter rose
#

and maybe have it next patch… or the other

#

so Locations are indeed local, therefore no "public" thing available

#

no remoteExec for you btw

spark turret
#

?

winter rose
#

you cannot have any public thing related to locations, since they are local and not shared over the network

spark turret
#

yeah i need to remoteExec the locaton creation as well

winter rose
#

if you do sqf [location1, ["myVar", 42] remoteExec ["setVariable"]; your client won't know your location1 at all

#

and you would also target different objects, sooo…

still forum
#

why do you need public vars?

#

Can make a script function, that takes some kind of descriptor and varname and value.
remoteExec that, use descriptor to find proper location on clientside and set variable onto it

spark turret
#

well im gonna move to dummy objects. there is absolutely no advantage in creating local locations if i can just use a global helipad or sth

#

i just use them to store data

slate cypress
#

How would I go about making a simple script which deletes dropped inventory after a certain amount of elapsed time?

spare mauve
#

I think you can do that with the garbage collection system in eden without having to do a script

#

Anyways, how can I have a bar gate to be set as open when the game is started?

winter rose
#

Anyway_, look around animationSource @spare mauve
(and animationNames)

thin owl
#

@spare mauve If you use 3den enhanced, you can do that with the Attributes option on right click.

spare mauve
#

oh alright, I was looking for that but I guess I missed iyt

#

it*

hallow mortar
#

setVariable does have an optional public flag

#

Alternative Syntax
Syntax:
varspace setVariable [name, value, public]

#

(and I know it's not just on the wiki because I've used it myself)

winter rose
#

@hallow mortar yes, he meant with Locations

astral dawn
#

Sorry I can't check now. Is it possible to use setPos kind of commands on locations?

winter rose
#

@astral dawn setPosition

astral dawn
#

Sets the position of a location.
Hmm yes how did I not infer it from function name 🤔

#

Thanks Lou

still forum
#

function? which function?