[Script] Endless Adventures - Random Asteroid Belts

The place to discuss scripting and game modifications for X²: The Threat.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

Shanjaq
Posts: 353
Joined: Sat, 3. Apr 04, 09:47
x3

[Script] Endless Adventures - Random Asteroid Belts

Post by Shanjaq »

Update 1.2!

Dec. 10th, 2006
-Added Pirate Hideouts to some asteroid fields(beware, they're armed!)
-Asteroids will most likely appear in sectors that already contain asteroids(realism boost)



Want to take your ships out for a voyage into deep space to seek out new resources? Now there's a reason to own Video Enhancement Goggles and a Triplex Scanner!

Most sectors will have at least one additional asteroid field far outside the trade grid(between 100km and 400km), there may be more though. They are modest in size to minimize FPS penalty, most of the asteroids are low-yield Ore or Silicon, though a few juicy ones can be found, and there's even a rare chance to find some NVidium!

Some will have a nearby nebula, which may make them easier to spot. Feel free to mobile mine the low-yield 'roids or build isolated factory loops, it's up to you! Beware though, some will already be claimed by Pirates!

Get it here:

http://www.ihud.com/file.php?file=files ... eroids.zip


I highly recommend trying this with milling_hordesman's Hyperbolic Space Drive, which will cut down on flight time for your ships going to and from these distant objects:
MH_AdvJumper v1.72
Last edited by Shanjaq on Mon, 11. Dec 06, 04:26, edited 11 times in total.
[ external image ]
SPACE HAS A TERRIBLE POWER
Shanjaq
Posts: 353
Joined: Sat, 3. Apr 04, 09:47
x3

Post by Shanjaq »

Hmm.. Since the sector map doesn't zoom out far enough you might want to consider placing satellites in each asteroid field you find, just as a sort of navigational beacon so you can easily return to them later(with a TL perhaps?)
[ external image ]
SPACE HAS A TERRIBLE POWER
AdmiralTigerclaw
Posts: 2131
Joined: Mon, 27. Dec 04, 11:49
x4

Post by AdmiralTigerclaw »

Just scroll down the sector map object list for the asteroid, and hit T, and your target recticle will point you in the right direction.

And if you zoom in by one, the map will jump to the position, allowing you do to anything else you need. In example, using an MH AdvJumper command like Hyperdrive or Freejump.

Can The Man tell us how this script works?
Shanjaq
Posts: 353
Joined: Sat, 3. Apr 04, 09:47
x3

Post by Shanjaq »

Yeah, I could do that but it's more interesting this way, like mapping out your own discoveries in unexplored territory ;)


Well, the scripts are quite straightforward. One script handles the actual creation of an asteroid field, another script(the Setup script) loops through all the sectors and selects positions to execute the spawner script.

The spawner script has 3 parameters: Position, Density and Size(length, width and height are randomized and contained in an array) It creates the "petty" asteroids of low yield(1-12) first, then a percentage of them are spawned as "juicy"(25-72). After that, the "special" features are spawned within the same range, these add atmosphere and make the asteroid fields seem more expansive. Then a coin is tossed to decide if there should be any NVidium 'roids, maximum of 2 may exist. The huge asteroids with tunnels in them are generally avoided, but there is a chance one may spawn with high yield(32-96). About the same chances of there being a nebula.
Last edited by Shanjaq on Wed, 24. Aug 05, 19:20, edited 1 time in total.
[ external image ]
SPACE HAS A TERRIBLE POWER
Shanjaq
Posts: 353
Joined: Sat, 3. Apr 04, 09:47
x3

Post by Shanjaq »

Eek! I thought using a Setup.Scriptname would run only ONCE no matter how many times you save and reload? Why is it running again every time I load a savegame that was made after installing the plugin? >_<

Isn't it the Init.Scriptname that runs every time the game loads up no matter what?
[ external image ]
SPACE HAS A TERRIBLE POWER
User avatar
Serial Kicked
Posts: 3823
Joined: Fri, 12. Aug 05, 20:46
x3tc

Post by Serial Kicked »

I'm pretty sure that setup.* and init.* are run each time the game is loaded.
X3:TC/AP Pirate Guild 3 - Yaki Armada 2 - Anarkis Defense System

Anarkis Gaming HQ
Independent Game Development
X3 Scripting and Modding Station
Galaxy613
Posts: 3285
Joined: Tue, 28. Dec 04, 02:19
x4

Post by Galaxy613 »

You might have to use Global variables, thats what I had to do for my "mnyFORfct" script. (I made the script to give me 900,000 at the start of the game, but because it loaded each time it kept getting 900,000 each time I loaded my save game, NOT. KOOL.)

Just do something like:

Code: Select all

001   $glbvar = get global variable: name='mnyFORfct'
002   if $glbvar != 1337
003    set global variable: name='mnyFORfct' value=1337
...
10,000 Lightyears of awesomeness
Shanjaq
Posts: 353
Joined: Sat, 3. Apr 04, 09:47
x3

Post by Shanjaq »

Ok it's all fixed, I used a global to keep it from repeating this time ^_^;


Proceed to download and enjoy the bounty and splendor of the X-Universe Frontier!


(edit: The asteroid fields are no longer cube shaped, they have variable width, length and height.)
[ external image ]
SPACE HAS A TERRIBLE POWER
AdmiralTigerclaw
Posts: 2131
Joined: Mon, 27. Dec 04, 11:49
x4

Post by AdmiralTigerclaw »

Up for a challenge now?

This script has one use only, add a depth element to the Xverse.

The script is simple, but complex. (Isn't that an oxymoron?)

Design a script that brings NPC shipyards to life.

NPC SYs must spawn TS craft (up to four per yard) and send them out to gether any and all legal supplies continuously. What does this do? Act as a mere sinkhole for high end goods while consuming low end goods.

Just have the TS spawn, run out and collect a random ware, return to base, and unspawn. Repeat cycle.

After all, shipyards are supposed to devour resources... but I see less traffic from them than anything else...
User avatar
MageKingS70
Posts: 138
Joined: Sat, 4. Sep 04, 05:41
x4

Post by MageKingS70 »

Perhaps an entire "Endless Adventure" series could be made, adding stuff like that... hmm...
Shanjaq
Posts: 353
Joined: Sat, 3. Apr 04, 09:47
x3

Post by Shanjaq »

@ATC: Who actually buys the higher end goods like weapons, ammo, missiles, fighter drones and satellites? Do they just get bought by the nearest Equipment Dock, which makes them dissolve after a random time interval(no AI actually buying and using them?)
[ external image ]
SPACE HAS A TERRIBLE POWER
AdmiralTigerclaw
Posts: 2131
Joined: Mon, 27. Dec 04, 11:49
x4

Post by AdmiralTigerclaw »

Pretty much.

There is a trick to doing it.

You can have only one primary resource, and all the secondaries you want.

My shortcut was to use a split gamma PPC forge, setting the product to Ecells, the primary to NVidium. Then setting the secondary to whatever I want. The PPC forge, because of the number of materials it holds.
xeon_1
Posts: 3535
Joined: Thu, 4. Dec 03, 17:16
x4

Post by xeon_1 »

that link for the advanced jumper is not working
Shanjaq
Posts: 353
Joined: Sat, 3. Apr 04, 09:47
x3

Post by Shanjaq »

Ah thanks, link is updated and works now :D
[ external image ]
SPACE HAS A TERRIBLE POWER
Stealth
Posts: 1732
Joined: Wed, 6. Nov 02, 20:31
x2

Post by Stealth »

Very interesting indeed. Worthy of an X Mining Corp stamp of approval, if only we had one. ;)
NavaCorp
Posts: 2253
Joined: Tue, 16. Nov 04, 12:08
x3tc

Post by NavaCorp »

Nice script: it's given me new reasons to explore! :D

One problem: in Akeela's Beacon I found many asteroids in the asteroid fields that are solid but not targettable and not visible on the map list.

I've not checked if it's the same in other sectors but it could be.

Bye :)
Shanjaq
Posts: 353
Joined: Sat, 3. Apr 04, 09:47
x3

Post by Shanjaq »

Yes those are to add ambience, they are not actual Asteroid objects but one big "Asteroid Field" Special Object. They can sometimes get in the way, but without them the asteroid fields just don't look "natural" :S
[ external image ]
SPACE HAS A TERRIBLE POWER
DenYaSis
Posts: 111
Joined: Fri, 3. Dec 04, 19:29
x2

Post by DenYaSis »

Seems the link is broken for this one too.

Too Sad.

EDIT-- Nevermind. It seems to work now!
YaY, this makes my day!
Shanjaq
Posts: 353
Joined: Sat, 3. Apr 04, 09:47
x3

Post by Shanjaq »

New version is out, and the files have a new host!

Here's what is new:

version 1.2:

-Added Pirate Hideouts to some asteroid fields(beware, they're armed!)
-Asteroids will most likely appear in sectors that already contain asteroids(realism boost)


Happy expeditions!
[ external image ]
SPACE HAS A TERRIBLE POWER
Rabid Potatoe
Posts: 43
Joined: Fri, 10. Nov 06, 16:56

Post by Rabid Potatoe »

Nice script, it made me rich ! I found a 32 yield nividium asteroid.

Return to “X²: The Threat - Scripts and Modding”