Jump to content

Looking to Mod - need resources


Wuumaster

Recommended Posts

Posted

Hi all, I'm interested in making a small* framework mod (in the same vein as SL Aroused). I'm having trouble finding resources for what I need - most of the tutorials and resources I've come across are the entry-level 'This is how the CK works'. These are useful but I need a little more. I've pretty much got everything all sorted out already, I just need to translate it from 'This is how I'd do it in Java/C++' to 'This is how it's done in the CK/Papyrus'.

 

I could really use some direction on how to get started with...

 

  • Storing a handful of numbers (actor values?)
  • Providing functions for other mods to manipulate those values and send events (SKSE's Mod Events would work, or is there a better way?). Bonus points if the other mods don't need to make the framework a hard dependency.
  • Creating a periodic event ("Once every x hours, do this")
  • Displaying a widget on screen (think Defeat's struggle bar)
  • Creating a Mod Configuration Menu
  • Is it possible hook into Skyrim's health/stam/magicka regeneration system? It'd be a bonus to have my values increment/decrement as smoothly.

Thanks in advance for any suggestions!

 

 

*'Small' in programming is deceptive - what I think will take 5 hours will more likely take 5 days lol. At least I have an idea of what I'm getting into.

 

Posted

Hello.

For point 1, 2, 3, and 5, you can find all the answers in my Papyrus guide.

 

I can provide a specific example for each of the points.

For point 4, I do not have examples, but I know how to do it.

For point 6, yes, it is possible. And also easy to do.

 

Now, some quick examples:

"Provide functions to other mods:

 

 

Scriptname myFramework extends Quest
 
Int Function getARandomIntBetween1And100() Global
  return Utility.randomInt(1, 100)
EndFunction
 
int[] myStorednumbers
int numOfStoredints
 
Event OnInit()
  if !myStorednumbers
    myStorednumbers = new int[64]
    numOfStoredints = 0
  endIf
EndEvent
 
 
Bool Function addAnInt(int theInt)
  if myStorednumbers.find(theInt)!=-1
    return false ; "Already there"
  endIf  
 
  if numOfStoredInts == myStorednumbers.length
    ; "Extend the array"
    myStorednumbers = Utility.ResizeIntArray(myStorednumbers, myStorednumbers.length + 64)
  endIf
  ; "And store it"
  myStorednumbers[numOfStoredints] = theInt
  numOfStoredints++
  return true
endFunction
 
 
--------------------
To use it:
 
First check if the mod is available, in an init section
 
myFramework Property myF Auto ; "Do not initialize the property, keep it empty"
 
if Game.GetModByName("myFramework.esp")
  myF = Game.GetFormFromFile(<your id of the quest>, "myFramework.esp") as myFramework
endIf
 
And then use it with an "IF"
 
if myF
  int result = myF.getARandomIntBetween1And100()
endIf
 
 

 

 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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