#arma3_scripting
1 messages Β· Page 416 of 1
then I don't even understand you English ...
[_this ] is a array yes?
One is an array with _this inside. The other is _this. the variable
question
I now understand
[_this] joinSilent createGroup INDEPENDENT;
``` that makes a unit go independent,how do i make it civllian cause CIV doesnt work?
make it go *
thanks @still forum
SQF is case insensitive
Not all SQF commands internals are. But SQF itself the language is.
the preprocessor is not though
yeah correct. The preprocessor is not SQF
rip case sensative
okay so ermm im tryna have a script to spawn chicken
and i got thi
"WHAT DO I PUT HERE" createUnit [position _user,civilian];
so wat do i put at "WHAT DO I PUT HERE"
Classname
from CfgVehicles
oh shit theres dogs in arma 3?
We once had a mission with a guy on vacation that couldn't really play or speak. He just ran along as a dog
i want to be a dog. can i play with you and be a dog?
No
dang.
"Fin_random_F" createUnit [position _this,civilian];
``` so this shold wowrk yes
question mark
is the group wrong?
now is it suppose to work when i do this
_this globalChat format["line 1 \n line 2 \n line 3"];
no
There are few places where it works
format doesn't do any formatting btw.
it has no effect right there
fuck i had this in ther
_this globalChat format["line 1 \n line 2 \n line 3 \n my name is %1",(name _this)];
format only replaces %X by the parameter
without %X and without parameters it does nothing
How do you make a execVM when you push a button (findDisplay 46) displayAddEventHandler ["KeyDown", "if (_this select 1 == 73) then {execVM "OpenDiag4.sqf"}"]; // 9(numpad) Needs to be something like that
Why are you using execvm over a function/method? @fleet wind
@cerulean whale Well you see im still new to this and i have never learnt the whole Functions
I'll jump on my pc in a sec and give you a hand
Sounds great xD
Could someone help.
I'm nearly 50... I can't code, but I'm almost there...
Now posting in the right place, I hope.
I have found/botched together the code below that enables me to add remove units from HC.
The last line should remove units from HC. Except it doesn't.
Question: What is the Object vs. Array error in the last line?
player addAction ["Add Group to HC",{player hcSetGroup [Group CursorTarget]}];
player addAction ["Remove Group from HC",{player hcRemoveGroup [Group CursorTarget]}];
Questions - I have a player variable that can either be nil, 0 or > 0 (nil if I have not set it yet)
But this OR statement just wont pass :-(
if ((isNil "_counter") || (_counter == 0)) then {
...
}
_counter is gotten via a _counter = player getVariable....
Does a variable have to be public for isNil to evaluate it since it requires it being sent along as a string (the variable to test) - this was something I read, that it had to be in string
@young spade
player addAction ["Add Group to HC",{player hcSetGroup [Group CursorTarget]}];
player addAction ["Remove Group from HC",{player hcRemoveGroup [Group CursorTarget]}];
player addAction ["Add Group to HC",{player hcSetGroup (Group CursorTarget)}];
player addAction ["Remove Group from HC",{player hcRemoveGroup (Group CursorTarget)}];
you used square brakcets [ around group cursortarget
Square braket mean it's an array
use normal ( instead
But only in that part
@gaunt hamlet
if ((isNil "_counter") || {_counter == 0}) then {
...
}
try wrapping curly brackets around.
Curly brackets after || mean that the following {code} will only be checked if the first condition is false
If _counter is nil then your if would error. With curly brackets it won't
Thank you.
np
@peak plover will try that - thanks!
so I kind of force it to a true or false by evaluating it?
worked as a charm - thanks a bunch!
Is there no way to get the generated event index inside the callback?
I need to remove my event once I have done the stuff I need to do inside the callback - and it would seem tidy to remove it the same place
And can you call normal EH's with addMPEventHandler also? coz example for addMPEventHandler says..
player removeMPEventHandler ["killed", 0];
Where I would think it should have been "mpkilled"?
it returns the ID, so save it as a global variable
and it will be available in the scope of the eh
is this allowed then?
private _player = this select 0;
... do stuff
private _index = _player getVariable "XxX_eventIndex";
_player removeMPEventHandler ["mpkilled", _index];
}];
player setVariable ["XxX_eventIndex", _eventIndex];```
it should have returned its own index inside the callback - is "this" the scope of the event function inside it? Can I log out what properties it might have - its own index should be on it.
@gaunt hamlet ```sqf
player addMPEventHandler ["mpkilled",
{
params ["_unit"];
/* your code */
_unit removeMPEventHandler ["mpkilled",_thisEventHandler];
}];
when was that added
makes a lot more sense
thanks @meager heart
so params ["arg1", "arg"]
is better practise than
_arg1 = this select 0;
?
very new to this "language" π
well, it lets you set defaults
and with params ["..."] what is the scope of that variable?
ok thats - saves me typing that private each time - just seemed like good practise to declare as private if it is private
its not better, its diferent https://community.bistudio.com/wiki/select
https://community.bistudio.com/wiki/params @gaunt hamlet
so _arg1 becomes block / script scoped by default?
No its just local variable
variables are accessible in deeper nested scopes in my script right? like inside a while loop I can access a variable I made outside it?
it depends on where you define it... also is it private
syntax question will this work?
player setVariable ["x_counter", _counter + 1];
Or do you need () around a statement that needs to be evaluated? Like this
player setVariable ["x_counter", (_counter + 1)];
aye - more readable
@peak plover if I have two numerically based evaluations I want in a if statment with && do I have to wrap both in curly?
Like: ```
if ({_speed > 0} && {_randomWait > 0}) then {
_randomWait = _randomWait - 1;
};
No
You don't need curly
Curly means the second one is only checked if the first one fails
good for isNil or isEqualType
if (_speed > 0 && _randomWait > 0) then {
_randomWait = _randomWait - 1;
};
ahh ok so only for ||
but why would you only want to check second one if first one fails in a && ?
with || only checks the 2nd conditon if first one is false and with && only checks 2nd condition if first is true
because
π
Hmm think my script is pretty much done - could use some scrutiny as it's my first one so to say
Had a need for a mine field in my first MP mission - so thought I might as well make this a reusable script.
But guess there are tons of minefield scripts out there - mine is special though :-D
Where do people go to share?
And anyone want to help me by looking it over and commenting where I messed the bed?
Would be very grateful - its only 67 lines, and like 1/3 of those are comments
so very small script
was page with nice code optimizations tips and examples on wiki... wait
Yeah, usually better to make your own than getting some elsewhere.
1/2 is comments actually
damn - sweet link sldt1ck
and 50% of the code lines remaining are end curlys π
My worry is the MP world and its caveats for random situations I have not thought about coz I'm new
coz I'm new
Everyone was there, its ok
in a script im trying to determine if its night, does anyone on have something they can share
well if anyone wanna have a look and give pointers (or possibly use it) - then here is link:
When it is night can probably vary a lot depending on time of year @exotic tinsel
useful @gaunt hamlet
@exotic tinsel ```sqf
0 spawn
{
private _hour = date select 3;
private _night = if (_hour > 20 || _hour < 8) then {true} else {false};
if (_night) then {hintSilent "Night"};
};
As of Arma 3 1.7, this returns either 1 for sun or 0 for moon. Nothing in between.
awesome thanks alot
π
@meager heart is [] spawn {} the same as 0 spawn {} and is it just to pipe the result into nothing - like null could have been used also?
or is it like a grabbing on to point to spawn it
is it just to pipe the result into nothing - like null could have been used also?
yes
And if anyone bothered to look at my script on my git - reload it - I fixed the indentation problem π
itβs arguments for the spawned code so the second one would have 0 as _this, itβs not needed but Iβd recommend sticking to []. on triggers or init fields you canβt return a script handle so there it can be used as 0 = [] spawn {... to circumvent
so I could do like this?
hint format ["%1", this name];
}```
or however you retrieve object properties
_this instead of this
how do you retrieve properties?
and name _this
"prop_name _this"?
I'm so blank lol - don't even know how the data structure works - is it objects with keys and values?
[1,2,3,4] spawn {
params ["_first","_second","_thrid","_fourth"];
hint str _first;
// 1
};
π΅ π¦ π· π¦ π² πΈ
ahh hint str instead of the whole format with arguments - when just wanting the variable and nothing more
lol saved me some time right there for my "hint-as-console-logs"
thanks you guys and girls - really helpful and saves me a TON of time
LOL yw,np,glhf
Could someone tell me if I am writing this the right way "switchMove "R_death_011"; s1 disableAI "anim";"
who ? switchMove "R_death_011"
s1 switchMove "R_death_011"; s1 disableAI "anim"; ?
and what is R_death_011...
@peak plover π― / π― params syntax highlighting π
is there a cap for how many conditions a if statement can take?
you'd fuck your shit up well before you reached any theoretical limit
and do I have to wrap all consecvent conditions in {} after first one?
you use () for conditions
he meant lazy eval maybe
No limitbut u shouldn't use curly if u don't need it
i just learned new word πlimitbut
If I run a script on a trigger activation like this _null = [] execVM "path\to\script\onActivation.sqf";
Is there then a way to pass whatever activates it as this in first argument _null = [this] execVM "path\to\script\onActivation.sqf"; And in that script treat that variable as I please without regards to if it is a vehicle, player or an AI?
Like then in scipt be able to do params ["_perpetrator"]; _speed = speed _perpetrator;
And again (and sorry for writing so much lol) - would appreciate if anyone would look over my script to see if they can see with their bare eyes any reason this would not work in a real MP server π
Its a pose.
could use some help understanding how to use a foreach with a multi dimensional array. Would this work to get β1β and β1aβ?
_myarray = [[β1β,β2β,β3β],[β1aβ,β2aβ,β3aβ]];
{
_getparamNum = _x select 0;
_getparamAlphaNum = _x select 1;
} foreach _myarray;
it'll never work if you spell select wrong i can tell you that much for sure
sorry was in a rush
that would print
1, 2
1a, 2a
well if you told it to print it would do that
this is simple stuff to test yourself though man come on
your array has two indexes:
[β1β,β2β,β3β] and ,[β1aβ,β2aβ,β3aβ]....
foreach go through each index of the array you pass
i'll let you figure out why that won't work yourself
@exotic tinsel
{
systemChat str _x; // "1", ...
systemChat str (_myarray select 1 select _forEachIndex); // "1a", ...
} forEach (_myarray select 0);
that looks so crazy to me
is that how you get places with arma 3 scripting? embrace the crazy?
Nothing crazy here. Though I'd assign each sub array into variable first though and str is not really needed here (just in case he has different data in his actual script).
This also of course assumes each sub array has same length but looking at his example it should.
@swift ferryenai#3053 selectPlayer I think. You can also replace the classname for a player slot in mission.sqm
Don't have time to fix that now.. ugh
@edgy dune
@Sticky Handz That is wrong channel for that kind of messages
what a desperate scrub lord
and he jumped out from server
Does preprocessFileLineNumbers do pretty much the same as what compiling functions with CfgFunctions does? I want to replicate how it does it, but I dont want to use CfgFunctions because I only want a group of scripts to be compiled for a certain group of people/side
pretty much i think yeah
you can't use the built in function browser unless you use cfgFunctions, otherwise i'm not sure there's many differences
I only want a group of scripts to be compiled for a certain group of people/side sounds like you're over complicating or over thinking things though
i use cfgFunctions cos it's neat and tidy
@rancid ruin What I mean by that is lets say I wanted just police to have access to their related scripts, that lets say civilians wouldnt need, I feel it would be better not to have it in CfgFunctions for everyone
because.....?
Well considering theres so many scripts for them, plus this isnt the only "group" of scripts that are only limited to that group. Do you honestly think it wouldnt matter much just putting them all in CfgFunctions?
I mean id love to just put them all in CfgFunctions, just didnt think it would be best for performance and load time
negligible
itβll work just fine
I mean id love to just put them all in CfgFunctions, just didn't think it would be best for performance and load time
That is most optimized and safe way i think...
preInit, postInit, preStart also check what this things do @warm gorge
also compileFinal...
Hey guys. I have a small question.
Is there a way to possibly change the color of vehicle headlights via a script in game?
nope
Lights are like part of the model, right?
Yep
I guess you can create a lightsource with a different color, but I don't think those will every act as normal car lights and provide a cone
As long as the Veh not moves
You can attach the light, 'tho
Hmm
Concerning performance and such... I have possible 300 locations that I want to draw a 3d icon for. They might move
Sending all of them as an array every second would be costly, right?
I don't understand the scale of how much information that would be
over the network ?
@warm gorge you can look at the CfgFunctions script if you want to.
compileFinal preprocessFileLineNumbers <script>
That is what CfgFunctions does
Yeah
thatβs not ok imo
heck even sending a single variable every second is something Iβd recommend looking into other options for
you also have 300 locations.... just saying
tell me they are already placed and not created
They are just array of positions right now. I can just make into locations
retrieve locations on player init -> use it for whatever you intend to do
what are you trying to build that requires 300 locations ?
no need to broadcast it
so itβs fake AI until they get in player range ?
It's just an array of positions until they get in range
Also uncache / cache with zeus module
So I need to draw 3d icons of the positions for client who is zeus
So there's identication of the cached units
oh boy
nigel - Today at 12:44 PM
You can attach the light, 'tho
Hmm```
Yes and the light will wiggle around like a TwerkingQueen..
clientside light ?
Yes
set initial pos, only send updates for moving units and send their start/end position, let the Zeus clients simulate how theyβd move
Test it yourself, attachLightSource or however it was called uses probalby the PhysX Box wich switches around like crazy, Nigel
oh wait no, that's the showcase mission
wow
3 FSMs for mines in that mission.... holy moly
bulli
Can i do an if within a switch?? That same cases are only available if certain conditions are met?
Consider using call and exitwith
private _a = 1;
call {
if (_a isEqualTo 0) exitWith {};
if (_a isEqualTo 1) exitWith {};
if (_a isEqualTo 2) exitWith {};
if (_a isEqualTo 3) exitWith {};
};
Will do. Thank you π
i guess i have to pass _a as an arg? Or is it known if it was set above the call in the script?
Thank you π
Np
Morning, May I ask something else.
My son cheats in Zeus! He can see both sides and (ahem) is always in the right place at the right time -- he also moves my units. I would like to get him back by setting up a scenario where he ^cannot^ see OpFor in Zeus. It it possible to remove the Group/Units markers from the Zeus interface? or make it so he cannot direct the units?
Many Thanks.
@knotty mantle yes you can have an if in the switch code. No problem at all.
@young spade You can remove the markers yes. But he will still see them running around.
Are all units pre-placed at mission start?
You can also restrict a zeus to a side (probably via the module/entity properties, can't remember specifics)
Would be far easier than the solution I was thinking about
@still forum Removing the markers would be awesome! Most units are placed at the beginning of the mission but I like to add a few surprises(!) here and there later on.
@inner swallow I looked for that couldn't find a practical way of doing it ;0)
Units you place yourself as Zeus shouldn't show up in his interface anyway. Unless you are running special mods or scripts that do that
this removeCuratorEditableObjects [allUnits select {side _x == opfor} ,true]
Put that into the Zeus Module's init script field. That should work
Rather then placing units before the mission starts, I could spawn everything. Would it then be possible to remove all Opfor units from the Curator on their spawn? i.e. they would mysteriously dissappear.
Removes allUnits that are of side opfor from the editable Zeus objects.
And what you can't edit you also don't get markers for
@still forum Will try, thank you.
If it doesn't work just mention me. I could imagine that it doesn't work right at mission start and one needs to wait a few seconds before doing it
Didn't even know about the camera area thing
;0)
@young spade in the list of Systems -> Virtual Entities, you'll find Zeus, Zeus (BLUFOR), Zeus (OPFOR), etc.
I've never actually used side specific ones, but they should work
along with dedmen's suggestion (although the side specific zeuses should just straight up prevent a zeus from placing opposite side's units)
Thank you - I give the Virtual BlueFor Zeus a go.
@still forum @inner swallow Not getting anywhere fast.
Created a mission in a VR scene.
Put down 1 x BlueFor & ! x OpFor.
Added traditional zeus or virtual entitity bluefor zeus (named and linked to a zeus game-master with Dedmen code) .
''' this removeCuratorEditableObjects [allUnits select {side _x == opfor} ,true] '''
then, got into zeus mode and place duplicate units... came out of Zeus, went back in. No changes.
Maybe I need to put code in init.sqf or similar to test all units?
It removes all units that are placed at mission start
The ones you place. Will show up
Ok -- my bad. Thank you.
And to be clear, pre-placed units that aren't explicitly added to the curator via addCuratorEditableObjects command or the Add Editable Objects module shouldn't show up at all
So my script doesn't even make sense in that case
if pre-placed enemies and units placed by other Zeuses don't show up
The Zeus should never see enemies or anything he didn't spawn himself
unless some Mod is running that's doing that
@still forum The CfgFunctions script? Isnt that all engine based, where do you see that
a3/functions_f/initFunctions.sqf
ah yep cheers
I think multiple zeuses on the same side can control each other's units, but i'm not 100% sure - unless you're 100% sure about The Zeus should never see enemies or anything he didn't spawn himself
I know that I run scripts that add every object spawned by one Zeus to the other zeuses so they can access it too
I think the curator wiki page also talks about that
wouldn't be needed if that happens automatically
yeah, true
I know Ares/Achilles mods allow you to add units via the zeus interface itself
Hello, Is there a way of testing if a player is in any type of vehicle (car, tank ...) ?
maybe with
Gunshiper = {player in _x} forEach [car,tank,plane.......];```
or something
_in_vehicle = !(isNull objectParent player);
ooooh ! nice !
you can also just check player != vehicle player
well it is... when the player isn't in a vehicle π
in this situation, I don't car about the position, all I want to know is if he is in a vehicle π
Hola, anyone online that could help me out with modifying scripts?
What wrong
I'm trying to figure out how to change this script so that instead of radius it would use xy range.
'''css
/*-------
Makes targets pop up at the user's command. Targets go down after being hit,
and return back with user action. Because swivel targets have a different
script assigned to them that works differently from all other targets,
they are handled separately in the script. If you don't plan
to use swivel targets at all, feel free to delete the corresponding part
of the code.
this addAction ["Reset targets", {0 = [radius, objectName] execVM "reset.sqf"}];
-------*/
params [["_dist",50,[1]],["_center",player,[objNull]]]; //in params
_targets = nearestObjects [position _center, ["TargetBase"], _dist]; //take all nearby practice targets
if (count _targets < 1) exitWith {
systemChat "No compatible targets were found."; //exit if no targets have been found
};
{_x animate ["Terc",0];} forEach _targets; //get all targets to upright pos
{_x addEventHandler ["HIT", { //add EH
_this select 0) animate ["Terc",1]; //if hit, get to the ground
(_this select 0) RemoveEventHandler ["HIT",0]; //remove EH
}
]
} forEach _targets;'''
^
Ah
Discord supports sqf, no need for css highlighting?
/*-------
Makes targets pop up at the user's command. Targets go down after being hit,
and return back with user action. Because swivel targets have a different
script assigned to them that works differently from all other targets,
they are handled separately in the script. If you don't plan
to use swivel targets at all, feel free to delete the corresponding part
of the code.
this addAction ["Reset targets", {0 = [radius, objectName] execVM "reset.sqf"}];
-------*/
params [["_dist",50,[1]],["_center",player,[objNull]]]; //in params
_targets = nearestObjects [position _center, ["TargetBase"], _dist]; //take all nearby practice targets
if (count _targets < 1) exitWith {
systemChat "No compatible targets were found."; //exit if no targets have been found
};
{_x animate ["Terc",0];} forEach _targets; //get all targets to upright pos
{_x addEventHandler ["HIT", { //add EH
_this select 0) animate ["Terc",1]; //if hit, get to the ground
(_this select 0) RemoveEventHandler ["HIT",0]; //remove EH
}
]
} forEach _targets;
There we go..
π
I got this script form Feuerex's video about how to make controlled pop up targets..
But it uses radius from object where I would prefer xy range.
Feuerex made it so that the targets, once hit, stay down until he would reset them on laptop which had this command this addAction ["Reset targets", {0 = [radius, objectName] execVM "reset.sqf"}];
What is your goal @long gazelle
The object specified was Game Logic.
I have a quick question here, trying not to interrupt conversation here. If I were to use onPlayerConnected and it's special variable "_id" (Listed as Unique PlayID) and objectFromNetID. Would I get the correct returns? I tried to turn the id into a string and diag_log it, but it came up with "Error: No vehicle attached".
And my goal is to change the data input so that it won't read all targets within circle with X radius but within an area with xy range.
> xy range what did you mean by that
you mean something like distance2D ?
For example area of x = 50, y = 100.
I know there's a better word for it but can't remember right now..
Radius....?
Is it really that? I've always used that with circles and spheres so I thought it would be confusing..
Well yes, because circles and spheres from center -> Radius
Okay, so how would I implement the alt syntax 3 into given code? I'm completely new to scripting..
_targets = _targets inAreaArray [_center, 50, 100, 0, true];
Also set the distance to x2, because nearestObjects wouldn't grab the corners
Can you elaborate?
inAreaArray returns only the _targets that are in a square
50 wide 100 high
roation 0
Yeah that I got. But what you meant by "distance to x2"?
Because ```sqf
_targets = nearestObjects [position _center, ["TargetBase"], _dist]; //take all nearby practice targets
it gets them around in a center
with a radios (circle)
So if you use a square later
you'd need to make sure the nearestobjects that in the square corners are there too
if your square is 50x50. then the corners would be more than 50
I'm gonna have to rewrite this whole code aren't I?
I hate text typing in chats...
This line,
_targets = _targets inAreaArray [_center, 50, 100, 0, true];
Did you mean I should replace the line below with line above?
_targets = nearestObjects [position _center, ["TargetBase"], _dist];
Or add the line above to the code without replacing anything?
nearestobjecst
inAreaArray
nearestObjects creates an array _targets
_targets = _targets replaces the array with the result of inAreaArray
Question: Can you explain me this:
This code is written on the laptop to reset the targets:
sqf this addAction ["Reset targets", {0 = [radius, objectName] execVM "reset.sqf"}];
And this is the first line of code in reset.sqf:
sqf params [["_dist",50,[1]],["_center",player,[objNull]]];
Now I'm not making any heads or tails with this because how I understand it is that the laptop executes the reset.sqf and returns the variables: ```sqf
[radius, objectName]
But apart from that I have no idea what happens..
was the person that wrote this drunk or impaired ?
using three letters global vars.... and sqf at that... wow
I haven't seen this even in MCC....
Did you read everything already? Get the gist of it what I'm trying to do?
going to read from the start, that sounds hilarious
what do you mean by xy range? you still haven't clarified that
xy axels on map. x = 10, y = 10 you got a square area, x = 20, y = 10 you got rectangular area..
oh, a square π
I'm not even sure how to explain it..
yes I get it
well, yes but it's less efficient than what you currently have
That doesn't answer a lot... Just raises more confusion for me..
with inAreaArray:
_targets = _targets inAreaArray [_center, 100, 100, 0, true]
inAreaArray will only return targets that are within the rectangle provided
Okay... Where do I place that in the code?
figure it out, otherwise you won't learn
also put that into a func since it seems you'll use it more than once
for more info on that:
https://community.bistudio.com/wiki/Functions_Library_(Arma_3)
Well assuming that because it has _targets = _targets it goes through targets already within the _targets so after the line ```sqf
_targets = nearestObjects [position _center, ["TargetBase"], _dist];
I'm guessing..
_targets is the local variable in which the result of nearestObjects is stored
we take that and check which ones are within the rectangle with inAreaArray and change _targets to only have those
Because I still don't fully know how this original code works..
I started scripting today, hopefully that clears just how much I know about all this.
So can you help understand my previous question first?
it's a trigger, just checked the video you linked
getPos _center should do it, also what was the question?
No it's not.. The video doesn't cover it very well..
The trigger he has is just to demonstrate the area of effect.
Hold one.
yeah, got it, sqf is the goddamn object varname..... π€¦
from what i've seen of what you just deleted
jesus christ
Question: Can you explain me this:
This code is written on the laptop to reset the targets:
this addAction ["Reset targets", {0 = [radius, objectName] execVM "reset.sqf"}];
And this is the first line of code in reset.sqf:
params [["_dist",50,[1]],["_center",player,[objNull]]];
Now I'm not making any heads or tails with this because how I understand it is that the laptop executes the reset.sqf and returns the variables:
[radius, objectName]
But apart from that I have no idea what happens..(edited)
Just... Ignore the sqf's...
Now it's clean..
reset receives arguments from the addAction, which in this case are nil
radius and center aren't defined in the addAction code block (scope)
Yes, I wrote them radius and objectName to explain what they are..
What I have in the game are [50, iCenter]
iCenter being the varname of an object / trigger, correct?
iCenter being the Game Logic..
why are you using a game logic?
I'm only using what the guy in the video put on the test map he had.
There's a download link to it in the description.
If it were me I would be using a rectangular Trigger and have every target within it react to the command but unfortunately I'm not that good at scripting yet..
@lone glade Where ya go?
No, I mean I wanted to learn what those two lines I last wrote are doing.. I know that the code in laptop
this addAction ["Reset targets", {0 = [radius, objectName] execVM "reset.sqf"}];
executes the reset.sqf and sends 2 variables to it.
But what I don't know is what happens here:
params [["_dist",50,[1]],["_center",player,[objNull]]];
It sets the parameters but besides that it's Latin to me.. For one, what the heck is that 50 doing there?
check this https://community.bistudio.com/wiki/params
And if the [1] is selecting the 2nd variable sent from the laptop then why is the _dist (which I assume is distance) taking the objectName?
I already did.
[variableName, defaultValue, expectedDataTypes, expectedArrayCount]
it's because he doesn't know how execVM works
Ok?
_handle =[args] execVM "filePath people just forgot you could omit the handle... and just decided to use nil / 0 instead :/
the handle is what allows you to use script commands such as terminate on the script
hello, sorry to but in but was wondering if someone could tell me how one would add a line of code that is a or option, ei need x item or y, z , c items
if (BOOL || BOOL) then
|| is or, alternatively you can use OR (but then people on this chat will yell at you for good reasons)
ok thanks alot
all operators:
https://community.bistudio.com/wiki/Operators
good reasons?
much faster to type and it's more readable
wut
π
you don't think "or" is more readable since it's a real word?
i use || out of habit, it doesn't really have any advantages lol
it's because it's a "real word" that it's worse
it's easier to see the separations with ||
same with &&and AND
@lone glade Wanna keep chatting in private so I won't thake space here? Also clearer and easier to multitask..
nope
but you read OR as OR, your brain has to parse || and translate it internally to OR
this chat is for help, might as well use it
Help them first then.. Get back to me when the channel is clear of traffic.
oneoh can help too
we need something like this in discord https://gyazo.com/99f37cf92b5fe8324d37fa6f2aaf5f94
or sqf bot... with !sqf <command> gives link
@meager heart https://discord.gg/vpdwJtG
A.D.V.E.R.T.I.Z.I.N.G
π
I only execute sqf instead
Though, there is a help command but due to the bot not Supporting full cmd range
if you're in this channel and don't have the sqf commands page bookmarked then you should be kicked tbh
no need for a bot
yes need for a bot
the search bar on the wiki is trash
if you don't type the exact name it will have a 50/50 chance of failing
that's why you bookmark the commands page and ctrl f
ah, yes, bookmark all the pages
why didn't I think of that
THATS WHAT THE GODDAMN BAR IS FOR
i'd rather just use ctrl-f and not have to wait for a page load myself
way quicker if you can't remember the full name of the function as well, or just remember one word
doesn't help when you don't remember the name of the command at all
you're fucked then yes
Hey, if I have variables [objectName1, objectName2]
And objectName2 was a trigger than can I get its area with
params [ ["_center", player, [objNull] ], ["_area", [10, 10, 0, True], [triggerArea] ] ]
no, the third argument of params expects a data type
Okay, so how would I get the triggerArea without hassle and set it to _area?
btw you can do it like that params ["_center","_area"];... looks less cool tho
nah, the other args are needed here
One thing at a time guys.. You can argue later... No pun intended..
what do I type in the [args]??
whatever is in the wiki page for triggerArea
[args]
can't remember what they are π
[a,b,angle,isRectangle,c]
How would I recieve them in params? I've been reading the page and I'm not entirely sure..
it's passed to _this in your script and is what params used as input by default
I don't get it.. Do I write it like this: params ["_area", [10, 10, 0, True], [] ]
So ["_area", [10, 10, 0, True], [ [] ] ] ?
yes, no need for the spaces in those arrays π
@meager heart the used syntax also confirms valid input types
Alright... Let's test this thing..
alganthe is right it will be easier for him, X39
Laptop code:
this addAction ["Reset targets", {_handle = [50, iCenter, triggerArea targetTrigger] execVM "reset.sqf"}];
iCenter = spheric trigger
targetTrigger = rectangular trigger with x = 10, y = 2, angle = 0
reset.sqf code:
params [["_dist",50,[1]], ["_center", player, [objNull] ], ["_area", [10, 10, 0, True], [ [] ] ] ];
_targets = nearestObjects [position _center, ["TargetBase"], _dist];
_targets = _targets inAreaArray
[_center,
[_area select 0],
[_area select 1],
[_area select 2],
[_area select 3]
]
if (count _targets < 1) exitWith {
systemChat "No compatible targets were found.";
};
{_x animate ["Terc",0];} forEach _targets;
{_x addEventHandler
["HIT",
{
_this select 0) animate ["Terc",1];
(_this select 0) RemoveEventHandler ["HIT",0];
}
]
} forEach _targets;
In short: Not working, any ideas?
Do you have -showScriptErrors startup param ? Abel_Ex
No, but if you are wondering about the missing ; already fixed that.. Didn't work..
So I'm guessing the problem is with _area select #
Anyone online?
Nope
Apparently so..
At least you didn't @ everyone
Well doesn't matter any more... Just found the solution to my problems.. Took only 12 hours but who needs sleep anyway?
welcome to arma
I've placed support requester module synced with a soldier (commander). Then I've placed artillery support module synced with mortar. I didn't sync both modules on purpose because I want them synced after certain action is triggered by a player (player needs to call in artillery action on some laptop near antenna tower). In that action I've called a script:
params ["_antena", "_caller", "_id"];
switch (side _caller) do {
case west:
{
[supportRequesterWest, [supportProviderWest]] remoteExec ["synchronizeObjectsAdd", supportRequesterWest];
};
case resistance:
{
[supportRequesterResistance, [supportProviderResistance]] remoteExec ["synchronizeObjectsAdd", supportRequesterResistance];
};
};
Unfortunately, that works only on single player despite synchronizeObjectsAdd being a global argument global effect command. What am I doing wrong?
You can try add this after synchronization BIS_supp_refresh = TRUE; publicVariable "BIS_supp_refresh";
@fossil yew
that's a secret magic var?
yep
ok thanks
What naming convention do you guys use for displays/dialogues? I see some use RscDisplay___, others just use camel cased names like someRandomDisplay
You mean what #arma3_config stuff style we #arma3_scripting guys use?
TAG_Display_Whatever TAG_Whatever
Sorry, should have put it in that section
important is to include the tag
Whys that?
So that others don't use the same classname as you do and break everything
Ah yep good point
Hey #arma3_scripting , I was wondering is there anyway to find the marker of a tactical ping in sqf? as in, use it like position myPing??
That no. But I could imagine that there is a eventhandler for it
Maybe inputAction "TacticalPing" and then you can return position with cursorTarget...
_position = position cursorTarget;
No
Won't work at all if you are aiming at anything that's not an object
Sky/Terrain/Water/Tree
Even if you aim at an enemy AI that you haven't spotted
well...yep you are right
but if look in sky with screenToWorld also will not work... maybe cursorObject and check if it !isNull...
π€¦ screenToWorld is for UI to world pos conversions
Can you ping into the sky?
No
So no problem?
the marker is a 2D / 3D icon
Only if there is object
hintSilent str (screenToWorld [0.5,0.5]); https://gyazo.com/90c3fc1f1d1a0bf68b784a158ec7e5db
Hello, In OFP you could give any vehicle weapon to a soldier with a addWeapon. In Arma 3 I can give missiles but not getling or miniguns ... can someone help ?
I guess if it doesn't work anymore then it doesn't work anymore
what a shame ....
I remember using vehicle missiles. But I don't think I ever tried miniguns
would it be possible somehow to attach a "M134_minigun" to a katiba ? xD
I guess that could be possible with #arma3_config
okay
@still forum mikero asks 35 bucks for his tools.
How much will you ask for the intrecept that improves perf
I need to get a lot of positions for mt terrain so how would I go about teleporting my player and grabing the positions , directions, height etc and copy to clipboard , can this be done in zeus ?
you should be able to do it in the editor
I believe there's even some copy position to clipboard stuff
ahh yep found it was over thinking it many thanks
I cant figure out how to use ctrlText on RSClistbox (What command do i use to check what is selected on there)
so Lbtext ?
I only want to "Read" the text (Use it as a varibale)
Hint format["This is the player you have selected %1",_playerSelect];```
says it returned a number huuu?
soooo, look at the wiki page again for that command
Roger that, π Thanks for the help anyway got me on the righ track.
Question about notepadd ++ figured this was the best place to ask.. if Im off topic .. let me know .. How do you append quotes and such to the end of a line of code .. with out manually copy paste .. saw one post on the web said to use find and replace $ and what ever you want to add at the end of each line .. dosent work for me
Why do you want to add quotes to the end of a line
Trader categories .. add ", at the end of every item .. has to be an easier way .. front side is easy
replace. Enable regex.
replace \n by ",\n
never mind I just figured it out .. needs to have reg expression checked π
But thank you for the answer π
using script, i have created a task and a trigger but how do i sync them to one another?
OK, so I'm beginning to move some of my eden concepts into sqf files. This particular script creates a 4 vehicle convoy (on Malden) and sets waypoints down the East coast to Le Port, and monitors for its destruction.
So my questions are;
- is there anything I can refactor
- Am I right to sleep something for so long? (Should be between 30mins and 1hr30mins right?)
- How do I add into the waituntil that I want an exit from the wait if the convoy has reached it's destination?
- Why do the trucks which spawn in exactly on the road facing the direction they need insist on moving into a herringbone off the road and crash into lamp posts??? grrr
Hello! Anyone know how sign EBO files?
it's a BI reserved extension
I saw that people signed these files
Obfuscating a pbo is a thing right?
yes
I would not ask if I did not see what I saw, and these signatures worked
yes, they worked, but it's illegal
@umbral oyster Sure. BI ebo's also have signatures
You have to ask BI to sign your EBO as only they have the tools to do it

