#arma3_scripting
1 messages · Page 489 of 1
where is the array out of range?
unitpositionelev returns an array of 3 numbers, selection of [0,1,2] doesn't seem like it's out of range
[
flagpole,
"Begin Your Next Sortie.",
"\A3\Ui_f\data\IGUI\Cfg\simpleTasks\types\interact_ca.paa",
"\A3\Ui_f\data\IGUI\Cfg\simpleTasks\types\interact_ca.paa",
"_this distance _target < 3",
"_caller distance _target < 3",
{},
{},
{},
{},
[],
10,
1000,
false,
false
] remoteExecCall ["BIS_fnc_holdActionAdd", mobius1];```
i'm sure this is a stupid question, but i'm not seeing any hold action being added and i'm not sure why.
it's nearly midnight already, no wonder my brain isn't working
your RE target is mobius1
and you are player 😃
mobius1 is player object, i should specify
i want to add the holdaction to a single person
hmm
mmm, found the issue, preemptive array, when getpos returns array. Array in array. Nevermind. Thanks for the help and info though, didn't know out of range was equivalent to dividing by zero.
@tough abyss what about: add the action to the flagpole but show only for that player
Good day beloved brothers
throws tasty freshly made and still warm chocolate chip cookie at @frigid raven
Why can I assign a ctrl to a variable if I am having a reference to the updated state of it?
Example
private _listBox = _display displayCtrl 1500;
// adding items to the _listBox variable
lbCurSel _listBox // yields `scalar`
// but
lbCurSel 1500 // yields the expected value
That does not make sense for me since the Wiki tells me both approaches are possible? Do I have to "update" the _listBox variable or better said reassign it before I call lbCurSel so it has the current state of the 1500 control?
if I am not having a reference to the updated state of it don't understand that?
hello boyz
a control type variable is a reference to the control. Just like a object type variable is a reference to the object
it doesn't contain the state of the control
when you call lbCurSel it looks up the control reference. And grabs it's current value
@still forum sorry remove the not
// yields 'scalar' tells me you were probably passing a Nil to it
but I selected an item in it
as I said I was able to reproduce with teh plain ctrl IDC
And it worked then
Meaning _listBox was probably nil
But as IDC is correct.. Maybe _display was nil?
mybe when using 1500 I fixed the _nil state of the _listBox as well without noticing
kk gonna recheck - so it actually should work with _listBox eh?
when you use 1500 it looks up in the currently open displays I think.
yes the _listBox way should work
_display = findDisplay 100000;
_combobox = _display displayCtrl 100001;
_comboboxTexture = _combobox lbData (lbCurSel _combobox);
this worked for me
ok then I have a typo somewhere
before you will add data to your list boxes use lnbClear and after lbSetCurSel
lbSetCurSel < without that, current selected sometimes - nothing
oh... also
lbClear != lnbClear
check wiki ^
I have not done many overlays so far, only really static ones which do not change. I want to create an overlay which increases in opacity over time. I know I can set fade in and fade out stuff in the configs themselves, but i would like to control this via script.
Can someone give me a pointer so I do not need to search through the whole wiki and several projects? I do want that overlay to be fullscreen as well.
maybe just use variable for the colors/backgrounds alpha and change it from anywhere 🤔
What is overlay?
any kind of paa or picture overlayed over the players display
So you use RscPicture to display it?
i do believe this will be needed as i do not know any other possibility to just display an image on a players screen
Hold on, I thought you already had an overlay and just wanted to change opacity with script? Sorry I misunderstood
Well that is true
I have an overlay and jus want to change the opaciy via script and not via fade in or out
You can ctrlCreate RscPicture and if I am not mistaken, control opacity with some foreground color command
Try that
getText(configfile >>"cfgAmmo">>"B_20mm_AP" >> "weaponType") returns "cannon", while getText(configfile>> "cfgAmmo" >> getText(configfile >> "cfgmagazines" >> "FIR_PavewayIV_P_1rnd_M" >> "Ammo")>>"WeaponType") returns "Default"
What I'm trying to do is pass a script any aircraft class, and determine if it carries bombs.(Eventually, also rockets, guns and missiles) Obviously the above is just a small part of the whole and is concentrating on a single ammo type or magazine type
How can I accomplish what I want
Or you can just use ctrlSetFade and fade in out the whole control @digital jacinth
I think you can commit that one to it will gradually change in its own
oh setfade looks promising
yeah that looks nice, the commit is the length of the transition then and I can freely set the opacity
Well opacity is the fade
i guess it is just a bit of a different naming as I am used to then.
🤔
I mean, i came across "opacity" as "visibility", "fillness" (most ridiculous one) already in my career. My understanding of the word "fade" in that regard was exclusively for the transitioning to opacity 1 or to 0.
who the fuck calls opacity "fillness"
well... if your controls created with ctrlCreate you can just use ctrlSetFade or/and change alpha for all of them...
depends on which controls types there ^
@meager heart did you think of anything regarding my issue? it's super simple and i don't mean to bug you, i just want to figure out why i'm being a big dummy
sorry which one ?
the one where addaction isn't working for one player
[
flagpole,
"Begin Your Next Sortie.",
"\A3\Ui_f\data\IGUI\Cfg\simpleTasks\types\interact_ca.paa",
"\A3\Ui_f\data\IGUI\Cfg\simpleTasks\types\interact_ca.paa",
"_this distance _target < 3",
"_caller distance _target < 3",
{},
{},
{},
{},
[],
10,
1000,
false,
false
] remoteExecCall ["BIS_fnc_holdActionAdd", mobius1];
mobius1 is playable unit
and i don't see the action being added to the flagpole
@tough abyss flash ui framework developers that's who
smack them
i doubt they are around stil
just tried that ^ code even with the same names > https://gyazo.com/11a6f9cabe3cc7ceb31f3de26ce0912f
and > https://gyazo.com/521bdce2deb8df2ad5c87c5ae913e18f
ffs
¯_(ツ)_/¯
guess i'll look later, i have to go wageslave now
glhf
@tough abyss also make sure t that object you attach the action to is not a simple object. Maybe that is the issue
It shouldn't be, it's just a flagpole
some objects placed in the editor are instantly simple objects. You mostly notice this if you double click on them and you see no option for simple objects
i know; flagpoles aren't
i also tested it with helper object
that didn't work either
hm, is there a command to set the thrust value of an aircraft?
no but you can manually update it, https://community.bistudio.com/wiki/setVelocity
righto new commands 👌
wanted to set the thrust as a QOL thing, but i guess that's impossible
the goal here is to do plane respawn by having the pilot look at a flagpole, perform a holdaction, and then be placed in a jet that's flying already
that’s not impossible, we just told you how to do it
and createVehicle with “FLYING” to have engine on
@tough abyss did you blocked me ? 😃
just tried to add 👍 to your useful post and was no luck... well 🤷
@cedar kindle missing the point of what i need
jet engineOn true;
jet setPos [getPos planeSpawnpoint select 0, getPos planeSpawnpoint select 1, (getPos planeSpawnpoint select 2) +10];
jet setDir 180;
_vel = velocity jet;
_dir = direction jet;
_speed = 500;
jet setVelocity [
(_vel select 0) + (sin _dir * _speed),
(_vel select 1) + (cos _dir * _speed),
(_vel select 2)
];
mobius1 moveInAny jet;```
this is the code i wrote for it but i did this at my desk at work and i can't test it
works in my head fine tho
jet setPos [getPos planeSpawnpoint select 0, getPos planeSpawnpoint select 1, (getPos planeSpawnpoint select 2) +10];
->
jet setPos (getPos planeSpawnPoint vectorAdd [0, 0, 10])
jet setVelocity [
(_vel select 0) + (sin _dir * _speed),
(_vel select 1) + (cos _dir * _speed),
(_vel select 2)
];
->
jet setVelocity (_vel vectorAdd [(sin _dir * _speed), (cos _dir * _speed), 0]);
┬─┬ ノ( ゜-゜ノ)
😃
math is hard okay
setVelocity This could be used to make Advanced Towing smoother, couldn't it? (it was using setPos last time I was checking the source of it.)
Probably using setpos because setvelocity might cause some pretty big physics fuckups
Setpos will find nearest acceptable spot
Setvelocity will just throw it
i'm totally fucking baffled with this holdaction thing
oh
now it's working all of a sudden?????
what in fuck
okay
i think i was just
my IQ must be room temperature because apparently 3m is too short of a distance
so condition was never satisfied
despite being
inside the unit
@tough abyss maybe you are just hungry 🤷
takes all of his food
reee
https://www.youtube.com/watch?v=MzYM3H20Xcg << Altitude restrictions cancelled, return to your mission Mobius One! >>
Gonna make a handful of tweaks
Gonna turn the jet engine on when the hold action is being initated
So the canopy doesn't close mid-air
Gonna reduce the initial speed
and then add a voice lcip
clip*
might make a nice fade in / fade out
Is there a way for a script-file wide scope?
I have a .sqf file that opens my dialog. In it I have a button handler. Unfortunately I have to redefine some variables in both scopes, the dialog-show.sqf scope and again within the _buttonHandler scope
That kinda buggers me
no.
Make a global variable.
or if you have a dialog. you can save variables onto it using setVariable
yeah
Hey guys, do you know a way to get the current gear of the car?
I´m referring to the gearbox
Like, 1, 2, 3
i have a formula which is v = ((wheelCircumferencewheel rpm60)/1000) /(gear ratio * group gear ratio)
But in arma is not working
` wrap your stuff in these things so that * works correctly`
I don't know of any way to get the current gear nor the rpm
v = ((wheelCircumference * wheel rpm * 60)/1000) /(gear ratio * group gear ratio)
Thank you
For example the hatchback
wheelCircumference = 2.277, wheel rpm (first gear) = redRpm * gearUpMinCoef = 4829, gear ratio (first gear) = 2.461, group gear ratio = 4.111
If you replace in the formula
velocity = 65 km/h
So over 65km/h we´re in second gear and below 65km/h we´re in first gear
theoretically it´s correct but in arma
Hatchback changes to second gear at more or less 20 km/h
@still forum You can retrieve the rpm with vehicle player animationSourcePhase "rpm"
https://community.bistudio.com/wiki/Model_Config i´ve checked here if there´s some source for gear but nothing.
Any leads? Let me know
oi people. i'm having some troubles again. wasn't it possible to "attach" a variable to a specific unit?
i'm feeling like i remember something, but at the same time i do not
setVehicleVarName?
basically, what i want to do is set a certain status for a unit
then later in script i just check if the unit has that status
wab wab wab waaaaaaaab
ah yeah, that's it.
what's the best way to use setVariable to add an object to an array
i want to put something similar to this setVariable ["marksman", this]; in the init fields of the marksmen in my ops
so that way i can specifically add a holdaction to them
Does anyone know if it would be possible to detect terrain features through scripting?
Like slopes for example
surfaceNormal would come in to play here but detecting which direction is higher, which is lower, and whether or not it is 'flat' to the left and right or more irregular
My goal is to set object orientation based on this so I could potentially design certain terrain features with objects more quickly
Another one that comes to mind is the terrainIntersect functions, sounds like they're performance heavy though
for the slope you can >
private _slopeValue = acos ((surfaceNormal getPos _origin) vectorCos [0, 0, 1]);
it being performance heavy doesn't matter too much since I wouldn't be using it in a mission. I am only trying to create a function that I could use to place and orient objects, and if it's functional and doesn't crash the game, that is good enough
@meager heart what does this return? Slope angle?
yes
also maybe you can play with selectBestPlaces 🤔
doesn't that one only use locations?
findEmptyPosition also this for preventing object overlap maybe
no... you can filter there any kind of terrain/surface/check if there hills/trees and a lot more... check wiki
So I'm running scripts on bombs/missiles after they drop, and I'm trying to figure out the best locality in which to do it. Do they get transferred to the server after drop/launch?
So while they're falling/flying, they're still local to the player that launched them?
cool, thanks
@foggy moon Any ammo shot is local to a gunner of that weapon, besides when you have some heli with manual fire where the owner is pilot or co-pilot.
awesome, thanks
is it possible to include mission macros in a serverfile ?
#include a file out of the mission.pbo in a server mod? no
other way around. #include in mission.pbo from a server mod. Yes. But not description.ext
thought so .. balls xD
format ["\life_server\..\..\mpmissions\%1.%2\script_macros.hpp",missionName, worldName]
``` i was hoping something like this but meeh
nope
unless maybe your mission file IS a serverside mod
then it would ofc work... But.. I don't know if Arma even lets players download these when they join or if players already need to have them
just a thought, will just have to put the pveh inside the missionfile
If you make an add-on for this and define functions for your sqf files in a config.cpp file you could even add eventhandlers or #include from the server side.
Not sure if this needs a plugin Management system like exile mod has or the APMS from desolation redux,which is what i am working with
Apms is very good to add stuff server side.
Why some people hate Arma so much? https://forums.bohemia.net/forums/topic/219522-trouble-looping-through-allplayers-array/
I can’t see discord links
@tough abyss i don't understand
Wait, I can now
why doesn't he just add this in initPlayerLocal?
why is he looping through all players for this
Well.. I already gave the answer to that didn't I?
JIPs won't get the eventHandler this way
😄
i'm going to make a bis account just to ask him what the fuck he's doing
oh
apparently i have bis account
Iol
done
1st post?
yeah lmao
I guess I made an account but never used it
what the fuck is gravatar?
why can't i just upload an avatar normally?
oh, i can, it's just a roundabout way
no
hey guys
@wary vine what do you mean ? There is no difference between server and client side. Macro file are used by preprocessor
didn't see the answers 😃
just refresh
@rocky mortar I meant, accessing a mission.pbo include from a serverside.pbo
include path is define from the root of your mission or mod
what do you want to do exactly ?
he wants to #include a mission macro file in a server addon
which i can’t say is a good idea overall
if the server side code is in the same pbo file of macro file there is no problem
How would I use params to pass two things, from two different arrays?
I was thinking of using ForEach, but there was a discussion a while back explaining another way.
Don't understand
params takes values from one array
so what do you mean with two arrays
_opforUnits = [classname,classname];
_opforUnitsPos = [[x,y,z],[x,y,z]];
```The two arrays
which two arrays?
the two arrays INSIDE _opforUnitsPos?
how are you passing them to the function
can you maybe write down some code to show how you want it to work?
Well. I was going to do forEach. for both arrays. One that passes the position, then one that passes the classname. Which then the unit is created and positioned.
But that's ain't effective.
I don't understand...
Do the arrays always have 2 elements?
They have the same amount, as they are related.
maybe order them like
units = [[classname, [x,y,z]], [classname, [x,y,z]]]
that would be easier
just a forEach loop through units. And a params ["_classname", "_position"]
but why do you think a forEach is a bad solution?
It's not "bad" it was giving me 32 reiterations
{
_classname = _x;
_position = _opforUnitsPos select _forEachIndex
} forEach _opforUnits
as it would foreach both arrays
I have no idea why you would foreach both arrays
you already know the index of the position
so why iterate again
Well that was my logic at the point. Now that I know you can pass arrays like that and param them.
Seems the legit way.
What does _forEachIndex return?
Just realized that adding InventoryOpened EVH on top of existing one will override the return value of previous one, even if new one has nothing or false as a return. Should I add this as note to EVH or its just too obvious and I am dumb?
the last returned value is used
Don't know if that's written down somewhere. But I think it is
So it considers nil return as an actual value.
yeah
the code is basically
bool shouldClose = false;
foreach (eh in handlers)
shouldClose = eh();
So no way to stack them? My purpose is just a script execution, not to override anything "behind" it.
Damn.
https://community.bistudio.com/wiki/addEventHandler check the notes on this page, maybe there is one already?
linking messages is a developer feature
you are missing the quotes around the classname string
{
_x params ["_classname", "_position"];
<do stuff here>
} forEach CAP_Units:
Ah yeah. I forgot that. xD
Any differences between Unit and Vehicle create..?
CAP_Units = [
["O_Soldier_F",[0,0,0]],
["O_Soldier_F",[0,0,0]],
["O_Soldier_F",[0,0,0]],
["O_Soldier_F",[0,0,0]],
["O_Soldier_F",[0,0,0]],
["O_Soldier_F",[0,0,0]],
["O_Soldier_F",[0,0,0]],
["O_Soldier_F",[0,0,0]],
["O_Soldier_F",[0,0,0]],
["O_Soldier_F",[0,0,0]],
["O_Soldier_F",[0,0,0]],
["O_Soldier_F",[0,0,0]],
["O_Soldier_F",[0,0,0]],
["O_Soldier_F",[0,0,0]],
["O_Soldier_F",[0,0,0]]
];
{
_x params ["_classname", "_position"];
_classname createUnit position _position;
} forEach CAP_Units;```
lol xD
If I createUnit, for a vehicle. Does it automatically give crew? Or would I still need to do createVehicleCrew?
never tried.. I'd say no though. Don't know what happens when you createUnit a vehicle..
What is this at 0,0,0? https://gyazo.com/59daf1cc894c200b75deccb89651893e
The Icon, thing.
_classname createUnit position _position; > _classname createUnit [_position, _group]; 👌
....position _something or ....[0, 0, 0]
or <clssname> createUnit [_position, _group]
OR just > https://community.bistudio.com/wiki/createUnit !11 😃
createUnit and createVehicle
both implemented in sqfvm
🤷
position too
but cannot remember some weirdo position <array> variant
what version @meager heart ?
is it the latest snapshot or the released version?
ahh
though ... wait
think the latest snapshot has bugged params
though .. no
wait
position <array> simply is invalid
that combination is simply not existing
1.0.0 rc 1 afaik 🤔
also .. there is no createUnit accepting "just" position
rc 1 has a bug inside with params
https://x39.io/projects?project=SQF-VM latest snapshot available there
CAP_units = [
["O_Soldier_F", [0, 0, 0]],
["O_Soldier_F", [0, 0, 0]],
["O_Soldier_F", [0, 0, 0]],
["O_Soldier_F", [0, 0, 0]],
["O_Soldier_F", [0, 0, 0]],
["O_Soldier_F", [0, 0, 0]],
["O_Soldier_F", [0, 0, 0]],
["O_Soldier_F", [0, 0, 0]],
["O_Soldier_F", [0, 0, 0]],
["O_Soldier_F", [0, 0, 0]],
["O_Soldier_F", [0, 0, 0]]
];
{
_x params ["_classname", "_position"];
_classname createVehicle _position;
} forEach CAP_units;```
will work
only createVehicle accepts that syntax
https://discord.gg/eP4QgTr already ran it in there in the #sqf channel
that would also be possible in sqfvm though :P
just that you need to create a group first 🤷
oh createVehicle there...
he had there createUnit > https://discordapp.com/channels/105462288051380224/105462984087728128/495338329466994688
and was horribly wrong with both commands 🤷
Are line ending characters a big deal in ARMA scripts?
Not that I know
// Expression only runs on the server, must handle actions for all machines and future JIPs (Why BI?!)
expression = QUOTE([ARR_2(_this,_value)] call DFUNC(setSize););
Sad.
so, if i want to compactly pass different parameters on clients, 3den custom attributes are not the right way
so, only inits, then?
Where is this expression quote from?
ace custom attribute
So why are you asking BI?
sorry if i am wrighting some strange stuff. Ive just discovered a bit counter intuitive feature of our game
because naturally everything in mission is kinda global
I’ve no idea what you are trying to do that is not working
ok, if someone is digging this custom attributes too: they are not good to define any client functions and fire only on server.
I have placed the following stringtable.xml in my root directory:
<?xml version="1.0" encoding="utf-8" ?>
<Project name="Deployment RPG">
<Package name="Lobby">
<Key ID="str.dpl.profile.info.name">
<Original>DebugName: </Original>
</Key>
<Key ID="str.dpl.profile.info.reputation">
<Original>ReputationDebug: </Original>
</Key>
</Package>
</Project>
Still the strings cannot be found using localize "<key>"
Do I have to include the stringtable anyhwere? Because the Wiki does not tell anything about that?
you no need "original" just use "english"
Do I have to include the stringtable anyhwere?
no, mission root folder only
also keys id's names...
<?xml version="1.0" encoding="utf-8"?>
<Project name="Deployment RPG">
<Package name="Lobby">
<Key ID="STR_dpl_profile_info_name">
<English>DebugName: </English>
</Key>
<Key ID="STR_dpl_profile_info_reputation">
<English>ReputationDebug: </English>
</Key>
</Package>
</Project>
something like that ^
@frigid raven
also_maybe_you_can_use_shorter_names_for_those_keys 😃
ah thought there is no convention
you no need "original" just use "english"
I think Original is the default value, whereas English is not used as default if wanted language isn't present @meager heart
If wanted language is not present first from the top is used, or smth like that.
Thats why ace stringtable has english on the first place.
https://github.com/acemod/ACE3/blob/master/addons/advanced_ballistics/stringtable.xml
yeah ^ commy was explaining that long time ago, i don't remember why exactly, but you can skip it...
also tried with russian as original... and was fail...
so i cannot use "ns.module.key" as keyname?
you can try it yourself just use them in your description.ext without quotes 😃
author = $STR_xetra11_Interactive; < like that and with dots
If wanted language is not present first from the top is used, or smth like that. correct. Either the original entry is used, if it doesn't exist then the topmost one is used
Hey, does anyone have a UAV to Screen script that isn't Killzones? Something similar to this https://www.youtube.com/watch?v=NRmEWtaKvSc ?
@hollow thistle @meager heart @still forum thanks! Didn't know that
@arctic owl I threw something together a while ago.
Here's the link: https://pastebin.com/ZfHHprA5
This should theoretically work with every UAV, just pass the Object/Screen and the UAV to the function.
@tough abyss , thanks going to give a go here after bit and see if I have any luck.
I'm trying to get an addAction that'll only be availabe if the player can point at the object, so it doesn't work through buildings and walls and stuff, any ideas?
Is there a exemple for a LOITER waypoint?
@tough abyss , It works well, only problem I'm having is that it objects do not appear past about 300 meters from the camera, vs what I'm seeing when I am in the gunner view. I understand this is a camera attached to the gunner part of a UAV.
That depends entirely on your PIP setting in the graphics options of the game.
Hmmm, I have it set to Ultra, I suppose that may be the limitations of the PIP. Better than nothing! Thanks for your help.
And, when I go into arsenal, the PIP totally disapears from the screen and does not come back. Oh Arma.. lol.
Any work around Quicksilver?
I tried making an action that terminates the script on the Monitor, then a script that restarts it.
No luck.
This is what I have as the script that is suppose to stop it.
uavmonitorphI = [] execVM "scripts/uavmonitor.sqf";
sleep 5;
terminate uavmonitorphI;
hint "PhantomI Signal Lost";
@still forum Is there any way to get a weapon reloading time delta?
don't know any
@arctic owl You have to first set "terminate" as the cameraEffect and then use camDestroy to get rid of it.
https://community.bistudio.com/wiki/cameraEffect
https://community.bistudio.com/wiki/camDestroy
I do have a question about spawning in many many objects. So far all of it is working just fine, but I do have some sync issues on a dedicated server. The server spawns those objects, but they are not in the right position and do not have the right rotation. this stays for around a minute or so and then it all snaps into place as it should.
Is there a way to prevent this?
This is the code snippet which spawns in the stuff, I have two of them one for simple objects and the other for normal object which have interactive parts.
{
_x params ["_class","_posASL","_vehDirAndUp"];
_object = createVehicle [_class, _posASL, [], 0, "NONE"];
// _object = createSimpleObject [_class, _posASL];
_object setVectorDirAndUp _vehDirAndUp;
_object setPosASL _posASL;
_object enableDynamicSimulation true;
} forEach _data;
Will spawning them at [0,0,0] also be faster or so?
this is all happening on the server btw
Does it do it without tinkering with simulation?
not sure.
actually looks like it is still happening without the simulation part. I do spawn in multiple locations one of them had no simlation statement there and it still happened
Is the script scheduled?
yes
Try wrapping inside of the loop in isNil{...}
Will spawning them at [0,0,0] also be faster or so?
yes, i guessenableDynamicSimulationis the slowest part here 🤔
i mean, I could be jsut overloading arma. I am spawning in so much that even visual code gave up in syntax highlighting
https://i.imgur.com/DDaHxPA.png
also running in unsheduled is a no go imo as these are way way too many objects
No one is suggesting you run it all unscheduled, just the object spawning and positioning part
Maybe you need to preload scene on clients as well, maybe it is not updating in time who knows
probably need to make the trigger areas larger then
the problem only occurs if you spawn the stuff directly on them (e.g. setting up the base camp) or if they drive to the locations.
i mean it is a lot i am spawning in, still.
from: https://i.imgur.com/j4zmFK0.jpg
to: https://i.imgur.com/vjVtrqc.jpg
So the delayed effect you observe is through Zeus interface or in game on the ground?
both
it is bascially the server needs to broadcast the right rotation and position of the object
it is there, but not at the right position
With just one player in game?
I tested with 2 other people around, they both told me it looked the same. e.g. some table in the ground 90° rotated in the rwrong direction etc
Pretty strange, you think you can make repro?
I wanted to release this at some point anyways. It is made to work with layers, it grabs the whole thing, extracts it into one huuuuge array so you can copy paste it into the spawn function.
Do you attach anything to the trigger?
no. right now i am using global variables as object holders, I will most likely switch to setVariable on the trigger in the future
i know it is a bit faster. it is only asl because that is with what i started out. now I cannot really change it anymore unless i want to edit an array with a few hundred items.
but yeah for future things posworld is better
It is not only better it is the one that should be used if you want exact position back, other pos commands introduce inaccuracy
🤔 that would explain some of the inaccuracies i experienced
Misalignment expected if you are not using get/setPosWorld
well, that means the stuff i have will stay misaligned as i got the pos with getPosASL
but future positions will be taken with getposworld instead
well, for now i just try spawning at 0,0,0 and moving them. salvaging those won't be possible right now.
getPosASL vs getPosWorld - same
so it is just the spawning part that has these problems when using setposAsl
getPosWorld // 0.0015 ms
getPosASL // 0.0016 ms
getPosATL // 0.0016 ms
getPos // 0.0020 ms
position // 0.0020 ms
getPosVisual // 0.0021 ms
visiblePosition // 0.0021 ms
getPosASLW // 0.0023 ms
Other setpos commands perform additional transformations while posWorld does not
There was a ticket on feedback tracker when it was introduced if anyone bothers to find it
meaning right now if i switch out setposasl with setposworld, it should be the same, just more accurate?
No you have to grab it with getPosWorld if you want to put it with setPosWorld
ah, sad
as far as i now there is no transformation command from asl to world
or at least i could not find one
spawning objects at [0,0,0] will speed up things, but probably the main problem is just number of objects... 🤷
still thanks for the feedback on this. I got some answers form some other problems i had. Still making these things spawn faster is also good.
isn't spawning of objects at [0,0,0] cause .rpt logs later?
Well, you tell me. I am not sooo sure
"Object not found" spam ?
afaik that happens when you set pos them out of map, not when you spawn them at [0,0,0] and set pos after 🤔
so far i am not seeing anything in the legs even repeated walking in and out of the trigger areas
must be a setpos thing then?
🤷
I had the same issue
But I think deleting and creating non physics objects and non vehicles is worse than letting them stay there
@digital jacinth Remember how FPS got better in terrible timing 3?
When we left the base on heli, I had ~60 fps. There were thousands of objects in the base. While there I was ~15
For me the only thing that helped with wrong pos and rotation was just setting it again.
So I'd create the objects and then reset their positions a second later.
@peak plover dunno it is a give and take really. I am utilizing the whole map with several highly detailed locations. i think at this point it is better to just despawn the objects as you do not return there
I'd say test it out. Don't hide any buildings and then teleport around.
I once tried by hiding and deleting all map objects and the fps impact out of view distance was minimal
There really shouldn't be much difference
However createVehicle on a HDD
once itis cached :v
That's true
yea
Can you elaborate on the latter?
Ohh
For unconscious state?
And revive?
I've noticed many people still use the thing where they respawn the unit where they died always.
So when someone gets killed, you see a guy appear and dissapear for 1 frame
@dim terrace isn't spawning of objects at [0,0,0] cause .rpt logs later? no
@meager heart afaik that happens when you set pos them out of map, not when you spawn them at [0,0,0] and set pos after no. So far that was caused by invalid backpack containers that weren't propagated to server and other clients properly.
yeah i know about the backpacks weirdness, iirc there was some issues with objects out of map too, Dedmen
pretty sure createAgent & createUnit did throw something
// Get designers to know more: Warning: Object B 1-1-B:10 (emtydoor.p3d) at position [1,1,0.356] too close to [0,0,0].
LogF("Warning: %s at position [%.2f,%.2f,%.2f] too close to [0,0,0].", cc_cast(GetDebugName()), vs._aimingPositionWorld.X(), vs._aimingPositionWorld.Y(), vs._aimingPositionWorld.Z());
Never seen that "too close to [0,0,0]" message before
I did, that's why I've used
private _agent = createAgent ["VirtualMan_F", [0,0,10000], [], 0, "CAN_COLLIDE"];```
Ah.. I don't see agents that often. That's probably why I didn't see it yet
it's in createUnit code too
oh btw vanilla respawn templates menu position teleports players at [0,0,0?] too...
when you will be in the respawn menu force close map and enjoy the view 😃
uav = createVehicle ["B_UAV_02_dynamicLoadout_F", [(getPosATL player select 0),(getPosATL player select 1),(getPosATL player select 2)+15000000], [], 0, "FLY"];
It does not matter how much I set the altitude, the UAV allways spawn in the same level.
where did you place it? what's your keyname, how do you try to localize
<?xml version="1.0" encoding="utf-8" ?>
<Project name="Deployment RPG">
<Package name="Lobby">
<Key ID="testString">
<Original>DebugName:</Original>
</Key>
</Package>
</Project>
Place in the root where my Description.ext lies.
And calling it like localize "testString"
and I guess isLocalized will return false for that?
checking...
Okay - I just figured out that I had to friggin restart the whole preview
not just heading back to the lobby
So it works now?
still benchmarking 😄
Asking this because I know you don’t like to read wiki, but having prefix str_ has some significance
Are there script commands or functions for spawning ship weapon systems in the right place?
@tough abyss doesn't have any significance in this case
<Project name="Deployed RPG">
<Package name="Lobby">
<Key ID="str.dpl.profile.info.name">
<Original>Name:</Original>
</Key>
<Key ID="str.dpl.profile.info.reputation">
<Original>Reputation:</Original>
</Key>
</Package>
</Project>
after 123423423 tests, this does work
Hi guys. Can I remove the "get out" action when in a vehicle?
I cant use removeAllActions player; since it only removes user added actions
Not without modding or disabling the action menu all together
oh ok
Is there anyway to stop the vitalsLoop from ACE that spawns on a character? I wanna test something with vitals but i need them to remain static and not get recalculated while i test things
I c
@nocturne basalt you can't remove the action, but you can add an eventhandler for GetOut that essentially puts the person back in the vehicle. IDK if that would solve the issue for you
nah it doesnt help. Im making a parachute with a firing from vehicle function
when Im in the FFV, I get the "get out" action
does the vehicle/parachute get deleted when that occurs?
no it only gets deleted when it hits the ground. Im putting the player into the driver position before it lands, or else you get stuck
this is just speculation, but wouldn't you be able to force them back into their old seat with the eventhandler? and at most they only see a frame of them falling? I know its not ideal, but might be the closet thing to want you want to accomplish
How do you put 2 switch cases into one to avoid something like this:
switch (_type) do {
case 0: {
code1;
};
case 1: {
code1;
};
case 2: {
code2;
};
};
Can you connect case 0 and 1 so you avoid identical cases?
maybe its better to use if else for this
That's an example, I have many more cases ofcourse
if ((_type ==1) or (_type == 0)) then {
//code1
} else {
code2
};```
Nah... I want to keep the switch since I have many cases
idk but i think this would work too:
switch (_type) do {
case (0 or 1) : {
//code1;
};
case 2 : {
//code2;
}
};```
That doesn't work, I tried it
damn... i could swear that worked. I thought that case evaluated the code behind it
You get an error that the or operator needs boolean:boolean
I guess I got it, looks a bit weird but gives me the right answer:
case 0: {
case 1: {
};
};
switch true do {
case ((_type == 0) or (_type == 1)) : {
//code1
};
case (_type == 2): {
//code2
};
};```
Edited and tested: works!
Just stop using switch if it's not suitable for what you're trying to do
@still forum Still better than having 20 different if statements
@vivid locust read my previous, it worked for me just now
Yep, I've seen it. Might give this a try. It kinda sucks that you can't use operators in the cases like
case ( < 2): {
};
Thanks
switch (_type) do {
case 0; // semicolon
case 1: { // colon
code1;
};
case 2: {
code2;
};
};
^ - this is also shown on wiki in examples of switch do usage
Hello guys, does anyone know how to use ace3 TRACE_2 Macros?
i mean, any other way then repack addon
i mean, any other way then repack addon no
Hey guys, I need help that involves setting up a mission's date upon start up, I know this is easily done through 3den editor but the highest year i can go to is 2050 (im using a halo mod so i want the year to to be 2535). I know i can use setDate but i cant seem to get it working, i followed what the wiki page says however when i load the mission, the date is not set to what i want it to be.
Here is what I have got.
waitUntil {time > 0};
setDate [2535, 9, 27, 14, 0];
};```
@tough abyss setDate requires a server side execution, but has local effects after the mission has started. The clients will sync their date if the server has the date set to 2535 before the mission has started
in this case, you are using waitUntil to ensure the mission has already started
if you need it to be set after the mission has started, use remotExec to set the date to 2353 locally on each client
the previous isn't true though if you don't change the year
@tough abyss you can edit the mission.sqm file directly too, just be sure not to edit it again in 3den afterwards (or repeat the process)
¯_(ツ)_/¯
:3
@tough abyss where do you put that code?
but the highest year i can go to is 2050
https://gyazo.com/221287b72737cf97d3a0536eaf6a2a5f 🤔
@tough abyss some kind of reactive armor ?
@tough abyss init.sqf, @subtle ore was able to help me out though
im also experimenting with the established shot intro thing and it displays the incorrect date, however i made a trigger for when i step on it, it displays the year and its the correct number (2535). Does anyone know a fix to this?
https://i.imgur.com/kU8hbg7.jpg established shot
https://i.imgur.com/dOzDuNQ.jpg trigger text thing
@tough abyss Hold on a second, does your whole date not sync or only year? I know there is a bug with the year, unless the same year is set in the editor it just won’t sync
whole date
Hmm
i wish the editor would allow me to use a year higher than 2050 lol
Considering the game is set in 2035 giving it another 15 years max sounds like an oversight, you should report it as a bug
is there any way to get rid of the date being displayed for the established shot?
Is it enabled in description.ext?
it's done through the editor
no option about a displayed date
is there any way to get rid of the date being displayed for the established shot?
no
i wish the editor would allow me to use a year higher than 2050 lol
https://discordapp.com/channels/105462288051380224/105462984087728128/496092557768392714
you can edit mission sqm...
if you missed that > https://discordapp.com/channels/105462288051380224/105462984087728128/496070702500413440 😃
@tough abyss
@meager heart i'll look into it, thanks!
so
am i being a smoothbrain here
in the init field of some vr objects, i'm using
oh SHIT I FORGOT TO SET THE VARSPACE
AAAAAAAA
lolololol
this setVariable ["starterBlocks", "true"]; is in VR object block
and
how the fuck am i supposed to return all of those variables into an array
i'm trying to use getVariable and I'm totally losing my mind
All variables?
All blocks?
Calmly explain what you are trying to do
I'm having an issue with ctrlCommit. It seems to cause my ctrlSetPosition to work inproperly
https://i.imgur.com/nqckp9z.jpg
3,21,34,1 would be on the bottom center of the screen
If I use ctrlCommit 0 on every frame
it bugs out
What are 3,21,34,1 winning lottery numbers for this week draw?
x y w h
The numbers are correct (2nd image)
But whenever I use ctrlCommit 0
It breaks it
Those numbers will place image outside visible area
Obviously ctrlCommit will move it outside
And don’t execute ctrlCommit on every frame it makes no sense
Yah
Wait a sec, are you the same world famous life developer nigel? Why would you do such a silly thing? Is this why life frameworks have such low standards?
I don't develop life 👺
That's what you say nigel, but when everyone sees your rpg framework 2.0, the secret will be out.
[_ctrlSliderTimeout,_sliderPos,_timeUntilOpen] spawn {
disableSerialization
params ['_ctrlSliderTimeout','_sliderPos','_timeUntilOpen'];
systemChat str _this;
systemChat str _ctrlSliderTimeout;
undefined variable in _ctrlSliderTimeout
🤔
Error speaks for itself
First one works and shows me https://i.imgur.com/YTlf3cd.jpg
Says it's a control
Ohh
I see
Disableserilization dones't have semicolon
And it didn't error
🤔
@peak plover trying to return a certain array of blocks
i don't want to set an individual variable for each block
and there's a lot of the same block that i need in different arrays, so i can't just use typeOf
Are these blocks all in the same area?
Yes
You can put a trigger with 3d space
and if they are all in there, you can get 'em
example
private _myArrayOfBlocks = [block1,block2,..];
private _myTrigger = triggerWithArea_1;
private _myArrayOfBlocksInTrigger = _myArrayOfBlocks inAreaArray _myTrigger;
As an alternative:
use 3den layers
Is there a way to detect whether an AI in a player's group has been given the Hold Fire command?
we have currentCommand but idk is there "hold fire"
sendSimpleCommand iirc has it but it returns nothing and no getters
oh.. maybe
~~with this > https://community.bistudio.com/wiki/commandingMenu~~
good morning brothers from another mothers
I am sad that I have to use localize to use stringtable values
I wonder if anybody of you have written a n0ice macro for it
Ah heres my question can I make a $ macro to have localize "key.of.awesomenezazsa substituted?
like hint $(key.of.awesoamsdasd)
can't test it cause am at work but am sure it is a not allowed symbol eh?
Dunno about dollar sign but you could use word or letter, something like
#define S(KEY) (localize #KEY)
Usage of macros however makes code difficult to read and in this case doesn’t improve anything
I wanted to find out of someone has a web site that has script samples. I;m looking for an insert and pick up
Oh and some mission editor samples too. I don't some missions in arma 2. The code in area 3 is more advanced that I thought
I don't some missions in arma 2. The code in area 3 is more advanced huh???
lmao
Bizarre
Hi, can anyone tell me how to confugure a mission with 3 respanws only. An script? Thanks.
What do you mean ? 3 different place to spawn ? or 3 respawn per player ?
respawns per player in the death place
well in the multiplayer options in 3den I think you can configure the respawn system
yes, but i can't find where to select the number of respawns
@tough abyss Macros are friggin awesome! localize "key.of.me" vs. STR(key.of.me) the latter wins my heart
... well after reading over it several times... meh
😄
@frigid raven yes you can use a macro like that.
Ignore that guy who clearly doesn't know what he's talking about 😄
@peak plover https://cdn.discordapp.com/attachments/287710933675933699/496121596080160768/20180930204941_1.jpg not really viable, i need to return an ever-shrinking mode for a bumper cars mini op i'm making -- i need a separate array for each 'ring' of VR blocks so i can progressively delete them
Does anyone know of a command to toggle free look?
I will ignore this guy what the actual fuck? I did not say you can’t use macros
@tough abyss If you're trying to define multiple "rings" of squares, Alt Syntax 3 may give you what you need - https://community.bistudio.com/wiki/inAreaArray
why do you people think you cant be touch lmao
thats an hard superiority complexe you got there
@tough abyss 😄 calm down - just joking around
No take your popcorn with you - before sb. else takes the seat
looks up after eating popcorn off the ground
👀
giving up by laying on the ground
listen here buddy that's too big-brained for me and also that's more effort than i want to put into this mission
Then 3den layers
@peak plover You can use 3den layers to return an array?
yea
holy shit
line 40 I got the 3den layer entities and did param [0,[]]
This returns all objects within that layer
My layer name is generated on the fly in this case
No problem
@tough abyss friends again?
Geee, let me think...sure
yay
Does anyone know how to add the alarm sound to an object?
to turn on and off such
@grizzled rain are you looking to make it so players can toggle the alarm?
Is GVAR a convention to adapt in your own mod/mission ? Or does it has some kind of copyright when I gonna use something similar?
yes @tough abyss
Rule of thumb, prefix your shit so that it won’t clash with other people’s shit
I don't think one can put copyright around 4 letters..
ALWAYS use prefix for global variables
whether you hide it behind macros doesn't really matter
yea but my macro names will not interfere with others do they?
ok got your point
I think you might be forgetting that macros are just copy-paste
really first time I use macros
Don't use macros if you don't know why you should
so I forget to grasp the concepts sometimes
I wanna make boilerplate statements more readable
getVariable is a good example in my opinion
Well I'd say GVAR is not boilerplate.
And yeah.. ACE also has macros for getVariable stuff. But. That kills readability completely
hm
#define DEBUG(var1) [format ["DEBUG: %1", var1], DEBUG_CTX, DEBUG_CFG] call CBA_fnc_debug;
I wanna slim down my debug statements actually
that's a very nice idea. That way you can also very easily disable all your debugging, by just emptying the macro
Aye
#define LDEBUG(var1,var2) [format ["DEBUG (var1): %1", var2], DEBUG_CTX, DEBUG_CFG] call CBA_fnc_debug
Any idea what's wrong with this macro? var1 is not getting evaled. Calling it like so:
LDEBUG("before", _allProfiles);
I am omitting the # because it doesn't need to get converted to a string in my opinion
Tried this as well LDEBUG(before, _allProfiles); // no ""
macro params aren't resolved inside "" strings
use '' strings
also leave away the quotes when you "call" the macro
ah ok - I found the quotes nice in the call cause of syntax highlighting for strings
Jeez I want to implement logic for 2 hours but still sitting there refactoring the whole
I am way too german
you mean "too perfect" 😉
🦌 are.... are we allowed to be patriotic again?
ah yea right - all eyes on Trump now so we can rise again!
Alright third try my Kameraden! This time we can make it!
...too soon?
for mother Chernarussia!
! yay
#define LDEBUG(var1,var2) [format ['DEBUG - var1: %1', var2], DEBUG_CTX, DEBUG_CFG] call CBA_fnc_debug
#define DEBUG(var1) [format ["DEBUG: %1", var1], DEBUG_CTX, DEBUG_CFG] call CBA_fnc_debug
Next mystery to solve...
Calling it like
LDEBUG(after, _allProfiles);
yields
DPL.PROFILES - - after: ["#CBA_HASH#",["76561197977776587"],[[<null>,<null>,["#CBA_HASH#",[],[],any]]],[]]
Please notice that DEBUG is being removed from the output - I do have a macro called DEBUG but that one expects argument. Might this be evaluated there?
Does anyone know a way to toggle free look?
double tap "alt"? is that what you mean?
I think he means by script eh?
There is a animation that plays, but the player is still allowed to move their head around, which makes the animation clip into the ground. I would like to switch to free look during the animation
Right now I going to use an extension to double tap alt... hoping for a better way
So you want the player to stop looking around right?
https://community.bistudio.com/wiki/lookAt
Found this - mybe you can force him to look at something specific
besides that only found the flag-check https://community.bistudio.com/wiki/freeLook
@fringe yoke well give it a try ?
Units can be players, too as far as I know
I found the check yeah, disappointed I didn't find an enableFreeLook like everything else
I tired it already in the debug console with no luck, didn't dig into it too much
I think there is a way to execute every action a user can do - but hard to find without the wording for it
I'm not sure if u can force freelook?
or disable
Also what would happen if trackIR
You can disable kinda by overriding key press but if it is remapped to mouse or joystick you can only check if the binding is not vanilla
Is it possible to make a Rsc_Picture clickable? I want to have them as clickable areas. Workaround would be overlay buttons without alpha values
Did u try an event?
https://community.bistudio.com/wiki/ctrlAddEventHandler
Yeah mousedown should work
okay then sth else is going wrong here
There is no Rsc_Picture though, only RscPicture
ye...
_profilePicture1 ctrlAddEventHandler ["MouseButtonDown", {
["DEBUG!666", DEBUG_CTX, DEBUG_CFG] call CBA_fnc_debug;
}];
Does not execute
trying same statement with a button now
k still not working - doing bullshit anyhow it seems
I’ve setup my artillery providers, my support provider and a unit they are synced and the artillery communicates and says Rounds complete but they never move to aim and the don’t fire. What am I doing wrong
Nevermind I figured it out I had to many providers
@frigid raven To make control fire event handlers, it should be enabled. AFAIR things like RscPicture|RscPictureKeepAspect are both disabled by default.
But can be enabled in the config eh?
thx a heap
oh... also "MouseButtonDown" - does not works with "RscPicture"... (i can't type)
is there anyway to get the IRL date/time in arma?
only with extensions afaik
Is it possible to grab chat control and add some text to it? thanks.
the only one i found was one by KillzoneKid, but its 32bit only, and i definitely would need 64
@tame lion Watch for real_date extension. It has both x86/x64.
yeah thats the one im referencing, I used the DL link from here:
http://killzonekid.com/arma-extension-real_date-dll-v3-0/
and used it. It states its only for 32bit
nevermind, he has a x64 buid on it too i just found
@tame lion you can do this with missionStart, it even has an example
thank you, i just got it to work 😃
long story short: I have a vehicle shop system and one of my members suggested doing like a "sale of the week" to me.
my idea was to do something like "Sundays between 7-9pm, all vehicles half off" or something to that effect
How would one determine which command to use to remove an item?
Like removeWeapon,removeMagazine,removeItem
bis_fnc_itemType?
addItem works with everything... so maybe removeItem too 🤔
Ohh it works with mags at least
be sure to have the right weapon item name
I had a stupid moment where the name visible in the eden editor != the name it needs for being added
ohh itemType works great thanks @still forum
I guess if I want to drop player uniform via script I have to get the items with itemCargo uniformContainer _unit
would probably easier to use the drop action
I know that works for weapons, might work for uniforms too
I need animationless/instant
hello superior living people
Well as soon as you have weapons with attachments in the uniform.. you're doomed
you can unlink them from the weapon and put them in uniform that way
I would just take the gun apart
Whatever 🤷🏻
As long as the items are not dissappearing 😄
not an arma script but wondering if anyone here has experience with python scripting and could tell me if my script will do the job i want it to
Kind of a general question scripting question here:
I know that while {true} do is bad to do, busty is it strenuous on the system if you put a sleep in that condition? Ex: while {sleep 60; true} do
put the sleep into the code, not condition ^^
Oh i thought you could put It in the condition. It's worked for me in other instances
Lol i don't know the engine well enough but I think i learned that from reading some script a long time ago when i was but a young padawan
My understanding is that the reason it's strenuous is because the condition code is getting run every frame, and my thought was that the sleep in the condition prevents that from happening
is because the condition code is getting run every frame nope
your script runs for at most 3ms per frame
and at minimum... never.
Without any sleep your while loop might run dozens of iterations each frame. For up to 3ms.
With a sleep you can make sure it only runs between once every sleep interval and.. never.
Oh yeah... The code will exit once the condition is false anyway lol
"The code will exit once the condition is false"
no it won't
the condition won't be satisfied if the condition is false
if you have code that's being run and your condition gets set to false somehow during that -- your code would still execute
it would stop executing after its current iteration would finish
but it would not exit
I'd love to find out what @tame lion 's goal is
Stop the loop condition from checking every frame?
private _i = 0;
// waituntil runs once per fram
waitUntil {
call my_fnc_runsEveryFrame;
// increment
_i = _i + 1;
(_i == 10 && {
_i = 0;
((currentWeapon player) isEqualTo (handGunWeapon player))
}) // condition
};
This would only check the condition every 10 frames
And execute the code every frame
it would check "some" condition at most every frame. But not "THE" condition 😄
Wll
let me edit
if you wanna run code every frame
but only wanna check the condition every 10 frames
🤷🏻
:U
but waitUntil doesn't run every frame
it runs at most once every frame
and minimum... never.
I'd say in the average case.. it runs every couple frames
and run it all in unscheduled
I think Crowmedic was only aiming to make his code less performance intensive
@tame lion Is the issue low fps ?
I was asking only a generalized question. But more specifically i have a vehicle shop that updates it's contentevery hour from server start via while {sleep 3600; true} do
I remembered reading somewhere that doing while true do's was a bad thing to do but figured if it only runes every hour it can't be that bad
your remembering and figuring are both correct
That way to do a hourly update seems horrendously bad.. But.. You don't really have alternatives with vanilla Arma
Isn/t sleep still inaccurate}
But is been working though lol
yeah. It works. And there aren't really any good alternatives. But it still makes my non-existent back hair stand up
As long as you don't need it critically on the hour :)
.dll and just a py script or sth 🤷🏻
Intercept is the only almost-perfect solution.
Is only an update that doesn't need to happen exactly at the hour. Just close enough
Sure, but there's gotta be more things like that
If you make an extension, you're still gonna have to poll it
I just mean use an existing extension
And use something other than arma to do things
Unless... Intercept.. But unless you go crazy like I would.. It's still polling
I was looking through a mod the other day (ace medical i think) and remember seeing something called cba_fnc_waitandexecute (or something to that effect) could that possibly be the alternative to my while sleep 3600 true do?
You almost can't do anything perfect with Arma ¯_(ツ)_/¯
Yeah. waitAndExecute is the most efficient alternative there is (besides.... that thing)
Don't be deterred from just sleeping for an hour if it really isn't time critical whatsoever @tame lion it's the simplest solution
and performance wise it doesn't really matter anyway
True
There are other ways of increasing performance
Which are probably more effective
-noSound :3
-nosound on server exe I'm assuming?
no.. that wouldn't make any sense ^^
scheduled scripts rarely kill performance
Server doesn't have sound anyway
Lol i knew that But the suggestion made me think i was wrong
disabling sound clientside gives more fps
How much more?
So 50% more?
Long story short I've got a project I've been working on over the past year. I've learn a lot in that time, better techniques, etc. I'm now going through all my older code and attempting to optimise and fix things that work but could work better
Ahh yeah.. Old projects are the best... NOT
Most of the time when people tell me "My mission is awesome, I have been working on it for over 3 years" you already know the SQF code is gonna be utter garbage
yikes
You either go over all your code about once per year and clean up. Or you rewrite everything. Or your code is gonna stay crap 😄
My mission is gonna be awesome, I've had the idea for it for years, just started writing it.
If I find a single private ARRAY in there you're gonna get a slap on the wrist
Yeah... As an example... The dialogs for this shop... They declare selections as global variables because i didn't realize better ways to store and transfer data between different ctrl event handlers
setVariable! 😄
I started looking into someone's mission on github today. This code is not his though, some idiot from armaholic wrote that years back and tons of people keep copying that shit. But I found DOZENS of occurrences of this
call compile format ["%1 = %2",_varType, _terrainGrid];
call compile format ["profileNamespace setVariable ['%1',%1]", _varType];
Note here that the profileNamespace variable is NEVER being read. It's purely useless garbage
You mean that they never pull it with profilenamespace variable?
getVariable yes
Yes... Lol I'm on my phone
Also the variable name is ""varname"" instead of "varname" like you would expect
Next you're gonna say they had with uiNamespace do { before that
no 😄 atleast I haven't seen that yet
Wait... I've done that... What's wrong with that?
kinda broken and unreliable.
I think the currentNamespace would carry over to other scripts even though you don't intent to
I'm not up-to-date to whether that has been fixed
but this is how this should work, correct?
with uinamespace do {
var1 = "Test Text";
};
hint var1; //<--- fails
hint (uinamespace getvariable "var1"); //<-- succeeds
just as a general theory question
yes
(but nothing stops you doing uiNamespace setVariable...!)
oh i know, it was just a working example to make sure i understood the concept lol\
<Key ID="str.dpl.profile.info.isprisoner">
<Original>Prisoner: </Original>
<German>Gefangener: </German>
</Key>
yields Prisoner:?
😦
when using normal it trims it
There is no way in forEachs scope to access the current iteration index eh?
Have a taco, will make you feel better.
there, don't go and getting yourself fat now.
@peak plover Brain fog?
You got sugar molecules in the form of cookies?
Brain fog is a general term for dysfunctions in focus, learning, and memory that can create brief episodes of confusion, disorientation and frustration.
It's when you are trying to script and it's not working and you don't know why and you get more and more frustrated and confused
I'm having an issue with addPublicVariableEventHandler not firing despite me actually changing the variable. Here is how im using it:
"APM_Admin_notes" addPublicVariableEventHandler {
hint str _this;
};```
and anytime i do this:
```sqf
APM_Admin_notes = "Some Data";
publicVariable "APM_Admin_notes";
the above code does not fire. Any ideas?
When are you calling the code? There's something with using it in preinit/postinit that you need to spawn it I believe
Rule?
dropped my keyboard and that popped out
the variable is gonna change whenever a player enters a note into the array that is going to be APM_Admin_notes and the client is going to public the new variable
what will happen is: Client who is an "Admin" (not logged or voted, but declared through my system) will enter data into a dialog, that data will get sent to the server and pushback'ed into the APM_Admin_notes array. The server will then PublicVariable APM_Admin_notes in order to make sure that all admins now have all the "notes" which will be in this array
let me ask this: I'm currently testing in the editor with Local Hosting, not dedicated atm, does that affect how this works? does the event only happen when you aren't the one changing and public'ing the new variable?
This is the login handler (mouse button down) for my login Dialog. It is being executed.
Please note that _profile is a CBA Hash. Debugging it in the handler scope yields the expected values.
_loginHandler = {
params ["_ctrl"];
private _profile = _ctrl getVariable ["_profile", EMPTY_HASH];
closeDialog 1;
_profile call X11_fnc_login;
};
But when inside the X11_fnc_login the given param _profile is not the hash it was before. I know Dialogs work a bit different but did wasn't aware it will screw these things up?
i only did hint str _this to test how addPublicVariableEventHandler worked
I strongly suggest to dump public variable EH and use functions and remoteExecute instead
@frigid raven What data type?
try
[_profile] call X11_fnc_login;```
CBA Hash (pseudo) so it isn in fact a huge ass array
[_profile] spawn X11_fnc_login;
is working now
no clue why -_-
look in X11_fnc_login
how are the params grabbed
I have no clue what pseudo means
Wouldn't the has be an array?
Pesudo -> Not genuine, perpetrating something, but is still not so
I have an array of 3 elements
want to remove the value of the element at index 1
_array set [1, nil] ?
Yes
you want to replace the 1 element by nothing. Or you want to remove the element?
Example depending on what you want to happen:
_array = [3, 4, 5];
_array set [1, nil]; //[3, nil, 5];
_array deleteAt 1; // [3, 5];
the deleteAt is enough to remove it lol.. thought you were him 😄
I just want to have an empty value there without having it pop back somehow
So I did it right, yay!
_player setVariable [KEY_PROFILE_FETCHED, EMPTY_HASH, _ownerId];
Does this make sense? I want the variable to be available on the players namespace.
Yeah. Looks fine I'd say. But better test that out before pushing it to production 😄
I am unsure about having _player as first param... I kinda see this as doubled args
haha ye testing the whole time
Well.. Do you want to set it on the player object?
or in that players missionNamespace?
mod is so huge for me now I am getting friggin crayz
Ehm actually I getVar on the player object
so yea on the player
that's correct then.
Have _ownerId instead of _player as left operand
Hm? Where are you talking about Sa?
@frigid raven post, I assume he tries to come up with a way to send specific player a variable or something
Come up as in imagine something that probably will never be in game
Unless it has something to do with Intercept since Dedmen responded to him
setVariable doesn't take a number as left argument
He is using the
<object> setVariable [<name>, <value>, <public variable to clientID>]
sytnax
Well, I feel stupid now
How did I miss third array value accepting client id or even array of ids
You don't really use it that much ^^
I thought he was thinking about how it could potentially work
Yeah, never had a need for it before
So @frigid raven ignore anything I said
yea thats what I felt weird about I have the left side argument player object and also as third right arg the owner ID... kinda double payload since the func could get the ID on the left side or get the owner by itself from the _player object
wow I do not understand what I just wrote
It makes sense since you might want to set variable on client which doesn't own target object