#arma3_scripting

1 messages Β· Page 612 of 1

oblique lagoon
#

no way to set default vaues...

winter rose
#

values might be

#define REVIVE_MODE 2
```or something
they are not documented but opening the revive stuff might explain
#

yeah nope, apparently no default values settable

#

so defaults should come from Eden settings

oblique lagoon
#

I'll try thanks.

oblique lagoon
#

"defines.inc"

#

does anyone know where "defines.inc" is

warm hedge
#

What defines.inc?

oblique lagoon
#
private _canUseMedikit = CAN_USE_MEDIKIT2(_unit,_target);```
This seem to be broken
#

Its in [_unit,_target] call bis_fnc_reviveAllowed; codes

#
/*
    Author: Jiri Wainar

    Description:
    Returns true if unit is in general able to revive someone.

    Parameters:
    0: OBJECT - unit performing revive
    1: OBJECT - unit that will be revived

    Returns:
    SCALAR (check defines.inc for exact values)
    > 0: unit is able to perform revive action
    < 0: unit is NOT able to perform revive action

    Example:
    _reviveAllowed = [_unit,_target] call bis_fnc_reviveAllowed;
*/```
#

And I get -2 which means #define ALLOW_CHECK_REQUIRE_MEDIKIT -2 in defines.inc

#

Which comes from here

//require 'medikit' or 'firstaidkit'
private _canUseMedikit = CAN_USE_MEDIKIT2(_unit,_target);  //It says false even I have medikit, fakit
if (bis_revive_requiredItems == 2) then    //bis_revive_requiredItems = 1 medikit. so false.
{
    if (!_canUseMedikit && {!CAN_USE_FAK2(_unit,_target)}) then
    {
        [ALLOW_CHECK_REQUIRE_FAK,ALLOW_CHECK_REQUIRE_MEDIKIT_OR_FAK] select _isMedic;
    }
    else
    {
        [ALLOW_CHECK_OK_USE_FAK,ALLOW_CHECK_OK_USE_MEDIKIT] select _canUseMedikit;
    };
}
else
{
    if (!_canUseMedikit) then {***ALLOW_CHECK_REQUIRE_MEDIKIT***} else {ALLOW_CHECK_OK_USE_MEDIKIT}; //I get -2, which means ALLOW_CHECK_REQUIRE_MEDIKIT
};

return from *** value from my values so far

#

But now I'm stuck on how to fine CAN_USE_MEDIKIT2(_unit,_target); this function.

#

Nothing even on google..

winter rose
#

check the includes?

oblique lagoon
#

You genius?

#

I forgot to find it from there

winter rose
#

how did you know

oblique lagoon
#
#define CAN_USE_MEDIKIT2(unit,target)    (unit getUnitTrait "Medic" && {('Medikit' in items unit || {(!isNull target && {'Medikit' in items target})})})
#

ok so...

#

?

#

why...

#

why CAN USE MEDIKIT... ask for medic trait...

#

then it means We cannot make other roles revive only with medikit and allow them to use fakit

#

it was feature of 3rd party revive system

#

@winter rose Thank you for help

versed belfry
#

hello again everyone, got another question if somebody can help with:

Device2 addAction ["<t size=2.0 color='#FF0000'>Search Device</t>", "Nothing.sqf"];

How do I add an icon next to the text? like the search icon from arma 3 it self?

warm hedge
#

See the note in addAction

versed belfry
#

Thanks but is it possible by any chance to have the text Next to the icon? or is it either text or icon only?

warm hedge
#

Just do it outside of the <img> tag will do?

versed belfry
#

Sorry I am a bit confused πŸ˜… , where do I add it exactly cause if you mean outside as in before? I think it is already:

private _action = Device2 addAction ["<t size=2.0 color='#FF0000'>Search Device</t>", "Nothing.sqf"];
Device2 SetUserActionText [_action , "<t size=2.0 color='#FF0000'>Search Device</t>", "<img size='2' color='#FF0000' image='\a3\ui_f\data\IGUI\Cfg\Actions\heal_ca'/>"];

https://cdn.discordapp.com/attachments/615522175281135676/744138519882104872/unknown.png

warm hedge
#
Device2 SetUserActionText [_action , "<t size=2.0 color='#FF0000'>Search Device</t>", "<img size='2' color='#FF0000' image='\a3\ui_f\data\IGUI\Cfg\Actions\heal_ca'/>Your Text Here"];```try
versed belfry
#

@warm hedge works, thanks a lot and sorry for bothering ^_^

mental wren
#

So we have a mission file that is able to load on 1 server, but not on a different server, although both servers are running the same exact mods. It's terminating with a message that a certain script cannot be found, but that script is present in the mission file

7:53:22 ErrorMessage: Include file mpmissions\__cur_mp.vt7\numericBillboard\setLit.sqf not found.
7:53:22 Application terminated intentionally
ErrorMessage: Include file mpmissions\__cur_mp.vt7\numericBillboard\setLit.sqf not found.

Any ideas?

winter rose
#

don't forget to shutdown the Arma 3 server before updating its missions, else it won't work properly
also this is #server_admins , not #arma3_scripting @mental wren

mental wren
#

My bad, I was thorn between the 2 channels since it could've been a script error!

winter rose
#

no worries, but if it works on one and not on another, scripting is most likely not the issue (hopefully)

fair drum
#

The limits on addRespawnInventory... Are they limits per squad? Cause I had a sniper class set to 1 and I saw a player from each squad select the kit.

#

When I wanted 1 for the whole team

winter rose
#

@fair drum the limit is I guess depending on the target parameter

fair drum
#

I had my target as player run locally

tough abyss
#

@rocky nest you'll likely need a game extension. sqf itself doesn't provide any networking. there's a project called intercept which provides c++ binding for sqf commands that could be useful

slate cypress
#

Why does 3 fadeMusic 0 not work for me?

#

Music is playing and the volume in Description.ext is defined as db + 10 which is an optimal value according to the wiki.

#

I tried it with +9 but no difference.

winter rose
#

@slate cypress how do you play the music?

tough abyss
#

@rocky nest vectorUp and vectorDir can provide roll pitch yaw, as for heave and sway, the best i can think of is sining vectorDir/Up with current velocity. not sure how to handle surge though, you could just compare velocities in prev/current frame

slate cypress
#

I tried db + 10 too but no luck.

#

I play the music using playMusic "music class name"

winter rose
#

sooo it should work, weird.

slate cypress
#

I got no volume change.

oblique lagoon
#

Will be there any means to check non-remote-detonatable mine's ownership? getAllOwnedMines Doesn't return mines put by someone.

slate cypress
#

Yeah I just tried it in a LAN server and it still doesn't work Montana

winter rose
#

@slate cypress wait, it is a local effect command

slate cypress
#

Yep

#

I executed both commands locally

#

I did it through the debug console.

winter rose
#

weird then, try with vanilla musics?

slate cypress
#

I'll try

#

It doesn't work with vanilla music either unfortunately.

winter rose
#

works well here

