Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Planning: Creation Framework #3

Open
Scrivener07 opened this issue Jul 11, 2019 · 1 comment
Open

Planning: Creation Framework #3

Scrivener07 opened this issue Jul 11, 2019 · 1 comment

Comments

@Scrivener07
Copy link
Collaborator

I've still had this standard library for scripting on my mind. I am going for a Microsoft DotNet imitation and CSharp inspired syntax which is very expressive.

I am trying to make the entire library "stateless" where usage is called globally or via type extension (extends). In general this means you can call the global members of the classes as-is, or derive a child class and bind it to a Form in your own mod. The child classes are stateless out of the box. You may override the provided virtual properties to change the base functionality or provide your own. It is also on derived user made classes that instance data may be used as normal.

Here is some highlights.

System:Object

Extends the base Form type. The base for my "re-unified" type system. This is so I can extend the existing type system without overwriting base classes like xSE does.
A new System:* base class is (will be) provided by the standard library. Each system base class will provide a special self property which is of the Form's concrete type. Besides this, you call, extend, and bind to Forms as you would normally with the vanilla base scripts.
https://github.com/Scrivener07/FO4_Scripting/blob/4a490610befd2a88cdd373f547087a948330e860/System/Scripts/Source/System/System/Object.psc#L49-L60

System:Activator

With my own reunified type system I can more easily support some advanced functionality.
The activator type provides a pseudo new operator for script types.
https://github.com/Scrivener07/FO4_Scripting/blob/4a490610befd2a88cdd373f547087a948330e860/System/Scripts/Source/System/System/Activator.psc#L42-L71

https://docs.microsoft.com/en-us/dotnet/api/system.activator
https://www.creationkit.com/fallout4/index.php?title=Activator

System:Type

An abstraction for "external" data communication. I plan for this to help support my type activator.
https://github.com/Scrivener07/FO4_Scripting/blob/4a490610befd2a88cdd373f547087a948330e860/System/Scripts/Source/System/System/Type.psc#L61-L113

Here is an example of external data for the System:Type.
The System:Type provides the generic globals that any script can call without doing any extends or attaching to CK forms. But you can optionally define your own System:Type that optionally provides instance members if bound to a Form..
The default instance implementation of the System:Object -> System:Type is an abstraction for Fallout4.esm. The "Creation Framework" as Ive coined it, internally uses a specialized extension of this by overriding some "virtual" members. The System:Type -> System:Properties:Assembly provides an abstraction for System.esl.
https://github.com/Scrivener07/FO4_Scripting/blob/4a490610befd2a88cdd373f547087a948330e860/System/Scripts/Source/System/System/Properties/Assembly.psc#L48-L58

System:Collections:Stack

An example of a type which provides a global pseudo new operator called Type().
https://github.com/Scrivener07/FO4_Scripting/blob/4a490610befd2a88cdd373f547087a948330e860/System/Scripts/Source/System/System/Collections/Stack.psc#L13-L15
https://github.com/Scrivener07/FO4_Scripting/blob/4a490610befd2a88cdd373f547087a948330e860/SystemTests/Scripts/Source/SystemTests/SystemTests/Services/Object.psc#L1-L16
Its still in the design/prototype phase so Im interested to hear scripter impressions. ☕

Inheritance Diagram

I built an inheritance diagram of script objects. Open the image in a new tab to make larger.

Inheritance Diagram

  • Black = Creation Kit Base Scripts
  • Red/Orange = F4SE
  • Blue = "Creation Framework"

That is the big picture so far with my current design direction. Just leaving this here in case someone has interesting feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant