Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Papyrus -> Scaleform
- Var UI.Get("menuname", "variablepath")
- bool UI.Set("menuname", "variablepath", Var)
- Struct DataContainer
- int handle
- EndStruct
- Var[] g = new Var[2]
- g[0] = "str1"
- g[1] = "str2"
- Var[] p = new Var[4]
- p[0] = 3.0 as float
- p[1] = PackArray(g)
- p[2] = "str3"
- p[3] = 0
- DataContainer arguments = PackArray(p)
- Var k = UI.Invoke("menuname", "variablepath", arguments)
- DataContainer retn = k as DataContainer
- Var[] v = UnpackArray(retn)
- DestroyContainer(arguments) ; We are done with the arguments pack
- DestroyContainer(retn) ; We are done with the return data
- DataContainer PackArray(Var[])
- Var[] UnpackArray(DataContainer)
- DestroyContainer(DataContainer)
- bool IsDictionary(DataContainer) ; True for maps or objects
- bool IsArray(DataContainer)
- Scaleform -> Papyrus
- RegisterForExternalEvent("SomeEvent", "OnCallback")
- GFX Call:
- SendExternalEvent("SomeEvent", vars[])
- GFx to PVM Adapter:
- VMArray<VMVariable> arr; // This will be converted to flat parameter list unless it contains other arrays
- for i in vars
- // Handle Form/Script types
- if var[i] is Object and var[i].HasMember("handle_high") and var[i].HasMember("handle_low") and var[i].HasMember("Scriptname")
- Pack as Scriptname type
- // Handle Object types
- else if var[i] is Object
- create DataContainer pack its hierarchy recursively
- // Handle Array of types
- else if var[i] is Array
- if var[i] has all same types
- PackValue as array of that type
- else
- PackValue as array of Var, pack recursively
- else if var[i] is primitive
- PackValue(var[i])
- else
- ????
- Scaleform:
- SendExternalEvent("SomeEvent", ["str1", {"handle_high":0x00FFFFFF, "handle_low":0x00000000, "Scriptname":"Billy"}, {"d1": 1.0, "d2": 23}, [1, 2, 3]]);
- ; Papyrus Receive call
- Event OnCallback(string s1, Billy billyForm, DataContainer d, int[] arr)
- ; )
- EndEvent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement