#arma3_scripting
1 messages ยท Page 643 of 1
Never used Event Handlers that I know of or remember doing at least, but when I try looking for nearest object nothing comes up
do a full world search
nearestObjects [player, ModuleCurator_F];```
@open star
nearestObjects [[worldSize/2,worldSize/2], ["ModuleCurator_F"], 1+worldSize/sqrt 2]
and please don't remote exec that 
And player is nullObj
not anymore, he's respawned
We have a command called allCurators
No. It always is
@open star use this then https://community.bistudio.com/wiki/allCurators
Do such stuff I always have a "dedmen" variable for myself
but not allLocations afaik ๐
How's that related?
sliding that into the convo, muhahaha
I noticed that a few days ago
did you use allCurators?
Mhm
Show what you are executing
just allCurators like the wiki showed.
If "nothing" would come up, it would be [], not {}
Yeah, my things are backwards not used to it it is just square brackets.
Oof. Maybe the module was deleted :D
I'm convinced of it at this point mate.
It's happened before when I use the vanilla respawn, and I was in Zeus when I die it either breaks and doesn't come back or gets deleted.
I don't think it gets deleted but I don't know enough on how the respawn system works in vanilla to know what happens when you die and respawn in the same character position.
Or well, Character Slot* not position.
So what happens if it comes up blank.
with no brackets.

just empty or square brackets.
Well I'd call it's gone then.
It's gone, I'm convinced it's gone.
next time use the event handler
I know very little about ASL to do that properly without mucking something up.
You mean SQF? :D
You guys have your own version of SQF
You can create a Zeus via script that you just local exec in debug console
Hello, I have a question
There is one on my github from like 4 Years ago that'll still work, but I think it's not super efficient anymore
OH yeah no it's gone
I went into the fake zeus and added the objects of where it should be, it's gone.
this addMPEventHandler ["MPRespawn", {
[_this, {
params ["_unit", "_corpse"];
_curator = getAssignedCuratorLogic _corpse;
unassignCurator _curator;
//_curator setVariable ["Owner", getPlayerUID _unit, true];
_unit assignCurator _curator;
}] remoteExec ["call", 2];
}];
Only my triggers are left behind.
not entirely new to sqf, but I'm having trouble finding what I need. So, basically. I want to script in a blood spray effect without the bullet actually hitting the enemy, do I need to create my own particle effect for this? or is there an easier way. I did a little bit of digging couldn't find what I needed.
Just plunk in debug console, local exec. But needs CBA
Aye have that.
I can only think of creating particle effect.
Script command is "drop"

hmm, i'm just going to have to dig around for the parameters for the blood
any particular reason why in an aircraft with AI in the cargo space, unit action ["Eject", vehicle unit] it does not kick out the AI but will kick out players, but unit action ["getOut", vehicle unit] will eject all players and AI when run
Yeah. Maybe you can find a old post about it on the BI Forums listing the parameters for blood
bugged?
most actions are at least
also, can I make enemy ai target specific body parts with doFire or commandFire
no
shame
unless you use helper targets
If i recall correctly, Eject wont work on AI
its arma AI, its hit the head or nothing, every time haha
You will just have to tp them out of the vehicle
none
ahh
make it yourself
Make another object and have the AI fire at that
B_target_F or something is the base class
ill use getOut looks like it works for AI
but its scope is 0
ah mk thanks
exploring the CBA function library. which are some that I should definitely be using that are more useful than the BI version?
Don't know of anything that's duplicated there.
i guess most of this was before things were added to the default library in the early days?
Don't think so
CBA remote events can be replaced by remoteExec, but neither is really better than the other
I guess their Eventhandler system is same as the vanilla scriptedEH, the CBA system is better performance wise, but different feature wise
How can CBA EHs be better performance wise than Vanilla EHs?
the functions are cleaner. EHs are the same
And is there a particular reason BI doesnt clean up their functions?
Vanilla has more code, older code, not as optimized
Time and Money.
Dont the EHs on vanilla run engine-side?
And no need to if basically no one uses it nor cares
all EHs do
๐ฆ I dont use CBA
Uh..
No.. scripted EHs are... scripted
Which are?
Scripted EHs.
scripted? ๐
Nothing coming up with that query, so i assume there is an actual name for it
addScriptedEventHandler
The name is scriptedEventhandler
๐ฆ

They're just a generic scripted system to have events / signals / etc whatever you want to call them for the framework you have
Easy way of using some modular functionality that can be gud
So these are essentially deprecated by the more modern engine side ones
No they're completely different
Damn a tripple ninja, thats a new one 
A scripted system isn't "real" you can create any arbitrary event and call it any arbitrary time and pass in arbitrary data when calling it
You can make scripted events all you want.
You cannot make engine events
They're a completely different thing. Some people hate them, I love them
Don't know why anyone would hate them :u besides hating themselves for not understanding the concept
Ummmm...
I think because there's a little overhead in calling them, instead of just calling whatever functionality you want to happen directly
How exactly is this different from the engine event handlers?
........
They are not engine. They are scripted
Engine Eventhandlers are not scripted. They are engine
How are they different in application
new hi-score ๐
As the name says
The one is from engine, the other is from script
A scripted system isn't "real" you can create any arbitrary event and call it any arbitrary time and pass in arbitrary data when calling it
You can't just randomly add new "engine" events to your mod
How can you add new scrioted event handlers
but you can call a scripted system for example "OnBandageFinished" in your medical system
BIS_fnc_addScriptedEventhandler
It was linked above 3 times
And then if you create another mod for "Scoreboard" you could for example to +5 score on the "OnBandageFinished" EH
And it looks for a variable change?
No. It looks for someone to fire the event
nope, it's an EH
fired by code
How do you fire the event?
wikiii
Not documented
BIS_fnc_addScriptedEventHandler
BIS_fnc_callScriptedEventHandler
BIS_fnc_removeScriptedEventHandler
BIS_fnc_removeAllScriptedEventHandlers
Instead of calling... why wouodnt you just define a script function and call that?
Because you can only have one
I think because there's a little overhead in calling them, instead of just calling whatever functionality you want to happen directly
๐
Modularity among other things
I don't quite understand why it seems that things need to repeated 3 times
For example again the 'Scoreboard' plugin that i made for my mod
I have scripted events for just about every 'event' that happens
Because i dont get the application of it
You don't know what Eventhandlers are?
Well, i guess a chef will never understand the application of an angle grinder
That means rather than me needing ot add "Scoreboard" related to code to my medic system, my spawn system, my killing system, etc etc etc
I can just tie into events easily and keep things neat
I mean that i have never needed anything this specific without having another smarter way of doing it
smarter way of doing it
Ok lol
https://doc.qt.io/qt-5/signalsandslots.html Similar ๐
Just try to apply your "why not call function directly" to engine Eventhandlers.
Do you want the engine Fired Eventhandler to call a hardcoded BIS_fnc_firedEvent function, that's empty and that you cannot overwrite or hook into?
I know what event handlers are and i've used the engine side EHs many many times
But i dont get what this is trying to be
That would make the event useless if you can't add a handler to it when you need it
There's a ton of different reasons you'd want to do it. For me the main one has always been modularity
Scripted Eventhandlers are the same thing as engine eventhandlers.
Application wise.
Want to know if someone shot their gun? You can check every frame if gun is being shot currently, or you can just add a fired Eventhandler.
yes, but that part is already taken care of by the engine side eventhandlers
Want to know if someone placed a explosive with ACE?
You can check every frame if someone is placing a explosive. Or you can add a ACE_explosives_placed eventhandler.
what more is there for the scripted EHs to do?
Want to know if someone finished bandaging with ACE?
No it's not
We already explained like 4 times now
e.g scripted framework
oh, so it's for mod API use
It feels like somehow these messages are not being received on your end
That's the general programming wide concept of Eventhandlers or signal/slot systems.
i never even thought about that

not only
instead of playing with global arrays of data, you can simply subscribe to an event of e.g sectorCaptured in a special mode
sectorEnter / sectorLeave / sectorCaptured etc etc. Plenty of different gamemodes and mods use it in different ways
i can see its application being for modded eventhandlers now
My terrain making mod uses it for each "Tool" it has. onActivate / onDeactive events
mod or sqf frameworks
or, user defined eventhandlers
is there a command to determine if a building is mission placed or map placed ?
the Biki article lead me astray a bit
It means that someone can easily make a new tool for that mod, without needing to touch any existing code, he can just register onActivate / onDeactivate script events
๐
i thought that the events could only be ADDED by BI modules
similar to how the engine side events are
No the point of scripted event systems is that they're 100% scripoted
so we're clear, noice ๐
this aprt had me confused:
Scripted Event Handlers are triggered by some of BI's modules and functions.
Or Arsenal
oh, Arsenal too?
yeah, but it does say that they are triggered by BI's systems
Arsenal has open scripted EH
and here I though Arsenal is SQF only
the whole thing flips around now that i know user scripts can trigger them just aswell
It is?
Read further than literally the first sentence.
You can even implement your own scripted eventHandlers by using BIS_fnc_callScriptedEventHandler.
then how could Arsenal EH be engine-based? unless I missed some steps
It's not?
why does the first sentence lead you astray then?
It's scriptedEH
some could be engine-side yes
e.g opening pause menu
Or Arsenal
technically, Arsenal can not?
People are expected to read on. And not just give up after the first sentence.
It doesn't lead you astray, it says what is fact
Pause menu is not engine side
The scriptedEH is scripted
when writing a summary, you want to summarize the information
not sprinkle it around
Yes. But it does that
it kind of does not
#community_wiki for any (constructive) suggestions
Barely anyone uses scriptedEH.
So the most important thing that people reading that page should get is that BI uses them
Scripted Event Handlers are triggered by some of BI's modules and functions or by user defined scripts
Something like that
Because thats what most people looking for the info are looking for
But i digress, appreciate the explanation.
trueโฆ and Zeus ones (e.g "ping") either?
one that could have been is "OnSaveGame"
Zeus ping is addEventHandler on curatorLogic no?
Engine doesn't know that scriptedEHs are a thing
It's purely all script
yeah, but isn't ping a scripted thing?

good enough answer I guess ๐
What does the "marker" in the description parameter of BIS_fnc_taskCreate change in-game? I've tried generic text, marker variable name, and marker type in it and haven't noticed any changes.
Task description in the format ["description", "title", "marker"]
I suppose the marker's text
as in, the task's marker
the little v pointing to where the task is
if the task has no destination, you won't see it
@winged wing โ
[west, ["task1"], ["Do this and you get a cookie", "Earn Cookie", "Get cookie here!"], [0, 0, 0], 1, 2, true] call BIS_fnc_taskCreate;
https://cdn.discordapp.com/attachments/739284316651126914/794679115328389150/taskMarker.png
๐คท
might be the old vs new task?
https://community.bistudio.com/wiki/Description.ext#Tasks
like 2D markers vs 3D
but I remember it was that
I'm trying to do setDir when I have AI inside a boat. won't let me do it, anyone know a way around this?
Sorry, I don't understand.
Hmm, markers2D and markers3D doesn't seem to do anything either. ๐
is it even possible to setDir when AI is in the speedboat?
No. Units in vehicles always sit in their seat in the seats direction
darn
what about attaching objects to the vehicles and then attaching the AI to that object
it would mess with the first person view I believe, but I am not sure
that's fine, don't need the first person view
not a problem, i'm just trying to make a cinematic. so, the functionality doesn't bother me
then yeah, attachTo ๐
Thanks!
my ai, keeps "walking in place" when i attach him
even when i change the animation
i don't know if using a flashdrive as my attachable object was the best idea
tried using unit DisableAI "MOVE"; and it fixed it
Arma2OA. How can I respawn a player in multiplayer via script? I.e., not using the "respawn" in description.ext.
kill & createUnit a new one then selectPlayer?
does isPlayer work on a "killed" unit?
Ok. There are playable units in the mission. If not player, then they are ai controlled. When any of them die, a new unit will be created for them. Now, if it is a player, the player must take control of the new unit.
I'm not using the built-in respawn because it causes unintended garbage collection problems
So I just gotta check that I can detect that a local player had controlled the killed unit
also, question. Last one for today. I promise. Why does forceWeaponfire work on some animations and not others
is it just a dev thing or do i need to play around with the different force fires to get what i need working.
or use the built-in garbage collection, and add a safety script over units? that could do
it might come from animation config; if the only difference is the animation, that's it
safety script? I searched and found no way to disable the garbage collector
isn't GC a module in Arma 2 (OA)? ๐ค
oh like cfgmoves
In A2OA, when you enable respawns and have playable ai slots, the garbage collector starts automatically
No way to turn it off as far as I can tell
and what are the issues encountered?
it causes bodies to be removed prematurely
I think I can do my respawns with if (player == killed) and then create a unit and do selectPlayer
in this situation what happens if the player leaves the game? Would a newly joining player be able to take that unit?
I'm not able to take control of the newly created unit using selectPlayer. maybe it doesn't work if the player has died?
if you are using no engine respawn template, wouldnt the slot become unusable after death?
thats how it is in a3, though i havent tried scripting unit respawning.
uhm... i've not used a respawn template before, but I presume I would have to enable respawns in order to use them.
I'll just make the ai non playable. That seems to fix the garbage collector problem with respawns.
im not sure if I understand the comparison with flyInHeight and flyInHeightASL do I have to use both?
flyInHeight flies X meters above the ground, whereas flyInHeightASL flies X meters above sea level
depending on which one is "higher", it will use that one
mk i just want my plane to fly at 200m ASL and ignore terrain changes
then set to 1 ATL and 200 ASL ๐
lol so I did that and when my plane went to bank turn it got stuck in a never ending bank. guess i might have to leave some room for variance in there
give it some space from the ground yes
I'm wondering if it's possible to destroy or shutdown an engine mid flight just to add some immersion and yeah alright
@covert crow YES it's possible ๐
most likely with https://community.bistudio.com/wiki/setHitPointDamage
use getAllHitPointsDamage to check which one is the engine or whatever you want to kill
(note that it's local effect, you should remoteExec it on the vehicle's network owner)
without major effect (pfx and sfx) work its however a bit... underwhelming if u're after immersion
Yeah I did a bit of Googling, its more like I just want to piloting crew to uhh
Let's just say draw the short stick and hope they know enough that they are able to autorotate to safety
ah yes, autorotation ๐ I did a training mission about that during the alpha
More curiously I'm wondering about things like large fixed wing aircraft with 2 or more jet engines
with helo, yeah that works. With planes - not really, they fall like bricks and bleed speed with the smallest turn
like "random location + random time + random damages" = deal with it ๐
as long as one engine remains it's fine
Its realistic in that there's enough thrust provided to atleast glide right
glide forward, I don't know how realistic Arma is about engineless fixed wings (I don't play flight sims much)
you cant make a banking turn - which is a big "oof" for simulation. You can addForce and addTorque, which is very powerfull... if you are into more complex stuff, flight mechanics and so on. I was considering trying to make my own flight model, but had to sacrifice it
Yeah I dont know a damn thing about anything
best way to get started / getting inspired ... is looking at the tool box provided: https://community.bistudio.com/wiki/Category:Scripting_Commands
or you can bring an idea and see with us how it could be doable (or not) ๐
I usually only see a possibility from the scripting end, not from the "real need" end, so a fresh look/idea is always good
Well I mean for a second I thought of "hey let's give it the smoke particle effect" then I realised performance issues
Yeah ive seen those but it feels like with armas fun tendencies to just not be logical sometimes it might backfire
i dont think particles can be applied in-cockpit view. The cockpit view is always "displayed on top" over anything else
Heyooo
There we go,
The first thats not gonna work, its a great start but im sure I'll figure something out later
alert sounds + peepee (post processing overlays) could get you a fair bit in invoking a bit of terror/anciety. A few random nudges with addForce /addTorque and it should already feel like you are wrangling controls. Though without proper control over cockpit warning dials it will feel a bit stale. Maybe some custom plane mods have animatable warning cockpit indicators. I know i have ๐
color desat + additional contrast always do the job!
is it possible to do your own custom post process? the brown one is a litttttle too dark
miiiight be a little over my head atm
not that much really ^^
as soon as you get what the values are, you only need to tweak to your liking
yeah had to look up what a few of those things meant as far as photos go
do you know off hand the class name of the parachutes that you can attach vehicles and crates to?
not off-hand, but the wiki might have intel ^^
you hear my voice now, and only my voiceโฆ
you will do as my voice saysโฆ
Use the wiki!!
๐
B_Parachute_02_F
from https://community.bistudio.com/wiki/Arma_3:_CfgVehicles_WEST#B_Parachute_02_F
this MIGHT be the most stupid way of doing things I've done so far... but I'm guessing that the reason only 1 marker is created for one of the crates is that I somehow need to make the marker name unique for each of them?
blah blah blah
for "_i" from 1 to 2 do {
[_vehicle] spawn {
params ["_vehicle"];
private _supply = "B_supplyCrate_F" createVehicle [0,0,50];
_supply setPosATL getPosATL _vehicle;
private _cargoParachute = "B_Parachute_02_F" createVehicle [0,0,5];
_cargoParachute setPosATL getPosATL _supply;
_supply attachTo [_cargoParachute,[0,0,0]];
private _marker = createMarker ["Supply Crate", _supply];
_marker setMarkerType "hd_dot";
_marker setMarkerText "Supply Crate";
[_supply,_marker] spawn {
params ["_box","_marker"];
while {getPosATL _box select 2 > 2.0} do {
_marker setMarkerPos _box;
sleep 1;
};
};
waitUntil {getPosATL _supply select 2 < 2.0};
sleep 0.3;
detach _supply;
};
};
correct
for "_i" from 0 to 2
_markername = format ["myMarker_%1", _i];```
without the "do"?
with the do.
lou just writing to show context
incase it isnt clear, you'd also need to provide _i as a parameter for the spawn, and then get it with params before using it
yeah this is what I did and it works
for "_i" from 1 to 2 do {
[_vehicle, _i] spawn {
params ["_vehicle", "_i"];
private _supply = "B_supplyCrate_F" createVehicle [0,0,50];
_supply setPosATL getPosATL _vehicle;
private _cargoParachute = "B_Parachute_02_F" createVehicle [0,0,5];
_cargoParachute setPosATL getPosATL _supply;
_supply attachTo [_cargoParachute,[0,0,0]];
private _markerName = format ["myMarker_%1", _i];
private _marker = createMarker [_markerName, _supply];
_marker setMarkerType "hd_dot";
_marker setMarkerText "Supply Crate";
[_supply,_marker] spawn {
params ["_box","_marker"];
while {getPosATL _box select 2 > 2.0} do {
_marker setMarkerPos _box;
sleep 1;
};
};
waitUntil {getPosATL _supply select 2 < 2.0};
sleep 0.3;
detach _supply;
};
};
does _vehicle change before that spawn in the loop?
no
so you do all that twice for the same vehicle?
this is the full thing https://sqfbin.com/ojoneboqiqafizuqopuz
kind of creates a nice... static line effect
Don't know if anyone here has played with Aliascartoon's Smoke Signal scripts, but i was wondering how i can make ai fire the scripts when they spot me.
The basic of the script allows the player to fire the scripts with the action menu.
TIA
since there are no event handlers for this, you'll have to use a loop like this:
[] spawn {
...
waitUntil {
sleep 5;
time - (_unit targetKnowledge player select 2) < 1
};
//throw smoke
}
What is the best way to detect if an object or unit has spawned inside geometry? For example, spawning inside a house object instead of at one of the building positions.
im guessing the ... is the ai?
is there a way to to magically spawn in a bullet
and make it hit a target
or an enemy rather.
lineIntersectsSurfaces
it's whatever you want to put before the main loop. at the very least you have to define _unit
yes
look in cfgAmmo. they can be created with createVehicle
as for shooting, give them a velocity and adjust their direction
look up setVelocity and setVectorDirAndUp commands
@little raptor Thank you.
np. also, if the unit's getPos select 2 is negative, it's clipping inside the floor of the building (roadway LOD). you can use that too.
similarly, if getPos select 2 is larger than ~0.1 m, it's floating in the air above the surface
Ah, that getPos select 2 is very handy to know, I'll give that a whirl.
ak kool
so far i have
[] spawn
{
waitUntil
{
sleep 5;
time - (_unit targetKnowledge player select 2) < 1
};
[smoke_obj,"red"] execVM "scripts\AL_smokeSign\al_object_smoke.sqf";
};```
//Sry dont know the code thing for discord
I keep getting waitUntill return nil. Expected true or false
@jade tendon see the pinned messages
that's not how you define a unit
a unit is an object
you're providing an array
also it's not defined inside the spawn
and your code is all wrong (types and stuff)
for example, what is smoke_obj?
you should read
https://community.bistudio.com/wiki/Introduction_to_Arma_Scripting
an example:
[] spawn
{
_unit = SoldierEB; //i'm assuming that's what you named your unit in editor
waitUntil
{
sleep 5;
time - (_unit targetKnowledge player select 2) < 1
};
//not sure what smoke_obj is, but I'm 99% sure it's not even the right type (and probably not defined either)
[smoke_obj,"red"] execVM "scripts\AL_smokeSign\al_object_smoke.sqf";
};
[smoke_obj,"red"] execVM "scripts\AL_smokeSign\al_object_smoke.sqf"; actually came from Alias. Its commented inside al_object_smoke.sqf
so? doesn't mean it's defined
and i thought the [] was wrong
so was the ""
{ alive _x && count (fullCrew [_x, "driver", true]) > 0 } count vehicles will return drivable (real) vehicles
I'm having an issue, where my AI stops the boat each time it gets into combat, yet I want it to keep moving
tried disableAI "autocombat"; set it to careless and hold fire
nevermind, figured it out.
Anybody have any neat solutions for dealing with AI who spawn in / move into /get stuck in rocks?
if you set the formation as file it might not happen as often @worn forge
the more spread out they are the more likely that is to happen.
hm interesting. executing:
parseText "<t size=2>TITLE</t><br/><br/>Body." remoteExec ["hint", remoteExecutedOwner];
``` logs the following to rpt:
```Performance warning: SimpleSerialization::Write 'params' is using type of ',TEXT' which is not optimized by simple serialization, falling back to generic serialization, use generic type or ask for optimizations for these types```
Hej People!
wish to all u a great 2021!
i need help, i was trying to make some scripting with the Editor for equipment from my unit, but i have an issue:
i trying to force to load a predefined loadout that i made, and for that, i this script in the Init from the Unit's that are oficial's entities.(as well as for the other's with their specific script): null = [this] execVM "loadouts\Oficial.sqf"; this addeventhandler ["respawn","_this execVM 'loadouts\Oficial.sqf'"];
But it's not working, what am i'm doing wrong? i made a File name *onPlayerRespawn.sqf *with the script's, as well for the Loadouts script, they are at the "right" place i think.
The worst of this is that in de VR map work's it perfectly, but if i change to a Map it's not working, what am i'm doing wrongยฟ?(and yes, all mi mission's have the files in the order's) could someone help me a little bit?? I'm really sorry if this is really simple, but i'm looking in Biki as YouTube tutorial's, and none has the solution or works well :S
regards!
Can you take a screenshot of the folder structure of the script?
Actually never mind, just realized you can't post pictures here.
Sure
thanks Tail! and sorry for taking u time :S
Don't thank me yet, we haven't solved the problem lol
If the units you want to set the loadout of are all players, it should be enough to have execVM "loadouts\Oficial.sqf"; in onPlayerRespawn.sqf. In that case you also don't need a parameter in Oficial.sqf because you can just use player (instead of _this # 0).
thank you Ansin! i'm gona testing it like u said! it's not exactly for all player but in some missions it's possible that i need it to do soo ๐
Excuse me I am really a noob at scripting... but I would like to understand where can I find the Cfgammo for modify for the RPG-42 the allowAgainstInfantry ๐
is there a way to get worldName in a hpp script?
hpp's are not scripts
What is your hpp?
If you #include it in a script you can just use worldName
@tough abyss as soon as they engage enemy units (ie players) they don't respect formations.
why do you need it?
depending on how you plan to use it there might be alternatives
Hello, I have a little problem and I find it quite bizarre, I explain myself, I defined the name of the item and I set a variable on it, however when I cursortobject on it and I do a get variable above all works without problem but when I take the result of the cursortobject and try it it only tells me that the variable is not defined. Do you have any idea where this could come from?
however when I cursortobject on it and I do a get variable above all works without problem but when I take the result of the cursortobject and try it it only tells me that the variable is not defined
um...what? it works and doesn't work at the same time?! ๐
you might want to share the code cuz it's hard to guess the issue
_drg = "Hazendarck_Canabis" createVehicle position player;
_drg setVehicleVarName _name;
_drg setVariable [_name, [0,10,5], false];``` the crรฉation, if i try this (i look object) ```sqf
var = cursorObject getVariable "drg_0";``` its right this but ```sqf
var = drg_0 getVariable "drg_0";``` is not right
cursortobject done -> drg_0
@grizzled lagoon setVehicleVarName doesn't create a new variable for you
also I don't see why you're doing that
anyway what that means is:
drg_0 = _drg;
you must put this at the end of that
to automate the growth of plants and if they are not treated well have effects on them
Yes but with that 20 plants = global var
then create an array
I don't see why you think 20 global vars is bad
How else did you intend to set a vehicle var name, without having a global var?
if you think you have to put in all of them one by one, look at missionNamespace and setVariable
but as a I mentioned an array is the best way to do that
Why do you want to store the object on its own var space, you'll already have the object. Big confuse
if the variable name was the same it would make sense. but right now it doesn't, as Dedmen said.
_drg setVariable ["pos", [0,10,5], false];
the all script is this : ```sqf
_pos = position player;
_px = _pos select 0;
_px = _px + 1.5;
_py = _pos select 1;
_pz = _pos select 2;
_pz = _pz - 1.8;
_pos = [_px, _py, _pz];
_drg = "Hazendarck_Canabis" createVehicle position player;
_drg setpos _pos;
if (isnil "ndrogue") then {ndrogue = 0;}else {ndrogue = ndrogue + 1;};
private name = "drg";
_name = _name + (str ndrogue);
_drg setVehicleVarName _name;
_drg setVariable [_name, [0,10,5], false];
if (isnil "drg") then {drg = [];};
drg pushBack _drg;
sleep 2;
if (isnil "verif") then {[] spawn john_fnc_verifetat;};```
verifetat
verif = 0;
_nombre = 0;
_name = "drg_" + (str _nombre);
_ndrg = drg select _nombre;
varr = _ndrg getVariable _name;```
I think it's best like that I only use a global var
I have always been advised to use the least global variable

If you use global variables, always prefix them so they are unique to you
And yes. Tons of globals often shows bad code...
Why not put all plants into ONE array?
the names of the plants will be put progressively in the table drg
Also your whole block at the top, can be done in a one liner
_pos = position player vectorAdd [1.5, 0, -1.8];
But why not make an array? Without global variables.
I don't see the need for globals here
Thank you, I didn't know the vector add
You the. Don't need ndrogue anymore. As you can just count your array.
You already have the array "drg" why not just use that?
so for arrays, would I need to do { _x disableAI "MOVE" } forEach
would i put the unit name at the end?
Your code above doesn't need a global variable per plant.
forEach iterates through multiple units. Do you only want one?
group being like alpha1-1
that's what i was wondering
erm, isn't that the default name
like when a you put down a squad and its callsign is alpha1-1 or whatever. would I put that as the group?
Yes add all in 1 var global, to save a variable outside the file there is better than the global var?
You need a variable name for the group.
A single unit in the group would work too though @Aux#7865 .
Where did you put your code
Why do you need the global var?
Save what variable? For what reason?
I would just fix and rewrite your whole script. But I'm on phone :u
right, so I would assign like squad = group alpha1-1?
and use squad as my variable?
like that
i save number of vehicle for create vehicle drg_0 drg_1 ... and drg for save all name of plants and up after in getvariable, and var verif for say if the script to up plants its done
talking to me or jon
Yes I see that you do that. But I don't see any reason for it. WHY do you need a global variable for every plant.
Why can you not just store them in an array?
@Jonastex#2733
i put my code in the init for the ditor
editor
yeah man, forEach bro
forEach time sqf breaks my god damn soul
does it sound like a var name to you?!
{
_x disableAI "MOVE"
} forEach units _group
that's it
@tough abyss ^
_group is a private variable for the callsign correct?
like alpha1-1
i'm sorry, I just started learning sqf.
Which init?
yes i make all information in array i work on that, I leave the setvarialbe ... on the plant so that the players can then look at their stats when they aim at it @still forum
it's a variable that contains the group.
for example:
_group = group player;
and as dedmen said even a single unit works too:
{
} forEach units player;
ok I gotcha, so like _group = group 1,2,3,4,5,6,7,8. the numbers being the variables i assigned in the eden editor
which is why you should keep the same name for the variable.
No..
PLEASE just answer my question and I can tell you what to do and why
no! 
I said I was using the eden editor
what's your question again.
Which init
@still forum btw disableAI doesn't work in init
Server init
Unit init
Group init
Composition init
Game logic init
Mission init
Object or server? What now?
Server init is not in 3den
its done this ```sqf
if (isnil "drg") then {drg = [0, 0, []];};
_pos = position player vectorAdd [1.5, 0, -1.8];
_drg = "Hazendarck_Canabis" createVehicle position player;
_drg setpos _pos;
_ndrogue = drg select 1;
private name = "drg";
_name = _name + (str _ndrogue);
_drg setVehicleVarName _name;
_drg setVariable [_name, [0,10,5], false];
(drg select 2) pushBack _drg;
sleep 2;
_verif = drg select 0;
if (_verif == 0) then {[] spawn john_fnc_verifetat;};```
object: init. in eden
@grizzled lagoon
_ndrogue = count drg.
drg pushBack _drg
I also have a file open that i'm using called server.sqf I'm calling it via execVM
Also arrays start at 0
Which object? One of the AI units in your group?
@grizzled lagoon also get rid of the setVehicleVarName, you don't need that anymore I think?
Yes drg = [verif, ndrogue, [drg_0, drg_1 ...]];
- don't use
position/getPos. use the ASL or ATL variants. see:
https://community.bistudio.com/wiki/Position
positions vary in Arma A LOT. it's important to use the correct one.
_drg setVehicleVarName _name;
_drg setVariable [_name
as I said, use the same variable name:
_drg setVariable ["my_var", _something]:
- No need for setVehicleVarName at all
so like, assign a variable for the squad leader then set that to _group = group variable
would that work.
That means, in that units init the "this" variable points to the unit.
So you can use "units this" to get all the units in the squad leaders group
So
.. forEach units this;
no ok.
group this
Is the group of the current unit
Who's init script you are writing
But don't use a local variable, and you don't need group either in this case.
I don't even know what that means. no ones man. I'm making my own thing.
If the players want to watch the plants with a cursort object I have to keep the name
Sure? I remember Arma mission making tutorials where people just copy pasted this disableAI... Into unit init and it worked
You can just store the number on the object, with setVariable
Not 100% sure but can't test right now. I think it was either that or doStop.
Keep your verif in a global variable, don't put it into the array.
set variable for get info of plant select
exactly
use the same name
why do you change the name
do you even know how setVariable works?
You can just store the index of the plant in "drg" array, as variable onto the object.
Then you can get it with cursorObject and know which plant it is
each variable is unique to each object, even if their names are the same
thanks i look that
I also remember
doStop this;
No idea I don't do missions. But I remember people using it years ago
but now is 2 var global
Yep. Then do that
But adding it into array creates more problems than it solves
Just make it a global var
okay, so can't i just make an array using _group = ["a", "b", "c"]; and then { _x disableAI "MOVE"} forEach _group
How's that problem just need to select
you can but not like that.
that's just a bunch of strings
right, removing the ""
no, I get that. What I mean was I assign a variable to a unit, that variable is x1. Next, I do _group = [x1, x2, x3]; the next ones being other units.
The problem with the getVehicleId is that after how it is retrieved using the player cursor ?
Yes thats how you'd do it for different units.
But not if you want to run on a whole group, because you can just forEach through the group directly
cursortobject done the model and not id
actually it's cool. Ill just use the array way for now since I understand it.
thanks for the help Dedmen and the Leopard20.
What?
cursorObject returns the object. As the name says
i have make this in object sqf _drg setVehicleId _ndrogue;
and cursortoject done this sqf 297b6cf9600# 8: hazendarck_canabis.p3d
setVehicleId? Wat?
Did you not read the wiki page?
Get rid of your setVehicleId and read it's wiki page.
Yes. It returns your plant, what's the problem?
I don't see a problem
Yes I just watched and it's not appropriate for what I need, the problem is that if I delete the setVehicle VarName I can no longer identify the plants between it
Which is why I set set variable the number
_drg setVariable ["plant number", _ndrogue]
...
_ndrogue = cursorObject getVariable "plant number";
Then you know which number plant you are aiming at
Yes, but then how to recover the number of the plant, if there are several plants, the drug is no longer good
I'm confused but if I do a setVehicleVarName on it and store the info in the global var and don't use the set variable anymore it works. And suddenly I use the cursortobject to identify it
cursorObject always returns you the object.
The setVehicleVarName only changes the displayed name, but it's still the same object. You don't need to set a vehicle var name or global var
I think I understood what you advise me but the concern is that if I just do a setvariablen then the objective is to make the plant rise so I could not except if I aim at it but the goal is it's automatic
You have the array
Just iterate through your array.
Your "drg" array
It has all the plants
Yes but for say plant number
You know the number
It's the index in your array
And you have it stored as variable on the plant (if you did what I told you)
if i have 3 plants the array is [drg_0, drg_1, drg_2], I can make script to try all combination but i think is not best idea
exemple this : sqf _nombre = 0; while {true} do { _name = "drg_0" + (str _nombre); _var = cursorObject getVariable _name; if (!isnil "_var") exitwith { its done }; _nombre = _nombre + 1; };
{
_var = _x;
Do stuff with _var...
} forEach drg;
Here, same thing
Thanks
Am i on the right track or should i just give up.
Ref for code.
Trying to have ai run a script* when they spot an enemy, mainly the player.
- script is from Aliascartoon's Smoke signal
All ai are spawned dynamically by mod after mission start, no placed units in editor other than players.
{
_unit = (sideEnemy);
_target = (sideFriendly);
_knowledge = _unit knowsAbout _target;
waitUntil
{
sleep 5;
time - (_unit _knowledge _target select 2) < 1
};
[smoke_obj,"red"] execVM "scripts\AL_smokeSign\al_object_smoke.sqf";
};
};```
not sure, but I doubt that (_unit _knowledge _target select 2) will return anything useful
it returns #syntax error
knowsAbout returns a number, you're after targetKnowledge where 2 is last time the target was seen by the unit
also there is one too many }; on the end of that snippet
oops forgot to remove that after i took out "while true do"
also also, the _target should be a unit, not a side. _unit should be a unit too if using targetKnowledge
@exotic flax it wont work at all
@jade tendon why did you modify that?
this is what I said:
#arma3_scripting message
and you never answered what smoke_obj is
But I'm gonna guess it is actually the unit
I know... east 1.234 s is not a valid number
A2OA: What are some solid ways to make AI group leaders not take point position? Is the V formation the only way?
how would one display a message in a "proximity" chat? I have a unit that should tell the player something via chat, however this should be only happening when near the unit. sideChat is a bad option here as it is side global:
[format ["%1: %2", groupId _watchGuard, "Slow Down and stop your vehicle, your entering a security checkpoint." ]] remoteExecCall ["sideChat"];```
Is there another option? Apparently directSay needs a audio file
remoteExec target units near a position. eg:
remoteExec ["sideChat",allPlayers select {_x distance player < 10}];
that's neat. My next option I would have tried was to create a custom Radio channel and for the time being add the player into it.
but that works as well
side notes:
commands always remoteexec execute in unscheduled, so remoteExecCall can just be remoteExec.
and yea, there is no directChat command ๐ฆ
Is there an alternative for playSound3D but local to the player?
Not sure if sound sources can play music
I can't seem to find a way to attach a music to an object locally
if you define the music file in a CfgSounds class you could use say3D
oh! thats it! ty
Can you bring markers to the foreground? I have some icons that created first. Then a bunch of area markers with transparency get created. But now the icons are darkened by the area markers
@austere hawk order of insertion I believe
guess the only way is to delete and readd?
Ctrl+X, Ctrl+V I believe
well, scripted
(I'm a believer)
If scripted, well, yep
setVehicleReportRemoteTargets, setVehicleReceiveRemoteTargets, and setVehicleReportOwnPosition
what are these actually about on the low level? it seems not about sharing group to group knowledge (ref knowsAbout/reveal), but only(?) about sensor (display?) information
in other words no relevance for AI, but only to the player as receiver
whats the difference between "sensor" and entity knowledge?
the only meaningful on the discord is here: #general_chat_arma message
but even then its not really confirmed information
sensors share knowledge, that's about it I guess
unfortunately the whole "sensor" upgrade with JETs DLC and around that time is worded so cloudy and unspecific (both config parameters and scripting) to really have any good understanding what all these do and how they relate to each other
like even when we disabled config wise every radar relevant parameter, AI vehicles still have perfect 360ยฐ scanning vision if something is irTarget=1 (only blocked by obstruction and concealment, plus affected things like viewdistance, daytime, fog, AI skill, etc)
A2OA. Is there a way to suspend the game so that a lengthy piece of code is allowed to execute quickly?
execute in an unscheduled environment?
@drifting sky I'm not sure if the isNil hack exists in A2OA, but if it does, use that.
https://community.bistudio.com/wiki/isNil
does alldead compile a new list of dead units, or does it just return a reference to an already existing list?
entry into init is an unscheduled environment, isn't it?
You can test allDead by saving the result to one variable, killing a unit, then executing it again and comparing the current value against the saved variable value.
I believe it would return a new array every time.
not sure what you mean by "entry into init", but you can test that by trying to suspend the script. eg: do sleep 5;, if it waits for the duration then it is scheduled.
I mean the init.sqf... when you enter into it
if it is like a3, it is scheduled.
it does
The command itself exists, yes, but does it run unscheduled?
of course
Is there a way to change the sound controller for footsteps on a single unit without needing to mess with configs?
For example I'm wanting to make a single units footsteps silent for a horror mission
But everyone else to be normal
@civic pine nope, afaik
Sads, hoped there would be a round about way to do it within the mission file
no you can't. script commands cannot return a reference to a in-engine array, if there was an in-engine array which there isn't
yes it does
thats what i said... "i believe it would return a new array every time".
I don't know wany script command that returns a reference
SQF arrays are pretty inefficient
so it doesn't make sense to use them for engine internals
player command also doesn't return the player object, it creates a new object value and returns that new one
Whats the point of the new HashMap?
Saw it on the dev branch and wanted to understand it a bit more.
Faster lookup time mostly
in eden, everytime i use https://community.bistudio.com/wiki/create3DENEntity in my script i get
Trying to create an invalid center EMPTY in RPT. Is this normal? It executed normally, throws no error but still confusing.
e.g. with inputs
diag_log ["input:", ["Object", _flagClass,[_xpos+0, _ypos+2, 0]]];
_flag = create3DENEntity ["Object", _flagClass,[_xpos+0, _ypos+2, 0]];
["input:",["Object","Flag_White_F",[530,5002,0]]]
Trying to create an invalid center EMPTY
โฅ Context: [] L154 (scripts\GridpointSystem_eden_setup.sqf)
[] L155 (scripts\GridpointSystem_eden_setup.sqf)
[] L173 (scripts\GridpointSystem_eden_setup.sqf)
diag.exe i might add
@winter rose Don't suppose you remember helping me out with a waituntil, getting an error with it :D
private "_side_lbText";
waitUntil {
private _cursorIndex = lbCurSel _ctrl_Players_Side_Combo;
_side_lbText = _ctrl_Players_Side_Combo lbText _cursorIndex;
_side_lbText |#|!= ""
};
waituntil returned nil when it run the second time, but this side listbox is never empty?
It works perfectly okay the first time around however.
duu eet bettah!
:c
@brave jungle check that cursorIndex is within range? and that returned string is not nil
is there a way to put a custom texture on the Liberty?
The flag and the ship's name only, iirc!
if setObjectTexturedoesn't work, only a retexture mod could do - if it is allowed to do
modding shouldnt be too hard tho, not gonna bother doing it tho
ill settle with flag and name
How could I open virtual arsenal ( [mode,params] call BIS_fnc_arsenal ) with my array of gear only ? Have a feeling I am missing something but can't find the proper answer still...
don't use waitUntil. That's what event handlers are for
probably
["Open", false] call BIS_fnc_arsenal
is what you want?
In process of rewriting it all now, gave up making that shite work ๐
yes, it blocks loading of all a3 gear content but how to load my array of gear then before arsenal opening ?
dunno. the ACE one has an option for that. the wiki doesn't say anything about the vanilla one.
but you can open the function file and see if it uses some sort of input for that
does anyone know a disable line to disable a specific unit's weaponry to be intercepted by ITC?
itc?
@still forum how do i typecheck if something is a hashmap? Its close to array, so i thought
_hmap isEqualType [] might return true, but its false
_hmap isEqualType createHashMap ๐คท
uh forgot about typeName... typename says "HASHMAP"
A2OA. Is it possible to force AI group leaders to Not take point position within the group formtaion?
gut feeling says, no
the description on formLeader says
Returns the formation leader of a given unit. This is often the same as the group leader, but not always, for example in cases when a unit is ordered to follow another unit.
so it might have been intended to be possible, but I cant seem to achieve it (in a3)
what heppens if you set the group leader to follow one of his subordinates
the game implodes
I would also say when the leader is in a vehicle driven by e.g #10, maybe it goes at the rear of the convoy or something like that
@robust hollow @drifting sky formLeader can only change if the unit has a different order than the leader.
For example, assuming none of these are leaders:
[unit1, unit2, unit3] commandMove _pos;
now units 1, 2, and 3 have their own "formation", and one of them is the formLeader (probably unit1)
that's why when you try unit1 doFollow unit2 and unit2 is following the leader, you don't see anything happening
so if none of the units are the group leader, do they form their own separate mini squad?
there is always a group leader
he is saying in leopardโs example where none of the units commanded to move are the leader of the group.
bottom line is I don't want the group leader in point position, because then they almost always die first.
set them in "V" formation? they would be last
is there any event to detect if a vehicle got repaired?
none afaik
Is there any way to control where mags are taken from in a players inventory when they reload?
the default order is uniform -> vest -> backpack, and afaik is it not possible to change that
Hmm, player inventories are segregated into what are essentially containers, can you prevent players from taking things from these individual containers, like say just their backpack?
And specifically preventing access to their own backpack
This would assume that when a mag item is moved for a reload that it even checks if the player has access to that container
I guess the main issue is that there is no event handler which runs before a reload, only afterwards.
perhaps the 'Put' EH works
This EH could also trigger when unit replaces magazine in weapon with another magazine from unit containers (uniform, vest, backpack) during reload.
although I believe that only works when replacing a magazine which still has ammo in it, not an empty one
or the 'Take' EH, which should work when grabbing a magazine to replace the old one
yeah im pretty much trying to figure out how to prevent players from reloading mags from their backpack
if its even possible
I don't think so... perhaps you could hook on the "reload" keybind, and ignore it when there is no valid magazine in the uniform and/or vest
wouldnt catch scroll wheel reload actions though
which doesnt seem to exist now that i try it. must have seen it in a mission ๐ค
it does when you have different types of ammo (eg. no tracer and tracer)
ah yes, there it is.
It is possible and i did it by rewriting the entire reloading as a scripted logic
oof
I had to do it to make my Arma 2 inventory function
this one:
https://youtu.be/c5NqXoiD0kg
(link to youtube video of the scripted inventory)
Dont mind the other stuff, this was literally the only video of it i had stored on my old disk ๐
setObjectTextureGlobal has worked for me with other vehicles and objects, havent tried with the liberty. You may need to apply the texture to each "section" to make it uniform
But yeah, what @exotic flax probably fits your purpise best
But you need extra logic if you want to make sure the mag gets taken from the Uniform of Vest
I dont think Arma bothers to prioritize any piece over another
You also need to check if the magazine the weapon wants to reload is present in unifrom, not just any
So you'd need to do a query for the magazines a weapon accepts
It gets all really complicated so that's why i just scripted my own reload logic
hi every body what is up
im trying to make a dialogue, that is played through playSound, here is my cfgSounds
class CfgSounds
{
class wholedialogue
{
name = "Sound with advanced subtitle options";
sound[] = { "sounds\wholedialogue.ogg", db + 10, 1 };
forceTitles = true; // will display titles even if global show titles option is off
titlesFont = "PuristaMedium"; // titles font family
titlesSize = 0.1; // titles font size
titlesStructured = true; // treat titles as Structured Text (see below)
titles[] = {
0, "<t color='#ff0000'><t font='PuristaBold'><t align='left'><t valign='top'>RED ALERT!</t></t></t></t>",
2, "<t color=""#00ff00""><t valign='top'>Green text</t></t>"
};
};
};
everything works except the vertical alignment, i want to make text appear on top but its always displayed on the bottom no matter what i put in valign
is it not possible to set valign when used through cfgsounds?
why are you doing this through CfgSounds again?
why not?
valign is relative to the position of the text box, not the screen. it will probably be easiest to use BIS_fnc_dynamicText instead.
that did the trick, thanks!
just use isEqualType as Connor posted
"fix"
yes, but with #arma3_scripting
If I want to make a map marker which displays the server FPS to all clients, what is a good minimum global marker update interval as to not overload the network? I was thinking maybe every 3 or 5 seconds?
yes that
Thanks
hey can someone tell me why this isn't working ?
soldierOne addMagazine ["HandGrenade", 4];
soldierOne forceWeaponFire ["HandGrenadeMuzzle","HandGrenadeMuzzle"];
use addMagazine ร4 for 4 grenades
the problem i'm having is the grenade isn't actually getting thrown
if the unit does not have grenades, it cannot throw anything
be sure they get added
Yeah, still not working. I'm trying to do the cinematic grenade throw by the Ai. This is what I got.
soldierOne addMagazine ["HandGrenade", 1];
soldierOne switchMove "AwopPercMstpSgthWrflDnon_Start2";
sleep 1;
soldierOne forceWeaponFire ["HandGrenadeMuzzle","HandGrenadeMuzzle"];
simple enough and it has worked before.
even without the switchMove doesn't work.
soldierOne addMagazine ["HandGrenade", 1]; โ I don't think this works
no?
it's on arma wiki
tried doing selectWeapon "handgrenade"
and a bunch of other stuff, at a loss.
that's why I say "check that the grenade is added"
soldierOne addMagazine ["HandGrenade", 1]; // that's "one bullet in grenade"
soldierOne addMagazine "HandGrenade"; // one grenade
I am not sure it doesn't work, but please check
I will
how do you do this screen thing? (4:11 - 4:400); https://www.youtube.com/watch?v=0QdJaGn2Apc
what "screen thing"? multiple textures, I guess
^ propably multiple setObjectTextures's with sleeps between them
Or a video
ye
Yeah, no. I'm also attaching the AI to a moving boat. Even when the AI is on the ground it doesn't throw a grenade.
could server mods possibly impact why it's not working?
should not, try in Eden without MP (and ideally without mods) at least
I'm doing this all in eden, Tried executing it through execVM and also through the debug console.
why mentioning server mods then?
setObjectTexture, multiple images
well, I didn't mean server mods. It's just my mods lol.
I don't know why I said that, yeah, this is all in eden.
try vanilla
yeah, ill do that right now
private ["_animEH"];
_animEH = [_inspectGuard, ["AnimDone",
{
params["_unit", "_anim"];
if (_anim == "Acts_WalkingChecking") then
{
// Remove eventhandler
_unit removeEventHandler ["AnimDone", (_unit getVariable ["KI_animEH", 0])];
{_unit enableAI _x} forEach ["ANIM", "AUTOTARGET", "FSM", "MOVE", "TARGET"];
// Ensure correct ending
_unit switchMove "AmovPercMstpSlowWrflDnon";
}
}]] remoteExecCall ["addEventHandler", 0, _inspectGuard];
_inspectGuard setVariable ["KI_animEH", _animEH];```
Can someone explain to me where the string is coming from?:
_unit removeEventHandler ["AnimDone", (_unit g>
15:53:06 Error position: <removeEventHandler ["AnimDone", (_unit g>
15:53:06 Error Type String, expected Number```
addEventHandler should return a number which then can be used to remove the action from the unit. However in my case something seems not right
seems like _animEH instead returns a string if I recall the error msg right
Hehehehe
_animEH is what remoteExecCall returns my friend.
Just use _thisEventHandler: _unit removeEventHandler ["AnimDone", _thisEventHandler];
Thankyou dude appreciate that
Would a high quality gif work by chance? Help smooth off the flow
the game does not take gif as input
jpg & paa only (iirc)
that works, appreciated.
yeah
it works in vanilla
god damnit
any clue as to what mods could fuck with something so basic?
CUP weapons maybe?
what Mods do you have loaded?
Mods
Archipelago,
B61 Nuclear Bomb,
CBA_A3,
Cinematic Lens Flare,
Civilian Airliners,
Cookie's Animations, 6
CUP Terrains - Core,
CUP Terrains - CWA,
CUP Terrains -
CUP Units,
CUP Vehicles,
CUP Weapons,
Death Zone,
Eden 2.0,
Eden Extended Objects,
Eden Objects,
G.O.S Song Bin Tahn,
GCam Cinematic Camera Tool,
GGE: Core, http:
Helicopter Dust Efx Mod,
Improved Melee System,
MCC Sandbox 4 - Mission Making The Easy Way,
nikoaton's Animations Pack
RDS Civilian Pack
Rismarck's Static Animations
Ruha,
task_force_radio,
Tschernobyl Zone Redux,
ZEI - Zeus and Eden Interiors,
Zombies and Demons,
โฆone of them ๐
yeah
maybe two
time to just go down the line and try and figure it out which one by individually loading them xD
oh fuck me this is going to suck
That one in Contact was multiple paas but what about ogvs? They sort of work but that isn't officially supported or have some major drawbacks?
MCC Sandbox, scary. Yeah seems like the best appraoch is to de-select the mods 1-by-1 and check again
what's wrong with sandbox
the coding behind it is bad.
@winter rose @still forum Thankyou guys so far for the helpful advice, but one more question please
videos working on a briefing screen/tv/pc screen object, woud that work? if yes, how please? ๐
hacky way and not working for players without PIP
That doesn't need PiP
_object setObjectTexture [0,"media\ourwar.ogv"];``` - http://killzonekid.com/arma-scripting-tutorials-ogv-to-texture/
whoops Lou was faster
correct, I don't know why I remembered otherwise ๐ค
@opal sand PIP doesn't matter
well it is a kind of "picture-in- picture", but not in Arma's terms
Hm, is there a way to make an object face another object/a player?
Like one of the light cones facing a player as an example
obj1 setDir (obj1 getDir obj2); // iirc
Hi
\o/

no
would also work. Major drawback here would be filesize I guess. Video vs a few images
@tough abyss glad you sorted it
but an .ogv could do the trick though? instead of multiple images? so the referred contact asbeforementioned (4:11 - 4:400); https://www.youtube.com/watch?v=0QdJaGn2Apc)
with drawbacks, see the link I sent
yes
Why not use BIS_fnc_playVideo?
I think i used this one before to play video on a screen
_video = "<Video_file.ogv>";
_screen = <screen_name>;
_screen setObjectTexture [0, _video];
[_video, [10, 10]] call BIS_fnc_playVideo;
Hey guys short question is there allready any solution to exec code from a website on an arma server? Like from a support panel?
Depends on what you want to do
like refunding a destroyed car by spawning it in with last trunk
only idea was do it by db an a worker checking for new code to execute but this cant be the best way
whut? Simply reset the database and let the game check the DB once in a while
The game does not have some API which you can call directly (unless you make an extension for it). So unless you want to go very deep into programming stuff the only thing you can do is check every once in a while for updates and execute that on the server and/or clients.
kk ๐ that was my question wether there is allready an existing extension or not ๐
but then i'll write one for my purpose ๐ thank you
I have one yes
it uses websocket server
but its pretty crappy
and annoying to get working and I think uses intercept..
you can surely do better than that with a purpose built thing
https://github.com/dedmen/ArmaWebControl here is mine. it hosts a webpage that you can use to exec code
Anyone have a lightweight script/method to safezone a particular region? I'd like to make it so our headquarters/arsenal area can't risk accidental teamkill.
Can't use the Protection Zones because TFAR detects the "Protection Zone" as a solid object and when you're inside it all voice comms are incredibly muffled and and broken
you could add a fired EH that deletes the bullet, to all units
note that it would not prevent incoming fire though
are there known cases of playMusic not working?
wrong classname yes
seemed to work in the debug console
maybe I did something wrong in my trigger
it seems that after a certain point in the mission I can't play music anymore
isn't LeadTrack02_F_EPA Aegis Blues?
Perhaps someone used fadeMusic?
nope
Hey maybe someone can help me. I want to use "doArtilleryFire" on the Zamak MRL but it does not work. Tried it with the Nato MRL Tank and it worked without problems. I checked the ammotype and the range and everything is fine. Any Ideas?
Multiplayer optimisation: Global marker commands always broadcast the entire marker state over the network. As such, the number of network messages exchanged when creating or editing a marker can be reduced by performing all but the last operation using local marker commands, then using a global marker command for the last change (and subsequent global broadcast of all changes applied to the marker).
Once I have made the marker on the server and applied all the necessary changes to it, how can I then make it global?
It says perform the last change using a global so does this mean I could do:
"markerName" setMarkerText "markerText";
yes
do all the changes but one with *Local variants, then the last change with a global command
Yep thanks
@still forum thanks for sharing i'll look into it ๐
How do I see the output of my init.sqf file in order to debug?
what do you output? ๐คทโโ๏ธ
the game should tell you script errors in a black box, and log in the arma.rpt
Is there any noticeable error in this?
previousRate = round diag_log diag_fps;
createMarkerLocal ["FPS", [200, 200]];
"FPS" setMarkerColorLocal "ColorGreen";
"FPS" setMarkerText formatText ["Server FPS: %1", initialRate];
[] spawn {
while {true} do {
rate = round diag_log diag_fps;
if (rate != previous) then {
"FPS" setMarkerText formatText ["Server FPS: %1", rate];
previousRate = rate;
}
sleep 3;
}
}
previousRate = round diag_log diag_fps;
ah, brackets?
no; wrong order
you want to round the fps, and log the result of that operation
so log round fps
Oh I see
is initialRate defined, too?
ah yes, initialRate was defined but I changed the variable name after that
formatText ["Server FPS: %1", initialRate]; no
setMarkerText takes string, not structured text
@slate cypress ```sqf
so i've changed initialRate to previousRate
not cpp
ok
ah ok i'll fix this
any way to turn structured text to string?
or should I concatenate a bunch of strings
format?
str can do it too
but we don't want to do that here as it would be stupid
yes, just answering the question
_previousRate = diag_log round diag_fps;
createMarkerLocal ["FPS", [200, 200]];
"FPS" setMarkerColorLocal "ColorGreen";
"FPS" setMarkerText format ["Server FPS: %1", _previousRate];
It says I am missing ; in line 5 and that there is a syntax error where I have used the _previousRate variable in setMarkerText.
_previousRate = diag_log round diag_fps;
```diag_log does not return anythingโฆ ๐คจ
if you do not want to log FPS to the rpt, remove diag_log @slate cypress
ohhh ok
so I seem to no longer get any errors but the marker does not appear for me
_initialRate = round diag_fps;
createMarkerLocal ["FPS", [200, 200]];
"FPS" setMarkerColorLocal "ColorGreen";
"FPS" setMarkerText (format ["Server FPS: %1", _initialRate]);
I got it working now
thanks Lou, dedmen and leopard
so it turns out you don't get a default type
hence you have to set a type manually
๐คฆโโ๏ธ
ah, yep
"Icon"
one other thing... is there a way to detect once the briefing screen is over?
the marker doesn't get updated as I assume the script is paused at this time
how long would I sleep for though?
what I mean to say is, is there an event which fires once the briefing screen has gone
I meant: you can use uiSleep if you want it to refresh during briefing
Ohh
Is it possible to script this command manually (working on Arma 2 mission) with the SQF commands available in Arma 2? https://community.bistudio.com/wiki/vectorWorldToModel
Yep this works thanks
most likely, it is only math/vectors
but don't count on me for 3D math ๐
From what I found is that I need dot product and matrices @winter rose
sin, cos, vectorDir & vectorUp might be the only things you need though
I am NOT clicking that
It's manageable but maybe too PITA for the designed functionality
rewriting some waitUntils to work as EHs instead, got a question about onLoad. Am I better adding this to the config or am I better off using displayAddEventHandler? Also on the latter it continues the trend on removing on, so it would be "load" correct?
onLoad should be added in the config. there isnt much opportunity to add display/ctrl onLoad events via script.
what would be the best way to have an AI track a player and purposefully shoot and miss the ground around them? say the AI is in a heli
create invisible objects at players position that are updated every sec and have the AI target that?
Remember to give the AI 100% skill
So it wont miss the target and accidentally hit the player
No, i think the best way would be to have the AI in the helicopter fire at the player and then delete the bullets. Then spawn a particle effect/sound of the bullet near the player
Maybe even teleport the bullet near the player and make it face at the ground
i have never messed with altering projectiles before. where should i start?
Eventhandlers
You can attach an eventhandler to the AI that triggers every time it fires
You then get the projectile and you can manipulate it like any other object
Set its position and direction
hmmm okay ill check it out then
There are many ways, but relying on the AI to not miss the fake target is one of the worse ones, in my opinion
Im more of a person to do scripted sequences, though, so if you dont like those, feel free to implement your own method
you use the event handler method for your sequences?
I use whatever method that gets me as far away from anything Arma AI or Physics
Never rely on arma AI or physics to function as expected
wouldnt have it any other way
i think ill do something like a projectile distance 3d player comparison then veer it off at some angle
Infact, i went as far as to remove ragdoll from the game entirely because i hate it
@fair drum remember bullet travel time
If you want to be 100% sure the player wont be hit, then i would teleport the bullet at their feet
And slightly away
mk noted
Otherwise you risk having the player move to where they previously werent
And the bullet hitting them regardless
hmmm using HE rounds from helis so I have to take splash into effect too
If you dont need the simulation aspect of Arma, then dont use it
Oh no
HE is bad...
Uhhhh...
maybe... is there a way i can grab a class of a .50 cal bullet? and replace?
during the teleport
Why not just use particle effects instead?
You obviously dont need the simulation aspect
So just spawn particle effects and SFX of the explosion
Near the player when the heli fires
And just remove the projectile
looks like I'll have to pull the CfgCloudlets config, I don't think there is a master list of them on the wiki atm
hey hmmm, was trying to make a simple script to attach vehicles on a boat carrier, everything is fine except one visual bug in first person.. once the player enters one seat, the boat's Z (textures) will always be at the top of everything that was attached.. any idea if it's possible to fix this?
I'm actually not sure if it's a Z problem
I've attached the cars to a memory point of the vehicle and it seems to be changing once the player enters the boat
yep surelly a visual bug, got giant cars by sitting as passenger ๐
hey what is up guys
is it possible to script periscopes going up ? (like in the strider / remote deisgnator you can press q to bring them up)
tq very much ^^
I wanna have a hold action that hides 1 object and shows another
for an mp mission
but hide object global says to call it on the server only
so idk if its better just exec hide object
and for reference I'm using 3den enhanced's hold action creator
should the objects be hidden/shown for everyone or just the person using the action?
@loud birch you can always just move the object somewhere
shows up for everyone
just move it ๐คฆโโ๏ธ
move it like 50cm down
if you want, you can even try some pseudo-animations
well I'd have to rotate it and get the exact xyz of the floor
why?
just get the surface of the floor at the 2d pos of the barricade
move it there and set the rotation
i'd just use hideobjectglobal. getting the message to the server isnt exactly a challenge.

