Alternate CharGen Tutorial

Post » Tue May 08, 2012 2:06 pm

Anyone know where I can find one? I want to get that part of Sunfall handled fairly soon.
User avatar
Nicola
 
Posts: 3365
Joined: Wed Jul 19, 2006 7:57 am

Post » Tue May 08, 2012 10:23 pm

I don't think Ive ever seen a tutorial on that subject. Probably because other than the basic premise, it is specific to the person doing it.

To put it simply, all you have to do is enable the menus ( name, race, class, and birthsign) and get the player to choose for each one. Some people simply have one scripted NPC who gives the menu options, and others make it as complicated as they want to suit their story line. The best place to start seeing how it's done is to look through the chargen scripts, paying attention to the scripts for Jiub, the dock guard, and the old guy whasisname inside. You'll see the commands needed for your script, and something of the order that works. then when you have questions ( if you do) you can just ask. It's really not very complicated, though it may seem so at first.

Just ignore the BS about "follow me to the office" and the non-essential actions that are in the chargen scripts. You'll want to script your own actions and voice anyway.

For an example, Thepal created a really short and easy chargen to go with his TC base mod "Thepal's Blank".
User avatar
CSar L
 
Posts: 3404
Joined: Fri Nov 09, 2007 9:36 pm

Post » Tue May 08, 2012 2:39 pm

Thank you very much. This is going to be a lot of trial and error I think.
User avatar
Ana Torrecilla Cabeza
 
Posts: 3427
Joined: Wed Jun 28, 2006 6:15 pm

Post » Tue May 08, 2012 11:28 pm

Maybe this helps:

http://planetelderscrolls.gamespy.com/View.php?view=Mods.Detail&id=8816
User avatar
Tarka
 
Posts: 3430
Joined: Sun Jun 10, 2007 9:22 pm

Post » Wed May 09, 2012 1:54 am

Thank you very much. This is going to be a lot of trial and error I think.
I afraid so. I took a look at some alt chargen mods when I was making my solsthiem chargen. It was a pain in the rear end. I still think that I managed to get it working by fluke. You have to work with scripts, dialogue and the ini.
User avatar
Lilit Ager
 
Posts: 3444
Joined: Thu Nov 23, 2006 9:06 pm

Post » Wed May 09, 2012 12:27 am

you don't necessarily need to change the .ini file you can achieve the desired result without it. if you plan on starting in an exterior Gibbo's New World on elricm is a mod that does it without ini changes. if you plan on starting in an interior you can delete all the objects in the prison ship and make it whatever interior you want.
User avatar
Tyrel
 
Posts: 3304
Joined: Tue Oct 30, 2007 4:52 am

Post » Tue May 08, 2012 5:04 pm

This is from my Royal Chargen mod - dunno if it's helpful:

Spoiler

