Mr Pure Pazaak 1 Posted January 11, 2019 Hey everyone, I can't seem to find much information on the spawning of extra creatures. I'm working on a small project and require more creatures in order to do so. For example, if I wanted to spawn 50 Gizka on the beach of the Unknown World, how would I go about it? I don't have too much modding experience but am pretty familiar with the KotOR tool. Any information would be awesome! Quote Share this post Link to post Share on other sites
DarthParametric 3,783 Posted January 11, 2019 The specifics can vary depending on what exactly you want to do, but as a general rule you typically define what creatures are in a module via the module's GIT. This dictates exactly how many instances of a given UTC are in the module (each creature doesn't necessarily need a unique UTC, you can spawn any number of duplicates) and where they are positioned. Alternatively, some situations may instead call for the creature/s to be spawned via script. This is typically the case for cutscenes or quests, where you only want the creature/s to appear under specific circumstances. In the case of your Gizka example, assuming you want them to be neutral (i.e. non-combat) background creatures, adding them to the GIT would be the way to go. For that you could just reference the pre-existing generic c_gizka.utc without needing to add a custom UTC of your own. All you'd need to do is figure out how many you want and where to position them, then add that info to the module's GIT and inject it into a MOD (that should be Central Beach I believe - UNK_M41AA). If you wanted to get more fancy and make them interactable, you could look at the Yavin station and Ebon Hawk modules to see how they handled being able to kill them. 1 Quote Share this post Link to post Share on other sites
Mr Pure Pazaak 1 Posted January 11, 2019 Yeah I just want them to hop around and behave as normal Gizka would. If you could simplify the procedure down to steps on how to do this, that would be amazing, from what you've said it doesn't seem to complicated, I'm just not very familiar with modding terms and "where to position them, then add that info to the module's GIT and inject it into a MOD (that should be Central Beach I believe - UNK_M41AA)". I'm fairly noob, thank you for you the quick reply! Quote Share this post Link to post Share on other sites
DarthParametric 3,783 Posted January 11, 2019 This is a brief overview. I would suggest starting by creating a folder to hold all your working files, with sub-folders as appropriate (here's an example) Extract both the RIM files for the module in KTool under RIMs -> Modules. Select unk_m41aa.rim and unk_m41aa_s.rim in turn and hit the "Extract Entire RIM File" button on the top right (I put them in the SOURCE folder in the above example) Using the ERF/RIM Editor, create a new MOD file named unk_m41aa.mod Select all the module's files you extracted in KTool, and drag them into the ERFEdit window, then save the MOD Make a copy of the module's GIT file, m41aa.git Open the GIT with K-GFF Start by going to View -> Fold All, then expand the base STRUCT node to reveal the GIT's structure Expand the CreatureList node If you expand the first few STRUCTS, you'll see there are already three Gizka in this module using two ResRefs - unk41_gizka and unk41_gizka002 Checking those UTCs in KTool, we can see some important dev notes in the Comments tab, so we'll go with unk41_gizka In K-GFF, right click on the first STRUCT and choose Copy STRUCT and then right click on the base CreatureList node, right click, and choose Paste STRUCT A duplicate of that STRUCT will appear at the bottom of the list, which we can now edit as appropriate Before proceeding further, you'll need some co-ordinates. You can generate these either via loading up the module layout in Max/GMax or by running around in-game with an armband that spits out co-ords of the player's position. Edit your new entry in the GIT, changing the X/Y/ZPosition values as appropriate You will see two values for rotation, XOrientation and YOrientation. These are the COS and SIN of the rotation in degrees, respectively. As these Gizka will be hopping around anyway, just leave the existing values. Repeat with duplicating and editing the STRUCT for however many new Gizka you want to add. Save the GIT when done. For testing purposes, you can just copy the MOD into your K1 modules folder, then open it with ERFEdit and drag and drop your edited GIT in. Save the MOD. Start the game and load a save from before entering the Central Beach module for the first time. Examine the quality of your handiwork. You'll probably want to test various position tweaks. They take a little bit to start hopping, so probably don't put them right outside the Hawk's loading ramp. Once you are happy, you can set up the mod with a TSLPatcher installer Read the included PDF for instructions on how to create a TSLPatcher setup The gist in this instance is you need to difference your edited GIT against the original and have it inject those changes into the MOD Here's a basic setup so you can see how it works 1 1 1 Quote Share this post Link to post Share on other sites
Mr Pure Pazaak 1 Posted January 11, 2019 Could you elaborate on the GIT? I'm making a copy of the file in "Dynamic Area Info" right? And I'm Extracting the entire subtype, will I need to rename it or anything? Quote Share this post Link to post Share on other sites
DarthParametric 3,783 Posted January 11, 2019 You extract the entirety of both RIMs. Don't expand them or select any of the contents, just click on the top level and use the button noted above. 1 Quote Share this post Link to post Share on other sites
Mr Pure Pazaak 1 Posted January 11, 2019 Oh I have the two RIMs extracted and have the new .mod file saved from the ERF editor, but am stuck with what to do next in regards to copying the GIT and using K-GFF. The file I'm looking at is m41aa.git (31484)... I just want to make sure that this is the right file and what to do with it next. Quote Share this post Link to post Share on other sites
DarthParametric 3,783 Posted January 11, 2019 The is only a single GIT per module. As I said above, make a copy of the GIT somewhere and then edit it with K-GFF. You no longer need KTool after having extracted the RIMs. Have a look at the archive I linked to at the end of the summary. 1 Quote Share this post Link to post Share on other sites
Mr Pure Pazaak 1 Posted January 11, 2019 Alright I've duplicated around 20 Structs with different X coordinates with intervals of about 5 values between each one just to test it out. Once I save this new .git, what is the procedure to move the right files into my game? I have the newly edited .git and .mod files. Where do these need to go, and I'm assuming I need to backup the files if I'm replacing things in the actual games files? Quote Share this post Link to post Share on other sites
DarthParametric 3,783 Posted January 11, 2019 As detailed above: 4 hours ago, DarthParametric said: For testing purposes, you can just copy the MOD into your K1 modules folder, then open it with ERFEdit and drag and drop your edited GIT in. Save the MOD. There will only be an existing MOD file if you have one from another mod. That's why they are used, so as not to overwrite the vanilla game files. 1 Quote Share this post Link to post Share on other sites
Guest Qui-Gon Glenn Posted January 11, 2019 TB12 made a population function that automates this. Quote Share this post Link to post Share on other sites
Mr Pure Pazaak 1 Posted January 11, 2019 How can I get this magic armband that'll give me coords? Quote Share this post Link to post Share on other sites
DarthParametric 3,783 Posted January 11, 2019 I don't use them myself, as a general rule, but I believe this should be what you need for K1 - https://www.nexusmods.com/kotor/mods/1076 1 Quote Share this post Link to post Share on other sites
Guest Qui-Gon Glenn Posted January 12, 2019 9 hours ago, Mr Pure Pazaak said: How can I get this magic armband that'll give me coords? If for K1, you don't really need it. Enter "whereami" into the in-game console (need cheats enabled/console on in .ini, use tilde "~" to access). This will give you your player's location and I think orientation, without any armband. However, Star Admiral made good stuff and if you need more info, the link @DarthParametric gave will provide it Quote Share this post Link to post Share on other sites
Mr Pure Pazaak 1 Posted January 12, 2019 That's allgood, I've been walking around with the armband manually putting in coordinates for different spawns around central beach, about to try it out with about 80 new spawns. Quote Share this post Link to post Share on other sites
Mr Pure Pazaak 1 Posted January 12, 2019 Alright so it doesn't spawn them in as of yet, I've attached my working in K GFF just to confirm that I'm duplicating and editing the structs correctly. I'm thinking my issue is that I'm not moving the files into my game correctly or something. I saved that .git file, copied my .mod into my K1 modules folder, open it with ERF editor, drag my .git file in, click yes to replace, and then save the .mod. What could be going wrong? Quote Share this post Link to post Share on other sites
Thor110 497 Posted January 12, 2019 (edited) If I were you I would just repackage the module file from scratch using the same files you have edited and kotor tool, this is what I do every time I edit a level, I don't use the ERF Editor, I just build each module through kotor tool every time I want to update it, trying to make as many changes as possible before re-building. Edited January 12, 2019 by Thor110 More detail added to my reply. 1 Quote Share this post Link to post Share on other sites
Mr Pure Pazaak 1 Posted January 12, 2019 I've already done all the steps in Darth's step by step instruction, I don't have much modding experience to be able to understand how to repackage from scratch or how it would be easier than what I've already tried. I'm just trying to troubleshoot where I've gone wrong from the guide using the method Darth has provided me with. Quote Share this post Link to post Share on other sites
JCarter426 1,214 Posted January 12, 2019 2 hours ago, Mr Pure Pazaak said: I saved that .git file, copied my .mod into my K1 modules folder, open it with ERF editor, drag my .git file in, click yes to replace, and then save the .mod. What could be going wrong? When you go to test it, are you loading a save from before you ever visited that module? 1 Quote Share this post Link to post Share on other sites
Mr Pure Pazaak 1 Posted January 12, 2019 Not from before ever going there, I have a save before going to the Unknown World I can try, I''m currently loading in from North Beach after already going through Central. Quote Share this post Link to post Share on other sites
JCarter426 1,214 Posted January 12, 2019 The game only loads data from the module files the first time you visit the module. It stores a copy of each module visited in the .sav file and subsequently loads from this. That's how it knows what containers you've looted, what NPCs have been killed or otherwise left the area, etc. So typically, if you make any change to a module, you have to load from before you've ever visited it. If you need to spawn creatures after you've visited the area, you would have to do it with a script. 1 Quote Share this post Link to post Share on other sites
Mr Pure Pazaak 1 Posted January 12, 2019 Alright I'll try my same process and load in from a save just before landing on the planet Quote Share this post Link to post Share on other sites
DarthParametric 3,783 Posted January 12, 2019 This was expressly noted: 19 hours ago, DarthParametric said: Start the game and load a save from before entering the Central Beach module for the first time 1 Quote Share this post Link to post Share on other sites
Mr Pure Pazaak 1 Posted January 12, 2019 Yeah no I figured it would be okay as long as you weren't in the actual module. I'll load in clean to try it in a bit. My bad Quote Share this post Link to post Share on other sites
Mr Pure Pazaak 1 Posted January 12, 2019 Yeah the save fixed it, thanks for the assistance! 1 Quote Share this post Link to post Share on other sites