Jump to content

[LE] Help with two scripts


Recommended Posts

  • 2 weeks later...

Hello,

 

it's me again...

 

Well, my little mod has a problem. I installed dawnguard and played a little bit. I realised the feed dialogue with my animal follower stopped working properly.

I have no clue if dawnguard is the problem. I do not think so. I edited the skript a little bit and this caused it, in my opinion.

So, what is wrong?

Well, the mod stopped removing the meat from my inventory.

 

Here is the skript:

 

 

 

 

;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment
;NEXT FRAGMENT INDEX 1
Scriptname FeedCatSkript Extends TopicInfo Hidden

;BEGIN FRAGMENT Fragment_0
Function Fragment_0(ObjectReference akSpeakerRef)
Actor akSpeaker = akSpeakerRef as Actor
;BEGIN CODE

If (Game.GetPlayer().GetItemCount(MammutRoh) > 0)
Game.GetPlayer().RemoveItem(MammutRoh, 1)
akspeaker.ModAV ("stamina", 1)

ElseIf (Game.GetPlayer().GetItemCount(MammutGebraten) > 0)
Game.GetPlayer().RemoveItem(MammutGebraten, 1)
akspeaker.ModAV ("stamina", 1)

ElseIf (Game.GetPlayer().GetItemCount(PferdRoh) > 0)
Game.GetPlayer().RemoveItem(PferdRoh, 1)
akspeaker.ModAV ("stamina", 1)

ElseIf (Game.GetPlayer().GetItemCount(PferdGebraten) > 0)
Game.GetPlayer().RemoveItem(PferdGebraten, 1)
akspeaker.ModAV ("stamina", 1)

ElseIf (Game.GetPlayer().GetItemCount(Wildbret) > 0)
Game.GetPlayer().RemoveItem(Wildbret, 1)
akspeaker.ModAV ("stamina", 1)

ElseIf (Game.GetPlayer().GetItemCount(WildbretGebraten) > 0)
Game.GetPlayer().RemoveItem(WildbretGebraten, 1)
akspeaker.ModAV ("stamina", 1)

ElseIf (Game.GetPlayer().GetItemCount(ZiegeRoh) > 0)
Game.GetPlayer().RemoveItem(ZiegeRoh, 1)
akspeaker.ModAV ("stamina", 1)

ElseIf (Game.GetPlayer().GetItemCount(ZiegeGebraten) > 0)
Game.GetPlayer().RemoveItem(ZiegeGebraten, 1)
akspeaker.ModAV ("stamina", 1)

EndIf


;END CODE
EndFunction
;END FRAGMENT

;END FRAGMENT CODE - Do not edit anything between this and the begin comment

Potion Property Wildbret  Auto  

Potion Property WildbretGebraten  Auto  

Potion Property PferdRoh  Auto  

Potion Property PferdGebraten  Auto  

Potion Property MammutRoh  Auto  

Potion Property MammutGebraten  Auto  

Potion Property ZiegeRoh  Auto  

Potion Property ZiegeGebraten  Auto  
 

 

 

 

Sorry for the German, its just the properties fur the different foods...

 

 

Well, I have absolutly no clue, what I could do. The skript seems to be ok, the dialogue works like it should (Goodbye, only aviable after several hours, sound, etc...), but it wont remove the food. And of course I have some of it with me.

I also tested it with only one food...

Edited by TheTetrahedron
Link to comment
Share on other sites

Did you check to verify the properties on the script in CK are still actually filled? I had a problem where somehow I accidentally removed them in CK once. If that's not the case, have you checked the papyrus logs to see if it shows any errors when that topic fragment runs?

 

And I know I said before using a while loop on a formlist could have an impact, but your list ispretty short. So rather than doing a messy tree like that you can shorten and reduce the chance for error like this:

;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment
;NEXT FRAGMENT INDEX 1
Scriptname FeedCatSkript Extends TopicInfo Hidden
 
;BEGIN FRAGMENT Fragment_0
Function Fragment_0(ObjectReference akSpeakerRef)
Actor akSpeaker = akSpeakerRef as Actor
;BEGIN CODE
Actor Player = Game.GetPlayer()
int i = 0
int iSize = Foods.GetSize()
while i < iSize
    Form testFood = Foods.GetAt(i)
    if (Player.GetItemCount(testFood) > 0)
        Player.RemoveItem(testFood, 1)
        akSpeaker.ModAv("Stamina", 1)
        return      ; get out on first food match
    endif
endwhile
;END CODE
EndFunction
;END FRAGMENT
 
;END FRAGMENT CODE - Do not edit anything between this and the begin comment
 
FormList Property Foods Auto
Edited by BigAndFlabby
Link to comment
Share on other sites

Hello BigAndFlabby,

 

thank you for your help.

I think, there are some broken code pierces floating around somewhere, causing problems.

 

Is there a option to clean a mod and get rid of all those old unused skripts, etc?

 

Otherwise I will redo the whole dialogue.

Testing your skript :happy:

Link to comment
Share on other sites

  • Recently Browsing   0 members

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