#arma3_scripting

1 messages · Page 417 of 1

meager heart
#

you said >Im creating the task in eden using the createtask module

#

so what that function for ? just trigger ?

exotic tinsel
#

and more, as i said before im spawning in compostion(missions) i need to clean them up when they are completed. i cant modify the triggers in the compositions but i can call my function at somepoint from; say the task creation. then i need to spawn in my trigger to detect when the task is completed so i can remove the composition.

meager heart
#

ok then just check for task completion in trigger statements

exotic tinsel
#

trying to do that, but its not working

meager heart
#

task id is what you set in module

exotic tinsel
#

yup and i left the var field blank

#

here is my trigger, no errors but also showing hint

#

_Trg_detectMissionComplete = createTrigger ["EmptyDetector", getMarkerPos _spawnmarker];
_Trg_detectMissionComplete setTriggerStatements [
"
['+ _task +'] call BIS_fnc_taskCompleted;
",
"
'hello' remoteExec ['hint'];
",
""];
_Trg_detectMissionComplete setTriggerTimeout [20, 20, 20, True];

meager heart
#
_Trg_detectMissionComplete = createTrigger ["EmptyDetector", getMarkerPos _spawnmarker];
_Trg_detectMissionComplete setTriggerStatements [
"
['+ _task +'] call BIS_fnc_taskCompleted;
",
"
'hello' remoteExec ['hint'];
", 
""];
_Trg_detectMissionComplete setTriggerTimeout [20, 20, 20, True];
#

formated

exotic tinsel
#

how do you do that?

meager heart
#

lol

exotic tinsel
#

sry im a noob to discord mate

meager heart
#

```sqf
CODE
```

#

like that

exotic tinsel
#
_Trg_detectMissionComplete = createTrigger ["EmptyDetector", getMarkerPos _spawnmarker];        
_Trg_detectMissionComplete setTriggerStatements [
"
['+ _task +'] call BIS_fnc_taskCompleted;
",
"
'hello' remoteExec ['hint'];
", 
""];
_Trg_detectMissionComplete setTriggerTimeout [20, 20, 20, True];
#

doesnt look as pretty as yours

meager heart
#

so you have task id test_1 ? and in this code you are checking +_task+

exotic tinsel
#

got it

#

yes

meager heart
#

try to check test_1 ? 😀

uneven prawn
#

Does anyone have and tips on how to figure out what threads those are : 3:46:27 "[""<spawn>"","""",true,4085]" 3:46:27 "[""<spawn>"","""",true,4804]" 3:46:27 "[""<spawn>"","""",true,132]" 3:46:27 "[""<spawn>"","""",true,196]" 3:46:27 "[""<spawn>"","""",true,261]" 3:46:27 "[""<spawn>"","""",true,326]" 3:46:27 "[""<spawn>"","""",true,354]" 3:46:27 "[""<spawn>"","""",true,505]"

exotic tinsel
meager heart
#
taskCompleted "task_id";
["task_id"] call BIS_fnc_taskCompleted;
exotic tinsel
#

i cant put that in the setTriggerStatements it will throw an error because its supposed to be in cased in ""

meager heart
#

"taskCompleted 'task_id'";

exotic tinsel
#

tryed that says its expecting a task not a string

fossil yew
#

use the 2nd one

#

["task_id"] call BIS_fnc_taskCompleted;

meager heart
#

maybe he not set task id in that module

exotic tinsel
#

here is error from @meager heart

meager heart
#

what ?

exotic tinsel
#

crap wont let me paste screen shot

#

well error says "error taskcompleted: type string, expected Task"

#
_Trg_detectMissionComplete setTriggerStatements ["taskCompleted 'test_1'","hint 'hello';", ""];
#

@fossil yew and this throws error as well

#
_Trg_detectMissionComplete setTriggerStatements [["test_1"] call BIS_fnc_taskCompleted;,"hint 'hello';", ""];
meager heart
exotic tinsel
#

yes when i tested your suggestion, im now testing both your guys suggestions with the task id set to test_1

meager heart
exotic tinsel
#

yes

#

just finished testing

#

i cant put double qoutes in the setTriggerStatements because they are reserved for incasing the setTriggerStatements parameters in the setTriggerStatements parameters array.

#

when i use single quotes it complains about it being a string.

#

my head hurts

meager heart
#

what about just test_1 ?

#

no idea how that module works tbh

exotic tinsel
#

testing all four scenarios

#

With the task module task id = test_1 and with task id = “” but variable = test_1

_Trg_detectMissionComplete setTriggerStatements ["taskCompleted 'test_1'","hint 'hello';", ""];
_Trg_detectMissionComplete setTriggerStatements ["taskCompleted test_1","hint 'hello';", ""];

With the task module task id = test_1 and with task id = “” but variable = test_1

_Trg_detectMissionComplete setTriggerStatements ["[test_1] call BIS_fnc_taskCompleted;","hint 'hello';", ""];
_Trg_detectMissionComplete setTriggerStatements ["[‘test_1’] call BIS_fnc_taskCompleted;","hint 'hello';", ""];
#

errors or nothing for them all

meager heart
#

also where is your setTriggerActivation ?

exotic tinsel
#

fml, what should that be set to since im not using it?

#
 _Trg_alldead setTriggerActivation ["NONE", "NOT PRESENT", false];```??
meager heart
#

looks right to me

#

also how you check conditions for task ?

exotic tinsel
#

i have a trigger sycned to >> settaskstate >> to create task

#

i give up, just tested all 8 scenarios, with or without single quotes, your suggestion and toms, with task id set, with variable set. all i get is task expected or nothing.

meager heart
#

if that is not life mission and there is less than 20 gigs of required addons send me it i will look... and will be less ping pong in chat 😀

exotic tinsel
#

im gonna do one last set of tests. but this time no spawning crap in, just set it up in the eden editor and see if any of these methods work manually.

meager heart
#

ok gl

exotic tinsel
#

ok get this shit!!!

#

(["test_1"] call BIS_fnc_taskCompleted) works in the trigger condition with double quotes, and the icing on the cake is with task id set

#

fml

#

here is the proper syntax for using double quotes "([""test_1""] call BIS_fnc_taskCompleted);"

meager heart
#

nice

sullen willow
#

removeaction 0; would be the first action added to a person/object, correct?

thorn saffron
#

Interesting, synchronizedObjects does not allow you to sync containers to a container, in such case it returns an empty array. It works fine if the containers are synced to player or a game logic.

exotic tinsel
#
_Trg_detectMissionComplete setTriggerStatements ["([""" + _task + """] call BIS_fnc_taskCompleted);","hint ""hello"";", ""];
#

for you guys who were helping me, thats how us a var inside double quotes.

#

if only we knew 3 hours ago lol

meager heart
exotic tinsel
#

doesnt show us how to use a var in there. no one said use """ + _var + """

#

all good my script workds i can take break

inner swallow
#

Well... Usually you can do " "" "" " or " ' ' " or ' " " '

#

Spaces for clarity only

thorn saffron
#
disableSerialization;

_seeds = synchronizedObjects shopLogic;
_taroShopInventoryWeapons = [[],[]];
{
(_taroShopInventoryWeapons select 0) append ((getWeaponCargo _x) select 0);
(_taroShopInventoryWeapons select 1) append ((getWeaponCargo _x) select 1);
} forEach _seeds;

createDialog "taro_GunShop_Dialog";

waitUntil {!isNull (findDisplay 9429);};

_weaponList = (findDisplay 9429) displayCtrl 94293;
lbCLear _weaponList;
{
    _displayName = (getText(configFile >> "cfgWeapons" >> (_taroShopInventoryWeapons select 0) select _forEachIndex >> "displayName"));
    _weaponCount = (_taroShopInventoryWeapons select 1) select _forEachIndex;
    _picture = (getText(configFile >> "cfgWeapons" >> (_taroShopInventoryWeapons select 0) select _forEachIndex >> "picture"));
    _index = _weaponList lbAdd (ctrlSetStructuredText parseText format ["<t align='left'>%1</t> <t align='right'>%2</t>", _displayName, _weaponCount]);
    _weaponList lbSetPicture[(lbSize _weaponList)-1,_picture];
} forEach (_taroShopInventoryWeapons select 0);
lbSort _weaponList;```

I'm trying to get my listbox to display a weapon picture and the name on the left and the item count on the right. I can get all the parts working, but I can't do that when I want to combine them. lbAdd expects string while ctrlSetStructuredText  outputs structured text. How can I properly display the item count alongside the name and the picture?
halcyon crypt
#

does a listBox item even support structured text?

#

I think you have to use RscListNBox instead and then use multiple columns

#

like so