[] spawn {
  playMusic "Defcon";
  sleep 1;
  2 fadeMusic 0;
};```
#

@slate cypress ↑

winter rose
#

@slate cypress?

signal sky
#

Anyone have a simple ai aircraft spawner? Looking to call enemy aircraft when certain criteria are met. Thought I’d reach out here first before taking a crack at it. Thanks!

ionic anchor
#
_add ctrlAddEventHandler ["ButtonClick","[true,_item,_amount] call RR_fnc_handleInv;"",SELECTED_TARGET_PLAYER"];

says error missing "" but i have tunnel vision and can't see where lol

cold pebble
#

you have ""

#

but this whole bit "",SELECTED_TARGET_PLAYER is wrong

ionic anchor
#

ah right, the buttonclick is supposed to give a virtual item amount (from an rscedit) to a player i select in a RscTree

cold pebble
#

well you'd need to remoteExec that function of whoever is clicked

#

as that function is run locally

winter rose
#

we can help, with more details ^.^

tough abyss
#

@odd pollen By far the simplest solution is to make your curators civilians and set the respawn point for civilians.

#

I believe πŸ‘€

#

Sorry?

#

They can use global chat. And I assume there is voice chat between players?

#

I had a question myself.

How do you make an object (vehicle) visible but without collisions ? The Eden editor doesn't distinguish and I couldn't find the relevant script command so fast.

#

hehe, found that one. Is there a disableCollisionWith everything ? πŸ˜„

#

I just want something floating in the air, basically

#

@odd pollen Errrr, so in Eden, you can uncheck "Enable Simulation", but my AMV-7 Marshall object most definitely still has collisions, even though you can't really interact with it. "Show Model" is the only thing that disables collisions, but also makes it invisible.

PS. Sure that picture is what I want. Well to be exact, I want my posed AI characters to execute their animations correctly next to it, without collisions interrupting them.

#

Appreciate the brainstorming! Was that picture a bug or intentional?

#

OK, not to be argumentative. But getting the Marshall to sit still is not a problem. I just want the 6 characters to NOT collide with it. And the exact reason I am asking this question is because disabling simulation does not solve the problem. I suppose I will play around with disableCollisionWith by executing it several times at mission start.

#

Yeah I'm making a cinematic :). By the way disableCollisionWith does work. Just need to execute it for every character. What's a helper?

#

Sounds great. Ya got an example? Searching for "Arma 3 Helper" is giving me cheat sites πŸ˜†

winter rose
#

use disableCollisionWith in conjonction with forEach for your 6 characters @tough abyss

tough abyss
#

Yessss merci. That was the solution I went with. Wonder why endigma 's messages are gone. Hope I didn't accidentally get him banned! notlikemeow

winter rose
#

he did it himself, one too many profanities. not permanent though

tough abyss
#

Ah. . How do you know this?

winter rose
#

…I'm a moderator?

tough abyss
#

Riiiiiight

tough abyss
young current
#

drop command can be used but likely needs a bit more to it too

slate cypress
#

@winter rose Ah I haven't tried it with spawn. I'll try that after this current mission I'm in

winter rose
#

spawn is not the issue/solution, it's just a way to use sleep

slate cypress
#

I tried it in a real time scenario using debug console

#

I executed playMusic command locally, waited about 10 seconds

#

Then executed fadeMusic command locally

#

It should have the same result as your code block but it doesn’t seem to

winter rose
#

I know it might sound patronising, but for debug's sake can you copy/paste the exact sqf lines you used in both debug executions @slate cypress ?

unique sundial
#

do you have CfgDisabledCommand defined?

oblique arrow
#

Hey peeps any chance anyone remember off of the top of their head if there's a command to join a server πŸ‘€ ?
I'm tinkering around a bit with the main menu spotlight buttons and wether I can use them to make a sort of quick join button for the unit I'm playing with

robust hollow
#

in dev there is connectToServer

oblique arrow
#

Hm okay

robust hollow
oblique arrow
#

oh yeah that looks like the thing I want, if there's nothing else I'll props just have to wait for that to come to main branch

winter rose
#

KK has something like that on his blog @oblique arrow

oblique arrow
#

πŸ‘€ Oki gonna take a look at it, thanks

winter rose
oblique arrow
#

Ah thanks

#

Aaah I think I understand what it does now? It manipulates the different displays to enter the server information and connect to the server... I think

winter rose
#

yes, it's a very hacky but efficient way to do so, right now

note that connectToServer won't work from a mission, either - only from the main menu

oblique arrow
#

Yeah I only want to do it from the main menu

#

I'll try out connectToServer on dev branch first and then just wait for it to come to main branch or try tinkering around with KKs work, I gotta figure out the rest of what I want to do too so heh

smoky verge
#

isn't the main menu technically a mission with specific UI dialogs?

oblique arrow
#

World scene is a scenario shown behind main menu when a specific terrain is loaded and -skipIntro is not used. If you're playing on Altis and leave to main menu, Altis scene will be used.

The scene is configured with the terrain and is responsibility of a terrain creator.

winter rose
#

I guess the command itself does some checks too

rocky nest
#

@rocky nest vectorUp and vectorDir can provide roll pitch yaw, as for heave and sway, the best i can think of is sining vectorDir/Up with current velocity. not sure how to handle surge though, you could just compare velocities in prev/current frame
@tough abyss Thanks man! those values are what i will be required to retrieve.. I was wondering what they would be called. now to find a way to export that data. maybe a custom .dll or something hmm

still forum
#

The command checks for non-multiplayer and uicontext, it miiight work in singleplayer. Never tried, and officially not supported

rocky nest
#

Cool ill check it out. Thanks!

fair drum
#

How should I approach limiting the range of the SAM batteries? Modifying the missile itself? Modifying the AI? Or is there something I can modify on the launcher itself?

winter rose
#

it would be a config change… or viewdistance change

fair drum
#

Are ai affected by view distance settings?

winter rose
#

yes

#

server VD if MP

fair drum
#

K gotcha I'll mess with it. Going the config route would result in a mod right? Never messed with game configs before.

winter rose
#

yep

hollow plaza
#

I'm 100% sure this has been asked and solved here already, but how can I get a custom flag texture to work on my server?
Currently I have put:
this setFlagTexture "custom\GOCLogo.jpg";
Into the init of multiple white flags, which then will get this jpg picture put onto them at the start of the mission, but my buddies only see an empty flag pole.

#

Seems that it should work locally on every machine, but it doesn't seem to be able to find the picture even though it is in the mission file. (Note that before I did not have the 'custom' folder)

north leaf
#

If I remember right, you have to convert the jpg to .paa(?) File type using Arma Tools, when I've used JPG in the past, it doesnt show unless the player gets real close to it...then it loads

hollow plaza
#

Yeah, I downloaded that to add a text onto the Corvette

#

I guess it only works with jpg when it's about pictures like in documents or something.

north leaf
#

I've used jpg a bunch, mainly cos I'm too lazy to switch it, but it doesnt load in MP unless a player gets close to it....no idea why lol

hollow plaza
#

Seemed like stuff wasn't loading in at all during my op, like the small flag at the end of the corvette wasn't showing for others. I'm unsure whether people could see the custom name of the ship, but it's problemful as I cannot test it myself.

#

Guess I'll try switching it all over to .paa

north leaf
#

Let me know!

hollow plaza
#

It'll take a moment before I know for sure due to the fact that I cannot check it myself, but I'll try and remember to post the results over here

torpid pike
#

Hi anyone here know what causes SP animations to not work in MP properly? (guy doing animation on the spot / AI fall over and stay down when something bumps them despite doNotCollide being on) :3

winter rose
#

@torpid pike which anims?

torpid pike
#

1 sec, will do it in code quote

#
BIS_shooter_1 switchMove "Acts_JetsShooterNavigate_in";
sleep 1.033;
BIS_shooter_1 switchMove "Acts_JetsShooterNavigate_loop";
sleep 2;
BIS_shooter_1 switchMove "Acts_JetsShooterNavigate_stop";
sleep 2.7;
BIS_shooter_1 switchMove "Acts_JetsShooterNavigate_out";
BIS_crew_1 switchMove "Acts_JetsCrewaidF_runB_m";
sleep 3.667;
BIS_crew_1 switchMove "Acts_JetsCrewaidFCrouch_in";
BIS_crew_2 switchMove "Acts_JetsCrewaidRCrouch_in_m";
BIS_crew_3 switchMove "Acts_JetsCrewaidLCrouch_in";
sleep 1.366;
BIS_shooter_1 switchMove "Acts_JetsShooterIdleMoveaway_in_m";
sleep 1.2;
BIS_shooter_1 switchMove "Acts_JetsShooterIdleMoveaway_loop_m";
sleep 1.8;
BIS_shooter_1 switchMove "Acts_JetsShooterIdleMoveaway_out_m";
sleep 3.66;
BIS_shooter_1 switchMove "Acts_JetsShooterShootingReady_in_m";
sleep 0.766;
BIS_shooter_1 switchMove "Acts_JetsShooterShootingReady_loop_m";
BIS_crew_1 switchMove "Acts_JetsCrewaidFCrouchThumbup_in";
BIS_crew_2 switchMove "Acts_JetsCrewaidRCrouchThumbup_in_m";
BIS_crew_3 switchMove "Acts_JetsCrewaidLCrouchThumbup_in";
sleep 2.5;
BIS_shooter_1 switchMove "Acts_JetsShooterShootingReady_pointing_m";
sleep 4.166;
BIS_shooter_1 switchMove "Acts_JetsShooterShootingLaunch_in_m";
sleep 1.791;
BIS_shooter_1 switchMove "Acts_JetsShooterShootingLaunch_loop_m";
vehicle player call BIS_fnc_AircraftCatapultLaunch;
sleep 8;
BIS_shooter_1 switchMove "Acts_JetsShooterShootingLaunch_out_m";
BIS_crew_1 switchMove "Acts_JetsCrewaidFCrouchThumbup_out";
BIS_crew_2 switchMove "Acts_JetsCrewaidRCrouchThumbup_out_m";
BIS_crew_3 switchMove "Acts_JetsCrewaidLCrouchThumbup_out";
sleep 2.366;
BIS_crew_1 switchMove "Acts_JetsCrewaidFCrouch_out";
BIS_crew_2 switchMove "Acts_JetsCrewaidRCrouch_out_m";
BIS_crew_3 switchMove "Acts_JetsCrewaidLCrouch_out";
sleep 0.5;
BIS_shooter_1 switchMove "";
BIS_shooter_1 setPosWorld getPosWorld BIS_resetShooter1; 
BIS_shooter_1 setDir 343.933;
BIS_crew_1 setPosWorld getPosWorld BIS_resetCrew1; 
BIS_crew_1 setDir 64.271;
#

XD okay thanks discord, lemme format that, sorry

#

thanks ❀️

#

I'm also trying to make sure that no matter whoever touches that AI, vehicle or otherwise, they don't flop down and hide

winter rose
torpid pike
#

yeah i didnt understand it sadly

#

i tried applying it but it seems to confuse the daylights outta me

winter rose
#

basically, try to do the same as in Example 2 πŸ™‚

torpid pike
#

Ohhh

#

for each line above? ^

winter rose
#

yep

torpid pike
#

I'll attempt that now, thanks!

#

Will that also stop the AI from hitting the deck if a vehicle goes near or hits them btw?

#

like, me or any other player

winter rose
#

hum, switchMove never did that iirc?

torpid pike
#

It might be how the animation is being executed, should I disableAI from init.SQF to prevent that occurring?

winter rose
#

well, try first, adapt later then

torpid pike
#

i think it's just that the current way i have it is... (in their init field)

this disableAI "TARGET"; this disableAI "AUTOTARGET"; this disableAI "MOVE"; this enableAI "anim"; this setbehaviour "CARELESS"; this switchMove "Acts_JetsCrewaidR_idle"; BIS_crew_2 disableCollisionWith vehicle player;

young current
#

if characters get hit, they might get damage to their legs and be unable to stand

torpid pike
#

Hmm, i disabled damage on them though

young current
#

just a guess

#

Β―_(ツ)_/Β―

torpid pike
#

^^; np

#

thank you all for this

real tartan
#

is there a way to check if mod is loaded with pre-processor in description.ext ? Probably using __EVAL

winter rose
#

…huh?

#

how do you load a mod in description.ext πŸ˜…

real tartan
#

description.ext

#ifdef MOD_ENABLED
    #include "file.hpp"
#endif
#

checking if mod is loaded when starting mission

winter rose
#

ah! I read that wrong, I thought "how can one know (in the mission) if a mod has been loaded by description.ext" 🀯🧠

#

I would say EVAL config reading indeed or some other sorcery

real tartan
#

trying to use isClass (configFile >> "CfgPatches" >> "name_of_the_mod" with __EVAL

still forum
#

yes you can do that.

#

with EVAL

#

but EVAL is not preprocessor, its ran after preprocessor is done, you cannot know INSIDE preprocessor

real tartan
#

nobody said inside preprocessor

#

nobody said EVAL is a pre-processor either

#

I guess this can do ? #define MOD_ENABLED (isClass(configFile >> "CfgPatches" >> "mod_base_class"))

still forum
#

nobody said inside preprocessor
You said
is there a way to check if mod is loaded with pre-processor in description.ext ?

#

And you posted

#ifdef MOD_ENABLED
from that I assumed you want to do it with/in the preprocessor

#

which means you can only use the preprocessor, and __EVAL is not preprocessor, meaning you can't use it

real tartan
#

*with pre-processor commands, happy now ?

still forum
#

Yeah. That means, what I said above.

#

__EVAL is not a pre-processor command

#

I don't understand why the offensiveness?

#

Just trying to explain to you

winter rose
#

@real tartan there have been two misunderstandings, and we tried (and managed) to help πŸ™ƒ
it's not mockery, it's "wait, what exactly are you trying to do?"

slate cypress
#

@winter rose
playMusic "MyIntro";
wait 10 secs
5 fadeMusic 0;

winter rose
#

so "MyIntro" in a custom music, ok
when you say "wait 10s", it's unpaused I assume

#

so yep, that's weird and I don't know how or why it's not working on your side πŸ™‚πŸ™ƒπŸ™‚

serene sentinel
#

can someone prompt me, playing HC mode, switching to one of the squad leaders and give order to soldiers to get in empty vehicle, when i switch back to HC they getting out of the vehicle. Can i solve it somehow?

winter rose
#

High Command. I was stuck on Headless Client πŸ˜„

serene sentinel
#

πŸ™‚

#

yes high command...

crude vigil
#

Why dont you command them to get into vehicle in HC mode? SL orders unit to get out when you stop controlling them.

#

in HC level, your orders will persist.

winter rose
#

so in HC, you give orders to the group
as a leader, you will give orders to your subordinates, but the leader himself has not been told to get in, so will get out and tell everyone else to, too

serene sentinel
#

in A2 the same works

crude vigil
#

When there is someone mind controlling him regularly, he of course forgets what is happening. notlikemeow

high horizon
#

There is anyway to get all arma3 faces ids?? including those that are in mods

exotic flax
#

Get all entries in CfgFaces most likely

high horizon
#

Get all entries in CfgFaces most likely
@exotic flax Where can i check it?? ☹️

winter rose
#

under the debug console > Config > CfgFaces

high horizon
#

under the debug console > Config > CfgFaces
@winter rose Thanks man

fair drum
#

confirming, triggering something that falls under water would be a ASL Z value of <0 right?

winter rose
#

ASL = Above Sea Level so I guess yes

high horizon
#

_nom = getText (configFile >> "CfgFaces" >> (face player) >> "Displayname") does anyone know how to make this work??

winter rose
#

should work no?

high horizon
#

should work no?
@winter rose returns ""

winter rose
#

starting A3 for the 12th time today… πŸ˜„

cunning crown
#

There's no displayName in faces

#

Or I cannot find one in the config atleast

#

Ah well, your cfgPath is wrong getText (configfile >> "CfgFaces" >> "Man_A3" >> (face player) >> "displayName")
CfgFaces >> XXX has subclasses of faces, and the Man_A3 is the one with Arma 3 heads

high horizon
#

Ah well, your cfgPath is wrong getText (configfile >> "CfgFaces" >> "Man_A3" >> (face player) >> "displayName")
CfgFaces >> XXX has subclasses of faces, and the Man_A3 is the one with Arma 3 heads
@cunning crown Working!! THX!

sonic thicket
#

Hey everyone,

I am currently making a script that involves animations and within this script it is very important that _source looks at _unit as the command is executed but for some odd reason there is a delay of between 1 and 4 seconds before this takes effect after the systemchat:

systemchat "test";
_source dowatch _unit;

The _unit performs a switchmove and the _source performs a playmove at the time, removing the playmove fixes the issue but adding a delay below a second or multiple dowatch/lookat commands wont help. Does anyone knows what I can do make the lookat push through the playmove?

#

I think it is the animation that comes with lookat. Is there any way to just skip the animation?

fair drum
#

remote exec global the switchmove and playmove, now try

#

@sonic thicket

sonic thicket
#

@fair drum Thanks for the tip πŸ˜„ I'll test that out! Never used remoteexec before but it should be like this right;

[_source] remoteExec [0 playMoveNow "babe_rvg_zed_stand_zombie_bolter"];

#

nopes lol

#

that throws an error

#

ill figure it out

#

got it πŸ™‚

fair drum
#

normal command:
A command B
remoteexec
[A,B] remoteExec ["command",client,JIP]

sonic thicket
#

Hmm, i got it to work with remoteExec [_source playMoveNow "babe_rvg_zed_stand_zombie_bolter", 0]; but despite it working it still throws an error

fair drum
#

your syntax makes no sense

#

standby

#
[_source,"babe_rvg_zed_stand_zombie_bolter"] remoteExec ["playMoveNow",0];
sonic thicket
#

Awesome πŸ˜„ Thanks a ton for the help! Now that command makes sense

#

Got myself a crispy animation of the wendigo eating a victim πŸ˜„

#

or... actually... I dont think it changed anything lol

fair drum
#

whats your error

sonic thicket
#

Well, no error really but the lookAt is still executed with a huge delay

#

I also tried executing lookAt remotely

#

Hmm I think i know what happens

#

Ahh nevermind

#

For a second I thought it's because the position of _unit doesn't update until the whole animation for _unit has played out. But if i remove the animation of _source it properly looks at _unit even directly after the animation

#

Hmm i can possibly fix this with a waituntil

#

waituntil _source looks at _unit

#

then execute the playmove

unique sundial
#

Try maybe Take and Put event handlers

tough abyss
#

that case just use EachFrame

#

what's stopping you from using eachframe?

#

eachframe isnt performance intensive

#

if you're just adding one eachframe per client

#

checking uniform types is almost instant so there'll be close to no performance impact

#

unless you're checking the uniforms of all units on the map that might be a different story (even then there can't be that many units to cause a performance penalty)

#

it looks like bottleneck is those <equipment> in tsp_allowedStuff. i'm guessing there's dozens of string comparisons in each iteration

#

you could create a game logic and set everything in tsp_allowedStuff as variables in that game logic, then to check if some equipment is allowed, use <game logic> getVariable <equipment class>. that's the fastest way to do dynamic sets in arma that i know

winter rose
#

the best code you can get is the one you do not execute ^^

hollow thistle
#

Both ace and vanilla arsenals emit events so Take, Put and arsenal EHs should be enough.

winter rose
#

the scripted Arsenal EH is only for Opening/Closing afaik

sonic thicket
#

I love that how eventually once you get the hang of the language mostly everything becomes clear. Arma3 has a great documentation. I have yet to find misinformation which is pretty amazing

astral oxide
#

hi, so i managed to add an FiredNear eventhandler to my character http://prntscr.com/u10l1e and it works fine. The problem only is that after a while, while the music is playing and another shot is being fired, the music cuts off and restarts from the beginning again. how can i fix this?

sonic thicket
#

you could add a cooldown for which you will need a scheduled environment, In this case I would execute a script from the init. Let's write something up

astral oxide
#

I know only very minimal basic scripting and copy paste my way 95% of the time so I don't know how to write one exactly

winter rose
#

I have yet to find misinformation which is pretty amazing
if you use player setDamage 1, your AI subordinates will flank the enemies using smoke, then come back to you bringing you elderberries
you said you wanted amazing misinformation, no?

sonic thicket
#

so for starters add the following line to the init field

this addEventHandler ["Firednear", {[this] execVM "yourscript.sqf";}];

Love it Lou πŸ˜‰

exotic flax
#

best undocumented "feature": if you place player setDamage 1 to the init field of any object, it will kill all players the moment they join 🀣

sonic thicket
#

I bet that's a hackers delight πŸ˜›

astral oxide
#

@sonic thicket done

sonic thicket
#

Then to the yourscript.sqf add the following:

_myfancycooldown = 10;
while { _myfancycooldown > 0 } do { _myfancycooldown = _myfancycooldown -1; sleep 1; };
playMusic ["Music_FreeRoam_Battle_Human",0];

There are better ways of doing this with E.G. waitUntil but I'm still lacking the confidence in my arma scripting skill to share a solid working method.

#

Also got a question for whoever could answer this;
Not that the else would ever fire but is this a proper string, as in does while also accepts else ?

while {true} do {} else {};
astral oxide
#

it works

sonic thicket
#

awesome πŸ˜„

astral oxide
#

could u explain whats happening in the script though? usually i can read and understand them somehow but this gets me off a bit

still forum
#

as in does while also accepts else ?
no, better said "do" doesn't accept an array.

sonic thicket
#

the variable _myfancycooldown has a value of 10.
Each loop within the while { } checks if the _myfancycooldown has a value higher then 0 and if it does it substracts 1 from the _myfancycooldown value.
This keeps repeating until it reaches 0 and then it continues the script with the playmusic

Thanks dedman πŸ™‚

winter rose
#

@sonic thicket

while { true } do
{
  if (condition) then
  {
    // x
  }
   else
  {
    // y
  };
};
still forum
#

Not aware of any Dedman being here

sonic thicket
#

And here i am trying my utmost best holding in the urge to ping everyone in my responses 😦

copper raven
#
_myfancycooldown = 10;
while { _myfancycooldown > 0 } do { _myfancycooldown = _myfancycooldown -1; sleep 1; };

whats the point of this? just sleep 10 instead?

sonic thicket
#

Well.. if the script gets executed 10 times in the first second it would play 10 times πŸ˜›

still forum
#

same with your while and a simple sleep tho

#

but your while is less exact.
So yours will sleep probably between 10 and 12 seconds or so

sonic thicket
#

I just realized lol, how would I fix that?

still forum
#

just replace it with a sleep?

sonic thicket
#

but if the script gets executed 10 times in the first second there wouldnt be a cooldown

still forum
#

each script would have a 10 second wait

#

do you want to queue them up, or do you want to just skip calls to the script before the end of the cooldown

sonic thicket
#

skip the calls

still forum
#

store last execution time in a global variable

sonic thicket
#

hmm that can be added easily

still forum
#

get it from diag_tickTime

#

on call check if currentTime < lastExecuteTime + 10seconds
if yes, exit

sonic thicket
#
_start = diag_tickTime;
while {true} do { if ( currentTime < _start+10 ) exitwith { playMusic ["Music_FreeRoam_Battle_Human",0]; }; sleep 1; };

So i guess that should do it instead then, I hope it works πŸ˜› I haven't tested it myself

@astral oxide

still forum
#

what

#

πŸ€”

#

currentTime doesn't exist.
_start is a local variable.
why the while loop??

sonic thicket
#

and that yes lol improved version:

if ( currentTime < diag_tickTime+10 ) exitwith { playMusic ["Music_FreeRoam_Battle_Human",0]; };
#

wait no it should save diag_ticktime

still forum
#

currentTime still doesn't exist.
diag_tickTime is current time, so that if condition will always be true

digital rover
#

   this addAction
   [
      "<t color='#0000cc'>REFRESH SCOPEBOX</t>",
      {
         params ["_target", "_caller", "_actionId", "_arguments"];
         _arguments params ["_addScopes"];
         {
            _target removeAction _x
         } forEach ((actionIDs _target) - [_actionId]);
         _target call _addScopes;
      },
      _addScopes, 10, true, true, "", "(_target distance _this) < 3"
   ];

Is there a better way of removing having an addaction remove actions, without using global vars?

I want to remove every action added by _addScopes, but the actionIDs added by _addScopes can't reliably be communicated to the scope of this addAction

This works, but would remove any other action on the object which isn't always what I want.

sonic thicket
#
if (diag_tickTime < (uiNamespace getVariable ['tag_cooldown',-1])) exitWith {}; 
_cooldown = 10;  
uiNamespace setVariable ['tag_cooldown',(diag_tickTime + _cooldown)];
playMusic ["Music_FreeRoam_Battle_Human",0];

@astral oxide did a check on this one, it really does work now

vernal mural
#

I was wondering, if I have a normal soldier of whatever side/class, and I do something like that :

_soldier enableSimulation false;
_soldier disableAI "ALL";
_soldier hideObject(Global) true;

is this enough to make this soldier almost "invisible" performance-wise ? If I have this guy and, let's say, 200 others like him, will the game run like there was nobody on the map ?

#

(question relative to dynamic ennemy spawners and stuff, because I always felt like creating/deleting soldiers on the fly is quite intensive and can sometimes be "felt" by players approaching cities and highly defended areas)

vernal mural
#

That's what I did this last two years, but to be honest I'm interested in trading a small bit of steady performances against a huge drop of FPS when entering a sector, and another one when leaving the said sector πŸ€·β€β™€οΈ

#

although reactivating simulation and pathing and stuff on a large group of AI will certainly lead to a FPS drop too

quasi zenith
#

Anyone know if there is a way to whitelist or blacklist certain unit patches from ace arsenal? Or is there a working method of setting unit patches to certain roles that won't be overridden by the ARMA group manager?

crisp cairn
#

I am not sure if this is the right place to ask this. I am wanting to create a zeus addon and it manipulates an object under it. I aint exactly sure where to start on it and I dont see much documentation on scripting for zeus. Can someone point me in the right direction?

digital hollow
#

Reference the Zeus Enhanced code on GitHub. They also have functions you can run to make custom modules pretty easily.

oblique arrow
#

@brave violet ^

brave violet
#

Thank you

#

So... you must be the admin... that yellow background means something!

crisp cairn
#

I was hoping to try and do it with out any need for a required mod

digital hollow
#

In that case see how ZEN adds their new modules, and do it that way.

oblique arrow
#

blep I'm not an admin either if you were talking to me, the people that have the veteran_moderator role and a brown name are the admins here @brave violet

brave violet
#

Very well, so many colors!

oblique arrow
young current
#

using @ in folder names on P is bad idea

#

@ is used in the game folder for mods

oblique arrow
#

Ah okay shibathinking

#

Hm I cant really find much online about file paths in relation to the P drive, maybe my google fu is just weak though

digital hollow
#

Looking at ACE is always a good plan

#

Especially if you use their project template

oblique arrow
#

do you mean their wiki or their files?

digital hollow
#

Files

oblique arrow
#

Ah oki

young current
#

it is not however the most simplest way πŸ˜„

#

if you have Arma data unpacked you have the A3 folder in P:\

#

thats how BI build their folder structure

oblique arrow
#

Nop I dont have the arma data unpacked

ebon citrus
#

You should

oblique arrow
#

Hm still havent figured it out, I've tried using a UI folder too but that just resulted in pbo project complaining about a missing file

#

rooHappy I got it to work with enough fiddling

#

Thank you to everyone that helped me hyperBongo

#

Okay now I gotta dig into the real scripting part

warm blaze
#

is it possible somehow spawn bots/object behind eyes of player(s) via scripts ?

young current
#

No you can only affect what is happening inside the game. not the realworld

oblique arrow
warm blaze
#

I mean to have a condition that could confirm: nobody looks at it now

young current
#

sure

#

you can check if any characters direction is towards the object for example

#

if you want to check if it is in the view of any character it does get more tricky

warm blaze
#

I would prefer to have max distance as one of parameters for condition processing

#

like 500 meters

winter rose
#
if (allPlayers findIf { _x distance _pos < 500 } == -1) then
{
  hint "_pos is at least 500m away from all players!";
};
```@warm blaze
warm blaze
#