begin 1jw_newcharNamescript;Effe-Tei takes Jiub's role; condensed into one short scriptfloat timershort stateshort doOnceshort noloreif ( menumode == 1)    returnendifif ( chargenstate == -1 )    returnendifif ( doOnce == 0 )    set timer to ( timer + GetSecondsPassed )                if ( timer > 59 )            set doOnce to 1            return        endif        if ( timer > 55 )            if ( state == 17 )                set state to 18                set CharGenState to -1                set ajw_newCharGen to 1                Messagebox "Effei-Tei: You're on your own now, ^PCName. I can take you to Vvardenfell to start your journey. Gods be with you. Goodbye"                endif            return        endif        if ( timer > 50 )            if (state == 16 )                set state to 17                Messagebox "Effe-Tei: You are to take this package to Caius Cosades, in the town of Balmora. Go to the South Wall Cornerclub, and ask for Caius Cosades -- they'll know where to find him. Serve him as you would serve the Emperor himself. I also have a letter for you, and a disbursal to your name."                Journal, "A1_1_FindSpymaster", 1                player->AddItem, "bk_A1_1_DirectionsCaiusCosades", 1                player->AddItem,  "bk_a1_1_caiuspackage", 1                player->Additem, "Gold_001", 500                addtopic "Caius Cosades"                Addtopic "South Wall"                addtopic "specific place"                addtopic "someone in particular"                addtopic "services"                addtopic "my trade"                addtopic "little secret"                addtopic "latest rumors"                addtopic "little advice"                addtopic "background"                addtopic "Morrowind"                addtopic "Princeps Almalexia"            endif            return        endif                if ( timer > 47 )            if (state == 15 )                Messagebox: "Effe-Tei: If it makes you feel any better, you will be missed."                set state to 16                enableinventorymenu                enablemagicmenu                enablemapmenu                enableplayerfighting                enableplayermagic                EnablePlayerJumping            endif            return        endif                if ( timer > 43 )            if ( state == 14 )                set state to 15                EnableStatsMenu                EnablePlayerControls                StartScript RaceCheck    ;sets the PCRace global flag for dialogue and such                EnablePlayerViewSwitch                EnableVanityMode            endif            return        endif                if ( timer > 39 )            if ( state == 13 )                set state to 14                EnableStatReviewMenu            endif            return        endif                if ( timer > 36 )            if ( state == 12 )                set state to 13                Messagebox "Effe-Tei: Before I write ahead to Caius Cosades - who of course shall not know of your noble heritage - do I have your details correct?"            endif            return        endif                if ( timer > 33 )            if ( state == 11 )                set state to 12                EnableBirthMenu            endif            return        endif                        if ( timer > 30 )            if ( state == 10 )                set state to 11                Messagebox "Effe-Tei: What sign were you born under?"            endif            return        endif                if ( timer > 27 )            if ( state == 9 )                set state to 10                EnableClassMenu            endif            return        endif                if ( timer > 24 )            if ( state == 8 )                set state to 9                Messagebox "Effe-Tei: Oh, and you'll need a profession."                "CharGen StatsSheet"->Disable        ;hide the actual scroll itself                "CharGen Boat"->Disable                "CharGen Boat Guard 1"->disable                "CharGen Boat Guard 2"->disable                "CharGen Dock Guard"->disable                "CharGen_cabindoor"->disable                "CharGen_chest_02_empty"->disable                "CharGen_crate_01"->disable                "CharGen_crate_01_empty"->disable                "CharGen_crate_01_misc01"->disable                "CharGen_crate_02"->disable                "CharGen_lantern_03_sway"->disable                "CharGen_ship_trapdoor"->disable                "CharGen_barrel_01"->disable                "CharGen_barrel_02"->disable                "CharGenbarrel_01_drinks"->disable                "CharGen_plank"->disable                DisablePlayerControls            endif            return        endif        if ( timer > 21 )            if ( state == 7 )                set state to 8                Enableracemenu            endif            return        endif                if ( timer > 18 )            if ( state == 6 )                set state to 7                Messagebox "Effe-Tei: You DO look like your mother. She was like you, a ...?"                EnableRest            endif            return        endif                if ( timer > 15 )            if ( state == 5 )                set state to 6                Messagebox "Effe-Tei: Let us hope that after a few weeks in Caius Cosades' care, we can speed your return. You are now banished from the Palace."                EnableMagicMenu            endif            return        endif                if ( timer > 12 )            if ( state == 4 )                set state to 5                Messagebox "Effei-Tei: Good. No harm done. Your father brings you this."                Player->additem "1jw_newchargen_letter" 1                EnablePlayerControls            endif            return        endif                        if ( timer > 8 )            if ( state == 3 )                set state to 4                EnableNameMenu            endif            return        endif                if ( timer > 5 )            if ( state == 2 )                set state to 3            Say, "Vo\Misc\CharGenName1.wav", "Stand up, there you go. You passed out. What's your name?"            endif            return        endif        ;---------------------------------------------        if ( timer > 2 )            if ( state == 1 )                set state to 2                Messagebox "Effe-Tei: Guards! This one falls. Do you remember your name?"            endif            return        endif                if ( timer > 0 )            if ( state == 0 )                set state to 1                Say, "vo\a\m\Hlo_AM104.mp3", "It looks unwell, unhealthy..."            endif            return        endif        endif        end
User avatar
Tammie Flint
 
Posts: 3336
Joined: Mon Aug 14, 2006 12:12 am

Post » Tue May 08, 2012 10:09 am

This is from my Royal Chargen mod - dunno if it's helpful:

Spoiler

