Custom Galactic Conquest [Tutorial] (FAQ)
Moderator: Moderators
-
Slime615
- Lieutenant General

- Posts: 704
- Joined: Thu Jan 07, 2010 9:38 am
Re: Custom Galactic Conquest (Tutorial)
What exactaly do you mean by dublicate? Is that just a script thing, or do you have to create a New Map entitles, mus2?
- DarthD.U.C.K.
- Master of the Force

- Posts: 6027
- Joined: Wed Sep 27, 2006 11:05 am
- Location: Duckburg, Germany
Re: Custom Galactic Conquest (Tutorial)
yes, if it doesnt work the normal way, duplicate the planets like jaspo said.
-
Jaspo
- Command Sergeant Major

- Posts: 282
- Joined: Sun Mar 01, 2009 4:34 am
- Projects :: AotC DoW+++Boonta Eve Classic
- xbox live or psn: No gamertag set
- Contact:
Re: Custom Galactic Conquest (Tutorial)
Right. I believe duplication is necessary because as soon as you
DeleteEntity("yav")
you lose the entity class "yav", and then when you try to
CreateEntity(GetEntityClass("yav"), GetEntityMatrix("end"), "CST");
The game says, "what entity class "yav"? I don't see any entity class "yav"!" and crashes.
Now, if you don't want Yavin elsewhere, you can simply delete it after creating your CST entity, without worrying about duplication.
Buuuut, if you create a new entity that is identical to the yav entity before you delete it,
then if you do want Yavin elsewhere you can remake the "yav" entity class by getting the entity class of the duplicate.
Actually, I'm just now seeing an alternative to the duplication process, which saves some code but might be potentially confusing. Ok, when you made your CST entity, it essentially duplicated the yav entity, (but put it in a different location, of course) right? Well, then, you could still delete the yav entity afterward, but then after that relocate Yavin to, say, star14, with
CreateEntity(GetEntityClass("CST"), GetEntityMatrix("star14"), "yav");
So at the cloning facility, they took Mr. Yav Jedi, cloned him, named his clone Mr. CST Jedi, killed Mr. Yav Jedi, cloned Mr. CST Jedi, and named his clone Mr. Yav Jedi. It's as if Mr. Yav Jedi never even died.
DeleteEntity("yav")
you lose the entity class "yav", and then when you try to
CreateEntity(GetEntityClass("yav"), GetEntityMatrix("end"), "CST");
The game says, "what entity class "yav"? I don't see any entity class "yav"!" and crashes.
Now, if you don't want Yavin elsewhere, you can simply delete it after creating your CST entity, without worrying about duplication.
Buuuut, if you create a new entity that is identical to the yav entity before you delete it,
then if you do want Yavin elsewhere you can remake the "yav" entity class by getting the entity class of the duplicate.
Actually, I'm just now seeing an alternative to the duplication process, which saves some code but might be potentially confusing. Ok, when you made your CST entity, it essentially duplicated the yav entity, (but put it in a different location, of course) right? Well, then, you could still delete the yav entity afterward, but then after that relocate Yavin to, say, star14, with
CreateEntity(GetEntityClass("CST"), GetEntityMatrix("star14"), "yav");
So at the cloning facility, they took Mr. Yav Jedi, cloned him, named his clone Mr. CST Jedi, killed Mr. Yav Jedi, cloned Mr. CST Jedi, and named his clone Mr. Yav Jedi. It's as if Mr. Yav Jedi never even died.
- [RDH]Zerted
- Gametoast Staff

- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
Re: Custom Galactic Conquest (Tutorial)
The work behind getting to those tutorials was extensive. I tried to keep the tutorials as short as possible to reduce the chances of mistakes. Sucessfully modding the shell requires knowledge of programming, Lua, and how SWBF2 works. This experience is best learned through lots of reading and creating map mods before making cGCs. I assume anyone at this level can review the code and identify the locations they need to edit for customizations. It's not possible to write tutorials on every customization point and I can't provide that level of support for everyone. However, anyone should feel free to keep reminding me about any issues they want my help on. Once things get left for too long I either forget about them or assume the person has already moved on to something else. If someone is bothering me or I can't help them I'll let them know. If I haven't said that directly to you than assume that you aren't.I know of no "comprehensive" tutorial included with the patch...only a few small text documents with bare bones info on what the stuff is, and not really much info on customization.
We don't have the Galaxy map assets thus we can't remake that map. However, it's just a map so you should be able to use whatever map you want. You'll have to edit the shell script(s) that loads the Galaxy map. I don't know which script off-hand.Is it possible to change the back ground, say from the Galaxy map, to that of a small area? Say, the core worlds, or the Hapes cluster? Or is it hard coded?
I don't see why you can't create new or move the existing points/entities. Read the docs on all the entity functions. You're just referencing matrices, same as the teleporting code (read the references to that too).
-
Slime615
- Lieutenant General

