#arma3_scripting
1 messages · Page 59 of 1
but @queen cargo, why not just write SQF directly? Surely that's much better than using an abstraction layer like OOS?
@queen cargo damn i actually had no idea lol
oh ok I thought you were asking about playerRespawnTime. well save the mission unbinarized then open the .sqm file with a text editor
I will check and get back to you, it’s open source so I’d imagine so
you should see the attribute in it
@shut reef or just open the config viewer and navigate to missionConfigFile
amazing, however the hemtt is vertical upon being spawned in 
Though so, too, but that one is empty
Seems to only hold values if you have a description.ext
i would have called it SQF++ though
GVAR prevents you from debuging. Dummest thing I've heard today. Sry.
That is how I created a nice bug in my mod that disables the delay cause it resets it to the missionConfigfile value that defaults to 0 xD
configProperties [loadConfig "mission.sqm", "true", true] apply {
[configName _x, [_x] call BIS_fnc_getCfgData]
}
it should list all properties and values
lemme see
i presume just setVectorDirAndUp after spawning in should rectify it being pointed up? 
feel free to argue @tough abyss
are you sure your initial vectors are not incorrect?
the ones you set on the CBA object
the cba object is pointed up and this just gets attached
@tough abyss Will do, once I'm off work
_shipObject attachTo [_shipHelperObject];
_shipObject = hemtt
_shipHelperObject = cba target vehicle, doesnt have any different rotation to default
That sadly fails right where the info would be >> ScenarioData is nil
use _shipObject attachTo [_shipHelperObject, [0,0,0]]; instead (that won't solve the problem tho, just saying)
yeah it only searches the properties not the classes
just rotating the cba object resolves it (however does make it go in a massive curve in the other direction 😅)
respawn delay is in ScenarioData, tho
just open it with with a text editor like I said before
well ... @pliant stream feel free to check it out https://github.com/X39/ObjectOrientedScripting/tree/master/TestProject
how would I make the object have different vectorDirAndUp? just set it after being attached?
yeah but how does that allow me to access it during runtime!?
after all, and i quote: "you just do it differently
instead of writing the var by yourself aligned to some convention
you let the macro do that for you
which either shows youre not capable of doing that
or you just wanted to use macros because "they are cool""
just open it now and I'll tell you once you find what you're looking for...oof 
Well it doesn't. What is there to argue? You never explain how and why.
class ScenarioData
{
respawn=3;
respawnDelay=10;
respawnVehicleDelay=10;
class Header
{
gameType="Coop";
minPlayers=1;
maxPlayers=12;
};
wreckRemovalMaxTime=3600;
};
getNumber (loadConfig "mission.sqm" >> "ScenarioData" >> "respawnDelay")
Comes up empty
yes
legendary, thank you so much 🙂
Like the entry does not exist, when I test it with isNumer
Well it does show 0
now just time to solve my velocity function being so inaccurate -- getPosWorld instead of getPosASL? causing jittering with the dir (to be expected)
that seems to apply to OOS pretty well, don't you think?
read the post
but it's not because there is a value 0 to read
read the backlog
Macro usage is simple. If your projects requirements matches with the benefits of macros, use them. If not; don't. There is no single good way to it.
Seems it doesn't really load much from it,
"true" configClasses (loadConfig "mission.sqm") returns [,,,,,,]
but @queen cargo, why not just write SQF directly? Surely that's much better than using an abstraction layer like OOS?
quite simple: sqf is shit. oos is written for the "normal" geek that is not infected by sqf virus
loadConfig "mission.sqm does point to the right file tho
ah I see why
it's a bug 
the game unloads the config if you store it in a temp value while you access its children
(tho I doubt it's fixable but it should be noted on the wiki).
So this fails: getNumber (loadConfig "mission.sqm" >> "ScenarioData" >> "respawnDelay")
🥳 second arma bug I find
@still forum ^
try this instead:
_cfg = loadConfig "mission.sqm";
getNumber (_cfg >> "ScenarioData" >> "respawnDelay")
oh nice, that works!
There is nothing in there. It just claims that you have to resolve the macros every time when debuging which is simply false.
Thank you very much!
That should work in all situations, SP, MP, local MP, dedicated, etc?
Whatever or not you see those benefits does not matter; simply don't use them if you dont see them.
yes
should be getPosWorldVisual instead right?
@daring zinc its something completly different to use a HighLevel lang for another lang
hell i could write another HighLevel lang for C++ if i would like to
thx 💚
in this channel, someone arguing someone else is doing something wrong because they did it differently, more at 10
I enjoy it.
getPosWorld is better but not sure what problem you mean
its like 2 year olds fighting
We should make another channel for SQF h8ers
@shut flower personally i'd do it for the same reason i don't write everything in assembly or C
it's somewhat inaccurate (for probably obvious reasons) so just trying to find any way to mitigate that
I mean where is the code? 
hey Glowbal, nice yo see your around
i sqfbinned it a short bit back but its this:
addMissionEventHandler ["EachFrame", {
{
private _shipLastPos = _x getVariable ["KJW_CapitalShips_LastPos", [0,0,0]];
private _shipPos = getPosASL _x;
private _shipVel = (_shipPos vectorDiff _shipLastPos) vectorMultiply (1/diag_deltaTime);
_x setVariable ["KJW_CapitalShips_LastPos", _shipPos];
_x setVariable ["KJW_CapitalShips_Velocity",_shipVel];
} forEach KJW_CapitalShips_Ships;
}];```
so where are all these people using OOS?
Hey @round scroll
why do you add so many EachFrame loops? 
I don't, that's inside the eachframe 😅
Been a while.
Nowhere, and thats why X39 is satly as fuck
wasn't ship attached?
yes
but this is getting it for the logic object that its attached to
:D
THE END
well you can use the ship to get the velocity
literally only thing i do to the ship while its attached is the setfeaturetype + setvdirup, rest of it is all done to the object its attached to
yeah, I kind of stopped armaing for a year ;)
iirc this works:
velocity _attachedObject
how? it's the same as a house 
no, the ship is equal to a house
the cba thing is an airplane target that has no physics
ship -> the thing thats attached
helper -> the thing that its attached to
i've been working on this function for nearly 2 weeks it's confusing me too
I don't know why you're attaching so many things and do so many weird things just to make a curve 
the attached things are either just cosmetic or turrets 😅
the velocity is used for getting the direction, inaccuracy means it looks like its wiggling back and forth a bit
This will solve everything.
yeah i use that to get the distance 😅
and then svt two objects for some reason
I have no idea what you're doing anymore 
Seems like everybody here loves sqf so much that he got dumb
join the club
bezierinterpolation -> approximate distance to be moved
logic object -> moved to destination
ship helper object -> moved to logic object at the same time
attached objects -> just come along for the ride
Everyones worries will wash away and scripting will be a place of peace
anyways,
offset for attaching is just worldToModel and the vectorDirAndUp is just BIS_fnc_vectorDirAndUpRelative right?
just as well i didnt configure the ship in its entirety just yet seeing as i need to redo all the parts 😅
I don't want to 😢
that's gonna be so hard
nice video
good man.
also same relevant for your destructor idea (was it yours? I think it was) cuz that'd work the same

pewpew.
You should update. BW now uses CBA keybinding, which are probably evil and prevent you from debuging
It's like.. a few months old
@queen cargo take a ride in my car https://www.youtube.com/watch?v=OpmveX68qrs
@daring zinc i hope nowhere
its still in ALPHA
even thought it is usable but no project should rely on it
i know a few people testing it over and over again
And i'm out of funny videos.
had the profilenamespace clearing bug right before i was about to save all my scripts from adt into the mod 
i have some
Thanks Putin
No worries, i'l always stand up for the weak minoritys.
you should really look into expanding your collection :) 2 vids isn't a lot haha
no, im not. 🙂
apologies for the massive time waste on that front 

it should be all good now.
think i'll give banking a miss for a while given this function has taken over 2 weeks 😅
Grenade rain?
these guy's pathfinding was written using OOS: https://www.youtube.com/watch?v=gKXMr7lbJM4
Shitty video tho
My flash plugin crashed when the first grenade exploded
xD
@daring zinc good you show us videos where your own incapability of scripting leads to fail uploads where you have to write into the description of the vid. "ignore the script error"
X39, how do macros prevent you from debuging? I couldn't find anything in the blog
HE DA MAN
@nocturne bluff where were you when @queen cargo was did?
God, @daring zinc dunno how stupid you are
well i don't either
but i know that this video feels relevant: https://www.youtube.com/watch?v=SmsRN78qMxM
shots fired
That's going into my personall archives.
Bohemia Interactive Simulations, a global developer of game-based simulation software, introduced VBS Radio in its latest software update to VBS3 v3.7.2. VBS...
He's very passionate. And salty
Gah true. I misread it seems
Darn. These scripted EHs will be the bane of my existence. Thank you though!
holy shit i just read that line in the blogpost
apparently we're SJWs
top fucking kek
private _shipVel = _ship getVariable ["KJW_CapitalShips_Velocity",[0,0,0]];
private _vdirandup = [getPosASL _ship, (getPosASL _ship) vectorAdd (_shipVel set [2, 0])] call BIS_fnc_findLookAt;``` should be allowed, right? ADT is complaining of syntax issue after the `vectorAdd` 
Says was in the wrong place for my specific useNo syntax matches these arguments: ARRAY vectorADD NOTHING,BOOL
set doesn't return anything
@jade abyss was a good choice made by BI to disable comments as this is fuckin stolen
Though that's not accomplishing what I'm trying to here -- trying to stop the vectordirandup calc have an increase in height so it remains flat
private _vdirandup = [getPosASL _ship, ((getPosASL _ship) vectorAdd (_ship getVariable ["KJW_CapitalShips_Velocity",[0,0,0]])) set [2, 0]] call BIS_fnc_findLookAt; is now what I'm doing but clearly it's not the correct way to go about it as ship now does not orient
as I said, set doesn't return anything
Do I need to assign it to a variable prior then? 
yes
ah gotchu
private _tempVar = ((getPosASL _ship) vectorAdd (_ship getVariable ["KJW_CapitalShips_Velocity",[0,0,0]]));
_tempVar set [2,0];
private _vdirandup = [getPosASL _ship, _tempVar] call BIS_fnc_findLookAt;``` is making it point downwards 😅
"stolen"
it's even below ground in VR (terrian ASL height in VR is 5) 
Yeah would that not eliminate any vectorUp? 
wait thats not the right word
I'm trying to make it be completely flat as it goes up and down rather than point up and down 😅
I think my brain is frazzled after working on this for so long
You want to set velocity Z to 0, not total?
Reallife? wtf?
just letting you know that arrays work by ref and if you do that you end up modifying that KJW_CapitalShips_Velocity array forever
I'm confused
oO
set modifies the array reference
oh
I've figured out my problem regardless
private _shipPos = getPosASL _ship;
private _tempVar = (_shipPos vectorAdd (_ship getVariable ["KJW_CapitalShips_Velocity",[0,0,0]]));
_tempVar set [2,0];
_shipPos set [2,0];
private _vdirandup = [_shipPos, _tempVar] call BIS_fnc_findLookAt;``` was what i needed
(It's just to keep it flat as it goes up 😅)
yeah, reallife, course, guess what: I'm out. too much idiots around here
it's too many idiots
rekt
wow, making fun of something like that? Really?
can't tell if you're guys serious or just kidding
macros are serious business
do sounds need to have an specific format?
I have a sample sound that I'm trying to pack within my mod but when doing so, the sound doesn't play at all using playSound or any other command but does show in the cfgSound config files, however when trying the same sound in a mission context, the sound is able to play using playSound3D using the path in the mission folder.
Im assuming that either I have a pathing issue in my mod, or sounds defined in cfgSounds need an specific file type and format.
bloody serious
Grammar nazi inbound. Is it a nice feeling to correct a non native speaker?
you can check for pathing issues with https://community.bistudio.com/wiki/fileExists 
The irony was to strong
too late Whale, this has been going on for quite some time already, might as well grab the popcorn
Does not seem like I can at the moment. Will have to see if I can make something else work
I was looking at the sector control AI spawn module. The example expression executed on the group is. [<GROUP>,<MODULE>,<GROUPDATA>]
@shut flower i'm not a native speaker either :P
im trying to have the units in the groups loadout change...
{_x setUnitLoadout [getUnitLoadout BADGUY, true]; } forEach units group _this select 0; Help...
trying to figure out best way of placing player next to vehicle sets say 5m offset in ASL format along with following vehicles vector (meaning if vehicles is on slope dont place him 20m in air)
Basically: @daring zinc I hope you will die because of stupidity (and because of your dumb scripting guideline).
And I don't really care about what you are
BTW: *I (has to be written upper case)
@high vigil https://community.bistudio.com/wiki/setPosATL
**in ASL format **
um... model to world?
Lol.
ya thats fine, biggest question is the offset point
Lets
_aboveAndBehindPlayer = player modelToWorld [0,-1,3];```
_worldPos = _relObj modelToWorld _offset;
_obj setPos _worldPos;```
not good
spawns your ass in 5 min in air
_offset = [5,5,0];
_worldPos = cursorObject modelToWorld _offset;
player setPos _worldPos;
i feel rather threatened by that post, i better go call the UN
and if the vehicle on steep hill you end up at 0,0,0 laland
Now that is a personal attack
dont comment if you dont know, keep this chat clean of bs
WTB a mod....
shit ...
anybody can gimme my text back?
i accidently deleted that posts content ...
- check the addon prefix and make sure your paths are written with respect to that prefix
- make sure whatever packing tool you use does include the file type of your sound
You subconsciously did the right thing
pff
@tough abyss I'm in on that request
holy shit, thank you so much....
The file was not being included in the pbo
o no
blog is kill
ty @tough abyss <3
@tranquil monolith Good to hear
Q: timing wise, when are 'mission objects' loaded in relative to pre/post initialization phase EH?
I have a use case where apparently some FOB objects are deserializing (correctly) during the post init phase.
But not seeing what I think should already be there in terms of actual mission 'grass cutter' objects.
Thanks...
Good evening,
small question regarding the intro and outro phases. I added two videos for my mission and was able to execute one of them with the initIntro.sqf. But I am now stuck with the outro video and I have no real idea on how to execute it directly and wanted to ask if something like initOutro.sqf exsits or at least something else? (And can I trigger the outro with a "silent" ending instead of the usual you have completed the mission thing?)
Thanks in advance!
now that this shitposting extravaganza is concluded, let's talk about something less controversial, like tabs vs. spaces.
tabs must die
never!
i don't see whats wrong with tabs ¯(°_o)/¯
thanks... I see my confusion otherwise.
there were some valid reasons, but i just prefer tabs
What's worng ? fucking indentation issues
The length varies.
indentation using tabs, adjusting with spaces
with tabs everyone can just set their preferred width in their IDE
@celest agate
anything but 2 spaces is plain wrong (... looking for cover)
how about a compromise.. say 3 spaces? :D
4 provides better readability for SQF
I take 3 spaces over tabs any day
Notepad++
VIM and atom, done
sublime ftw
ST 3. It's the first one I had and it's in my nature as East German to despise change.
gif
gif
gif.
because it's written as gif
consensus reached next.
Graphic -> gif
NO FLUMMI NO
gif
haha delete function ftw
42!
pls rename channel to #circle_jerk
welcome to any online community ever, get your ticket and get in the file
fine, let's stay with sqf to appease @hasty violet: manually preprocess vs CfgFunctions
go
Hmm. Depends on how big the project is.
no cfgfunctions in arma 2 :<
arma 2? what's that
A2 dead.
yea but it's not buried yet so we get to have our little fun
Wasnt Arma 2 a Mod of DayZ?
like Arma3 is a mod of Altis life, (• ε •)
the shit
What did they add?
just to quickly end the topic macros in my head:
all you had as "argument" was bullshit you negated yourself later or never actually prooven
and all you did thus was flaming
great job
thats what i expect from our ACE3/ex-AGM devs
thx for prooving my point
and all you did thus was flaming
you're projecting so hard you could show off powerpoint presentations
lol
X39, how do macros prevent you from debugging? Can't find that info in the blog.
there is an example @tough abyss check it ..
Point me to the line. I can't find it.
QGVAR(colorTextMax)
you got two seconds to tell me without context which variable this is, where it belongs to etc.
It's a maximum threshold for a text color.
It belongs to the pbo/folder you are editing
It is
diag_log QGVAR(colorTextMax)
when you want to debug
What was the way to return current camera zoom level?
Camera as in camCreate'd or your player character's?
https://community.bistudio.com/wiki/getObjectFOV
Mmmmaybe this
Thanks
great idea @still forum! Will try that ingame in a few seconds
Meant client's current camera zoom
Are you trying to get a remote player's zoom level? I guess it is not MP friendly or requires some workaround
No, just my own camera zoom, whatever player is seeing
Ah that makes sense. Guess feasible enough
I've been using KK's distance2D worldToScreen positionCameraToWorld hack, wondering if this can be done better nowadays
It ain't that bad solution though
It works well, just a bit imprecise
http://x39.io/?page=news&id=50# Why I do not contribute to community projects like CBA
1: https://github.com/CBATeam/CBA_A3/blame/master/addons/arrays/CfgFunctions.hpp
2: gr8 b8 m8
3 and 4: Complaining about code you do not understand doesn't help your case.
@lone glade no fucking clue what you want to point me at with your link
and to 3 and 4 pff! till now, i did understood every shitcode i had to read and there was NO case where i did not understood it
Are you unaware of the glorious git blame function ?
think you did not got the point of my 1. point
as said below
there are no real arguments in that post yet
so just take the headlines
((easier for people like you anyway))
Well, here's the issue if you understood it you wouldn't be supplying the mediterranean sea with salt.
dont worry @lone glade, updated 1. for you with extra text to explain to people like you too
Stupid people using it, more stupid people developing for it
T_T
I really wish you could write less like a 12 year old.
well ... some things never will happen @nocturne bluff
:D
Yeah, figured.
my sides are now in orbit
Can i blast up there too?
only if you do rocket science MrPutin
outdated stuff like usual russia ...
Speaking of gut feelings, altering select to accept negative indexes could've broken some things as well, because now if you select by result of find or findIf, selecting -1 will return last value instead of erroring out.
I guess its the same case with set, a theoretical issue somewhere VS massive usefulness gain
exporting?
the 148 has a little speaker on it
that you can turn on
so other people can hear your radio
No that won't break anything. Because it would return the same type of thing (obviously you don't iterate over something unless its elements are all similar)
It would simply return something unexpected
What Dedmen says is that set will now return something in a place where it shouldn't (and the user trusted that it doesn't)
Who knows maybe some function somewhere now will return -1 (last) element from array instead of erroring out
Its same in a sense that its kind of hypothetical issue somewhere
Sure nobody built their code to error out, but now instead of an error, it will select some array values
Any idea how i can detect when a vehicle is repaired with the repair kit?
'🍤
would there be any peformance impact (outside of when i'm assigning them or deleting the objects) if i were to add "deleted" eventhandlers to hundreds of objects?
The Service mission EH can detect the use of repair/resupply vehicles. It doesn't say it detects repair kits, but it might be worth trying it to find out for sure.
Does somebody know something about this?
Just do execVM with your script when you need it
You can instantly end the mission with endMission command
Is there a way to preload models without having them spawned in?
They don't have a config either, it's just plain .p3ds
createSimpleObject?
oh. you could kinda rig one up using the radio system
Already using execVM for the outro Phase, but that has a slightly delay unlike the initIntro.sqf version for the Intro Phase.
endMission works with a charm for both the intro and the outro. But for the scenario itself it has the "Mission Completed" screen which I would like to have skipped so it goes directly to the outro phase.
make a radio with a loudspeaker, its very simple, it is just a radio that can only do exernal audio
and then make another radio that can only communicate to it
its not built into ACRE right now, but it could easily be added
I can't get it to work. How can I teleport to the marker kavala after pressing the "tp" button when I have selected Kavala, for example? I have already tried to check lbText and with lbcursel, but that didn't work either.
createdialog "tpselecter";
waitUntil {!isNull (findDisplay 9001)};
_display = findDisplay 9001;
_listbox = _display displayCtrl 1500;
_listbox lbAdd "Kavala";_listbox lbAdd "Sofia";_listbox lbAdd "Pyrgos";_listbox lbAdd "Airfield";_listbox lbAdd "AAC Airfield";_listbox lbAdd "Molos Airfield";_listbox lbAdd "Almyra";
setPosATL getMarkerPos listbox value
A side note, alt syntax for createDialog returns the display: https://community.bistudio.com/wiki/createDialog
as a side note, do you happen to know if forceOnTop is optional?
Yes, it is optional
That's what I'm using them for
I could also be mistaken about where the lag comes from, but at the moment it seems like spawning in a bunch of different objects (unscheduled) causes some lag
That's more of a gut feeling than anything proven tho
Ignore this message I'm hoisting this as I need to find it later (profile corrupted and I lost all my ADT scripts without backing them up
)
serves me right i suppose
What does ADT stand for?
advanced developer tools
Well, you can probably use the command at the pos somewhere the players never see, I guess
How can I pause a script until a helicopter has landed on the ground?
is it my fault? 
or was it a game bug?
Nah, just arma profile corruption bug 😅
Probably easier to start a new script when helicopter hits ground
waitUntil and check the Z element in the helicopter's PositionAGL
I presume you save everything to profilenamespace so nothing you can do about it 🤷
AGLS is better in this case
Wonder if it's due to the profile becoming too large though 🤔
could be 
It's not a big deal, need to redo the function for integrating with this anyway as multiple moving areas need to be checked 
Are you suggesting using getPos? 🤔
well if you spawn several objects together unschd it will ofc cause some lag
yeah
It's actually heartwarming to know that there's a way for me to be wrong literally no matter what
well you weren't wrong. just in some cases...
if the heli was landing on the ground you would be correct 😅
That;s exactly what I am trying to do. But not sure how to check this. Helicopter has the variable Golf2.
it just seemed like there was more lag when there were more unique objects and less duplicates
waitUntil {
sleep 0.1;
((getPos golf2) select 2) < 0.5;
};```
Notes:
- small sleep for performance
- not checking exact zero because helicopters can be imprecise
Oh I see. The 0 might have been the issue before. Testing...
One more question regarding disabling the AI of a helicopter. Do I have to use disableAI "all" on the object helicopter or the crew of the helicopter?
disableAI only works on units. Not groups, not vehicles, just units.
is anyone aware of any way of making an attached object be targeted by radar? or does it follow the same properties as the object it's attached to? 
so i take it this just doesnt work at all if it doesnt work on dedicated servers or does it work on local host?
have you binarized your models?
by attaching an object you make it a simple object so i doubt that it would be possible unless you do whatever workaround ZEN uses if simple objects remove it from radar
there's no reason it shouldn't be targetable
I'll do some more testing then 
think it's probably inheriting cba target vehicles lack of ability to be radar targeted
not yet, cause i fear it would take like an hour.
there's 8900 models at the moment
well unbinarized models are slow to load
and I don't know what you need all those models for
i think he wants to stress test the game with modules
Is there a way to use the slat armor of the Rhino MGS on other vehicles? Maybe to somehow remove the turret and hull (make them invis) and keep only the add-on slat armor
i need them to make a collider for vehicles with animated triangles.
vehicle collision doesn't follow single vertex animation
at the moment i'm testing if i can make do with 890 models, but i'm unsure if that'll be too inaccurate at larger scales
binarizing apparently is faster than copying the files to the temp folder
Attaching objects does not turn them into simple objects
i can target but cannot seem to missile lock 
though wondering if thats a config problem
yeah just doesn't lock on even when its on the ground 🤷
seems its a me issue
I am having the issue that a helicopter which has landed for extraction takes off and lands again as soon as I gave the AI to board the helicopter (engine on). I thought disabling the helicopter's crew AI would solve the problem but it does not. Did anyone else experience the same issue before and knows a solution?
enjoy, this happens once every 10 moons!
so broken code would still be broken.. eh 
Got this sorted. In case anyone has the same issue. The command flyinheight 0 solves the problem.
This worked only for repair vehicles
Any other ideas on how to detect usage of toolkit? Im trying to make toolkits consumed when used so vehicles cannot be repaired infinitely
Wild guess, maybe toolkit triggers HandleHeal like the medkit?
got to try that out
a bit odd that it doesnt have eventhandler when stuff like "scuba breathing sound" has one😂
Means BI didn't need it for their campaigns
You can always try putting in a ticket if there really isn't a way of detecting it
I also consider making a whole new repair trough addaction
That would be a better choice, built-in system SUCKS
Yeah, also allows making the repair last longer. Vanilla repair is op af
Post the code itself too
i can sqfbin the entire function
You should to
surfaceTexture _posAVG there returns what?
Not sure that is the solution
...isn't SQFbin supposed to have, you know, SQF syntax highlighting?
it had it when i pasted it
it fixed it
still i'm confused about "Error Type String, expected String"
It's just showing as plain text for me 🤔 and when I tried putting in some SQF myself, it also didn't get highlighting
lol
you can, and its implemented if you drop the radio
you know Nou its an ACRE Dev? XD
gets highlighted initially but then never after
I think it gets broken when you add #
Whats a radio?
:P i mean you could do it with the 148/152 now, though the speaker is kinda weak (actually it should be weaker, you can hear it from like 10 meters away clearly)
the distinction between speaker and headset is quite noticable, considering the sound needs to come through your ears either way
Help. See my previous post.
what post?
What the "arguments" part of addaction is used for? i tried reading it but cant understand.
it's passed to the action script
params ["_target", "_caller", "_id", "_args"]
Does it make those variables usable in action script?
What can be done with it? I still donttget it
you pass a variable from outside the action script (where addAction is running) to inside the action script
here's an example:
_somevar = 0;
_obj addAction ["bla", {
hint str _someVar ;//error
}]
Oh so regular variables dont work in it unless moved with that?
local variables won't be seen no
_somevar = 0;
_obj addAction ["bla", {
params ["_obj", "_caller", "_id", "_someVar"];
hint str _someVar ;// no error
}, _someVar]
Okay so it is used to put local variables inside action scripts?
that's one way to think of it yes
alrighty, thanks for your help!
hey, im trying to add a progress bar to a generator object and it works fine,
but the progressSetPosition is not broadcasted to other players globally, how can i achive that?
https://sqfbin.com/ozaxikemipovimoguley
broadcast? it is a UI primitive. therefore by definition I should think client side only. i.e. if it is happening for one player no reason to think it should happen for any other player.
okay, but is there a way to broadcast progressSetPosition of that progressbar to others?
i tried something like this too but no success:
progressPos = progressPosition (uiNamespace getVariable "progressBar"); publicVariable "progressPos";
you should make a function that sets the progress position for everyone.
not just broadcast that variable
and even if you did broadcast that variable it would be pointless
you just read it back from the progressBar again
okay but i "global executed" the whole code via debug console and it didn't work
I didn't say broadcast the whole code
i understand, i mean every player can "repair" the generator but the progressPosition is not updated for everyone
_progressPos = progressPosition (uiNamespace getVariable "progressBar");
_progressPos = _progressPos + 0.01;
[_progressPos] remoteExec ["my_fnc_updateProgress", [0, -2] select isDedicated];
if (_progressPos >= 1) then {
powerGen1 setVariable ["generatorActive", true, true];
};
my_fnc_updateProgress = {
params ["_progressPos"];
(uiNamespace getVariable "progressBarBkGd") ctrlShow true;
(uiNamespace getVariable "progressBar") ctrlShow true;
(uiNamespace getVariable "progressBar_text") ctrlShow true;
if (_progressPos <= 1) then
{
(uiNamespace getVariable "progressBar") progressSetPosition _progressPos;
(uiNamespace getVariable "progressBar_text") ctrlSetStructuredText parseText format["%1%2", round(100*_progressPos), "%"];
};
if (_progressPos >= 1) then
{
ctrlDelete (uiNamespace getVariable "progressBarBkGd");
ctrlDelete (uiNamespace getVariable "progressBar");
ctrlDelete (uiNamespace getVariable "progressBar_text");
uiNamespace setVariable ["progressBar", nil];
uiNamespace setVariable ["progressBarBkGd", nil];
uiNamespace setVariable ["progressBar_text", nil];
(findDisplay 46) displayRemoveEventHandler ["KeyDown", progressBarKeyDown];
(findDisplay 46) displayRemoveEventHandler ["KeyUp", progressBarKeyUp];
};
};
ah okay so you mean only a function only for the progressPosition?
[_progressPos] remoteExec ["PARADOX_fnc_progressPosition", 0, true];
a function for all the UI stuff
okay thank you very much !
hi, for the Unsung CAS module I use cursorObject to get whom the player is looking at. This does not seem to work very well for enemy units from a distance. Is there any other function that tells me if there are enemies at the center of the view of the player?
no but you can do a manual lineIntersectsSurfaces
(it's much slower than cursorObject tho)
to add more detail
"Error got Nil of type String, expected non-nil of type String"
This sqf squadUI_VAR_FncDone = false; _squadUI_Functions = [] execVM "scripts\UI\squadUI\squadFnc.sqf"; waitUntil {(scriptDone _squadUI_Functions || squadUI_VAR_FncDone)}; used to work for me but now it gives me an error that the squadUI_VAR_FncDone part makes the WaitUntil return nil
Any way to regain that functionality?
is squadUI_VAR_FncDone being set by that script only?
In the init file: squadUI_VAR_FncDone = false;
At the end of "scripts\UI\squadUI\squadFnc.sqf" sqf squadUI_VAR_FncDone = true;
then there's no need for waitUntil at all
just do:
call compile preprocessFileLineNumbers "scripts\UI\squadUI\squadFnc.sqf"
instead of that whole code (which is also slower)
Yeah I know but I am still in the process of making changes to the "scripts\UI\squadUI\squadFnc.sqf" on the fly for the mission, wouldn't call compile preprocessFileLineNumbers make it so that if change something (alt tabing) I would have to restart the whole missions for any change?
no
it will do exactly what you want except it's faster
(no useless waitUntil eating poor scheduler's time)
and for the record, execVM is short for spawn compile preprocessFileLineNumbers
and another thing: _handle = [] spawn...; waitUntil {scriptDone _handle} is always wrong
Aha! I never knew nils had types
If you pass nil to a command, the command never executes, and just returns a new nil.
And if a command only returns a specific type, the nil will be that subtype
how are you supposed to turn a config path string into a config path? 
currently using _configPathTo = [_hi, "", true] call BIS_fnc_configPath; but it returns everything double quoted within a string ;-;
_configPath = [_configPath, [], true] call BIS_fnc_configPath; also returns a string around configFile 
If I use sqf call compile preprocessFileLineNumbers "scripts\UI\squadUI\squadFnc.sqf" and inside "squadFnc.sqf" there is a sqf TAG_fn_whatEver = {}; then doing sqf [] spawn TAG_fn_whatEver; // doesn't work while if I EXECVM then sqf TAG_fn_whatEver = {}; does exists... and sqf [] spawn TAG_fn_whatEver; //does work so how can those two be the same?
then doing
[] spawn TAG_fn_whatEver; // doesn't work
doing it where?
init.sqf but after the call compile
call compile preprocessFileLineNumbers "scripts\UI\squadUI\squadFnc.sqf";
0 = [] spawn VAL_fn_squadUIloadStats;
0 = [] spawn VAL_fn_squadUiID;
"undefined variable in expresion VAL_fn_squadUIloadStats"
that does work tho
are you sure you don't have it backwards?
if you do execVM those vars won't be defined when you do the spawn
if you do call they will
[] execVM "scripts\UI\squadUI\squadFnc.sqf";
sleep 2;
0 = [] spawn VAL_fn_squadUIloadStats;
0 = [] spawn VAL_fn_squadUiID;``` <----- This works for example...
this should work
unless you have another spawn or execVM in it
Or a sleep... right? Checking now
no
Yes XEH is a good fit for that
what's even the point of that function?
solved now (albeit badly) but
Returns config path to given entry in given format.
(lets you swap between various formats of config paths)
Ok, managed to make it work by adding a single 2 secs sleep after the call compile and before the 0 = [] spawn xxx. Hate to use sleep inside init and that is why the waituntil was working before but suddenly it was not anymore
You do not need any sleep
You're doing something wrong
could use CAManBase, so the game doesn't have to compile every time a rabbit spawns
Instead of Man
Wait
It won't. But your classes are wrong
class Extended_Init_EventHandlers {
class BWA3_Tiger_Base {
class randomizeSerialNumber {
init = "_this call BWA3_fnc_randomizeSerialNumber; _this call compile loadFile '\bwa3_tiger\data\bwa3_tiger_decals.paa';";
};
};
};
It is missing a class
It won't
Well you can name it whatever you want
A full restart somehow fixed the issue, now even the waituntil works and call compile works as you said it would...
Thanks!
It has to be your Tag basically. Otherwise all addons would overwrite each other
Yep
I'd not compile it every time a soldier is spawned though
_this call Whale_fnc_vFix
compile it when the player joins (initPLayerLocal) or put it in CfgFunctions
Whale_fnc_vFix = compile preprocessFileLineNumber etc. on pre init
Yeah. Or CfgFunctions
Haha
yes, see allowFleeing
Saw somebody say that didn't work, I'll give it a shot
The advantage is that the function is read from memory and not from hard drive every time
You also don't have to compile it for each soldier placed in that mission.
Doesn't have the "instant flee" behavior I'm looking for, I think I'll just use doMove
Is ths for a mission?
move*
class CfgFunctions {
class BWA3 {
class BWA3 {
class start {
file = "bwa3_common\start.sqf";
};
};
};
};
Would be BWA3_fnc_start
Goes into description.ext
One of the class BWA3 is the category in the functions viewer, the other one is the tag (BWA3_fnc_...)
I never can remember which is which, so I always use the same for both, haha
CfgFunctions is native and works without CBA
XEH requires CBA
But you can't assign init eventhandlers in vanilla
I prefer to write everything on one line for the last class ```
class CfgFunctions {
class YOURTAG {
class derp {file = "pathToYourFile";};
};
};
No, BWA3 is the Bundeswehr mod
Which I'm a dev of, so I copy stuff from there.
CfgFunctions does compile ahead of time
Thats the point of it
wrong path for your file
it should be something like "functions\vfix.sqf"
if your file is in functions \
Good morning, before I start build my own keybind.
What is correct path in game where I find my new key?
https://community.bistudio.com/wiki/Arma_3:_Modded_Keybinding
I did this config to my mod but I do not find place where I can change value of keybind in game.
And if this is wrong way to do , let me know.
my goal is to have my own customizable key
What do you mean by path?
no need to if you use file =
It is apparently customizable through ingame options
i see
This.
I will start search
Just like you change your keybind, you can access to the customized keybind there
why do you compile your function twice ?
remove the init code, add the extension in the cfgFunction and change the call in init = to _this call VF_fnc_vfix
Thanks. This was what I want to achieve
yes
oh and also, for the love of god don't use BIS_fnc_MP
use remoteExec
["Hello World","hint",true,true] call BIS_fnc_MP; becomes "Hello World" remoteExec ["hint",0,true];
Hi All,
I'm New scripting i'm well out of my depth but i'm learning slowly.
i'm sure this has been asked before sorry if it has.
I'm having some issues with my script.
I want to set up multiple markers that when a player that is alive is within a radius is near this marker it spawns units from a list of possible units. I want all the values the units the spawn radius and etc to be customisabled.
I'd love to know how to get them to spawn in buildings as well as on different floors.
These spawn points would be through the map in towns and other locations.
At the moment i only have it set to 1 marker and 1 unit type but the units don't spawn and i'm a bit lost as to what i should do i can't seem to figure it out.
I'd rather create something my self than use already existing scripts (i'm being difficult i know sorry)
My script is below I'm not sure if ive pasted it in correctly let me know.
line 24 keeps throwing a error of missing ;
Thanks all.
_opforMarker = "Opfor_1";
_spawnRadius = 100;
_opforUnits = ["O_Soldier_F"];
_markerPos = getMarkerPos _opforMarker;
_newGroup = createGroup east;
_triggerPos = _markerPos;
_triggerRadius = 50;
_opforTrigger = createTrigger ["EmptyDetector", _triggerPos];
_opforTrigger setTriggerArea [_triggerRadius, _triggerRadius, 0, false];
_opforTrigger setTriggerActivation ["WEST", "PRESENT", true];
{
_unitPos = [_markerPos, _spawnRadius, 360] call BIS_fnc_findSafePos;
_unitType = selectRandom _opforUnits;
_unit = createUnit [_unitType, _unitPos, [], 0, "NONE"]; // create the unit
_unit setGroupId [_newGroup];
};
please just reply to this so i get taged if anyone has and answers
you tried calling the function yourself via the debug console if it worked ?
hints are local, always
I don't remember the arguments used in BIS_fnc_MP so give me a sec
yeah that hint should be global
- I would like to suggest not to make the post too long, aka remove empty lines.
- So the question, (as far as I check the script) it does seem to have mostly no errors, except
createUnitlacks the group parameter. - In order to let them spawn into a house if there is... is rather complicated to make it happen. I can write a mockup.
- Also, please follow this so you have the proper highlight:
!sqf
...Hey! @wicked roost
!sqf
smh I recalled wrongly
!code
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
☝️ @orchid yew
thanks for that ill give it a test in a bit
private _opforMarker = "Opfor_1"; // use private to make those local variables never alive outside of the script whatsoever
private _spawnRadius = 100;
private _opforUnits = ["O_Soldier_F"];
private _markerPos = getMarkerPos _opforMarker;
private _newGroup = createGroup east;
private _triggerPos = _markerPos; // not necessary it seems?
private _triggerRadius = 50;
private _opforTrigger = createTrigger ["EmptyDetector", _triggerPos];
_opforTrigger setTriggerArea [_triggerRadius, _triggerRadius, 0, false];
_opforTrigger setTriggerActivation ["WEST", "PRESENT", true];
{ // oh? what's this?
private _unitPos = [_markerPos, _spawnRadius, 360] call BIS_fnc_findSafePos;
private _unitType = selectRandom _opforUnits;
private _unit = _newGroup createUnit [_unitType, _unitPos, [], 0, "NONE"]; // create the unit
};```My quick edit. Not sure what the last part should be (not tested)
that part won't even execute...
So I'll just let it leave
it's wrapped in a code that never gets called 
But besides that overall idea is not that bad it seems
the units don't spawn and i'm a bit lost as to what i should do i can't seem to figure it out.
actually that was his problem
Yeah 
that {} block should be a trigger statement I think?
@orchid yew How it should be?
Sounds like you lost control
is it defined?
Is VF_fnc_vfix defined? Copy paste it in the show part of the debug console to find out
players walk to within radius of the marker trigger activates and spawns the units
the current iteration is the below.
_opforMarker = "Opfor_1"; // Name of the marker where the OPFOR units will spawn around
_spawnRadius = 100; // Radius around the marker where units can spawn
_opforUnits = ["O_Soldier_F"]; // Types of units that can spawn
// Get the position of the marker
_markerPos = getMarkerPos _opforMarker;
// Create a new group for the spawned units
_newGroup = createGroup east;
// Define the trigger area
_triggerPos = _markerPos;
_triggerRadius = 50;
// Create the trigger
_opforTrigger = createTrigger ["EmptyDetector", _triggerPos];
_opforTrigger setTriggerArea [_triggerRadius, _triggerRadius, 10, false];
_opforTrigger setTriggerActivation ["WEST", "PRESENT", true];
_opforTrigger setTriggerStatements ["True", "hint 'trigger on'", "hint 'trigger off'"];
// Spawn units around the marker
_unitPos = [_markerPos, _spawnRadius, 360] call BIS_fnc_findSafePos;
_unitType = selectRandom _opforUnits;
_unit = _newGroup createUnit [_unitType, _unitPos, [], 0, "NONE"]; // create the unit
If the function is stored in the variable
Just copy
VF_fnc_vfix
in one of the four lines of the debug console
@warm hedge @little raptor sorry for ping
If you see your function, the function is successfully compiled
_opforMarker = "Opfor_1"; // Name of the marker where the OPFOR units will spawn around
// Get the position of the marker
_markerPos = getMarkerPos _opforMarker;
// Define the trigger area
_triggerPos = _markerPos;
_triggerRadius = 50;
// Create the trigger
_opforTrigger = createTrigger ["EmptyDetector", _triggerPos];
_opforTrigger setTriggerArea [_triggerRadius, _triggerRadius, 10, false];
_opforTrigger setTriggerActivation ["WEST", "PRESENT", true];
_opforTrigger setTriggerStatements ["True",
toString {
hint 'trigger on';
// Spawn units around the marker
_opforMarker = "Opfor_1"; // Name of the marker where the OPFOR units will spawn around
_spawnRadius = 100; // Radius around the marker where units can spawn
_opforUnits = ["O_Soldier_F"]; // Types of units that can spawn
// Get the position of the marker
_markerPos = getMarkerPos _opforMarker;
// Create a new group for the spawned units
_newGroup = createGroup east;
// Define the trigger area
_triggerPos = _markerPos;
_triggerRadius = 50;
_unitPos = [_markerPos, _spawnRadius, 360] call BIS_fnc_findSafePos;
_unitType = selectRandom _opforUnits;
_unit = _newGroup createUnit [_unitType, _unitPos, [], 0, "NONE"]; // create the unit
}, "hint 'trigger off'"];
From @round scroll
hi, I found attachTo is quite stuttering with a boat attached to a davit on a house. I've used setPosASL within a perFrame mission eventhandler and it looks much better. Question is, how costly is it really? I guess there's usually only one carrier on map, and only one rescue boat in question. Video is at https://www.youtube.com/watch?v=xVxLLzU0N0g and code at https://sqfbin.com/icaketavohiqodovigay
What's better, the old attachTo method that is stuttering or the per frame event handler that's probably more expensive?
SQF code available here for the event handler test:
https://sqfbin.com/icaketavohiqodovigay
@round scroll not much, but it's better to use setVelocityTransformation to prevent lag in multiplayer
also to prevent stuttering with attachTo, always attach the object to one with high simulation rate
Like logic
Thanks, but it's not clear to me how to simulate the animation via setVelocityTransformation.
ah, I guess I can just use the mempoint of the animation as toPosASL and apply that every frame, and interval being 1?
this work, thanks for the help! sqf _boat setVelocityTransformation [ getPosASL _boat, _pos, [0, 0, 0], [0, 0, 0], vectorDir _boat, vectorDir _boat, [0, 0, 1], [0, 0, 1], 1 ];
Hmm there was such usecase for this?
what do you mean? Wrong approach?
I mean, I haven't figured how I would use setVelocityTransformation for a reason that only the command can solve
I used it on an AI mission for Nimitz, for taxiing the plane in a sane manner and not looking to jerky
isn't it the base for some recorded path of a vehicle as well?
the whole point of using setVelTrans is providing a velocity and you set that to [0,0,0]?! 
it's the velocity that prevents the lag
so little I know ... is the velocity vector best derived from getPosASL _boat and _pos, e.g. the vector between the two?
well you want the boat to move at a certain speed no?
if speed is constant velocity would be vectorDir _boat vectorMultiply _speed
yes, I need to check the animation of the Davit then, how much meters/second it travels I guess
On the wiki the examples on https://community.bistudio.com/wiki/setVelocityTransformation all have speed set to [0,0,0] - I had no idea it was any important
Hello. Can someone give me a hint on why is this not working for me in SP/MP (tried first in InitPlayerLocal.sqf, not in init.sqf in all combinations):
inGameUISetEventHandler ["Action", "hint 'Lights, Camera, Action!'; true"];
!code
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
inGameUISetEventHandler ["Action", "hint 'Lights, Camera, Action!'; true"];
Want to play around with intercepting 0-8 radio calls...just a copy from Biki example. Tried with HintC, SystemChat. If I just put as expression return simply "true", no action is blocked - and I understand it should be.
What exactly you expected? When do you think the hint is issued?
Again the question. Is this for a mission or an addon?
okay. One thing
Don't remoteExec the hint
That is the event handler that is activated when you activate mouse wheel action. What I understand from Wiki and forums is that it should be activated also when you for example have support and go to call for it through 0-8.
First part, true, last part, false
?
This code will be executed on every machine
So.. just for AddAction?
That is the event handler that is activated when you activate mouse wheel action.
Correct
What I understand from Wiki and forums is that it should be activated also when you for example have support and go to call for it through 0-8.
Incorrect
So yes
Not sure how you're going to add 0-8 menu though
You would send hints from every machine to each other machines
Ok man, many thanks. saved me a lot of time experimenting. I am almost sure that this handler workes some months ago when I added also custom submenu through description. ext. So I assumed it would intercept built-in 0-8. Will try later again with custom. Thanks. My goal is to have resource-based (player money) arty/CAS request quick and dirty... so.. no money - > support requester rejected.
meaning you will have 5 hints on one machines if 4 machines are conected to the server
Just use hint
Well if you would use it.
Then don't remoteExec it here.
It isn't?
❤️ thanks dude it works
any where that you could point me so that i can try to learn about setting it up so that when the group dies it deletes it so i dont hit the limit on groups for the mission
What units have you placed?
Well, you have to run CBA for XEH
And it still does nothing?
won't work either
cursorTarget getVariable "VCOM_NoPathingwhatever"
https://community.bistudio.com/wiki/createGroup
In Arma 3 auto-deletion [✓]
And if there is alternative syntax to set false/true current value.
(don't forget to put it in one of the watch fields)
unchanged as in?
Maybe VCOM uses it's own eventhandler that is executed later and overwrites it.
replace the remoteExec hint with a simple
diag_log text str _this;
And check the rpt
also load the mission again after changing the description.ext
Also check
isClass (missionConfigFile >> "Extended_Init_Eventhandlers")
with the debug console
(scratched my yet another excessive idea)
a feature creeper
my last truly failed system was about a year ago ... wanted procedural helicopter landings (without AI)
theres only a few ways to make a heli fly without the AI
crashing, and not
for multiplayer i settled on "addForce" + "addTorque"
so i had complex propulsion with addforce, but there was no way to "clearForce" so it became super hard for me to control the flight
in nvidia physx there is "clearforce" but not in arma
it looked nice and natural but the longer the flight the more unstable it got 😄
I assume "just" applying opposite forces don't cut it?
yea
i think it would have been possible with a "clearforce" command, since there's also no getter
ah, yes
wonder if you could use addforce to simulate 0 gravity instead of halving velocity on each frame 🤔
Only one idea came from attempting that helicopter flight system w "addForce" ... discovered actually looks very nice to use "addForce" + "addTorque" to carry a crate, instead of attachTo or a setpos loop
you can effectively use addForce and addTorque to keep a small box in a certain position (like in front of the player), and it has nice elasticity, and also retains physx, so it will bump into a surface rather than warping into it
but i never developed it, just bookmarked and moved on to other things
so if anyone wants an interesting weekend project, work on controlling an ammo crate with addforce+addtorque, its probably got a future in a carry script somewhere
since it failed with procedural helicopter landings
and if the @still forum gods gave us a "clearForce" and "clearTorque" command it would be legendary, we could actually simulate flight
how much potential to launch vehicles into orbit would a physics based carrying script have?
arma 3 space program
*Gmod physics crunch noise*
the sound of all of your bones breaking in ace medical
What does
cba_xeh_fnc_init_once
say?
Wait add force is permanent?
In what sense?
You don’t need to apply it with oneachframe to keep it “floating” ?
Nope. In that sense addForce is a temporary
Damn, I have some fun ideas with it lol
it's more like addImpulse than addForce
hold shift and press end
copyToClipboard (cba_xeh_fnc_init_once)
It's
copyToClipboard str cba_xeh_fnc_init_once
Nah. Was just testing if CBA is running
Okay. Test passed.
Well I have no idea why it doesn't work
oh wait commy, I think I know why......
Say
remember when I was trying to use XEH last time.....
holding breath
mission syntax might be different than mod's one
Hmm. Wait.
class Extended_InitPost_Eventhandlers {
// vehicles
class BWA3_Puma_base {
initMission = QUOTE(_this call DFUNC(initPuma));
};
};
After I use:
west setFriend [west, 0];
All west ai units leave their vehicles if they see enemy, things like below doesnt help to prevent them from leaving vehicles:
allUnits apply {
_x disableAI "all";
_x setVariable["NER_unitAssignedVeh",vehicle _x];
(group _x) addVehicle (vehicle _x);
_x addEventHandler ["GetInMan", {
params ["_unit", "_role", "_vehicle", "_turret"];
_vehicle allowCrewInImmobile true;
_vehicle setUnloadInCombat [false, false];
}];
_x addEventHandler ["GetOutMan", {
params ["_unit", "_role", "_vehicle", "_turret"];
private _assignedVeh = _unit getVariable["NER_unitAssignedVeh",objNull];
if(_vehicle isEqualTo _assignedVeh && alive _assignedVeh) then {
systemChat format["Moving %1 in veh %2",_unit, typeOf _vehicle];
_unit moveInAny _assignedVeh;
};
}];
};
I have this in one mission and it definitely works
!code
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
use that to format the code
It's a InitPost instead of init, but that doesn't change anything here
do you get the messages in systemchat?
also i'd use a foreach loop instead of apply
In that case it's XEH fucking up I would say
yes its constantly showing that message because they are constantly leaving vehicles
are members of the same squad still friendly with each other with west being hostile to west?
Thats why we need this PR:
https://github.com/CBATeam/CBA_A3/pull/186
Solves all these issues. Then XEH can finally rip
will check soon, but probably not, however they are still in the group, but still even if there is a single AI sitting in an APC as gunner without anyone else in the vehicle, why would he leave that vehicle instead of firing at enemy west AI?
what do you mean by friendly?
not killing each other
by that script they cant because all AI features are disabled anyway
they most likely cannot stay in the same vehicle as… an enemy's
even if there is nobody else in that vehicle they will leave such vehicle, in example: if there is Offroad HMG with single AI unit sitting in gunner role, then he will leave that vehicle instead of firing at enemy
Since they are themselves west, it could be that they detect the vehicle as being west (and therefore enemy) and decide they can't be in it
that's what i thought, buti just tried forcing an opfor soldier into a blufor occupied vehicle and he stayed inside
I'm really not surprised that setting a side enemy to itself has unexpected results
but if features wont be disabled then yes they would shot each other (thats what I want)
Isn't the issue here that the default physics logic is still adding forces on top of what you input? And you can't disable that without disabling everything else.
so i messed around with it a bit and it seems that hostile units can work together as a crew of one vehicle
Ran into that issue with dive bombing, default physics was trying to raise the nose faster than I was pushing it over.
Makes sense. We use separate driver/gunner groups to force careless driving without hanging out of the turret.
I wonder if they use the vehicle side or their own side when making decisions...
@hasty gate if i force a hostile into the drivers seat of my tank, he will get out after half a second, however, if i (as the tanks commander) command him to drive the tank, he will not get out and drive the tank instead.
Like driver might be trying to avoid redfor tanks, while gunner is trying to shoot blufor tanks :P
i suggest you experiment with that a bit
thank you, but still I need a group without a player to be able to do so
of course, i was thinking about something like seeing if you can force them into their vehicle and immediately give them an order via sqf to make them compliant with being in that vehicle
another idea you could try is to have a second side that is friendly to blufor own the vehicles
@hasty gate I would say - "what is your original idea" first
because if you want only one group of BLUFOR to be attacking others, you can mimick that as OPFOR
what is your end goal?
Original idea is that in Exile Mod, all players + AI are in the same side, and on top of that there is custom 'clan' system which something like scripted side in side. I want to able for AI units attack enemy 'clan' units while they are in the same side, with all the native AI behaviour work fine, like doTarget should also make an AI attack enemy target. So far workaround was to issue commands like _unit doTarget _enemyPlayer; _unit doFire _enemyPlayer; which works but I think they wont take cover etc.
in that case just make the enemy clan units join a hostile side
well, there are not enough sides in the game to do so, you see there might 50 clans inside one side
and they're all supposed to be fighting each other at the same time?
yes
but two members of the same clan are not supposed to fight?
yes
ye hard stuff, but everything would be ok if they just don't leave their vehicles, this is our last puzzle
the only other way i can think of to make it maybe work is trying to work with the 3-6 sides that you can use and whenever one group of ai spots another go and dynamically switch them around
also if units of the same squad still fight each other, how would you make units of the same clan not fight each other?
or it could be that we are just missing something with doTarget doFire method, for example, what is actual command/waypoint whatever used if an AI get into contact with hostile AI?
via disableAI commands it works
but wouldn't they also not shoot hostile clans then?
yes, but you can issue doTarget doFire commands by another script and they will fight such unit
does the leaving vehicle thing still happen if you assign them all to sideEnemy?
did you remember to load the mission again after editing the description.ext?
upload the rpt to pastebin
no, but they dont attack each other as well
what happens if you declare blufor hostile to blufor and give the vehicles a sideFriendly commander?
It works! and they fire at other units too. However now I'm thinking if there arent any other cons with this, but thats good idea, thank you
west setFriend [west, 0];
private _grp = createGroup sideFriendly;
[f1] joinSilent _grp;
f1 moveInCommander veh;
u1 moveInGunner veh;
I guess if there is a gun in the commander role, he wont use it against WEST?
setting effectiveCommander might help tho?
i have no clue
"C:\Users\admin\AppData\Local\Arma 3"
Don't -.-
I hate how this channels descripton is
IF (script == true) etc.
Error generic error in expression
If (script == typename true) or (script)
oh please
Q: maybe I am barking up the wrong tree here, but, are there any EH approaches (i.e. solutions) for object variable changing/changed event notifications? I see for instance addPublicVariableEventHandler sort of gets there, is deprecated 'today', but was also focused on missionNamespace, whereas I am looking for something focused on anything that can be the subject of setVariable.
I see remoteExec functions mentioned as the migration path, but am not clear what migration path that is; or is the focus there simply the remote invocation of whatever functions might be called in response to the thing that just happened (whatever that was, setVariable, for instance).
Thinking it through, the issue I think that is more the case is the client/server variable sync, because a variable was set public global (i.e. true) does not necessarily mean the sync has happened yet when the EH occurs. Could be missing something there, but I think that is the challenge.
Of course then there is the whole CBA EH approach, local, server, target, etc, but that's beyond the scope here, I think, for the core question.
https://community.bistudio.com/wiki/addPublicVariableEventHandler
https://community.bistudio.com/wiki/setVariable
https://community.bistudio.com/wiki/remoteExec
Thoughts? 🧠
how you think that can be done?
i mean an addforce is a little impulse, and thats it, but when you do an "eachFrame" how you find a the ammount of force to keep it floating?
it would show "hello world" in the debug console, i think
nothing useful. -1
it doesnt return "char *output" ?
if (call compile str if (true))
uhm nvm I remembered wrong
Return Value:
String - data sent back from extension; If the extensiion was not found an empty String will be returned
oh god
it will return that yes
Anyone have any direction to point me on make an object holdable?
the extension already returns a string
Could be the case, whale
hint ("mytestdll" callExtension "Hello World")
Wow making
In that case you could try:
_this spawn {
waitUntil {isNil {_this getVariable "whatever"}}
_this setVariable ["whatever", false];
};
What do you mean by making ? only weapons can be handheld
just remember with hint that it wont show anything if the string is empty. good to keep in mind when testing
Yeah whatever. Also needs a ;
how do i convert UID to the player object?
allPlayers select (allPlayers findIf { getPlayerUID _x == _uid })
So I guess I need to know what I need to do to make an object a weapon then like a wrench or a bat
Will break (select -1) if not found. Should be checked if it matters.
hmm was hoping there would be a command i couldnt find but yeah that works haha. Thanks 😄
Maybe there is. Not like I know all the commands :P
john you know everything though
allPlayers select { getPlayerUID _x == _uid; } params [["_player",objNull, [objNull]]]
then use _player however you'd like, i.e. isNull _player, alive _player, etc.
not that John's approach is invalid, but allPlayers index cannot be guaranteed to map back to the same player, I think.
You'd have to write a weapons config for them and probably make a .rtm animation
Fun question. I don't think you can get a scheduler break in the middle of a findIf.
Trying to help my model guy make this guitar a weapon I suppose
sure, depends 'when' he uses the index
you can
the problem with this one is that it would be a bit slower
because it runs thru all players
_allPlayers = allPlayers;
_allPlayers param [_allPlayers findIf { getPlayerUID _x == _uid }, objNull];
is another approach
if you intend to run it on the server I think you can get it using getUserInfo iirc 
hmm, ok thanks!
no it uses playerID, not UID 
One other question... How can i tell my code to wait for a player to respawn? Or will JIP code wait to run when they select their spawn location?
Hi guys, i am trying to use relative positions and model to world to replicate buildings, specifically the ghost hotel and the composite buildings it kind of works but it isnt precise or the code i have isnt quite right http://pastebin.com/GMkiahXM gets the relative positions of objects i want to place/replicate. http://pastebin.com/P3NQHKJN this places the objects using player to modeltoworld.
…BIS_fnc_getUnitByUID?
looks good.
but it does not truly iterate all, exitWith at the first match. O(n) either way, I think.
not like there is a hashmap of UID, that would be something...
because allUnits does not get dead units, and a player can be waiting for respawn
What's the mechanic there? units owned by dead-waiting-for-respawn players still have a playerUID but aren't in allPlayers?
playableUnits specifies that it doesn't include dead players waiting for respawn, but allPlayers doesn't.
Uhm, Brun. What exactly is the issue?
yep
playableUnits includes AI too, so it's more "available slots right now"
i can replicate the objects but they do not line up exactly
ah. ok.
for the composite buildings is important
On a quick check, doesn't seem to be true? lifeState DEAD_RESPAWN units are still in allPlayers.
hmm, then would a waitUntil !(lifeState DEAD_RESPAWN) work for detecting unit spawn?
we have event handlers for that
perhaps 🐮
you are using the old syntax of createVehicle
argh, maybe it was true in the past and it was changed in an undocumented version
You have to use createVehicle ARRAY to define the exact position
could I mention for headless clients also?
Your code needs an update overall
Or you adjust the position with setPosASL and setVectorDirAndUp after createVehicle
the first part isnt my code second part is, ill adjust the createvehicle and see how i go
Yeah. Dunno what the variable is supposed to be.
Nope
So the XEH stuff is working now, but VCOM doesn't do what you expect?
post the rpt
I know if CBA works then
(unless you removed the diag_log)
what this command actually does https://community.bistudio.com/wiki/enableAttack?
Thats fucked up.
CBA + BWA3 1.3 is 54 kB
Well if it's full of script errors then you can't expect any code to work
what the page says
Are you sure it's not you entering stuff in the debug console? They log that every frame too
Nah. getVariable syntax is either string or array
I mean what are the "attack commands" technically? new waypoints?
single quotes do the same as normal ones
oh fuck
I know what you did
hahaha
here is the thing
in your fix script
the _this variable
is
[_unit]
yup
Do this:
params ["_unit"];
And use _unit instead of _this
lol, always the simplest thing :0
Haha. And thats why you don't disable the log
params ["_unit"];
join the revolution
I'm trying to create a waypoint of type DESTROY, when I do that via editor it works as expected, units move to kill target unit attached to waypoint. When I do that via SQF script it they don't, they just stand there doing nothing, does anybody know whats the issue?
(group u1) reveal player;
[group u1] call CBA_fnc_clearWaypoints;
private _wp = (group u1) addWaypoint [player, 0];
_wp setWaypointType "DESTROY";
(group u1) setCurrentWaypoint _wp;
Player is EAST side, group u1 are just 4 units of side WEST (default Fire Team NATO->Infantry in editor)
Hey commy that link you gave me on weapon cfgs doesn't go anywhere
params ["_unit"];
in the first line of the script
and in the first line inside the spawn
then replace all _this with _unit
inside that script that is
How so? Andino
just add+setType should do
note that the waypoint won't follow the target as such, you need to waypoint attach it
Don't listen. You did good.
how do I attach such waypoint to player?
thank you
anyway, its weird, they do nothing if I do that by scripting, current code:
(group u1) reveal player;
[group u1] call CBA_fnc_clearWaypoints;
private _wp = (group u1) addWaypoint [player, 0];
_wp setWaypointType "DESTROY";
(group u1) setCurrentWaypoint _wp;
_wp waypointAttachVehicle player;
nevermind, I see editor actually creates 2 waypoints, probably thats the reason, 1 is waypoint MOVE, and second is DESTROY
lol
(group u1) reveal player;
[group u1] call CBA_fnc_clearWaypoints;
private _wp = (group u1) addWaypoint [getpos u1, -1];
_wp setWaypointType "MOVE";
_wp = (group u1) addWaypoint [player, -1];
_wp setWaypointType "DESTROY";
(group u1) setCurrentWaypoint [group u1, 0];
_wp waypointAttachVehicle player;
doesnt work 🤦🏻♂️ , I have added exactly the same waypoints which are present when I do that via editor
I just got used to climb through windows :D
I was once pushed through a 50 cm thick wall thanks to collision + rotation axis
It was with basic medical, so only my torso was wounded
But it was one of these maps with huge compounds
I had to walk 2 mins through enemy territotry alone
group u1 addWaypoint [player]; // already is a "MOVE"
private _wp = group u1 addWaypoint [player];
_wp setWaypointType "DESTROY";
_wp waypointAttachVehicle player;
you'll try without mods, too
And everyone laughed at me.
my bounding box was kind of fused with the building, when someone tried to drag me I got teleported :D
Mine too, but I always forget to either enable file patching or remove my debug messages
Is there a way to complete a task without assigning it to the player first? At one point I'm creating a task:
[true, taskStealth, ["(Optional) Get to the APCs without getting spotted.", "(Optional) Stay undetected", "marker_apc_workshop"], objNull, "CREATED", 2, false] call BIS_fnc_taskCreate;
then at some point I want this task to be completed along with a different task once the player reaches a trigger:
[taskReachApc,"SUCCEEDED"] call BIS_fnc_taskSetState;
[taskStealth,"SUCCEEDED"] call BIS_fnc_taskSetState;
my expected result is that I would see, in order:
- A notification that task taskReachApc is completed
- A notification that task taskStealth is completed
but what actually happens is:
- A notification that task taskStealth is completed
- A notification that task taskReachApc is completed
- A notification that task taskStealth is assigned to the player
the last one is extremely weird, considering that when I open the tasks menu they are all marked as completed and none are assigned 🤔
How do I get rid of the last notification?
:D
Could be, is there a way to disable this for a mission? I'd like to have full control over tasks via scripts
So. Now that we have a Spanish Tiger (FFAA), and a German Tiger (BWA3 soonTM), when do we get a French one, alganthe?
I'm not into model making
hmm, can't find it right now
I think it was disableable at least in A2, but there was a task rework since so I don't know
I would recommend to close the not current one first then the current one
any ideas?