Jump to content

Recommended Posts

Posted
  On 9/10/2016 at 2:35 AM, IsharaMeradin said:

There could always be improvements made to the code up to a point. Ultimately, simpler would be less features.

 

Perhaps you could scrap the whole tempering idea and do what The Huntsman does with its upgrades. Replace the weapon with a different version. The Huntsman does it to change the mesh, but you could do it to change the stats (and even pre-apply the name change to include fine and what not, tho personally I prefer using +1, +2, etc instead of text)

the items really are tempered, you don't need to change the names at all. I included that in my original code for debugging purposes.

  • Replies 135
  • Created
  • Last Reply

Top Posters In This Topic

Posted

Tip: In your SpawnTemperedWeapon function you are also using a variable of the same name. Might be a good idea to adjust the variable name just in case the script decides to flip out and get confused as to when to use the variable or when to use the function. Hate for you to end up with a function that keeps calling itself repeatedly.

 

Bored: Maybe the following will help with the function you need. An adjusted SpawnTemperedWeapon function (with suggested tip above), a couple added local variables and two functions to get whatever dawn or dusk variant the actor currently has.

 

 

  Reveal hidden contents

 

Posted
  On 9/10/2016 at 2:49 AM, irswat said:

The next part is going to be tricky. I need to create a function that returns a flag for whether the weapon equipped is a tempered version of dawnfang or duskfang. Right now I check if these base ids are equipped or in inventory, but this won't catch any of the tempered versions of the blade.

 

 

 

I don't think there is a good way to determine this from the object itself since most functions that work on items in inventory query against the base object. This prevents you from getting the actual Item health value that reflects that it is tempered. If I could make a suggestion, create a GlobalVariable for each sword to track how many times it has been tempered. Then simply increment the Global in the tempering function. This will allow you to determine how many times it has been improved and adjust the temper from there. It will also give you a good way to test if it is tempered. Given that a Global value of 0 is treated as false and anything larger than 0 is true, you can just do an if on the Global to see if it has been tempered.

Posted (edited)
  On 9/10/2016 at 12:12 PM, palingard said:

 

  On 9/10/2016 at 2:49 AM, irswat said:

The next part is going to be tricky. I need to create a function that returns a flag for whether the weapon equipped is a tempered version of dawnfang or duskfang. Right now I check if these base ids are equipped or in inventory, but this won't catch any of the tempered versions of the blade.

 

 

 

I don't think there is a good way to determine this from the object itself since most functions that work on items in inventory query against the base object. This prevents you from getting the actual Item health value that reflects that it is tempered. If I could make a suggestion, create a GlobalVariable for each sword to track how many times it has been tempered. Then simply increment the Global in the tempering function. This will allow you to determine how many times it has been improved and adjust the temper from there. It will also give you a good way to test if it is tempered. Given that a Global value of 0 is treated as false and anything larger than 0 is true, you can just do an if on the Global to see if it has been tempered.

 

I'm not sure the implications but when I use placeatme with the persistent reference flag I am able to store and retrieve the base object reliably. When I temper the blade I store this base reference in a formlist.

 

For example suppose I get 12 kills with dawnfang, it becomes tempered to (fine). After it is tempered I store it in a formlist. The tempered blade is replaced at 6pm with duskfang. When 6 am rolls around again I am checking the highest tempered weapon in the formlist, in this case it is a (fine) dawnfang, and so I pass that base reference to the function SpawnTemperedBlade and it gives the player a (fine) dawnfang.

 

In order to check whether a tempered is blade is equipped or inventory I'm simply going to check the currently equipped weapon/inventory against both form lists of tempered blades. If it's in the list then it means it's tempered.

 

Your idea is a good idea, and I already have implemented it. It is the GlobalVariable DawnfangLevel and DuskfangLevel.

Edited by irswat
Posted
  On 9/10/2016 at 4:02 AM, IsharaMeradin said:

Tip: In your SpawnTemperedWeapon function you are also using a variable of the same name. Might be a good idea to adjust the variable name just in case the script decides to flip out and get confused as to when to use the variable or when to use the function. Hate for you to end up with a function that keeps calling itself repeatedly.

 

Bored: Maybe the following will help with the function you need. An adjusted SpawnTemperedWeapon function (with suggested tip above), a couple added local variables and two functions to get whatever dawn or dusk variant the actor currently has.

 

 

  Reveal hidden contents

 

Thanks I may refer to this, or just use it, if that is ok.

Posted (edited)

 

  Reveal hidden contents



C:\Games\steamapps\common\skyrim\Data\Scripts\Source\DawnDuskTimerScript.psc(250,1): cannot return a bool from weaponisintemperedformlist, the function does not return a value

clearly I return WeaponFound in the function weaponisintemperedformlist. what is wrong here?

EDIT: Forgot to declare the function as bool

edit two:

C:\Games\steamapps\common\skyrim\Data\Scripts\Source\DawnDuskTimerScript.psc(250,1): cannot return a bool from weaponisintemperedformlist, the types do not match (cast missing or types unrelated)
Edited by irswat
Posted (edited)

the script works!!!!!!!!!!!!!! It's basically done too I think. Unless some bugs emerge.

feel free to play with this beta and help me find bugs.

to install add with NMM or extract to skyrim folder.

to get blades open console and type 'bat "fang.bat"' without the single quotes.

for anyone interested here is the QuestScript

  Reveal hidden contents

 

459 lines. special thanks to paladingard, family frank, and IsharaMeriden. Without you guys I couldn't have done this.

My first skyrim script finished!

EDIT: Let me know if you notice severe performance issues with this. I personally didn't but the guy who created the mod - ZurinArctus, he reported severe HDD thrashing which he attributed to my script. I'm thinking the script maybe is being called too often. Perhaps the RefAlias script is the cause:

  Reveal hidden contents



  Reveal hidden contents



maybe it's the references reserve or allow reuse flags?

Edited by irswat
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...