thx a lot πŸ™‚

ornate sky
#

is this:
missionNamespace setVariable ["var1", 0, true];

the same as this:
var1 = 0; publicVariable "var1";

brave jungle
#

Hi guys, quick question, from a mod directory, any quick access methods to get say, a message to pop up on 3den Load? Not asking for a do it for me, just seeing if anyone has the knowledge on hand

random loom
#

@brave jungle BIS_fnc_3DENShowMessage

winter rose
brave jungle
#

Used the onTerrainNew EH in the end

#

Forgot about them haha

random loom
#

I'm running into an issue with BIS_fnc_createSimpleObject, where it spawns objects floating

#

What I'm trying to do is store some data regarding an object, delete it and spawn at a later point

#

For simple testing I'm just doing [typeOf cursorObject, getPosWorld cursorObject, dir cursorObject] call BIS_fnc_createSimpleObject

#

but same result

#

Found a solution, it appears that getPosWorld for a regular object is not the same as for a simple object

#

using it for simple objects you need to use getPosASL for some reason

#

except maybe not

#

Copying from BIS_fnc_replaceWithSimpleObject, you need to setPosWorld again after creating the object

#

apparently

winter rose
#

it depends on the createSimpleObject command syntax it seems: World vs ASL

random loom
#

Yeah but supplying it with either getPosWorld or getPosWorldVisual spawns it floating in mid air