- Posts: 704
- Joined: Thu Jan 07, 2010 9:38 am
Re: Custom Galactic Conquest (Tutorial)
Ok Jaspo. I know I must sound like a complete noob. A lot of this Code just goes straight over my head, so bear with me.
If I am reading this right, If I wnt to move a planet, then I have to delete it first, then dublicate it.
If I want to delete it to free up the space, or just cause I dont want that planet in my GC, then I simply have to delete it after I have loaded my New planet with the CreateEntity
code?
But if I want to move the planet,. I have to create an Identical planet, and place that in the new area.
I am confused however. If we are moving a planet, why do we need to delete the original in the first place? WHy not just change the code from:
to something like:
why would that not move the planet?
If I am reading this right, If I wnt to move a planet, then I have to delete it first, then dublicate it.
If I want to delete it to free up the space, or just cause I dont want that planet in my GC, then I simply have to delete it after I have loaded my New planet with the CreateEntity
Code: Select all
(GetEntityClass("yav"), GetEntityMatrix("end"), "CST");code?
But if I want to move the planet,. I have to create an Identical planet, and place that in the new area.
I am confused however. If we are moving a planet, why do we need to delete the original in the first place? WHy not just change the code from:
Code: Select all
CreateEntity(GetEntityClass("nab"), GetEntityMatrix("nab"), "nab");Code: Select all
CreateEntity(GetEntityClass("nab"), GetEntityMatrix("Star03"), "nab");-
Jaspo
- Command Sergeant Major

- Posts: 282
- Joined: Sun Mar 01, 2009 4:34 am
- Projects :: AotC DoW+++Boonta Eve Classic
- xbox live or psn: No gamertag set
- Contact:
Re: Custom Galactic Conquest (Tutorial)
NOTE: I was mistaken about the nature of "GetEntityMatrix()"...Two of my above posts have been corrected, as well as this one; look for the EDIT:. Sorry for any confusion it might've caused. It's the trouble with coming back to something after being away from it for a while, you know.
You see, if the mission is loaded with no changes to planets done in the script, by default all the entities are present, right where the designers of the GAL map put them. Therefore, if you want a stock planet somewhere else, it must also be deleted from it's starting location. Notice that in the init script you start with, there's a big section for deleting entities (everything but the 3? planets used, in fact) but no section for creating new ones.
What Zerted was hinting at above (by saying this is very similar to teleporting code) is that, well, understand this:
Galactic conquest uses a ZeroEditor-made map, just like any other mission. The map is made up of a big rotating galaxy model behind a bunch of planet and star models (entities). The only locations that a new entity can be created at are the current locations of planets or stars whose names are known...just as with teleporting, where an object can be relocated to the location of any known object or path node, etc. However, if, say, Naboo were to be deleted, nothing can be created where it used to be, because there's nothing at the location anymore and so it's no longer possible to tell a new entity to create itself where Naboo is...because Naboo doesn't exist. That's why it's useful to make a temporary duplicate of Naboo, with a different name, to hold it's spot in the galaxy. Then, once all the planet shuffling is complete, the duplicate can be deleted, and since it's named something other than what Naboo is named, deleting it won't also delete Naboo.
EDIT:It's possible to create planets at new locations using CreateMatrix, read some of the posts below this one to find out how.
Hmm, I bet you have a point, though...instead of deleting "nab" and making a new one in a different location, it could almost assuredly be teleported to a different location instead...brb *goes off to look up teleporting again*
*comes back*
There. Try that alone (without the CreateEntity stuff) and see if Naboo moves.
Oh, and notice that it's SetEntityMatrix, not GetEntityMatrix.
No guarantees that it will work, but it probably will.
It is because otherwise you will have two Naboos.I am confused however. If we are moving a planet, why do we need to delete the original in the first place?
You see, if the mission is loaded with no changes to planets done in the script, by default all the entities are present, right where the designers of the GAL map put them. Therefore, if you want a stock planet somewhere else, it must also be deleted from it's starting location. Notice that in the init script you start with, there's a big section for deleting entities (everything but the 3? planets used, in fact) but no section for creating new ones.
What Zerted was hinting at above (by saying this is very similar to teleporting code) is that, well, understand this:
Galactic conquest uses a ZeroEditor-made map, just like any other mission. The map is made up of a big rotating galaxy model behind a bunch of planet and star models (entities). The only locations that a new entity can be created at are the current locations of planets or stars whose names are known...just as with teleporting, where an object can be relocated to the location of any known object or path node, etc. However, if, say, Naboo were to be deleted, nothing can be created where it used to be, because there's nothing at the location anymore and so it's no longer possible to tell a new entity to create itself where Naboo is...because Naboo doesn't exist. That's why it's useful to make a temporary duplicate of Naboo, with a different name, to hold it's spot in the galaxy. Then, once all the planet shuffling is complete, the duplicate can be deleted, and since it's named something other than what Naboo is named, deleting it won't also delete Naboo.
EDIT:It's possible to create planets at new locations using CreateMatrix, read some of the posts below this one to find out how.
Hmm, I bet you have a point, though...instead of deleting "nab" and making a new one in a different location, it could almost assuredly be teleported to a different location instead...brb *goes off to look up teleporting again*
*comes back*
Code: Select all
SetEntityMatrix("nab","star03")Oh, and notice that it's SetEntityMatrix, not GetEntityMatrix.
No guarantees that it will work, but it probably will.
Last edited by Jaspo on Thu Jan 05, 2012 12:26 am, edited 2 times in total.
-
Slime615
- Lieutenant General

