#arma3_scripting
1 messages ยท Page 189 of 1
And people wonder why I get a headache maintaining my community's mods ๐
Locality is the one thing that has always hurt my brain
A table and discussion of the exact rules of precedence that ARMA 3 uses to evaluate SQF.
yo, im making a mission revolving around CSAT and taking them down, and i want the riflemen on the CSAT side to attack civilians to show how brutal they are, is there a script to do this????
You can join the civilians to a blufor group, and then redfor will shoot at them.
how do i do that?? im very new lol
In script it's just joinSilent. Can be done in the editor too, IIRC.
ty!
okay so dumb question what would i type in ive never scripted beforre
i did
this joinSilent blufor; and its telling me joinSilent needs to be in an array
Would this be the correct place to ask for a walk through on making a mod. I already have the code needed I just need to know how I need to package it to upload to steam so people can subscribe and it will work
I'm creating a scenario where the player is a police officer and they get dispatched to a warehouse. There are 2 suspects at the warehouse and I've been trying to write a script that makes the 2 suspects shoot the player if the player draws their weapon 15 meters near the suspects. How can I make this happen?
Hey, it's fairly straightforward when using Arma 3/Mikeros Tools.
This page provides solid documentation and should help you get started: https://community.bistudio.com/wiki/Arma_3:_Creating_an_Addon
If you have questions, this channel (and the other channels regarding config etc.) is/are a good place to ask them, just try to use the channel which is most appropriate for your question.
okay thank you so much
No problem, best of luck 
You can make a trigger which changes the suspect's side to an opposing side when the player enters it, or performs a certain action etc. That should make them hostile towards the player and engage him.
Side swaps can be achieved by having them join a group on a different side. For example, given they start out as civilian and the player Blufor, you can have the suspects join an opfor group, making them be considered opfor and thus hostile to the player.
You'd need a trigger, which you can set up in the Editor and in terms of scripting these commands should point you in the right direction:
https://community.bistudio.com/wiki/createGroup
https://community.bistudio.com/wiki/joinSilent
To check whether the player has a weapon drawn, you can check the return of currentWeapon.
That is because, it doesn't use simpleVM.
Because its too large.
&& {_x} would fit
__EVAL is NOT preprocessor.
Why do you want to do that? Detect if a mod is present?
I just want to detect if config class/variable exists so i dont try loading it again , just to prevent the already defined warning. my current solution is to use define checks to load the include file only once
I feel like there are better ways these days.
We have hasInclude for config, fileExists for script.
What tool are you using to build your addon?
the official addon builder

