#arma3_scripting
1 messages · Page 475 of 1
Considering AI driving performance i'm not sure that would make things easier.
This guy made an A* implementation
https://github.com/AmauryD/A3GPS
But i noticed that all these silly checks on existing map objects do not impact performance in any meaningful way as far as i can tell.
It takes a long time, but if you run this every 3-4hrs to spawn a mission, who cares.
Yeah I agree with you, it all depends on the situation and how often you need to perform this
Yeah... in the Antistasi mission there is a road database as well (for civilians AFAIK)
A* is an improved dijkstra as it seems
but yeah implementing an algorithm like that is probably better than my branching attempts
But that's exactly what you asked for... if the piece of road actually connected to the towns (and not a random piece of road instead)
Yes yes
Just try to run it not on the roads from the whole map but on the roads between the towns plus some radius (so that the towns are also included) and it should be fast enough
I think I tried this GPS script and it was making the routs quick enough
The annoying bit is in 80-90% of all cases my script already picks nice spots
but sometimes it just derps out and puts stuff in dumb places
which i think hurts immersion too much
Are you doing some awesome dynamic scenario?
Hmm sounds nice
I did automated roadblock placement in the old antistasi, they would be placed along the frontline, taking into account road width and surrounding buildings 😄
But yeah they were placed in weird places 10% of the time or so
I'm only spawning one main AO at the time
so only 1 to 5 roadblocks or so
so if one is placed really badly, one road might be totally open, if players pick that then zero roadblocks encountered - bad
well maybe not but they might laugh their butts off because the roadblock is on a tiny side street right next to the main road
hmm for that you could check the road width
but these road things get very weird at intersections, I had just to filter out intersections
Because it's very hard to measure the road width at an intersection
In addAction condition expression, where special variables _target (object to which action is attached to) and _this (caller/executing person) from BIKI, e.g.:
_unit addAction ["Move Unit", {call blabla;}, [], 1, false, false, "","alive _target AND _this == _target AND blabla..."];What does this condition mean? _this == _target
== is a comparator. in this case you're comparing if the caller is equal to the target.
result is bool, true or false.
I know the operator, so what does it mean? _this == _target?
Please translate the meaning _this == _target.
it's checking if the caller of the script code is equal to the target.
idk how to explain it better.
Sorry, I don't understand how the caller is the target?
with addAction you attach an action to an object. that object is stored in the variable _target.
this object is passed into the script as a magic variable
so that you may use it inside the script code
also the caller of the script code, so the object that called it, is passed as _this
so you can do a comparison in your script like _this == _target
i'm wondering a bit how that is useful
maybe if you do addAction on every player, and want each player be able to trigger it on everyone else but himself or something.
(might be talking rubbish here now)
I thought when I use the addAction like player addAction ["Move Unit",... blabla... ], I ,as a player, am the _this, and the unit to be moved is the _target, so how _this is _target?
you're the object to which the addAction is attached, so you're _target
you're also the caller, so you're also _this
the terms "target" and "this" etc only apply to the addAction, not to what you're actually doing inside the script you're putting behind the addAction.
the unit you want to move has nothing to do with the addAction
_target and _this have nothing to do with your script code that addAction executes unless you want to use them for some reason (which you absolutely do not need to do to move a unit)
now if you attach the addAction to the unit, then the unit is the _target and you're still _this if you use it.
if some other player does it, then he's _this
but then you need to walk up to the unit to use the addAction
if you use player addAction, then you can use it always
Oh I see. I'm trying to understand you are saying. Thanks a lot. 😅
https://i.imgur.com/LrFztxWr.jpg makes a lot more sense to go this way around for sure
@astral dawn I know a Life site that's selling that Arma GPS you linked 😄
I fail a bit to understand how the came_from is saved to each node
or, how to best save it myself
@still forum I think we must tell it to the author of the GPS script then
Someone posted it on BIF and the scripts they sell for free. But can't find it anymore via google.
But their whole store was a big crapshow of stolen together life stuff that they only distribute as EBO so that no one can look inside it and see that it's stolen.
Just average life stuff.
the GPS scripts is licensed as GPL which allows selling so they aren't doing anything wrong
Just leaving this here. If you feel you can help him, please reply.
Long story short - BIS_fnc_ambientAnim works fine in a SP preview. The animation is played properly etc.
When I tried playing the mission on a dedicated ...
Don't have the link ^^ I knew a guy ripped their paid scripts and posted them for free on BIF. But google doesn't find me that thread.
thats sad D:
if you remember the name site, tell me please !
wasnt it "The Programmer" ? @still forum
Don't remember that website design so probably not
okay thanks you, the developper of TP is the creator of that GPS
The brofiler just locked up with the sqf assembly pbo still in the mod tried without it and looks like the main contributor unde the CBA every frame handelr is acre fnc_speaking but it is 0.5ms so not massive - https://imgur.com/wfDqztJ
The bad contributor hasn't climbed yet so once it does should see it now, nice job Dedman 👍
My name has no a inside it
Only 2ms of frametime is in unscheduled scripts. So that is atleast currently not causing a framedrop
@still forum If it's GPL, they are required to distribute the source (not as an EBO) along with it
Or give them access, and directions on how to view it
Correct. But you can charge for source code or AFAIK even only give it out when requested
https://www.gnu.org/licenses/gpl-faq.en.html#WhatDoesWrittenOfferValid yeah yo ucan
Ambient animations were pretty broken on DS when I tried it last
Can't see that thread just now but will when I get home
Today something else has happened, not seeing the climb in unscheduled but fps is down to 30 again (from 60-80) and its all in visUA, any ideas what causes that? - https://imgur.com/UbOQJHg
It is alternating as well, one frame is 22 and the other is 40+, so lots of stuttering with this only being large every other frame
You're playing antisatsi? I was playing few days ago and I've noticed that when there is an enemy jet our and server fps were around 20. The moment we destroyed it Server fps stabilized to ~45.
I wonder if this might be related to integrated VCOM ai or smth.
There are a few different aspects, none of them are directly scripts, visUA is the big climber, sounds for cars is another (so AI count) and then occasionally indirectly something on frame handle.
parWorldVis checks what things are visible against particles
aka "Is that object visible or are there particles in the way?"
What's weird is that it should be multithreaded. As parWorldVisJob tells you. Things with Job at the end are usually "wait till multithreaded jobs are done"
but they don't show up on the profiler at all. But that could be just because there is no scope inside the job
actually no.... parWorldVisJob is the actual job not the "waiting for jobs to be done" so there is only one job there.
Would be interesting to know which positions it's checking
Not sure. Might be the occlusion check. To not render things that are not visible?
In your screenshot I'm seeing rain. Aka lots of particles to check. Maybe that's why it's so slow. And it only runs on intervals. Not every frame. Which explains why it's only there every few frames
@still forum Yeah, they're not giving a 'written offer to distribute the source code', and I doubt they have any intention to selling EBOs
It was raining but it was also raining before the major performance drop off occurred. Might explain the jobs beneath it but not why the cost of those checks was 40x what they usually are
hey guys, how do i do that: if i want to create some AI, who stay at a certain position, and not attacking me until i approach them ?
@compact maple create unit, assign any idle animation in infinity loop (using AnimDone) and disablAI 😃
that could work but thats dirty isnt it
@compact maple it is normal, when unit find enemy, we enableAI and disable animation
@compact maple or you can use setCaptive
@compact maple https://community.bistudio.com/wiki/setCaptive
setCaptive for that ai will not stop him from shooting at players... with setCaptive for the players... maybe 😃
also this will stop him (but he will be not able look/turn around) > https://community.bistudio.com/wiki/stop
Hey, does anyone know why my while loop is not executed? I'm running CBA and ACE, do they block it for some reason?
{
_target playActionNow "kka3_arrested"; //Make Gesture arrested
if (currentWeapon _target != "") then //Check if Weapon is selected
{
_target action ["SWITCHWEAPON",player,player,-1]; //Unselect Weapon
};
};```
if I put true instead of "kka3_isHostageWalk" in the condition, it still doesn't run.
Well to clarify, the loop runs once, but doesn't "loop" as it should
error inside the loop would make it only run once
Could it be if (currentWeapon _target != "") { _target action ["SWITCHWEAPON",player,player,-1]; };
I have no time to test it right now, but I made bad experience with != operators, could that be the issue? So changing it to if !(currentWeapon _target == "") could solve the issue?
Is it possible to add a new parent element for ace interaction with some other object. Right now I am trying to add an interaction point to a selection name of a unit, it just does not show up and I am not sure why.
private _action = [
"diw_action", // internal identifier
"label", // shown to player
"", // icon
{systemChat str _target}, // code
{true}, // condition
{}, // insert children code
[], // params
"head", // pos
5 // distance
] call ace_interact_menu_fnc_createAction;
["CAManBase", 0, [], _action] call ace_interact_menu_fnc_addActionToClass;
I left the parent array for addActionToClass empty as I am trying to make my own interaction point.
so far it only works when you are using pre existing points which is not what i want
If I haven't misread your post, you can make new parent classes in Configs, so I would assume it works in scripts as well.
@still forum my next guess would be currentWeapon when having no weapon and returning the value of currentWeapon it returns "". But if you want to select Weapon "", nothing happens, the unit is not holstering its weapon
player call {
private _unitDude = createGroup playerSide createUnit [typeOf player, player, [], 5, "NONE"];
_unitDude spawn {
while {true} do {
_this playAction "gestureGo";
if (currentWeapon _this != "") then {
_this action ["SwitchWeapon", _this, _this, -1];
};
};
};
};
```loops^*
So it doesn't work because I didn't change player to _target? The rest seems to be the same
Or am I wrong?
it works with player too 😃
Yea, but maybe not in my script as _target is not the player
a local AI?
i think he not define _target and/or getVariable return false
@strong shard then you didn't read what he told us before
it works once he said, so it does return true, Vlad
_target is defined, I was able to use it in the script before. The loop is just a code snippet of the actual script.
_target is defined by Ace and given as parameter in my script
@ornate quail it is ACE action?
Yep
mb this code run in unscheduled environment?
unscheduled environment has limit on while loop 😃
if this code outside scheduler then it looks like one iteration because this limit reached in one frame
^
Not exactly sure what you mean by that, I'm not really into scripting. I'll read some stuff about scheduled and unscheduled environments and reply tomorrow if I have any more questions. Thanks to all of you :)
Thanks
Anyone know if in a listbox, when you lbAdd something - can you use <br/> or something to have multiple lines for that specific selection?
likely no @cold pebble
but i'm not available to test the theory at the moment to confirm
@hollow thistle Look into RHS Afterburner bug if you're using it.
I am. I will check this out, ty for info.
Do you have any link? I can't find anything recent on Google :/
@hollow thistle No but i remember very recently either reading a bug report somewhere or someone complaining about RHS T-50 afterburner causing loads of issues and i remember that being the case a long time ago. So when you say killing a jet doubles fps and you're using RHS then that would be a reasonably confident first guess.
how do i disable all scops/muzzels accesorys and bipods for my weapon ? so i only can use the stuff i tell it can use ?
Is it possible to freeze all AI at once (keeping the position and animation they were at moment of freeze) while letting the environment active?
Thanks, I didn't even consider this!
@paper thistle afaik there's no such command to disable attachments and allow only specific ones. The only solution to this that comes to my mind right now is: you could make a loop and inside you check if the attachment is equal to your allowed one or if not the remove it.
https://community.bistudio.com/wiki/removePrimaryWeaponItem
You can find the other needed commands on there as well. Also this might help: https://www.exilemod.com/topic/14026-how-to-return-a-weapon-accessory-from-a-unit/
oh well if there are no such script i can fit into my config for the new gun then it is so but thanks anyway for letting me know 😃
Well, you're making a new gun?
yep
Then it's not really scripting I guess. I have no time right now to send you an example. For Configs there is of course a way to restrict only specific attachments. Lemme try to find an example real quick
i am in no hurry to get it out so you can send me an example later on if you want 😃 i am just slowly trying to learn bohemia way of coding in stuff
There's a Config sample and explanation. Should be clear on how it's done. If not then I could send you a code snippet tomorrow. Anyway, Config stuff is related to #arma3_config not scripting.
oh ok sorry thought it was almost the same 😛
It kind of is but at the same time not at all 😋
see with arma you learn something new everyday and in my case i have learned alot of stuff of arma just by trying to make a new gun 😛
Modeling, Textures, Animations, Configs, sometimes scripting when it comes to bolting functions etc... Yea you really need a very universal knowledge when it comes to weapons, but you could do the same for vehicles etc 😄
indeed 😛
Hm, how come there is trigger distance for "Fired" event handler?
I have "Fired" event handler on remote jet, and it triggers only if jet is close to camera (few hundred meters close only)
Me and remote jet are both clients, server is not involved
(FiredMan is affected too)
Seems like all weapons are affected and trigger distance is different
Hm, I guess testing from server side mislead me to believe that Fired\FiredMan trigger regardless of distance, looks like they don't for clients.
I wonder what are the conditions for event triggering then, distance seems to be different for different weapons.
@meager granite maybe it's the server not broadcasting that event with the other client due the distance and him being outside of the zone where he receives client updates from the jet
As in, too far away to bother updating since they can't see each other anyway to save processing
Yeah, probably some kind of optimization
Flares themselves actually do come out though, just no Fired event
Distance being different for different weapons is what stumps me, I wonder how it is calculated
i have that eh in cas (plane) support thingy
private _ehID = _plane addEventHandler ["Fired", {
params ["_plane"];
if (assignedTarget _plane isKindOf "LaserTargetW") then {
[_plane, 3] remoteExec ["SL_fnc_supportProvider", JTAC_player];
};
}];
```RE there that is just report message for jtac player and was no issues with distance 🤷
Sure I can script broadcast everything but I expected to use engine functionality to my advantage
With Fired working on remote entities
Nothing is done easy in Arma
No, everything is always simulated.
Pretty much having Fired event handler on remote entities as client is pointless now, might as well do if(!local ...) exitWith {}; or not add it in a first place.
Actually, looks like I knew about this for a long time and just forgot, vanilla smoke screens don't even spawn on remote vehicles if camera is too far away, since they're created through Fired event handler script.
Hello, I'm new to scripting and am attempting to remove specific items from ACE Arsenal. I've had success removing firearms via [this, ["hlc_smg_mp5k"]] call ace_arsenal_fnc_removeVirtualItems. However, when attempting to remove something such as [this, ["optic_nightstalker"]] call ace_arsenal_fnc_removeVirtualItems the item remains. Could anyone shed some light on why I'm able to remove primary items, but not secondary attachments?
My ACE version is 3.12.2.
So far I can remove primary weapons, pistols, launchers, rail attachments, magazines, bipods, etc. I just can't remove Optics for some reason
Resolved: capitalization matters. -- Nightstalker vs nightstalker
Display EH onSliderPosChanged can only have string?
explain?
https://community.bistudio.com/wiki/displayAddEventHandler takes code or string. And
https://community.bistudio.com/wiki/User_Interface_Event_Handlers#onSliderPosChanged says nothing about string at all
you said display although you mean control?
yeah
and you didn't even say you are talking about Set instead of Add
So yeah. Sure https://community.bistudio.com/wiki/ctrlSetEventHandler read.
Ohh thanks
That wasn't in see also
So I thoguth it didn't exist
I gottaa use dis
It is now! (∩`-´)⊃━☆゚.*・。゚
👏🏻
MIght be a stupid question, but what is the difference between .h, .hpp and .inc?
I see, thanks.
no functional difference at all
SQF files can be called script.blabbelblubber if you wanted
blubber ducky
hey everyone, do you know if theses functions from A2 work on A3 ? https://community.bistudio.com/wiki/BIS_fnc_supplydrop
They usually do
hm thanks i will try it later
I don't know what it is, but it still does the loop only once, any ideas?
[_unit,_target] spawn
{
params["_unit","_target"];
while {true} do //while Var true //_target getVariable ["kka3_isHostageWalk", false]
{
_target playActionNow "kka3_arrested"; //Make Gesture arrested
if (({getNumber (configFile/"CfgWeapons"/_x/"type") in [1,2,4,5] } count [currentWeapon player] == 0) then //Check if Weapon is selected
{
_target action ["SWITCHWEAPON",_target,_target,-1]; //Unselect Weapon
};
};
};```
Your count is completly useless. Why?
and why use / instead of >> ? / is slower. It's only benefit is that you afaik don't need the parenthesis around it. But you have them anyway
You should add a small sleep if running once per frame is enough
did you try to add logging to check if it reaches till after the if statement? Before the closing } for the while code?
I haven't really thought through that line of code, it works but it isn't perfetct. Still the loop runs only once
Is there a get version of ctrlSetTextColor? It would appear there is not
@meager granite Probably your EH doesn't fire because you added it on the client instead of server?
@still forum getNumber(configFile>>"CfgWeapons">> (currentWeapon player) >>"value") == 0 like this?
yeah.. similar to that
but in your thingy you test type in 1,2,3,4,5 that's not value == 0
Anyone know if in a listbox, when you lbAdd something - can you use <br/> or something to have multiple lines for that specific selection? 🤔
@fringe yoke ye, i dont think there is
@cold pebble you already asked that. Try it out. If it doesn't work then probably you can't
Alright, by adding a delay the loop was working, but as I expected it became laggy. I just found an EH who does the job as well
@cold pebble give it a try by assign it the proper style and a ctrlSetStructuredText ?
https://forums.bohemia.net/forums/topic/181604-dialog-multiple-lines-with-text/
https://community.bistudio.com/wiki/Dialog_Control#CONTROL_STYLES That's what google gave me.
Oh look.
ST_MULTI maybe?
LB_MULTI 32 0x20 Makes CT_LISTBOX multi-selectable (see also lbSetCurSel, lbCurSel, lbSetSelected, lbSelection)
I think that's just for selecting multiple lines, isnt it ?
For list boxes, the usage of 'ST_' style constants (ST_MULTI & ST_TITLE_BAR) behave differently than expected for other controls, so use the corresponding 'LB_' (LB_TEXTURES & LB_MULTI) list box style variants instead.
style = LB_TEXTURES; // solid scrollbar
style = LB_MULTI; // multiple item selection
Not sure if there is a better place to ask in this discord, but I am having issues with file patching using the ACE development environment
I had it working previously, but after a fresh install of Windows I seem to be unable to get it working again
You have a z folder in your Arma directory. And -filePatching parameter set
that's about all you need
Yeah, got those 🤔
maybe the CBA cache disable PBO too if you are doing script stuff
Have that too
when I used setup.py it didn't run saying I was missing the ACE Development Environment
debug console. loadFile with a \z\ace\addons\... path to a file updates if you update that file?
https://community.bistudio.com/wiki/isFilePatchingEnabled returns true?
isFilePatchinEnabled does return True
I setup all the folders manually since I couldn't get setup.py to work
I have a P drive too
I can build a release just fine, so everything required should be setup correctly
setup.py is only for building stuff. Afaik not for ingame stuff.
So you have the file Arma 3\z\ace\addons\common\config.cpp ?
i know, I was just mentioning that I got the missing the ACE Development Environment so the folders were setup by me
I am not working on ACE
but I have the equivalent for my mod
sooooo... What doesn't work?
file patching
I load up Arma
find a bug
fix the bug
doesn't get recompiled
I have to build and relaunch before changes are seen
Answer my question then.
debug console. `loadFile` with a `\z\ace\addons\...` path to a file, updates if you update that file?
so theoretically it's possible to work with this filepatching for other addons?
without having to close and reopen the game ?
You can build with build.py from ACE or with makePBO and then by using file patching you don't need to relaunch when working on a mod
I can import my OWN mods into the addons ace folder ?
filePatching works with everything
you can use it without ace being involved in any way
it literally checks if a file can be found in game directory and loads it from there instead of PBO. any file.
im a bit lost. i should activate the pbo first on my launcher right ?
then when i'm making modifications, i just have to delete the PBO and to repack it, and the game will reload it ?
so it need to be basic folders ?
If a file on the same path exists in your game folder. It will load that
having a PBOPREFIX will help
it does have a pboprefix
I fixed my file patching issue anyway.
I used mklink /J "[Arma 3]\z\mymod" "P:\Arma3Work\mymod"
Arma didn't like that for file patching for some unknown reason (P drive is also all junctions)
I had to use mklink /J "[Arma 3]\z\mymod" "[My Documents]\mymod"
then it worked just fine
i got it, its working, thanks you two
junctions afaik don't work across file systems.. Wrong. But they only work on NTFS.
I use symlinks. Never had any problems
Windows Explorer had the paths working just fine, same with my text editor. Oh well though, easy fix ¯_(ツ)_/¯
Is there a way to return the current Action / Gesture? For example I want to prevent the player from switching weapons, but AnimationState doesn't work as it's not an animation but a Gesture/Action.
@meager granite range for the WeaponFired event is max (ammo.visibleFire*ammoCoef.visibleFire, ammo.audibleFire*ammoCoef.audibleFire);
Coefs come from silencer for example.
I'll add that to the wiki notes for that event
Don't know about FiredMan but I'd guess it's the same.
actually all "Fired" effects are controlled by that. Adding heat to the weapon (TI), the sound (obviously), the ejected cartridge being spawned (also obvious), FiredNear EH, and maaaaybe.... potentially also notifying nearby AI. If they are local to your computer, not the server.
I guess if he added them at the machine which spawned the units then it would work without the distance check, right?
locality is what matters. Not who spawned them
If you add the EH where the unit is local then yes. It would fire locally and not depend on the range of that network event
Aren't they local to you when you createVehicle them?
For a vehicle. yes. Until someone get's in the driver seat.
For a unit.. You don't createVehicle a unit
createUnit a AI it is local to you. Until you add it to a group. The it's local to the groups leader
Noob question for the day : what does FMS stand for. I have been googling for it but cant get an answer
Finite State Machine
FSM?
That one yes
FMS is also False-Memory-Syndrome
Oh lol 😄
Obviously in Arma 3 terms
It's a way to implement a sertain set of actions or states... like a traffic light IRL or in arma (and other games) AIs are made with FSMs
Finite State Machines have states and transitions.
A FSM file defines SQF scripts for the conditions for each transition. And the code that's executed on a transition to a different state.
Ok i found the wiki in bohemia i will read it up thank you my issue was typing FMS rather than FSM
So if I had to make the EH run all the time regardless of distance on the server, do I have to watch the vehicle's locality constantly and add the event handler to the machine who now owns the vehicle?
Yeah.. Think so.
Don't know a way to make the EH transfer automatically
There is a locality changed EH tho
@still forum Thanks for insight. Different trigger distance indeed gave me an idea it has to do with some config values related to visibility or sound audibility
That's weird, I recall I used the 'fired' EH well on the server, it was working all the time.
The client always sends the message to the server. But he also sends along a "Range of where this event is relevant" and the server decides based on that which clients to notify about it
I wonder if shooting slow projectiles (missiles, bombs) still triggers regardless of distance, probably does
Actually, might be not, considering that Fired doesn't even return the entity of the projectile (There was something about projectile entity being null in Fired event on remote vehicles, can't fully recall now)
Maybe...... reyhard recently mentioned that CfgAmmo has eventhandlers. It has a fired eventhandler. The projectile might be spawned regardless of FiredEH firing. And if the projectile spawn calls the CfgAmmo eventhandler that might work. But the eventhandler is config only
Yeah, there is no projectile in Fired event handler if shot is slow. And no, Fired event handler still doesn't fire over certain distance regardless of shot kind.
That thing also influences the muzzle flash and cartridge drop and stuff. I wonder what happens when you have a silencer that reduces audible/visible distance to 0. Stand next to the guy but don't see/hear him shooting? 😄
The perfect silencer, doesn't even show you shooting 👌
Addition to that. On serverside the range is multiplied by 2. and used as the "error" value. error specifies the priority of getting the message out. And if the message is above a max age. It will just get discarded.
So it should technically still arrive. Just after some time. In your case(Or in any case if it is too low) the message will timeout before it's priority get's high enough to be sent out
That is then dependent on MinErrorToSend/MinErrorToSendNear setting
Waaah.. Forget half of what I said. Everything about priority and time
error = visible value (from before) * 2.0
agecoef = 1- (currentTimeInSeconds-timeWhenMessageArrived)*(1/5)
errorCoef = (20*20) / (firePosition distance cameraPosition)
if THEN
error*ageCoef*errorCoef < MinErrorToSend or < MinErrorToSendNear then the message is discarded
I hope that's understandable?
Having a hard time with this networking stuff.
If you have time. Can you write that up into a wiki note that I can add on the eventhandler page? I don't feel like my brain is up to that task.
Sure, I will add a note about trigger distance.
I already added a note before. But I missed all this error value coef stuff
Ah you mean in-depth details. Maybe its better to just mention that it is dependent on visibleFire and audibleFire as well as connectivity
Yeah. Maybe look at my note. Maybe you're fine with it already
Hm, Tigris\Cheetah cannon ammo has values of
visibleFire = 38;
audibleFire = 200;
```and event fires are max of approximately 12600 meters, not sure if these values are related
quick question, what would be the good syntax ?
onMapSingleClick "[_pos select 0, _pos select 1, _pos select 2] call life_fnc_teleport;";
18:53:15 Error Type String, expecting Boolean
onMapSingleClick should return boolean, life_fnc_teleport seems to be returning string instead of boolean
@meager granite i got it, thanks, its fixed
?
[_object,false] remoteExec ["enableSimulationGlobal",2];
can some one add this exemple for players to call the enableSimulationGlobal?
fixed
Now it's correct 😉
because
_object enableSimulationGlobal false;
Does nothing for clients
Done.
Thanks.
Hey, is the GPS displayCtrl still findDisplay 311 displayCtrl 101 because when I add a ctrleventhandler it does nothing?
is it possible to remove items/ blacklist items from an ace arsenal" ace_arsenal_fnc_openBox" rather than initbox? if so what is my route?
Does anyone know a way to use hideObjectGlobal without removing collision?
Use some invisible object instead?
The object is a player's object though
@tough abyss No. But why not initBox first?
Is their a function to determine if a unit is in smoke?
Is there a way to get the number of people connected to a server?
not allPlayers, but the total connected, even people in the slotting screen
Don't know if PlayerConnected EH fires for them. It could but probably doesn't
Basically what I am trying to do, is wait for everyone to be fully loaded into the mission at the start
so I need to know how many people are still loading
maybe playableSlotsNumber will helps
Don't know how that could help...
number of playable slots doesn't give you any info about how many are filled
"filled" slot taken by player ?
playableSlotsNumber > Returns the number of available slots in mission per side (both empty and taken).
🤔
also playersNumber 🤔 x2
Players who claimed a slot in the lobby but didn't start the mission are counted as well.
Looks like that might do it
kind of annoying side is required, but I should be able to make it work
AI bots will be treated as valid players and will be counted too oof why
but you can also count the AI's by counting the !isPlayer in playableUnits and count them out then. playableUnits only contains spawned in units
yeah, just gonna make it messier than would be ideal
@rough fiber the display must be visible
Is there a way to spawn units into a flying plane directly? As cargo, not crew? BIS_fnc_spawnCrew works fine to spawn pilots into flying planes, but there does not seem to be an equivalent for cargo. I know about moveInCargo but i don't like that i have to spawn units somewhere first and then move them in.
Meh. I just unpacked the functions_f pbo, and in line 87 of fn_spawnCrew.sqf you find:
_unit = _grp createUnit [_crewType, position _vehicle, [], 0, "NONE"];
So they just spawn the AI on the same spot as the vehicle, and then they're later moved in:
_unit moveInDriver _vehicle;
That's one hacky solution. I mean it works but if you put a sleep 1; in there the vehicle looses all wheels and the soldier dies 😐
No there is no way to spawn unit in vehicle, only spawn then move in
moveIn* commands don't care about unit position, spawn then anywhere you want.
Look at moveInAny, might be what you want
I was thinking of just spawning them outside the map in the air, but i am concerned if lags etc happen. The BIS function is only safe if the unit is moved before the unit/vehicle takes dmg by being glitched into each other.
But thx for confirmation Sa-Matra i'm never quite sure i missed nothing.
Hi does anyone know the script for arma 3 rp so only gangs or police can open gates
trying to use BIS_fnc_showRespawnMenu
Everything loads but the respawn button does nothing? I can't see where I need to call extras, as they seems to call eachother?
hey i have a question not around here so often but i am searching for a Sandstorm script that has really bad visibilty
basically with very limited vision
Armaholic has one
is it the MKY one ?
my unit used that one before but its not really what i am searching for
its not really thick
Hey Guys, could Need some help. I wanna sort vehicle classnames in two groups, armed and unarmed. Does anyone know how the check could be done? Already looked in the config viewer but there aren't any informations about the weaponry of a vehicle, or I'm to blind to find it.
Is there a way to access the preconfigured unit lists for infantry groups that you can place in editors via skript? I looked at the config but i didn't find it.
Look at CfgGroups
Oh i'm an idiot. I looked in there and just totally overlooked it. Thx.
Can you execute SQF's while in zeus using achilles?
Depends on the nature of the script
Because some require to be run from the init of the mission
And if you have to execute it on an object
Thats not a vehicle
Then you have to give it a variable name
And use the execute code module
So you can only execute it on objects?
No
You can execute sqfs on anything
Its just that objects dont bring up an init field
When you try to edit them in zeus
Unlike vehicles, ai and players
Np
just one more question, if you assigned them a variable to an object via a module, then ran an execute code module, wouldn't you be able to bypass the init limitation?
Exactly
Thats why you should give objects variable names if you want to run scripts on them
ah okay, that makes it alot more clear
Achilles does have a execute code module
But you can't drop it on an object and execute the code
you can use cursorTarget to get the object you are aiming at
not sure if that works well with zeus camera
you can also save your zeus mission and then copy the sqf code into the execute code module and have a prepped zeus mission loaded without dealing with the 3den editor
wooo that might also work
Does anyone know why 0.03 min 0.2 results in 0.03
lol
Ah i know that but i didnt read the min function properly
did you think it's going to subtract? :P
probably thought the minimum function returns the maximum of the two numbers
possible to create conical light sources (flashlight)? if not, can you hide a street lamp objects body but still keep the light it emits?
hideObject might work on street light
hideobject removes all
diretional light with only scripting. no.
is there a flashlight object mod i can just attach to stuff?
Basically, we've been trying to make a Music Mod. And it works great, before we decided to create another music mod because we wanted two seperate mods. Now only one of them loads. Great.... Any suggestions?
@tame portal ill go gay for you
wot
who wouldn't, I mean
There is a nice editor module to spawn mines - can i use that with a script, too? My google fu failed :/
You could probably call the mine function through a script. Not quite sure which fnc it is, but you could probably find it pretty easily in the function viewer.
Don't take my word for it though
Hmm I remember Dedmen said that the profiler addon dumps all local variables' valued to the .rpt on script errors. How do I activate this? I've installed the intercept and the ArmaScriptProfiler addons and they seem to have loaded fine.
Thanks! This one?
https://github.com/dedmen/ArmaDebugEngine
yeah. Just made a release build on there
Cool, I'll check it soon. So tired of these errors
Since when does synchronizedObjects building no longer return anything (for buildings)? This broke some of my missions. :(
synchronizedObjects otherUnitThatIsSyncedToABuilding still works though.
Edit:
Seems this is true for all "non-intelligent" (except game logic)? objects. e.g. also empty vehicles.
Related: https://feedback.bistudio.com/T126516
Edit2: Interstingly get3DENConnections building select 1 still works (but only in 3DEN obviously)
@astral dawn what intercept? 😮
IF you google it up you will find it easily
Should I ping someone (specifc) about this synchronizedObjects bug?
Are you using that for a eden module script? That would also have a second way to access synchronized objects
No, it has nothing to do with 3DEN, but afaik get3DENConnections building select 1 would be the equivalent command in 3DEN ... which still works.
https://community.bistudio.com/wiki/synchronizeObjectsAdd ? Why not just force it instead of using editor wonks
maybe it'll pop up then
//Script 1
_handle1 = [] spawn {sleep 10;_h="";};
_handle2 = [] spawn {sleep 10;_h="";};
handlearray = compileFinal (str [[_handle1],[_handle2]]);
systemChat str handlearray;
// Script 2
_test = handlearray;
systemChat str _test;
``` I'm using compileFinal on a array, how do i get the array back to normal since it returns a code with an array in it
call it
does not work
call it.
call compileFinal
tried alot of things
@edgy halo code is wrong, you can’t convert string to script-handle
Well, how would i do it different, i want to store script handles on client . and let servert execute code on client and check if it is still running
i dont want any client to overwrite it
Both ways and reverse dedmen, I think I found your kink.
I dont get you Dedman, can you give a small example
i dont want any client to overwrite it can't.
@high marsh synchronizeObjectsAdd doesn't work either. The problem isn't that the objects aren't synced. It's that synchronizeObjects simply doesn't return anything sometimes.
just store the script handle in a normal variable
//Script 1
WIT_handle1 = [] spawn {sleep 10;_h="";};
WIT_handle2 = [] spawn {sleep 10;_h="";};
// Script 2
systemChat str WIT_handle1 ;
I should be able to do that but i will have to make some if statements instead
Is there simpler expression than this? :
(cursorTarget isKindOf 'CAR') OR (cursorTarget isKindOf 'TANK') OR (cursorTarget isKindOf 'Helicopter')
no
thx Dedmen
I wonder if pre-scanning entire CfgVehicles config and then doing typeOf cursorTarget in classesList will execute faster, probably will
if you prescan for these isKindOf's then yeh
Recently found out that CfgVehicles config has fast lookup enabled
Very few classes do. The others just iterate over all entries
Although I thought they were all hashMaps.
But CfgVehicles has some special thingy to find entries faster
PreloadConfig?
ye
Yeah noticed that some time ago too
Nope, in array is much much slower 0.00868ms vs 0.00180ms for triple isKindOf
count classesList => 517
Thought in array was quicker
I can immediately see that you have a Intel CPU 😄
Yep, why? Does arma utilize multi-threading well for such searches?
no
I don't yet know why. I guess better prediction and bigger cache
I made a mod that replaced the interpreter. I think about 10x speedup on AMD. None on Intel because Intel was already at the edge
I'm still on buldozer though. Dunno how newer AMD fares
Much better. Honestly i am tempted to start a kickstarter for a new pc for dedmen. It is sad to see someone competent wasting time on optimising for bulldozer µarch
Hah... Dedmen is fine with Bulldozer
The Latest AMD family May be better, but there should be no pressing issue with the Bulldozer Plattform yet
Hell... Even my phemom II still is doing fine! Just that I Start to feel that bottleneck in modern Applications more and more.. But that has to do with less optimized Apps
Well when i went from Phenom II to Skylake the jump in performance in ArmA was gigantic. Easily doubled or tripled fps in multiplayer. TOTALLY OFFTOPIC THO
Being on worse hardware is a good stimulus to optimize your stuff well
Usually i would concur, i used to marvel at what people did with super cheap 8bit risc hardware and inline assembler. But the Bulldozer µarch is not just linerarly slower, it is simply a different (failed) approach that is now entirely irrelevant. I don't think it is worth optimising for it at all especially since even AMD moved much closer to intel's current approach. But then, i'm not an expert, i just pretend to be one on the internet occasionally.
Well I meant not optimizing for it specifically, we're talking Arma here, meant trying to squeeze as much FPS out your scripts as possible.
Wich reminds me to do speed comparisons between arma and my sqf-vm implementation
during a3 alpha friend of mine was playing on "toaster" with average 10-15 fps, so when he had somewhere close to 20 ish that was a sign that scripts are 👌 😃
You guys are about to make me read the code optimisation guide a 5th time.
You mean you cannot recite it from memory yet?
I think my brain has like 100kb of memory, tops.
that's enough to remember 3 different script commands and the location of my coffee machine.
100kb is a lot of text
A condition of unit presence defined in the editor - can it contain a variable expression and at what point in the initialization should those variables be set?
"Condition of presence evaluated at the scenario start, must return boolean expression. When false, the object is not created at all."
No idea myself. Just do a quick test, add diag_log in your init script and diag_log in condition field and see in RPT which gets called first?
init field will be the first one
probably most reliable way will be after time > 0🤔
Searched forums and it seems preInit functions need to be used to set those variables
afaik objects are not initialized yet in preInit... so gl
is there a way to retain player controll if you create a camera and switch to it? I want to make a custom third person cam for servers which have third person disabled.
No
You can issue commands like walking (playMove "WalkF", etc.) into direction to unit though
hmm. The thing I needed it for is, I do have a playable dog and the camera position for it sucks pretty hard.
Well I gues you might be able to simulate controls over dog like this, not sure how precise it will be though
Best approach would be to have an addon that moves the camera properly
hm i thought the camera is parented to either the head or the pelvis bone.
Can't recall to where exactly, but there is camera offset array in vehicle config which you can change
Oh actually, I've been looking into it just recently, it rotates around "zamerny" memory point
Anyway, camera position offset from that point can be configured without touching the model
hm. I guess i look into that at some point.
right now i just add the base functions to the dog player
you gotta be a good boy and sit down 😉
Which camera view are you trying to change? Third or first?
You can sort of emulate control by issuing movement commands after movement keys were pressed
Not sure how usable or precise it will be though
It will not be precise enough, the dog would be then an agent as well then, which i do not really want.
I assume you're using BI dogs models?
I already have made dog agents and they are really finicky with the "run through solid objects" thing.
yep
memoryPointPilot = "head"; in the vehicle config should fix first person iirc
<- has spent far too much time working on playable dog stuff
lol. yeah it is a thing many people want and I just make these for my oddball missions
sane as basically any script beginning with the anomalies to the ragdolling one
It's super possible to build out as unit based off CAManBase but there's some issues with it
Mostly no damage hitpoints
diwako, check kk's comment there > https://community.bistudio.com/wiki/switchCamera 😃
You can give it throw and put weapons though, and if you're using ACE the dog can then pickup grenade objects like chemlights via ACE advanced throwing
ooooooooh
switchcamera, i forgot about that command!
I used that one in one of my spooky mission where you suddenly are in someone else's body for like a split second.
or something similar
ayyy, that works
tho it will most likely require PIP enabled
or actually, no this whoudl work without
That works better then expected, only that the attach to cannot keep up.
https://streamable.com/39x72
This scene had over 300 fps and video was recorded in 60 fps
noice 1 m8
attaching the camera to the head at 0,0,0 was a bad idea already
https://i.imgur.com/fidWxHE.png
Hm, I forgot that you can still control yourself when switching camera to another entity 🤔
don't worry about it. I also forgot about that command
another interesting issue now is, I wanted to make the dog be able to leap forward. I noticed the velocity i set is only applied at one frame and the dog it self will just stand there doing nothing
player setVelocityModelSpace [0, 10, 10000000];
not even this makes the dog do anything.
nope
Anyone know why this dialog and its controls (https://hastebin.com/vocimokoca.cpp) don't retain the correct size and position when the resolution/aspect ratio changes?
I am using safezone for sizing and position, which i thought meant that it would adjust the position correctly no matter what aspect ratio, but some of the controls are still a bit off. My theory is that there is small area on the screen in which this is true and if the dialog goes outside this area (when using safezone) it all goes to shit. Am i on the right track or way off?
@limpid pewter inside group positions is relative to group-control
@limpid pewter and safezone for entire screen, if you need 25% from group-control you need use group-control size instead
Hmm.. But the control group is also using safezone. Shouldn't that mean that its child controls follow the same sizing? or do you mean because the children controls are relative to the control group and not the rest of the display, it doesn't notice the change in aspect ratio?
@limpid pewter [0,0] inside group = top-left corner
@limpid pewter and bot-right corner = [w, h] of this control
ok, makes sense
So it should look more like this: https://hastebin.com/xoboqicuqo.cpp
Where all child controls don't use the safezone constants, but rather use sizing and positioning values relative to the control group
@limpid pewter x = “X * groupW”; y = “Y * groupH”; w = “W * groupW”...
@limpid pewter replace groupW/H with w and h from group-control
Is it possible to pass cursorTarget as addAction argument?
player addAction ["test", {call ciy_fnc_drag;}, [cursorTarget],1,false,false,"","blabla... "];
You mean, fn_drag.sqf: _obj = cursorTarget; ?
{[cursorObject] call ciy_fnc_drag}
0
@strong shard Multiplying everything by the height and width of the control group didn't work unfortunately (sorta). But your other advice about the child controls being positioned and size relative to the group helped alot. In the GUI editor i moved the control group to position 0,0 (using safezone), then using absolute value i placed the rscStructuredText controls to the position i wanted them in, and it worked :D.
Essentially i just got the size and position in absolute values relative to the group and used that.
Thanks Mate 😃
I'd say that this should remove all items from AI's (though not only AI but any soldier that is of type "Man" so players too) inventory upon getting killed but it doesn't:
params["_killed"];
if (_killed isKindOf "Man") then {
removeAllAssignedItems _killed;
removeAllItems _killed;
};
}];```What am I missing here?
First you're missing a proper error description. What actually happens? Nothing? Script errors? Some items not being deleted?
in that form the script doesn't give any errors and also no items get removed when I as a player kill an AI
(so nothing really happens)
you have script errors turned on? so you usually see your script errors?
I'm testing the script on a dedicated server for which I have a console open at all times so that I get to read the mission output constantly
did you check if your if condition actually turns true?
_removeItems = addMissionEventHandler ["EntityKilled", {
params["_killed"];
if (_killed isKindOf "Man") then {
systemChat "true";
removeAllAssignedItems _killed;
removeAllItems _killed;
};
}];
tested just now and there was no true being output to systemChat so apparently it doesn't (turn true). Uhh, whyy
what's inside _killed?
Apologies, I don't understand what you are asking
try that
_removeItems = addMissionEventHandler ["EntityKilled", {
params["_killed"];
systemChat format ["_killed: %1", _killed];
if (_killed isKindOf "Man") then {
systemChat "true";
removeAllAssignedItems _killed;
removeAllItems _killed;
};
}];
either there is nothing inside your _killed var, or it is not of type Man
no results by adding systemChat format ["_killed: %1", _killed]; in the mix. I mean, the game did not output anything in the systemChat when I killed an AI
Both commands take local argument, is _killed local?
the whole bit of code you posted isn't being executed. otherwise you would see "_killed: any" in chat at least.
either you're adding that code in the wrong spot (server/client locality) or your eventhandler is wrong. I'm not terribly experienced with EventHandlers.
If I add a deliberate error in the script (removed the last }]) I get an error so it "should" be exectued
but that I don't know if the script executes correctly when someone kills someone
btw CAManBase < do not includes rabbits and 🐍 😃
Thanks for the tip sldt1ck 😄
how can an AI soldier be something else than typeOf "Man" and/or "CAManBase" unless one has deliberately changed the type to be something else (can such thing even be done)
that's not your problem
your "typeOf" is never evaluated
i think.
try:
_removeItems = addMissionEventHandler ["EntityKilled", {
params["_killed"];
diag_log format ["_killed: %1", _killed];
if (_killed isKindOf "Man") then {
diag_log "true";
removeAllAssignedItems _killed;
removeAllItems _killed;
};
}];
This might also be a good moment to check if the EH is applied at all
this came now with diag_log immediately after killing an AI soldier
15:29:31 "true"
15:29:32 "_killed: cc7a3000# 1030699: dummyweapon.p3d REMOTE"
ah.
everything i said previously was rubbish. i now say the opposite: your EH works and your commands to remove the items do not work.
I at least can't come up with anything else than
removeAllItems _killed;```but I bet there a million other ways to script and make the item removal work
Removes all special items from the unit.
special items? that sounds like toolbelt items or something
probably ignores weapons and magazines or something 😄
removeAllItems should at least remove compass, watch and map. Maybe even FirstAidKit. No?
Remove Everything and make blank slate:
removeHeadgear this:
removeGoggles this;
removeVest this;
removeBackpack this;
removeUniform this;
removeAllWeapons this:
removeAllAssignedItems this;
I have that removeAllAssignedItems covered but no, nothing gets removed
i just did
removeHeadgear player;
removeGoggles player;
removeVest player;
removeBackpack player;
removeUniform player;
removeAllWeapons player;
removeAllAssignedItems player;
and now i'm buttnaked.
sure sure I bet you are :D
But using player does not remove stuff from _killed AI
Could it be that once the entity is killed, it stops being a unit you can remove gear from with those commands, but rather turns into a groundweaponholder or something?
I'd hope it would not be so.. but probably is. Would have been more nice if this had been an easy thing to achieve
can confirm further that the script works with removeAllContainers _killed;With that the killed soldier loses its uniform + all the containers it has (backpacks, vests)
Does anyone know where I could find the original arma 3 inventory scripts?
I want to modify the inventory display and add a few custom options
Ive got the display done, just need to code it now. Wanted to see if I could hook it in with the default scripts before making my own
@tiny wadi As far as I know logic wise it's pretty much hardcoded into the engine, but the displays are changeable
What is an efficient way to get any unit in a 45° cone in front of you. Right now i am using lineIntersetsSurfaces, but that is just riiight infront of me
private _res = lineIntersectsSurfaces [
AGLToASL positionCameraToWorld [0,0,0],
AGLToASL positionCameraToWorld [0,0,10],
player,
objNull,
true,
1
// "GEOM",
// "NONE"
] select 0;
get all units. Get their position. get your position and view direction. And Math.
Try forEach allUnits inPolygon
i was thinking about attaching a trigger infront and see what is in the list of it.
it is an action which could go each second
inAreaArray?
You can make a rectangle rotated 45° so you get All units in there
Like this: https://s.sqf.ovh/Discord_2018-07-29_17-23-29.png
yeah, i was thinking about something like this.
That would be 90 degree cone
that is fine with me, internally I do a distance check anyways, so the upper part is not counted in anyways
allUnits select { _dir = (player getRelDir _x); (_dir <= 45) || (_dir >= 315); }
Ah yeah. That would work. But not very performance effective
private _pos = player modelToWorld [0,2,-1];
private _units = (allUnits - [player]) inAreaArray [_pos, 2, 2, (getdir player) + 45, true, 3];
private _target = objNull;
{
if(alive _x && (_x isKindOf "CAManBase") && {((_x distance player) < 2.5)}) exitWith {
_target = _x;
};
false
} count _units;
that is what i got now, it works so far
allUnits are all alive and of CAManBase by default
ah, tho nope not the second
right now my player unit is a dog
till shows up in allUnits
Are you remote controlling the dog?
nope
selectPlayer dog?
Yeah, then player will be in allUnits as a dog
i have a player respawn EH that is running twice, how do i stop it from duplicating ?
Still it would probably be more efficient subtract player dog object before the loop like you did with player than check type each iteration
Is 40 lines of code + 20 lines of log above the "you'll get murdered for posting it directly into the channel" limit?
if in doubt use pastebin or equivalent
Don't worry there have been so many 9999 character messages already without any code tags or anything, but anything above 30 lines I'd drop in paste or hastebin aswell
Does your code take dead ends into consideration?
Sometimes on a regular road two road segments don't report each other being connected
not yet, but i tried a lot of different spots and the code always behaves the same
The roads are actually connected, that is not the issue.
kind of a stupid question, but I'm trying to pull what type of man a player is currently playing as (such as B_Soldier_F), what's the command to do this?
alright, thanks
I was looking under get* at BIS wiki
hmmmm, so I'm trying to make a player's loadout reset to the base loadout of the unit they're playing as when they respawn
so I made an onPlayerRespawn.sqf in the mission file
and in that I put
_playerCurrentClass = typeOf player;
_standardLoadout = getUnitLoadout _playerCurrentClass;
setUnitLoadout player _standardLoadout;
doesn't seem to work though
setUnitLoadout player _standardLoadout; what's that supposed to be? That's a syntax error
hnnng i found my error.
i didn't check if the currently processed road isn't the _dir_road as well
@waxen tide Did you delete your messages?
yeah i don't want someone to crawl thru my bullshit for an error i already found.
Was just about to do it :P
Well thank you, that would have been very nice of you.
@peak plover The description for that seems wrong
yes
Seems like it's got the default description
It returns an array containing all layer names
I'll check which commands are missing when 1.84 is out
Hey, in regards to https://community.bistudio.com/wiki/BIS_fnc_showRespawnMenu
How would one actually make this work? I've tried to use it, but the respawn button doesn't work :/
probably you will need respawn templates class in description.ext... and position
Yep all present
It works normally, but using the function to open the menu, for some reason, makes the button clickable, but it does nothing
It opens, then I can't esc it
yep
have to use flush
lol
😃
what is task there ?
Loading startup for JIP players, but then I want the respawn screen to be present after it. I've got it currently killing them but I feel it's too messy killing them afterwards
Loading startup for JIP players
that is some scripts/intro things ?
Yeah
titleCut ["", "BLACK FADED", 10e10]; > waitUntil {visibleMap};> openMap [false, false]; > "Loading startup for JIP players"> openMap [true, true]; < i have something like that in one mission
yep
I say load
Work*
https://imgur.com/a/K8e8L2Z
This is my problem
I can spam the respawn button
but nothing :c
Noob question here, how do you execute scripts outside of a mission folder
debug console
throught execVM right? how do i call it outside the mission folder though
you can use a PBO
some guy called an ogg. that spooked me
and run \mypbo\functions\myfunction.sqf
oh I read that question wrong hahha
or if its the server you can run scripts from the server directory
say i am running master zeus, would i still be able to use mypbo
can't find the mission file in documents
or if its the server you can run scripts from the server directory with filePatching enabled
@meager heart The function seems to be broken, or atleast others say that too, gonna create a bug thing for it
no way to do it via listen server then i'd assume
So if i run file patching
is it possible to deposit scripts into the game's directory?
yes
looks like you have problem with respawn position, not with the menu
[player, [worldSize /2, worldSize /2, 0], "Test position"] call BIS_fnc_addRespawnPosition;
```try this ^ (and don't use modules for respawns)
@brave jungle
Well even so, there is a problem in there somewhere
i'll go try now
@meager heart Didn't work
🤔
odd, i made a subfolder named Scripts in arma 3's directory and ran an execvm Scripts\Subfolder\test.sqf and it said it was not found
did it in listen server with filepatching on
What does isFilePatchingEnabled return?
Whether FilePatching is Enabled
^^
Anyone know how to make a sleeping script
Or animation
Or if there is already a script for that?
Just when you click sleep it goes into an sleeping animation
only that
playMove. Done.
Just need to find the animation
you can use the animation viewer in the debug console for that
or, playMoveNowOrElse
this addAction ["sleep", {jan1 switchMove "Acts_SittingWounded_loop"}];
When I do thid
this
It goes into animation
But then after 1 second it goes to just prone
I need an idea how to approach a problem. I've been tinkering with it for a week now and i've tried 20+ things and scrapped them. I'm trying to find spots inbetween cities for roadblocks that aren't on sideroads, deadends etc but rather on the important main roads. It seemed like an easy problem but i'm really struggling. Do not need code, just the right idea.
i don't have an idea for you, but would be nice to know the main stuff that you've already tried out, so that people don't end up suggesting those same things again. Also which map are you doing this on? I've heard the Altis road network is just way better defined than Malden or Tanoa, for example.
I'm trying to keep it map independent, but i've mainly focused on Deniland for now. Altis is much harder because a lot more irrelevant small side roads in cities, Deniland has a lot of cities that are just 2 rows of houses next to the road.
Maybe check bounding box for road segment, main roads seems to be wider
I think bounding box doesn't work, but I believe going to the side of the road on one end and always measuring "isOnRoad" or whatever the command is called can reveal how wide the road actually is
That's something i didn't try yet.
I just remember me having the same problem and ending up with such a solution 😛
just a quick question but is it possiable to create a script that turns an object like a barrel into an explosive prop?
so you shoot it and it explodes
Yes.
how would one go about this
hit eh or something that detects hit events. Replace barrel with explosion. Bam.
Flexible Fuel Tank both Forest and Sand explode when you shoot at them
script handle will become scriptNull after scriptDone right ? 🤔
oh nvm... yes about ^ question... if something
yeah, probably it's time for sleeps and not for scripts here
@noble pond theres no reason for it to exist any longer after it has finished
scriptDone command. How is it supposed to check if the script is done if the handle doesn't exist anymore?
Or might aswell be that scriptDone is a completly useless command because it is just a isNull that only accepts a specific type..
That would be dumb. But we know Arma I guess.
But that means scriptDone would return true for scripts that never even existed and never ran. Which is also dumb.
I just tested it. If the script handle was never defined, scriptDone returns bool If the script handle was defined, but isn't done, it returns false and once the script is done, it returns bool again.
Does anyone know how to use the unconscious param for addaction as listed on wiki?
I mean do I have to put all those other params to use the unconscious param?
I have no idea what those other params are even for, I just need to check if someones unconscious, figured use the one built into the thing
object addAction [title, script, arguments, priority, showWindow, hideOnUse, shortcut, condition, radius, unconscious, selection, memoryPoint]```
yes you need to pass all parameters to be able to use that
https://community.bistudio.com/wiki/addAction see example 4
Hmm
findEmptyPosition search a suitable position between minDist. and max Dist? So, minDist. < a suitable Pos. < max Dist ?
center findEmptyPosition [minDistance, maxDistance, vehicleType]
By the way, why my return value is so close to center? _spawnPos = (getposatl _veh) findEmptyPosition[20,50,"O_SAM_SYSTEM_04_F"]; 🤔
think i got it fam ty @still forum
Trying to hook a addaction that consumes a fak and preforms a healing animation to the vanilla revive system, hoping that works
@quasi rover maybe because that the only empty position available ?
but, When I see the map at the location, there is lots of empty area.
and even center Pos. < return Pos. < min Dist.
If only available position is smaller than minDistance it shouldn't return the position. As it's not "valid"
about scriptDone and scriptNull i was doing some ui/camera things with animations scripts, to make sure that the same script not running multiple times while i'm waiting for scriptDone did used just isNull _handle... so my stupid question was more related to 🛏 rather than scripting issues 😃
You're telling me my 30 second test was WASTED because you made a JOKE?
😄
tactital plankton https://community.bistudio.com/wiki/BIS_fnc_effectPlankton
i clicked on that random page link and i found that func, but i didnt know how to spawn it 😃
with createVehicleLocal
private _tacticoolPlancton = "#particlesource" createVehicleLocal _position;
_tacticoolPlancton setParticleClass "PlanktonEffect";
Plancton vs Plankton 🤔
plancton < french version of the plankton 😃
eheh thanks
You can use lifeState to check if someone is unconscious, addAction param only controls visibility of this user action for unconscious player
you should tag him
Does Arma have a function to compare strings? To return whether one string is smaller, equal, bigger when sorted.
For example
"ab" compare "ba" would return -1. Because a is smaller than b
And "ba" compare "ab" would return 1 because it's bigger.
Something like that probably doesn't exist right?
no
K. I'll make one then. Spaceship operator
"ba" <=> "ab" and _numberX <=> _numberY and more 😄
yeah
only really useable for string,number,bool though.
And I found out I only really need STRING < STRING which I already made previously
it does
!= as well?
Yeees...
_arrayOfStrings = _arrayOfStrings sort true;
private _index = _arrayOfStrings binaryFind _needle;
_arrayOfNumbers = _arrayOfNumbers sort true;
private _index = _arrayOfNumbers binaryFind _needle;
_arrayOfAnything = _arrayOfAnything sort true;
private _index = _arrayOfAnything binaryFind {_this < _needle};
I made dis today. Dis nice.
yes. Dis intercept. As always
wanted a faster find that's not O(N)
This is good for finding the index of a value in huge arrays. Like CBA hashes for example.
Dedmen, what does execVM search for besides the mission folder?
it doesn't search anything other than root mission folder unless you tell it to @fierce ingot
but it is capable of looking in any folder inside the mission that you want, I believe it can also look inside mod folders too
Some where referring about file patching
that apparently allows you to load external scripts outside the mission folder
Do you by any chance know how to?
@noble pond please don't lie
it searches everything in Arma's internal filesystem.
Addon PBO's same as mission files.
atleast for the stuff i use. filePatching requires the file to exist in the same path inside a pbo. But it will load from your Arma directory instead of using the file from the pbo.
But if the file isn't there in some pbo somewhere it still errors.
It once executed a script i had on a 3,5" floppy disc that wasn't even in the drive, just lying on my table next to the pc.
@waxen tide as long as it works...
I wonder if the boolean returned is "true" for "stay unconscious miserable human carpet" or "true" for "I order you to stand up and fight" ?
@vernal mural https://github.com/acemod/ACE3/blob/2bde515aaaf974b77c50d5b71ae54ff08958f5b5/addons/medical/XEH_postInit.sqf#L291
if it returns true you are put put into unconsciousness
Okay, so if I add an unconscious condition containing only {true} and then I call setUnconscious on a unit, now my unit will be forever unconscious and will have no way to wake up. Right ?
it will add it to a global variable which is ther for ALL units on that machine including the player
are you using basic medical or advanced?
Can anyone remind me which control can play video and how?
BIS_fnc_playVideo
that should contain the name of the display
combine that with AiO config and done
I think it's a special video control
Aw damn thanks.
Now just got curious, default Arma menu videos (middle ones) are visually tied to a findDisplay 0 but there is no specific display argument in function? Want to see that function 😄
@digital jacinth I use advanced medical of course 😉 but nevermind, I was working on (aka messing with) a proof-of-concept that I succeeded to do. Now, it is gonna sleep deep in my hard-drive for centuries until I find something useful to do with it.
Like dozens of proof-of-concept I produce each month
tbh you should not let your proof of concepts sleep on your harddrive, I push most of mine to github and let them rot there
Im usually paranoid, I do store my local git repo on SSD which is copied to my other drive and also copied to my external linux DS.
Top kek
Why don't you write it on paper and store it in a lock box while you're there
Guys I have a portable light. I want it to not move but when I do enablesimulation is goes off. How can I stop a light from moving while still beeing turned on?
is it turning off because its daylight?
you sure it does not break/has damage set to 1?
No i can try allowdamage
Are these the same meaning?
!(side cursorTarget == civilian) (side cursorTarget != civilian)
Anyone knows the cause of this being spammed on my rpt? (Client) 21:25:00 Object id 94453489 (1161) not found in slot 166,162 21:25:00 In last 3000 miliseconds was lost another 1997 these messages. 21:25:00 Link cannot be resolved 21:25:00 In last 3000 miliseconds was lost another 1997 these messages. 21:25:03 Object id 94453489 (1161) not found in slot 166,162 21:25:03 In last 3000 miliseconds was lost another 1997 these messages. 21:25:03 Link cannot be resolved 21:25:03 In last 3000 miliseconds was lost another 1997 these messages. 21:25:06 Object id 94254cb7 (1207) not found in slot 169,161 21:25:06 In last 3000 miliseconds was lost another 2069 these messages. 21:25:06 Link cannot be resolved 21:25:06 In last 3000 miliseconds was lost another 2069 these messages. 21:25:09 Object id 8d250d18 (1304) not found in slot 161,105 21:25:09 In last 3000 miliseconds was lost another 2279 these messages. 21:25:09 Link cannot be resolved 21:25:09 In last 3000 miliseconds was lost another 2279 these messages. 21:25:09 Warning Message: Sound debug not found 21:25:10 Warning Message: Sound debug not found
type: String - usually "EmptyDetector"
Do we have to understand "because BIS", or is there any other usable types ?
@quasi rover yes
thx
@vernal mural ```
The type must be a class name in CfgNonAIVehicles or CfgVehicles with simulation = detector.
Oh I see. Basically, there is only one vehicle configured with a detector simulation, and it is EmptyDetector. Alright, thanks
😃
@still forum do you have performance comparisons for binaryfind?
no. Wrote that at work where I don't have Arma. Maybe i find (heh.. find...) time tomorrow to test.
That's what intercept-cba is already supposed to be
I wasn't aware that was something in the works
https://github.com/dedmen/Intercept_CBA/tree/master/src/SQFExtension
Also has keybinding support with direct access to joystick buttons. Which was the first thing that got added. Wanted CBA to be able to bind joystick keys
👍
hi, do someone know how to stop showing of distance on task destination marker?
@still forum sure you don't wanna join Bohemia?
@minor lance Is it just when you connect to a specific server? or does it spam it everywhere (even sp?). Are you on linux or windows?
Apparently doing integrity check can get rid of link can't be resolved rpt spam
nobody except BIS really knows what any of the gibberish is, or what its connected to. I'd guess it has something to do with packets getting dropped because of either bad configuration on the server end or slow internet on your end
-noLogs is best thing to do if it is literally filling up your hard drive every 5 minutes, that will stop it from writing anything at all into the rpt file, beyond some very simple startup information
how would i go about creating a function on a client from a server side addon? by that i mean how do i remoteExec it to the the client so the client can call it locally.
you remote exec it to the client so they can call it by themselves @exotic tinsel
its a great way to confuse people trying to rip your mission off
@noble pond Would you be willing to give me some example code?
I would if i had some on hand
but i'm out of town
trial and error is the best way to learn 😃
So I noticed when people rejoin a server, my triggers seem to go up. 43 to 83 when somebody rejoined. What's this an indicator of?
'triggers'?
as in mission triggers?
it fires individually for each client @unreal siren , 3 players = 3 sets of triggers, one for each client
QUESTION: Is there a way to create an image on the screen which doesn't activate a cursor, nor disable the player's movement? (Aside from PIP workaround)
cutRsc
With a display with said image in it
You can create empty display and then ctrlCreate RscPicture and set it to needed image, to avoid config work
❤
anyone know of a good way to count all players on each side, also making sure it doesnt count them if they leave the server?
hintSilent format ["BLU = %1 --- OPF = %2 --- IND = %3 --- CIV = %4",count(playerSide west),count(playerSide east),count(playerSide independent),count(playerSide civilian)];
May count players in lobby, but shouldn't count players who leave (I think).
well that counts playable slots i think
no allPlayers doesnt include playable slots
oh yeah
hintSilent format ["BLU = %1 --- OPF = %2 --- IND = %3 --- CIV = %4",playersNumber west,playersNumber east,playersNumber independent,playersNumber civilian];
that could have saved me some time instead of writing code to do it myself
But i think https://community.bistudio.com/wiki/playableUnits does
^
Is there an existing functions used to simulate a password in a static text ? like none space allowed, characters hide with " * "... ?
@tame portal I never said no ^^ I could move to czech.. But I can't do anything till apprenticeship is over. BIS (Not BI) already tried to recruit me but I couldn't.
@violet gull count(playerSide west) did you test that? count doesn't take side.
Does anyone know a way to have a missions description.ext read a file from an addon
And add parameters? Assuming this is a packed PBO inside of a server
I'd like to include a file, packed either into an addon or a userconfig, or something else and read them dynamically?
It was previously possible. But 3DEN packs pbo's improperly which break that. It might work if you pack the mission pbo manually with a real packer. No one told me yet if that really works though.
If done correctly you can just #include inside the description.ext
The file has to exist everywhere. Server only is not enough. Every player needs to have it in the same place
My community has a custom addon which we distribute to all members, so it will be present for all players.
Currently, I tried using one of the Bohemia parameters templates, but it broke as soon as i packed the mission using a 3rd party PBO packer
broke aka it crashes because "include file not found"?
Then includes from description.ext are generally broken. Even if 3rd party packer. Good to know
I'll see if I can pack a file into my own addon and then include it.
you could put the mission into a addon pbo. Instead of a normal mission pbo in MPMissions.
Then you could also #include stuff from there
https://forums.bohemia.net/forums/topic/202077-multiple-missions-mod/ Here is some info about that
Yeah that'd be a bit of a pain for my group's mission developers, but its a consideration
My community has a custom addon which we distribute to all members, so it will be present for all players
if so ^ maybe just check if addon is loaded and use content in your mission(s)
(ez way)
Right that's what we're doing. We already have a large library of functions, textures and the like added into the addon. What we're trying to do here is tie some of those functions into script parameters, and then import those paramters from an addon, into the mission.