#arma3_scripting
1 messages ยท Page 237 of 1
FYI, this is a snippet of my current code:
_splatter setDir (random 360);
_splatter setPosASL (_surfacePosition vectorAdd (_surfaceNormal vectorMultiply (0.02 + (random 0.01)))); //Place splatter slightly offset from surface to prevent Z-Fighting.
_splatter setVectorUp _surfaceNormal;
and of course, the setDir is reset upon setting vectorUp
it works!
thanks a ton NetFusion -- I'll be sure to credit you on the forums!
and in the code ๐
Been pulling my hair out trying to think out the trig behind this
almost worked -- had to modify your solution a bit. Here's what I came up with:
_splatter setVectorDirAndUp [[sin _angle, 0, cos _angle] vectorCrossProduct _surfaceNormal, _surfaceNormal];
thanks again
Hey guys, trying to make a little script to make ambient aerial combats. Created 2 groups, 1 with 3 blufor F/A18 and 1 with 3 opfor SU25 spawning above water, and then having random waypoints on map. Problem is that they cross but do not engage. Here is how I make waypoints ;
_wp = USGrp addWaypoint [_cord1, 200];
_wp setWaypointType "MOVE";
_wp setWaypointBehaviour "COMBAT";
_wp setWaypointSpeed "FULL";
I think it coulb be because of the waypoing type "Move" but how to make a waypoint that says "Move, if you see something, engage, then when engagement over, continue the waypoint" ? I already checked waypoint type on wiki, but did not found my solution
THx by advance ๐
Fixed sry
yea
I do
_object = "OBJECT CLASSNAME" createVehicle [0, 0, 0];
_object setPosASL _POSITION;
supposedly more optimized this way
I figure it has something to do with createVehicle's algorithm for placing the object at a clear position and aligning the vectorUp to the terrain surface.
trying to use roadsConnectedTo but its only eve returning 2 roads
maybe i misunderstood what the command was for lol
sup
Never used that command, it might be checking the individual road objects that are adjacent to the road tile being compared to
perhaps for AI navigation
Maybe you thought it was checking a long stretch of road?
i did ๐ฆ Ideally I was looking for an easy way to get all road segments between two positions
@agile pumice easy ... arma ...
good one
to get all segments of a road you will have to run over all segments using "roadsConnectedTo"
however, that will (as already mentioned) not provide you with intersections due to the way roads in arma work (which is pretty much also why it is PITA to write a proper "navigation" script which would guide you through the streets of whatever map)
if you execute nearRoads with a radius as big as the map you would end up with the whole road network, other than that one could proably parse the roads.shp and go on from there
not provide you with intersections
for Tjunctions it should, (never seen a Xroad actually used). runways have no 'intersection', and you are quite correct that two roads crossing over each other, you'll only get/see your two connection points
an algorythm fpr pathfinding
Really?, why i never heard of the most used pathfinding algroithm.
it would improve your script and prob fix the issue in your video
You have failed the reading test.
Congratz. you get one "Dork" tag.
Please smash nearest door into your face several times to cement this fact.
no i just try to give you input (and especially others who read here)
if you dont need help feel free to ignore it
If you are feeling uneasy about smashing the door in your face.
Don't worry, it be over soon enoguh.
and i am sorry that i dont know what algos you ve heard of
The last version i produced was fully functioing expect for issues with arma road network.
i assume you have problems finding a contected road that is a independant polyline from the one your are following, is that right?
- Test it
- Recognize how slow it runs
- Optimize it
- Repeat
@nocturne bluff hope you find something useful in my code
@tough abyss that was the gist of it, the issue makes it pretty impossible to path into certain areas.
@deft zealot congrats.
or something
I dont know what you want?
a medal?
did you try to check a small radius with nearRoads on each road object and filter out the two roadsConnectedTo + the one you are executing the check on, if there is another one it is the start of a new road polyline.
just a idea..
Yea.
That's what i did in the end.
It worked fineish
I was waiting for getRoad command.
We got that in 1.58
can't find it on the wiki..
does it return the whole road ployline?
do checks left and right of your road segment
at least it could be used for that
are you doing AI pathfinding or what is this for?
I aint doing anything anymore
that was like 6 months ago, was working on convoys and the like.
Used it for one mission to generate roadblocks
hey guys, ive made a online sqf tool. thought some of you guys here might like it ๐ http://sqf.io/
great tool!
ty. im working on adding an sqm to sqf converter too atm
is the source for the iseco encrypt/decrypt available somewhere?
i can give you my javascript function if you want?
my friend made a sqf version once
its the "Molaron's edit" encryption of iseco on my site
ty! the design is inspired by google's material design
I like the gui to sqf
me too. i just hate hpp. ctrlcreate is so much simpler and easy to use
also you can animate dialogs using sqf. like i did here: https://www.youtube.com/watch?v=Du76sXPA764
I'm still a noob at ArmA GUIs -- it's a pain in the ass so far
I prefer having full control over everything -- so going the SQF route would be a better way to handle this for me
also gives me a quicker preview of any changes
-- honestly didn't know you could create GUIs from SQF -- never bothered to look into those commands -- so thanks for bringing that to light as well ๐
youre welcome haha ^^
is there anything in your tool that relies on back-end code?
just wondering if it's possible to download your tool to use offline
commands only allow you to create BIS defined dialogs and controls
lol
You're forced to use config if you want to create anything specific.
^
@lone glade What about user-added controls in the configs?
I been busy hpping today
i allways create the ctrls using hpp and animate/change them a bit up with sqf ๐
That's what I meant zooloo
alrighty
you're forced to include them in the description.ext of your mission of you want to use them.
(or use an addon)
Any proper dialog combines sqf and hpp
of course -- wouldn't be much point to have a dialog that does nothing, lol
exactly ^^
Lol
you don't really need hpps much any more
can do it all with sqf
i made this gear selector https://dl.dropboxusercontent.com/u/14576264/2016-02-25_00001.jpg with only an empty container + the buttons in the top right in the config (because you can't set the textures on RscShortcutButtons with sqf)
you don't really need to? you're already in a script when you createDialog
I made an empty dialog config for the main dialog class because I'm not sure if there's a built in blank one, so could've used onLoad, but not really any point
Nice, what's the script called?
not released publically yet.. asor gear selector
the old version is released, but it uses the standard config based controls
@rancid ruin defintiely not because rule 18. right @empty pagoda and @wispy cosmos ... read #info_help_tips
thought so. keep up the good work
@vapid frigate while on the subject, how do you get coordinates of where you want your controls to be? I usually use the in game GUI editor, create the positions and sizes, export and use only the x y w h values...just wondering if there's other ways
using maths/defines
stuff like #define primary_weapon_pos (top + title_height + top_spacing)
But that goes with a bit of trial n error right?
i guess, i find it easier/faster than fiddling with the ui editor though
Ah
But having to constantly restart back to Eden to see if my control is in the perfect position would be tedious I reckon
that's the macros for all the positions in that ui
its most basic calculations ... nothing with trial and error
"trial and error" is it only if you either have no idea where to place them (which means you did not created a basic UI document first which you can use as reference) or that you have no idea how to do math
yeah, you're right.. it's not really trial and error (although I won't pretend i didn't make some errors along the way)
it's just thinking it out logically
I usually don't come up with an ui layout until I'm actively making it lol I guess a bad habit o mine
yeah.. i started with this https://dl.dropboxusercontent.com/u/14576264/asorgs3layout.png
But yeah seems there are two ways...ima stick to the ui editor since it works faster for me...but thanks for the insight
made this about 3 months ago
the end result is a lot different ๐ - well a few things
nope @fallen locust but it is currently in progress
a lot of thinking now started properly
head over to #arma3_tools and follow the discord invite there if you want to keep a lil more track ๐
right now ... what you see is just the front-end which is already designed (i hate unfinished work in that shit)
i'm running in to performance issues using allMissionObjects....presumably it's not a command which i should really be using throughout a mission? better to refactor with a more sensible command?
i wouldn't use it every frame or anything
might be what you're doing with all the objects?
rather than the command on its own
i'm calling it every minute or so to find objects of certain classes which i want to save to a database
it's noticable when it's running?
it just causes a noticeable lag of at least a few frames, no matter if i call it with allMissionObjects "classname" or "all"
yeah it totally locks up for a few frames
have you tried taking out the contents of the loop or whatever you're doing?
to see if it's that slowing it down rather than 'allmissionobjects'
and you spawning the script, not calling it?
i'm execVMing this file
_objects = allMissionObjects _x;
{
if (_x isKindOf "GroundWeaponHolder") then {
// small code block
};
if ((_x isKindOf "Car") || (_x isKindOf "Helicopter") || (_x isKindOf "Plane")) then {
// small code block
};
if (_x isKindOf "ReammoBox_F") then {
// small code block
};
} forEach _objects;
} forEach ["GroundWeaponHolder","Car","Helicopter","Plane","ReammoBox_F"];```
fully open to the idea that that ^ is shit code, logic is not my strong point
i mean, it all works, but the time has come to refactor and optimise the mission
not certain, but i think spawning a compiled function is quicker than execvm (but probably not that much)
did you see the note on the wiki that it's much faster on the dedicated server?
performance wise you would also be better off running separate loops (so you're not doing the isKindOf comparisons on every object)
for "Car","Helicopter","Plane", you could just use "vehicles" instead of allMissionObjects.. then you'd be calling it 2 times rather than 5
i'm gonna test that right now
also gonna test the "entities" command which i hadn't noticed before but is linked on the allMissionObjects wiki page
i don't really want to rely on the mission performing badly on anything except a dedi as it'll probably not be run from a dedi most of the time
I believe entities also picks up weaponholders
The physx ones at least I think.....
at least near(est)Entities does that so yeah not sure
damn, entities does seem to be faster for "proper" vehicles like cars, etc, but i can't get any of the entities commands to return weaponholders, which is kinda crucial
oneoh -- that search can be optimized
I don't think you need that outer foreach. You're already checking against that list through your conditions within the inner loop.
One factor for the lag you notice is due to you searching all objects 5 times when you could just do it once
null = [this] execVM "LO\JTF2OperatorGear.sqf";
So, why does the above not do anything?
The above is pasted into the init field of an offroad./
Was hoping to have it be script based, to make it a bit more modular.
Want to avoid using the EDEN menu.
hmm
null = [this] execVM "LO\JTF2OperatorGear.sqf";
try this instead:
_s = this execVM "LO\JTF2OperatorGear.sqf";
@dull parrot
comment "25thMEU JTF2 Operators Gear - vehicle Cargo Script";
hint format["Set _veh to jtf2_truck"]
private ["_veh"];
_veh = _this;
// _veh = jtf2_truck;
hint format["Works"]
comment "CLEAR";
hint format["Clear"]
clearBackpackCargoGlobal _veh;
clearItemCargoGlobal _veh;
clearWeaponCargoGlobal _veh;
clearMagazineCargoGlobal _veh;
hint format["Works"]
comment "MAGAZINES CARGO";
_veh addMagazineCargoGlobal ["rhsusf_mag_17Rnd_9x19_JHP", 12];
_veh addMagazineCargoGlobal ["CUP_30Rnd_556x45_Stanag", 24];
comment "BACKPACK CARGO";
_veh addBackpackCargoGlobal "tf_rt1523g_black";
comment "WEAPONS CARGO";
_veh addWeaponCargoGlobal ["CUP_arifle_M4A1_desert",5];
_veh addWeaponCargoGlobal ["rhsusf_weap_glock17g4",6];
_veh addWeaponCargoGlobal ["CUP_SOFLAM",1];
comment "ITEMS CARGO";
_veh addItemCargoGlobal ["CUP_HandGrenade_M67",6];
_s = this execVM "LO\JTF2OperatorGear.sqf";
Fixed stupidly placed syntax error, also this is being called on a Offroad
got it working?
just a var to store the return value from the execVM
it's needed when executing scripts in the init line (for some reason)
ahh
I'm assuming you're running with CUP and RHS?
Yeah
comment "25thMEU JTF2 Operators Gear - vehicle Cargo Script";
private ["_veh"];
_veh = _this select 0;
// _veh = jtf2_truck;
comment "CLEAR";
clearBackpackCargoGlobal _veh;
clearItemCargoGlobal _veh;
clearWeaponCargoGlobal _veh;
clearMagazineCargoGlobal _veh;
comment "MAGAZINES CARGO";
_veh addMagazineCargoGlobal ["rhsusf_mag_17Rnd_9x19_JHP", 12];
_veh addMagazineCargoGlobal ["CUP_30Rnd_556x45_Stanag", 24];
comment "BACKPACK CARGO";
_veh addBackpackCargoGlobal "tf_rt1523g_black";
comment "WEAPONS CARGO";
_veh addWeaponCargoGlobal ["CUP_arifle_M4A1_desert",5];
_veh addWeaponCargoGlobal ["rhsusf_weap_glock17g4",6];
_veh addWeaponCargoGlobal ["CUP_SOFLAM",1];
comment "ITEMS CARGO";
_veh addItemCargoGlobal ["CUP_HandGrenade_M67",6];
Tried passing it a global variable, and using the init.sqf
Did not work.
Tried assuring I was selecting the correct object, still nothing.
Getting no script errors as well.
weapon: "arifle_MX_ACO_pointer_F"
weapon: "hgun_P07_F"
magazine: "30Rnd_65x39_caseless_mag"
magazine: "HandGrenade"
Well, fixed that
// JTF2 Operators Captive Timer.
private ["_jtf2group"];
private ["_jtf2units"];
_jtf2group = group comp1;
_jtf2units = units _jtf2group;
// set all JTF2 operators to captive to emulate being sneaky bastards
{_x setCaptive true;} forEach _jtf2units;
// Sleep while not armed.
while {isNull currentWeapon forEach _jtf2units;} do {sleep 30;};
// Shit gets real.
{_x setCaptive false;} forEach _jtf2units;
This however is throwing a syntax error at line 11
That's the while{isnull...
Saying I am missing a ;
yeah check the isNull currentWeapon forEach _jtf2units; part
thats not how u forEach
:p
need the {}
Also I don't really know what this is being used for?
but syntax wise
{ isNull currentWeapon } forEach _jtf2units;
i think he meant to do something like waitUntil {sleep 30; ({!isNull currentWeapon _x} count _jtf2units) > 0 }
Anyone wanna collab bro?
I got her figured out all, essentially I can now - Dynamicly populate vehc contents via scripts, and make groups captive (Undercover) based on conditions IE not holding a weapon.
I can't make this code work on a dedicated server :
_chute = "Steerable_Parachute_F" createVehicle [0,0,0]; _chute setDir random 360; _chute setPos (PilotSpawnPosition vectorAdd [0,0,100]); player moveInDriver _chute;
I can see the chute spawn, but I never get in the chute. The code even use to work on a local host
there is no 'player' on dedicated server
It runs locally
should work then afaik
hint player works, hint Position works, but I can't figure it out ๐ฆ
I can see the empty chute spawn
i assume discord has screwed up the underscores?
where at?
when i copy/paste it it looks right
Ok
for some reason moveInDriver does not work and it use to
oh
I am dumb
I had died somehow
when testing
-_-
chute != _chute
So I have a question for y'all
In the context of objects in the game, like a player's unit, is it possible to add my own variables to each unit
I'm guessing it is, well hoping to be honest
setVariable might be what you're looking for. https://community.bistudio.com/wiki/setVariable
@noble ether you can add a variable to almost anything
how do I temporarily disable a trigger?
try:
yourTrigger enableSimulation false
hello all
in the past i have mod some cars , in class vehicle => Event handler init = "_this execVM '\LAPS_FrankCaptainPuff_Cars\Scripts\init.sqf'";
but when i load the vehicle ingame thats show me error cannot find "\LAPS_FrankCaptainPuff_Cars\Scripts\init.sqf"
my folder is exactly Same
i have the init.sqf inside Scripts folder
maybe this command : "_this execVM '\LAPS_FrankCaptainPuff_Cars\Scripts\init.sqf'"; is old and they have replace byy a fonction for performance code issue ?
lol , ok thats was my bad , i always use pbo project from mikero for creating addon , but i got error when i create vehicle : model cfg do not want external class , then i used addon builder but this program never copied my sqf files , then on field => list of files to copyy directly in addon builder i wrrite .pac;.paa;.rtm;.sqf;.sqs;.bikb;.fsm;.wss;* .ogg;.wav;.fxy;.csv;.html;.lip;.txt;.bisurf;.sqm;.ext;.dbf;.prj;.shx;*.shp and then all is fine sorry was myy bad
okey
get ready for this 4 page essay lmao
i need to make a rappel script for like throwing rope and climbing off of building etc, where do i start with this
have you ever scripted in SQF before?
once
no need to post all the sqf here, use pastebin/pastie or such
but nothing like this
also i will answer when i get time, mood, the stars position is right and such ๐
ye i get it
if youre a beginner, start smaller
remember that BIKI and BIForum and OFPEC and google is always your friend
start making stuff and youll learn
well google has failed me
because everytime i google rappel i get fast rope
like
ffs
way too ambitious for a first project
then start connecting stuff to a full script when youre more condifent
come back to it after 30
wondering if it can be done with an invisible vehicle with only a passenger seat that the unit can shoot from
wat
and then attach a rope from the rappel point to that vehicle
no
that will get me no where
or nowere
how ever you english people do it
ffs
wells i'm working on a car for my LAPS addon , but i'm stuck on gearbox , the problem is my gear move from -1 (reverse) ,0(null) and 1 (first speed) but never move to 2, 3,4 etc... redline = 7500 omega = 785.4 #define MAX_RPM 7500 #define RPM(rpm) (rpm/MAX_RPM)
GearboxRatios[] = {"R1",-2.97,"N",0,"D1",2.97,"D2",2.1,"D3",1.46,"D4",1,"D5",0.74,"D6",0.50};
maybe latency or switchTime i must change
how do I play a sound for a given number of times?
anyone here familiar with ACE medical? My problem is im trying to get something to happen upon pressing a key while you are unconscious (put a beacon or marker for medics to see). But the keypress doesnt work while you are aceunconscious. it works fine while conscious.
if (!isDedicated) then {
keyPressed = {
_key = _this select 1;
_handled = false;
if (_key == 55) then {
hint "test placeholder";
};
};
waituntil {!(IsNull (findDisplay 46))};
(findDisplay 46) displaySetEventHandler ["KeyDown", "_this call keyPressed"];
};
Anyone know if locations always have a name? Example, if I were to use createLocation, is a 'name' automatically assigned to it or do I lose all references to the location if I don't store a reference to it at the time createLocation is called?
I'm just wondering if there's a way to retrieve access to a location if you haven't created a reference for the purposes of checking for duplicates or to see if a given location has been modified after it has been created.
the "name" of an object is just the global variable it represents
in other words: without you actually assigning the value returned by createLocation ... the location will just be lost
((in fact ... you still can receive it ... but you still can assume it as lost))
why "afraid"?
just save it to a var and publish the var afterwards ... there is no real problem here
Oh, I'm not the one creating the locations.
only thing you have to take care is due to some weirdo shit at BI with setVariable and/or getVariable
I'm tracking the locations that are created and displaying them separately.
still do not rly get your problem
there is no possible scenario where the variable name could solve/cause problems
anyway ...
Not worth getting into. Thanks for info.
hey @cold quartz , need some help?
shoot me a PM and I'll help you get everything sorted out -- and I won't belittle you in the process! ๐
apply salt to wound
@wispy cosmos I don't think I was belittled but I appreciate the offer. My situation is non-standard and I figured out a way around the problem that worked for me. Thanks!
Congrats!
@Jermin#1414use for
Any idea of the charset that A3 uses?
@tender fossil , UTF-8 probably
@frank cedar Alright, thanks. ๐
should I be using an exit command to break out of a spawned function that calls itself at the end?
Recursion...good question
@agile pumice If you call the same function at the end it will keep running until one of the called functions stops using exitWith
should I just stick exit at the end?
aw
The script ends automatically already doesn't it
if it reaches the end of the scope it ends afaik
Ah alright ๐
@agile pumice I am curious though, I've never ever had to use a recursive function using calls in ArmA before, are you sure you need to?
its a makeshift eventhandler
hmm that doesn't tell me much but it's fine, I can imagine you're busy ๐
i could share the source if you want
dont worry about the MG_ACE_MouzeZEvent, I know its not in use atm ๐
can someone give me a hand with some line intersection stuff?
trying to use boundingboxreal with lineintersectswith
http://pastebin.com/raw/1Nzw5zrv calls http://pastebin.com/raw/JgKpssQ6 but im getting "0 elements provided, 3 expected"
drawbounding modified from http://killzonekid.com/arma-3-bounding-box-utility/
im new and helping out a buddy hear what looks wrong in this
_health = round((1 - (damage player)) * 100);
i was thinking 100 * (damage player)
round (100 * (damage player))
half damage would be 50
full health would be 100
is that what you wanted?
i have no idea man he gave me a broken mission file for arma 2 and asked why his health bar wasn't working. im not a coder im a m,odeler and mapper but i dabbled in code for arma 2 not really sure how to fix it
round((1 - (damage player)) * 100); is correct for health
you had it backwards eagledude, that would show the damage from 0-100 (so 100 = dead)
this sqf is so messy
i cant find whats wrong, if anyone is feeling helpful it would be much appreciated
what's happening?
the health isn't updating
nothing looks wrong there that I can see.. but uses a lot of functions/vars that aren't in that script
other stuff is updating, but not the health?
i don't see why health wouldn't update.. that's the one thing there that you can see all the code
maybe try putting this in a watch box in the debug console? round((1 - (damage player)) * 100)
err i haven't done any dev in A2.. i'm assuming it has a debug console
there is about 80 sqf files in the main file i think im just gonna tell him i dont know, and neither have i most i ever did was run a day server way back in the day
it seems that havingwaitUntil {!(isNull (findDisplay 46))}; waitUntil {!isNull player && player == player}; //Wait till the player is ready in my addon is causing my game to hang when loading in
maybe running it in non scheduled space? (might be mixing it up but i hope you know what i mean)
i ended up not needing it, but it was in scheduled space
ran from cfgfunctions with postInit = 1
Afaik postInit should give you the same result as the code above. But looks like you found that out
Don't use waitUntil in unscheduled.... it's going to run the 10 000 loops in a single frame bruh
sorry my mistake, it was scheduled (as far as I know, all functions in cfgfunctions are spawned)
i would imagine all of them, as far as I know, execvm is the only non-scheudled environment by default, no?
im prob not explaining myself properly, confused or both lol
I have another waituntil below the other ones I posted in the same function that doesnt cause the hang
on a side note, add a sleep inside your waituntils to prevent it from executing an excessive amount each frame -- frees up some cycles
Or use a PFH :p
you can run functions defined in CfgFunctions either way.. spawn = unscheduled, call = scheduled
What? I think you have those reversed, spawn is scheduled and call is sometimes unscheduled. If you use call from a scheduled environment it will also be run from a scheduled environment.
Some clarification on a little misinformation stated here about waitUntil...
Even if it's run from unscheduled it should only excute one time and then you'll get your "generic error in expression" and "suspsending is not allowed in this context" error.
Secondly, when waitUntil is run from the scheduled environment without a sleep it can only execute once per frame at most, but it's not guaranteed to run every frame. On the other hand a while loop without a sleep can execute multiple times a frame and will wreak havoc on other scheduled scripts, hence why a sleep is very important if using a while loop.
err yeah, sorry, got those backwards
yo alganthe
is there a built-in way to remove a PFH (provided by CBA) from within the embodied code?
From what I've seen, it doesn't pass a handle to the PFH as one of the arguments to the code being executed, but only returns the handle to the caller
The reason I'm asking is if I have some code I want to run in a PFH and then want to end its execution based off of certain conditions within the embodied code, how would I go about doing that? Or would this require a bit of a rewrite of the parent solution?
@lone glade
You can, look at the example here http://ace3mod.com/wiki/development/arma-3-scheduler-and-our-practices.html#pfh-wait
thanks for the tips boys
@native hemlock while without sleep is totally fine ... sleep just will interrupt the scheduled earlier
the scheduler will "take care" that your spawned function wont stay in "running "mode for too long
and you cannot rly wreck the scheduler unless you spawn a ton of loops
// Not 100% on the syntax here, the examples kinda sucked...
_nc = if ( _nearby_count > 0 ) [{hint ["No Sectors!"]},{ _nc str _nearby_count}];
Fix my if statement haha.
This line gets a missing ; error thrown
I have tried allot of variations, and I am pulling this from the BI wiki
private _nc = "";
if (_nearby_count > 0) then {
hint "No Sectors!";
_nc = str(_nearby_count);
};
private _nc = "";
if (_nearby_count > 0) then {
exitWith {hint "No Sectors!";};
};
This is giving me a "Missing SemiColon" on line exitWith
@dull parrot exitWith is the one time you don't use 'then'
if (_nearby_count > 0) exitWith {hint "No Sectors!"; };
not sure that syntax for private works either?
would usually be private ["_nc"]; _nc = ""; afaik
It does since 1.54. See Alternative Syntax 2: https://community.bistudio.com/wiki/private
It's also faster than using the private array command.
Hmm, such weird syntax conventions for a silly if statement.
Well, I am stepping out of my rookie exeVM world and into a new one, so I expect some bumps in the road.
But, why then, would it give me a missing ; error?
The error messages aren't always the most helpful.
@jaunty drift interesting, ta
much nice syntax imo.. means you don't need the list up the top at all
params [ "_current_player" ]; // Needs to take a SINGLE player as a param.
_pos getPos _this select 0; // get position of player and set it to x
// check to see if sectors in sectors_allsectors is in range of player, in realiton to the SECTOR_SPAWNRADIUS, store in array _is_nearby
// Count _is_nearby
_is_nearby = [ sectors_allSectors , { (markerPos _x) distance _pos < SECTOR_SPAWNRADIUS } ] call BIS_fnc_conditionalSelect; // sort through ALL sectors, and get the ones within range of _pos put them into _is_nearby
_nearby_count = count _is_nearby; // Count what IS nearby
hint format ["_nearby_count %1", _nearby_count];
_nearby_count; // Return nearby_count
Here is another wonderful error by me.
This, produces nothing, I tried with hints at every step, to see if I could step through, it simply never happens. I am thinking my params is messed up.
I was trying to call it via addAction
player addAction ["<t color='#FF0000'>GET ESTIMATED CURRENTLY SPAWNED SECTORS(ONSELF)", { [player] execVM "debug/dfunc/DF_debugNearbySectors.sqf" }];
A way to test small bits of code before I integrate it into the project.
@dull parrot i think you want _pos = getpos _current_player;
or you can use _pos = getPos (_this select 0); and omit the params line.. they'll do the same thing if you provide the correct input
make sure you have script errors turned on.. you shouldve got one for _pos there i think
this: _pos getPos _this select 0; would try to get the position of the player relative to _pos (which is nil) and do nothing with it (so even if _pos existed, that line wouldn't do anything)
Thank you so much lecks, I am busy with the kid right now, but I will plug this in a keep debugging in a bit.
Is there some secret way to make RscPicture images look good?
I've got an 1024x1024 texture which i want to show ingame
At the moment I'm just creating the image with ctrlCreate ["RscPicture"...
But what confuses me is how I can get the picture to look good on 16:9 monitors, 4:3 monitors, and so forth
On 4:3 1024x1024 should fill the whole screen
But on 16:9 it should be centered
Or rather, I think it works fine on 4:3 monitors, but the heigth scaled on 16:9 monitors
gets scaled*
Well, there is a way to get the aspect ratio and manually correct the problem (https://community.bistudio.com/wiki/getResolution)
I haven't really done much in the way of serious GUI editing, but IIRC maintaining aspect ratio etc. it's a matter of using safezone or absolute screenspace when defining the UI coordinates https://community.bistudio.com/wiki/SafeZone
@tough abyss: RscPictureKeepAspect might be what you need?
and the aspect ratio is always 4:3
so 1 x (4/3) or (3/4) x 1 is always a square
@ all who create UIs in ArmA
Need early Feedback about the Look&Fell of my tool ArmAUiEditor (currently PreAlpha!)
http://x39.io/ArmAUiEditor_InDev.zip
please head over to https://github.com/X39/ArmA-UI-Editor/issues if you want to file some bug and/or want to note something
thx
X39
@tough abyss Not sure you need the aspect ratio to do what you want, but you can use (safeZoneW/safeZoneH)
@Quiksilver#5042are you using rain or cloudy weather? I think that automatically ups the wind a lot.
I will look in to RscPictureKeepAspect today, though when I tested on another computer with the interface size set to large, the image was again warped and not where it is supposed to be. I'm using SafeZone values as well, so it makes me wonder..
@queen cargo initial impressions are good. eagerly awaiting the finished product ๐
if you got feature request or something like that @rancid ruin post them at the issues page ๐
Hey guys
Any idea about how to make AI defend a place, engage hostiles incomming, then get back to the place to defend ? I usefdBIS_fnc_taskDefend, but if I shoot on AI, they all seek me, then if they do not find me, they stay where they are and do not fall back to the point to defend
setWind doesn't really work if your mission has auto wind enabled
@Quiksilver#5042could the wind be multiplying per user joining?
@carmine galleon put them in buildings and use doStop
Can you recognize damage taken from fire with HandleDamage event handler? (Or do you need to write your own hacky solution?)
There's script command related: https://community.bistudio.com/wiki/setParticleFire
No, it will be reported as <objNull>, same as crashes, setDamage, drowning damage etc.
You can guess drowning damage - the damage added will be exactly 0.1 and oxygenRemaining will be below a threshold I don't remember (0.3 ?)
Alright, thanks for advice @little eagle
hey does anyone have any idea how test_EmptyObjectForBubbles/test_EmptyObjectForFireBig/test_EmptyObjectForSmoke define the actual particle effect?
I've seen a lot of people try and replicate it but they never seem to get it right.
Look in weapons_f\data\scripts\ and there are 3 scripts in there that seem to create the effects
All of those objects use empty p3ds and have calls to those scripts in their init
Fire: http://pastebin.com/MuehFRX1
Bubbles: http://pastebin.com/yEENaUwJ
Smoke: http://pastebin.com/T7At0i8Q
it doesn't tell the actualy values and settings of hte particle source though, just the light?
You'd have to check in a3\data_f\particleeffects\config.cpp for what each is
ahh ok cheers
@Quiksilver#5042 look back at those recent pastebins. They have the values to different light settings for standard vehicle fires.
Having some trouble with a zeus module UI I'm working on right now: http://i.imgur.com/LTN59Em.jpg
Do map controls have a minimum size or something?
nope, i've made tiny maps before
I've never had tiny maps before. No Idea
What's that search area in the background?
fuck knows. he should pastebin his code though or it'll always be a mystery
raiders of the lost Rsc
Temple of the forgotten semicolon
Temple of the forgotten definitions probably better
Sorry, I went bouldering ๐ Will pastebin the relevant configs in a sec here
@plucky beacon ACE zeus modules I'm working on: https://github.com/acemod/ACE3/pull/3796
Tried setting the size really small via ctrlSetPosition when it initalizes and it still was the size in the screenshot
My theory is that it's related to the map being in that controls group
_Ctrl CtrlCommit 1; done?
Okay, I've half figured out the problem, I think you're right and I must have forgot to add in the ctrlCommit earlier
Now that I've got that working, it looks like the map control position is relative to a different origin from the other controls
(Not the controls group position like it should be, possibly defaulting to absolute position)
Which actually seems like a bug
Perhaps not absolute, using the position of the controls group and adding it to the position of the map control didn't fix it
Okay no, definitely using absolute, I wonder why that didn't fix it then
๐ Well at least I know why it's broken now, can figure out how to fix it tomorrow
Reading the control is the only way I know of. That will only work when the control is shown though. Never actually tried to do it, but I see no reason why it wouldn't work. You can even read the chat.
If I add an action to a player with a boolean variable in the visibility argument, will its visibility toggle with the variable?
well shit
Ok, then I need help.
Oh
Right
๐
I think I've been at this too long today
Goal is to try to get an action associated to players that only Gunners can use
I'm assigning player classes to the player namespace
Need the action to only be visible to gunners, so would I just put in the condition:
==
er, yeah
omg
Brain... melting...
Trying to do too many things at once
I think you may be onto something.
Back in 5 ๐
@winged thistle use getUnitTrait for that medic detection.
should've used a function for this in the first place
to read the medic=1 from config
It's just a glorified setVar tho
@lone glade I am where it is necessary. My system is complex and that command isn't an ultimate solution for script compatibility with other custom classes I've created.
One day, you guys will be able to see it ๐
Hopefully one day soon...
For now, I've been awake entirely too long.
if(_cnt <= (_cnt - 35)) then { // qf5 sets out.
Is this line doing what I think it does.
if _cnt is less than or equal to the value of _cnt -35 then do code.
???
how can the value be less than or equal to the value, minus a number?
Basicly, I wana get a count
it would always execute
Ahh.
So, I would have to assign new variables, every time I wana check thyis.
say _cnt <= _cnt2
yeah
while {!_qrf_sent} do {
_cnt = {(side _x) == east} count allUnits)}; // Get _cnt
if(_cnt <= _cnt1) then { // qf1 sets out.
// CODE
if(_cnt <= _cnt2) then { // qf2 sets out.
// CODE
};
if(_cnt <= _cnt3) then { // qf3 sets out.
// CODE
};
if(_cnt <= _cnt4) then { // qf4 sets out.
// CODE
};
if(_cnt <= _cnt5) then { // qf5 sets out.
// CODE
};
if(_cnt <= _cnt6) then { // qf6 sets out.
// CODE
};
sleep 60; // Check every minute
};
Another question, does this work a switch statement?
Or will it do them all, every time...
I mean, I could run a check that sets cnt4complete = false
and then in its relative part of code, set it to true
and do a && conditional
Honestly, unless I am missing something that's all I can think to do, to keep this from re-running itself every 60 minutes.
is realtively new to sqf
what values do _cnt1 represent, are they calculated or fixed?
@dull parrot as Plebeian implied, can't really answer what that'll do without knowing what _cnt1 etc are. Maybe you want to use if/else rather than just if? That would make it behave more like a switch (only 1 would run each time).
^ This answers my question
Hello, I know the overall opinion of Altis Life has shifted but does anyone know anything about modifying 4.4? I've taken on the project out of boredom and I was looking to add new drugs and resources.
However no guides seem to exist.
Kinky, instead of forever looping and sleeping, you could execute the code in an event handler for when an east side unit is killed.
So extdb2 has been taken down from everywhere and you can't get it anymore. Anyone have any alternatives for it?
#realProblemsForArmaRightHere
Taken offline everywhere
feel free to finish this crap
https://github.com/X39/EasyDatabase/tree/master/Extension/EasyDatabase
was some random test project which i never finished fully due to lack of time and interest
it mainly just was to look for new ways to parse callExtension stuff
I have no C++ skills so I might not be the right person but the community will sooner or later need an updated DB extension to replace extDB2
why was extdb2 taken down?
anyway ... i might should finalize that stupid extension at some point ...
not even sure why i never finished it out
https://github.com/X39/EasyDatabase/blob/master/Extension/EasyDatabase/easyDatabase.x39
at least it looks like i put some thoughts back into it when i prepared that crap ...
Well if you do finalize it, it would be a big thing for everybody needing MySQL connection
@queen cargo I have a version I can give you when I'm home if you like
which version of what @fickle plover ?
Ahh well ... not in need dude :) but ty (others here would need though ...)
Just starting to think about continuing an ancient time waster project besides other time waste projects
extDB3 rewrite is done already plus a license change.
https://bitbucket.org/torndeco/extdb3/wiki/Contents
Will require some minor sqf changes. Should be better, and easier to use now aswell
Will require minor edits to SQF Setup Stage & SQL_CUSTOM ini file.
But yeah it should be fine.
It will complain about everything that is wrong(changes) with the SQL_CUSTOM file.
Just pm if you get stuck / confused.
can someone point me in the right direction of returning objects in a particular direction, relative to an object?
nearestObjects, getPosASL, vectorFromTo and vector math
thanks
Will this ever be MP Compatible ?
make it so
I'm having difficulty getting an addAction to use the right parameters.
(_this select 0) and (_this select 1) in the action don't have the correct values.
They are pulling from the script instead of from the action arguments
I expect that (_this select 3) == ["reload",player,_ammoBox] but it instead returns ["reload",B Alpha 1-1:1 (pigneedle) REMOTE,"init"]
The REMOTE is because I have 2 clients connected on the same machine
It's returning the wrong player and the last parameter should be equal to _ammoBox from the paste
What am I doing wrong?
_this select 0 == _mode?
But it isn't supposed to be
what mean in the retzrn you dont get ammobox you get _mode
It's supposed to be pulling _this from the action arguments
you parse it?
Did you look at the pastebin link?
yes
In the addAction, I define arguments to pass to the script in the action.
so _this should be ["reload",(_this select 1),(_this select 0)]
I'm expecting that _this in that scope is pulled from the addaction
_this in a addaction is [_object, _caller, _id, _arguements]
well, ID, then arguments
yeah
so (_this select 3) spawn ... should use ["reload",(_this select 1),(_this select 0)]
yes from the function where the remote exec get called
which it seems to, but (_this select 1) and (_this select 0) pull from the wrong scope
So why is it wrong?
because you get it in the wrong scope
Sure, but how can I fix it?
I want to pull the arguments from addaction, not from the script
?
Currently, the arguments are pulling from params in the script
I want to use the arguments from addaction
[_object, _caller, _id, _arguements]
yes use it in the code?
The action should be present for each player, allowing them to reload at an ammobox
Woah, man.
what is _target?
Please don't be that presumptuous.
_target is the object target where the action is attached to
_target changes
first it's the gunner placing the box
later it is used to identify the player using the box
_newBox is the object
@winged thistle {["reload", _this select 1, _this select 0] spawn FOR_fnc_ammo_doReload;}
this is you so hard solution and you dont get it da fuck
Calm down man. I don't come here to be criticized. I come here for help just like everyone else.
@zealous solstice Thank you. That's what I needed.
did you understand what was wrong with your code?
I do.
Honestly though, I believe this should be an area conducive to supporting learning and development.
Please understand that not everyone knows everything.
Agreed @winged thistle. The childlike mannerisms that seem to be presented here often only do harm to the overall community.
I see your post as someone who likely has little experience with scripting, or at least in SQF. Of course I wouldn't expect you to understand much of the low-level details, and won't hold you accountable to do so either.
Everyone has to start somewhere.
And a word to everyone of all levels of experience: there's always a bigger fish
Be humble.
...and one day you too can be a Muted Troll ๐
Just kidding. Hot pink suits you.
It's quite fetching. Slightly jelly.
Rofl @Head
hmmm
how can i simulate a lock, lockDriver, lockTurret, lockCargo with local effect
i know the command i need dont exist so workarounds welcome
my first idea is to lock a vehicle completly and code custom GetInX actions but i think its impossible to make them work exactly like the vanilla ones
It's not possible. The only way is to moveOut with the getIn event handler
emulating the getIn actions is a huuuuge pain in the ass. not possible to make it work exactly like vanilla without the VBS version of selectionPosition
I tried in AGM and ACE (to add those to our menu), but I failed
Is there an event raised, or function I can call, to determine if shots are landing near a unit/group? or a non-performance intrusive third party script?
the only way would be to track projectiles with an EachFrame handler until they are <null>
that has two problems:
- no way to reliably detect ricochets
- really bad performance hit when AIs have a bigger fire fight
okay, what I feared - thank you both for answering
AI FSM you can have it behave to nearby shots, requires an addon though
Believe its the danger.fsm
you could a invisible sphere model with a firegeometry and 100% penetrability, then just add a hit eventhandler to it.
don't know if it works but would require a custom .p3d
@tough abyss that may be the most efficient method
Okay. Would anyone be willing to look over my garbage script and tell me how to make it work? I don't understand the sqf language much at all, but I've had a simple idea for a while and I just can't get it to work. Maybe someone who understands code can look over it and understand what I was trying to do.
you haven't posted the sript ๐
isn't there a function or command to get all running scripts?
thanks!
@vagrant kite, do I paste the text in here or can I drop the .sqf in here for download?
@vagrant kite http://pastie.org/10852133
It's pretty bad. Like, the code isn't even close to working, I more or less wrote this to explain what I'm trying to do.
it would be better if variable names meant anything
lines 20-22 make no sense
if (side = GUER) side of what?
should be sth like: side player or side _unit
C3A == true -> C3A
C2A == false -> !C2A
also: you're creating a lot of triggers and markers? can't they be placed in the editor?
what is that you're trying to accomplish?
@vagrant kite, fixing first two issues now.
As far as I can tell, the trigger conditions are too complex to place in the editor, because the triggers are being created by trigger pairs, when both trigger conditions are true.
What I'm trying to do is have a central point that acts like a two way capture point. When the point is captured, then a point is spawned for the other side to defend. Whenever the second point is captured, the defending side defends one more point. So basically, it starts off with a neutral point. When that point is captured, the side that captured the point has to capture two more points to win.
So, whenever a point is captured, it deletes itself and creates a new point. Each point has two triggers, one to check if a side is present and one to make sure a side is not present.
cCould also use playerSide
BTW
Guer is no more supported on Arma 3
resistance or independent
instead
I think I am going to remote execute on all clients to create the markers. Thanks for letting me know about independent.
Well in fact I'm not sure guer is no more working
But using independent
And working
Replaced all instances of GUER with independent.
When running code on an independent side unit,
side _unit == independent
but
str side _unit == "GUER"
@snow pecan, thanks!
I suggest using side group player over side player and playerSide because those cause potential problems
playerSide doesn't report the side the players unit is on. It reports which side you joined in the mission. It is totally possible to change that side by joining a group of an enemy side.
It's an edge case, but why make your code intentionally less powerfull.
side player (side <OBJECT>) can return different sides than west, east, civilian or independant. It will report sideFriendly if your unit is treated as captive and sideEnemy if you killed to many friendly units.
hi, is there a way to disable "Rearm" at an ammo box without removing the items it contains that trigger the rearm option?
There is a way to do everything in arma.. question is wheather its hard or easy ^^... Hard way would be creating your own pbo and overwriting Armas configs which create the Rearm action on the ammoboxes...
I have been wanting to get rid of that HORRIBLE design decision myself. It's utterly worthless and completely annoying.
Screw that rearm option.
that answers it... im saddened by it. it can be annoying when you accidentally hit rearm and pause for a few seconds when you intended to inspect the inventory
Does anybody know if there is a config entry inside a weapon's class that refers to the side it is used? Eg. katiba -> opfor
Or at least some value referring indirectly to the side
Eg. If it has a magazines array it is probably a weapon. This logic just with the side
weapons dont have side, nor faction only vehicles do, including soldiers/characters
I got used to never using the mousewheel menu on containers.. i always just use the inventory key
hi, is there a way to disable "Rearm" at an ammo box without removing the items it contains that trigger the rearm option?
Yes, but it requires you to change a config, so you'll need an addon.
https://github.com/acemod/ACE3/blob/master/addons/norearm/CfgActions.hpp#L2-L7
It will also disable the action for every ammo box, vehicle etc.
@little eagle, can this be done via a server side mod or only client side mod?
Client @shadow sapphire
Rats!!
client
Only way to change handAnims on the fly is to apparently create another weapon class with different handAnim. Well..
better than another model or dupe the existing, right
my arma just crashed ... AGAIN ... DBG_PRINTEXCEPTION_C ... you have to fucking kid me ...
@west lantern Imagine you have a verti grip accessory. Now you have multiple weapons compatible. Now you have multiple camo variants on these weapons. Now I'm gonna kill myself
If you follow some naming convetion (you should) it should be easy
Yes, I have set up some rules regarding my class names. But still, that would do more variants and stuff, just for the handAnims[] line..
@ebon onyx : have you set _unit ? like _unit = this; if you're calling it with "this execvm 'myscript.sqf'"
i am trying to use names now
so for example removeAllWeapons CO; but still no luck, named player in editor also
only way i have got this to work is by making an arsenal, exporting it and applying directly to init line
@McCarthy I notice you are using ace, you can set and get loadouts using functions provided by them
ace_common_fnc_getAllGear and ace_common_fnc_setAllGear
If you are looking for a Loadout Script, I wrote a lightweight one that is based off of template units you set using the arsenal. No code changing. https://github.com/Rafael09ED/Arma/tree/master/scripts/GearTemplates.VR
that confused the shit out of me, bare in mind I have only added respawns before, i have no experience scripting.
You'll have to learn it if you want to edit soldier loadouts ; )
Or you use the 3den arsenal and do it by hand. That can take hours with enough units, while a script can be written and tested in probably 30 minutes.
anyone see this yet (from rpt - when launching arsenal)?
ModParams - can't find mod:
i suspect its some logging/info system to notify faulty configs, yet it doesnt list the class or anything
couldnt find it in the A3 source either (was searching all scripts, configs and xml)
could it be related to cfgMods so the arsenal wants to get the "dlc" icon and other infos to display?
> ModParams - can't find mod:``` yeah was wondering if this was caused by my mod cfgPatches or cfgMods...could it be the `cfgPatches overhaul`? Anyone know whats the change there?
could also be this what soul_assasin said there... in cfgMods dir = "@MOD"; will not work, should be dir = "MOD"; ... I thought it may be related to this since its whining how it "cant find mod:"
Will try this now and see if I get the error again. Change the dir property to not include @ there
yep fixed
error is gone will send rpt now so you can see @velvet merlin
the problem is all other things will not work if you try to fix it this way
solution may be to ditch @ everywhere and that is cfgMods and mod.cpp and actually use the file dir without @ prefix
Just realized I am not on RC build...lol need to switch and czech again ๐
@west lantern thanks!
ah its not it.. tried on RC and its back, damn it
Ill try to do the same to mod.cpp and change mod folder name
no its not it definetly...was hoping it was that easy
its still whining cant find mod:
Would a hacker be usually able to change a variable that is only local to the server?
If the server runs it then only the server knows about the variable unless publicvariable is used. So I read about it. And should be like that.
Local to a script or in the server's missionNamespace? If they knew the variable name and had the ability to execute some dangerous commands they could change it, but those are big ifs.
If you don't have properly setup filters/CfgRemoteExec they could do [{yourVar = -1}] remoteExecCall ["BIS_fnc_call", 2] to change a variable, they could even tell the server to execute allVariables missionNamespace and have the output sent back to themselves.
I was thinking of storing some player related variables like cash on the server and have the player fetch the money from the server
Thats a good idea.
Could anyone offer guidance on the use of BIS_fnc_setTask?
hey guys i could use some help/advice. i create a trigger via script or init event handler:
rf3080trigger = createTrigger ["EmptyDetector", getPos player];
rf3080trigger setTriggerArea [5, 5, 0, true];
rf3080trigger setTriggerActivation ["ANY", "PRESENT", true];
rf3080trigger setTriggerStatements ["this", "player setVariable ['tf_sendingDistanceMultiplicator', 1.5]", "hint 'Deactivation!'"];
and everything is working fine except the on deactivation part in the setTriggerStatements. I have no idea why. If I put the exact same statement in the debug console the on deactivation parts works just fine. Any ideas why?
Quick question; is it possible to deactivate the "Get out" action from a vehicle crew member when the exit memory point is in collision with something ? For exemple, a guy takes a SUV and parks next to the building wall. He gets out, and is now in the building. how to fix pls
I don't know if you can disable that, but if you'd like to prevent it at all costs you could always use the GetOutMan eventhandler and check if the position they are getting out to is visible from the vehicle, if it's not then you move them back inside of the vehicle
anyone know how to clear cargo of a box ClearItemCargoGlobal isn't working, sorry for noob question
@native hemlock
Thx for idea. Script snippet (working as intended) :
player addEventHandler ["GetOutMan",{
_unit = _this select 0;
_position = _this select 1;
_vehicle = _this select 2;
if(lineIntersects[(getPosASL _unit),(getPosASL _vehicle),_unit,_vehicle]) then {
switch(_position) do {
case "driver": {_unit moveInDriver _vehicle};
case "gunner": {_unit moveInGunner _vehicle};
case "cargo": {_unit moveInCargo _vehicle};
default {};
};
};
}];
@ebon onyx
clearMagazineCargoGlobal _object;
clearWeaponCargoGlobal _object;
clearItemCargoGlobal _object;
clearBackpackCargoGlobal _object;
Thanks Mash6, does Global parameters only work on MP? just curiosity it works fine
Sad thing it's the only thing that always works
Pro tip : These commands works even is objects is not local, and broadcasts over network
Pro tip 2 : If MP player in desynch when you execute the clear, then he will always see the inventory until desync ends
Just check on wiki because some commands have global effects but requires local arguments
Example : addMagazineTurret adds magazine in global, but only works if executed where vehicle is local
@native hemlock
Little fix, because player wasn't able to get out of vehicle while inside building like hangar :
player addEventHandler ["GetOutMan",{
_unit = _this select 0;
_position = _this select 1;
_vehicle = _this select 2;
if(([_vehicle, "VIEW"] checkVisibility [eyePos _unit, eyePos _vehicle]) < 1) then {
switch(_position) do {
case "driver": {_unit moveInDriver _vehicle};
case "gunner": {_unit moveInGunner _vehicle};
case "cargo": {_unit moveInCargo _vehicle};
default {};
};
};
}];
"What did you do today ? - Oh, nothing special, fixing BI stuff"
Wouldnt that disable entire crew from getting out if one is blocked?
Should not
Because event handler is on unit
And not on vehicle
it's a "GetOutMan" and not a "GetOut" eventhandler
So only applying to the unit getting out, and do not affect other crew members
ah overlooked that one, good one thanks
BTW, this eventhandler continues after respawn so only need to put it in like init.sqf
Is there any way to force the squad hexagons to be team-based instead of squad based? In co-op missions I'd like to separate the pilots and the infantry while letting them still see one another on the field.
@shadow sail you can draw custom icons on the screen https://community.bistudio.com/wiki/drawIcon3D
ah thank you
Whats the best way to package scripts up into a mod, so I can reuse them across many missions? I tried unpacking the CBA pbo but can't really make sense of the organisation of it.
Thanks
Yo, I'm messing around with Eden right now, just trying to get a feel for things.
Is it possible to build a complex chain of command, where subordinates have subordinates?
for example, I have a High commander (Crossroads) and several fireteams of NPCs in a perimeter around the HQ. Hawk-1 to Hawk-6
I want All of Hawk to be controlled by one NPC, who is a subordinate to Crossroads, the player, without combining them into one big squad.
Can I do that?
Maybe the wrong channel to ask this, sorry
So no, it's not possible?
I am trying to get all the sub classes of a weapon config but only 2 return
("true" configClasses (configFile >> "CfgWeapons" >> "SMG_02_F"));
Help?๐ฉ
hey guys, i have an init event handler that runs a script with a while loop. Unfortunately i noticed that the script isn't canceled when the object is removed. Is there any way to destroy an init event handler for an object?
Is this an infinite loop? Exiting the loop when the object is null might work, or only running the loop when the object is not null
while {true} do {
_dist=player distance (_this select 0);
if (_dist < 6) then {
player setVariable ['tf_sendingDistanceMultiplicator', 1.5, true];
}
else { player setVariable ['tf_sendingDistanceMultiplicator', 1.0, true];
};
sleep 10;
};
yep the loop is infinite
while {!isNull(_this select 0)} do {
_dist = player distance (_this select 0);
if (_dist < 6) then {
player setVariable ['tf_sendingDistanceMultiplicator', 1.5, true];
} else {
player setVariable ['tf_sendingDistanceMultiplicator', 1.0, true];
};
sleep 10;
};
You could give that a try
great idea! ill give it a try
Works like a charm! I wouldn't have tought about it. Thanks @native hemlock !
Good to hear
@vocal mantle I think I've found something that'll work for you
_config = configFile >> "CfgWeapons" >> "SMG_02_F";
_properties = configProperties [_config, "isClass _x", true];
_properties apply {diag_log _x};
The output of that was
bin\config.bin/CfgWeapons/SMG_02_F/WeaponSlotsInfo
bin\config.bin/CfgWeapons/SMG_02_F/Library
bin\config.bin/CfgWeapons/SMG_02_base_F/Single
bin\config.bin/CfgWeapons/SMG_02_base_F/Burst
bin\config.bin/CfgWeapons/SMG_02_base_F/FullAuto
bin\config.bin/CfgWeapons/SMG_02_base_F/UGL_F
bin\config.bin/CfgWeapons/Rifle_Base_F/GunParticles
bin\config.bin/CfgWeapons/Default/GunFire
bin\config.bin/CfgWeapons/Default/GunClouds
Credits to @little eagle and his post here https://forums.bistudio.com/topic/190987-configclasses-or-bis-fnc-getcfgsubclasses-doesnt-return-all-classes/?p=3028789
@native hemlock Thanks. I just added a note to it's wiki page so that this information is more transparent.
whats the alternate syntax for call compile format for (str someobject) again?
you have three commands in there. which one?
all of them I guess, I'm not sure how to answer that, here's an example: _to = call compile format[""%1"",(lbData[3004,(lbCurSel 3004)])];
%1 being an object
I get error position and error missing ;
you cant call an object. what are you trying to do to said object?
it would be the same as _myObject = call {myObject};
its trying to compile a string for the object reference
lbdata is a string
i asked my question kind stupidly I admit
but yeah, lbData[3004,(lbCurSel 3004)] is (str someobject)
I feel like I ran into this in the past and I'm not sure if you can go from a string data type to object
I've seen it done in a lot of scripts, but it wont work for me anymore
unless if the string matches the variable name of the object
its a stupid way to do it honestly
might be easier to put all the objects in an array attached to the listbox
and put the indexs in either lbData or lbValue
since arma3 1.55 you can setVariable on a control
yeah, I've just recently started using setvariable for controls
was gonna do that for this instance as well
god bless BI for adding that setvariable lol
Hello everyone o/ Is there a possibility to make a lightening flare to start at a specific altitude (let's say 10) ? Because flyInHeight obviously doesn't work for anything else than planes or helis ^^
Anybody got any good examples to disable the normal ArmA radio chatter and use your own.
For example when a unit spots an enemy instead of saying "Enemy Man at 007252, 100 metres". Can I just play a sound instead?
how can i stop the AI from lying down/running away when they or units near them are wounded? I need static human targets for a testing mission
or more specifically, is there a way to disable all AI functions with 1 command? Or does it only work by using disableAI multiple times to achieve total braindead-ness?
Wasn't there an ArrayVersion?
havent seen it in scripting commands biki list
move - they still change stance though
setunitpos "UP"/"MIDDLE"?
and anim freezes them completely, but i want them to fall over dead / go autoprone when their legs are gone
my money's on the careless. But remember to remove their nades before that: https://www.youtube.com/watch?v=o3jDHqKWXKA ๐
ok careless seems to do the trick
i want to test indirect damage... unfortunately human shield is a thing in Arma, so i have to come up with some circle script so that the targets are not shielded by each other xD
You mean placing them in a circle around an explosive and comparing damage?
yeah
opted for manual placement... before i figure out a script that does this: https://abload.de/img/20160529144818_1iqs9w.jpg the day would be over... The rotate tool in the Eden Editor is very powerfull thankfully
Completely untested snippet:
_center = getmarkerpos "centermarker";
_distanceMin = 5;
_distanceMax = 50;
_count = count _units;
{
_step = _foreachIndex +1;
_distance = _distanceMin + (_step * ((_distanceMax - _distanceMin) / _count));
_pos = _center getPos [_distance, 360 / _count * _step ];
_x setpos _pos;
_dir = (_pos getDir _center) + 0; // 0 degree angle to center. Ie. facing it directly. edit. this was wrong first
_x setdir _dir;
(group _x) setFormDir _dir
} foreach _units;```
_to = call compile format[""%1"",(lbData[3004,(lbCurSel 3004)])];
just store the object reference as string in the list box controls namesspace and use str _index as identifier
private _index = _listbox lbAdd _objectName;
_listbox setVariable [str _index, _object];
onLBSelChanged:
params ["_listbox", "_index"];
private _object = _listbox getVariable str _index;
something like that
Hey all, I am trying to make a functions addon, this is my config.cpp however it can't get it to work in game by doing `call GhostFunctions_fnc_HelloWorld;"
{
class GhostFunctions
{
class Test
{
class HelloWorld {file = "\the_ghosts\functions\misc\hello_world.sqf";};
};
};
};
does it complain about not finding the file?
Not in the editor no
So the function is just undefined?
No warnings . no errors. I will check the rpt file. It should do this
hint "Hello World!";
-showScriptErrors used? any errors during preprocessing in RPT?
you can enter GhostFunctions_fnc_HelloWorld in one of the four "watch" fields in the debug console
that should show you your function
Ok I added it to the watch field, do I need to press something?
I just checked the functions browser and I can't find it in there
There are no errors in the RPT ๐ฆ
Hmm do I need to have a CfgAddons ontop of my CfgFunctions ?
no, but CfgPatches
I will try that
also try to find your function in CfgFunctions in the config viewer
is this for a mission or addon?
A full addon, I have sounds, textures just need to add scripts
dumb, question, but did you #include the CfgFunctions.hpp ?
Yay! I added the CfgPatches now I am getting an error.
15:15:58 Warning Message: Script \the_ghosts\functions\misc\hello_world.sqf not found
At least it is progress, thanks @little eagle
Oh, did you add *.sqf to the "files to copy directly" ?
Sorry I don't understand
mikeros tools or BI tools?
Because the "Addon builder" from BI removes *.sqf files by default
BI Tools
ok, wait
*.p3d;*.paa,*.wav,*.ogg
Anything else while I am at it?
bw mod uses these:
*.pac;*.paa;*.sqf;*.sqs;*.bikb;*.fsm;*.wss;*.ogg;*.wav;*.fxy;*.csv;*.html;*.lip;*.txt;*.wrp;*.bisurf;*.xml;*.h;
Thanks
yw
Yea, I started out making Ghost recon as missions but I realised this has to be an addon. So I am repackaging everything into an addon.
hmmm
--------------------------------
Build result
--------------------------------
Build failed. Result code=1
CfgConvert task failed.
--------------------------------
OK
Maybe syntax issue
Shouldn't be a problem with the SQF file
those are preprocessed on game start
not when you binarize or pack the file
you'll have to check the log file
I just removed all the file extensions you gave me, it works now ๐
shrug
Yay, it works now. Once again thank you.
Thank you @agile pumice
what's wrong with it?
_v = "B_APC_Tracked_01_AA_F";
_a = configProperties [configfile >> "CfgVehicles" >> _v >> "AnimationSources", "isClass _x", true] apply {configName _x};
copyToClipboard str _a;
_a
["Missiles_revolving","muzzle_rot","HideTurret"]
not all of those can be used with animate though. You'll have to replace
"isClass _x"
with:
"isClass _x && {getText (_x >> ""source"") == ""user""}"
to only get those
With the config identities, I can set an identity of a unit. However how do I find out what identity the unit is, I cannot see any getIdentity function. Any ideas?
class CfgIdentities
{
class Moss
{
name="Corey";
country="USA";
speciality="rifleman";
ghostSound="male_1"
fullName = "Corey Moss";
nameSound = ""; // Arma 3 only!
face="WhiteHead_10";
glasses="G_Combat";
speaker="Male05ENG";
pitch=1.0;
};
}
Say if I want to access the identities member variables?
Are you setting the identity in a config, description.ext or in game?
Setting them from init.sqf
This might be helpful then https://forums.bistudio.com/topic/190716-setidentity-get-classname-from-existing-unit/?p=3023304
It's a hacky solution of
_identity = "MyLittleSoldier";
_solider setIdentity _identity;
_soldier setVariable [ "identity", _identity ];
Ok, what would be better way do you think. I am making a mod where I want to create a roster of units like you get in Ghost Recon / Rainbow six. Each identity will have attributes which will affect gameplay e.g. radio chatter, what kit they can select.
I need to know if they are a rifleman, support, demolitions etc
I will have scripts with dependencies on those attributes
Maybe that is a bad thing in fact, however I have no idea how else to go about implementing that
Do you care what their faces look like?
At this point, not really
I think you would be better off having specific slots have roles
True however it will be dynamic roster / slots. The user picks their team with a dialog after mission starts and then they spawn in.
Yeah so that wouldn't work
In Ghost Recon 1, they have a huge XML with all these identities, I was hoping I could do the same in ArmA , I guess not lol ๐ฆ
Can someone proof my script?
_GreenChopper = [];
if (isServer) then {
_GreenPilots = creategroup independent;
_GreenChopper = [getMarkerPos "GreenSpawn", 0, "I_Heli_Transport_02_F", _GreenPilots] call BIS_fnc_spawnVehicle;
_WP1 = _GreenPilots addWaypoint [(getmarkerpos "M1"), 0];
_WP1 setWayPointBehaviour "CARELESS";
_WP1 setWaypointType "TR UNLOAD";
_WP1 setWaypointSpeed "FULL";
_WP1 setWayPointCombatMode "BLUE";
_WP1 setwaypointstatements ["_GreenPilots 'land'; _GreenChopper AnimateDoor ['CargoRamp_Open',1];"];
_WP2 = _GreenPilots addWaypoint [(getmarkerpos "GreenSpawn"), 0];
_WP2 setWayPointBehaviour "CARELESS";
_WP2 setWaypointType "MOVE";
_WP2 setWayPointCombatMode "BLUE";
_WP2 setWaypointSpeed "FULL";
};```
Doesn't throw any errors, but it doesn't open the cargo ramp, either. I can open the cargo ramp in that particular object by having a named mohawk on the map and using a trigger with the statement
```Mohawk AnimateDoor ['CargoRamp_Open',1];```
Can anyone educate me on the difference?
For future reference, you should format large code blocks in discord with ``` https://support.discordapp.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline-, I'm not sure what you used for the above code but your underscores aren't showing which initially confused me
Isn't that much prettier? ๐
Indeed.
Does the helicopter actually land?
Yep!
if somebody has an idea for a formula that fits the experimental indirect damage falloff graph it would really help
https://forums.bistudio.com/topic/191116-finding-a-formula-for-indirect-damage-to-units/?p=3031582
@shadow sapphire
setWaypointStatementsisn't actually being executed but it's not giving you any errors to show that, it's landing because of the waypoint type. The syntax for setWaypointStatements can be seen here https://community.bistudio.com/wiki/setWaypointStatementssetWaypointStatementscan't use local variables like other commands because it is not executed in the same scope as where the local variable is, if instead the variables were global (GreenPilots and GreenChopper) it would work, except that there are a couple of other issues.- Wrong usage of
land, it seems redundant but it should beobject land "LAND"(capitalization doesn't matter) https://community.bistudio.com/wiki/land - You are using the
landcommand with _GreenPilots which is a group, not an object - You are using the
animatecommand with an array, but it only works for objects. This is because BIS_fnc_spawnVehicle returns you an array that contains[Created Vehicle, [Crew1, Crew2], Group of Vehicle]. In order to execute animate you would need to refer to an object, which in this case would be_GreenChopper select 0
My suggestion would be to keep _GreenPilots and _GreenChopper as local variables, but to replace your setWaypointStatement with the following
_WP1 setwaypointstatements ["true", "(vehicle this) land 'land'; (vehicle this) AnimateDoor ['CargoRamp_Open',1]"];
Within setWaypointStatements the word this refers to the group leader, so the vehicle of the group leader will be the helicopter
Holy. Balls. @native hemlock, that worked perfectly!
Whats the syntax for calling a compiled function with arguments?
call GhostFunctions_fnc_Chatter {"normal";}; ?
I want to pass it a string called "normal"
Thanks,
It is complaining now about my syntax although the intellij plugin isn't saying anything :/
/*
chatter.sqf
This function provides sounds effects causing the squad to begin chatting at the start of the mission to add some ambience
*/
private _scenario = _this select 0;
private _conversation1 = [];
private _conversation2 = [];
switch (_scenario) do
{
case "normal": {
_conversation1 = ["tm1_start1a", "tm2_start1a"] call BIS_fnc_selectRandom;
_conversation2 = ["tm1_start1b", "tm2_start2b"] call BIS_fnc_selectRandom;
};
default { hint "Cannot find chatter for this scenario" };
};
playSound _conversation1;
sleep 1;
playSound _conversation2;
Can I do that inside the switch?
That's useful to know
Is the sleep function asynchronous to the game or does it actually interrupt anything outside the function?
depending on the environment you are working in
there is scheduled and unscheduled environment
you cannot use suspension commands (sleep, uiSleep and waitUntil) in unscheduled environment
using execVM, spawn, remoteExec (with a function, not command) will enter scheduled (or suspendable) environment
you can check the current environment with canSuspend
@native hemlock, What would I do if I wanted to make sure that the helicopter was landed before it opened the cargo?
unscheduled (not suspendable) is the default
Hmm it seems say or say3d might be better as it forces synchronicity of sounds being played.
In this code:
_GreenChopper = [];
if (isServer) then {
_GreenPilots = creategroup independent;
_GreenChopper = [getMarkerPos "GreenSpawn", 0, "I_Heli_Transport_02_F", _GreenPilots] call BIS_fnc_spawnVehicle;
_WP1 = _GreenPilots addWaypoint [(getmarkerpos "M1"), 0];
_WP1 setWayPointBehaviour "CARELESS";
_WP1 setWaypointType "TR UNLOAD";
_WP1 setWaypointSpeed "FULL";
_WP1 setWayPointCombatMode "BLUE";
_WP1 setwaypointstatements ["true", "(vehicle this) land 'land'; (vehicle this) AnimateDoor ['Door_Back_R',1]; (vehicle this) AnimateDoor ['Door_Back_L',1]; (vehicle this) AnimateDoor ['CargoRamp_Open',1]"];
waitUntil {sleep 0.5; getPOS _GreenPilots <= 0.5;};
_GreenChopper land "NONE";{_x action ["Eject", vehicle _x]; unassignVehicle _x;} forEach _assigned;
waitUntil {sleep 10; {_x in _GreenChopper} count _assigned == 0;};
_GreenChopper AnimateDoor ['Door_Back_R', 0];
_GreenChopper AnimateDoor ['Door_Back_L', 0];
_GreenChopper AnimateDoor ['CargoRamp_Open', 0];
_WP2 = _GreenPilots addWaypoint [(getmarkerpos "GreenSpawn"), 0];
_WP2 setWayPointBehaviour "CARELESS";
_WP2 setWaypointType "MOVE";
_WP2 setWayPointCombatMode "BLUE";
_WP2 setWaypointSpeed "FULL";
};```
In my waituntils, I need to make _GreenPilots and _Greenchopper work. I am unaware of why it won't work.