#arma3_scripting

1 messages ยท Page 206 of 1

bold rivet
#

nvm found it. Thanks

dire star
#

how do i make squad invincible this script isnt working {_x allowDamage true;} forEach units group dog_company_grp;

winter rose
dire star
#

mb i said it wrong, i wanted to make them be able to take damage again. I figured out it's working like this {_x allowDamage true;} forEach units dog_company_grp;

dire star
#

Nvm so if i run this script via debug it works but if it's ran via script it says undefined variable

#

Any fixes?

austere granite
#

Does anyone know a way in which I can just skip team selection when previewing a mission in MP (From editor).

winter rose
#

where is dog_company_grp defined, by which machine is the script run?

dire star
#

dog_company_grp is player group so it's already spawned in editor

#

and script is ran

{_x allowDamage true;} forEach units dog_comapny_grp;
};```
winter rose
#

comapny or company?

#

seems like a script typo too

dire star
#

think its working now i didnt know i had to remove this ; from allowDamage true

winter rose
#

you don't need to

dire star
#

idk when i had that it gave me error now when i've remove it, it seems to work

winter rose
#

try adding it again, it should not matter ^^ anyway, good thing it's solved ๐Ÿ™‚

blissful current
#

As a backup solution, yes, because my mission will break unless the helicopter lands close to the coordinates I have selected.

Ideally, I would like to try for a better solution, though. Would it be possible to monitor those coordinates for objects that could impede landing and then shift the landing a couple of meters away? Then rinse and repeat this as it is landing to make sure there are no new obstructions.

Or how about this idea, a check to see if the landing spot is blocked, then a warning to tell players to move? Then check again and reinitiate the landing. Though I like this less because it might be unrealistic, since IRL the pilot would just land a few meters away.

hallow mortar
#

Probably setVelocityTransformation and an eachFrame mission event handler

#

If they're physics objects you can use standard setVelocity and addForce for true physics crushing, but you may have to apply them more than once over time if you want to keep a constant speed

#

About it being multiplayer, you want to make sure that the objects are being managed by one machine only - if every client is trying to do it at the same time, it could cause problems. Usually the server is the machine of choice for this sort of thing. remoteExec, isServer, and the "server only" checkbox in the trigger's settings are potentially useful tools for this.

errant jasper
#

He wants to allowDamage false eventually. Don't allowDamage require local argument? Wouldn't the proper way be to "remote" exec for each member where they are local at the time you want it to happen? (For this particular scenario, I guess a "safe" way would just be to remoteExec globally).

#

Locality can change dynamically, like say AI leader is killed and player takes over, isn't locality of AI transferred to player machine?

crimson lion
#

Feel like I'm going crazy. I have a script that creates a group based on the detected side of a given class:
private _reinfGroup = createGroup _factionSide;

Literally anywhere later in this function when I call _reinfgroup, like for this line:
_enemySpawned = _reinfGroup createUnit [(selectRandom enemyInfantry),_reinfSpawn,[],0,"CAN_COLLIDE"];

I get an error undefined variable in expression: _reinfgroup

#

_reinfGroup is created at the start of this function so its not a scope issue, why the fuck

#

When debugging, if I do this, _reinfgrp is correctly defined:

private _factionSide = [east, west, independent, civilian] select _sideIndex;
private _reinfGroup = createGroup _factionSide;
#

Nevermind for now, seems like my function is not correctly receiving the faction class I've been trying to pass it petoday fuck

smoky crane
#

@still forum Just some feedback on the new "Promises" on dev branch:

Would be really useful if continueWith could accept an "args" parameter, that would be passed to the code as _thisArgs. For example:

[_handle, [1, 2, 3]] continueWith {
  diag_log _this;
  diag_log _thisArgs; 
}
pallid palm
#

@blissful current hay friend me i have something for you:

winter rose
#

a virus

thin fox
#

๐Ÿณ๏ธโ€๐ŸŒˆ

pure hare
#

In setVariable when should i set the public field to true? If i set it to false, does that mean during getVariable, the client will still receive the updated version?

thin fox
#

if not, it remains local only to the machine that executed

pure hare
#

Ah okay. I should mention, in my case it is part of the missionNamespace, so i assume a getVariable request would be directed to the server, who has the updated version stored?

thin fox
#

if you want send the information to the clients as well, you should put it true in the public parameter

tough abyss
#

Hi there. I got some help coming up with "talking" NPCs. We are really happy with the results, and understand there are limitations to Arma's code. Here we simply have a "hidden" disabled custom channel, and a painfully simple sqf. Is there by any tiny chance, a way to disable the part that shows my screenname sending the message to myself? If possible, I want only the white part of the text in the chat stream in the photo to be visible.

#

We could use systemchat channel, but we don't want the drab grey text. If there is a way to change the color on that, I believe that would work as well, but my gut tells me that is hardwired.

#

Haha, last message before a response. If it would be possible to change the displayed name in the red text that would work as well. Not picky about the method, just the result.

thin fox
#

what commands are you using it?

tough abyss
#

This with a simple addAction and execVM in the NPC. We have local and server triggered notifications, so our hint stream is busy enough. We also have color coded text channels, and the stream there can be busy. I will make the sleep much higher, so things are not as chaotic. We just want this channel to stand out as much as possible, to make it easier to read and focus. Some of these NPCs give important tutorial info. Any ideas or workarounds welcome.

pure hare
#
[unit1, "Hello!"] remoteExec ["globalChat", thePlayersMachineNetworkID]``` works perhaps? You need to query the unit and player id in advance though.
#

From my understanding, since the remote execution is limited to the player client, it should not appear in anyone else's global chat.

tough abyss
pure hare
#

The player's name is taken, because you let the player send the message to custom chat. You need to have "endyou321" send the message though.

tough abyss
#

I thought this would be the issue. Can a unit with disabled sim be made to send a message to the chat stream?

pure hare
#

hmm, i assume in this case "_unit" in the code above refers to endyou321 in this example?

#

so you can try _unit customChat ...?

tough abyss
#

I think that may work! Thanks, I would have never thought of that. I will test it with this simple one first.

pure hare
#

And if that doesnt work, look at my remoteExec example above. "unit1" is the one sending the message and "thisPlayersMachineNetworkID" the id of the receving player

tough abyss
errant iron
#

in this case, remoteExec shouldn't be necessary since the action already runs local to the client that activated it

pure hare
#

Hey, i want to check the existence of a mod, but i'm a little lost at finding the correct name.
So here's an example from ACE