- Posts: 704
- Joined: Thu Jan 07, 2010 9:38 am
Re: Custom Galactic Conquest (Tutorial)
Mmmm. Okay. I will try that once I get back home to my CP - If any one else can try that in the mean while, please let me know the result.
If I am reading this right, the Points are created by A Model, shaped like a galaxy, with a lot of additional models... and these are named Star3 etc. Then these are called for in the script, similar to setting a CP in the LUA, or else, makeing a normal object something else, like a pwan point? AM I right?
Assuming this is true, that make the Construction of a New Map, feasiab;le, but very difficult and impractical, because we lack the original files?
Or have I got that completley wrong?
If I am reading this right, the Points are created by A Model, shaped like a galaxy, with a lot of additional models... and these are named Star3 etc. Then these are called for in the script, similar to setting a CP in the LUA, or else, makeing a normal object something else, like a pwan point? AM I right?
Assuming this is true, that make the Construction of a New Map, feasiab;le, but very difficult and impractical, because we lack the original files?
Or have I got that completley wrong?
- DarthD.U.C.K.
- Master of the Force

- Posts: 6027
- Joined: Wed Sep 27, 2006 11:05 am
- Location: Duckburg, Germany
Re: Custom Galactic Conquest (Tutorial)
yes the galaxy is a model/texture of which we dont have the assets. this galaxy exits within a space. within the space there are many points on these points the entitys (the planets and start) are put. you can only access those points through the entitys. thats why you cant just delete one and place another one on the same point.
as zerted said the setup of the galaxymap is probably in some script and can be changed but because the assets arent avaible the new map would have to be created from scratch.
you can most likely create new "positions" by adding offsetvalues to the createentity command.
as zerted said the setup of the galaxymap is probably in some script and can be changed but because the assets arent avaible the new map would have to be created from scratch.
you can most likely create new "positions" by adding offsetvalues to the createentity command.
-
Jaspo
- Command Sergeant Major

- Posts: 282
- Joined: Sun Mar 01, 2009 4:34 am
- Projects :: AotC DoW+++Boonta Eve Classic
- xbox live or psn: No gamertag set
- Contact:
Re: Custom Galactic Conquest (Tutorial)
My grand realization is that the models aren't at points in the galaxy, they are the points.
But offset, eh? Cool. I wasn't aware it could be done. Could I see a code example of that?
And, I think my code in that last bit is wrong. Instead of
It would need to be
because the string "star03" isn't a position, but it's matrix is.
Oh, and then because you probably won't be moving star03 to anywhere, you should probably delete it after moving Naboo to it, and also in case you want something else where Naboo used to be, you should make a temporary duplicate of it, so the whole relocation would look like:
But offset, eh? Cool. I wasn't aware it could be done. Could I see a code example of that?
And, I think my code in that last bit is wrong. Instead of
Code: Select all
SetEntityMatrix("nab","star03")Code: Select all
SetEntityMatrix("nab",GetEntityMatrix("star03"))Oh, and then because you probably won't be moving star03 to anywhere, you should probably delete it after moving Naboo to it, and also in case you want something else where Naboo used to be, you should make a temporary duplicate of it, so the whole relocation would look like:
Code: Select all
CreateEntity(GetEntityClass("nab"),GetEntityMatrix("nab"),"nab_placeholder")
SetEntityMatrix("nab",GetEntityMatrix("star03"))
DeleteEntity("star03")
[whatever other galaxy setup code goes here]
DeleteEntity("nab_placeholder")- DarthD.U.C.K.
- Master of the Force