#
----------------------------------------
| icon | display name 1 | weapon count |
|------|----------------|--------------|
| icon | display name 2 | weapon count |
|------|----------------|--------------|
| icon | display name 3 | weapon count |
----------------------------------------
thorn saffron
#

Ah I see now, I need to use the listNbox box instead

exotic tinsel
#

how do i check if array has values in an "if" condition? isnull and isnil isnt working

thorn saffron
#
_yourArray isEqualTo [];```
Will return true if _yourArray is empty
#
!(_yourArray isEqualTo [])```
Will return true if not empty, ie. there is something inside
exotic tinsel
#
if (v_activemissions isEqualTo []) then
```, threw error about zero divisor
thorn saffron
#

maybe use count?

exotic tinsel
#

my bad that did work, thanks mate

thorn saffron
#

No problem

thorn saffron
verbal otter
#

hello, i making my life server. Is possible to make custom lobby dialog? I find dialog and make new with gui editor, but can't find script wich create this dialog. Can you help me please?

halcyon crypt
#

@thorn saffron you should be able to just inherit RscListNBox

#
class RscListNBox;
class YourThing : RscListNBox {
};
thorn saffron
#

@halcyon crypt Its mission dialog, I can't really inherit from the game files

halcyon crypt
#

ah right

#

I think there's also a GUI sample pack thingy you can include

thorn saffron
#

Managed to inherit it, but I get an error when I try to display that new ListNbox

#

I need some simple mission with it so I can see how its done properly

#
14:11:37 Warning Message: No entry 'C:\Users\Misaki\Documents\Arma 3 - Other Profiles\Taro\missions\shop_scripting.VR\description.ext/taro_GunShop_Dialog.taro_rscListBox_1'.```
halcyon crypt
#

that's where my ability to help ends lol 😛

still forum
#

@verbal otter That has nothing to do with #arma3_scripting. You can do that in a Mod yes. Not in a mission

#

No you cannot send me a friend request and have me help with your life shit. Do it yourself.

#

And noo.. Sending me messages and repeating what you already said here won't make me help you too. I can read. Thanks.

long gazelle
#

Hey guys, is there a way to make trigger reactivatable without the "repeatable" function in trigger itself? For example, player walks through trigger, it is activated and cannot be activated again, unless you press a button and the trigger can be activated again..

young current
#

repeatable+ condition that the trigger when triggered sets false and your button then sets true

queen cargo
#

wondering right now ... what exactly does SEED random X do?
if i throw in the same seed over and over again, do i get the same random number out of it?

still forum
#

yes

queen cargo
#

so it basically just is cpp srand(...); return rand()...;

#

instead of just the return rand()...;

shadow sapphire
#

Okay, so this script is in the init of an object that we'll call the primary object, it creates the secondary object, but I don't know if it's attaching the secondary object and I do know that it isn't rotating the secondary object appropriately. Anyone know why?

DFP attachto [this];
DFP setVectorDirAndUp [[-15,-10,-5],[-15,-10,-5]];```
still forum
#

Basically kinda but not really

pliant stream
#

sqf has seedable prng now?

#

back in my day we implemented our own linear congruential generator... 👴🏻

astral tendon
#
SpawnUnit_No_PATH_ambush = {"O_G_SOLDIER_F" createUnit [position _this, Opfour, "
this synchronizeObjectsAdd [Spawn_Area_abush];
[this] join grpNull;
group this addWaypoint [position car_1, 0];
this setUnitPos 'UP';
this getSpeed FAST;
this setSkill ['aimingAccuracy', 0.1];
this setSkill ['aimingShake', 0.1];
this setSkill ['aimingSpeed', 0.1];
this setSkill ['spotTime', 0.1];
this setUnitLoadout getUnitLoadout selectRandom units loadout;
lockIdentity this;
this setFace Face selectRandom units loadout;
this disableAI 'PATH';
"];
};
#
{_x spawn SpawnUnit_No_PATH_ambush
} forEach synchronizedObjects Spawn_Area_abush;
#

The synchronized Object is a gamelogic placed in the editor, seens that height does not count, i was trying to create a unit on the top of a building.

#

Any way t fix that?

sour saffron
#

is it same linear height or diffeernt building ?

astral tendon
#

Im sorry?

#

The building does not seens to be the problem, the unit only gets created on ground level and ignore the object height.

#

i tried other buildings in the map and buildings placed in the editor but all the same result

sour saffron
#

what i was asking was if its the same building you can jst place the height as a parameter , in buildings a roadway lod will reset height to 0 so you need to know actual height in old days , maybe not ehere is a new way or else its a case of ASL

astral tendon
#

does not seens to matter the building, even if i manualy place the possition it is set to ground level

sour saffron
#

must be same as always then , pain in the ass

astral tendon
#

Well, rip.

sour saffron
#

there a way

astral tendon
#

can some one let a note about it?

#

i imagine that you would sugest to set the height afther the unit created right?

sour saffron
#

well i am not so well informed in Arma 3 but i guess first is Above sea level and if not then worldtomodel or a relpos using modeltoworld

#

im sure i hear about some ATL too was a fix for this but cannot swear

astral tendon
#

getPosATL?

sour saffron
#

yeah i think thats valid

#

and setposATL

astral tendon
#

I tested it, same problem

#
"B_RangeMaster_F" createUnit [getPosATL player, group player];
sour saffron
#

have you see what is returning pos player select 2 ?

#

is it actually 0 because of roof ?

meager heart
indigo snow
#

dont use get/setPos in on or even near buildings

#

use the other variants

sour saffron
#

there ya go loads of new commands 😃

astral tendon
#

13.0226

indigo snow
#

setPos will assume z = 0 is on top of whatever building on those coordinates

astral tendon
#

i tryed to set the possition in mid air and still created the unit on the ground

#

does not matter

indigo snow
#

just create it and move it immediately after

astral tendon
#

even if i manualy set the Z it still gets ignored

sour saffron
#

ah yeah always place after creating

indigo snow
#

use a setPosXXX command immediately after creating the unit

#

do it that way

sour saffron
#

in last event try name of your thin setpos (player modeltoworld [0,0,0])

exotic tinsel
#

whats the best way to call a function after 10 seconds from the init file? sleep causes issues

indigo snow
#

an on each frame event handler that checks the time diff

#

assuming the sleep issues cause from suspending

astral tendon
#

that was the only way

#
SpawnUnit_RPG = {_Objectpos = position _this; "O_G_SOLDIER_F" createUnit [position _this, Opfour, "
this setPos _Objectpos; 
[this] join grpNull;
group this addWaypoint [position car_1, 0];
this setUnitPos 'UP';
this getSpeed FAST;
this setSkill ['aimingAccuracy', 0.1];
this setSkill ['aimingShake', 0.1];
this setSkill ['aimingSpeed', 0.1];
this setSkill ['spotTime', 0.1];
this setUnitLoadout getUnitLoadout selectRandom units loadout_RPG;
lockIdentity this;
this setFace Face selectRandom units loadout_RPG;
this addEventHandler  
[  
 'Fired',  
 { 
  _mag = _this select 5;  
  _unit = _this select 0;  
   
  if ({_x isEqualTo _mag} count magazines _unit < 2) then  
  { 
   _unit addMagazines [_mag, 3];  
  };  
 } 
]; 
"];
};
#

i trow that on the new unit init and works.

sour saffron
#

yeah the setpos after creation does it

#

weird its still tsuch a thing after all this year

blazing quiver
#

dumb question

#

is there a way to use AttachTo without actually moving an object? I basically just want to use it to get rid of PhysX collisions

blazing quiver
#

Alright, I'm totally at a loss for this issue

#

Apologies in advance for the garbage-tier video, have not recorded anything in a while.

#

Basically, the sliding doors in my ship template will work in some positions but not others. I know the ship model is littered with invisible walls, and I've used a disablecollisionwith script to allow players to walk through them, but I suspect the invisible walls are stopping some of the doors from opening as well, since when I delete the ship model all doors work properly, regardless of position (all this is shown in the video).

#

Does anyone have any clue as to what could be causing this, and what I should be looking at in regards to fixes? Because I'm stumped.

tough abyss
#

Looks newer door detection method. just because you disabled collision between objects. The invisible wall geos are prob still blocking the door detection.
Using getCursorObjectParams is a good method to testing the new door detection ingame.

Anyway you would be better off overridding the config for the door conditions than scripting invisible walls.

blazing quiver
#

@tough abyss Thanks, that's something I would have had no clue about if you hadn't mentioned it.

#

I'm very much a super basic mission maker, any chance you could point me in the right direction for dealing with the door conditions?

thorn saffron
#

How to get a listNbox dialog resource working? I tried copying stuff from some templates, but I get an error while opening my dialog. Is there any simple example of the ListNBox I could study? For the life of me I can't get it to work

meager heart
#

@thorn saffron

thorn saffron
#

@meager heart Tried, can't get stuff to display though

thorn saffron
still forum
#

Did you upload your code somewhere so one can look at it?

thorn saffron
#

dialogs kinda ride the middle ground between scripting and config editing, and no. I didn't upload it (yet).

still forum
modern sand
#

How would I be able to get the current gesture the player is doing, or possibly stop a player leaving a gesture?

still forum
#

Else.. Gesture? What gesture?

thorn saffron
#

Ok so I have a 2D array like the one bellow. It's an array containing weapon classes and their count inside multiple boxes. The issue is there are some duplicates. Say I have 2x "arifle_MX_F" and each has the count of 4 (ie. there are 8 rifles) I need to select the count for the first instance of the class name, go through the array, add up the counts from duplicates and remove the duplicates' classes and counts afterward.

[["arifle_MX_F","arifle_MX_GL_F","arifle_MX_SW_F","arifle_MXC_F","SMG_01_F","hgun_P07_F","hgun_Pistol_heavy_01_F","launch_B_Titan_F","launch_B_Titan_short_F","launch_NLAW_F","arifle_SDAR_F","arifle_MXM_F","srifle_LRR_F","srifle_DMR_03_F","srifle_DMR_02_F","MMG_02_black_F","arifle_MX_F","arifle_MX_GL_F","arifle_MX_SW_F","arifle_MXC_F","SMG_01_F","hgun_P07_F","hgun_Pistol_heavy_01_F"],[4,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,4,2,2,2,1,1,1]]```
tough abyss
#

