#arma3_scripting
1 messages · Page 586 of 1
Alright. Appreciate it.
By the way, in general, is this a good way to do that?
for example, let's say, KOTH server. so I need some kind of a server loop not exposed to the user to determine who is in the zone
so would it be that initLocalPlayer.sqf calls [server_fn].add_player(this) ?
what do you mean "not exposed to the user" ? 🙄
the user won't see any of the server side code in the PBO downloaded locally
so your mission becomes completely dependent of this server-side addon, ok
i.e., yes
so would it be that initLocalPlayer.sqf calls [server_fn].add_player(this) ?
@tough abyss no
since the clients would not know of server-side declared functions
you can do a client-side function that sends the required data yes
ok
and just so you know… No crossposting #rules
I deleted your messages in #arma3_troubleshooting to avoid you a warning @tough abyss
Trigger to hide object module to object, another show module to object. I enter the trigger, the object appears, cool. Now if I back away from trigger I want object to disappear again. Do I need to say something in "on deactivation?
or...
do I need two triggers?
tried on deactivation?
Trigger is guarded by blufor
well actually Blufor presesnt
I'd like to just walk in and out of said trigger and make an object appear/disappear
appear os ok but disappear not so much
I
ve been looking for 2 hours. 😟
what could I say in deactivatioin?
obj hideObject false ?
scripting all the way
(this is the channel for it after all)
is it MP?
atm SP
…will it be MP?
I will be porting to coop in the future
well anyway, use hideObjectGlobal and make the trigger to be server-side
I've been looking about and can't figure it; is it possible to update and add information to a diary record, rather than creating a new one every time?
no way that I know of, except deleting/re-adding it
Wait, they can be deleted?
The only thing I saw on that was an ancient post saying it wasn't possible 😮
maybe I am wrong on that one too 😄
Yeah, the wikipage for deleteDiaryRecord isn't very helpful :p
I'd post the link, but the joke is that it's got no information whatsoever, is a Contact exclusive (?) function, and no description.
https://community.bistudio.com/wiki/BIN_fnc_deleteDiaryRecord
That one right there, officer.
Huh... you'd think this would be included in the 'see also' for createDiaryRecord.
shhh, don't criticise the wiki
hey so I'm going to re-attack
I have set the variable "squad1" in the eden editor to the team lead for a unit
_marker1 = ["enemyPos1", position squad1]; _marker1 setMarkerType "mil_objective"; _marker1 setMarkerColor "ColorRed"; _marker1 setMarkerText "Large OPFOR unit";
when it runs it says something like "setMarkerType got an array, expected string"
so i did this
_marker1 = ["enemyPos1", position squad1]; "_marker1" setMarkerType "mil_objective"; "_marker1" setMarkerColor "ColorRed"; "_marker1" setMarkerText "Large OPFOR unit";
got no error or results
not sure what to do
i even switch the "_marker1" with "enemyPos1"
"_marker1" is not your marker's name
so in theory, the "enemyPos1" should of worked
_marker1 = ["enemyPos1", position squad1]; "enemyPos1" setMarkerType "mil_objective"; "enemyPos1" setMarkerColor "ColorRed"; "enemyPos1" setMarkerText "Large OPFOR unit";
should have please @_@
_marker1 = ["enemyPos1", position squad1]; // does NOT create a marker.
so i tried this, and it yielded no results or error
ah
well
oh boy, here i go reading again
mother
f'er
i see it
spanky for no read-y the wiki
@manic sigil https://community.bistudio.com/wiki/createDiaryRecord lists removeDiaryRecord
…now
t_t
_marker1 = createMarker ["enemyPos1", position squad1]; "enemyPos1" setMarkerType "mil_objective"; "enemyPos1" setMarkerColor "ColorRed"; "enemyPos1" setMarkerText "Large OPFOR unit";
```sqf so it's fancier
sqf _marker1 = createMarker ["enemyPos1", position squad1]; "enemyPos1" setMarkerType "mil_objective"; "enemyPos1" setMarkerColor "ColorRed"; "enemyPos1" setMarkerText "Large OPFOR unit"
hold on lemme re-read the pin
line-return after sqf and you're good - it should even colour while typing
_marker1 = createMarker ["enemyPos1", position squad1]; "enemyPos1" setMarkerType "mil_objective"; "enemyPos1" setMarkerColor "ColorRed"; "enemyPos1" setMarkerText "Large OPFOR unit";
this worked btw
noice
?
1 trigger = present
2 trigger not present
object appears when I enter trigger and disappears when I leave
huh… why not one trigger?
I know but I need someting I can copy/paste 😳
I looked at the wiki but ...
I just can't comprehend it
theStuff hideObjectGlobal true;
theStuff hideObjectGlobal false;
```…this?
true to hide, false to unhide
WellI know your right and I havew picked up stuff but it's really hard to get up that first mountain
I keep trying though,...stubborn
how do i trigger my open.sqf in the onAct field of a trigger ```sqf
this addAction ["Open", {true}];
thats got to be close ?
nope
lol come on it is
Remember that execVM isn't the most efficient way to execute code, it basically reads the file everytime you call it- so don't put it in a loop
if you want to run your sqf file, just what I set
also what ↑ said
the video that plays is on loop
but would only be triggered once
thanks
no it dont work still
execVM "DataTerminal\open.sqf";
i tried this in the end and that didnt work either
¯_(ツ)_/¯
so is it something like mymission.altis? that kind of mission folder?
or the "missions" folder
yea
uhh yea to which one
oh right
mpmissions/ ee.altis/ dataterminal/open.sqf
do you have the debug console?
no
Try execute the line execVM "DataTerminal\open.sqf";
i know the trigger will work
oh
i did thats what i came back with and it dont work either
string ecpected nothing or something
are you sure you don't have the debug console?
the bit where the animation list is
Right do you see the textbox that says "execute" - copy the line execVM "DataTerminal\open.sqf"; and click local exec
well I mean copy and paste into the text field
ok ill give it a try thanks for the help
i used the debug and it said it couldnt find the file, so i checked and the dile name was OpenTerminal so i changed it all but its still saying string expected nothing
execVM "DataTerminal\OpenTerminal.sqf";
is that a script error or an editor popup error?
editor popup error
tried nul = execVM "DataTerminal\open.sqf";?
did you write the OpenTerminal.sqf yourself?
no someone did it for me on the bis forum
while {true} do
{
_object = _this select 0;
_caller = _this select 1;
_id = _this select 2;
_object removeaction _id;
[_object,3] call BIS_fnc_dataTerminalAnimate;
sleep 2;
with uiNamespace do {
disableserialization; //thank you so much tankbuster
_object setObjectTexture [0,"images\ee6.ogv"];
1100 cutRsc ["RscMissionScreen","PLAIN"];
_scr = BIS_RscMissionScreen displayCtrl 1100;
_scr ctrlSetPosition [-10,-10,0,0];
_scr ctrlSetText "images\ee6.ogv";
_scr ctrlCommit 0;
};
};
autoplay = 1;
loops = 1;
_closeaction = [[_object,["Close","DataTerminal\CloseTerminal.sqf"]],"addAction",true] call BIS_fnc_MP;
can you try again and tell me what variable is the error referring to when it says string expected nothing
[[this,["Open","DataTerminal\OpenTerminal.sqf"]],"addAction",true] call BIS_fnc_MP;
should have a # in front of the problem variable
thats bit gose in the terminal object
nul = execVM "DataTerminal\open.sqf";
this did pass without an error untill i pressed play
then theres was a script error
but i didnt read it
yea, the script expects it to be on an addaction
dont understand what it is in a loop for
thats ok for now cause i need it auto playing more than an addaction now
but both would be better
the type script expected nothing
is supposed to stop editor complaining about getting a return
the nul stops the popup erros
i ran it through the debug and it was saying something about these bits
_object = _this select 0;
_caller = _this select 1;
yea, because it is written to be run off an addaction
it is expecting the action parameters
right
Well as far as I can see you're not passing any variables through the execVM
oh wait
what about getting an npc to trigger the addaction with a waypoint ~?
_object = _this select 0;
_caller = _this select 1;
@faint kraken
right you should get errors from this if you run it through execVM but not if you run it through addAction
but how would i write that ?
i have a hostage in a room with a screen infront of him and in another room ins the data terminal, and when the terminal is open the ogv plays on the screen
ok and what error are you getting when you do the run the addAction
this addAction ["Open", {true}];
i thought this would work but it didnt. let me open it and check the erro
this addAction ["Open", "DataTerminal\OpenTerminal.sqf"];
this addAction ["Open", "DataTerminal\OpenTerminal.sqf"];
@robust hollow was just about to say, always good to start with non-mp first
no that dont work either. it dont come up with any eorrs but the terminal isnt opening
did you add the action to the terminal?
no to the onact of the trigger
with the way that script you pasted is written right now, it assumes the object thee action is attached to is the terminal.
lol
you should give your terminal a variable and rewrite the script to use it
yes i have that bit i pasted in the terminal and any unit can open it but i need a trigger to open it
[[this,["Open","DataTerminal\OpenTerminal.sqf"]],"addAction",true] call BIS_fnc_MP;
that bit is in the terminal
yes
it opens the video plays on the terminal and the screen
yeah
both if possible
cause then it can be stopped when needed
thats ok thanks for the help
replace insertTerminalVariableNameHere with the variable name of the terminal object (idk what you named it)
@eager pier
In other words, in the editor, change the name of the terminal object to something likemyTerminaland do[myTerminal]execVM "DataTerminal\OpenTerminal.sqf";
thanks ill try them ina bit. pc crashed now
yeah like civ1
[term1] execVM "DataTerminal\OpenTerminal.sqf";
script type expected nothing
sweet thank you everyone for all your help, it is working now 🙂
nul = [term1] execVM "DataTerminal\OpenTerminal.sqf";
i did get an error but it dont matter cause its all working now. thanks
ah nice glad to hear it
How do i turn off the abort function in the esc menu? I have the ALIVE mod installed and soon as someone presses abort rather than "Player exit" the server hangs when trying to do an ALIVE server save so my only fix i can think of is turning it off any ideas?
@Genius Play Uniquehave you tried the USS Nimitz mod? That is a working carrier.
@primal marten Can you send me a link to that mod? (A mod is not really a solution for my problem since I would like to put my mission on a open server one day and if I would include mods players would need to download and install those mods before playing which I think will turn a sizable away from the server BUT I may be able to look at the code and "reverse engineer" a scripted solution...)
@primal marten Thank you.
put this in the init field (I can't believe I just wrote that!)```sqf
if (!isServer) then { this setVariable ["BIS_exitScript", false]; };
@winter rose Sadly tested... and did not work... 😦
…try true? that would make more sense actually
on it!
yep, would work
but sides are numbers in config 🙃
yep
see https://community.bistudio.com/wiki/Side for their config id
What for the path?
oh, idk
check the Config Viewer maybe
Yeah just did
maybe "West"
soooooo you're good?
Yeah 🙂
okido! 👌
Got more than one error but thats where it stopped
Trying to make a UI filter from side, add filtered factions, then filter the factions by each squad
Annoying me 😄
Will probs be back
haha
🙀
…try
true? that would make more sense actually
@winter rose Sad news dude... still dont work.. damn swivel targets
welp, idk
you can check BI script and find out how it works, or contact the mod author for assistance
Will do thanks Lou for trying though! Super appreciate the community help
we try :p
waitUntil { if (lbtext lbCurSel 2101) != "") exitWith {}; sleep 1; }; I don't see my error here, i'm comparing two values, two strings?
It will all be better in ARMA4
@brave jungle waitUntil expects a boolean
waitUntil
{
if (lbtext lbCurSel 2101) != "") exitWith {};
sleep 1; // returns Nothing
};
waitUntil
{
sleep 1;
lbtext lbCurSel 2101) != ""; // returns Boolean
};
Oh right okay
having true in the exitwith would also work I guess?
For future ref
no
you have to place the Boolean at the end of the statement, therefore place the sleep before
Ohhh I see
Still getting an error 😅
_curSelFac = lbText [2101, lbCurSel 2101]; waitUntil { sleep 1; _curSelFac != "";};
Generic error at the |#|!=
that waitUntil will never ever exit or not exit immediately
your variable will never change, the result of the != comparison will never change
The waitUntil either does nothing, or you will get stuck forever
waitUntil { sleep 1; lbText [2101, lbCurSel 2101] != ""; };
```for the logic issue
as for the generic error, something may be wrong with lbText idk
Yeah not getting the value now, so probs something before that contributing
So, I'm trying to create a "safe zone" using triggers that forbids the player from causing nor taking any damage while in the trigger zone. The script works, however, it fails to deactivate and keeps getting stuck with the safe zone calls.
This is what I have it set so far:
Condition:
this
On Activation:
inZoneSafe = [] execVm "inSafeZone.sqf";
The inSafeZone.sqf contains:
hint "Entering Safe Zone";
player allowDamage false;
vehicle player allowDamage false;
while {true} do
{
player action ["SwitchWeapon", vehicle player, player, 100];
sleep 1;
};
On Deactivation:
null = [] execVm "leftSafeZone.sqf";
The leftSafeZone.sqf contains:
terminate inZoneSafe;
hint "Exiting Safe Zone";
player allowDamage true;
vehicle player allowDamage true;
player action ["SwitchWeapon", vehicle player, player, 0];
sleep 1;
your while true… there is no exit condition
shouldn't
terminate inZoneSafe;
stop the previous script?
yup, should
only in this case it does not for some reason
does the trigger fire it continuously?
try hint format ["Entering Safe Zone @ %1", round time];
So the player spawns in the safe zone at start, gets in the desired vehicle and leaves the safe zone to engage others
the switch weapon stops the player from using the weapon but it keeps getting stuck even after leaving the safe zone
Its only at 1 round time
the deactivation does not even get triggered and hint "Exiting Safe Zone" is not displayed.
is the trigger "one-time" only?
repeatable
if the trigger fires more than once, the script will spawn a second time and inZoneSafe will be overwritten
you'll have the while loop running twice, but you can only terminate one
add to your trigger condition && isNil "inZoneSafe"
and in your code after the terminate do inZoneSafe = nil;
thanks, will try
now its entering and exiting the safe zone one after the other
iirc, the trigger only fires once while the player is in the zone; how does it run twice?
depends on how the trigger activation is set
Activation: BLUFOR
Type: Present
so if any blufor unit enters, player becomes invincible
my idea is to make that IF and ONLY IF and WHEN the player enters the safe zone, then THAT player is invincible
while inside the safe zone
the other blufor units outside can still fire / die while not in the zone
then link the trigger to this player unit, or make condition this && player in thislist
but that wouldn't take into account if the player gets into a vehicle while in the safe zone?
also, using that condition, the safe zone is activated, and while entering a vehicle it gets deactivated and activated back and never to be deactivated again when leaving the zone.
this && vehicle player in thislist then
sorry im being too much of a pita...
np
but triggers are not the best way to do this thing anyway (entering a vehicle inside the trigger fires a "vehicle entered the area" iirc)
i tried
this && ((vehicle player) || player) in thisList
ah
this writing would also throw an error, as you are comparing objects, with ||
Progress! Thanks a lot.
but its not yet completely solved though 
the activation scripts keeps working on loops for some reason, im going to combine what dedmen said
yet the deactivation script worked after leaving the area
nope does not work
got the solution
terminate the script twice 😄
For which purposes stuff like nearestLocation might be used?
It may be used to show something like “NE of Kavala” text
Hello, is there a way to disable night time?
change the time to day?
no like the mission is staying up for 6 hours and I want to disable night time
no, that is not possible
however you can use setTimeMultiplier to slow it down a lot
but then when it gets to night time, night is very slow
then use setDate
every hour, reset an hour earlier, ta-daaa
also you don't want to "disable night time", you want to stop daytime progress - that's different
@grim wing ^
huh
can i like set it to if it detects a certain daytime then change the multiplayer and change it back to original when its day time again
// server-side, e.g in initServer.sqf
[] spawn {
private _date = date;
while { true } do {
sleep 1 * 60 * 60;
setDate _date;
};
};
@grim wing ^
every hour, reset to start date
yes have a looping script that has case values and then when a certain time occurs setdate to skip the time
if (daytime = 18.5) then {setTimeMultiplier 80};
if (daytime = 6) then {setTimeMultiplier 12};
something like that
hi all, did you know if there's any way to configure the factions that the opfor side npc's identify an OPFOR player as an enemy and attack him and obviously they also attack a NATO side player?!
Cause I want to create a PVE multiplayer mod with two factions, the blue side and the red side but I want that the NPC's look both as enemies.
while { true } do {
waitUntil { sleep 60; daytime > 6 };
setTimeMultiplier 12;
waitUntil { sleep 60; daytime > 18.5 };
setTimeMultiplier 80;
};
```@grim wing
how can I change the view color of players? google didnt helped that much
In ACE f.e. if you put on glasses your view color changes to yellow-ish. I want that the color changes like that but without an item
See post process effects on the wiki 😉
https://community.bistudio.com/wiki/Post_process_effects @fervent kettle
aah right, thanks
while { true } do {
waitUntil { sleep 60; daytime > 6 && daytime < 18.5};
setTimeMultiplier 12;
waitUntil { sleep 60; daytime > 18.5 };
setTimeMultiplier 80;
};
@grim wing This might be better as the code Lou suggested will continuously switch multiplier from 12 to 80 once you hit daytime 18.5 (both waitUntils will return true, resulting in both setTimeMultipliers execute)
@crude vigil true dat, thanks
in a (boring & long) work meeting at the same time… I should check twice
@winter rose Well, people should still be happy that still in such case you are trying to assist them, in addition to your continuous assistance ⭐
Mraw!
I also use this channel as a way out, too 😄
One more question, i am trying to add a range to an "addAction" but it doenst change the range
Tavares addAction ["<t color='#0ac6d2'>Jammen</t>", {
"jam.sqf"}, [], 6, false, false, "", "", 0.1];
a range, like a max distance for it to display?
Yea, i want that only the guy who has the addAction to see it
jam.sqf does what? Anyway you need to do execVM in order to execute the script
according to https://community.bistudio.com/wiki/addAction
use the radius parameter
also:
Tavares addAction /* stuff */ // add it LOCALLY
it does as it`s named, it james lol
@fervent kettle {"jam.sqf"} is incorrect, you either will give ur script file as string , or code, you are kind a trying to do both which actually results in a script returning "jam.sqf" as text. (In practice no effect)
Well, it actually just removes the ammo from a turret with some fancy effects^^
@fervent kettle {"jam.sqf"} is incorrect, you either will give ur script file as string , or code, you are kind a trying to do both which actually results in a script returning "jam.sqf" as text. (In practice no effect)
@crude vigil Still the problem with the range
is the range the issue, or that everyone can use the action?
0.1 range is for a vehicle or something?
Wait... totally forgot that the first addAction is in the onPlayerRespawn wich i didnt change -_-
Also.... by "" in 7th parameter, you are overriding condition of code...
if you have no condition, you need to make it return true. ie. "true"
so like this?
Tavares addAction ["<t color='#0ac6d2'>Jammen</t>",
"jam.sqf", [], 6, false, true, "", "", 0.1];
no the one before 0.1
https://community.bistudio.com/wiki/addAction refer to condition parameter
so smth like [...] "", true, [params], 0,1];
Tavares addAction ["<t color='#0ac6d2'>Jammen</t>",
"jam.sqf", [], 6, false, false, "", "true", 0.1];
"true" ← default value
oh you have to set it in ""
https://community.bistudio.com/wiki/addAction#Parameters parameter "condition"
@fervent kettle If you are not willing to modify parameters, better to use nil to leave them to default values to avoid issues like this.
Nevermind, it is only applicable to functions, my bad.
String, Optional, default "true", so… yes, quotes ^^
Ok, somehow it is not executing the .sqf tho
@crude vigil not sure nil is accepted in commands
I remember so. Time to test! 😩
range is working, the rest is not :/
@winter rose @fervent kettle Ignore that suggestion with nil. My bad :X
I got tricked with that too after a long time using functions!
nil is so useful
Pretty much the only command I would use with since there are 11 12 parameters and the necessary ones are at the end.
tried this one here, still not executing the .sqf
[Tavares, ["<t color='#0ac6d2'>Jammen</t>", "jam.sqf", [], 6, false, false, "", "true", 0.1]] remoteExec ["addAction", 0,true];
is your "jam.sqf" at the mission root?
Yep
wait
Why a 0.1 radius? so only Tavares get the action?
Yep
then```sqf
[Tavares, ["<t color='#0ac6d2'>Jammen</t>", "jam.sqf", [], 6, false, false, "", "true", 0.1]] remoteExec ["addAction", Tavares, true];
you don't need to set the radius at all if the action is on the unit himself?
I do need to, it will create an immense radius like up to 10 meters
still not executing the .sqf
50m
just the unit name
a soldier?
right?
if he is inside vehicle etc, u might not be able to reach to 0.1 radius of him
range is working so far, might change that later on
oh so you see the action but the code is not doing anything
Yea
It does show me errors sometimes even tho i didnt activate that
the errors will be displayed in 3den, not when u run the mission afaik.
sometimes it does that
I am just gonna send you the whole code, one sec
Init.sqf:
[Tavares, ["<t color='#0ac6d2'>Jammen</t>", "jam.sqf", [], 6, false, false, "", "true", 0.1]] remoteExec ["addAction", Tavares, true];
onPlayerRespawn.sqf:
[Tavares, ["<t color='#0ac6d2'>Jammen</t>", "jam.sqf", [], 6, false, false, "", "true", 0.1]] remoteExec ["addAction", Tavares, true];
jam.sqf:
// pret1 = name of the turret
// Taveres = name of the unit
removeAllActions Tavares; // removes the "jam" option from the unit
[] spawn{
sleep 23.0; // waits 23 seconds before executing the next variables
pret1 setVehicleAmmo 0; // sets turret ammo to empty
addCamShake [10, 5, 25]; // adds camera shake [strenght, duration, frequency]
playSound "sounds\emp.ogg";
[] spawn{
sleep 300; // waits 300 seconds before executing the next variables
pret1 setVehicleAmmo 1; // sets turret ammo to full
};
[] spawn{
sleep 600; // waits 600 seconds before executing the next variables
[Tavares, ["<t color='#0ac6d2'>Jammen</t>", "jam.sqf", [], 6, false, false, "", "true", 0.1]] remoteExec ["addAction", Tavares, true]; // adds the "jam" option to the unit
};
and what is the error you get?
No error, it is just not executing the jam.sqf
now it`s working, thanks ❤️
which should give you errors---
code with Show Script Errors
but kinda didnt xD
Next time open -showscripterrors :)
yea will activate that now
Maybe only rpt
(Launcher's option or ^ .exe argument)
error = error... no matter where you look
why is it giving me an "couldnt find sounds\emp.ogg" error tho O.o
like, it IS clearly there
try a \ at the beginning of it
I just want a sound to be played, and heard, no matter where the players are
playSound is local
so either use playSound3D (absolutely read the wiki on this one)
or remoteExec playSound
judging from the name, it will be a position based sound, so it will be a sound played on a location, if players are nearby, they will hear it. In this case you want playSound3D
but if you want to play some sort of sound at the proximity of each player, then playSound...
No, i dont want a position based one, i want so that everyone, no matter where, can hear it
@fervent kettle https://community.bistudio.com/wiki/Description.ext#CfgSounds
just did it like this
description.ext
class CfgSounds
{
sounds[] = {};
class emp
{
name = "emp";
sound[] = {"\sounds\emp.ogg", 25, 1};
titles[] = {0,""};
}
};
jam.sqf
remoteExec playSound "sounds\emp.ogg";
ooh ok
class emp {...} means you need to pass emp there
with the folder it is in?
no folder, just classname
file location is already defined in class emp
it has the data there.
playSound "soundClassname"; ← ↑
thought i should do with remoteExec remoteExec playSound "emp";
still says file not found
That is not how you use remoteExec.
…that's not how remoteExec works
You used it once correctly, try to use it again in this scenario. It takes practice :)
like this? remoteExec [playSound "emp"];
Already on that page,
playSound is a command, so it has to be alone there
"emp" is a parameter of this command.
maybe this one here? playSound "emp" remoteExec ["playSound", player, true]
close enough, playSound shouldnt exist in parameters.
also I am not sure, you want JIP compatibility there. (the true at the end)
@fervent kettle being on the page is not enough, try reading it 😋
I`m trying my best but some things are just so confusing
it is ok, u re doing fine.
if you can manage to decypher this page, you can read all of them and the wiki knowledge opens to you
why did you use playSound "emp" before remoteExec? It says params, params of playSound in your case, is param of playSound is playSound?
are you writing
playSound playSound "emp"
when you are using the command or?
so my playSounds param is "emp"?
yes
does this look about right?
[["emp"] remoteExec ["playSound", player, true]];
first of all, why the outer [ ] ?
dunno, thought i had to bracket it like in the other line
do you see any such example in the page you are looking?
ehm... actually.. no
so like that?
["emp"] remoteExec ["playSound", player, true];
or without the [ around "emp"
better, but you are not using playSound ["emp"] you are using playSound "emp"
yes.
without the [] around "emp" indeed in this case.
soo playSound "emp" remoteExec ["playSound", player, true];
or "emp" remoteExec ["playSound", player, true];
You say it
wich one, first or second?
Which one is correct? Why? tell it
dont slaughter me
the second one? cause "emp" is my param, wich is the only thing i need in front of remoteExec
Indeed.
welp, it`s still not finding the sound file
remove the \ at the beginning of sound[] = {"\sounds\emp.ogg", 25, 1};
It might work, I am always confused with these...
["emp"] remoteExec ["playSound", player]; // -not- JIP
tried, still not working
oh true, that as well
don't set JIP
you don't want JIP players connecting an hour later to hear the sound
OK, as I said, still not finding the sound
Posted it already a bit more up
just did it like this
description.extclass CfgSounds { sounds[] = {}; class emp { name = "emp"; sound[] = {"\sounds\emp.ogg", 25, 1}; titles[] = {0,""}; } };
jam.sqfremoteExec playSound "sounds\emp.ogg";
@fervent kettle
; after class CfgSounds
just to be sure, is your file description.ext or description.ext.txt?
.ext
class CfgSounds;
{
sounds[] = {};
class emp
{
name = "emp";
sound[] = {"\sounds\emp.ogg", 25, 1};
titles[] = {0,""};
}
};
that ; after class CfgSounds looks a bit missplaced tbh
tried it with that
class CfgSounds
{
sounds[] = {};
class emp
{
name = "emp";
sound[] = {"\sounds\emp.ogg", 25, 1};
titles[] = {0,""};
};
};
still getting an error
Which error? (sound "emp" not defined/found?)
Sound emp not found
Anyone knows what could cause such kind of picture?
https://cdn.discordapp.com/attachments/559453352111636515/698948556781912154/20200412202453_1.jpg
found the error, i had to remove the last ;
class CfgSounds
{
sounds[] = {};
class emp
{
name = "emp";
sound[] = {"\sounds\emp.ogg", 25, 1};
titles[] = {0,""};
};
}
no, the last ; was definitely correct
Nope, cause now it is working
Yes it was correct
dont ask me why, but as soon as i removed that ; it worked
probably just arma not properly reloading the changes you made before that. Maybe forgot to save the file. many possible human errors
Is there a difference between “{_x someaction} foreach units this;” in the groups init vs “{_x someaction} foreach units group this” in the group leader init?
no
I'm trying to have it where a marine gets a radio transmission from one of his fellow marines saying "We're under attack, requesting MEDEVAC Over!!" how do i put the dialogue for that in script and animation
[] spawn{
_unit sideRadio "We're under attack, requesting MEDEVAC Over!!";
_unit playMove "Acts_listeningToRadio_Loop"; // playMove or switchmove not sure rn
_unit setRandomLip true; // dunno if it works when using playMove tho
sleep 5.0; // put whatever time you want in here
_unit setRandomLip false;
_unit switchmove ","; // didnt test this one yet
}
btw, is it a soundfile too or just text?
sideChat? just text.
depends on where he wants to have it. As far as i remember, in campaign you have the chats in side chat too, so i just came up with that
sideRadio != sideChat
yo
what's the code for ace, to kill an ai
and @fervent kettle I use _unit sideChat format ["thank god you're here!"];
tried to do [unit, 100, "head", "bullet"] call ace_medical_fnc_addDamageToUnit
but it only injures them
unit setdamage 1; doesn't show up on the ace medical system as killed, so that doesn't work either.
@tough abyss
_unit sideChat format ["thank god you're here!"]; // format is not needed if there are no arguments
_unit sideChat "thank god you're here!"; // correct, faster
ahh ok
you just want to kill the ai right? use _unit setDamage 1; no need for all that ace stuff, or what exactly are you trying to do @tough abyss
when I do _unit setDamage 1; it doesn't actually kill the unit, it puts them on the ground with their hands out, it's because i'm using the ace medical system
so it doesn't register as killed, and when you go into the ace medical system on the body it sais no damage.
new or old ace?
new
cause for me that works fine
weird
i am using a downgraded one tho
that's prob why
will test it with the new one
@tough abyss just tested it and it`s working fine for me
figured it out, was a conflicting mod, thnx.
ah ok
I'm trying to get a server addon only to be started (initialized). What is the proper way to do it ?
( It's not a mission )
what does initialized mean?
if you want script, a preInit CfgFunctions script is usually used as entry point
@still forum Thanks. I tried, but it doesn't execute
class CfgFunctions {
class academy_koth
{
class main {
file = "academy_koth";
preInit = 1;
class preInit {
preInit = 1;
};
};
};
};
// fn_preInit.sqf
diag_log "nisan server initialized";
doesn't print to RPT
I already read all that doc
class CfgFunctions {
class academy_koth
{
file = "fn_preInit.sqf";
preinit = 1;
};
};
Is this better?
@still forum ?
That's not what the doc says...
CfgFunctions >> tag >> category >> function
Alright
So, I reached this structure:
testmod/functions/server/fn_func.sqf
testmod/config.cpp
// config.cpp
class CfgFunctions
{
class SKR
{
class server
{
class func
{
preInit = 1; //(formerly known as "forced") 1 to call the function upon mission start, before objects are initialized. Passed arguments are ["preInit"]
};
};
};
};
Congratulations
testmod/functions/server/fn_func.sqf
wrong.
testmod/functions/fn_func.sqf
oh, "mission only"
oh!
checking..
I'm really surprised there are no warnings/errors relating to this..
getting started is really rough
have you checked your rpt?
ofcourse
funny, as in mission config there are plenty of "file not found" messages
This still doesn't work for me. I have fn_func.sqf do:
diag_log "Testing";
But it doesn't print to rpt
-server- rpt, right?
Yes
path to an addon is not included and has to be part of the file path, e.g., myAddon\myFile.sqf
try defining manually thefile =
It's frustrating. I feel like it's such a simple and beginner thing, and I just can't get that to work :\
trying
it's not a beginner thing, but once you have it right once you get it forever
ugh..nada
not working
It doesn't print to the RPT
hence I conclude it doesn't initialize
preInit = 1 runs the function on mission start
preStart = 1 runs the function on game start
I think both should have been initialized, but I will try preStart
if you didn't start a mission, no chance you had any results indeed.
nope, not working
0:51:37 Dedicated host created.
0:51:44 Game Port: 2302, Steam Query Port: 2303
0:51:44 Mission BFArma.Altis read from directory.
0:51:44 Host identity created.
0:51:44 Roles assigned.
0:51:44 Reading mission ...
0:51:50 Mission read.
0:51:50 Game started.
it's persistent
?
persistent battlefield
how does it matter in the issue at hand?
preInit is on mission start
the mission started even when I didn't enter the server because it's persistent
ok, auto-started is fine (or should be fine) too
show your CfgFunctions?
```cpp
sure
thanks for assisting by the way
class CfgFunctions
{
class SKR
{
class server
{
file="testmod\init.sqf";
preStart = 1; //(formerly known as "forced") 1 to call the function upon mission start, before objects are initialized. Passed arguments are ["preInit"]
class func
{
file="testmod\functions\fn_init.sqf";
preStart = 1; //(formerly known as "forced") 1 to call the function upon mission start, before objects are initialized. Passed arguments are ["preInit"]
};
};
};
};
(I also tried preInit)
// init.sqf
diag_log "INIT Testing";
// fn_func.sqf
diag_log "Testing";
file = "" in the category is to define a (sub)directory, not a file
okay, so testmod alone?
also, preStart/preInit/preAnything do not have any use in the category
class CfgFunctions
{
class SKR
{
class server
{
file="testmod";
class init
{
file="testmod\init.sqf";
preInit = 1; //(formerly known as "forced") 1 to call the function upon mission start, before objects are initialized. Passed arguments are ["preInit"]
};
};
};
};
oh, path to an addon is not included
it should target the file in "testmod\init.sqf"
yea
just read that
ok, same result
commandline, by the way, is:
"C:\Program Files (x86)\Steam\steamapps\common\Arma 3\arma3server.exe" -port=2302 "-config=C:\Program Files (x86)\Steam\steamapps\common\Arma 3\TADST\default\TADST_config.cfg" "-cfg=C:\Program Files (x86)\Steam\steamapps\common\Arma 3\TADST\default\TADST_basic.cfg" "-profiles=C:\Program Files (x86)\Steam\steamapps\common\Arma 3\TADST\default" -name=default -filePatching -autoInit -serverMod=testmod
( I'm using TADST )
is your file in testmod\testmod\init.sqf?
then why did you add testmod\ in front of init.sqf
also, shouldn't addons be in Addons? 🤔 unsure about that and config though
because it didn't work when I tried
Also, because of this:
I tried so many different stuff, all fails to work.
I really am frustrated by this. It should be so simple..
@winter rose Are you willing to remote my desktop and try for yourself ?
negative, that's an addon & #arma3_config issue and I am not well versed into this
would it have been for a mission it would already be working.
Yeah, Okay
it's posible to load an default arma3 dialog into GUI editor to get some specific things like font used and size of the dialog? to be more specific i'm looking for EDEN editor mission selector (not map) thingy
How do I Make a trigger activate when a specific person enters it?
go to trigger activation
wait no, go to trigger and replace the condition with a Tag you gave whoever you want
as in Condition; Player1
@fluid cairn
I think, if not maybe use Condition: this ; player1 ;
@gaunt ferry Thankyou
@fluid cairn if it doesnt work tell me, ill tell you within the hour, and teach you how to do it as well
[1:54 AM] Lou Montana: show your CfgFunctions?
I've been curious what's the reason of usingCfgFunctionsfor a user mission? It is cumbersome, hard to maintain, requires exit to editor each time you wish to add/remove a function.
exit to editor each time you wish to add/remove a function.
No
No
So far I had to exit and save/load each time I wanted to get anydescription.extupdates
In Eden Editor just save does. If not, just preview and back to the mission does
how do you check if a unit of specific side has killed a CIV
I'd go with entityKilled
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers/addMissionEventHandler#EntityKilled
addMissionEventHandler ["EntityKilled",
{
params ["_killed", "_killer", "_instigator"];
if (isNull _instigator) then {_instigator = UAVControl vehicle _killer select 0};
if (isNull _instigator) then {_instigator = _killer};
if ("_killed" side civ) then {
_killerSide = side "_killer";
if (_killerSide !side civ) then {
_killerside addScoreSide -2;
};
};
}];
how does this look?
im new to this 😂
Also I don't think addScoreSide in this situation will work, it's only for the server, according to BIKI
how would i go about adding to subtractinbg the sides score?
Is this for singleplayer or multiplayer?
I'm not really sure about multiplayer-behaviour of addMissionEventHandler so...
is there a better way youd go about subtracting a sides score if they kill a civ?
addMissionEventHandler ["EntityKilled",{
params ["_killed", "_killer", "_instigator"];
if (isNull _instigator) then {_instigator = UAVControl vehicle _killer select 0};
if (isNull _instigator) then {_instigator = _killer};
if (side _killed == civilian) then {
_killerSide = side _killer;
if (_killerSide != civilian) then {
_killerside addScoreSide -2;
};
};
}];```I don't think this is correct, but rather make sense than your original code (not tested)
I assume if CIVs are serverl-local then entityKilled should trigger on server.
now i have a question if its civs from ambiant civ module will it trigger even if they are agents?
What is an agent in arma? Saw them but have never used
Agents are “dumb” NPCs, which don't have AIs so computers run faster, AFAIK
as far as i can tell a dumb down version of the ai that only have three states panic, idle , or hiding
And well, I think it will
So it can stand, walk or die and can be used as storyline NPCs?
It will do nothing unless you order them via scripts, but we can shoot them, kill them, anything other we can with regular AIs
main reason i want them over normal is s i can have quite a few and save on cpu
should i put this in init.sqf or?
i have trouble figuring out where to put stuff
should i put this in init.sqf
generally speaking - no
and also with event handler does it run every time enitiy is killed or do i have to loop it
No need to execute more than once
okay, good to knwo
In MP init.sqf you:
- check if the code has ran on client or on server
- run the appropriate initialization routines
- into the server initialization routines you call your code
check if the code has ran on client or on server
or use the alternative separate client/server init scripts instead of a singleinit.sqf
https://community.bistudio.com/wiki/Initialization_Order
so init.sqs does it function like init.sqf except only runs mp code?
nvm
initserver.sqf
all .sqs stuff is legacy and normally must not be used
okay i was wondering about that
Just it exists for “backward compatibility”
would it be best to use initSever over initPlayerServer becuase the event handler is only on server correct? or should i put it in an obj init
Object init is a massive no
whys that?
Maybe initServer.sqf will do, I honestly don't know what's the exact behaviour of the multiplayer tho
mhm well ill test it
Also, object init will be executed on every clients, which will cause unnecessary things
would it be best to use initSever over initPlayerServer becuase the event handler is only on server correct? or should i put it in an obj init
Your choice isinitServer
getting an "type string, expected number" error when using this here
player removeAction healplayer;
healplayer = [player, ["<t color='#0ac6d2'>Heilen</t>", "heal.sqf", [], 6, false, false, "", "true", 0.1]] remoteExec ["addAction", player, true];
remoteExec won't return you the action ID, so removeAction won't be able to remove the action
Right, what do i need to add?
Why do you need to remove the action?
And why do you call remoteExec targeting the player machine?
how to check if the zeus side is same as a sectors
It`s for a training map, i want that players have the option to remove or add the "heal" option
if the code runs on a server, there is no player there; if the code runs on client, then remoteExec ... player means "client own machine" (i.e. makes no sense)
so it won't as server has no idea what player is
if you run remoteExec from server to clients you use some server-existing player selector
i.e. side or group or an array of units
but player addAction ["Heilen", "heal\heal.sqf"]; worked
The question is - how do you run your tests. If you do "Editor -> Run in Multiplayer" then you'll have surprises when you go to real MP
It worked in Editor MP aswell as on the server
so if i replace "player" by "side or group" it`d work?
so if i replace "player" by "side or group" it`d work?
By anything the server may use to get required players
does that look about right?
blufor removeAction healplayer;
healplayer = [blufor, ["<t color='#0ac6d2'>Heilen</t>", "heal\heal.sqf", [], 6, false, false, "", "true", 0.1]] remoteExec ["addAction", blufor, true];
is addCuratorPoints the correct thing to call to give a zeus more money
does that look about right?
no
oh i thought you were talking to me lmao
I don't have experience with zeus, so I wasn't🙂
Oof, can you give me a lil hint?
According to BIKI, that's a yes, me neither tho >curator
Oof, can you give me a lil hint?
//client - moving the addAction stuff to a separate func to be able to deal with `player` variable
my_fnc_add_action = {my_action_id = player addAction ["<t color='#0ac6d2'>Heilen</t>", "heal\heal.sqf", [], 6, false, false, "", "true", 0.1]};
//server - run action add
0 remoteExecCall ["my_fnc_add_action", blufor]
is there a way to count how many sectors a side controls
Oof, can you give me a lil hint?
to remove the action - it depends on who is a remove decision maker
if that is a server, then
//client - moving the removeAction to a separate func to be able to work with `player` variable
my_fnc_remove_action = {player removeAction my_action_id}
//server
0 remoteExecCall ["my_fnc_remove_action", <some_correct_selector>];
//i.e.
//0 remoteExecCall ["my_fnc_remove_action", blufor];
//0 remoteExecCall ["my_fnc_remove_action", player_1];// where player_1 - is some variable name
//or so on
if it is a client then
player removeAction my_action_id;
i want players to activate the addAction
if (ownerSide == blufor) then {blu_z addCuratorPoints 50};
if (ownerSide == opfor) then {opf_z addCuratorPoints 50};
if (ownerSide == independent) then {ind_z addCuratorPoints 50];
``` in theory would this work in the Expression Field of a sector?
doesnt add the heal option tho
I think this meanssqf params ["_module","_ownerSide","_previousOwnerSide"]?
@quartz pebble this right here seems to work.. atleast in MP Editor
removeheal = player removeAction healplayer;
healplayer = player addAction ["<t color='#0ac6d2'>Heilen</t>", "heal\heal.sqf", [], 6, false, false, "", "true", 0.1];
params ["", "_owner",""];
if (_owner == independent) then {ind_z addCuratorPoints 50];
``` so like this?
doesnt add the heal option tho
Have you updated theCfgRemoteExecformy_fnc_remove_action/my_fnc_add_action?
IDK Aurora, I just guessed as I've no experience with Zeus
is that a proper use of perams?
params
And yes
learning more about scriping having a goal and reading the wiki and getting help from yal then i would of gotten any other way lmao
if all this functions then i think im good, i thank you both for your assistance!
is there such a thing a as a autoformatter for sqf?
that can take existing code blocks, and neatten them up?
is there such a thing a as a autoformatter for sqf?
I haven't seen such
Online version: https://sqfvm.arma3.io/vm/
@still forum a peice of code it could not eat
https://pastebin.com/H9H59SrX
that looks like koth
Probably. That was a first piece of obfuscated code I found.
it works if you remove the #include and #define lines
But the real code is most likely to have them🙂
whats the iskondof name for helicopters/planes?
air?
tried but doesnt work
Any of these:
"Helicopter_Base_H", "Helicopter_Base_F", "Helicopter", "Air", "AllVehicles", "All"
Ive set this as condition ({_x isKindOf "Air"} count thisList) > 0
Well it can't resolve includes that it doesn't have
It tries to resolve includes? Quite unexpected for a linter.
(I have no objections ragarding the attempt to resolve, but failures on that confuse me)
buuut the condition doesnt work
linter, formatter.. whatever
@fervent kettle can a helicopter show up in thisList?
i dont know... but when you ask like that, probaply not
i dont use triggers, but based on my 30 second test, no.
Hello guys! Just one fast question: is it possible to remove destroyed town structures that were hidden underground (~40-100 meters) automatically by Arma logic once a building has been destroyed (setdamage 1)?
if it is a map object, no i dont think so. if it is a building you placed, yea.
means: better stay those map objects alive, if possible, or partially damaged?
if you like. is it a performance concern?
yes
it should be fine. you can hide the destroyed structures if it makes you feel better, but i doubt itll have any noticeable effect because you cant see them anyway.
what would I use then?
@fervent kettle can a helicopter show up in
thisList?
@robust hollow
what if I have one destroyed structure (setdamage 1) and I decided to "resurrect" it via setDamage 0. Will it remove an underground building as well?
Online version: https://sqfvm.arma3.io/vm/
@still forum Wow. I didn't know such a thing existed. 🙂 Other than #include, no errors on the first file I gave it 🙂
it could also execute SQF online. But that needed to be disabled because of humans
@warm blaze you cant setdamage 0 on the ruin, but you can setdamage 0 on the underground building which will bring it back to ground level and remove the ruin object
@robust hollow , you sure the ruin gets removed?
yea, just tested in editor
ok, when I was fiddling with this, the ruin remained
the original building returned to ground level and the ruin obj is now null
cool
yea, just tested in editor
@robust hollow great, thanks a lot! Appreciate it! 😎
this was the cause of a huge FPS hit back in the old days
some simulation problem with the sunk object
I'm pleased to say a now retired community member and myself were among the first to highlight it when Joris and Jay still answered their phones
@fervent kettle this example isnt the best but it illustrates the kind of check you may need to do:
private _objects = _trigger nearObjects ["Air",selectMax(triggerArea _trigger select [0,2])];
count(_objects inAreaArray _trigger) > 0
hopefully someone reading has more experience with triggers and can give you a better solution.
am looking for a vanilla scripting solution for a player based suppression system. Laxmanns addon uses a localised CBA based extended event handler attached to each created AI unit. Best solution I am currently working with is a localised fired event handler based system on the players machine. Pity there isn't a Fired At event handler but hey ho there isn't. Anyone have any better ideas than the one i listed above ?
I am using a vehicle ammo box in my mp mission "Box_NATO_AmmoVeh_F" .. it's a nice solution as you just land next to it and automatically get rearmed. Is it possible to control what ammo gets replenished? E.g. guns yes, rockets no? Cheers 🙂
i would say not using the built in BI system, you would have to attach an addaction to the box that runs a script, that way you can define exactly what you want
or base it on a trigger that execs a script
there is an event handler for opening or taking items from a storage container, you could also use that
I use that to booby trap players looting from the obvious dead sniper in the middle of a field
this addEventHandler ["ContainerOpened", {
params ["_container", "_unit"];
}];
or
this addEventHandler ["InventoryOpened", {
params ["_unit", "_container"];
}];
Thank you @slim verge that’s helpful 🙂
@robust hollow sorry for disturbing but coming back to "underground houses": if I set not setDamage 0, but f.e. setDamage 0.5 then underground house will disappear as well?
i dont know, didnt test that. i assume repairing it any amount will remove the ruin and restore the underground building.
that sounds promising cause I would like to keep them not in brand new mode
check #arma3_gui , was discussing that sort of thing earlier
how would i make it so if a person is alive long enough you fail
sleep for x seconds, if alive → fail
is there something like !dead
how would you check if someone is dead?
nvm, i confused myself
it's posible to load an default arma3 dialog into GUI editor to get some specific things like font used and size of the dialog? to be more specific i'm looking for EDEN editor mission selector (not map) thingy
get some specific things like font used and size of the dialog
For that you find the dialog in config
dead = ! alive in code.... or you can attach a killed event handler to the unit and if he dies then you win, if he is still alive at mission end you lose. Can be done in a trigger, in a script
class Music1
{
name = "Music1";
sound[] = {"\music\eedc.ogg", db+0, 1.0};
titles[] = {0,""};
};
tor1 say3D ["Music1", 900, 1];
sleep 5;
Miller_alive = true;
}else{
i have these bits of code playing my audio
but it sounds like the audio is retriggering before the clip ends. how do i write the duration in to one of those bits of code ?
52000 ms
the music stops at the end of the file
if it repeats, then it means that you are calling the sound twice
it sounds like its playing ti a few times
but not everytime i play
also is there a way to rotate the sound ?
rotate the sound… ?
randomly select you mean ?
yeah like the sound is louder in one direction and alot quieter in the opposite direction
I would think "move the sound source"?
but thats a screen
ll try other objects for that tho thanks
is there a way to set auio duration tho ?
addMissionEventHandler ["EntityKilled",{
params ["_killed", "_killer", "_instigator"];
if (isNull _instigator) then {_instigator = UAVControl vehicle _killer select 0};
if (isNull _instigator) then {_instigator = _killer};
_killerSide = side _killer;
if (side _killed == civilian) then {
if (_killerSide != civilian) then {
_killerSide addScoreSide -2;
hint format ["A civilian was killed by", _killerSide];
};
};
if (side _killed != civilian) then {
_killerSide addScoreSide 1;
};
}];
``` it says im mission a ;
but as far as i can see im not?
just look at the colors in your syntax highlight
the error is not colored because its invalid
ops miss spell
lmfao
thank you
wow look at that syntax actually highlighting lmao
I'm trying to spawn back a bunch of lost items in a cargobox using this example piece of code:
_targetContainer = cursorTarget;
_restoreItems = ["rvg_money"] ;
{_targetContainer addItemCargo [_x, 1];} forEach _restoreItems
But whichever item i try to use for testing on my cargobox ends up spawning the box with 10.000 of that specific item. Can someone help me understand what im doing wrong? (im executing this through the in-game debugger clientside)
If i make a full array of restoreitems it seems to spawn somewhat random amounts of items, im getting the impression it may execute more times then once.
the code posted here is right; something else isn't
Okay so something else is rummaging with the snip, good to know 🙂
you may have this snippet in a loop, like a while { true }? @west tree
I'd literally pasted just that in my debug console window in-game, expecting it to execute just once.
in the long run if the syntax worked i did want to fedge that snip into a bit of script so i can easily restock certain chests for missions/events, but thats once i got the hang of understanding the commands more 🙂
maybe you clicked bottom-left "benchmark"?
Oh i didnt know that was supposed to be a benchmark, i'd only noticed it executed. But okay i guess it makes sense if benchmark executes the snip 1000 times xD
now a whoooole lot of strange stuff i had makes a ton more sense xD
ok y'all, i'm brand new here so be gentle. Signed up for discord earlier with a different problem that I then solved. Got a new one now, I'm using unitCapture to precord driving paths for my convoy to get around the ai pathfinding problems, 3 path.sqf files recorded, all identical save for unit identifiers and the path name inside each sqf is numerically distinct also. Path1, Path2, Path3. All my inits are set up, identical save for their own identifiers, each one pointed to the correct path file. The convoy drives through the trigger (3 triggers laid on top of each other) and as each vehicle passes its trigger, it's put onto its .sqf by calling the entry i made in the init and from there just follows the path. This keeps them in formation and stops them hitting each other or having accidents, as they're all just playing the same recording copy pasted starting a few seconds behind each other. One and two start just fine, three is not. Three just tries to use his pathfinding ai instead of playing the recording and ARMA's into a wall at the first opportunity
as i say, everything is identical save for unit identifiers, any idea what is going on? or suggestions for steps to take to troubleshoot
worth mentioning i did have all three moving together yesterday, but on a smaller scale
@hollow tusk Maybe it's worth a shot to try and let them start at a slightly larger distance of one another? in an attempt to check if AI might wanna take over if one car's too close to another? just purely guessing as i haven't messed with paths ever before.
They're not pathing, once the recorded movement takes over they're just copying what i did one time, the issue is 3 is hitting the trigger and not starting the recorded movement, even though all the triggers .sqf files and init entries are identical save for unit info and filenames
I can only think for it to be the trigger or my scripting, but as there isn't much script it has been easy to check both]
Maybe try a log-output just to double-check all three triggers actually fire?
can i just ask the trigger to print something when it fires?
I guess hint should work fine for most purposes
but not sure how to make sure to do that when its triggered instead of init yet, ive mostly used eden (and ingame console) myself 😦
rec = [] spawn TruckPath3;
hint "Fired";
so, the triggers on activation looks like this, no message
for some reason my trigger is not firing
How did you setup trigger activation, might it be (still) triggered by another entity? i.e. the previous car?
Im not sure on this, but it may be triggers don't re-check/refire while another BLUFOR still is within the trigger. many games handle such things differently.
If you i.e. use the script in OnActivation you might want to assign specific owners for the vehicles
to make sure each truck can only fires its own trigger
that sounds likely, i'm gonna take out the blufor and present and just leave it with truck_3 in thisList, see if that changes the behaviour
further testing has revealed it's definitely the trigger
trigger 2 fires and prints a message just fine
Okay so we also know for sure our debug message should function once the trigger fires 🙂
still no joy
i'm gonna make a brand new trigger whose only purpose is to make a print, but is otherwise identical, see what happens
i'm starting to crack up. the new test trigger won't detect it either, why is truck_3 invisible to all triggers? and why did this exact code work fine yesterday and not today? BOHEMIA!
in all honesty though, the challenge is fun
just for the sake of argument i'm closing and reopening arma. by god i hope this doesn't work
holy shitballs i got it to work. After fixing the testing trigger that i made for debug i got it to fire, so i figured hey what, maybe some triggers are just born wrong and deleted the original trigger3, gave its code to the test trigger, copied and pasted the x and y coords an tested. suddenly this trigger which worked a minute ago does not work. lucky me on returning to the editor the camera was in just the right place to see the trigger flung way off in the corner of the map.
today i learned that if you try to layer triggers on top of each other by copy pasting coords, arma does not like that, and will curse you by flinging your triggers off into the void
Anyone know what causes those Error Zero Divisor errors relating to select? @ me please
Additional question: synchronized object/waypoints/triggers can only be achieved via script of editor correct? Zeus cannot do so?
what causes those Error Zero Divisor errors relating
index thats not in the array
Now thats the weird thing as im using _forEachIndex.
why do you select with _forEachIndex?
Its a set of data arrays that are supposed to be kept synced. I guess they get desynced somehow, the question is why.
I dont believe arma supports 2D arrays afaik
It does.
how so?
Don't know what you want me to tell you
It just works.
What do you want to hear
"how" you put an array into an array, bam 2D
Actually, yeah Im aware it does in a sense but i though select doesnt work with it?
yeh but last i tried ((array select x) select x) didnt work
You may have made a mistake at the time then 😄
perhaps it was a while back so may have forgotten what exactly was my problem then. I had tabled this project for a bit
That said, that pseudocode should work right?
Also any answer on the synchronization question?
what tags do i need to place a code snippet in, for viewing hewre
?
if it isnt over the character limit you can paste it normally and format it.
you can use sqf as the language
see pinned messages 🙃
player sidechat "TEST2.SQF Running";
_fx1= ppEffectCreate ["RadialBlur",400];
_fx1 ppEffectEnable true;
_fx1 ppEffectAdjust [20];
_fx1 ppEffectCommit 5;
player sidechat format ["FX: %1",_fx1];
player sidechat format ["ENABLED: %1",ppEffectEnabled _fx1];
sleep 10;
player sidechat format ["ENABLED: %1",ppEffectEnabled _fx1];
_fx1 ppEffectAdjust [0];
_fx1 ppEffectCommit 5;
sleep 10;
_fx1 ppEffectEnable false;
ppEffectDestroy _fx1;
player sidechat "TEST2.SQF END";
Am struggling to see why the above ppeffect isnt being enabled, the debugging sidechat lines are returning false on both occasions for the enablement. the handle is returning -1 if that makes any difference
am justb learning the ppeffect code, first time dabbling with it
```sqf -line return-
code
```
k thx
initially i stated working in the debug console copying and pasting snippets from wherever, and was getting ppeffects so... must be enabled right /
there are examples on this ↑ page btw
the snippet i am using is a breakdown of the bi pages examples
from what i can see and have read, the code should create a blur effect what i dont understand is why the fx is returning as not enabled
you cannot use sleep directly in the debug console as it is unscheduled
the only returns i can use for debugging is the _fx1 value, returning as -1 and the calls for ppEffectEnabled _fx1 which return false in both cases
I hope you are using a [] spawn around your code
do you have radial blur disabled in your video options?
would have to restart to see, did have a radialblur effect running when i was in debug console though
currently arma switched off
your code seems right though
its on
mmm maybe some code snippet from whatever source has managed to disable it then
how would that effect the base game though rather than just the mission
if you dont have show script errors on btw you will want that on it can help if its an error issue. Arma seems to reset that parameter after updated sometimes for some reason for me at least.
I have showscripterrors on ive been dabbling with ofp arma code since 2002
Just saying it turns off sometimes for me
ok just done a complete arma restart and still getting no fx and values still returning false
I use a desktop shortcut m8, so my startup is always consistent
ive sat here for over an hour before i pasted this, normally in just about all code I have plenty of vars i can return to debug, these ppeffects dont have much to work with
are post processing effects magical as in can effect outside of the arma engine... am failing to see what the hell is wrong
Cant really provide much insight on that as I haven't used it however the BIKI on it does include a while loop for the creation with increasing priority
I tried replacing it with DynamicBlur, same returns
i saw that, and understand the priority base, however other working snippets dont use the while loop or the incremental priority and they worked in the debug console
AHA>>>> success, seems its a priority issue, just replaced the priority value from 400 which was the default value for it to 0 and success
default for it is 100 so i guess you can try that as well
It does state the higher the priority the later it is applied
ok i could see why, after dabbling with all types of ppeffect code it may not have run initially due to a priority value.... however if there was another ppeffect running that should have been terminated when i restarted arma
oh well learning curve thx for the help
It could just be that the higher priority put its spawn after its removal canceling it
the test code is linear and there are sleep com,mands to out wait any commit times
so... maybe a normal bis default screen has a ppeffect on it that appears "normal" ??
any way thats my last 2 hairs gone off my head
and am getting a different return value for the handle, which is 93 ??
Ikr we all know how arma can be. Now for a question on 2D arrays. Is it possible to have in or find process a 2D array by comparing only to the [x][0] index value?
ah its incremental, now 94,, so this i dont understand, if i am " ppEffectDestroy _fx1; " why is the _fx1 number going up when i rerun the script in the same mission instance
Im assuming it doesnt remove old values in order to maintian the handles
like EHs
they function the same way
ah ok have never returned an eh handle, never needed to
yeah it needs the number for deletion purposes
dont know the answer to yours, have always written a function to search nested depths, if it doesnt make it easier create a version of the nested array as a simple array and search that
Well im wondering if im gonna be able to do it with the vanilla commands or if im gonna need to create a function to handle it. And while I wouldnt mind having a synced array, ive been having issues with my synced arrays so im trying to change them to 2Ds
ive been able to edit a specific position by i.e. using _arrayVars set [3, ["some_item",1]]; so change the object on third position to another array
I tried looking for a way to use an array in a key-value type sense, and there ended up stuffing my array with arrays xD
Im aware thats how to do so for set im talking about in and find While I can create function for it, I was hoping that the vanilla commands may support doing so. I guess its not really possible.
I do know theres a way to check if a certain value is part of the array, but it returns either true or false not the object itself
you might be able to use that for more advanced search behaviour i guess though
alternatively arrayInterset can be used to find an array of possible entries in an array
Thats the purpose of in and its what im using it for. That said, I dont need to modify individual values in subarrays so i can use set. But I will need to find the indexes of data sets based of a key value. As such I believe the only way to do so is to make a function to do so as afaik the vanilla command equivalents do not support 2D arrays. I was just asking in case if there was a way to do so I want aware of.
as afaik the vanilla command equivalents do not support 2D arrays
As I said above, arrays inside arrays are just arrays
the commands support these too just like any other array in any other place
i mean you could show your code and i could tell you what you are doing wrong
or you can keep stating that they don't support something that they indeed do support just fine and just ignore everything I'm telling you
So assuming:
grpData = [[group,owner],[group2,owner]];
if (group2 in grpData) then {}
This is pseudocode but this is the functionality im looking for. Afaik, This isnt possible in this way?
_grpData findIf {_x select 0 == group2} != -1
Well thats exactly what I was looking for. But that begs the question, why isnt that just rolled into find like select?
because SQF is made to have many generic blocks
that you can build more complicated things with if you need to
fair enough
Hello, was someone from people around using leaflet script ? I mean dropping them from plane or drone
POLPOX lol your core mod says this ```sqf
File @POLPOX's Base Functions\mod.cpp, line 2: '.logo': Missing ';' at the end of line
Not all sectors are loading in sector control?
What's the matter of #arma3_scripting topic...?
is there a negotiation for isKindOf? I basically want to check if something is not X. Current code is sqf (typeOf _x) isKindOf ["Tank_F", configFile >> "CfgVehicles"] and I want that to check if something is not Tank_F e.g.
Add a not in Front of it @hollow lantern
hey guys can someone help me the problem is that i can't get the doctors to handcuff the civilians (is one altis life server)
(typeOf _x) isKindOf ["Tank_F", configFile >> "CfgVehicles"]
-> _x isKindOf "Tank_F"
-> !(_x isKindOf "Tank_F")
yes typeOf _x is fine there. because I do a foreach loop
yes typeOf _x is fine there. because I do a foreach loop
no
...
forEach loop doesn't matter
{
if ((typeOf _x) isKindOf ["Tank_F", configFile >> "CfgVehicles"]) then {
_x addEventHandler ["Fired", {
_wep = _this select 1;
if (_wep isKindOf ["CannonCore", configFile >> "CfgWeapons"]) then {
_veh = _this select 0;
_vel = velocity _veh;
_dir = _veh weaponDirection _wep;
_veh setVelocity [
(_vel select 0) + (_dir select 0) * -3.5,
(_vel select 1) + (_dir select 1) * -3.5,
(_vel select 2) + (_dir select 2) * -3.5
];
};
}];
};
} forEach vehicles;```
yes its fine in that it works, but its useless, superfluous, nonsense
how does one increse max curator points higher then 1
so just _x is fine?
Thats literally what I just said. yes.
{
if (_x isKindOf "Tank_F") then {
_x addEventHandler ["Fired", {
params ["_veh", "_wep"];
if (_wep isKindOf ["CannonCore", configFile >> "CfgWeapons"]) then {
private _vel = velocity _veh;
private _dir = _veh weaponDirection _wep;
_veh setVelocity (_vel vectorAdd (_dir vectorMultiply -3.5));
};
}];
};
} forEach vehicles;
yeah, I see, the code is from Arma 2 times, thanks for the insight
thanks for the rewrite
hi, im fairly new to the editor aand i want to make a stealth mission ala MGSV, is there a way to makee the ai detection decreased? this regards to gunshots with the supressor, being down low proning, etc.
ai detection decreased
afaik - no. only the overall skill reduction might help
How do I make an enemy attack another enemy from the same side?
I was looking the sideEnemy comand, but, how can I use it?!
Do you want that they attack all each other or just attack one group/unit?
No