Difference between revisions of "Tutorial:Race Specific Start Spells"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Shadowndacorner
imported>Shadowndacorner
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Introduction ==
== Introduction ==
Awhile back, I was trying to make a new race that had it's own set of starting spells.  After looking around a bit, I noticed there really wasn't one.  So, after 3 hours of typing, this is the tutorial on creating player starting spells depending on what race the player is.  It will add the spell if the script hasn't run yet, meaning that you don't have to start a new game.   
Awhile back, I was trying to make a new race that had it's own set of starting spells.  After looking around a bit for a tutorial, I noticed there really wasn't one.  So, after 3 hours of typing, this is the tutorial on creating player starting spells depending on certain conditions (like race, gender, etc; not limited to spells, though).  It will add the spell if the script hasn't run yet, meaning that you don't have to start a new game.   
__TOC__
__TOC__
== How to do it ==
== Method 1 ==


There are a few ways to do it, the simplest is in the race menu (select your race and drag the spell to "Specials"), but the following script allows an extra degree of control, such as items, special quests, and alternate starting places (using "MoveTo [XMarker/Item]"):
This method is a way to set extra conditions.  The only downside is that it's incompatible with any mods that add a script to the PC (Player Character):


  scn AAPlayerScript
  scn AAPlayerScript
Line 34: Line 34:
  EndIf
  EndIf


This whole part is basically saying: "If the script hasn't run yet and if the player is an Argonian then add AACustomRaceSpell01 to the player's spell list."  You could change that to say "VampireRace" or you could make it Class/ Birthsign specific (of course that would be much easier simply putting that in in the Class/ Birthsign dialogue box).
This whole part is basically saying: "If the script hasn't run yet and if the player is an Argonian then add AACustomRaceSpell01 to the player's spell list."
 
To enforce the script, go into NPCs and double-click on "Player".  Click on the drop down box next to the word "Script".  Select the script we just made (if you copy/pasted it, it will be AAPlayerScript).  Hit "OK" and you're done.
 
== Method 2==
This method also allows you to set extra conditions, but is also compatible with mods adding a script to the player.  This is the recommended way to go.
 
First of all, go into the quests window (the "Q" in the top right of the toolbar; to the left of the dialogue button).  Right click on the list of quests and select "New".  Make the Form ID whatever you want.  Go into Quest Stages and make 2; the first one 0 and the second one 10.  Other than that, leave it as is for now.
 
Now go to Gameplay -> Edit Scripts and click File -> New.  Type the following code:
 