exotic flax
#

short question; is there a (big) difference between

_unit linkItem "NVGoggles";

and

_unit addItem "NVGoggles";
_unit assignItem "NVGoggles";

Since both should add the item to the players inventory, and put it in the correct slot

#

or is it as simple as I think it is; linkItem will bypass the inventory, and therefor also work when inventory is full

winter rose
#

addItem won't work if there is no inventory room yep

vague geode
#

Is there any easy way to get a vehicles icon and then mark said vehicle with said icon for either one person or one side?

#

The reveal doesn't seem to be a good solution so I am thinking about attaching a marker with the vehicle icon to said vehicle.

winter rose
#

drawIcon3D + Draw3D mission EH?

vague geode
#

But how to I get the vehicle icon?

winter rose
#

through config, I suppose

vague geode
#

Yeah, I thought about a more automated solution.

Anyways other question: Does anyone happen to know where I can find a kbtalk sentence that announces the Estimated Time of Arrival with a variable time?

random loom
#

@vague geode pretty sure you can do

getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "icon")
#

check the config viewer

winter rose
#

you can't be more automated than that indeed πŸ€·β€β™‚οΈ

vague geode
#

@random loom Thanks, that's exactly what I was looking for.

random loom
#

πŸ‘

vague geode
#

Still is there a list of all sentences that can be spoken (by any player) with kbtell?

winter rose
#

I suppose so

random loom
#

should be available in config viewer

winter rose
#

you can compose your sentence with CfgWords in radio config

random loom
#

^

#

Just a complete pain to navigate though

#

probably better to extract the game files and look for it there

winter rose
#

The advantage is you can make a fully dynamic sentence, as in "target at 030, 200m"
an Operation Arrowhead sniper mission had your spotter speak like this

vague geode
#

So I can simply add a .bikb-file to my mission folder and add all the sentences I need and can then use them with BIS_fnc_kbTell?

Also what I meant was a list so that I could search the right sentences with ease instead of needing to click through all the subconfig thingies in the CfgSentences because that can take ages...

E.g. "Everyone out!" is configfile >> "CfgSentences" >> "Showcase_SlingLoading" >> "37_Landed" >> "Sentences" >> "showcase_slingloading_37_landed_PIL_0" so you have to click through numerous submenues.

winter rose
#

these are already defined sentences
I don't know of a list of all the official kb assets

vague geode
#

Ah, ok. But how does the building sentences thing work because I can not record me saying them...

winter rose
#

it uses the unit's speaker voice

#

all the "words" are listed in CfgWords iirc

vague geode
#

Ok, but I can just put a .bikb-file to my mission folder, put in the sentences with reference to their soundfiles and then use them with BIS_fnc_kbTell, right?

winter rose
#

yes can

vague geode
#

Ok, thanks alot.

tawdry harness
#

Hey, Im currently working on a comms script where i change the players comms depending on a situation, however after holding PTT for over 3seconds (give or take) it cuts u off

#

I can give codeif u need it but im not sure what you will need, im just looking for knowledge abt it

fair drum
#

exitWith just exits that code block right? or does it terminate the whole script

winter rose
#

it exists the current scope

#

if you are at the root, it will leave the whole script

fair drum
#

okay

vague geode
#

How can I let someone say something from the "RadioProtocolENG"?

winter rose
#

kbTell?

#

as I told you, words can be used to build sentences with kb commands

vague geode
#

Ah, ok. I am trying to figure it out...

fair drum
#

if I do something like this:

private _timer = [600,true] call BIS_fnc_countdown;

private _alarm = true;

while {[true] call BIS_fnc_countdown} do {

    while {_alarm} do {
        playsound "evacuate";
        sleep 30;
    };

    _timeleft = [0] call BIS_fnc_countdown;
    hintSilent format ["%1 seconds until detonation!",floor _timeleft];
    sleep 10;
};

the code will never pass to the _timeleft line as long as that _alarm is true correct?

winter rose
#

yep

fair drum
#

hmmm. how could i get two loops going in the same code or should i just make two separate files and call them?

winter rose
#

what do you want to do? that alarm keeps going? spawn it?

fair drum
#

i intend on having the alarm phrase going every 30 seconds cause I'm going to add a looping panic music that occurs during the whole 600 s duration (so that will be another loop). then timer will update every 10 seconds (3rd loop)

#

the original code i had was

while {} do {};
while {} do {};
while {} do {};

but that wouldn't pass to the next while. I'm now at,

private _timer = [600,true] call BIS_fnc_countdown;

private _alarm = true;

playSound "escape";
private _escapeSound = ASLToAGL [0,0,0] nearestObject "#soundonvehicle";

while {[true] call BIS_fnc_countdown} do {

    playsound "evacuate";
    _timeleft = [0] call BIS_fnc_countdown;
    hintSilent format ["%1 seconds until detonation!",floor _timeleft];
    sleep 10;
};

due to me combining different things

#

still need to loop the "escape" though and I'd like to pull the "evacuate" out for a 30 sec timer

copper raven
#

store countdowns for each thing, and just compare the deltas to the delays you want, rather than having so many loops

#
TAG_alarmLastPlayedTimestamp = diag_tickTime;

while {...} do {
  private _currentTimestamp = diag_tickTime;
  if (_alarm && {_currentTimestamp > TAG_alarmLastPlayedTimestamp + 30}) then {
    TAG_alarmLastPlayedTimestamp = _currentTimestamp;
    playSound "...";
  }
}

etc etc

winter rose
#

@fair drum quick and dirty solution:```sqf
private _handle = [] spawn {
while { true } do {
playsound "evacuate";
sleep 30;
};
};

waitUntil { !_alarm };
terminate _handle;

vague geode
#
while { alive player } do {
    waitUntil { !isNil { player getVariable "BIS_SUPP_selectedProvider" } && {!isNull (player getVariable "BIS_SUPP_selectedProvider")} };

    _pilot = player getVariable "BIS_SUPP_selectedProvider";
    _vehicle = vehicle (player getVariable "BIS_SUPP_selectedProvider");
    _vehicleType = typeOf vehicle (player getVariable "BIS_SUPP_selectedProvider");
    _icon = getText (configFile >> "CfgVehicles" >> _vehicleType >> "icon");
    _colourArray = [1,1,1,1];

    _index = addMissionEventHandler ["Draw3D", {
    drawIcon3D [_icon, _colourArray, ASLToAGL getPosASL _vehicle, 1, 1, 0, 'str_a3_wl_custom_transport' call BIS_fnc_localize, 1];
    }];

    waitUntil { player knowsAbout _vehicle > 0 };

    removeMissionEventHandler ["Draw3D", _index];
};```

For some reason I get an error saying drawIcon3D is expecting 3 elements while getting 0 even though it is clearly getting more. Any idea why?
high horizon
#

Do you know any way to count the words of a text obtained from a RscEdit?

winter rose
#

@high horizon you could split by spaces then count

fair drum
#

any way to get the playSound to not have these spikes of attenuation? I know that this area is technically under the map in some spots and as I walk over those spots it attenuates.
https://streamable.com/s9ar1x

fair drum
#

well.. nvm. me being the dumb dumb I am, I didn't test the navmeshes or the hitboxes on this user created map... the AI shoot through the walls so thats a scrap 😠

sonic thicket
#

Hey guys, I am trying to make a music player for within cars that uses createVehicle and say3d so i can attach it to moving objects However the createVehicle location always has some sort of offset. Same goes for when using the player to determine the location.

#

I am not sure if this is what causes the issue but I am using HeliHEmpty to create an object

#

vehicleRadio provided an excelent solution

fair drum
#

post code so far

agile pumice
#

Can someone give me a hand with some radio chat stuff? I want to set a custom callsign for a gamelogic to be used for a simple sidechat. This is my test string [west, "Tower"] sideChat "Hi there";
And this is the class I made for Tower:

class CfgHQIdentities {
    class Tower {
        name = "Tower";
        pitch = 1;
        speaker = "Male03EN";
    };
};```
winter rose
#

I don't think you can define CfgHQIdentities in description.ext

agile pumice
#

:<

winter rose
#

you could use one unit left somewhere at sea to be the HQ, and name it as you wish ?

agile pumice
#

I tried the setCallsign module for that and I couldn't get it working

winter rose
#

use it on a unit, not on a HQ

agile pumice
#

Working, thnx

#

I was using a civ unit being big dumb

winter rose
#

rubber-ducking the solution!

vale sky
#

I currently have 2 Scripting Issues I hope you Guys can Help me with. Its not much really. The First thing is: How am I able to Move Objects with Scripting Smootly, appearing like they have been Animated? (Up and Down Motions, not more) And 2nd, is there a way in Scripting where I can Measure the Distance a Vehicle has Driven?

winter rose
#

@vale sky for the latter, you can count every second, or every meter, the distance from earlier position

#

for the former, see key animations (I don't know anything about them)

vale sky
#

Thanks, I'll look into that! To get more into Detail with the 2nd Thing, Distance Stuff, I have to Measure the Distance which a Vehicle Traveled in a Straight Line from some Point on. If the Vehicle Moves Back or to other Sides, it should not Count. Maybe im just Stupid and my 1:23 AM Mind cant wrap around how you could use the "distance" Command for that πŸ˜…

#

Its a Bulldozer Moving, and if it Moves forward with the Shield down, the Hill its Creating gets bigger, the First thing I asked about was about the Hill, because I dont want to "Animate" it in Visible Steps

winter rose
#

pointA distance pointB for a straight line

vale sky
#

hm, yea maybe that could work. I'll see if im able to make it work πŸ˜„

tough abyss
#

How i can add custom flag to vehicle?

#

Example i found unique flag on google and i want to use it as flag for vehicles on my mission

winter rose
#

Like a floating flag?

tough abyss
#

i'll send you pic in dm

winter rose
#

Flag pole, and in the Eden properties there is a flag texture path

#

You can set your own flag in the mission directory

#

That or setFlagTexture

tough abyss
#

So like if my flag is in missions/MissionName/flags/flag1?

winter rose
#

No, directly flag1.jpg (or paa)

tough abyss
#

And everyone will see it on server?

winter rose
#

I sure hope so πŸ˜„

tough abyss
#

Thank you,again

grim wing
#

cursorObject setVehicleInit "this addaction ["Arsenal", "["Open",true] call BIS_fnc_arsenal;"];";

#

does this work?

#

if not whats the fix?

young current
#

have you tried it?

grim wing
#

yeah not working

young current
#

what is it that you want it to do?

grim wing
#

add arsenal to a box that im looking at

young current
#

probably use the addaction part only

grim wing
#

no setVehicleInit

young current
#

init does really nothing here as the object is already spawned

#

init is already over

grim wing
#

so

#

cursorTarget this addaction ["Arsenal", "["Open",true] call BIS_fnc_arsenal;"];

#

?

young current
#

cursortarget is already the object

#

no "this"

grim wing
#

didnt work

warm hedge
#

No " inside "

#

Use ' if you want to make a string inside string

grim wing
#

still didnt work

warm hedge
#

How did you even tried to do that?

grim wing
#

console

warm hedge
#

Didn't work at what context?

grim wing
#

nope

fair drum
#

anyone got a RHS and CUP class list? the RHS site link for their classes has been broken forever.

warm hedge
#

Use configClasses to make list easily

fair drum
#

interesting. is there a list of different things such as 'transportSoldier' in the example?

warm hedge
#

You can if you want

fair drum
#

no i mean, how would i know the tons of possibilities i can throw into this command lol, is there a list

warm hedge
#

Meant a list that contains transportSoldier numbers per vehicles?

fair drum
#

no, for example

_transporters = "getNumber (_x >> 'transportSoldier') >= 10" configClasses (configFile >> "CfgVehicles");

where can I find a list of things i can replace 'transportSoldier' with if I wanted to check for anything else

warm hedge
#

Ah

fair drum
#

its the same thing with this

_respawn = _logic getvariable ["respawn",[]];

how would I ever have known to put "respawn" to get this logic

warm hedge
#

You just can use all of config values

fair drum
#

so i would have to go into each config and actually see what categories are available to acquire then

warm hedge
fair drum
#

yes thats what i was wondering if there was a list of

#

ty

sonic thicket
#

Hello everyone, I am trying to create a music player with CreateSoundSource so I could delete the source when E.G. someone switches the track playing. I have tried setting the SounrSource Variablespace and then deleting the soundsource with deleteVehicle but without any luck.

Could anyone explain how I would go about deleting the soundsource attached to the player parentobject (car) at the // comment lines in the following part of the script:

    _vietnamtrack1 = ["Track01", "Track01", "", {
    _playergroup = group player; 
    ["Album BFV", "Track: Fortunate Son", "By: Creedence Clearwater Revival"] spawn BIS_fnc_infoText; 
    _vehicle = objectparent player; 
    // ----------------------------------------- Need to delete any current track attached to the objectparentplaying here.
    _musicplayer = createSoundSource ["BFVTrack01", position player, [], 0];
    _musicplayer attachTo [_vehicle];
    }, {true}] call ace_interact_menu_fnc_createAction;
    
    _vietnamtrack2 = ["Track02", "Track02", "", {
    _playergroup = group player;
    ["Album BFV", "Track: On The Road Again", "By: Canned Heat"] spawn BIS_fnc_infoText; 
    _vehicle = objectparent player; 
    // ----------------------------------------- Need to delete any current track attached to the objectparentplaying here.
    _musicplayer = createSoundSource ["BFVTrack02", position player, [], 0];
    _musicplayer attachTo [_vehicle];
    }, {true}] call ace_interact_menu_fnc_createAction;
#

Even deleting the soundsource using allMissionObjects does not seem to work

#

Well.... it works with say3D lol

#

Hehe, that works all too well πŸ˜„ I've probably missed it on the workshop but If there really is no mod that does this I'm very supriced. It's not too hard to add an music player

fair drum
#

curious to know why you are doing it this way instead of something like playSound3d/say3d

sonic thicket
#

Because at first I didnt knew about the #soundonvehicle you can find with E.G. nearestObject and to my knowledge the only way to make a say3d stop is with deleteVehicle.

So i had to make a seperate createVehicle _musicplayer, do an _musicplayer say3D and then I could delete the object but createVehicle has some sort of positional offset

#

if the _vehicle location is used it spawns next to it instead of dead center and this bothered me big time so I explored all other options, found nothing, posted the issue here and then at the last moment I found out about allMissionObjects which i now use in nearestObject

#

Ofcourse I could've asked here from the bat and get it all explained but I like to explore how the code works and try out everything so in the end i can believe that what I code is quite roundabout. I think this one is pretty straight on this time though πŸ˜„

ebon citrus
#

@sonic thicket did you check the syntax

#

Use "CAN_COLLIDE" to set the vehicle EXACTLY where the object position is

#

Or setpos it after

#

Whichever

#

Example from biki:
createVehicle ["Weapon_Empty", getPosATL player, [], 0, "CAN_COLLIDE"];

sonic thicket
#

Oh damn ofcourse, thanks for the tip πŸ˜„

#

That is very nice to know for future implementations πŸ˜„

unique sundial
#

dont underestimate the power of BI wiki

winter rose
#
setVehicleInit```is **deprecated** and has been neutralised. See https://community.bistudio.com/wiki/setVehicleInit
@grim wing @young current @warm hedge
young current
#

πŸ‘Œ

ebon citrus
#

The BIki is a gateway to many abilities some would deem... unnatural

sonic thicket
#

So, for some reason I can't create this simpleobject with any of the following commands:

_craterBB = createSimpleObject["a3\weapons_f_orange\ammo\bombcluster_03_f.p3d", position player];
_craterBB = createSimpleObject["bombcluster_03_f", position player];

I got the info with the command getModelInfo cursorObject

["bombcluster_03_f.p3d","a3\weapons_f_orange\ammo\bombcluster_03_f.p3d",false]

However if I make it a vehicle it does work

winter rose
#

isn't it
\a3
instead of
a3
? I don't remember

sonic thicket
#

I have tried both & @ 😦

#

I wanted to automatically create a crater and more at a location that has a bomb dud, seems I will have to add in this dud manually, its perhaps even better as the amount of locations I will add those are forseeable

ebon citrus
#

@sonic thicket createsimpleobject takes ASL position

#

position returns AGL

#

createvehicle takes AGl

#

That's why createvehicle works

#

Createsimpleobject was just generating the object underground

#

VERY RELEVANT

#

Next time check if your object exists with !isNull

#

Let me know if you get it working or if more issues arise

sonic thicket
#

Thanks @ebon citrus πŸ™‚ I've already switched things around and placed the objects on the map itself, however with the following tiny script i have tested it:

_craterBB = createSimpleObject["bombcluster_03_f", GetposATL player];
isNulL _craterBB;

this returns true, no object was created

winter rose
#

ASL

#

getPosASL @sonic thicket

ebon citrus
#

@sonic thicket asl and createSimpleObject takes the FULL shape path

#

bombcluster_03_f is not a shape path

#

It looks like a classname

#

So ofcourse it would create nothing

warm hedge
#

createSimpleObject may take CfgVehicles class but not CfgAmmo IIRC

winter rose
#

hopefully, there is a wiki at hand

ebon citrus
#

You right, didnt check the alternate syntax

#

But if you use cfgVehicle, then you use asl

#

Not positionWorld

#

Minor difference likely

#

But still meaningful

still forum
#

isn't it
\a3
instead of
a3
? I don't remember
@winter rose it always changes in places πŸ˜„ But leading backslash is usually the way to go, but then there are also places where that doesn't work.

ebon citrus
#

Leading backlash is not meant to be on createSimpleObject.

#

It reads on the biki page

#

But i found it always confusing when and when not to use it

#

Maybe if you dig back bohemia historical commits for decades, you might find what and why

still forum
#

Programmer just thought he'll do what he did and not think about standards that's why :D
But for simpleObject mission relative paths work too, so leading \ for absolute path would have been neat πŸ™ƒ

fair drum
#

if i have a bunch of boxes all over the map but don't give them variables, how could I go about selecting them script wise?

copper raven
fair drum
#

mk. trying to learn configclasses... so if i wanted to get the classes of everything that contains the text "OPTRE" would I do something like this?

_configs = "(getText (_x >> 'OPTRE'))" configClasses (configFile >> "CfgWeapons")

warm hedge
#

Use "'OPTRE' in toUpper configName _x"

fair drum
#

will i have to take out the file path then add in quotations to make it a normal array of strings?

warm hedge
#

Mean you want the array of classNames?

fair drum
#

yeah

warm hedge
#

Then something like this:

"somecondition" configClasses (configFile >> "CfgWeapons") apply {configName _x}```
fair drum
#

so like this

_weaponList = "('OPTRE' in configName _x)" configClasses (configFile >> "CfgWeapons") apply {configName _x};
#

well i guess i have to add a kindOf condition now as well as that pulls in armor

warm hedge
#

Note that in command is case-sensitive and is why I used toUpper in the example

fair drum
#

I guess its time to learn how to manipulate arrays cause now I have an array of class names which I wanted, but now I need to remove things like helmets and stuff from the array

winter rose
#

Or make an array of helmets, an array of stuff, and join their content when needed

exotic flax
#

I have an interesting issue with groups:
On the server I create an empty group and give it a name, and set 'deleteWhenEmpty' to false so it doesn't get removed directly.

_callsign = "CallSign";

_group = createGroup [west, false];
_group setGroupIdGlobal [_callsign];

On a client I call a script to set the player to one of the groups created on the server (this always happens AFTER the server ran its code).

_player = player;
_callsign = "CallSign";

{
   if ((toUpper groupId _x) isEqualTo (toUpper _callsign)) then {
      [_player] joinSilent _x;
   }
} forEach allGroups;

However, when I check allGroups I don't see the groups being created (and I know the script has ran) until I manually run the server script in the debug console (executed by server).
And until I manually did that, the client can't join the group (obviously).

I know that both createGroup and setGroupIdGlobal are global, so it locality shouldn't matter. And with 'deleteWhenEmpty' set to false it should stay even when empty (although wiki notes this is always the case in Arma 3?).

Is there something I'm doing wrong?

PS. the data is retrieved from a database, although for testing purposes the data is hardcoded. It also uses CBA_fnc_serverEvent and CBA_fnc_targetEvent to get data from the server (after DB access) to the correct events at the server/client.

winter rose
#

I believe there is an "issue" with deleteWhenEmpty, that deletion will happen no matter what

exotic flax
#

But nobody was in the group (yet), and it should only be deleted the moment it becomes empty (after units were in)...
Guess it's just a "feature"... so now I need a solution πŸ€”

exotic flax
#

yup

#

server part, on mission start (XEH postInit)
client part, called manually while in-game

#

It seems to be related to the "deleteWhenEmpty" feature, which basically removes empty groups.
Question is; is this happening because it takes too long to use the group, or is it caused due to locality πŸ€”

#

Although locality I already busted, since I can run the above scripts from the console (as server and as client) and it works without issues.
So it's most likely a timing issue...

winter rose
#

yup - you could add one default unit in it?

exotic flax
#

yup - you could add one default unit in it?
I could, although that gives the problem of disconnects;

  • server creates group with dummy
  • client joins group, kicks dummy
  • client disconnects (aka leave group)
  • group gets deleted anyway?
  • client joins again, group is gone...
#

will try

blazing moat
#

Not sure if anybody can talk me through this, i want to do a CO-TVT where you have to locate a crash site defended by AI and take it back to your start.

The crash-site I want to be at one of a number of pre-determined locations, easiest way I could do this is set a few spawn markers for it I believe? I'm looking for something a little more complex... so that I can make each crash site look a little more of a set piece, so to do that I would create each full crash-site and have a condition for them to spawn... so lets say condition for spawn might be SITEA, SITEB etc etc...

How would I make the mission script at the beginning to randomly choose which site to spawn this round? Please and thankyou...

finite jackal
#

selectRandom
switch

blazing moat
#

so I wouldn't create an array that would randomly set SITEB=true; or anything?

pliant stream
#

what is this fascination with the set difference operator? in A3 you even have a command to remove from array by index...

exotic flax
#

to satisfy my curiosity, would you mind seeing what happens if groups are created once the mission is fully initialized say...cba_missionTime > 1
@tough abyss
Doesn't seem to do anything, even added a CBA_fnc_waitAndExecute with 5 seconds.

But it seems that the groups are not created at all on the server. I also added a diag_log allGroups after the createGroup code, and it just returns the default group which was created in the editor (Alpha 1-1).

Will try to execute the code globally instead and see if that works (although I'm afraid I just create n*1 groups with it...

pliant stream
#

after choosing an index i and moving out a[i], i would normally move the last element from a[n-1] to a[i] and shrink the array but since this is sqf and you're probably dealing with a small array, deleteAt even if it is O(N)

still forum
#

even if it is O(N)
The overhead of executing more commands will be worse than any in-engine performance thing

pliant stream
#

right

#

you'll need a big N before it's a win in SQF

still forum
#

per command overhead is going down by about 8% on next perf/prof tho :3

pliant stream
#

are you still using the same dynamically allocated OOP instructions?

#

i.e. BlahInstruction derives Instruction with some overriding Execute function

still forum
#

what

#

yeah kinda

pliant stream
#

i bet you could get orders of magnitude improvement with a contiguous instruction stream, a tight execution loop, a union for values where possible, and preprocessing local variable access to get rid of the map lookups

#

at least over a2. i don't know how much you've changed it for a3 of course

#

at least in some worklods... e.g. any linalg stuff would probably see huge improvement

still forum
#

with a contiguous instruction stream
nah, I tried
a tight execution loop
it already is, iterate through array of instructions until timelimit runs out

#

preprocessing local variable access
can't do, your function can be called from anywhere, and if you have a call in there it can call to anywhere

#

orders of magnitude improvement
no

pliant stream
#

you tried a bytecode instruction stream?

still forum
#

instructions store data in them

#

so can't really do that

pliant stream
#

why not? lots of ISAs have variable size instructions

still forum
#

we currently have array of instructions. not much different from a bytecode stream with all the info in there. Minus some padding ofc

pliant stream
#

the tight loop kind of plays into this. in most "high performance" script vms instead of an actual loop, after each instruction you jump directly to the next one. think gnu address-of-label extension.

still forum
#

huff

#

I have another 10% performance improvement for script execution that I couldn't do yet

pliant stream
#

as for optimising local variable access, i bet you could do it locally to some extent at least

still forum
#

mark your variables as private if you want to get fast access/set

pliant stream
#

right

still forum
#

One big problem making scripts slow is that we also need to constantly do things against cheaters/hackers. Such a drag

winter rose
#

many CPU cycles are lost to the great hackers war…

pliant stream
#

but even with private locals you're still doing a table lookup on each access, yeah?

still forum
#

yeah but only one table

pliant stream
#

right. i think you could eliminate the lookup in many cases

#

link the instruction directly to the variable slot at script compile

still forum
#

as soon as you have a single "call" or "isNil" or && or || or tons of other stuff that executes code, your variable might have been replaced with something else

#

I grab things by profiling and seeing whats slowest.
local variable lookup did barely show up in my benchmark script

tough abyss
#

How to I get a title to show to only one player, this message goes to everyone on the server titleText ["<t color='#44ff00' size='3'>test message</t><br/>", "PLAIN", -1, true, true]; This script is running in a mod. It is supposed to send "onPlayerConnected" to the person that is connected but it sends to everyone.

winter rose
#

@tough abyss where is it run?

pliant stream
#

heh, i suppose it's not worth the effort of completely reimplementing the vm or building an optimiser. you've got that new dayz sa language as well right

winter rose
#

you've got that new dayz sa language as well right
not in A3 afaik

tough abyss
#

Wdym by where it is run

#

it is a server mod

pliant stream
#

right, but they wouldn't be pouring resources on SQF at this point i imagine

tough abyss
#

meant to only be on the server

winter rose
#

right, but they wouldn't be pouring resources on SQF at this point i imagine
ah now I got it yes "you got that on your arms already"

pliant stream
#

right, and i'm guessing there will be no new titles using SQF

winter rose
#

@tough abyss is it a mission EH, an object EH, ?

still forum
#

I want to add a optimizer yeah

#

but only constant foldibng

pliant stream
#

where's the fun in that

tough abyss
#

I don't have it in an event handler

#

should I?

winter rose
#

I don't know Β―_(ツ)_/Β―

#

where is it written, where is it run, what are you trying to do?

blazing moat
#

@tough abyss Thanks, your example worked great, seems to be deleting all the props, one more question, how would I get it to incorporate things like smoke modules, chemlights etc

pliant stream
#

constant propagation and some math identities might be interesting but i guess if you can't inline functions you're missing the best part of an optimiser

still forum
#

but i guess if you can't inline functions you're missing the best part of an optimiser
exactly, can never know what will be in a global variable.

tough abyss
#

I got it Lou, i need to put in an initPlayerLocal.sqf, thanks for the help

pliant stream
#

still, you could do local constant propagation, identities, loop transforms, dead code elimination, at least to some extent

#

but callees being able to write your locals definitely screws with that

still forum
#

dead code doesn't need to be eliminated

pliant stream
#

yeah it's not the most important optimisation certainly

winter rose
#

if it's dead-dead, performance impact = 0
if it does unneeded operations, improvement/refactoring is welcome

still forum
#

a if statement that always evaluates false does waste some performance

#

but not really worth the effort

#

might aswell just not write bad code

#

things like inlining array creation does alot tho

pliant stream
#

even if it's never touched technically it's still eating up cache in a tightly packed contiguous instruction stream

#

if the instructions are all over the place then you're probably wasting a lot of cache anyway

still forum
#

they are

#

can't know if "if" branch will be taken or not

#

and if then code can be a variable too, and a global one too. Meaning no optimization

pliant stream
#

ah but that's a rare case

still forum
#

if _localVar && globalvar then fnc_test

#

yeah but, it needs to work

pliant stream
#

sure

#

but you could optimise the 99% of cases where the code following a then is inline

#

i'm not saying it's worth it writing that optimiser for sqf

#

the rules are too loose

still forum
#

It won't help much

#

what would help moist is constant folding and changing how arrays are created

pliant stream
#

changing array creation sounds easy enough

still forum
#

X39 already wrote an optimizer, and I wrote a second one

#

works pretty nicely

winter rose
#

any hint on the perf gain?

still forum
#

don't remember the results

#

ofc depends on what you're doing. There is no real benchmark script that does something from everything

queen cargo
#

One could in theory optomize away false evaluating Code, unroll loops etc

#

But that is quite complex to do

#

And requires pre compilation

vale sky
#

Guys, I need to find a way to see get the distance a vehicle has driven forward, no Matter what direction it turns. Could I use Distance2D for that?

pliant stream
#

so if it it drives around a circle you want 2*pi*r?

jade abyss
#

distance2D only returns the distance between 2 points, so if he would stear left/right -> false result

vale sky
#

yes, thats the Problem in Facing

pliant stream
#

you could poll it and add up the distance

jade abyss
#

You probably want something like (of course not 100% accurate):
store last pos -> wait 1s -> check distance2D between those two points and add it to an existing distance counter -> repeat

vale sky
#

exactly

jade abyss
#

(rough example to give you the idea)

vale sky
#

problem is

jade abyss
#

As i said: not 100% Accurate.

vale sky
#

how to Define an Unknown Point in Distance2D

#

if you know what I mean

jade abyss
#

Why unknown?

pliant stream
#

you need to keep track of the last known location

vale sky
#

oh wait

#

now I think I know what you mean

#

Basically the Vehicle Starts Moving > Creates Point1 > 1sec later Creates Point2 > after Point2 was created it measures the Distance between Point1 and Point2

#

and adds them up when the Vehicle Continues driving

pliant stream
#

keep going

jade abyss
#
_start = getPos _car;
_someBoolStatement = true;
_dist = 0;
while{_someBoolStatement}do
{
  _end = getPos _car;
  _dist = _dist + (_start distance2D _end);
  _start = _end;
  uisleep 1;
  if _dist > 10 then{_someBoolStatement = false;}
};
systemchat str ["Distance driven:", _dist];
#

something like that ☝️

vale sky
#

thanks, that looks about right πŸ˜…

#

didnt really consider that Approach at first

jade abyss
#

But as said: Not 100% accurate + it also counts if the vehicle moved backwards etc

vale sky
#

hm, yea the Backwards Driving is still a Problem

jade abyss
#

Yep, that is something for you to solve now πŸ˜‰

vale sky
#

is there a Command to get the Speed of a Vehicle?

jade abyss
#

(hint: speed)

pliant stream
#

surely you want velocity..

vale sky
#

just found it

jade abyss
#

sshh Untelo

vale sky
#

its literally just called "Speed"

#

Question is

jade abyss
#

No fun in serving everything on a plate πŸ˜›

pliant stream
#

you what mate

winter rose
#

(hint: speed)
with Keanu Reeves right?

jade abyss
#

Yeah

pliant stream
#

you're the one that coded him up a whole solution

#

smh

jade abyss
#

Not the whole

vale sky
#

is Backwards driving giving Negative Values?

winter rose
#

yes

vale sky
#

I seen it on Helicopters

#

I think

jade abyss
#

Just check it out (+read the Descriptions on the biki)

winter rose
#

performance-wise: is there any value in declaring a script as a function and call/spawn it, instead of using execVM?

#

(for a one-time call, should I add)

jade abyss
#

I guess it's faster, since it won't need to "load" the file?! Never rly used execVM tbh.

still forum
#

execVM reloads the file, recompiles the whole script

#

and preproc

#

one time call, not really a difference

#

execVM saves you some memory, as all the stuff is thrown away after use. But you don't care about memory

jade abyss
#

I guess memory is the least of the problems

#

btw: Was there a simpler way to get the "player" from the ownerID, except for cycling through units?

winter rose
#

nope, and I got a function for that

jade abyss
#

same here, was just curious if there was a simpler way added recently

high horizon
#

Anyway to check if vehicleplayer is on road or grass?

high marsh
high horizon
high marsh
#

πŸ‘

tough abyss
#

Can somebody help me in dm about attaching object to vehicle ?

exotic flax
#

If you ask your question here more people will be able to help

tough abyss
#

I cant send pic here

#

I want to attach banner on my truck left side

#

But i dont know how to get right cordinates

#

i've heard about getpos but i have no idea how to use it

high marsh
#

boom, if you already have any points setup on the left side you can do that

#

otherwise, I believe when using attachTo it's literally just relative to the model center.

ebon citrus
fair drum
#

if houses are under 'house', what are military buildings under?

ebon citrus
#

Uhh

#

Strategic?

#

Im pretty sure everything is under house to some degree

#

Even gates

quasi rover
#

Is there a land in the map that the height of ATL is lower than ASL?

fair drum
#

pretty much any surrounding body of water

#

the terrain underneath

quasi rover
#

I mean the surface of the map is lower than ASL. which area? excluding sea.

fair drum
#

I don't think there is. Pond water and stuff is frequently just placed there by the terrain maker and doesn't count as a water surface for ASL

#

what command do I use to change the heading a unit in a turret is looking at? setDir moves the whole object

oblique arrow
#

iirc there's something like 'target'

fair drum
#

looks like everything involving 'target' involves the ai looking at an object. im just trying to get them to look around.. so far i have

_direction = 0;

while {alive gunner aa} do {

    aa setDir _direction;
    _direction = _direction + 60;
    sleep 5;

};

but I don't want to use setDir since it moves the whole turret base

#

or is there the ability somehow to call the function that controls the "scan horizon" on the player to AI command bar

tough abyss
#

Can i get help making a exile server here?

fair drum
oblique arrow
#

Remember not to break the crossposting rule @tough abyss

tough abyss
#

@oblique arrow sorry I thought building a server was a version of scripting. Still new to this kind of stuff

fair drum
#

eventually when you want to customize that mission, it will involve that, but getting it off the ground is for those channels

frail vault
#

hey guys, is it possible to put a space where patches can be seen on a vest?

olive walrus
#

Hey guys little question how can i force ai to shoot while he is doing an animation, i tried to look for it in the forum but i found nothing i also tried to use the forceweaponfire function but it didnt work, i will be glad if someone can help me

ebon citrus
#

Try that

#

This leads me to believe it would work
Weapons can be fired in this way from a not-readied position (eg, firing a rifle on a soldiers back).

vague geode
#

I have a question concerning the HandleDisconnect mission event handler: It says in the community wiki that "If this EH code returns true, the unit, previously occupied by player, gets transferred to the server, becomes AI and continues to live, even with description.ext param disabledAI = 1;"

Does that mean that it becomes an NPC until it dies or does it become and NPC as if the AI option was enabled in the description.ext meaning it respawns after death and just continues to play until the mission ends?

ebon citrus
#

Depends on your respawn options and methods. I dont think vanilla AI respawn in this way with vanilla respawn modules if AI is disabled

#

I could be wrong, though

#

Usually best is just to handle the unit at disconnect if you need continuity

#

Like moving them to a debug area outside the map and disabling their AI

#

Try it?

vague geode
#

There's already a system in place for dealing with disconnecting players (thy either drop dead or despawn altogether) so moving them out of map etc. isn't necessary.

I just thought it would be cooler if their unit lived on until dead because despawning comrades isn't very realistic, is it?

fair drum
#

It will continue to live until it dies.

#

Is my interpretation

winter rose
#

live until it dies, yes
but the question was "will it blend respawn?"

winter rose
#

what for…?

#

Does that mean that it becomes an NPC until it dies or does it become and NPC as if the AI option was enabled in the description.ext meaning it respawns after death and just continues to play until the mission ends?

copper raven
olive walrus
#

hey guys is there any way to make heli engines look like they are on and moving in editor?

winter rose
#

yes, but why?

#

if for screenshots, I would recommend you use Polpox's screenshot framework πŸ˜‰

olive walrus
#

yeah i am using

#

but i just want to save time and screenshot it in editor

#

so i need to know how to make the heli engines on effect

winter rose
#

you select it, then get it with```sqf
(get3DENSelected "object" select 0)