Or you could manually add the array elements in, using find / pushbackunqiue to check for duplicates

thorn saffron
#

Yeah, I was just saying this in case there is some magical command that already does that for you

tough abyss
#

No there isn't. Personnally i would use pushbackunique to add an element to array if it returns -1 you know it already exists, or returns the index.
If its a duplicate you can then use find to check for the index (find is case sensitive, but that shouldn't be an issue for your case)

thorn saffron
#

I was given a function that actually does the searching and removing strings. I just need to adapt it for this

tough abyss
#

Nah that is just messy imo

thorn saffron
#

I think of it as a concept art for code: its a shit code that does what it's supposed to, then someone who actually knows what he is doing makes the code that is not shit 😛

tough abyss
#
_classnames = ["classA","classB","classC"]
_ammount = [10,20,30];

_class = "classD";
_num = 99;
_index = _classnames pushBackUnique _class;
if (index > -1) then  { 
   _ammount set  [_index, _num];
} else {
   _index = (_classnames find _class);
  _ammount set [_index, (_ammount select _index) + _num];
};

Didn't test but that is the gist of it

#

updated it: forgot to use find to get index

thorn saffron
#

the problem is this:

_classnames = ["classA","classB","classC","classA"]
_ammount = [10,20,30,24];
tough abyss
#

You group then back into a main array afterwards i.e above you basicaly have [_classanmes,_ammount]

#

Or you can do reference arrays, but people get confused over that (thinking they copied an array). Not really in anything else scripting wise in arma

final condor
#

Does anyone know good Smoke Pod Script for Jets or any Addons for adding smoke pod in Arma 3 ?

thorn saffron
#

like rocket pod that fires smoke grenades?

final condor
#

Yes

thorn saffron
#

its a config stuff and AFAIK the unsug did that

warm gorge
#

Is the code for searching for things on the eden editor engine based? I cant find it in any of the eden scripts

still forum
#

yes. Same for zeus

warm gorge
#

alright ty

drowsy axle
#

Is anyone able to help me out. I'm looking for a way to spawn a box (ammo) next to any "insertclassnamehere" object. How could I go about have a condition, to meet these requirements?

#

I thought about the use of isKindOf would that work for classnames?

thorn saffron
#

@drowsy axle If it can only be a one classname then you can just get the classname and then compare it with the one you set in the script

_targetclassname = "targetclassname"
if (_scannedClassname = _targetclassname) then {
//here you get the position of that scanned object and spawn the container using adjusted coordinates
};```
still forum
#

Yes. isKindOf returns classname

drowsy axle
#
private _objectFinder = nearestObject [player, ["UK3CB_BAF_Static_L16_Deployed_MTP"], 50];
private _objectFinderPos = getPosATL _objectFinder;
if (_objectFinder) then {
    private _mortar = [] spawn {private _obj = "UK3CB_BAF_Box_L16_Ammo_HE" createVehicle position _objectFinderPos;
};```
still forum
#

spawn?

#

Why the spawn?

drowsy axle
#

idk

still forum
#

Don't do stuff if you don't know why

drowsy axle
#

Do stuff so you know why....

still forum
#

if (_objectFinder)
You mean if !(isNull _objectFinder)

#

To check if you found an object

drowsy axle
#

Yeah, that's true.

still forum
#

move the getPosATL into the if statement

#

Because first getting the position of the object and then checking if you even have a object doesn't make much sense

#

then remove the spawn.

#

Done

drowsy axle
#
private _objectFinder = nearestObject [player, ["UK3CB_BAF_Static_L16_Deployed_MTP"], 50];
if !(isNull _objectFinder) then {
    private _objectFinderPos = getPosATL _objectFinder;
    private _object = "UK3CB_BAF_Box_L16_Ammo_HE" createVehicle position _objectFinderPos;
};
still forum
#

Jup

drowsy axle
#

Wow. I was so close

still forum
#

that finds the closest "UK3CB_BAF_Static_L16_Deployed_MTP" to your player within 50m and then spawns a Ammo box next to it

drowsy axle
#

Would it spawn it on top or does the engine command createVehicle look for object collide?

still forum
#

It checks for collision

drowsy axle
#

cool

#

This would work mid mission?

still forum
#

yes

drowsy axle
#

nearest object is looking a number...

#

shoudl it be objects

still forum
#

It says it wants a number but you gave it object

#

It wants [position,type]

drowsy axle
#

oh

#

okay

still forum
#

you gave [object, type, distance]

drowsy axle
#

I done player

#

oh

#

that's for nearest objects

#

one sec then

still forum
#

yeah

drowsy axle
#

im gunna do nearest objects

still forum
#

because nearestObject doesn't have the range limit

drowsy axle
#

Yup

#

isNull is wrong

still forum
#

no

drowsy axle
#
private _objectFinder = nearestObjects [player, ["UK3CB_BAF_Static_L16_Deployed_MTP"], 50];
if !(isNull _objectFinder) then {
    private _objectFinderPos = getPosATL _objectFinder;
    private _object = "UK3CB_BAF_Box_L16_Ammo_HE" createVehicle position _objectFinderPos;
};```
still forum
#

nearestObjects returns multiple objects in an array

drowsy axle
#

So wouldn't I need to break that down?

still forum
#

need to take the first object yeah

drowsy axle
#

do a foreach?

still forum
#

select 0 or param [0]

#

I don't know

#

do you want to spawn one ammo box at the nearest. Or one on each?

drowsy axle
#

one each

#

on each

still forum
#

the forEach yeah

drowsy axle
#

foreach _objectFinder

#

cirrect?

still forum
#

yeah

drowsy axle
#

k

#
private _objectFinder = nearestObjects [player, ["UK3CB_BAF_Static_L16_Deployed_MTP"], 50];
if !(isNull _objectFinder) then {
    { 
        private _objectFinderPos = getPosATL _x;
        private _object = "UK3CB_BAF_Box_L16_Ammo_HE" createVehicle position _objectFinderPos;
    } foreach _objectFinder;
};
still forum
#

Move the isNull to inside the forEach

#

and check isNull _x

drowsy axle
#

Okay...

#

why?

still forum
#

Shouldn't happen usually. But could

#

It could find the object. But before it get's into the forEach something else could have deleted that object

#

If you don't care just remove the isNull check

drowsy axle
#

How can I have the _objectfinder loop each 10 secs?

#

So that any object made within 10 secs has a ammo box spawn

still forum
#

spawn while {true} do and sleep 10

drowsy axle
#

is that around the if?

still forum
#

around everything

#

But that would spawn a new box on every object every 10 seconds.. So you'll have lots of boxes

drowsy axle
#

okay

#

lol

#

I could have a delete box make box

#

loop

#

of say 60 secs

still forum
#

Either that. Or you remember which mortar already has a box

drowsy axle
#

Yeah ture

#

I could do something like that

#

I could do setvariable to hasBox

#

at the end then check that the object has that variable

#

setvariable do work like that...

#

setvariable isn't giving it a "unique" name, corect?

still forum
#

you can set the variable onto the mortar

#

_object setVariable ...
_object getVariable ...

drowsy axle
#

yup

#

this is what I have so far sqf [] spawn { while {true} do { private _objectFinder = nearestObjects [player, ["UK3CB_BAF_Static_L16_Deployed_MTP"], 50]; if !(isNull _objectFinder) then { { private _objectFinderPos = getPosATL _x; private _object = "UK3CB_BAF_Box_L16_Ammo_HE" createVehicle position _objectFinderPos; } foreach _objectFinder; }; }};

still forum
#

look at wiki page for spawn and while

drowsy axle
#

how about now?

still forum
#

yeah

rancid ruin
#

doesn't spawn require arguments?

#

e.g

[] spawn { while {true} do {
still forum
#

Uh yes..

#

Not in my world though. But in yours it does

rancid ruin
#

i can't remember, haven't used it in ages

still forum
#

Yeah you have to pass something as argument

rancid ruin
#

remember seeing people do

0 = spawn .....

all the time

still forum
#

That's something different

#

That's a crappy workaround to a nonsense bug that BI never wanted to fix

#

People just made a habit out of it and now litter that crap everywhere

drowsy axle
#
spawn { while {true} do {
    private _objectFinder = nearestObjects [player, ["UK3CB_BAF_Static_L16_Deployed_MTP"], 50];
    if !(isNull _objectFinder) then {
        {
            isNull _x;
            private _objectFinderPos = getPosATL _x;
            private _object = "UK3CB_BAF_Box_L16_Ammo_HE" createVehicle position _objectFinderPos;
            _object getVariable;
            if (_object getVariable = "hasBox") then exitWith{};
            _object setVariable ["hasBox", 1, true];
        } foreach _objectFinder;
    };
}};
#

Does exitWith and setVar work in that context?

still forum
#

exitWith yes

#

setVar no. Check wiki page

drowsy axle
#

setVariable ["myPublicVariable", 123, true]; // what does the 123 mean?

still forum
#

You have to set the variable to something

#

123 is something

drowsy axle
#

now?

#
spawn { while {true} do {
    private _objectFinder = nearestObjects [player, ["UK3CB_BAF_Static_L16_Deployed_MTP"], 50];
    if !(isNull _objectFinder) then {
        {
            _x getVariable;
            if (_x getVariable = "hasBox") then exitWith{hint "debug1";};
            isNull _x;
            private _objectFinderPos = getPosATL _x;
            private _object = "UK3CB_BAF_Box_L16_Ammo_HE" createVehicle position _objectFinderPos;
            _x getVariable;
            if (_x getVariable = "hasBox") then exitWith{hint "debug2";};
            _x setVariable ["hasBox", 1, true];
        } foreach _objectFinder;
    };
}};```
still forum
#

Yeah.. I guess

#

But what are these weird getVariable thingies nonsense stuff

#

Read the wiki page for getVariable

drowsy axle
#

To check whether that same mortar has a box next to it

#

as it would only get the variable has box at the bottom

still forum
#

That's not how getVariable works

#

read the wiki page

#

Well that's how it works.. But that's not how you use it...

#

Like.. Stuff.

drowsy axle
#

varspace: Namespace, Object, Display, Control, Group, Location, Task, Team Member, Display, Control // you mean

#

varspace getVariable name

still forum
#

jup I mean that

drowsy axle
#
private _count = 0;
spawn { while {true} do {
    private _objectFinder = nearestObjects [player, ["UK3CB_BAF_Static_L16_Deployed_MTP"], 50];
    if !(isNull _objectFinder) then {
        {
            _x getVariable;
            if (_x getVariable = "hasBox") then exitWith{hint "debug1";};
            isNull _x;
            private _objectFinderPos = getPosATL _x;
            private _object = "UK3CB_BAF_Box_L16_Ammo_HE" createVehicle position _objectFinderPos;
            _x getVariable;
            if (_x getVariable = "hasBox") then exitWith{hint "debug2";};
            _x setVariable ["hasBox", _count+1, true];
        } foreach _objectFinder;
    };
}};```
still forum
#

As I said

#

read wiki page for getVariable and find out how it works

#

Reposting your code over and over won't change stuff

drowsy axle
#

I'm looking at it. Makes no sense...

#

Examples
Example 1:
_thePublicVariable = _myTruck getVariable "myPublicVariable";

still forum
#

Yep.

#

Now compare that to what you have and see that yours doesn't make sense

drowsy axle
#

Yeah

#

is sqf _x setVariable ["hasBox", _count+1, true]; the same as sqf _objectFinder = hasBox;

still forum
#

Well.. Does it look like it?

drowsy axle
#

idk

still forum
#

Not a single character is the same in these two code snippets

drowsy axle
#

I don't litteraly the same

still forum
#

Oh wait. No. The _ at the start is the same

meager heart
#

😄

drowsy axle
#

I don't understand the context of setVariable.

#

_objectFinder setVariable ["hasBox", 1, true]; and _objectFinder = hasBox;

still forum
#

The context is the argument you give to it on the left side

drowsy axle
#

_objectFinder setVariable ["_hasBox", 1, true]; and _objectFinder = _hasBox;

#

the _hasBox can also store info

#

which for the setvar

#

is 1

still forum
#

Those are two completly different things

drowsy axle
#

..........................

#

okay

#

That's good

#

So the setVariable doesn't define an actual variable.

still forum
#

_objectFinder setVariable ["hasBox", 1, true];
set's the variable hasBox on the object inside _objectFinder to 1 and transfers to everyone on the server.
_objectFinder = _hasBox copies the contents of the local _hasBox variable into the _objectFinder variable

#

No. setVariable does define a actual variable.

drowsy axle
#

hmmm

#

that's a problem

#

i think

dusk sage
#

A problem?

drowsy axle
#

yes

#

i think

still forum
#

Probably

dusk sage
#

With you/your code?

drowsy axle
#

haha

#

funny

#

😐

dusk sage
#

The only problem would be using it incorrectly 🙃

drowsy axle
#

I mean the potential solution might not be a solution, but a block

dusk sage
#

Perhaps rewrite your code with the newly learned information, then see

drowsy axle
#

Yup

#

You say this: @still forum

#

set's the variable hasBox on the object inside _objectFinder to 1 and transfers to everyone on the server.

#

that doesn't define the _objectfinder

still forum
#

I know what I say

#

No need to repeat

#

True? The word _obfinder doesn't appear anywhere in that sentence

drowsy axle
#

it's the object within it

dusk sage
#

I think you need to elaborate on what you want objectFinder to be defined as

#

It's the object you're setting the variable on

still forum
#

Well yeah it doesn't define it

#

because you are supposed to give that to the setVariable function

drowsy axle
#

ObjectFinder is already defined as an array of objects

dusk sage
#

Then you can't setVariable on it

drowsy axle
#

I know

#

So the setVariable would be on the _object which i cannot do, as it would already be created

still forum
#

What?

dusk sage
#

But you're looping through it, _x is your object

still forum
#

You already have the object

#

it is already created

drowsy axle
#

Yeah

still forum
#

you get the position from it. in your code

drowsy axle
#

but I want the loop to end at the exitwith

still forum
#

Yeah?

drowsy axle
#

if the variable is already defined for the object.

still forum
#

It does that

#

Well then use getVariable to check if the variable is set

drowsy axle
#

Yeah. How? the GetVaruiable only look at the varspace not the object... i'm confused about the getvar

#

ohim an idiot

still forum
#

A object is a varspace

drowsy axle
#

yeah

#

😦

#

just realised

#

welp

dusk sage
#

🐧

drowsy axle
#

the only issue I have now is that the _object isn't create

#

d

still forum
#

What?

drowsy axle
#
private _count = 0;
spawn { while {true} do {
    private _objectFinder = nearestObjects [player, ["UK3CB_BAF_Static_L16_Deployed_MTP"], 50];
    if !(isNull _objectFinder) then {
        {
            _x getVariable;
            if (_x getVariable = "hasBox") then exitWith{hint "debug1";};
            isNull _x;
            private _objectFinderPos = getPosATL _x;
            private _object = "UK3CB_BAF_Box_L16_Ammo_HE" createVehicle position _objectFinderPos;
            _object getVariable;
            if (_object getVariable = "hasBox") then exitWith{hint "debug2";};
            _object setVariable ["hasBox", _count+1, true];
        } foreach _objectFinder;
    };
}};```
still forum
#

You mean the script doesn't run?

dusk sage
#

You've still not fixed the getVar

still forum
#

Because it can't run because it's a syntax error

dusk sage
#

Fix the code first

drowsy axle
#

I cannot get the _object

still forum
#

why can't you?

#

It's right there

dusk sage
#

You use position on an array

drowsy axle
#

wait hang on

#

let me sort it out.

#

what's name?

#

_object getVariable [name, "hasbox"];

#

oh wait

#

I mixed them up

#

_object getVariable ["hasBox", null];

dusk sage
#

Check what the second parameter does carefully

drowsy axle
#

defaultValue: Anything - Value to return if variable doesn't exist

#

nill or null?

#

for nothing

dusk sage
#

Well if hasBox is a bool, you ideally want to default to false, I assume

drowsy axle
#

could i set it to 0?

dusk sage
#

You can use nil and perform and isNil check

#

But you cannot use null

drowsy axle
#

wait hangon

#

uhm

#

the value would be the _count+1 correct?

dusk sage
#

There is different types of 'null' in arma, see the wiki

#

Yes

drowsy axle
#

well

dusk sage
#

If you setVariable it to that

drowsy axle
#

I cannot know that beforehand

#

because there could have been 1000 _count+1's

dusk sage
#

Then use a default like 0 as you suggested

drowsy axle
#

_object might break

#

at the getvar. what do you think?

still forum
#

The object is in _x not _object

dusk sage
#
_myVar =  _object getVariable ....;
if (_myVar == 1)...
still forum
#

check forEach on wiki

#

That isNull _x; doesn't make sense

dusk sage
#

And as dedmen said

drowsy axle
#

ik what foreach is

still forum
#

private _count = 0; That variable is not visible in the code

drowsy axle
#

yeah outside the scope

dusk sage
#

Nearest objects returns an empty array if nothing is found

still forum
#

Yeah. Already said an hour ago to move the isNull check

drowsy axle
#

see edit ^

dusk sage
#

It's the same

#

objectFinder can't be null

still forum
#

Still nonsense isNull and nonsense getVariable and another syntax error getVariable

dusk sage
#

Did you change anything

still forum
#

@pastel cloakuu#1044 It technically could. Rarely

#

I already said he can just remove it entirely when he doesn't care about that rare error

drowsy axle
#
spawn { while {true} do {
    private _count = 0;
    private _objectFinder = nearestObjects [player, ["UK3CB_BAF_Static_L16_Deployed_MTP"], 50];
    {
        isNull _x;
        _x getVariable ["hasBox", 0];
        if (_x getVariable = 1) then exitWith{};
        private _objectFinderPos = getPosATL _x;
        _object = "UK3CB_BAF_Box_L16_Ammo_HE" createVehicle position _objectFinderPos;
        _x setVariable ["hasBox", 1, true];
    } foreach _objectFinder;
}};```
still forum
#

Nothing changed

drowsy axle
#

private _count = 0; inside the scope

dusk sage
#

What would it return? @still forum

still forum
#

null object

drowsy axle
#

ObjNULL?

still forum
#

If the object get's deleted before the forEach get's to it it will just be null object

dusk sage
#

It's the array at the top

#

From nearestObjects

still forum
#

@drowsy axle Read what i wrote above. I talked about 3 nonsense errors and you fixed none of them

dusk sage
#

Not the object

still forum
#

Oh

#

I see

drowsy axle
#

nonesense doesn't help me fix them..

still forum
#

4 errors then

#

It does

#

Read the wiki page. Look at examples

drowsy axle
#

isNull are you talking about the if?

dusk sage
#

Yes

#

And the isNull _x

#

That line serves no purpose

still forum
#

And the getVariable line serves no purpose

#

and the other getVariable inside the if is a syntax error

#

because that's not how you use getVariable

dusk sage
#

Honestly Capwell, you've been given some changes and they haven't been added

drowsy axle
#

see edit ^

dusk sage
#

You didn't read what I wrote for getVariable

drowsy axle
#

How am I meant to get the GetVariable?

dusk sage
#

By reading what you're being written, and the wiki

#

I literally wrote the code for you

drowsy axle
#

this? _myVar = _object getVariable ....;
if (_myVar == 1)... // i didn't see that sorry.

dusk sage
#

Yes

still forum
#

Yes exactly that

#

Why don't you see that? It's right there. You just copy pasted it by yourself

dusk sage
#

Before changing it, try to see that _x getVariable = 1 is nonsense

#

As to understand why it's wrong

drowsy axle
#
spawn { while {true} do {
    private _objectFinder = nearestObjects [player, ["UK3CB_BAF_Static_L16_Deployed_MTP"], 50];
    {
        private _hasBox = _x getVariable ["hasBox", 0];
        if (_hasBox == 1) then exitWith{};
        private _objectFinderPos = getPosATL _x;
        _object = "UK3CB_BAF_Box_L16_Ammo_HE" createVehicle position _objectFinderPos;
        _x setVariable ["hasBox", 1, true];
    } foreach _objectFinder;
}};```
still forum
#

Better

#

getVariable is still syntax error

#

It can't magically know what variable you want

dusk sage
#

'get what variable' <-- ARMA

#

Perfect

still forum
#

Yes! perfect! 😄

dusk sage
#

_count serves no purpose

#

That I can see on my phone

drowsy axle
#

_count+ not needed?

still forum
#

no

drowsy axle
#

okay

peak plover
#

Lol

dusk sage
#

You should make hasBox a bool

drowsy axle
#

Why's that?

dusk sage
#

Because that's exactly what it's designed for

#

This is not C

#

:)