begin 1jw_newcharNamescript;Effe-Tei takes Jiub's role; condensed into one short scriptfloat timershort stateshort doOnceshort noloreif ( menumode == 1)	returnendifif ( chargenstate == -1 )	returnendifif ( doOnce == 0 )	set timer to ( timer + GetSecondsPassed )				if ( timer > 59 )			set doOnce to 1			return		endif		if ( timer > 55 )			if ( state == 17 )				set state to 18				set CharGenState to -1				set ajw_newCharGen to 1				Messagebox "Effei-Tei: You're on your own now, ^PCName. I can take you to Vvardenfell to start your journey. Gods be with you. Goodbye"				endif			return		endif		if ( timer > 50 )			if (state == 16 )				set state to 17				Messagebox "Effe-Tei: You are to take this package to Caius Cosades, in the town of Balmora. Go to the South Wall Cornerclub, and ask for Caius Cosades -- they'll know where to find him. Serve him as you would serve the Emperor himself. I also have a letter for you, and a disbursal to your name."				Journal, "A1_1_FindSpymaster", 1				player->AddItem, "bk_A1_1_DirectionsCaiusCosades", 1				player->AddItem,  "bk_a1_1_caiuspackage", 1				player->Additem, "Gold_001", 500				addtopic "Caius Cosades"				Addtopic "South Wall"				addtopic "specific place"				addtopic "someone in particular"				addtopic "services"				addtopic "my trade"				addtopic "little secret"				addtopic "latest rumors"				addtopic "little advice"				addtopic "background"				addtopic "Morrowind"				addtopic "Princeps Almalexia"			endif			return		endif				if ( timer > 47 )			if (state == 15 )				Messagebox: "Effe-Tei: If it makes you feel any better, you will be missed."				set state to 16				enableinventorymenu				enablemagicmenu				enablemapmenu				enableplayerfighting				enableplayermagic				EnablePlayerJumping			endif			return		endif				if ( timer > 43 )			if ( state == 14 )				set state to 15				EnableStatsMenu				EnablePlayerControls				StartScript RaceCheck	;sets the PCRace global flag for dialogue and such				EnablePlayerViewSwitch				EnableVanityMode			endif			return		endif				if ( timer > 39 )			if ( state == 13 )				set state to 14				EnableStatReviewMenu			endif			return		endif				if ( timer > 36 )			if ( state == 12 )				set state to 13				Messagebox "Effe-Tei: Before I write ahead to Caius Cosades - who of course shall not know of your noble heritage - do I have your details correct?"			endif			return		endif				if ( timer > 33 )			if ( state == 11 )				set state to 12				EnableBirthMenu			endif			return		endif						if ( timer > 30 )			if ( state == 10 )				set state to 11				Messagebox "Effe-Tei: What sign were you born under?"			endif			return		endif				if ( timer > 27 )			if ( state == 9 )				set state to 10				EnableClassMenu			endif			return		endif				if ( timer > 24 )			if ( state == 8 )				set state to 9				Messagebox "Effe-Tei: Oh, and you'll need a profession."				"CharGen StatsSheet"->Disable		;hide the actual scroll itself				"CharGen Boat"->Disable				"CharGen Boat Guard 1"->disable				"CharGen Boat Guard 2"->disable				"CharGen Dock Guard"->disable				"CharGen_cabindoor"->disable				"CharGen_chest_02_empty"->disable				"CharGen_crate_01"->disable				"CharGen_crate_01_empty"->disable				"CharGen_crate_01_misc01"->disable				"CharGen_crate_02"->disable				"CharGen_lantern_03_sway"->disable				"CharGen_ship_trapdoor"->disable				"CharGen_barrel_01"->disable				"CharGen_barrel_02"->disable				"CharGenbarrel_01_drinks"->disable				"CharGen_plank"->disable				DisablePlayerControls			endif			return		endif		if ( timer > 21 )			if ( state == 7 )				set state to 8				Enableracemenu			endif			return		endif				if ( timer > 18 )			if ( state == 6 )				set state to 7				Messagebox "Effe-Tei: You DO look like your mother. She was like you, a ...?"				EnableRest			endif			return		endif				if ( timer > 15 )			if ( state == 5 )				set state to 6				Messagebox "Effe-Tei: Let us hope that after a few weeks in Caius Cosades' care, we can speed your return. You are now banished from the Palace."				EnableMagicMenu			endif			return		endif				if ( timer > 12 )			if ( state == 4 )				set state to 5				Messagebox "Effei-Tei: Good. No harm done. Your father brings you this."				Player->additem "1jw_newchargen_letter" 1				EnablePlayerControls			endif			return		endif						if ( timer > 8 )			if ( state == 3 )				set state to 4				EnableNameMenu			endif			return		endif				if ( timer > 5 )			if ( state == 2 )				set state to 3			Say, "Vo\Misc\CharGenName1.wav", "Stand up, there you go. You passed out. What's your name?"			endif			return		endif		;---------------------------------------------		if ( timer > 2 )			if ( state == 1 )				set state to 2				Messagebox "Effe-Tei: Guards! This one falls. Do you remember your name?"			endif			return		endif				if ( timer > 0 )			if ( state == 0 )				set state to 1				Say, "vo\a\m\Hlo_AM104.mp3", "It looks unwell, unhealthy..."			endif			return		endif		endif		end