then you enableSimulation true
olive walrus
#

thank you man

#

and one more quick question

#

how can i make heli stay static in air but with engine on?

#

@winter rose

#

not in eden editor hh

winter rose
#

not in editor? just place it > 30m altitude iirc

olive walrus
#

im creating heli fast rope picture and i dont want the heli to me

#

move**

winter rose
#

place above the ground > 30-50m in Eden,
then setPos where you want and enableSimulation false

hollow thistle
#

not sure if rotorblur will be visible with disabled sim. attachTo mby?

warm hedge
exotic flax
#

I did try a lot of stuff and it seems to be working now, although no idea why and how...

#

I did add some fallbacks just in case, because sometimes it still removes the groups before I can access them

fair drum
copper raven
#

just calculate some position relative to the heading you want

winter rose
copper raven
#

look at the examples

winter rose
#

@eager pier click the "Show Text" button in the description, it's a bit hidden

#

it is not structured text, but close enough

slow falcon
#

How can I sign the mods so that they cannot be messed with hacks? and what do I have to sign
Γ§

oblique arrow
#

Uh I'm not sure what you mean with signing them, if you mean signing them with a bikey that just means that they can be used with the signature verification feature on servers @slow falcon

slow falcon
#

what I want to do is encrypt the mods so they don't mess with cheats

pliant stream
#

what exactly are you looking to encrypt?

#

you can obfuscate sqf to make changing its behaviour more difficult

slow falcon
#

only one altis can be encrypted or it can be from pop3 mods

still forum
#

what you're talking doesn't make much sense

oblique arrow
#

only one altis can be encrypted or it can be from pop3 mods
Sorry can you rephrase what you mean? I'm not really understanding it

still forum
young current
#

Educated guess is Altis Life server that would be protected from hackers and cheaters.

oblique arrow
#

I'm pretty sure he's talking about a multiplayer mission so yeah could be altis life

short flame
#

I got a script where I have a backpack and when i Drop it I can delet it to use the inside

Now I want to get the same backpack back after I am finished

I just need to get the class name of the backpack from the config.cpp saved into a variable in my delet script and open this variable in the finished scrpit

oblique arrow
short flame
#

yeah but i need to delet it and get it again later so how can i save it to a variable which is Shared in 2 files

oblique arrow
#

I'm not sure how you can transfer it between 2 files but cant you just save the classname in a seperate variable before the backpack is deleted and then use that?

short flame
#

I don't know beacause I'm new to scripting

#

I would use anything that works

#

do you have abny idea

#

config.cpp

class Backpack{
  class EventHandlers
        {
            init="_this execVM (""\scripts\init\init.sqf"")";
        };
  };

init.sqf:

_staticBackpack = backpack player;

finish.sqf:

use _staticBackpack;
young current
#

explain more detail what is it you want to happen

#

why do you delete the backpack and then need it again

#

why not just not delete the backpack

#

if you delete it you cant access it anymore

fair drum
#

i want to get the profile or steamprofile name of a player... profileName and profileNameSteam look to have no defining syntax. How would I use these?

#

i guess it works if it is run locally, guess i need to figure out how to collect all the player names for the server only script

robust hollow
#

one way is to setvariable the return onto the unit with the server as the target, then the server can getvariable the name off the player object.

fair drum
#

sooo....

_profileName = {profileName};
engie1 setVariable ["userName",_profileName];

running locally then,

_profileName = engie1 getVariable "userName";
etc

run serverside?

ebon citrus
#

shouldn't

#

but can

fair drum
#

well I'm just trying to do some death messages, and this is where I'm at so far...

_engie = [engie1,engie2,engie3,engie4];

{
    _engineer = _x;
    if (!alive _engineer) then {

        format "%1 has been killed!", blahhhhhhhh something something hint remoteexec on clients
    }
} forEach _engie;

blah is where I'm at. if i had to do something locally, i would have to do two scripts instead

ebon citrus
#

or remoteexec a function server-side

#

the client passes the player steam name as a variable to that function

#

and it's fired at the killed eventhandler

fair drum
#

maybe something like this?

_engie = [engie1,engie2,engie3,engie4];

while {true} do {

{
    _engineer = _x;
    _owner = owner _engineer;
    if (!alive _engineer) then {

        _profileName = [] remoteExec ["profileName",_owner];
        [format ["%1 has been killed!",_profileName]] remoteExec ["hint",0];

    };
} forEach _engie;

sleep 1;

};
robust hollow
#

i was meaning

engie1 setVariable ["userName",profileName,2];

and then the server can get the variable off the unit whenever it needs to.
for death messages specifically I would normally do that with a killed or mpkilled eventhandler, but whatever works.

#
_profileName = [] remoteExec ["profileName",_owner];
[format ["%1 has been killed!",_profileName]] remoteExec ["hint",0];

that would not return the profileName from the first remoteexec, because remoteexec does not return the result of the remote executed command/fnc.

velvet merlin
#

ran into a super weird AI issue:
an AI/GL walks after a setPos into a cover position (bush) no matter what (fleeing returns false)

doStop, stop, disableAI "move"/"fsm"/"all", removing all WPs, allowFleeing 0, etc - nothing worked

#

only switchMove "" made him stop in the end

jade abyss
#

What's the mode of the AI? e.g. Combat, casual (or however they are called)

velvet merlin
#

was careless and yellow, but tried all variants too

jade abyss
#

πŸ€”

winter rose
#

I call "mods" for 5000 Alex!

pale ridge
#

so i am trying to introduce pain inducing bullets into a mod, and i have no experience with scripting. This is my best shot at it, i am pretty sure i messed up alot there. Can someone help me with that?