drowsy axle
#

okay.. does it make the performance better?

still forum
#

Why C?

#

Yes it does

#

but not much

drowsy axle
#

ok

still forum
#

well....

#

Actually might make it worse.

dusk sage
#

Because C has no bool type

still forum
#

But you shouldn't care about that. It's a very minimal impact

#

it doesn't? :U

dusk sage
#

Well, with defines only

still forum
#

Good to know I guess

dusk sage
#

stdbool

drowsy axle
#

i'll stick with 0 and 1

#

gunna test brb

dusk sage
#

Defines true false to 1/0

#

:P

drowsy axle
#

spawn |#|{while // missing a ;

still forum
#

As we said an hour ago

drowsy axle
#

oh

#

no []

still forum
#

spawn needs an arument

#

check the wiki page

drowsy axle
#

yeah

still forum
#

yeah. That

drowsy axle
#

idkw it got deleted

#

i did put it...

#

lol

#

you guys missed one

#

if (_hasBox == 1) then exitWith{};

dusk sage
#

No

drowsy axle
#

there shoud be no then

dusk sage
#

You missed one

drowsy axle
#

😛

dusk sage
#

:)

#

When there is so many errors, it becomes hard to spot them all

drowsy axle
#

fully working¬!!!!!!!!!!

#
spawn { while {true} do {
    private _objectFinder = nearestObjects [player, ["UK3CB_BAF_Static_L16_Deployed_MTP"], 50];
    {
        private _hasBox = _x getVariable ["hasBox", 0];
        if (_hasBox == 1) then exitWith{};
        private _objectFinderPos = getPosATL _x;
        _object = "UK3CB_BAF_Box_L16_Ammo_HE" createVehicle position _objectFinderPos;
        _x setVariable ["hasBox", 1, true];
    } foreach _objectFinder;
}};
``````sqf
[] spawn { while {true} do {
    private _objectFinder = nearestObjects [player, ["UK3CB_BAF_Static_L16_Deployed_MTP"], 50];
    {
        private _hasBox = _x getVariable ["hasBox", 0];
        if (_hasBox == 1) exitWith {};
        private _objectFinderPos = getPosATL _x;
        _object = "UK3CB_BAF_Box_L16_Ammo_HE" createVehicle _objectFinderPos;
        _x setVariable ["hasBox", 1, true];
    } foreach _objectFinder;
}};```
#

free scriptz

#

Capwell - Today at 11:57
I could make a script that creates and places down a box... @[VM] Icario(edited)
TankNut - Today at 12:01
Couldn't you just
Place down a box with a bunch of the items loaded inside ahead of time?(edited)
I don't know, make a composition out of it
Capwell - Today at 14:01
took two hours
[] spawn { while {true} do {
private _objectFinder = nearestObjects [player, ["UK3CB_BAF_Static_L16_Deployed_MTP"], 50];
{
private _hasBox = _x getVariable ["hasBox", 0];
if (_hasBox == 1) exitWith {};
private _objectFinderPos = getPosATL _x;
_object = "UK3CB_BAF_Box_L16_Ammo_HE" createVehicle _objectFinderPos;
_x setVariable ["hasBox", 1, true];
} foreach _objectFinder;
}};
(edited) @still forum @dusk sage

still forum
#

What?

#

Please cut the spam. Thanks

drowsy axle
#

I'm so proud. Thank you guys 😄 @still forum @dusk sage

dusk sage
#

:+1: @drowsy axle

#

@drowsy axle

drowsy axle
#

Anyone know the command to get the classname of the item you are looking at?

still forum
#

typeOf

drowsy axle
#

typeOf cursorTarget

lone glade
#

DED

#

DED

#

BIS IS WORKING ON IT

still forum
#

No

#

Already...

lone glade
#

YES

still forum
lone glade
#

yeees! I did

still forum
#

They fixed lag when creating the entities

#

which was never a problem

#

Atleast if the changelog entry is correct

lone glade
#

it's tagged WIP, they can't not fix the entity spam

still forum
#

Maybe they'll fix the rest

#

They sure can ^^

drowsy axle
#

just have -nologs on the server?

lone glade
#

that's what i'm hopping

#

🤦

#

ah, yes, disabling logging will delete entities, of course

#

why didn't we think of that

drowsy axle
#

oh

still forum
#

Remember how they can't screw up something that was reported on dev branch and then made it through RC and into release?

drowsy axle
#

i get ya

lone glade
#

...... true

#

like, enums

rotund cypress
#

Why stick to 0 and 1 and not use what is in the language instead (boolean (true/false))? @drowsy axle

still forum
#

Because sticking is easier

rotund cypress
#

Also I’m curious, as BoGuu said, did you get this from C language? @drowsy axle

drowsy axle
#

nope

#

and what do you mean by that?

still forum
#

@rotund cypress non programmers usually don't know the concept of booleans I'd say

pliant stream
#

anyone with a high school education should know about boolean algebra, surely...

still forum
#

Yeah. I had it in 8th grade I think.

#

But there are many countries on this planet

inner swallow
#

i had it in the 11th grade

#

but that was only because i had computer science/C/C++ in the 11th and 12th grade

tough abyss
#

Idk in my school we learned about bools and shit around 3rd grade with simple logic statements

still forum
#

Sounds like Sweden 😄

tough abyss
#

Nah us

inner swallow
#

FreeSpace 2 taught me those things when i was 7 or 8 😄

#

We did learn LOGO in school between 2nd and 4th grade, after which we learnt BASIC for a year or two

#

but no boolean algebra back then iirc

thorn saffron
#

Truth is: if you don't have a real reason to learn coding its hard. I jumped a bit deeper into that to create that shop script thing. The fact I do it for arma keeps me interested.
IMHO schools with programming should actually have courses using an Unreal or Unity as a thing your program for. Just so kids can see they can create cool stuff if they learn how to code.

still forum
#

As soon as a couple kids in class have to laugh in unison because someone programmed something funny. You know that you are doing your job right

inner swallow
#

it's just going to be a dick, you know that 😛

still forum
#

That spews fire particles

#

#Unreal

#

😄

thorn saffron
#

Of course, but they would be the ones to program that dick to flop around

still forum
#

Unreal is a very nice idea. Especially with the node based programming.

thorn saffron
#

They would have so much fun they would actually learn

#

and its free

#

and you can dig under the hood and create custom nodes

#

It wouldn't be that bad of an idea for a school course

subtle ore
#

Unreal also has the option between node based and C++

still forum
#

You can go to a more advanced level in higher grades. Without going somewhere else

lone glade
#

"programming" requires a certain mindset, and it's not taught in schools, that's all

#

it's a different kind of problem solving imho

subtle ore
#

No ofc not. It's "let's see how many useless steps we can throw in" kind of crap

still forum
#

If you look at these people that don't know how a variable assignment works...
Don't you learn x = y stuff in maths lessons?

thorn saffron
#

yeah, that is why the kids need a goal: to create the floppiest dick or whatever. Something that will make them want to learn how to program the optimal dick floppiness

still forum
#

I can generally only learn when I have something to do with it... Which is why I can't get myself to improve my russian

subtle ore
#

@thorn saffron That's exactly what the school boards don't want.

#

Well can you speak us some Russian Dedmen?

still forum
#

Kids gotta learn how life is. Can't do what you want. Have to do what someone else tells you to do

#

Yeah

thorn saffron
#

@Midnight#4592 Haven's forbid the kids will actually learn something worthwhile and something they can get fun from

still forum
#

Had it 3 years in school

#

could choose French/Latin/Spanish/Russian/Swedish.
That was the time when i got into DayZ.. So.. Cherna...

subtle ore
#

@thorn saffron Not mine, nor any of our decisions. New dept heads is the next step. Or rather, destruction of the dept and states will be leading programs (in the us this applies, dunno anywhere else)

#

@still forum Spanish i hear is pretty easy

#

inb4 Chernarussian Troll

thorn saffron
#

To this day I lament that I didn't go with russian as the second foreign language in my high school

subtle ore
#

Some Universities require it

thorn saffron
#

3 years of german instead, didn't really learn anything

subtle ore
#

Man, you gotta take advantage of that kind of thing

thorn saffron
#

I adored english though, I was actually one of the best in school at it

subtle ore
#

Depends on where you come from i guess

thorn saffron
#

maybe I liked it because I was good at it 🤔

subtle ore
#

Maybe, not sure how hard it is to learn?

still forum
#

English maths and physics were the most boring classes for me.. Always had the 2 lesson task done in like 10 minutes... yuck

subtle ore
#

For most, you'd be a prod Dedmen

#

Generally either lack of initiation is what kills most grades, you sure have more than most if that is the case

thorn saffron
#

Still, the floppy dick simulation should be one of the entry courses to Unreal, especially for kids 😛

subtle ore
#

Plus, Germans are supposed to the engineers of the world right?

#

Easy to apply in unreal

still forum
#

I still had shit grades in other classes because I was too bored to do stuff.

subtle ore
#

Just make bones

#

My point exactly dedmen, lack of initiation

thorn saffron
#

Not enough floppy dick programming I guess

subtle ore
#

Well music and art make room for appreciation of little things i guess.

thorn saffron
#

🤔 art classes leave a lot room for dick floppines

subtle ore
#

Simple things in life ^

lone glade
#

wanna see floppy dicks? google floppy dicks

subtle ore
#

No thanks

still forum
#

floppy disks? What?

thorn saffron
#

Nothing like a serious discussion on the matters of education, programming and floppy dicks

subtle ore
#

Rather it be in a ue4 sim than an image

still forum
#

Are that these things on your head with the eyey things on top?

lone glade
#

I think you need to see a doctor

subtle ore
#

Eye thingies lol

still forum
#

if (_val == 1) then {false == false} else {controlNull == controlNull}

subtle ore
#

Lol

still forum
#

Splendid obfuscation right there

austere hawk
#

i dont see the problem... its all true

thorn saffron
#

@austere hawk The last part actually seem to return false

subtle ore
#

Wat

austere hawk
#

semantics 😛

subtle ore
indigo snow
#

Not all Nulls are created equal

thorn saffron
#

#notAllNulls

austere hawk
#

thats numeracial!

thorn saffron
#

End the binary opression in programming! Where are the "maybe" or "true-curious" bools?

subtle ore
#

Taro, my head. You're hurting it

thorn saffron
#

Good! Pain is just weakness leaving the body!

subtle ore
#

Yeah, but i may die remotely from the crap you are posting here

indigo snow
#

Fuzzy bools is the new catch all term

austere hawk
#

@thorn saffron quantum computing will bring equality

subtle ore
#

Fuzzy bools?

austere hawk
#

"most likely true" ^^

still forum
#

Furry bools :3

austere hawk
#

bleh

subtle ore
indigo snow
#

Fuzzy logic. The sort commy likes where something can both be not true and not false.

still forum
#

if _value > true

austere hawk
#

*tru

thorn saffron
#

@austere hawk I guess the whole list of the furry bools in quantum computing could called a boolsack

subtle ore
#

😂

austere hawk
#

putting a different spin on it, i see

thorn saffron
#

brogramming jokes

#

well, I'm off to the Unreal discord server in order to learn how to create that floppy dick simulation

subtle ore
#

@thorn saffron Unreal Slackers right?

astral tendon
#

How to make Units that only have the Laucher as a weapons draw it instead off keep unarmed?

indigo snow
#

selectWeapon

astral tendon
#

```this selectWeapon "rhs_weapon_rpg7";````

