#arma3_scripting
1 messages ยท Page 381 of 1
exactly
What do you need a text for?
probably still cleaner to use arrays
Yeah, gl... i am out... either Trolling or got 0 idea of anything
classNameOfCrashedHeli = "B_Heli_Light_01_F" + "Crashed";
B_Heli_Light_01_FCrashed = B_Heli_Light_01_FCrashed + 1;
setVariable
I told you that before, Justin
Dscha - Today at 10:02 AM
missionNameSpace setVariable [myString,"bla"];
hint newString; //"bla"
missionNameSpace setVariable [typeOf (_this select 0),(missionNameSpace getVariable [typeOf (_this select 0),0])+1];
So in that case:
missionNameSpace setVariable [(typeOf _Veh), DoYourStuff];```
thanks, I'll mess around with that.
And before you ask again: be sure what you want and make it clear for others, we can't look inside your head and know what you want.
I normally do, It was a stretch so was difficult to explain
"I want to store the kills of a Vehicle in a Variable, wich has the same name as the Classname of the chopper"
maybe?
๐
_i = crashedTyoes find typeOf _heli;
if (_i isEqualTo -1) then {
crashedTypes pushBack typeOf _heli;
crashedCount pushBack 1;
} else {
crashedCount set [_i, (crashedCount select _i) + 1];
}
that should also work and youll have all information in 2 arrays
๐ Would be better, yeah.
that is expensive on performance I believe but I'll test the performance of both.
pff
lol
is that the reason you arent using switch?
youre not gonna have 1000 helicopters crashing per second or are you ?
This takes maybe.. hm... 0.01ms? Don't try to be smart, when you don't know the basics^^ (no offense)
You just end up making it harder for you
then setVariable is also not the best idea
it kind of depends on how you want to read your data
if you want a list of all the helicopters who crashed, then use those arrays
if you just need to check individual helicopters against their classname
then the setvariable will suffice
Wtf
I would like to store them as variables and then when I go to read them then I'd collect them into an array and then display them. If I'm not mistaken you have to reconstruct an array if you manipulating it. Right?
๐คฆ
so why not have them neatly stored in an array in the first place ?
Why? Why not store them in an array from the beginning?
use Tajins example, its exactly what you would want
ah, so I can actually set the value...didn't know abou that. In the past I would deconstruct the array and make the change and then reconstruct it....
oO
There are linkings below that lead you to "close to what you do"-Commands
and there are many fancy things you can do with arrays
e.g.
https://community.bistudio.com/wiki/set
has:
See also:
Array
plus a
valuea plus valueb
a - b
resize
reverse
select
in
find
toArray
toString
forEach
count
pushBack
pushBackUnique
apply
deleteAt
deleteRange
append
sort
param
params
arrayIntersect
splitString
joinString```
(almost) all are related to Arrays
I've spent over 100 hours on that site. I'm familiar with it but nothing pointed my research of arrays to set...
thanks @jade abyss
Then you haven't read carefully ๐
uhm
@candid jay yes. to your setPos on local vehicle question.
@simple solstice Yes. Can't overwrite variables that contain compileFinal'ed code.
@tulip cloud Dscha gave you the exact correct answer. Exactly what you were asking to do.
You explained what you wanted correctly right in your first question. You got the correct answer to that immediatly.
The problem is not you not formulating your question good enough as Dscha said. The problem is you not accepting the correct answer for some reason.
If you want performance best method would be to create yourself a seperate namespace (CBA) and store all crash counts as a typeof _vehicle variable inside that namespace.
Math wizards assemble! Can anyone help me with problem. How to calculate BLUE position? Here is doodle: https://i.imgur.com/FFP1INB.png
if you already have posgreen and posred:
_posBlue = _posGreen vectorAdd (_posGreen vectorDiff _posRed);
btw. getPos direction seems to have some precision problems
or at least it seemed that way last time i used it
seemed to go only in 1m steps
Thanks @still forum
If I want a script to fire when a player presses a hotkey, do I need a script that is constantly checking or can it be fired only when the key is pressed?
If I want to piggyback off an pre-existing hotkey. For instance the player presses 'R' to reload. Then it outputs "player is reloading". How can I do this? The player potentially could set the hotkey to something else. So I need to detect their hotkey and then add my additional script to that hotkey.
But the player could change reload from R (19) to Q (16). I'm wondering how I would detect this change so that my script is fired by the right keypress.
it has some problems with modifers though
I guess those problems can be avoided though if you combine it with https://community.bistudio.com/wiki/inputAction
hmm actually, no not really
unless you just use inputAction by itself inside a keydown eh
Hey guys, any idea why a CSAT VTOL would fail to take off again after executing a Vehicle Unload waypoint?
I have six identical ones, two just won't take off again after executing the unload
the other four work as expected
all the vehicles are successfully unloaded every time.
Yeah, if I could just modify the reload inputAction that would be the simplest way. Then I'm not dealing with reassigned hotkeys etc.
how about using reload with needReload? not sure if it would work, but worth a try.
and bind on R
This is a zeus question but never see anyone talking about scripting in there so posting here.
Anyone know of a way to force zeus to select select a unit?
#zeus_discussion
You never see anyone talking about scripting? Just read the messages right above you and you will see them.
You mean you want to force him to move his mouse and select someone?
There is a getter https://community.bistudio.com/wiki/curatorSelected
but no setter
yeah looking for setter.
I will probably have to search the units tree for the unit and use tvsetCurSel
is there a fnc for what the tree search bar does, or do I have to code it myself?
params ["_triggerName","_radius","_scale","_frequency"];
_ordnanceType = ["G_40mm_HE","M_RPG32_F","M_Mo_82mm_AT_LG","Sh_120mm_HE","Sh_155mm_AMOS","Bo_GBU12_LGB"];
_shellNumber = floor(random _scale);
_shellName = _ordnanceType select _shellNumber;
_myObjectInstance = _triggerName;
_pos = getPosWorld _myObjectInstance;
if (count(synchronizedObjects _myObjectInstance) >= 1) then {
_objects = synchronizedObjects _myObjectInstance;
_selectedMarker = selectRandom _objects;
_pos = getPosWorld _selectedMarker
};
while {triggerActivated _myObjectInstance} do {
_bomb = createVehicle [_shellName,[(_pos select 0) + (_radius * sin floor(random 360)),(_pos select 1) + (_radius * cos floor(random 360)), 25],[], 0, "FLY"];
_bomb setDamage 1;
sleep _frequency
};
for some reason when _radius is below 150 bombs just kinda float in the air
already did, no dice
_shellNumber = floor(random _scale);
_shellName = _ordnanceType select _shellNumber;
-> selectRandom
with some magic to include _scale ofcause
yeah i was thinking of that too, the original script i pulled had it and i'm trying to improve it
That code is kinda hard to read...
code opti 101 for me honestly, first time im doing somethin like this
no need to use getPosWorld getPos is enough. Dunno which is cheaper performance wise though. But you don't seem to care about performance anyway.
As to why they float no Idea.. Does float mean they don't explode?
yeah, they just stay suspended on the air
any script errors maybe?
add systemChat's all over your code and then just see what happens
Lol, this is my script... You're spawning the bombs in the air, with no velocity.
yeah i was bored and thought i'd pick it up to see what i could do -w-
Gravity usually takes care of adding velocity
yeah that
Idk, it works for me. I set damage to 1 on the booms so they blew up right away.
@sullen dune work on a script that makes thrown satchels spawn a "land_ww2_crater_sand" object when they explode.
i have seen too much in arma to know what would happen by doing that
engineer throws satchel, tiger tank suddenly clips with spawned crater and flies upward at mach 8 in a fiery explosion
Making an Omaha beach mission, and I want people to be able to sort of spawn cover by throwing bombs to make craters to hide it.
The beach is really flat and open, and there's just a certain point where you die if you take that extra step forwards.
spoilers
alright, fixed it with a hacky solution
params ["_triggerName","_radius","_scale","_frequency"];
_ordnanceType = ["R_TBG32V_F","M_Mo_82mm_AT_LG","Sh_155mm_AMOS","Bo_Mk82"];
_shellNumber = floor(random _scale);
_shellName = _ordnanceType select _shellNumber;
systemChat 'Shell selected';
_myObjectInstance = _triggerName;
_pos = getPosWorld _myObjectInstance;
if (count(synchronizedObjects _myObjectInstance) >= 1) then {
_objects = synchronizedObjects _myObjectInstance;
_selectedMarker = selectRandom _objects;
_pos = getPosWorld _selectedMarker
};
systemChat 'Position selected';
while {triggerActivated _myObjectInstance} do {
_posX = (_pos select 0) + (_radius * sin floor(random 360));
_posY = (_pos select 1) + (_radius * cos floor(random 360));
_bomb = createVehicle [_shellName,[_posX,_posY,0],[], 0, "NONE"];
systemChat format ['Bomb spawned at %1',position _bomb];
sleep _frequency;
};
for ref
Continuing yesterday's discussion... I'm trying to move an object from A to B back and forth in a straight line, and want this to run in MP
I can change the model properties if needed, right now it inherits from ThingX
setVelocity does nothing, well it does give it a little push but then it settles
setPos is probably unsustainable in MP
setVelocityTransformation doesn't move the object
yeah we talked about it yesterday
addForce is an impulse
otherwise there's no option that would properly work in MP. What is it for exactly? If you only need direct local effect you could try local setpos
right
local setpos and setdir is my current way to go
and a periodical info message from server with coordinates
to sync
yeah, do that thing with creating local object and attachTo with that is probably your best bet if you want it to be smooth in MP
one question though
if I have point A and B
moving from A to B
what is the easiest way to get the coordinates in-between
vector calculations
yes
there's simply no other way around
vectorWorldToModel?
can't remember which vector commands do what right now ๐
I only remember the axis ones
if the direction doesn't change you could even just the alternative getPos syntax
_object getPos [_dir, _distance] (or the other way around?)
distance heading
also why didn't they make a whole other command for relPos
so on every iteration i need to compute the pos
nah
alternative getPos syntax
instead of, you know, make variants of relPos for all the getPos commands
so:
relPos
relPosASL
relPosWorld
the stupid thing is that bis_fnc_relPos has a different output than the alternative syntax of getPos
yeah, noticed that when taking the camera calculus from arsenal
still bothered that I can't use velocity logic on a custom vehicle
that would just sync automatically
the baloon is just a thingX BTW
i bet that alternative syntax fucks up anyway with pitch/bank? ๐
fuck I can't get the starting point of this setPos computation in between 2 positions while keeping a steady velocity
but it shouldn't matter, it's taken from model center
it's actually a triangle and not all sides are even
model center does not change
it's either that or the center of boundingBoxReal, don't think there's objects with different values for those tho
ah, that'd be too practical
Or just #Intercept it and read bounding box directly from Model ยฏ_(ใ)_/ยฏ
Like I kinda did for Advanced ballistics to do stuff
i've finished the french and english strings for arsenal rewrite ๐
Directly from model
not via script
ACE also had code to directly read p3d's. Until I removed it like.. last week or so..
But it's still in repository history
dunno
Couldn't you.. instead of the box and intersection thingy..
Just use lineIntersects script?
fn_boundingBoxWorldRealRealest
Just use model center and go to each side till no intersection anymore.. And then try to draw a full box using lineIntersects with a cm space between each line
modelToWorldWorld ๐
Would probably take a couple minutes using SQF.. But #Intercept
not only that but some bounding boxes are bigger on purpose IE: tonks turrets
That would be alot easier in Intercept think ๐
Everything is easier in Intercept
#StartDiscussionNow!
The channel description doesn't say "No advertising" ๐
plus the channel message makes no sense huehuehue
cmon' i'm sure you can make this worse
That's actually quite good
seems legit
Ouch
And all possible combinations are true.
Although I prefer a #%1 for the last format string
I can't seem to find a way to compute the position between two points (3d) and specify a velocity somehow to use setPos
position between 2 points?
p1 - (p1 - p2)/2
no
I want to move between A and B
let's say that I setPos on an object every 0.01 seconds
jup
how do I compute setPos so that it takes 10 seconds to go from A to B, as an example
velocity is in meters/second
yes ๐
distance/10 gives you distance that you need to travel every second to reach target in 10 seconds.. -> velocity
yes but in 3d
that's what vector commands are for
No difference in 3D
no difference in 2D or 3D
oh you do the same on each axis?
just that distance is a 3D vector instead of 1D
i understand that but I can't seem to see how to
depends on parabola or direct
vectorMultiply by 0.1 == distance/10
then as told already
distance and direction you can get by targetPoint-startPoint.
(target-part) * 0.1
and that gives you the amount and direction you need to move every second
ok will try looking into that
pos is returned in x,y,z so from the two positions calculate from x and y fiddderence = distance
i hate vectors ๐
The formulas are all the same as with only 1 dimension
Just do it with 1 dimension.
And then just replace the numbers by 3D vectors and the vector math script commands (Because Arma is to dumb to ARRAY * ARRAY) Hm.. #Intercept
oh I see
so first manually compute X Y Z differences
and then I can move to the vectors which should be just the same
If you want to make it easier for yourself you can probably https://community.bistudio.com/wiki/linearConversion
that seems to be an odd function, i'd figure the math is easy for that
maybe I'm misunderstanding it
minTo is start position
maxTo is end position
minFrom is 0 maxFrom is 1
and then value is just between 0-1 of how much distance you traveled
ok
Sadly that only takes single numbers not vectors
thank you ded
so you need to do it for x,y,z seperately
will try
yeah so I might as well do the math and then switch to vectors as you originally suggested
will see
BTW I was considering to use an agent
then make it invisible
and attach my object to it
that should probably do all of the syncing for me in MP
might still be clunky
isn't there a vehicle of some sort
that doesn't consider physx
๐ฎ .. Yeah... That could work.. But.. ugh...
a mosquito ๐
that is always local
i used flys for such things
my first ever rope in MP was a seagul
is a seagul sync'ed in MP?
i mean, can you use this on a seagull? https://community.bistudio.com/wiki/setDriveOnPath
any Ai can be if configged correct thing is to make the mechanic smple
you will have to check i didnt make it since 2007
I wonder how setDriveOnPath could be used then all of this would be easy
well it is a linear path you need , always same ?
setDriveOnPath is AI based... I don't think you should trust AI with anything.
lol
why not grab a bunch of co - ords and then place in ana array and then setpos _X
unless setDriveOnPath works on agents don't use it
of course DB that's what it's all about
but in MP setPos is going to be shitty as hell unless done on local objects that then you need to sync somehow
maybe attach to an animated vertex ?
just sync by CBA_missionTime
point the model then animate
and setPos in PFH ^^
how far is the distance to travel ?
PFH?
Per frame handler - Each frame
CBA_missionTime because it is synced between everything. So you have the same value over all clients & server
well it's the same as serverTime, no?
there ya go
ok I have enough food for thought
thank you dedmen
but I will try to use a MOSQUITO or similar first lol
hey, I'm new(ish) just never got really advanced into scripting in general, but I have two questions.
does anyone have an earplugs script that is binded to a key that i can use or rebind.
Do you have CBA?
yes
That's quite easy then
its always this earplugs bullshit
lol and death screams I need
Or something with item shops
Do you have ACE? If yes then that just got harder.. If you don't want to use the ACE earplugs
no ACE
ACE earplugs come packed with ear wax
https://cbateam.github.io/CBA_A3/docs/files/keybinding/fnc_addKeybind-sqf.html#CBA_fnc_addKeybind Adding keybind
And then as code you can just https://community.bistudio.com/wiki/fadeSound
well, better start learning how to make those earplugs script because they take 3 fucking lines
lol
I just find it mind boggling tbh
you seriously saying Ace and CBA isnt reforamtted code from single addon makers ?
haha
well now i think i heard it all
Yes.
bull
It actually is.. A lot of ACE was written specifically for ACE
macros and defines do not hide originality
or AGM or CSE
SPooner stuff still there mine and al simmmonsstuff still there etc etc
hahahahahahahahahahahahahha
haha
just check the commits
Dude.. The full history is literally there.
You can go back 3 years and watch every line of code get written one by one if you want
oh god, all those by commy2 huehuehue
pricnicples are all there and again back to the original point : since day 1 all addon makers and mission makers look at others code to learn
Yes. And then make their own code. based on the principles they learned
its ok to mock but first principle must be , stick to facts
you're the one who provide none tho
If you start writing code that isn't based on SQF syntax and how SQF works... Your code won't work.
so back to original statement to the newb : there is a standalone code on armaholic
problem here is you are blinded by a linear mentality of new kid on the block cannot possibly have a new and or correct point of view , unfortuantely its cot condusive to progression
bullies
you try to be intelectual bully lol
..... it's still 3 lines of code max
if it was a garrison script or some more complicated stuff, yes
You are telling someone that he is a "newb" and probably to dumb to make something himself and instead go to armaholic to fetch something ready-made.
And trying to tell us we bully?
sorry but that has no pertinant p[oint to the convo
yeah I have no idea what i'm doing so far
holding the key down would toggle on/off very quickly Are you sure? CBA keybind?
I already asked if he has CBA. And he does
๐
completly forgot that these exist
Argh fuck off you spammer.
that's the only option for that, or some very painful agent pathing
agent pathing is entirely different from AI pathing
they have no brains
i'm currently readering Fockers guide to arma 3 scripting
reading
and gonna use that earplugs script too, thanks by the way
to reverse-engineer too
right now they just follow commands to the T
which is perfect for what they're supposed to be used for
nah, just an agent created via createAgent
I keep hearing the term agent, I guess it's like dumbed down AI?
i know animals are agents but nothing else
pretty much
Agents are basically empty AI's
they're perfect for cinematic stuff ๐
agents use moveto in fsm but are thick in sqf with move and domove
animal agents get stuck alot
because they cant reverse and are limited to 5 anims
didn't they fix that?
animals animations are just so fucky
it was so hilarious at one time watching a snake open the door in a session
i have just made a Manimal Hybrid for a horse i now completely understand how tard animals are
and no one believed me
funniest was fish in town , saddest was the Bi fix that ruined all ambients
that's crazy talk
too bad they aren't MP synced
T.T
thefuck, civilians have the same brain components as animals
so, none
i agree wholeheartedly
as learned on qs' georgetown
unless he did some magic australian trickery to make civilians stand in your way 99% of the time
i figured as much
https://www.youtube.com/watch?v=WVMYoNY3GNQ i tried rabbit miner 3 rabbits had same FSm and suddenly they went AI 2.0 and decided they dont want to die
i would think they're less expensive in performance, right?
ohhh that's smart
dang
qs you're on a different level
bunnies need full path planning, because they're terminators huehuehue
(or because they get stuck a lot)
viper bunny
making those animations must've been a gigantic pita
it's already a pain in the ass without having to do the skelliboi yourself
its harder to tell it not to get in a car
wait, you're using full AI on it?
yeah its a man
oh god the laughs
the Bike horse is dead
the "situations" it gets into must be hilarious
i wistled in a high rise other day in he walks opens door and all
fortnately now i can remove that from actions so maybe he/she calm down some
๐
lol lazy
or it's a feature
does it have hidden other model types or is it memory points ?
looks like it used to have atrailer and they left somehting in there
could be old verts not deleted , im guessing on the size = double alamost = trailer
yeah i think i saw this before maybe it was VBS or wishful physx MEDIA lol
i remember a varaint with trailed something
cant it be checked in difefrent lods or am i imagining ?
hi all: easiest way to convert a direction (360) into a vectorDir?
awesome
btw FYI dedmen I ended up using https://community.bistudio.com/wiki/setVelocityTransformation
using FPS info to compute time, hence covered distance
in SP now it is all good
I need to ensure the MP now, will do soon
If I want to create a hint that tells the player to press 'x' to complete 'an action'. how do I look up an action and return the action key?
not sure if I understand you correctly but https://community.bistudio.com/wiki/inputAction
im not one to pry behind the blinds
though i get the feeling i should if i wanna get good at this sqf thing
I've already looked at inputAction. It can only be used to watch for a specific action to be pressed. I can't see what keys are mapped to that button using inputAction.
actionkeys looks like it's going to do what I want. Gotta learn how to use DIK KeyCodes.
Trying to make camera follow fast moving vehicle by setting camera position each frame, always end up with vehicle (or camera relative to it) jerking back and forth a little. Is there any way you can make camera position smoothly follow the vehicle?
yes
detach and reattach it every frame
that's what BIS does for the arsenal cam to smooth the movement
well, detach part can be ignored, just use attachTo every frame
Thanks, gonna try it.
i've touched up a bit BIS code and replaced the vars for the rewrite but it boils down to this for the "updating pos" part of it:
GVAR(cameraPosition) params ["_distance", "_dirH", "_dirV"];
[GVAR(cameraHelper), [_dirH + 180, - _dirV, 0]] call bis_fnc_setobjectrotation;
GVAR(cameraHelper) attachTo [GVAR(center), GVAR(cameraPosition) select 3, ""]; //--- Reattach for smooth movement
GVAR(camera) setPos (GVAR(cameraHelper) modelToWorld [0, -_distance, 0]);
GVAR(camera) setVectorDirAndUp [vectorDir GVAR(cameraHelper), vectorUp GVAR(cameraHelper)];
Hm, still can't do it. If I do attachTo every frame I get same jerkiness
I don't have middle object though, attaching camera to the vehicle
i'm using a logic as a helper
GVAR(cameraHelper) = createAgent ["Logic", position GVAR(center) ,[] ,0 ,"none"];
it's attached to the unit / vehicle and the camera just get setPos'd depending on it's position
Nope, having logic attached and then camera setpos'ed modelToWorld from the logic doesn't help, same result, camera jerkiness
how often is the camPos updated? every frame?
SRTS_commandCam = "camera" camCreate position player;
showCinemaBorder false;
SRTS_commandCam camSetFOV 0.4;
SRTS_commandCam cameraEffect ["INTERNAL","BACK"];
SRTS_commandCam camSetTarget dummy1;
[] spawn
{
while {!isNull SRTS_commandCam} do
{
_camPos = [dummy1,25,90] call BIS_fnc_relPos;
_camPos set [2, (_camPos select 2) + 15];
SRTS_commandCam camPreparePos _camPos;
SRTS_commandCam camCommitPrepared 1;
sleep 0.025;
};
};
On Draw3d, with setPos command
same here
just retested that code following full speed jet works well
Tried opening arsenal on jet, same camera jerkiness as I have with my script
It only appears smooth because of 1 second commit which also makes camera lag behind fast moving vehicle, you can't say have it right above it
@lone glade Try opening arsenal while in jet and you'll see that is it jerky as well
yes, checking BIS spectator right now
apparently they use setPosASL
it's also super nicely written
which is very nice for once
Yeah spectator seems to be following vehicle smoothly, gonna check it out
it's fairly simple too
but I can't find for the life of me the UI parts of it with the onKeyDown Ehs
nicely written indeed
_countW = { side group _x == WEST } count _nearEntities;
WEST in all caps triggers me though, almost looks like str west output yet it is scripting command
and those brackets
newline for them uuurgh
found it, finally
the rest of the camera handling is in a3\ui_f\scripts\gui\rscDisplayEGspectator
Still can't figure it out and recreate what EG spectator does.
hey there , im here to ask for some assistance in firguring out what i did wrong with this script . starting at 3:37 mark i followed what was done in the video and mortars arent shooting. here is the link to the video https://www.youtube.com/watch?v=lC_Re0DEJFI
anyone know how to spawn in a custom composition?
@meager granite use modelToWorldVisual the non-visual commands use the last known position. The visual ones interpolate.
@tough abyss Did you recommend that to the other guy?
There was a guy yesterday that thought he needed to use bis_fnc_objectsmapper to place compositions which was total bullshit
I created my own functions for that that uses super simple objects.
I got a building mapping system that has good locations for fortifications and AI positions. Also the AI positions are the right direction this way they don't look into a wall...
It uses modeltoworld and worldtomodel. This way it's on the exact spot I want it to be.
Not really.
I was gonna be but its doing stuff that isn't needed.
While objects mapper can spawn stuff anywhere my function needs a center object.
Uh no.
I've made a sandbag castle. Angles and all.
Worked perfect.
It was a perfect copy from the original one.
That sounds like grabbing the objects was ASL and placing them was AGL
Ah I've not tested with water. Because I'm not using water a lot.
jasper was the position the same or could it be anywhere
@cedar kindle anywhere.
mind sharing
Well it's an server side mod for my unit but I don't mind sharing the idea and how it works.
sure but if some one has already made it why invent the wheel again
It's mainly used for the buildings on takistan.
It needs a center object, the building for me.
yeah sounds like what i need, ive used objectsMapper and while it works itโs not perfect
I got a SP VR mission with all these building templates that stores it into a array that then can be used by the functions.
So the grabbing part is only used to make this array. As it's slow and under performed.
So change their positions?
Well the best is to remove it.
Yea I see.
You use players vision in a way to see what gets hidden away?
Yea
But you do use the players viewdistance?
how do you select what should be a simple object or not?
K
thereโs a command of some kind since eden can do it?
createSimpleObject ?
must be a better way
no I mean how would you check that โyeah this is just a sandbag, use simple objectโ vs โthis thing has doors, createVehicleโ
eden seems able to do it ?
That's in the config of a ovject
But a lot of objects aren't assigned to be a simple object while they should.
That's why I do it my self.
You also have to be aware of https://feedback.bistudio.com/T127068
With Draw3D, is it possible for you to use line breaks in the text element?
Draw3D is a eventhandler that you can do literally anything with.
What text do you mean? systemChat/hint/some UI thingy
drawIcon3D i would assume
Sorry, lemme specify a bit better
Yeah my bad
DrawIcon3D
addMissionEventHandler ["Draw3D", {
drawIcon3D ["", [1,0,0,1], position cursorTarget, 0, 0, 0, "Target", 1, 0.05, "PuristaMedium"];
}];
So using that as an example
If I wanted to write 'Enemy' on the line below Target, is that possible?
Looks like no.
If you read the wiki comments to drawIcon3D they say no.. but..
drawIcon3D ["", [1,0,0,1], position cursorTarget, 0, 0, 0, format["%1Target",endl] , 1, 0.05, "PuristaMedium"];
Try that
Nope ๐ฆ
when I'm adding a string to an array it's getting double quotes. How do I prevent this?
How do you add it to the array?
@still forum @tough abyss Thanks for trying, and thanks for the info, just wanted to make sure I wasn't missing something#
Answer is. No it's not getting double quotes. Now to find out what you are doing wrong.
when I do diag_log currentWeapon player;
it returns "arifle_MX_F"
If I do ```sqf
myArray = [[currentWeapon player]];
diag_log myArray ;
output is `""arifle_MX_F""`
if I'm going through all that trouble I might as well compile so it is {arifle_MX_F}
๐ค
this seems like an extremely obvious question but my curiosity peeks at me
is there a performance difference between using if-then / switches?
at least on cases with more than a few checks
Instead of instancing many if you CAN instance only one switch
yeah that I know, I'm just thinking about whether it's a code cleanup/formatting thing or strictly performance related
im trying to optimize an old mission of mine for MP play and, well, let's just say I know a whole lot more now than I did back then
switch is micro slower
I had some pretty nested if statements and others hated it so I switched to switch. though performance is a deal to mean so I checked and it was neglible
@tulip cloud That doesn't mean it is doublequote in the array.
It is not.
@tough abyss Taking away the first and last character of a non-quoted string won't do good.
impart your wisdom ๐
@sullen dune Yes.
if,then is two script commands. case,: is also two. But with the switch you also have the switch script command.
It depends on what you are doing. Atleast for a switch (true) the if variant can be faster.
Check code performance guide
@tulip cloud diag_log stringifies the variable before it writes it to long.
The stringification of "string" is ""string""
So.. No it is not adding any double quotes. In fact there are not double quotes at all.
ok so in that case I can treat the array with strings as single quotes?
They actually have no quotes at all.
They are just strings
The quotes are just added so you can see that it's a string
Thanks once again.
hmm
say I wanted to use a cutText to make a black screen fade-in from mission start but I have an important script that shouldn't be stopped from executing (alas no sleep between it and the script exec), would running the cutText in a non scheduled environment use a sleep only in its scope or would it delay the script being executed after it?
im thinking the latter but I'm not too familiar with scheduling
yeah I wrote before reading the wiki, whoops
excuse the extreme simplicity but I'm on the commute
titleText "hello", black,5;
sleep 5;
cutText "", fade in,0
[script exec that ideally shouldn't be interrupted]```
pretend that's all correct syntax for now; that's in the initPlayerLocal file for the mission - I'm trying to think of a way so that the sleep 5 doesn't delay the script exec after
else the point of the fade in is useless given how it's trying to hide player vision for a few seconds while the script does it's thing
You mean.. You want to exec the script right after the title text.
But only want to execute the cutText 5 seconds after the titleText?
titleText "hello", black,5;
[] spawn {
sleep 5;
cutText "", fade in,0
};
[script exec that ideally shouldn't be interrupted]
like so?
exactly so
you can use removeFromRemainsCollector
Or that :P
i seem to misunderstand something regarding the arguments in eventhandler "killed".
i thought
_victim = _this select 0;
_killer = _this select 1;
but both returns the victim it seems...
in a foreach loop on a set of units i use:
_x addEventHandler ["killed",{
//diag_log "handeling death";
_victim = _this select 0;
_killer = _this select 1;
diag_log format ["%1 killed by %2",name _victim,name _killer];
}];
Did he kill himself?
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Killed
It says on the wiki why that happens.
no happens with several units that kill each other
i saw this on the wiki
mySoldier addEventHandler ["Killed",{hint format ["%1 was killed by %2",name (_this select 0),name (_this select 1)];}]
so thats pretty much the same
happens when they kill each other, or when i kill them...
@proven crystal I've never had this issue before
I believe your units arent actually dying by someone else
What does the chat say when you kill a player
X killed Y? Or something like x was killed
You can try using the instigator instead of the killer though in most cases
See what that returns
so that would be _this select 2; ?
i happens right now when i kill those units
hm should i be using MPkilled?
Maybe.. But normal Killed should really work
"Karim Khalili killed by Karim Khalili and Error: No vehicle is the instigator "
so karim is the victim and i shot him
t triggers but returns me ninsense
_x addEventHandler ["killed",{
//diag_log "handeling death";
_victim = _this select 0;
_killer = _this select 1;
_instigator = _this select 2;
diag_log format ["%1 killed by %2 and %3 is the instigator ",name _victim,name _killer,name _instigator];
}];
well these are dudes that get shot
and the trigger does fire
its just that _victim and _killer both return the victim
and in the above the _instigator is nothing apparently
where it should be me
i figure there is also no killer which is why it returns the victim instead of a killer
so why the heck does it not get a killer?
now i was wondering... as i use this on NPCs that are handled server side, maybe locality plays a role and i should use MPeventhandler and MPkilled
How do you test? Shoot AI in singleplayer Editor? Shoot AI in local hosted MP?
no on server
I thought Killed EH only triggers where unit is local
so only on server then
Might be wrong
Yes it is
that would be fine in principle. There is another bit of code that adds loot to dead corpses and that works
Ah you are grabbing that diag_log out of server console then?
but i figure i dont get a killer returned as player is not local to server?
yes the line is what comes out in the rpt
Shouldn't be a problem that the killer is not local...
can you try removing the name from the script?
Maybe both units have the same name for some reason ๐
@still forum Simply using visual commands doesn't seem to be enough, camera still jerks back and forth, using non-visual commands make its it even worse.
I have the same problem in TFAR. Just with audio instead of camera.. I even added custom interpolation based on velocity... No joy
I wonder how EG spectator does it
It follows fast moving vehicles perfectly smooth, no sound issues too
I guess.. you could just move the camera on a fixed velocity
and when vehicles velocity changes quickly interpolate to the new one
So instead of trying to hold onto it. Just move along with it.
I don't see EG spectator doing any of that though
Or store last position and velocity. And if you detect the new position is jerking backwards just ignore it and continue with the old one
// The pivot on the target vehicle
private _center = if (_isMan) then { AGLToASL (_focus modelToWorldVisual (_focus selectionPosition "Spine3")) } else { AGLToASL (_focus modelToWorldVisual [0,0,_height]) };
// Set dummy location and rotation
_dummy setPosASL _center;
[_dummy, [_dirTemp + _cameraYaw, _cameraPitch, 0.0]] call BIS_fnc_setObjectRotation;
// Apply location and rotation to camera
_camera setPosASL (AGLToASL (_dummy modelToWorldVisual [0, -_distance, 0]));
_camera setVectorDirAndUp [vectorDirVisual _dummy, vectorUpVisual _dummy];
Tried doing exactly the same, doesn't work as well
crap. same result with MP Eventhandler
I see lerp being used for zoom only
afaik the dummy is only for translations outside of follow mode
yep, dummy is detached in follow
Added some debug outputs, camera or dummy objects are not attached to anything, camera has no velocity, dummy has some but it is set only once on view mode change
"focus" is pretty much synonym to target in egspectator's case
the findfocus part of rscDisplayEGspectator.sqf in ui_f searches for an entity
also:
_focus = uiNamespace getVariable [VAR_FOCUS, objNull];
prepare target seems to be what's doing the camera setPos for follow mode
It does it just once at start
isn't the cameraTick func on an eachFrame EH?
Yes, but it does set_target only when vehicle changes, not each frame
if (!_targetInVeh && { vehicle _focus != _focus }) then
{
[_focus] call CAM_SET_TARGET;
missionNamespace setVariable [VAR_CAMERA_TARGET_IN_VEHICLE, true];
};
if (_targetInVeh && { vehicle _focus == _focus }) then
{
[_focus] call CAM_SET_TARGET;
missionNamespace setVariable [VAR_CAMERA_TARGET_IN_VEHICLE, false];
};
missionNamespace setVariable [VAR_CAMERA_TICK, addMissionEventHandler ["EachFrame", { [] call CAM_TICK; }]];
block before the one you posted calls this
case "SetFocus" :
{
private _newFocus = _params select 0;
private _oldFocus = ["GetFocus"] call DISPLAY;
if (_newFocus != _oldFocus && { !isNull _newFocus || { !isNull _oldFocus } }) then
{
private _allowFreeCamera = missionNamespace getVariable [VAR_ALLOW_FREE_CAMERA, true];
private _allow3PPCamera = missionNamespace getVariable [VAR_ALLOW_3PP_CAMERA, true];
// Make sure we can be without focus
if (!isNull _newFocus || {_allowFreeCamera}) then
{
uiNamespace setvariable [VAR_FOCUS, _newFocus];
uiNamespace setvariable [VAR_OLD_FOCUS, _oldFocus];
["OnFocusChanged", [_newFocus]] call DISPLAY;
};
};
};
``` every frame
which then calls "OnFocusChanged" which itself calls "setCameraMode"
what the hell update the camera movement then hm...
so yes, cam_prepare_target is called every frame
and interestingly enough we come back to
// Set dummy location and rotation
_dummy setPosASL _center;
[_dummy, [_dirTemp + _cameraYaw, _cameraPitch, 0.0]] call BIS_fnc_setObjectRotation;
// Apply location and rotation to camera
_camera setPosASL (AGLToASL (_dummy modelToWorldVisual [0, -_distance, 0]));
_camera setVectorDirAndUp [vectorDirVisual _dummy, vectorUpVisual _dummy];
Yeah, posted this above, tried doing the same with my script and camera still jerks
what did you use as "center"?
where the dummy is placed
and I found your issue
// The distance at which to place camera from the focus pivot
private _distance = (_bbd select 1) + _zoomTemp;
they interpolate the zoom and add that to the distance
_dummy modelToWorldVisual [0, -_distance, 0]
Don't think this has anything to do with camera jerkiness
I did exactly the same
but yes, the issue is most likely due to the temp zoom interpolation missing
it's only done for man quicksilver
Nope, I just set _distance to fixed 50 value, no jerkiness either
vehicles have the center of their boundingBox used
I even started using camcurator and all this set of camCommand commands, still can't reproduce what EG spectator does.
๐ค ๐ซ
probably missing
private _bbd = [_focus] call BIS_fnc_getObjectBBD;too
it's used for the modelToWorld calculations and distance
It simply returns bounding box sizes
well, yes ๐
As I said I made _distance to be fixed value of 50, it didn't change anything, camera is still smooth
so its not zoom interpolation that fixes jerkiness
they also have "dirTemp"
so they most likely do some kind of interpolation too for it
@lone glade so quick question here you god of config returning fool. When i go to add a condition to reference the 'side' entry external to cfgweapons in the config classes condition. Ie : 'getNumber(configFile >> 'CfgVehicles' >> configName _x >> 'side) i get noting.
I tried just testing the side bool outisde of the configClasses condition and it definitely returns side numbers properly for each uniform / gear set
Even tried just counting the returned configs and checking the side with an if statement. No dice.
The quotes may not be accurate here (mobile) i purposely did a single quote there
Forgot to close it lol
also, you fucked up
Should've been double in this case to start
_x is the tested config entry there, the FULL path to it
so it's _x >> the rest
no need for configname
Er. One sec here
you're doing "getNumber( _x >> 'side') == 'MyThing'" configClasses (configFile >> "CfgVehicles") right?
private _un = "(getnumber (_x >> 'ItemInfo' >> 'Type') == 801) && (getnumber (_x >> 'scope') == 2 && (getNumber(configFile >> 'CfgVehicles' >> configName _x >> 'side') isEqualTo _sn)" configClasses (configFile >> "cfgWeapons");
uhhh...that's not any better
_sn is the side number - > 1 being WEST in this instance.
missing round bracket on the second statement
So I commented out camPrepareTarget, camCommitPrepared, attachTo and detach from SetTarget and ResetTarget. Turns out these don't seem to do much, everything still works just fine and camera follow vehicle smoothly.
Acidentally deleted that bracket pasting this, figedty piece of shit.
So I've checked this to no end, and it doesn't seem to be working at all.
Are you moving the camera in EachFrame? Or Draw3D?
Draw3D as well
I actually tried trigger's each frame, EachFrame, Draw3D, all work identical
@subtle ore are you sure configName _x is the same in CfgVehicles?
it might also be that you can't pass args to it, I never actually checked
@lone glade Yep, 100% positive. Classnames are the same all around
try to use format just in case
Add logging to each value you use and receive and you'll get where it goes wrong.
Well I am Sa-Matra, I logged each side number that is coming in with that line of command all of them were zero for the side numbers. And nothing pushed to the array returned by ConfigClasses
there isn't really any middle ground where I can say HA! I found a missing 'x' here and it's magically working.
private _un = format ["(getnumber (_x >> 'ItemInfo' >> 'Type') == 801) && (getnumber (_x >> 'scope') == 2) && (getNumber(configFile >> 'CfgVehicles' >> configName _x >> 'side') isEqualTo '%1')", _sn] configClasses (configFile >> "cfgWeapons");
Like I said, I've already tried just checking outside of config classes
Commented out all camCommand everywhere to see if it affected smoothness, it doesn't
Oh, my bad. You weren't talking to me lol
@lone glade I see so the whole condition then? Sweet.
I did about logging @subtle ore
And a whopping zero entries returned, what he hell.
Ah, yeah I try and do that regardless
check all brackets, discord or I might've fucked up
add single quotes around it
there
remove it then, forgot you were checking a number ๐
I probably thought of the side command when typing ๐
slowly rests in the ground after a truely grueling defeat
I just changed preparetarget to:
_camera setPosATL (_focus modelToWorldVisual [0,0,20]);
_camera setVectorDirAndUp [[0,0,-1],[1,0,0]];
And guess what, camera is still smooth, has nothing to do with dummy, centers, attaches, camPrepareCommits
Yes, non-dedi though
Doesn't matter really
The issue is that I can't make my own camera that doesn't jerk
And now I can't make EG spectator be jerky, its always smooth
What black magic is this?
EG spectator does it with Draw3D as well
It has nothing to do with it, I simply set camera by fixed offset for test, it still moves smoothly
_camera setPosATL (_focus modelToWorldVisual [0,0,20]);
_camera setVectorDirAndUp [[0,0,-1],[1,0,0]];
_focus is vehicle itself
what fucks up on yours?
No idea, no matter what I do it still appears jerky
ohman that eventhandler thing is really fucking with me. i mean im not even trying anything fancy here
Arsenal camera is jerky as well when it object it follow is moving fast
arsenal camera was made to stay within 5 meters of the bounding box center, makes sense
EG camera is smooth regardless
And I can't figure out what makes it smooth
Changed it so it would create "camera" instead of "camcurator", still smooth
So finally managed to break it
Turns out camera position update is done in EachFrame, not Draw3d
Apparently I used some non-working method when trying EachFrame in my script and mainly did tests in Draw3d
Yes there is, Draw3d is done after world simulation (or other way around?)
You can also execute multiple times per frame with unscheduled @tough abyss Plus.. There is only one image per frame. So you can't really update not fast enough if you do per frame.
Draw3D is after simulation
EachFrame is before
while loop.. I guess for loop maybe too.
How do I look at the shortcuts etc. in sublime text 2
Like how does the F1 work with poseidon
so it looks up the biki
Camera is finally smooth, you must update it on EachFrame
I mainly did it with setTriggerStatements and Draw3d before, I guess both were executed after vehicle simulation was done (and position update), resulting in jerky camera. Only EachFrame executes before any entity simulations so camera position always matches actual entity position smoothly displaying it
Thanks, now just for the forums not to error out
@still forum probably depends on trigger and vehicle creation order, if trigger simulates before the vehicle, then you can have smooth camera updates.
Unless they're simulated in different groups so creation order doesn't matter
Anyway, not a proper way of doing camera updates whatever the case.
@peak plover top right there is that interesting menu-button which is very confusingly named "Help" ๐
Most likely seperate groups
yes
but it's scheduled.. so who cares ยฏ_(ใ)_/ยฏ
second
_function checks the local variable table. Which only has 3 entries I think.
the global variable table has hundreds
It get's a bit deminished because the while loop opens another scope so it has to check 2 local var tables instead of just one
same with _player = player or _true = true
and similear
or _whileTrue = while {true} though you probably won't use while true more than once ๐
just remember to always private these if you are not inside a completly new script.
as in. if your function get's called
most likely overkill.
There are probably easier and better optimizations possible
moving the serverside stuff to Intercept for example :3
which doesn't work for missions you redistribute
You can optimize your global namespace by grossly overfilling it and then emptying it again
stretching it out. It will stay stretched after you remove variables again.
but again.. overkill.
It is a hashtable with buckets. Finding in which bucket an element is is constant time.
But buckets may have more than one element so it has to iterate through each one till it finds the correct one
if you stretch it out there is less chance of multiple items in the same buckets
But.. If you think about that a single binary command call is 2 microseconds... And the actual finding in the hashtable is like.. half a microsecond maybe..
just removing one function call get's you 4x the improvement... so...
overkill.
Dedmen, what can you do with "intercept" globally
All the time, i see, you speaking about it
In one of TFAR's highest performance functions I optimize performance by not taking any arguments and instead accessing the _this that was passed to a function 2 scopes higher up ^^
Everything goes to hell if someone calls that function from some other place or it might even break if someone moves it in the file it's currently in.
@little oxide Dedmen.
And what do you mean by "globally" ?
Intercept can do everything a SQF script can
for all.
not some
if you have a single if statement or a single variable assignment or a single script command call in your script. Then Intercept will do the same faster
Some things benefit more than others though.
And some things benefit so little that it's not worth the time rewriting them
So if you create a "gamemode" with intercept, you can have a real optimization, can the player feel this optimization, for example at the fps level?
yes
moving the heaviest ACE modules like advanced ballistics and frag and... ugh.. Wind deflection... to Intercept you can get +10fps in some cases.
How to get typeOf (_class) of unit as default parameter params ["_unit", ["_class", typeOf _unit]];. Should I use _this? I have OCD for clean code ๐
No that won't work
because _unit doesn't exist yet
you can typeOf (_this select 0) though
yup, what is why I am asking, ( jost posted example hto
I prefer giving default of scriptNull and then just using isNull
@tough abyss https://github.com/acemod/ACE3/pull/5704
200 bullets.
SQF: 10-12ms fps drop from 50 to 35.
Intercept: 0.474ms fps drop from 50 to 45.
Couldn't even measure performance using SQF. Because it was too fast for the low precision of available using SQF commands.
@tough abyss I will improve my life when I uninstall Arma 3. Thug life of programmer.
@still forum that it is the best situation to use intercept, because you said that under certain conditions it was not beneficial, in which situations intercept can make a big difference ?
The more math and control flow you have the better. If statements, isNil checks, +/-/vectorAdd/vectorMultiply and stuff. Basically stuff that just takes 2 known variables and does stuff with it without getting any additional information from the engine.
The more you call SQF functions that are not replaceable by other means the worse.
For example vectorAdd is just math. Intercept can do that without calling SQF functions.
If you have a loadout script that basically just calls addWeapon a couple times. There is only very minor perf improvement.
basically everything that interacts with the engine itself. Intercept also has to call the SQF functions for that.
It is still about 2x as fast when just calling SQF functions. But that doesn't make enough difference that rewriting is worth it. atleast for me
so basically you are saying use addWeapon instead BIS_fnc_addWeapon ( just example )
No.
Sorry I was using the word "functions" instead of "commands" ^^
I was talking about Intercept. You are talking about SQF.
But what you said is true yes. In Engine everything is fast. In SQF everything is slow.
Example BIS_fnc_selectRandom.
You can either call the BIS function. Which means you call into it using very slow SQF. and then go into fast selectRandom inside it.
Or you can directly go into the fast selectRandom
Intercept is fast because it does everything "in engine" without any actual slow SQF inbetween
Going from SQF to engine is also "slow".
if,then,else these are 3 engine commands. So with one if then else statement you have to make 3 "slow" calls from SQF to the engine.
As Intercept is already "in engine" it doesn't have to go that far and is much faster.
Additionally Intercept can evaluate the if,then,else by itself without calling the actual engine commands.
So it's faster at calling engine commands. And often doesn't even need to call them at all.
So by not calling a single engine command at all you already have 100% performance improvement.
_var = if (true || false) then {true} else {false} in SQF 4300 nanoseconds (4.3microseconds)
Intercept for the same code 1 nanosecond theoretically. Theoretically because practically the compiler will completly optimize all of that out. So theoretically 4300x speedup. But in practice infinite x speedup.
https://www.reddit.com/r/arma/comments/6zvcpj/intercept_version_090_released/dmygvyu/ Here is an example of a function that doesn't benefit much.
It basically only calls engine functions (getPos) and only has a 2x speedup
does this "Intercept" works only for making addons as said in the github repo or does it work also for altis life or mods like that?
HAHAHAHA
if you think people making altis life servers are even remotely capable of using intercept.... well I don't know what to say
๐
Intercept, can relly optimize an EachFrame EVH for example @still forum ?
any script
It is unscheduled. So using Intercept to replace scheduled functions might not be that wise
My only question is malicious use. Clients could load an addon like such?
@lone glade thanks for answering
๐
If you don't enable bisigns then yes. Clients could load whatever they want
but they can also do that without intercept
but it's not intercept's fault
Intercept has active protection so that addon makers can prevent people overwriting their dll
which default Arma extensions don't even have.
Excellent. Glad to see that was something that has already been done
But as Intercept is open source people could theoretically recompile Intercept itself and disable these checks.. But then again addon makers can include checks in their own addons to verify that the Intercept core is valid
So Intercept checks if the mod is valid. and the mod checks if Intercept is valid.
so a malicius player would need to recompile both dll's. Which he can't if the mod dll's source isn't public.
plus that'd be a lot more work compared to memory injection
Sounds like the next best thing since bread and butter.
because it is ๐
:+1:
All the new security stuff in Intercept should've been implemented by BI for normal extensions years ago..
Surely. But it's better to have it than never
needing battleye whitelist is a hurdle for people if battleye is enabled.
But.. a hurdle that just needs time. You have to get your dll whitelisted. But if you do you can overwrite stuff like the ace dll's and make them execute malicious scripts at your will. if the dll is used in a way that it can do that
Yep, is there manual appeal for .dll review?
Battleye you mean?
Yep
You send them your dll. And as far as I've heard they usually just whitelist it without checking it further
Huh, that's bad.
They even whitelist dll's after some time if enough people try to load it. Without anyone needing to request whitelisting.
wasn't there some manual whitelisting done at the start?
when battleye was introduced.
I guess so
Battlefield 2....?
wat
to arma 3, not when BE was created
and afaik .dll whitelisting became a thing much later
I think that was only added when BE went kernel-driver
yep, just checked, 1.46
BattleEye was a anti cheat for bf2 originally iirc
No.. Punkbuster.
That was when I stopped hacking. Or shortly after that. Their system was incredibly dumb back then and very easy to circumvent.
Third party dedmen
What does third party mean to you both?
punkbuster is what dice used
Some communities started using be
if i remember correctly
ย Starting out as an external 3rd-party anti-cheat for Battlefield Vietnam, first versions were quickly released and it rapidly gained first acknowledgement. In early 2005, it was integrated in the first professional leagues. Due to request by the community, BattlEye was then ported to Battlefield 1942 and again used by some leagues.
pew pew pew
runs around with imaginary guns shooting into the sky
So... All it does is prevent you from compiling scripts that use disabled commands?
Meaning you can just compile from editor into uiNamespace successfully. And then just call the earlier compiled function?
With Intercept you can really block the commands by redirecting them to your code.
And you can enforce Intercept usage clientside by just moving parts of your scripts into it.
If only Intercept was reliable, easy to download and battleye whitelisted.
Almost done with the first part. Second is easy to do.. Third I have no idea.
Intercept, not. Reliable?
as in bug free*
- may still include bugs
It doesn't work with latest prof v7 on x64. because one adress changed
already wrote code so it can detect that in the future and fix itself. Didn't test that yet
Meh, it's been so long since i watched it
I actually have a product here that was made by iRobot
Heh.
Is it possible to change exterior camera position during the game with scripts? I know you can do that via config, but its set when game loads. I wonder if it would be possible to have shoulder switching for over the shoulder camera (from deadfasts mod)
Yeah, but you loose all the crosshairs, ballistic computer etc. if you switch to some other camera. At least I think so
Create the controls / displays required then
It may be that you need to sort of "rebind" controls with a ui event handler
oi, would that mean I could get 3d person CCIP for planes?
Sure could
๐ฎ
There were ccip scripts before ccip was in the game. So all, very very possible.
I want to use vanilla CCIP, vanilla stuff works the best
only I want to see it in 3rd person/external view
Yep. Possible.
๐ How then? Where should I start looking?
Ui_f pbo? Functions? Not too sure on that one
Show off
nvme ssd + everything ubined -> super easy to find stuff
Question time! How would you go about detecting the mouse going to the borders of the screen? I want to recreate the clasical RTS camera movement (left border moves the camera to the left, right to the right etc.). I thought about making 4 transparent controls at the borders, but maybe there's a better way?
@icy raft you'd use an onMouseMoving EH, screen pos relative to the parent control is returned in it
or even onMouseExit with a control that covers all the screen bare the screen edges
Could I use Display 46 with that?
also @thorn saffron I checked and those "MFDs" are actually images being layered on top of the current cam, it's all config based
@icy raft you'd have to create a new control for it but yes
Yeah, that's the aproach I mentioned, but I was lazy as hell with making controls
LOL
I just realized the best way
"onMouseMoving" EH
that was what i was looking for
@lone glade Including the lead indicator we had some time before the sensor update?
@thorn saffron that's engine side afaik.
fuck
that is one of the things I was after
I wanted in 3rd person
@hasty violet Would you happen to know how to swapn some buildings and AI to garrison them. I was trying to make a randomized MOUT training scenario using DAC
ACE3 has mine in it now
Nah I would just settle on DAC spawning random buildings. I'm no scripter
does anyone know how to make a player enter an object that has a cargo proxy in it
i mean the typical proxy used in vehicles that you can use the moveincargo function
itโs an object that is not driveable
you mean by scripts or what?
yes
iโm trying to understand how to use proxy cargo from script
i guess with moveincargo
but maybe something is missing from the config.cpp
disable model on some vehicle and use attachto and move player into cargo of that hidden model vehicle?
Do you guys know how do i group objects (not units) and give it a varible to be deleted later?
you can't group objects
something similar?
put the list of objects in an array and go through it later
i mean, we are talking about ALOT of objetcs
yeah, and the array limit is around 10 000 000
๐ nevermind.
Trying to spawn a vehicle via .sqf, can spawn the vehicle fine, on designated road section, but when I try to orient the vehicle using roadsConnectedTo and getDir, I get undefined variable error message?
if (_mapVehicleProbability > random 100) then {
_spawnCenter = (_this select 0);
_vehTrigName = missionNamespace getVariable str _spawnCenter;
_mapSelectVehicle = _mapVehicleList call bis_fnc_selectRandom;
_mapVehicle = _mapSelectVehicle createVehicle (getPos _vehTrigName);
_roads = (_vehTrigName nearRoads 30) select 0;
_roadConnectedTo = roadsConnectedTo _roads;
_connectedRoad = _roadConnectedTo select 0;
/*_mapRoadDir = [_roads,_connectedRoad] call BIS_fnc_DirTo; // TRYING BOTH WAYS TO GET DIR, BOTH WAYS PRODUCE SAME ERROR */
_mapRoadDir = _roads getDir _connectedRoad;
_mapVehicle setdir _mapRoadDir;
_mapVehicle setPos [(getPos _mapVehicle select 0)-4.5,getPos _mapVehicle select 1, getPos _mapVehicle select 2];
};
Any ideas?
maybe the road is not connected to?
Seems to be happening in places where there are multiple road sections.
Maybe the road is not connected to anything?
There being multiple "connected" roads doesn't mean they are connected.
you should add some diag_log's to debug that
How could I check something like that?
add diag_log's to debug that.
Showing my deep ignorance in scripting; How do I use diag_log's?
if you have written that script you already know enough to use it
Just print out your variables and see if they are all like what you expect
K, I'll check it out. Thxs
Can you give me an example of how to diag_log the variable? I added "diag_log _mapRoadDir;" , found my .rpt file, and the results returned is: Error position: <_connectedRoad; How can I get more information about the error?