I might be able to adapt that, thanks.
User avatar
Cool Man Sam
 
Posts: 3392
Joined: Thu May 10, 2007 1:19 pm

Post » Tue May 08, 2012 11:10 am

I don't think Ive ever seen a tutorial on that subject. Probably because other than the basic premise, it is specific to the person doing it.

This very much. Chargen script(s) depends very much on how complicated you want it to be. It can be from one script consisting of like 20 lines, or it can be a whole mini-quest ala Skyrim tutorial with bunch of little quests, enemies and whatnot. It also depends on the way you want to present the goodies, and if you want to present them at all (for instance if you're doing a TC and your main character is set character with set name and class, you obviously won't need the name and class creation menus).
User avatar
tegan fiamengo
 
Posts: 3455
Joined: Mon Jan 29, 2007 9:53 am

Post » Tue May 08, 2012 9:50 pm

Basically my intent is to start the game off in a Daggerfall-like fashion, where I create my character and then start the game.

Near as I can tell, no matter how I do this, I will need the following functions:


EnableNameMenu
enableracemenu
EnableMagicMenu
enablemapmenu
EnableInventoryMenu
EnablePlayerControls
enableplayerfighting
enableplayermagic
EnablePlayerJumping
EnableclassMenu
EnableStatsMenu
EnablePlayerViewSwitch
EnableVanityMode
EnableStatReviewMenu
EnableBirthMenu

(If I'm missing any, or don't need all of them, please let me know.)

What I don't know is how to make the necessary menus appear, one after the other, before I begin playing. I also don't know how to determine where I start off at.
User avatar
STEVI INQUE
 
Posts: 3441
Joined: Thu Nov 02, 2006 8:19 pm

Post » Wed May 09, 2012 12:19 am

Look in the CharGen boat for hints. eg. a spawn marker. I don't know if there is one but if there is than that's where it would be.
User avatar
Mandy Muir
 
Posts: 3307
Joined: Wed Jan 24, 2007 4:38 pm

Post » Tue May 08, 2012 10:43 pm

Basically my intent is to start the game off in a Daggerfall-like fashion, where I create my character and then start the game.

Near as I can tell, no matter how I do this, I will need the following functions:


EnableNameMenu
enableracemenu
EnableMagicMenu
enablemapmenu
EnableInventoryMenu
EnablePlayerControls
enableplayerfighting
enableplayermagic
EnablePlayerJumping
EnableclassMenu
EnableStatsMenu
EnablePlayerViewSwitch
EnableVanityMode
EnableStatReviewMenu
EnableBirthMenu

(If I'm missing any, or don't need all of them, please let me know.)

What I don't know is how to make the necessary menus appear, one after the other, before I begin playing. I also don't know how to determine where I start off at.
When your script says "enablebirthmenu" etc., that is all you need to do: that's what makes it pop up at the requisite time, so putting those lines in the script as a list like that will indeed make them appear one after the other. You just have to run the script at the beginning of the game, and voila. You can start off whereever you like, but you do need a trigger for the script to run. You could attach it to an activator, or you can run it through the dialogue resultsbox as a global script.

As well as the "enable" list, as you'll see in my example above, you also need to disable the chargen boat and actors, or else you'll end up having to run through chargen again when you arrive in Seyda Neen. It's all in the script example, which as you can see, runs backwards through a timer.
User avatar
Adrian Powers
 