#

that gives a error about missing ]

#

but in the example they are in ""

indigo snow
#
  1. That means your error is elsewhere
  2. make sure to note the part about the string being the name of the muzzle, not the weapon
astral tendon
#

oh i see, i need to chage to ' '

#

and yeah, the unit did not draw it anyway.

indigo snow
#

just look at the notes at the bottom of the wiki page

dim terrace
#

rhs_weapon_rpg7 is not a weapon

#

it's placeable item

indigo snow
#

its a vehicle!

astral tendon
#

urg, in the arsenal is named rhs_weap_rpg7

#

like, wtf

#

that note talk about underbarrel granades

still forum
#

Yeah

#

rhs_weap_rpg7 != rhs_weapon_rpg7

#

Not sure if that's the issue. But classnames have to be correct and not about correct-ish

astral tendon
#

meh, this seens hopeless

indigo snow
#

Its the way you do it /shrug

blazing quiver
#

Does anyone know how I could get a door to open/close normally by ignoring any collision stuff around it?

#

Basically I have a door placed in a mission which won't open to due an invisible wall placed in the object the door is in

#

Someone said to try and mess with "overriding the config for the door conditions" but I haven't got a clue how to do that

exotic tinsel
#

im calling a function from a trigger and getting an error when using time in the function, is there an alternative?

