Jump to content

If x Race, give x item on start?


ShadowLance194

Recommended Posts

In my mod, The Ilztafein, I added 10 new races. What I want is for when you select a new race, you get a guidebook for that race in your inventory. I have written all of the guidebooks and have them in-game, I just need to know how to get them to appear in the player's inventory when he picks that race.

 

Any help would be much appreciated, thanks!

Link to comment
Share on other sites

I think you could just make a quest to associate a script with to make the script run right away.

 

Then you could use GetPCIsRace as a condition to check for your new races and then use AddItem on the player to add the guide book.

 

There are some decent scripting references at The Elder Scrolls Construction Set Wiki.

Link to comment
Share on other sites

I would do it by creating a Quest with Initially Started checked and the usual GetIsPlayableRace condition, with something like this script attached. (Make sure it's a Quest script)

 

scn MyGuidebookQuestScript

Begin GameMode
 if (player.GetIsRace MyRace1)
	  player.AddItem MyRace1Guidebook 1
 elseif (player.GetIsRace MyRace2)
	  player.AddItem MyRace2Guidebook 1
  
;Repeat for races 3 through 9

 elseif (player.GetIsRace MyRace10)
	  player.AddItem MyRace10Guidebook 1
 endif
 StopQuest MyGuidebookQuest
end

 

The problem with that script, though is that it would only work if you chose the race right at the beginning, as opposed to changing it by opening the race menu later, like at the sewer door. If you wanted the quest to keep running/checking instead of stopping, the script would go like this instead.

 

scn MyGuidebookQuestScript
short LastGuidebook
;LastGuidebook will store which of the races the player last was.
;If they're one of the races and not the one they were last, give them the appropriate book.

Begin GameMode

 if (player.GetIsRace MyRace1 && LastGuidebook != 1)
	  player.AddItem MyRace1Guidebook 1
	  set LastGuidebook to 1
 elseif (player.GetIsRace MyRace2 && LastGuidebook != 2)
	  player.AddItem MyRace2Guidebook 1
	  set LastGuidebook to 2

	;Repeat for races three through nine

 elseif (player.GetIsRace MyRace10 && LastGuidebook != 10)
	  player.AddItem MyRace10Guidebook 1
	  set LastGuidebook to 10
 endif
end

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...