- Posts: 6027
- Joined: Wed Sep 27, 2006 11:05 am
- Location: Duckburg, Germany
-
Slime615
- Lieutenant General

- Posts: 704
- Joined: Thu Jan 07, 2010 9:38 am
Re: Custom Galactic Conquest (Tutorial)
Just to confoirm - Will this create a New Galactoc Conquest, or will it override a stock one?
-
THEWULFMAN
- Space Ranger
- Posts: 5557
- Joined: Tue Aug 17, 2010 3:30 pm
- Projects :: Evolved 2
- Location: Columbus, Ohio
- Contact:
Re: Custom Galactic Conquest (Tutorial)
It creates a new Galactic Conquest, it does not override any of the four stock GCs.Slime615 wrote:Just to confoirm - Will this create a New Galactic Conquest, or will it override a stock one?
- [RDH]Zerted
- Gametoast Staff

- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
Re: Custom Galactic Conquest (Tutorial)
There's no mission script for the galaxy map. There's no objective, so no ScriptPostLoad is needed. There's no ScriptInit as that is done within the shell itself. Everything in the map would have been placed there using ZeroEdit.DarthD.U.C.K. wrote:...the setup of the galaxymap is probably in some script...
In theory, you could load some units and have the AI running around shooting each other while you select your next move.
-
THEWULFMAN
- Space Ranger
- Posts: 5557
- Joined: Tue Aug 17, 2010 3:30 pm
- Projects :: Evolved 2
- Location: Columbus, Ohio
- Contact:
Re: Custom Galactic Conquest (Tutorial)
[RDH]Zerted wrote:In theory, you could load some units and have the AI running around shooting each other while you select your next move.
-
Slime615
- Lieutenant General

- Posts: 704
- Joined: Thu Jan 07, 2010 9:38 am
Re: Custom Galactic Conquest (Tutorial)
ok. For some reason, I have the Dark times Riseing Son GC Installed, although it is uninstalled, and does not run properly... Will createing a New GC Get rid of this, or do I have to uninstall it?
- DarthD.U.C.K.
- Master of the Force

- Posts: 6027
- Joined: Wed Sep 27, 2006 11:05 am
- Location: Duckburg, Germany
Re: Custom Galactic Conquest (Tutorial)
are you sure you really understand the tutorial? because it explains exactly how gcws are added(=>how they are removed). the "custom_gc_number" scripts define the galactic conquests. if you remove dark times, its gone. if you dont, its not.
-
Slime615
- Lieutenant General

- Posts: 704
- Joined: Thu Jan 07, 2010 9:38 am
Re: Custom Galactic Conquest (Tutorial)
Well sorry to diapoint you. But The dark times has been removed from my my Addon folder for months, and the Galactic Conquest for The Dark Times is still there...
-
Jaspo
- Command Sergeant Major

