Jump to content

Please help me get this simple script working


irswat

Recommended Posts

  • Replies 135
  • Created
  • Last Reply

Top Posters In This Topic

;this function adds persistent tempered blade forms to a form list for inventory filtering
Function AddTemperedBladeToFormList(bool WeapSwitch,float temperinglevel,ObjectReference WhichBlade)
	if WeapSwitch==true
		; BladeIndexSize=DawnfangTemperFormList.GetSize()
		DawnfangTemperFormList.AddForm(WhichBlade.GetBaseObject())
	else
		;int BlaseIndexSize=DuskfangTemperFormList.GetSize()
		DuskfangTemperFormList.AddForm(WhichBlade.GetBaseObject())
	endif	
endFunction

here is the refalias script

 

 

Scriptname FangBladeRefAliasScript extends ReferenceAlias  

;script with help from IsharaMeradin
DawnDuskTimerScript Property DDT Auto 
Weapon Property adventurerdawnfang Auto
Weapon Property tsasciduskblade Auto

FormList Property DawnfangTemperFormList Auto
FormList Property DuskfangTemperFormList Auto

Event OnInit()
    AddInventoryEventFilter(adventurerdawnfang) 
    AddInventoryEventFilter(tsasciduskblade)
	AddInventoryEventFilter(DawnfangTemperFormList)
	AddInventoryEventFilter(DuskfangTemperFormList)
EndEvent

Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)
    If !akSourceContainer   ;picked up for the first time from the world space i.e. not from a container or npc
        DDT.UpdateFangQuest(1)
    endif   
endEVENT

;make sure this is running on quest start
Link to comment
Share on other sites

  On 9/9/2016 at 1:36 PM, irswat said:

If I add a formlist to an inventoryeventfilter do I need a loop to call AddInventoryEventFilter(Formlist(index)) for every form in the list, or can I simply call AddInventoryEventFilter(FormList()) and papyrus handles the rest?

You can simply call the formlist in the inventory event filter. But since that is what you have in your code posted after the above quoted post, you probably already figured that out. :P

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

I have cleaned the code up much.

  Reveal hidden contents



Still haven't gotten the OnItemAdded functionality working because I had some weird logical loopholes going on that was preventing conditional statements from triggering. Thus why I had to rewrite the code.

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.

Edited by irswat
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...