scn AATestQuestScript
Begin GameMode
if GetStage [Quest we made earlier's FormID] != 10
if player.getisrace [Race FormID]
player.addspell [spell FormID]
  ;Message "You have learned a new spell because you're an Argonian!"
SetStage [Quest we made earlier's FormID] 10
EndIf
EndIf
End
 
The script is saying "If the quest's stage is not 10 and if the player is [whatever race you specified] add the spell [whatever spell you specified] and set the quest's stage to 10 so we don't do this again."  '' '''NOTE:''' The reason that the line "Message "You have learned a new spell because you're an Argonian!" " has a semicolon before it is to tell the script to ignore this line.  If you remove it, you'll notice that when you start the game there will be a message saying "You have learned a new spell because you're an Argonian!".''  Before you exit out, be sure to set it as a Quest Script.
 
Open up the Quest window again and select your quest.  Set the script to the script we just wrote.
 
== Method 3==
This is the way Bethesda did it (I think), but it is also the most limited method.  You can only do race-specific things with this method (and it can only be used for spells).
 
Click on Character -> Race.  Drag a spell from the Object window into "Specials".
 
That's it.


To enforce the script, go into NPCs and find "Player".  Click on the drop down box next to the word "Script".  Select the script we just made (if you copy/pasted it, it will be AAPlayerScript).  Hit "OK" and you're done.
== Closing ==
== Closing ==


I figured this method out on my own, so I don't know if this is how Bethesda did the spells for official races (such as the Imperial's "Voice of the Emperor" spell).  This can be used for many things.  Instead of using addspell, you could use additem and add some kind of special armor, weapon, or just make that race rich.  You can, of course, add multiple spells and multiple items.
I'm pretty sure Bethesda used Method 3, but if you want to have extra conditions such as Gender or item equipped I would use Method 2.  This can be used for many things.  Instead of using addspell, you could use additem to add some kind of special armor, weapon, or just make that race rich, you could complete another quest, you could start another quest, or really anything else that you can do with scripting.  The reason I even mentioned Method 1 is that Quest scripts do have some limits.  You can, of course, add multiple spells/items.

Latest revision as of 11:42, 8 June 2010

Introduction[edit | edit source]

Awhile back, I was trying to make a new race that had it's own set of starting spells. After looking around a bit for a tutorial, I noticed there really wasn't one. So, after 3 hours of typing, this is the tutorial on creating player starting spells depending on certain conditions (like race, gender, etc; not limited to spells, though). It will add the spell if the script hasn't run yet, meaning that you don't have to start a new game.

Method 1[edit | edit source]

This method is a way to set extra conditions. The only downside is that it's incompatible with any mods that add a script to the PC (Player Character):

scn AAPlayerScript

short DoOnce

Begin GameMode

If DoOnce != 1
 If GetIsRace Argonian ;can put any race here (even custom races)
  addspell AACustomRaceSpell01 ;put the spell for this race here
 EndIf
EndIf

If DoOnce != 1
 If GetIsRace Imperial ;can put another race here
  addspell AACustomRaceSpell02 ;put the spell for this race here
 EndIf
EndIf
;Copy/ Paste this for every race with race-specific spells
End

Let's look at the "If" chain:

If DoOnce != 1
 If GetIsRace Argonian ;can put any race here (even custom races)
  addspell AACustomRaceSpell01 ;put the spell for this race here
 EndIf
EndIf

This whole part is basically saying: "If the script hasn't run yet and if the player is an Argonian then add AACustomRaceSpell01 to the player's spell list."

To enforce the script, go into NPCs and double-click on "Player". Click on the drop down box next to the word "Script". Select the script we just made (if you copy/pasted it, it will be AAPlayerScript). Hit "OK" and you're done.

Method 2[edit | edit source]

This method also allows you to set extra conditions, but is also compatible with mods adding a script to the player. This is the recommended way to go.

First of all, go into the quests window (the "Q" in the top right of the toolbar; to the left of the dialogue button). Right click on the list of quests and select "New". Make the Form ID whatever you want. Go into Quest Stages and make 2; the first one 0 and the second one 10. Other than that, leave it as is for now.

Now go to Gameplay -> Edit Scripts and click File -> New. Type the following code:

scn AATestQuestScript

Begin GameMode
if GetStage [Quest we made earlier's FormID] != 10
if player.getisrace [Race FormID]
player.addspell [spell FormID]
;Message "You have learned a new spell because you're an Argonian!"
SetStage [Quest we made earlier's FormID] 10
EndIf
EndIf
End

The script is saying "If the quest's stage is not 10 and if the player is [whatever race you specified] add the spell [whatever spell you specified] and set the quest's stage to 10 so we don't do this again." NOTE: The reason that the line "Message "You have learned a new spell because you're an Argonian!" " has a semicolon before it is to tell the script to ignore this line. If you remove it, you'll notice that when you start the game there will be a message saying "You have learned a new spell because you're an Argonian!". Before you exit out, be sure to set it as a Quest Script.

Open up the Quest window again and select your quest. Set the script to the script we just wrote.

Method 3[edit | edit source]

This is the way Bethesda did it (I think), but it is also the most limited method. You can only do race-specific things with this method (and it can only be used for spells).

Click on Character -> Race. Drag a spell from the Object window into "Specials".

That's it.

Closing[edit | edit source]

I'm pretty sure Bethesda used Method 3, but if you want to have extra conditions such as Gender or item equipped I would use Method 2. This can be used for many things. Instead of using addspell, you could use additem to add some kind of special armor, weapon, or just make that race rich, you could complete another quest, you could start another quest, or really anything else that you can do with scripting. The reason I even mentioned Method 1 is that Quest scripts do have some limits. You can, of course, add multiple spells/items.