Page 2 of 2

Re: Custom Galactic Conquest (Tutorial)

Posted: Mon Dec 26, 2011 2:36 pm
by Slime615
What exactaly do you mean by dublicate? Is that just a script thing, or do you have to create a New Map entitles, mus2?

Re: Custom Galactic Conquest (Tutorial)

Posted: Mon Dec 26, 2011 2:49 pm
by DarthD.U.C.K.
yes, if it doesnt work the normal way, duplicate the planets like jaspo said.

Re: Custom Galactic Conquest (Tutorial)

Posted: Tue Dec 27, 2011 1:04 am
by Jaspo
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.

Re: Custom Galactic Conquest (Tutorial)

Posted: Tue Dec 27, 2011 2:28 am
by [RDH]Zerted
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.
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.
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?
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.

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).

Re: Custom Galactic Conquest (Tutorial)

Posted: Tue Dec 27, 2011 7:30 am
by Slime615
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: 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");
to something like:

Code: Select all

CreateEntity(GetEntityClass("nab"), GetEntityMatrix("Star03"), "nab");
why would that not move the planet?

Re: Custom Galactic Conquest (Tutorial)

Posted: Tue Dec 27, 2011 11:44 pm
by Jaspo
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.
I am confused however. If we are moving a planet, why do we need to delete the original in the first place?
It is because otherwise you will have two Naboos.
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")
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.

Re: Custom Galactic Conquest (Tutorial)

Posted: Wed Dec 28, 2011 11:54 am
by Slime615
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?

Re: Custom Galactic Conquest (Tutorial)

Posted: Wed Dec 28, 2011 12:19 pm
by DarthD.U.C.K.
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.

Re: Custom Galactic Conquest (Tutorial)

Posted: Wed Dec 28, 2011 2:12 pm
by Jaspo
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

Code: Select all

SetEntityMatrix("nab","star03")
It would need to be

Code: Select all

SetEntityMatrix("nab",GetEntityMatrix("star03"))
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:

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")

Re: Custom Galactic Conquest (Tutorial)

Posted: Wed Dec 28, 2011 3:13 pm
by DarthD.U.C.K.

Re: Custom Galactic Conquest (Tutorial)

Posted: Wed Dec 28, 2011 3:39 pm
by Slime615
Just to confoirm - Will this create a New Galactoc Conquest, or will it override a stock one?

Re: Custom Galactic Conquest (Tutorial)

Posted: Wed Dec 28, 2011 4:00 pm
by THEWULFMAN
Slime615 wrote:Just to confoirm - Will this create a New Galactic Conquest, or will it override a stock one?
It creates a new Galactic Conquest, it does not override any of the four stock GCs.

Re: Custom Galactic Conquest (Tutorial)

Posted: Wed Dec 28, 2011 4:53 pm
by [RDH]Zerted
DarthD.U.C.K. wrote:...the setup of the galaxymap is probably in some script...
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.

In theory, you could load some units and have the AI running around shooting each other while you select your next move.

Re: Custom Galactic Conquest (Tutorial)

Posted: Wed Dec 28, 2011 5:23 pm
by THEWULFMAN
[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.
:o Must test that sometime...

Re: Custom Galactic Conquest (Tutorial)

Posted: Wed Dec 28, 2011 5:35 pm
by Slime615
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?

Re: Custom Galactic Conquest (Tutorial)

Posted: Wed Dec 28, 2011 5:54 pm
by DarthD.U.C.K.
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.

Re: Custom Galactic Conquest (Tutorial)

Posted: Wed Dec 28, 2011 6:08 pm
by Slime615
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...

Re: Custom Galactic Conquest (Tutorial)

Posted: Wed Dec 28, 2011 7:03 pm
by Jaspo
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

Code: Select all

SetEntityMatrix("nab",GetEntityMatrix("star03"))
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?):
Hidden/Spoiler:
[code]ifs_purchase_tech_cards = {
[1] = {
true,
true,
true,
true,
true,
true,
true,
true,
true,
true
},
[2] = {
false,
true,
true,
true,
true,
true,
true,
true,
true,
false
}[/code]
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:

Code: Select all

CreateEntity(GetEntityClass("NameOfExistingEntity"), 
CreateMatrix(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, GetEntityMatrix("NameOfExistingEntity")), "NameOfNewEntity");
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.

Re: Custom Galactic Conquest (Tutorial)

Posted: Thu Sep 25, 2014 11:49 am
by [RDH]Zerted
In the context of picking Galactic Conquest moves:
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.
:o Must test that sometime...
Did you ever try that?

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.

Re: Custom Galactic Conquest [Tutorial] (FAQ)

Posted: Sun Sep 04, 2016 5:29 am
by Benoz
Is it possible to edit an already existing GC without the patch 1.3?