Jump to content

Running a script on level-up


Extragorey

Recommended Posts

Hey guys, I've written a script that I want to run whenever the player advances a level in a specified skill.

I've used the "OnStoryIncreaseSkill(string asSkill)" event, and I was just wondering how I'd actually go about attaching this to the quest level-up script or something so it's actually called when the player levels up a skill.

 

Does anyone know what I'd have to do?

Edited by Teh Masterer
Link to comment
Share on other sites

You can have a quest run when the player advances any skill, but there does not seem to be a direct way to have it only run when a specific skill increases. Rather, you'd need to capture that logic in your script--test what "asSkill" is in the script event and take one action if it is the skill you care about, another action (stop the quest) if it is not.

 

Beyond that, you'll need to add your quest to Story Manager's "Skill Increase" event. Go to "SM Event Node" in the Object Window, choose "Skill Increase," right-click the topmost entry and add a new Stacked Quest Node, give it a unique ID and check "Shares Event," drag it so it is first in the list, then right click it, choose "Add Quests," then add your quest.

 

The quest will need to be selected to run on the Skill Increase event in its Quest Data tab, and remember that Story Manager will only start a quest if it is not already running, so be sure to stop your quest after it does whatever it does.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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