How to make a character generator for DnD in Skyrim.

Post » Wed Jun 20, 2012 11:33 pm

Basically, for every stat you make a faction rank, and set the default on the player to 9. Also have a global that is set to the number of stat points you want them to gain. Make the messages such that the button only appears if the associated FactionRank is >9 for decreasing and <18 for increasing. Then, in a dialogue option, you can put this:

int popupblocker = 0while TormInitStats.GetValue() as int >=1 && popupblocker ==0popupblocker = 1Int iButton = InitialStatsM.Show()	    If (iButton != -1)			    If (iButton == 0)					  Int iButton2 = InitialStatsDec.Show()				   if (Ibutton2 ==0)						 popupblocker = 0				   ElseIf (iButton2 == 1)						 Game.GetPlayer().SetFactionRank(DnDStrength, (Game.GetPlayer().GetFactionRank(DnDStrength) as int) +-1)					    TormInitStats.SetValue((TormInitStats.GetValue() as int) +1)						 popupblocker = 0				   ElseIf (iButton2 == 2)						 Game.GetPlayer().SetFactionRank(DnDDexterity, (Game.GetPlayer().GetFactionRank(DnDDexterity) as int) +-1)					    TormInitStats.SetValue((TormInitStats.GetValue() as int) +1)					    popupblocker = 0				   ElseIf (iButton2 == 3)						 Game.GetPlayer().SetFactionRank(DnDConstitution, (Game.GetPlayer().GetFactionRank(DnDConstitution) as int) +-1)					    TormInitStats.SetValue((TormInitStats.GetValue() as int) +1)					    popupblocker = 0				   ElseIf (iButton2 == 4)						 Game.GetPlayer().SetFactionRank(DnDIntelligence, (Game.GetPlayer().GetFactionRank(DnDIntelligence) as int) +-1)					    TormInitStats.SetValue((TormInitStats.GetValue() as int) +1)					    popupblocker = 0				   ElseIf (iButton2 == 5)						 Game.GetPlayer().SetFactionRank(DnDWisdom, (Game.GetPlayer().GetFactionRank(DnDWisdom) as int) +-1)					    TormInitStats.SetValue((TormInitStats.GetValue() as int) +1)					    popupblocker = 0				   ElseIf (iButton2 == 6)						 Game.GetPlayer().SetFactionRank(DnDCHarisma, (Game.GetPlayer().GetFactionRank(DnDCharisma) as int) +-1)					    TormInitStats.SetValue((TormInitStats.GetValue() as int) +1)					    popupblocker = 0				   endIf			    ElseIf (iButton == 1)						 Game.GetPlayer().SetFactionRank(DnDStrength, (Game.GetPlayer().GetFactionRank(DnDStrength) as int) +1)					    TormInitStats.SetValue((TormInitStats.GetValue() as int) +-1)					    popupblocker = 0			    ElseIf (iButton == 2)						 Game.GetPlayer().SetFactionRank(DnDDexterity, (Game.GetPlayer().GetFactionRank(DnDDexterity) as int) +1)					    TormInitStats.SetValue((TormInitStats.GetValue() as int) +-1)					    popupblocker = 0			    ElseIf (iButton == 3)						 Game.GetPlayer().SetFactionRank(DnDConstitution, (Game.GetPlayer().GetFactionRank(DnDConstitution) as int) +1)					    TormInitStats.SetValue((TormInitStats.GetValue() as int) +-1)					    popupblocker = 0			    ElseIf (iButton == 4)						 Game.GetPlayer().SetFactionRank(DnDIntelligence, (Game.GetPlayer().GetFactionRank(DnDIntelligence) as int) +1)					    TormInitStats.SetValue((TormInitStats.GetValue() as int) +-1)					    popupblocker = 0			    ElseIf (iButton == 5)						 Game.GetPlayer().SetFactionRank(DnDWisdom, (Game.GetPlayer().GetFactionRank(DnDWisdom) as int) +1)					    TormInitStats.SetValue((TormInitStats.GetValue() as int) +-1)					    popupblocker = 0			    ElseIf (iButton == 6)						 Game.GetPlayer().SetFactionRank(DnDCharisma, (Game.GetPlayer().GetFactionRank(DnDCharisma) as int) +1)					    TormInitStats.SetValue((TormInitStats.GetValue() as int) +-1)					    popupblocker = 0			    EndIf	    EndIfendwhile

Works like a charm.
User avatar
A Dardzz
 
Posts: 3370
Joined: Sat Jan 27, 2007 6:26 pm

Post » Wed Jun 20, 2012 7:21 pm

You can pass up to 10 float values to the http://www.creationkit.com/Show_-_Message command in order to display the player's current 'stats'. That would probably help a lot.

Spoiler
GlobalVariable property PointsAvailable autoMessage property StatAllocationBasemanu autoMessage property StatAllocationSubMenu autoFaction property DnDStrength autoFaction property DnDDexterity autoFaction property DnDConstitution autoFaction property DnDIntelligence autoFaction property DnDWisdom autoFaction property DnDCharisma autoActor property Player autoFunction ShowStatAllocBasemanu()	int choice = StatAllocationBasemanu.Show(Player.GetFactionRank(DnDStrength), Player.GetFactionRank(DnDDexterity), Player.GetFactionRank(DnDConstitution), Player.GetFactionRank(DnDIntelligence), Player.GetFactionRank(DnDWisdom), Player.GetFactionRank(DnDCharisma), PointsAvailable.Value)	if (choice == 6)		Return	elseif (choice == 0)		ShowStatAllocSubMenu(DndStrength)	elseif (choice == 1)		ShowStatAllocSubMenu(DndDexterity)	elseif (choice == 1)		ShowStatAllocSubMenu(DndConstitution)	elseif (choice == 1)		ShowStatAllocSubMenu(DndIntelligence)	elseif (choice == 1)		ShowStatAllocSubMenu(DndWisdom)	elseif (choice == 1)		ShowStatAllocSubMenu(DndCharisma)	endifEndFunctionFunction ShowStatAllocSubMenu(Faction StatFaction)	int choice = StatAllocationSubMenu.Show(Player.GetFactionRank(StatFaction), PointsAvailable.Value)	if (choice == 2)		ShowStatAllocBasemanu()		Return	elseif (choice == 0)		choice = -1	endif	Player.ModFactionRank(StatFaction, -choice)	PointsAvailable.Value += choice	ShowStatAllocSubMenu(StatFaction)EndFunction

[img]http://i39.tinypic.com/657var.jpg[/img]

[img]http://i42.tinypic.com/200a4og.jpg[/img]
User avatar
Antonio Gigliotta
 
Posts: 3439
Joined: Fri Jul 06, 2007 1:39 pm

Post » Wed Jun 20, 2012 8:10 pm

Once again you give me great advice that I don't understand at all.
User avatar
phil walsh
 
Posts: 3317
Joined: Wed May 16, 2007 8:46 pm

Post » Wed Jun 20, 2012 4:17 pm

Note that you still have to use Game.GetPlayer() instead of a property, if you use a property those functions won't work. I just spent a long time trying to figure out what was wrong with my script using a property for the player.
User avatar
suniti
 
Posts: 3176
Joined: Mon Sep 25, 2006 4:22 pm


Return to V - Skyrim