indigo snow
#

do you know why youre getting that error?

exotic tinsel
#

no i dont, can you explain, im a noob

indigo snow
#

you can execute scripts in two contexts in arma, scheduled and non scheduled. non-scheduled scripts run completely in a single frame, so they can cause a big stutter. scheduled scripts stop running after 3 ms and resume the next frame. Only these scheduled scripts can suspend, use sleep and waitUntil.

Generally, scheduled code is executed with the spawn command as opposed to the call command. Consult the wiki for more information.

outer fjord
#

Question,
call{this animateDoor ["Door_rear", 1, true];}

#

Will that work in a dedicated server enviroment? Or do I need more added. This is simply on a ifirit inti section

indigo snow
#

it would reexecute everytime a player connects

exotic tinsel
#

thanks @indigo snow , whats a good alernative to using this then _future = time + 5; waitUntil {time >= _future}; i need a delay in this function and using spawn isnt an option.

indigo snow
#

im also not sure why you wrap it inside a call

#

why isnt using spawn an option? Otherwise you simply can't suspend, you stay in a single frame

#

unless you use CBA

exotic tinsel
#

becaue i have to call another function that spawns in a compostiion and it throws tons of errors when i call my func with spawn

indigo snow
#

then solve those

#

spawn simply shows you errors non-scheduled ignores

