Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
Toasticuss

Help with a randomization

Recommended Posts

No, but the point was to have three possible places where the bomb would be right? The player having to choose from them to find it? If you set the destination to the actual location of the bomb, there's no choice, you already know where it is and the other two places you never have to check.

Unless I'm misunderstanding the point of this that is. :)

Share this post


Link to post
Share on other sites
No, but the point was to have three possible places where the bomb would be right? The player having to choose from them to find it? If you set the destination to the actual location of the bomb, there's no choice, you already know where it is and the other two places you never have to check.

Unless I'm misunderstanding the point of this that is. :)

I think I confused you guys with my taskname, it actually isnt a bomb its a weapons cache. The task will only activate if a player will walk near it so its all good. The way point goes right to the cache in its random location.

What you do in the task is blow it up with a satchel charge.

Share this post


Link to post
Share on other sites

Ok sure, but you want to have one task to blow up a cache, in three possible locations, and want all three locations to have a task destination or waypoint attached. Right? You can't do that with a single task.

You could have three tasks, any one of which would remove the other two tasks upon completion, or you could simply put markers and have no destination/waypoints and rely on player intelligence to get them where they need to go.

Personally I'd go with one task, no waypoints, three markers. :)

Share this post


Link to post
Share on other sites
Ok sure, but you want to have one task to blow up a cache, in three possible locations, and want all three locations to have a task destination or waypoint attached. Right? You can't do that with a single task.

You could have three tasks, any one of which would remove the other two tasks upon completion, or you could simply put markers and have no destination/waypoints and rely on player intelligence to get them where they need to go.

Personally I'd go with one task, no waypoints, three markers. :)

Lol what gave you the idea I would make 3 task destinations.

I did what you said the first time, I have one task and I am using

"tskbomb setSimpleTaskDestination getpos cache;" for the markers, it will dynamically move to where the cache is spawned to and it works great.

What could I do if I wanted to add more then one cache but still have the same objective?

Edited by Toasticuss

Share this post


Link to post
Share on other sites

In your trigger for checking for completion of the task:

damage cache > 0.7 AND damage cache2 > 0.7

Share this post


Link to post
Share on other sites

I've been using this script for randomising some positions:-

pos = _this select 0;

_Dist = _this select 1;
_Dist2 = _this select 2;

_posX = ( _pos select 0);
_posY = ( _pos select 1);

_Dist = _Dist + random _Dist2;

_Angle = random 360;

_posX2 = _posX + _Dist * sin _Angle;
_posY2 = _posY + _Dist * cos _Angle;

_newpos = [ _posX2, _posY2];

_newpos 

Save it as an .sqf. It takes a position, min/max distances changes it and returns the new position. Access it using a line like this:

rndPos = compile preprocessFile "randomposition.sqf";
_newpos = [<position> , <minimum distance>, <variablility beyond>] call rndPos;

or just

_newpos = [<position> , <minimum distance>, <variablility beyond>] execVM "randomPosition.sqf";

Share this post


Link to post
Share on other sites
In your trigger for checking for completion of the task:

damage cache > 0.7 AND damage cache2 > 0.7

Thank you

---------- Post added at 07:51 AM ---------- Previous post was at 07:04 AM ----------

EDIT: Okay, I guess I was wrong about the specific unit randomization.

He is not moving to the correct coordinates for the marker. Any ideas on whats wrong?

Share this post


Link to post
Share on other sites
Sign in to follow this  

×