Custom Chargen Scripts

Post » Mon Aug 02, 2010 5:45 am

So, I've been creating myself an Alternative Start mod. Most starts have been finished, but scripting just aint my thing. I need help.

I've tried to edit the "Chargen" script. I want the character to start in a specific room, "-Alternative Start Selection", with only vanity mode and view switch disabled. This is what I have:

;global character generation scriptbegin CharGen;short CharGenState is a global; 1 = start; -1 = all done. Set from CharGenDoorExitCaptain. Can save game after that is setDisablePlayerViewSwitchDisableVanityModePlayer->PositionCell 4672, 3456, 12736, "-Alternative Start Selection"ChangeWeather "Bitter Coast Region" 1 ;sets beginning weather to cloudy, looks nicerset CharGenState to 10stopscript CharGenend CharGen


When I try to save the script, I get told that I need to enter a Cell ID on Line 11. As you can see, I clearly have, and I've made sure there's no typos. In game, I'll start in the normal ship near the door out, with everything disabled that should be normally. That shouldn't happen. Can anyone tell me what I've done here?


Also, I created a book that is supposed to help with Chargen. When clicked for the first time, I should get the "enablenamemenu" script. When clicked for the Second time, "enableracemenu", etc, until the last time clicked I'll get "enablestatreviewmenu", and I'll get that every other time I click it.

My problem is, I don't know how to go about this. Again, some help would be appreciated. Thanks :goodjob:



One last question: Is an alternative start mod something you'd all be interested in? It's a personal mod, but I'll release it if anyone is interested.
User avatar
Brooks Hardison
 
Posts: 3410
Joined: Fri Sep 07, 2007 3:14 am

Post » Mon Aug 02, 2010 1:47 am

Player->PositionCell 4672, 3456, 12736, "-Alternative Start Selection"[/code]
When I try to save the script, I get told that I need to enter a Cell ID on Line 11. As you can see, I clearly have, and I've made sure there's no typos. In game, I'll start in the normal ship near the door out, with everything disabled that should be normally. That shouldn't happen. Can anyone tell me what I've done here?

The function PositionCell (and Position too) requires the z angle (angle from the top) :
Player->PositionCell 4672, 3456, 12736, 0, "-Alternative Start Selection"
I think that you get this error because the game considers that "-Alternative Start Selection" is the angle you want to use instead of the cell name.

One more thing is that you use comma after each value, but not after the name of the function.For more consistency, you should try to use one of those:
Player->PositionCell 4672 3456 12736 0 "-Alternative Start Selection"
Player->PositionCell, 4672, 3456, 12736, 0, "-Alternative Start Selection"
User avatar
John N
 
Posts: 3458
Joined: Sun Aug 26, 2007 5:11 pm

Post » Sun Aug 01, 2010 6:31 pm

The function PositionCell (and Position too) requires the z angle (angle from the top) :
Player->PositionCell 4672, 3456, 12736, 0, "-Alternative Start Selection"
I think that you get this error because the game considers that "-Alternative Start Selection" is the angle you want to use instead of the cell name.

One more thing is that you use comma after each value, but not after the name of the function.For more consistency, you should try to use one of those:
Player->PositionCell 4672 3456 12736 0 "-Alternative Start Selection"
Player->PositionCell, 4672, 3456, 12736, 0, "-Alternative Start Selection"

:bowdown:
User avatar
Tanika O'Connell
 
Posts: 3412
Joined: Fri Jan 26, 2007 1:34 am

Post » Mon Aug 02, 2010 6:22 am

Also, I created a book that is supposed to help with Chargen. When clicked for the first time, I should get the "enablenamemenu" script. When clicked for the Second time, "enableracemenu", etc, until the last time clicked I'll get "enablestatreviewmenu", and I'll get that every other time I click it.

After thinking a bit more about this, I think that I would try something like this:
begin chargenshort stateif ( state == 0 )	if ( onactivate == 1 )		enable the 1st menu		set state to 1	endifendifif ( state == 1 )	if ( onactivate == 1 )		enable the 2nd menu		set state to 2	endifendif...if ( state == x )	if ( onactivate == 1 )		enable the last menu		;keep the variable state at the same value	endifendifend

You should remember that book are difficult to use because they can be activated in game (click on them in game) or equiped in the inventory. The 1st case needs to use the function 'onactivate' and the 2nd one should theorically require 'onpcequip', however, books use 'pcskipequip' instead of 'onpcequip' if you use them in the inventory.
You should look at http://planetelderscrolls.gamespy.com/View.php?id=6083&view=Mods.Detail at pages 174 - 175.
One last question: Is an alternative start mod something you'd all be interested in? It's a personal mod, but I'll release it if anyone is interested.

There are already a few chargen mod around here, so I can assure you that one more would be a welcomed addition. :)
User avatar
Lory Da Costa
 
Posts: 3463
Joined: Fri Dec 15, 2006 12:30 pm

Post » Mon Aug 02, 2010 1:24 am

You should remember that book are difficult to use because they can be activated in game (click on them in game) or equiped in the inventory. The 1st case needs to use the function 'onactivate' and the 2nd one should theorically require 'onpcequip', however, books use 'pcskipequip' instead of 'onpcequip' if you use them in the inventory.
You should look at http://planetelderscrolls.gamespy.com/View.php?id=6083&view=Mods.Detail at pages 174 - 175.

Thanks for that, I'll get to testing it now. I can always just create an activator with the book mesh.
User avatar
Steve Smith
 
Posts: 3540
Joined: Sat Jun 30, 2007 10:47 am

Post » Mon Aug 02, 2010 1:58 am

Ok, another script. I've this set on my "book";

Spoiler
begin -ASChargen_Book_Script

short state

if ( state == 0 )
if ( onactivate == 1 )
enablenamemenu
set state to 1
endif
endif

if ( state == 1 )
if ( onactivate == 1 )
enableracemenu
set state to 2
endif
endif

if ( state == 2 )
if ( onactivate == 1 )
EnableClassMenu
set state to 3
endif
endif

if ( state == 3 )
if ( onactivate == 1 )
EnableBirthMenu
set state to 4
endif
endif

if ( state == 4 )
if ( onactivate == 1 )
EnableStatReviewMenu
;keep the variable state at the same value
"-ASObsticle 1"->Disable
set CharGenState to -1
endif
endif

end


Whenever I try to click it, though nothing happens. I've figured it's the ""-ASObsticle 1"->Disable" section, for some reason. That disables the obsticle over the doors to each different start. I need it there. Whenever I take it off the script, everything works fine. I have it set up as an activator with a book mesh.

edit: Nevermind. Everything's now working fine. For now at least...
User avatar
Ash
 
Posts: 3392
Joined: Tue Jun 13, 2006 8:59 am


Return to III - Morrowind