#

they have to do with nil

exotic tinsel
#

would rather not mate, its a whole library of code that i didnt write.

indigo snow
#

Then you cant suspend unless you use CBA

#

(as an aside, not seeing the errors doesnt mean theyre not there...)

exotic tinsel
#

ok so spawn is being used and im getting the error "error generic error in expression". here is the line of code its complaining about.

#
_future = time + 10; waitUntil {time >= _future};
still forum
#

please post the full error

#

You are most likely not getting a "generic error"

#

It always shows that. Right next to the actual error

exotic tinsel
#

if i take that bit of code out on the line it complained about i dont get an error.

indigo snow
#

We can't solve it from what you've shared

exotic tinsel
#

how to do i share a photo?

indigo snow
#

dont share photos

#

copy the error from your log

exotic tinsel
#

let me find out where that is

halcyon crypt
#

%userprofile%\AppData\Local\Arma 3 put that in explorer or the run dialog thingy ❤

#

or start menu search even I guess

indigo snow
#

look for the most recent .RPT file

#

itll contain all errors, relevant code lines, and the exact command or value where it errored.

exotic tinsel
#
17:30:29 Suspending not allowed in this context
17:30:29 Error in expression <


_future = time + 10; waitUntil {time >= _future};
[false] spawn TLS_fnc_nextm>
17:30:29   Error position: <>= _future};
[false] spawn TLS_fnc_nextm>
17:30:29   Error Generic error in expression
17:30:29 File TLS\functions\Server\fn_missionspawnfunc.sqf [TLS_fnc_missionspawnfunc], line 82
indigo snow
#

Suspending not allowed in this context

#

i think you already know what the solution to that is

exotic tinsel
#

i used spawn

indigo snow
#

you didn't, didn't save, or used call somewhere else

exotic tinsel
#

ok let me dig more

#

thx

indigo snow
#

you used spawn in the next line though

halcyon crypt
#

huh since when does the rpt include the final function name thingy?

indigo snow
#

every preprocessed file i think

halcyon crypt
#

never seen it 😛

indigo snow
#

oh you mean before the line number?

halcyon crypt
#

yeah the thingy between the brackets

indigo snow
#

yea never noticed that, probably a feature from the cfgFunctions framework

#

they inject extra headers into the function iirc

exotic tinsel
#

yay, it worked, needed to back out to editor to reload the .sqe files.

#

thx guys

barren magnet
#

yes they do if you do not disable it with headertype=-1;

halcyon crypt
#

interesting, is this new though?

indigo snow
#

couldn't tell you, sorry

austere granite
#

no its real old

#

the headtyper stuff

#

it shows scirpt name if you set scriptName in functions

halcyon crypt
#

maybe it has just been too long since I've had A3 open ^^

still forum
#

@halcyon crypt function name in rpt is the scriptName SQF commands stuff.
CfgFunctions sometimes adds that automatically ... sometimes not..

#

Oh. too late

hushed minnow
#

Uhm, just a question, how many scriptors here use Git or other SVC tools?

indigo snow
#

loads

still forum
#

Many.

#

How many? Many.

#

¯_(ツ)_/¯

hushed minnow
#

would it be okay to ask about workflow here?

still forum
#

ACE/CBA use feature branches. Always stable build in master branch. And a release branch for releases

indigo snow
#

we merge into a dev branch which gets tested and then merged into master

#

generally

halcyon crypt
#

we just throw everything in master and pray it still works 😁

austere granite
#

Use git

#

and use Gitkraken with it if you're a really prop erson right @lone glade

still forum
#

For Intercept I keep a seperate dev branch that get's feature branches merged into it while they are being worked on and eventually just get's reset to master branch when all feature branches are done

#

messy. Don't do.

hushed minnow
#

I've been using git for a while now, and when I started on DUWS-R, I forked it but now its been about 2 years since i've been on the dev team but im still working on my fork, should I stay on my fork and pull from there or work directly on the organisations main line?

indigo snow
#

you should ask them, really

hushed minnow
#

well...... I'm kinda the only dev left active....

indigo snow
#

seems mostly an etiquette thing, then

still forum
#

Well... If they let you work directly on the main repo then do that 😄

indigo snow
#

could always maintain in one place and PR every once in a while

hushed minnow
#

👍

exotic tinsel
#

ok, so since i converted to using "spawn" to call my function im getting diff errors. this is the message

#

17:54:56 Error +: Type Script, expected Number,Array,String,Not a Number

#

this is the line

#

_v_endtask = _v_missionname + "_EndTask";

#

what am i doing wrong?

indigo snow
#

_v_missionname is type SCRIPT ( {code} iirc ), you cant add that with a string

#

on nil

#

expected number, not a number means somethign doesnt have the value you expect it to have

still forum
#

No. CODE is code

#

Script is handle returned by spawn

#

so _v_missionname = [] spawn ...
somewhere

indigo snow
#

yea wasnt sure on that one, been a while

exotic tinsel
#

yeah _missionname is a string

indigo snow
#

not anymore it isnt

#

spawn doesnt return values

#

it returns a script handle

still forum
#

Where do you get that variable from?

exotic tinsel
#
_v_endtask = "";
_v_missionname = "";
// requires task names be mission 
_v_delimiterloc = (_v_taskid find "_") - 1;
_v_length = count _v_taskid;
_v_missionname = [_v_taskid, 0, _v_delimiterloc] spawn BIS_fnc_trimString;                
_v_endtask = _v_missionname + "_EndTask";
still forum
#

Yeah

exotic tinsel
#

thats the whole bit

still forum
#

Use call

#

No reason to spawn that

#

besides that spawning that just doesn't work at all

exotic tinsel
#

well i was told to use spawn when calling a function that i need to have a delay in

still forum
#

Yes

#

You need to have a delay inside BIS_fnc_trimString?

indigo snow
#

i might have needed to explain a bit more comprehensive when i said to use spawn: you only need to use it in the root bit , subsequent calls are fine from within the spawned code

still forum
#

You modified a vanilla function that doesn't need a delay to function just so you could have a useless delay?
Don't tihnk so

exotic tinsel
#

no but in the function that code is in

indigo snow
#

spawn { sleep; call {sleep}} is fine, no need to replace all calls

still forum
#

You need to spawn functions that want to suspend

#

suspend aka Sleep/waitUntil

#

As longs as the function that suspends is scheduled it's fine

#

Even if you call inside a spawned function it is still scheduled so sleeping in there is fine too

