View previous topic :: View next topic |
Author |
Message |
Merthen Space Emperor

Joined: Jun 25, 2009
|
Posted: Wed Mar 05, 2014 9:45 pm Post subject: Create Planets |
|
|
Hi all
I have a problem. To finish script to create planets (alternative) I have to find a way to check the size of the asteroid field and remove it.
Does anybody have an idea?
Regards
Back to top |
|
 |
Zwo_Dvoongar Space Emperor

Joined: Feb 02, 2011
|
Posted: Thu Mar 06, 2014 5:44 am Post subject: |
|
|
I haven't done any event scripts, so I don't know what constraints you're working under.
"SPACE_OBJECT_TYPE_ASTEROIDS = 8"
I wouldn't expect there'd be a need to know the size, but rather the "space object id" number.
I notice there is no "SYS_DESTROY_ASTEROIDS", so you have your work cut out for you.
There's not a lot of thought behind this, but might you convert the asteroid field to a storm, and then just destroy the storm? Oops - maybe not. I don't see anything that lets you set the type of a space object. I must stop taking for granted that anything which one can get, one can set. That's habit from other languages.
Back to top |
|
 |
Zwo_Dvoongar Space Emperor

Joined: Feb 02, 2011
|
Posted: Thu Mar 06, 2014 6:02 am Post subject: |
|
|
Say...
If you've got a way to destroy asteroids... how many sizes are there? Can't you just make a loop and destroy all potential sizes one-by-one? I suppose a wrong entry might bomb, but lots of functions just "return false" if they fail.
Back to top |
|
 |
Merthen Space Emperor

Joined: Jun 25, 2009
|
Posted: Thu Mar 06, 2014 3:43 pm Post subject: |
|
|
I am looking for two functions
1 check the size of asteroids
2 destroy asteroids
Back to top |
|
 |
marhawkman Space Emperor

Joined: Mar 24, 2008
|
Posted: Thu Mar 06, 2014 6:59 pm Post subject: |
|
|
Ooh... an Honor Harrington fan, cool!
Hmm... this is a sophisticated scripting function. I remember Isopsyco did something like it for his version of Asteroid mod.
Back to top |
|
 |
Merthen Space Emperor

Joined: Jun 25, 2009
|
Posted: Fri Mar 07, 2014 6:24 pm Post subject: |
|
|
HH loyal fan
I checked - Asteroid Habs Ver2.
Unfortunately, asteroid fields are not removed it 
Back to top |
|
 |
Zwo_Dvoongar Space Emperor

Joined: Feb 02, 2011
|
Posted: Sat Mar 08, 2014 7:34 pm Post subject: |
|
|
It won't be easy.
http://www.spaceempires.net/modules.php?name=Forums&file=viewtopic&p=64960
We have a grab bag assortment, when it comes to tools. There'll be something that looks easy, and then you don't have what you need.
Myself, if I just had to do what you're attempting? It'd be a whale of a project, but I'd make a "ghost" empire, and give it its own AI. It'd be limited (at least in what it KNOWS) to one or two hulls, and no weapons, armor, or shields. All its stuff'd be cloaked to ridiculous levels. It'd build some shipyard ships and rely on event scripts for resources. Once it had its shipyard ships constructed, it'd abandon all its colonies and disappear.
The only problem left would be the odd chance collisions, when ghost ships are encountered by accident. That's unavoidable, but giving them a non-shooting point blank strat (suicidal) should suffice to make them sufficiently non-factors.
THEN a ghost ship could go convert some asteroids to planets, using the same "ability" players presently use.
Hopefully, you'll think of something better. Modders often have to be creative and work around obstacles.
Back to top |
|
 |
marhawkman Space Emperor

Joined: Mar 24, 2008
|
Posted: Tue Mar 11, 2014 3:18 am Post subject: |
|
|
Merthen wrote: | HH loyal fan
I checked - Asteroid Habs Ver2.
Unfortunately, asteroid fields are not removed it  | Err... I was really saying you should ask Iso how to do it... if you can find him.
Back to top |
|
 |
Zwo_Dvoongar Space Emperor

Joined: Feb 02, 2011
|
Posted: Thu Mar 13, 2014 10:48 pm Post subject: |
|
|
Okay, I came up with another idea. What if you give the asteroids themselves the same ability ships use to create planets from asteroids? Your script could then issue orders to the asteroid to use the ability when the event is triggered. The main issue would be whether or not the asteroid would then execute its orders.
It might be worth a try, if you have nothing better. There is an event script which alters the orders of ships, so I don't think issuing the order would be a problem.
Anyhow, it should only involve modifying StellarAbilityTypes.txt and writing your script. It wouldn't be trivial, but I don't think it'd take forever.
Back to top |
|
 |
marhawkman Space Emperor

Joined: Mar 24, 2008
|
Posted: Sun Mar 16, 2014 12:11 am Post subject: |
|
|
Umm... it's disclaimer time... I don't know enough about scripting to do this, but this is what I understand from what Isopsyco said:
The script he wrote for his version of Asteroids mod check to see if a ship with the conversion component is at the same location as an asteroid belt, then it creates a new object at the location that is colonizable.
I'm... guessing... based on how you can add/remove storms with scripts, (It was done in the BSG mod.) that you could modify the script Isopsyco wrote to delete an asteroid belt after it makes the new object. But I'm not sure since I've never tinkered with that aspect of SE5 modding.
Back to top |
|
 |
Skyburn Space Emperor

Joined: Mar 12, 2008
|
Posted: Mon Mar 17, 2014 5:10 pm Post subject: |
|
|
I don't think there are script functions to remove asteroids. I think in most asteroid habitat mods the asteroids are technically planets. I haven't actually tested this, so there's still room for doubt. It's possible that the asteroid removal script function was added in a patch and not properly documented.
Back to top |
|
 |
Zwo_Dvoongar Space Emperor

Joined: Feb 02, 2011
|
Posted: Mon Mar 17, 2014 11:20 pm Post subject: |
|
|
Actually... "Sys_Destroy_Planet" might do the trick. Every space object has an ID. Unless the function runs some sort of check to be sure it's a planet, and not something else, it just might delete the fool thing.
Quirks notwithstanding, there's almost got to be some way to monkey with any space object in the game. It could take a lot of trial-and-error to work out, of course. Abusing some of the tools at hand is probably the quickest and most direct approach.
I don't know...
Back to top |
|
 |
marhawkman Space Emperor

Joined: Mar 24, 2008
|
Posted: Mon Mar 31, 2014 2:08 pm Post subject: |
|
|
Skyburn wrote: | I don't think there are script functions to remove asteroids. I think in most asteroid habitat mods the asteroids are technically planets. I haven't actually tested this, so there's still room for doubt. It's possible that the asteroid removal script function was added in a patch and not properly documented. | I know this... I wrote one of them...
In SE5, Asteroids are a different type of stellar object than planets, and thus not colonizable. So to be able to colonize an object that looks like asteroids, you need to make a planet that uses an Asteroid model.
Back to top |
|
 |
Skyburn Space Emperor

Joined: Mar 12, 2008
|
Posted: Mon Mar 31, 2014 3:19 pm Post subject: |
|
|
marhawkman wrote: | Skyburn wrote: | I don't think there are script functions to remove asteroids. I think in most asteroid habitat mods the asteroids are technically planets. I haven't actually tested this, so there's still room for doubt. It's possible that the asteroid removal script function was added in a patch and not properly documented. | I know this... I wrote one of them... |
I forgot that, sorry. 
Back to top |
|
 |
|