- Posts: 282
- Joined: Sun Mar 01, 2009 4:34 am
- Projects :: AotC DoW+++Boonta Eve Classic
- xbox live or psn: No gamertag set
- Contact:
Re: Custom Galactic Conquest (Tutorial)
That's because the custom_gc_whatevernumber script for dark times (or any cgc) is/needs to be located at swbf2\gamedata\data\_lvl_pc, not in the addon folder.
Please refer to steps 22 and 23 in the first post of this topic.
And just to be sure you understand what he did in step 22, he renamed "shell.lvl" to "custom_gc_7.lvl"
And just in case it wasn't mentioned anywhere else by now, it apparently only works to have 1 custom gc script in the _lvl_pc folder at a time. This is why when Mav created his KoTOR galactic conquests (in which there were 2 versions you could play) he created another folder inside the _lvl_pc folder where the custom galactic conquest script currently not in use could be placed...the game couldn't find it there, so it was a nifty alternative to deleting the script.
EDIT:
Got back from actually putting some of these ideas into practice and found that
doesn't quite work right in this case. I didn't bother to figure out what all was wrong, but I think while the planet entity moved, all its clickable localized glowy stuff didn't, so the end result of doing this to multiple planets was a confused mess...and that's why I didn't bother to investigate any further.
In other news, I got the desired tech card changes implemented (into the init script is where this goes), and came up with a way of keeping the AI from buying the re-enabled sensors bonus and the hero bonus (there's no AI heroes, and what good does seeing the map do for a NPC?):
and then to keep the AI from unlocking the false (locked) value for those two cards, their "false" value is set to a high number (I put 1000, which is equal to 10000 credits) in the other table that needs to be copied from ifs_freeform_purchase_tech (I'm not sure what the name of it is, but it sets up which planets or missions use which bonuses). Note that this is assuming that the sensor bonus remains listed first and the hero bonus remains listed last in that table.
In other news, I found out that the light bloom glitch I was experiencing came from my failure to delete the original star entities. I also dug around in GAL.lvl to find the name of an existing star destroyer model so I could put it in place for the star destroyer mission in my custom galactic conquest, and for the name of the large yavin planet models, which were in the way after I moved Yavin 4 to a different location. I deleted them, but I suppose I should really move them to Yavin 4's new location. Meanwhile the origins of the Yavin IV planet model that exists near each planet location remains a mystery.
In other news, this works just fine and I used it to clean up all the camera positions in my custom galactic conquest, and also to rotate the tantive IV and star destroyer models:
Different numerical values can be inserted in the CreateMatrix part to rotate or move the new model in relation to the original position, and in case you didn't notice, there's a link a few posts above (DarthD.U.C.K., 8 up) which leads to a description of which number does what. Leaving them as zeros, however, will accomplish nothing in the way of relocation. Note that this can all be written as one line of code, but it didn't quite fit here and so appears as two.
Please refer to steps 22 and 23 in the first post of this topic.
And just to be sure you understand what he did in step 22, he renamed "shell.lvl" to "custom_gc_7.lvl"
And just in case it wasn't mentioned anywhere else by now, it apparently only works to have 1 custom gc script in the _lvl_pc folder at a time. This is why when Mav created his KoTOR galactic conquests (in which there were 2 versions you could play) he created another folder inside the _lvl_pc folder where the custom galactic conquest script currently not in use could be placed...the game couldn't find it there, so it was a nifty alternative to deleting the script.
EDIT:
Got back from actually putting some of these ideas into practice and found that
Code: Select all
SetEntityMatrix("nab",GetEntityMatrix("star03"))In other news, I got the desired tech card changes implemented (into the init script is where this goes), and came up with a way of keeping the AI from buying the re-enabled sensors bonus and the hero bonus (there's no AI heroes, and what good does seeing the map do for a NPC?):
Hidden/Spoiler:
In other news, I found out that the light bloom glitch I was experiencing came from my failure to delete the original star entities. I also dug around in GAL.lvl to find the name of an existing star destroyer model so I could put it in place for the star destroyer mission in my custom galactic conquest, and for the name of the large yavin planet models, which were in the way after I moved Yavin 4 to a different location. I deleted them, but I suppose I should really move them to Yavin 4's new location. Meanwhile the origins of the Yavin IV planet model that exists near each planet location remains a mystery.
In other news, this works just fine and I used it to clean up all the camera positions in my custom galactic conquest, and also to rotate the tantive IV and star destroyer models:
Code: Select all
CreateEntity(GetEntityClass("NameOfExistingEntity"),
CreateMatrix(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, GetEntityMatrix("NameOfExistingEntity")), "NameOfNewEntity");
- [RDH]Zerted
- Gametoast Staff

- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
Re: Custom Galactic Conquest (Tutorial)
In the context of picking Galactic Conquest moves:
From: viewtopic.php?f=27&t=27601&start=20#p470922
*Note to self: topic related to having selectable objects floating ingame that let you swap/load different map sections: viewtopic.php?f=27&t=30666
Edit: That was supposed to be a PM. Sorry about the bump.
Did you ever try that?THEWULFMAN wrote:[RDH]Zerted wrote:In theory, you could load some units and have the AI running around shooting each other while you select your next move.Must test that sometime...
From: viewtopic.php?f=27&t=27601&start=20#p470922
*Note to self: topic related to having selectable objects floating ingame that let you swap/load different map sections: viewtopic.php?f=27&t=30666
Edit: That was supposed to be a PM. Sorry about the bump.
- Benoz
- Corporal

- Posts: 142
- Joined: Tue May 28, 2013 12:34 pm
- Projects :: Clone Wars Era Mod Version 2
- xbox live or psn: No gamertag set
- Location: Germany
Re: Custom Galactic Conquest [Tutorial] (FAQ)
Is it possible to edit an already existing GC without the patch 1.3?