umbral oyster
still forum
#

Instead of posting a screenshot with minimal information you could also link the wiki page and say what you want

umbral oyster
still forum
#

Thanks for the next basically 0 information screenshot

#

You can't get it via script

#

and you don't need it

umbral oyster
#

No, I need to get this information, I would not ask if it would not be necessary

still forum
#

Why do you need it?

umbral oyster
#

for RCON

still forum
#

Oh. Then it's impossible

#

Can I now tell you alternative ways to do this

#

or do you just not care?

umbral oyster
#

bcs cmnd kick not working with GUID, name or UID

still forum
#

Wiki says it does though

#

In RCON just use #userlist then you get ID+Name+UID.

#

Then just search user by name or UID and then grab the ID from the table

austere hawk
still forum
#

@austere hawk You have a syntax error at line 157. The cookie in your metavariablearray is one too high. You need to decrease the index by if (_index == 1) then {1} else {1}
And then it should work

meager heart
#

If not try this ༼ つ ͡° ͜ʖ ͡° ༽つ fix

austere hawk
#

but the file i stole from someone else clearly says decrease index by -2

still forum
#

It's good that you didn't ask your very specific question in some life forum. here is definetly the perfect place to get help with that

austere hawk
#

but then they would know i haxored their files...

willow haven
#

Hey does anyone know how to make VR entities in the editor?

#

I have some VR entities with the init "[this, 10] call bis_fnc_VRHitpart;"

#

which works for showing the damage, but the time is totally broken

#

the number is supposed to tell it to reset the colors but it doesn't work

#

so I can either disable simulation so they remain standing but this doesn't help because the colors don't reset

#

or I can enable simulation so they fall and die like normal, but what I really need is for them to respawn then just like they do in the VR arsenal

#

so that it forces the hit zones to reset like they should

#

anyone know how I can acheive this? I found nothing online

river meteor
#

If I want to save the player's inventory into a database, what is the easiest command to use to gethe player's inventory?

robust hollow
unborn ether
#

@willow haven Gonna try this myself sometime, good stuff you want to do.

willow haven
#

Yeah, I'm making kavala into a target range and I was initially using just pop up targets (and some skeets that explode when you shoot them)

#

but now I want some fancier stuff

#

especially since I can't get moving targets to work

#

the rails I mean

#

but I've never done SQL so

obtuse cosmos
fluid radish
#

is there a way to get the id of a client executing a server function via remoteExec?

river meteor
#

@fluid radish you can send clientOwner as an argument

fluid radish
#

I guess I could, but then I'd be trusting the client to identify itself - is there some sort of magic variable/parameter passed to remote functions instead?

obtuse cosmos
fluid radish
#

that's exactly what I was looking for, thank you @obtuse cosmos

obtuse cosmos
#

np

#

Read the comment on that page btw

blazing quiver
#

Hey, is there a script that would spawn a placable door as open instead of closed? Open doors module is not working.

#

From google I'm seeing a lot of vehicle door stuff but what I'm looking to use is basically a sliding bulkhead door from a mod

obtuse cosmos
#

@warped thistle use the animate command

blazing quiver
#

thank you, will take a look

cerulean whale
#

Anyone know why my gesture (animation) works in singleplayer but not multiplayer?

obtuse cosmos
#

did you broadcast it ?

#

do you see it or is it other people don't see it but you?

cerulean whale
#

it just won'

#

won't load*

obtuse cosmos
#

show me your code?

cerulean whale
#

like no animation on either screen

obtuse cosmos
#
// show code
cerulean whale
#

noone, even the client executing it can see it: SQF player playAction "Foski_Gesture_handsUp"

#

it's my friends one but he aint on and I was integrating it via script

obtuse cosmos
#

you just want hands up ?

cerulean whale
#

it's a custom gesture, can walk around and such

#

and it's happening with all my other gestures as well for some reason

obtuse cosmos
#

let me try

#

1 sec

#

where did you get "Foski_Gesture_handsUp" from ?

#

Note: Not all of these work btw

#

@cerulean whale You said you can move with hands up? Or stand still like:

cerulean whale
#

dw I fixed it

#

config issue for some reason

obtuse cosmos
#

you got it working?

#

with that animation?

cerulean whale
#

yer

obtuse cosmos
#

show fix?

cerulean whale
#

yeah 1 sec lemme just reload my game lmao xD

obtuse cosmos
#

rgr

#

you can walk around with hands in air?

#

😮

#

or is it like, static?

#

LMFAO

#

that is so funny!

#

These are new, right? From Laws of War DLC I assume...

unborn ether
#

@obtuse cosmos No thats not coming from that DLC. That animation is called "Acts_CivilIdle_1" and were in arma since alpha i think.

#

@obtuse cosmos And yes, you can move like this.

obtuse cosmos
#

lmao

#

never ever saw this 😄

#

are the panic animations new?

#

or did they just add category for it in Anim Viewer?

subtle ore
#

They were in there for a while

#

even before LoW

obtuse cosmos
#

since Laws of War?

#

oh

#

don't recall seeing them in changelog

subtle ore
#

¯_(ツ)_/¯

obtuse cosmos
#

How come the animations behave differently? ```sqf
player switchMove "Acts_CivilIdle_1";

#

I can move

#

With playMoveNow, I can't but, it isn't the same

subtle ore
#

They don't behave differently, they're a blend of animations

#

so that you don't have a new anim for each type of movement

#

Well, seperate that is

obtuse cosmos
subtle ore
#

Think of it like a statemachine:
Moving left? -> Transition to left
Moving Right? -> Transition to right

obtuse cosmos
#

oh

#

switchMove freezes it?

#

or something?

willow haven
#

anyone know how to do it?

obtuse cosmos
#

Do what? @willow haven

willow haven
#

scroll up a bit

subtle ore
#

How do ou mean Haz? playMove places anim in qeue

unborn ether
#

@obtuse cosmos If you want to interrupt it you need to

player switchMove "";
obtuse cosmos
#

yeah

#

I know that

#

but I mean, when I do: ```sqf
player playMoveNow "Acts_CivilIdle_1";

#

it doesn't look liek the same aniamtion at all

subtle ore
#

try playmove isntead, you could be breaking something

obtuse cosmos
#

okay

#

with playMoveNow

#

playet stands, hand on neck

#

idle

#
player playMove "Acts_CivilIdle_1";
#

same as playMoveNow

subtle ore
#

Surrender?

obtuse cosmos
#

no

#

switchMove is surrender

#

with that animation class

willow haven
#

@obtuse cosmos ill just repost it

#

Hey does anyone know how to make VR entities in the editor?
I have some VR entities with the init "[this, 10] call bis_fnc_VRHitpart;"
which works for showing the damage, but the time is totally broken
the number is supposed to tell it to reset the colors but it doesn't work
so I can either disable simulation so they remain standing but this doesn't help because the colors don't reset
or I can enable simulation so they fall and die like normal, but what I really need is for them to respawn then just like they do in the VR arsenal
so that it forces the hit zones to reset like they should
anyone know how I can acheive this? I found nothing online

obtuse cosmos
#

@willow haven what do you want exactly?

#

Use extDB3

#

ooh

#

I didn't see that question...

#

let me check Wiki for you @willow haven

willow haven
#

I tried, but maybe you'll have better luck

#

really it would be fine if the hit zones reset like they should

obtuse cosmos
#

they are still damaged

willow haven
#

otherwise I need them to respawn just like in the VR arsenal

obtuse cosmos
#

you could use Hit EH to reset?

#

or is it suppose to do that itself?

willow haven
#

Description:
Initialize hit effects on VR targets

  • grey - undamaged
  • orange - damaged
  • red - destroyed

Parameter(s):
0: OBJECT
1 (Optional, default is 30): NUMBER - delay before hit parts are returned back to default

Returns:
NOTHING

obtuse cosmos
#

it works for me

#

but when hit

#

the colour stays

willow haven
#

so it should disappear after 30 seconds I assume

obtuse cosmos
#

oh

willow haven
#

yes it works

obtuse cosmos
#

AH

willow haven
#

but I need it to then stop working

#

else I need to have the dummies respawn like in the arsenal when they respawn right there in the same position

#

I'm making a target range, but it's going to suck if the targets break after one shot you know

obtuse cosmos
#

odd

#

not sure why it doesn't reset?

willow haven
#

it should

#

it has it by default, and has its own function

#

although..

#

come to think of it you never see it reset on the dummies in the arsenal, but it does reset on the VR target vehicles

#

so maybe it only works on them?

obtuse cosmos
#

ah

willow haven
#

but in that case I definetly need a script to have them respawn in place and remove bodies

#

i have no idea how to do that