lol
How do you even make eboΓ€s
If you do not know what is possible, it's better and say that you do not know.
Exile
and get demonitzed and banned :p
I saw how a person not from the environment BI signed these files, their own files, their own byprivatakey, without the help of BI
Ye, Exile, fuck life)
Not possible though
if they did that mean they reverse engineered BI code and broke the EULA
That guy probably had a direct contact to BI to get them signed
BI can signed files directly for me?))
exactly
if you're on exile levels of fame probably :/
Sorry to intervene What is the reason fror writeing this _target = param [0,objNull,[objNull]]; (From altis life framework) instead of just ?_target = _this select 0
because param is superior
because it has a default value
Default value, and type check
which makes it superior
More efficent?
Yes
default value + typeCheck + privating
@fleet wind no
π€
it's not more efficient, just a lot more useful
Does a lot more stuff.
well, it kinda is more efficient if you did all of those
id argue params is better than param though
not the same
not if you only have one argument
You're not kidding? Do they really sign the file on request? @still forum
mmm fair
@umbral oyster yes
it's like saying inAreaArray is superior to inArea
or saying that iforeach3 is superior to count
inAreaArray > inArea
Ayyy. Dscha has my fav name today
thank you.
It has a lot of history π
Hey quick question: what do I need to write, exactly, in to the condition field of a trigger for it to activate on any player passing through?
Here comes anothe stupid question why do you declare variables like this at the top for optimization ? private ["_dp","_target"];
@long gazelle Don't use triggers?
@long gazelle
thisList count {isPlayer _x} > 0
player inArea thisTrigger?
@indigo snow NOOOO
@fleet wind
private _var = 0;
//not
private["_var"];
_var = 0;
itll activate locally π
@still forum Didn't work..
@long gazelle You dont really need to write anything in a trigger just change the activation to any player π
@fleet wind You don't. The private ARRAY variant shouldn't b e used
i should probably bow out, im not very much on point today
Thanks Dedmen allways to great help π Ill be back soon.
Dedmen*
Ops
Oops*
@subtle ore Still alot more in there =}
Daamnnnn.
We need a online name generator that finds fitting names in a 100GB wordlist
Woah
Okay, so either it the trigger will not activate even if god willed it, or I have the On Activation wrong.... I'm trying to get it do a simple hint for starters... How would I type that in?
God doesn't will stuff
it doesn't exist
On Activation would be
hint "stuff"
No ; in the end?
Not only does my Arma minimize itself every 2 seconds the trigger does not work... No hint, no nothing..
Ideas?
whats your activation setting?
Wtf are you on about
Minimise itself every two seconds?
type: none, activation: any player, activation type: present, repeatable: yes, server: no
Your hands having spasms
you're running into it yourself in eden preview?
Yes.
How do I #include from a parent folder?
..\aaaa
is there any way without ..
No
uh why would you think there would be
Can't be done with like mission path somehow?
How about in description.ext?
you can't get that scripts path into your script file before the preprocessor
youd go to a predefined location though, not necessarily the actual parent folder
How's that life code going nigel π€
π
... can you still prune __THISFILE___ or whatever the macro was?
So is it not working because I'm in eden?
oh no but i couldnt think of another reason for it to not work
maybe try switching it to any present instead of player present
How do I use THISFILE and prune it in description.ext?
There is "any player" and "anybody"... Did you mean the latter?
sure, Abel
nigel, liberal filty abuse of _EVAL?
havent messed with them for a year or so
dont think you can use that to #include in preprocessor though
Why is there no clear guide on the net that says: "Type THIS into the condition area and THIS into the On activation area"...
I'm getting nothing and internet ain't being helpful..
what's the issue?
I've been asking.. So far either nothing's been helpful or clear..
Why not ask for clarification on something then?
put hint "weeee" in the activation area (the code run when the activation condition returns true), don't touch the condition and select a proper activation type
boom done
I simply want a trigger, that when any player enters the area, it displays a hint saying "hi"..
Boom hasn't worked for the past 40 tries..
And that's all I've been having... Does not work.
is the trigger area large enough / are you in the trigger area
Yes and No.
Does this have something to do with it not working "function can only be activated during mission init"?
It displays everytime I press play scenario..
huh? do you mind posting a screenshot of the trigger in 3DEN (the properties)
well yes
that error is unrelated
your trigger is working fine
what's the issue ?
it's working fine, you say it activates after you press play π
ah, the error displays, gotcha
You're running mods though, aren't you?
then screenshot of the trigger properties pls π
Why is there no clear guide on the net that says: "Type THIS into the condition area and THIS into the On activation area"...
https://community.bistudio.com/wiki/Eden_Editor:_Trigger
https://community.bistudio.com/wiki/2D_Editor:_Triggers
Read it, didn't help.
Β―_(γ)_/Β―
Someone previously said not to put anything in it.. Well it works now.. Next question: is the hint ever gonna go away?
yes
Ah there we go..
Also, those wiki links explain both the condition and activation condition...
I read them but for me they are not clear enough..
Last question: What command do I need to use in the On Activation: to execVM "test.sqf" with 3 variables?
_temp = [var1, var2, var3] execVM "test.sqf"
So it was that.. Thanks.. The format of the line was the main point here.. wasn't sure if I should put all of it within [] or not..
Putting it all between [] makes it a single array thats passed
Thats why it all needs to be in the square brackets
so then within the script you can access the first variable by _this select 0 and the second by _this select 1, and so forth.
how can i, in a triggers condition check the state of a task? im trying to execute script on succeeded of a task using a trigger
How have you set up your tasks?
_Trg_detectMissionComplete setTriggerStatements ["taskState " + _taskid + " == 'Succeeded';","hint 'main task completed';", ""];
Hi all, I need help trying to get an enemy ai to drop his primary weapon when blufor enters the triiger. I have this in the act: unit1 action ["dropWeapon", unit1, "PRIMARYWEAPON"]
but doesnt work
LifeSnatcher, youre still using the simpletask commands? You might wanna switch to the mewer tasks function framework
using the task modules. those work fine, trigger >> set state >> create task. i need to have a trigger unrelated to that chain waiting for the last task to be completed. i am spawning the monitoring trigger in.
i just need a trigger condition that if task state == Succeeded then execute activation.
I am trying to use ["addon"] call BIS_fnc_activateAddon but I cant seem to get it to work. I am calling it from a function with preInit = 1.
why are you calling this function in the first place?
I want to add a dependency to an addon without editing the mission.sqm
i.e. no placed objects or units
how it will add dependency if nothing was used from addon ?
if !(isClass(configFile >> "CfgPatches" >> "rhsusf_c_m1a2")) exitWith {systemChat "no rhs m1a2"};
@meager heart
You can acces cfgPatches with config viewer
The functions adds the CfgPatches class to the array actiivatedAddons but needs to be run before mission start
I figured preInit would do the trick but doesn't
before time is above 0, it's not a "perfect" preInit check.
maybe use older activateAddons command instead?
that's what the func uses
right
hmm
if !(isserver) exitwith {"The function can be called only on server." call bis_fnc_error; []};
if (time > 0) exitwith {"The function can be activated only during the mission init." call bis_fnc_error; []};
private ["_input","_addons"];
_input = [_this] param [0,[],[[]]];
_addons = activatedaddons;
{
private ["_addon"];
_addon = _x param [0,"",[""]];
_addon = if (isclass (configfile >> "cfgpatches" >> _addon)) then {[_addon]} else {unitaddons _addon};
{
if !(_x in _addons) then {_addons set [count _addons,_x];};
} foreach _addon;
} foreach _input;
activateaddons _addons;
_addons
here it is
I am looking at it atm too
So preInit = 1 doesn't guarentee that if (time > 0) will be true?
@peak plover dependency != cfgpatches check
np
question
is there away to say,disable ejecting with scripts π
aka like delete the action from the menu
no
if you lock a vehicle can it still be ejected from?
nope
Yes
wait what?
wait, nvm. I had the AI Dissembark in mind
and name it omae_wa_mou_shindeiru.sqf π
π
okay so u know how u can spawn dogs right?
wat if im bored af, and I wana attach the mx rifle to the dog....for science
can u attach a rifle to a dog? like ik u can attach objects to objects but ....idk i figured weapons would be diffrent
attach weapon holder maybe
okai
also
so im looking at the createUnit function on the wiki
_unit = group player createUnit ["B_RangeMaster_F", position player, [], 0, "FORM"];
``` this is one fo the examples
the thing is when I use it in zeus on a server in on
i makes N times range masters,where N is the number of ppl on the server
any ideas why?
lemme guess, you run that in init.sqf or initPlayer.sqf ?
probably some mega addon for zeus
Is it possible to stop the sound produced by the say3D command?
while(true) in scheduled space doesn't survive mission changes right?
@umbral oyster https://community.bistudio.com/wiki/say3D says everything you need to know.
@zenith edge What do you mean by mission changes? The condition of the while is evaluated on each cycle. Consider that values stored in private variables are not updated, unless you do that in its body. (if meant this)
i mean if you are hosting a mission on a dedicated server. you launch some code in scheduled enviroment, with a while loop without any exit logic at all. and then you change the mission without restarting the server
does that while true loop survive
or does the engine end it for you
@zenith edge If that was running in a schedule of a mission (almost anything scripted*) it goes away with mission namespace. * There are few scripted things that aren't nullified on mission restart/stop, such as onEachFrame and any EH that is attached to a such displays as RscDisplayMain
and the engine will free memory on scope loss and isn't just removing the pointer?
for variables?
so we dont have to manually null them?
@zenith edge Not sure about how engine handles that, but schedule is "dying" for sure. You might ask #arma3_scenario about how mission schedule reacts to exactly restarting it.
@unborn ether Ρ Π·Π½Π°Ρ ΠΊΠ°ΠΊ ΠΎΠ½Π° ΡΠ°Π±ΠΎΡΠ°Π΅Ρ, Ρ ΡΠΏΡΠ°ΡΠΈΠ²Π°Ρ Π΅ΡΡΡ Π»ΠΈ ΡΠΏΠΎΡΠΎΠ±Ρ ΠΎΡΡΠ°Π½ΠΎΠ²ΠΈΡΡ Π·Π²ΡΠΊ Π²ΠΎ Π²ΡΠ΅ΠΌΡ Π²ΠΎΡΠΏΡΠΎΠΈΠ·Π²Π΅Π΄Π΅Π½ΠΈΡ, Π½Π°ΠΌΠ°Π½Π΅Ρ ΠΊΠ½ΠΎΠΏΠΊΠΈ ΡΡΠΎΠΏ.
Oh
Sorry
@unborn ether I know how it works, I'm asking if there are ways to stop the sound during playback, a like a stop button.
@umbral oyster ΠΠ²ΡΠΊ ΠΌΠΎΠΆΠ΅Ρ ΠΎΡΡΠ°Π½ΠΎΠ²ΠΈΡΡΡ ΡΠΎΠ»ΡΠΊΠΎ Ρ ΠΎΡΡΡΡΠ²ΠΈΠ΅ΠΌ ΡΠ΅ΡΡΡΡΠ° Π·Π²ΡΠΊΠ° ΠΈΠ»ΠΈ Π΅Π³ΠΎ ΡΠΌΠ΅ΡΡΡΡ. ΠΡΠ»ΠΈ ΡΡ Ρ
ΠΎΡΠ΅ΡΡ ΡΠ³Π»ΡΠ±ΠΈΡΡΡΡ Π² ΡΡΡ ΡΠ΅ΠΌΡ, ΠΌΠΎΠΆΠ΅ΡΡ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡ createSoundSource, ΡΡΠΎ ΠΏΠΎ ΡΠ°ΠΊΡΡ ΠΈ ΠΏΡΠΎΠΈΡΡ
ΠΎΠ΄ΠΈΡ. ΠΠ°ΠΊ ΠΎΠΏΠΈΡΠ°Π» Π² ΠΊΠΎΠΌΠΌΠ΅Π½ΡΠ°ΡΠΈΠΈ Killzone Kid, ΠΌΠΎΠΆΠ½ΠΎ Π²ΡΡΡΠ½ΠΈΡΡ, ΡΡΠΎ ΡΠΎΠ·Π΄Π°Π΅ΡΡΡ ΡΠΏΠ΅ΡΠΈΠ°Π»ΡΠ½ΡΠΉ ΡΠΈΠ·ΠΈΡΠ΅ΡΠΊΠΈΠΉ ΡΠ΅ΡΡΡΡ, ΠΊΠΎΡΠΎΡΡΠΉ ΠΌΠΎΠΆΠ½ΠΎ ΠΏΠΎ ΡΠ°ΠΊΡΡ ΡΠ΄Π°Π»ΠΈΡΡ, Π½ΠΎ ΡΡΠΎ Π΄ΠΎΠ²ΠΎΠ»ΡΠ½ΠΎ Π½Π΅ΡΠ΄ΠΎΠ±Π½Π°Ρ ΡΡ
Π΅ΠΌΠ° Π΄Π»Ρ ΠΌΠ°Π½Π°Π³Π°
ΠΠΎΠ½ΡΠ», ΡΠΏΠ°ΡΠΈΠ±ΠΎ, ΡΠ΅Ρ Π½Π΅ Π²ΠΈΠ΄Π΅Π» ΡΠ°Π½ΡΡΠ΅ ΡΡΠΎΠΉ ΠΊΠΎΠΌΠ°Π½Π΄Ρ
@umbral oyster And yeah, we should talk only EN here. Rules.
@unborn ether sure)
Could you guys help me out a bit? I would like to have the player's current animation class name displayed in the systemchat.
I'm trying to get a crosshair to display when you run with weapon up (not tactical pace though). I did add "showWeaponAim=1" but it does not seem to work for some reason.
I suspect I might have edited the wrong animations
you can try this _current_anim = animationState player;
@thorn saffron You can use AnimStateChanged EVH, it does trigger for any animation changes, including animation sequences.
Never mind, I did edit the correct animations, its just the fact the crosshair does not appear for some reason
I do have it enabled and it does work for the tactical pace
I'm trying to get a crosshair to display when you run with weapon up
https://community.bistudio.com/wiki/weaponLowered
@thorn saffron
class CfgMovesMaleSdr: CfgMovesBasic
{
class States
{
class AmovPknlMstpSrasWrflDnon;
class AidlPknlMstpSrasWpstDnon_G0S;
class AmovPercMrunSlowWlnrDf;
class AmovPercMstpSrasWrflDnon;
class AmovPercMstpSrasWpstDnon;
class AmovPknlMrunSrasWrflDf: AmovPknlMstpSrasWrflDnon
{
showWeaponAim=1;
};
class AmovPknlMrunSrasWpstDf: AidlPknlMstpSrasWpstDnon_G0S
{
showWeaponAim=1;
};
class AmovPknlMrunSrasWlnrDf: AmovPercMrunSlowWlnrDf
{
showWeaponAim=1;
};
class AmovPercMrunSrasWrflDf: AmovPercMstpSrasWrflDnon
{
showWeaponAim=1;
};
class AmovPercMrunSrasWpstDf: AmovPercMstpSrasWpstDnon
{
showWeaponAim=1;
};
class AmovPercMrunSrasWlnrDf: AmovPercMrunSlowWlnrDf
{
showWeaponAim=1;
};
};
};```
I did edit the correct animations but arma seems to do stuff with the crosshairs, I guess I'll just live with that.
And yeah I did check ingame using "_current_anim = animationState player"
As a fun note: the weapon in arma does not actually aim at the center of the screen, its a bit off. I tried out a simple crosshair in the screen center (using reshade) and the arma crosshair was always off. My guess is when I enabled the crosshair for the running animation it actually points somewhere off the side, where the weapon is actually pointing. Although I should see the crosshair for the pistol at least.
Is it possible to spawn a partly damaged building? I tried setting hitpoint damage to a normal editor placed house, but I only managed to break the windows.
Hiding/unhiding damage selections on a simpleObject building also didn't do anything. The normal terrain object of the same house can be broken with the editor module.
@thorn saffron Eh, yes crosshair is relative to gun sights. Nice thing for VR experience tbh.
@unborn ether I found the reason, its the "disableWeapons" setting, but if I enable it then the first shot is somewhere off to the side, before the character can bring the weapon up. The crosshair does appear in the center though.
bullets are literally fired from the barrel. youβll notice this using forceWeaponFire with weapon on back
from usti hlavne in direction of konec hlavne... memory points
Oh yeah, got the crosshair working properly!
usti hlavne is my favorite hlavne
is it possible to detect if a task is completed in a triggers condition?
thank you
i tried doing this but im not getting a hint message when i complete the task
_Trg_detectMissionComplete = createTrigger ["EmptyDetector", getMarkerPos _spawnmarker];
_Trg_detectMissionComplete setTriggerStatements ["(taskCompleted " + _taskid + ") ","hint 'worked';", ""];
_Trg_detectMissionComplete setTriggerTimeout [20, 20, 20, True];
how do you create a task?
using the eden editor
which property is _taskid?
think module var is not that, there is a taskId attribute on create task module
double check that
I don't know what type of tasks that module creates, but it should be simple task for taskCompleted. You can double check like this - if your task is on list of simpleTasks then you can use taskCompleted.
If not, there is something in that Intel module that is different than simple tasks.
@exotic tinsel oh, just found out this page -> https://community.bistudio.com/wiki/Arma_3_Task_Framework
Basically you should use then BIS_fnc_taskCompleted
rgr, ill test it out. sorry got pulled away. thanks mate for info
ok so i changed the task varrible name to be "task_1" and thats what im passing. but im gettinga n error on the trigger condition.
_Trg_detectMissionComplete setTriggerStatements ["BIS_fnc_taskCompleted " + _task + "; ","hint 'worked';", ""];
["task_1"] call BIS_fnc_taskCompleted should be your condition
BIS_fnc_taskCompleted is a function, not a command, hence the parameter array.
is this correct syntax? _Trg_detectMissionComplete setTriggerStatements ["['" + _task + "'] call BIS_fnc_taskCompleted ","hint 'worked';", ""];
format["[%1] call BIS_fnc_taskCompleted",_task] (I generally like using format for readability)
You need to go go check if the actual task name is correct, it might not be the same as the module variable name if you used that
if youre doing these things by script anyway, might as well create these tasks via script.
It's better he uses tasks framework, takes care of MP locality issues.
createSimpleTask is local effect only
Im creating the task in eden using the createtask module, the taskid is set to βtest_1β the variable field is blank.
In the createtask module i put in the init, β["test_1", 'marker_0', 'true', 1] call TLS_fnc_missionspawnfunc;β
When the composition spawns in i want my function βTLS_fnc_missionspawnfuncβ to create a trigger to wait for the task to be completed. Im not getting errors using the below code, but its also not giving me a hint.
_Trg_detectMissionComplete = createTrigger ["EmptyDetector", getMarkerPos _spawnmarker];
_Trg_detectMissionComplete setTriggerStatements [format["[%1] call BIS_fnc_taskCompleted",_task],"hint 'worked';", ""];
_Trg_detectMissionComplete setTriggerTimeout [20, 20, 20, True];
you made it a lot more complicated than it should be
- create a task as above, ditch this
["test_1", 'marker_0', 'true', 1] call TLS_fnc_missionspawnfunc;
Don't you already have a trigger that toggles the module that sets the task to complete?
- create a trigger and in condition use
["task_1"] call BIS_fnc_taskCompletedas condition. Puthint "it works!";in on activation
also, that's a good question, when does your task complete?
yes its important to know, i cant modify the compositions task logic chain. i can onlyy add my function call somewhere that detects when the compostions task is complete so i can despawn it.
this is the last peice of a larger setup, i get this figured out im done.
I sense missing quotes in this _Trg_detectMissionComplete setTriggerStatements [format["[%1] call BIS_fnc_taskCompleted",_task],"hint 'worked';", ""];
this will format it as [task_1] call BIS_fnc_taskCompleted while it should be ["task_1"] call BIS_fnc_taskCompleted
try putting str around
testing now
good point
also consider using something that is not a trigger, simple spawn with waitUntil and sleep will do as well
no error, but also no hint
your syntax is wrong for setTriggerStatements @exotic tinsel
here is the updated code
_Trg_detectMissionComplete setTriggerStatements ["['task_1'] call BIS_fnc_taskCompleted","hint 'worked';", ""];
_Trg_detectMissionComplete setTriggerStatements ["['test_1'] call BIS_fnc_taskCompleted", "'Task completed' remoteExec ['hintSilent']", ""];
scratch that last post
_Trg_detectMissionComplete setTriggerStatements ["['+ _task +'] call BIS_fnc_taskCompleted","hint 'worked';", ""];
hintSilent - typo
fixed
@fossil yew do i need to change my hint to hintsilent?
will this work?
_Trg_detectMissionComplete setTriggerStatements ["['+ _task +'] call BIS_fnc_taskCompleted","'hello' remoteExec ['hint']; ", ""];
no task id
its in the var _task
you have + _task +
can you please format code @exotic tinsel as this is hard to read, use code formatting for Discord
isnt that how i put a var in a string?
```sqf
your code
```
rgr will do @fossil yew
_Trg_detectMissionComplete setTriggerStatements [
"
['+ _task +'] call BIS_fnc_taskCompleted
",
"
'hello' remoteExec ['hint'];
",
""];
what your task id ? task_1 ?
test_1 passed in via function params
and you have + _task +
i dont know how to refrence a var in a string
thought that worked for me in the past, please advise
your task id string will be "test_1" or 'test_1' if its inside " "
Im creating the task in eden using the createtask module, the taskid is set to βtest_1β the variable field is blank.
that is your task id
its my understanding that when placing strings inside (setTriggerStatments) string, that i have to use single quotes for other string.
" 'string_1' "
do you have showScriptErrors param ?
yes
and no errors ?