#arma3_scripting
1 messages ยท Page 372 of 1
maybe
well.. you could take them.. and calculate what the corner points would be ^^
but they show differently in NV and TI now
... but why
can you make a drawPenis command for drawing penises on the map please dedmen
.-.
yes i know drawLine3D, but figured at least BIS would use a animated model
drawDickbutt
lol adanteh
We can't take out single Items from a Vehicle and you expect that? ๐
Without a "workaround"
... which it doesnt
altF4
Good bot
thats how some other mods do it
โค you too Commy
```[[_unit,"PRONE_INJURED", "ASIS"],BIS_fnc_ambientAnim ] remoteExec ["call"]````
Then ... why do you ask?
the unit still loses the backpack with this
Wanna know a protip
You dont need to pass THE ENTIRE function as an argument for "call"
instead you can do [_unit,"PRONE_INJURED", "ASIS"] remoteExecCall ["BIS_fnc_ambientAnim"]
nop, still loses the back pack
What would that do, make enviromental gachi sounds?
i don't know but i know we need it
Agreed Dr Freud.
i'm trying to help here
is bored and thinks of going to bed
๐
๐น ๐ ๐ ๐ฌ ๐ฅ
@still forum mimimimimimimimimi
You guys now have 10 hours time to get new Ideas for SQF commands. Good night o7
I know that was coming before I clicked the link
also some โค
wtf
Why does your link get expanded but Dscha's not?
httpS
Wow...
Because I am based.
the best
Still is of question.
But I just proofed it AGAIN? How much proof do you need?
proofed ๐ค Much more than proofed is needed.
^^
No, i just added a < and > before the Link, so it doesn't spam the Channel with the previewPic ๐
lies
You didn't have to tell them.
I am fwiendlรผ
^^
Classy
That is morally inappropriate...
Anyway, @still forum ClientSide Extension for Intercopter?
Dschas post
Yeah. But, Morally? Why?
Do players get a diferent variable when they are JIP?
sems like enableFatigue does not like JIP
even on a event handle
I wouldn't expect it to
because once you disconnect, it gets rid of any object variables set on the player
hence the point of DB's and data saving scripts
hm... if the Unit (that the player owned before) won't get deleted, after he disconnected it should still be there.
iirc it gets deleted anyways
Not sure, it's a while since i did anything in A3
so, how do i apply that to the new unit?
initPlayerLocal.sqf
OnPlayerConnect EH (or what it was called)
EH would be removed on disconnect?
As i said: Many ways possible
what one works for jip?
Yeah, but doesn't matter if he hads that command to it
All of them
init = When an Object gets created/spawned
init = Initilization
Search the Terms above in Google e.g. "Arma 3 initPlayerServer"
this is my init.sqf
player enableFatigue false;
player addEventhandler ["Respawn", {player enableFatigue false}];
};
if(!isMultiplayer) then
{
{
if(! (isPlayer _x) ) then
{
deleteVehicle _x;
};
} foreach switchableUnits;
0 fadeRadio 0;
enableRadio false;
enableSentences false;
};
if (isMultiplayer) then {deleteVehicle Team_1};
if (isMultiplayer) then {deleteVehicle Team_2};
if (isMultiplayer) then {deleteVehicle Team_3};
wp1 = compile preprocessFile "techbridge_1path.sqf";
wp2 = compile preprocessFile "techbridge_2path.sqf";
wp3 = compile preprocessFile "tech1path.sqf";
wp4 = compile preprocessFile "tech2path.sqf";
wp5 = compile preprocessFile "tech3path.sqf";
{_x enableFatigue false;} forEach playableUnits;````
still have it
Who wrote that?
ewwww...
Delete everything and learn scripting for yourself... that code above is a mess
if (isMultiplayer) then {deleteVehicle Team_1};
if (isMultiplayer) then {deleteVehicle Team_2};
if (isMultiplayer) then {deleteVehicle Team_3};```
wtf?
God, I think I've got a heart murmor going on here.
what is wrong?
does not accept arrays
Hey, whats your name -> You answer -> Do A
Hey, whats your name -> You answer -> Do B
Hey, whats your name -> You answer -> Do C
Instead of:
Hey, whats your name -> You answer -> Do A,B,C
its atually is:
Hey is it MP? -> then delet A
what i tried
Hey is it MP? -> then delet A, B, C
what Arma says:
Hey man, i cant do that, i only accept one.
Friendly Tip: Learn the Basics first ( if()then{} is the basic of the basic )
๐คฆ
have you thought about: Putting the Code you execute in the 3 if's into on "if"?
Like:
if(blablub)then{DoThisTo Group1; DoThisTo Group2; DoThisTo Group3;};
?
(i am especially not starting with forEach atm)
Just tested that variable on player disconnect, looks like everything is saved specifically for each individual player slot (objects)
That's with the AI enabled to replace player upon disconnect
and it's set to persistant on server
no, never saw this example in Wiki
So it could be just the AI inheriting the variables, since it technically doesn't belong to the player until they take over the unit correct?
Until Owner changes (gets possesed by a player)... hmm... yeah, could be true
well thanks, i will save this exemple
Still: Stick to basic stuff first, otherwise you won't get far (if, forEach, spawn, call, declaring Variables, etc)
With the AI disabled for the mission, it doesn't save EH, Variables, etc.
So yeah, I guess my previous statement applies
{_x enableSimulation true} forEach (crew thislist); what is the generic error?
crew of an array ๐
that does not apply to every crew inside the array?
nope
what is the right way to put that?
What do you want? I can't get it
enable simulation to all the crew inside of the vehicle
{
bla bla bla
} forEach (crew _x) ;
} forEach (thislist) ;```
maybe not tested at all
it worked, thanks
{
_x enableSimulation true
} forEach (crew _x) ;
} forEach (thislist) ;```
is there a way to i have control over unit spawn on mission and only spawn once a code is given?
to create a unit from code? yes of course
_cost = 0;
for [{private _i = 0}, {_i < count _struct}, {_i = _i + 1}] do {
private _curSelect = _curEquips select _i;
private _newSelect = _newEquips select _i;
private _equipType = _struct select _i;
if(typeName _equipType == "ARRAY") then {
_cost = _cost + ([_newSelect, _equipType, true] call ZE_fnc_calcCosts);
} else {
if(_curSelect != _newSelect && _newSelect != "") then {
//_cost = _cost + ([_newSelect, _equipType, false] call ZE_fnc_calcCosts);
};
};
};
if(zeDebug) then { systemChat format ["zeDebug (handleEquip): Final cost for new equipment is $%1", _cost] };
Is giving me an error stating that _cost is undefined on the final line. What the fuck?
ZE_fnc_calcCosts probably reports nil.
Keep getting Warning Message: Script functions\fn_createZues.sqf not found
even though its there...
I can even see it in the pbo...
class JRab_test {
author = "JasperRab";
units[]={};
weapons[]={};
requiredVersion=0.1;
requiredAddons[]={};
};
};
class CfgFunctions {
class JRab_test {
class functions {
file = "functions";
class initZues {};
};
};
};```
any idea as to why it isn't working? Am I looking over something stupid?
@distant egret is this a mod?
Yea
You need the full path for the file entry.
e.g. /JRab_est/functions
Dunno if it has PBOPREFIX or not,
\
Backslash? Idk.
Yeah
OK
I wasn't sure either, just checked my files ๐
"test" is a brilliant component name btw.
I was just testing xD
๐
At least, it's a "unique" Tag!
test
testing /o\ woaa
@jade abyss what what what? You mean BE whitelist? Or what do you mean with "clientside extension"?
Yes
I just didn't try talking to BE guys.. Noone else did..
Someone needs to ask them I guess ยฏ_(ใ)_/ยฏ
You would still need to get all plugins whitelisted too because they are seperate dll's
gl hf gg no re
Need python programmer Btw for the sqf-vm project in case one doesn't checks #creators_recruiting
IF {selection "weapon" OR "Launcher" OR "pistol" intersect _x Object} then {player playActionNow "LowWeaponDown"};
its Pseudocode who can make good sqf code for low or rise weapon when u staying close to objects likes walls or vehicles?!
That is not pseudo code.
// loop
if weapon_raised && weapon_peeks_into_wall
lower_weapon player
This is pseudo code and much more helpful.
just for info, OR and AND are ugly alternatives to || and && but they work
maybe im not coder ๐
@little eagle can u write something likes this? i will make anims for it ๐
no need to, there's lowering weapon anims already
Anyone can write this if they can figure out:
- how to loop
- how to check weapon_raised
- how to check weapon_peeks_into_wall
- how to lower_weapon player
There solutions for all of these steps and they're not hard.
how rised izi, read state of current action and anim
if peeks into wall, izi too, arma have funcs for it
type in Search -> Intersect
how to lower weapon - call animation action
wat iz it?
The lower_weapon player step.
Does that still make you stand up if you use it when prone? ๐
i remember that used to be the case. Rather than going "Hey there is no weapon lower for prone, so i'll just do nothing" it would make you stand up, then lower the weapon
Well, you can't lower your weapon when prone, so probably.
It's the same when you hit the lower weapon key while prone. You'll kneel iirc.
@little eagle oh man and i just thought i found a nice action to put a weapon away... okay i have but its "Switchweapon" and muzzle index -1 ^^"
i can make anims for PRONE stance!
The WeaponOnBack name is really stupid.
yeah ^^ good to now that there is that way, btw "WeaponOnBack/InHand" will not make you stand up, just checked ^^
Cool.
atleast for perf/prof branch
I remember that it used to make you do a weird swimming animation when using it while walking or something like that.
i can make any anims, just need a coder who can write smart sqf
yeah using "switchweapon" and moving is a bit odd
is it possible to programatically force AI to shoot a GL grenade through a selected window of a house?
or maybe it'd be easier to simulate the firing, just spawning a GL grenade explosion inside the house near the selected window and playing the respective sound of the shell fired before that?
also, simulating the breaking of the window, playSound3D most likely too.
it should not be imposible
biggest problem should be getting him to aim at that window
I know Command & Conquer mod has done it, you can order AIs to nade a house, not sure if they can shoot through a window accurately
Can the virtual arsenal GUI be modified?
yes and no, I preferred rewriting it
I'm guessing it was an arcane mess to deal with
nope, took me 2 weeks but it's nearly done, thanks to dedmen optimization it's also a shitload faster
ACE
@meager granite if i remember correctly at one time you were looking at a setPosLocal type function, any luck with that?
Or anyone else for that matter
It can only be done through hacky approaches
Create local entity, attach remote entity to it and by moving local vehicle you will move remote entity without sending any updates over the network
i'm fine with that
attach would not be sent over network too as one of the vehicles is not global
If you then detach it would the position update, or would i have to detach, then call a normal setPos?
it would revert to whatever is received from the server
so getpos, detach, update pos to the getpos var and it would work okay?
basically i wanna have local moving, then "commit" it
you wil need to do setPos right after detach so it would update it everywhere
yep got it. Nice, thanks ๐
on that, what is the most reliable way to attach an object, but keeping it in the same location? I remermber in the past i had some problems there with the height coordinate being different (middle of bounding? waves.. whatever it was)
Try setPosWorld getPosWorld and then attach?
Probably depends on object you're attaching to
Just do a test, it should be easy to figure out
how many AIs are recomended to rum a good FPS coop mission
9001
can i run it at 60 fps?
Hi guys. what method should I use for measuring the distance from object to the ground?
altitude
getPosATL select 2
thanks
you can use getPos if you wanna include buildings and so too
someone using Sublime Text 3 here? How can I reformat my code for SQF?
there's 3 you absolutely need, armabuild, sqf language, openLastRPT
use package control, those are the exact names
check thanks
Anyone have some other containerType I could implement in Intercept?
hashMap is already done
@lone glade I got them all now. Any advice? Not sure if there is something like a code reformatting available
don't think so, but sublime is quite powerful
should be fairly easy if you've mastered some shortcuts and multiline selections
Yesterday you complained about discord and now you're here.
was a bit curious after all this time, it's a lot less worse now
"less worse" ๐ค like... "better"?
doesn't have blob emojis, still worse than slack
? never left
i've been clinging to the ace slack tho ๐
that's because i've been on the ACE3 slack all this time
blob emojis best emojis
The turtle โค
๐
@little eagle - what are you talking about!? The Discord emojis are great.
But have you seen the google emoji and especially the google turtle?
If you want to see bad emojis look at Samsung's.
๐ค
๐ข The Apple emoji is not anywhere as cute.
even the big smile google emoji is cute as fuck
When do we get Arma emoji support?
@lavish ocean - please ๐
emoji variable names
o_O
In Czech.
usti hlavne
It'll be flashlight in mouth and shadow puppets with hands animation.
A3_ลฝelva_F
Arma has Emoji support already
scripts are UTF-8
as long as your script editor has emoji support you can use emoji variable names
use IME chars for your vars for maximum troll
GVAR(๐คข)
A3_ ๐ ๐จ _F
My debugger can inject macros into the preprocessor
basically global macros that are available everywhere without #include
utf-8
I can use รตรผรครถ
Pretty sure GVAR() is a result of a bunch of #defines.
รค
รถ
ยต
scripting in arabic when
ืืื = vehicle player
yes GVAR and EGVAR are results of defines, but god fucking damn it if they aren't incredibly useful
There are enough Chinese characters to convert every variable in ACE into a one character variable name.
Wasn't there that guy that claimed shorter variable names make scripts faster?
one character variable names everywhere
call xxx_fnc_gasAttack
@still forum -X?
Lmao, he works fast 'tho
and you are supposed to use ofpec tags not opec tags
Took me a few minutes to get this.
The world sure is small...
๐คฆ
More like ๐ธ๐พ_fnc_gasAttack.
separator for switch cases
a-z, 0-9, _
can't start with number
yes.. : is a script command
Classnames are the same, but can start with a number :/
so no you can't use that
๐ฆ
Hey guys, is there any easy way to get the middle of a object?
I was looking at the command modelToWorld
btw ofpec. I've seen ofpec around and been on the site like twice, but does it have any value to scripting ?
I would assume it's the feet
bonding box. half hight
_obj modelToWorld [0, 0, 0] would give me the feet I assume
yep, get the center of boundingBoxReal
Add the bottom left front edge of the bounding box to the top right back edge and divide by 2?
Could do
Trigonometry!
Always fun ๐ค ๐ซ
actually I think there's already some code I use from arsenal
private _centerBox = boundingboxreal GVAR(center);
private _centerSizeBottom = _centerBox select 0 select 2;
private _centerSizeUp = _centerBox select 1 select 2;
private _centerSize = sqrt ([_centerBox select 0 select 0,_centerBox select 0 select 1] distance [_centerBox select 1 select 0,_centerBox select 1 select 1]);
ah, but what then if the object is aligned with a slope?
No one complains about trigonometry here if you haven't suffered through 3 years of crystallography.
crystallography is the fun part
Trigonometry was the best subject in HS ๐
@lone glade GVAR(center)? ๐ค
I guess I could just do this though objNull modelToWorld (boundingCenter objNull)
What.
What?
What
objNull ?!
I knew GVAR was some CBA3 macro, but don't know what it does
Why do you use distance and not vectorDiff? distance uses AGL and will report slightly off distances if the terrain around [0,0,0] is rough.
eeeeh, lifted straight from arsenal
BI ยฏ_(ใ)_/ยฏ
it's the only thing I straight up took from it, didn't want to figure how to move smoothly the camera and BIS seems to have found a good way ๐
Oh, it's 2D actually. You need distance2D I think? Never tested if that ignores Z or if it converts to AGL z=0 too.
But you can just add z=0 I guess.
THis does not seem to work private _position = _object modelToWorld (boundingCenter _object); drawIcon3D [ "", [1, 1, 1, 1], _position, 1, 1, 0, "Test", 1, 0.2, "PuristaMedium", "center", false ];
Any ideas?
No errors, but it does not show up any text
Yep, red highlighting.
What? ๐คฃ
I used the command in the discord sqf syntax code box and it was drawn red. Therefore it is a command.
Too lazy to open the wiki.
Ah
Wait, so Discord staff goes through the commands and adds them to Discord? ๐
Is that a bot doing that or Discord itself?
Dunno where discord gets the command list from. But it's a discord thing to support code highlighting. The only thing mission from Slack...
Might've also been from Linguist and therefore what Flummi and I PR'd 3 years ago. Maybe it's different. No idea.
๐ค
Ah alright
So you think that Discord might be running of this?
For their commands list
I don't know why else they would support a niche language like SQF.
^
haha the highlight.js sqf snippet...
/***
Arma Scripting File
Edition: 1.66
***/
// Enable eating to improve health.
_unit addAction ["Eat Energy Bar", {
if (_this getVariable ["EB_NumActivation", 0] > 0) then {
_this setDamage (0 max (damage _this - 0.25));
} else {
hint "You have eaten it all";
};
// 4 - means something...
Z_obj_vip = nil;
[_boat, ["Black", 1], true] call BIS_fnc_initVehicle;
}];
yep, i contributed to this ^^
4 means something!
poor _boat never gets defined
i wrote the regex for functions so i just added random code with function in the middle of already existing code
neat... the example is a piece of broken code
_boat is undefined. This is bugged.
_this is not object right?
functions regex looks for _fnc_ or the BIS_ prefix?
Pretty sure that _this is an array in the statement of addAction.
So this code will just error out when you use the action.
its just here to show highlight
But this is the channel where we complain about code posted.
cool!
CBA_fnc_addClassEventHandler
It works with any tag and with misspelled functions...
I always choose my function names to be misspelled BIS variants so this suits me
nigel, anything with x_fnc_y will be highlighted blue.
oooh, didn't know, that's cool
huehuehue ๐
but it does check the first char isnt a number
Nah. But it would error in the game.
deleteGroupWhenEmpty does something to perfomacy or noting at all?
That's a negatory, sir
I've yet to see performance loss from high amounts of groups
That being said, having every unit in a separate group is still bad
Aparently it means they have 2 brains
deleteGroupWhenEmpty does something to perfomacy or noting at all?
Nothing noticable.
ah but commy look that first char is a different colour
so that a different bug, its considering the function name to start with x
and the green 1 means it thinks its a value iirc
You're right. I had to zoom a lot to make out the difference between these two. Am I color blind?
you might be slightly, dark greens and dark blues is a common one
i have it with dark blues and black
guess its more of a teal than a green, too
@astral tendon deleteGroupWhenEmpty is very handy command for having the engine delete groups.
Instead of having sqf code delete groups, were you got to
worry about deleting a group that you might not have added units to yet etc
But nothing really todo with performance
I remember 2 years ago the engine did it by itself
but then someone broke it, then never fixed it....
Having a flag to say you can delete this group when empty is alot better imo. Makes it easier to reuse groups & not worry if engine deleted
Well, _fnc_addClassEventHandler should be a local variable.
Thanks for the info
yep, it'll pass variable regexp un guess
this one is for functions
_fnc_addClassEventHandler
yep, variable spotted ๐
Is _fnc_blah considered a local function? Do we have that convention? It's what I do all the time.
i tend to either use that or _fn_temp to more clearly mark it as not a "real function"
How is it not a real function?
^^
Everyone's against Hungarian notation, but somehow I ended up naming variables _ctrlButton, _dlgMenu and _fnc_something.
its much like pinocchio not being a real boy
But it ended with the puppet becoming a real boy iirc (never seen / read it myself).
some of my temp local functions end as proper ones when im done scripting
its all very symbolical
hungarian notation makes sense for certain edge types to be honest
_buildingsArray might as well be _buildings
but then you might want the number of buildings too and everything gets confused
are you going through my PRs by any chances nick? ๐
German.
is there a command to get childrens of a RscControlsGroup ?
configClasses
to get dynamically created childrens ?
no idc, no manipulation
disableAI "AUTOCOMBAT"; seens good to force AI squad mates to keep following you and obey orders, is there any warning i should get?
why would you get a warning?
like, that may broke something latter?
well.. you disable autocombat
so.. autocombat will be disabled
If you expect autocombat to be enabled. Then it will be "broken"
Well, works for me.
Can someone fix https://community.bistudio.com/wiki/lineIntersectsWith Example 1 and Example 2?
screenToWorld reports AGL and not ATL. It will break on roofs and over sea.
AGLToASL not ATLToASL
why u no fix?
Don't have the login for the next few days and will likely just forget.
fixed
thx
โค
Actually it's fine on roofs, but not the carrier and generally over water.
I hope your hair grows
It does too much. Too lazy to shave.
the CfgRadio does take the VON volume settings or music?
In my next mission i want player be able to remove the custon music but be able to hear the dub
the one i am using right now is taking the effect slot
{
sounds[] = {};
class missionstart
{
// how the sound is referred to in the editor (e.g. trigger effects)
name = "#MissionStart";
// filename, volume, pitch, distance
sound[] = {"dub\starting.ogg", 1, 1, 100};
titles[] = {0,""};
};
};```
its a radio chat, i tink it would be right if was on the radio or VON category
if you call more than once then yes
They're all functions
which you do
as you save into variable
so yes. definetly
Do you PR these changes to kp_liberation?
Else I will have to do it someday
Why?
Should I?
yes
Fix it for everyone instead of for yourself
Already talked to Wyqer he would like these changes
he has
Yep found it.
With change to CfgFunctions the names of the function variables will probably change tho
so every usage has to be updated then
should I localize them to a single cfgFunctions.hpp?
I've experimented with more than 1 cfgFunctions.hpp
It made a bit of a mess...
No what I did was this.
and missions only have one config
you can and should have multiple categories inside CfgFunctions
class cfgFunctions = { #include "other funcs"
#include "more funcs" };
not sure
don't think it's worth splitting up
But made a mess.
a single cfgFunctions.hpp would be seperated into proceedures
and functions anything called via spawn is a proceedure
anything that is "called"
is a function.
Thats how I seperate my code.
anything.
execVM'd
spawn'd
etc is a 'proceedure"
call
is a "function"
Sure.
It will be higher though.
Don't even have to run it
paste it into the watch field
with count and format
This is modded version I am using so, it will probably have additional scripts
and running a listen server
so it will include both
"Active SQF Scripts: 154"
@tough abyss
is there a smart way to check if a trigger is present on a mod map or visualize the trigger to see if its "there" ?
isNull trigger
you can use markers. loop through all triggers, create marker for each, set size, set colour according to if the trigger is active, etc
@still forum sorry if im randomly tagging you, but i heard Intercept was faster than SQF is that correct (just the raw engine itself). Is there any overhead?
okay well the thing is that I'm certainly sure that the terrain is the cause why my trigger isn't firing. I'm a blufor soldier in a car but it doesn't work... https://i.imgur.com/OJmpfwD.png
isNull gatetrigger returns false
hmmm
i thought thisList was a list of units who met the conditions, so thisList in the condition itself would be an empty array?
@tough abyss Intercept is raw C++ basically instead of SQF that is compiled into a intermediary binary
Intercept has overhead.. But it's far lower than SQF's overhead
performance improvement depends on what you are doing.. But one of my examples had a theoretically 4300x speedup
if I just use {side (driver _x) == west} count thisList > 0 as condition the gate opens instantly hmmm
Are you sure "Aebian" variable is defined?
its my player name so it should be
So it's the variable of the unit you are in?
but even if not the gate should just open when there is a blufor driver in the trigger
there is no undefined variable
the condition has a or statement so even if the driver != Aebian the other condition which is side (driver _x) == west should apply
@still forum tyvm
Yes.. But you said "but even if not" if Aebian is not defined then it would be script error
and I can't explain why else it would fail
I never said that its not defined
I meant that the driver is not Aebian
Did you check in debug console if Aebian variable is defined?
I did isNull Aebian says false
Also that script would fail if no one joined your slot and it doesn't exist.
isNull != isNil
but isNull should error if the var is nil
try || {(driver _x) == Aebian}}
encase your second condition in {}
hmm now its open all the time even if I'm not in the trigger. I guess I need to refine the condition to just return true when there is truly a land vehicle on the trigger. maybe do something with count (thisList unitsBelowHeight 2) > 0; and so one
can't you set the trigger height?
my goal is that the trigger only fires up when there is something from side WEST in it and drives a vehicle
@jade abyss this is the right place ^^
@nocturne basalt Currently searching the files, not sure if i still have em
ok ty
any reason why selectionPosition wouldn't return a correct AGL position post to modelToWorld conversion?
[] spawn
{
waitUntil{!isNull (findDisplay 46)};
onEachFrame
{
{
drawIcon3D["\a3\ui_f\data\gui\rsc\rscdisplaymain\menu_options_ca.paa",[1,1,1,1],(_x modelToWorldVisual(_x selectionPosition "spine")),1,1,0];
} forEach entities "";
};
};
obviously not final product
You expect modelToWorldVisual to return AGL?
๐คฆ
Wiki actually says it returns AGL
Well it does
I'm confusing it with modelToWorldWorld
how much is it off?
hmm seems not to work. I also tried (driver _x) != _x https://i.imgur.com/kiVxoPM.png
It just floats underneath the player
@nocturne basalt
Script for the HoverCrate (not the follower one)
https://pastebin.com/d6SS9dgU
@hollow lantern keep the count loop.
so this is torso? I'd say it's off by a shit ton. Not sure if I can check the distance or not
_x is undefined outside of count/forEach
Oh
@jade abyss thanks so much ^^ appreciate it
hf with it
Oh wait a second
No that wouldn't make sense
because it's still following the unit
Wtf.
@jade abyss May come in handy! Thanks man!
o7
@jade abyss btw, will it hover over water?
k
It's just a "Proof of concept"-Thingy
what is the right way to put custom voice acting in the game? like, i am using triggers to execute those sounds
So technicaly, it's possible to do SciFi HoverTanks with it ๐
^^ thats my aim
Just needs adjustments to Slopes etc, but... yeah, gl hf with ๐ I am done with Arma. No further scripting for me
so why are you in this channel if your done with it xD?
@still forum oh wow thanks, that actually worked o7
๐
@jade abyss #Intercept solves it all
Not the engine
Looks like selectionPosition returns [0,0,0] FYI
If a selection does not exist [0,0,0] is returned.
๐ค
Geogoogly
Same for ModelToWorld Positions (since i just read it) in moving PhysX objects... big big mess...
cries in defeat
@earnest ore Don't hold back :X I'm curious what you're writing
btw. you guys do know, that MTW Positions change, when a Vehicle is moving? ^^
@subtle ore
Yeah, but this thing won't even return a modelToWorld position even if it's not. ๐
Then your Script sucks ass ๐
Hey, screw you man! ๐
@still forum I wrote my problem, then looked back at my code again, then looked at my mug of coffee and cried.
๐
Ain't tell the postman that he sucks, when he gave you the Warning about the false Tax-Payments, when you haven't done it properly ๐
Fair enoguh, but those tax payments don't show much even if I didn't do them correctly ๐
you sure it's correct?
Cause i was working with it before and... yeah, no prob at all ๐
(except for the moving positions)
Mind showing me a snippet?
What do you want?
Just anything, but I can't seem to get it working in any case. a correct modelToWorld position
keeps returning [0,0,0] in every case
do I need to filter for a certain LODName?
[] spawn
{
waitUntil{!isNull (findDisplay 46)};
onEachFrame
{
{
drawIcon3D["\a3\ui_f\data\gui\rsc\rscdisplaymain\menu_options_ca.paa",[1,1,1,1],(_x modelToWorldVisual(_x selectionPosition "spine")),1,1,0];
} forEach entities "";
};
};
icon on the spine
Yep.
- "_xmodelToWorldVisual" doesn't seem correct
yeaaaahhhh, Discord ๐
๐คฃ
+Why MTWVisual?
Terrible lag behind when drawing the icon, but even then it still didn't work lol
Because it was following the player
just not at the spine
which is, terribly. Weird.
Example for a Veh
_inModelPos = (_Tgt modelToWorld (_Tgt selectionPosition [_MemPoint,"Memory"]));
player setDir (player getDir _inModelPos);```
Would t hat LODName apply for units as well?
Why shouldn't it?
So you wanna do something like that:
https://steamuserimages-a.akamaihd.net/ugc/262720587549360373/6B06066722F01B3AC459C7346197DF0135C0249C/
Essentially
Get the HitPoints
JIP playes hear all the triggers sounds that played before once they spawn, is there a way to fix that?
Use the hitPoints to get the Coords
_Dist = _CursPos distance (ATLToASL (_Tgt modelToWorld (_Tgt selectionPosition [_SelectionName,"HitPoints"])));```
Alrighty, well. Damn. I am still unsure why that didn't work.
Dscha - Today at 3:40 AM
Helping out other newbs :smile:```
Thats why i am still here ๐
Hahahah ๐
_inModelPos = (_CTarget modelToWorld (_CTarget selectionPosition [_SelectionName, "HitPoints"]));
drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\simpleTasks\types\heal_ca.paa", _Color, _inModelPos, 1, 1, 45, _Text , 2, 0.0325, "RobotoCondensed", "center", false];
For example
Gotcha, that makes sense.
Wow, show off ๐
why is that guy's Face hit point on his knee
HitPoint doesn't exist, so Coord [0,0,0]
Can someone with wiki access please modify the Array page so that it has in BIG BOLD FUCKING LETTERS that it is passed by reference?
Implying anyone who doesn't know that, reads that page specifically and not just copies code involving arrays from examples of other commands
Is it me or lnbSetTextRight doesn't do anything?
lbSetTextRight is fine, lnb isn't, no matter what I try. Not fully implemented probably?
isn't it supposed to be invisible? ๐
No it supposed to show text in the cell aligned to right
Like it does with normal ListBox
spine1, spine2 and spine3 only afaik
@earnest ore better question is why you expected it to be value based
The wiki should have a page about how SQF arrays work.
Why does str adds double quotes inside strings? ๐ค
it was reworked some time ago to fix some issue with that afaik
Or maybe it was Torndeco / extdb who fixed it for databse writing, and this is still a bug in str
Looks like format ["%1", is a way to avoid it
Since Arma 3 v1.63.137891 this command will correctly escape all " inside a string
It doesn't add double quotes. It just escapes the quote marks now correctly.
entitykilled stackable?
It's addMissionEH, so yes.
thanks
@earnest ore Everything in Arma is passed by reference
@meager granite lbsettextright does work and sets text to the right, InbSetTextRight if it were to work only sets invisible text on the right so you can still pull for data/scripts.. Basically a free variable on the object
SA mantra it was done so you could call compile the result. It also makes possible for extensions to parse the result properly when the quotations are escaped
@torn juniper Yeah I was asking why lnb version didn't work while lb did
I guess displaying is not implemented yet or something
@meager granite It doesn't work as it doesn't display? Because all the lnb commands should all be invisible and only store data, if I read it all correctly. They shouldn't be visible at all. The only way you should be able to use them is pulling data not showing it
Thats why there is a visible and invisible version of each
Your statement confuses me is all, not sure if you are saying the command actually doesn't work or you just cant see it, if the second part then that is intended I am pretty sure ๐
@tough abyss Wish they made a separate command then, all my stuff ending up with extra quotes is annoying as hell
Was done a good while ago
So how do you get a string of array with string inside array without double quotes then?
copyToClipboard format ["%1", [format ["%1", ["test"]]]];
=> ["[""test""]"]
use single quotes
_string = "test"; copyToClipboard format ["%1", [format ["%1", [_string]]]];
also format stringify whatever you pass to it
Try using single quotes there
Str is to get the string Variant of a value
Those double quotes are because the string needs to be escaped that way...
If you want an unescaped Variant, use regex or simply to array, remove duplicates, to string
Fun though of the day: implementing regex in sqf
cough intercept
Don't steal my thoughts!
Custom-written arma engine, no less
Just because somebody wanted to copy-paste their arrays for code compile
but... why
No
Because str is not to wrap " around strings @meager granite
And a " in a string has to be displayed as "" in ALL representations to the user
_string = "test"; copyToClipboard format ["%1", [format ["%1", [_string]]]];
Where is str there?
format
Unless they are string
Do not get annoyed when the to string functions are stringifying strings
That is what they are supposed to do
No, format isn't str, they changed whatever function was turning scripting types into string representation which is used when walking through array when turning it into string, instead of just changing str command itself.
@meager granite no...
Format is stringifying values unless they are string
Gonna repharse, messed up when editing
Really not hard just escape the quotations
Before you hard worry about santiize user input, if it got saved to DB & retreived from DB later on.
With the change no longer need to worry about user input, unless its from a dialog text for some reason that doesn't escape quotations
Mainly the change allows for extensions to parse a stringified array correctly.
I get why it was done, but the command itself should've been changed instead
Or new one introduced
๐คฆ ๐คฆ ๐คฆ
No
Stringification was broken
They fixed it after years of being broken
If you ask me string to string should'nt have done anything in the first place instead of just adding quotes left and right
Right now fromString(toString something) returns exactly the same as input. Before the quote escape that wasn't the case.
Luckily nobody asked you @meager granite
Yeah keep on defending bullshit
https://image.prntscr.com/image/ZcpSyz2LSEKe3KULAJt6tQ.png
That was fun. Thanks for the Idea @queen cargo
You are defending Bullshit... You are like those guys who join this discord to get their stuff fixed but pretend to not show anything and all solutions presented are wrong
Just that you are in the vet group... Which is even worse
No problem @still forum
But you lack the other essential regex methods (match for example)
You're missing the whole point of strings, they are textual data, not "text-to-be-compiled"
yeah.. replace was easiest to implement
Tbh a special intercept addon only providing new commands would be funny
@meager granite You are missing that extensions deal with strings. So they need to able to compiled etc
@queen cargo That is what I am doing
@meager granite you miss everything about everything here and just want that stuff your way and are annoyed
the first string argument in the function call is the ingame name
how fast is the hashmap compared to one in sqf ded?
lookup in a hashmap with 10k elements is 0.002ms
noice ๐
?? Not Rly seeing where you mean ๐
If you mean real hashmaps as in Namespaces should be roughly the same.. besides that Namespaces can only have string keys and my Hashmap takes ANY.
If you mean CBA hash... That will be much slower because every lookup is a linear search over the unsorted keys array
@queen cargo Nice arguments you got there. Just sod off already.
Ahh found it
@queen cargo first argument to registerFunction call
@meager granite still waiting for your arguments
Did not saw that part of the code page @still forum๐ ๐
Still cannot sit straight so I am on mobile
@tough abyss That's why it should've been a separate command ot change to str only, not entire string to string conversion anywhere else.
I should probably add a using registerFunction = intercept::client::host::registerFunction to make it a little more compact
@meager granite no
You do not understand anything about the whole concept of it...
Stringification
Google it
Whatever you say
Not to mention that I have no idea what use one could have about not correctly escaping strings in their sqf representation...
Strings are text data, not "text-to-be-compiled-later" data. If you want to escape strings to be compilable, have a separate command for it.
So you are an idiot... Good to know
Likewise
Strings still are Text data
And stringifying a string is now correct
There is no "because ppl wanted to be able to compile it again"
There is only a bug carried over for ages
it's just how it works..
And you demand that the bug fix is a hoaks
how would you unstringify
["test","te"st","te","st"] and get out test, te"st, te","st ? @meager granite
["test","te""st","te"",""st"] is easy and the engine already knows how to do that
Baseically that simple fix, allowed extensions to be alot more useable and more secure (before parseSimpleArray).
Also just checked the change was done over a year ago. v1.64
So no point arguing over it
str command was always a way to turn any data type into a string, it was never meant to escape quotes before. Right now not only it changed its behavior but also entire string to string conversion changed resulting in this escaping happening in other string related commands.
Also all commands you should be able to reverse it.
I understand how it benefits extensions and parsing of arrays, but the change should have only affected str command only, or was made into separate command.
@meager granite that is simply incorrect
Did you see command description? "Converts any variable to a string."
They fixed exactly that
Turning any datatype into a string
That's it. Not "escapes string" or "makes string compilable".
Guess what? If you want to stringify a string, you have to escape what needs escaping
The change affects all string to string conversions, not just str command
In case you still didn't get it
It doesn't effect all commands ๐ Just most of them
Regardless its correct behaviour now
Here
Take this
Has nice example of stringification
It wasn't, string to string conversion simply added additional quotes, that's it. It never meant to escape quotes for it to be a bug.
It never meant to make string compilable either
Honestly its not gonna change now. Everyone has tweaked any code they need to.
Anyway i got stuff todo, than debate about a year old change in arma ๐
String version of a string is the string but escaped
Can you read? What does command description say?
Converts any value into a string by placing " and " around the argument. Since Arma 3 v1.63.137891 this command will correctly escape all " inside a string:
"Converts any variable to a string."
This is its original purpose, there is no "bug" in it not escaping string, it simply turns any data type into string.
You remind me of that duck guy that did not wanted to alter his code and told all answers presented to him have been wrong
Its still a string, just the quotations are escaped now.
Its still a string
Honestly arma modelers / terrain people have more to complain about updates breaking stuff.
Converting string to string is not by just putting " around it... You also need to escape the string
Accept that this is the common way in the whole it world
Additional quotes shouldn't have been there in a first place
But you call lack of escaped quotes a bug
It Rly is like talking to a wall...
its so good to finally watch others debate
Yeah, likewise, you would deny anything no matter what you're told
@lone glade
MyHashMap = createHashMap;
for "_i" from 1 to 10000 do {MyHashMap set [_i, _i];};
MyCBAHash = [] call CBA_fnc_hashCreate;
for "_i" from 1 to 10000 do {[MyCBAHash,_i,_i] call CBA_fnc_hashSet;};
MyCBANS = createLocation ["CBA_NamespaceDummy", [0,0,0], 0, 0];
for "_i" from 1 to 10000 do {MyCBANS setVariable [str _i,_i];};
[MyCBAHash,125] call CBA_fnc_hashGet 0.0298 ms
MyHashMap find 125 0.002ms
MyCBANS getVariable (str 125) 0.0049ms
I included the string for Namespace to give it the same properties as the other maps. As in keytype can be ANY
MyCBANS getVariable "125" 0.0023ms
I explained to you in thousands of different ways already why it is this way
Other people did too
You just repeat what you already said and do not want to understand
damn, you're still at it?
He just refuses to read what command is supposed to do
You refuse to correctly understand what the command is doing... And interpreting it wrong
I told you what it is doing
And you just say no to it
You refuse to correctly understand what the command is doing... And interpreting it wrong
I told you what it is doing
And you just say no to it
Notice how it works both ways
I provide you evidence of how it works, told you to Google the term and you still insist on the current way being wrong
"Converts any variable to a string."
That's all that you need to read to understand what it supposed to do
Correct
If you pass a string it is converted too
Guess what you have to do to convert a string to a string? Escaping it
You do not cast the string but converting it
@still forum do that example with find 9999 instead
why?
Youll see shortly alganthe
oh, I do ๐
the second one should a lot lot slower then, whereas the 'proper' shouldnt have any speedloss
[MyCBAHash,9999] call CBA_fnc_hashGet 0.349528 ms
MyHashMap find 9999 0.0019 ms
MyCBANS getVariable (str 9999) 0.0049 ms
MyCBANS getVariable "9999" 0.0021 ms
The point is about type conversion, converting string to string should not do anything, not even add quotes like it did before. The whole type converison was changed, not just str even if you want it to escape strings.
Depends on what the keytype is. you need to stringify it for Namespaces
Get that now?
@meager granite conversion is not dynamic casting
Get that now?
โค
Looks like you don't get it
Well, no point in talking to idiot then. Have a good day.
MyHashMap find 9999 0.0019ms
MyHashMap findF 9999 0.0018ms
Microoptimization ๐ Apparently not worth it at all at that level.
question, why for some reason when
(findDisplay 46) displayAddEventHandler ["KeyDown","_this call detach_player"];
the function named "detach_player" with contents
hint format ["Detached %1", _theplayer];
will return "Any"? This doesn't happen when call happens outside displayAddEventHandler
yes?
because _this contains the event name too
I don't see why it wouldn't return "Any" .. _theplayer is undefined
it's 2 arrays, EH name + args
im using the creat task module but the variable name i give seens to not work when i use like
````task1test setTaskState "Succeeded";``` what it could be?
it also give a generic error
@still forum well, _theplayer is globally defined actually
I meant it relatively actually, but if they re outside of my functions right on the top this means both of these functions should be able to access em
A eventhandler has nothing on top though.
It's a completly new scripts without any scopes above it
with completly empty local variables besides _this and _thisEventHandler
MyHashMap find 9999 0.0019ms
MyHashMap findF 9999 0.0018ms
MyHashMap findNop 99990.0016ms
findNop literally does nothing. It's a instant return Nil.
so just grabbing arguments and calling the function takes 0.0016ms which is 90% of the commands runtime.. GG Arma..
And that's why SQF is so crap ^^
a getVariable call is literally 90% of SQF crap.. and 10% of the actual getVariable function.
how do I pass the local var for the event handler to swallow? any chance?
(findDisplay 46) displayAddEventHandler ["KeyDown","_this call detach_player"]; dont you need a bit more at the start ? like _mycall =
@sour saffron no
it's an add EH so no
@tough abyss BIS_fnc_StackedEventhandler can pass arguments trough. don't think that works for display tho
i am old thats why i have it ๐
Really... again Discord?
you can pass anything as _this for displayEHs
compared to missionEHs where args are pre-defined
dbo_KeyPressedCode = compile preprocessFile "key.sqf";
_dbo_KeyPressed = (findDisplay 46) displayAddEventHandler ["KeyDown", "_this call dbo_KeyPressedCode"];
thats my old ways ๐ i need to rethink maybe i get more speed
you can use format (BIS uses it) or use a GVAR
No you won't get more speed
example of BIS using format for displayEHs:
_ctrlDLC ctrlseteventhandler ["mouseexit",format ["(_this select 0) ctrlsettext '%1';",_logo]];
here is what I did though
_truck = _this select 0;
_theplayer = _this select 1;
attach_player = {
_theplayer attachTo [_truck, [0, 2, -1.6], "Pelvis" ];
_theplayer setVectorDirAndUp [[0,0,1],[0,-1,0]];
_theplayer playMove "LadderCivilStatic";
_theplayer switchCamera "External";
waituntil {!isNull (findDisplay 46)};
(findDisplay 46) displayAddEventHandler ["KeyDown","_this call detach_player"];
hint format ["Attached %1", _theplayer];
};
detach_player = {
(findDisplay 46) displayRemoveAllEventHandlers "KeyDown";
detach _theplayer;
_theplayer switchMove "";
_theplayer switchCamera "Internal";
_theplayer playAction "PlayerProne";
_theplayer playAction "EvasiveLeft";
hint format ["Detached %1", _theplayer];
};
call attach_player;
people who into spy stuff might understand me
https://vimeo.com/4824768 i been using it on nodes for 8 years on over 200000 objects always got nice spped
@tough abyss How does that change anything?
first of all, use params pls
it's 2017, not 2013
and yes, your arg isn't passed, so it's any
sounds intruiging attaching to a truck ๐
_this passes ["keyDown", [<control>, <keypressed>, <shiftState>, <ctrlState>, <altState>]]
forgot alt ๐
<.< i got pinged <.<
use format to insert your arg
@wispy locust Yes. The usual ^^
i find out about the task thing, its
format the function? Question is how do you fuse it with displayAddEventHandler? ๐ค
no, addDisplayEH takes a string as code
just use format to insert whatever arg you want in it that isn't the default ones
@tough abyss Do you use any mods?
@little eagle nope
_args = [blah];
_display setVariable ["MyTag_args", _args];
_display displayAddEventHandler ["keyDown", {
params ["_display"];
private _args = _display getVariable "MyTag_args";
...
}];
Read this, try to understand it, and then use it for your code.
too bad this server doesn't have blobthinkbutfast , so ๐ค
You don't understand how it passes arguments inside the event code?
oh yes, I see now
It's cumbersome, but that's how it's done without filling the global namespace.
The code block from event handlers is executed in a different script instance. Therefore no local variables carry over. It's difficult to understand for beginners. One of the worst things about sqf honestly.
also
(findDisplay 46) displayRemoveAllEventHandlers "KeyDown";
is a terrible idea
ah, right, can't quote on discord
Yeah, that will break about every mod. Guess it doesn't matter if it's just for your vanilla mission.
b b b but how will it break every mod?
By removing their key handlers?
รถhรถรถรถ ๐ค
You should look into how the addEventHandler function passes an ID that can be used with removeEventHandler (not All).
Or just don't ever remove the eventhandlers. Imo you about never need to actually remove them if you instead add some exitWith in their line 1. Which is much cleaner even though some noob here will disagree.
Some noob? ๐ Thanks I'll look into it ๐
There's always someone that disagrees with you. Haven't seen the light yet. ยฏ_(ใ)_/ยฏ
If the config viewer does not show certain commands to retract a ladder of RHS truck. Is there a faster solution besides opening the PBO?
use getText, getArray
need help with make this come true Buy Virtual Arsenal", "_this call fn_buyArsenal;
what do you mean by that?
its for virtuail aersenal, i need some help making a fn that opens on respawn after you buy it
takes out his bat