+1 noticed this too
- Queries
- Arma 3 Activity
- All Stories
- Search
- Advanced Search
Advanced Search
May 10 2016
new commands :
https://community.bistudio.com/wiki/deleteAt
https://community.bistudio.com/wiki/deleteRange
https://community.bistudio.com/wiki/select (extended)
take care of this ticket too, resoved!
You can walk back and forward when inventory is open, look up how it is done.
Closing as per request.
nearestObjects https://community.bistudio.com/wiki/nearestObjects does, and the example is right there on biki:
nearestObjects [player, [], 50];
It is simple, distance to a tree is measured to its centre, which is about half way up the trunk. So to detect tall trees you need to increase detection radius.
I don't think you can get ASLW value at position at the moment, without placing an object there.
Still not sure what you need. If you want to know the delta wave height then:
((asltoatl getposaslw boat) vectorDiff (getposatl boat)) select 2
Sounds familiar :) There is also getTerrainHeightASL that takes x and y and gives you z, you might want to use that too then. Again, without knowing exactly what you are doing, I would be just guessing, so I leave it up to you.
Try this, I wrote this quite sometime ago to substitute modelToWorld
KK_fnc_offsetFront = {
_newPos = [_pos,_dir,_offset] call KK_fnc_offsetFront;
private ["_pos","_dir","_offset"];
_pos = +_this select 0; copy
_dir = _this select 1;
_offset = _this select 2;
_pos set [0, (_pos select 0) + ((sin _dir) * _offset)];
_pos set [1, (_pos select 1) + ((cos _dir) * _offset)];
_pos;
};
_newPos = [getPosASL boat, getDir boat, 25] call KK_fnc_offsetFront;
What are you trying to do?
(boat modeltoworld [0,0,0]) vectorDiff (getposASLW boat)
produces [0,0,constant z]
Are you using mods? Just tested it on dev, the model is correct.
Changelog says it is fixed?
[B]closing[/B] [COLOR="#FF0000"]here[/COLOR]
Yep, fixed.
Limit init to the server
init = "if (isServer) then {...your code...}";
or
init = "if (!isServer) exitWith {}; ...your code...";
It is not a bug because there is no provision for all controls, just a particular one. I can change this ticket to Feature Request for you
After further investigation, CONTROL is limited to map control, and not just any map but static editor map control, whatever this is. So not a bug really, just useless functionality.
Confirmed. It is supposed to work:
"b:NAMESPACE setvariable ARRAY"
"b:CONTROL setvariable ARRAY" <= here
"b:OBJECT setvariable ARRAY"
"b:GROUP setvariable ARRAY"
"b:TEAM_MEMBER setvariable ARRAY"
"b:TASK setvariable ARRAY"
"b:LOCATION setvariable ARRAY"
But it doesnt
Marked resolved on author's request
Some update to map markers today, any chance to fix duplication described in this ticket?
The marker id only changes when user leaves server, if he drops to the lobby and back id is the same
Strange, I could swear markers do not change size at all. Just tested, always the same size regardless of zoom.
Edit: unless you mean ellipse and rectangular marker?
Works for me. Have you got a detailed repro?
same on dev 1.26
Executing repro on dedicated server does not mess up the inventory. Seems client execution messes up server and not vice versa
Also, when changing uniform to another uniform and not the same class, new uniform can get corrupt in such way that when putting an item in it via inventory GUI, the item disappears on client too and of course never gets added on the server as well.
Confirmed. Server starts having own idea about items in uniform.
To add, this happens in scheduled environment too.
Yep, wind is fixed, but local ambient life doesn't accelerate (butterflies in the night), but this is minor and happens on crazy setTimeMultiplier 600.
what is not minor is setTimeMultiplier 0; practically freezes the game. It does not crash but becomes very very unresponsive.
+1, although setting wind [0,0,true] didn't help
also driver get in option is available at 9 metres
@mickeymen the link is in the description of the video
"They could very well be empty"
@Goomer your argument is invalid. The barrel doesn't explode, period. Doesn't matter what you throw at it, or shoot at it, you can even set fire on it, it will not explode.
Nah, makes no difference:
arr = [0,1]; arr select random 1;
3 attempts 10000 iterations each
1 / 4987
0 / 5013
1 / 5063
0 / 4937
1 / 4874
0 / 5126
arr = [0,1]; arr select round random 1;
3 attempts 10000 iterations each
1 / 4958
0 / 5042
1 / 5046
0 / 4954
1 / 5002
0 / 4998
EDIT: Also you are right about half the apearance, but it makes no differenc eif you round or not:
with round
2 / 2478
1 / 4931
0 / 2591
without
1 / 5065
0 / 2489
2 / 2446
Edit: floor on the other hand does make it more even, but not sure if this really needed for shuffle operation. It might make it too predictable like for example "if such and such combination is close to 30% the chance of it appearing is greatly reduced". Those functions from Master85 give pretty subtle deviation +- 30%
@JSharpe I've run the actual tests "select round random" is no different to "select random". select floor random is different (see the edit)
@Master85 Thanks for pointing out the flaw *facepalm* Was very simple fix. I've optimised Fisher-Yates a bit so it is now even shorter, probably the fastest now:
KK_fnc_arrayShuffleFY = {
_this = [[+_this], 0, [], [[]]] call BIS_fnc_param;
private ["_el","_rnd"];
for "_i" from count _this - 1 to 0 step -1 do { _el = _this select _i; _rnd = random _i; _this set [_i, _this select _rnd]; _this set [_rnd, _el];
};
_this
};
What about my variant :)? It is at least 4 times faster than the original and even has shuffle strength param http://killzonekid.com/arma-scripting-tutorials-arrays-part-4-arrayshuffle/
Repro?
With new commands you can simply
reverse arr;
arr pushBack el;
reverse arr;
Done
However when japa comes from holiday, maybe he can add pushFront? It is a cpp method so why reinvent a wheel?
addWeapon
This is what I had in mind. I pretty sure there has to be substring method in A3
strSubstr
STRING = STRING strSubstr ARRAY;
ARRAY - [start, stop]
Extracts the characters in a string between 'start' and 'stop', not including 'stop' itself.
"Hello" strSubstr [1,4]; ell
When only one param specified, substring is extracted from 'start' to end.
"Hello" strSubstr [2]; //llo
IMO substring command would do what you want and more. Ive privately asked for it already, but no guarantees of course.
Duplicate of #4351
You can already use restricted uniforms with a bit of scripting https://community.bistudio.com/wiki/forceAddUniform
Sorry, the video was private instead of unlisted for some reason
findDisplay 46 displayAddEventHandler ["JoystickButton", {hint str ["joystick", _this]}];
Huh! There is also no "JoystickButton" event handler in A3, great!
Resolved in todays Dev
+1 = 37 up
Marked resolved on author's request
Ok, thanks .kju, it is now on 1.26, so going to resolve it.
@MadDogX could you elaborate on reopening?
If there is a problem with pushBack command, an explanation and possible repro is needed.
New push command is 60 times faster than array + array! Mission complete!
Oh and attached code was to demonstrate suspension that can occur in the middle of the script, real problem is reliable and fast add to the back of array
@japa you are the best! Only why push_back? Can we call it pushBack to keep with naming convention? It is explicit name so I'm fine with it, although array commands I've encountered like in perl etc were push, pop, shift and unshift. pushBack is ok too (if you are planning on adding pushFront ;))
@Druid. I've just run a small test to demonstrate how bad is array + array and why we need fast push command. Try it yourself. It basically iterates 10000 times so you end up with 10000 element array at the end. Note the set variant has 2 command as well, imagine how fast would be dedicated push:
arr = []; ['arr set [count arr, 0]'] call bis_fnc_codePerformance
my result: 0.0046ms
arr = []; ['arr = arr + [0]'] call bis_fnc_codePerformance
My result: 0.1586ms
34 times the difference!
The array + array is much slower operation than set and count together, and with large arrays it is very slow. in shcheduled environment when you only have 3ms window before the suspension, any gain in speed of every individual command you can get matters a lot. And yes i dont see why adding to array wouldnt solve this particular problem, but as i said at the cost of performance.
I'm not sure I understood your last comment. Length of "assigned vehicle role". It is always 1 unless it is a turret, then it has path so it is 2. What exactly did you mean by that?
Great, now I have absolutely no clue what it is all about.
unit can have assigned role but not be inside a vehicle
player assignAsCargo heli;
hint str [assignedVehicleRole player, vehicle player != player]; //[["Cargo"], false];
^^^ not in vehicle yet assigned as Cargo. Same goes for assignedCargo
Assignedvehiclerole has very little to do with actualnunits in cargo, even more so with cargo index of a unit
Related to #19435
Are you on stable? On dev it works with override.
What a waste. Command has been removed, this ticket can now be closed.
I think a proper sheduler where you can insert timed tasks one off or repeating would take care of many things. Then you can cue any object for deletion alive or dead. You should be able to add scripted task and remove it. addScriptedTask [interval, boolrepeat, code] returns id of then task for removal. Maybe even add it to an object? obj addScriptedTask?
Just spoke to dwarden and it sounds like having weaponholders added to the collector is not a bad feature, to remove dropped items after some time. Will need a bunch of description ext params though, holderxxxxmaxtime etc.
Also I have a question to George. How difficult this would be to add event handler "collectorDeleted" to fire when unit or vehicle is removed. Would make respawning scripted vehicles very straight forward as well as will help to dynamically adjust mission events. Example destroy tank. After tank burnt for a bit it gets collected and either new tank is spawned instead or new mission task added, all right from event handler.
I'm curious as well to what kind of objects would benefit from disposal collector. Adding buildings to it makes 0 sense as disappearing ruins would look really weird. Small (empty) objects? Many get deleted upon death anyway. So what exactly do you have in mind SilentSpike?
vehicles and units placed in editor are included by default. it is those that are dynamically spawned after mission start need to be added.
removefromremainscollector
isinremainscollector
addtoremainscollector
George is the man!
Please add global command
addToDisposeManager obj
To take care of vehicles and units
Thank you Druid and Iceman, all AIs are now deleted when vehicle is deleted, no more FPS dropping.
Unfortunately, this issue is not solved. Here is the video after the fix:
http://www.youtube.com/watch?v=KKGbtb4AMKs
What changed is that the unit may (or may not) get pushed when uav is colliding with the unit. TBH this change doesn't make it better... well, maybe even worse, sorry dude :(
What expected is
- EpeContact type event handler attached to UAV to fire when UAV collides with the unit. Currently this doesn't happen at all.
- UAV bouncing off unit like it was an obstacle and possibly getting damaged (optional as it can be done with EpeContact EH if it is fixed)
After more testing what happens is when UAV is colliding with a unit, the damage to the unit is registered from "B_UAV_AI" which is the driver and not the craft. This is why EpeContact never fires for the craft, and if EH is assigned to the driver, it also doesn't fire as AI driver seems to get 0 damage.
Made a workaround based on the above, but this solution is far from ideal: http://www.youtube.com/watch?v=NLrLerlb3lo
In my tests uav is flawn by AI, this is why it might be different. Just createVehicleCrew for empty uav and set velocity towards target. In your tests, does uav push unit? Id rather prefer to go back how it was before as new behaviour looks a bit silly and also I found workaround.
It would help if you could explain what you attach the action to and under what circumstance the action is suppose to show. Throwing a bunch of code with no repro or explanation is not going to help anyone.
After a few hours, all dead vehicles:
[
2349d0c0# 166163: uav_01_f.p3d,
234a50c0# 166166: uav_01_f.p3d,
234a6080# 166169: uav_01_f.p3d,
239d8100# 166184: hatchback_01_f.p3d,
23978100# 166185: hatchback_01_f.p3d,
23936b00# 166186: hatchback_01_f.p3d,
238d0100# 166203: uav_01_f.p3d,
23900100# 166206: uav_01_f.p3d,
239c0100# 166209: uav_01_f.p3d,
18277040# 166212: uav_01_f.p3d,
182750c0# 166215: uav_01_f.p3d,
18223040# 166218: uav_01_f.p3d,
182210c0# 166221: uav_01_f.p3d,
1817b040# 166224: uav_01_f.p3d,
181790c0# 166227: uav_01_f.p3d,
23903040# 166232: uav_01_f.p3d,
180fd0c0# 166238: uav_01_f.p3d,
18276080# 166243: uav_01_f.p3d,
17f3b040# 166248: uav_01_f.p3d,
17f0a080# 166253: uav_01_f.p3d,
17f08100# 166264: uav_01_f.p3d,
11fd6080# 166273: uav_01_f.p3d,
18701600# 166415: hatchback_01_f.p3d,
18e4c100# 166419: hatchback_01_f.p3d,
18f81600# 166420: hatchback_01_f.p3d,
19369600# 166421: hatchback_01_f.p3d,
1934ab00# 166422: hatchback_01_f.p3d,
19349600# 166424: hatchback_01_f.p3d,
19f87040# 166641: uav_01_f.p3d,
19f86080# 166648: uav_01_f.p3d,
19f84100# 166659: uav_01_f.p3d,
1a067040# 166670: uav_01_f.p3d,
1a066080# 166681: uav_01_f.p3d,
1a0650c0# 166696: uav_01_f.p3d,
1a064100# 166707: uav_01_f.p3d,
19996080# 166717: uav_01_f.p3d,
199950c0# 166731: uav_01_f.p3d,
19994100# 166743: uav_01_f.p3d,
1a832080# 166757: uav_01_f.p3d,
1a833040# 166772: uav_01_f.p3d,
1a830100# 166786: uav_01_f.p3d,
1a8310c0# 166798: uav_01_f.p3d,
1a70a080# 166815: uav_01_f.p3d,
1a70b040# 166826: uav_01_f.p3d,
1a7090c0# 166836: uav_01_f.p3d,
19997040# 166846: uav_01_f.p3d,
19ab6080# 166860: uav_01_f.p3d,
19ab50c0# 166870: uav_01_f.p3d,
19ab7040# 166880: uav_01_f.p3d,
1a708100# 166890: uav_01_f.p3d
]
not one is removed
This ticket is almost resolved. The only issue left is that UAV wrecks start smoking again for JIP after the initial smoke ended.
So I've made about 20-25 UAV wrecks and logged out, logged back it and FPS went to 15 from 50. A) the wrecks do not get removed, B) each of them starts smoking at once on log in. This is a disaster.
@Koala you're right it was set to 20. This current shadow implementation is far from OK. I have made a cumulative ticket on all shadow problems. http://feedback.arma3.com/view.php?id=19311 This one can be closed.