Jump to content

EXP Tokens


Huglarh

Recommended Posts

  • Replies 63
  • Created
  • Last Reply

Top Posters In This Topic

Sure, just use the AddToLeveledList function and add them to some default leveled lists. Or create your own leveled list with all the tokens and stick that on the leveled lists found in-game.

 

Hehe... how to do that im not sure ^_^;

Link to comment
Share on other sites

Sure, just use the AddToLeveledList function and add them to some default leveled lists. Or create your own leveled list with all the tokens and stick that on the leveled lists found in-game.

 

Hehe... how to do that im not sure ^_^;

 

I'm not sure if there's relevant info to your question or not, but this is a good place to start when you're learning to mod: TESNexusWiki

Link to comment
Share on other sites

Sure, just use the AddToLeveledList function and add them to some default leveled lists. Or create your own leveled list with all the tokens and stick that on the leveled lists found in-game.

 

Hehe... how to do that im not sure ^_^;

 

I'm not sure if there's relevant info to your question or not, but this is a good place to start when you're learning to mod: TESNexusWiki

 

Its not. TES construct Wikia is but its not in laymans terms ^_^;

Link to comment
Share on other sites

First you need to edit the Exp given for a skill:

You need these :

GetSkillUseIncrement SKILL 	; Get how many Exp you get for each use
SetSkillUseIncrement SKILL 	; Set how many Exp you get for each use

Create the following Object scrip

scn SwordTokenScript

float defaultEXP
float newEXP

Begin onAdd Player
  set defaultEXP to getSkillUseIncrement 14
  set newEXP to defalutEXP*1.5      ; Increase by 50%
  SetSkillUseIncrement newEXP 14
End

Begin onDrop Player
  SetSkillUseIncrement defaultEXP 14
End

Attach this to the Sword token. This will increase the EXP given by 50% when you own the token. Removing it will remove the bonus too.

14 is the code of the blade skill. Change it (see link) for the other skills.

 

 

 

Then you need to add these tokens to leveled lists

(Actually, I can't help you with thishttp://www.thenexusforums.com/public/style_emoticons/dark/confused.gif)

Edited by forli
Link to comment
Share on other sites

First you need to edit the Exp given for a skill:<br>You need these <a href="http://obse.silverlock.org/obse_command_doc.html#Skill" class="bbc_url" title="External link" rel="nofollow external">OBSE Functions</a>:<br>

<br>
GetSkillUseIncrement SKILL     ; Return how many Exp you get for each use<br>
SetSkillUseIncrement SKILL     ; Set how many Exp you get for each use<br>

<br>Create the following Object script<br>

<br>
scn SwordTokenScript<br>
<br>
float defaultEXP<br>
float newEXP<br>
<br>
Begin onAdd Player<br>
   set defaultEXP to getSkillUseIncrement 14<br>
   set newEXP to defalutEXP*1.5      ; Increase by 50%<br>
   SetSkillUseIncrement newEXP 14<br>
End<br>
<br>
Begin onDrop Player<br>
   SetSkillUseIncrement defaultEXP 14<br>
End<br>

<br>This way, EXP given increase by 50% only when the player own the token. Removing it from the inventory remove this bonus.<br>Attach this script to the Sword token (EXAMPLE)<br><a href="http://obse.silverlock.org/obse_command_doc.html#Actor_Value_Codes" class="bbc_url" title="External link" rel="nofollow external">14 is the code of the blade skill</a>. Change it (see link) for the other skills<br><br><br><br>Then you need to find a way to add these tokens to leveled lists<br>(Actually I can't help you with this, sorry<img src="http://www.thenexusforums.com/public/style_emoticons/dark/confused.gif">)

 

Thanks so much~! and That is Okay. I am Thinking maybe i should cleverly hide these all over Cyrodill, places no one would think to look~ and if i gotta give any hints, it's gotta be cryptic as heck.

 

But May i please ask for a addition into that script, so when you procure that said token, you cannot procure another of the same kind? This leaves you to procure only one of each kind, the script im asking for prohibits stacking of the same kind of token :)

 

But thanks so much for your help. You will be super creditted~! :D

 

EDIT: nvm. Read post ^_^

Edited by Huglarh
Link to comment
Share on other sites

Thanks so much~! and That is Okay. I am Thinking maybe i should cleverly hide these all over Cyrodill, places no one would think to look~ and if i gotta give any hints, it's gotta be cryptic as heck.

 

But May i please ask for a addition into that script, so when you procure that said token, you cannot procure another of the same kind? This leaves you to procure only one of each kind, the script im asking for prohibits stacking of the same kind of token :)

 

But thanks so much for your help. You will be super creditted~! :D

There are 2 ways:

 

 

1) Ignore next tokens (Advised, you can sell any further token):

scn SwordTokenScript

float defaultEXP
float newEXP
short bonus

Begin onAdd Player
  If bonus == 0
     Set bonus to 1
     Set defaultEXP to getSkillUseIncrement 14
     Set newEXP to defalutEXP*1.5      ; Increase by 50%
     SetSkillUseIncrement newEXP 14
  EndIf
End

Begin onDrop Player
  If (Player.GetItemCount SwordToken == 1)
     SetSkillUseIncrement defaultEXP 14
     Set bonus to 0
  EndIf
