Jump to content

Quick Questions, Quick Answers


Mattiewagg

Recommended Posts

 

I don't understand what you mean by "processing" nor "pass[ing] it through GetForm." All I did was add the form id to a formlist.

OK, then I have no idea why it isn't working for you although it might be yet another issue with the "high-order bit" problem. GetForm won't work correctly on any formID that is 0x80000000 or higher because those values all become negative numbers to Papyrus which GetForm then fails to treat as proper formID values. It's possible you've found another situation where the large formID values aren't processed correctly.

Faaaascinating. Clearly I'll have to test this with an item that comes from a mod that loads later than 80. Althouh it hardly matters since the method is useless to me if it can't process dynamic items anyway.

Link to comment
Share on other sites

  • Replies 2.6k
  • Created
  • Last Reply

Top Posters In This Topic

Is there a way to change an object's directory in the CK? Eg: Move something from Potion/Clutter/DeadAnimals to Potion/Clutter/Food.

http://skyrimmw.weebly.com/skyrim-modding/naming-conventions-skyrim-modding-article

 

See Specific Naming Conventions for info on what you're asking about.

Link to comment
Share on other sites

Function RegisterForMenu(String MenuName) Native


Event OnInit()
StatusChecks()
EndEvent


Function StatusChecks()
RegisterForMenu("ShowRaceMenu")
EndFunction






Event OnMenuClose(String MenuName)
PlayerRef.UnEquipAll()
PlayerRef.SetWeight(0)
PlayerRef.QueueNiNodeUpdate()
EndEvent

Doesn't work by the way. :sad:

 

 

 

Scriptname SkyEndWeight extends ObjectReference  


Actor Property PlayerRef auto
Keyword Property Drink auto
Keyword Property Food auto
GlobalVariable Property FatGainedDay auto
GlobalVariable Property DaysWithoutEat auto


Float Property CountDrink auto
Float Property CountFood auto
Float Property Fat auto


Function SetWeight(float weight) native
float Function GetWeight() native
Function QueueNiNodeUpdate() native


Keyword Property Vampire auto


Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference)


if akBaseObject as Potion && akBaseObject.HasKeyword(Drink)
Fat= FatGainedDay.GetValue()
CountDrink=CountDrink+0.5
Fat=Fat+CountDrink
FatGainedDay.SetValue(Fat)
CountDrink=0
endif


if akBaseObject as Potion && akBaseObject.HasKeyword(FOOD)
Fat=FatGainedDay.GetValue()
CountFood=CountFood+1
Fat=Fat+CountFood
FatGainedDay.SetValue(Fat)
CountFood=0
endif


EndEvent


Event OnSleepStart(float afSleepStartTime, float afDesiredSleepEndTime)
PlayerRef.UnEquipAll()
EndEvent


Event OnSleepStop(bool abInterrupted)


if PlayerRef.HasKeyword(Vampire)==0


if FatGainedDay.GetValue()>9
FatGainedDay.SetValue(9)
PlayerRef.SetWeight(PlayerRef.GetWeight()+FatGainedDay.GetValue()/10)
PlayerRef.QueueNiNodeUpdate()
FatGainedDay.SetValue(0)
endif


if FatGainedDay.GetValue()>=7.5 && FatGainedDay.GetValue()<=9
PlayerRef.SetWeight(PlayerRef.GetWeight()+FatGainedDay.GetValue()/10)
PlayerRef.QueueNiNodeUpdate()
FatGainedDay.SetValue(0)
endif


if FatGainedDay.GetValue()>=6 && FatGainedDay.GetValue()<=7.5
PlayerRef.SetWeight(PlayerRef.GetWeight()+FatGainedDay.GetValue()/10)
PlayerRef.QueueNiNodeUpdate()
FatGainedDay.SetValue(0)
endif


if FatGainedDay.GetValue()>=4.5 && FatGainedDay.GetValue()<=6
; Any value between 4.5 and 6 means you keep your current weight
FatGainedDay.SetValue(0)
endif


if FatGainedDay.GetValue()>=3.5 && FatGainedDay.GetValue()<=4.5
PlayerRef.SetWeight(PlayerRef.GetWeight()-FatGainedDay.GetValue()/10+0.5)
PlayerRef.QueueNiNodeUpdate()
FatGainedDay.SetValue(0)
endif


if FatGainedDay.GetValue()>=2 && FatGainedDay.GetValue()<=3.5
PlayerRef.SetWeight(PlayerRef.GetWeight()-FatGainedDay.GetValue()/10+1)
PlayerRef.QueueNiNodeUpdate()
FatGainedDay.SetValue(0)
endif


if FatGainedDay.GetValue()>=0 && FatGainedDay.GetValue()<=2
PlayerRef.SetWeight(PlayerRef.GetWeight()-FatGainedDay.GetValue()/10+2)
PlayerRef.QueueNiNodeUpdate()
FatGainedDay.SetValue(0)
endif


if FatGainedDay.GetValue()==0
DaysWithoutEat.SetValue(0)
FatGainedDay.SetValue(0)
endif


endif
EndEvent


Function RegisterForMenu(String MenuName) Native


Event OnInit()
StatusChecks()
EndEvent


Function StatusChecks()
RegisterForMenu("RaceSex Menu")
EndFunction




Event OnMenuClose(String MenuName)
MenuName="RaceSex Menu"
PlayerRef.UnEquipAll()
PlayerRef.SetWeight(0)
PlayerRef.QueueNiNodeUpdate()
EndEvent

This script regulates the player's weight, placed keywords all around the place to make sure it works correctly.

 

 

Edited by Kerberus14
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...