OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Robinhansen on 21 Feb 2005, 16:32:42

Title: Minefield
Post by: Robinhansen on 21 Feb 2005, 16:32:42
I've modyfied the Clusterbomb' n minefield script from SEFE a bit, so it only makes a minefield now.

looks like this:

Triggers init: ["MF", GetPos Player, 100, 200, 0] Exec ""ClusBomb.sqs"

and the script:
_Type = _this Select 0
_Pos = _this Select 1
_Radius = _this Select 2
_Bomblets = _this Select 3

_ThrowMines = FALSE
_MineRandomDir = TRUE
_Radius = _Radius^2

Goto _Type
Exit

#Loop2
   ? _i >= _Mines : Exit

   _Angle = Random 359.9
   _Distance = (Random _Radius)^0.5
   ? _MineRandomDir : _MineDir = Random 359.9
   _x = (Sin _Angle) * _Distance
   _y = (Cos _Angle) * _Distance

   _Mine = "Mine" CamCreate [(_Pos Select 0) + _x, (_Pos Select 1) + _y, 0]
   _Mine SetDir _MineDir

_i  = _i + 1

Goto "Loop2"

Exit

;Minefield
#MF

? (Count _this) > 4 : _MineRandomDir = FALSE; _MineDir = _this Select 4

_Mines = _Bomblets
_i = 0

Goto "Loop2"

Exit


The script places the mines randomly in a 100x100m minefield.

Is there a way to place them in a certain patteren?
 :D
Title: Re:Minefield
Post by: SilentHunter on 21 Feb 2005, 20:12:42
yes, using complex mathmatical constants, for example cos sin tan pi etc, what pattern do you intend to make, maybe i could set up a formula for you.
Title: Re:Minefield
Post by: PrejudiceSucks on 21 Feb 2005, 20:42:54
Or u cud use CoC mines instead, and have loads of them each with their own triggers (copied)
Title: Re:Minefield
Post by: Robinhansen on 21 Feb 2005, 22:19:45
I allready have the CoC mines, but the plan was to let an engineer beeing able from the action menu to create an anti tank minefield. ;)
I would be really pleased if you (SilentHunter) would set up a formular for me :D :D :D