Automatically spawning free ships when certain planet is captured

Is it possible?

I'm working on a map right now, and I can't figure out how to get something to work.  Basically, what I want to do, is this:  When you capture a certain planet, a bunch of capital ships spawn for free at that planet.  Now, I have had some small progress with this.  If I make it where the planet begins as being controlled by the player, I can make it spawn the ships.  In GalaxyForge, I right-click on the planet, press edit, and use the group edit tool to make a group.  When you start the map, you own the planet, and have 11 advent capital ships at your disposal.  But that's not quite what I want, as I said.  I want the cap-ships to spawn only when that planet is captured, and have the ships given to the owner of the planet.  Can you help me?

5,646 views 8 replies
Reply #1 Top

Dont pawn cap ships!! that is way overpowered even in a capship only environement! Spawn a crap load of frigates and use them as bullet meat for your big guns!!

The idea in itself is something I was also looking at but unfortunately, I don't think it is possible!

Would be fun though, to have vessels spawning after capturing a planet..sort of like a bonus form the people of the planet thanking you for saving them by helping youre war effort!:D WE MUST FIND A WAY!

 

Justin S.

Reply #2 Top

The maps can't process change of owner, the game does that. The maps are just layouts of the galaxy, so they can only have starting templates and can't change them.

However, in theory what you want is possible through a mod. There are two ways I can think of for doing it: 1) Modify the colonize abilities to spawn the ships, and 2) add an ability to the planets themselves to spawn ships for the new owner.

To be honest, 2) is iffy - planet based abilities are always tricky and though I know there are some "owner" comparisons for buffs, I'm not sure if owner change can act as a trigger to execute the buff. So, I would recommend going with 1) if you don't mind making it a mod instead of just a map.

Reply #3 Top

Problem is, I don't want it to happen every time I capture a planet.  I only want it to happen with a certain planet, as if the player has discovered a fleet of ships on the surface of the planet and has taken them for themselves.

Reply #4 Top

Ah, I see, that gets more complicated. It might still be doable, however. Again this is purely theorycraft as I've never done this before and don't think anyone else has, but it might work this way:

You make a new planet type that's an exact clone of an existing, except it also gets an ability assigned to it. So for example, you could have your normal Terran, and then your special Terran with the ship spawn ability. Then you use the special terran in your maps in places where you want it to be (and it can also be made to show up with the game's random map generator).

You could then make a passive ability to give to that planet. There is apparently a trigger for "OnAbilityUsed" that can be used to call a buff (the effect that will be spawning your ships), and you can use the colonize ability as the trigger. The buff it calls would then use CreateFrigate (I'm not sure if that can spawn capital ships, it might be able to do any ship entity) to create the ships for the colonizer.

On paper, it looks like it might work.

Reply #5 Top

Sweet! Thanks again Annatar for some wonderful explanation!!! I'll have to go check that out!

 

Justin S.

Reply #6 Top

Thanks for the help, Annatar.  You don't have 158 Karma for nothing.  But how do I make a new planet?  I'm a total beginner at modding.

Reply #7 Top

You'll be worried a lot more about making the ability than the planet :P Making it is easy. Each planet type that exists has a corresponding .entity file in the GameInfo folder (PlanetTerran, PlanetIce, PlanetDesert, etc). To make a new one, you just need to copy one of the existing files and modify it however you like. Each entity is allowed 4 abilities, and planets are no exception:

ability:0 ""
ability:1 ""
ability:2 ""
ability:3 ""

They don't have any by default, but can be given some. So let's say you make your ability and it's called "AbilitySpawnCapitalsOnColonize.entity" (to be descriptive and use same naming convention), to make the special Terran planet that uses it you can just copy PlanetTerran.entity, rename it something like PlanetTerranSpecial.entity and attach the ability:

ability:0 "AbilitySpawnCapitalsOnColonize"
ability:1 ""
ability:2 ""
ability:3 ""

;) You could then use PlanetTerranSpecial in the templates for map making and insert it into your maps. It will need the mod running to function properly, of course. To learn more about how modding works and to get a little practice, check out the sins_modset.pdf in the Forge Tools download (site's downloads section). You'll also need to download them to work with the entity files - the game ones are in binary so you can't edit them, the forge tools give you text versions.

Hope this helps a bit ;)

Reply #8 Top

AWESOME!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!