#arma3_scripting

1 messages ยท Page 653 of 1

heady quiver
#

thats my problem

#

Maybe im not explaining it too well xD

winter rose
#
if (_task != "" && { not completed _task }) then
{
  // task incomplete
} else {
  // no task or task completed
};
#

(pseudo code, don't go copy-paste that)

heady quiver
#

// Check for mission and if mission is completed if !(_currentTask isEqualTo "" && _currentTask call BIS_fnc_taskCompleted == false) exitWith { systemChat "Please complete your current task before starting a new one."; };

#

Seems to be working

winter rose
#

&& { }

#

don't forget, even though it won't break

heady quiver
#

done

#

Alright well that seems be working but im not 100% there yet ๐Ÿค”

#

ah man i think i gotta rework it orsomething its just not what i want xD

#

Even tho BIS_fnc_taskCompleted is true now it still says systemChat "Please complete your current task before starting a new one.";

cosmic lichen
#

if (_task != "" && { not completed _task }) then
I am not sure lazy eval is faster here ๐Ÿ˜„

winter rose
#

yeah well :p

#

@heady quiver you kept your isEqualTo and the ! outside the parenthesesโ€ฆ

heady quiver
#

Yea i just saw that

#

xD

#

it uno reversed it self

#

i got it working now tho

#

if (_currentTask != "" && {_currentTask call BIS_fnc_taskCompleted != true}) exitWith { systemChat "Please complete your current task before starting a new one."; };

#

Anything wrong with this code or?

cosmic lichen
#

No, except that lazy eval is probably slower, but that's minimal

heady quiver
#

it wont be a huge script tho

cosmic lichen
#

Yeah all good. Get it working first.

limber panther
#

hi, i have a quick question, can someone tell me what does this script mean / do ? it's almost everywhere, thank you

#

if ((!isServer) && (player != player)) then {waitUntil {player == player};};

winter rose
limber panther
#

so basically when this is in mission init.sqf it means that the server should wait until a player becomes a player? ๐Ÿ˜…

cosmic lichen
#

it's never executed on server

winter rose
#

it makes the client waiting until the player unit is ready

limber panther
#

this just makes me confused, so it tells the game to wait until a player is recognised as player and not ai, is that correct?

winter rose
#

it's more or less```sqf
if (didJIP) then
{
waitUntil { not isNull player };
};

cosmic lichen
#

AI = Server. This script will never run on the server. So it waits on a client machine and makes 100% sure that the player unit is ready

heady quiver
#

BIS_fnc_spawnGroup; is there a eventHandler to check if the group is dead ๐Ÿ˜„ ?

winter rose
cosmic lichen
#

There will be soon I think

limber panther
#

so there is no point of havng it in init.sqf if it's meant for a dedicated server?

winter rose
cosmic lichen
#

use initPlayerLocal.sqf

#

done

heady quiver
#

Isn't EntityKilled just for a single NPC btw?

limber panther
cosmic lichen
#

What do you wanna do with that group?

heady quiver
#

i want to know if its dead

#

xD

#

all of them

cosmic lichen
#

you could also do waitUntil {sleep 1; isNull _group}; //Not tested

#

or waitUntil {sleep 1; units_group isEqualTo []}; //Not tested

heady quiver
#

Thats not gonna work if the script is only triggered once right?

cosmic lichen
#

It depends.

heady quiver
#

thats why i prob need EH

#

Maybe a while loop?

cosmic lichen
#

If you tell us what it is you want to do, we might be able to tell you.

heady quiver
#

Alright so group one spawns in and then after that group is dead i want a second group to spawn in (spawns about 500 - 1km away and moves into area)

cosmic lichen
#

Wait until is what you want.

heady quiver
#

That works even tho i only call the script once?

cosmic lichen
#

waitUntil {blub};

...
Spawn 2nd group

heady quiver
#

Mmm im gonna leave that for a bit

#

Is there a way where i can see the folder directory order?
[_spawn_area, east, (configFile >> "CfgGroups" >> "East" >> "3CB Takistan Insurgents" >> "Infantry" >> "Fire Team (AA)")] call BIS_fnc_spawnGroup;

trying to spawn a group not sure if this is the right path

cosmic lichen
#

Config Viewer?

heady quiver
#

Ah yea

#

btw that global variable doesnt work

#

me mate just tested and he is able to start another mission

#

maybe i need lil break

cosmic lichen
#

Might be a good idea to post the whole script

heady quiver
#

Just post it here?

cosmic lichen
heady quiver
cosmic lichen
#

you are executing this how?

heady quiver
#

init.sqf and i exec a custom file

spark turret
#

Quick tipp for random names: use time

heady quiver
#

enableSaving true; execVM"missions.sqf";

cosmic lichen
#

missionNamespace setVariable ["currentTaskOn", taskName]; โ†’ missionNamespace setVariable ["currentTaskOn", taskName, true];

#
   objective = format["%1",object] createVehicle _spawn_area;```
No format needed here
heady quiver
#

ah oke

#

but

#

Did you find a reason why global thingy not working :d ?

cosmic lichen
#

yes, because you never set the variable globally.

heady quiver
#

WHAAT

#

Could you pleeaase fix it xD

cosmic lichen
#

Read what I wrote

heady quiver
#

yes, because you never set the variable globally.

winter rose
#

then set it globally?

cosmic lichen
#

Read

heady quiver
#

yes yes

#

i read

cosmic lichen
#

I literally posted the solution ๐Ÿ˜„

heady quiver
#

xD

#

OH

#

did i forget the public variable at the end to true

winter rose
heady quiver
#

Yeaa didnt work

#

missionNamespace setVariable ["currentTaskOn", taskName, true];

winter rose
#

what is the value of taskName? ๐Ÿ‘€

heady quiver
#

taskName = format["task_%1", rndNmb];

winter rose
#

then it worked

heady quiver
#

i activated a task and then my buddy also

winter rose
#

there is something else that is wrong yeah

heady quiver
#

which shouldn't be possible

#

`
// Check if there is already a mission activated.
if (_currentTask != "" && {_currentTask call BIS_fnc_taskCompleted != true}) exitWith {
systemChat "Please complete your current task before starting a new one.";
};

`

#

private _currentTask = missionNamespace getVariable ["currentTaskOn",""];

winter rose
#

if your script is local (which it is since you use systemChat), every player can have only one task

heady quiver
#

Yes thats true but thats why i wanted it globally

#

so only one task at a time (for entire bluefor)

winter rose
#

how do you add the task? modules?

heady quiver
#

Code

#

private _myTask = [west, taskName, [_description, _title, _waypoint], objNull, true, 0, true, "destroy"] call BIS_fnc_taskCreate;

#

The whole task thingy works

#

the 'check' just doesnt work

#

i mean it works for me but as soon as someone joins he is also able to start one

#

thats where the problem is

winter rose
#

how do you get the _currentTask?

heady quiver
#

private _currentTask = missionNamespace getVariable ["currentTaskOn",""];

winter rose
#

everything seems clean, so maybe it is a code organisation issue?

heady quiver
#

mmm

cosmic lichen
#

There is the code @winter rose

winter rose
heady quiver
#

yes sir

winter rose
#

setVariable set to , true] then (since the code)

heady quiver
#

Yea already did that

#

Then tested it with a friend and nope

cosmic lichen
#

I guess I have to fire up my dedicated server ๐Ÿ˜„

heady quiver
#

Haha.. well if you have time for me ๐Ÿ˜„

#

I appreciate

cosmic lichen
#

xD

#

taskName is a very bad variable name

#

Since it's a new command in the version I use ๐Ÿ˜„

heady quiver
#

damn

#

should i refactor that then

winter rose
#

private _taskName =

cosmic lichen
#

you know what?

#

It works as expected ๐Ÿคทโ€โ™€๏ธ

heady quiver
#

What..

#

You kidding me

cosmic lichen
#

no

heady quiver
#

it works locally yea

#

I can't start one twice but my mate can start one and i can start one after that

cosmic lichen
#

I have hosted a mission

heady quiver
#

i'm bamboozled

#

you didnt change any code

#

code *

cosmic lichen
#

no

heady quiver
#

wtf.

cosmic lichen
#

๐Ÿช„

heady quiver
#

Try this

#

Put a laptop or something down

#

this addAction ["Search & Destroy", { call createDestroyMission; }, nil,1.5, true, true, "", "true", 3, false, "", "" ];

#

prob wanna tidy that up a bit lolz

#

see if both can activate

cosmic lichen
#

works ๐Ÿ˜„

heady quiver
#

i mean

#

whaaaaaaaaat

cosmic lichen
#

once missionNamespace setVariable ["currentTaskOn", _taskName, true]; is executed, it's set globally, there is no way around it

heady quiver
#

how does your init look like

#

enableSaving true; execVM"missions.sqf";

mine is just this

cosmic lichen
#

I just executed the code globally in debug config

#

which is pretty much the same as init.sqf

heady quiver
#

mmm

cosmic lichen
#

then code is available on each client, ready to be called

#

That's what I did then.

heady quiver
#

Could you join my session and activate it for me ๐Ÿ˜„ ?

little raptor
cosmic lichen
#

True, many things about that script could be better ๐Ÿ˜„

#

But first he needs to get it working.

heady quiver
#

im new

#

xD

cosmic lichen
#

But since @little raptor Is here now. He can take care of you ๐Ÿ˜„

little raptor
#

no notlikemeow

heady quiver
#

lel

cosmic lichen
#

yes meowthis

heady quiver
#

revo can you see if you can join my session?

#

Server name is BlackShadows Testing

cosmic lichen
#

I cannot

heady quiver
#

oh ok

cosmic lichen
#

I am currently running a special a3 version

heady quiver
#

ah ok

little raptor
#

me too

#

dev

heady quiver
#

mmmm

#

well if you say it works i gotta test later when mate is on

cosmic lichen
#

plot twist: Your mate is secretly resetting that task variable globally and then telling you it doesn't work ๐Ÿ˜„

heady quiver
#

Well im gonna leave that bit for now then and see if i can spawn some compositions

little raptor
#

are you using init.sqf @heady quiver ?

heady quiver
#

yes sir

little raptor
#

or object init?

#

what was the problem again?

heady quiver
#

Inside iniq.sqf

enableSaving true; execVM"missions.sqf";

#

Well

#

Long story short

#

Only 1 mission allowed at the time (which is checkable via global stored var) but for some reason i was able to start a mission and my friend also.

#

`
private _currentTask = missionNamespace getVariable ["currentTaskOn",""];

     // Check if there is already a mission activated.
     if (_currentTask != "" && {_currentTask call BIS_fnc_taskCompleted != true}) exitWith {
            systemChat "Please complete your current task before starting a new one.";
     };

`

this part should have stop him starting another one

#

But @cosmic lichen just tested and hes own server and works for him so i dont know

little raptor
#

_currentTask call BIS_fnc_taskCompleted != true -> !(_currentTask call BIS_fnc_taskCompleted)

not the issue tho

#

@heady quiver what's your setter code?

#

task setter I mean

heady quiver
little raptor
# heady quiver https://sqfbin.com/iteyuqevewarunahuxoh

Revo is right
It should've worked
Are you sure your friend has this task too?

Also this is a terrible idea:

rndNmb = ceil (random 9999);
private _taskName = format["task_%1", rndNmb];

use increments
Also:

[taskName, "SUCCEEDED"] call BIS_fnc_taskSetState;

wrong again. you should use that "currentTaskOn" variable

limber panther
#

hi, is here anyone familiar with anomaly (paranormal) scripts made by alias?

#

i need a little help

winter rose
#

wat

limber panther
#

these โฌ†๏ธ

winter rose
#

oh! did not know it was a thing itself ๐Ÿ˜„

limber panther
#

can you help me with those?

heady quiver
#

@little raptor Yea on 'Search & Destroy' button we get that task so not sure why the check didnt work

winter rose
limber panther
#

that's pity but they are really great you should check them out, it gives arma a totally new dimension

heady quiver
#

seems like i fucked something up and now nothing works

#

Task ID cannot be empty string lolz

#

Alright fixed it again lolz

#

I know the code is shit but it should've worked right i mean..

dusky pier
#

Hi, i trying to make something like "key codes" for loot box.
Trying to make a message (if player don't have codes - it gives message and not allow player to look into gear)

Tryed this way, but inventory is not closed for player...

_box addEventHandler ["ContainerOpened",{
        params ["_container", "_unit"];
        if (isNil 'the_razlom_keys_token') then {
            the_razlom_keys_token = false;
        };
        if !(the_razlom_keys_token) then {
            titleText['ะ’ะพะทัŒะผะธั‚ะต ะบะพะดั‹ ัƒ ะฝะฐั‡ะฐะปัŒะฝะธะบะฐ ะะ˜ะ˜ "ะ ะฐะทะปะพะผ"', "PLAIN"];
            waitUntil {!(isNull findDisplay 602)};
            systemChat "Gear Opened";
            closeDialog 0;
            false 
        };
    }];

SystemChat return Gear Opened, but gear dialog is not getting closed...

is possible to prevent open gear dialog with that event handler? Thank you!

little raptor
#

you can try this:

[] spawn {
  _disp = displayNull;
  _endTime = time + 10;
  waitUntil {
  _disp = uiNamespace getVariable ["RscDisplayInventory", displayNull];
  !isNull _disp || time > _endTime
  };
  _disp closeDisplay 2;
}
#

(in MP you should execute that for the client that opened the container)

#

@dusky pier also you can use the lockInventory command

#

when the user acquires the key, unlock it for them

dusky pier
#

@little raptor ty, but i wanted to give message for player, and lock status is must be local (not same for all players)

little raptor
#

it is local

#

read that page

dusky pier
#

@little raptor ty a lot! Understand now

heady quiver
#

`
group_spawn = [_spawn_area_group_1 , east, _listEnemies, [], [], [0.2, 0.5]] call BIS_fnc_spawnGroup;
group_spawn_2 = [_spawn_area_group_2 , east, _listEnemies2, [], [], [0.2, 0.6]] call BIS_fnc_spawnGroup;

   group_spawn_2 move (position group_spawn);

`

How do i force group_1 to move to group 2 ๐Ÿ˜„ ?

little raptor
heady quiver
#

ty ty

#

Btw i use _spawn_area = [] call BIS_fnc_randomPos; this to get a random pos on the map but its mostly in the open, is there also a way to put near buildings and such?

#

oh sorry.

#

i keep forgetting -.-

#

_spawn_area = [] call BIS_fnc_randomPos;

heady quiver
#

ah

agile pumice
#

Where can I find the function that does the "animation" for locked doors?

exotic flax
candid cape
#

Hi, one question I want to make a system , basically it's like a jail. I want to do that one player can arrest an other player. I know how to do this, my question is that I want to make a variable that have to be permanently, basically , if you disconnect you still have the same time. Idk how to make this variable , maybe with mysql or idk. If anyone can help me pls.

crude vigil
#

@candid cape You do not need any outer source like a database unless you want this feature to persist in such scenarios where server has to restart... If you do not care about such scenario, what you basically can do is, pass the values such as player UID and either how much time left (upon disconnection) or save current time and how long is player jailed..

#

and create an event for joining and see if these player had been "jailed" before. You can also use database solution if you got something in your hand, such as if jail time is long periods like days, it could also be done like that. It is a matter of preferability but not necessary in this scenario.

#

@hardy tree Repeatable trigger already covers you in this scenario, so I believe your main question is, what should you do so in a scenario the player reenters the area, the Hellos do not flow again for a certain amount of time, right?

crude vigil
#

I mean there are ways but it would be nasty doing this...

#

Using triggers

#

May I suggest you to check out cfgSentences?

#

@hardy tree

#

Because from what I understand, you are trying to create a dialog in a trigger

#

am I right?

#

If you are trying to achieve something else, that depends on what the continuing script will be.

dreamy kestrel
#

concerning finite state machines (FSM) ...
background: working on an A3 project and considering how to approach "production", i.e. factory sectors that produce resources; then similarly "logistics", i.e. lines that deliver resources between locations.
Q: what is the overhead for establishing an FSM, over all? is it like an execVM running?
Q: in particular, I am considering whether it would be better for "one FSM to rule them all", i.e. production FSM, or "FSM per concern", i.e. FSM per factory sector, for instance.
obviously, states are states, transitions are transitions, FSM does not care about all that, it is in what I identify as such... notwithstanding overhead considerations.

exotic flax
#

Q: what is the overhead for establishing an FSM, over all? is it like an execVM running?
I don't think there's a real overhead compared to (other) scripted solutions, if not better performance wise.
Q: in particular, I am considering whether it would be better for "one FSM to rule them all", i.e. production FSM, or "FSM per concern", i.e. FSM per factory sector, for instance.
Just to make it simple for yourself I would make different FSM's based on the type of purpose.
For example; AI uses FSM's to define their combat state, and is even split per combat state so it can behave differently per state.
ACE Medical uses a FSM as well to handle the different states of a player/AI regarding their medical status. And they work perfectly fine at the same time.

So yes; FSM does take resources, because it's constantly checking for it's current state and running scripts to handle that. But the alternative is a while {true} do {}; with all kind of checks build in to do the same.

You could use the default FSM stuff in Arma, or take a look at the scripted FSM in CBA (either fully scripted or through classes) which makes it a lot easier to work with.

crude vigil
#

@hardy tree Without developing an additional script that records on what point the dialog is and handle interruptions, I doubt you can achieve that in a single trigger.

#

About your second question

#

You need to modify identity of the character which can be done through setName command (if u re in 3Den, I believe there is an option to assign name to units)

dreamy kestrel
#

Just to make it simple for yourself I would make different FSM's based on the type of purpose.
Well, of course. That was the ground level boundary I would consider, of course. Would not make sense for one FSM to do both production and logistics, for instance.
No, rather, my question was more one of whether it made sense to have one FSM "manage" all of production, or FSM per factory sector, for instance.
Sounds like either is possible, just depends on what I do arranging the machines.

tender fossil
#
"WFBE_CL_VAR_SKILL_WEST" addPublicVariableEventHandler {

    private ["_skillWestRequest","_skillWestRequestID","_skillWestRequestIDplayerSkill","_skillWest"];

    _skillWestRequest = WFBE_CL_VAR_SKILL_WEST;
    _skillWestRequestID = WFBE_CL_VAR_SKILL_WEST select 0;
    _skillWestRequestIDplayerSkill = WFBE_CL_VAR_SKILL_WEST select 1;

    _skillWest = missionNamespace getVariable format ["WFBE_CL_VAR_SKILL_WEST_REQUESTID_%1", _skillWestRequestID];

    missionNamespace setVariable [format ["WFBE_CL_VAR_SKILL_WEST_REQUESTID_%1", _skillWestRequestID], _skillWest set [count _skillWest, _skillWestRequestIDplayerSkill]];

};

Should this work? ๐Ÿ˜„

little raptor
#

no

hallow mortar
#

For AI, side chat displays the name of the unit's group. So you need to give the group a name using setGroupID.
Note: if this is a multiplayer mission, both setGroupID and sideChat should be remoteExec'd from a server-only script to avoid potential locality issues; don't forget to set the JIP flag to true when remoteExec'ing setGroupID.

violet gull
#

Is there a way to clear out all the <objNull> agents in the agents array?

cosmic lichen
#

array - [objNull] maybe

hollow ibex
#

Hello hoping i can get some help i have been able to figure so much out on my own with trial and error but i cant figure this out. Basically i wish to change the intro music to my own that i want to use. the first line of code is what is included in the file already for this mission then below that is my CfgMusic. I am wondering how i would get my custom song to fit into this every attempt i do I either get errors or no errors but no music plays either.

Client_Fncs

INS_intro_playTrack = {
    //Plays a random intro track:
    // 0 => title, 1 => start delay
    playMusic "";
    private _track = selectRandom
    [
        [["LeadTrack05_F", 1], 33],
        [["AmbientTrack01a_F", 32], 33],
        [["LeadTrack01_F_Bootcamp", 36], 32.9],
        [["Track06_CarnHeli", 1], 33],
        [["BackgroundTrack01a_F", 63], 33],
        [["BackgroundTrack01a_F", 27], 33],
        [["EventTrack02_F_EPA", 1.63], 34.3],
        [["EventTrack01_F_EPA", 1.63], 34.3],
        [["LeadTrack03_F_EPA",60.85], 33.678]
    ];
    0 fadeMusic 1;
    playMusic (_track # 0);
    uiSleep (_track # 1);
    playMusic "";
};

Description.ext

class CfgMusic
{
    // List of tracks (.ogg files without the .ogg extension)
    tracks[] = {intro};

    // Definition for each sound
    class intro
    {
        name = "intro"; // Name for mission editor
        sound[] = {\music\intro.ogg, db + 0, 1.0};
        titles[] = {0, ""};
    };
};
languid oyster
#

With

_turrets = [_unit] call BIS_fnc_getTurrets;

I can get the turrets data like this:

"Turret: bin\config.bin/CfgVehicles/B_MBT_01_TUSK_F"
"Turret: bin\config.bin/CfgVehicles/B_MBT_01_TUSK_F/Turrets/MainTurret"
"Turret: bin\config.bin/CfgVehicles/B_MBT_01_TUSK_F/Turrets/MainTurret/Turrets/CommanderOptics"

Is there any way to get the turret paths from this data? If not, do I always get the paths in the same order by this?:

_paths = [[-1]] + allTurrets _unit;
quasi sedge
#

How to implement such thing with ACE interaction menu:

if i'm squad leader and my cursor target is bot from my squad,
i want ace interaction on this bot with
action: load bot as passanger to the nearest vehicle(distance to vehicle < 10m)

spark turret
#

You create the action that loads the object into the closest vehicle, and then add it to all group members

finite sail
#

ok, locality question... dedi/client stuff...
I have a bobcat spawn on the server it has an epecontactstart EH added to it. Players drive the bobcat to do stuff.
later, I need to remove the EH, I'm using removealleventhandlers for that...
does the fact the bobcat changed from server to client mean i must remoteexec everywhere the removealleventhandlers command?

spark turret
#

Why would the bobcat change locality?

#

The eventhandlers might be local to each client

finite sail
#

because player got in to drive it

spark turret
#

That doesnt change locality afaik

still forum
#

it does.

#

vehicle are local to driver and chance locality when they need to

finite sail
#

yeah, testing it now, its owner 2 when spawned, and 3 after test client gets in it

heady quiver
#

Hi how would i run a function everytime between 10 and 20 minutes ๐Ÿ™‚ ?

#
_max_delay = 1200;
_avg_delay = 600;
_min_delay = 300;

sleep (random [_min_delay,_avg_delay,_max_delay]);};

Would this work ๐Ÿ˜„ ?

warm hedge
#

sleep takes a number in seconds

heady quiver
#

Yea so i can do 1200 (20m) and 600 (10m) and 300 (5m)

#

Right ;D ?

warm hedge
#

Yes

heady quiver
#

Do i need to while wrap it or something so it keeps looping ?

spark turret
#

_min_delay + random 900 //min 300, max 900, random inbetween

#

While loop

finite sail
heady quiver
#
while {true} do {
    // Do some code here
    
    // Sleep
    sleep (random [_min_delay,_avg_delay,_max_delay]);};

}

Like this?

warm hedge
#

while takes a code to run, also check the pinned message

glacial anvil
#

while(condition), no?

warm hedge
#

while {condition} do {};

heady quiver
#

ah

#


randomAiSpawnToPlayer = {

// Settings
_max_delay = 700;
_avg_delay = 600;
_min_delay = 500;

    while {true} do {
    
        // Do some code here
        // Find safe position around player between (x and x meters)
        _player_circle = [player, 400, 700, 0, 0, 20, 0] call BIS_fnc_findSafePos;
    
        // Enemy List
        list = ["UK3CB_TKM_O_GL","UK3CB_TKM_O_ENG","UK3CB_TKM_O_IED","UK3CB_TKM_O_RIF1","UK3CB_TKM_O_SPOT","UK3CB_TKM_O_SL"];
    
        // Spawn enemy
        group_spawn = [_player_circle, east, list, [], [], [0.3, 0.5]] call BIS_fnc_spawnGroup;
    
        // Make the enemy move to player location
        group_spawn move (position player);
    
        // Sleep
        sleep (random [_min_delay,_avg_delay,_max_delay]);};
    
    }

};
#

Does this make sense?

warm hedge
#

No

heady quiver
#

damn

#

xD

glacial anvil
#

So I've got a class CfgDifficultyPresets defined in a config.cpp. Packed it into a .pbo, loaded it up, and in SP the difficulty preset shows up in the dropdown just fine, but cant seem to get it to show up on the server in the #missions selection, what could I be missing?

heady quiver
#

Oh yea my bad

#

But this keeps looping if i call it right?

warm hedge
#

Not sure where you do that but you should spawn it

glacial anvil
#

wouldn't while{true} just become a lag generator?

warm hedge
#

It wouldn't

heady quiver
#

its sleeps right

glacial anvil
#

ah rog

#

anyone have anything on the difficulty preset problemo i having?

#

it is, rog - ill try there

#

thanks

slate cypress
#

Is the difference in network impact between dynamic simulation and creating/destroying objects huge?

heady quiver
#

Anyway worked with alive framework?

real tartan
#

when holding BIS_fnc_holdActionAdd it will fade out after some 10+ seconds and you don't see progress, is there a way to prevent this?

winter rose
real tartan
#

scroll wheel did not help

cosmic lichen
gloomy cradle
#

Sorry

cosmic lichen
#

delete the msg here and post it there

gloomy cradle
#

๐Ÿ‘

heady quiver
#

Revo, you got experience with alive framework?

cosmic lichen
#

nope

heady quiver
#

damn

spark turret
#

Alive has a discord

quasi rover
#
for 'x' from 0 to 1 step 0 do {
 
};

what it mean?

slate cypress
quasi rover
#

so, what it mean, if interval 0?

vague geode
cosmic lichen
#

besides being pointless.

quasi rover
#

thanks, it was called by 0 spawn

still forum
quasi rover
#

thx, Dedmen.

winter rose
#

an ugly one

median abyss
#

Can you poll the game for keystates, without using inputAction or eventHandler? (Im inside a mouse event handler, and want to know if any modifier key is pressed. And inputAction requires the key to be bound already)

winter rose
median abyss
#

Yes, but I'm in onMouseZChanged. So no modifiers are sent to it.
(params ["_displayorcontrol", "_scroll"];)

winter rose
#

ah, shoot indeed

#

(could create a feedback ticket forโ€ฆ 2.04)
but why not inputAction?

exotic flax
#

or you can combine it with 'onKeDown', set a global variable (eg. TAG_CTRL_DOWN = true;) and check that inside your EH.

#

it's not perfect, but probably the best you can do

median abyss
#

Then it's probably way better/cleaner to just assign a keybinding to it

#

So that I can use inputAction instead

exotic flax
#

Or use CBA Keybinds, those are easier to manage IMHO

median abyss
#

That's probably easier yeah

#

Thanks ๐Ÿ™‚

real tartan
#

where can I find more about

LOD: String - level of details to use. Possible values are: "FIRE", "VIEW", "GEOM", "IFIRE", "PHYSX"

and meaning of those values

alpine spear
#

How would you add an Action to an info stand which deletes a vehicle inside a specified trigger?

exotic flax
#

the wiki is a great source about how to script stuff

dreamy kestrel
#

Why is this an invalid number in expression?

onMapSingleClick {
  private _obj = vehicles select {typeOf _x isEqualTo "..."} select 0;
  _obj setPos [(_pos#0), (_pos#1), 0.1];
  //                             ^^^^^ (?)
  onMapSingleClick "";
};

Is the SQF parser having difficult with the code block?
According to the examples, code blocks seem to be allowed?
https://community.bistudio.com/wiki/onMapSingleClick

cosmic lichen
#

Works fine for me

winter rose
dreamy kestrel
#

I see the note in the docs actually. onMapSingleClick might just be borked is the reason, with the migration path being the mission event handler, which does work.

winter rose
#

huh โ€ฆ ?

crude prism
#

Good evening, is it possible to remove the action to open a door from a door, and script it in to be a addAction at another place?
Like you have to be at the top of an ATC-Tower to open a hangar door.

noble tiger
#

does anyone have any simple clean up scripts that work on dedicated servers?

noble tiger
#

cleans up dead bodys, destroyed vehicles, and dropped items that are not placed from the editor

winter rose
#

there is the garbage collector, see Eden options :)

noble tiger
#

i will look, thanks ๐Ÿ˜„

surreal peak
#

Asking here, because it is the only place I can think of. Is there a way to use an external script (python/c/etc.) to get the list of players on a server? I know some websites can do it so I was wondering if anyone could point me in the right direction

#

trying to make a script to compare peolpe in arma vs people in TS

#

Also could you @ me if you know, as I am unluckly to remember this come morning

exotic flax
#

Seach for RCON scripts in any language you want, connect to the server and get what you need

surreal peak
#

Could you link me? Applogies, but my internet searching are not returning what I think is the correct scripts

exotic flax
surreal peak
#

Ah, sorry. TYVM

dreamy kestrel
#

Q: is there a variable we can use, like vehicles except for static objects, like cargo buildings?

still forum
#

nearestTerrainObjects

#

buildings are terrain objects

#

or maybe nearestObjects should also return mission placed ones.
or allMissionObjects if you wanna go crazy

dreamy kestrel
#

well, perhaps I should clarify. these are actually built objects, cargo buildings. i.e. created via createVehicleLocal and createVehicle

still forum
#

nearestobjects then

#

or nearObjects

#

or similar

#

see related commands on the wiki

dreamy kestrel
#

right. okay dokay then.

#

figured as much, wasn't certain if there was an easier way

#

the rub being we need to know a reference object, location, etc, which is not the worst thing. anywho.

still forum
#

or just a position

dreamy kestrel
#

hmm actually this works also nearestObjects [getPos objNull, ["..."], 50000] adjust range accordingly. which object or pos is [0, 0, 0]

still forum
#

getPos objNull you can also just write [0,0,0]

#

also if you just want all objects and don't care about where they are, nearestObjects is a bad choice as it sorts all objects by distance, nearObjects doesn't sort

dreamy kestrel
#

I see. so it still makes sense to do some persistent cataloging to avoid that case. plus for ordering anyway, makes sense.

hallow mortar
#

Does removeAllActions remove holdActions as well as normal actions?

still forum
#

normal only

#

hold actions are scripted

#

normal actions are engine

hallow mortar
#

I see.
Followup: does the "remove on completion" parameter of BIS_fnc_holdActionAdd have global effect, or only local?

agile pumice
#

Am I using BIS_fnc_doorOpen wrong here?

case "openDoor": { //this only works with a radius of 10
        private _doorArr = [cursorTarget] call hachii_door_breaching_fnc_getTargetDoors;
        if(count _doorArr > 0) then {
            _building = _doorArr select 0;
            _doorRot = (_doorArr select 1) select 0;
            _doorNum = (_doorArr select 1) select 2;
            _doorBreached = _building getVariable [format["Door_%1_Breached"], false];
            if (_doorBreached) then {
                [_building, _doorRot, nil, nil, 1] call BIS_fnc_doorNoHandleOpen;
                systemChat "1";
            } else {
                [_building, _doorRot, nil, nil, 0.25] call BIS_fnc_doorOpen;
                systemChat "2";
            };
        };
    };
``` outputs ``2`` but door doesn't open. BIS_fnc_doorNoHandleOpen works.
#

[_building, _doorNum, 1] call BIS_fnc_door; works fine

#

just curious as to why doorOpen isn't

hallow mortar
#

Can you try doorOpen with a whole number for the animation phase? It may be that the animation doesn't support partial opening for whatever reason

agile pumice
#

both 1 and 1.0 don't do anything

hallow mortar
#

of course, but that doesn't mean every door has the same animation setup. There are plenty of animations in the game that only change at the 0 and 1 states. It was worth a shot just because you never know what strange limitations you might hit in Arma.

#

Okay, so BIS_fnc_door uses animateSource but BIS_fnc_doorOpen uses animate. You need a different animation name.

agile pumice
#

I was comparing doorOpen to doorNoHandleOpen which I would expect to use the same animat method

little raptor
agile pumice
#

yeah I am now

#
private _doorArr = [cursorTarget] call hachii_door_breaching_fnc_getTargetDoors;
    if(count _doorArr > 0) then {
      _building = _doorArr select 0;
      _doorRot = (_doorArr select 1) select 0;
      _doorNum = (_doorArr select 1) select 2;
      _doorBreached = _building getVariable [format["Door_%1_Breached"], false];
            if (_doorBreached) then {
                _building animate [format["Door_%1_rot",_doorNum], 1, true];
      } else {
                _building animate [format["Door_%1_rot",_doorNum], 1, true];
                _building animate [format["Door_%1_handle",_doorNum], 1, true];
      };
    };
#

I just wanted to know what was up with that particular function

little raptor
# agile pumice I just wanted to know what was up with that particular function

It's a stupid function. You can even tell by looking at its parameters:

Parameters:
building: Object - (Optional, default objNull)
doorAnimation: String - (Optional, default "")
upDownAnimation: String - (Optional, default "")
downUpAnimation: String - (Optional, default "")
animationPhase: Number - (Optional, default 1)

#

all parameters are "optional" meowsweats

limber panther
#

hello, i'm wondering, is sun on the sky in arma an actual object? is it possible to create a script that can refer to the sun?

#

(asking because i'm trying to fix something broken)

little raptor
cerulean cloak
#
cleared = true;
_this pushback 1000;
sleep (900 + (random [-30, 0, 30]))
while {cleared} do
    {    
        _missile = createvehicle ["ammo_Missile_cruise_01", _this];
        [_missile, [0, -90, 0]] call BIS_fnc_setObjectRotation;
        _missile setvelocity [0, 0, -100];
    };

For some reason this is throwing a missing ; error in line 4 when I try to run it from the debug console. Anyone know what I've done wrong?

hallow mortar
#

I assume _this is correctly formatted - is an array of numbers, starts with 2 elements before you pushback 1000?

exotic flax
#

because it's missing a ; on line 4

cerulean cloak
#

Yes

hallow mortar
#

grezvany is right

#

although it's actually missing from line 3 in what you pasted

cerulean cloak
#

Where should it go though?

hallow mortar
#

At the end of the line

exotic flax
#

at the end of sleep (900 + (random [-30, 0, 30])) <--

cerulean cloak
#

Ah, I see it now.

candid cape
#

Hi, one question. Anyone can helpme with a DB?. Thanks!!

exotic flax
#

if we know the problem we might be able to help

limber panther
hallow mortar
#

hard to say without seeing the script

candid cape
hallow mortar
#

the parameter is passed to the script when it's execVM'd, and the script receives that and saves it as a variable...then never refers to it again

limber panther
#

so day time / night time activity with parameter true / false in init.sqf is just fake?

hallow mortar
#

as far as I can tell, it would be active at all times regardless of what you set the parameter to

#

I'm hesitant to describe it as "fake", as such a thing could easily be done - it's more likely that the person just forgot about it, perhaps when making the major change to the script structure that's described in the changelog.

limber panther
#

that's actually true, even when the parameter is false it keeps working 24/7

#

would you be able to fix it?

hallow mortar
#

ehhh...it is technically possible. You would use something like this:

if (sunOrMoon > 0.4) then {exitWith {}};

But it needs to go somewhere in the loops that run the entity's behaviour, and it needs to have proper handling to pause the entity, put it somewhere safe, and turn it back on when it's night again. That's doable but I can't read this script well enough to put it in myself.

#

For best results, find a scripter who reads this language (not sure what language it is, sorry) or contact the person who originally wrote it and let them know that the functionality is missing.

limber panther
#

well i tried talking to him but he seems to be overloaded with work

#

@hallow mortar By the way, you seems to be a person that knows a lot about it, would you mind helping me with scripts for my server? I would really appreciate it. (Nothing complex like this strigoi, i just need simple things like addaction and these.) I'm lost in it.

hallow mortar
#

What specifically do you need?

limber panther
#

Can i send you a private message? I don't want to bother other people here with not-related discussion.

hallow mortar
#

Go for it.

queen cargo
paper fulcrum
#

hello there fine lord of scripting

#

I want to save player loadouts between missions is there a script done for this or a tutorial?

warm hedge
#

What is the use case? Between missions? You meaning campaign missions or scenarios?

timid tulip
timid tulip
#

Ill DM you a link, but its alive, so its a beefy boy mod

paper fulcrum
warm hedge
#

Then it should have a builtin function to do that

paper fulcrum
#

ah very cool, thanks

warm hedge
#

Well, I've never done campaign thingies so... gimmie bit, I think I'm closing to the thing

scarlet flume
#

need some help please, i trying to make a 2 phase objective with to stage targets/ one target is ID75 and the other is ID76 they are all set up but how do i set a tigger to "tigger" when both are killed would i use [ !Alive ID75; !Alive ID76; ]

warm hedge
paper fulcrum
#

๐Ÿ‘

scarlet flume
#

that simple REEEEEE

#

while i have you now that that problem is fixed on that said tigger, on activation conditions what would i use to enabledamage to ID77 and ID78 (the next set of objectives)

warm hedge
#

What do you mean? What is the situation?

scarlet flume
#

co op mission, take out the 1st two targets, that will enable the next two

warm hedge
#

allowDamage?

scarlet flume
#

just pop that in?

warm hedge
scarlet flume
#

very sorry this wiki is hard to use/understand, im to use
ID77_object allowDamage true and ID78_object allowDamage true;

warm hedge
#

No no no... I thought it's easy enough

ID77 allowDamage true; ID78 allowDamage true;```
scarlet flume
#

im trying so hard to understand the wiki

ionic tinsel
#

So I'm trying to get a basic radio dialogue flow going for a singleplayer mission I'm trying to make. I've got a test script set up for that now, but it's behaving oddly, likely where its sleep function is concerned. Here's what I've got so far:

sleep (5.3); // Pause for 5.3 seconds...
player sideChat "Well guess what? You're not." // Play the final dialogue line.```
When I try running it in my mission, it just plays both dialogue lines at once and throws an error, seemingly related to the sleep function. How could I fix my script here?
warm hedge
#

Where/how do you run it?

ionic tinsel
#

I'm running it via a Trigger. I don't really know how else to run scripts in the 3DEN Editor.

warm hedge
#

That's why. tldr; you can't do sleep in some conditions/places. Use something like:sqf 0 spawn { player sideChat "bra bra"; sleep 1; player sideChat "bra bra"; };

ionic tinsel
#

Looks like adding the 0 spawn {} part fixed it all up for me.

#

Also, how do you play audio files with the dialogue?

warm hedge
#

Well there's plenty of ways IMO, so can't say which is better

#

Probably simplest way is just say3D or such command

pine solstice
#

hello all! i was wondering if some nice person could help?
i would like to know how to fade out the sound and not just suddenly not just stop

_source = playSound mission_intro;
_source spawn 
{
    sleep 20; 

    deleteVehicle _this;
    
};
warm hedge
#

Unfortunately no

winter rose
pine solstice
#

i will try that thank you

vague geode
young current
#

It's not a key?

spark turret
# ionic tinsel Looks like adding the 0 spawn {} part fixed it all up for me.

To expand on that: if you run code from a trigger window or an init field of a unit, thats a unscheduled environment, meaning it can not suspend code = no sleeps, no while loops. Nothing timed. All happens within one frame.

By using _handle = spawn {mycode} you "spawn" new code, in a different , suspendable environment. There you can use sleeps and while loops.
It runs parallel to the game

finite sail
#

no while loops in unscheduled?

#

they are limited to 10k spins

warm hedge
#

Intended. IIRC it's 50K but so won't cause a hang

still forum
#

I thought 10k

#

yes you can use while loops in unscheduled.
while doesn't automatically mean "loop forever" a while loop can also be 5 iterations

finite sail
#

biki says 10k

vague geode
dreamy kestrel
#

Q: if I have an array of objects and I want to make a copy of it, i.e. +[...], that takes a snapshot of the array, and not a copy of all of the objects, correct?
IOW, I want to get a snapshot of the array without necessarily risking changes to the array midstream.

still forum
#

it copies the array

#

not the objects no

#

well it copies the object references/values

pine solstice
#

is there a way to make this text bigger

["Special ArmA Service Presents...",format["S.A.S OPERATIONS \n%1",toupper(worldname)],"By Gaffey","Don't Kill Civillians..."] spawn Core_intro;
still forum
#

what is "Core_intro" ?

#

Btw the game's name is Arma, not ArmA ๐Ÿ™‚

pine solstice
still forum
#

the code you posted has absolutely nothing about text size

#

not enough information to tell you if there is a way or not

pine solstice
#
{ 109 cutText [format["%1",_x],"PLAIN",5]; sleep _time; }forEach _titles;

109 cutText ["","PLAIN DOWN",0];
still forum
#

you can make big text with structured text

#

btw your format there doesn't do anything at all. its just useless

#

but. Its useful for structured text

#

109 cutText [format["<t size=2.0>%1</t>",_x],"PLAIN",5, true, true];

distant oyster
still forum
#

I took that from wiki page example :u

pine solstice
#

thanks guys that worked nicely

wind hedge
#

Guys I am doing a loop to check if there are objects in front of a vehicle and making it stop if there is. The thing is that I only got it working with lineIntersectsWith but I believe it could be faster if I use lineIntersectsSurfaces? Or should it stay as it is? Here is the important part of the loop: ๐Ÿ‘‡

winter rose
wind hedge
#
                 
if (_speed > 1) then {        
_objectsIntersected = [];// Extra measure to reduce speed if a object is in the way, quite performance friendly!
 if (vAiDriving_useLinesIntersectWith) then {            
  private _carFrontPos = ATLToASL (_car modelToWorld [0, 2, -0.2]);
  private _distanceToCheck = 10;
  _distanceToCheck = ((_speed)*1.1);
  if (_distanceToCheck < 10) then {_distanceToCheck = 10;};
  private _carFrontDistanceToCheck = ATLToASL (_car modelToWorld [0,_distanceToCheck, 0.5]); //position far in front of vehicle
  _objectsIntersected = lineIntersectsWith [_carFrontPos, 
  _carFrontDistanceToCheck, _car, _driver, true];
  if (vAiDriving_show3DLine) then {drawLine3D [ASLToATL _carFrontPos, ASLToATL _carFrontDistanceToCheck, [1,0,0,1]];};
};
// If vehicle already slowing down because of linesIntersect no point in searching for other Entities (Reduces resources usage!)
  if !(_objectsIntersected isEqualTo []) then {    
    _car setSpeedMode "LIMITED";
    _car forceSpeed 1;
    _car limitSpeed 5;
    _car setVelocityModelSpace [0, 0, 0];
    if (vAiDriving_debug) then { systemChat format ["Car hit the BRAKE due to: LINESINTERSECT",""]; };
    ```
#

๐Ÿ‘† Any suggestions? Tested with 30 Ai Driven vehicles and only lost perhaps 4 fps but haven't tested it in Multiplayer, the script is only run by the server of course

#

In its current form the script reduced the Ai crashing into walls, other vehicles and even pedestrians to almost cero... (Saving countless Ai Lives!)

#

The whole loop is on a 1 second sleep, that becomes 2 seconds if the vehicle is already stopped or hitting the breaks

distant oyster
winter rose
#

Thanks ^^ lots of Dedmen out there :D

dreamy kestrel
#

@still forum cool thanks. so to be clear, I get the snapshot. would not see subsequent deleteAt, pushBack, etc, on the original.

dreamy kestrel
#

I've asked before, not sure the response was satisfactory... what is the global stringtable (?). as compared/contrasted to stringtable <Package name="..."/> (?)
specifically, the error in the log is: @STR_MY_TITLE: string @STR_MY_TITLE cannot be localized client-side - move to global stringtable
but it does exist in the <Package name="General"/> element.
best guess booting up A3 from a cold start does not see these for the mission file?
any insights are appreciated.

exotic flax
#

Package and Container "groups" are only helpful for organisation and have no impact on the translations; use them for your own sanity.
So they don't matter

#

and believe that error simply means a translation is not available ๐Ÿค”

dreamy kestrel
#

@exotic flax hmm well it must matter. I am running in "English" AFAIK, those translations are indeed there.
so... putting the keys on the shelf for the time being. what is a global string table? i.e. <Key ID="..."/> can exist at the "root" level, directly child to <Project name="..."/> (?)

still forum
dreamy kestrel
#

in the error log ^^

still forum
#

huh, never seen that error

dreamy kestrel
#

literally copied and pasted from the log; it's an A3 thing, not anything I am dumping.

still forum
#

I guess it refers to the dta/languagecore.pbo stringtable

#

I'll have to look up that message to see what it means. Doesn't make sense to me

dreamy kestrel
#

right, but in terms of this mod, I should move the keys under the project itself?

still forum
#

Arma doesn't care about project/package

#

it literally just skips them

dreamy kestrel
#

apparently it does care when there are apparently references in the mission file.

still forum
#

no it doesn't

dreamy kestrel
#

the log would disagree

still forum
#

The log doesn't say anything about that

#

atleast the part you posted

dreamy kestrel
#

omg yes it did...

still forum
#

where?

dreamy kestrel
#

that's exactly what it reported, @STR_MY_TITLE: string @STR_MY_TITLE cannot be localized client-side - move to global stringtable

still forum
#

Yes that says nothing about package/project entries?

dreamy kestrel
#

which IIRC is in the mission file. but the keys are in a "general" package.

still forum
#

Again, Arma doesn't read project/package it doesn't care

dreamy kestrel
#

as far as the keys "being there" in the xml, they are. but A3 is complaining about it, and does not present player slots

still forum
#

Not sure what that message means

#

It doesn't say "not found"

#

The @ is weird. string keys are usually $STR not @STR

dreamy kestrel
#

come on man... I am reading between the lines there. cannot be localized... what else is that supposed to mean?

still forum
#

I don't know

#

I'll have to check what it means. But I'm currently in a mission

dreamy kestrel
#

literally in the mission file, which is why I ask:

briefingName="@STR_MY_TITLE";
overviewText="@STR_MY_DESCRIPTION";
#

maybe the syntax in the mission file is incorrect.

#

i.e. it should be $STR_MY_TITLE instead (?) ๐Ÿคทโ€โ™‚๏ธ

still forum
#

Why @ ?

#

where did you read

dreamy kestrel
#

not sure, it is "inherited"

still forum
#

where did you read that its @STR and not $STR?

#

as far as I know its always $STR

dreamy kestrel
#

because these are config classes like any other I suppose, so I don't expect the syntax to be that different...

class Mission
{
  class Intel
  {
    briefingName="@STR_KPLIB_TITLE";
    overviewText="@STR_KPLIB_DESCRIPTION";
  };
};

as I said, "I didn't", the code was inherited. just troubleshooting it is all.

still forum
#

Try $ then

dreamy kestrel
#

yep will do. appreciated.

still forum
#

And then someone tell me what the difference between @ and $ is :u

dreamy kestrel
#

besides syntax, ๐Ÿคทโ€โ™‚๏ธ ... probably innocently misinformed, my best guess

#

or maybe it really does reference a "global" string table, IDK

agile pumice
#

is it possible to use regex to use the find command to find a number in a string?

still forum
#

find doesn't support regex no

#

but I guess I can add that

willow hound
#

Does anything that is shipped with A3 support regex?

exotic flax
#

Never seen it

dreamy kestrel
#

If you have a generally regular string, maybe you can do things like rudimentary splitString, something like that, along predetermined delimiters.

#

I've done that before, but it is C-R-U-D-E.

winter rose
still forum
#

yes yes

#

need check if can

#

there are limitations

winter rose
#

license ones?

still forum
#

no

fair drum
#

so i have a particular line under bis_fnc_typetext

["29% UNKNOWN", "<t align = 'left' shadow = '1' size = '0.7' color='#ffff0000'>%1</t><br/>", 30]

how do I make only "unknown" a different color in this syntax? right now the %1 points to the whole sentence, do I need a %2 and to place "unknown" in a different section?

exotic flax
#

Also put structured text in the first param?

agile pumice
#

What even the heck is this error? Error Type Number,Not a Number, expected Number

exotic flax
#

you gave a number, but it's not a number, but it wants a number

#

so something returned NaN (Not a Number) instead of a number

still forum
#

you provided a NaN

#

to a command that wants a valid number

agile pumice
#

I find it strange that NaN could be type number

brazen lagoon
#

any tips for debugging network spam?

#

or do I just have to watch tcpdump

still forum
#

ArmaScriptProfiler shows you network traffic caused by scripts

brazen lagoon
#

cool

#

will check it out

cosmic lichen
still forum
#

ah interesting

#

always learn smth new

dreamy kestrel
#

good to know, thank you @cosmic lichen

#

Q: concerning isKindOf, is there a "go to" spot where I can see the general kinds, i.e. "ground", "air", what about for sea? "ship"? or *UAV *or UGV, those are also "air" or "ground", etc... thank you...

still forum
#

isKindOf just checks config inheritance

#

People often think it checks if a object is of a certain type, it doesn't

dreamy kestrel
#

I'm not interested in the class name. reviewing some code here, I think that about covers my bases, with maybe a few exceptions, buildings, unmanned, etc.

still forum
#

but isKindOf is all about classnames

dreamy kestrel
#

I see it used that way all the time, i.e. _x isKindOf "Tank", or _x isKindOf "Air"

still forum
#

"Tank" is a classname

#

And "Air" too

#

Same as "All" and "B_Soldier_F"

dreamy kestrel
#

I think you are confusing that with typeName which is about class names

still forum
#

No typeName is not about class names it returns type names of script values

#

completely different thing

dreamy kestrel
#

first statement in the docs, isKindOf, Checks whether the object is (a subtype) of the given type. i.e. base type of Tank, Air, etc

still forum
#

correct

#

it checks the classnames of the parents of the given object/class

fair drum
#

best way to convert to .ogv? my premiere doesn't have it as an option

dreamy kestrel
#

I think we're arguing semantics

still forum
#

VLC

dreamy kestrel
#

I understand it is about the class hierarchy

#

I was just curious if those basic classes were enumerated somewhere

still forum
#

Not really, because thats not how it works :u

#

You can have a tank that isKindOf Air.

#

best way is to look in config viewer

#

For example the AL-6 Pelican drone is isKindOf
"UAV_06_base_F","Helicopter_Base_F","Helicopter","Air","AllVehicles","All"

dreamy kestrel
#

right I understand that. what I was curious about was seeing the base classes enumerated, i.e. Ground, Air, etc

#

do not know if such a listing exists

still forum
#

All in One config dump will have a list

#

They will be at the top of CfgVehicles

dreamy kestrel
#

it is a mod? okay dokay, thank you.

fair drum
#

hmmm my vlc doesn't have a .ogv container. it does have .ogm though with a codec of Theora

still forum
#

just name it .ogv

#

I know VLC can export it

#

"Video + Theora + Vorbis (OGG)"

drifting sky
#

Guard Waypoints: Does the group assigned a guard waypoint actually have to reach the waypoint or have reached a guarded by trigger before they will start pursuing enemies known to their side?

dreamy kestrel
#

dumb question maybe... without loading all in one... how do I obtain the base class of a class name?

still forum
#

ingame config viewer

#

it shows all parents on the bottom

fair drum
#

should I be using stringtables? I see them a lot in other peoples missions. is it worth learning?

cosmic lichen
#

@fair drum If you want to have your mission available in other languages, yes, otherwise no.

dreamy kestrel
#

re: config viewer, thanks... got there from the editor. perfect thank you.

gloomy musk
#

Hi, I was hoping I could get some advice, on this one. This mission will work in editor and will work in a local MP mission. But won't work on my server

_this addMPEventHandler ["Fired", {

params [">
 3:27:33   Error position: <addMPEventHandler ["Fired", {

params [">
 3:27:33   Error Foreign error: Unknown enum value: "Fired"
 3:27:33 File mpmissions\__cur_mp.Tanoa\tung.sqf..., line 1
 3:32:15 Error in expression <missions\__cur_mp.Tanoa\tung.sqf"
_this addMPEventHandler ["Fired", {

params [">
 3:32:15   Error position: <addMPEventHandler ["Fired", {

params [">
 3:32:15   Error Foreign error: Unknown enum value: "Fired"
 3:32:15 File mpmissions\__cur_mp.Tanoa\tung.sqf..., line 1```
#

The script is:

        
        params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"]; 

        if (_weapon == "CUP_Vmlauncher_9M311_veh") then {  
            _turretPath = _unit unitTurret _gunner; 
            _unit addMagazineTurret [_magazine, _turretPath, 1]; 
        };

    }

];```
fair drum
#

@warm hedge i just started using your animation viewer mod and wow that's so much better

warm hedge
#

I kinda have no idea how to make a simple animations viewer that complicated and slower

verbal saddle
#

If you use addEventHandler then it will work

gloomy musk
#

So, I tried it as a normal event handler and it didn't work also

verbal saddle
#

What was the error?

gloomy musk
#

Let me get out of this game and I'll tell you, give me like 30 minutes

gloomy musk
#

@verbal saddle I forgot to reupload the version where I changed from MPEventhandler to just Eventhandler. Thanks for your help. I need sleep

finite sail
#

vlc can convert to ogv? didnt know that ๐Ÿ™‚

finite sail
thorn saffron
#

Does anybody knows any way to check if player is honking in a vehicle? Sadly the fired event handler does not pick up the act of "firing" the horn "weapon".

young current
#

Weapon selected and keydown maybe

thorn saffron
#

Might trigger in menus and such

young current
#

Check also what display is active?

#

Car horn is weapon empty sound. Maybe something in there that could be detected

hot lichen
#

maybe it works with the "fired" event handler

thorn saffron
#

Sadly the fired event handler does not pick up the act of "firing" the horn "weapon".

hot lichen
#

oh sorry

#

havent slept in a while

thorn saffron
#

So the question is: how do you detect dry firing a weapon? The fired EH doe not pick up empty rifle dry firing either

warm hedge
#

I don't think there's any way

thorn saffron
#

I would say, no easy and clean way. I guess one could kludge something, but it has the chance to be pretty wonky

warm hedge
#

Yeah I mean there's no "direct" way, if there's possibility, must be a big workaround

little raptor
radiant osprey
unique sundial
#

Why are you tagging me?

nocturne bluff
#

So that you know about this completely random topix

quasi sedge
#
enableSaving [false, false];
_launches=0;
while { ((diag_tickTime > 10) && (_launches < 5)) }
do {
    west reportRemoteTarget [t1, 3000];
    t1 confirmSensorTarget [west, true];
    g1 fireAtTarget [t1, "weapon_vls_01"];
    _launches = _launches + 1;
};
#

i can't understand why my while doesn't work as intended

#

it simply launches 1 vls tomahawk and its over

#

t1 target is quadbike with redfor bot with damage to immunity

#

if i simply change to while { diag_tickTime > 10 }

#

all working as intended

distant oyster
quasi sedge
#

roger

quasi sedge
distant oyster
#

no?

little raptor
#

while { ((diag_tickTime > 10) && (_launches < 5)) }
_launches = _launches + 1;
for

heady quiver
#
random_group_spawn = [randomMarkerPos, east, _list, [], [], [0.1, 0.2]] call BIS_fnc_spawnGroup;```

How do i tell this group to loiter at the location they spawned?
still forum
#

diag_tickTime > 10 seems nonsense to me

#

it can never become not that

#

no reason to repeatedly check it in a while loop

heady quiver
#

Yea i think i got it not sure tho

_wp = random_group_spawn addWaypoint [randomMarkerPos, 0];
_wp setWaypointType "LOITER";
willow hound
#

What do you mean "not sure"? Just test it magic

heady quiver
#

I am xD

#

Seems like they just standing there

ornate horizon
#

Does anyone here do advanced vehicle shit?

#

I'm thirsty for a CVT "gearbox" right now.

#

Before you go on about durability and reliability, I DO NOT MEAN THE KIND THAT USES BELTS.

#

That's an article about Allison Transmission buying stock in Torotrak.

willow hound
heady quiver
#

Yea i just did that and seems to be working ๐Ÿ™‚

#

me happy

ornate horizon
dreamy kestrel
#

Q: working with object variables, seems to me as though the keys are being converted to lowercase. is that accurate? i.e.

_obj setVariable ["My_Var", true, true];
//                 ^^^^^^
_obj getVariable ["My_Var", false]; // is false
//                 ^^^^^^
_obj getVariable ["my_var", false]; // is true
//                 ^^^^^^
still forum
#

variable names are case insensitive

willow hound
#

Not that I know of; my object varspace variables all work the exact way I spell them.

still forum
#

upper or lowercase makes no difference.

#

The answer to the question is, yes. But I don't think you actually asked what you wanted to ask.

#

Atleast I think they are stored as lowercase, would need to check.

willow hound
#
_obj setVariable ["A", true];
_obj getVariable "A";
```This really should work properly, not quite sure how you're getting different results there.
still forum
#

No wait, allVariables returns correct case does it?

hollow thistle
dreamy kestrel
#

and the verdict is? ๐Ÿ˜‰ pretty sure that's lowercase...

still forum
#

still case insensitive

#

and your example code there is wrong

hollow thistle
#

casing does not matter when accesing the variables.

#

However...
I'm pretty sure I've had few occurences when after doing:

_obj setVariable ["My_Var", true, true];
_obj getVariable ["My_Var", false];
#

it returned false

#

It looked like var was not set on object immediately.

dreamy kestrel
#

ok I got it I think...

hollow thistle
#

Never got consistent repro on it tho.

dreamy kestrel
#

allVariables is the issue. getVariable is fine in terms of case arity. so any queries on allVariables should case accordingly.

hollow thistle
#

No it's not an issue.

dreamy kestrel
#

repro:

player setVariable ["A", true];
"A" in allVariables player; // is false
toLower "A" in allVariables player; // is true
still forum
#

Well yes

#

but thats not the code you posted above

#

"in" is case sensitive

dreamy kestrel
#

I just corrected the record.

#

and to be clear, in is not case sensitive. the result from allVariables is lowercase, regardless what went in during setVariable.

still forum
#

no

#

in IS case senstivie

hollow thistle
#

in is not case sensitive
why you're saying such things when you apparently have no clue how it works.

dreamy kestrel
hollow thistle
still forum
#

quick poll. script commands httpGet httpPost ?

#

give me contras if you have any

agile pumice
#

quick question about random. will random 5 == 5 ever be true?

finite sail
#

almost certainly not

#

ceil random 5 will, and round random 5 will but not a fifth of the time

winter rose
#

I think not

#

I believe it is 0 included, 5 excluded?

still forum
#

but 5-epsilon might round up?

#

according to ingame comref its exclusive 0 and 5

#

"The random real value from 0 to x. (0&lt;=random&lt;1)"

#

its rightArg*Random(0,1)

#

the random value is any float between 0 and 1

#

so inclusive both 0 and 1

finite sail
#

in practice though.....

still forum
#

Hm we only use 30 bits though

#

but the last 2 bits of a float always being 0 won't matter here

still forum
#

even if highly unlikely

finite sail
#

which is what i said

#

sort of ๐Ÿ™‚

still forum
#

but original question was ever. And as far as I can see the answer is yes

finite sail
#

I think the best answer is, yes it will, guaranteed.. eventually

#
 #include "..\includes.sqf"
_myscript = "do_test";
__tky_starts
a= 0;
while {random 1 !=1} do
{
    a=a+1;
};
diag_log str a;
__tky_ends```
#

a is 3.85817e+006 and still going

#

1.04139e+007

#

it ended..not sure if random 1 was 1 or it just got bored ๐Ÿ™‚

still forum
#

10^7 is basically the limit of float precision

finite sail
#

yes, im sure i remember you saying that the other day

agile pumice
#

I wish we could script animations to force a particular angle

#

aka, open a door the opposite way of which it was designed to

heady quiver
#

Question how would i run an action on all players?

titletext ["9 Hours later", "PLAIN"];
titlecut ["", "BLACK OUT"];
sleep 1;
skiptime 9;
sleep 8;
titlecut ["", "BLACK IN"];
heady quiver
#

aah yea

#

lets see how we get this working

willow hound
#

Put that code in a function or at least its own script file and remote execute that, not every line one by one.

heady quiver
#

Yea in in my sleep.sqf

#

this addAction ["Sleep","sleep.sqf"] how would i remoteExec this?

#
[this,["Sleep","sleep.sqf",[],1,false,true,"","_this distance _target < 2"]] remoteExec ["addAction",2];
#

Seems te be working ๐Ÿ™‚

willow hound
#

2 is the server (i.e. you, in Eden)

#

Do you not want all players to sleep at the same time?
skipTime also requires special attention with Remote Execution.

#

What I'm trying to say is that it probably doesn't do what you want it to do right now. It does so in testing, but it will not once you increase the amount of players beyond one.

heady quiver
#

Yea i want all players see that cutscene

#

So when one of us presses the 'sleep' button we all go to sleep

willow hound
heady quiver
#

This will be on the init of a sleeping bag```sqf
[this,["Sleep","sleep.sqf",[],1,false,true,"","_this distance _target < 2"]] remoteExec ["addAction",2];



this is the sleep.sqf
```sqf
titlecut ["", "BLACK OUT", 0];
sleep 2;
[] Spawn {
[
    [
        ["CAMP HOLLAND", "<t align = 'center' shadow = '1' size = '0.7' font='PuristaBold'>%1</t><br/"],
        ["9 HOURS LATER", "<t align = 'center' shadow = '1' size = '1.0'>%1</t>", 15]
    ]
] spawn BIS_fnc_typeText;

};
sleep 1;
skiptime 9;
sleep 6;
titlecut ["", "BLACK IN"];
willow hound
#

Alrighty.

heady quiver
#

Thats gonna work?

willow hound
#

No, I'll explain. It'll just take a few minutes to type

heady quiver
#

oh ๐Ÿ˜ฆ

#

Oke ๐Ÿ˜„

willow hound
#

So your mission starts on the server (no client can connect to your mission or load the mission before the server has loaded it, right?), and the server begins by executing the init fields, executing addAction in the process. The target of that Remote Execution is 2 though, so that's just the server himself (which is why this works when you test it on your own, you are the server).
So now the "Sleep" action is available - but only on the server.
Then, once the player on the server (if there is one) activates the "Sleep" action, sleep.sqf is executed (but only on the server). The player on the server will see all the fading to black, animated text and so on.
skipTime is special: The wiki page says "Most be run on the server" (SE icon below the page title). Again, you get lucky with your testing, you are the server, so skipTime works.
If you were testing it with other players, only you would see the fading and the text, the effect of skipTime would apply to everybody though.
So, not quite how you want it to play out.

Instead, what you have to do is run addAction on all machines - that should (provided my brain is still working at this hour) work without issues using the sleeping bag's init field. So then every player can use the "Sleep" action.
Next, let's look at how we get sleep.sqf going.
We need sleep.sqf running on all machines (simultaneously) - except for skipTime (remember, it's special).
For that, we modify the addAction code:

this addAction ["Sleep", {"sleep.sqf" remoteExec ["execVM", 0];}];
```Note that the Remote Execution target is now `0` (everybody) instead of `2` (server).
Because `skipTime` is special, it's probably best if you wrap the line with `skipTime` in an if-statement like so:
```sqf
if (isServer) then {
  skipTime 9;
};
```And now we should be good if I have not missed anything.
#

Small remaining problem: Your "Sleep" action is still available on the machines where it was not used (so it could be used again, putting everyone back to sleep and skipping nine more hours), so you might want to remove it with Remote Execution as well.

heady quiver
#

Damn

#

You took your time

#

I appreciate it

#

Its alot of info

#

xD

#

Alright so i made those changes

#

But you said removing the sleep option right?

#

But i want it to stay available in-case we want to make it day again

willow hound
#

Well then you can ignore my last "Small remaining problem" paragraph; the current behaviour should just be what you want then.

heady quiver
#

Awesome

#

Hard to actually test it now cuz no one to test it with but i trust you xD

willow hound
#

Terra is typing...
meowsweats

heady quiver
#

One more thing:
["Base of Operations", "<t align = 'center' shadow = '1' size = '0.5' font='PuristaBold'>%1</t><br/"]

Why doesn't size do anything? i change it to what ever but not changing

#

oh..

#

im stupid

#

Or not thought i figured it out but guess not, you know anything about that? @willow hound

distant oyster
# heady quiver Question how would i run an action on all players? ```sqf titletext ["9 Hours l...
[["9 Hours later", "PLAIN"]] remoteExec ["titleText", 0];
[["", "BLACK OUT"]] remoteExec ["titleCut", 0];
sleep 1;
9 remoteExec ["skipTime", 2];
sleep 8;
[["", "BLACK IN"]] remoteExec ["titleCut", 0];
``` could work. in this case all the logic is handled on the client who is activating the addaction whereas handling it on the server might be the better option. on the other hand you would have to double remoteExec or split the script in two functions. btw it seems that you are adding the action in the init field of the object which is a bad idea. It will add an action for each joining client on every connected client. try to avoid the init field.
distant oyster
heady quiver
#

Don't forget its gonna be a 3 man squad play trough tops

willow hound
#

I don't use format text often; maybe the incomplete <br/> tag at the end?

heady quiver
#

Yep..

#

That was it

#

xD

willow hound
#

I thought about the init field adding more actions on all players but I thought since the init field runs its code local and since addAction only has local effect we should be fine-ish?

heady quiver
#

Also this addAction ["Sleep", {"sleep.sqf" remoteExec ["execVM", 0];}]; its on the sleeping bag not on the player right?

distant oyster
heady quiver
#

So it shouldn't create it for every player.

#

oh..

distant oyster
heady quiver
#

Yea thats what im saying

#

that code is in the init

#

sleeping bag init

distant oyster
#

i just remember from my early scripting days that whenever i made an addaction it would show up multiple times

heady quiver
#

Its not gonna be a online mp server

#

Just with some friends ๐Ÿ˜„

distant oyster
#

hosted mp is the same

#

only singleplayer is unaffected by these problems

willow hound
#

Good guy singleplayer keeping things simple ๐Ÿ‘ผ

heady quiver
#

Yea but i had this addAction on a map board before and didnt get any double actions

#

atleast not that im aware off

#

Anyway thanks for the help

agile pumice
#

is there a way to easily grab the class of a particle when a new one is created?

#

an oneachframe handler looking for isKindOf "#particlesource" or something?

#

nearestObjects [player, ["#particlesource"], 5]; ?

exotic flax
#

how do you set the particle(s)?

agile pumice
#

I don't

#

I want to grab particles made by the engine

#

do I want to use nearObjects, nearEntities, nearestObjects?

exotic flax
#

not sure if you can use that at all on particles, since they're not objects...

agile pumice
#

when you create a particle with a script, you use createVehicle, so wouldn't it be?

exotic flax
#

in that case it would be "#particleSource", which afaik is local only

#

and even then; the particle "object" itself will be set with setParticleClass or setParticleParams (no getters available)

#

so even if you know it's a particleSource (which means nothing than "something with particles"), you still don't have access the details of those particles

agile pumice
#

I'm trying to create the particle effect when you shoot a wood surface, but I can't see it. I'm not using the right class because when I use the "ObjectDestructionFire1Smallx" class, it works

    _particle = "#particlesource" createVehicle _worldPos;
    _particle setParticleClass "ImpactDustWood";
ornate horizon
#

Does anyone here think they could demonstrate a CVT "gearbox" script?

drifting sky
#

Does anybody know with the "Guard" waypoint, whether the group assigned to that waypoint must first reach the waypoint or be assigned a guard trigger before they will begin pursuing enemies known to their side?

cosmic lichen
#

They will move to that waypoint and then move to a "guarded by" trigger.

#

Check the biki for waypoints

drifting sky
#

well it also says that they will move to engage any enemies known to their side. HOwever it doesn't say whether they must first arrive at their guard waypoint or have moved to a guarded by trigger.

spice thistle
#

Hello,
I need your help to figure out how you guys deal with race condition in sqf in multiplayer. For example I want to share a counter between all my players:
_actualValue = _obj getVariable[โ€œcounterโ€,0];
_obj setVariable[โ€œcounterโ€, _actualValue + 1, true];
How to be sure if two clients executes this code at the same time that it will increment by two?

fair drum
#

can animated objects, such as objects that say have a particle effect, be subject to dynamic simulation? or only entities?

cosmic lichen
exotic flax
queen cargo
#

The remote mutability is actually a quite complex problem with loads of research.
Most simple solution tho:

  • Do it Serverside
spice thistle
exotic flax
#

If the set/getVariable is done on the server you shouldn't have that issue; just send a "update counter" to the server.
Getting the counter can still happen locally.

spice thistle
#

Yes but correct me if Im wrong: two clients calling the โ€œupdate counterโ€ function on the server will result with two spawns on the server. So the concurrency problem is now local but can occur. There is no command like TestAndSet in sqf afaik.

exotic flax
#

trust me, there's no programming language or system in the world which is able to handle that ๐Ÿ˜‰

spice thistle
#

Yes there is! In asm you have atomic instructions and in c/c++ you have locks (using the underlying asm atomic instructions)

dim crow
#

I tried to load guys up into a helicopter in editor they get in then get out

#

Irk why

#

Idk

spice thistle
#

I just wanna now if there is a way in sqf, if there is not, i will write an Extension to handle the problem

exotic flax
#

If two pieces of code would do something at the exact same time (nanosecond precise), which one will set the lock? That is the issue you'll always have, but gets bigger when timings are less accurate ๐Ÿคทโ€โ™‚๏ธ

wind hedge
#

๐Ÿ‘‡

violet gull
#

@wind hedge Use the tilde key ` without holding shift, not apostrophe ' (Use the key to the left of your #1 key)

spice thistle
#

You are not guaranteed wich one get the lock but you can guarantee that no one will get the lock, be paused and the other one will update the value

#

(I just want to ensure that getVariable and setVariable are executed atomically)

wind hedge
#
vShowAllyOnMap = {
    findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw"๏ปฟ, "
        _display = _this#0;
        if (visibleMap && diag_fps > 15) then {
            {
                _icon = getText (configfile >> 'CfgVehicles' >> typeof _x >> 'icon');
                    _display drawIcon [
                        _icon,
                        [0,0,1,1],
                        getPosVisual _x,
                        24,
                        24,
                        getDirVisual _x,
                        name _x,
                        1,
                        0.03,
                        'TahomaB',
                        'right'
                    ];
            } forEach (allUnits select {side _x isEqualTo side player && (isFormationLeader _x));
        };
    "];
}; 
#

๐Ÿ‘† That is giving me an error:

#

It says missing ] in line 2... meowsweats This line: (findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", ")

violet gull
#

Add a ] before the parenthesis ๐Ÿ˜›

#
 (findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", ")//No bueno

 (findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", "])//Mucho bueno```
dim crow
#

Help, I made my gets move to helicopter and did get in, then i@made the helicopter go to a point where they drop off the guys, once all the men get in they all ge to it please help

exotic flax
#

try:

vShowAllyOnMap = {
    findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", {
        _display = _this#0;
        if (visibleMap && diag_fps > 15) then {
            {
                _icon = getText (configfile >> 'CfgVehicles' >> typeof _x >> 'icon');
                _display drawIcon [
                    _icon,
                    [0,0,1,1],
                    getPosVisual _x,
                    24,
                    24,
                    getDirVisual _x,
                    name _x,
                    1,
                    0.03,
                    'TahomaB',
                    'right'
                ];
            } forEach (allUnits select {side _x isEqualTo side player && (isFormationLeader _x));
        };
    }];
};
``` makes it easier to read as well
#

Because if the second parameter is a string I believe you can't have line breaks in there

wind hedge
#

Thanks!

#

No more errors!

agile pumice
#

any ace coders let me know why this isn't working? [player, 1, "LeftLeg", "falling"] call ace_medical_fnc_addDamageToUnit;

cosmic lichen
#

@wind hedge After the next update you might wanna use (units (side player) select {isFormationLeader _x}); which is twice as fast as your current code.

wind hedge
#

After I am done with this script suite I am gonna five @little raptor a run for his money ๐Ÿ˜‰ ๐Ÿ™‚

desert cargo
#

Hello, I'm trying to do an op where a small group (that is unknown to the main group) works to link up with the main group. So naturally I'm gonna cut comms between the groups to make the linking up harder but I don't want to make it impossible either so I'm planning to restrict radio range for a certain person/group to around 200m. Not sure if anyone's done that but I looked up and can't find any help on that. We use TFAR Beta.

fair drum
#

@desert cargo here is some stuff that I wrote down a while ago, might be useful for you and TFAR

// jam radios
unit setVariable ["tf_sendingDistanceMultiplicator", 0.05,true];
unit setVariable ["tf_receivingDistanceMultiplicator", 0.05, true];
unit setVariable ["tf_transmittingDistanceMultiplicator", 0.05, true];
// un-jam radios
unit setVariable ["tf_sendingDistanceMultiplicator", 1,true];
unit setVariable ["tf_receivingDistanceMultiplicator", 1, true];
unit setVariable ["tf_transmittingDistanceMultiplicator", 1, true];

and be careful of locality

desert cargo
#

so for a dedicated server, it should be fine right?

#

and if I just put these lines in the unit init, the player controlling this unit will be affected?

"this setVariable ["tf_sendingDistanceMultiplicator", 0.05,true];"

fair drum
#

if you do that, every time a player joins your server, that line will run

#

so say you unjam them, and someone joins, that init field is fired again on his machine thus jamming again

#

init fields are fired on every machine when they initialize the mission

desert cargo
#

yeah the idea for the op is for that small group to have severely limited radio all the way anyway

#

how would you use it?

#

like, I'm used to doing 3den stuff but not playing with scripts, the most I do is unit init functions once in a while

little raptor
#

put it in initplayerlocal

#
player setVariable ["tf_sendingDistanceMultiplicator", 0.05,true];
...
fair drum
#

~~you can try a

if !(local this) exitWith {};

this setVariable ["tf_blahblahblah, blah, blah];

if you are set on using init fields~~

little raptor
#

you'd have to do that for every player

desert cargo
#

yeah I'm just wondering how to use these scripts, coz I have no idea how scripts work outside of init field

fair drum
#

that's true, because that variable has to be available on every machine for every unit you assign it to

#

how many players are going to be jammed?

desert cargo
#

8

fair drum
#

all in one group at the start?

desert cargo
#

yup

fair drum
#

k, let me make something to try

desert cargo
#

it's a recon team that's shot down and lost, the platoon will have no idea they exist all the way until that team finds them

#

sort of an interesting idea but I'll have to reduce the recon team's radio range so they don't just talk to each other right off the bat

fair drum
#

maybe something like this?

// initPlayerLocal.sqf 

params ["_player", "_didJIP"];

private _jammedGroup = insertGroupVariableHere;

if (group _player == _jammedGroup) then {  //jam the radios

    _player setVariable ["tf_sendingDistanceMultiplicator", 0.05,true];
    _player setVariable ["tf_receivingDistanceMultiplicator", 0.05, true];
    _player setVariable ["tf_transmittingDistanceMultiplicator", 0.05, true];
};
desert cargo
#

I have no idea man

#

like, I understand code enough to know it would probably work but I don't know how to use it for arma

fair drum
#

try that. as long as you don't have dynamic group system on that allows players to change stuff, you should be good. obviously i didn't put in a check to see if the group still existed because if its that far into the game and the group dies, I don't think there are going to be any join in progress players

desert cargo
#

I assume this one I need to attach it as an sqf file in the pbo and name the group "__jammedgroup"

fair drum
#

no, name your group in the editor whatever you want in the variable line (with no underscore)

#

then make a new file in the root folder of the mission

#

name it initPlayerLocal.sqf

#

then put those lines in and change the insertGroupVariableHere to whatever you put in the variable line of the group in the editor

desert cargo
#

ok so it's like naming specific units to have zeus modules in zeus owner and unit variable, except it's an sqf

#

cheers

fair drum
#

yes, those "names" you give those units are actually stored as global variables that you can access directly with scripting. you just have to remember what you named them

desert cargo
#

I wonder, if I assigned the jammed players to another group mid-op, would that effectively change their group tags and make them unjammed? or is it something that only runs once upon joining the server?

little raptor
fair drum
#

or directly just call the unit you want to change and skip the check all together

lusty canyon
#

is it possible to make a serverside only mod that creates a map/diary/task url link on JIP? and since copytoclipboard doesnt work in MP how do i make it easy for ppl to goto the link? i have over 700 missions on my dedicated so modifying mission pbo is out of the question. also will i need to do server config

allowedHTMLLoadURIs[] =

so far i got

createDiaryRecord 
htmlLoad
remoteExec global on mod init

thoughts?

still forum
still forum
still forum
#

Ahh R3vo blobninja
Yes I still reply faster than I read-

exotic flax
still forum
pale ridge
#

I am having an issue with not being able to properly put a parameter _unit into the spawn extension. I tried it a global variable, but the issue is, that the global variable changes to fast for the sleep to work.

        DEKdonotevertouchthis = _unit;
        if (_ammo isEqualto "AmmoStingerPistol" or _ammo isEqualto "PoisonBomb_Remote_Ammo" or _ammo isEqualto "PoisonBomb_Remote_Ammo_Scripted")
        then
        {
            [] spawn 
            {
                sleep (4 + random 5);
                DEKdonotevertouchthis setDamage 1;
                deleteVehicle DEKdonotevertouchthis;
                _PoisonBomb = "PoisonBomb_Remote_Ammo_Scripted" createVehicle position DEKdonotevertouchthis;
                _PoisonBomb setDamage 1;
            };
        };```
if anyone has an idea to transfer the parameter easier, that be nice.
still forum
#

[_unit] spawn { params ["_unit"];

#

Should be a example on spawn wiki page :u

pale ridge
#

it truly should be, thank you very much it works.

narrow oxide
#

Hi everyone Can you help me with a script that can make ai invisible but you can see them on thermal and your still can kill them if you are shooting the place they are in

dusty dawn
#

But i have a question too:

We currently use a workaround for creating concealment on a large scale PVP mission, we use the tall grass for that.
Its spawned by createsimpleObject (as it seems to be the only way to spawn it)

The issue is that when you drive a vehicle inside, you cant get in anymore because the interactions are missing

Is there any non-hacky way to solve that?

narrow oxide
#

I tried a script and it made the ai invisible and you can see it only on thermals but you can't kill it except you have thermals one

dusty dawn
#

Thats sounds interesting though

#

10/10 would play that

narrow oxide
#

So I saw a video of people used the same thing I want

#

I can send you a link

#

So only one of them can see the unit (anomaly ) and the others can kill it with him guiding the team to were the anomaly is

spark turret
#

I read somewhere that AI uses raycasts from eyepos to eyepos and can therefore be fooled by standing behind a roadsign that blocks your face. Is that still true?

still forum
#

sounds reasonable

#

If you are standing with your face right up against a streetsign, you cannot see either

#

but I think AI checks from eye to center of mass

winter rose
spark turret
#

So you re saying there is a chance to recreate that skyrim thing where you place a bucket over an NPC and he becomes docile :D

dusty dawn
#

Though you probably will get armaed by the engine

#

The Sensors of weapons work in a similar way

#

(Sensor source raycasts towards center of vehicle)

distant oyster
gloomy aspen
#

Would this work in a Dedicated MP mission to make Static C130 make an engine noise?

    object say3D "enginenoise";
    sleep 100;
};   ```
verbal saddle
#

No, that would only play for the dedicated server client. Which doesn't have an interface or audio.

#

You would need to remote execute the say3D command to the clients.

#

Unless that is already being run locally on the clients.

winter rose
#

it might be better to do it locally, idk
regarding performance and loop timing "quality"

exotic tinsel
#

anyone know how to make the vls shoot at a position? i know how to make the hammer fire at a postion. but not the vls. ive tried a few things but none seem to work. this is what works for the hammer.

_turret doArtilleryFire [_pos, currentMagazine _turret, 1];
#

ive googled it and tried suggested solutions for the past 4 hours.

cerulean locust
exotic tinsel
#

@cerulean locust well that made them fire but the missiles just went way up in the air.

little raptor
exotic tinsel
#

@little raptor that is complaining about laser being an array and not an object.
The thing is that im randomly selecting a building pos in an area and trying to get the missiles to fire on it every x seconds.
I got the hammers working but not vls.

little raptor
#

laser is an object

#

according to that code

#

laser = "LaserTargetE" createVehicle some_pos;

exotic tinsel
#

i changed some_pos to be _my_pos

little raptor
exotic tinsel
#

@little raptor sorry i had a work call. i resolved the error it was my fault but the missiles still go straight up in the air.

tender fossil
#

@still forum I'm currently writing a test project with Intercept. How does server receive request to execute something with remoteExec if the server side is written in C++?

still forum
#

register your own script command

#

and use that

tender fossil
#

Rgr

marble flint
#

hello there, I'm a little bit pissed off from AI
how to make them watch to something behind any obstacle?

#

I've tried doWatch, doTarget, glanceAt, lookAt and it still aim to nothing

narrow oxide
marble flint
#
  _pos = position _target;
  _mark = "Target_F" createVehicle [_pos select 0, _pos select 1, (_pos select 2) - 2];
  _mark attachTo [_target, [0, 0, -2]];
  while { (_target inArea ttt) && (alive _target) } do {
    ai reveal [_mark, 4];
    ai glanceAt _mark;
    ai doTarget _mark;
```with this code AI just hold it's weapon down and didn't aim anything
#
ai setBehaviour "COMBAT"; ai disableAI "all"; ai enableAI "TARGET"; ai enableAI "WEAPONAIM"; ai enableAI "MOVE"; ai enableAI "ANIM"; ai setSkill 1; this addeventhandler ["fired", {(_this select 0) setvehicleammo 1}];
```Init from AI
#

It can aim though, but only if it see the target

tender fossil
#

@still forum Speaking of registered functions, is it possible to register a SQF command so that it accepts only set types of variables as parameters (and return value)?

#

The IDE gives weird errors if I use eg. intercept::types::GameDataType::STRING when I register the custom function and then try to use game_data_string or eg. game_data_type::STRING in the actual C++ function parameters

still forum
#

uh

#

You always take game_value_parameter as argument. You can cast it to other types

#

Check intercept-cba or intercept-database for examples

tender fossil
#

I'd just like to have static typing so that IDE nags me if I try to use uncompatible variable types ๐Ÿ˜„

still forum
#

Well such a thing doesn't exist

#

but you can build your own wrappers ofc

tender fossil
#

Aight

queen cargo
#

for callExtension it does exist pretty much ๐Ÿคช
float, std::vector<sqf::value>, std::string, bool are the accepted types
see https://github.com/arma3/sqf-value methodhost
you should be able to mangle it into intercept too

tender fossil
#

@queen cargo The link doesn't work

queen cargo
#

fixed

real tartan
#

can someone confirm ?

#

[getPos player, civilian, 5] call BIS_fnc_spawnGroup; is not spawning civilians, when I change side, is spawns normally, but civilians not. bug or I am missing something ?

clever radish
#

Hello all. Ive got a kinda weird script error here. Got two computers, two tablets and two USBs. The computers both got a Addaction "hack" and loading hacking1 and hacking2 for the other PC.

Both scripts are identical, except one named "hardware1" and other named "hardware2".

First line of code is "hackcount = 0; ishacking = false;", some lines that shows the tablet and usb and next line is removing the addaction from all PCs, so the user only can hack one PC at a time.

Ive got a "while, do" script that begins to count the hacking percentages up with a hint.

Whenever the counter reaches 100 it will remove tablet and USB.

Last line of coding a "if !hardware2hacked then" and then adding a addaction for hardware 2, so the user can hack the second PC.

BUG comes if i start with PC2 and the hack PC1, i can hack PC1 again - it goes the other way around too.

exotic flax
#
  1. what is the script error?
  2. what is the code?
  3. and a bug?
little raptor
#

@real tartan civilian is not defined in the function
see BIS_fnc_returnGroupComposition
if you want the function to work, you must provide a config or array as the third param, not number

clever radish
exotic flax
#

did you remove the addAction from the first PC?

little raptor
#

you can make it work

#

see the new note I added

#

if you want the function to work, you must provide a config or array as the third param, not number

clever radish
little raptor
clever radish
#

https://pastebin.com/R4uKUZFF Pastebin link. This is for PC2, script on PC1 looks identical, only difference all "Hardware2" is replaced with "Hardware1"

I've also got a "Hardwarehacked" sqf that tells if Hardware1 or 2 is true or false, script being "IsHardware1Hacked = false;"

little raptor
#

these actionIDs could be invalid

exotic flax
#

use params ["_target", "_caller", "_actionId", "_arguments"]; at the top of the script, and use _actionId to remove it from the current object

little raptor
#

to remove it from the other one, use setVariable