#arma3_scripting
1 messages · Page 431 of 1
would run it through my sqf-vm but i lack some commands to execute it currently
and i have zero idea what exactly youre talking about that something is not working in parallel blablub
the code is working on each group in series (one after the other) instead of parellel (all at the same time)
uhm ... redesign it so that the marker part is not in the foreach loop?
doing a call to function now instead
instead use pushBack to push the groupleaders to some array
and iterate over that after the foreach
or avoid foreach completly in first place by using ARRAY select CODE from the very begining
Eh...
For one your _handle variable is bullshit.
Second.. use spawn. That's anyway where you got your _handle variable name from
I am playing as a CIV is there a way to get all EAST to shoot CIVs Just like they are WEST ?
@misty trail https://community.bistudio.com/wiki/Side_relations
hey, is there a way to have items created from a script inserted into a container created from another script. (e.g. you build a base spawning a container, you can but sand bags which go into said container by the flag which was also spawned upon making the base)
Yes.
put the container into a global variable. And then use that in the script that adds the items
okay, so : "Box" addItem "edn_sandbag"; ? where box is the global variable
Box without the quotes. Otherwise it's a string. Not a variable
okay
And addItemCargo/addItemCargoGlobal
Well..
put the container into a global variable
ah got it now, i also had to use square brackets (Box addItemCargo ["edn_sandbag",1];)
also, will i be able to spawn a group of units at a random position from a certain distance away on the ground with a waypoint set to a position which they will move to?
Uhhh...no you didn't have to add brackets. Where is this being executed at? Yes you can spawn a group of units at a random position from a certain distance away on the ground with a waypoint set to a position they will move to
- it just didn't work without the square brackets, but when i put them in it did work
- s there a function that i can use (or group of functions) to do it?
Where are you executing this? Because it does matter
Init fields have to return nothing
'''if (nails >= 0)
then {
hint "Sandbag Purchased!(It can be found in the crate.)";
nails = nails - 0;
"edn_sandbag" createVehicle getpos player;
Box addItemCargo ["edn_sandbag",1];
}else{
hint "You need more nails!";
};
//Box setVariable ["HQBox","HQBox",true];'''
W H E R E
aha
so you never told the game what the variable Box is
oh wait instead you just cretaed a sandbag at the player position?
Or, created at player pos then added it to the box??
So there is a sandbag created regardless on the ground?
im also doubting both the item and vehicle classname are identical
is anyone able to help me out, I'm getting an error that I just can't figure out.
{
[_x, _faction] call FUNC(loadout);
[_x] call FUNC(earplugs);
} forEach allUnits;
I get missing ; on line 2
missing include for the macros?
🤦 thank you
random [0,5,10] >= 5
Is this give me a 50% of chance of being true or false?
OK, so I 've been trying to think how to do this for long time now and I came up with nothing. I need to translate global position of vehicle to simple screen(defined in class MFD but that is not important). Is there a way, to somehow convert X and Y of each vehicle, in relation to my position AND direction? I also need to have output of two values x and y so I can use it in class mfd to draw geometries. Basicly, I need to get a top down view of surrounding vehicle, in relation to my position and direction, so for example if a vehicle is directly in front of me, the output X would be 0 and Y the distance from me? Picture for reference: https://imgur.com/4CC5rWB
@astral tendon Yes... But only if second number is exactly the average of the min and max, and what you are comparing against is also that number, which happens to be in your case. So for example: random [0, 5, 10] >= 7 would not be true 30% of the time, but if you do random 10 >= 7 it would be 30% of the time, although I prefer writing it like 30 < random 100.
Thanks
im using the Alternative Syntax, is there other way i can put the special like the CAN_COLLIDE?
no, you should use the first syntax
you an set skill using other commands, and init is just more code anyways
thats my problem, i need that init.
what for?
you are using an SQF command, so you are using SQF, just create the unit using normal syntax, which returns the created unit object, then do what you want on that
You could literally just execute your code immediately after spawning it
Anyone know if a animate ["HideX", 1]; exists to hide the rear covering of the Hunter?
you can check it yourself with https://community.bistudio.com/wiki/animationNames
@finite jackal
is it possible to spawn the large ghost hotel complex? I see the smaller pieces. want that huge one on altis
yes but you have to LEGO it together
Box setVariable ["HQBox","HQBox",true];
👏
Am I able to change a dialog after using cutRsc to create it? Trying to lbAdd to a listBox and it's not having any effect
@cedar kindle , I'll gladly lego it together if you have a place to get classnames or more info
@river meteor Give that dialog some init script and store the DISPLAY in a uiNamespace variable. The init script will be executed immediately after the cutRsc command in your original script before it resumes, which means that you can fetch the DISPLAY in the next line from the uiNamespace.
Ghost Hotel (Gazebo, Ruin) Land_GH_Gazebo_ruins_F
Ghost Hotel (Gazebo) Land_GH_Gazebo_F
Ghost Hotel (House, Ruin) Land_GH_House_ruins_F
Ghost Hotel (House) Land_GH_House_1_F
Ghost Hotel (Bungalow) Land_GH_House_2_F
Ghost Hotel (Platform) Land_GH_Platform_F
Ghost Hotel (Pool) Land_GH_Pool_F
Ghost Hotel (Stairs) Land_GH_Stairs_F
@hallow spear
@little eagle Right now I'm just storing the dialog in a global variable, I imagine it's a similar effect? Overall what I'm trying to do is to remake the arma 3 action menu. Is cutRsc the wrong command to use to display a dialog that needs to be interacted with while open?
The effect is the same, but the game complains about if you store a display inside a mission namespace variable. Therefore you should probably use a ui namespace variable.
Is cutRsc the wrong command to use to display a dialog that needs to be interacted with while open?
You don't have a cursor if you use cutRsc, because your display will be created as a subdisplay of the mission display.
But you need a dialog for a cursor, so createDialog.
I don't intend to have a cursor. I'm trying to emulate the arma 3 action menu and basically just make it look nicer. I was going to use event handlers and selection commands to do the selection and "clicking" of an action item
Don't know what you mean by "interacted with" then.
You can easily add e.g. scroll wheel eventhandlers to the mission display and modify your display that way. If that is what you mean.
Yes that is what I mean. I just don't know why my lbAdd isn't showing up even though when I hint lbSize it's reporting an extra element as if it was correct
I seriously doubt it's something to do with my display being bad like text size too small or something similar to that
I've never seen listboxes used in displays that are not dialogs. It might not work.
You're supposed to click on them with the mouse cursor.
Do you have a control in mind that would fit for what I'm trying to do?
Multiline rsc text.
Or multiple rsc text.
Maybe structured text multiline.
I think they all are multiline, so just RscStructuredText.
That way you can easily highlight the selected item. And do interesting stuff like different colored text and fonts.
I'll try a different control, thanks for the advice.
So you want to create a "game mode" that could be portable to different maps but you don't want code to repeat (naturally). What do you do? Put all the common code in a mod? Trouble is, the code is not meaningful outside context of the mission(s) and not very useful as mod for anything else.
Can this be structured some other way?
Put all your files into a folder. Then to include your scripts into a different mission you only have to edit the description.ext, mainly CfgFunctions.
There was talk about playing positional sound global once, so playSound3D is good right?
Can anybody tell what each of the elements stands for in
getUnitLoadout player select 8 // ["Rangefinder","","","",[],[],""]
Thanks.
//Weapon Binocular (follows same layout as other weapons above) Not very conclusive..
Binocular classname, muzzle,side,top,loaded magazine, loaded secondary magazine, bipod
yes. Attachments and magazines for a binocular.
thanks
distance where the sound is audible :D
It's the fade distance.
and CurveDistanceScaler is distance and minimum 1.
See https://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.x3daudio.x3daudio_emitter(v=vs.85).aspx
I guess that doesn't help you much. And I have nooo Idea.
Oh wait
pVolumeCurve
default curve that conforms to the inverse square law, such that when distance is between 0.0f and CurveDistanceScaler × 1.0f, no attenuation is applied. When distance is greater than CurveDistanceScaler × 1.0f, the amplification factor is (CurveDistanceScaler × 1.0f)/distance. At a distance of CurveDistanceScaler × 2.0f, the sound will be at half volume or -6 dB, at a distance of CurveDistanceScaler × 4.0f, the sound will be at one quarter volume or -12 dB, and so on.
There.
CurveDistanceScaler == distance
So from center out to distance you will have 100% volume.
At 2*distance you have 50%. At 4*distance you'll have 25%
afaik with playSound3D sound volume start to fade out at about ~ 50 meters from source, even if set to no max distance
not sure about exact "range"
Already played sound more than 50 m with playSound3D
you will hear it, i said volume will drop at that distance
Hmm thanks
Server spawned objects are out of place for the first 300 seconds or so until the server is synced with the clients, then everything snaps into place for the clients. Is there any way to force a synchronization immediately? (May be the same reason serverTime isn't synced for the first 300 seconds)
300 seconds? vehicles and stuff in the mission file are also server spawned but they are synced right at missionstart.
What does "out of place" mean?
Let me grab a screenshot.
flying objects i guess 😀
Out of Position https://imgur.com/gallery/5P7tf
The positions can be slightly off (within 2m) and the rotation is almost always off.
Then immediately, it snaps into place around 250-300 seconds
Can get better screens in a few
maybe related to this https://feedback.bistudio.com/T76687
i would guess that those are still pending
Also, there's a spawned aircraft carrier that is missing parts of it's hull for the same time period. Anyone that teleports there falls into the water
Can it be forced out of pending @queen cargo?
it was a wild guess of mine
only way i could think of would be modifying the server network config
so that it updates faster
@still forum all these objects are placed server side via script, not via sqm
Yeah, the server I’m from has that issue too
Sometimes it works, sometimes it doesn’t
Maybe I should do a setpos or something
They always snap into place after the clients and server syncs (post 300 seconds) so that's not the issue.
Yes. I know. Same thing happens here
Very annoying when trying to line up multiple walls
https://community.bistudio.com/wiki/serverTime
NOTE: serverTime is available to both server and clients and shows the same value when synced. The only time it is not synced is on the server, right after server restart and only for the first 300 seconds. Client side serverTime is synced from the start.```
Try doing a setpos to the objects current position immediately after placement
That's what is happening. @strange urchin
Hm.
Were does that 300 seconds number come from? Exactly 300 seconds everytime?
No. Usually around 200 - 300 seconds.
I wonder if doing something with simulation would help
They all have disabled simulation
That might do it
private _bluBase = createVehicle ["Land_MetalShelter_02_F", [_respawnPos select 0, _respawnPos select 1, 0], [], 0, "none"];
_bluBase setDir (_respawnPos select 2);
_bluBase setVectorUp [0, 0, 0];
_bluBase enableSimulation false; _bluBase allowDamage false;
This is the order of things.
scheduled or unscheduled?
Probably not relevant I guess.
Maybe you should leave simulation enabled. That way it might update it's position more often
Only disable it later on if you want to save performance.
Or make it simpleObject right away?
What happens if you enable simulation. Do they sync faster if you do that?
also maybe this can help BIS_fnc_replaceWithSimpleObject
Why does banking the aircraft affect getreldir? Is there a way to get a relative direction without affection from banking?
Will test with that as well, thanks sldt1ck
@meager heart It also has this on the page which isn't good: Use with caution as this technique is not very clean - should not be used for many objects and definitely not in MP games. I am breaking all those rules
replaceWithSimpleObject is a bad choice anyway
as you could just directly spawn the simple object.
Correct
@neon snow
getRelDir probably checks the relative direction as it is using only the object's model as a reference, rather than the world
I would try calculating relative direction by taking the first object's direction, then taking the direction from the first object to the second and subtracting the two numbers.
It's nice to know that that's how they do it, though. I'd imagine that it would be useful to have it the way it is for some people.
use the alternative syntax of getDir and be done with it.
Yeah, you’d need that for the second part
ok will use it, Just question, why that doesnt work?
_dir = player getDir q1; hint str _dir Tried it in local exec ingame
No error, nothing
nvm, I am stupid.
Were you still in the pause menu lol
No, the tank name wasnt q1 but q1w xd
This command hides the bumper for the offroad Offroad animate ["HideBumper1", 1] What would i then use to show it again? (Cant find anything on the wiki) tried Offroad animate ["ShowBumper1", 1]
@fleet wind Second arg number is which state it should be in. So
offroad animate["ShowBumper1",1];
//hidden ?
offroad animate["ShowBumper1",0];
//show?
Nope dosent seem to work
Not sure what you're doing because that indeed does change state
Anyone know how well animateSource works when doing it multiple times on the same thing? Does the previous command get overridden properly?
can you describe what you're trying to do?
do you mean activating multiple animations on the same object at the same time? that should work fine
you can also make one animationSource start a sequence of animations one after the other
0 -> 1
1 -> 0
The state doesn't just magically reset after setting the phase
you can return the phase with (animationPhase) given the name and object you're animating
if usings scripts you can use waitUntil to activate a new animation after the other too
Sure.
waitUntil { _v animationSourcePhase "animation1" == 1 };
Yeah that works. Still not 100% sure what the original question was
me neighter xD
I want to know if I can constantly animate a source to track an object without making it instantly snap to the target.
to track an object without making it istantly snap to the target? What do you mean?
Just as it sounds
What does that have to do with animating a object?
Animating a turret
Hmmm, well you're going to want to define in what angle of the turret in relation to the phase of the animation
I am aware
you dont want the animation to be instant you mean? just set animPeriod = x seconds
I know
IE: 90 = 0.5 , etc
But this is a moving target
And I’d have to constantly adjust the animation
For it to track
I'm sorry I dont follow
Will spamming animationSource cause any problems?
yesover the network
you will flood the network
causing desync
but you can go around it animating a local object
can you try to explain exactly what it is you're trying to do?
The turret will be a global object that is local to the machine running the script, which is the server
Basically, I am dissatisfied with the lookAt command or whatever. Trying to make a C-RAM work better
Okay...and you want it to fire at a object?
Yes
fireAt ?
What result do you not agree with?
And readjusts
Alright.. so you want it to be looking directly at the object without fail
Which is a problem when trying to target a high speed projectile
you want an aimbot for CRAMs ?
Not aimbot. I just want it to be less floaty
increase their precision skill
increasing their skill is the easiest and fastest way to fix your issue.
I don’t think that effects their overaiming
it does.
Yes it does
Really? How much does it affect them?
I’m not worried about accuracy
But I’ll see if it makes them stop passing by the target and doing a sort of double take
Yes you are. That's exactly your "floaty" ness you are talking about
Never knew an AI’s ability to control weapon inertia of a vehicle turret was tied to their skill
is there a difference in deploying new content on vbs or arma3? i have a vehicle that works in vbs but if i try to launch it in amra 3 i get the error data file too short
Anyone know where I can find information on a CT_CONTROLS_TABLE? Wiki doesn't have a page for it
hello, i'm set event handler on vehicle in client script, but when this player offline - eventHandler not working. But when try bring EH to server side - is not working.
When a player is offline.. How should the eventhandler work
if there is no one to execute the code how should it be executed
hi guys. Im trying to play a scriptet sound inside a vehicle only. I dont want to hear it outside, even when turned out. Can someone help me?
but can I hear it in 3rd person then?
or from other vehicles around me?
I can try playSound. if it keeps me from hearing others that'll work
one more thing
Are there any real difference between these two approaches on playing a sound over the network?
[_v, "sound"] remoteExec ["say3D", 0, true];
playSound3D ["WHwalkers\sentinel\sounds\sound.ogg", _v];
if so, which one is better?
I use playSound3D
does playSound3D have local effects too?
I don't think so
playSound3d cant be used on sound classes can it? must it use the pathtoFile?
Afaik it must be full path. Not sure if absolute path but yes you cannot use sound classes
Any way to tell if a player's group lead is recognized in group manager /has star symbol in group manager?
I can tell if player is group lead but can't discern if its recognized by group manager.
how do i make an objective a success when the vehicle is entered
playSound3D is global
cant be used on sound classes...
check this http://killzonekid.com/arma-scripting-tutorials-mission-root/
@nocturne basalt
ok thanks
Just a quick query,
_Text = switch (toLower "handgun") do {
case ("primary weapon"): {([primaryWeapon player] call Life_fnc_fetchcfgDetails) select 1;};
case ("secondary weapon"): {([secondaryWeapon player] call Life_fnc_fetchcfgDetails) select 1;};
case ("handgun"): {([handgunWeapon player] call Life_fnc_fetchcfgDetails) select 1;};
case ("backpack"): {[backpack player] call Life_fnc_fetchcfgDetails) select 1;};
case ("vest"): {([vest player] call Life_fnc_fetchcfgDetails) select 1;};
case ("uniform"): {([uniform player] call Life_fnc_fetchcfgDetails) select 1;};
case default {"test"};
};
``` anyone know whats up with this ?
it was saying missing ;
@subtle ore mite
i thought it might have beed the ones 2 in from the end , but it wasnt ,
hmm
I mean, ignore the error it's giving you
case default has always worked for me.
switch (toLower "handgun")
i think i found it
{[backpack player] call Life_fnc_fetchcfgDetails) select 1;}
whats missing xD
I think im blind.
nope xD
Quick Question - if i wanted to retreive the name of the unit a player is looking at ( not through a wall ) how would i do so?
@dusk sage the toLower is to just help with switch case, I have found it case sensitve.
toLower "handgun" is "handgun"
yeah.
You're just doing
switch ("handgun")
but whats being passed in the script is "Handgun"
Are you expecting it to mutate into a different string?
im just using this for testing.
so i can run it over and over , till i find the issue.
_Text = switch (toLower "Uniform") do {
case ("primary weapon"): {([primaryWeapon player] call Life_fnc_fetchcfgDetails) select 1};
case ("secondary weapon"): {([secondaryWeapon player] call Life_fnc_fetchcfgDetails) select 1};
case ("handgun"): {([handgunWeapon player] call Life_fnc_fetchcfgDetails) select 1);
case ("backpack"): {([backpack player] call Life_fnc_fetchcfgDetails) select 1};
case ("vest"): {([vest player] call Life_fnc_fetchcfgDetails) select 1};
case ("uniform"): {([uniform player] call Life_fnc_fetchcfgDetails) select 1};
default : {"test"};
};
``` is still not working
Remove the colon after default
case ("handgun"): {([handgunWeapon player] call Life_fnc_fetchcfgDetails) select 1);
^^^
}
👋 😃
Is there any way to use those little sensors boxes? I have a sonar system, and I’d like to do something a little better than just having it sit there in the corner of the screen.
you need check model cfg... afaik they are different for some models
uavCameraDriverPos = "PiP0_pos";
uavCameraDriverDir = "PiP0_dir";
uavCameraGunnerPos = "laserstart";
uavCameraGunnerDir = "commanderview";
@ornate pawn
That stuff is just the PiP for viewing other crewmember perspectives
Is there a way to add a Active radar event handler?
@cloud thunder Check for the variable "BIS_dg_reg" on a group. It's true when when the group is registered, nil when it's not.
As long as the group is registered the current leader will have the star.
Sweet, nice one @delicate totem . TY
That stuff is just the PiP for viewing other crewmember perspectives
༼ つ ͡° ͜ʖ ͡° ༽つ 🏆
Yes, I was pointing out how what you were telling me so far was useless to me.
Unless you have some better advice than that?
//fn_addtoListbox.sqf
params ["_control","_text","_data","_picture","_tooltip"];
_control lbadd _text;
_index = ((lbSize _control) - 1);
_control lbSetData [_index,_data];
_control lbSetPicture [_index,_picture];
_control lbSetTooltip [_index,_tooltip];
``` because saving lines xD
What?
addToListBox sounds very generic if you ask me
Its what it does xD
https://gyazo.com/a9b1af592b69d4c6208350f2562d0bf4 when I have 4 listboxes on the same dialog, which some get updated in the same script, it helps shortening scripts xD
I'm trying to create a control table and when I use ctAddRow, the first element of the array is -1 which is an error as it's supposed to be the row index. Anyone have experience with control tables and know why ctAddRow might fail?
hmm, so I think my issue is related to the following. If I try to create the dialog with createDialog, it can't find the resource. If I use cutRsc then I see dialog on the screen, but I get an error in rpt about error loading control
ok I think I'm being stupid here, I'm trying to get one thing to spawn if a another thing doesn't
in the condition of presence ive put alive basewall
and !alive basewall
it doesn't spawn with ether
could be an initialisation order issue
I was thinking that could be it. just not sure how to fix that
condition true, on activation: if (!alive basewall) then {deleteVehicle otherThing;};
use a script then
something like init.sqf
tbh, i know its probly simple. but going from the triggers to and sqf confuses be.
its not quite the same
I mean could i simply put this into a sqf:
if (!alive basewall) then {deleteVehicle otherThing;};
if (!alive basewall2) then {deleteVehicle otherThing2;};
does anyone know how to set up a random mission event?
what kind of event?
an air drop for example
well it has to depend on somthing
where every 5mins an air drop comes down at a random marker
well i that's definatly possible
I'm rather nooby so id have to work on that myself for a while to figure it out
@sinful sky yes to your question
well you can have a trigger active evey 5 min no prob
ok thanks suiside
just have a trigger repetable and active evey5 mins [anybody-not present] or somthing
then the bit i don't know about
you need to create a list of all the places and pick one. then have it spawn parachute infantry
droppoint= [drop1, drop2 drop3] call BIS_fnc_selectRandom;
ty
hmmm
i think this would work for moving then AI to that point
droppoint1 = droppoint modelToWorld [0,0,200];
paraunit setpos droppoint1;
I belive that SHOULD put the AI 200m above the randomly picked spawn point
ty
i shall try it out now
have i done this right? ad= "Airdrop" adlocal= "edn_Box_Materials" createVehicle position getmarkerPos ad modelToWorld [0,0,200]; droppoint1 = (getmarkerpos ad) modelToWorld [0,0,200];
ignore the droppoint bit for now
do i need brackets or something in the second line?
after this
droppoint1 = droppoint modelToWorld [0,0,200];
the "droppoint" is already 200m up
so you want
createVehicle position getmarkerPos droppoint
or whatever you call it
i think tbh. all the bits make sence to me but i struggle to put it all together. I'm sure sombody else will point out whats wrong.
droppoint1 = (getmarkerpos ad) modelToWorld [0,0,200];
adlocal= "edn_Box_Materials" createVehicle position getmarkerPos droppoint1
why the ad = airdrop?
what do you need help with @sinful sky ,I won't scroll up
its not me trying to help Kadava with my limited knowledge
what does he need help with? a paradrop on a map click?
a paradrop every 5 mins on a randomly selected spot.
sooo, what's the hard thing in this?
I'm noob lol
so,
ive got this
droppoint= [drop1, drop2 drop3] call BIS_fnc_selectRandom;
gimme 2 minutes
then
droppoint1 = (getmarkerpos droppoint) modelToWorld [0,0,200];
adlocal= "edn_Box_Materials" createVehicle position getmarkerPos droppoint1
wait, does he use CBA or not?
duno
otherwise i'll have to use a fucking while loop.
cant you just have a repetable trigger with a 5 min delay
yes, and also it's stupid
there:
[] spawn {
while {true} do {
private _vehicle = createVehicle ["edn_Box_Materials", [random [0, worldSize / 2, worldSize], random [0, worldSize / 2, worldSize], 200], [], 0, "NONE"];
sleep 300;
};
};
so that just picks a random spot anywhere on the map?
yes
just be aware that the longer the mission will run the less precise the "timer" will be due to how the scheduler works
is it able to create a popup saying when an airdrop is imbound our have a mission marker on it?
absolutely not
yes it's possible, no I won't do it for him
just put it in a var if you want to
well, i wouldn't have don't it like that because i don't know enough
not sure where to put the Var name for the object
well id love to help but without knowing how to name the random location or the object i don't now how to get the location of the drop
... wow
O so smart are we...
see the array after the first string?
that's the "random location that's totes impossible to put in a var"
put it in a local var and use said var instead the the array there
aka private _mySuperVar = contentOfTheVar;
@meager heart does memory points don't work anymore. it looks like they change them.
who...wut...
fuck, I almost went into writing SQF 101 for a second
lol
well i just read a bit on local variables
yea was just there
doesn't help if you don't understand half the page
people that knows how to script are like that @sinful sky
I know, its easy to forget what its like to learn.
@still forum :
Variables are only visible in certain scopes of the game. This prevents name conflicts between different variables in different scripts.
There are three scopes:
....
someone needs to get the 🗞
don't worry about scopes yet
tbh this isn't the time for sqf 101 ive been up for about 20 hours
but i appreciate the help.
stonedraider, also you can check this for variables how to http://killzonekid.com/tag/variables/
cheers il keep it bookmarked for later.. after sleep
at least scopes are properly explained there
is it possible to change a turrets weapon using a function in a script?
what will happen to the weapon that was already there?
ok thanks. Im making my own dynamic loadout for turrets
can use this
removeWeaponTurret
to delete the previous one
@lone glade for that script you made do i still need to link it to a trigger with repeat at 300 seconds or does it automatically repeat
it automatically repeats, that's what the sleep is there for, HOWEVER, due to how the scheduler works the timer will become less precise over time
okay, thats fine
and thanks btw
also when i create the mission intel popup for when i is dropping how to i make the mission icons position stay following the airdrop
like when using the intel tab in the eden editor to set the position of the module to the drop
but is there a way to script that
actually
ignore me, ill just do a normal marker
Welp
would be nice to have native suppport to add Arrays, as data to listboxes, just spent an hour trying to find the issue I was having.
get good ^
fucking skids ^
oh wait, I think I know what he's on about
I had to turn an array into a string, to set as data on a listbox, then when pulling it back out, with call compile it was trying to turn my strings into variables xD
its done now xD
o.o
it works fine .
just have to make sure the strings are strings,
and then those strings are string.
There is a distinct difference between functional, and fine
private _formattedArr = format ["[%1,%2]",str _itemClassname,str (_arr select 1)];
xD
save the array in the control namespace / dialog namespace using the classname or whatever you have as text as varname
then when you want your array you retrieve the classname / text and use getVar
If your using the control as namespace, couldnt you use the index as the varName ? then it would be easier to overwrite ?
suit yourself
but in my case that wasn't a valid solution because I modify the indexes
deleting an element of the list / adding one would break it
Yeah, I see what you mean, but with mine , you may have multiple lines with the same classname
I'm working on a towing system for an MP mission. but when somebody else does the towing the vehicle gets tow but it change its direction.
[
player,
"Attach Landing Platform",
"scripts\BEW\Logistics\images\attach_ca.paa",
"scripts\BEW\Logistics\images\attach_ca.paa",
"_target distance LP_1 < 3",
"_target distance TVeh_1 < 5",
{},
{},
{
_target playaction "Putdown";
LP_1 attachTo [TVeh_1, [0, -6, -1.3] ];
sleep 0.1;
[LP_1, "BEW_attach_to"] call CBA_fnc_globalSay3d;
sleep 0.5;
lP_1 setDir 90;
},
{},
[],
10,
1000,
false,
false
] call BIS_fnc_holdActionAdd;
if i do the towing the landing platform gets align with the vehicle but if somebody else the landing platform is looking in another direction
lol
.... no shit.
any clue on how to fix this?
use getDir to retrieve the first vehicle direction and setDir the second one with it
its just one vehicle
@lone glade why?
i mean its a landing platform where i attach the little bird to it
certain scopes of the game is bullshit yeah. And name conflicts too. But... Otherwise?
three scopes?
There is a unlimited number of scopes
wtf is dis shit
hahahaha
@ornate pawn you're rotating the platform to a specific direction, and then you wonder why it rotates?
sitDir 90 does it for me in MP
but when i ask my friend to do it doesn't
the object is looking somewhere else
@lone glade link to that page? Variables page?
@ornate pawn https://community.bistudio.com/wiki/sitDir I think I have an idea why it doesn't work
that page is empty
TIL setDir is AL
lP_1 setDir 90; works for me but NOT for my friends
always thought it was AG EG for some reason, use remoteExec
yes, that's normal
instead of
lP_1 setDir 90;
use
[lP_1 , 90] remoteExec ["setDir", lP_1 ];
Exactly. That page is empty.
That command doesn't exist.
And if you meant setDir
https://community.bistudio.com/wiki/setDir
look at the top left. under the setDir title
that command doesn't exist? how come it works?haha
That blue AL thing
sitDir doesn't, setDir does
how come it works?haha
to do it doesn't
all your words.
You wrote that tho
Also yeah. It says AL.
Meaning the arguments have to be local to you
okay
An object that is local to you is not local to your friend
easiest way is to use remoteExec like @lone glade posted above.
okay i will change my script
[
player,
"Attach Landing Platform",
"scripts\BEW\Logistics\images\attach_ca.paa",
"scripts\BEW\Logistics\images\attach_ca.paa",
"_target distance LP_1 < 3",
"_target distance TVeh_1 < 5",
{},
{},
{
_target playaction "Putdown";
LP_1 attachTo [TVeh_1, [0, -6, -1.3] ];
sleep 0.1;
[LP_1, "BEW_attach_to"] call CBA_fnc_globalSay3d;
sleep 0.5;
[lP_1 , 90] remoteExec ["setDir", lP_1 ];
},
{},
[],
10,
1000,
false,
false
] call BIS_fnc_holdActionAdd;
yeah thank you i forgot
which gives you
mycode
[
player,
"Attach Landing Platform",
"scripts\BEW\Logistics\images\attach_ca.paa",
"scripts\BEW\Logistics\images\attach_ca.paa",
"_target distance LP_1 < 3",
"_target distance TVeh_1 < 5",
{},
{},
{
_target playaction "Putdown";
LP_1 attachTo [TVeh_1, [0, -6, -1.3] ];
sleep 0.1;
[LP_1, "BEW_attach_to"] call CBA_fnc_globalSay3d;
sleep 0.5;
[lP_1 , 90] remoteExec ["setDir", lP_1 ];
},
{},
[],
10,
1000,
false,
false
] call BIS_fnc_holdActionAdd;
y u no show sqf highlighting @lone glade
lol
ma bad
hahaha
one more thing. when my friend detach the helicopter from the landing platform the helicopter starts to bounce to finally blow up
that's normal
when i do the detaching the helicopter falls on the landing platform without bouncing
it's probably clipping the platform
we can't tell you why if we don't see the code
the detaching code ?
here's the entire code
//- This script attach the Helicopter to the landing platform
[
player,
"Attach AH-6 Little Bird",
"scripts\BEW\Logistics\images\attach_ca.paa",
"scripts\BEW\Logistics\images\attach_ca.paa",
"_target distance LP_1 < 3",
"_target distance LB_1 < 5",
{},
{},
{
_target playaction "Putdown";
LB_1 attachTo [LP_1, [2, 0, +2.3] ];
sleep 0.1;
[LP_1, "BEW_attach_to"] call CBA_fnc_globalSay3d;
LB_1 setDir 270;
},
{},
[],
10,
1000,
false,
false
] call BIS_fnc_holdActionAdd;
//- This script detach the Helicopter from the Landing platform
[
player,
"Detach AH-6 Little Bird",
"scripts\BEW\Logistics\images\detach_ca.paa",
"scripts\BEW\Logistics\images\detach_ca.paa",
"_target distance LP_1 < 3",
"_target distance LB_1 < 5",
{},
{},
{
_target playaction "Putdown";
sleep 0.3;
detach LB_1;
[LP_1, "BEW_attach_to"] call CBA_fnc_globalSay3d;
},
{},
[],
10,
1000,
false,
false
] call BIS_fnc_holdActionAdd;
i still need to update the remoteExc you gave me
why is my falling damage negation EH not working?
player addEventHandler ["HandleDamage",
{
private ["_unit", "_damage", "_source"];
_unit = _this select 0;
_damage = _this select 2;
_source = _this select 4;
if ( (_source == "") && !(isTouchingGround _unit) ) then {0} else {_damage};
}];
For one. Your private in there is completly useless
And... Wouldn't you be touching ground when you get fall damage?
Anyone know how to make map items/objects selectable by cursor?
how can i then make sure only falling damage is negated?
well source empty already seems logical
I would try to use that
@muted sand Can't.
oh damn ok
was hoping to make a script for scavanging items from certain trees, bushes ect...
You can hide the building. And manuall spawn exactly the same building at the same position.
That one you could move then
You mean you want a action on that object? like a scroll wheel action?
yes sorry worded that completely wrong hha
You can add actions to most buildings/map objects via config
but if they don't have a config class.. Like trees/bushes. You can't.
thanks d it works now
hmm alrighty so no trees or bushes have config classes?
You can make an action that's always visible. If the player uses that check if he is looking at a bush/tree. If so use that. Otherwise tell him there is nothing to scavenge from
I don't know of any... In theory it's possible to make them be config classes and make maps with these
but never seen anyone do that
you can addaction with sqf too https://community.bistudio.com/wiki/addAction
Yea ok
@lusty canyon To terrain objects?
hmmm ok good info, i dont suppose theres any examples out there you guys know of?
Well I'm sure some life server already made that
how about attaching an invis object that has the addaction to the simple object you want?
Oh true
Yeah. You could attach invisible objects to every bush/tree
performance will get wrecked tho?
jayTAC maybe but I am pretty much noob so yea 😃
performance will probably get wrecked
cant make the addaction conditional too complex since its checked every frame unscheduled
lol yea dont want that then, what if the item we added an action to was placed by editor so not a simple object would that work?
yeah
any editor placed object works
But as I said you can make a action that's always available. Or with CBA even a hotkey.
When used it will check if there is something to scavenge
Aha nice could make a few areas around map then that people could gather things
then you can also check if user is looking at terrain objects like trees/bushes without having to place anything on the map
Ok nice
And that would also allow players to gather anywhere
hmm alrighty guess will just have to try some stuff and see what happens, much appreciate your time!
@muted sand Could use an addAction coupled with something like str(cursorObject) find "neriumo2d" > -1 as a condition.
Ok is that based on editor placed objects?
ok cool just so i know
Actions added to the player are evaluated every frame regardless of you using the scrollwheel.
so its always on wheel and then have it so only if it finds a specific object it will allow the player to scavenge?
No, every frame regardles of the scrollwheel.
ok
I didnt think it would be as complicated as regards to gethering items from objects 😄
Pretty sure the workaround most life servers use is something to push the actions back into a list and then add on mousewheeldown / remove on keydown, click, etc, etc
yea probably, will work it out im just new to this sorta stuff
yea well will give it a bash, if i get it working will let you know! Cheers
@lone glade does this script spawn in the box aswell, because i use it and it creates the marker but not the crate
while {true} do {
_vehicle = createVehicle ["edn_Box_Materials", [random [0, worldSize / 2, worldSize], random [0, worldSize / 2, worldSize], 200], [], 0, "NONE"];
_markerad = createMarker ["Air Drop", position _vehicle];
_markerad setMarkerType "hd_dot";
sleep 5;
};
};```
it's possible the box just falls and get destroyed by fall damage and thus sink into the ground instead of glide like vehicles
ah
The marker name is not unique. Only one marker will be created.
and that too
also I hope for you that classname in the createvehicle array is valid
Dynamically create the name. Just put some number at the end.
in the quotes?
What?
so
_markerad = createMarker ["Air Drop1", position _vehicle];
No, that is still not unqiue.
You obviously have to change the number each time.
Like increment it by one.
how would i do that for a script?
Increment a number?
ye
_number = _number + 1;
but how would i include the number in the name
toFixed work with number like 3e+015 ?
Define "work".
is there a cmd that can change the respawn timer?
Yes.
setPlayerRespawnTime
toFixed works with numbers yes @little oxide
Just wanted to know if i have a number like 3e+015, this will put in string a 3 with fifteen 0 behind it
If you tell toFixed to give you 15 zeroes... yes
otherwise no
Wait...
Not after comma
then yes. it should
And what is the fastest way to know the number of decimals in number ?
Doubt it will be fifteen zeroes, as floats are not that accurate above 1e7.
It will probably peter out with something close to 1e15.
know number of decimals in number?
You mean digits?
I know there is a formula for that
number of digits after comma
Ah yes
https://en.wikipedia.org/wiki/Logarithm
floor (log10 (abs (x))) + 1
That was the formula I meant
decimal places then... Eh.. That question is... wrong
If you print the number with 10 decimal places then it will have 10 decimal places
If you print it with 1 then it will have 1
Theoretically any number has infinite decimal places. With most of them being 0 though
1e15 has zero digits after the decimal point. I don't understand the question.
floor
if i have 3 it will return me 0
3.125 is the same as 3.125000000000000
True.
There is no real way.. Besides rounding to 1 decimal digit and checking if it's equal the original number. If not, try two and so on
till it matches
that way you get the shorted possible, exact representation
convert to string and count chars after a .
Not even 3.1523534563463634634634 will be 3.1523534563463634634634 if entered as float.
When arma converts to string normally it cuts of after a set number of decimal places
if you use toFixed it will always be equal to the number you give to toFixed
how do i make the marker dynamic?
_markerad = createMarker ["Air Drop", position _vehicle];
i don't get it? do i do
_markerad = createMarker ["Air Drop %1", position _vehicle];```
No.
_number = _number + 1;
_markerad = createMarker ["Air Drop %_number", position _vehicle];```
?
What command makes a unit speak and where can I find the game's vanilla dialog?
Also no
DEL-J, say/say3D?
https://community.bistudio.com/wiki/format @broken forge
i know, i don't understand it
@broken forge %1 in the string is being replaced by the first argument
I think the instructions on the wiki are pretty clear.
well im pretty new and retarded xd
😛
@little eagle, this has me on the right track! Thanks. Can I find vanilla voice lines from some kind of config viewer, like the animation viewer?
You can find configs in the config viewer
I don't know why the animation viewer would have voices
Not what I was asking, but okay.
If you're slow in the head then you have to carefully read. Don't think we can cure that over discord.
Yes you can find them in the config.
Thanks!
can someone give me an example of creating a marker with this format thing
format ["I have a string and I can insert variables using %1, and %2 and so on...", _myExpressionReplaces1, _thisVariable replaces2];
@broken forge format ["Markername %1", _number] will create stuff like Markername 1 or Markername 2
According to the wiki, the sound files for say2D/say3D are defined in CfgSounds.
ty
Which can be accessed over the config viewer.
There is no sound viewer afaik equivalent to the animations viewer.
Awesome! Thanks, @little eagle, @still forum.
Maybe someone should build a sound viewer 🤔
Yes, but don't call it "viewer".
Anyone know why I may be getting an error loading resource error when trying to create a control tree?
Nope, not me.
config hearer :3
sound ... board?
Not a control tree actually, a control table. Which has very little documentation and I only found one github project that actually uses it
Ah, never used those. Since they are not document, maybe they don't work?
Possibly. I found this page, but it isn't linked from the control page. Found it googling. https://community.bistudio.com/wiki/DialogControls-ControlsTable
Also that screenshot showing what the result can be is exactly what I'm trying to accomplish
I think silentspike tried to use those for something (spectator?) and then didn't in the end for some reason.
Can I get selected target position?
ok, but how do I make it return the target position?
What target?
Oh ok... Is there a list of the parameters like that? such as _target etc?
I am just begining to script so you know
No?
Ok then, so now I dont know how it will work. I
Uhm, target of what? That would be a place to start.
Like I asked 2 minutes ago ^^
The target selected by a player in a vehicle
how do you "select" a target?
I meant locked, my bad
You mean like a missle lock?
Yes indeed
Good question.
It now took 6 minutes to find out what you actually want :D
I don't know.. But I can google
Sorry for my stupidity xd
No idea. But doesn't that overwrite the cursorTarget?
I will check it now
cursorTarget also returns locked target for the duration of the lock even if there is another target under the cursor
yes
I was about to post exactly this quote.
ergo, the answer to your original question is getPosWorld cursorTarget
That part I know, I was just looking for cursorTarget. Thank you all 😃
Added: A new "#" script operator (works in the same way same as "selects", is shorter to write and has higher priority than math functions)
Nice joke
you have to be shitting me
[127] # 0 // 127?
holy fuck it's real....
Well sure, why not.
because params, param and select weren't enough huehuehue
and it for sure looks very readable
I gave BI a script command to add weapons with attachments into boxes and stuff.... They just have to copy-paste it into the engine
and instead they chose to give us #
Something that we already have.. And that doesn't give us any real benefit
yes it's shorter.. But we already use params anyway if we would have many select's
Why not give us both? Surely can't take longer than a few hours to implement each.
No speed improvement too
i'll try with an array of 10 000 just in case
it's slower than select
Are you sure?
aaaactually no, it's within test variance
Eh, it looks nicer.
so at best it's the same as select
Does it look more readable too?
imho no
The # char stands out a lot.
private _array = [];
_array resize 10000;
_array select 1000;
vs
private _array = [];
_array resize 10000;
_array # 1000;
How very odd. Doesn't make a lot of sense at all. If they wanted to improve the syntax then _array[1000] would be easier and quicker to learn but I suspect that isn't happening. This is just an alias and a weird one at that
Also.. isn't # the character BI uses to show place of script errors?
example using something that uses a shitload of selects:
[(_cargo # 0 # 0),(_configItems # 0 # 0), _cargo # 0, 0],
[(_cargo select 0 select 0),(_configItems select 0 select 0), _cargo select 0, 0],
[] is like.. Impossible to implement though.
I can't remember ded, but # is used somewhere else, can't remember for what
yeap. Position where the script goes southis marked with #
It's not impossible, but it would require deeper changes. # is like done in one evening.
..........._abc ## 1000......
ooooh
That isn't going to be wonderful
Macros and suh are all # based
like concatenating words and replace
I honestly wouldn't be surprised if # was an alias of select
for macros is always the first char in a line. # is a binary command. Unless you put your statement into multiple lines for some reason, there is no conflict between the two.
Does #something preprocessor stuff also work outside of macros?
Like the # that turns things into strings
no ideas
I don't think so, everytime I have used it/seen it used is always for the macro purpose.
And...
wait a second.....
What if you
#define STUFF(x) _array # x
Just as select @lone glade
Well.. Scripting beginners will adopt to that very quickly. I'm sure they won't be confused at all
one more command to never use 😛
And odd one to add this late as well
especially without speed improvements
Well.. Scripting beginners will adopt to that very quickly. I'm sure they won't be confused at all
if it was faster than select maybe there would be a use case
this requires documentation of it
just ban it off everywhere
the "use case" is that is get's prioritized
maybe some BI dev needed it for some strange calculation to make it shorter to read
yeah, but in that case you use brackets
Woah
and welp, there it is, a useless script command
I don't even know if we can create wiki pages with name #
don't think so
mediawiki has problems with that
Well. I won't make that wiki page...
someone will maybe do one day
and then there has to be included: don't use it, it's strange
so yeah, we can safely ignore that command and forget about it until someone decides to use it because why the fuck not.
as a new guy, I prefer "select" actually, as I can directly read what it does.. if I saw # in a code somewhere, I'd have to look up what it means
Exactly.
I tried replacing all my select with # in a file, it's imho less readable
course it is
look at C++
that's the result if you use symbols
for like fuggin everything
C++ is mathemagics taken too far
If there was actually a benefit.
But it's exactly as fast. Harder to read. Confusing AF if you use macros with #.. And that's about it.
Higher precedence.. well.. Precedence isn't documented anywhere so 99% of people won't know about that anyway
Why not make it ->
_array->5->3 is more readable
true, but > is already used huehuehue
wow
And that combined with macros.
_array->RADIO_FREQUENCY_INDEX
yes.. > is.. But -> isn't
that strange c++ syntax isn't better
and @?
@ is used in SQS
or just curly braces?
-> makes more sense
like in every language?
that's crazy talk right there
braces isn't possible without changing the language itself
remember, it's sqf
You could have a [ command.. But you can't because array
we just wait for a4 and enfusion
How about using a unicode arrow character? 😄
and everything will be better
They just want to make our lives hard until enscript
So we all know how much better enscript is
LIES DEDMEN
let's go back to sqs
the splash screen is made in sqs because of how good it is
Some people are still using sqs
I'm still surprised you cannot delete single items in cargo since the beginnings of sqf
For several years now
You can.
nope
You can't.
how would you do it @lone glade ?
holy shit, you can't O.o
waited for this reaction 😛
intercept has the main problem that is is a mod
but you can't choose which exact item as item ID's... eh... Technically don't... Eh.. Theoretically.. eh... ... Item ID's don't exist.
Noo
I can't make it in Intercept 😄
well.. I could.. But no
just hack this stuff into the main assembly and hack into BIs servers and put it there
ah, you mean you make a script command you send to BI that would never get added?
because reasons?
later == 2^9999999 ?
After Arma 2 EOL.
How can i detach a helicopter from a landing platform without the helicopter bouncing so it doesn't blows up?
then I need this script command badly
I don't even know what "detach" means
a helicopter is usually not bolted to it's landing platform
i have an attach script that attaches the helicopter to the landing platform
move the "attach" point higher
attach it. Move it up by half a meter. And... It will bounce back down but...
Maybe explode less
but when i detach the helicopter nothing happens the helicopter lands on the landing platform perfectly but when a friend does it the helicopter starts bouncing and then blows up
just a tiny explosion instead of a huge one
move the "attach" point higher. I did
helicopter eneableDamage false
do i need to add a remoteExc to the detaching script too?
check the wiki, if effect is local then yes
detach has global effects
here's the whole script.
But it may have to be executed on the same machine that used attachTo. At least that is what I'd guess.
//- This script attach the Helicopter to the landing platform
[
player,
"Attach AH-6 Little Bird",
"scripts\BEW\Logistics\images\attach_ca.paa",
"scripts\BEW\Logistics\images\attach_ca.paa",
"_target distance LP_1 < 3",
"_target distance LB_1 < 5",
{},
{},
{
_target playaction "Putdown";
LB_1 attachTo [LP_1, [2, 0, +2.3] ];
sleep 0.1;
[LP_1, "BEW_attach_to"] call CBA_fnc_globalSay3d;
[LB_1 , 270] remoteExec ["setDir", LB_1 ];
},
{},
[],
10,
1000,
false,
false
] call BIS_fnc_holdActionAdd;
//- This script detach the Helicopter from the Landing platform
[
player,
"Detach AH-6 Little Bird",
"scripts\BEW\Logistics\images\detach_ca.paa",
"scripts\BEW\Logistics\images\detach_ca.paa",
"_target distance LP_1 < 3",
"_target distance LB_1 < 5",
{},
{},
{
_target playaction "Putdown";
sleep 0.3;
detach LB_1;
[LP_1, "BEW_attach_to"] call CBA_fnc_globalSay3d;
},
{},
[],
10,
1000,
false,
false
] call BIS_fnc_holdActionAdd;
nah, detach is AG EG
when i detach the helicopter from the landing platform the helicopter lands perfect on the landing platform
Not according to the wiki: https://community.bistudio.com/wiki/detach
when my friends detaches the helicopter the helicopter starts bouncing
even if he does the whole process of attaching and detaching
everything else works perfect
where on this page does it say AL EG commy? HONHONHONHON
I think this solution to this is to set the position of the helicopter slightly above the groud. Like 10 cm. Then it drops and doesn't collide with the ground as violently as when released inside it.
It says AG EG.
okay, try this:
[LB_1] remoteExec ["detach", LB_1]
I think this solution to this is to set the position of the helicopter slightly above the groud. Like 10 cm. Then it drops and doesn't collide with the ground as violently as when released inside it.
Can only repeat myself.
I want to finish this so i can release it on workshop I already have some stuff in my workshop if you guys wanna check it out.
okay @lone glade
i did set the helicopter like 12" above the landing platform
I'm still working on Black Sheep - Chapter II
Nato Black Sheep is a mod with custom uniforms
i also have a C.Q.B training facility
i finish the cameras this morning thanks to a friend
that's an screenshot
the C.Q.B from the outside
also doing some underwater environment 😛
Sorry for the spam
sneaky advertisement: check
That was also the name of the CC Generals mission they had to censor, because the task was to gas 300 civilians.
It's a variable name, and arbitrary.
_unit doesn't mean anything besides that it's a local variable with the name _unit
so nothings assinged to it then by default?
By default all variables are undefined.
depends on your meaning of default
If your script is called from a nother script that has a _unit variable.. Then it's usually assigned to something.
ah cool thx
There are no variables that are assigned to something by default
There are a few that are, depending on where, when and what.
how would one set a waypoint for a group of units spawned by script
ty
does anyone know what's wrong with this?
_wp =_groupalpha addWaypoint [getmarkerposHQ,0];```
yes
addWeapon doesn't return a number
and it's missing the left parameter
And the getmarkerposHQ variable is undefined
NOTE: THIS SYNTAX RETURNS NO UNIT REFERENCE!
For starters.
No argument on the left hand side of addWeapon.
Too many args in the array of createUnit, though you probably want the other syntax anyway.
corporal is supposed to be a string. Currently it's an undefined variable.
getmarkerposHQ looks suspiciously wrong too.
Harder to find something right with it :/
Guys, almost sure that someone posted a module here that improves bots capability of using cover
but cant find it at all
anyone?
Guys If my helicopter is already attach to an object then how to prevent the attach helicopter action from displaying?
Uhm, guys, may anyone help a bit? I just trying to make the scirpt which will override PP settings of ace3's NVG...
Should probably ask that in ACE Slack
#channel_invites_list