Jump to content

Recommended Posts

View File

About

 

SkyUtilities is a SKSE plugin targeted to Skyrim mod authors.
It adds features to Papyrus which yet don't exist and aren't available anywhere else.

 

This project is a way for me to get an understanding of SKSE and the game itself. I'd like to start working on Skyrim SE and Fallout 4 too, as soon as there is a release of their script extensions. I'll try to implement every feature written for Oldrim into SSE as to not make the plugin irrelevant in the future if SSE actually leaves Oldrim behind (modding-scene wise).

 

Info

 

This version (v0.4) is a pre-release and not yet ready to be distributed for a playthrough. I'm releasing it now so that if you're planning on using this SKSE plugin for your mod you can start working with the papyrus functions. The API won't change.

 

Also: I'm looking for ideas. Let me know if you have something in your mind that you think might be useful as an addition and for other modders aswell who might benifit from that.

 

I advice to download SkyUtilities directly from a trusted source (such as this one or the official github repository, if you don't build it for yourself) to make sure that everything works as intended. If this plugin is distributed elsewhere I can't guarantee for proper functionality (meaining: might be altered).

 

Features

Networking
:
  • ​(Basic) HTTP requests (both GET and POST)
  • URL en/decoding
  • Mod information retrieval from Nexus (non-adult) or LoversLab (via mod id).
  • Usage of the Steam API: Profile ID, Profile Name, Achievements
  • Configuration (Readable: JSON)
  • StringUtil: regular expressions

 

 

 

 

 

Note
:

Requests
do not
block/freeze the game. Responses are distributed via events (See Examples or scripts in github or in the download archive for more information).

Requests not yet finished while saving are too saved and will be loaded if you choose to load that particular save.

 


Examples can be found here: Examples

 

Sourcecode

 

If you want to take a look into the Sourcecode behind this plugin, there is a GitHub repository you can check out (hehe): https://github.com/sereni-ty/SkyUtilities


  • Submitter
  • Submitted
    06/07/2017
  • Category
  • Requires
  • Special Edition Compatible

 

Link to comment

Wow, HTTP requests during the game, this could open a wide range of new features (in game updates ? interactive quests ?).

 

Interactive Quests! That certainly could be something interesting!

 

In game updates.. I don't think that is possible, but you can always notify the player about an update if there is one available and even provide him with a download link.

Link to comment

It could be useful for debugging, you can send entire logs/messages without papyrus log noise to a second computer. Hopefully it will not bog down performance, but that is not that important since it is for debugging (and probably just to send small strings elsewhere)

 

A Mod update notification sounds like a very sensible, feasible and useful idea.

I wonder how it will handle firewalls (and security apps). Instructing users to make changes to firewall/antivirus settings to use a mod is not something I would like to do

 

I guess, it is time for some tests

 

Link to comment

It could be useful for debugging, you can send entire logs/messages without papyrus log noise to a second computer. Hopefully it will not bog down performance, but that is not that important since it is for debugging (and probably just to send small strings elsewhere)

 

A Mod update notification sounds like a very sensible, feasible and useful idea.

I wonder how it will handle firewalls (and security apps). Instructing users to make changes to firewall/antivirus settings to use a mod is not something I would like to do

 

I guess, it is time for some tests

There is already a way to create custom log files containing only information your mod logs, it is in fact a vanilla game feature.

Link to comment

 

Wow, HTTP requests during the game, this could open a wide range of new features (in game updates ? interactive quests ?).

A ​Virtual Multi User LoversLab seems to be in reach...

 

Maybe someone could create a chatbox mod we could use for Loverslab :o

 

However a server would have to be hosted somewhere, if we want to push this feature further we could create another SKSE plugin that would act as a server, storing messages, roles etc.  I'm not a C++ expert but it's an interresting project I would be ready to try.  If you have ideas on how this could be done please feel free to share them.  We could end up with a new kind of mod every player could use to set private chatrooms with his friends.  I'm concerned about the performance impact, though.

Link to comment

 

Wow, HTTP requests during the game, this could open a wide range of new features (in game updates ? interactive quests ?).

A ​Virtual Multi User LoversLab seems to be in reach...

 

 

Hmm. It certainly could be done with just requests right now and a server in the middle to manage it all but it'd be some work for sure.

 

BTW: I love your mod. It's something that got mandatory for my playthroughs. Wouldn't a fashion trend be something for it?  ;)

 

 

 

 

Wow, HTTP requests during the game, this could open a wide range of new features (in game updates ? interactive quests ?).

A ​Virtual Multi User LoversLab seems to be in reach...

 

Maybe someone could create a chatbox mod we could use for Loverslab  :o

 