Posts: 3368
Joined: Fri Oct 26, 2007 4:44 pm

Post » Wed May 09, 2012 12:05 am

As well as the "enable" list, as you'll see in my example above, you also need to disable the chargen boat and actors, or else you'll end up having to run through chargen again when you arrive in Seyda Neen. It's all in the script example, which as you can see, runs backwards through a timer.

Would simply removing all vanilla CharGen-related stuff, including the scripts, from the game suffice?
User avatar
His Bella
 
Posts: 3428
Joined: Wed Apr 25, 2007 5:57 am

Post » Tue May 08, 2012 6:45 pm

Okay, I got a script working but I need to know two things:

1) How do I prevent my character from automatically being clothed?

2) How do I determine the precise spot within a cell that I want to spawn on?
User avatar
krystal sowten
 
Posts: 3367
Joined: Fri Mar 09, 2007 6:25 pm

Post » Wed May 09, 2012 12:49 am

1) How do I prevent my character from automatically being clothed?

Player-> RemoveItem "common_shirt_01" 1
Player-> RemoveItem "common_shoes_01" 1
Player-> RemoveItem "common_pants_01" 1
User avatar
louise hamilton
 
Posts: 3412
Joined: Wed Jun 07, 2006 9:16 am

Post » Tue May 08, 2012 11:00 pm

Player-> RemoveItem "common_shirt_01" 1
Player-> RemoveItem "common_shoes_01" 1
Player-> RemoveItem "common_pants_01" 1

Sweet, thanks. Now to get the spawn point just right...
User avatar
saharen beauty
 
Posts: 3456
Joined: Wed Nov 22, 2006 12:54 am

Post » Wed May 09, 2012 2:08 am

The remove script Dana Nova Darko gave you should work, but just as information, if you look in the NPC tab of the CS you will find "Player" listed there. You can add or remove anything you want directly there as you would any NPC.
User avatar
Flash
 
Posts: 3541
Joined: Fri Oct 13, 2006 3:24 pm

Post » Tue May 08, 2012 7:51 pm

The remove script Dana Nova Darko gave you should work, but just as information, if you look in the NPC tab of the CS you will find "Player" listed there. You can add or remove anything you want directly there as you would any NPC.

That is going to help a lot, thanks.

Why doesn't this command work?

Player->PositionCell 5121, 102620, 0 "Abanembra, Gloomy Caves"

It keeps saying I need to input the cell ID, but clearly I already did that.
User avatar
SWagg KId
 
Posts: 3488
Joined: Sat Nov 17, 2007 8:26 am

Post » Tue May 08, 2012 11:03 am

Okay now the game is automatically starting anew, and dropping me off as a Dunmer in the middle of the Ashlands. PostionCell isn't working, only CenterOnCell does, which doesn't give me the results I want, and now this.

This. Is. Infuriating.

I'm officially done messing with CharGen crap. Which means no Sunfall.
User avatar
Shannon Lockwood
 
Posts: 3373
Joined: Wed Aug 08, 2007 12:38 pm

Post » Tue May 08, 2012 4:31 pm

The game isn't recognizing that cell ID. Check for misspelling, or see if that cell has an extra space attached before the first or after the last visible letter...

It also could be looking for the compass heading, which can be fixed by adding another 0 to the position.
User avatar
Andrew Lang
 
Posts: 3489
Joined: Thu Oct 11, 2007 8:50 pm

Post » Wed May 09, 2012 12:13 am

No misspellings, no spaces. The game recognizes the ID if I'm not trying to position my character in a precise spot.

I appreciate the help, but I can't tolerate this anymore. I'm done. Manipulating the CharGen has been way too frustrating for me to be worth it.
User avatar
Sandeep Khatkar
 
Posts: 3364
Joined: Wed Jul 18, 2007 11:02 am

Post » Tue May 08, 2012 10:21 pm

I also PM'ed you, Tonal.



