#arma3_scripting
1 messages ยท Page 584 of 1
Of course there's 'move' as a script command T_T
:p
Though I had a lot of things tied to specific waypoints... mostly radio chatter, but still. Hrn...
Would this be run as an SQF, Init, or triggered event?
Ugh... I'm going to have to offload so many things into external files, aren't I T_T
Double ugh, that's the only proper way to do anything more complex than dropping units on the map and killing them, isn't it T_T T_T
if you only need one waypoint after another, just use waypoints
if you want to do complex things and setCurrentWaypoint (which you should not need for simple waypoints), ditch them and go scripting
I'm pretty new to SQF. Can someone check me?
c = "a" select 0; is equivalent of char c = 'a'; am I right?
It's not like I'm making them do anything complex, but it is enough simple parts that complexity is just a byproduct. Thanks, Lou, I'll see what I can do.
c = "a" select 0; is equivalent of char c = 'a'; am I right?
uh.. yes and no?
c = "a" select 0
is equal to
Hello I'm a syntax error
I need the char value. I want to fill an array with characters. If I use apply { "a" }; it gives me an arrays of strings.
Alternative Syntax 3
Syntax:
string select [start, length]
there is no "character" type - only String
So _arr = _arr apply { "a" select 0 }; is what I'm currently trying
Would I actually have to use a hardcoded ASCII value?
no. Stop. What do you want to do.
I want to fill an array with characters
private _myArray = ["mycharacters"];
```boom, done
Right. That would solve the issue for let's say a length of 10. What If it should be 20, 100 or even 1000?
It 'works' if I use a hardcoded value, but that's just dirty.
so you mostly don't want an array, you want a big string
an (ugly) way to do so would be:
private _array = [];
_array resize 1000; // your string length
private _finalString = (_array apply { "a" }) joinString "";
it might be the faster/cleaner way actually
Hmm. Let me test this
That appears to be doing what I need. Still weird that SQF has no concept of characters. Considering a string really is an array of characters.
yes, but not really needed at this level
_myStr = "a";
diag_log toArray _myStr;
[97]
It doesn't have a representation for it. But it's there.
it does have a representation for it - it's a number
see https://community.bistudio.com/wiki/toArray
It can, just not outside of an array. Which is good enough ๐
Yay, my text editor uses " marks that .sqf doesn't recognize after I just bashed out 30 lines of new code and a backup save to nuke ๐ ๐ ๐คข ๐
โฆwha'?
Do not code in a ten year old OpenOffice window, then copy-paste into Notepad to save as an SQF
why would you do that
Because I hate myself
why don't you use your mouse and on screen keyboard while you're at it?
or better yet speech to text
30 lines isn't necessarily that much though. I'd recommend vscode/notepad++ for sqf
Just installed Notepad ++
And it isn't, but it's half fresh-written, half copy-pasted from triggers I had in the mission already
So it throwing a fit over the quote marks not being exactly 6 pixels tall is the highlight of my day
It's " instead of "
Which I'm really hoping came across or I'mma look like a madman
Wait, no
easy, Ctrl+H
(also, switch to LibreOffice)
anyway, Notepad++ or Visual Studio Code should be way better
Thanks again, Lou; got the last one.
And we use LibreOffice at work and it just makes my soul bleed.
Mostly because people have been poking at it for years and nothing works right anymore, but I digress
Okay, two dozen restarts later, script stopped throwing up errors, things seem to be running... now to see if the pilot still dicks me over :x
xD So close. At least he didn't fly off.
Okay, so far so good, but 'move' brings him to a hover above my desired point, and
waitUntil {(Taru distance GetMarkerPos "TaruWP1") < 200};
didn't seem to parse
@manic sigil what do you want i to do, land?
I want it to reach that point in steady flight, then have it land at the LZ a little distance away - I was going with an AddWaypoint once it was within 200m of the move command's target, but it appears to have quietly died.
private _wp1pos = getMarkerPos "TaruWP1";
waitUntil { heli distance _wp1pos < 200 };
heli land "land";
ffs I swear I searched for 'land' as a simple command t_t
I swear I'm not this new to scripting!
Though correct me if I'm wrong, but wouldn't that script just make the pilot land at TaruWP1? My goal is a nearby LZ, a bit too far for the AI to search for the invisible helipad. Is it possible to interrupt a Move with another Move?
Hi again.
Trying to do a multiline html text control (aka: textarea).
ctrlSetStructuredText parseText "<a href='http://arma3.com'>A3</a>" generates a wonderful link...but sadly ctrlText flattens the text.
Is there any way to get the control text in his original "html" format?
looks like this carrying/dragging injured AI by AI topic is not done? I'm currently looking for a solution where one AI carries or drags another one to a player controlled helicopter, both AI then GETIN the heli
you could try to script it yourself, because I don't believe it exists yet
I'm not even able to get them into a injured animation I''m afraid: sqf injured switchMove "Acts_LyingWounded_loop"; injured2 switchMove "Acts_SittingWounded_loop";
looks like this carrying/dragging injured AI by AI topic is not done? I'm currently looking for a solution where one AI carries or drags another one to a player controlled helicopter, both AI then GETIN the heli
@round scroll I wish I knew more, would make a great stanalone mod
Coop could be very useful...
and cool
I know your scripting for AI but nonetheless
bis coding to the help: sqf [injured, "PRONE_INJURED", "NONE"] call BIS_fnc_ambientAnim; [injured2, "PRONE_INJURED_U1", "NONE"] call BIS_fnc_ambientAnim;
I'll ask another way: how to append HTML to ctrlSetStructuredText ?
+?
...example? cause i have being dealing with parseText for half an hour...
_oldTxt = ctrlText _control;
_control ctrlSetStructuredText parseText format ["<a href='http://arma3.com'>A3</a><br/>%1<br/>%2", _oldTxt, _newTxt];
doesnt work (it flattens html)
private _structuredText = "<a href='blah'>blah</a>";
_ctrl ctrlSetStructuredText _structuredText;
_ctrl ctrlSetStructuredText formatText ["%1%2", _structuredText, _html];
``` _perhaps_
it seems there is no ctrlStructuredText to get it, maybe you can do something with ctrlText
Though correct me if I'm wrong, but wouldn't that script just make the pilot land at TaruWP1? My goal is a nearby LZ, a bit too far for the AI to search for the invisible helipad. Is it possible to interrupt a Move with another Move?
@manic sigil he would land near taruWP1 yes.
yes you can override a move with another move
Yeah, working that out now... though it's less than ideal, get a real AI landing flare going T_T I don't want to much with unitCapture but it may be necessary for muh realisms
depends on the level of precision you want
you can do a waitUntil heli close to taruwp1, then heli move getpos helipad, then land
@winter rose that doesn't seem to work neither.
_oldTxt = ctrlText _control;
_control ctrlSetStructuredText formatText ["%1<br/><a href='http://arma3.com'>%2</a>", _oldTxt, _newTxt];
doesnt parseHTML
_oldTxt = ctrlText _control;
_control ctrlSetStructuredText parseText ["%1<br/><a href='http://arma3.com'>%2</a>", _oldTxt, _newTxt];
parses new as html, but old is flattened
(```sqf , see pinned message)
then I don't know if there is a way to get structured text from a control.
best bet: keep it somewhere like setVariable it on the control @mighty vector
do u mean store data in html/raw, append there, and then parseText for control...well, it could work. ill give a try.
ctrlText returns a string, not structured text
so yep, use alternative storing
@winter rose thanks. it woarks. I will use that for a while ๐
noice!
Getting closer... only one error away from the first leg of the mission being scripted in a single .sqf ๐ฎ
At least, the pilot side of it
And no guarantees it's repeatable, and it's not a smooth entry in the slightest :/
the issue beingโฆ?
AI flying habits ๐
Tale as old as time, the autohover-ultrasafe-soccermomwithextrakids approach in what's supposed to be a tense combat drop
That, and the final part of my script didn't fire o.0 No errors, but the expected sideChat/move order didn't trigger.
autohover-ultrasafe-soccermomwithextrakids
@manic sigil LOL
Hrm...
private _Passengers = fullCrew [Taru,"Cargo",false];
waitUntil {count _Passengers == 0};
Doesn't seem to trip, even when _passangers hits 0.
Oh come on XD
First i can't code in Arma, now I can't even markup in Discord
There wego
... nvm, I'm getting there slowly.
It's not updating, is it. It's just getting a number then sitting on it.
yep
That got it :3
So that was what... 4 hours to replace the first leg of my mission? ๐
waitUntil { sleep 1; count fullCrew [Taru, "Cargo", false] == 0 };
4 hours to replace the first leg of my mission?
it's an investment ;-p
i have found that sometimes the player object (civ_3 forExample) is returned objNull, even if a player is using that slot. why is this happening?
hmm
@distant wave when?
well i just test the player in the debug console using isNull civ_3;
and returns true
try civ_3 == player?
it's another player from the server, not my player which works fine
then maybe civ_3 is not defined on your machine
it might be a locality issue, idk.
you could try
hint str allPlayers;
```to get a preview of all named units
okay.. in the allPlayers array the object seems that's there, but if i do this in the debug
private _obj = civ_3;
_obj
running as local or server it returns <NULL-OBJECT>
yeah, and did you see civ_3 in allPlayers?
yep. but if i check isNull civ_3 it returns true..
now that's weird. where is civ_3 defined?
eden editor variable?
yep
searching in the BIS wiki found in here https://community.bistudio.com/wiki/isPlayer this In some cases, the identity of certain player units might fail to propagate to other clients and the server, which causes isPlayer and getPlayerUID to incorrectly return false and "", respectively, where the affected units are not local.[1] Therefore, beware of false negatives.
so probably this is the problem
but the next question is how to prevent this ๐
^ that's what I never figured, the "some cases"
isPlayer and getPlayerUID to incorrectly return false and ""
You're having it return true tho
ping me if you find out so I can document it
What does getPlayerUID return
yep, even if that slot is used by a player
Interesting
i tried doing cursorTarget looking at the civ_3 player with local exec and it returns this C Alpha 1-3:1 (oski689) REMOTE (civ_3) on that player which has this problem, but if i do this cursorTarget on a working fine players it returns their slot like eg. civ_5
maybe because i got a zeus module in the mission for the loggedInAdmin?
how do I check who is in control of the UAV? because UAVControl does not seens to work on dedicated server
I cant understand, setMarkerPos is global (EG) command, inside loop in script that executed on server, when I use this command its not working, but if I use remoteExec with parameter 2 it is, why?
Hi everyone, I come here as a last resort, and hoping someone can steer me right on this. Probably dead easy in the right hands. I want to preserve an addAction on a heli asset in my MP mission. Trouble is, when the asset respawns (using the MP respawn module from the editor) the addAction disappears. My best guess is that the respawning process renames the asset, so my action assigned to "heli1" does not exist any more bc "heli1" is replaced with "heli1_1". This is just a guess. Anyway, what I was hoping for is some advice on how one would go about keeping an addAction assigned to a respawnable asset like a heli in MP.
Would I need to look at a script-based option, and find a way to retain the asset name (e.g. heli1), so the addAction always has a home. Or, would I ditch the reliance on a named asset and us the init field of the asset and/or the vehicle respawn module (so that the code fires on respawn)?
Any advice on how best to do this would be super appreciated
you need to add the action every time the vehicle respawns, because it is technically a new object.
It'
It's basically the last thing you said - put the code in the respawn module. ๐
I mean if you want to keep the init you can just spawn the vehicle by script and then repeat the script once the vehicle is dead
so the variable name is the same and the init is the same
right right .. thank you guys .. I have been thinking about the latter option, but was unsure how to manage a homebrew resapwn script that didn't kill my performance lol, so I guess I was leaning towards a vehicleRespawnModule solution.
@night frigate thank you for the link, checking now
as always, thank you all for your help ๐
_Ratio=0.3; //At _a=0.2, with 30 players, 6 AI allowed/player....At _a=0.3, with 30 players, 3 AI allowed/player.
_Max=12;
while {! CTI_GameOver} do {
_nbp={isPlayer _x} count playableUnits;
_next=0 max ceil(_Max-(_Ratio*_nbp));
if !(missionNamespace getVariable "CTI_PLAYERS_GROUPSIZE" == _next ) then {
missionNamespace setVariable ["CTI_PLAYERS_GROUPSIZE",_next] ;
HUD_NOTIFICATIONS pushBack [format ["Group size is now : %1 ",_next],time+10,"ffffff"];
};
sleep 60;
};
Im trying to change this script to do a check for PlayerNumber instead. Im essentially trying to make a script that will give the side with less players more AI while also balancing according to server player count
https://community.bistudio.com/wiki/playersNumber
anyone have any suggestions?
could you name your variables properly please? I get _nbp is number of players, but _a and _bโฆ please ^^
_a = ratio,
_b = max?
What makes {isPlayer _x} count playableUnits; different from count allPlayers ?
Arma 2 script I suppose?
yes it came from arma 2 CTI
pushBack is also A3, and its in there
he is updating it
well it came from arma 2 and was updated for a3
You want to find players per side.
west countSide allPlayers
east countSide allPlayers
or```sqf
count playersNumber west;
countSide would include anything in the mission, right - not just player/playable slots?
allPlayers would restrict that to players
anyway, I guess you could do playersNumber east and playersNumber west, compare those, find the difference, and then add AI to the side with fewer players (don't forget to disable AI or it'll count the playable bots) based on your ratio.
(unless you want to count the playable bots, that is, I guess ๐ )
there are no playable bots, or at last not ones that take up mission side slots
_west = playersNumber west;
_east = playersNumber east;
_countplayersbyside =
so yes I need to compare the number then once the 2 numbers are compared i need to have a ratio that is in favor of the side with less, and then gives that side more AI
this is normally done using
player setVariable ["CTI_PLAYER_GROUPSIZE", CTI_PLAYERS_GROUPSIZE, true];
to set the groupsize via a single value
so i need to find a way to split it based on side
so when i assign the new value it does it properly per side
I'm not sure what CTI is doing with that variable elsewhere
well it has a table where its got a numbers going from 0-16, and 99.
when on of those numbers is selected it goes down a different path. at 0 it uses a upgrade system based off that sides upgrades. on the other settings its just a hard number
i added 99 so it would use this script
so on 99 it activates this sqf
OK. Do you need it to modify this variable?
how do I create a ratio with the 2 numbers.
umm i dont quite understand. I need to switch it so player setVariable ["CTI_PLAYER_GROUPSIZE", CTI_PLAYERS_GROUPSIZE, true]; will take player side into account. but that is a later problem
and, so I understand... if one side has 10 players, and the other has 12, you want to add AI - like actually spawn AI into one of the players' groups - based on a factor calculated off the difference of 2 players?
yes, but the ai does not spawn, it just changes a value of how many AI that player can buy/ho;d
so how do i take 10 west and 12 east, turn that into a ratio that spits out 2 numbers
ahhh, OK.
that i can then apply per side
So if there are 10 on east and 12 on west, you want east to be able to recruit (e.g.) 20 AI, and west only to be able to recruit 14 AI?
yes
private _westNumber = count playersNumber west;
private _eastNumber = count playersNumber east;
private _max = _westNumber max _eastNumber;
private _westAllowed = _max - _westNumber;
private _eastAllowed = _max - _eastNumber;
waitโฆ I don't get anything about it.
heheh. That's why I was asking q's. ๐
What is the max number of units you want on either side?
(player plus AI)?
so like west has 12 players, east has 6
I need to take those 2 numbers, have a function compare that and be like west has 50% more players then east so give each east player +5 AI per extra player or %50 more AI
or
I obviously dont want it so if one side has 13 and other side had 13 and then loses one and then has 12 that that side does not get a immediate boost of like 10 AI
i need it to understand if there is a gap
and how wide that gap is
and then give a boost to the side losing players
OK, then I think what Lou gave you above would work, just take _westAllowed and _eastAllowed and multiply by the number of AI you want per missing player on the side with fewer players
and if someone connects again? kill the AI?
because its assigned per player right, so if i just set a value of +10 to side with 1 less player, then potentially one side could have 10 players each getting 10 extra AI each.
plan is to have it have a long enough sleep cycle
that its hard to game
ohhhhhhhh.... I see the issue then, it's per player. I was missing that.
I'm out of here ๐
sorry lol
but if its on a ratio, its harder for the players to game it
because they would have to quit in a large number and rejoin to try to pull a advantage. or have it adjust on a +2 per side or something.
OK... so that number exists for each player already. You could do something like...
_recruitsPerPlayer = <whatever that is for CTI>;
_eastPlayers = playersNumber east;
_westPlayers = playersNumber west;
if ( _eastPlayers != _westPlayers ) then
{
if ( _eastPlayers > _westPlayers ) then
{
_westPlayerRecruitModifier = 1 max (floor ( ( _eastPlayers - _westPlayers ) / _westPlayers ) );
<multiply the recruit number for west players by _westPlayerRecruitModifier>
}
else
{
<do the opposite of above>
};
};
or something..... ๐
ok that helps thanks ill go tinker for a bit and come back when i made it down the road a bit
well the number does not exist if its using this script, this script would have to create a base number then adjust that value for each player per side based on the player count difference :S
so like
OK - so you'll have to set the number initially for however many AI you want each player to be able to recruit. Then this will bump that number for players on one side based on the ratio of the team balance. The way I have the formula, it will require one team to be double the size of the other before any boost even occurs.
but then every player would be able to recruit double the number of units. You will need to massage the formula based on what you're actually going for
if ( CTI_PLAYERS_GROUPSIZE isEqualTo 0) then {
player setVariable ["CTI_PLAYER_GROUPSIZE", _upgrade_barracks_ai, true];
} else {
player setVariable ["CTI_PLAYER_GROUPSIZE", CTI_PLAYERS_GROUPSIZE, true];
class CTI_PLAYERS_GROUPSIZE {
title = "AI: Player Group Size";
values[] = {0,1,2,3,4,5,8,10,12,14,16,99};
texts[] = {"Barracks","1","2","3","4","5","8","10","12","14","16","Autobalance"};
default = 99;
so normally it would use that to find its groupsizes
ah, this is a parameter at mission start?
it would either take the 0 value and then run its script checking against that teams "upgrades"
or it would use a raw number. or 99 which is "autobalance" that i just made
yes
and it adjusts during the game in the upgrade system
and the old version of this script i am upgrading
was dynamic on a 60 second sleep and would just take total numbers of players on the server
and use that to adjust how much AI the players got regardless of side
and was primarily used for performance. so IE if you had 5 players on the server total they would each get like 10 AI and if there where 30 players it would cut you down to like 3-5
OK, so you'd just have to determine what you want it to start at if the autobalance option is selected.
yeah
then i need it to count players, compare find ratio, adjust via the ratio take that adjusted numbers for each side and give that to the players
so 10 west 5 east
50%
_adjustedeast=east _X AI per player
Side player setVariable [CTI_PLAYER_GROUPSIZE= _adjustedeast]
OK, so change the formula to something like this:
_westPlayerRecruitModifier = _eastPlayers / _westPlayers;
<get current player group size>;
<multiply current group size by _westPlayerRecruitModifier >>> floor this calc to get a whole number>;
<set player group size variable to new value>;
sorta like that? logic wise i mean
so if current group size is 3, and players is 10 and 5, that's a factor of 2 for east. change variable for everyone on east to 3 x 2 = 6
if group size is currently 6, let's say, and there are 10 east and 8 west. 10/8 = 1.25. 1.25 x 6 = 7.5. floor 7.5 is 7. set the new group size for west to 7.
Or you could ceiling the number to give the lower player count side extra AI. In that case, you'd set the variable for west to 8. That would be a max of 60 east and a max of 64 west (players plus AI)
(thinking about it, that's probably better to use ceiling rather than floor, otherwise one team has fewer players and not enough AI to make up the difference)
yeah that makes sense
Is there any way to check turret path of a pylon?
I suspect magazinesAllTurrets will do the thing, but how do I know a magazine is a slung under a pylon?
SideChat is local, but if I remoteExec an .sqf with sideChat in it, does it become 'global', or do I still need to remoteExec ["sideChat"] in the sqf?
it doesn't become global
but it will be executed where you remoteExec it to
if you remoteExec it to everyone, it will locally execute globally
And the headhurting begins t_t
if your whole sqf already executes everywhere, the sideChat inside it will also execute everywhere.
So you don't need to remoteExec the sideChat specifically again
Okay, that was more clear - and what I suspected. Thank you :)
on the injured rescue mission, I came up with some crude script to have a medic 'load' three injured into a helo (ok, teleport): https://tetet.de/arma/arma3/Download/unsung/missions/injuredRescue.RungSat.7z
Is it possible to have vehicles with different dynamic loadouts in the CfgWLRequisitionPresets?
Is there any EH or something that triggers when unit reports an enemy? I want to get the moment squadmembers report the enemy, but I do not want to run a really agressive loop that checks their knowledge every second.
Is there a way to add x,y,z values to like "position player"?
@safe pilot https://community.bistudio.com/wiki/set
how do i set a trigger to be false once its been activated
@safe pilot
// get position of player with +10 on X, Y and Z
_position = [(position player select 0) + 10, (position player select 1) + 10, (position player select 2) + 10];
@safe pilot vectorAdd command will also do.
Yuhh!! thank y'all!!!
Does setting triggers to be server side make them not work in singleplayer?
Like enabling the server only option
@eager pier Okie, thank you!
Hello! I try to transfer Ownerships of all groups from the Server to the Headless Client (4) using following script, but it just doen't work. Any clues?
_array = []
{
if ((groupOwner _x) == 2) then
_array pushBack _x;
}forEach _allGroups;
{_x setGroupOwner 4}
forEach _array;
@signal kite missing then { }
also, missing ; after []
1/ this is not javascript
2/ use "show script errors" in Arma launcher ๐
Anyone had an issue with vehicles created with createVehicle not moving? Im spawning 4 vehicles with createVehicle and adding crew, the waypoints aren't added until the vehicle is full. If I assign a WP in zeus they work fine. The engines are on and I'm creating them at a spot on land instead of 0,0,0 and moving them.
Whats weird is the wayponts are there but over the course of 10 seconds they complete despite the vehicle never moving and the first WP being 6km away minimum
Its almost like the waypoints are created too quickly for the group leader
Hi all .
I am on a mission and I would like to have a CAS module with the a164 attack aircraft. I put it in place without problem, with the support, the air strike support (bombing) but there are only two options: bomb and laser guided bomb, I would like to know how to make an option for the executions of , missile strikes, etc.
@plain raven Yes, I see this all the time. For my waypoints, it may be that the server is too busy or that the waypoint is too far away. I've gotten the impression that when a waypoint is put down and figuring out a path take too long, ARMA just gives up. If you then interactively move the waypoint, the vehicle will often wake up and get moving. By interactively moving it, you're telling ARMA to again figure out the path to the waypoint, and it can usually find the computes after a try or two.
Thanks @hazy trail, I'll run some tests where the WP is closer. Its annoyingly inconsistent
Ok so looks like it might be vehicle related in this case, other vehicles work fine although I can't see the logic in that
Is the difference tracked vehicles versus wheeled vehicles? Some vehicles, like the Ifrit will just kinda zone out if the waypoint is behind them.
nah, its happening with cars, tanks and APCs
I always have this error at the start of the scripts, and it runs 1 time in 20 and the only time it worked it didn't hit the target.
@ruby island DON'T post a wall of code. use e.g https://sqfbin.com and paste the link here.
use a default value for getVariable
what is default value?
see https://community.bistudio.com/wiki/getVariable 's alternative syntax
all the getvariable to put by defaultvalue?
to avoid an error if the variable doesn't exist on the object
Can you give me an example of default value so that I'm sure of what I'm doing?
if you are checking for !isNull, you could put objNull
I tried to replace! isNull with objNull but it doesn't work anymore.
@winter rose I do not know anything in script I do not understand well.
!isnull (player getVariable "theVarName")
// becomes
!isnull (player getVariable ["theVarName", objNull])
```@ruby island
Hi.
Considering I want to execute a function in 15 minutes each time a certain unit is killed....
would it be considered "good practive" to use BIS_fnc_loop itemAdd/itemExecute and executeOnce=true, or it is better to use spawn+sleep+call?
I would sayโฆ your call ๐
the simplest, the bestest
either use BIS_fnc_loop, one item, executeOnce = false (because you want the same code to repeat)
I would go for manual scripting, but that's my usual way of doing things
@winter rose It says in the description of the script "Added a slope for gun run. Better accuracy.", What does that mean?
no idea.
Does anyone know how to use the transfer switch? I found this page: https://forums.bohemia.net/forums/topic/228187-how-to-use-the-switch/ , but it doesn't seem to work for switching it on.
@safe pilot All the animation sources: "Power_1", "Power_2", "switchLight", and "switchPosition" worked for me using animateSource.
transferSwitch animateSource ["switchPosition",1];
https://community.bistudio.com/wiki/animateSource
If anyone knows how to use the 30mm gun of the a164 from the supports; air strike support (bombing), I am a taker.
thanking you in advance .
@winter rose regarding my problem with isPlayer == false, which we spoke about it yesterday, seems like i found a thing that fixes that problem.. i saw when onPlayerKilled/onPlayerRespawned EVH gets triggered it fixes isPlayer problem, maybe it's a clue
Do y'all remember the scripting functions and syntax?
Or do y'all always have the wiki open?
I'm trying to make my workflow more efficient and I just find myself always referring to the wiki for syntax on functions I use all the time.
I always have the biki open on my second screen while scripting, although most functions I know without looking (took a few years though)
And I have my P drive with the A3 pbo's extracted to read into the functions themselves in case I want to know how it works internally
@distant wave maybe respawn of that player fix this problem?
That parameter makes any unit respawn on start. If that case dont broke anything when player connect to your server - that can be a possible solution
What's the most performance friendly way to continually loop a script with a delay in between?
Spawn with while-true and sleep is kinda okay, typically it's more about the actual calculation than the housekeeping logic
And unless you want to calculate something really heavy you shouldn't bother
So what's that you want to calculate and how often?
I'm trying to learn how to use the BIS_fnc_taskCreate and tried to reverse engineer the samples
I made this
[player,"_task1" ,["task","task",""], getPos h1 ,-1,-1,true,"task"] call BIS_fnc_taskCreate;
which works
but then tried to use
"_task1" setTaskState "Succeeded";
and it doesn't seem to work
am I doing something wrong? I though the _task1 was the taskID
You're mixing up strings, variables and actual task variables
Task framework (BIS_fnc_ stuff) operates tasks by string identifies
Task scripting commands operate with actual task variables (of Task type)
Basically BIS_fnc_ stuff is designed to avoid using task scripting commands and use BIS_fnc_ functions instead
What you want to do:
["_task1", "SUCCEEDED"] call BIS_fnc_taskSetState;
Having that _ in "_task1" doesn't mean anything, its not local variable, its just a string and can be anything
oh yeah I just added it to distinguish it from the other "task" names I used as dummy
I think I understand what you're saying
I guess setTaskState would have only worked with createSimpleTask
Yes, exactly.
BIS_fnc_ task framework does all these commands inside it but just hides it from you, its a functions wrapper for these scripting commands.
is it me or the only advantage they have over modules are the capability to have custom icons?
and I think they are slightly faster
Not sure what module does (probably uses BIS_fnc_ stuff too) but everything comes down to what scripting commands are capable of.
How can I make an unit rotate with an animationg instead of an instant transition?
maybe LookAt?
ok it works
is there any good way to simulate keyword arguments?
thus far I'm setting variables on the object I'm working with, but that seems kind of ugly
How do I spawn a shell so triggerAmmo would blow it?
createVehicle
ammo = createVehicle ["Sh_120mm_HE", [14182.1,16298.2,50], [], 0, "None"];
triggerAmmo ammo;
didn't work when running through debug console; a shell spawns and hangs in air
First stop using ammo to contain the munition; it's reserved command
^
I need help :c
Okay
It is just a piece of script i used here. The real var name was ugly so I "prettied" it
Can i send the photo to someone?
@loud python what the heck are you trying to accomplish, "simulate keyword arguments" ๐
if you need help with your face, no
if you need help with your code, paste in https://sqfbin.com and post the link here ๐
I'm interested with your selfie
about the game xD
a photo of what
v = createVehicle ["Sh_120mm_HE", [14182.1,16298.2,50], [], 0, "None"];
triggerAmmo v;
no difference
@deft flax if this is not scripting, post in #arma3_troubleshooting
Keyword arguments as in [this, health=100, stamina=20, foo="bar"] call ME_fnc_someStuff; (obviously pseudocode)
Does anyone have 3den ehnaced 3.9.7 version?
Sh_120mm_HE is not something to use triggerAmmo
@loud python make classes in Description.ext and read/apply them with a missionConfigFile-reading function
Others such M_Mo_120mm_AT does work
Then it says A3_Data_F_Sams_loadorder
@deft flax this has nothing to do with scripting. Go #arma3_troubleshooting and delete your message here
At what context
Ok
Sh_120mm_HE is not something to use triggerAmmo
And what - is?
-?
Docs say: "shells, bullets, missiles, rockets and bombs"
I honestly don't know what exactly is the requirements of it, just that doesn't work
lol, i'll try other kinds of ammo
@loud python you cannot do something likesqf // Keyword arguments as in [this, health=100, stamina=20, foo="bar"] call ME_fnc_someStuff; unless e.g you write your own string parser, you would then write```sqf
[this, "health=100, stamina=20, foo='bar'"] call ME_fnc_someStuff;
that sounds more complicated than my current solution ๐คท
right now I'm just doing this setVariable ["health", 100]; ... ; [this] call ME_fnc_someStuff;
So, tried different stuff. Seems triggerAmmo works only for smart ammo, like guided missiles.
It kinda works only for like that, maybe I need to write more โspecificallyโ requirements to do it
@loud python don't forget to prefix your variables with a tag
If you're passing a lot of arguments you can create some throwaway entity like Location, no prefixes will be ever needed too.
prefiiix ๐ ๐
no need for prefixes; you can just choose very descriptive variable names like a or b or spd
/s
No need for prefixes if everyone else uses them ๐
personally, I'm somewhat of a variable socialist
if everyone uses the variables responsibly and there's enough dialogue between devs, there should be no collisions
okay, enough sarcastic complaining about bad scripting practices, back to debugging stuff
[
"key", "value",
"key2", 1000,
"key3", objNull
] call somefunc;
somefunc = {
_value = _this select ((_this find "key") + 1);
};
You can try stuff like this
Plenty of limitations though, strings for values should never have key names in them
Additional checks in case key is not preset (check if find is >= 0 before select)
[
["key", "value"] // solves it
]
I was thinking of something like [this, ["key", "value], ["key2", 1000]] call ...;, but that seems hard to extract
The less arrays the better
it's an init, it's a one time thing
I mean, functions that need that many arguments are probably not called often, so performance is less relavant there
in the end you'd probably just use this for stuff to initialize objects every now and then
My guess was that your goal was configuration convenience
mostly, yes
well, it's really about not having one config-entry per gas station on altis life ๐
If you're doing this from Init fields, either store actual data in some other file or in config
I'm going through my .rpt and trying to eliminate as many errors as I can. Knowing that there are hundreds that are also generic in nature...
I see this
Missing 'description.ext::Header
should I woory about it?
and I saw this posted somewhere
class Header
{
gameType = Survive;
minPlayers = 1;
maxPlayers = 100;
};
if this corrects the error entry, where do I put this?..
I'm gusing in the description.ext
๐ I know but still hard to grasp,....I'll try
๐ TkU
I am trying to limit the distance to activate an addAction but it doenst work
questd2 addAction ["somerandomtextinhere", "quest\mario\askm.sqf", "questd2 distance player<2.0"];
Read BIKI, that's not how to set custom conditions
addAction's 8th argument (which I start from 0) is the condition
Use radius
^ I forgot about this
good morning
are nearRoads and BIS_fnc_nearestRoad functions supposed to be working correctly on dedicated server?
I am to much of a bread, however, can i remove one specific action?
You can โentity removeAction idโ
you mean like that questd2 removeAction 1; ?
Maybe, id has to be the id of the action you want to remove
There is actionIds and actionParams too, just look up Biki
I have tried askmd2 = questd2 addAction ["morerandomtext", "quest\mario\askm.sqf"]; and questd2 removeAction "askmd2 "; but that doesnt work
No why in โโ?
tried with and without ""
You canโt use โโ it is an error the command expects number not string
i am confused, as i said i have tried with and without ""
(_this select 0) removeAction (_this select 2);
is _this in this case the action name or the obj it is attached to?
none of them; when you run a script file from an action, parameters are passed
see https://community.bistudio.com/wiki/addAction#Syntax
Parameters array passed to the script upon activation in _this variable is:params ["_target", "_caller", "_actionId", "_arguments"];target (_this select 0): Object - the object which the action is assigned to caller (_this select 1): Object - the unit that activated the action ID (_this select 2): Number - ID of the activated action (same as ID returned by addAction) arguments (_this select 3): Anything - arguments given to the script if you are using the extended syntax
that worked, thanks
one more question for now, i have this line
_items = items player;
if ("MCC_bakedBeans" in _items) then {
execVM "quest\mario\bsuc.sqf";
}
else {
execVM "quest\mario\bfail.sqf";
}
};
but it drops me a missing ; error
this is not a line, thats multiple lines
also yes you have a syntax error after the second execVM
argh, i`m stupid -_- thanks
Are executing sqfs from execVm a good idea for MP?
worked fine for me so far
When would someone use the server only option for triggers?
hi.
Is there an asset for groups? (ie. creating "scout_sqad" instead of creating unit by unit and joining them...)
Hi, I wonder if it is somehow possible to get the player that requested support of a support provider module? What I am trying to achieve is having artillery support modules but in order to request support the player has to pay a certain amount of CP (in Warlords) to prevent people from misusing it. I know that I can put in a cooldown but I feel like that's not enough since I want to make a powerful artillery strike and some unexperienced player or troll could just wait for the cooldown to run out and then waste the strike either my accident (in case of the unexperienced player) or on purpose to give the team a disadvantage (in case of the troll).
Hey, calculatePath has a strange behavior when it comes to helicopters, it seems that using the helicopter/plane type the path is not calculated, the agent stays in place and doesn't move. Is anyone able to reproduce the issue or am I doing something wrong?
Example code (tested on Altis):
player setPos [12900, 15500,0];
player setDir 45;
// private _type = typeOf player;
// private _type = "B_Heli_Light_01_dynamicLoadout_F";
private _type = "helicopter";
private _origin = (position player) vectorAdd [0,0,1000];
private _destination = player getRelPos [5000, 0];
(calculatePath [_type, "CARELESS", _origin, _destination]) addEventHandler ["PathCalculated",{
systemChat format ["CalculatePath | Agent: %1 (%2)", (_this#0), (typeOf (_this#0))];
}];
It's known that calculatePath is not perfect when not used for infantry or (land) vehicles, especially when there are obstructions (like water).
I haven't tested with airframes yet, although my solution would be to simply ignore it and just set a direct waypoint (since it doesn't need a more optimal route than a straight line through the air).
For airframes it only would make sense if a min/max flight height could be set, or no-fly zones.
Yeah I don't use it on airframe but I was curious, might be worth adding a note on the wiki then.
Does anyone know if ctrlAddEventHandler are working?? I wrote this and its not working
_boton = _ui displayCtrl 16022220;
_boton ctrlAddEventHandler [ "onButtonUp", {
pressed = false;
}];
- Make sure
_botonexists - You have to get rid of "on" from
onButtonUp
Also 16022220 is a big number, Arma is precise only for 1-6 digits number, more it's not garuenteed (in script that is, dunno about configs or engine itself)
@warm hedge @cunning crown New code, not working:
_boton = _ui displayCtrl 16022;
_boton ctrlAddEventHandler [ "ButtonUp", {
pressed = false;
}];
Make sure you read this page before asking questions about UI event handlers https://community.bistudio.com/wiki/User_Interface_Event_Handlers#onButtonUp
i'll dare to ask again: Is there an asset for groups? (ie. creating "scout_sqad" instead of creating unit by unit and joining them...)
F2?
with scripting; no
BIS_fnc_spawnGroup??
didn't knew about that one
paddlin' for you too :p
but does it run Crysis? ๐
does it blend?
Let's spawn a helicopterโฆ
@mighty vector did you check F2 in Eden, or BIS_fnc_spawnGroup for scripting?
just copied BIS_fnc_spawnGroup to google it xD
โฆever heard of the wikiโฆ?
what was the command to get all script commands?
output looks like:
u:goggles OBJECT
supportInfo? @vague hull
thanks alot
about time sqf lint gets a little update ^^
You are behind it? @vague hull
Well, got into scripting again lately. Figured it needs some features I am missing. Appears to be abandoned and its MIT.. so I am just gonna fork and release a new version
@winter rose works!
@vague hull thanks, and good luck ๐
gonna need it.. its setup was.. an adventure to say the least
its a freaking netbeans project..
netbeans
?
exactly
so I am just gonna fork and release a new version
That would be awesome ๐
I've definitely not got my script pants on, this should be simple and straight forward but my brain doesnt seem to be able to logic this one out atm.
This script is intended to keep the driver of a boat alive as the players race up a river while the banks are lined with opfor, I would like to use ace heal (we use ace basic medical (latest)) so it gives the feel of "driver passed out, panic, driver woke up, panic, drive away"
Currently is not throwing any errors but it is also not healing the driver in a multiplayer environment
My immediate thinkings is either incorrect ace module or incorrect usage of something
// auto heal
fnc_wee_heal = {
_d = (driver (vehicle player)); //_d = boat driver
if ((damage _d)>0.1) // if driver damaged {heal driver}
then {[objNull, player] call ace_medical_fnc_treatmentAdvanced_fullHealLocal;};
};
//call auto heal, while player is driving repeat autoheal
while {(driver (vehicle player)) isEqualTo player}
do {
sleep 15;
[]spawn fnc_wee_heal;
}foreach allunits;
// execute script in boat init
/*
null = execvm "i_driver.sqf";
*/
use allowDamage
if I cant find a solution that lets the driver pass out then wake up a few seconds later, I might have to but i'd really rather not
[player, true, 5, true] call ace_medical_fnc_setUnconscious;?
does that wake em up?
is there ace function documentation anywhere? cant seem to find any
awesome will have a go, cheers ๐ค
but if you set player allowDamage to false, its seems that there will be no transition into unconscious state only from, it will set black screen instantly
You could probably use allowDamage and the "Hit" EH (if allowDamage doesn't prevent it from firing) and force conciousness states manually.
Does RemoveAction work for all clients?
I don't know
it doesn't
Sorry not addaction, but removeaction
it doesn't remove it for everyone
just for the one who used the action
In the script that the action runs I do _action_object RemoveAction _action_id;
Havent used that before so I cant help with that sorry
okay thanks
class Altis : CAWorld
{
cutscenes[] = {"TF461JungleOverwatch"}; // Class names of used scenes. When more than one is present, the system will pick one randomly.
};
class Stratis : CAWorld
{
cutscenes[] = {"TF461JungleOverwatch"}; // Class names of used scenes. When more than one is present, the system will pick one randomly.
};
class Tanoa : CAWorld
{
cutscenes[] = {"TF461JungleOverwatch"}; // Class names of used scenes. When more than one is present, the system will pick one randomly.
};
class Malden : CAWorld
{
cutscenes[] = {"TF461JungleOverwatch"}; // Class names of used scenes. When more than one is present, the system will pick one randomly.
};
class Enoch : CAWorld
{
cutscenes[] = {"TF461JungleOverwatch"}; // Class names of used scenes. When more than one is present, the system will pick one randomly.
};
class VR : CAWorld
{
cutscenes[] = {"TF461JungleOverwatch"}; // Class names of used scenes. When more than one is present, the system will pick one randomly.
};
class Livonia : CAWorld
{
cutscenes[] = {"TF461JungleOverwatch"}; // Class names of used scenes. When more than one is present, the system will pick one randomly.
};
can anyone tell me why Livonia , stratis and what ever enoch is , are the only ones that run my cutscene... the rest have there default cutscenes and are not overwritten
Check what you actually get in the config through config browser
Probably issue with addon hierarchy
requiredAddons
I did , thats how i know that those are the only maps that worked as their cutscenes are replaced
btw Enoch is Livonia.
hmm never thought of that tho
Make sure to have addons that define these worlds in your addon's requiredAddons
thought so , so do i remove enoch or livonia
So it loads after them and properly overwrites
I'll try that once my new PC parts arive , my Motherboard died this morning
also, not #arma3_scripting and crossposting @gilded rover ๐ ๐ ๐
I appologise
adding another name to the paddlin' list
is there something like "setConvoySeparation" ? i would love the convoy vehicles being closer
I remember something but can't remember if it was a dream...
Definitely ๐ don't code while drunk tired
btw, @winter rose a trigger to check "no emenies at zone X" is it really checking every frame?
...is there any way to know when a population has been captured in event-like format?
triggers are checked every 0.5s iirc?
ie: i dont want to loop&check, nad i can trigger on certain guy dead, but perhaps using "locations" or something i havent explred yet
...u arent serious...
"killed" event is not a function executed when someone is killed, but internally checked each 0.5???????
no, triggers are checked every .5s, events are checked every frame or something similar I guess
events are checked every frame or something similar I guess
events are never checked
see https://community.bistudio.com/wiki/setTriggerInterval
Event handlers != triggers
thats what makes them events
sorry, my bad
Oh no yeah, not checked but idk how to phrase it xD
i explained incorrectly
triggered
they trigger when it happens, that's it
(if they, ill jump from roof right now)
that's the definition of an Event Handler
there is no "position taken/conquered" in the default game state
not an engine one, maybe a scripted one (and what misison/gamemode are you talking about?)
if you mean in a specific game mode, then perhaps
im making a mission, i know i could set a trigger (but that, if using internal loop+check) seems unefficient
i was looking for a way to fire an event, and the best way i cant think by now is killed on a certain guy within the hood
as i havent played with "cities" on editor, didnt know if there was something like "CapturedEvent"
Captured means nothing, in unscripted Arma
you could use/set a Location, and determine there are no enemies in it
and that would be "checking each x seconds", right?
hi, i'm trying to make triggers, with : Systems> Module> Effects> close air combat (CAS) ModuleCAS_F.for the plane to attack when i use the JTAC laser; but I can not .
@mighty vector you could, yes
as the major issue im having with arma is the "heavy usage of cpu", i would prefer to use a less consumming approach.
probably some "take" event would also make sense in the mission context
i'll let you know
event handler "take"โฆ seriously?
for capture?
if you have to do something, do it - optimise later
if you are afraid of a side check for units in a location every second, your mission is already broken and has other issues
Hello (I aplogise if this does not go here), I'm finialising a sqf script used on a vechile I created. The final thing I would like to do is when the vechile hits the ground (or goes below 0 meters or something) I want it to freeze where it hit rather than skid or bounce up. I've tried a few things now but my sqf knowledge is limited so wondering if anyone has any suggestions.
waitUntil { getPos _vehicle select 2 < 0.01 || isTouchingGround _vehicle };
_vehicle enableSimulation false;
not that I know of
Oh then that's good way
Physics would still affect it
From the sound of it, vehicle in question might be some sort of drop pod
Which is supposed to hit ground and stay there
Haha, thanks for info, I had something similar but in a bit of the wrong order so I'll try your suggestion.
And yeah, kinda like a drop pod.
Arma ground just is not especially friendly for such as its unyielding
does it matter if I use.....
if ((toLower _class) in _myweaponblacklist) exitWith {};
or...
โฆnot?
the suspense is killing me
no difference, except that you would store a variable in the latter
if it were a while, storing a var prevents toLower recalculation every loop; since an if is a one-time, you can go the former way
also note that there is toLowerANSI, which I believe is safe for classnames
4 of the 5 blacklists are good but the ammo throws an error
which way is most efficient (like I know what I'm asking,...a liitle bit)
those were givento me by Rydygier
so knwing hiim, there has to be a perfect reason
maybe not?
I'm just trying to follow in giant footsteps
๐
if ((toLower _class) in _myweaponblacklist) exitWith {};
Line 4926: if ((toLower _class) in _myammoblacklist) exitWith {};
Line 4976: if (_lowClass in _myvehblacklist) exitWith {};
Line 5134: if ((toLower (configName _class)) in _mygroupblacklist) exitWith {};
Line 5325: if ((toLower (configName _class)) in _myFactionBlackList) exitWith {};
and the ammo throws the error
time to sparamint
@sage flume and the error isโฆ?
also, if _class is a string, configName _class sure throws an error!
{
_class = _ammoClass select _i;
if ((toLower _class) in _myammoblacklist) exi>
15:44:07 Error position: <toLower _class) in _myammoblacklist) exi>
15:44:07 Error tolower: Type Config entry, expected String
there what .rpt says
nounnerstan
well you cannot toLower a config entry
as it says
Error tolower: Type Config entry, expected String
you gave a config entry to toLower
but
doesn't even take a config entry
strange thing though, I've used this in a few other ports, and it works
Sp
not COOP
maybe an issue there??
I don't see how toLower could be impacted by that
I've used this in a few other ports, and it works
No you didn't
anyone know a way to force AI to collide with enviroment?
โฆ?```sqf
player setPosATL (getPosATL player vectorAdd [0,0,0.1]);
player setVelocity [0,500,0];
๐
Agents collide more, according to a wiki comment
sadly tried that. still runs through a wall likes its nothing when telling them to do an animation
animations (mostly) don't care about collision iirc
^
weird thing is if it an AI it doesn't care if it the player the collisions work fine... Looks like it's back to having to write a whole AI movement system. Le sigh.
having some trouble, this command works in singleplayer and Dedicated perfectly fine, but on Local Host, the Text appears for a split second and then disappears again for everyone:
[4, ["wave","PLAIN"]] remoteExec ["cutRsc",0,true];
_disp = uiNamespace getVariable ["wave",DisplayNull];
_ctrl = _disp displayCtrl 19;
_text = format["%1", waveDisplay];
_ctrl ctrlSetStructuredText parseText _text;
@winter rose Why did you curse me with offloading everything into .sqf files T_T I've spent days just tweaking and modifying the first 5 minutes of my mission because I keep thinking of something else cool to add and how to fit it into a stack of scripts and deleting almost everything I put on the map to begin with
Hue hue hue, because so is my destinyโฆ and now yours, too!
You will thank him later ^^
And that's why I have a ton of small missions with small scripts I made and combine them when needed in a mission.
Each script works on it's own, so I know they always work even when combined
Yeah... but now I'm fighting my same old issues, but in exciting new detail XD
My deploying helicopter follows a unitPlay path, lands, begins offloading troops... but inevitably, begins taking off again and thus accidentally airdropping the last two+ guys.
Even with
waitUntil {count fullCrew [Taru,"Cargo",false] == 0};
Hrn... the last action for the group is an orderGetIn, and they do get in and wait... I wonder if it's pegged a waypoint at that xyz, so when the unitPlay ends, they suddenly realize 'I'm not at xyz, gotta go!'
Nope, just going to the default 50m hover :/
Damn, not even disabling the pilots simulation or "ALL" AI works :c
And I put in so much work to get that flight path looking good.
So I'm trying to set up a cargo box to spawn in with Weapons and ammo already inside them as they will be used as supply crates during events. Run up to a laptop and request a Ammo supply crate and the crate with ammo will spawn in. Im having trouble setting up the crates to spawn in with the items i want.
Code used so far:
_this = createVehicle ["UK3CB_BAF_MAN_HX60_Container_Green", [8281.296,10029.59,0], [], 0, "CAN_COLLIDE"];
_crate = _this;
clearWeaponCargoGlobal _crate;
clearMagazineCargoGlobal _crate;
clearItemCargoGlobal _crate;
clearBackpackCargoGlobal _crate;
_crate addItemCargoGlobal ["ACE_CableTie", 10];
_crate addMagazineCargoGlobal ["UK3CB_BAF_9_17Rnd", 10]; // error missing
Can get cable ties to work but any weapon or magazine wont work. Anyone help??
Tried calling in Vanilla based items as well still wont work.
I get a blank box appear in the inventory but i cant move it onto the player which suggest its registered i want said item but doesn't fully process the command.
Problem fixed.
Hello. Is there any way to duplicate units/groups? Copy&paste, but for scripts. I created and configured in editor group with some init-scripts and some loadouts, and I want it to respawn every 5 minutes but without deleting already spawned groups (dead or alive but they should remain).
@manic sigil a wonky way I get around that is to remove all the fuel from the helicopter and make the crew not able to eject
I ended up abandoning the unitPlay option :/ I'm given to understand it doesn't work well in multiplayer
_win = false;
_winnerside = West;
_loserside = East;
switch (_result) do {
case "win": {if (CTI_P_SideJoined isEqualTo _side) then {_win = true; if (CTI_P_SideJoined isEqualTo West) then {_winnerside = West;_loserside = East;} else {_winnerside = East;_loserside = West;};}};
case "loose": {if (CTI_P_SideJoined != _side) then {_win = true; if (CTI_P_SideJoined isEqualTo West) then {_winnerside = West;_loserside = East;} else {_winnerside = East;_loserside = West;};} else {if (CTI_P_SideJoined isEqualTo West) then {_winnerside = East;_loserside = West;} else {_winnerside = West;_loserside = East;};}};
};
43:1 error sqflint:error Binary operator "!=" arguments must be [(Number,Number),(String,String),(Object,Object),(Group,Group),(Side,Side),(String,String),(Config,Config),(Display
,Display),(Control,Control),(TeamMember,TeamMember),(NetObject,NetObject),(Task,Task),(Location,Location)] (lhs is Anything, rhs is Nothing)
how do i fix this error?
Use isEqualTo like every other comparison in the code. Also change loose to lose
@digital hollow thanks
I wonder what would be a way to find if object has flag proxy so forceFlagTexture can be used on it.
selectionNames?
Yep, just found it out, gotta pull all simulation = "flag" classes from CfgNonAIVehicles first though to check against
Looking for simplest object which can have flag on it
Such what? I don't think I get what โsimplest objectโ you meaning
Something that isn't a vehicle or a man
Ideally I wanted object that's nothing but flag but there is no such thing
Flagpole is huge pole that I don't need
OK so regarding my above problem, if I use 2 to target just the server it pops up and stays there, but only I can see it
@astral dawn sorry, didn't see your reply yesterday about looping scripts. The only code I want looping is calling a single function from a script. I got it working and it seems to have minimal impact as far as I can tell, but will run it through Dedmen's script profiler before going live.
In module> effects> close air support (CAS); Not in module> suppport.
How to intervene the plane after aiming with the jtac or a smoke.
hmm. this might be really basic, but how to get the first unit of a group...
units grp[0] ?
units grp select 0 ?
for making it the leader ?:
group selectLeader units group select 0 ?
@still forum a cat just died?
@mighty vector
if you check the wiki, selectLeader does not take a String.
Let me break it down for you so you understand:
private _groupUnits = units _group;
private _firstUnit = _groupUnits select 0;
_group selectLeader _firstUnit;
It isn't
Is that โStringโ just a typo?
we cannot guess, and code has to be precise
sorry
so yup, typos + string were the mistake
maybe also some parentheses needed, idk
perhaps group selectLeader [units group] select 0; ?
or even:
group selectLeader [[units group] select 0]; ?
square brackets != parenthesis 
How can I check that a given class name (e.g. B_Heli_Light_01_armed_F) is valid? Is there a general method?
e.g. isClass (configClass >> "CfgVehicles" >> "B_Heli_Light_01_armed_F")
Thanks, does CfgVehicles always contain all infantry and vehicle class names from vanilla and mods?
Yes
Awesome thanks
Anybody here familiar with CMake?
is it possible to sling load a wreck through some scripting?
@round scroll hideObject real_object + attachTo wreck_of_object of object maybe
if you mean slingload using the games built in sling load system
yes, using m1ke suggestion, but it will look nasty
the sling load assistant will show you as trying to sling the hidden object, rather than the wreck
you could (excuse the pun) lash up your own sling load system but again, it would not be a nice and integrated as the BI one
it is possible but not recommended... extremely bug
when vehicle (for example chinook) "drawn" MPkilled event not fired?
it goes underwater and switches to wreck damage is 1 but for some reason, MPkilled event not executed
guys, is there a way of getting when player is using spectator or splendidcam?
my tactical HMD (if player wears vr goggles or similar) is still on screen when using cam or spec to take screenshots/video
Are you putting them in spectator with a script?
no
im starting it from debug console
its only me who does it, or perhaps another mission dev
the HMD is only shown to players who are on foot, have the vr goggles and are in first person
so i thought, switch to 3rd before starting cam/spec
but splendidcam seems to override 3rd person.. the hmd shows even if i start spec after being in 3rd person
Hello guys !
Is there a way to count thรฉ number of red groups ?
Yeah opfor
do groups have a side?
yes, confirmed.. side group player returns west
in mission now
side doesnt return OPFOR though
at least not in the mission im in right now
opfor guys are side east
actually EAST
parenthesis only for order preference?
then why [foo] call bar ?
is there a good wiki page about arma's (, [... ?
Works, thanks @warm hedge
@mighty vector that [foo] call
is for when the function you are calling requires an array to be sent to it
can someone help me solving this: https://forums.bohemia.net/forums/topic/229044-can-ingameuiseteventhandler-be-used-to-remove-a3s-default-actions/
@finite sail so theorically I could (foo) call fn?
if foo is an array, yes
then, my last statement seems false.
"functions receive arrays" seems to be more correct, based on your statement
not really...
do functions always expect an array of params? In order to use params
usually, yes
can a function expect a single number, and hence invoke it using _mynumber call fn?
does anyone have an idea as to why this isn't showing the Rsc? shows up perfectly fine on a Dedicated Server and SP, but as soon as I do it on a local host, if flashes up briefly then disappears again. It works for me if i target the server and not everyone, and -2 to target everyone but the server doesn't work either.
[4, ["wave","PLAIN"]] remoteExec ["cutRsc",0,true];
_disp = uiNamespace getVariable ["wave",DisplayNull];
_ctrl = _disp displayCtrl 19;
_text = format["%1", waveDisplay];
_ctrl ctrlSetStructuredText parseText _text;
Which function is to move vehicle?? vehicle player moveTO [coord,coord,coord] doesnt work and doMove neither
you mean for an ai?
a vehicle drived by an ia and player as cargo @nimble cove
Its there a way to stop group leader spamming "regroup" command sin the chat ?
I tried:
enableRadio false;
enableSentences false;
showSubtitles false;
player disableConversation true;
player disableAI "RADIOPROTOCOL";
0 fadeRadio 0;
player setVariable ["BIS_noCoreConversations", true];
player setSpeaker "NoVoice";
How could I make a script so that if a player uses a drone or other vehicle with a camera, then they can take a picture and when they return to the HQ there will be a photo (leaflet) of the picture(s) taken? I am trying to get a small recon mission that must be done before performing the other task
// should work when placed in any unit
(leader group _this) disableAI "RADIOPROTOCOL";
// set on all groups in mission
{(leader group _x) disableAI "RADIOPROTOCOL"} forEach allGroups;
I am already doing disableAI "RADIOPROTOCOL" on every player in initplayerlocal. So it should work right?
unless AI are players, that doesn't work
no AI only players
regroup isn't something that players say automatically (afaik), reporting enemies yes, which can be disabled with unit setSpeaker "NoVoice", or create a custom Difficulty Preset with autoReport = false
I only play with ACE, which has a feature to disable all communication (voice and text) for players. And I never play with AI in my team, so never had the problem ;)
Looking at ACE, they created a custom voice (which is set with unit setSpeaker "ACE_NoVoice";), which doesn't have any text or sounds.
{ _x setVariable ["name", "Mercapyrgos", true] } forEach synchronizedTriggers this
Any idea what might be wrong with that? It's in an init field
the error I'm getting is
20:00:01 Error in expression <["name", "Mercapyrgos", true] } forEach synchronizedTriggers this> 20:00:01 Error position: <synchronizedTriggers this> 20:00:01 Error synchronizedtriggers: Type Object, expected Array
AAAAAH!
It took me posting it here
what is this? Because it should be a waypoint
to realize how dumb I am
never mind, I just realized that
oh well, sorry for wasting your time xD
does synchronizedObjects return triggers as well?
it should return a list of triggers
Which function is to move vehicle?? vehicle player moveTO [coord,coord,coord] doesnt work and doMove neither
@high horizon Anyone?
regarding earlier point, tried this as well as a workaround, has the same effect as the previous:
waveDisplay = "Wave: " + str (Wave);
{_id = owner _x; ["waveLayer", ["wave","PLAIN"]] remoteExec ["cutRsc",_id];} forEach allPlayers;
_disp = uiNamespace getVariable ["wave",DisplayNull];
_ctrl = _disp displayCtrl 19;
_text = format["%1", waveDisplay];
_ctrl ctrlSetStructuredText parseText _text;
remoteExec is not guaranteed to execute immediately on every machine (even locally); you maybe should use a```sqf
waitUntil { not isNull uiNamespace getVariable ["wave",DisplayNull]; };
@ornate marsh ^
should that be at the start, on encompass the entire script in it?
right after your remoteExec - call it, then wait for it to exist
gotcha
waveDisplay = "Wave: " + str (Wave);
[4, ["wave","PLAIN"]] remoteExec ["cutRsc",0,true];
waitUntil { not isNull uiNamespace getVariable ["wave",DisplayNull]; };
_disp = uiNamespace getVariable ["wave",DisplayNull];
_ctrl = _disp displayCtrl 19;
_text = format["%1", waveDisplay];
_ctrl ctrlSetStructuredText parseText _text;
like that?
like that```sqf
private _waveDisplay = format ["Wave: %1", Wave];
[4, ["wave", "PLAIN"]] remoteExec ["cutRsc", 0, true];
if (hasInterface) then
{
waitUntil { sleep 0.1; not isNull uiNamespace getVariable ["wave", displayNull]; };
};
_disp = uiNamespace "wave";
_ctrl = _disp displayCtrl 19;
_ctrl ctrlSetText _waveDisplay;
i'll test it out now
20:23:14 Error Missing ;
20:23:14 Error in expression <splayNull]; };
};
_disp = uiNamespace "wave";
_ctrl = _disp displayCtrl 19;
>
20:23:14 Error position: <"wave";
_ctrl = _disp displayCtrl 19;
>
20:23:14 Error Missing ;
20:23:14 Error in expression <splayNull]; };
ah perhaps some parenthesis```sqf
waitUntil { sleep 0.1; not isNull (uiNamespace getVariable ["wave", displayNull]); };
wait no
I need some help on scripting bcoz Iโm trying to make it look like a Marine is on patrol and theyโre clearing a house but one of them gets shot and they have to call in for extraction and drag the wounded to the landed helicopter at the extraction point. But I want three soldiers to stay back and provide covering fire for the extraction
@ornate marsh I forgot a getVariable:```sqf
private _waveDisplay = format ["Wave: %1", Wave];
[4, ["wave", "PLAIN"]] remoteExec ["cutRsc", 0, true];
if (hasInterface) then
{
waitUntil { not isNull (uiNamespace getVariable ["wave", displayNull]); };
};
private _disp = uiNamespace getVariable "wave";
private _ctrl = _disp displayCtrl 19;
_ctrl ctrlSetText _waveDisplay;
Error in expression <f (hasInterface) then
{
waitUntil { not isNull (uiNamespace getVariable ["wa>
Error position <not isNull (uiNamespace getVariable ["wa>
Error Generic error in expression
โฆwhat
that's what it says in the .rpt
where are you running the code?
well yes, you cannot waitUntil from the console - surround this with a [] spawn { };
same thing as before, flashes up for a brief second then disappears
then idk, magic
if you do ```sqf
4 cutRsc ["wave", "PLAIN"]; // instead of remoteExec
yea, the remoteExec works with -2 for me in the targets section
if you are the server, it should not
waveDisplay = "Wave: " + str (Wave);
[4, ["wave","PLAIN"]] remoteExec ["cutRsc",-2,true];
_disp = uiNamespace getVariable ["wave",DisplayNull];
_ctrl = _disp displayCtrl 19;
_text = format["%1", waveDisplay];
_ctrl ctrlSetStructuredText parseText _text;
this makes the text show up perfectly fine for me
again, if you are the player-server, it should not work
im on a localhost and local exec-ing that from the console works, so idk
doing it with 2 also works
also, wait, ther is something wrong.
I guess that the server is supposed to be the one using remoteExec, right?
that script will be in an sqf
that will be called byโฆ?
execVM
by? server, client?
localexec from my debug console
you will use the debug console during the mission?
yea, i execute the scripts from there. I only execute the wave changing scripts and spawn Ai. I'm gonna make them into modules soon
what you are doing here is:
remoteExecute "show the display" to everyone
and only locally change your text, others will not have the change.
but if im local executing a execVM from the debug console with that script, it should work, right? or is it because those local variable don't happen on each clients machine?
I don't know what else to say:
- you remote exec "show the display" to everyone
- you edit the display only on your side
if do an execVM from the console, the file will only execute on the server, so those variables in the sqf (the code you did) only changes for the server (me), correct?
if you do an execVM from the console by pressing LOCAL EXEC, it will run on your computer, not on the server.
so again, yes, it will run the following steps from your computer:
- execute "show the display" on every computer
- modify the text on this computer only
so how would i go about modifying the text for everyone? make the variables public?
or could i just global exec it with the remoteExec removed?
but would that then break other sqf files that should only run on the server
because some of the sqf files which that code is in will break if global executed
nope, UI data should never be public
you should remoteExec code or script that does all the thing
I think I know where you were confused; your remoteExec tells all the computers to create a "wave" display yes, but each computer creates its own one - it is not creating i.e a "multiplayer object" that is the same to everyone (and you expected that editing it once would spread the change)
you could for example do a "displayWave.sqf" file and use```sqf
[wave, "displayWave.sqf"] remoteExec ["execVM"]; // not great, but next step is using CfgFunctions
and in displayWave.sqf:
```sqf
params ["_waveNumber"];
4 cutRsc ["wave","PLAIN"];
private _disp = uiNamespace getVariable ["wave", displayNull];
private _ctrl = _disp displayCtrl 19;
_ctrl ctrlSetText format ["Wave: %1", _waveNumber];
this way, you would manage all the display locally.
seems to work with just me, i'll try it with another player
I suppose wave is the wave number, correct?
yea
@ornate marsh works?
Can't test currently, will ping later with results
anyone got file for Remove radiation zone screen effects
Sounds like a question for the exile discord
Okay, trying to wrap my head around scheduled environments. Would this be valid, assuming I'm not cramming a whole mission's worth into each block/appropriate use of uiSleep?
Task1 = spawn {waitUntil (thingIWantDone)}
Task2 = spawn {waitUntil (otherThingIWantDone)}
waitUntil {scriptDone Task1 && scriptDone Task2}
the concept is correct, though obviously what you have written there would return syntax errors at multiple points.
Yeah, not written to be executable, just legible ๐
Okay, that beats me running if-then after if-then when I have multiple objectives.
could somebody please confirm or deny this hypothesis (regarding object locality) for me?
imagine a dedicated server with two connected players; ply1 is in a car's driver seat, and at some point they dismount - ply2 then gets in the car's driver seat.
when ply2 gets in, the car's locality is transferred from ply1 over to ply2, however (this is where I'm unsure) - is there an intermediate step where the car is briefly local to the server?
(note: I'm specifically asking this in regards to the Local EH, which supposedly only triggers on the "old" and the "new" owner of an object during locality change (in my example this would be ply1 and ply2), which makes it sounds like the EH wouldn't trigger on the server (which is what I'm after))
...perhaps @still forum? ๐
@half inlet , last time I checked this, the car remains local to ply1 for some time, perhaps indefinitely , until ply2 gets in the drivers seat
is there a better way to add a 0 in front of a single digit? Something with format maybe? sqf private _hourStr = (str(_hours) splitString ".") select 0; if (_hours <10) then { _hourStr="0"+_hourStr; };
@round scroll
private _hourStr = "0" + str floor _hours;
_hourStr = _hourStr select [count _hourStr - 2, 2];
thanks
Hello, folks! Can i track the radar lock status?
hola hola, does anyone know how to disable ambient player staggering/stretching etc (mean just those ambient animations). I need him to stay straight and dont move.
Guys I'm a Python/C# coder. Does anyone have a link or suggestion for the most up to date video tutorials or easy to read documentation other than API reference for the scripting language in Arma 3?
I want to learn how to script for my missions but I dont know where to start.
thats the script command reference, most of guys i know learn from simple examples they find in workshop/elsewhere
and of course, this channel is here to help.
So, it would be handy to learn PBO unpacking first
i use mikero tools, integrated into the winwows explorer, but it is always a quest for me after every os change
and who help me lol? ๐
@lucid junco no one ๐
Doubt disableAI will work for it
some noted some interferences, such as some disableAI would prevent a player to leave a vehicle so perhaps
nope. doesnt work ๐
My very best guess is to use AnimChanged EH
Does anyone know if it is possible to create a camera in a delimited screen position?
yes.
https://community.bistudio.com/wiki/BIS_fnc_cinemaBorder interesting thing is that even with this command player doesnt stop to perform those moves. I would expect they would do it with this
this function only shows cinema borders, nothing else ^^
Me: Ha, I'm so clever, if I run my tasks in spawned blocks, I can have multiple waitUntils running!
Also me: running all those tasks in separate .sqfs already.
@half inlet
IIRC the car stays local to the original driver until either the owner is changed through commands or a new person gets into the drivers seat.
this function only shows cinema borders, nothing else ^^
@winter rose Do you know which function would be appropriate?
I was talking about what prababicka said
๐
as for you, you would need to create a control, and use Picture-in-Picture on it if you want a "partial" camera
(if I understood correctly @high horizon)
@winter rose Yes, just that, that the camera you created is seen in a control, Picture-in-picture is RscPicture?
I don't know UI I am afraid
according to https://community.bistudio.com/wiki/setPiPEffect , yes @high horizon
See Example 3
Hey, guys, and what about the radar info? Can one get anything like the current target?
yes and no @calm bloom - there is https://community.bistudio.com/wiki/cursorTarget , but it also works on non-locked target
cursorTarget also returns locked target for the duration of the lock even if there is another target under the cursor.
thanks! i have used cusrorobject all the time and didnt even know it has that behavior)
you would have to check if the radar is locked on something though
according to https://community.bistudio.com/wiki/setPiPEffect , yes @high horizon
@winter rose Thx man!!
Well, i am making the automatic SACLOS tracking for SA-19 and starstreak, so it probably wouldnt need radar check very much
ill just need to borrow some lockcamerato ideas from rhs folks)
with all credit of course
Hi.
I know this is not the more efficient way, but I'm having issues setting up a convoy, and wondering if Im doing something wrong. (A few mods loaded)
veh1 = "LIB_SdKfz124" createVehicle ([1731,50,0]);
_grp = createVehicleCrew veh1;
veh2 = "LIB_OpelBlitz_Tent_Y_Camo" createVehicle ([1731,40,0]);
_grp = createVehicleCrew veh2;
veh3 = "LIB_OpelBlitz_Fuel" createVehicle ([1731,30,0]);
_grp = createVehicleCrew veh3;
veh4 = "LIB_OpelBlitz_Ammo" createVehicle ([1731,20,0]);
_grp = createVehicleCrew veh4;
veh5 = "LIB_OpelBlitz_Ambulance" createVehicle ([1731,10,0]);
_grp = createVehicleCrew veh5;
veh6 = "LIB_SdKfz251" createVehicle ([1731,0,0]);
_grp = createVehicleCrew veh6;
grp = createGroup west;
[veh1, veh2, veh3, veh4, veh5, veh6] joinSilent grp;
grp selectLeader (units grp select 0);
systemChat str(units grp);
What I expect:
B Charlie 1-6:1, B Charlie 1-6:2...B Charlie 1-6:6 created with first veh. being leader and THAT'S CORRECT
BUT, it additionally it creates Bravo 2-5 and Bravo 1-5 groups. (?)
https://paste.pics/87e90fc61102b812a98e238dc663688c
Any ideas?
On the other hand, when using:
grp = [[1731,50,0], WEST, ["LIB_SdKfz124", "LIB_OpelBlitz_Tent_Y_Camo", "LIB_OpelBlitz_Fuel", "LIB_OpelBlitz_Ammo", "LIB_OpelBlitz_Ambulance", "LIB_SdKfz251"],[[0,0,0],[0,-10,0],[0,-20,0],[0,-30,0],[0,-40,0],[0,-50,0]]] call BIS_fnc_spawnGroup;
grp setFormation "FILE";
grp selectLeader (units grp select 0);
the first vehicle of the convoy is not the LIB_SdKfz124, but the 2nd, then the 3rd and so on...until the LIB_SdKfz124 (the first in the array)
Anybody here know how to script the destroyers cruise missiles?
as in, just have them fire at some object
You need to place a VLS on it and then it should auto target enemies and fire
Hey does anyone know what I'd need to do to make it so I can remove an addaction right after it has been interacted with. Currently I have it in a trigger so that it adds the addaction when the players are nearby. I've been trying to use the removeAction in deactivation section but it doesn't seem to be working.
OnActivation: _myID = mcn1 addaction ["Speak with Sgt. Mcnemera", {mcn1 say3D ["mcn1", 1000, 1];}];
OnDeactivation: player removeAction _myID;```
the variables are local
not 100% sure, but _myID should be nil in the deactivation handler
you can just use thisTrigger setVariable ["actionID", ...] instead though
Hello again, do you know a way to create an array but that has certain values in the name? For example, the array must be _array (+ nameplayer) (+ life_cash) = [];
no
well, yes, but still no
the array doesn't have a name
it's stored in a variable
how? @loud python
how what?
as I said, you can't really do it
setVariable and getVariable accept strings, so you could use format to actually create a string on the fly
but that would just make your code hard to read
I assume you really want something like an associative array, which isn't a thing in arma
hmmm...
why can't I spawn a laserTargetW object?
or rather, why does it instantly despawn?
I assume you really want something like an associative array, which isn't a thing in arma
@loud python kind of
@loud python a kind of dictionary it "kind of" exists
also, there are "database" functions out there
https://community.bistudio.com/wiki/Category:Function_Group:_Database
We are generating random waypoints in a town for a group to clear area using SAD waypoint type. The group leader is spamming "2 observe that position", "3 observe that position", "4 observe that position" over and over. Is this expected?!
no
Given a crate like C_IDAP_supplyCrate_F, is there a way to remove the Inventory action, while keeping actions added via addAction? I know that removeAction only works on user added actions. I tried making it a simple object, but that disables all actions.
not possible
unless maybe you destroy it and immediately disable its simulation, big perhaps
๐ I'll look into modding a non-storage version of it. Disable sim doesn't remove either from what I can tell.
you should be able to create a new config with the model and textures, but without the variables which make it a supply box
Think a dumb solution, do addAction to the player and put any codes to filter if cursorTarget is the crate to the condition of the action
๐ I'll look into modding a non-storage version of it. Disable sim doesn't remove either from what I can tell.
@austere sentinel I use the PLP containers mod, has a bunch of non cargo storage objects. I wanted to do the same thing you wanted to do, but couldn't script it so used that mod
you should be able to create a new config with the model and textures, but without the variables which make it a supply box
This is the plan. Gotta look into what to subclass.
@warm hedge Thats not a bad idea, but it'll probably be a bit less performant than I'd want.
@ornate marsh I'll look into that, if it's been done then I don't wanna reinvent the wheel, thanks!
@austere sentinel the following config should do the job already (just requires a custom mod to implement it):
class CfgVehicles {
class ThingX;
class TAG_IDAP_supplyCrate_F: ThingX {
class SimpleObject {
eden = 1;
animate[] = {};
hide[] = {};
verticalOffset = 0.892;
verticalOffsetWorld = 0;
init = "''";
};
editorPreview = "\A3\EditorPreviews_F_Orange\Data\CfgVehicles\C_IDAP_supplyCrate_F.jpg";
scope = 2;
scopeCurator = 2;
displayName = "IDAP Supply Crate (no inv)";
model = "\A3\Weapons_F\Ammoboxes\Supplydrop.p3d";
hiddenSelections[] = {"camo"};
hiddenSelectionsTextures[] = {"\a3\Supplies_F_Orange\Ammoboxes\Data\supplydrop_idap_co.paa"};
slingLoadCargoMemoryPoints[] = {"SlingLoadCargo1","SlingLoadCargo2","SlingLoadCargo3","SlingLoadCargo4"};
};
};
could be that I've missed some stuff from inheritance, but it shouldn't have an inventory
Damn you're quick. Thanks, I'll give that a shot.
@exotic flax Worked flawlessly. You sir are a gentleman and a scholar.
you're welcome, always happy to help ๐
private _source = param [0];
private _target = "LaserTargetW" createVehicle (position param [1]);
target = _target; // For debugging only
_p = position _source;
private _missile = "ammo_Missile_Cruise_01" createVehicle [_p select 0, _p select 1, (_p select 2) + 1];
_missile setVectorDirAndUp [[0, 0, 1], [1, 0, 0]];
missile = _missile; // For debugging only
_target setVehicleTIPars [1,1,1]; // Maybe the laser target has TI parts?
(side _missile) reportRemoteTarget [_target, 3600]; // Maybe the missile doesn't know about the target?
_missile setMissileTarget _target;
Any idea why this doesn't work?
as in, does nothing
tells me to f### off, essentially
tried it step by step in the debug console and setMissileTarget returns false
with what do you call this?
with thisTrigger and synchronizedObjects thisTrigger select 0 (which is a game logic object off in the distance)
it happens in the trigger activation field
the missile spawns and just flies up
I've tried it with a missile shot from the actual "turret" and the designator target of a remote designator and it does work
so setMissileTarget can, in theory at least, be used that way
setMissileTargetPos is a thing, too
so
[trigger, triggeringUnit] call theScript;
reportRemoteTarget is useless, an ammo doesn't have a side
yes, that was just a hopeless attempt to get the game to do what I want xD
setMissileTargetPos also did nothing though ๐คท
ยฏ_(ใ)_/ยฏ
may I post my gigantic question again?
I just confirmed it again
missile setMissileTargetPos (getPosATL target) returns nothing and has no visible effect
well I guess arma 3 just hates me
https://community.bistudio.com/wiki/setMissileTarget
Doesn't work for all types of missiles.
If target is dead, target is ignored.
The target has to be inside configured missile targeting cone for command to work.
@loud python
yes
I've read that, which is why I initially tried it out with 1. the same missile type and 2. the same target type
but the missile shot from an actual turret, using the "fired" event handler to save the missile into a global variable and getting the laser target directly from a remote designator
that actually worked quite well
confirmed it again
forcing the turret to shoot makes the missile go straight up
then run missile setMissileTarget laserTarget harry in the console (harry is the remote designator ;D) and the missile instantly curves right and hits the laser target
and if I spawn the missile with createVehicle, the exact same code returns false instead and nothing happens
is the ammo type correct?
typeOf missile returns "ammo_Missile_Cruise_01" for the one the turret fires and that's the one I use in the createVehicle command
I can only assume that the missile is somehoe magically linked to either the unit that fired it or the side or something
ammo_Missile_Cruise_01 only takes a target by Data Link
all I can say is that setMissileTarget works ๐คท
does the missile share any datalink information with the unit that shot it?
vehicleReceiveRemoteTargets missile returns false for the missile where setMissileTarget works
simplified your debug script```sqf
private _target = "LaserTargetW" createVehicle (player modelToWorld [0,0,300]);
private _missile = "ammo_Missile_Cruise_01" createVehicle (player modelToWorld [0,0,10]);
_missile setVectorDirAndUp [[0, 0, 1], [1, 0, 0]];
[_missile, _target] spawn {
params ["_missile", "_target"];
sleep 0.1;
(side _missile) reportRemoteTarget [_target, 60];
sleep 0.1;
_missile setMissileTarget _target;
};
thanks ๐
hmmmmm... interesting...
Killing the "gunner" in the turret and forcing it to fire another missile makes it stop working
so the missile is somehow linked with the unit that shot it (and its side, I guess)
Is it possible to customize the loadout of dynamic loadout vehicles in the mission config so that if they are called in by any player they automatically come with the changed loadout?
Yeah, missile scripts are something weird thing I've ever did in Arma
@vague geode dynamic loadoutsโฆ respawn gear is configurable, yes?
@loud python works with "M_Scalpel_AT" and "Missile_AGM_01_F" yes
I'm currently trying to use modelToWorld to spawn objects inside of buildings around my map, can anyone tell me how I can get the position inside of the building from where the player is standing?
@winter rose Not sure what you mean. I would just like to change the default loadout of the Black Wasp II so that if anyone calls in a Black Wasp II in my Warlords mission it automatically comes with the changes to its loadout...
@winter rose Thanks,
Hello, excuse me for disturbing you, I am currently working on a mod that will replace the main menu of Arma 3 for my server. I created a "Play" button, I would like with an "onbuttonclick" that the game connects itself to a server, I found the STS mod that will allow me to do this but it only seems to work via a server, do any one, know what I can use inside of a "onbuttonclick" to do it ? Thanks
||Excuse me for my bad English||
@woven flame I can't help a lot, but you could take a look at http://killzonekid.com/farewell-my-arma-friends/
IT WORKS! Well, kind of, for now
but it still needs the actual missile launcher to work
have to missile setShotParents [turret, gunner turret] after spawning it; then it will know about the laser target
ah, not bad! didn't think of that.
maybe you only need a unit of said side @loud python
0.0001 is to many digits?
No
Thank you @winter rose I'll try asap ๐
I had hoped that, but no
tried with [player, player] instead, but since I'm not a "vehicle", it didn't work
what's the best thing I could use as a dummy for that though?
a missile pad at [0,0,1000] ? ๐
a drone could do, I suppose
gonna try spawning a "B_Ship_MRLS_01_F (kim)" and disable AI and make it invisible ๐
YESSSSS
private _source = param [0];
private _target = "LaserTargetW" createVehicle (position param [1]);
_p = position _source;
private _missile = "ammo_Missile_Cruise_01" createVehicle [_p select 0, _p select 1, (_p select 2) + 1];
_missile setVectorDirAndUp [[0, 0, 1], [1, 0, 0]];
blufor reportRemoteTarget [_target, 3600];
private _launcher = ("B_Ship_MRLS_01_F" createVehicle position _source);
createVehicleCrew _launcher;
{ _x disableAI "ALL" } forEach crew _launcher;
hideObjectGlobal _launcher;
_missile setShotParents [ _launcher, gunner _launcher ];
_missile setMissileTarget _target;
this works
a bit of extra magic, like a delay before setting the target so the missile rises a bit further (looks more cinematic ;D) and disallowing damage on the launcher and the script is pretty much ready to be used now โค๏ธ
Hiya lad, I was wondering if you could help me. This is my first post here so sorry if this has already been covered. I am running the current script;
_talkers = [talker1,talker2,talker3,talker4,talker5,talker6,talker7,talker8];
_seltalker = _talkers call BIS_fnc_selectRandom;
while {{alive _x} count _talkers > 0} do {
_voicelist = [
"china1",
"china2",
"china3",
"china4",
"china5",
"china6",
"china7",
"china8"
];
_voice = _voicelist call BIS_fnc_selectRandom;
[_seltalker, _voice] remoteExec ["say3D"];
sleep 5;
_seltalker = _talkers call BIS_fnc_selectRandom;
sleep random 20;
};
However, I am also using a ragdoll mod that prevents AI units from dying instantly and instead they set into an unconscious type state. I was wondering if there was a way that I could stop the script running per individual 'talker' if there health falls below a certain % such as 0.3?
Any help would be greatly appreciated; apologies again, I'm new to all this.
```sqf
// code here
```
@sage sluice
write it like that and the code gets highlighted like this
// code here
So just to be clear // like this
guess not aha
// ``
ah gotcha
sorry
// _talkers = [talker1,talker2,talker3,talker4,talker5,talker6,talker7,talker8];
_seltalker = _talkers call BIS_fnc_selectRandom;
while {{alive _x} count _talkers > 0} do {
_voicelist = [
"china1",
"china2",
"china3",
"china4",
"china5",
"china6",
"china7",
"china8"
];
_voice = _voicelist call BIS_fnc_selectRandom;
[_seltalker, _voice] remoteExec ["say3D"];
sleep 5;
_seltalker = _talkers call BIS_fnc_selectRandom;
sleep random 20;
};
hello guys ! I've a question about the createDiaryRecord : i can't find the utility of the second parameter : subject. I cant see what object i can or cannot put there and what it does once i'm in game !
in the examples it shows "diary"
when you use creatdiarysubject, you provide subject
then all creatediaryrecords with the same subject are shown together
is there a way to mod the Old Man mission?
Can I just extract the pbo files and then repack them after modding, or will that have a problem with file validation?
That will have a problem with file validation yes
because exactly that is what file validation should prevent, you just modifying stuff
but as its singleplayer, you just have to revert to the originals before you play multiplayer
I see, but will it let me launch the game as usual? Or should I change anything in the launcher?
I don't really know, never modded before, but want to have some fun with that mission. Is there another way to do so?
yes. no. yes you could make a addon mod, instead of modifying the original, but thats harder to do