Jump to content

Can Someone Help Me Apply This Script to the World?


ZombieUbermensch

Recommended Posts

That is the Script, but I don't know how to apply it to the game. My goal is to put it into the game, and make it so whenever one skill levels, the other 17 do as well. I don't know if that will make a new event and cause it to nest forever, but I was going to test that. I just can't find a way to put it in the game. I have that on notepad++ and I have 2 files made, I have the file set up as follows, right underneath SkillIncrement01 as I'll show here.

 

 

That is all the cards on the table, aside from having that plugin saved, that is everything that I have done, I would appreciate help, I can't watch videos as I'm on limited internet.

Edited by ZombieUbermensch
Link to comment
Share on other sites

Untick the Run Once box and select Start Game Enabled. That'll give you a good quick way to test whether or not it will go into an infinite loop of level raises. Plus, it'll start up as soon as the game starts and you won't have to do any kind of activator for the player to initiate the quest.

Link to comment
Share on other sites

Uhm.. that is not going to compile. I think you want something like this:

 

 

 

 

Event OnStoryIncreaseSkill(string asSkill)
    debug.trace("Player just increased the " +asSkill+ " skill.")
    
    String[] sSkills = new String[18]
    sSkills[0] = "Marksman"
    sSkills[1] = "HeavyArmor"
    sSkills[2] = "OneHanded"
    sSkills[3] = "TwoHanded"
    sSkills[4] = "Block"
    sSkills[5] = "Smithing"
    sSkills[6] = "Pickpocket"
    sSkills[7] = "Lockpicking"
    sSkills[8] = "Sneak"
    sSkills[9] = "Alchemy"
    sSkills[10] = "Speechcraft"
    sSkills[11] = "Alteration"
    sSkills[12] = "Conjuration"
    sSkills[13] = "Illusion"
    sSkills[14] = "Restoration"
    sSkills[15] = "Enchanting"
    sSkills[16] = "Destruction"
    sSkills[17] = "LightArmor"
    
    int index = sSkills.length
        
    while index
        index -= 1
        
        ; only ignore the recently increased skill.
        if sSkills[index] != asSkill
                
            ; increase all the other ones.
            Game.IncrementSkill(sSkills[index])
        endif
    endwhile
    
EndEvent

 

 

Link to comment
Share on other sites

I also can't seem to compile the script on it's own?

It compiles just fine for me. Did you change any bit of it? What does the compiler tell you? Note that asSkill will also return the string of the skill increased, so you don't need to do a long super if chain, as well as not having to type out IncrementSkill 324 times with my script.

 

Also of course that should be in a quest script extending quest.

 

As for your initial script, well yeah, and yet the mistakes made in it were not pointed out. The compiler would complain about Events being called in statements, and all the re-declarations of already declared functions, the compiler would likely say 'mismatched' input FUNCTION, expecting <some closing statement it'll expect here>.

 

That's fine though, it's all a learning process, and what you wanted to do was clear from reading that script.

Edited by Rasikko
Link to comment
Share on other sites

The fail message I get is this:
"Starting 1 compile threads for 1 files...
Compiling "AAASkill"...
<unknown>(0,0): Unable to find flags file: TESV_Papyrus_Flags.flg
G:\Games\Steam\steamapps\common\skyrim\Data\Scripts\Source\AAASkill.psc(1,0): mismatched input 'Event' expecting SCRIPTNAME
G:\Games\Steam\steamapps\common\skyrim\Data\Scripts\Source\AAASkill.psc(0,0): error while attempting to read script AAASkill: Object reference not set to an instance of an object.
No output generated for AAASkill.psc, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on AAASkill.psc"

 

That is doing it from the bar across the top, clicking the "Compile Papyrus Scripts" option in a drop down menu. I don't know if that's what I should be doing?

Link to comment
Share on other sites

No, that's not how to do it(that will compile ALL scripts).

 

You add that script to your quest. After adding the script, right click => Edit Source. A window will open up showing the script. Ctrl+S to compile it.

 

Make sure that something like this:

Scriptname NameOfThisScript extends Quest

Is at the very top of the script.

 

Don't do anything else to code.

 

It appears you don't know your way around papyrus, so that makes me think you wont know how to setup the quest to properly work with the Story Manager either, it's isn't all that well documented and imo more complex. So assuming you don't how: make sure that when adding your quest to the Story Manager(Skill Increase), that the branch/quest nodes' box 'Shares Event' is checked and it is above all other nodes except "Stacked Event Node: Skill Increase". Nothing further special needs to be done.

 

Untick Run Once, otherwise, the script will only run once and no more unless the quest is stopped and restarted(in this case calling reset is better, which Run Once prevents). I've edited my code slightly. Here it is again to make adding it easier... NameOfThisScript can be changed to whatever you want:

 

 

 

Scriptname NameOfThisScript extends Quest

Event OnStoryIncreaseSkill(string asSkill)
    debug.trace("Player just increased the " +asSkill+ " skill.")
    
    String[] sSkills = new String[18]
    sSkills[0] = "Marksman"
    sSkills[1] = "HeavyArmor"
    sSkills[2] = "OneHanded"
    sSkills[3] = "TwoHanded"
    sSkills[4] = "Block"
    sSkills[5] = "Smithing"
    sSkills[6] = "Pickpocket"
    sSkills[7] = "Lockpicking"
    sSkills[8] = "Sneak"
    sSkills[9] = "Alchemy"
    sSkills[10] = "Speechcraft"
    sSkills[11] = "Alteration"
    sSkills[12] = "Conjuration"
    sSkills[13] = "Illusion"
    sSkills[14] = "Restoration"
    sSkills[15] = "Enchanting"
    sSkills[16] = "Destruction"
    sSkills[17] = "LightArmor"
    
    int index = sSkills.length
        
    while index
        index -= 1
        
        ; only ignore the recently increased skill.
        if sSkills[index] != asSkill
                
            ; increase all the other ones.
            Game.IncrementSkill(sSkills[index])
        endif

    endwhile
    
    ; Reset the quest and listen for the next skill increase.
    Reset()
EndEvent

 

 

 

This has been tested and works as intended on my end.

 

Also, concerning infinite looping with this - this isn't an issue:

 

If 2 skills increase at the same time, the event will only fire for the first skill. Since 18 skills are being increased all at once, only the skill that triggered the event will count.

Edited by Rasikko
Link to comment
Share on other sites

  • Recently Browsing   0 members

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