However a server would have to be hosted somewhere, if we want to push this feature further we could create another SKSE plugin that would act as a server, storing messages, roles etc.  I'm not a C++ expert but it's an interresting project I would be ready to try.  If you have ideas on how this could be done please feel free to share them.  We could end up with a new kind of mod every player could use to set private chatrooms with his friends.  I'm concerned about the performance impact, though.

 

 

It shouldn't be noticeable at all.

 

  • Requests are processed in a seperate thread so your game won't freeze (I guess that would be bad, huh? :P ) and everything else can continue its work.
  • Requests are removed as soon as they're processed so memory consumption is kept to a minimum.

Talking about memory: There is a hard cap at 256KB for each response right now and a request frequency limit per script (which is not set properly right now to let you guys experiment without restrictions) to not stress the system too much. In the future it's planned to let the user customize those values to an extent (there will always be a hard cap for those who don't have a clue).

 

  • Responses are distributed as an event to a specific script instance (See the appropriate functions and events in SKUNet.psc). No need to frequently check if the requests was processed or not.

 

I did test following script without any lags:

import SKUNet

int get_counter = 0

event OnInit()
  RegisterForSingleUpdate(2)
endEvent

event OnUpdate()
  if get_counter < 20
    RegisterForSingleUpdate(0.5)
  endIf

  SKUNet.HTTPGETRequest(self, "http://www.google.de/?q="+(get_counter*20+1), 2500)
  SKUNet.HTTPGETRequest(self, "http://www.google.de/?q="+(get_counter*20+2), 2500)
  SKUNet.HTTPGETRequest(self, "http://www.google.de/?q="+(get_counter*20+3), 2500)
  SKUNet.HTTPGETRequest(self, "http://www.google.de/?q="+(get_counter*20+4), 2500)
  SKUNet.HTTPGETRequest(self, "http://www.google.de/?q="+(get_counter*20+5), 2500)
  SKUNet.HTTPGETRequest(self, "http://www.google.de/?q="+(get_counter*20+6), 2500)

  get_counter += 1
endEvent

That are approximately 12 requests each second.. 

 

If you have any performance issues, make sure to send me your load order, active mod list, the log file of SkyUtilities and the script in which you're handling any requests with SkyUtilties.

 

// edit (because of mangalo's edit):

 

You don't write a SKSE plugin to host a server for this to work. That'd be like cooking noodles in a pool. Sorta. In a way. You'd just have to have a web server handling the requests and a little database for this to work. The hard part is to implement writing a chat message. 

 

Link to comment

Sorry about the edit :P

 

I could code a small tomee server to handle requests and make it easily deployable with maven but that's a lot of setup for the everyday player if he wants to host his chatbox.  I think they'll also have to add a port forwarding into their router to access the server from outside the local network.

Link to comment

Sorry about the edit :P

 

I could code a small tomee server to handle requests and make it easily deployable with maven but that's a lot of setup for the everyday player if he wants to host his chatbox.  I think they'll also have to add a port forwarding into their router to access the server from outside the local network.

 

Well, I didn't mean a local web server. You'd have the port-forwarding problem in any case. For something like a 'chat system' to work with just a mod you'd have to setup a remote web-server. Then you'd need to write an API (create chatroom, invite user to chatroom [more like: give user rights to join .. what's a user anayway?], join chatroom, leave chatroom, write to chatroom, read from chatroom [since..], get chatroom information, get chatroom user list). Implemented rudimentary it could be done fairly quickly.. I'd even do it just for demo purposes but you still have the problem with the remote web-server .. someone would have to pay. 

Link to comment
  • 1 month later...

Looks wonderfl. This means it is possible to retrieve really anything? Ofc if the response is something structured.

Was thinking about rank servers, ingame weather which gets synced with real weather, notification updates hinting the users to update their mods..

event OnHTTPRequestFinished(int request_id, bool request_failed, int response_code, string response_body) 

  int data = JValue.objectFromPrototype(response_body)
  form secret = JMap.getForm(data, "weather")
  int intensity = JMap.getInt(data, "intensity")
endEvent
Link to comment

 

Looks wonderfl. This means it is possible to retrieve really anything? Ofc if the response is something structured.

Was thinking about rank servers, ingame weather which gets synced with real weather, notification updates hinting the users to update their mods..

event OnHTTPRequestFinished(int request_id, bool request_failed, int response_code, string response_body) 

  int data = JValue.objectFromPrototype(response_body)
  form secret = JMap.getForm(data, "weather")
  int intensity = JMap.getInt(data, "intensity")
endEvent

 

Heya!

 

Thanks! As long as the the plugin does the request and not the other end, sure. Sure, structure is important and if I can take a breath and get to improve SkyUtilities further, I'll implement JSON and XML parsing to allow you to access data more easily. For the time being there at least is a way to do some regular expressions operations (See SKUStringUtil.psc). 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use