#arma3_scripting
1 messages Β· Page 347 of 1
It's clearly able to load the code, and read the variables, but it's like it isn't updating the variables. The sleep / loop is working, because the hint isn't fading away. So why would a publicVariable only be updating for one player, and not another.
Okay, can there be conflicts when you're running two copies of arma on your computer, one being the host and another being a client?
Because I'm getting some things that wouldn't make sense otherwise.
This is getting too frustrating :( Hopefully some sleep will help me out. Night everyone!
replace your hints with systemchat and test it
Maybe a hint is overriding another
I had to learn that the hard way
if you have lots of systemchats, replace them with diag_log and you can find them in the logfile for pretty much infinte amounts.
I had to learn that the hard way
diag_log call {"test"}
what does this do?
mhh ... that is ... problematic then
most linters also probably do that wrong
as ... call has a binary and unary variant
i personally parse that as (diag_log) call ({"test"}) currently as my parser thinks it is the binary variant
Achievement unlocked: Functions
@still forum did you see any kind of syntax or input params for those two?
DeployWeaponAuto
DeployWeaponManual
player action["DeployWeaponManual", currentWeapon player]; no dice with something like that
@still forum i know
no problem for other unary thigns
only that call has a binary and unary variant is the problem
as in the AST the binary has to appear before the unary
SQF parser also reads from left to right afaik
need to adjust parser so that it remembers that if left was an unary and mid is binary, it probably means the unary variant of it
listen to deadmen, read from left to right et voila π
- has a higher priority though
read from left to right. You find + which is a binary operator. Done
its like maths 1 + 2 * 3, its still left to right but the * goes first
that is the whole point
call has a binary and a unary variant
need to add detection for when left arg is already unary, right arg cannot be binary
diag_log call {"test"}
--> diag_log is unary
--> call cannot be binary as left is unary
im simply not sure if a blanket statement of if the left term of what could be a binary command is a unary command, the binary command is in this case its unary variant is completely true
me neither
<@&105622502444711936> what IS SQF doing actually here?
can it check if the code on the right side has a correct structure to return an argument?
e.g. all commands have the proper number of arguments present
Wow.. Okey.. Ignore me and bother BI devs instead
straight to the top
highly doubt i would get an answer anyway
So why bother them then
because maybe i am lucky? π
im just gonna postulate that in SQF a binary command can never have a unary command preceding it, just like a unary command cant have a nulary or value preceding it (barring parentheses)
the real case would be: what if there are two possibly binary commands next to each other?
e.g. ??? BINARY BINARY ??? is also invalid, but at which command does the parser error, the first or second BINARY command?
i doubt
should be parsed as
(getPos (player)) call ({})
"should"
<ANY> BINARY BINARY <ANY> is perfectly valid
no
they cant use each other as argument
see select
either left binary is missing right arg. Or right binary is missing left arg
yes but which one would the engine complain about
so binary command cannot follow on a command
the left or right binary command
unless it is a nullar command
a unary command can be right of a binary command
but not the reverse
and the same with nulary and unary
Okey.
Is assignment?
if not compile as binary
Increment priority till you find a binary command. If you don't find any parse as constant.
parse as Constant first checks if it's a unary function. If not then check variable.
if not then check for paranthesis and if you find them compile a binary again (and goes all the way to here again)
if no paranthesis then check for array []
if no array then check for code
else check for "" string
else check for '' string
else check for number
it finds diag_log. Which is not a binary. So it pushes the unary call to the stack and goes to next element.
it find's call. It first checks for the binary version. It finds it....
it parses a constant again then skips spaces. and checks if there is a binary command. There isn't. So it returns the constant instead. Which is the call unary command
because parse as constant only returns unaries
A lot of recursion as you can see. especially the "Increment priority till you find a binary command"
Because it doesn't do anything till it arives at 11
@queen cargo because https://highlightjs.org/static/demo/ , click all, search SQF ... that's what Discord uses
then i wonder what he asked for cause i didn't get it π
He asked how the SQF parser differentiates between unary and binary call
ah, though he randomly picked the days old discussion with the highlight
Go back to whatever you were doing ^^ Don't be bothered by the guy that choose to bother BI minions for no reason
there is reason for it
we only can speculate
and try to get reason in that question
they actually can check in theory
Well. I answered your question. And probably future ones
If you need more specific info ask a specific question
anyways, that tiny thing is now fixed in my parse function
_response = "text";
_action_x = _object addAction ["Engage in conversation", {hint format ["%1", _response]; removeAllActions (_this select 0)}]; // error undefined var _response
_action_x = _object addAction ["Engage in conversation", hint format ["%1", _response]]; // works
_action_x = _object addAction ["Engage in conversation", hint format ["%1", _response]; removeAllActions (_this select 0)]; // error missing ;
how can i fix that?
You cant do that, because the code inside {} doesnt get evaluated
i am surprised that the later two actually work
You have to provide it as a string you can format variables into
ohhh no wait, addAction also worked with string didn't it?
Yes is what im saying
hold on ... still ... hint is not returning string
No, youd format that into the code string
i want to pass TWO statements to the addaction. the hint and the removeAllActions. But i can't do that with {} because then i can't get the var into the hint.
_action_x = _object addAction [
"Engage in conversation",
hint format ["%1", _response];
removeAllActions (_this select 0)
];```
check it yourself why it is not working
you added a `;` in the array
"hint ""a""; removeAllActions (_this select 0)"
to get the response inside, use it like this: sqf _action_x = _object addAction [ "Engage in conversation", format ["hint %1; removeAllActions (_this select 0);", _response] ];
if it is a string, then yes
btw the big sqf inconsistency
select 0 and %1 for first elements
its the true inconsistency i tell you none of the other ones matter
%1 is easier to implement internal probably
weirdly i didnt even notice this inconsistency
%0 would require to _arrayIndex - 1 everytime
i guess its technically correct because %1 will correspond to _formatArray select 1
but still
_action_x = _object addAction ["Engage in conversation", hint format ["%1; removeAllActions (_this select 0);", str _response]];
it prints removeAllActions in the hint
check the differences between yours and what x39 posted
the hint needs to be inside the string too
m(
because you need an argument in this structure: "hint ""a""; removeAllActions (_this select 0)"
yeah i figured it out, works fine now.
is it normal that the return value of my addAction stays the same even if i delete it?
sure, if you delete it the action index is free to use again
so i'm back at the problem of determining if an addAction is completed.
somehow my approach sucks.
set a variable on the object that increments?
how do i do that?
object setVariable ["asd_counter",object getVariable ["asd_counter",0] + 1]
okay turns out i underestimated what setVariable does.
thanks again
you guys are awesome
i can actually attach multiple vars to the object and vastly simplify my life
keep in mind it only saves locally. if its MP, you gotta add a true > <OBJECT> setVariable ["name",value,true]
so it syncs accross all clients and server
(unless you dont want that, of course)
i'm not sure it matters
the npc dialogues can be individual per player. actually makes sense in the context.
no there are actually problems with this, an NPC can't run away in terror from one player while standing still and talking to another.
yea you might want to block conversations for other players whilst a player is talking with the npc
_dude setVariable ["nig_isTalking",true,true];
then have condition for talking
(_dude getVariable ["nig_isTalking",false];)
Just make sure you remove it from all clients...
Also I found out something interesting
addAction actually only checks condtion if you are pointing at the thing with the addaction
or atleast that's when I got the lag
thats good performance wise
I added 10000 addactions to a unit and didn't lose performance until I was looking straight at him
well (didn't lose) means noticably
from 200 to 120 fps when not looking at target and when looking at target, ~10-20 fps
sooo, add them to a player to fps-bomb him? π
and i thought my ideas for punishing people were rude
To punish players for leaving AO, add faulty functions to profilenamespace so their game will break every time they launch it π
well i thought up a mission that includes attacks on the player base and limited ammo supply because the enemies obviously messed with your supply lines in case people wank too much in the base instead of doing their assignments.
use KKs server switch fnc to switch them to a different server
a mission with low supplies to recover your supply lines sounds kinda cool, tho
on that thought, it would be hillarious if people actually would find a way to inject that code to other players. they could just go around and steal players π
Hahaa
Hide a loop that runs every time you start
in like random time
It joins your server π
Server is ALTIS LIFE. hahha that's like worse than hell π
~"I was playing my normal milsim server and then suddenly I was in a life server with a bunch of 9 year olds"~
but also, you can send nasty people you don't like to an altis life server ...
The possibilites are endless
im a fan of attaching them to the bullets they fire
I know what im going to sound like, and I know this seems crazy but i canΒ΄t run a while or for loop anymore it just wonΒ΄t run no matter the condition
well youre doing something wrong
Is there any way to model TFAR and have the vanilla radio channels play out of a specific side of audio? Group in left ear, Side in right, etc.
you can´´t go wrong with while {true} do { send hint ...
i assure you the commands work
i tried to debug it but it just wont run
so either youre editing in the wrong place, not executing, or making a different error
yes you can Trail, you can forget the ;
damn
@blissful wind ive had weird things crop up too. Variable = null; just refusing to go off when the trigger was fired, etc.
hey thanks @indigo snow didnΒ΄t realise that yet huh
give me the most basic while loop you can think of
wont run
dude im not that basic
ok i need to let the steam off from tis be back ina bit with coffee
@blissful wind where are you putting that loop is more interesting.
idk why youre calling me out then, the commands work
for "_i" from 0 to 8 do {
systemChat format ["test_%1",_i];
};
^ put that in your debug console
i went through all the basics
if youre not that basic, im assuming youre not running into any errors in your RPT?
this is why its frustrating
it runs all fine up until the point where it enter either a while or a for
everything else in the script its working fine
like i said i did some debug
and it runs up until that point
and then any basic while or for just wont run
no matter how basic
damn
have you put the above in?
because then it becomes relevant what yor code looks like
doesnt run
because i double assure you the looping commands work
i do. show me the code bit?
@blissful wind why don't you post some code?
im just going to restart it all
@hard hamlet you want me to write a basic while like cmon
well yes
im still interested in this loop that refuses to execute
probably a script error
and you forgot to enable showscripterrors during arma startup
--> loop gets aborted due to script error and those are not shown to ya
check RPT log for errors
unless you disabled those too
@queen cargo yea, it was all working fine yesterday
im just rebooting all
@queen cargo thanks I will check the logs
weird stuff man
π
its not wierd, youve just made a mistake somewhere
ok
im actually doing something else .. i ll get to it
I'm afraid you can't do that. You asked for help so you're morally obliged to try everything we say.
well my editor has a "open log (latest)" button and i mash that often.
would recommend.
good tip thanks
poseidon on armaholics
also if you type like, "while" and hit <TAB> for autocomplete you get like this
while {/* condition */} do
{
/* STATEMENT */
};
kinda hard to fuck up then.
ye
i know
hats what i ve been saying
you cant f it up
but it does
and thats why
IM MAD
HAHAH
just mess up the code inside the loop et voila
π
common one is using sleep when suspending isnt allowed
no
eh if we're talking about fcking up im thinking local variables in diffrent scopes
for debugging i did a while true and set it to hint something back
basic
and nothing
nothing on chat
nothing anywhere
just post the code ... or stop complaining @blissful wind
its dead
i closed all for now but i will no problem and i wil l tell you what was wrong with it
right now im burnt
eheh
but lets jsut say you write that while with a remoteexec hint
and nothing
i promise you the looping commands work. there would be some very big hubbub if they didnt.
user-error
relaunching
while {true} do {
[alex, "its looping"] remoteExec ["sideChat", 0, true];
};
its working now
weird but it did
i can't use global and local vars in the same script?
what? sure you can
_p = player;
currentTime = time;
_p sideChat str currentTime;
some scopes dont allow local vars, tho
namely the ui execution boxes (debug menu, init boxes, etc)
yeah i derped a bit i figured it out thanks
namely the ui execution boxes false
_var = "foo"; _var will work fine in the debug menu for example
problem is more: = is not returning anything which then will cause script errors if tried to print
diag_log call {_var = "foo"}; should also throw
is there a setting or a script that could cause AI kills not be displayed?
difficulty
ah, I assume that would be because I am running veteran?
in the scoreboard I can only see deaths
and negative points for crashing a vehicle
yup
private ["_var1","_var2"];
{hint "hello"} forEach private;
i guess this is supposed to not work
uhm ... what? π
//Method 1
private ["_var1", "_var2"];
_var1 = "foo";
_var2 = "bar";
//Method 2
private "_var1";
private "_var2";
_var1 = "foo";
_var2 = "bar";
//Method 3 (requires instant assignment)
private _var1 = "foo";
private _var2 = "bar";
those are equal
as lil extra: all those variants are already supported in my SQF-VM
care to elaborate?
mhh?
SQF-VM ?
https://github.com/X39/sqf-vm
it is a project of mine that emulates SQF
also has a bot available that will execute your code
can be found in this channel (& server) https://discord.gg/b5qCUCK
holy moly.
do not get hyped too much π it is not yet supporting the whole range of arma commands
but the basic operations are mostly possible
new commands are added pretty much on day2day base
feel free to test the bot in the channel i linked to ya
to use you just need to @SQF it
Can someome help me im trying to script weapons onto my playee using chat but i dont know how to
Player*
Using chat? Wot @north vortex
No i meen
How do you script while on you player
Im trying to get an rpg in argo but i can equipt it with arsenal so i have to script it
Nvm i figured it out but i need the name for the launcher
In editor i add a weapon then save to arsenal
@north vortex go to the Argo discord: https://discord.gg/7YB5FBa
If you have a trigger, oncond triggeringvariable == 1, onAct sets a bunch of variables to null, and at the end sets its own triggeringvariable to 0, would it stop itself from nulling out the other variables?
looks at his to do list
jumps off from next building
declines and climbs up that building to try again
i'm starting to not be totally retarded. i wrote like 100 lines of codes with only 3 errors inside.
is porud
can't spell proud
and done for today ...
fixed enough ... implemented enough ... and even worked 4 hours
see ya all
@tough abyss i found out how you had to script player weapons in eden editor then save to arsenal and the go on muiltiplayer and load your loadout
Well, that kind of sucks. Default parameters doesn't work if the number isn't whole D:<
Ah well, that wasn't so hard to work around. Also, holy shit - having overcast on the highest completely changes this mission.
Took a while, but here - this should be fun come mission night. https://youtu.be/2JiEYMWFpiI
@ShiningRayde#2444 no. TFAR is 0% connected with ingame audio.
@queen cargo Talk about UI execution boxes not liking local vars
problem is more: = is not returning anything which then will cause script errors if tried to print
In case of Triggers and Editor UI script boxes that's the opposite. They need a void.
@ShiningRayde#2444 If you think logically.. Then yes. Could also set the trigger activation to once.
when interns add things without supervision to your project optix
like index's starting at 1
that really screwed with me on format[]
That was not done by "interns" That was done by core engine developers back in OFP
they mind as well be interns
Trust me. No.
I spent 15 minutes "spellchecking" mission code before I realized dammage was a sqf thing
That is indeed dumb. Probably was written wrong back in OFP. And when they fixed it they didn't want to break old scripts. Which is a good thing
%1 says "first element"
first elements should all be 0
Btw it's also %1 in Java, PHP and probably many others.
Do you even know why C Arrays start at 0?
there is a reason I don't like java or php
i know there is a specific reason they do it, but it breaks my pattern of thought
to go from starting at 0, to starting at 1
between things
format litterally uses %number -> array[number]
as the array contains the format string itself as 0'th element this works out nicely
that actually makes my happier
So you are actually starting at 0. But embedding the format string itself in your format doesn't make sense
format[0, 1, 2, 3] || format["", var1, var2] is what you are saying
I think so...
If you could start with %0 Arma would have to internally always +1 the index to get to the right element
which isn't that hard
lol
the reason we aren't writing in machine code
is because higher level languages are easier/faster to write and understand
i'd rather it do things in the backend to make things standardized across everything
Also for most Humans it's easier to start counting at 1. So that's what high-level Arma uses.
It's still inconsistend with select though
so you don't have to think about it on front end
yea, their arrays start at 0
that is why it took my awhile
i just started using it as if 0 was first element
and didn't understand why my outputs were off, and first element was blank
maybe bad coding practice not to do with known outputs, buuuuuuut
ingrained habit not to question the 0 index
but thank you, your explanation even if wrong makes me not angry at it anymore
also, while I do dislike java and php
im pretty sure their arrays start at 0
and most of their functions operate first element is 0
but I'll beleive anything negative about them
Yes that's true. But their string format methods start at 1
All other string formats I found were using {0} instead of %1.
Every one I found using % also started at 1
mm, i've never used that way so I guess maybe that is why i haven't seen it
I typically just add strings together
string = "" + val + "";
yea, I was basically following what other things are using because I realise there are all these weird optimizations
That's 0.003 ms differnece
I use isEqualTo because it stops from =/== mistakes
I started by mixing those up π
anybody familiar with modding benny's warfare? I want to edit it a little bit so AI does not sprint when moving to objectives.
@thorn saffron https://community.bistudio.com/wiki/Arma_3_AI_Behavior
maybe check if you can find that command somewhere in the scripts
i recommend an editor that can search a whole folder of files at once for a keyword
Seems like the missions uses some magic AI management that does not use weapoints. I searched far and wide for the weapoint, speeds or behaviors, but I got nothing
got a link to the mission?
becti_0097.Tanoa\Server\FSM\update_ai.fsm:
becti_0097.Tanoa\Server\FSM\update_commander.fsm:
becti_0097.Tanoa\Server\FSM\update_salvager_independent.fsm:
becti_0097.Tanoa\Server\FSM\update_worker.fsm:
becti_0097.Tanoa\Client\Functions\FSM\Functions_FSM_UpdateClientAI.sqf:
look for commandMove and doMove
i think you should be able to control the speed with https://community.bistudio.com/wiki/setSpeedMode right after the move command. not sure tho.
Ok, so I can't open the mission config with the config viewer...
http://i.imgur.com/xPqtR6d.jpg
My question:
is it possible to read teh mission config to recieve all playable units (slots)
I want to get a list of playable slots (even those which are not slotted)
Why can't you? double-clicking doesn't do anything?
Nope, that one does not open
Others open
renamed
mission to missionSQM
class MissionSQM {
#include "mission.sqm"
};
works now...
trial and error... always works
Now I just need a script that gets all the groups for all the side and units from insdie...
Ok, got one issue with this now...
If I don't set the name to the group
How can I refference to it with a script?
every item in the config has id = 9;
Can I somehow use this to access the item in scripts?
Maybe add it to an array then call upon that?
I was actually writing something, not sure if it'll work, to get a list of all the groups you have.
_groupsArray = [];
{
if _x side == west then {
_group = (group _x);
if !(_group in _groupsArray) then {
_groupsArray pushback _group;
};
};
} forEach AllUnits;```
Though, I've never written anything like that, so
Β―_(γ)_/Β―
No you can't
So im making a global info stand placement script that you can buy a license for in altis life. For some reason the variable i give it should be a string but is staying as a variable is there anyway i can change this? https://hastebin.com/bisapohino.cs
@spice kayak https://community.bistudio.com/wiki/allGroups
Well, you know what? Fuck you, man :(
You too π
I'm joking, but that is convenient haha.
I wonder, would what I wrote do the same thing?
@grizzled spindle What is a variable but should be a string?
I guess the best I can do is check if all the groups / units have names... And tell the mission maker ( YOU GOTTA SET A NAME TO ALL UNITS ) with hintC
Ah I see
Wow..
Genius
For one _type is a local variable that doesn't carry over into the addAction code
second. _type is a local variable on the SERVER and you execute the addAction on the client
you can use format to push it into your addAction code if it is a string or number
Yeah doesnt seem to like that
Yeah, I was going to say, maybe try without the underscores.
Like, 'vType' instead of _type.
use the code-as-string variant of addAction
Why are there so many people lately that try to push local variables into addAction?
funnily enough that came up yesterday too
I'm pretty sure I had addAction issues the other day too.
Though it wasn't for variables.
not only yesterday. That's atleast the 4th time in the last 7 days
code as string?
I'll just copy over an example snippet
_action_x = _object addAction [
"Engage in conversation",
format ["hint %1; removeAllActions (_this select 0);", _response]
];
My addAction is a thing of beauty! If by beauty, you mean shit thrown at a wall in hopes of it sticking. sqf pOperator1 addAction["EMP Charge", {{execVM "emp1Script.sqf";} remoteExec ["BIS_fnc_call", 0]; playSound3D ["A3\Missions_F_Bootcamp\data\sounds\vr_shutdown.wss", pOperator1, false, getPosASL pOperator1, 5, 1, (_vEMPRange * 2)];},nil,6,false,true,"","true",0];
addAction accepts the code part as a compilable string as well
since its been around since OFP / SQS
@peak plover https://community.bistudio.com/wiki/playableUnits. Feed playable units into a loop to get the group, then pushbackunique to add their groups to an array.
no you gotta do away with all {}
For me, or jcbjoe?
and use format to insert local variables into the compiled string
well its joe whos asking the question, no?
Yeah, sorry, I thought I'd just ask.
@delicate totem https://community.bistudio.com/wiki/allGroups
just in case _x is a string, in which case it needs to be str'd (so the format argument is str _x), @grizzled spindle
@still forum I was thinking there was a command with an exact example but couldn't remember it.
I just posted the exact same link 9 minutes ago
you can use pushBack and then arrayIntersect the array with itself to filter out duplicates too
totally the best way to do this
ugh, backpedalling on something said a few days ago
parseText format
is not the same as
formatText
Seems like formatText is not making str to text
Where is the problem? Last point in screenshot?
yes
https://community.bistudio.com/wiki/parseText
Check the example of parseText though
That point is using formatText
uh duh
okay, so parseText is needed for using <t>
Okey.. You have to provide Structured Texts to formatText
Okay gotcha
messy stuff
I now understand
formatText is format for structured texts
not a combined parseText format
That's my bad, misunderstood
Well, anyway. now mission makers will know if they fucked up setting up units
hint format ["Skills %1", skill unit1]; trying to get the game to return the skill value of a unit, I'm pretty sure this is wrong, but not sure what XD
Curious, how would one add a spacer to mission parameters?
dosin't return the valuse of say, aiming accuracy?
Actually, let me try something stupid.
systemChat str (unit1 skill "aimingAccuracy");
@spice kayak
class p_headless_1
{
title = " === HEADLESS PARAMETERS === ";
values[] = {0};
texts[] = {""};
default = 0;
};
class p_headless_enabled
{
title = "Enable Headless Client";
values[] = {0,1,2};
texts[] = {"NO","YES","AUTO"};
default = HEADLESS_PARAM_ENABLED;
};
I tried that, and it dosin't show anywhere when I enter game. am I looking in the wrong place?
@coarse atlas Are you using it on a unit init?
yep
it probably appears too early
just use hint in that case, but it will override other hints
chat gets reset at some point me thinks
how do I change it to hint? just change out systemchat for hint?
I understand the first parameter, the p_headless_1, but why the second? Is that needed, and why?
hint str (unit1 skill "aimingAccuracy");
yay
Booyah! http://i.imgur.com/BkkHyNI.png
very nice design
biggest reason I'm trying to figure this out is a freind looked at a graph in the wiki(the one on Cfgaiskill) and thinks that that's the defualt settings for arma3 (and we kind of agree a 0-100 iterpolation would not be a good thing XD)
Thank you :D I don't want people to complain about mission / unit balancing, so I figured I'd let them set it how they see fit.
The AI system was changed very recently in dev-branch. Not sure if that made it's way to stable branch already. They removed the linear interpolation thingy
I'm loving parameters so much. They're amazing.
The previous version of ace3 fiddled with CfgAiSkill, so if you are using ACE3, your ai might have gotten harder in the last month or so...
@spice kayak
http://i.imgur.com/wGyWmD2.png
I thin I will rip-off your design instead of this π
Ha, sure!
sounds like the scripting for cfgakskill will change too then?
class Weather {
Title = "Weather Settings:";
Values[] = {0};
Texts[] = {" "};
Default = 0;
};
class Spacer1 {
Title = " ";
Values[] = {0};
Texts[] = {" "};
Default = 0;
};```
CfgAiSkill means you can set the limit to what setSkill 1 will do. With ace3 I think they changed the aimingAccuracy when set to 1 be 0.7 or sth
I mean, I'm sure you didn't need it, but still haha.
I really wish they would allow for commands to disable skill interpolation
Yeah, I might be ok with writing a few lines of sqf, but my artistic value is 0 π
I don't use ACE3, XD, and arn't they just disabling it compleatly now?
Ha, I ain't artistic at all. You should see the thumbnail for this mission haha :/
I don't think they are. (I hope they are)
@still forum said it if you scroll up a bit, it's on dev branch.
so at the very least, it'll be here by the new DLC.
Man, speaking of DLC, I wish Arma would explore exosuits a little more. The tech has come quite a way recent years, and I'd only imagine what it would be like in Arma 3's time.
Actually, when is A3 set? 204x?
35
http://i.imgur.com/x5xrsGH.png Looks much better Thanks to you π
Cleaner, readable
Oh, nice!
Hmm
vGuardStamina = ["GuardStamina", true] call BIS_fnc_getParamValue;
player enableStamina vGuardStamina;
Error enableStamina: type Number, expected Bool
param values are numbers
you have to do
vGuardStamina = [false,true] select (["GuardStamina", true] call BIS_fnc_getParamValue);
Also default value from true to 1
vGuardStamina = [false,true] select (["GuardStamina", 1] call BIS_fnc_getParamValue);
someone could mod in exosuits.
though curious, what are the next 2 DLC sceduled after laws of war again?
combat operations and tanks
omg, my mission 100% works, error free.
π
I've been working on mine for months
Ha, well this project started on Saturday, so.
It's ok π I bet it's worth it
All with the idea of 'Hey, EMPs are cool, I want to make one. Okay, now I've made one, but it's broken [10 hours later] Man, I should make a mission out of this!'
Good luck with your's though!
Great dude, soudns like a fun mission with a cool feature
I mean, I'd love to properly test mine, but I can't, sadly. I can only test what I can do myself.
Ha, thank you.
Should get a bunch of you guys to try it out :P
But nah, should hopefully have another mission night coming up soon. I'll let the guys try it then, which is when it'll more than likely break.
I'm currently making zeus modules for my mission to allow for zeus to respawn / change respawn locations.
Yeah wish scripting was faster
Not going to lie though, I've enjoyed the challenge.
I used to program a lot in high school, and was pretty good at picking up new languages. Was actually doing pretty good, grade-wise. Sadly, due to personal reasons, I ended up flunking and not programming any more. Only recently have I dived back into A3 mission editing / creation, and decided to try the scripting side of things. It's been one hell of a ride, but it's been great.
Thanks to you guys too, really.
Sounds like Intercept π #shamelessAdvertising
So high school programming doesn't involve C++? Sad world :/
Hey @still forum where did you hear about interpolation of the AI skills being removed? I want to take a closer look.
Nah, I did C++ in highschool.
Fucking visual basic, man. haha.
Least, that was one of the things we did, which included C++.
I remember one of my earlier languages, though it's rather embarrassing haha.
...GML...
@coarse atlas
https://forums.bistudio.com/forums/topic/150499-ai-discussion-dev-branch/?do=findComment&comment=3222112
https://forums.bistudio.com/forums/topic/150499-ai-discussion-dev-branch/?do=findComment&comment=3221677
https://forums.bistudio.com/forums/topic/150500-development-branch-captains-ai-log/?do=findComment&comment=3221641
https://forums.bistudio.com/forums/topic/150499-ai-discussion-dev-branch/?do=findComment&comment=3220897
https://forums.bistudio.com/forums/topic/150499-ai-discussion-dev-branch/?do=findComment&comment=3220586
I guess the last one is what I read
so not getting rid of it, just changing it then?
There we go, my mission in a nutshell, @peak plover :D http://i.imgur.com/TwOfnIg.png
Hey all. Is it possible to change then recompile these functions from BI? https://community.bistudio.com/wiki/Category:Arma_3:_Functions
if so, Is it possible to do it through description.ext?
Have any particular one in mind?
BIS_fnc_ModuleCurator
Just copy the insides and make something like nig_fnc_moduleCurator
This is the function used to start Zeus Curator. I know for starters, you need "allowFunctionsRecompile = 1;" in description.ext
Well, this is the code behind it here; https://hastebin.com/fegomupede.sqf
For my purposes, I need to change BIS_fnc_ModuleCurator spiecfically
I can't just copy the function
onto a new one
If you use "allowFunctionsRecompile = 1;" then I can change the function inside init.sqf. But I want to change it at mission start, which means I need to change it in description.ext. Surely this is possible, because you can define functions there
@spice kayak that's awesome. The text could use a shadow, because it's hard to read (blue on especailly).
Very nice polish on the mission. loading screen like that is sick
Actually, can you set the loading screen image?
Yeah
I mean, the big one, not the little thumbnail one.
There's a mod for that
Because if so, that would totally be the background (without the text)
full screen mission loading screens
Aw, I was hoping it could be done without a mod.
I reckon you can, but you gotta hop some hoops
Oh yeah, that totally reminds me about the ticket I had to make for one of the modules.
setPosATL vs setPosASL
Which should I use for unit that could be put anywhere
Carrier, building, top of building, etc.
Probably setPosASL, considering you said anywhere. You'd rather rely on the sealevel, a constant, over the terrain level.
But won't getPosATL be correct above water, because the ground still exists?
All I want to do is TP players...
So I guess setPosATL is fine..
perfect.. I just wanted for zeus to be abled to set respawn position and set it on top of objects so for ex. I can spawn a bench on top of a carrier and then allow for players to respawn on the carrier
Also can set respawn position on top of objects in editor, by moving objects
My mission is slowly taking form as well π
Yeah, sleep tight, glad you figured your things out!
Modules are like units.. they have groups etc...
So my question is what typeOf do I use to check if something is a unit/ has group
I want to use setOwner / setOwnerGroup
Will AllVehicles have modules?
it shouldn't
entities does though
vehicles should only return vehicles, nothing else
ahh, I'm using addEventHandler ["CuratorObjectPlaced",{
if !((configfile >> "CfgVehicles" >> (typeOf _unit) >> "_generalMacro") isEqualTo "Module_F") then {
// Change object owner
_unit setOwner (owner mission_ai_controller);
};
I'll try this...
_unit isKindOf "Module_F" is probably better/easier
if !((getText(configfile >> "CfgVehicles" >> (typeOf _unit) >> "_generalMacro")) find "Module" > -1) then {
Because there are diferent types of moduels apperntly
Ohh, isKindOf checks subtypes... Thanks!
Very very nice
So i obviously messed up by using a local variable in a global scope? but i have no clue how and where exactly. I have little experience with the namespaces.
Error position: <private ["_emotion","_neutral", "_annoye>
I can't see this in your code
you're correct
the file i linked is conversation.sqf. --- fn_conv_hello.sqf : https://pastebin.com/xpSVGrh9 --- fn_conv_final_stage.sqf : https://pastebin.com/xNDXEMVG --- fn_conv_enemy_activity.sqf : https://pastebin.com/NpHH1J9v
These are the 3 main files i call in conversation.sqf for the responses. they all have a bunch of privates that look like the list in the error message
I'm not sure which file specifically is at fault
if (typename _destTarget == typename objnull) then
{
_dest =
[
_destTarget,
_dest param [1,false,[false]]
]
}
else
{
if (typeName _destTarget == typeName objNull) then
{
_dest =
[
_destTarget,
_dest param [1,false,[false]]
]
}
else
{
_dest =
[
_destTarget,
_dest param [1,0,[0]],
_dest param [2,0,[0]]
]
};
};
(typeName _destTarget == typeName objNull)
are both same
What purpose do they have?
Why Jiri, why
_var = true;
if (_var) then {
//runs
} else {
if (_var) then {
//never runs
};
};
Why?
if (true) then {avert your eyes!}
Quick question, can you get like "bones" with sqf?
like an arm, or the torso etc with sqf
nobody has a hint for me with my problem above? I'm failing to see the issue.
@waxen tide
private ["_emotion","_neutral", "_annoyed", "_afraid", "_switch", "bool", "attemps"];
This line is wrong.
You can only private local variables
bool is not a local variable and therefore cannot be used with private.
bool, lol can that even be used?
yes
bool is not a reserved keyword, so it can be used. But using globals without OFPEC tag is very bad style.
Emotion system sounds cool btw
Generally naming a variable after it's type (only) is bad style. Even _bool.
@little eagle thanks. I think i'm slighty too tired.
nigel, this bracket placement gives me eye cancer.
bis_fnc_setTask
:^)
@ππΆπ²π΅ ππ²πͺππ#4898 is this for an aimbot π ?
Your at does not @
I see π
refund it
systemChat str ["a" in allVariables player, player getVariable "a"];
player setVariable ["a", 1];
systemChat str ["a" in allVariables player, player getVariable "a"];
player setVariable ["a", nil];
systemChat str ["a" in allVariables player, player getVariable "a"];
[false,<null>]
[true,1]
[true,any]
π€
Magic trick of the day.
Bamboozled!
So, I was looking at ways to prevent someone from picking up all but one object, yet the only methods I've found so far to prevent inventory acess is to close the inventory window when it's open. Is there another way to handle this?
Yeah, I was just looking at eventhandlers then. Was thinking of the possibility of remove all objects from the dead player, minus the uniform and FAK.
but EVH might work.
You could use the playerkilled EVH and strip them there also
No problem π
Wish there were a simple way to remove the 'Inventory' action that pops up though haha.
I'd just replace that with my own addAction and then it would be perfect.
Actually, hang on.
If you disable simluation on something, wouldn't that disable the interactions?
Actually, then I wouldn't be able to add an action either.
Fuck.
:/
ugh, what do you need to achieve?
Ha, well, I was thinking, for the Operators, I don't want them to be able to take all the gear the Guards have, like their armor, submachine guns, etc. Instead, I want them to only be able to take a FAK, which essentially gives them one more chance to revive / heal, as they're outnumbered.
Shhh you. I know I said it was pretty much done, but I couldn't help myself :C
I have a basic idea of how it would work, though I'd have no idea how to script it.
I'd just strip vest and bag, empty clothing and add 1 FAK to clothing π
Ahh, don't want them to loot corpses...
GuardFAKArray = [[Guard1,FAK1],[Guard2,FAK2],[Guard3,FAK3]];
{_x addeventhandler["killed", {(_x select 1) getPos _x); _x enableSimulation false;}];} forEach GuadFAKArray
something like that?
I'd have no idea how to actually write it.
Never used arrays like that before.
Oh, sorry, forgot to add.
So, only fak will be lootable?
You'd just need to do player add eventhandler killed in the init.sqf
Then removevest and removebackpack, get array of clothing items, remove them and add a FAK?
Oh yeah, I probably could just spawn a FAK on their body, instead of teleporting one.
duh.
They all wear the same clothing, so :P
π
That should make it easier.
@cold pebble , but that would make the units naked...
But I don't exactly want them to spend the time opening the inventory, going into the clothing slot, dragging the FAK out.
Agh, perfect
Nigel I mean as in find what's in the clothing, remove it, add FAK
OH
Well just remove everything plop a FAK with the guy
Nah, disableSimulation, and make a new action that says "Loot" or sth like that
Well you can leave the clothing, and empty it with a forEach and the array which is the clothing items
Then it'd be a bit less weird
Yeah, that's what I was thinking, Nigel.
{addEventHandler["killed",{"Item_FirstAidKit" createVehicle getPos _x; _x removeAllWeapons; _x enableSimulation false;}];} forEach guardArray
I still hate how it's createVehicle
Ah yeah, let me just drive around in my FAK.
π
BAZINGA
Use KK code as refference to create a rotating FAK π
It's like GTA (old ones)
Ha, oh jeez.
Actually, if this was executed locally, for the Operators, would that only removeAllWeapons and disableSimulation for them, and not the guards?
Should probably check how those functions execute.
remoteExec this function instead https://community.bistudio.com/wiki/enableSimulationGlobal
wait... not sure if they changed this command or not...
No no, but I like it locally.
That way, the operators will only be able to take the FAK, as where the guards can take the ammo and weapons if they get low.
:D
I feel like you, I always find new things to add
Yeah, I know, and I hate/love it.
Nothing is ever truly complete for as long as you can think.
...
It's just what makes us human
If we didn't always look into the next best thing or improvements, we would still be banging rocks together
Ha, exactly.
So, if my scripting is correct (haha...), this might work?
guardArray = [];
{
if (side _x == west) then {
guardArray pushback _x;
};
} forEach allUnits;
{
_xname = str _x;
if !(isNil _xname) then {
_x addEventHandler[
"killed",
{"Item_FirstAidKit" createVehicle getPos _x;
_x removeAllWeapons;
_x enableSimulation false;
}
];
};
} forEach guardArray;
for some reason, isNil doesn't like _x, or even (str _x). At least, in my limited experience.
scopes
If they are on a different side, couldn't you do the initial check if they're west then then add eventhandler to player?
Well, I want this to be run from someone who isn't west, so.
I'm not sure if that would work.
But all that's doing is adding the EVH to a list of people on the west side is it not?
Yeah, but executing it in a local, independant-only script.
I want the eventhandler to only happen for the independent units.
'happy' fuck me
Ohhh I'm beginning to understand π
Ha, sorry!
My bad
To explain it better, the only people I want the bodies disabled and unlootable for is the two units who aren't blufor.
isNil {_x} does that not work
apparently isNil reads strings, not objects.
Least, that was the error I was having a while back using it.
Hell yeah!
First time I've used pushback too \o/
Anyone have any clue how much data default zeus modules transmit to clients and if I should be careful with what I send?
Achievement Unlocked: pushback
Have you tried param yet?
Would that little performance button do something for you on the debug console?
ah, I believe so.
Wait, I've used parameters before, in the sense of adding variable, user-defined settings to the mission
Does nothing for me, but I need to find out if sending an array with ~10 elements probably max 100 char is too much...
Ah, sorry, I've used BIS_fnc_getParamValue, so I'm not sure if that's what you're talking about.
It's the most glorious of commands
it's used in functions / scripts instead of select
One day, you will find out about the glories of param, some say it's better than recieving your firstborn baby and holding it for the first time
Ha, that might be so.
So far, I've been mostly proud of my Parameters screen haha.
Also, can addEventHandler not have multiple lines of code?
Yea it can, but it should not, as it will be compiled every time.
ah, so call instead?
use {call myFncWhenEH} instead
yeah
eventHandlerMP will suffer hardcore with that if you just put in a function, that's like 100 lines
sends 100 lines every time...
Yeah, that's understandable.
oh
I'm an idiot
_x removeallWeapons should be removeallWeapons _x
so this whole time, I thought i was fixing one issue... when it was another.
Hmm, well, the _guardArray part works, but the addEventHandler doesn't.
No errors, just nothing happens.
gimme code
actually, isNil is irrelevant when it's running off an array that is purely compiled of units that exist.
Haha.
Not to say that'll fix it, but it was funny.
[] spawn {
_guardArray = [];
cLootable = {
"Item_FirstAidKit" createVehicle getPos _x;
removeAllWeapons _x;
_x enableSimulation false;
};
{
if (side _x == west) then {
_guardArray pushback _x;
};
} forEach allUnits;
systemChat format ["%1",_guardArray];
{
if !(isNil {_x}) then {
_x addEventHandler["killed", {call cLootable}];
};
} forEach _guardArray;
};
is the createVehicle syntax correct?
"Item_FirstAidKit" createVehicle getPos player
does that work
(in debug)
Where is it wrong sorry?
_x wouldnt be defined in clootable
cLootable = {
_unit = param [0];
"Item_FirstAidKit" createVehicle getPos _unit;
removeAllWeapons _unit;
_unit enableSimulation false;
};
Even if it was called within the forEach thing?
clootable is called from the evh, not foreach
IT's in the EH now
That code is like "Got this EH, none of that forEach shit anymore"
And he does not care about your _x
Aw, alright :c
Yeah, fuckhim!
eek
Also, despite enableSimulation activating, I can still interact with inventory. Was hoping that wouldn't be the case :C
you can try lock (not sure 'tho)
add containerOpened EH to the dead unit and do code {(findDisplay 602) closeDisplay 0;}
Yeah, I figured that would work, but wouldn't that look a little odd? Like, a flickering?
Should instantly close inventory when it's tried to opened
EH runs in unscheduled, means it happens before the frame next frame is displayed?
Ah, that might work.
Try it, I've never done it 'tho so I dno
Well, instead I've just made it so that it clears their body of everything but their uniform, and puts a FAK on the ground next to the body. I guess this also allows them to 'disguise' if they want, but they'll only look the part, they won't have the weapon for it.
I'll just say 'it's a feature.'
Duuuuude. I've connected the platforms and shit. This is actually great.
The what now π
Okay, so the mission area is docks, and there were quite a few higher platforms, pipes and all that.
I've connected some of them, allowing the operators to traverse more vertically.
Like so! http://imgur.com/a/3m0yD
(Orange lines mark the new paths)
Ha, maybe. I'd need to playtest it first though.
Yea ofcourse
if(_dir2 > 2) then```
not optimization but nothing happens if _dir2 == 2?
cant tell if intentional or not.
_dir2 could reuse the identifier of _dir
I'd prefer if the 2nd and 3rd if statements were merged into one. The Indentation is a bit too much IMO
@velvet merlin is it only 1 loop total / max?
Don't just add a loop per vehicle / unit
Make a loop handler for your loop and loop through all units with that... I had ~3000 units cached with no performance drop when checking for uncaching π
Also means there is no sleep per vehicle (no clogging up scheduler)
do you reckon engine solition to _dir = [_vehicle,_target] call BIS_fnc_relativeDirTo; would be faster?
I don't understand _dir2 = 360/_dir; and _dir2 < 2
This seems more intuitive to me:
private _dir = [_vehicle,_target] call BIS_fnc_relativeDirTo;
private _increment = [-1,1] select (_dir > 180);
_vehicle setDir (getDir _vehicle + _increment);
instead of all the stuff in the middle.
Might have to flip the >, dunno
Isnt relDirTo obsolete with the new alternative getDir syntax?
Yeah.
Converts degrees to radians @little eagle
What no
Maybe?
No
Radiants are 0-2pi in my country, not 0-1
@peak plover one per static gun
Ah! It checks if dir > 360?
degrees/180*pi - deg2rad
private _dir =_vehicle getDir _target;
private _increment = [-1,1] select (_dir > 180);
_vehicle setDir (getDir _vehicle + _increment);
(The second pair of parenthesis are optional : ))
do parenthesis kill performance?
Yes!
Almost 1 ms per parenthesis
That's actually a lot
Its actually a lie
Its actually a lie
This is a lie.
The 1 ms per parenthesis part is
Its actually a lie
This is a lie.
That's a lie
Or are we diving into that logic branch again
This statement is false.
Magic trick of the day.
10:00:31 Error in expression <_a = []; _a pushBack _a>
10:00:31 Error position: <pushBack _>
10:00:31 Error 975157240 elements provided, 708879920 expected
π
Hereby proving the list of all lists can't contain itself
does EachFrame EH work when executed on dedi?
isnt the setup and type of conditions, and sleep design way more relevant performance wise compared to the innermost code?
once per tick i assume?
Per frame
@velvet merlin If the innermost code isn't even executed because of the conditions.. sure.
wait what, dedi draws frames?
No. frame != render frame
k
Frames has "nothing" to do with what you see.
The actual rendering of an image is only about half of the frame time
well i would usually call those game ticks
@velvet merlin I'd push the _vehicle getVariable ["LIB_ARTY_AI_DIR",true] right to the beginning and if it doesn't match do a longer sleep
They are called frames in this game.
All those sleep are a ugly headache, so no one wants to touch them.
Foley, the Draw3D mission eventhandler wouldn't be executed on a dedicated server or headless client.
That is what you were thinking of.
inPolygon is kinda same as inAngleSector
Except the AngleSector is an open sector. And inPolygon is not?
But FAR worse if you don't want a max.
Also harder to calculate compared to inAngleSector.
sure
Though as inPolygon is in engine and inAngleSector is probably SQF that might not matter
Always take the engine command over the SQF
#Intercept
@still forum good point. ty
is there any way of knowing if/when drawTriangles will make it to a release build? :/
drawTriangle, even
If it's in the RC, then it should make it into 1.76.
Unless they find a problem with it.
fingers crossed
π€
Depends on how many πΏ
Why the question mark then?!
...and I answered it.
for "_i" from 0 to 100000 do {1+1+1+1+1+1+1+1+1+1+1+1+1+1}
448.333 ms
for "_i" from 0 to 100000 do {((((1+1)+(1+1))+((1+1)+(1+1)))+(((1+1)+(1+1))+(1+1)))}
485 ms
Conclusion
PARENTHESIS NEVER AGAIN
You don't use parenthesis where it is not required of course π€
I was pointing out optional parenthesis.
I acutually do π
Of course you can't get rid of required parenthesis.
I put parenthesis everywhere
@peak plover Test again. But this time the one with parens first and then the one without
// Change the size based on the amount of elements
private _hMod = ((((lbSize _ctrlList)min 10)*0.85)max 1);
``` help me
and then compare results
IMO you shouldn't use parenthesis unless required
Thing is, you wouldn't use semi colons in python
Parenthesis make no difference in runtime. But help preventing errors that you don't expect
parenthisis
472.333 ms
non-parenthesis
453 ms