-
Content Count
2494 -
Joined
-
Last visited
-
Medals
Posts posted by sarogahtyp
-
-
Example:
if ( [player, "VIEW"] checkVisibility [eyepos santaClaus, eyepos player] > 0) then { hint "He sees you!"};
And compared to lineIntersects, it's much faster to execute.Thank u very much for your explanation. I tested both commands and measured 1000 runs via diag_tickTime and my result for my specific case was that lineIntersects runs about 2 times faster than checkVisibility.
checkVisibility had values between 0.2 - 0.25 ms as sum of 1,000 runs
lineIntersects had values between 0.08 - 0.15 ms as sum of 1,000 runs
I think playing around with checkVisibility could be interesting with smoke and such things but i ll test that.
EDIT:
I compared that line
if ( [_looker, "VIEW"] checkVisibility [(AGLtoASL (_looker modelToWorldVisual (_looker selectionPosition "gunner"))), (getPosASL _target)] < 1) exitWith {false};
with this one
if (count (lineIntersectsSurfaces [(AGLtoASL (_looker modelToWorldVisual (_looker selectionPosition "gunner"))), getPosASL _target, _target, _looker, true, 1,"GEOM","NONE"]) > 0) exitWith {false};
just in case if i made a measuring mistake with those lines just tell me, please.
EDIT again: I did a cleaner test now in VR with one man and one cargo box only with a distance of 1,000 meters.
The difference is not so much now.
I reapeated the code 10,000 times now therefore the time for both is higher.
checkVisibility took about 0.6 ms
lineIntersects took about 0.4 ms
next EDIT:
I did some tests with checkVisibility and smoke now and it seems that the return value is never reaching 0.6 even if the objects are close together and without smoke.
If u pop smoke then the return value falls rapidly near zero. I tested only the case when the objects are close together (1-20 meters).
For that distance i think 0.001 could be a good value to decide if u can see through the smoke or not. everything above 0.001 means you have a good view.Last EDIT in this post:
After testing a lot more in a real scenario on altis i m totaly confused about the return value of checkVisibility.
I dont know how to decide if something is smoked. the only thing what I know that u have a LOS if the return value is above zero.
-
I like that idea but i think its not done.
Last time i studied a lift script was in arma2 domination mission. there it was done with attachTo command and i think u need some complete different here.
At that time I wanted to modify the lift script to get a more realistic behavior when transporting vehicles. I never finished that but I came to a point where I needed to do relative rotations for the lifted vehicle.
Maybe that you will get at this point too and therefore im posting this.
Here is a link to a post where is described how to rotate things as you like with tensor manipulation:
https://forums.bistudio.com/topic/103137-stop-ai-pilot-from-diving-at-start/#entry1730932
-
Hey man, your bumping up old threads like hell with the same post again and again.
If u ask me then that is very bad behavior. i try to help where i m able to but in this case ...
Your bumps in case u forgott:
EDIT: I m so sorry, I fogot that one: -
hey man, you are realy nice to me ... like this :-)
Edit: u saved hours for me if not days. I m very happy with that. Thank you very much.
-
checkVisibility or maybe lineIntersectsSurfaces
Thank you for your advice.
checkVisibility is work in progress and has no comments in biki it would be nice if someone could explain it.
lineIntersectsSurfaces seems to be good but is it only checking for surface intersections? what about objects? do I need to check with another Intersect command?
-
What I want to know is if there is a simple command to check if point A has a line of sight to point B ?
-
Ive been doing some more digging into the command. So far it looks like any client can execute the code specifying another player, however the animation itself is only displayed locally.
thats exactly what is described in biki.
this means that the Arguments of the command can be Global, in your case it means that _unit is not needed to be local on the machine which executes the command.
this means that the Effect of the command is seen Local only on the machine which executes the command.
just to clarify :-)
-
I say go for it. I would love to see more Manuals/Tutorials. I would actually pay for official DLC Tutorials from BIS. :P
The Wiki is great, and there are indeed plenty of resources, guides, forums, etc. But I say make a better wheel!
The best way to learn something, is to teach it. Go ahead. And as for where to start?... Start at the beginning!!
I m complety agree that post. i think the biki is one part of the wheel and not the whole one. i remind murray editing tutorial and some other wh9ch helped me to understand things better. even killzone kid who has a biki account is hosting a blog with good tutorials. the thing is that you cant learn a language if u read one book even it is as big as the biki.
go for it!
-
post ur script for getting em in the vec please. maybe we ll get it work.
Maybe this topic could help.
Main key for solving the problem was to assign driver, crew and vehicle to the same group. After that it worked.
-
sure I understand but its still quite odd that the helo just hovers over there and doesnt fly circles for example... after all its supposed to react to the enemy presence so why just stand still and not do combat maneuvering? (while waiting for the command to open fire...) that or following the waypoint is proper way to act IMO.
thats true but not a bug of those commands. its just bad behavior from the ai itself in the given situation.
if u need better behavior then u can try to find a suitable ai addon like vcom or asr ai. but most of them optimizing infantry combat i think.
you can also try to enhance the behavior by scripting sqf or fsm files.
-
thats it! it now works :)
i still think that its bit buggy behavior that the helo wont move when combat mode is BLUE. but its up to BIS to decide whether they'll fix this.
thats definetely not a bug its a feature.
As you can read in the wiki setBehaviour sets the general behavior of a unit/group independent from the fact if there are enemies nearby or not. Its just the setting how much they care about enemies. "Careless" means they dont care about any enemy.
setCombatMode is different from that cause it sets the rules of engagement. So it is the behavior in a combat.
If you set the combat mode to "BLUE" then it means that the ai has the order to not fire. But if the behavior is set to combat then they behave as if they could fire, looking for a good position to fire.
That makes sense if you want a squad to watch all angles for enemies and get a good fire position (setbehavior "combat") but let the enemy come near the squad (setcombat "careless").
And if the enemy is near enough kill em all (setcombat "yellow").
-
As far as I know, the low-level FSMs are not accessible to us. User-created FSMs for AI behavior have just as much (and just as little) precedence as scripted behavior; using the FSM format is more a matter of preference.
As far as I understand that article you can not only add own FSMs but modify some of BIs FSMs too.
That is a little more than run scripted behavior on ai only.
Are FSM's not executed in the non-scheduled though?
FSMs are running in a non-scheduled environment (see KKs blog) but I think you can spawn code in them in a scheduled environment, but I m not sure.
-
I should point out that he marker in question is an area marker, how do I define its dimensions?
- 1
-
i dont know if it helps and i ve not tested but it could be that scripted triggers are not affected by this issue. so you could try
createTrigger
-
you have do some more commands here.
unassignVehicle (maybe that command could be enough)
unitArray orderGetIn false; (forbids to get in again)
-
You could write a script which first stores all information (waypoints, behavior and so on) of all spawned units, then delete all that units and then spawn them as ur wanted type and give them their behavior from the prior stored information.
That script should run every few seconds to cover all newly spawned units.
Murklor did a script for arma 2 where u can look at to get an idea how to store all needed information:
Editor based AI script by trigger
There maybe an easier solution but thats what came in my mind.
-
-
we have a given example here with a specific class name string which should be compared. i cant see a difference between line 7 and 23 0f my code if _uav contains an array of class name strings. or is there a subtype of that class names?Not really, you can't compare 2 commands that do totally different things.
It just comes down to what you want to do.
isTypeOf (combined with an Array) is better when you only want to allow a specific selection of classes.
isKindOf is ideal if you want to limit to everything in a specific sub-category (all UAVs for example).
point that out please.
-
What are the advantages of iskindof, over typeof? :)
You could just measure it to decide it.
Kindly tell us what is faster,please
_typo_sum = 0; for "_i" from 1 to 1000 do { _typo_start = diag_tickTime; if ((typeOf _vehicle) in _uav) then { /*do nothing cuz we measure the time of the condition*/ }; _typo_time = diag_tickTime - _typo_start; _typo_sum = _typo_sum + typo_time; }; systemchat format ["typo time: %1 ms", (_typo_sum / 1000)]; _kindo_sum = 0; for "_i" from 1 to 1000 do { _kindo_start = diag_tickTime; { if (_vehicle isKindOf _x) then { /*do nothing cuz we measure the time of the condition*/ }; } forEach _uav; _kindo_time = diag_tickTime - _kindo_start; _kindo_sum = _kindo_sum + kindo_time; }; systemchat format ["kindo time: %1 ms", (_kindo_sum / 1000)];
-
Hey guys,
The Question is if it is possible to get a list of objects shown in vehicles radar?
The reason is that I am working on some little FSM scripts to enhance A.I. shooting from vehicles.
Until now I have a zu-39 tigris with this "Tigris Flak Conversion Script".
The vanilla ai begins to shoot only if the directly attacking plane (a10) has passed the tigris.
My FSM script enhanced that behavior and now tigris begins to shoot if A-10 is about 1.000 m away. Maybe I can optimize it some more.
Why I need that radar objects?
I want the tigris to target and shoot the A-10 only if it appears on the radar of tigris. -
deleteVehicle paramters need to be local to get it work.
there r some possibilities:
1. If player A spawns it then player A should delete it
2. if player A spawns it u can change the locality with setOwner (must called by server) to the one who should delete it (could be the server,too)
3. You can remotely execute the deleteVehicle command at that players machine which has spawned it.That was bullsh.. see next post.
-
Try this
if (_vehicle isKindOf _uav) then
I think that should not work cause _uav is an array of strings and not a single string as requested by isKindOf
I would suggest:
if (typeOf _vehicle in _uav) then
-
-
In this case i think u should provide much more info for the community.
AddAction bomb with sound
in ARMA 3 - MISSION EDITING & SCRIPTING
Posted
post ur script please and we are able to look for errors.