Page 1 of 1
Blowing up stations?
Posted: Mon Jan 21, 2013 12:13 am
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).
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?
Re: Blowing up stations?
Posted: Mon Jan 21, 2013 12:56 am
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
*). 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.)
Re: Blowing up stations?
Posted: Mon Jan 21, 2013 2:16 am
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.
Re: Blowing up stations?
Posted: Mon Jan 21, 2013 7:36 am
by Thargoid
And don't forget to script-strip it of it's beacon and beacon-code too.
Re: Blowing up stations?
Posted: Mon Jan 21, 2013 1:06 pm
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...
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?
Re: Blowing up stations?
Posted: Mon Jan 21, 2013 1:54 pm
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?
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.
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.
Re: Blowing up stations?
Posted: Mon Jan 21, 2013 9:31 pm
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.
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!
Re: Blowing up stations?
Posted: Mon Jan 21, 2013 10:14 pm
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!
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);
}
Re: Blowing up stations?
Posted: Mon Jan 21, 2013 10:57 pm
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.
Re: Blowing up stations?
Posted: Tue Jan 22, 2013 1:04 pm
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!