Still - unsuccessfully - trying to find a way to somehow get the dropoff/pickup location of the "virtual heli transport support" module that is available in vanilla ARMA 3. There has to be a way the AI knows where to go (the player does in fact tell the module where to pick him up and where to drop him off), so the position info MUST be there somewhere and so one should be able to get/grab that info? But how best to do that?
expectedDestination
if you've already tried that but failed, explain your setup/code
@little raptor - Oh that one I did not try.
So far I have the following, with works nicely (put in the INIT field of the platoon leader player). To explain the code below: If you call the virtual AI support transport heli, you can pop a green smoke grenade if you see it coming and this will move an invisible helipad to the location of the green smoke and thus force the AI to land there (effectively helping it to land at a good spot -> before the AI sometimes decided to land elsewhere, either too far away or in a bad spot, leading to its destruction). The invisible helipad then also gets moved back to its original position "off the map" after 30 seconds.
This got me thinking that it would be easier if what I am doing with the smoke grenade would happen right away, when the player calls up and selects the pickup and then after getting on the heli the dropoff position for the virtual transport heli. Because with the above one you still encounter the issue that the heli does not want to drop you off at the location where you ask him to, but looks for a different spot. (Might be that all this is due to the AI having issues with the custom map - so could be it needs this little bit of extra help.)
```sqf
// your code here
hint "good!";
```
โ
// your code here
hint "good!";
I hesitated to post this here but I think it can help someone create its own version of the script. And I did not find a similar implementation online so here it is
New little script to clear LZ using hatchets (cut tall grass, small trees, etc.) or C-4 for bigger trees.
the link to the git is in the video description. And if you have suggestion to improve it feel free to ping me ๐
Short video showcasing How to clear an LZ using hatchets and C-4 via one of my script. Works on dedicated server !
For installation and how to use, see documentation & implementation on Git: https://github.com/gerard-sog/arma3-macvsog-columbia-scripts
Arma 3 Vietnam unit: https://discord.gg/dyeUNXHFqS
@granite moat - Oh that is a very cool idea!
FYI You can set the direction of the tree fall with alt syntax of setDamage
Anyone have a method to force AI (in parachutes) to come toward ground with some speed / motivation?
On spawn each one gets; addWaypoint ("MOVE"); setWaypointSpeed "FULL"; setBehaviourStrong "CARELESS"; (Did try without setting behaviour, no difference)
They all just float down slowly / aimlessly.
CODE = https://pastebin.com/ZkBZwvKv (WP stuff @ line 100).
VIDEO = https://www.youtube.com/watch?v=IIVK11YhP3g&t=447s (~20-30 sec of relevance).
I'm sure I knew the answer here, but I don't work with AI as much as years ago. A friend however wanted me to build him a mission for practicing shooting parachutes, but it's essentially useless if they behave like this :(. Sorry for the long message!
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
I didn't want to make this vid so damn long :X
99% done just gotta finish a secret, and hope someone knows how to make the parachutes fall faster, then I'll release a compiled (Playable) version and Editor version of the mission for anyone else if wanted.
Just setVelocity / addForce
o.O that is temporary / doesn't affect how they move in the parachute, they'd just come down like a cannon :D
I'll try it but I don't see that being beneficial for practicing shooting them
Tried both, setVel is too absolute / non adjustable for the purpose, I tried using a loop of addForce on the parachutes (world & model space), but no matter how strong (10k newtons) I make it they seem to negate it after about 0.25 sec :/
setVel is too absolute
Well sounds like you're just doing a straightsetVelocitywhich would obviously remove their existing velocity. You'd want to add whatever values you want to their current velocity
that's a lot of calc for constant parachuters falling tho
I'm pretty sure the issue here / fix is AI behaviour
It's like three lines
to do it once....
but like I said before, that's a straight line
that's not what I want for practice lol
that's why I tried a loop with addForce, so they'd change direction speed etc constantly
Yeah if you just give it a straight line then it's going to be a straight line
You can also just increase velocity in whatever direction the parachute is facing
Ooh I didn't know this, my trees fall random.
@little raptor I was thinking that this might be useful and could be utilized somehow:
[caller, vehicle, position, mainScope, secopScope] call BIS_fnc_transportService
since it has the "position" in there that is passed for pickup/landing
(or alternatively the addMissionEventHandler -> "MapSingleClick")
Is it a bug if you spawn a drone and not get the AI crew along with it? Somebody posted on my Steam workshop item that he's spawning via script a couple of UAVs and the crew is not showing up, so is that something on the mods end? Or is it Arma being Arma?
depends how hes creating the vehicle, you can create them with and without crew
Okay, I don't know what he's doing, all he said is that the crew aren't spawning, so it might be on his end
createVehicle on its own wont create crew
youd need createVehicleCrew, not sure there is a built in way to it in one pass, i rarely use createvehiclecrew tbh, I prefer to have more control since I like to be able to swap troops/crew out as I want
Okay
I remember specifically having trouble putting AIs in a drone manually. Like if you spawn them outside then they don't work.
So that's about the one thing we use createVehicleCrew for.
Okay
not at pc but as long as its B_UAV_AI or whatnot its never caused me issues and i use a lot of drones ๐
Yeah I use that all the time, so that's not the issue.
Possibly hes not not creating the crew or hes trying to use createVehicleCrew and thats failing somehow, config maybe but if you can place the unit in eden or zeus with crew checked i dont know how itd fail since afaik they do that internally
Yeah as said I don't know the specifics as I don't script and didn't ask either. I'll pass this along though, and maybe that'll fix the problem.
Can you overwrite settings from Description.ext on the fly? Like switching between vanilla revive system's basic/advanced incapacitate settings?
What is the default height?
In https://community.bistudio.com/wiki/createVehicle
"FLY" - if vehicle is capable of flying and has crew, it will be made airborne at default height.
Last I checked it was 100m, but I don't know where that comes from.
I found this function a while back that actually does them both together https://community.bistudio.com/wiki/BIS_fnc_spawnVehicle
hello friends :)
i come with another issue, much simpler this time thankfully
I need an AI jet's radar to be forced on to make player targeting easier. So, I put this setVehicleRadar 1; into the vehicle's init.
But I still had trouble getting a lock. So in the debug menu, I ran isVehicleRadarOn jet;, and it returned false.
...I don't see anything in the documentation that says anything about that kind of behavior. The command doesn't work on player-driven vehicles, but should function on AI vehicles. Yet, again, it doesn't seem to be?
...hold on i might be stupid, I don't think I'm using a vehicle that has radar capabilities.
that was the issue ๐ญ ignore me.
These mission parameters can't be changed mid mission, maybe some of them, but I don't remember any command that would allow you to do that.
And usually there's no point in doing such changes.
Got another question, as I have been using the vanilla minefield module so far, but that has two issues: The first is that it does only place the vanilla mines/tripwires; the second is that the mine placement (at least for the trip wires) is less then ideal when random. So I rather place some myself at "good" locations and put in different presence percentages in regards to them being there. The problem I have is how to tell the enemy (and maybe also the civilians) where the mines are, so they do not accidentally run into them.
Ah so just "East revealMine _mine;" in the init field of the mine? Thanks @warm hedge !
this instead of _mine if you're putting it into the init
got it! much appreciated
if you're using virtual supports that's not the right function
module functions are defined in the module class (e.g. for the support requester it's BIS_fnc_moduleSupportsInitRequester)
anyway I looked at the code but it seems that the position is registered via the FSMs which I can't open rn
@little raptor - Thank you for looking into this. Seems such a simple issue to get the position, but it really looks like there is no simple, straight-forward way to get it. Maybe to go the eventhandler and onmapclick is the better way to do it?
@drifting badge i made a complete chopper command useing radio triggers, did you try that at all
my radio triggers call scripts for 5 diff chopper commands
well I didn't look deep enough so I'm not 100% sure.
anyway, the onMapSingleClick EH can work but only if the support was called via map, and you knew that a support was being called
also for water insertion and extraction
yes Dart helped me with this onMapSingleClick EH works awsome
i like it that you can just open the map and click on the map and the chopper lands right where you clicked so you must make sure its clear where you click
yes this is the only downside, that a player has to make sure the area is really suitable for the heli to land if one puts down invisible helipads in any form - another way to get round all of it is to put down preplaced LZs for the AI transport heli to use as the AI heli will prioritize those. Essentially the heli transport is only meant for those players that really do not want to pilot helis and rather have the AI do that work (they sure are missing out as piloting helis is lots of fun).
given the way AI pilots in helo's land "Let me just hold stationary here and slowly descend at a speed that makes an arthritic old man look speedy" doing that anywhere near PVP is a recipe for an RPG7 enema anyway - even PVE LandVehicles will shred AI piloted choppers trying to land by default
{
_this spawn
{
playSound "AlarmCar";
};
}]; ```
So, dumb question. I've been stumped on this for a while. I'm currently making a custom grenade that I'd like to have play a sound once it's thrown. The above script works, but of course it triggers when "any" weapon fires.
Is there any way to have the above script trigger, but only for the class my grenade is? Not really familiar with scripting stuff like this.
You get a bunch of stuff passed to the EH, just read the variables
Also please for the love of god do not spawn a new thread on every weapon fire
this addEventHandler ["Fired", {
params ["", "", "", "", "", "_magazine"];
switch (_magazine) do {
case "TAG_yourMagHere": {
playSound "AlarmCar";
};
};
}];
That's extremely helpful, and does work, thank you. This is the first time I've messed around with making custom scripts for my weapons rather than simply messing with inheritance.
The last part of my question would be, so the above script does work in-game running it with the console, but is there any way to plug the SQF file I can make with that into my weapons actual config file? Would something like that be bad for performance since I'm assuming it'd check for that specific magazine class any time something is fired?
You'd make a function that would be called that would run that
Is your mod dependent on CBA?
Makes that a bit easier if it is
it is yeah actually
// config.cpp
class CfgFunctions {
class TAG {
class Weapons {
file = "TAG_addon\functions"; // Set where your function files will be placed
class fired {}; // Compiles your function into a function named TAG_fnc_fired
};
};
};
class Extended_FiredBIS_EventHandlers {
class CAManBase {
TAG_yourAddon = "call TAG_fnc_fired"; // This runs your function whenever a unit fires
};
};
// \functions\fn_fired.sqf
// This is an example of a function header, telling you what parameters it recieves, who made it, and what it returns
// These aren't mandatory, but make development much easier
/*
* Authors: Your Name
* Plays a sound when a grenade is thrown.
*
* Arguments:
* 0: Shooter (unit or vehicle) (unused) <OBJECT>
* 1: Weapon (unused) <STRING>
* 2: Muzzle (unused) <STRING>
* 3: Mode (unused) <STRING>
* 4: Ammo (Unused) <STRING>
* 5: Magazine <STRING>
* 6: Projectile (unused) <OBJECT>
* 7: Gunner (unused) <OBJECT>
*
* Return Value:
* None
*/
params ["", "", "", "", "", "_magazine"];
private _sound = switch (_magazine) do {
case "TAG_yourMagHere": {
"AlarmCar";
};
case "TAG_yourOtherMagazine": {
"SomeOtherSound";
};
};
playSound _sound;
There's a quick little example
Geez that's insanely useful, Thanks a bunch for this! I'd been stumped on it for a while and couldn't seem to find much information, really appreciate it.
Oh wait, that actually brings me back to my other question though. Is it a bad thing to have a script like this optimization-wise, given that it seems like it'd be checking for my mod's grenade magazine class every time a unit fires, or is it a negligible difference?
it's negligible for this
you can measure the code performance using the speedometer button
(you need to pass the args too because it's a function)
Cheers you guys, appreciate all the help. First time I've had to mess with SQF like this so I'm glad it can be implemented without bombing performance.
instead of playSound you should use say3d btw
also since it's a man fired weapon you should use FiredMan
I'm trying to use the Animation Player in the Init category in the Eden Editor, but I can't figure it out, does anyone know how to use this?
Animation Player?
I'm assuming its a part of a mod I have as it's not in the base game. I've tried googling it and using AI, neither work.
Is there any functions to support connectToServer and allow me to first ping a server/check its online? Would be nice to add a little online icon to our community's servers.
I'm not sure what that is but to play animations you use playMoveNow/switchMove
play the animation on some soldier (or on player), use animationState to get the anim name, and finally play it with those commands
Okay, thank you!
if that mod is for playing anims itself you should read its docs (or get AI to summarize it for you or something)
afaik no. but you can do that using extensions (there might be existing ones too)
Thank you so much for that hun^^
It's only added to CAManBase objects
It does, or at least every single time I've used it
I copy/pasted that same setup from a flamethrower
This EH will not trigger if a unit fires out of a vehicle
Oh that
Yeah forgot you can throw grenades out of vehicles
Nevermind, I got it^^
Anyone know if its possible to disable aim down sights? I want my players to not be able to aim down sights when wearing a gas mask.
Is it possible to switch a players model to a different one while playing? Im trying to see if it possible to have a opfor player turn into a webknight opfor zombie when they reach a certain amount of damage.
No, it's not
You could spawn a new unit and make the player remote control the unit though
And then maybe move their original unit somewhere else
Ok, can I do it with AI units then?
Are there any known issues with add3DENConnection currently? Running profiling atm. This code will not group the units together. I've spent a lot of time trying different variations, explicitly fetching Eden Entity and IDs instead, using syntax 1 for create3DENEntity, etc, but nothing: https://pastebin.com/apRcX0Gw
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Is edenList defined somewhere?
as dart said not possible but you could cheese it by just creating the new unit off map and then swap em out with getPos/setPos and (if required) delete the old unit (or keep it around to to swap back)
if any of my players ever make it that far off map they are going to see some weird things happening ๐
Rediscovering that _v setPosASL getPosASL _v; moves the object if its vectorUp is not [0,0,1]. The biki doesn't seem to say which position types change value with orientation right?
hi guys,
is there a way to force an AI jet to use full throttle on take off?
all except setPosWorld
no. you can use setVelocity or addForce but that's not actually the throttle. you just give it a boost
so in essence this will make the object move faster, but there is no way to manipulate the vehicles engine?
directly not that I've ever seen but if you set them to combat "full" and give them a waypoint with a high fly in height they'll haul ass off the runway - that's what I did here https://www.youtube.com/watch?v=OhSQGkAhELM
hello Arma 3: Awesome people:
So if i have 10 playableUnits on my team (West side)
and only 5 of units are players, and the other playableUnits are Removed
How do i get a count, of the player units, that are still alive, and, select one player at Random
private _westUnits = units west select { alive _x };
if (count _westUnits < 1) exitWith {};
private _randomWestUnit = selectRandom _westUnits;
wow holy cow Awsome Lou
that was fast as lightning
Love you man
im so glad i asked, cuz i would of had that all F-ed Up lol
to get players you still need isPlayer check there
like: ```sqf
private _westUnits = units west select { alive _x && isPlayer _x };
not exactly as "the other playableUnits are Removed", but always a good check - especially if more west units are added later
roger that m8s
yea i may have misunderstood
yes
you all did awsome imo
like he said its a good idea to check that anyway
thx you guys @winter rose @proven charm
really helpful, you guys are my ChatGODs
I just use CBA_fnc_players ๐คทโโ๏ธ - got bit by a HC once and that negates that happening ๐
doesn't BIS_fnc_listPlayers cover that too?
i don't use any mods like CBA or ACE im Mod free WooHoo
i used to be a Mod addict, but i whent to mod rehab, and now i kicked the Mod Habit, lol
Yeah, I've always try to make scripts without the need for mods
it's very rare that I use something from CBA, but it has some very useful functions
it really depends on the use case for me - nothing I do doesn't have ACE and CBA is a dependency of ACE so at that point I'd have to be crazy not to rely on the battle tested library built by much better sqf programmers than me ๐ - I take the view "why re-invent the wheel as long as you understand how the wheel works* ๐
yeah i used to meet this friend on the street corner, and get Mods from him, but i don't go there any more, lol
I battle myself to see if I can make a script work without cba ๐
The other playable units were removed, but there could be other non-playable units (ordinary AI) on the same side
do you guys remember Sickboy he helped start CBA way bak in Arma 2
๐ - suspect it's just attitudes from day job seeping in - in my world (enterprise dev) we are paid to solve problems first, program second - so the idea of not using existing good/widely used libraries is just weird - can I write a framework from scratch sure, is it a good use of my time probably not - it's an eternal debate in software development generally and I don't think there is a solution beyond "it depends" ๐
yup
it should not effect non-playableunits right ? @hallow mortar
@cyan thunder i agree to your point, but see, im retired, and i have all day to do anything i want, like play golf, or learn from the Awsome people in discord, or play Arma 3, all day long, or well you know anything,
Try reading the messages in the conversation, and the code in those messages. It should be pretty easy to figure it out.
ok rgr that m8
if its easy then im all about that lol
yeah it wont effect non-player units, cuz of { alive _x && isPlayer _x };
I'm looking for a script that I could put into vehicle int field to make it unlocked only to specific player by Variable Name. I have 10 players slots and one of them is Pilot that has its Variable Name and would like only Pilot to be able to get into a helicopter. I want to limit who can fly.
You can't do player-specific locking because all the lock commands are global effect.
What you can do is use a GetIn event handler on the vehicle to instantly kick out anyone who's not authorised.
i think the best way would be to eject out the people you dont want in the chopper
this addEventHandler ["GetIn", {
params ["_vehicle", "_role", "_unit", "_turret"];
}];
``` that ๐
wow thats Awsome @proven charm
aye and stick a this setVariable ["isPilot", true]; before that (on the actual pilot player unit) then can do if!(_unit getVariable["isPilot", false]) then { //yeet them } and that's about all you'd need to do (not how I'd do it personally but I avoid init fields entirely except for setVariable since I want to be able to move my mission code from mission to mission more easily (I'm lazy and init fields while great are pain when it comes time to change map)
init field what initfield theres no init field there what do you mean ?
He answered a question from someone who specifically asked for an init field script and he's using this in exactly the way that you would typically see it used in an init field - so it's a reasonable assumption that that was the intended use case
I do use them but for stuff like this setVariable ["isAggressorPilot", true] and what not though for specific things I also lock stuff off by steam UID because there is a couple of players who always do the thing I don't want them to ๐
i mostly use initfield for group id stuff
Thank you guys, I will test it. And yes, I want to do it in init Field of an object like helicopter.
I can always punish them (I'm in the zeus slot) but that gets boring zapping them with lightning, sending them to space so a while back I started having fun with it - https://www.youtube.com/watch?v=Cwa4_pjLAWs
lol awsome lol
final version, I broke both their legs (via ace medical) and then had 2 smashers, took 2 mins to do but they listen more weirdly ๐คทโโ๏ธ players am I right ๐
yes lol Awsome
i had this one friend all he did was try to mess up anything he could or blow up anything he could, i did learn alot trying to stop him from doing that but yeah your right
ouch that sounds painful " broke both their legs" ouch
lol
Any other ideas on what could be tripping up add3DENConnection here? The data is good going into it
You should share full code, snippet doest tell what happen before and after
@unborn rivet btw you don't have to exec the addEventHandler GetIn from the init of the chopper , you can execVM it from the initServer.sqf
but you would have to change the word this, to whatever or just addMissionEventHandler
On just
If (isServer) then {
this ...
}
Using type "Sync" instead of "Group" works... if I switch it to Group, nothing. And if I use 3DENConnectGroup, I get lines I have never seen before (probably because this is wrong of me to do but I am testing)
you should use "Group" and not "Sync" to group the team
I did, the 2nd image is that case: No connection is made. The others were just demonstrating that the connection works for other types
are you useing "Group" on playable units or what are you grouping
you should use "Group" from the units in the team to the leader of that team
Grouping the 3DEN Entity ID's for all the opfor soldiers being spawned by the script, to the first one in the full array of all the soldiers spawned
Unfortunately this is using create3DENEntity so it doesn't use the same parameters
oh shit yes Unfortunately
This code as posted should put all the units in the same group (UnitsMasterGroup) to begin with, including the team leader. Trying to make group connections to the team leader might then not do anything, because...they're already grouped together.
Also, be careful with your use of global variables. You don't need to use them to make this script work, and they could conflict with other scripts (and other instances of this script)
So do you still need help with this?
hello
i wanted to use a soundtrack using playMusic but wanted it to play on a repeating loop
Could use a MusicStop event handler and just start the music again
https://community.bistudio.com/wiki/addMusicEventHandler
Could just be something like:
addMusicEventHandler ["MusicStop", {
playMusic (_this select 0);
}];
playMusic "whatever";
Never used it before, so not sure if there's any issues with playing new music right as it stops
addMusicEventHandler ["MusicStop", {
playMusic (_this select 0);
}];
playMusic "bgm1";
playMusic "bgm1";
Oh is it separate music classes?
when broadcasting a hashmap over the same hashmap, does it resend the whole hashmap or just the changes? I'm thinking it probably resends the whole thing.
no just 1 music file i want to use as background soundtrack on a loop
Okay then yeah just do what I had sent then
That'll just replay whatever music was playing last
If you want, you could check the class name so only your thing repeats if you want
params ["_musicClass"];
if (_musicClass == "...") then { playMusic _musicClass };
this will work if only 1 track is defined in cfgmusic right?
if there are multiple tracks i would have to do it individually
Are you using multiple classes in CfgMusic or just a single one with the whole sound track
single one for now, but was curious to confirm how to do the same with multiple tracks as well
You'd need to track all the songs so it knows what one to play next and when to repeat from the beginning
Probably something like this:
TAG_musicTracks = ["music1", "music2", "music3", "music4"];
addMusicEventHandler ["MusicStop", {
params ["_musicClass"];
// If its the last song, repeat from the beginning
if (_musicClass == (TAG_musicTracks select -1)) exitWith {
playMusic (TAG_musicTracks select 0);
};
// Play next song in sequence
private _index = TAG_musicTracks find _musicClass;
playMusic (TAG_musicTracks select (_index + 1));
}];
Yes, but sorry I'm in the middle of the work day so I'm spotty back and forth. I'd be glad to share my code privately to provide the full context that snippet is used in
It'll send the whole thing. If you want to do partial network updates then there's still the old logic object + setVariable hashmap method.
you mean just using a "logic" object's var namespace? I'm current using a struct system (using a hash) within a object's var namespace and broadcasting that struct.
private _siloData = _silo getVariable ["CarrierStrike_SiloData", +CarrierStrike_Structs_SiloData];
// modify stuff in the struct
_silo setVariable ["CarrierStrike_SiloData", _siloData, true];
This probably sends the whole thing if I do it this way won't it.
The whole of whatever _siloData is, yes.
boogers. i like the organization provided by just setting up a hashmap for the data when managing a lot of it rather than the object's var namespace.
i'll just send the data to change to the client's local hash and let it handle it locally then
They were saying to essentially use the object as the hashmap itself, which was what CBA_fnc_createNamespace does too, since it was made before native hashmaps
Hi all, I'm hoping to get some advice on how to proceed with a script I'm using. Following Sneaky Kitty Game Dev's guide on making a music radio, here (https://youtu.be/ql3Mb0Cnetk?si=r1-PY07OxYPrzjSY&t=1115) they mention how you can delete an audio track from the array in order to prevent them from playing back-to-back. Then, when the array is empty, you can fill the array again with the same audio tracks. Here is my script so far (it is otherwise functional):
_songList = selectRandom [["songA", 535], ["songB", 284], ["songC", 118], ["songD", 161], ["songF", 152], ["songG", 420], ["songH", 193], ["songI", 151]];
_song = (_songList select 0);
_songLength = (_songList select 1);
[radio, [_song, 100, 1]] remoteExec ["say3D"];
radio remoteExec ["removeAllActions"];
[radio, ["Turn Off Radio",
{
_pos = getPosATL (_this select 0);
_dir = getDir (_this select 0);
deleteVehicle (_this select 0);
radio = "Land_FMradio_F" createVehicle [0, 0, 0];
radio setPosATL [_pos select 0, _pos select 1, _pos select 2];
radio setDir _dir;
radioH remoteExec ["terminate"];
[radio, ["Play Radio", {radioH = [] execVM "playRadio.sqf"}]] remoteExec ["addAction"];
}, [], 6, false, true, "", "_target distance _this < 2"]] remoteExec ["addAction"];
_waitTime = time + _songLength;
waitUntil{time >= _waitTime};
radio remoteExec ["removeAllActions"];
radioH = [] execVM "playRadio.sqf";```
tldr: How can I use **deleteAt**, **find**, **count**, etc. commands for my purpose?
This video will be improved again, first we just got it working in video 18, now we have it running smoothly on all clients so they have the ability to toggle it on and off without problems. However it is running on the clients and that is not what we want to happen, we are going to make it all run on the server so were not wasting any resources...
barebones example working with multi dimension arrays and deleteAt
private _array = [["song1", 10], ["song2", 20], ["song3", 30]];
private _songnames = _array apply {_x#0}; // ["song1", "song2", "song3"]
private _index = _songnames find "song2"; // -------------^ found at index 1
if (_index != -1) then {
_array deleteAt _index; // deletes ["song2, 20] from the first array
};
Thank you so much! I appreciate you pointing me in the right direction โบ๏ธ
@granite sky Hay John Jordan you helped me make my Chopper command better after we texted the other day thx alot m8 you gave me some cool ideas about how to moveOut or eject players and Ai so it does not effect the chopper Woohoo thx m8
now my chopper command works even better woohoo
even over water insertion
What do people think is the best way to check if a player has stepped on a custom trap? I want it to execute some code if a player is on top of an object, like a mine i suppose. Obviously i could do a check for nearby players every second (or faster), but is there a better way? createTrigger maybe could work?
Trigger's just going to be doing the same thing, loop checking X condition
Yep imo a trigger is definitely the way to go. Although you could just keep checking the condition within an already scheduled script, there would be a lot of nicer benefits you would get out of using a trigger. For example:
- With
setTriggerAreayou could make this small so it only checks when they are nearby the trap. - With
setTriggerIntervalyou could reduce the interval to every second or faster as you were wanting.
Don't quote me but pretty sure you could even used thisTrigger within the setTriggerStatements to automatically delete the trigger upon your traps activation too ๐
With setTriggerArea you could make this small so it only checks when they are nearby the trap.
Same thing as just getting objects within the same distance
With setTriggerInterval you could reduce the interval to every second or faster as you were wanting.
Not any different than making a delay yourself
Don't quote me but pretty sure you could even used thisTrigger within the setTriggerStatements to automatically delete the trigger upon your traps activation too
Just stop when the trap is triggered
I could be wrong, but I vaguely remember a trigger running slower than just something like a pfh checking the same stuff
I don't use them too often in our mission but I think how situational they are just kinda depends on the mission.
In the mission that I work on we have taken a lot of steps to ensure that we are being conscious of network and performance. If I remember correctly the objects created with createTrigger are global and added to the JIP queue so we tend to steer away from them. Running those conditions within an already scheduled script would likely be more performant, although I imagine that also depends on what the task is.
I think in SP missions or scenarios where optimization isn't as much of a concern, there is a lot of really convenient usages you can get out of them. Also will keep a lot of those scheduled scripts cleaner and you won't be reinventing the wheel so much.
@manic kettle dropping your @ since I expanded and added some additional information 
You don't have to run that code scheduled, you can very easily run it unscheduled
True. I was more just referring to it in the context of suspension as he would likely need some sort of loop to check the condition.
You can unscheduled delays, most commonly with cba functions
Interesting- I didn't know that. Hasn't ever really been any cases where I've needed to use it. I see they have a function CBA_fnc_waitAndExecute. If you don't mind me asking, what are the use cases for a function like this? Does it not spawn a new script allowing _this to remain in scope?
https://cbateam.github.io/CBA_A3/docs/files/common/fnc_waitAndExecute-sqf.html
waitandExecute works well for situations where you wait some time and run the code once.
If you need to run the code every x seconds, the CBA perFrameHandler works best
https://cbateam.github.io/CBA_A3/docs/files/common/fnc_addPerFrameHandler-sqf.html
you can pass arguments through them
Ah cheers thanks ๐
They exist to run code in an unscheduled environment and still be able to use delays
Using scheduled code has a lot of negative performance impact, so large mods like CBA and ACE use unscheduled code
Especially since mission makers like to fill the scheduler
It's not really for the performance impact.
More for replicability. Unscheduled functions aren't gonna get interrupted halfway with some other code that might touch the same data.
I can't launch arma atm to test, but does anyone know the locality for the arguments on getPlayerUID? The wiki doesn't specify
So I just have the same issue right now. Sync works as documented, grouping doesn't.
Okay so I'm not going crazy
Thank you for checking
lol
because its "groupTo" instead of "Group" @crimson lion
ffs
https://community.bistudio.com/wiki/add3DENConnection I added a note here
You're welcome.
Well, it actually seems to only be doing the cursor effect when dragging the groups, similar to when I tried 3DENConnectGroup instead of Group
The units are not actually grouped into one
You are right. It says missing config.
For some reason, GroupTo is now no longer being recognized as well for me
At this point I'd say it's broken. Maybe dedmen can have a look when he has time.
Are you on profiling btw? I am on profiling when I tested this
I am
I'll revert to normal and test too just to double check
No luck on normal branch either so indeed this seems to be broken
It seems that get3DENConnections is also broken for grouping
Is _group create3DENEntity [...] not suitable for your use?
No for my use case
Doesn't work in my case either
need repro I don't know editor scripting
Does anyone know how I can handle the opening of the UAV terminal?
This way don't work
params ["_activated"];
systemChat "123"
}];```
Via infinite loop with isNull display 160 is very bad i think
I made a ticket with instructions. See #arma3_feedback_tracker . If you need I can add a demo mission.
where did you find UAVTerminalOpen? i think it should be from https://community.bistudio.com/wiki/inputAction/actions uavView or uavViewToggle
It isn't those. Those are for opening the UAV camera side panel, not the UAV terminal.
ok the addUserActionEventHandler wiki page seems to have wrong link
UserAction EHs don't detect those; they're for inputActions.
There may not be an EH specifically for the UAV terminal. Possibly you could try a scripted EH for "OnDisplayRegistered" to detect when the UAV terminal display opens.
No, it's correct.
k
Can u please explain
Know nothing about this EH
https://community.bistudio.com/wiki/Arma_3:_Scripted_Event_Handlers
BIS_fnc_initDisplay is used to load BI displays. It calls the OnDisplayRegistered scripted EH when it does that. The UAV terminal is a BI display, so it should, in theory, cause that scripted EH to be called. You can attempt to use that EH to detect when the UI terminal display is opened.
Thanks
why dosent this work: this attachTo [natohunter, [1,1,1]];
that in the init field?
yeah
natohunter defined?
i wanna add a flag to the hunter
yes
hmm
make sure natohunter is vehicle and not group for example
wdym
groups got init fields too. make sure its in right init field
i spawned in the vehicle by itself
How can i check what given display is terminal display?
That code don't work
if (_display == (findDisplay 160)) then {
};
if you spawned it later then thats why the flag failed to attach at start
wdym later
init field runs at mission start, you created the vehicle after that?
can you post the natohunter creating code?
i jsut reset my game and went in a fresh editor
im spawnign the object and hunter at the same time
I don't quite understand your question. Do you want to check whether the given display is open or?
how
New display is display 160
so whats your full code like ?
this attachTo [natohunter, [1,1,1]];
just this on the object
and then the hunter is named natohunter
you placed natohunter in the editor?
yes
Found solution. So class of terminal display is
if (_class == "RscDisplayAVTerminal") then {
};
ok then it should work
It's not clear to me what you mean by "new display". If you wish to check whether or not the UAV Terminal is open you can run
!(isNull (findDisplay 160))
They don't want to check whether it's open, they want to detect the moment it is opened, using an event handler.
and when you start the mission the flag doesnt attach?
Helps to read the whole conversation.
it dosent even show
Im add scripted EH for terminal display
[missionNamespace, "OnDisplayRegistered", {
params ["_display", "_class"];
if (_class == "RscDisplayAVTerminal") then { // Check what given display is Terminal display
// code here
};
}] call BIS_fnc_addScriptedEventHandler;
i followed this totorial exactly https://www.youtube.com/watch?v=3ZDTVl1lXbo
use code line: this attachTo [offroad,[0,-2,0]];
If there are any specific aspects of public zeus you would like to see a tutorial on then feel free to place a comments and I'll see what I can do!
#Arma3 #Arma3PublicZeus #Arma3ScriptingTutorials
the flag could be inside the vehicle
ok
I did, thanks a lot. However, you already answered the question you referred to. The question I replied to was a subsequent issue.
can you give screenshot of the flag's init field?
yes
Actually it was a continuation of the same issue: they were trying to check, inside the scripted EH previously discussed, which display it had fired for. Not simply "is the UAV terminal display currently open", but "did this EH fire because the UAV terminal display was opened".
im out of ideas, maybe flags cant be attached
i tried mortar to
hmm
Works for me. [1,1,1] isn't the most ideal offset to use, but it's clearly attached.
Yeah, 1,1,1 might not be easily visible.
Oh, it's clearly visible. Might impede your vision of the road ahead, though
ill try 5 0 0
even tho i alr did try it before
it is
I said at that moment (when the init runs)
im testing it in the scenario
eden objects are created one by one
I've never had any problems with Editor object inits failing to reference other Editor objects ๐ค
Generally I don't quite understand why you're passive aggressively stating that reading the whole discussion is helpful. Like no shit sherlock. I did read the entire chat, it just wasn't immediately obvious what he wanted to achieve with the code he posted. Especially since you had already given him the solution to his original question and because the check statement made no sense, which is why I asked him what he wanted to do.
I gave him the answer to what I assumed he wanted to do, before he fully replied.
Given how many people write stuff this way, I would guess that objects are all created and variables assigned before any init runs. But the behaviour isn't documented.
(and I could never be bothered to test it personally)
i tested it in a public zeus
still dont show
In case you do want to check via the IDD, you can use ctrlIDD on _display and check whether it's 160.
One more question. How can i handle mine or explosives placed by player?
If you couldn't reliably reference Editor objects in each others' inits, I think a lot of things would be a lot more broken than they are
I have CBA, but this way looks wrong because i can't check players actions
["TimeBombCore", "init", {
systemChat "1"
}] call CBA_fnc_addClassEventHandler;
What are you trying to handle and when are you trying to handle it?
And thats not compatible with ace
For vanilla mine placement, you could use a FiredMan EH to detect the "Put" weapon. But ACE is a whole different animal, I don't even know how they do it.
Yeah that was my reasoning. Also I just tested vehicle + unit + banner and they all existed in each other's init.
I need to link the player's action of planting a mine to the explosive object itself
As stated above, you can detect the action of placing a mine, explosive etc. with Fired or FiredMan (FiredMan being more appopriate). However, this only really works in the confines of the vanilla action menu.
Also works in MP but I'm not gonna test DS/client.
Okay, it looks like ACE triggers the ace_explosives_place and ace_explosives_setup scripted EHs when the explosive is armed/placed. https://ace3.acemod.org/wiki/framework/events-framework#28-explosives-ace_explosives
(I think the descriptions of those two might be backwards on that page)
Actually, CBA EHs, not regular scripted
Yeah, we use ace_explosives_place and I'm fairly sure that works.
There is also ace_throwableThrown for their special grenade throwing. Not sure if relevant.
Thanks
anyone know how i can add a russian flag on the shoulder patch
Save load out
Also that's #arma3_config, not scripting
i make a new patch in the files?
Yes, you make a mod that adds the patch
im using it on publiz zeus tho
You can't then
You can set a texture on the insignia part, but you wouldn't be able to add the texture file
how can i set the texture on the insiginia to a russian flag
the vanilla russian flag
Sorry, I've been trying to code a way for objects and units to disappear when a player isn't looking at them, but it doesn't seem to work. Has anyone been able to achieve something similar?
_someUnit setObjectTextureGlobal ["insignia", "\path\to\texture.paa"]
Yeah, sadly don't have the code anymore though
:'c
Forgot to push stuff when I reinstalled windows :p
says invalid number in experssion
_someUnit setObjectTextureGlobal ["insignia", "\A3\Data_F_Enoch\Flags\flag_rus_co.paa"]
invalid number in experssion
wait this worked this setObjectTextureGlobal ["insignia", "\A3\Data_F_Enoch\Flags\flag_rus_co.paa"]
@tulip ridge ty
One question: Does anyone know how to add OPEX to a new map?
I'm trying to integrate OPEX into the Archipelago map, placing markers, buildings, and everything else, but it doesn't seem to be working. I also created a file with the map name and placed it in the game folder where all the maps go. But I still can't get any missions or AI to appear.
(DATA-UPLOAD is blocked)
โ ๏ธ Subject: Help with global initialization of my extended NVG script (similar to EZM/EP module โ incl. menu attempt)
Hello, I'm currently scripting an extended NVG module for Arma 3 โ similar to EZM or EP, but purely script-based, without dependencies on CBA/ACE.
The script works locally via a helipad object (init field), activates 3/4-6 switchable night vision modes via the "N" key, runs in a loop with ppEffects, includes safeguards against invalid states (e.g., VisionModeChanged, respawn), and regularly outputs system messages to confirm activity.
(- Normal โ Blue โ Thermal โ Normal โ Green โ Thermal โ Normal)
Working version (Helipad Init โ Global via Debug Console):
[believe this is the correct one (I've made too many files/prototypes by now)] TXT FILE 1:
โผ๏ธ Problems:
The script only runs locally on the player who placed the object.
Joining players do not receive the script โ even using missionNamespace or publicVariable has no effect.
Testing with remoteExec in the debug console (e.g., global execution) results in getting kicked by BattleEye with errors like:
remoteExec restriction #(random)
or Script restriction #/
A global solution via a menu should be implemented through a UI like in Simple Spot System or Crubโs Competitions.
The attempt using the Steam Workshop code under this link: https://steamcommunity.com/sharedfiles/filedetails/?id=3472082945 failed.
The attempt included the following script with UI menu (ENABLE / DISABLE):
[TXT DOCUMENT 2]:
Even with this menu attempt, the script could not be activated globally.
It responds locally, but not for JIP players
The server seems to ignore the global variables or they donโt get through
Despite using missionNamespace with setVariable [..., true], thereโs no effect for new players
I need help.๐๐ป -Contact me
FinalBiologic โค๏ธ
Hello guys, i got a short question.
What happens if i iterate over a group and do something like this:
blueUnit3 = (units grpPlayers) select _y;
But because units of the group suddenly die _y is now out of bound.
I assume i would get an error and the script stops doesn't it? So i guess you should always befor itterating save all the units in an new array first and iterate over that one instead?
Hey y'all I've been trying to make my own fixes for ITC air weapon systems. I'm having a problem though. In vanilla ITC night vision with the TGP or Mavrik Pip open causes screen overaly glitching. However, in the dev branch this is not the case. Anyone know the code in the dev branch that is stopping this glitch or how to fix it in vanilla ITC?
Less risky with forEach.
This sort of thing is an argument in favour of doing everything in unscheduled though.
no. when you call units grp the array gets copied to memory, and as you iterate, even if one of the units die, you just get a null (objNull) which is safe to work with
(it doesn't cause errors but the results are "defaults", e.g getPosWorld _x will give [0,0,0])
seems global
:c
someone?
do you have a github with it? we can just fix it for you
can't help if we don't see the code
I have an account, but I no longer have my login information. But if you say so, I'll take care of it right away. What exactly should I do once I'm logged in?
you just upload it to a repository
do a quick review of how github works first
you have no code on that repository
you just have an issue page
What? I have
did you do a commit?
The massage is to long for another theme
even though I can just go through and look at it, this is important for you to learn git if you want to get further into the code world
its currently empty. go watch some short youtube videos on how github works
you can use GitHub Desktop if you don't want to mess with the command line
I'll do better next time. At least you can read it and copy it out.
Its by issue
(1)
For Code the Code was to long
Character limit
are you intending on adding these event handlers every frame? I see no removals of them, so they are going to stack infinitely
well i guess you have an init check
pull those out of the frame handler and put them somewhere else
Normally, I had a protection inside the script to prevent duplication. I now have over 140 versions of the script and can barely tell them apart. The script has been limited to its core functions.
You have three versions there. 1. Global init for debug console in public zeus. 2. Enable menu by placing a helipad with the included init. 3. Helipad placement enables and disables the script (1=debugcon/2=nenu after placing/3=placing is activated).
what you are doing is not going to be fun for the network on a public zeus. idealy, you would have this written as a function on every machine, then you as the zues, would remote tell every client to run that function that exists on their machine. Since its public zeus, you cannot define the function on everyones machine ahead of time. So now you are forced to remote send the entire code as a string which is going to nuke everyone's connection for a couple of seconds. if you go the route of remoteExec each command, now you just bogged down the network with EachFrame sends.
I don't use EZM, but I bet they are not handing the UI (what you are trying to do) on the clients. All of their scripts probably use the zeus as the makeshift "server". You want to handle the UI locally on the client, especially when you are doing EachFrame stuff. Your option as I see it now, is to wrap all of this code up, then [myCodeInVariable] remoteExec ["call", 0];. Players might notice a lag spike though until its all sent.
The menu (only in version 2, which I would prefer) is only visible to Zeus, and only he can enable or disable the script after placing it. Later, once that's working, I'll add a function that allows players to disable the manual for themselves after activation via a #chat command or key combination.
The script can be disabled during training by pressing L-Alt+Esc, Esc+L-Alt. (arma once into screen mode and back to full screen)
Whatever you decide to do, you still should handle the PPEffects on the client, meaning you have to get the code to the client in the first place since zeus placed object inits only fire local to the zeus.
(what i want to do)
I just hope my English is good enough to understand this correctly. I'm supposed to apply these effects locally to each player, but how are new players supposed to automatically activate the script?
i have to get to bed but I'll readdress this tomorrow
Same bro ๐ค๐ป Thanks 1st
Dont know if it this thread or editor...
I have a few scripts that makes so I can call for: reinforcements, mortar, LMG, medic supplies etc.
Is it possible to create a object that has all these scripts? instead of having them in the scroll wheel menu as I have now
an object so I can walk to it and activate the scriptrs
this is how its set up for now
well triggers can do that m8
like i walk in to a trigger and it spawns in 7 soldiers on my team
but then you must mark the trigger so you can see where it is on the map
or just you can know where the trigger is
is that what you were thinking ? @gleaming onyx
i like the way you have it set up now,,,,,,,
Hmm, a trigger should work, the problem is that I'm not sure if I can move a trigger when playing the mission?
Im looking for a solution to have a "movable" FOB that I can move depending on how the frontline is. Cause if I somehow connect the scripts to a object, I'll be able to move take it with me in game
yes you can move a trigger any time you want to
you just must make sure it size is high enough and wide enough to fit all positions like up a side hill and stuff
hmm, more of a truck I think
What do you mean by "create a object that has all these scripts" in this context?
i think he or she means addaction
haha, pretty hard to explain but here we go
I have a few scripts that I active through the mouse wheel menu, the thing Im looking for now is to have that function (ability to call for reinforcements for example) on a radio. so when I'm standing nearr this radio, I have all the options from my mouse wheel menu (picture)
So stay within N meters of the radio instead of looking at the radio?
i think all he or she needs is a Mobile Respawn truck with 3 addactions in the init of the truck
to activate the scripts
im guessing
but i dont know unless he or she says something else
both ways can work, dont know whats easiest to fix. so either look at the radio and stand near it or use mouse wheel menu
i like the mouse wheel way myself
but i also have Mobile Respawn trucks and choppers
What I don't get is what is your current blocker, I assume your current script is lacking something but it really seemed what you want to achieve is already done in the pic?
Haha, scratch that, it's hard to explain ๐
i think i get you m8, i would just make a Mobile Respawn truck with 3 addactions in the init of the truck
so you can drive the truck in to any loaction and activate the scripts from the truck
then you would have to set up the respawn of the truck to get the addactions back also witch can be done though respawn modual
Yes, correct! Cause for now I have 5 or 6 scripts in my actions menu and I can't choose the right one when stressed out to it's always fuckup. So if I have all those action menu options on a truck, my action menu is more cleaner when I play
So the issue is having a lot of options in Action Menu?
Correct. And to make it more clean I want them only to be visual from a truck/radio/box or something
So the goal is apply less actions into an object, and have more objects to activate a script, so your mosue wheel less likely to confuse which to choose?
he or she wants to remove most of the mouse wheel Action Menu and move them to a truck/radio/box or something
imho
Not necessarily, this is how I think and I apologize for the poor explanation, English is not my native language
Currently my action menu looks like this:
-Heal yourself
- Get out
- Engine off
-Call for reinforcements - Call for ammo box
- Call for medic supplies
- Call for Mortar
For example.
What I want is that these are NOT tied to a player but you have to go to a radio (for example) to use them
- Call for reinforcements
- Call for ammo box
- Call for medic supplies
- Call for Mortar
And how is your current script?
It is. Remove the second and third chunk of the code so it will run one addAction. The first addAction should go to an object (radio?) instead of player
Okok, will test, thanks!
Im trying to add our counter-artillery script to our mod for convienice but I have a problem:
// this addeventhandler ["fired",
{
[_this select 0,
_this select 5,
100,
selectRandom [3,4,5],
true,
[enemyAri_1,enemyAri_2,enemyAri_3,enemyAri_4],[],0] remoteExec ["Redd_fnc_AriCounterFire",2]
}
];
in the past we used this eventhandler in the friendly artillerys init, with static variables for the enemy artillery pieces. Im looking for a better way for missionsmakers with less scripting experience.
can i (and if so how) have a module that assigns the eventhandler to my own artillery and a second module that gathers the enemy artillery?
im thinking of something like
statement = {pusback missionnamespace friendlyartillerylist } foreach [syncedbject]
Would that work?
Not sure what really you want to "assign" in this context. Do you want to assign eventhandlers to more objects or?
2 things
friendly artillery need to be assigend the eventhandler above
inside that eventhandler i need to list the enemy artillery
- Use forEach
- Store enemy arties into an array and use it in the EH
i think you could use something like this: ```sqf
{
// do something with the friendly arty (_x) here
} foreach (synchronizedObjects friendlyArties);
game logic is better option imo, assuming it can have synchronized objects
Ja, that would be "script free setup"
?
for eden editor.
is there is any way i can view markers that has no markerclass ?
im not sure what you mean no marker class
do you mean like view the marker from the briefing ?
you can see all markers in the eden editor. after you place them down on the map
there are some markers in cfgmarkers that are not displayed in arma 3 eden editor
the one that are not displayed has no markerclass
"no markerclass" does mean the marker does not even exist so you cannot see, place, anything. So what you say is not possible to say. If you're just trying to place a hidden marker, yes. Use create3DENEntity
agree
any marker that is placeable has a class in CfgMarkers. It's just that some markers are of scope = 0 and are not visible in Eden Editor or Zeus. You can still create them with create3DENEntity
like witch marker is not viewable is there a name of this maker or markers ?
oh i see ok thx m8
ahh ok yes got ya
man i was woundering big time lol
so basicly you are creating a marker Entity
so that would mean this marker is alive em i right
No, a marker cannot be alive
oh ok good shoooo lol
your eden editor made it easier for me
thanks
is there any All-in-one_Config up to date file online like on a webpage to download?
i dont want to download dev branch to get arma3diag_x64.exe
There has been one on the forums but we all know what happend to the forums
If you want to config dump, you can do that on non diag. Ofc config dump script is also on forums...
If you see it on an object you can check the textures on that object.
i only see it on a tank
dosent say the texcture
Set variable name for the tank and run getObjectTextures tank
where is the console
thanks
@cosmic lichen - Since you mentioned it above... - ...what DID happen to the forums, why are they still down?!? Do we ever get them back or are they now lost?
it's in cleanup mode, there is no ETA, and they are of course planned to come back
you can use web archive
I see - but that has been going on for quite a long time, so one keeps wondering (also it would be such a shame if all the info on the forums would be lost to us)
yeah, been using web archive as well (a bit tedious but better than nothing and of course coming here and pestering you guys with questions ;) )
Is it possible to set shot parents for a particle effect such as fire
they're not shots so no
if you create an explosive that uses that particle effect maybe
I wonder if you or @warm hedge knows but the SynchronizedObjects command from my testing only works on vehicles that have AI in. If you remove the AI and use that function on the vehicle it will say nothing is linked when it is :/
seems to be the case, see comments: https://community.bistudio.com/wiki/synchronizedObjects
Yeah, with the exception in arma it will return the vehicle when there is AI in it, not the vehicle commander. Unlike the first comment that must be for A2 or another arma game
there is nothing linked
3den links are not the same as synchronizedObjects
I used this for an Iron Dome system in working in to create your own linked networks of radars, Battle management control stations and launchers. As well as an in-game UI that lets you manage the network and link them there too.
Huh? Ok is there a command to return the 3den links? As that would work better for what I'm building I think than synchronizedObjects
get3denConnections
only works in 3den afaik
Amazing I'm glad I asked! I'll change my code over and that will work much better.
That's what they want us to believe.๐
Ah dam. Then it might not work, I'm getting the linked connections on the init EH of the object. It's added in the mod
Not sure if it will return it on init, I'd guess not as that's game start?
well synchronizedObjects only works with triggers and AI (logics too because they have AI)
idk, try it
Ofcourse will do just wasn't sure if you knew before. I'm on my phone ATM I'll test later thanks for the info on that command.
Makes sense. Thanks
Looking for a script for "hacking" something like an enemy radar or a computer that controls it. Have a very rudimentary one that is just stand close and wait for x amount of time but wanted to see if anyone has something more interactive that they are willing to share. Appreciate any help out there
Hey guys, im working on a script for my thesis, but i am encountering some issues in the way the bounding box is being calculated/displayed on screen. Since i dont really have experience im not sure what the issue is and i am somewhat running low on time.
So if some of you have dealt with that topic before, i would greatly appreciate any help. Feel free to dm me if that makes it easier, else i will check here for responses ๐
I am currently working off of a github I found, but no worky, not giving me any action on the laptop
https://github.com/Poslovitch/HackEX/tree/0.0.4
Try to describe in more detail
Hi, sorry for the inconvenience. Does anyone have a script I can use to improve performance? We have a base, but something's going wrong with it. I don't know if there's anything that can hide the AI โโand map objects when you can't see them. I tried doing something like that with Chatgpt, but it didn't work. :c
Use less objects to start. If you just hide them, they still exist. You'd have to save everything about the object, delete it, then recreate it when you want.
i went to look at this again and its just not readable how you did it. you gotta upload this the right way into github. or just paste the whole thing on pastebin
what is so hevy on this
you have areas of code that are not even in a code block, so copy paste is a pain
I try to figure it out..
i will do it tomorro (today at 18/19:00) need to sleep rn a little.
what was the command that you put in the init of like the naval turrets to make them opfor?
you can just place a opfor unit, then take the crew of the turret and drag them into the opfor units group. then delete the opfor unit.
otherwise, you can do:
if (local this) then {
crew this joinSilent group opforUnitHere
};
or
if (local this) then {
private _group = createGroup [east, true];
crew this joinSilent _group;
};
sweet! ty!
@digital hollow so when the bounding box is being drawn the box is not aligning at all with the Position on the vehicle on Screen. Sometimes its like 10 Meters off. Im running a vehicle spawning Script to Generate Synthetic images and my .rpt file gives me the coordinates of the box but it just doesn't match. You want the script snippet to have a look?
Tried asking for help on fiverr, but everyone seems to be a scammer, so im trying here
You can use this to get the points of the bounding box and then spawn objects at those points and after that just display bounding box https://community.bistudio.com/wiki/boundingBoxReal note bounding box is diffrent for each objects it all depends how is it configured.
I have a script that should make the days far more longer than the nights, but it feels like its going super duper fast...
Have I done something wrong in the script?`
[] spawn {
while {true} do {
_hour = daytime;
if (_hour >= 21 || _hour < 3) then {
setTimeMultiplier 180;
} else {
setTimeMultiplier 40
};
sleep 5;
};
};
Adjust 180 and 40 to desired number
i am already using boundingboxreal but its still not giving the right coordinates. you reckon i could send you the part that deals with it and you have a look? i can compensate you, or anyone else if interested.
Hard to say anything without the script. Using BB real with the correct geometry should give accurate results.
this is the full thing
its probably not very elegant because most is with Chatgpt as i h ave no clue. i would greatly appreciate any help
Can you post a pastebin i am on a phone right now and cant download/ open that file.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
thats one example of what happens
Is that a horizontal or vertical offset? I can't tell from the picture.
If it's vertical then it could be an ATL/ASL mismatch issue.
i have tried both asl and atl before, the bounding box still wasnt accurate
Also don't use ChatGPT (in general, but particularly for SQF). It will absolutely make up complete garbage. It does not have an actual understanding of functional code, it just tries to come up with something that "looks real" - and SQF is a particularly niche language with a relative shortage of examples of good code.
it was able to do everything else quite good, but i agree otherwise. its just that i need to get it done for my thesis and this is the last issue im having, the rest works as its supposed to
semi-advanced autocomplete strikes again eh
fnc_getModelCenterTarget
getPosWorldalready does that
_centerModel = [
((_min select 0) + (_max select 0)) / 2,
((_min select 1) + (_max select 1)) / 2,
((_min select 2) + (_max select 2)) / 2
];
we have vector commands. use those instead:
(_min vectorAdd _max) vectorMulitply 0.5
_vehicleType createVehicle _spawnPos
- spawnPos is ASL. createVehicle needs AGL
- createVehicle is unreliable and you must always use setPosXXX after it anyway
ah you used chat gpt. well then goodbye
Ye I know, I said that I cant do it alone. Which is why I am asking for help to fix it
I have a bit of a dilemma here. I wanna check if the cursor is inside the bounding box of the nearest object in Eden Editor.
I can do that fine as long as it's close to the surface ASL or AGL but if the nearest building is floating (ASL Z=20) I cannot properly do that as I don't have a Z height of the cursor.
So either I just ignore the cases where a building is floating or I use the Z height of the closest building and assume that is my cursor height. It works but doesn't look right.
Any other ideas?
Actually, I think I rubber ducked my self out of that lol.
It only looks weird if the building is floating but looks fine for all other cases. So I guess I'll roll with it as floating building should be rare anyway.
you can use positionCameraToWorld to get the cam pos and screenToWorldDirection getMousePosition to get the vector from camera to where the mouse points
after that you can just intersect the line with the bounding box
if you need help with it let me know
But that would only tell me if the bounding box is between camera and mouse, no?
well it tells you if the mouse is inside the bounding box
but it doesn't consider other objects (i.e blocked and not in view)
That doesn't matter
I think eden editor even intersects it with model geometry.
Let me implement hat and check the results.
Now I wonder why we don't have an intersect variant that checks if a ray passes through an area.
here's the bb intersection in case you need it:
private _dir = screenToWorldDirection getMousePosition;
private _p1 = positionCameraToWorld [0,0,0];
private _obj = get3denSelected "Object" select 0;
pp = [AGLToASL _p1, AGLToASL _p1 vectorAdd (_dir vectorMultiply 100)];
_p1 = _obj worldToModel _p1;
_dir = _obj vectorWorldToModel _dir;
call
{
scopeName "Inter";
// you can also use geometry BB which is more accurate
boundingBoxReal _obj params ["_min", "_max"];
private _tmin = 0;
private _tmax = 1e9;
private _entry =
{
params ["_t"];
if (_t > _tmin) then
{
if (_t > _tmax) then
{
false breakOut "Inter";
};
_tmin = _t;
};
};
private _exit =
{
params ["_t"];
if (_t < _tmax) then
{
if (_t < _tmin) then
{
false breakOut "Inter";
};
_tmax = _t;
};
};
_max = _max vectorDiff _p1;
_min = _min vectorDiff _p1;
{
private _d = _dir#_x;
if (abs(_d) > 1e-6) then
{
private _t1 = _min#_x / _d;
private _t2 = _max#_x / _d;
if (_d > 0) then // positive on max negative on min
{
_t1 call _entry;
_t2 call _exit;
}
else // negative on max positive on min
{
_t2 call _entry;
_t1 call _exit;
};
};
} forEach [0, 1, 2];
true;
};
didn't test it but it should work ๐ค
And here I am already asking myself if I am too stupid to draw a line from point1 to point2
Sqf can be an ass sometimes.
"sometimes"
@cosmic lichen btw that script had a bug which I just fixed (+ some cleanup)
it's not incompatible ๐ *runs away*
expectedDataTypes: Array of direct Data Types - (Optional) checks if passed value is one of listed Data Types. If not, default value is used instead. Empty array [] means every data type is accepted.
this line is lying, right? if i put Boolean as expected data type its not working, if i put true its working same thing with Numbers,
Show what you're using, it's worked perfectly fine for me
params [
"_ownArty",
"_magazine",
"_enemyArtyArray",
["_radius", 100, ["NUMBER"]],
["_rounds", (selectRandom [3,4,5]), ["NUMBER"]],
["_decrementRadius", true, ["BOOLEAN"]],
["_counterTime", 0, ["NUMBER"]],
["_enemyArtyRadarArray", [], ["ARRAY"]]
];
the examples also dont do data types. see example 5 here https://community.bistudio.com/wiki/params
wiki gone crazy
You put a literal value there
E.g. params [["_someVar", 0, [0]] only accepts numbers
yep
?
Example 5 is fine there
Array of direct Data Types
sounds like it need a thing fron the linked wiki page
you do not type the data type in string, you provide any data of the wanted type
Can also just scroll down and look at the examples though
e.g ["_someVar", _defValue, [0, ""]] accepts numbers and strings
but description and example should match, imho.
anyway now i know
Array of direct Data Types
does not mean "array of strings" ^^
but I will see if I can make it more understandable
wiki back again
it got buggy (unreadable)
I think I did similar mistake the first time. I was expecting that keywords should be used like bool rather than any value of datatype. When you want to do stuff with datatype and not it's values
Bit of weird thing in SQF
yea wish we could just type [boolean,scalar, etc]
#define boolean false :p
I might have done same mistake with both params and isEqualType commands ๐
that would actually be useable if it didnt require including those defines to every file ๐
just have a script_component.hpp and include it there
or boolean = true; then its global
That's good tip. I might do datatypes file and include that in every future script ๐
now if we just had final command for variables (other than code final) ๐
@grizzled cliff Would it be possible to make a kind of player tags with intercept? Meaning the dll is creating a thread and doing all that stuff directly in the background?
How do you make AI with RPG move to target and fire with line of sight, with script
i tried so much and he just doesnt move, get stuck, fires int oa tree kills himself, misses a lot
I just got arma three and I'm recrating some of my old arma 2 missions, things were going pretty well with my intel task and until i open arma the next day and it doesn't work.
Does anyone have a method of making intel missions/tasks that they prefer?
what did you have?
2 triggers - one normal and the other attached to a set task state with !alive varintel as it's expression and just a normal create task
the !alive varintel trigger was synced to the intel
something like this (define _dir, _ai, and _target yourself)
_ai setDir _dir;
_ai disableAI "ALL";
// run forward with launcher
_ai switchMove "amovpercmrunsraswlnrdf";
_ai playMoveNow "amovpercmrunsraswlnrdf";
_ai selectWeapon secondaryWeapon _ai;
_ai setVariable ["my_target", _target];
_ai addEventHandler ["FiredMan", {
private _ai = _this#0;
private _target = _ai getVariable ["my_target", objNull];
if (!isNull _target) then
{
// throw the projectile towards target
private _shot = _this#6;
private _speed = vectorMagnitude velocity _shot;
private _dir = getPosWorld _shot vectorFromTo aimPos _target;
_shot setVectorDirAndUp [_dir, vectorNormalized([_dir#1, _dir#0 * -1, 0] vectorCrossProduct _dir)];
_shot setVelocity (_dir vectorMultiply _speed);
};
_ai removeEventHandler ["FiredMan", _thisEventHandler];
}];
// wait for LOS
waitUntil {
sleep 1;
lineIntersectsSurfaces [eyePos _ai, aimPos _target, _ai, _target, true, 1, "VIEW", "FIRE"] isEqualTo [];
};
// stop
_ai switchMove ["amovpercmstpsraswlnrdnon", 0, 0];
isNil
{
// fire launcher
_ai selectWeapon secondaryWeapon _ai;
_ai forceWeaponFire [secondaryWeapon _ai, "single"];
};
_ai enableAI "ALL";
it doesn't account for drop tho. so it only works if the RPG shot is really fast
well using event handlers is faster and more reliable than triggers
you mean the task doesn't get completed?
what is the issue with it?
What's supposed to happen is that you're able to pick the intel up and the mission gets completed
ah. well you can use the Take event handler
this addEventHandler ["Take", {
params ["_unit", "_container", "_item"];
if (_item == "class of item") then {
["pvt_pickUpIntelTask", "SUCCEEDED"] call BIS_fnc_taskSetState
};
}];
use that in the player init (if it's a SP mission)
and rename "class of item" and "pvt_pickUpIntelTask" ofc
would it make sense for me to put it in the init for the intel if I wanted it to be a MP coop mission?
how do you init the intel?
what I just typed might be stupid nevermind on that
well in any case it depends on the locality. I'm not sure if the Take EH works on remote units
if it doesn't you'll have to remote execute it on all players by making a function
I'll give it a test
Thanks for the help, I really appreciate it
hay hi @pliant dagger
Is there a way to make a camera orthographic in Arma3?
Kinda want to make a silly mission that works like Worms (Side view, turn based, etc).
Wasn't sure which channel to ask this in, I assume the answer is no, sorry for the dumb Q.
Can do it with perspective (Far + low FOV) but it won't be "the same" :P
no
you can use GUI
the "worms" can be 3D gui models or 2D static ones
that's a really good idea haha
ty
not familiar with how that will work so a lot of learning (How physx & forces (gravity) affects UI models, if/how to get "world" objects in UI's collision working with them, rmt-ctrl & getting the "worms" to aim correctly...) but I'm in bc learning is fun :P.
(How physx & forces (gravity) affects UI models)
They don't, they're gui
you have to script physics yourself in that case
you can simplify collisions using simple shapes (e.g circle, rectangle, etc.)
if you're familiar with web dev you can use javascript too (in dev branch)
On the topic of silly missions. How is this even possible I wonder? https://steamcommunity.com/sharedfiles/filedetails/?id=1281184230
Look at the mission / mod and find out
o m g, this is amazing LOL. He got everything in that working very smooth. I know how you'd get most of the things working, but he must be insanely familiar with almost every arma limitation / methodology :P ...duke nukem / cmdr keen vibes! more duke bc of the lore focus ;P
Closest things I've done (missions not mods);
https://www.youtube.com/watch?v=WeVl64KWTps
https://www.youtube.com/watch?v=IAb0vEGc1yc
I haven't done a lot with remote control / custom camera while controlling a player, but that's probably easier as a mod than mission.
Made this last year but never used it for anything (as usual) lol.
include another SQF script
im trying to check if there's a fence (map fence) between path of 2 soldiers, which scritp can i use for this?
specifically to check for fence
Is it a specific type of fence? Or any fence
its this fence
i dont know what the name or class is and im not abel to make simple script for it
its a fence belonging to the inherent map objects
Its saying there's no walls or fence detected between the two soldiers
You can run the command
TypeOf cursorobject
While looking at it to figure out the classname. This works if it's just one type of object but if you want a robust solution to many fence types it'll need a more complex answer
i just need it towork for this fence, for some reason it just not detectable
its givign empty result
It's a terrain fence right? You didn't put it down?
Land_Mil_WiredFence_F
Yes
It only detects it if i look at specific parts of the fence
wtf this is impossible
It's not impossible, but it is difficult to work with map objects like this.
I'm not at my pc to test things. But one, albeit inefficient, method i can think of is using nearestterrain objects to get a list of all terrain objects near your 2 guys...then check every object...
{
if (_x isKindOf _classname) then {do stuff}
} foreach _objects
Hopefully someone can give you a better answer.
Stand right next to the fence and try this:
fence = nearestTerrainObjects [ player, ["FENCE"], 5, true, false ] #0;
Hi ! I have this script that create a unit. I set them to go to a point and load into a vehicle. The problem is that they just phase trought objects (classic arma) the problem is that it's map baked object, so It's not object without a path LOD. (+ it's arma 3 vanilla assets, so they shouldn't phase through them)
There is my code :
private _civCount = 10;
private _civType= "OPTRE_UEG_Civilian_Rural";
for [{_i = 0},{_i < _civCount} ,{_i = _i + 1}] do {
private _group = createGroup west;
_group createUnit [_civType,position civilSpawn,[], 0, "CAN_COLLIDE"];
_waypoint = _group addWaypoint [extractionVehicle, 0,-1];
_waypoint setWaypointType "LOAD";
//_waypoint setWaypointBehaviour "CARELESS";
sleep 10;
};
That's engine behaviour. If the AI can't go around an object it will go though it.
Hello, i want to make an unit do the 'scan horizon' command through code, how do i do that?
Isn't that just a unit slowly turning around?
Yup
Problem is thats really important for some units that are blind to anything happening outside their fov
Like radars for example
maybe something like https://community.bistudio.com/wiki/commandWatch or https://community.bistudio.com/wiki/lookAt
Does these commands work with Game Logic object? One could move the game logic object every couple of seconds and let the unit keep looking at it
Since I don't think there is command to turn unit slowly and doing it using setDir would be weird
Why the ships wont work with keyframes?
the commands take a position so yes it will work with game logic
If they take position then there is no need to use game logic. You can just give it position and change it little bit later
true
because of the way the game engine handles them
yes, many map objects don't have class names because they're already super simple objects
get all terrain objects by using [] for filter
then filter them manually using select and instead of typeOf use getModelInfo and compare the models with fence model (or if you have many, create a hashmap of the models you want and search in them)
you can do this instead:
- create another object e.g a plane
- animate it
- hide it
- attach the ship to the hidden obj
I was hoping it'd be automatic, what makes the Ai spin the radar like that?
Ig i can try to put an ai radar and steal the ai from that radar to put in mine
does ignoreTarget (Added in 2.18) is causing crashes? ๐ค
why?
did you get crashes when using the command? if so send the crash dumps to Dedmen
Using vanilla revive system, anyone know a way to script it so if a unit is downed/unconscious that the next hit will execute them? I tried doing this but it insta kills instead of downing them first
this addMPEventHandler ["MPHit", {
params ["_unit", "_causedBy", "_damage", "_instigator"];
if (incapacitatedState _unit == "UNCONSCIOUS" && side group _causedBy == west) then {
_unit setDamage 1;
};
}];
yes, do I send directly to him (dm)?
yeah
the command is in this script of mine
when you uncomment those lines does it crash?
if I uncomment those lines with ignoreTarget it crashes
Okay, thank you
btw does it crash when you do both forgetTarget and ignoreTarget together?
I use one or another, not both of them together
Does anyone know what code do the ai radars have to make them spin?
@fair drum https://pastebin.com/yg5HjEkW
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
your final iteration starts at line 103 right?
could anyone help me out? there are two things i cant figure out how to do, restrict my zeus slot so only certain players can get into it and i would like to limit the arsenal based on role selected in my missions
For zeus slot you can make a whitelist with steamUID, and check it in a script. If the UID doesn't match, end the mission for the client (it will return to the lobby). Maybe there is a easier way.
For arsenal based on role you can make it work with this:
https://github.com/PiG13BR/Arma-3/tree/main/ARSENAL_WHITELIST_ACE.VR
ACE or vanilla arsenal?
ace
how are you tracking what role was selected?
like you named the unit using the Variable Name in the unit attributes? Or are you using Role Description? or are you using the classname of the unit?
i just did the role description, no variable name
just know that roleDescription does not work in single player. if you are trying to make it compatible with both
i can add variable names if i need to
are you using the built in respawn menu at all?
ok, im making it for MP only. i just dont want people using the zues slot or taking stuff outside the role they select. ive gotten pretty far without scripting much as im not that knowlegable about it but it seems that i have hit a wall lol.
yes, select respawns with a timer
yeah. thats the uploadet steam version with the orange menu (Enable/Disable Menu)
whats NOT working:
- Switch massage for all players (green, blue, thermal,normal....), its not working for other players (just the enable masse, the 1/5min masse (hold n) and disable amssage work for all)
- the nightvision not working for all players (the filters and colour correction ...)
- not workign automaticly for rejoin players
(code from 103) @fair drum i activate the code for some time four u
so there are a few ways to grab what unit is being used in your current situation:
- Grabbing the string value of the UI that was selected in the respawn menu (hard)
- Using the
roleDescriptionstring (easy - doesn't work in SP) - Classname comparison
then once you have that, you'll need to have to init your box globally (init of the arsenal) and add NO items to it:
// init box of arsenal
[this, false] call ace_arsenal_fnc_initBox;
//-------^ no items
then, locally on the client, you'll have to add the items locally, so each machine sees a different set of items to add to the box:
// locally
[_box, ["item1", "item2", "item3"], false] call ace_arsenal_fnc_addVirtualItems;
// -----------------------------------^ this is the arg that makes it so only the local machine has this set of items
ok i will attempt this and let you know how it goes
Hello, I'm coming to you because I'm making a server on my machine arma 3 exile, here's what I've already done and where I'm stuck, I installed the server with steamcmd, installed the database that works with the server, I opened my ports via the admin panel of my internet box, I have a fixed IP,disabled windows firewall but the server remains local and I can't put it online, would someone know how to help me
Hello, I created an A3 Exile server for myself and my colleagues. Now we're having a few small problems. Could someone perhaps help us? (We don't see the vehicle HUD on the top left and right) (The pylon manager can't be opened) (When a rocket is fired, the AI โโisn't killed, or it doesn't count respect in DMS missions)
on Root server ?
yes
so your functions don't exist on the other machines. and since zeus placed objects only fire locally, you need to send the function and store it locally on every machine:
private _sendFunctions = {
GlobalFnc_01 = { /* stuff */ };
GlobalFnc_02 = { /* stuff */ };
GlobalFnc_03 = { /* stuff */ };
};
[_sendFunctions] remoteExec ["call", 0, "FB_SendFunctionJIP"]; // this will also make the functions available to joining late players
now you can use those functions using remoteExec to the client
so im going to guess i put the local items in the wrong place, i added the arsenal function unchanged in the arsenal then added the local tiems in the characters init and added a rifle to test it
it looks like you didn't open the firewall properly
This is possible because the interface of my internet box differs from what I can find in tutorials on the internet.
could be initialization order of the objects if you are going the init box route. you want to make sure the arsenal is initialized first, then the character's init fires.
// box init - box also needs to have a variable name - set it to arsenal_01
[this, false, false] call ace_arsenal_fnc_initBox;
//------^ no items
//-------------^ initialize locally
// character init
if (local this) then {
[] spawn {
waitUntil {time > 0};
[arsenal_01, ["arifle_AK12_F"], false] call ace_arsenal_fnc_addVirtualItems;
//---^ box
//------------------^ item array
//--------------------------------^ do this locally
};
};
note: it will bring in what the character is currently wearing. though its not actually in the arsenal. if they were to change, leave arsenal, and reopen, you won't see what they originally wore
it already does that which im fine with, they all start as civilian beggers converted to blufor ๐คฃ
hopefully the comments kind of help you. know that inits in editor objects fire globally, which is why we have a local filter in it. so that when players join that don't control this object, nothing happens
same thing why we want the box to initialize locally. so that joining players don't globally overwrite it
i appreciate the help, i cant really script except to alter what is already created so really any help is super appricated. im just trying to play a game and guess i didnt know what i was getting myself into XD
@median perch what you want exactly?
i try it right now. u mean so? https://pastebin.com/W90HvyBC @fair drum
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
not quite, you only want to send the things that start with FinalBiologic_fnc_blahblah. you don't want to use them in this function
oh i see this is the full script, not just that function
hmm i dont understand.. but its funny "finalbiologic:blabla" haha
yes, up until line 99 you are good
everything after line 99 is still only going to fire on the zeus client
you'll use the functions by
// if no arguments
[FinalBiologic_fnc_blahblah] remoteExec ["call", 0];
doing it like this goes against my nature of A3 scripting, but since you are trying to do public zeus stuff, and don't have access to the mission, gotta make the jank work
thank u for u help mate ๐
[] remoteExec [โFinalBiologic_fnc_blahblahโ,0];
thats not registered into the function library though
at the moment im just trying to make it where when a player selects a role they can only pull role specific weapons and equipment from the arsenal, i however cannot make scripts and have limited understanding of scripts. i can alter them once they are created so if i can get somthing usable and put it into the right place i can add what i want to it.
im sure im doing somthing wrong still lol, for information purposes i have a rented server and i add mods and files to filezilla, i also have added some files to the mission folder generated by eden editor like EOS and a few copy and pasted simple scripts ive found online
its not that im not willing to learn how to do these things im just stuck in kind of a turorial hell that gives me no real usable information.
@median perch you can make simple addAction and then choose and apply a loadout to the unit, does this fit your idea? I can give you the script
well it has to be useable from ace arsenal, meaning heres a list of things this role can pull from the arsenal you can take as much or as little from this list. the players i make missions for like arma barbie pretty much but i do need to limit who can take what.
That's because most of the stuff out there is bad or not useful. Learn how to debug and read the documentation of the Ace framework.
I see enough of this question I'm just gonna add a module into Modules Enhanced for it.
ok where do i put this and how do i use it?
@median perch you want to create limited arsenal for every role having only items this role can choose?
yes thats exactly what i want
i guess i need it explained to me like im 5 and have never used a computer before lmao
@fair drum It doesn't work for people who rejoin
And I don't think it will run for other players after activation.
Post what you changed...
i testet this code:
and this is not working for (i think other players) but definatly not for rejoiner
I told you this wasn't going to work. You need more changes to everything past line 99
hmm okey i will chaned it now
It's a mission file
https://github.com/PiG13BR/Arma-3/blob/main/ARSENAL_WHITELIST_ACE.VR/readme.txt
@median perch
you can easily use something like
make some box, call it "box" ๐
in initPlayer.sqf and onPlayerRespawn.sqf
if ((typeOf player) == "classname_assault") then {
[box, ["item1_for_assault_classname", "item2_for_assault_classname", "itemN_for_assault_classname"]] call ace_arsenal_fnc_addVirtualItems;
};
if ((typeOf player) == "classname_grenadier" then {
[box, ["item_for grenadier_classname", "item2_for_grenadier_classname", "itemN_for_grenadier_classname"]] call ace_arsenal_fnc_addVirtualItems;
};
and so on for every squad role ๐
player with different slots with proper clasnames will se different item in the arsenal
Ok i will attempt this and let you know how it goes
@median perch just replace with the proper classnames of the units and the gear, nothing difficult. The long part will be to copy and paste every needed item classname from the full ACE arsenal ๐
to do this just hover the mouse over the item and press ctrl+c then ctrl+v to paste it in the script
ok, should be doable thank you
I don't get these dogs man, what I have here works for like 2-5 minutes and then suddenly they just start walking in a straight line until the end of the earth..
OB_resetDogTrigger = {
params ["_trig"];
detach _trig;
_trig setPos (getPosATL gd_trigger_reset);
systemChat format["reset dog trigger %1", _trig];
};
randomDogPos = {
private _randomSafePos = [];
while { count _randomSafePos == 0 } do {
private _randomPos = [["dog_area"], ["water"]] call BIS_fnc_randomPos;
_randomSafePos = _randomPos findEmptyPosition [0, 20, "C_Quadbike_01_F"];
};
_randomSafePos;
};
[] spawn {
sleep 30;
_dogArray = ["Fin_sand_F", "Fin_blackwhite_F", "Fin_ocherwhite_F", "Fin_tricolour_F", "Fin_random_F", "Alsatian_Sand_F", "Alsatian_Black_F", "Alsatian_Sandblack_F", "Alsatian_Random_F"];
_dogs = [];
for "_i" from 0 to 1 do {
_grp = createGroup east;
_dog = _grp createUnit [selectRandom _dogArray, ([] call randomDogPos), [], 0, "CAN_COLLIDE"];
_dog setVariable ["BIS_fnc_animalBehaviour_disable", true];
[_dog] joinSilent _grp;
_dogs pushBack _dog;
};
[[sideLogic, "Base"], "Guard dogs spawned."] remoteExec ["sideChat", allCurators];
sleep 2;
trig_guard_dog1 attachTo [_dogs select 0, [0,0,0]];
[_dogs select 0] spawn {
params ["_dog"];
sleep 1;
private _animMovement = ["Dog_Walk", "Dog_Run"];
private _animStop = ["Dog_Stop", "Dog_Sit"];
while { alive _dog } do {
_randomPos = [] call randomDogPos;
_dog doMove _randomPos;
_dog playMoveNow (selectRandom _animMovement);
waitUntil { sleep 0.5; (_dog distance2D _randomPos) <= 3};
_dog playMoveNow (selectRandom _animStop);
sleep ([15, 60] call BIS_fnc_randomNum);
};
[trig_guard_dog1] spawn OB_resetDogTrigger;
};
};
My best guess is that the randomDogPos function is the thing that's breaking at some point because of a bad position or something? It tries to pick a marker from a specific square marker around a house and I want it to pick a random position outside the house
would my "box" still have to have the ace arsenal function in the init?
@median perch I think no, first try with only 3 items for two roles to see if its working, I never tried this kind of "personal arsenal", I use loadout presets
im just trying one item on one role atm, nothing so far. it wont give me the option for arsenal
paste you code for initPlayer.sqf ...
@median perch remove the variable name from the classname of the unit and the file should be named initPlayer.sqf, not initplayer.sqf
does the vector they move to happen to be towards [0,0,0]?
I have chat printouts in the code which I removed due to character limit but no I haven't ever seen the coordinates being [0,0,0]
They don't stray in one specific direction, they'll just carry on walking straight in the direction they were facing when it breaks
are the printouts giving values that seem expected?
Yes, all coordinate printouts I've seen appear were around the house
so i removed the variable name and its still not giving me the option for arsenal
thats where i put those files too
it worked!
i just need the arsenal fnc in the "box" and to remove the variable name
now how do i keep ppl out of my zues slot?
After control of the unit is given to the player, do a steam64id check. Kick them back to lobby if it's not in the list.
where and how do i do that?
I've tried a lot now, but it still doesn't work. In some cases, nothing happens at all
if they keep walking forever it's probably because the animation gets locked and they never get a chance to move towards the target
also that while loop for getting a position is bad and can get stuck forever
@split scarab
also you keep spawning new code (nvm I thought it was an infinite loop)
that could clog up the scheduler
You mean _randomPos = [] call randomDogPos;?
yeah
Even though it's just meant to find the _randomPos and then exit?
is there any guarantee that it does find a pos?
Eventually yeah, there should be plenty of clear space for it to find one but I suspect that it somehow breaks, no idea why though
where does this code run from? (as in where does it get executed) and why do you keep using spawn?
initServer.sqf and because there's meant to be two dogs but I cut one of them out due to character limit
well in any case you can also not guarantee that the dog will ever reach its destination
so your waituntil loop with distance check is also another potential infinite loop
@fair drum idk i tryed more than 4times to change something but nothing works. u see my tests here https://pastebin.com/BJ2c6fiL
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
you aren't understanding at all the multiplayer locality. you only need to send the functions to the client once. this might be over your head at the moment. I've shown you the steps that are needed to do what you want, but the rest of it, you have to have an understanding.
For public zeus to run functions locally on clients (which you need because you are doing UI stuff) through object inits (which are local in zeus):
- send functions to the clients (by telling the client to save a function into a variable)
- treat local zeus as the server, he will be sending the remote calls of the functions to the client (telling the client to call the code in the variable)
Everything else is in the scripting logic. I can't, nor do I want to spend the time to go through everything in your script. So if someone else wants to take over, then go ahead. But as of now, I'm stepping away from it.
Your idea would do much better as a mod due to limitations of public zeus-ing.
https://github.com/Sparker95/Vindicta/wiki/DEV-Setup
Hey so I'm trying to do the dev setup for this mission so I can edit one of the factions. And I don't even know if I'm doing the first step correctly. Is there supposed to be a confirmation or anything? I'm new to all of this. Also for the second step, I don't know how exactly to set up a repository. I've done factions for liberation so I now that part the setup for this one is just way more complicated then what I have done before.
don't even attempt this yet. watch some videos on what github is and how it works. look into github desktop if you don't like command line.
I mean I know what GitHub is
uh, hey there everyone. I don't come on here often as I can usually figure stuff out for myself, but i thought I would ask here.
How can I go about making intel in the editor like you can in Zeus? I've looked up videos, watched all of them, tried my own attempts, nothing's working. I would really love some guidance on how to add intel that can be picked up with a hold action command, with the item in question getting removed.
Additionally, I would like to know how I can make it apply to stationary NPCs as well like I can in Zeus Enhanced.
Obviously, without the NPCs disappearing.
How should I know when Iโm ready to attempt it tho
Could you recommend any videos idk if Iโm going to get good results if I just search up โwhat is GitHubโ
you said you don't know how to set up a repository. have you used github before? or just know of its existence. that would be the first step in pretty much anything github is setting up a repository or cloning a repository
https://www.youtube.com/watch?v=HkdAHXoRtos
github desktop can do a lot of this stuff for you without command line
Ive used it before
you can verify the first step by using Get-ExecutionPolicy to confirm that it is bypassed
Ig maybe I havenโt used it in that way tho Iโve only just downloaded stuff from it
Okay thank you
if you are just playing with friends, something like this will be fine:
// initPlayerLocal.sqf
private _whitelistZeus = [
// obviously replace these
"203958230589",
"29385023598"
];
if (MyZeusUnitOrWhatever == player && !(getPlayerUID player in _whitelistZeus)) then {
// boot back to lobby
endMission;
};
so I would be cloning the repository right? just to confirm
i believe so according to his docs
in the video u sent he is using visual studio right?
oh wait its just git right
he didnt explain that I downloaded github desktop
https://git-scm.com/downloads/win I need to install this right?
@lyric gulch use VSCode + github desktop
@tough abyss best ui for that is no ui (or better: no graphical)
Is there a way I can have a trigger activate when an object is deleted?
Anyone able to help me script a way to instakill downed players on any hit by BLUFOR? I wrote this but instead of hits downing them first it just outright instakills them...
this addMPEventHandler ["MPHit", {
params ["_unit", "_causedBy", "_damage", "_instigator"];
if (incapacitatedState _unit == "UNCONSCIOUS" && side group _causedBy == west) then {
_unit setDamage 1;
};
}];
It's possible the EH is firing after the damage has been processed and they've been set to unconscious.
This is a complex area to operate in because of all the interacting mechanics.
You might need a HandleDamage EH instead; it fires earlier in the damage process. But the medical system also uses HandleDamage EHs to do its work, and those will probably be added before yours - so if you want yours to be processed first, you'll need to remove the BI Revive EHs, add yours, and then re-add the BI ones. As I said, complex.
Working with damage processing is probably one of the most annoying and complicated scripting topics in the game.
Damn, real shame because trying to execute people using the vanilla medical system is janky as hell
Use the deleted event handler instead of a trigger
Sometimes it takes 1 bullet to the chest and other times it takes 3 to the head
Can I get a link to the arma wiki for the deleted eventhandler? I'm not familiar with it. Still new to mission scripting.
Nevermind I've found it
This may work wonderfully, ty.
@fair drum where do I go for commands?
file > terminal
or ctrl + shift + `
okay I did this and I think it worked
mines under file, try under view
you can change the environment on the top right bar of the terminal. can do powershell, cmd, etc
Guys, anyone here have a script that gives the player a new mag on the last fired shot? old one i have is no longer working
player addEventHandler ["Fired",{
params ["_unit","","_muzzle","","","_magazine"];
if (_unit ammo _muzzle == 0) then {
_unit addMagazine _magazine;
};
}];```not tested
Thanks, gonna test and come back with the results
Worked perfectly, thank you very much brother
Another question, i have this script here:
[] spawn {
while {true} do {
{
_x setVariable ["HAF_spawned",true];
_x addEventHandler ["HandleDamage", { [_this#2, 1] select (_this#6 == player) }];
} forEach (allUnits -allPlayers select {isNil {_x getVariable "HAF_spawned"} && side _x == EAST && !isPlayer _x});
uiSleep 2;
};
};
What should be changed for it to have an effect on already spawned units and not just the new spawned ones?
if you are using CBA, you should be using a class event handler with the init tag for this instead of running a loop.
Hmm, thing is, this script im using is working, just not for units already spawned, i thought about removing the variable, but i don't think it will work and might just break the whole thing
hey scripters anyone here know how to manipulate ace stuff? ive got some variables i want to change for all ace cargo and wanted to see what was possible
i want to take the utility of this image and be able to make it for a mission rather than config it for a pbo
ive seen this framework but to be truthful im too noobish to understand it
https://ace3.acemod.org/wiki/framework/cargo-framework#42-adjusting-cargo-size-of-an-object
what do you mean make it for a mission rather than a pbo? that menu right there is setting the options for that object for that mission
i understand that, for an individual object it will follow those rules but i want to make it so all of that same object follows those rules ie all barrel cargo net object follow the rule of cargo size = 2 this menu only allows manual change of that one and any duplicates, if i then load into the game and try to spawn or duplicate the object it doesn't follow the same ace principles and id like it to be consistent for the mission that all follow that rule set
i figured maybe on startup i could run a script or maybe a script for each individual object in the cargo framework i noticed im not 100% sure because im new to this stuff but that was where my head was at with i
Ah ok. So you'll want to use a class event handler with the init tag from CBA to execute code on everything new and old of a given class name. I'm not at my computer to give you the values to change, but in the meantime, you can look at the ACE GitHub under the addon that contains what you want to change. There are usually some public functions, if not, look in the code for specific variables to change.
ill get back to you in 30 minutes or so thx still unfamiliar with all of this but i will try
wow ace github is a repository of some fantastic public functions, i will note id like to learn this for myself to some degree but this is really really helpful if it actually works lmao, thanks so much!
im running a gamemode where supplies lead to purchasing vehicles and equipment etc and so far ive had to do alot of it manually but i really would prefer to have some functions that allow for some load of ie: players can load and unload cargo, they can purchase items for certain price of supplies, and those items and vehicles and supply all are maintained by the mission itself so thank you this is a great start for me!
how would i go about using these functions do i put the code into the init of the mission id like to learn how this works so i can do it alot
im mostly asking how do i tell what to do i dont want to just copy paste id prefer to understand how for future ref
ty btw
Hello guys, I am failing to assign LAMBS-dev tasks (WP) to AI group in vehicle, does somebody have some working examples to share?
guys im spawning a sniper and making him aim and fire at a target, can u guys give me just the code to make him very accurate, good stance, right AI features disabled, enabled etc...
i need the sniper to be extremely accurate
setUnitPos to change unit's stance
setSkill to set skill
@warm hedge Thank you
Do you have any idea how a .50cal m107 is injuring ai at first shot instead of always killing?
no ace medical, vanilla
"HandleDamage" Event Handler to instakill
but is it realistic, im asking cuz i wont do it if its realistic
if there's a reason why it is like that in arma
Urm, are you asking is it possible in script or is it realistic
Can we know how many "seats" are available in a vehicle? I would like to generate the right number of bots (random but not exceeding vl capa) before moveInAny all of them (vehicle class is chosen randomly).
is it realistic
I don't care. I will do it if it is necessary
No i asked if its possible in reality that u dont get killed from this hit
I answered "I don't care"
thats nice
is it fun
being very helpful
yeah great help, bro
im gonna say that to other ppl too when they need help
guy thinks i msking his personal opinion whilst i literally asked if the arma devs had a reason for making it this way
the iq points are shining out of this one
youre funny as hell for saying that to polpox of all people
Is there a reason why the arma devs made vanilla damage the way that a .50 cal can injure someone instead of directly kill
How does one understand that question with these three words: "is it realistic"
No, I'm not a developer
Are we supposed to reverse engineer the code by using open source tools to understand this game, sicne the forums adn the docs are always so lackluster
also chances are the .50 cal is modded which can mean that it does anythign in damage depending on how it was made
It's M107 though, isnt it basegame
It isn't
So ur saying it's a CUP issue?
No?
not really the biki and most commands list a lot of useful information additionally this server and other servers to help exist
I have nothing but CUP weapons
"It is happening" is the answer
so is it the cup mod?
.
could be depends on a few factors
And is it the real question you want to make?
and how it relates to scripting