End

Can't remember if "Player.GetItemCount SwordToken" must be == 1 or 0 (test it to find the correct one)

 

2) Remove next tokens

 

scn SwordTokenScript

float defaultEXP
float newEXP
short bonus

Begin onAdd Player
  If bonus == 0
     Set bonus to 1
     Set defaultEXP to getSkillUseIncrement 14
     Set newEXP to defalutEXP*1.5      ; Increase by 50%
     SetSkillUseIncrement newEXP 14
  Else
     Player.RemoveItem SwordToken 1
  EndIf
End

Begin onDrop Player
  If (Player.GetItemCount SwordToken == 1)
     SetSkillUseIncrement defaultEXP 14
     Set bonus to 0
  EndIf
End

Like above: check for "Player.GetItemCount SwordToken" correct value.

Link to comment
Share on other sites

To make sure you can't procure another of the same kind, the simplest way is just to put one of each kind in the world. Otherwise, you'll have to change the script that forli gave you.

 

The reason is because other than doing that, it means at some point you'll have 2 of the same tokens. So to get back to 1 token, you're going to have to remove 1 of the tokens. The OnDrop script block also runs when an item is removed from an actor/container, not just when it's dropped. However, when you remove an item from something that has more than 1 instance of that item, you can't really control which one is removed.

 

It might remove the first token, or it might remove the second. If it removed the second token, then everything is fine. The problem comes if it removes the first token.

 

If it removed the first token, then your skill use increment is set back to default, and the second token has absolutely no effect (since it's OnAdd block had already run before you started removing tokens). Then, when the second token is removed afterwards, you get left with a bonus while you have no tokens on you.

 

EDIT: I got ninja'd. :ninja:

 

About the script, I suggest changing it to this:

 

scn SwordTokenScript

float defaultEXP
float newEXP
short bonus

Begin onAdd Player
  If (Player.GetItemCount SwordToken == 0)
     Set bonus to 1
     Set defaultEXP to getSkillUseIncrement 14
     Set newEXP to defalutEXP*1.5      ; Increase by 50%
     SetSkillUseIncrement newEXP 14
  Else
     Player.RemoveItem SwordToken 1
  EndIf
End

Begin onDrop Player
  If (bonus == 1)
     SetSkillUseIncrement defaultEXP 14
  EndIf
End

 

Even though the tokens have the same base items with the same scripts, the values stored in their local variables will be different. So the way you were using bonus wouldn't work.

Edited by fg109
Link to comment
Share on other sites

To make sure you can't procure another of the same kind, the simplest way is just to put one of each kind in the world. Otherwise, you'll have to change the script that forli gave you.

 

The reason is because other than doing that, it means at some point you'll have 2 of the same tokens. So to get back to 1 token, you're going to have to remove 1 of the tokens. The OnDrop script block also runs when an item is removed from an actor/container, not just when it's dropped. However, when you remove an item from something that has more than 1 instance of that item, you can't really control which one is removed.

 

It might remove the first token, or it might remove the second. If it removed the second token, then everything is fine. The problem comes if it removes the first token.

 

If it removed the first token, then your skill use increment is set back to default, and the second token has absolutely no effect (since it's OnAdd block had already run before you started removing tokens). Then, when the second token is removed afterwards, you get left with a bonus while you have no tokens on you.

 

Hm... I will try with what Forli first shown me and do as you say. that was the idea. Only one of each cleverly Hidden around all of Cyrodill.

 

 

But though i expect the people who commented about people stacking this for cheating, I expect them, by their own will, not too. Though they have a point about stacking.

 

EDIT:Nicely done~! o_O

 

You two are super awesome :D

Edited by Huglarh
Link to comment
Share on other sites

scn SwordTokenScript

float defaultEXP
float newEXP
short bonus

Begin onAdd Player
  If (Player.GetItemCount SwordToken == 0)
     Set bonus to 1
     Set defaultEXP to getSkillUseIncrement 14
     Set newEXP to defalutEXP*1.5      ; Increase by 50%
     SetSkillUseIncrement newEXP 14
  Else
     Player.RemoveItem SwordToken 1
  EndIf
End

Begin onDrop Player
  If (bonus == 1)
     SetSkillUseIncrement defaultEXP 14
  EndIf
End

Even with this script there's the risk it remove the first token and the bonus (because the script doesn't check if there's still a token), while the second token has already been added (and the OnAdd block fired)

 

I think the best solution is merge the 2 codes:

 

scn SwordTokenScript

float defaultEXP
float newEXP

Begin onAdd Player
  If (Player.GetItemCount SwordToken == 0)
     Set defaultEXP to getSkillUseIncrement 14
     Set newEXP to defalutEXP*1.5      ; Increase by 50%
     SetSkillUseIncrement newEXP 14
  Else
     Player.RemoveItem SwordToken 1
  EndIf
End


Begin OnDrop Player
  If (Player.GetItemCount SwordToken == 1)
     SetSkillUseIncrement defaultEXP 14
  EndIf
End

 

With Player.GetItemCount SwordToken in both block.

With this, it won't add 2 times the bonus, neither remove it if there's still a token in player inventory

 

"bonus" variable, as you said is useless, so we can remove it.

Edited by forli
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...