Jump to content

Quick Questions, Quick Answers


Mattiewagg

Recommended Posts

  • Replies 2.6k
  • Created
  • Last Reply

Top Posters In This Topic

Yeah, no need whatsoever to declare (native) functions in your scripts, ever. Just new functions you've created IN THAT SCRIPT.

 

And I'll give your script a full read later on and provide my thoughts.

Link to comment
Share on other sites

You should not have it in there. Just comment it out at the very least. You should not have that extraneous code for the compiler, you should not be declaring native functions, etc.

 

Just put a comment at the top of your code/after properties:

 

;MyNativeFunction(Parameters)

 

It's a bad habit to be declaring it in your script as its uneccessary/messy/etc. And MAY have ramifications though I'm not sure.

Edited by Matthiaswagg
Link to comment
Share on other sites

 

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.

 

Thanks Matthiaswagg, great tutorial :) It doesn't help my slightly disorganised food records (cloned from the various categories that the game food is sorted into), but I'm confident that if you haven't found a way yet, then there probably isn't. At least naming conventions was something that I had already considered :)

Link to comment
Share on other sites

 

 

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.

Thanks Matthiaswagg, great tutorial :) It doesn't help my slightly disorganised food records (cloned from the various categories that the game food is sorted into), but I'm confident that if you haven't found a way yet, then there probably isn't. At least naming conventions was something that I had already considered :)

Yeah, it was more to show HOW the stuff like food is organized so you could understand.

Link to comment
Share on other sites

Is it possible to have a quest provide a different reward each time that it is completed? Or would it be better to have separate quests (let's suppose that there are a lot of different rewards - dozens)?

 

Also, if said quest is a timed quest, is it possible to add something to the script so that the length of the time to complete the quest increases each time? I know very little about code, but I'm guessing that if there were, that something would go in here GlobalTime.SetValue(GlobalDays.GetValue() * 7 + GetNumberOfTimesCompleted x 7)

Link to comment
Share on other sites

Is it possible to have a quest provide a different reward each time that it is completed? Or would it be better to have separate quests (let's suppose that there are a lot of different rewards - dozens)?

 

Also, if said quest is a timed quest, is it possible to add something to the script so that the length of the time to complete the quest increases each time? I know very little about code, but I'm guessing that if there were, that something would go in here GlobalTime.SetValue(GlobalDays.GetValue() * 7 + GetNumberOfTimesCompleted x 7)

Yep, you can use RandomInt to choose from an Array/bunch of properties for your rewards and then award a different one depending on the number.

 

And to do the time, use this script:

 

http://www.creationkit.com/Complete_Example_Scripts#Script_for_a_quest_with_time_limit

 

You'd modify endTime. So where it says:

endTime = Utility.GetCurrentGameTime()+GlobalDays.GetValue()

You could add to endTime. So, for example:

endTime = (Utility.GetCurrentGameTime()+GlobalDays.GetValue()) * TimesQuestDone

With TimesQuestDone as an integer var/property updated += 1 every time you complete the quest.

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.

 

 

 

 

Do you think you have to use this function:

 

http://www.creationkit.com/UpdateWeight_-_Actor

 

?

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...