if (isClass(configFile >> "CfgPatches" >> "ACE_Medical")) then {...```
Now i tried with DUI squad radar
```sqf
if (isClass(configFile >> "CfgPatches" >> "DUI - Squad Radar - Radar")) then {...```
but nothing happens, so i probably search for the wrong thing. What exactly is the name that goes there? Where can i find this exact naming for a given addon? I just went with the Addon name appearing in the CBA Addon menu, but that seems to be wrong.
errant iron
#

afaik mod authors can name their patches anything they want, so reading config.cpp is the most reliable way to know exactly what it is

tough abyss
pure hare
errant iron
#

uhh not that one, the class itself

#

whatever CBA generates for ADDON would be the class name you check for

pure hare
#

OH, so the "ADDON" macro

#

alright ty!

#

Related to debugging this, do you know if there is a way to speed up reloading missions in a server? I always recompile mission -> restart server -> restart client, but it takes so long. Especially for small naming issues like this lol

errant iron
errant iron
# pure hare Related to debugging this, do you know if there is a way to speed up reloading ...

oh god, for a windows server it would lock the mission file so i used to have two .pbo copies and then switched between them with #mission command to reload it without a restart, and after a few runs my client would also start disconnecting after downloading the mission file (maybe it didn't want to overwrite MPMissionsCache?), so i set up symlinks to my MPMissions directory to avoid client restart as well

pure hare
pure hare
#

I was stuck in preprocessor hell, tried to find the definition of ADDON, but it was 10 includes and addon itself was defined of other components with a custom preprocessor function

errant iron
#

i believe for CBA with hemtt, it's simply the prefix in project.toml* + the name of the addon directory with an underscore: ```toml

project.toml

prefix = "diwako_dui"``` so for addons/main/, the final ADDON would be diwako_dui + _ + main = diwako_dui_main
-# *did some more research and now as far as i understand it, CBA's ADDON macro actually only depends on script_mod.hpp => PREFIX and script_component.hpp => COMPONENT, meaning hemtt's config doesn't affect it at all >.>

pure hare
#

Ah okay, also i assume it doesn't care about capital letters? Since "ACE_Medical" should probably be "ace_medical". I use ACE - No Medical, so i can't say for sure, but there everything else is lowercase.

errant iron
#

yeah either should work, their canonical patch names are lowercase but config lookups are case insensitive anyway

pure hare
#

Aye, thanks a lot!

pure hare
#

Omg, it works! Finally I can have unconscious color tracking inside DUI

blissful current
#

I there a list of these somewhere? "Man", "Tank", "Car". I need to add static weapon emplacements and whatever else but idk what they are called in game.

private _objectsNearby = ExtractHelipad nearEntities [["Man", "Tank", "Car"], _clearRadius];
split ruin
#

ok, this gets interesting ... location placed on the map is actually object not location ... is this normal ?

cosmic lichen
cosmic lichen
#

It should have parent class Static or turret

jade acorn
#

I have an idea, making it real is a problem - how can I register a sequence of pressed buttons to execute code? Something like the built-in cheats work

tough abyss
#

I am trying to implement something a member helped with above. I am new to this, so I needed some clarification.

In this photo example, would "_unit" = the variable entered in the unit in the editor? and would "your_custom_channel" be the _channelID?

thin fox
keen stream
#

No. Edit in SP. Or use the funky script KK made?

jade acorn
tough abyss
thin fox
earnest valve
#

lol

pallid palm
#

@blissful current @winter rose No it's not a virus: it's a Demo mission of my chopper command

#

@winter rose i think you know enough by now: that i'm a good guy

pallid palm
#

lol

#

your funny Lou: love you my brother

#

yeah see i made this Awsome chopper cammand: that Dart helped me with: he's Awsome btw: and its works Awsome: i was thinking i would share it:

thin fox
#

he already got it working

pallid palm
#

ok thx man

#

working is one thing: but working perfectly is another ๐Ÿ™‚

tough abyss
#

I am nearly finished with our talking NPC "mini framework" thanks to help here the last several days. The only problem left to resolve is the displayed unit name. It is displaying "Liosi" when I have changed the identity to the desired "Endyou321." Is there a script to force a name change, or have I overlooked something? Thanks for the help, so close to the finish line.

fair drum
#

what is your custom chat channel?

tough abyss
#

the channelID is 6, if that is what you mean?

fair drum
#

no, how are you defining it, specifically want to see the callSign parameter

tough abyss
#

Oh, ok. Just a couple minutes, when I get back to my office I will send what I have for that channel in the initServer.

#

I used the template from the Bohemia wiki. I believe the only two things I changed were the channel display name and color.

fair drum
#

does it function (the right name) when previewing in SP and failing in MP?

tough abyss
#

I have only tested on MP so far.

fair drum
#

test on SP real quick

#

if it does work in SP, but not MP, create a custom identity in Description.ext and use setIdentity. Or you can see if setName (idk if the note about it working in SP only is outdated or not) works. Both of these are local commands so you either need to run them via remoteExec, or in a global script spot such as the objects init.

#

during the mission, what does name return when run on the unit in debug menu

tough abyss
#

It works in SP but not MP, the person who helped earlier just did super quick a quick test to get me going. I will look at both setIdentity and setName right now.

tough abyss
#

A simple setName in the init and it is working perfectly!
I have serious memory issues, but I think there were about 6 of you who each pitched a piece to this puzzle! We will put it to good use, with triggers and other simple scripts, we plan to make a complex web of unique NPCs, like the old Pokemon or Zelda characters that always kept a player reading their rambling monologues, lol.
Grab some digital beers as a thanks: ๐Ÿป ๐Ÿป ๐Ÿป

fair drum
#

we need to work on your script though. just from that screenshot, it looks messy

tough abyss
fair drum
tough abyss
broken pivot
#

Hey people ๐Ÿ˜„

Im into scripting an chair interaction. My current problems belongs to following:

  • If sitting, players cant move their heads
  • If sitting, players can only stand up with a scuffed solution you can find it at the end of the post

My final result will need to be capable to return an value during the player is sitting
so I could switch via "condition" of UserAction between "TakeSeat" - "StandUp"

Those are my current sources: https://community.bistudio.com/wiki/Category:Command_Group:_Animations
Maybe you know some more I could read about

Scuffed "solution" I would like to improve

if ((((animationState player) == "hubsittingchairuc_idle1") 
    || ((animationState player) == "hubsittingchairuc_idle2") 
    || ((animationState player) == "hubsittingchairuc_idle3"))
    ) then {
    hint "Sits!";
    } else {
    hint "Stands!";
    };
broken pivot
#

Update:

Ive implemented my askworthy solution in the script like Ive shown to you on
the screenshot. Does anyone sees or knows a better solution where people could maybe move there heads etc?

thin fox
#

just use ace :v

old owl
#

-# And VScode hmmyes

pallid palm
#

oh hell yeah: i made this script: that has like 5 diff functions in it: that runs like a (M99 M-Code in Machining) its cool ๐Ÿ™‚

#

its like the function's leap frog to the one that's needed when its called or spawned

#

no looping and no waiting ๐Ÿ™‚

#

i guess being a Machinist for 25 years had some good things to it: it helps me with Arma 3 Woohoo ๐Ÿ™‚

#

woowa this is cool ๐Ÿ™‚

#
#include <iostream>
// Represents a CNC operation that can be called repeatedly.
void performCuttingOperation() {
    std::cout << "Performing a cutting operation..." << std::endl;
    // In a real CNC controller, this would send commands
    // to the hardware to move the tool.
};
int main() {
    std::cout << "Starting main program..." << std::endl;
    // The equivalent of M90 G00 X10 Y10
    std::cout << "Rapid move to start point X10 Y10" << std::endl;
    // The equivalent of M98 P1000
    performCuttingOperation(); // Call the function (subprogram)
    std::cout << "Continuing main program after subprogram returns." << std::endl;
    // The equivalent of M30
    std::cout << "Ending main program." << std::endl;
    return 0;
};
pallid palm
#

Just interesting facts that all friends

broken pivot
thin fox
fair drum
#

first, see if you animation even supports head movement. just run it on yourself through debug. if it does, then have the unit change to that animation, then set direction, then set position.

hallow mortar
broken pivot
broken pivot
pure hare
#

Hey, anyone here using VSCode can tell me which linter is more updated or preferred? There's SQFLint and SQF-VM Language Server. Also some people recommend HEMTT Language Server & Utils but i haven't quite figured yet how to integrate it and if it contains linting.

cosmic lichen
errant jasper
#

Real OGs remember Squint

winter rose
pure hare
#

ah nvm, that means it's already activated

#

it doesnt do any linting though...

tulip ridge
#

It definitely does

pure hare
#

do you perhaps need a whole hemtt project? Is the VSCode Plugin alone sufficient?

tulip ridge
#

Not sure, I've only used hemtt in recent times because I never looked back after learning about it
I wouldn't imagine it'd require a project to use hemtt for the basic lintings

#

Are you using hemtt's sqf language? It has one included

pure hare
#

wait, i can disable SQF Language (only other i still have loaded)

#

still no linting. Also the plugin has no settings for me

#

Same for you?

tulip ridge
#

Because it doesn't have any

thin fox
pure hare
#

I also checked the logs of HEMTT & HEMTT Language Server, everything seems fine and initlialized

#

only thing that could remotely look like a problem is this line
2025-09-26T19:22:15.089609Z DEBUG tower_lsp::service::pending: client asked to cancel request 1, but no such pending request exists, ignoring

tulip ridge
#

Could ask in the hemtt channel in the ace discord

pure hare
#

Good idea, ty!

blissful current
tulip ridge
#

It definitely does work

#

It opens it as a proper log file for vs code, so you can have it open and update live

blissful current
#

It doesn't open anything for me. Is there more to getting it to work other than installing the extension?

#

Both of your code color choice is different than mine as well. Is there a reason for choosing those other than personal preference?

#

Just reinstalled hemtt. ctrl+alt+r does nothing for me.

pure hare
tender fossil
#

Speaking of which, anyone who actually uses my CfgFunctions (and CfgRemoteExec) generator extension in VS Code? I'd love to have some feedback about it. It was really buggy in the beginning as it was my first time both writing TypeScript and utilizing VS Code API, but after numerous bug fixes and feature additions I think it's somewhat decent now. (Or is it?)

tardy osprey
#

Hello gamers, i've made a mission where the players start in a truck and get transported to the HQ, but upon spawning they dont seem to stay seated but rather get drumped on the ground taking a lot of damage. any ideas?

formal grail
#

Ran into an odd issue with vanilla SDB bombs. When spawned from directly above a Strider GMG and targeted with scripts, it would hit the top of the vehicle, destroy the main gun, and do minor damage to the car's main health pool. Thought I was going crazy. The other missiles/bombs don't do that. It seems like a unique issue with the SDB, but only with certain flight paths. And it's not just the Strider, it's the same issue with Varsuks etc. There doesn't appear to be any submunitions. Does anyone know if maybe I'm missing something, or is the munition really just configured this way?
Video shows me spawning 4 of them directly onto a strider. Script is:

player allowDamage false;
_fnc = {
  params ["_height"];
  private _sdb = createVehicle ["ammo_Bomb_SDB", [0, 0, 1000], [], 0, "CAN_COLLIDE"];
  private _bombsite = getPosATL cursorObject;
  _bombsite set [2, _height];
  _sdb setPosATL _bombsite;
  _sdb setVectorDirAndUp [[0, 0, -1], [0, -1, 0]];
  _sdb enableSimulation false;
  sleep 5;
  _sdb enableSimulation true;
};
50 spawn _fnc;
40 spawn _fnc;
30 spawn _fnc;
20 spawn _fnc;

(Also does not appear to be related to speed. I can setVelocityModelSpace to [0, 100, 0] which is about the max the munition can go and it does the same thing.)

neon plaza
#

I have been trying to make players spawn In the air using the respawn module with no luck. Does anyone happen to have a script a solution to this problem?

thin fox
neon plaza
thin fox
neon plaza
#

The line of code has been placed In the expression area. My Issue now Is that It does not update as the marker moves.

neon plaza
neon plaza
# thin fox what code

// Define the respawn position (adjust marker name as needed)
private _spawnMarker = "respawn_west";
private _spawnPos = getMarkerPos _spawnMarker;

// Create a new position at a high altitude
private _spawnAltitude = 200;
private _parachutePos = [_spawnPos select 0, _spawnPos select 1, _spawnAltitude];

// Teleport the player unit to the parachute position
player setPos _parachutePos;

// Give the player a parachute
player addBackpack "B_Parachute";

#

To be honest If there Is someone I can pay to get this down It would save me a whole hella time.

thin fox
neon plaza
#

You are right. It Ia AI

thin fox
#

don't use AI for arma scripting ๐Ÿ‘

#

that's why we have a whole wiki for that

#

you have to provide us all the information on how are you doing this so that we can help you

neon plaza
#

Not sure what else to say here.

#

The only thing I had was the AI script. I just need the respawn module synced to players as a spawn point to have players spawn In the air 300 meter high with a parachute.

#

The marker has to update every 10 seconds or so.

#

If this Is something someone here can code I am willing to compensate them.

thin fox
#

if no one helps you with that, I can help you when I get home

neon plaza
#

Sounds good. Please be sure to contact us P.M

mellow scroll
#

Question - while I've been writing scripts for years - I only started with mods. It seems everything in a mod is geared towards functions - even a onetime init script - is this correct - or should one-shot functions really be scripts so they don't stay running forever? Or am I missing something?

tulip ridge
#

If something is run more than once, you should compile it to a function to save Arma having to read and process the file multiple times

mellow scroll
#

thanks - that was kind of what I thought - appreciate the confirmation - I have some stuff to change... ๐Ÿ˜‰

hallow mortar
#

If you already have functions then there's no point going to the trouble of changing them back

#

Being functions also makes them easier to reference, and it also makes them visible in the Functions Viewer so you can see how they work

#

It's also the only way to do mission-init scripts in a mod, because mission event scripts like init.sqf aren't available for mods. CfgFunctions init / preinit / postinit attributes are the only way to do that for a mod.

tulip ridge
#

CBA's pre/postInit event handlers as well, with the benefit of running unscheduled

hallow mortar
#

I wonder how those event handlers manage to run on pre/postinit

hallow mortar
# mellow scroll Question - while I've been writing scripts for years - I only started with mods....

or should one-shot functions really be scripts so they don't stay running forever?
I just want to address this directly: being a function does not mean that a script will keep running forever. Any function will exit when it reaches its end and will not continue to run unless executed again. The only thing that keeps running forever is a while {true} loop. There's no downside to having your scripts be functions, unless you register like a million of them and clog up the compilation process during mission loading.

proven pond
#

Anyone knows which script I need for make In-game cutscenes for public Zeus? Instead of just using circle around module of EZM which is boring.

mellow scroll
#

Appreciate all the insight !

blissful current
#

I have this condition, which fires if all alive players are in a helicopter:

((allPlayers select {alive _x}) - crew ExtractHeli) isEqualTo []

Is there a way to filter out downed players though? I want it to fire even if there is downed player outside the heli (apparently they count as alive)

granite sky
#

Depends how your revive script works, but usually they use setUnconscious so you can use lifeState _unit == "UNCONSCIOUS" at least.

blissful current
#

I think this is vanilla. It is in my SOG mission but I do not have their custom revive module installed.

granite sky
#

I've never scripted with it.

blissful current
#

Those screenshots look like my editor so Ima say yes this is what I'm using.

blissful current
thin fox
#

lifeState returns a string

blissful current
#

Copy that. I will test now.

granite sky
#

HEALTHY might not work because INJURED exists.

#

you want lifeState _x != "INCAPACITATED" in combination with the alive check.

#

either that or lifeState _x in ["HEALTHY", "INJURED"] without the alive check.

blissful current
#

I was just thinking that. I would accidentally block injured players.

#

I'll try this one:

((allPlayers select { alive _x && lifeState _x != "INCAPACITATED" }) - crew ExtractHeli) isEqualTo []
blissful current
#

This is working great. Thanks ya'll!

pallid palm
#

hello all: if i get into a vehicle as driver e'm i now a (vehicle player) or how does that work

versed trail
#

vehicle is just a scripting command to figure out what vehicle a unit is in. You can then detect the vehicle by doing vehicle player or check if the player is in a vehicle at all by doing (vehicle player == player). The player object itself doesnt change at all

pallid palm
#

ok i see thx man

#

@versed trail that's cool really thx man

cedar kindle
#

i don't think i've ever created a mission in the MP Editor

tough abyss
#

I had to do some reading before I got things going here, so I deleted my post and came back. I think I am ready to jump into something:

I want to make a virtual market place for players to post items for buy or barter. I have virtual shops, and know how to make UI/dialogs for such. Is this below where I would need to start? Or should I head into the "Namespace" variables? I know this task will be complex, so start broad please!

I do not know how to store the items in the database, while the player has them listed, and then have them sent to the correct player after transaction. I don't know much DB side stuff.

https://community.bistudio.com/wiki/Arma_3:_Scripted_Database

tender fossil
tough abyss
tender fossil
# tough abyss Our server is pretty much always open, and all data and stats are persistent. So...

You can make a scripted database then, it just needs to be saved either via extension to an actual database or the server's profileNamespace mentioned in the article. HashMaps can be useful too here.

IIRC serialization of a scripted DB entries to JSON drops the size of the DB a lot and equally improves performance in general. In other words, when you're saving stuff to database, serialize it as JSON (toJSON command) and when you load stuff from DB, do the opposite operation (fromJSON)

tough abyss
#

Ok, I am sorta getting there. the JSON is good to know, our DB has housing, vehicles, etc, and our economy has hundreds of items, so keeping things compact and moving well is a must. I assume that the script would just put a hold on the player's ability to use the item until a business decision is made, to sell or withdraw? Or will this need to be a new category in my DB?

tender fossil
#

I'm not sure if I understood it correctly, but yeah, you probably don't want an item or entity added to the marketplace to be accessible/usable while it's there (i.e. not sold or withdrawn)

#

But that's different level of abstraction and not directly coupled with the technical aspect of DB design

tough abyss
# tender fossil I'm not sure if I understood it correctly, but yeah, you probably don't want an ...

Sorry, early and need more coffee. The item must be frozen from use regardless. I think what I actually would like is to have it go to a new category, to make it easier to see and keep track of on the admin side. We have "housing," "vehicles," and "players" (which includes all items and stats). I am thinking it would be better to have the items placed in a new "marketplace" one. It would keep things orderly, easier to observe from the back end, and probably simplify the script. If that is not a good way to go, I am open to any suggestions.

tender fossil
tough abyss
tender fossil
tough abyss
#

We are managing everything through phpMyAdmin. We started with the Altis Life 5.0 framework by Tonic. We have been at it for over a year, and have edited so much of it, that I don't know what is left of huge parts of the original.

tender fossil
#

I don't know how Altis Life is programmed when it comes to DB stuff and don't know PHP well either, so can't help there unfortunately ๐Ÿ˜…

#

Was just thinking that if your team has the needed skills, you could also keep using the current database and just reorganize it (as an option)

tough abyss
tender fossil
#

You might even be able to keep the database structure as is and just rewrite the SQF part to handle the new marketplace

tough abyss
#

Yeah, that should work!

#

Outside of this DB line of Q's, if we wanted to make this market place have a barter system, would the following work?

Player A lists x Diamonds, Player B lists x Gold.
Player B uses the dialog to place an automated message to the other player, which they will see when they next access the market. (Stringtable with all the % variables to get the info right).
Player A reads the message, and presses accept deal.

I assume that is the gist of how that would be scripted out?

tender fossil
#

You can do it like that yeah, or just use money for everything instead. I think barter system would be kinda nice (personal opinion), but using money instead would be much more flexible for players especially if the player count or activity level in the marketplace is low. I would probably choose money as the trade mechanism thanks to the massively better flexibility. (Also just as a thought, having a small mobile app for the barter system (if implemented) would be cool lol)

tough abyss
# tender fossil You can do it like that yeah, or just use money for everything instead. I think ...

Haha, great minds! I actually plan to ask this week about more dialog related scripting to do new menus. As for the barter, we plan to have both options. Buy/Sell/Trade was our goal, and I think I can piece it together, now. I am sure I will get my butt handed to me a few times, but this will be a great addition. Our gameplay is economic and business grand strategy, so this would really up things.

tender fossil
#

Anyways, I think we need to continue this discussion e.g. in #game_design if needed ๐Ÿ˜…

tough abyss
#

I just made a cup of coffee. If you want to workshop, I am always open to ideas, lol.

buoyant hound
#

Hey whats usage of โˆ† in game?scripts

warm hedge
#

A what

buoyant hound
#

I just remember use it before some variable on init.sqf

jade acorn
#

use what

thin fox
#

what

buoyant hound
#

โˆ†

warm hedge
#
  1. We don't know that term
  2. We don't know what you're trying to say
  3. We don't know what you've ever used
thin fox
#

a delta?

buoyant hound
#

โˆ† somevariable

#

Yes@thin fox

thin fox
#

show us an example

warm hedge
#

A delta maybe is related to SQF. ฮ” never is

exotic gyro
#

You can technically use emojis in sqf so I guess you could use that delta symbol too

thin fox
#

๐Ÿ’€

jade acorn
#

I'm messing around with the weapon wheel mod, by default it makes the unit equip the chosen weapon via selectWeapon but it only works with equipped weapons. How do I let player equip a weapon from a backpack without having to delete it and then use addWeapon?

exotic gyro
# thin fox ๐Ÿ’€
private _data = createHashmap;
_data set ["๐Ÿธ","I love frogs!"];
_data get "๐Ÿธ"
// returns "I love frogs!"

The applications for this are immense, as you can see.

hallow mortar
hallow mortar
warm hedge
#

Ah sorry

ruby spoke
#

Does anyone know if it's possible to create a 3D progress bar through the Draw3D eventhandler?

warm hedge
#

Well, just tried. At least TakeWeapon can access a weapon that is stored in a backpack

#

This could be your best bet

old owl
#

Never really thought of doing that, or if it was possible KEKW

granite sky
#

It's just UTF :P

manic sigil
#

What would be the easiest way to have a vehicle-smoke-screen effect on a vehicle or position that doesnt have one natively? Like, an instant concealment over an area for a landing ship, say. ETA: Found an option from an old thread, but it's rather chunky.

granite sky
#

Drop grenades in an arc?

jade acorn
#

is it a bug that when adding a displayAddEventHandler in a mission, it does not remove itself after this mission's restart? Right now I have to go back to editor and play it again to have it gone, otherwise it just stacks

granite sky
#

Unless the display is deleted when the mission restarts, I would imagine that the event handlers attached to it hang around.

jade acorn
#

I guess it does not by itself which is a bit inconvenient

granite sky
#

I don't know of any documentation on which displays are permanent vs temporary.

jade acorn
#

I have the EH attached to 46

earnest valve
#

Draw3D is used for the map only.

tulip ridge
#

Is there anyway to persistently save data to a mission? I have an eden module that creates objects and I want to save the class / position / etc. so it will be the same when the mission is launched and when run from a dedicated server.

missionNamespace is reset between mission loads and missionProfileNamespace is saved to the player's namespace (so it would be different on a server)

granite sky
#

Use missionProfileNamespace (or profilenamespace) and read/write the data on the server.

earnest valve
#

So far, only 2D progress bars can be made. But I think it's possible (not sure if anyone has tried) to create a progress bar model and then animate it.

#

which could take a long time to do.

thin fox
jade abyss
#

Long time? 10min

errant iron
#

it sounds like your data should be represented as eden entities or module attributes (create3DENEntity / set3DENAttribute) since they're saved to the mission.sqm directly, but i've never touched eden-related scripting before, so i'm not sure of an appropriate entry point to run those commands from...

#

wouldn't work with dynamic data though... in that case, write an extension and HTTP POST your module namespace to a webserver to be fetched by clients with same mission hash? blobcloseenjoy

granite sky
#

oh yeah, if you're actually trying to edit the mission then the 3DEN commands I guess. I'm not entirely sure what the question meant.

tulip ridge
#

Still has the issue of I need to somehow save which objects are created by the module

errant iron
#

can the objects only be created at mission runtime, or would it make sense to pre-generate them in the editor?

granite sky
#

set3DENLayer?

#

You can set 3den entities to be simple objects, so I'd guess you can do that with set3DENAttribute too.

earnest valve
#

Well not with the 2D models (they are relatively easy to create), but creating a model that acts like a progress bar with animations (similar to what you would see with compasses and watches) may take a while to do. ๐Ÿ˜‰

tulip ridge
tulip ridge
granite sky
#

I thought the only objects that didn't have the setting were the ones that it didn't matter for.

tulip ridge
#

Not sure, but I assume the checkbox uses the class simple objects instead of model path
Would need to look in-game to verify that though

errant iron
granite sky
#

I personally love premature optimization, but I'd certainly check whether there's a benefit here before making life that hard for yourself :P

tulip ridge
tulip ridge
#

It's also just a whole lot of clutter, though I could move them to their own layer and possibly disable transformation directly

jade abyss
#

Even that

granite sky
#

yeah but class simple rather than model simple? Not sure if that ever makes much difference.

jade abyss
#

Not that long to create. A simple Anim (moving to 2 Points from Left to Right) isn't "Time consuming".

errant iron
tulip ridge
#

Yeah, though that'd be a lot of data. Not sure if there's any kind of potential issue there.
Probably will just settle for eden entities with simulation disabled / simple object enabled, though both will bloat mission size by a fair amount

ruby spoke
#

Then how would I be able to control the speed of the progress depending on what is being loaded?

jade abyss
#

in model.cfg min=0 max=1 || bar animate["bar",0-1];

#

thats it

#

(btw. idk if you can animate the 3D Obj, but should be possible)

ruby spoke
#

ok thx

#

while people are replying here, can I ask an unrelated question as well?

cosmic lichen
#

And if you want to store a lot of data you could save it as a string not as array. See the inventory attribute for crates in eden

tulip ridge
#

Yeah I have it as an edit box attribute

#

And then parseSimpleArray when reading it

manic sigil
#

Tried to follow the wiki's examples for adding a module to Zeus, but didnt have much luck. Would there be a good guide somewhere that I can't find on Google without its AI getting in the way?

warm hedge
#

Spoiler: It's painful

manic sigil
#

So im experiencing t_t

formal grail
# manic sigil What would be the easiest way to have a vehicle-smoke-screen effect on a vehicle...

You can create particle effects in sqf. For example this script, you just need to create a smoke grenade for each direction and then pass it in here, then delete the smoke grenade.

params ["_asset"];
private _smokeGrenades = [];

private _radius = 2;
for "_i" from -90 to 90 step 20 do {
    private _x = _radius * sin (_i + random 5 - 2.5);
    private _y = _radius * cos (_i + random 5 - 2.5);

    private _smokeGrenade = createVehicle ["SmokeShell", _asset modelToWorld [_x, _y, 1], [], 0, "FLY"];
    _smokeGrenade setDir (getDir _asset + (_i + random 5 - 2.5));

    _smokeGrenade setVelocityModelSpace [0, 15 + random 5, 5 + random 1];
    _smokeGrenades pushBack _smokeGrenade;
};

sleep 2;
{
    [_x] call WL2_fnc_smokeScript;
} forEach _smokeGrenades;

sleep 10;
{
    deleteVehicle _x;
} forEach _smokeGrenades;

And this is the smoke script:

params ["_smokeEntity"];

private _smokePos = _smokeEntity modelToWorld [0, 0, 0];
_smokePos set [2, 1];

private _smoke = createVehicle ["#particlesource", _smokePos, [], 0, "NONE"];
_smoke setParticleParams [["\A3\data_f\ParticleEffects\Universal\Universal", 16, 7, 48, 1], "", "Billboard", 1, 10, [0, 0, 0], [0, 0, 0.5], 0, 1.277, 1, 0.025, [1, 16, 24, 30], [[1, 1, 1, 0.7],[1, 1, 1, 0.5], [1, 1, 1, 0.25], [1, 1, 1, 0]], [0.2], 1, 0.04, "", "", _smoke];
_smoke setParticleRandom [2, [1, 1, 1], [1.5, 1.5, 1], 20, 0.05 + random 0.05, [0, 0, 0, 0.1], 0, 0, 360];
_smoke setDropInterval 0.2;

private _smoke2 = createVehicle ["#particlesource", _smokePos, [], 0, "NONE"];
_smoke2 setParticleParams [["\A3\data_f\ParticleEffects\Universal\Universal", 16, 12, 7, 0], "", "Billboard", 1, 5, [0, 0, 0], [0, 0, 0.5], 0, 1.277, 1, 0.025, [1, 16, 24, 30], [[1, 1, 1, 1],[1, 1, 1, 1], [1, 1, 1, 0.5], [1, 1, 1, 0]], [0.2], 1, 0.04, "", "", _smoke2];
_smoke2 setParticleRandom [2, [1, 1, 1], [1.5, 1.5, 1], 20, 0.05 + random 0.05, [0, 0, 0, 0.1], 0, 0, 360];
_smoke2 setDropInterval 0.15;

sleep 45;

_smoke setDropInterval 0;
_smoke2 setDropInterval 0;
tulip ridge
primal quiver
#

Does anyone have pointers on how to disable NVG for scopes?

tulip ridge
#

Not an easy way via scripting afaik

primal quiver
#

damn, oh well. I know how to do it for NVG and stuff but ye

tulip ridge
#

VisionModeChanged may trigger for scopes with built in nvgs, only thing I can think of

primal quiver
# tulip ridge VisionModeChanged may trigger for scopes with built in nvgs, only thing I can th...

I found this script but for thermals

addMissionEventHandler ["Draw3D",
{
if (currentVisionMode player isEqualTo 2) then
{
if (isNil "A3W_thermalOffline") then
{
"A3W_thermalOffline" cutText ["THERMAL IMAGING OFFLINE", "BLACK", 0.001, false];
A3W_thermalOffline = true;
};
}
else
{
if (!isNil "A3W_thermalOffline") then
{
"A3W_thermalOffline" cutText ["", "PLAIN", 0.001, false];
A3W_thermalOffline = nil;
};
};
}];

It works, but well. I wonder if there's something for Night Vision specifically

tulip ridge
#

You'd change the the 2 to a 1

#

That also doesn't change the player's vision mode at all Oh I see, it's just blocking out the screen with it

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
โ†“

// your code here
hint "good!";
winter rose
#

!sqf

#

hmm, changing that

primal quiver
tulip ridge
#

currentVisionMode player in [1, 2]

#

It does not

primal quiver
tulip ridge
#

Yeah, I should've specified I meant handheld weapon optics

primal quiver
manic sigil
manic sigil
tulip ridge
# manic sigil That would be ideal; I have a function put together that makes a ship drive forw...

Then you could do that fairly easily. This is how all of my basic modules are set up, but you may want changes to it

class CfgVehicles {
    class Module_F;
    class YourPrefix_moduleBase: Module_F {
        scope = 0;
        scopeCurator = 2;
        author = "Your Name";

        category = "YourPrefix_modules"; // class in CfgFactionClasses
        isGlobal = 1; // 0 for server only, 1 for global execution, 2 for JIP global execution
        curatorCost = 1;
    };

    // Make sure to add YourPrefix_module<Name> to your CfgPatches >> units array
    class YourPrefix_module<Name>: YourPrefix_moduleBase {
        scope = 1;
        author = "Your Name";
        displayName = "Module Name";
        function = "YourPrefix_fnc_module<Name>"; // Should be a function name, not code directly
        curatorCanAttach = 1; // When placed on an object, the module will be attached to the object
    };
};
// fnc_module<Name>.sqf
params ["_logic"];

if (!local _logic) exitWith {};

private _object = attachedTo _logic;
deleteVehicle _logic;

// Assume the script should exit by default, and then switch over invalid cases
// Each case condition should be what must be true for the module to work
private _exit = true;
switch (false) do {
    case (!isNull _object): {
        [objNull, "Must select an object"] call BIS_fnc_showCuratorFeedbackMessage;
    };
    case (alive _object): {
        [objNull, "Object must be alive"] call BIS_fnc_showCuratorFeedbackMessage;
    };
    // You should do extra checking here as well
    default {
        _exit = false;
    };
};

if (_exit) exitWith {};

// Do whatever your module should do
manic sigil
quaint oyster
cosmic lichen
primal quiver
primal quiver
tulip ridge
cosmic lichen
#

Yeah sometimes these commands work on units as well.

tulip ridge
#

It does work on units

#

It just doesn't affect weapon mounted optics

quaint oyster
# primal quiver I tried that but it's still there ๐Ÿ™

Oh I think i do this:
Store optic info
Remove optic
Replace with dot sight or something with no nvg or thermal
Remove optic
Replace with original optic

See if this cheap method helps. Might not be required to remove it so many times but I wanted to be safe.

#

I'm not home to look at the code specifically, I can send it later though.

primal quiver
quaint oyster
primal quiver
sharp grotto
#

Some years ago, i made that for someone, don't remember if it also worked for infantry scopes.
Worth a try

player addEventHandler ["VisionModeChanged", { 
    params ["_person", "_visionMode", "_TIindex", "_visionModePrev", "_TIindexPrev", "_vehicle", "_turret"]; 
    //systemChat "VisionMode changed";
    if (_visionMode != 2) exitWith {}; 
    if (!isNull _vehicle) then 
    {
        _TIDisabled = (equipmentDisabled _vehicle) #1;
        if!(_TIDisabled) then {_vehicle disableTIEquipment true};
    }; 
    _person action ["nvGogglesOff", _person]; 
}];
tulip ridge
#

That won't no

primal quiver
winter rose
primal quiver
quaint oyster
# primal quiver It's better than nothing but I really appreciate it! ๐Ÿ™‚

Here's what I ended up settling with. Not ideal, but it did the trick for me. As you can see there's some extra things in there with it you'd have to remove.

[{

private _currentWeapon = currentWeapon player;
private _hasThermal = false;

if (player getVariable ["pvpmode", 0] isEqualto 1) then {
private _visionMode = currentVisionMode player;
if (_visionMode > 1) then {


//force off the players thermal goggles if they have some on
player action ["nvGogglesOff", player];
hintSilent "Thermal imaging is due to PvP mode!";

//disables gun optics thermal modes but allows nvg
if (currentWeapon player == primaryWeapon player) then {
_currentoptic = primaryWeaponItems player select 2;
_currentweapon = primaryWeapon player;
player removePrimaryWeaponItem _currentoptic;
player addPrimaryWeaponItem "optic_ACO_grn";
player removePrimaryWeaponItem _currentoptic;
player addPrimaryWeaponItem _currentoptic;
};

};

//forced camera back into first person
if ((cameraView == "external" )&& (vehicle player == player)) then {
player switchCamera "internal";
};

};

}, 0.1, []] call CBA_fnc_addPerFrameHandler;
quaint oyster
# primal quiver I'll try this!

here's with some excess stuff removed that was either dead code or not acting right or were moot for the topic at hand, I'll leave both up to show you how the original one worked despite the dead pieces in it.



[{

private _visionMode = currentVisionMode player;
if (_visionMode > 1) then {


//force off the players thermal goggles if they have some on
player action ["nvGogglesOff", player];
hintSilent "Thermal imaging is disabled!";

//disables gun optics thermal modes but allows nvg
if (currentWeapon player == primaryWeapon player) then {
_currentoptic = primaryWeaponItems player select 2;
player removePrimaryWeaponItem _currentoptic;
player addPrimaryWeaponItem "optic_ACO_grn";
player removePrimaryWeaponItem "optic_ACO_grn";
player addPrimaryWeaponItem _currentoptic;
};


};

}, 0.1, []] call CBA_fnc_addPerFrameHandler;

primal quiver
primal quiver
primal quiver
thin fox
steel spoke
#

oh

#

execvm you say

#

this may explain my localization issues

#

hmmm

#

need me some JIP compatibility

thin fox
#

it's just where you executed

#

@steel spoke initPlayerLocal has a second parameter to get JIP as a boolean

#

I rarely use this one (the second parameter)

#

yes, it will get the player object and if he is JIP (true or false)

#

it's useful when you want to show stuff just for the player that starts with the mission

#

if a player enters the mission later (jip), then it won't show for him

blissful current
#

I've got choice paralysis regarding the design of my helicopter sequence and I'd love some opinions on the matter:

  1. All players must be in the heli to RTB. Easier to script since I dont have to account for other possibilities. Not realistic?
  2. Anyone can trigger the RTB. Means players can leave others behind. Not totally mission-breaking since respawn is allowed. More realistic? Heli wont stay forever and under fire.

Currently, the heli is a one way trip. I could script it to return, though that opens up a can of worms. But maybe that's more realistic giving players more freedom.

thin fox
#

it's your scenario, your job to figured out what's best

#

think that we have no idea what your scenario is like

tulip ridge
#

They're just asking for opinions on whaf to have the condition as

modern plank
#

Hello, I need some script to be able to respawn the bots who spawned at the beginning from the playable slots. I want generic code, I ignore their loadouts, numbers and groups.

I am thinking about storing in a variable as arrays of arrays the loadouts of all AI units in initServer.sqf, then read these arrays to createUnits then setUnitLoadout.

Do you see an easier alternative? Thx

manic sigil
tulip ridge
manic sigil
# tulip ridge My mistake, I just realized I removed / didn't include the `scope = 1;` from the...

Had me hopeful there for a second, but no dice. I'm very grateful for your help, all the same ๐Ÿ™‚

In missionroot\SRD_Landingcraft\config.cpp:

class CfgPatches
{
    class SRD_Landingcraft
    {
        units[] = {"SRD_module_BoatAssault"};
        requiredVersion = 1.0;
        requiredAddons[] = { "A3_Modules_F" };
    };
};


class CfgFactionClasses
{
    class NO_CATEGORY;
    class SRD_modules: NO_CATEGORY
    {
        displayName = "SRDModules";
    };

};


class CfgVehicles {
    class Logic;
    class Module_F;
    class SRD_moduleBase: Module_F {
        scope = 0;
        scopeCurator = 2;
        author = "ShiningRayde";

        category = "SRD_modules"; // class in CfgFactionClasses
        isGlobal = 1; // 0 for server only, 1 for global execution, 2 for JIP global execution
        curatorCost = 1;
    };

    // Make sure to add SRD_module<Name> to your CfgPatches >> units array
    class SRD_module_BoatAssault: SRD_moduleBase {
    scope = 1;
        author = "ShiningRayde";
        displayName = "Begin Boat Assault";
        function = "SRD_fnc_beginassault"; // Should be a function name, not code directly
        curatorCanAttach = 1; // When placed on an object, the module will be attached to the object
    };
};
tulip ridge
#

It has to be a mod

pallid palm
#

triggers can act like modules in a mission

#

none area triggers that is

tulip ridge
#

In a way I suppose, but not really as an easy thing you can do from zeus

manic sigil
#

I suppose I'm a little fuzzy on the difference; I've made a companion mod for Mike Force before, running a blank copy of the map and utilizing functions and scripting.

pallid palm
#

oh yeah Zeus i forgot

manic sigil
#

The wiki entry conveniently leaves off that detail X_X

tulip ridge
#

Are you placing your config in an actual mission folder (i.e. MissionName.MapName)? That's what I assume what you mean by missionroot in your message

tulip ridge
thin fox
pallid palm
#

oh hi Lou lol ๐Ÿ™‚

manic sigil
tulip ridge
#

The Zeus Enhanced mod has their own way of making Zeus modules via script, but I've never used it before so I'm not aware of any limitations it might have

manic sigil
tulip ridge
#

You'd have to implement it as a mod then

#

Which isn't that difficult

manic sigil
#

Indeed, I got it in a few attempts, just had to remember how to arrange a .pbo conversion X_X

#

The module appears, and seems to run the code! At least, until it hits a bug, being passed an array instead of an object, but that's life.

tulip ridge
#

What's the exact error and where it occurs?

manic sigil
#

I see what I did, had a second helping of Params in there between your section and my script.

#

Or... thought I did, at least. Hmm.

#

Alright, it was reading the function I had in the mission file, not in the addon.

But removing the function from the mission file leaves me with a bottom-screen error of 'cannot execute module, error found in 'the function name' '

tulip ridge
#

Is your function defined in your mod?

manic sigil
#

I'm guessing not, hmm. That wouldn't just be a description.ext file, would it?

tulip ridge
#

Nope, you'd need to define it in your config.cpp

If you're using CfgFunctions, then you can just copy/paste it over and just change the path to the function

manic sigil
#

Something as:

class CfgFunctions
{
    class SRD 
    {
     tag="SRD";   
                
            class functions 
                {
            class beginassault
                    {
                        description = "Launches Assault Boat";
                        postInit = 0;
                    };

        };
    };
};

It threw an error on loading up the game that the function wasn't found, despite Addons/functions/fn_beginassault.sqf existing.

#

That was copied direct from the original description.ext from the mission version.

#

Probably pathed wrong, I'm sure x_x

tulip ridge
#

You'll need to start the path with your pboprefix, which is using addon builder will just default to the folder name you're packing

manic sigil
#

So something like file = "@SRD_Landingcraft\Addons\Functions" ?

tulip ridge
#

What there is the folder you're packing?

manic sigil
#

Ah, right, Addons

tulip ridge
#

You have to pack each addon, which in that setup would be Functions, individually

#

You'd also want the folder name to include your prefix, e.g. SRD_Functions

manic sigil
#

I'd be packing the srd_functions folder as it's own pbo?

tulip ridge
#

Yeah

manic sigil
#

Nevermind, got a step closer; no error, and it shows up in the functions viewer under configFile ๐Ÿ˜„

tulip ridge
#

๐ŸŽ‰

manic sigil
#

But then throws a script error. But at least that I can wrap my head around.

#

Bah... an exit clause I swore I fixed up, checking if the object if a boat or not.

tulip ridge
#

You can post the script here if you'd like

manic sigil
#

I got it, originally did a dumb '!iskindof', then forgot that it still needed to be inverted to (!(_vehicle isKindOf "Boat"))

#

Some unexpected behaviours I wasn't seeing in my initial scripting tests, but otherwise it seems to be working ๐Ÿ˜„

Thank you so much, Dart!

tulip ridge
#

No problem, glad it's working for ya

manic sigil
#

Now on to other problems... like my supposedly bulletproof plan of using setVelocityModelSpace to force boats to ground themselves directly ahead working fine on larger modded ships, but little boats that can dip and rise suddenly becoming airborne :c

pallid palm
#

the speed boats work great for that

#

lol i like sliding up on the Shore at full speed and jumping out ๐Ÿ™‚

manic sigil
#

They do, but the AI drivers dont.

#

This is a tool for making AI driven landing assaults more effective and cinematic.

pallid palm
#

really hmm i never had Ai try it ๐Ÿ™‚

manic sigil
#

A much older version I used vectorLinearConversion, which works but seeing boats smoothly glide along between start and end points, heedless of waves or dangers was... unnerving.

#

And meant that the mission maker had to plan out specific nonconflicting boat paths.

pallid palm
#

Ai do some dumb things don't thay: but they do other things Awsome

#

roger that m8

manic sigil
#

There we go, just had to give the while-do loop forcing the speed a bit more breathing room between loops.

pallid palm
#

for water landing assaults i just have a player as the driver of each boat and the Ai as riders

#

if i have the Ai on that is

#

but i see your meaning

modern plank
#

Ok same implementation, except the way you do respawn your bots.

modern plank
#

Finally, I go with this implementation:

// SAVE AI INITIAL LOADOUTS AT STARTUP 
if (isServer) then {
  { [_x, [_x, "INITIAL_LOADOUT"]] call BIS_fnc_saveInventory; } forEach (allUnits - allPlayers);
};

// THEN REVIVE AI WHENEVER IT NEEDS
revive_ai = {
  { 
    _unit = (group _x) createUnit[typeOf _x, position _x, [], 0, "NONE"];
    [_unit, [_x, "INITIAL_LOADOUT"]] call BIS_fnc_loadInventory;
    deleteVehicle _x;
  } forEach (allDeadMen - allPlayers);
};
still forum
#

That is not a Armed Assault Script File. As it says on the top.
addMissionEventHandler was only added with Arma 3.

manic sigil
#

So, if I make a mod to add a zeus module, will it only utilize functions designated within the mod files? Or can I tell it to run a function from the mission its run in?

Repacking the .pbo each time is kinda soul and time draining, and Im hoping theres an easier way Im just not thinking of.

warm hedge
#

It doesn't matter as it is just an SQF. You can use any script

pallid palm
#

yeah i made that script myself: it just had the incorrect header: i changed the header now for you:

#

@manic sigil do you have PBO manager its way easy that way

manic sigil
pallid palm
#

i see maybe you want to look into PBO manager

#

its super fast

#

@modern plank that will save all loadouts on All Ai even the enemy

#

is that want you intended

modern plank
#

sure.

pallid palm
#

ok

tough abyss
#

I have been working on some "talking NPCs." Thanks to the help here, things are going great. The next thing I want to do, is add a randomization to some of the chats when you trigger the addAction. For example, if there were five lines of chat, each would have a 20% chance of displaying when a player interacts. If anyone could point me to a wiki that would help with that, many thanks. The above is the simplest example of what we have. It could be better, but it works well enough.

pallid palm
#

NPC (Non Player Character) ๐Ÿ™‚ or Ai as it were

#

@tough abyss i just use addMissionEventHandler

tulip ridge
tulip ridge
pallid palm
#

oh ok sorry bout that

thin fox
pallid palm
#

wow cool i never saw this before

tough abyss
#

@thin fox & @tulip ridge Sorry for the ping, but you guys each nailed it. I already can see uses for both ๐Ÿป

tough abyss
pallid palm
#

@tulip ridge is that posisable to use inside the addMissionEventHandler

tulip ridge
#

Yeah

tough abyss
#

On the selectRandomWeighted wiki page it says: "If numbers of items and weights do not match, the shortest array is used." Can someone explain that to me? With very long lists of items and weights, I can easily see making some mistakes and not having a 1:1 setup. So, I am curious what results that would yield?

tulip ridge
#

Similar thing for the alternate syntax:

["Val1", "Val2"] selectRandomWeighted [1];

Only Val1 would be selected

tough abyss
tulip ridge
#

You just need to have the same number of values as you do weights, that's all it's saying

#

There's no math required for that

tough abyss
thin fox
tough abyss
#

So the weights in that expample make an 80% and 20% chance?

thin fox
#

so it's like "80%" spawning civs and "20%" spawning enemies

tough abyss
#

The only thing left I would need to know, is how to make "like" NPCs use the same .sqf if possible. In my example above that is one avatar, out of five total identical ones. Each is at an airport. We also have "shop vendors" in our businesses, and four towns on each map, so four identical units per industry. So, for an example, I would like to have units with the variables "Endyou321_1", "Endyou321_2", "Endyou321_3, all function the same way, but without needing to update separate files each week when we change their various monologues. I am not sure how to tell it "if/or" between the units, and have the same end result.

thin fox
#

pass the object as an arguments, and use params to get it in your script

#

like [Endyou321_1] execVM "myScript.sqf"
and in the script, on the top, put:
params["_unit"];, the variable _unit will be the object that was passed as an argument, and you can place it where you need it in your script

tough abyss
#

I was way overthinking it! Thanks @thin fox , I believe we don't need to do anything more to this humble system. You helped on several steps for this the past week or so. Our players loved the prototype. They have an oldschool Nintendo rambling character vibe, and it is a good nostalgic touch.

stable dune
tulip ridge
#

If you intend to call a function with no arguments, you should use []

#

You can run into unexpected issues if you don't do that

// foo takes a number and does X with it, and calls bar
_fnc_foo = {
    params [["_a", 1, [1]]];
    call _fnc_bar; // params error because _bar expects a string, but is being passed a number
};

// bar takes a string and does Y
_fnc_bar = {
    params [["_str", "", [""]]];
};

call _fnc_foo;
#

The correct usage would be to use [] call _fnc_bar

thin fox
#

the called functions doesn't have params/arguments

#

would still be a problem?

#

and the function that runs the random stuff doesn't have either

tulip ridge
#

No, but you should still explicitly call it with an empty array. Semantic reason is that it's "more correct"; but some function along the chain might eventually take some parameters, which could lead to several Bad param errors

thin fox
#

Thx for the info Dart

stable dune
pure hare
#

@blissful current I sadly don't have the time anymore to debug the HEMTT addon issue or do arma modding / follow the ongoing discussion, but if you ever get it to work, please tell me ^^

blissful current
#

Same. Ima wait till I start a fresh mission to dive into that. In the meantime I can test code with linting with the Advance developer tools mod.

buoyant hound
#

Hey , how i can do :
Vehicles move to wp1 then stop 5sec then move to next wp and delete

granite sky
thin fox
granite sky
#

I guess there is setWaypointTimeout which in theory does exactly what you want.

thin fox
#

yes, I misunderstood the question

buoyant hound
#

Then when i use setwaypointtimeout for a hold wp i give that wp an sleep and then next waypoint started right?

thin fox
buoyant hound
#

Nice it must work for me
There i need an sleep time for player to take some weapon from truck then truck leave to next wp

cobalt path
#

Does anyone know the script that mods often use in Spaceships? The one where you press addaction and it boosts your aircraft forward to like 800kmph and addaction where it quickly deccelerates you to almost 0. I remember seeing it in Star Wars opposition mod long time ago, used for tie fighters and such, as they were helicopters and couldnt go at speed without it

ruby spoke
#

is it possible to make an array of classes?

tulip ridge
#

It's not one specific script, but the tl;dr is that it's just setVelocity on a keybind

earnest valve
#

ye

#

yea

tulip ridge
ruby spoke
#

Like this || array[] = {class Example1, class Example2};

earnest valve
#

you mean for config scripting or .sqf?

ruby spoke
#

config

earnest valve
#

ah. Well yes it is possible on some terms.

buoyant hound
#

Hey, the main target
Spawn truck set waypoint to move to marker1 wait for 5s then set waypoint to move to marker2 wait for 2s then delete vehicle
The waypointtimeout or statement or script not worked , am run code from debug console on zeus , vehicle spawned move to waypoints but no react about timing or removing


st = 
{
_tc = "isc_ia_gaz66_o"; 
_tr = createVehicle [_tc,getMarkerPos "spawn", [],0,"NONE"]; 
_gtrd = createGroup independent; 
_trd = _gtrd createUnit ["C_Tak_01_C_lxWS",getMarkerPos "spawn",[],0,"NONE"];
_trd moveInDriver _tr; 
_w1 = _gtrd addWaypoint [getMarkerPos "stop",0]; 
_w1 setWaypointType "MOVE"; 
_w1 setWaypointBehaviour "CARELESS"; 
_w1 setWaypointScript "hint '123'";
_w2 = _gtrd addWaypoint [getMarkerPos "delete",10]; 
_w2 setWaypointType "MOVE"; 
_w2 setWaypointBehaviour "CARELESS";
_w2 setWaypointStatements ["TRUE","deleteVehicleCrew _tr;
deleteVehicle _tr;"]; 
};
[_tc] call st;

earnest valve
#

Like for example: Units[] = {myUnit1, myUnit2, myUnit3} ... as seen in the CfgPatches

thin fox
buoyant hound
#

_w1 setWaypointTimeout [5,5,5];

thin fox
earnest valve
#

same for CfgMusic too

buoyant hound
#

Not matter , i test it before, you think that i check it in thesetwaypointscript position

#

I test one by one and its my last one

ruby spoke
#

yeah that's where i got the idea from

thin fox
#

I'll test your code later, but from my experience, setWaypointTimeout works

ruby spoke
#

I'm wondering how I could apply that in my own script

granite sky
#

The setWaypointStatements there won't work because it's referencing _tr that doesn't exit in the context.

buoyant hound
#

Look i test this codes
_wp1 setWaypointTimeout [5,6,7];
[_gtrd,wp1] setWaypointTimeout [5,6,7];

thin fox
buoyant hound
#

["true","hint '123'"];

#

For waypointstatement

granite sky
#

Should run if the waypoint actually completes.

buoyant hound
#

Yes but it wont

#

My prob is there that not run

ruby spoke
#

So if I had an array of classes like so: items[] = {class item1, class item2};

granite sky
#

shrugs

buoyant hound
#

Maybe i must run it via external sqf file to work?

granite sky
#

We use setWaypointStatements regularly. It works. Main issue is that the code runs everywhere, but that won't be a problem here.

#

Also that it runs in some cases where it really shouldn't. Which also isn't a problem here :P

buoyant hound
#

_w1 setwaypointstatement ["true","hint '123'"];

granite sky
#

you missed the s off the end of statements

buoyant hound
#

In _wp2

ruby spoke
#

how would I be able to use the data inside of the array?

granite sky
#

I already told you that why that code is wrong.

buoyant hound
#

Just for that _tr?

earnest valve
#

u mean acquire data from a config and place it into an .sqf array?

thin fox
granite sky
#

My inclination on the next rewrite would be to stop using waypoints entirely given that it's a layer of opaque and buggy trash that you don't need :P

ruby spoke
#

yes

buoyant hound
ruby spoke
#

but from the array

#

If that makes sense..?

#

xD

earnest valve
#

lol. so you want an array inside an array? ๐Ÿ˜ƒ

thin fox
# buoyant hound Guide me too for use eh

like Jonh said, for your case you don't need it, just use that command, the problem in your code is that the _tr is not defined in the waypoint space, _tr is a local variable that only exists in that scope of your code, the waypoint deals with a different scope, and that scope doesn't know what _tr is. Read the wiki on that command (https://community.bistudio.com/wiki/setWaypointStatements), particularly the description, you can use this or thisList to get the object that you want

buoyant hound
#

Bro i say its correct about that _tr

#

But what about test hint

#

Hint not work too

#

Not just that _tr part

ruby spoke
#

class Shop{ items[]={class item1, class item2}; };

#

like so

granite sky
#

You didn't paste any code with a correct test hint in it.

earnest valve
#

Ahhh

#

ok

ruby spoke
#

and item1 and 2 are defined classes

earnest valve
#

one sec

granite sky
#

Original one is using setWaypointScript incorrectly. setWaypointScript takes a file path, not a code string. Read the wiki.

earnest valve
#

that may help ๐Ÿ˜‰

cosmic kayak
#

Does anyone know if there a setPose function we can call? I want to be able to set the pose of my unit to the tactical/scoot crouch. Wiki says there is no such thing, has anyone done this? Tried messing around with: switchMove "<class_name>"; this setUnitPos "DOWN";

cursive tundra
#

i have a question - if i try to get a variable using GetVariable "varName" but the group doesnt have a Variable with this name in it, what does it return? nil? i think so from checking wiki - so i should be able to check against this using isNil?

#

like ```sqf
_groupComposition = _group getVariable "groupComposition";_groupComposition = _x getVariable "groupComposition"; if !(isNil _groupComposition ) then {...};

granite sky
#

nil, yes.

#

but your usage of isNil is incorrect. The variable name needs to be in quotes there.

limber panther
#

Hello! I would like to ask for a little assistance. I wrote this script: ```sqf
while { (player getVariable["fw_alcohol_level",0]) > 0 } do {
sleep 180;
_alclevel2 = player getVariable["fw_alcohol_level",0];
_novyalclevel2 = _alclevel2 - 1;
player setvariable["fw_alcohol_level",_novyalclevel2,true];
};

thin fox
limber panther
tender fossil
# limber panther yes, this loop can actually be called multiple times, therefore i do that getvar...

I think the main problem is the sleep command's position in the script. If the script detects that alcohol level is > 0, it will sleep three minutes at first and only after that update the value. The parallel scripts might have modified the variable during the sleep. Try this: ```sqf
while { (player getVariable["fw_alcohol_level",0]) > 0 } do {
_alclevel2 = player getVariable["fw_alcohol_level",0];
_novyalclevel2 = _alclevel2 - 1;
player setvariable["fw_alcohol_level",_novyalclevel2,true];
sleep 180;
};

limber panther
tender fossil
#

Because that sounds like it might be better to redesign the whole script

thin fox
#

would an exitWith after the sleep help in your case?

limber panther
#

@tender fossil @thin fox thanks for ideas, i think i can actually do what Ezcoo suggested if i add one extra sleep before the loop begins. The whole script is supposed to let players drink beer in game. Each bottle adds alcohol level by a given amount + a random value. Then over the next 10 minutes the alcohol level climbs up and once it reaches the top, the loop begins and each 3 minutes reduces alcohol level by one simulating sobering. If someone drinks multiple bottles, the alcohol level climbs up faster but thanks to the script running parallel, it also decreases faster, therefore the time from drinking to being sober again is still +- the same regardless of the number of beer bottles.

#

Here's the whole thing: ```sqf
hintC "You drank a whole beer bottle. Now press ESC to close the window.";
_alclevel = player getVariable["fw_alcohol_level",0];
_novyalclevel = _alclevel + 4 + random 3;
player setvariable["fw_alcohol_level",_novyalclevel,true];
sleep 180;
_trialclevel = player getVariable["fw_alcohol_level",0];
_novytrialclevel = _trialclevel + 1;
player setvariable["fw_alcohol_level",_novytrialclevel,true];
sleep 180;
_sestalclevel = player getVariable["fw_alcohol_level",0];
_novysestalclevel = _sestalclevel + 1;
player setvariable["fw_alcohol_level",_novysestalclevel,true];
sleep 240;
_desetalclevel = player getVariable["fw_alcohol_level",0];
_novydesetalclevel = _desetalclevel + 1;
player setvariable["fw_alcohol_level",_novydesetalclevel,true];

sleep 180;
while { (player getVariable["fw_alcohol_level",0]) > 0 } do {
_alclevel2 = player getVariable["fw_alcohol_level",0];
_novyalclevel2 = _alclevel2 - 1;
player setvariable["fw_alcohol_level",_novyalclevel2,true];
sleep 180;
};

gleaming token
#

// drinkBeer.sqf
// Run this when a player drinks a beer

hintC "You drank a whole beer bottle. Press ESC to close the window.";

// --- Configurable values ---
private _initialBoost = 4 + random 3; // immediate boost
private _stages = [180, 180, 240]; // times between extra +1 increments
private _decayStep = 1; // how much to lower per tick
private _decayDelay = 180; // how long between ticks

// --- Apply initial boost ---
private _level = player getVariable ["fw_alcohol_level", 0];
_level = _level + _initialBoost;
player setVariable ["fw_alcohol_level", _level, true];

// --- Apply staged increases ---
{
sleep _x;
_level = player getVariable ["fw_alcohol_level", 0];
player setVariable ["fw_alcohol_level", _level + 1, true];
} forEach _stages;

// --- Begin decay loop ---
while { (player getVariable ["fw_alcohol_level", 0]) > 0 } do {
sleep _decayDelay;
_level = player getVariable ["fw_alcohol_level", 0];
player setVariable ["fw_alcohol_level", (_level - _decayStep) max 0, true];
};

AI remake

tender fossil
#

You can utilize the same value symmetrically when adjusting and simulating the rate of sobering

#

So the end result is same, even your idea (which I think is kinda clever in itself), but you'd avoid bad practice in code and make it much less prone to bugs

#

It would be like switching from FM to AM radio: instead of adjusting frequency you'd adjust amplitude. (Sorry, my currently insomniac brain is a bit restless) ๐Ÿ˜‚

hallow mortar
limber panther
#

Thank you @tender fossil ๐Ÿ‘ I appreciate it

pallid palm
#

@cosmic kayak ```sqf
this setUnitPos "Middle";

gleaming token
#

Goodbye ๐Ÿ‘‹ Mr Palestine

#

They/them and a pally flag oops.

pallid palm
#

"trust" AI to be "efficient" are you kidding me: no way

gleaming token
#

Yeah robots and efficiency usually go together till it starts to attack you I guess...

#

Anything that makes something quicker, is efficient. I'm not a dictionary tho.

pallid palm
#

Ai don't know how to do ArmA scripting

gleaming token
#

So if you can't trust that that's efficient you are probably a fast typer!

#

I never said it does.. but It can read and rewrite... So if your script is valid it won't break it mate. Test it ๐Ÿ˜‰

pallid palm
#

Ai is efficient at giving you the run around

gleaming token
#

Yeah maybe if you ask it for magic. Not perhaps to rewrite or give advice.

Guess I find that obvious!

pallid palm
#

yeah sorry m8 we don't use Ai or any chatGpt or LLM here on discord

gleaming token
#

Okay. But the point still is valid anyone who can actually read what AI says to them and perhaps check it will be more efficient using it

#

I get that the more it's used the better it gets... So don't use it!

pallid palm
#

my Ai is the guys here on discord: i don't trust anything else

gleaming token
#

Good point but logically it's not AI have a goodnight mate didn't mean to cause offence .

#

Apart from to Mr Pallyshtine who's probably enraged

pallid palm
#

im not offended

thin fox
#

@moderator pls

#

kick this guy

gleaming token
#

๐Ÿคฃ for what mate ... Is this a strict server?

thin fox
#

for beign stupid

gleaming token
#

You can't support it anyway

#

Your profile pic haram.

#

Thanks for calling me stupid!

pallid palm
#

he didnt say u are stupid he said your being stupid

gleaming token
#

Okay.

#

In my opinion someone who does stupid things is stupid. But yeah I must be wrong

pallid palm
#

just remember no ChatGPT or any other kinda Ai stuff on here ok m8

gleaming token
#

Yeah ๐Ÿ‘

pallid palm
#

roger that HooWha

gleaming token
#

I ain't sticking here mate

#

Didn't realise Arma was filled with furries.

thin fox
#

bye

gleaming token
#

This server woke me up to that lol

#

Ah is that the point the mods take offence.

#

Lol ๐Ÿ˜‚ find Jesus.

thin fox
#

another day another troll on Internet

pallid palm
#

@gleaming token easy m8 take it easy dont push it

gleaming token
#

I'm not trolling lol! They/them and pally flag is literally trolling but hey ho!

pallid palm
#

plz don't make us use the block thingy ok m8

gleaming token
#

Yeah you're right

pallid palm
#

thx m8

thin fox
gleaming token
#

Hope you agree tho Scotty

#

Your bros political views would land him in danger if he practiced them.

pallid palm
#

no one has political views on here m8

gleaming token
#

Ah I just assumed then again... Looking at the guys profile.. perhaps I shouldn't.

thin fox
thin fox
#

you're still here

gleaming token
#

Yeah joined for Arma tag

#

Are you a good pig or a naughty pig? ๐Ÿ˜‚

pallid palm
#

dude you need to relax

thin fox
#

<@&105621371547045888> sorry to ping you, but this guy is just talking sh*t

gleaming token
#

Wtf lol seems you're the one with the agenda

#

I'm simply here to help others... Go read the chat lol yes I took offense to someone calling me out for simplifying repeated script with AI. I'm sorry

young current
#

@gleaming token time to step off the keyboard for a moment

pallid palm
#

@gleaming token hay m8 lisson to m8 plz im 64 so i lived some life plz relax and plz don't try so hard

gleaming token
#

Thanks for the wise advice Scotty I'm not trying to get banned by Antifa but it may happen now I have only replied to people

young current
gleaming token
#

Great lol at what point

#

Reality is I'm trying to answer and be fair. But see it as you want

young current
#

no you been insulting people left and right

gleaming token
#

Okay if that's what you say I made 1 insulting comment which wasn't directed.

young current
#

theres many

gleaming token
#

Nah mate nothing offensive said

#

If I repeat someone's pronouns without adding anything and you take that as offensive that's your issue.

#

If I describe the community of a whole game as a type of person (obviously not true) and you take that as serious that's the same story.

pallid palm
#

ok see you m8 have a good day or night

young current
#

anyway. back to scripting

light musk
#

is anyone able to help me with a script to check is all living players from a side are present in a trigger area to fire as true?

#

i tired:
({alive _x} count units this) == ({_x in thisList} count units this)

#

i found that in a reddit post but it throws errors

granite sky
#

this isn't even valid in a trigger activation statement so I'm not sure what they were aiming for there.

light musk
#

yeah i'm really new to this and not sure what I'm doing really

granite sky
#

Any particular side?

light musk
#

blufor

#

its a PvE coop mission and I want the task to complete once two units rejoin at the rendevous area

granite sky
#

Count of all live players on blufor:
{alive _x and isPlayer _x} count units west

#

If your trigger is only counting blufor players then just {alive _x} count thisList should be the count of players in the trigger area.

#

For testing in the debug console you can do list myTrigger instead of thisList.

light musk
#

ok, so like this:

granite sky
#

you have no type/activation settings.

#

So I can't tell you what code to use.

light musk
#

so Bluefor and Present would work then with the condition more like this:

granite sky
#

Ah there's no blufor players option. I guess this then:
{alive _x and isPlayer _x} count units west == {alive _x and isPlayer _x} count thisList

light musk
#

thank you, I'll try this.

#

same activation and activation type?

granite sky
#

blufor/present is probably as good as you get.

#

Now the issue is that if you don't start with any blufor players it might just trigger immediately.

#

0 == 0

#

whether that's a problem depends how you're running your mission.

light musk
#

well there will always be atleast 1 blufor player since that is their only side

granite sky
#

It would also trigger if they all died :P

light musk
#

yeah that just uato triggered and completed when I started the mission

#

oh wait didn't sync them whoops

#

didn't see the blue line wasn't there

granite sky
#

With zero filter:

private _countBlue = {alive _x and isPlayer _x} count units west;
_countBlue > 0 and _countBlue == {alive _x and isPlayer _x} count thisList;
light musk
#

ok yeah that autocompletes at mission start since it counts all the players as dead

manic sigil
#

LimitSpeed negative on a helicopter makes it fly backwards... ironically, if I could get that on a boat that'd solve a big headache right now XD

#

For some reason, small vanilla boats, when forced to move backwards by setVelocityModelSpace, force a hard turn on the driver even with AI disabled.

#

Which leads to them spinning about and, sometimes, driving up the beach backwards.

pallid palm
#

lol wow

warm hedge
#

Excuse me, why you worry about SP being played by 30 players?

tulip ridge
#

It's the same thing, assuming you run that code on each player's own machine

#

E.g. like an initPlayerLocal script or something

warm hedge
#

player always returns one object

#

Depends. Just "player whatever 1000" will not run for everyone automatically

fair drum
#

depends on what your respawnOnStart in your description.ext is

#

then you're fine.

to test this yourself, you can turn off battleye, and hit play multiple times to start multiple instances of the game. no dedi server needed.

warm hedge
#

Also, you can learn one thing: LA, LE, GA, GE where BIKI states

#

Especially LE and GE, means "effects only the computer that runs it" or "effects on every MP clients"

formal stirrup
#

running into an interesting thing here
When using the fire command the AI seem to want to rotate their turret up as soon as they start firing, happens if they fire 1 bullet so its not recoil
Im trying to get them to just stare at a specific object and dump a mag so them rotating up is a bit troublesome
I tried a mixture of lookAt, doWatch, and doTarget but nothing seems to stop making them doing it

I've also tried disabling AI and only have WEAPONAIM enabled but that also did not work

warm hedge
#

Do you mean an unit or vehicle

#

If vehicle try lockCameraTo

formal stirrup
#

its a vehicle yeah, static turrets

#

lemme try that

warm hedge
#

Also try forceWeaponFire or BIS_fnc_fire

formal stirrup
#

well lockCameraTo seems to have fixed it

#

thank you very much

granite sky
#

what sort of weapon was that btw?

formal stirrup
#

Tested with a couple

#

base game HMG turret, rest was an assortment of OPTRE turrets

#

mostly the big AA guns

ruby spoke
#

they're returning as strings...

#

๐Ÿ˜ฆ

old owl
#

POV reading last nights chat

#

Pasting AI stuff then bringing up politics meowsweats

pallid palm
#

yeah he went right to the Gen chat: and did the same thing:

atomic niche
#

Interesting angle, guess LLM's are always accurate and never make mistakes

pallid palm
#

why would any one ever use Ai crap when we have great guys in discord

atomic niche
#

Clearly gave up on thinking and had the LLM do that for him too ๐Ÿ˜‚

ivory lake
hallow mortar
#

Oh I'm glad I went straight to bed after posting that message. Dealing with that guy would've ruined my whole day

pallid palm
#

yes sir i left also lol

manic sigil
#

How would you extract information from a vehicles config, in particular maxSpeed, etc?

pallid palm
#

i just use the config viewer in the esc menu of ArmA

winter rose
#

Arma*

pallid palm
#

yeah what Lou said

#

Hi Lou: i love you man ๐Ÿ™‚

manic sigil
pallid palm
#

yeah you can copy that stuff out of the config viewer

winter rose
cosmic lichen
#

getNumber (configOf _veh >> yourValue)

#

For example.

pallid palm
#

so whats this i hear you can run 2x the game and test stuff ?

#

is this true

manic sigil
#

You mean, like a loopback'd server to test multiplayer with two clients?

pallid palm
#

yeah how do i do that

cosmic lichen
#

Sorry I misread

manic sigil
#

I use TADST which has a toggle for looping back the launched server, but I believe its also a value in the server config file. Just set that, then launch arma and then launch another copy through the .exe in the install location.

pallid palm
#

ahhh ok i see yes i used that before

cosmic lichen
manic sigil
#

Id say I dont know why google couldnt parse my questions to get that page, but AI have a few hunches...

pallid palm
#

oh thats cool @cosmic lichen

old owl
winter rose
still forum
#

Also our bot protection on wiki, should effectively prevent any LLM learning setup from reading it and learning from it.
Not sure if thats a good thing

somber silo
#

Hey all, working on the dismemberment mod for arma 3.

I had some questions about effects for you guys, particularly in particles vs objects.

Currently, for the head explosion mechanic, I am spawning various different items (Such as skull, brains, etc)

I am spawning each particle in a for loop, creating an emitter object for each"

IE { _emitter = createVehicleLocal ["#particlesource", _pos, [], 0, "CAN_COLLIDE"]; _emitter setParticleParams [ [_x, 1, 0, 1], // shape name other particle code here ]; _emitter setDropInterval 6000; } forEach _objectstospawn;

Am I utilizing the particle system correclty here, or is this ill advised?

Would it be better to just create a physx object for each object instead?

Thanks in advance

winter rose
somber silo
#

Thats what im thinking, Im not sure if an emitter for each one is the best - I cant drop because each particle is different.

But the simulation is more efficient for particles no? vs fully simulated physx object?

winter rose
#

hold on, hold on.
the above code - what is in _goreItems?

somber silo
#

Just an array containing the paths to the 3d objects

winter rose
#

so for each models, create one emitter that shoots 1 drop every 6000s?

somber silo
#

Yes basically the emitter only drops one particle each

#

the emitter gets deleted long before the 6000s

#

I am going to change it to physx objects instead, see if that gives me good performance

warm hedge
#

It is actually making not much of sense. Please post the entire context

winter rose
#

if you have duplicates in _goreItems, better configure one emitter properly to generate them all dupes

somber silo
#

Yes but they are all unique shapes

warm hedge
#

In the first place, there is a command to drop ONE particle each execution: drop

somber silo
#

Ah - I saw that while browsing the wiki recently. Is this more efficient than an emitter?

warm hedge
#

It is not about efficiation. It is about dropping one particle

#

Well, it is efficient than your code anyways, though

somber silo
#

Would that be better than say, spawning a physx simulated object for each instead of a particle?

warm hedge
#

That is absurdly bad

winter rose
#

here you create one emitter for one drop, it's faster to just drop directly

tough abyss
#

I have a framework with a text message system which uses the hint system to display messages to other players. Our players will have an option to "build" a PC by combining virtual items, and exchanging them to an admin, to have a prop computer placed in the player's home. This feature is to offer "online shopping" from home.

Our team wants to add an "email" system, to the same, where a player uses the same basic feature, but can check the message from the addAction in the prop, at their leisure. I got some help here starting script for an online market (player to player virtual buy/sell/trade shop). Am I looking at the same process basically?

So far the gist is, use a scripted database, profileNamespace, info to JSON, store, and reverse functions. I know that is extremely watered down. Just seeing if I am in the ballpark.

winter rose
#

โ€ฆwhat is the question here?

tough abyss
#

I apologize, brain injury from time in the army, makes cognition rough.

To make an email system, from an existing text message system, would this be the basic flow of the scripting?

Scripted database > profileNamespace > info to JSON, store > and reverse functions.

still forum
#

Man I would have so much fun developing life stuff if I had the time for it ๐Ÿ˜„
I'd build a whole computer and phone. Multiple apps, E-Mail addresses, phone number with calls, SMS, maps, online banking. So much fun ๐Ÿ˜„

tough abyss
still forum
tough abyss
still forum
#

Ah then yes.
Server has a database (hashmap) that stores every players inbox. Which is saved to profileNamespace.

When player sends mail, it tells server, server puts into receivers inbox.
When player receives mail, it asks server for inbox list, server grabs inbox list and sends it back

tough abyss
old owl
still forum
#

I think it would be good if AI can learn from the wiki to produce better SQF code

old owl
#

Ah okay, totally understandable. More avoided instances of stuff like setFOV haha ๐Ÿ™‚

ruby spoke
#

nvm found a workaround

old owl
#

One thing I did wanna add is a form of instant messaging, which would have read receipts and even an indicator to show when another player is typing. Only thing that really holds me back from doing stuff like that is just that with our mission having existed for 10+ years, there is also a lot of older and more interesting written code that can make reworking things a little daunting sometimes. I am not an SWE or anything IRL but I imagine that kinda just goes for any project lol.

granite sky
#

Half my bugfix PRs for Antistasi these days end up being refactors as well :P

#

At some point you gotta stop stacking up the trash.

still forum
#

Me be like "Hey I could spend some time working on this old project"
Me then: spends days just refactoring and not really changing anything meaningful
Me after: "Okey I've spent enough time on this project, time to switch to something else"

old owl
# granite sky At some point you gotta stop stacking up the trash.

That's cool you work on Antistasi- I didn't know that! I have played a little bit of it with friends from time to time and had a blast. Since I work on life framework stuff, we pretty much never do anything AI related but think I remember saying to you a while ago I got a lot of respect for you guys who know AI stuff really well the way you guys do. Seems like magic to me haha

granite sky
#

Arma AI is sadly pretty close to magic. If you follow certain arcane orthodoxy then it usually works out. If you stray then you open a portal to hell.

#

Too many layers of broken shit between your code and the results. There are paths that work but a lot of non-obvious and undocumented ways to screw up.

old owl
hallow mortar
granite sky
#

I don't think they're great at learning from documentation anyway because they lack comprehension. Forum answers and github repos are more useful for them.

tough abyss
fair drum
granite sky
#

Arguable whether it's more dangerous when the code is obviously or non-obviously wrong. I consider it a good thing that LLMs are so bad at SQF that they usually make it obvious.

formal grail
#

Copilot's made my sqf coding like 50x faster, and now with inserts, it frequently catches very trivial errors for me (like syntax issues or forgetting an underscore here or there). This is made more important by the fact that sqf language tools in vscode generally don't have semantic tying info and won't catch/autocomplete those. It hallucinates scripts from time to time but I just press escape and move on.

granite sky
#

Once you get used to the language you don't make a lot of syntax errors. I think the worst one is where you miss an underscore in an if statement and Arma just ignores it.

#

Syntax checking is probably the best use for the things though. LLMs get syntax.

formal grail
# granite sky Once you get used to the language you don't make a lot of syntax errors. I think...

I've coded in C-like languages for 15 years, and without an IDE that does it for me or catches it with squiggly lines, I'll still forget a semicolon at least once every 10 minutes of heads down coding.
In arma 3 that's catastrophic for productivity because the sqf vscode extensions don't catch it and because that's a 20-30 second issue to fix at least, more if it's a mp test. And that's just semicolons. There's the forgotten underscores. Brackets/paran (at least this one gets caught by my IDE without copilot). The typos. The forgotten parameters inside spawns/event handlers. Being able to read my mind and make formats for text. All adds up.
And then there's the tedium like:
private _whateverX = ...
Ok, now it can do _whateverY by itself.
Another is annoying vector math, though that one I usually take outside my IDE to chat gpt which will hallucinate 80% of the sqf commands and syntax but once I put it next to my code, copilot will automatically translate it nicely because its context field includes my last touched files.

buoyant hound
#

Hey i need an example for a truck spawn then go to first waypoint wait 5second then move to last waypoint and got delete

Am try to know the statements part of waypoint so i need better examples to know it

austere granite
#

@ruby spoke you just want to put "items1, "item2" in that array. Then go through the items[] array and use config to format config path from the array elements.

ruby spoke
#

What I did was just put the class names of "item1", "item2" in the array. So all i have to do to get the data is run BIS_fnc_getCfgData on the selected array element.

#

Don't know why I didn't think of it before.

grand oracle
#

Can you put a hyperlink in a hintc ?

modern plank
#

When we do a "createUnit", is there any recommended check to be done before the unit is actually ready?
Something like:

_unit = _group createUnit[_class, _pos, [], 0, "NONE"];
waitUntil { not isNull _unit };

Maybe another test than not null ?

cosmic lichen
#

No

#

The unit should never be null immediately except you provide a wrong class name .

#

But then the check would run indefinitely and break anyway.

modern plank
#

Ok, so the created unit is immediately avail. and "usable", no need to wait like for a player.

pallid palm
#

@formal grail stop useing big words i don't understand lol "hallucinate" ๐Ÿ™‚ joke lol

#

@grand oracle hintC shows up on your schreen right

pallid palm
#

@grand oracle hyperlink is mostly used to link map markers imho

austere granite
#

Yeah that's how you're supposed to do it ๐Ÿ˜ƒ

flint topaz
#

Then for larger changes will then do restarts, then move back to ingame for small fixes

#

Advantage is ADT has syntax highlighting and even undefined variable detection due to being live.

tulip ridge
#

You can recompile functions without restarting

#

Personally I use hemtt with filepatching, it's got some fairly advanced linting and will catch a lot

tulip ridge
#

In general

#

Vanilla and CBA's function setup can both recompile

#

That's unrelated to ADT

errant jasper
#

And function in variables can also just be overwritten

thin fox
#

ah makes sense

tulip ridge
#

Assuming they're not compileFinal'd, yes.
For vanilla, just setting recompile = 1 will allow recompiling via BIS_fnc_recompile.

In personal experience (though I don't use vanilla's at all anymore), it's rather slow to use the default parameters so I would recompile specific functions rather than "everything" (which was still only the ones I was manually doing).

#

I've just use CBA's PREP ever since I switched to hemtt, much nicer to work with imo

sharp grotto
#

For developing you can also do that without the function libary.

{
    // missionNamespace setVariable [(_x #0), compileScript [_x #1]]; // protected against overwriting - for the live build.
    missionNamespace setVariable [(_x #0), compile preprocessFileLineNumbers (_x #1)]; // For developing - not protected!
    
} forEach
[
    ["fnc_abc1","fnc_abc1.sqf"]
];

Then you can just edit the SQF files and execute it again to recompile the functions.

manic sigil
#

Alright, digging through the config files didn't leap out at me; is there a way to Get how long a vehicle is? Bounding box dimensions, anything?

cosmic lichen
#

Not in config. But there are commands for it.

manic sigil
#

Yeah, should have figured, I assumed it was more AI delusions since no proper links showed up T_T

#

sizeOf should do fine, I think.

#

Eh, 90% accurate. Good enough for what I need.

cosmic lichen
#

why not use the bounding box?

manic sigil
#

I just need a roughly scaled multiplier for how far back to send boats after they drop troops off.

#

Or rather, how far back to make them back up, before giving them back control to turn around and drive off

hasty gale
#

Sorry if this is the wrong place to ask, but does anyone know if there is a way to play around with the aiming deadzone in arma 3? What I mean by that is if it's possible to get or set the offset from the weapon deadzone? Sorry if I'm not clear, but basically when you enable deadzone to the max, you can move your character's upper body independently similar to holding alt while aiming down the sights. Is it possible in any way to get control over this via modding?

winter rose
thin fox
#

AI be like: setDeadzone

tough trout
#

I've been having issues with a script. I'm trying to create an "extraction beacon" scenario where players can execute a hold-action on one of several beacons and it will produce 3 outcomes:

  1. A hint telling players that an extraction beacon has been activated (this part works)
  2. Move an invisible item labeled "LZ_Marker" to the same position as "Exfil_X" which is a landing zone near each beacon (This should work but doesn't)
  3. Create a map marker to show players which beacon was activated (This I have no idea how to make what I have work)

Here's what I have for code (It's inside the activation of a Hold Action):

LZ_MARKER setPos [getPos Exfil_2];
 "Safety can be found at the Outpost!" remoteExec ["hint"];
 private "_mkr";
 _mkr = createMarker ["outpost_marker", getPos _target];
    _mkr setMarkerShape "ICON";
    _mkr setMarkerType "mil_dot";
    _mkr setMarkerColor "ColorBlue";
    _mkr setMarkerText "Outpost";
hallow mortar
#

You should use one set of getPosASL/setPosASL, getPosATL/setPosATL rather than getPos/setPos. getPos and setPos are slower and don't actually use the same type of coordinates as each other.

#

Now for things that might actually be the issue: What is contained in the variable Exfil_2? Object, marker...? If it's a marker you'll need to use getMarkerPos instead.

tough trout
#

It's a landing pad

#

And LZ_Marker is an invisible helipad

hallow mortar
#

Your syntax here is wrong:

LZ_MARKER setPos [getPos Exfil_2];```
Leaving aside which position commands are being used, what you're doing here is creating an array _containing a coordinates array_, which is not what `setPos` expects to receive.
Let's say `exfil_2` is located at coordinates `[10, 10, 0]`. If you do this:
```sqf
[getPos Exfil_2];```
Then the end result is `[[10, 10, 0]]` - an array inside an array. `setPos` and its counterparts expect to receive _just an array_, e.g. `[10, 10, 0]`.
tough trout
#

So if I were to define _exfil as a private variable, would this work?

_exfil = getPosATL Exfil_2;
LZ_MARKER setPosATL _exfil;
hallow mortar
#

It would work, but you don't have to use a private variable. (It's handy to do so if you want to use that position again in the script, so you don't have to get it again, but not required to make it work.) You just have to not add the extra [].

tough trout
#

Well, that solved most of that problem, but now the helipad duplicates and the one with the variable name LZ_Marker goes to the debug corner

tough trout
hallow mortar
#

For more compact privating, you can use private as part of the initial assignment of the variable, rather than needing a separate thing for private "_myVar";. See private syntax 3

hallow mortar
tough trout
#

It may be the actual exfil script. I'll post it here in a second

#

Actually, I found it almost immediately, the original version of the exfil script was when LZ_Marker was still a marker

#

Now the heli lands in the right spot, but then it takes off immediately.

private ["_lzPos","_spawnPos"];


_lzPos = getPosATL LZ_MARKER;

// Spawn extract
_spawnPos = _lzPos getPos [3000, 135]; // 2 km SE
_spawnPos set [2, 750];
EXTRACT = createVehicle ["B_Heli_Transport_03_F", _spawnPos, [], 0, "FLY"];
createVehicleCrew EXTRACT;

EXTRACT flyInHeight 75;
EXTRACT move _lzPos;

waitUntil {sleep 5; EXTRACT distance _lzPos < 200};

// Land
EXTRACT land "GET IN";

// Wait until all players on board
waitUntil {sleep 10; {alive _x && _x in EXTRACT} count allPlayers == {alive _x} count allPlayers};

// Take off
EXTRACT flyInHeight 100;
EXTRACT move (_lzPos getPos [1000, 270]); // fly west

// Music cue
playMusic "Mephistos_Lullaby";

sleep 60;

// Fail state
EXTRACT setDamage 0.7;
EXTRACT setFuel 0;

waitUntil {sleep 5; (getPosATL EXTRACT select 2) < 50};

// Trigger outro
[] execVM "outro.sqf";
hallow mortar
#

You might want to restrict the crew's AI by setting them to Careless or using disableAI, otherwise they might get spooked by reported contacts and try to leave.
It's also possible that because of using the "GET IN" landing type, it's checking to see if it has any synced waypoints of units that want to get in, seeing there are none, and immediately deciding its job is done and leaving. You could try using syntax 3 of landAt to set a wait time instead.

tough trout
#

I need it to avoid taking off until all players are on board. It's meant to be a cinematic failed extract

hallow mortar
#

Well, you can just set a super long wait time, then cancel it with landAt mode "None" when all the players are aboard

tough trout
hallow mortar
#

Well, I don't know what you actually did, so ๐Ÿคท

tough trout
#

Replaced
EXTRACT land "GET IN"; with EXTRACT landAt _lzPos;

hallow mortar
#

Well, that's not a valid syntax for landAt, so not too surprising

tough trout
#

So, rather than being condescending let's try helpful

hallow mortar
#

heli is obviously EXTRACT. Then on the right side we have an array of parameters. position is presumably _lzPos. mode, I would imagine, is "GET IN". For waitTime, we could try something like 999999999 since we're not expecting it to run in full; it will be manually cancelled. putOnSurface doesn't matter too much if the LZ position is accurate, so we can omit it or just go with true.

waxen edge
#

Hey everyone, I'm trying to make a self/emergency revive script that works with the default revive system. I managed to get the below to work, except upon revive the player cannot scroll through the action menu. It took me forever to figure this out and I can't find a next step, any idea what to change? ["#rev", 1, player] call BIS_fun_reviveOnState; player setVariable ["BIS_revive_incapacitated", false, true]; player setVariable ["#rev_state", 1]; //stops #rev_bleed from coutning up, removes greyscale player setDamage 0; //heals player setUnconscious false; //makes player getup

hallow mortar
hallow mortar
waxen edge
tough trout
finite bone
#

What is the best way to rewrite this statement? I get that hemtt is suggesting configOf but it only returns the path not the display name...

warning[L-S30]: Use configOf instead of typeOf with configFile for variable `_x`
   โ”Œโ”€ addons/main/functions/fn_addNewObject.sqf:15:77
   โ”‚
15 โ”‚         private _newObject = _x getVariable ["PEPE_CustomObject", getText (configFile >> "CfgVehicles" >> typeOf _x >> "displayName")];
   โ”‚                                                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use configOf
   โ”‚
   = try: configOf _x
hallow mortar
#
getText (configOf _x >> "displayName")```
winter rose
#

we help scripting here ๐Ÿ˜‰

oak loom
#

thx

#

ill move it

agile pumice
#

Can someone tell me why the trigger I placed down is showing as "no shape" even though I assigned a and b values for its size?

indigo snow
#

negative values?

glossy matrix
#

Does anyone know how to set banking degrees on a camera object? On wiki someone said setVectorUp command can be used for this purpose, but I tried _camera setVectorUp [1 * (sin _bank), 0, 1 * (cos _bank)], nothing happens with the camera.

glossy matrix
#

BTW I'm on arma 2 oa, does this command only work on arma 3?

warm hedge
#

BIS_fnc_setPitchBank is an A2 function

#

You sure you use the right camera or number to set

agile pumice
#

not sure, but I was able to use triggerArea with it so i guess its of no concern

glossy matrix
warm hedge
#

Post the entire code

glossy matrix
# warm hedge Post the entire code

I tried my best to come up with this minimal example

_playerDir = ((getdir player)-90)*-1;
_playerPos = getPosASL player;

_cameraAngle = INIT_CAM_ANGLE;
_cameraDir = [ cos(_playerDir+180) * INIT_CAM_DIS_Y, sin(_playerDir+180) * INIT_CAM_DIS_Y, INIT_CAM_DIS_Z ];
_cameraPos = [ (_playerPos select 0) + (_cameraDir select 0), (_playerPos select 1) + (_cameraDir select 1), (_playerPos select 2) + (_cameraDir select 2)];

_camera = "camera" camCreate [0.0,0.0,0.0];
_camera setPosASL [_cameraPos select 0, _cameraPos select 1, _cameraPos select 2];
_camera camSetTarget [ (_cameraPos select 0) + (cos _playerDir) * (cos _cameraAngle) * 100000.0, (_cameraPos select 1) + (sin _playerDir) * (cos _cameraAngle) * 100000.0, (_cameraPos select 2) + (sin _cameraAngle) * 100000.0];
_camera camCommit 0;

while {true} do
{
    // Some other stuff.
    _bank = _bank + 0.01;
    [_camera, 0, _acbank] call BIS_fnc_setPitchBank;
};
#

I'm modifying GCam 2, the entire script is nearly 4k lines long

warm hedge
#

You sure it is about GCam 2 or your code? Does your code work on its own?

glossy matrix
#

No I'm not saying it's about GCam 2, GCam 2's code works, just mine doesn't. I'm mentioning it because posting the entire 4k lines of code is simply not viable.

warm hedge
#

No I'm not saying that. Are you sure your code being broken or injecting your code is

glossy matrix
#

Let me try executing my code in mission editor

warm hedge
#

Didn't you do that yet?

still forum
glossy matrix
# warm hedge Didn't you do that yet?

Sorry I only started learning about arma modding yesterday.
In mission editor it shows this error:

'[_camera, 0, -45] call |#|BIS_fnc_setPitchBank'
Error Undefined variable in expression: bis_fnc_setpitchbank

The script is this:

titlecut [" ","BLACK IN",1]
_camera = "camera" camcreate [0,0,0]
_camera cameraeffect ["internal", "back"]

;=== 14:51:29
_camera camPrepareTarget [-55102.08,84473.38,19.82]
_camera camPreparePos [3724.91,3606.90,0.45]
_camera camPrepareFOV 0.500
[_camera, 0, -45] call BIS_fnc_setPitchBank
_camera camCommitPrepared 0
@camCommitted _camera

~30

_camera cameraeffect ["terminate","back"]
camdestroy _camera
end1=true;
exit;
warm hedge
#

I just recalled you need a Functions module in Editor

still forum
#

@camCommitted _camera
Wuht, is that SQS? notlikemeow

mellow scroll
#

Question - I have a medic script that works quite well - until the squad is at a STOP from a vanilla STOP command. What is the trick to release just the medic to treat wounded? I've tried everything I can think of - I can't get the Medic to leave his STOP spot.

glossy matrix
winter rose
zinc loom
#

hi, im a newbie with some little skils in sqf, im working on an arma3 project with extDB3, and i need some kind of help how to use it properly,

pallid palm
#

what's extDB3

zinc loom
#

some old stuff, invented probably by turning himself

pallid palm
#

so its like a config file ?

zinc loom
#

arma 3 has no persisntent saving , so extDB3 is a module that gives u kinda this ability, it gives u the chanse to send data into a database and request it

pallid palm
#

ahh i see

tender fossil
zinc loom
#

?! tell me more ๐Ÿ™‚

zinc loom
#

hm, like saving stuff in xml and loading it at restart ?

tender fossil
#

Hmm, is that deprecated info now?

still forum
tender fossil
#

Was just typing that HashMaps are probably the way to go ๐Ÿ˜„

#

Well yeah, could've linked their page directly indeed

pallid palm
#

@glossy matrix

#
//.sqs is Very old:
.sqs - uses  goto

.sqf - uses while { } do { };
//and many other kinds

//i remember useing sqs way back in OFP :)

//sqs -  goto - is kinda like CNC machining M99 and m98
//where you can jump to diff parts of a script or looping as it were

//i find .sqf way nicer then sqs
#
//Ex 1  sqs ===================================================
if (!isServer) exitWith {};

_grp = group (_this select 0);
_range = _this select 1;
_delay = _this select 2;
_ranX = 1;
_ranY = 1;

_origPos = (getPos Player);

#patrol_again
_origPos = (getPos Player);
{_x setBehaviour "AWARE"} forEach units _grp

?(random 1) < 0.5: _ranX = -1
?(random 1) < 0.5: _ranY = -1
xx = random _range * _ranX
yy = random _range * _ranY

units _grp commandMove [(_origPos select 0) + xx, (_origPos select 1) + yy];

{_x setBehaviour "Safe"} forEach units _grp
~_delay

goto "patrol_again"

//Ex2 sqf =========================================================
//here how to exec-- [leader _grp, 100, 10] execVM "Randpatrol.sqf";
//==================================================================
if (!isServer) exitWith {};
sleep 0.5;

// Setting variables
_grp = _this select 0;
_range = _this select 1;
_wtime = if (count _this > 2) then {_this select 2} else {10};
if (_wtime < 0) then {_wtime = 10}; 
_timeout = 0;
_ranX = 1;
_ranY = 1;

// getPos (leader _grp);
_origPos = getPos (leader _grp);

// Have the units patrol
while {{alive _x} count (units _grp)  > 0} do
{
    {_x setBehaviour "AWARE"} forEach units _grp;

    if ((random 1) < 0.5) then {_ranX = -1};
    if ((random 1) < 0.5) then {_ranY = -1};

    xx = random _range * _ranX;
    yy = random _range * _ranY;

    units _grp commandMove [(_origPos select 0) + xx, (_origPos select 1) + yy];
    {_x setBehaviour "Safe"} forEach units _grp;
    If (!alive _grp) exitWith {};

    _timeout = time + 10;
    waitUntil {moveToCompleted (leader _grp) or _timeout < time};
};
zinc loom
#

so you say its better to make a sisytem with namespace then extDB3 ?

#

using steamid as name of variable ?!:) and set giant string in it ?

#

sounds doable

pallid palm
#

or missionNameSpace

#

well i really dont make systems i just make missions

zinc loom
#

cool are u interested in teaching a noob how to do so :)?

pallid palm
#

it would take like 10 years to do so

errant jasper
#

Pretty sure you need one of teh namespaces with profile in them. So no I would not use missionNameSpace. Like dedmen says above

pallid palm
#

what i could do is send you 1 of my missions: and you could rip it apart and see what i have done: and that would be a good start for your learning

zinc loom
#

i need just some independeds patrol around in defined areas , they hate blue and red ๐Ÿ™‚

pallid palm
#

i gave 2 exsamples up there look up

#

2ed one is sqf

cosmic lichen
#

Its been a while since I've seen sqs code

sharp grotto
#

small private server and not many players = profileNameSpace is fine
Open public server with many players and much data = extDB3

old owl
#

I think just kinda depends on what your servers constraints are and what you're also intending to store.

Using a hashmap on server would be far easier to setup and would be more efficient in saving data.

With ExtDB3 you are able to organize data better and even use it within other applications like web apps. The draw side is just that it is really old and slow, so if you were to use it; I would advise caching data and only using it to update that cached data very sparingly and infrequently.

winter rose
old owl
#

We store our information in a database but we also have a crap ton of players. Realistically for smaller missions and servers using hashmap methods would be far more efficient, easier to deal with syncing wise and is entirely appropriate

zinc loom
#

its like combo altis life and exile so stuff is on the ground ... permanent

#

like its a lot of stuff to save, lot of things, im right now checking how to save that in missionNameSpace, and how loong can a variable be ?

pallid palm
#

@not alive player yeah Lou that = waitUntil not alive player in sqs

zinc loom
#

i want every weapon car etc to be unique, having stored owner permanent even if owner is not online etc

still forum
old owl
still forum
#

There is also Intercept Database by the way. Which last I heard still works. But no-one is maintaining it except it fully breaks ๐Ÿ˜„
It is not old and not slow (excluding the database speed side)

still forum
zinc loom
#

well thats the only way i know how to organiose data ๐Ÿ™‚ and thats working well atm, im stuck with stuff klike async calls

errant jasper
#

But if you are gonna dump non-small amounts of data regularly be sure to use the missionProfileNameSpace and not just profileNameSpace.. Had enough of missions ballooning that to 50MB and then writing it several times per minute...

sharp grotto
#

and stuff like "weapon having stored owner permanent" wont work, most items have no unique ID.

pallid palm
#

every time i type something i say to myself w8: could this be mistaken for being mean ๐Ÿ™‚

#

then i start over ๐Ÿ™‚

old owl
#

On my phone so can't fact check myself but didn't Arma also add something to support HTTP requests? Could that be used as a better alternative to stuff like ExtDB3 if I'm correct about it existing? Maybe I am thinking of a reforger framework

zinc loom
#

i apologize if it sounds like i neeed someone to hold my hand, i have chat gpt for that, i just looking for some infos on how to tackle the project, which i recived, ty

still forum
old owl
#

Ah okay cheers :)

pallid palm
#

omg chatGPT omg Nooo there gos your learning

#

soon people will get chat GPT to ride there bikes for them

#

i like the way Nikko does it: he gives me hell: and teaches me to understand all at the same time ๐Ÿ™‚

winter rose
mellow wasp
#

what's the script command to detect when an entire group has boarded a heli? I want to make it so that when the player and all their units board a heli, a trigger detects it and can skip the hold waypoint to begin the assault

pallid palm
#

@mellow wasp well there is no command per say: for the player and all their units board a heli: but i order all my team in the chopper: then i get in: i use this for the script to check if all players are in the chopper: ```sqf
waitUntil {sleep 3; (Helo2 emptyPositions "CARGO" == 0) or (!alive Helo2 or !canMove Helo2 or !alive Pilot2) or ({(isPlayer _x) && (isNull objectParent _x) && (alive _x)} Count (nearestObjects [Helo2, ["CAMANBase"], 300]) == 0)};

#

i made a complete Chopper Command if you wold like to have it: just friend me: and ill send you a demo mission

#

it uses no way points and all is run by radio triggers so it can be called in game at any time

#

@mellow wasp and if you want i'll even get on voice and explan the entire missions and how it all works ๐Ÿ™‚

#

it was very importante to me for the chopper to work perfect: in my missions so well you know: i worked on it and ask for help all day long: every day: and woohoo now its Awsome ๐Ÿ™‚

#

Dart is the guy that helped me the most: on my chopper command hes Awsome: but other people helped me also

winter rose
pallid palm
#

that will work also ๐Ÿ™‚

#

i needed all the checks in mine ๐Ÿ™‚

zinc loom
#

question: can i still getVariable on a player if i try it in onPLayerDisconected {}

granite sky
#

yes, because the unit still exists.

#

Whether it's a player at that point is another matter, but the variables will still be there.

pallid palm
#

i can just explane in the brifeing that the time showing is false and the time in the params can be chesen

#

like this```sqf
player createDiaryRecord ["Diary",["Multiplayer Log","Make Sure Parameters Are Set The Way You Want"]];
player createDiaryRecord ["Diary",["Multiplayer Log","<------Check The Log Over There"]];

#

that's what iv been doing anyway

mellow scroll
granite sky
#

Ah yeah, Leopard suggested that last time and I never got around to testing it. Didn't find any other way to override a player's stop command.

pallid palm
#

i'm not sure i understand what you guys are talking about ? but i can order my team to stop and then point at the medic or any other guy and hit enter; and order that soldier to move or whatever : can you explan to me what you guys mean ?

#

oh w8 you said players stop command hmmm