Jump to content

Creating a script with option menu


ElderOfScrolls

Recommended Posts

I am working on creating a mod that, when you kill a dragon and absorb the dragon soul, one of your 3 stats are increased. I want to make an option menu pop up and you select Health Magicka Stamina and it is permanently increased by some number. My idea was that when you absorb a dragons soul your own dragon soul should become stronger.

 

I have never done any successful scripting so I figured while I research how to make this I would put it out there and see if anyone has a link to a tutorial or some advice of their own.

 

Currently looking into heromaster's steps

and

Looking for the script that opens up the stat leveling option menu when your character levels up. T3ndo directed me to http://www.creationkit.com/UI_Script so I am trying to figure out how to understand and use these

 

Dragon souls can be catched by the OnTrackedStatsEvent. The stat you are looking for is 'Dragon Souls Collected'.

You don't need to change any base record from the vanilla game.

Set up a quest, create an alias preferable the player, add a script and create an Event OnTrackedStatsEvent(string asStat, int aiStatValue).

And why would you need a token for? This is not Fallout 3(:New Vegas) or Oblivion :wink:

Right now I have a custom "blank" quest with a "blank" script and an alias with the playerRef. Looking through stuff I think I need to make my script in the alias not the quest, is this correct?
I'm not really understanding how the quest alias system works, does anyone know of a good tutorial for activating scripts using a quest?
Current Script
Function SomeFunction()
RegisterForTrackedStatsEvent() ; Before we can use OnTrackedStatsEvent we must register. ; Is this something that is needed for this or is it just for the tutorial purposes? Will something need to go in the "()" in the first 2 lines?
EndFunction

Event OnTrackedStatsEvent(string asStatFilter, int aiStatValue)
if (asStatFilter == "Dragon Souls Collected")
if (aiStatValue == 50) ; I think this 50 will become something like "player value + 1" I'm not sure about this part
Debug.Trace("Player has bartered 50 times.") ; I believe this is where I will have my option menu lines
endif
endif
endEvent
Thank you in advance for any help.
Edited by ElderOfScrolls
Link to comment
Share on other sites

Try OnTrackedStatsEvent since dragon souls absorbed is one of the stats it reports.

 

Create a quest script, register for tracked stats and in that event if it's a dragon soul event show your menu.

How does the OnTrackedStatsEvent work? Does it simply report when a stat changes? Would it be affected by spending dragon souls or does it only count when a stat is increased?

Link to comment
Share on other sites

I haven't tried it but I'm pretty sure it gets called when any of the stats that you can find displayed on the system menu. You would have to test it to be sure though.

Thank you very much. I will keep this in mind when I'm working on my script. From what I've learned from my own research I think you are on target with this event. I will definitely have to test it but I think that's the one.

Link to comment
Share on other sites

Dragon souls can be catched by the OnTrackedStatsEvent. The stat you are looking for is 'Dragon Souls Collected'.

 

You don't need to change any base record from the vanilla game.

 

Set up a quest, create an alias preferable the player, add a script and create an Event OnTrackedStatsEvent(string asStat, int aiStatValue).

 

And why would you need a token for? This is not Fallout 3(:New Vegas) or Oblivion :wink:

Link to comment
Share on other sites

Dragon souls can be catched by the OnTrackedStatsEvent. The stat you are looking for is 'Dragon Souls Collected'.

 

You don't need to change any base record from the vanilla game.

 

Set up a quest, create an alias preferable the player, add a script and create an Event OnTrackedStatsEvent(string asStat, int aiStatValue).

 

And why would you need a token for? This is not Fallout 3(:New Vegas) or Oblivion :wink:

 

Great thank you for your input. The token was part of the stuff that was on the creation kit wiki. I was looking at that when I posted this.

 

What do you mean by creating an alias "preferable (to) the player"? Would the script go in the alias or the quest?

 

Will the OnTrackedStatsEvent also take into account when a dragon soul is spent? I only want this option menu to open up after killing dragon and obtaining the soul.

Edited by ElderOfScrolls
Link to comment
Share on other sites

  • Recently Browsing   0 members

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