Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Changing game start location

Page: 1 of 1
 revanmg
06-28-2007, 3:13 PM
#1
I was wondering how to change the starting location of the game. Like getting rid of the starting cut scene, and making the player start in a different module.
 SithRevan
06-28-2007, 5:09 PM
#2
Really you can make the player start anywhere you want them to actually. It may screw up the game but it is possible.;)

If you wanted to do that you would need to first make a script that would set all of the globals up to the point of where you want to start off. You would also need to make sure that this said script jumped you to the module you wanted to go to when the game first loads.

BTW, where did you have in mind for starting off that game and which version of the game exactly would you like to be able to do this in?
 revanmg
06-28-2007, 10:54 PM
#3
I am making it for Kotor 1. Here is what I wanted to do. I am planning on making a mod that has the player play as a sith. I know that their might be one made already but I enjoy making mods and wanted to make this mod. I have made a new version of the first level on the republic space ship. I want to have the player start off where the dark jedi is (the one that kills the npc that follows the player in the beginning). Then obviously the player would play through my new story. (although the player would still not be Revan, the player would just be a normal soldier). But to do this I needed to change the start module and location within it. I hope this helps you understand what I am trying to do and I am sure that it is possible. I have the module mostly completed just a few extra things I wanted to add in but it is ready to have the starting location thing set up.

I haven't done much with scripting but the best way that I lean this kind of stuff is learning it the way that I am, So if you could explain the scripting thing a little it would help or even direct me to a tutorial that I could check out to see if I can try to figure out how to incorporate it. Thanks
 SithRevan
06-28-2007, 11:50 PM
#4
Well I would suggest asking one of the more knowledgable scripting modders around here as I am not much a of a scripter and more of a module designer. Stoffe or tk102 would probably be able to help you with better then I could.;)

Sorry that I can't be more be more help to you.
 stoffe
06-29-2007, 5:56 AM
#5
But to do this I needed to change the start module and location within it. I hope this helps you understand what I am trying to do and I am sure that it is possible. I have the module mostly completed just a few extra things I wanted to add in but it is ready to have the starting location thing set up.

As far as I am aware the name of the first module that's loaded when you start a new game is hardcoded in the game engine. So you'd either need to name your new module the same thing to make the game load yours, or modify the original start module's OnModuleLoad event script to immediately transition to your new area instead of triggering the usual cutscenes where the ships gets attacked and you wake up.
 revanmg
06-29-2007, 12:16 PM
#6
After looking at some of the scripts I was unable to find one that I could edit so I am guessing that my only choice is to rename the module, although how would I make a new script that would move the player to a coordinate within the module this way I could place the player where I want them to be.
 stoffe
06-29-2007, 12:47 PM
#7
Do you know which script is the one that I would modify. Also could you explain how I would go about doing this. I think I could probably figure out how to change the module, but the part of placement within the module might give me some problems trying to mess with. It seems like it would be more easy to modify the script because then I think I would be able to control where within the module the player will start off instead of having to script that later, if I could do it all at once in one script I would be very happy.

The end_m01aa (Endar Spire Command) area has an OnEnter script called k_pend_area01. If you replace this script with your own that just warps to a new area immediately that should probably be enough. Something like:


void main() {
if (GetIsPC(GetEnteringObject())) {
StartNewModule("NameOfYourModule");
}
}
 revanmg
06-29-2007, 12:56 PM
#8
O ok I am starting to get this now. The only other question I have left is how do I control where within the module the player will go. Mainly something like a player.move (X,Y,Z). Although I know that isn't the right script.
 stoffe
06-29-2007, 1:28 PM
#9
O ok I am starting to get this now. The only other question I have left is how do I control where within the module the player will go. Mainly something like a player.move (X,Y,Z). Although I know that isn't the right script.

If the module you warp the player to is a custom module you've made yourself you can set the module starting location in the module.ifo file of your module. Set the X and Y coordinates in the Mod_Entry_X and Mod_Entry_Y fields. Then the player will automatically end up at that location when the module starts.

As an alternative you can place a waypoint in the area where you want the player to appear, and then specify the tag of that waypoint as a second parameter to the StartNewModule() function call.
 revanmg
06-29-2007, 1:42 PM
#10
Ok thanks, I wound up changing the name instead of using a script because I couldn't get it to change the module. All I got was it to stop the cut scenes. But I have it starting in the new module, and in the correct place. Thanks.
Page: 1 of 1