Blowing up stations?

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

Post Reply
User avatar
Pleb
---- E L I T E ----
---- E L I T E ----
Posts: 908
Joined: Sun Apr 29, 2012 2:23 pm
Location: United Kingdom

Blowing up stations?

Post by Pleb »

Quick question, I have removed all stations from a system via javascript and added a new one in oribt of the planet. I've set its energy and energy recharge levels low enough that an all out assault should be able to destroy it...however despite getting it to throw off lots of sparks like it's about to blow up it never does! Also, even though I've created a new AI file for it I still end up with a fugitive status for attacking it (despite it having a scanclass of CLASS_THARGOID). :evil:

So my question is, if there is only one station in the system, does it automatically become the main station? And does that then make it indestructible? If so, is there a way around is? :?:
Desktop PC: CPU: Intel i7-4790K Quad Core 4.4GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1080Ti RAM: 32GB DDR3

Laptop PC: CPU: Intel i5-10300H Quad Core 4.5GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1650 RAM: 32GB DDR4
User avatar
GGShinobi
---- E L I T E ----
---- E L I T E ----
Posts: 291
Joined: Tue Dec 25, 2012 7:20 pm

Re: Blowing up stations?

Post by GGShinobi »

Pleb wrote:
So my question is, if there is only one station in the system, does it automatically become the main station? And does that then make it indestructible? If so, is there a way around is? :?:
Regarding the destructibility of main stations: I don't know how they did it, but in [wiki]Asteroid Storm[/wiki], stations can be destroyed when the get hit by asteroids (which I had to witness today :cry: *). Perhaps you can have a look at it's code.

*(And I always thought that the [wiki]Asteroid Storm[/wiki] only brings more variety to the asteroids.) :P
忍 knowing that enough is enough, you'll always have enough.

Running Oolite 1.77 on Ubuntu Linux 12.04 LTS
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2453
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: Blowing up stations?

Post by Wildeblood »

Pleb wrote:
So my question is, if there is only one station in the system, does it automatically become the main station? And does that then make it indestructible? If so, is there a way around is? :?:
Yes, yes, move the main station to nowheresville, where the player can't find it, rather than removing it. It only has to exist, it doesn't have to look like a station.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: Blowing up stations?

Post by Thargoid »

And don't forget to script-strip it of it's beacon and beacon-code too.
User avatar
Pleb
---- E L I T E ----
---- E L I T E ----
Posts: 908
Joined: Sun Apr 29, 2012 2:23 pm
Location: United Kingdom

Re: Blowing up stations?

Post by Pleb »

I thought as much, spent half hour trying to blow up the station last night!

And yes, I had removed all beacons from the system already but thank you Thargoid. Ironically it is a Thargoid Station I'm attempting to destroy... :lol:

So if I remove all stations from the system, I could add the first station in the middle of nowhere (where no one would ever find it), and the second station I add (in orbit where the main station used to be) will now no longer be considered the main station and it will not give me a fugitive status and I will actually be able to blow the Thargie's out of the sky? :twisted:
Desktop PC: CPU: Intel i7-4790K Quad Core 4.4GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1080Ti RAM: 32GB DDR3

Laptop PC: CPU: Intel i5-10300H Quad Core 4.5GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1650 RAM: 32GB DDR4
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Blowing up stations?

Post by Eric Walch »

Pleb wrote:
So if I remove all stations from the system, I could add the first station in the middle of nowhere (where no one would ever find it), and the second station I add (in orbit where the main station used to be) will now no longer be considered the main station and it will not give me a fugitive status and I will actually be able to blow the Thargie's out of the sky? :twisted:
A commander that uses its escape pod, it will go to the nearest station. When you blow that new station out of the sky, that far away station will now be the closest. :roll: That can probably be fixed by adding a script to the new station that also blows away the far away mainStation if it is killed himself.
User avatar
Pleb
---- E L I T E ----
---- E L I T E ----
Posts: 908
Joined: Sun Apr 29, 2012 2:23 pm
Location: United Kingdom

Re: Blowing up stations?

Post by Pleb »

Eric Walch wrote:
A commander that uses its escape pod, it will go to the nearest station. When you blow that new station out of the sky, that far away station will now be the closest. :roll: That can probably be fixed by adding a script to the new station that also blows away the far away mainStation if it is killed himself.
Okay I will bear that in mind, I don't want this 'fake' main station to be available to the player, the player should think the Thargoid Station is the main station and that needs to be destructible for my mission. Thanks Eric! :D
Desktop PC: CPU: Intel i7-4790K Quad Core 4.4GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1080Ti RAM: 32GB DDR3

Laptop PC: CPU: Intel i5-10300H Quad Core 4.5GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1650 RAM: 32GB DDR4
User avatar
Pleb
---- E L I T E ----
---- E L I T E ----
Posts: 908
Joined: Sun Apr 29, 2012 2:23 pm
Location: United Kingdom

Re: Blowing up stations?

Post by Pleb »

Hmm...still isn't working. I have scripted that when entering the system, the coordinates of the main station are saved into a variable. Then all station entities are exploded in the system (using same code used in the Nova mission). Then the two beacons in the system are exploded. Then the script adds one station miles away and another (the Thargoid Station) in the same place the original main station was at...and yet still I get a fugitive status and the station is indestructable! :evil:

Code: Select all

	// Check if Player accepted mission and is in the target system:
	if (missionVariables.thargoid_invasion == "GOING_TO_SYSTEM" && system.ID == 161)
	{
		// Store co-ordinates of main station to variable:
		var mainStationPosition = system.mainStation.position;
		
		// Find and destroy all stations in system:
		this._blowUpAllStations();
		
		// Send all ships away:
		system.sendAllShipsAway();
		
		// Add a temporary (hidden) main station far away and aldo add Thargoid Station where old main station used to be:
		this.tempMainStation = system.addShips("icosahedron", 1, Vector3D(5, 5, 5).fromCoordinateSystem("wpu"), 0);
		this.thargoidStation = system.addShips("thargoid_station", 1, mainStationPosition, 0);
	}
Desktop PC: CPU: Intel i7-4790K Quad Core 4.4GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1080Ti RAM: 32GB DDR3

Laptop PC: CPU: Intel i5-10300H Quad Core 4.5GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1650 RAM: 32GB DDR4
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Blowing up stations?

Post by cim »

The station closest to the planet is assigned as the main station. Because you're adding both the stations in a single JS call, it doesn't check for main station between the two addShips commands.

Probably easiest is to blow up everything except the main station, then move it well out of the way and put the new station in its place.
User avatar
Pleb
---- E L I T E ----
---- E L I T E ----
Posts: 908
Joined: Sun Apr 29, 2012 2:23 pm
Location: United Kingdom

Re: Blowing up stations?

Post by Pleb »

cim wrote:
The station closest to the planet is assigned as the main station. Because you're adding both the stations in a single JS call, it doesn't check for main station between the two addShips commands.

Probably easiest is to blow up everything except the main station, then move it well out of the way and put the new station in its place.
Ah okay I will try that instead, thanks cim! :mrgreen:
Desktop PC: CPU: Intel i7-4790K Quad Core 4.4GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1080Ti RAM: 32GB DDR3

Laptop PC: CPU: Intel i5-10300H Quad Core 4.5GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1650 RAM: 32GB DDR4
Post Reply