The attached mod adds two small stargates to binary systems. They are placed between 40 and 70 ls from the centre of the each star. Using 'objSetPos' the player can instantly travel between the two gates.
But there is a possibility that the gates will be placed where a station already exists.
I've tried
Code: Select all
exclusionRadius="40"
Code: Select all
<Encounter
exclusionRadius= "100"
>
</Encounter>
I don't mind if the gates are close to other stations but having them overlap or be completely hidden isn't desirable.
Is there another way to stop station overlap? Or am I doing it wrong? Any help greatly appreciated.
This is the code for adding the gates:
Code: Select all
<OnGlobalSystemCreated>
(block (listOfStars firstGate secondGate)
(setq listOfStars (filter (sysFindObject Nil '*) theObj (eq (objGetProperty theObj 'scale) 'star)))
(if (eq (count listOfStars) 2)
(block Nil
(setq firstGate (sysCreateStation &stD789SmallStargate; (sysVectorPolarOffset (@ listOfStars 0) (random 0 360) (random 40 70))))
(objSetName firstGate (cat (sysGetName) " Gate 1"))
(setq secondGate (sysCreateStation &stD789SmallStargate; (sysVectorPolarOffset (@ listOfStars 1) (random 0 360) (random 40 70))))
(objSetName secondGate (cat (sysGetName) " Gate 2"))
)
)
)
</OnGlobalSystemCreated>