this addEventHandler ["HitPart", {                                       
    params ["_ammo","_target"];                                          
    if _ammo = ["AmmoSplinterRM","AmmoSplinterRS"] then (                
        if (isClass(configfile >> "CfgPatches" >> "ace_main")) then (    
            _painLevel = _painLevel + 0.2 _target;                           
            else (                                                       
            _currentdamage = getDammage _target;                         
            _newdamage = _currentdamage + 0.1;
                 )
        )
}];```
#

another option would maybe be to give _target the ace modifier of : painReduced=-X , as it is stated in medicaltreatment for e.g. morphine.
Tho i don't know if painReduced works with negative numbers

thin owl
#

How would one saves placed objects via ACEs fortify tool to inidbi?

#

So they save into a database and don’t poof after a restart

slate mantle
#

Hello, in the creation of my clothing shop I have this problem: line 273: Config: 'U' encountered instead of ','. Yet there is nothing wrong with this line?

thin owl
#

Paste the line of code, 4 before and 4 after

slate mantle
#
class gang_clothing {
        title = "STR_Shops_C_Gang";
        conditions = "";
        side = "civ";
        uniforms[] = {
            { "NONE", $STR_C_Remove_uniforms, 0, "" },
            { "U_IG_Guerilla1_1", "", 1500, "" },
            { "U_I_CombatUniform", "", 5000, "" },
            { "U_I_CombatUniform_tshirt", "", 5000, "" },
            { "U_I_CombatUniform_shortsleeve", "", 5000, "" },
            { "U_I_GhillieSuit", 75000, "" },
            { "U_I_OfficerUniform", "", 155000, "" },
            { "U_I_C_Soldier_Bandit_1_F", "", 4000, "" }, //Apex DLC
            { "U_I_C_Soldier_Bandit_2_F", "", 4000, "" }, //Apex DLC
            { "U_I_C_Soldier_Bandit_3_F", "", 4000, "" }, //Apex DLC
            { "U_I_C_Soldier_Bandit_4_F", "", 4000, "" }, //Apex DLC
            { "U_I_C_Soldier_Bandit_5_F", "", 4000, "" } //Apex DLC
        };
        headgear[] = {
            { "NONE", $STR_C_Remove_headgear, 0, "" },
            { "H_BandMask_blk", $STR_C_Civ_BandMask, 300, "" },
            { "H_Cap_headphones", "", 400, "" },
            { "H_Booniehat_dgtl", "", 500, "" },
            { "H_Booniehat_tna_F", "", 500, "" }, //Apex DLC
            { "H_MilCap_dgtl", "", 35000, "" },
            { "H_HelmetIA", "", 95000, "" }
        };
        goggles[] = {
            { "NONE", $STR_C_Remove_goggles, 0, "" },
            { "G_Balaclava_oli", "", 15000, "" }
        };
        vests[] = {
            { "NONE", $STR_C_Remove_vests, 0, "" },
            { "V_PlateCarrierIA1_dgtl", "", 39000, "" },
            { "V_PlateCarrierIA2_dgtl", "", 49000, "" },
            { "V_PlateCarrierIAGL_oli", "", 59000, "" },
            { "V_PlateCarrierIAGL_dgtl", "", 79000, "" }
        };
        backpacks[] = {
            { "NONE", $STR_C_Remove_backpacks, 0, "" }
        };
    };```
#

^^

warm hedge
#

Where's your line 273?

slate mantle
#

{ "V_PlateCarrierIA1_dgtl", "", 39000, "" },

warm hedge
#

Also use ``` <- this formatting

slate mantle
#

But when I remove the vest lines, the error is still there for the goggles, etc etc etc.

warm hedge
#

Pastebin your entire code

slate mantle
warm hedge
#

And you put this into description.ext, and how?

slate mantle
#

It's a config master that includes the config shop.

warm hedge
#

What's the config master?

#

I get nothing, since I know nothing about the script/config format or something

slate mantle
#

#include "Config_Clothing.hpp"

warm hedge
#

Paste your entire description.ext please

slate mantle
#

but I know the mistake didn't come from there, the mistake came from the clothing config.

warm hedge
#

You meant if you comment out the #include won't cause an error?

slate mantle
#

I mean, if I hadn't put more clothes in the shop, there wouldn't be this mistake...

warm hedge
#

Excuse me?

slate mantle
#

I added clothes, and that added that mistake.

#

The file without the modifications yes has no error

#

No, it doesn't even work without

#

The error then goes from 273 to 269

warm hedge
#

Might caused by wrong and invisible character. How about to rewrite the same thing?

slate mantle
#

I'm thinking of doing it by elimination, since the error is not visible. I'll see and tell you again if it still doesn't work. Thanks to you πŸ˜‰

short flame
#

config.cpp

class Backpack{
  class EventHandlers
        {
            init="_this execVM (""\scripts\init\init.sqf"")";
        };
  };

init.sqf:

_staticBackpack = backpack player;

finish.sqf:

use _staticBackpack;

@young current
I need to delete the backpack which is empty and then spawn an backpack (just the same model) again so I can use it again

I can not explain it more but thi sbackpack has an funktion with lets "transform" the backpack (delet it and spawn something else) and later I want to make it backward but I dont know how I can save my backpack model/class name

potent dirge
#

After running

player action ["Surrender", _unit];

Is there a way to un-surrender captive unit? That is to return him to normal animations state.

winter rose
#

nope, afaik

thin owl
#

Maybe use the same one but just have the ""

#

I know that's how you cancel AI animations

potent dirge
#

You mean like:

player action ["", _unit];
thin owl
#

yeah

#

might not work on players though

potent dirge
#

Returns Foregin error: Unknown Enumeration

short flame
#

maybe "none"

#

or something simlar

thin owl
#

try
player switchMove ["", _unit];

#

or just put ANIM in the quotations

#

also could try just the regular player switchMove "ANIM"; / "";

potent dirge
#

Thank you so much. I could give you a big fat kiss

thin owl
#

np πŸ™‚

short flame
#

I need to delete the backpack which is empty and then spawn an backpack (just the same model) again so I can use it again

I can not explain it more but thi sbackpack has an funktion with lets "transform" the backpack (delet it and spawn something else) and later I want to make it backward but I dont know how I can save my backpack model/class name
@thin owl can you help me too

thin owl
#

bit of an odd thing to do

short flame
#

I know but rest is finished and works

thin owl
#

you got everything, you just need to find the backpack model?

short flame
#

yeah I just need to save the classname of that backpack and open it in an other file

thin owl
#

thats a little outta my realm fella lmao

short flame
#

no i want to delet it in init and later replace it in finish
@eager pier

#

I alredy can spawn it but not with the same model/texture

#

the texture is saved in the config.cpp of this mod

#

A script which delets the other things and spawns a backpack (already on the player)

              _caller addBackpack _staticBackpack;

if I wrote the classname of one of my backpack it works but for that I have to change it everytime in the script so I want to use a variable which knows the classname of the backpack which i deletet in init

thin owl
#

you cannot remove stuff from an init and move it to another file

short flame
#

I want to define a variable in one script and call it in anotherone

like

_staticbackpack = backpack player;

other script

Addbackpack _staticbackpack ;

if I wrote Addbackpack (name of backpack class); it works but due to multiple backpakcs this script is for I need to use a variable

proud carbon
#

Hello people of this fine discord.
I have a simple and humble request of assistance.
What is the most simple way to check if a group of AI has completed their 1 and only waypoint?

#
_wpBoatSatus = False;
_wp = _BoatCrew addWaypoint [_Targetpos, 50, 0];
            _wp setWaypointStatements ["true", "_wpBoatSatus = True"];
            waitUntil {sleep 15; ((not alive _TheBoat) or (_wpBoatSatus))};

so something like this?

short flame
#

@eager pier THank you very much it works but one last question

is it possible to make something like _staticbackpackID setVariable ["backpackClassNameToRemember",_staticbackpack];

#

because this script will run in multiplayer and so if someone dies and anotherone wants to use his backpack it doesn't work anymore

copper raven
#

_wpBoatSatus will always be false, local variables carry over into lower scopes, but not into new scripts, either make it a global variable, or better - call some function when either _theBoat is destroyed, or the waypoint is completed, and run stuff there, rather than having waitUntil mess constantly checking, when you can actually know at what time exactly the condition will be true. @proud carbon

short flame
#

ok due to I am really new to scripting do you know howI can do this
@eager pier

proud carbon
#

I am a bit lost. how do I know the time at which the condition is true?

#

well my script will spawn in boats every time a boat dies.

copper raven
#

killed event handler on the boat + what you already have with the setWaypointStatements

proud carbon
#

I'm a bit new to event handlers, but how do I resolve when the boat reaches the destination?

#

because then I want to give it another waypoint

copper raven
proud carbon
#

ok I see what you mean

proud carbon
#

With the kinda support of this discord, I got the script working. only problem is the bridge kills the waypoint for some reason.

#

but that's a mod problem. Thank you @copper raven @eager pier

short flame
#

@eager pier Thank you very much for your help

does anyone which type is a backpack which lays on ground (backpackContainer or simlar)

oblique lagoon
#

Is there a way to add a class? For eg I have below in description.ext. Done searching (https://community.bistudio.com/wiki/Class_Inheritance)

//description.ext
class CfgCommunicationMenu
{
    class someCommMenu;
};

//myComm.cpp
class myCommMenu;

And I want my class to be added to there without conflict and letting my script user do #include once at the last part of description.ext.
Like below

//description.ext
class CfgCommunicationMenu
{
    class someCommMenu;
};
#include "myComm.cpp"
//myComm.cpp
class myCommMenu;

And I expect result config to be like this.

class CfgCommunicationMenu
{
    class someCommMenu;
        class myCommMenu;
};
#

Is it possible or should I just say users to manipulate their description file?

winter rose
#

you can, but place your include inside the CfgCommunicationMenu

#

include is just "write this file here"

oblique lagoon
#

You again?

winter rose
#

me again

oblique lagoon
#

Brilliant

#

Always forget...

#

#include should be something like #ItReallyReplacedTo>>>>>>>>>>> "here"

olive walrus
#

hey guys i am getting an error with my script, maybe im blind but i cant find what i missed
the game say "Error Missing ;"

winter rose
#

then something is wrong indeed
post on e.g sqfbin.com ?

olive walrus
#

wait i am posting the script

#

maybe i am missing something

#

and you guys can help me

#

this is the script

#

the game say "Error missing ;" in line 10

winter rose
#

indent plz πŸ™€

olive walrus
#

what hhh?

winter rose
#

use tabs please, and spaces πŸ˜„ so it is easier to read

reading it rn to find the issue

olive walrus
#

OK XD

#

thankes

#

Ping me if you find the problem

winter rose
#

sure thing

#

@olive walrus missed a };

olive walrus
#

oh

#

are you sure?

winter rose
#

kinda, I redid the indent and something was off

olive walrus
#

I tried to put a };

#

its not seem to work

winter rose
olive walrus
#

if you can repair the code for me i will be glad

#

oh

oblique lagoon
#

indentation for you

olive walrus
#

thank you let me check it

winter rose
#

mine is butter, there

oblique lagoon
#

;γ……;

#

textFx for npp is great but can we indent sqf file in VSCODE too?

#

Just as same as NPP TextFX

olive walrus
#

Its now giving me a big error

oblique lagoon
#

I use npp to beautify code and VSCode to code..

olive walrus
#

and still missing ;

#

i send a picture of the error wait

oblique lagoon
#

what a small screen

olive walrus
#

no

#

i just took a screen shoot with light shoot program

#

and it looks realy small

#

hhh

oblique lagoon
#

imgur

olive walrus
oblique lagoon
#

still small to read

short flame
#

I have attached a variable to a backpack and want to access it when the backpack is laying on the ground, anyone knows how it works?

still forum
#

backpackContainer on the weapon holder

short flame
#

I am new to scriptin what do I have to write

#

@still forum

short flame
#

Ok i am really sorry but I dont get it

#

backpackID = unitbackpack player;
backpackID setVariable ["backpackClassNameToRemember",_staticBackpack],

#

instead of unitbackpack backpackcargo to write the variable?

#

here with script @still forum @thin owl

init.sqf 1.

private _id = backpack player;
backpackID = unitbackpack player;
backpackID setVariable ["backpackID",_id]

use.sqf 2.

_backpack = cursorTarget; //Script is started from backpack laying on ground
_id2 = _backpack getVariable "backpackID";
oblique arrow
#

Shouldnt you be able to cut out the ID and just do
unitbackpack player setVariable ["backpackClassNameToRemember",_staticBackpack],?

short flame
#

yeah but I need tha variable later in other things too, but it don't works with both sets

oblique arrow
#

ah oki

short flame
#

do you know how it could work?

oblique arrow
#

nop

short flame
#

ok thanks anyways

still forum
#

backpackID = unitbackpack player;
why do you use unitBackpack when I told you to use backpackContainer?

#

my

on the weapon holder
was wrong though, on weapon holder (on the ground) its
everyBackpack command

pliant stream
#

is it still impossible to fully replicate vehicle inventory? i seem to recall even in A3 there were some cases you either couldn't query or reproduce with something like attachments on a rifle in a backpack in a vehicle

short flame
#

init.sqf 1.

private _id = backpack player;
backpackID = backpackContainer player;
backpackID setVariable ["backpackID",_id]

use.sqf 2.

_backpack = everyBackpack cursorTarget; //Script is started from backpack laying on ground
_id2 = _backpack getVariable "backpackID";

why do you use unitBackpack when I told you to use backpackContainer?
@still forum so?

still forum
#

"everyBackpack" returns an array of backpacks

#

_id2 = (_backpack select 0 )getVariable "backpackID";

short flame
#

ok thx

peak plover
#

Hello, I need to know when the player starts aiming down sights

#

How do I know that the player has started aiming down sights?

#

As soon as RMB is pressed (even if it is rebinded)

short flame
#

"everyBackpack" returns an array of backpacks
@still forum thank u u are the best

thin owl
short flame
#

ok and this is hopefully my last post to this mod

is it possible to make something like an if ()then{} in the config.cpp to look if an extra mod is installed

young current
#

no

short flame
#

ok

young current
#

could you perhaps explain what kind of feature you are trying to make

#

It might be easier to advice on the exact thing instead of the beating around the bush