This is the basics of the chargen script, I hope this helps:
(good resources are any chargen mod. a lot of this comes from Midgetalien's Solstheim Alternnate Beginning)





Begin chargenew

short State
;this makes it so all the menus don't pop up at once
; you can also make it a global, so you can have multiple scripts running to do all this, so you can have multiple guys ask you all this, ala oblivion





;first, you need to position the player: (look at the uesp article on the "position" console command for more info)

;this simply positions the player where you want to start. if you want to start in an exterior, use Player->Position. if you want to start in an interior, use Player->PositionCell
;I don't understand position (exterior) command very well, so you need to ask about that, if you want to use it
Player->Position, X, Y, Z, ZRot
Player->PositionCell, X, Y, Z, ZRot, "CellID"

X,Y,Z = location in the cell to move to the object to.
ZRot= Z-axis orientation of the object (degrees, 0=North, 180=South)
CellID =cell name


;example: player->PositionCell, 106, 1241, -105, "Ald'ruhn, Manor District"

;original morrowind example: Player->PositionCell 61,-135, 24, 340, "Imperial Prison Ship"





if ( menumode == 1)
return
endif
; makes sure that it doesn't start if menumode is up, not strictly needed, but good practice

if ( State == 0 )
;remember, all variables start at zero
disablePlayerControls
;not strictly needed, but again, good practice
EnableNameMenu
;enables the "name menu", ala jiub
set State to 10

elseif ( State == 10 )
EnableRaceMenu
;enables the "race menu", like when the guard asks where you are from
set State to 20

elseif ( State == 20 )
EnableClassMenu
;class menu. "there are a few ways to do this... etc."
set State to 30

elseif ( State == 30 )
EnableBirthMenu
; birthsign menu. "you said you were born under a certain star... etc.)
set State to 40

elseif ( State == 40 )
EnableStatReviewMenu
;stat review, so you can make sure you didn't mess up. "is this information all correct?"
set State to 60

elseif ( State == 60 )
"CharGen StatsSheet"->disable
"CharGen Boat"->Disable
"CharGen Boat Guard 1"->disable
"CharGen Boat Guard 2"->disable
"CharGen Dock Guard"->disable
"CharGen_cabindoor"->disable
"CharGen_chest_02_empty"->disable
"CharGen_crate_01"->disable
"CharGen_crate_01_empty"->disable
"CharGen_crate_01_misc01"->disable
"CharGen_crate_02"->disable
"CharGen_lantern_03_sway"->disable
"CharGen_ship_trapdoor"->disable
"CharGen_barrel_01"->disable
"CharGen_barrel_02"->disable
"CharGenbarrel_01_drinks"->disable
"CharGen_plank"->disable
"CharGen Door Hall"->Unlock
;makes sure that the chargen boat is disabled, so you don't see it if you go to seyda neen.

StartScript RaceCheck
;checks the race, and sets a global variable, so you can use it in dialouge. "that nasty nord/dunmer/wood elf twit, etc."
enableplayerfighting
enableplayermagic
enableplayercontrols
EnablePlayerJumping
EnablePlayerViewSwitch2
EnableVanityMode
enablestatsmenu
enableinventorymenu
enablemagicmenu
enablemapmenu
EnableRest
; enables all the menus, etc.
set CharGenState to -1
;global variable that makes sure that you don't have to go through the chargen proccess again.
set State to -1
;makes sure the char creation menus don't come up.


;if you want the package to give to caius, you need this command: Player->additem "bk_a1_1_caiuspackage" 1
;if you use that, do it when you are ready, and only then


endif


End chargenew
User avatar
Lewis Morel
 
Posts: 3431
Joined: Thu Aug 16, 2007 7:40 pm

Post » Tue May 08, 2012 3:48 pm

Well, Tonal is having some problems with his script, and I'm stumped. If more experienced scripters could help, that would be great. The problem he is having is:

Spoiler
Well, it works, except for one small problem. When I get to the stat review sheet, the background goes black (whereas just before then, I could see the brazier I placed in the cave my character is standing in), and my control response is sluggish, and clicking on the Okay button does nothing.

The script he is using is:

Spoiler
Begin CharGen

short State
;this makes it so all the menus don't pop up at once
; you can also make it a global, so you can have multiple scripts running to do all this, so you can have multiple guys ask you all this, ala oblivion

;first, you need to position the player: (look at the uesp article on the "position" console command for more info)

;this simply positions the player where you want to start. if you want to start in an exterior, use Player->Position. if you want to start in an interior, use Player->PositionCell
;I don't understand position (exterior) command very well, so you need to ask about that, if you want to use it
Player->PositionCell, 2847, 5188, 10244, 0, "Abanembra"

;example: player->PositionCell, 106, 1241, -105, "Ald'ruhn, Manor District"

;original morrowind example: Player->PositionCell 61,-135, 24, 340, "Imperial Prison Ship"

if ( menumode == 1)
return
endif
; makes sure that it doesn't start if menumode is up, not strictly needed, but good practice

if ( State == 0 )
;remember, all variables start at zero
disablePlayerControls
;not strictly needed, but again, good practice
EnableNameMenu
;enables the "name menu", ala jiub
set State to 10

elseif ( State == 10 )
EnableRaceMenu
;enables the "race menu", like when the guard asks where you are from
set State to 20

elseif ( State == 20 )
EnableClassMenu
;class menu. "there are a few ways to do this... etc."
set State to 30

elseif ( State == 30 )
EnableBirthMenu
; birthsign menu. "you said you were born under a certain star... etc.)
set State to 40

elseif ( State == 40 )
EnableStatReviewMenu
;stat review, so you can make sure you didn't mess up. "is this information all correct?"
set State to 60

elseif ( State == 60 )
"CharGen StatsSheet"->disable
"CharGen Boat"->Disable
"CharGen Boat Guard 1"->disable
"CharGen Boat Guard 2"->disable
"CharGen Dock Guard"->disable
"CharGen_cabindoor"->disable
"CharGen_chest_02_empty"->disable
"CharGen_crate_01"->disable
"CharGen_crate_01_empty"->disable
"CharGen_crate_01_misc01"->disable
"CharGen_crate_02"->disable
"CharGen_lantern_03_sway"->disable
"CharGen_ship_trapdoor"->disable
"CharGen_barrel_01"->disable
"CharGen_barrel_02"->disable
"CharGenbarrel_01_drinks"->disable
"CharGen_plank"->disable
"CharGen Door Hall"->Unlock
;makes sure that the chargen boat is disabled, so you don't see it if you go to seyda neen.

StartScript RaceCheck
;checks the race, and sets a global variable, so you can use it in dialouge. "that nasty nord/dunmer/wood elf twit, etc."
enableplayerfighting
enableplayermagic
enableplayercontrols
EnablePlayerJumping
EnablePlayerViewSwitch
EnableVanityMode
enablestatsmenu
enableinventorymenu
enablemagicmenu
enablemapmenu
EnableRest
; enables all the menus, etc.
set CharGenState to -1
;global variable that makes sure that you don't have to go through the chargen proccess again.
set State to -1
;makes sure the char creation menus don't come up.


;if you want the package to give to caius, you need this command: Player->additem "bk_a1_1_caiuspackage" 1
;if you use that, do it when you are ready, and only then


endif


End CharGen

I'm fairly sure part of it is because we didn't specify a stopscript, but I can't get it to work. (I made a cell called "testcell" and replaced

Player->PositionCell, 2847, 5188, 10244, 0, "Abanembra"
with
Player->PositionCell, 1, 1, 1, 0, "testcell"
User avatar
Annika Marziniak
 
Posts: 3416
Joined: Wed Apr 18, 2007 6:22 am

Post » Wed May 09, 2012 12:39 am

While it doesn't really make sense, there is often an issue with long if blocks that contain several elseifs. If your script doesn't run correctly, sometimes removing elseifs and breaking them into if blocks will help. Also, the next section after the stat review is a very long if block with many things being done and even includes a startscript.

Trying to do too much in a single if block is mentioned as a problem in MWSFD, so you might want to break that up as well. I don't see anything wrong with your script as it is and it would seem that it should work, so perhaps it is just a matter of the Morrwind script destroying bugs that crop up now and again.

To simplify, my advice is to eliminate some elseifs changing them to if blocks and break that long if block into 3 or even 4 if blocks and see if that changes the results. The other advantage to several if blocks is that you can insert messageboxes at each stage, and that will help you debug if just breaking it up doesn't fix it.
User avatar
josh evans
 
Posts: 3471
Joined: Mon Jun 04, 2007 1:37 am

Post » Wed May 09, 2012 12:40 am

How exactly do I break them up appropriately?
User avatar
Je suis
 
Posts: 3350
Joined: Sat Mar 17, 2007 7:44 pm

Next

Return to III - Morrowind