#Umbrella Project
1 messages · Page 1 of 1 (latest)
i like it
But seriously Umbrella is a tool in PZ and fits what goal the project serves.
Either of you want to host the git repository?
Asking before I'd make one out of respect.
it doesn't really matter to me
@lusty steppe Is this ok?
Sounds good to me & I'm okay with anyone hosting the repo
Awesome. I'll create the repository for us. One moment..
Sent invites.
accepted!
I gave both of you maintainer roles.
👀
is this the vscode plugin you guys uses for emmylua?
https://marketplace.visualstudio.com/items?itemName=tangzx.emmylua
i use emmylua in intellij, from what i've heard for vscode luacats is compatible with emmylua annotations and is generally a better plugin
I use lua-language-server (which uses LuaCATS), which has slightly different annotations
Mostly compatible but some differences in how annotations are interpreted + some additional annots. I don't think the breaking changes will matter for our use case but I'll have to check on that
https://gist.github.com/omarkmu/9116e6d1b7736015821579afaf328e7b double-checked the kahlua stub. Should be good, but a second look wouldn't hurt
we could produce safe, compatible annotations.
@languid walrus
oh beautiful
Added the modifiers just now.
So yeah.. A digestible YAML file with the info scraped from the JavaDocs.
I'll write a batch process later.
I have a working batcher. I'm currently implementing support for enum constants.
Working on param documentation...
Doing some optimization of the files, then I'll DM the initial renders @languid walrus
sounds great!
Yup. I include the existing documentation that TIS provides.
Also @deprecation tags.
Here's a file for example:
@lusty steppe
Okay. Turning back to work on Candle to implement this new data.
This data is publicly available for others to use to build their own tools.
You think there is a way to do the same with the lua codes of the game?
pain.
It's nowhere near perfect and without type specificity.
If that's expected of me, pay me lol
Doing the JavaDocs scraper wasn't a big deal.
Just coded that in one go.
Hey Id pay you but im poor too
So I asked chat gpt 4 to create proper **emmyLua **annotations to a piece of lua code.
The piece of code:
ISBaseObject = {};
ISBaseObject.Type = "ISBaseObject";
--************************************************************************--
--** ISBaseObject:initialise
--**
--************************************************************************--
function ISBaseObject:initialise()
end
--************************************************************************--
--** ISBaseObject:derive
--**
--************************************************************************--
function ISBaseObject:derive (type)
local o = {}
setmetatable(o, self)
self.__index = self
o.Type= type;
return o
end
function ISBaseObject:new()
local o = {}
setmetatable(o, self)
self.__index = self
return o
end
gave me this:
--- @class ISBaseObject
ISBaseObject = {};
--- @type string
ISBaseObject.Type = "ISBaseObject";
--- Initializes the base object
-- @function ISBaseObject:initialise
function ISBaseObject:initialise()
end
--- Creates a new derived object with the specified type
-- @function ISBaseObject:derive
-- @param type string the type of the derived object
-- @return table derived object
function ISBaseObject:derive (type)
--- @type ISBaseObject
local o = {}
setmetatable(o, self)
self.__index = self
o.Type= type;
return o
end
--- Creates a new instance of the base object
-- @function ISBaseObject:new
-- @return table new instance of the base object
function ISBaseObject:new()
--- @type ISBaseObject
local o = {}
setmetatable(o, self)
self.__index = self
return o
end
If you want to work with AI stuff that won't bother me. I won't be adding any AI-generated materials in my repositories, though.
i mean it need supervision
could be loaded of false incorrect info
especialy with pz lua
You're correct. It would need a lot of work.
I also see this as a hobby, art, and trade. I'd like to work on it myself. I find it rewarding. Maybe I will do my own parser for the Lua side eventually.
I got too much on my plate with just daily work to go into big enterprise online
small mods are okay but going nuts with big project too much atm
pzstudio i did it in one run yesterday, as to get a working prototype without losing focus but other than that I barely have 2 hours a day to go online now. 
pz-zdoc took a fairly liberal approach of just applying class annotations where it seemed to match in the Lua source iirc. I might use an existing Lua parser to generate stubs so the full source doesn't have to be used for that
something like that would be helpful, i had to stop using that library because of it failing on certain files for some reason
The code I wrote to generate my YAML files is very small.
It's in TypeScript under a node environment.
~530 lines (With some comments)
I'd inspect the Lua files for the following: :derive(..), :new(..), and = {}.
Table declarations and invocation of derive and new.
pz-zdoc does the first two. Idk about looking for tables, seems like it'd generate a lot of unnecessary annots
Using a parser means factoring in stuff like whether it's global too, since most pz stuff is global
Did tables not include a bunch of extra stuff?
That's the one I was thinking of 😄 Looked into it in the past
The last commit on master* is still the bug I found (but did not fix), minor pride
luaparse fails to digest pz's lua code without modifying it.
I have a method that fixes it.
Dang, I was hoping it'd just happen to work with the entire source. No such luck
(PZ Lua isn't real lua & Kahlua ignores certain syntactic errors that real Lua throws on)
No no
You can
Oh?
it loads the string for lua files and transforms it.
What syntax errors does Kahlua ignore?
One moment.
Ah, I had seen the long and float bit before. I didn't know about the break thing though, I wonder why luaparse can't handle that
Same. Didn't report the issue because I didn't care enough to.
If you read that codebase you'll find a lot of transformations & adaptation code.
I have two separate repositories to publish and Candle to upgrade.
I can possibly rewrite PipeWrench too.
If all the data I need is with simple class data provided by the docs and mapping to a filter that tells what's exposed and what isn't, Rewriting PipeWrench AND Candle to not depend on the JRE would be an insane upgrade.
Expect Candle to be upgraded tomorrow.
When that happens, I'll push it to Umbrella.
vscode settings:
{
"Lua.completion.requireSeparator": "/",
"Lua.workspace.library": [
"F:/SteamLibrary/steamapps/common/ProjectZomboid/media/lua"
]
}
basically get intelisense to the game lua
potentially add other mod in the library to get intelisense about them
also it seems that candle lacks Events object
You're correct. @languid walrus has that covered.
What exactly is umbrella going to be?
A collation of separate projects that improves the Lua modding pipeline for project zomboid
neat
so apparently i can download the latest version of it using this url https://github.com/demiurgeQuantified/PZEventDoc/releases/latest/download/Events.lua
Will include this in pzstudio
Umbrella keeps the door open for others to contribute while not stepping on other projects.
Albion has a fantastic solution for events.
Omar has wonderful and expansive utilities
Umbrella removes steps to operate tools such as Capsid that can easily gatekeep newcomers from benefits of the tool because of its complexity when operated.
I missed my alarm. Will likely code later on today.
This is the first time since December that I missed getting a room at a library to focus on personal projects...
Working on uploading PZDocs-Yaml-Compiler project.
Licensing as LGPL 3.0.
The scraper will be MIT licensed.
Taking a quick breather and then resuming work on the application of parameter names.
Can Candle handle the global functions defined in LuaManager? Meant to ask that before
I'm starting to understand why you've expressed disdain for the Lua source before 😄 Not terrible, but stuff like
ThermoDebug = {};
ThermoDebug = ISCollapsableWindow:derive("ThermoDebug");
is certainly a little annoying
Nonetheless, very initial version of unnamed lua doc thing is working
This is good news.
Yes. Candle has a saveGlobalAPI() function in Candle.java.
So I do a nifty thing by caching the rendered code for each entity.
I go through those and remove GlobalObject. and it makes the function global.
I delegate the render code as a task via CandleRenderAdapter.
The codebase for Candle is pretty straightforward ATM.
Also, if you want to do this to code outside of PZ, Candle can do that easily with modifications to the class bag.
Everything underneath Candle.java and CandleClassBag.java has nothing to do with PZ.
Found a bug in Candle.
Fixing it..
Correction: It's a bug in the PZDocs Yaml stuff.
Cool. That's done.
I can make support for generics in the future.
Today is a bug-hunting day.
Found another for the Yaml stuff. Not storing multiple of the same method name.
Fixed.
getDefinition("zombie.Lua.LuaManager$GlobalObject").getMethod("triggerEvent", String.class)
YamlMethod{name='triggerEvent', modifiers=[public, static], parameters=[com.asledgehammer.candle.yamldoc.YamlParameter@23355c58], returnType='void', returnNotes='null', notes='null', deprecated=false}
YamlMethod{name='triggerEvent', modifiers=[public, static], parameters=[YamlParameter{name='event', type='String', notes='null', deprecated=false}], returnType='void', returnNotes='null', notes='null', deprecated=false}
@languid walrus
nice!
I can now attempt to grab the names of parameters for constructors and methods.
Also, PZDocs-Yaml has a few bugs fixed.
I'm fully parsing my own Yaml stuff now.
Pulling inside of candle.
Big moment.. Writing injects right now.
--- @public
--- @param weapon HandWeapon
--- @param wielder IsoGameCharacter
--- @param bIgnoreDamage boolean
--- @param damage float
--- @param bRemote boolean
--- @return void
function IsoPlayer:hitConsequences(weapon, wielder, bIgnoreDamage, damage, bRemote) end
--- @public
--- @param dir IsoDirections
--- @param bTest boolean
--- @return boolean
function IsoPlayer:hopFence(dir, bTest) end
There's a bug introduced that's causing some classes to not render for Candle however there's lua files with param names.
let's goooo
Fixed the bug.
This also looks nice:
--- @public
--- @static
--- @param event String
--- @return void
--- @overload fun(event: String, param: Object)
--- @overload fun(event: String, param: Object, param2: Object)
--- @overload fun(event: String, param: Object, param2: Object, param3: Object)
--- @overload fun(event: String, param: Object, param2: Object, param3: Object, param4: Object)
function triggerEvent(event) end
Got rid of the redundant @rough sleet and @arctic owl
...
wtf
Why would that even ping someone if I didn't enter in a user when the prompt opened up....
Awesome..
People catching strays.
Constructors are not showing up param names atm.
Fixed.
--- @public
--- @param width int
--- @param height int
--- @return IsoCell
function IsoCell.new(width, height) end
Fixed issue where param names are reserved words in Lua.
--- @public
--- @static
--- @param __in InputStream
--- @return int
function IsoWorld.readInt(__in) end
--- @public
--- @static
--- @param __in InputStream
--- @return String
function IsoWorld.readString(__in) end
@languid walrus https://github.com/asledgehammer/Umbrella
See how I added Candle as a submodule,.
git submodule add https://github.com/asledgehammer/Candle.git Candle
also the file .gitmodule at the root folder.
@lusty steppe As well.
You can add your GitHub repositories or Git links using this feature.
When someone clicks on it via the website there it'll forward you to the repo page.
ohh, very handy
I'm going to take a break from coding although I'm totally capable of responding to messages.
Been at it for 10ish hours without a break.
I've got a logo to make for Umbrella.
I'll work on that sometime soon.
The code for generating is up although the instructions to set up those code bases to run aren't noted down just yet.
@lusty steppe @languid walrus Do you want me to add a repo for you and get it done now?
Haven't pushed anything quite yet; I'll add it once I've had a chance to freshen it up a bit & make sure everything looks good
Okay sounds good.
i'll add events in a bit
sounds good.
@languid walrus One huge thing that we could do is use the dataset generated from the JavaDocs and do multiple language support options for people.
@thick ravine great fixes
Thanks.
reworking pzstudio to keep a more natural structure
Candle already feels feature-complete.
I might take a look at adding in generics back into the Yaml tomorrow.
If I do this then PipeWrench is ready for a rewrite.
I'm grabbing some food and then relaxing for a bit.
Productive day.
just added events
i was a little afraid git would do something weird but thankfully it played nice
I'm still unsure how I want to handle the strange closure-based constructor pattern that is very rarely used
.new function in ISPriorityTable
.new function in ISMoveableSpriteProps
.new function in ISThumpableSpriteProps
.new function in ISMenuContext
.new function in ISMenuContextBuild
.new function in ISMenuContextInventory
.new function in ISMenuContextWorld
.new function in ISMenuElement
In these, in particular
Other than that my side of things is nearly there. May improve it to emit source instead of annotations where appropriate so that, for example, definition tables (like ZomboidGlobals, Professions) reflect the values they were defined with
oh i hate when they do it like that
Yeah, it's an odd choice
I'm thinking I'll have to define an extra X__instance class based on the function body which is a bit annoying for an edge case, but it is what it is
We'll need to write out a tutorial and explain what Umbrella is.
I'm guessing this will fall on my lap.
I actually don't know the optimal environment for EmmyLua and PZ modding.
I also recall EmmyLua support for VSCode.
I might need help with writing out the setup process.
I only know the answer from the lua-language-server perspective, so I can help in that area
Also, I took a look at Candle a bit ago and saw two areas of potential improvement:
LuaClosureshould probably be aliased tofunction- Some doc params that are present in the javadoc are
arg0,arg1, etc. still—potentially some javadoc quirk that the HTML cleaning isn't picking up
I'm thinking I'll reuse your YAML spec (or create a sub/superset of it as needed) to allow custom docs for the Lua side as well; do you have a spec written up anywhere? Fine if not, I can just look at the code that generates/handles it
The 2nd bullet is likely Candle exposing more than it should.
I can write a Yaml Schema if needed.
That info will be very very useful.
The 2nd bullet also isn't a big issue.
If we can get the main thrust of parameter names then we're way ahead.
People can figure out the rest.
It could be improved yeah.
I see a solid 95+% population of param names.
Yeah, definitely a large majority. Gonna be v handy
IMO way ahead of what Capsid did.
Definitely
We have:
- An active coder
- A simple codebase with some documentation
- APIs built to simplify & expand the project
You don't need to decompile the game to use the tool.
Huge W
{ param: ' Iterable subStates', full: ' Iterable<State> subStates' }
{ param: 'List frames', full: 'List<Keyframe> frames' }
{
param: ' ArrayList targetsProne',
full: ' ArrayList<HitInfo> targetsProne'
}
{ param: 'HashMap map', full: 'HashMap<String,String> map' }
{
param: ' ArrayList params',
full: ' ArrayList<TextureCombinerShaderParam> params'
}
Already smartly parsing param data.
function splitParameters(
paramString: string,
): Array<{ param: string; full: string }> {
paramString = paramString
.replace('(', '')
.replace(')', '')
.replaceAll('\n', '').trim();
const params: Array<{ param: string; full: string }> = [];
let genericIndent = 0;
let current = { param: '', full: '' };
for (const char of paramString) {
// (Generics counter block)
if (char === '<') {
genericIndent++;
current.full += char;
continue;
} else if (char === '>') {
genericIndent--;
current.full += char;
continue;
}
// (Only split params if not inside of a Generics block)
if (char === ',' && genericIndent === 0) {
params.push(current);
if(current.full !== current.param) {
console.log(current);
}
current = { param: '', full: '' };
continue;
}
// (Add to basic param if not in Generics block)
if (genericIndent === 0) current.param += char;
current.full += char;
}
return params;
}
i'm thinking of moving the event docs to yaml too
never actually worked with the format before, looks super nice
So I've come to the conclusion that this Yaml dataset is actually a full-blown "Rosetta Stone" for PZ.
LOL
It just opened the door to some wild things. Let me explain.
I can rewrite PipeWrench with full features in less than a week with this, compared to the several months it took me.
Other language support is possible.
We can also have third-party documentation overloading the Yaml provided. This opens the door for third-party Documentation, in any spoken language.
We could have a Russian dataset provided by their PZ modding community that gives documentation in Russian.
They could modify the param names too.
oh that's great
That's a fucking huge deal.
So because of this, I'm currently addressing the Yaml schema.
Next, I'll build an editor that allows for this to be easily done.
These tools would undeniably help modders in an unprecedented way.
I'll need to provide a compiled exposer map to filter the yaml or simply provide it separately.
I may rename the Yaml schema based on its new-found potential.
The schema is still a WIP and will change.
I'm writing API for it so this will help. (I guess)
I'll provide an unsigned integer value for version control.
Heck yeah, translated docs sounds very cool
Addressed the weird constructors like this:
---@meta
---@class ISPriorityTable
ISPriorityTable = {}
---@return ISPriorityTable_Instance
function ISPriorityTable.new() end
---@class ISPriorityTable_Instance
local ISPriorityTable_Instance = {}
---@return any
function ISPriorityTable_Instance.setDefaultZvalue(_z) end
---@return any
function ISPriorityTable_Instance.add(_k, _v, _z) end
---@return any
function ISPriorityTable_Instance.get(_k) end
---@return any
function ISPriorityTable_Instance.getIndex(_index) end
---@return any
function ISPriorityTable_Instance.remove(_k) end
---@return any
function ISPriorityTable_Instance.removeIndex(_index) end
---@return any
function ISPriorityTable_Instance.size() end
---@return any
function ISPriorityTable_Instance.toString() end
---@return any
function ISPriorityTable_Instance.indexIterator() end
---@return any
function ISPriorityTable_Instance.keyIterator() end
I was initially going to do X__instance or _X__instance but it looks ugly & this applies to so few classes in the Lua idt it really matters
Yeah as long as it works.
I'm working on my yaml generator from the JavaDocs.
Doing QOL improvements already.
Grabbing generics for things.
Not sure if annotations really matters at this point.
I do grab @deprecated
I don't mind my initial schema to be scrutinized and I actually want that.
It needs to work and be optimized for the uses defined above.
fields:
- name: factions
modifiers:
- public
- static
return:
type: ArrayList
generic: ArrayList<Faction>
A better design.
Just noticed a bug with the Yaml set.
Generic classes are mangled with names.
Working on the fix.
Gotta love working with HTML
It's the smallest problem to have.
=)
(Also explains some missing arg param names)
Added the stubs to Umbrella. Only tweak I have left in mind is better typing for the ProceduralDistributions table, but I'll wait on the YAML schema to figure out how I want that to look
Generation code will probably not be published until next weekend
So the cool thing is that you can pull submodules vicariously through Umbrella.
It checks the commit head.
=)
How do you pull them in? I noticed it pulled in my project after I added the submodule
I had to use git submodule update for it to grab the other ones
Before that they were present in the directory but without their files
Well, the submodules were present in vscode—the actual directories were not yes they were
git clone --recursive git submodule update --init --recursive git pull --recurse-submodules
so git pull --recurse-submodules
Second one is what I ended up using, good to know. Should include that in the instructions if we don't create a GitHub release for it
Or either way, really
Yup.
@warped plover You can properly pull from Umbrella now.
We've put our stuff in as submodules so pull them properly.
oh wow
Working on bugs on my stuff.
Good job @lusty steppe
As expected, great work and in good timing.
Glad I can focus on other tasks.
crazy job guys
I think it was a great decision between all three of us to group up and solve this issue together.
Ah that stinks
Was giving a link to the #github-feed channel on my server but I can DM it
I can make a text channel for Umbrella on my Discord server.
That should be useful for people who pop in who might need assistance or have questions.
Updated pzstudio
hmm, might be a difference in behaviour between vsc and intellij?
i'll remove the deprecated file for now, it's not really all that useful anyway
Are those events even used still?
no - i included them because they technically still exist, but they are not used at all
otherwise you can just add them in the same documents
unless those have the same names
it was my preference to keep them in separate files because intellij's emmylua plugin doesn't mark deprecation like vscode does, but the generator does have an option to have them in the same document
when i remove the deprecated one i dont get the intelisense for the other one
i restarted lua in vscode still
so strange
Candle and Lua works
yeah, on my end the deprecated events file is getting ignored
There appears to be a bug in the event generation
Events.AcceptedFactionInvite.AcceptedFactionInvite = {
---@param func fun(factionName:String,username:String):any
Add = function(func) end,
---@param func function
Remove = function(func) end,
}
If you mark them both with a ---@class annotation I think it will use both definitions, also
i love pushing untested changes
i actually don't understand how it happened because the code causing that bug should just be outright crashing from what i can see but it is what it is
i would love to generate the fixed files and push but windows has now decided that it cannot find python 
Something's gone wrong and is haunting Candle's generated code.
I'm going to sleep on it.
Really annoyed though.
Letting yall know that the issue is methods with same param counts aren't generating as overloads.
So some random flip-flopping is going on with the sorter.
I just did a string compare on same-param count method sorting.
The issue still remains that overloads aren't generating where they should for those situations.
I also had a deep logic error in the chain from Yaml dataset to Candle which took some debugging to get fixed.
If you run into the issue know I'm working on it.
I'll likely be working on revision of the method render design.
Thoughts on whether the ---@field [any] any annot should be present on Lua annotations? I included it to avoid strict field checking in case a user purposefully adds a field/the generator misses something, but leaving it off could help avoid typos & such
Example:
---@class ISReloadableWeapon : ISReloadable
---@field defaultAmmo any
---@field [any] any
ISReloadableWeapon = ISReloadable:derive("ISReloadableWeapon")
I'm not sure. If everything breaks endlessly it could be used as a last resort.
That's the current behavior. Idt anything would break (in the type stubs, anyway) and at least on the vs code side it can be disabled via diagnostic settings anyhow
Hmm ok. I wouldn't know the optimal solution to that.
I need time to sort out the same method name with different return types.
I'll probably do what I did with PiprWrench which was OR-joining them.
Work time.
Will touch grass and Candle code later.
(Screams in development)
@languid walrus My generation of the Events class won't conflict with your stuff right?
Leaving work in a few.
I'll be heading to a cafe to improve Candle.
@lusty steppe I know you need the Yaml schema. I'll work on that when I'm done fixing what problems I see with Candle.
as long as the class isn't literally called Events, no
Looks good on my end.
Meant to respond earlier—no rush. I'll only be able to do a little during the week and I can get set up for handling yaml without the schema or just look at your code to get an idea
Yeah no worries.
I'm in full battle-mode with this project.
I work really really fast when I go full in.
Been combing and investigating my Candle generator codebase for why it isn't adding methods with identical names & param counts.
Once that's sorted I believe Candle is safe for human consumption.
I did make slight progress in figuring out why some of those methods aren't showing up in Candle.
I'm also somewhat relieved that Candle had a deep logic error in method propagation.
It means that whatever bugs aren't more elusive than can be analyzed and fixed.
PipeWrench had several of these when handling generics.
I had to spend several weeks on some of those.
I'd rather spend a few days than weeks.
There was one bug that wasn't my code that was a problem however I quickly found it and was lucky to.
SnakeYaml interprets a value of 'on' as boolean not string, causing params named 'on' being called 'true'.
I briefly forgot about the adjective/adverbial senses of "on" meaning "active" and was confused as to why on Earth that would be the case
I believe it to be a bug and not an over-engineered feature. only true and false should be interpreted as string literal equivalents.
It's certainly a strange choice
This is improper for string interop
Logically sound, programmatically improper or frowned on (At least I frown on that)
I'm already dealing with reserved words in translation as a step so snakeyaml adding to this could've made me spent a lot of time chasing down what is IMO a bad take on string interpretation.
const RESERVED_FUNCTION_NAMES = ['toString', 'valueOf'];
const RESERVED_WORDS = [
'and',
'break',
'do',
'else',
'elseif',
'end',
'false',
'for',
'function',
'if',
'in',
'local',
'nil',
'not',
'or',
'repeat',
'return',
'then',
'true',
'until',
'while',
// NOTE: This is a technical issue involving 'snakeyaml' interpreting
// this as a BOOLEAN not a STRING value.
'on',
'off',
'yes',
'no',
];
I added 'yes' and 'no' pre-emptively.
I'm not going to deal with SnakeYaml when I don't know what they're up to.
I was curious so I looked into it a little & this actually is (or, more appropriately, was) a YAML problem and not a SnakeYaml problem, apparently: https://yaml.org/type/bool.html
"was" because SnakeYaml uses YAML 1.1, to which the link in that message is relevant. The 1.2 spec does not mention yes/no for booleans: https://yaml.org/spec/1.2.2/#10212-boolean
Rest. In. Pickled. Peppers.
Yaml is still superior to JSON here.
I strongly believe that using Yaml over Json was the right choice.
I can easily export to Json if ever needed.
It's certainly nicer to look at
I was thinking I'll support both on my end since it'll just end up being an object in the end anyhow
I'd like to force conformity to Yaml though.
Manual editing Yaml is way better than Json.. Plus you'd be able to comment.
We're not using jsonx
Yeah, I'd rather not use a format that's not as supported
Do what you want.
It's not a big deal to go off and use Json.
The tools I'll make will use Yaml.
It's not hard to translate between them.
Only in the interest of allowing user choice 😄 Yeah exactly, it'll work the same
Of course, but in this case idt it's a bad thing
Not with how I'm thinking of supporting it anyhow
Yeah no worries.
SO I chose Yaml because I thought about how we could use this as a way to submit our documentation over the devs documentation.
Editing Yaml is way easier and I can make a software solution for this as well.
Incredibly simple.
I have to market this ability hard when we push Umbrella to the modding community
It's such a powerful opportunity to set things right with documentation.
@lusty steppe What sounds better for a name for the Yaml project: Rosetta or AnnotatedMap?
If we were to lean more into the translation benefit as its primary goal then I think Rosetta would make more sense. I think that depends entirely on its adoption, though—I have no doubt that modders will make great use of it, but whether or not modders whose primary language is not English will take the time to create their own translations is less certain
Not that that was your reasoning for the name, it's just the association it gives me
Well Umbrella is more like Rosetta for exposing the function of the API.
Yaml is more like Rosetta for that very alt-language support potential for reading the API.
We could also build support for proxy functions or proxy calls that could be named something foreign as well.
That's a feature that could be built at some point if desired.
Again.. This is fucking insane.
The control gained by the modding community with these tools is stupid crazy.
Makes PipeWrench look like a Fisherprice toy.
I'll look at building an Electron application with bootstrap.
I'm thinking about disassociating the path of the yml file with the class.
Might move to IDs.
It'll make custom typings / documentation possible.
--- @public
--- @static
--- @param val float
--- @param min float
--- @param max float
--- @return float
--- @overload fun(val: int, min: int, max: int): int
--- @overload fun(val: long, min: long, max: long): long
function PZMath.clamp(val, min, max) end
This is the current result.
This looks proper.
EmmyLua really lets me write simple overloading without type-joining.
@lusty steppe I believe Candle is ready.
It's obvious that there's more than what's actually exposed in Candle right now however it isn't that much so it should be fine for now.
Nice 😄
Fixed a few other issues after that.
I'll add the actual documentation text render code soonish.
@lusty steppe
--- @public
--- @static
---
--- Almost Identity Imagine you don't want to modify a signal unless it's drops to
--- or close to it, in which case you want to replace the value with a small
--- constant. Then, rather than clamping the value and introduce a discontinuity,
--- can smoothly blend the signal into the desired clipped value. So, let m be the
--- (anything above m stays unchanged), and n the value things will take when the
--- is zero. Then, the following function does the soft clipping (in a cubic
--- https://iquilezles.org/www/articles/functions/functions.htm
---
--- @param x float value in [0..1]
--- @param m float
--- @param n float
--- @return float value in [0..1]
function PZMath.almostIdentity(x, m, n) end
--- @public
--- @static
---
--- Almost Unit Identity This is a near-identiy function that maps the unit
--- into itself. It is the cousin of smoothstep(), in that it maps 0 to 0, 1 to 1,
--- has a 0 derivative at the origin, just like smoothstep. However, instead of
--- a 0 derivative at 1, it has a derivative of 1 at that point. It's equivalent to
--- Almost Identiy above with n=0 and m=1. Since it's a cubic just like
--- it is very fast to evaluate.
---
--- @param x float value in [0..1]
--- @return float value in [0..1]
function PZMath.almostUnitIdentity(x) end
Okay. Adding this to constructors and then fields.
Then classes.
So a problem with translation is EmmyLua is limited to method signatures with the same name to show different documentation.
We're going to need to go with the first-defined method that renders which is the simplist. =/
Going to be a silly rule but yeah.
Limitations suck.
What do you mean?
Overloads are problematic for documentation
Because of documenting the additional parameters, or documenting other behavior?
Ah
=)
Actually, I revoke that ah
=(
😄
I'm unsure what you mean by problematic
Do you mean problematic in terms of pulling documentation from the javadoc?
If a method very similar to the host method in Emmy annotations has documentation it can't be expressed.
Pulling is fine.
Applying is the issue.
Ah yeah, that's what I meant. Makes sense
We can use a priority flag as a solution if need-be.
I don't think it'll be a big deal right now since no one is writing their own docs.
Glad this isn't something I have to worry about from the Lua side 😄
Just found and fixed a bug in my docs scraper.
Involved field documentation blocks not fully extracting due to link DOM elements.
Okay so that leaves classes to be documented.
Almost there..
Okay. Updated Umbrella to latest commit head for Candle.
git submodule update --remote
git add .
git commit -m "Git Submodule Update"
git push origin main
Okay @languid walrus @lusty steppe I'm logging off for a bit. Candle looks ready. If your works are ready as well, we can begin the installation and usage documentation stuff.
@warped plover
Mine is usable, but I'd like to improve it further so I wouldn't say ready. Like I said though, there likely won't be any progress on it until the weekend
Yeah. I jumped ahead to go ahead and fix the remaining known issues with both compilers.
So now candle is solid.
@lusty steppe I still want to try to write a resolver for type literals for Lua params, fields, etc.
I was writing a Lua to Typescript transpiler earlier this year. This is the next step.
I'm unsure whether I understand; does this mean being able to infer those types from usage?
I was thinking something similar 😄 I put that one in the "maybe, but unlikely" bucket though, since I only have so much time to put towards this
function foo(bar)
print(bar);
end
foo(1);
1 is a numeric literal expression.
I know that I'm calling foo in this context.
function foo(bar)
print(bar);
end
foo(1);
foo('bar');
--- @param foo: number | string
function foo(bar)
print(bar);
end
foo(1);
foo('bar');
Using an AST parser, you can link calls to their respective destinations. Create a reference chain.
All undead code has a chain leading back to the literal expression or calculated literal value.
My plan was to walk through parsed Lua code and build these relationships / references into chains and walk back to resolve types.
That'd certainly be handy
It was what I planned in order to improve PipeWrench's Lua typings.
Clarify all event parameters and add them as references in this graph / chain / tree.
Then run through the Lua code.
Something that would potentially be difficult to capture depending on how the vanilla Lua uses functions: optional parameters
Analysis of the function body could help in that regard
I'm thinking of those callback functions that pass param1, param2, param3, param4 (which I find unfortunate and wish it were just ..., but that's a separate rant)
Few Candle things I noticed from opening some of my mod folders to check smth:
__globals.luafile is missing---@metaannotation- The global functions that have a different name than their java function name use the java function name;
instofshould beinstanceof, for example addSoundglobal is missing. Lua method has the same name as Java function so not too sure why that would be happening- We could probably add a
classfield to every class; other solutions didn't do this but it's present & would avoid needing to suppress a diagnostic - overloads that don't specify
selfdon't seem to work properly, at least in vscode. That is, the following annotation produces diagnostic about argument count for a call with 4 args
--- @public
--- @param other Color
--- @return Color
--- @overload fun(r: float, g: float, b: float): Color
--- @overload fun(r: float, g: float, b: float, a: float): Color
function Color:set(other) end
For the class field, I'm referring to the use with __classmetatables, which also could be declared (but maybe that part is something that belongs in the Kahlua stub)
unused params are dead code.
They're not necessarily unused
Those params tend to be only stored and then passed back to callback functions (any examples I can think of, anyhow)
Then they're being used and aren't dead code.
Mhm
What I meant by the optional parameters bit was that your provided example could be inaccurate for something that isn't actually required, but isn't passed without that parameter in the vanilla code
That's not what I'm referring to, one moment
I know why we'd want it.
local _ChatBase = __classmetatables[ChatBase.class].__index
For the purpose of overrides
For the purpose of overrides lol
You can override a Java class from Lua?
It'll only use the override Lua-side, but yeah
local _ChatMessage = __classmetatables[ChatMessage.class].__index
--- ...excluding details
---Override to modify chat format.
---Decorates the original getTextWithPrefix.
---@return string
function _ChatMessage:getTextWithPrefix()
local info = processTransforms(self)
if type(info) == 'string' then
return info
end
-- rebuild the string with the desired format
return concat {
utils.toChatColor(info.formatOptions.color),
'<SIZE:', info.formatOptions.font or 'medium', '> ',
info.timestamp or '',
info.tag or '',
utils.interpolate(info.format, info.substitutions),
}
end
Excerpt from chat mod I have yet to release
And this works without debug mode set to true?
Yup, I've used it on a server with friends
You can shadow class methods in Lua.
That sounds like a possible security vulnerability lol.
How so?
A shadowed method being rerouted with vanilla calls from Lua without knowing could create anomalous situations that could trigger something undesirable and potentially lead to instability.
The same argument could be made for overwriting globals
I wouldn't say it's inherently a vulnerability—I see what you're saying but idt it's a concern
It's one of the things I'd look for as a malicious actor.
That's fine. Not here to discuss it at length. =P
(Security brain)
So I'll need to check for Lua annotations in GlobalObject. I did this for PipeWrench buttttt forgot to do it for Candle. Good catch.
Also @meta and I don't even know what the damn thing does.
It's not all that important really, but if you ctrl + click on a global there's an explosion of diagnostics bc it applies them (and there are a lot of missing returns, of course, because it's a stub)
In VSCode anyway
Oh so it's for that version of Emmy.
Yeah, idt non-LuaCATS even has the meta annotation
Yes, I think that'd do it
Likely this weekend; I noticed one issue at the same time that I saw that stuff, but aside from that I think all I have left are enhancements for the generation code
Well, that and the ability to inject documentation
Get it to the point where you can generate using GitHub Actions and you're golden.
This is my target.
It already accepts command line args for input & output so that's probably doable today
I'm going to need to learn GitHub Actions.
Someone helped me set up auto-compilation for PipeWrench. =)
They used public Steam API to download PZ and run my super secret code. =D
Oh nice
It might be good for me to run the exposer classes into a compiled list of exposed classes, fields, and functions.
Combine this with The Rosetta Yaml and any transpiler to Lua can be used and rapidly deployed.
I'd like to get people as far away from executing Java as possible.
Fair, although I don't think this'll stop people from decompiling for a deeper understanding (nor should it 😄)
In this context yes I do but not generally.
I'm not sure if specifying a type in overload functions works however it shows up in IntelliSense via IntelliJ IDEA.
I also don't know why addSound isn't there.
Ohhhhhhhhhh
I know why
fixed
Everything except the last bullet regarding overloads is fixed & implemented.
@lusty steppe Fixes are pushed and also updated on Umbrella.
You got your silly class field.
Anything else, @lusty steppe ?
Couldn't tell ya, aside from the last bullet point. I only looked at the warnings for 2 of my own mods
The __classmetatables bit can go in the kahlua stub, other than that nothing else I saw
feels like it would make more sense for candle to do that since it's already parsing all the exposed classes
I was thinking __classmetatables could just be defined as a global table; a more accurate typing would need the class fields to have a type to use for the key type
If you can write it out here, I can add it.
I don't know anything about that setup.
I think just a table would suffice, but @languid walrus may have a better idea?
no you're right, if we were to add keys for each class then we'd probably have to actually map out the metatables
In that case, if we want it to be in Candle, it should work as just __classmetatables = {}
at which point it could just be in the kahlua stub again
We can make a new lua file called __kahlua.lua
I was gonna rename my kahlua stub to that to fit with that standard lol, yeah I'll just include it in there
--- @class __classmetatables
__classmetatables = {}
Correct?
Okay.
Your utilities are more technical.
I'm simply mapping the Java side.
Technically the kahlua stub contains stuff coming from the Java side and the Lua side, but I don't think anyone will care unless they're competing for the position of ultimate pedant
I was referring to a hypothetical end user lol
Ah ok.
I want the best for the modding community and the work we have now already far-surpasses anything else on the market in quality.
It's actually out-competing PipeWrench, my very own Typescript transpiler project.
maybe i'll follow suit too
I like using underscores because in file lists, and tree views they're all together.
It's a categorical sorting and signifier thing with me.
Also Lua uses this for their internal API so it simply works.
Python 3 oddly enough uses this as well.
I thought the intent was to try to avoid potential future collisions with vanilla files, but now that I've typed that out I realize with Candle's file structure that wouldn't happen anyway
These are habits that I've adopted over my 15 years' of coding.
to me it's just an indicator that this file does not execute
Three benefits wrapped in one dunder
I may write a Python adapter implementation in Candle.
I may also write an exported Yaml file that serves as an exposer map.
“Python to Lua? Who would want to—”
All variable declarations automatically become
localin the output, which if outside any expression, will be equivalent to a global.
Alright I'm sold
I'm doing it for testing purposes for strengthening the Yaml schema for the doc stuff and exploring how fast it would be for me to implement this using Candle.
Apart from the __*.lua files, Candle renders everything through an implemented RenderAdapter.
Neat, I like it. I've yet to clean up the annotation part of my generation code, might model it to be similar to that
I can merge a lot of the constructor-method code but otherwise it's set.
I'm not in a cleaning phase so it'll be fine for now.
If you have a donation link and want to put it on Umbrella I am 100000% okay with that.
i've been meaning to clean up my tool
especially with the md output, that's a separate tool with mostly copy pasted code - was meant to be a proof of concept but never went back to it
This is the 2nd attempt at making a logo for Umbrella.
I may use the cane part for Candle.
Ah yes.. All the symbolisms..
WDYT @languid walrus @lusty steppe . Are you okay with this being Umbrella's logo?
looks good to me!
Same here, I like it
REMASTERED IN HD!
Get Rihanna’s eighth studio album ANTI now:
Download on TIDAL: http://smarturl.it/downloadANTI
Stream on TIDAL: http://smarturl.it/streamANTIdlx
Download on iTunes: http://smarturl.it/dlxANTI
Download on Google Play: http://smarturl.it/ANTIdlxgp
Download on Amazon: http://geni.us/amzANTI
Music video by Rihanna performing Umbr...
@languid walrus Is there anything else you think could help modders with Umbrella?
nothing has come to mind yet
i've been thinking about something to map out the sandboxvars table like events, but that would probably have to be an ide extension to be useful
Yeah very likely so.
The .txt files?
They can use the ZedScript extension for some help.
yeah, it'd include the vanilla ones too but they aren't commonly used by modders so automatically generating them would be most important
Same highlighting format.
yeah, that might be something to add to the zedscript extension if i get around to working on it
I paused development on it to focus on other stuff.
(Like Candle)
Will clean that codebase when I resume work on it.
I'm going to add a couple channels for discussion / support for candle & umbrella in my server.
hehe got event stubs updating with a github action
i haven't got it doing that automatically yet, it should probably lint them + maybe check if they've actually changed before i risk that
but it's still a huge time saver
Nice.
@languid walrus I'm thinking about taking your events dataset and writing a compiler project for it so I can compile it to TypeScript too.
Oh yeah so it's all manually put into Lua.
manually?
Did you type Events.lua?
no
Where's the dataset?
PZEventStubs is the output of https://github.com/demiurgeQuantified/PZEventDoc
i recently rewrote it around the groundwork for multiple output format support so depending on how the typescript for that would look it could be added
Unfortunately I wrote this manually.
Having the full path of the type fixes that.
if we did that then yeah it would fit pretty well with the structure i just set up
Actually I forgot that I simplified imports for PipeWrench using a proxy import.
You need the class names.
You'd manually copy this code into the result file:
/**
* EventEmitter is for both vanilla ProjectZomboid event handling and custom events written for PipeWrench.
*
* @author Jab
* @param L The type of {@link EventListener} associated with the Lua-event.
*/
export class EventEmitter<L> {
/** The Lua-event ID. */
readonly id: string;
/** @param id The Lua-event ID. */
constructor(id: string);
/** @param listener The listener to register. */
addListener(listener: L): void;
/** @param listener The listener to unregister. */
removeListener(listener: L): void;
/** @param params Any parameter to pass. */
trigger(...params: any): void;
}
This is the heart.
This is what it fires:
local EventEmitter = ____exports.EventEmitter
EventEmitter.name = "EventEmitter"
function EventEmitter.prototype.____constructor(self, id)
self.id = id
if not Events[id] then
LuaEventManager.AddEvent(id)
end
end
function EventEmitter.prototype.addListener(self, listener)
addEventListener(self.id, listener)
end
function EventEmitter.prototype.removeListener(self, listener)
removeEventListener(self.id, listener)
end
function EventEmitter.prototype.trigger(self, ...)
triggerEvent(self.id, ...)
end
it already supports prefixing the file (for comments and the meta annotation) so it should be fine to insert that
Gotta love my interfaces with vanilla PZ code.
I might rewrite PipeWrench's Java typings generator in Candle.
hell yeah
How's it going?
Likely working on this later today; focusing on other stuff at the moment
Take as much time as you need.
Any updates from yesterday?
Nothing from yesterday, but I'm working on it right now. Kind of turning into a rewrite bc I'm rethinking how I did it
Do you have a stable version of your first write that is usable for a first release of Umbrella?
The stubs are available on the repo, but the SandboxVars one isn't representative of what's produced since I made it how I intend for it to be. If you mean the code that produces them, no but I can do that & save improving it for later
It's a bit of a challenge for me to accept the version of something that's not exactly how it is in my head or at least close—that's why I've released very few mods (only one, actually) 😄
Hmm okay. Is it possible to make it how you'd think it'd be ok for a release?
I get that optimization feeling.
I call it "Cleaning as I Cook".
I do my own micro-rewrites to keep myself from spiraling down the ladder of optimization hell.
Yeah, I feel you. I think it's technically okay now, it's just the SandboxVars one that has me annoyed
It's the only thing that qualifies as being a class that uses the return value from another module: SandboxVars = require 'Sandbox/Survival'. I was going to rewrite it to try to resolve it
All good.
I've decided to just not emit a class for SandboxVars for now, but still emit the original require so it'll still offer Intellisense. Better solution will come later
I'm still seeing the issue with the diagnostic for overloads with self from Candle's stubs; unsure whether you were going to address that
I tried it out in IntelliJ and found that the way the plugin handles overloads for name hints is inconsistent, but it doesn't have diagnostics so it's not a problem for that version
Can you provide me an example of this issue?
I was just typing up a contrived example, but I'll just show the actual one instead
Where newColor is a Color: newColor:set(red / 255, green / 255, blue / 255, 1.0). Produces the diagnostic: This function expects a maximum of 4 argument(s) but instead it is receiving 5., because the self argument isn't in the overload for set:
--- @public
--- @param other Color
--- @return Color
--- @overload fun(r: float, g: float, b: float): Color
--- @overload fun(r: float, g: float, b: float, a: float): Color
function Color:set(other) end
So the solution? add self param?
function Color:set(self, other) end
Do overloads need it?
It'd have to be added to the overloads, yeah. The only concern is that it may make the parameter name hints in IntelliJ's EmmyLua look off
emmylua does have diagnostics, they're just off by default
Oh, I didn't see them anywhere. Lemme see what they say
I have not used this plugin and have no idea where to turn the diagnostics on 😄
it's buried
I'm not sure either without seeing the diagnostics in IntelliJ's EmmyLua
This issue didn't exist with the annotations produced by pz-zdoc, but I think that's because it emitted a copy of the function for every overload
e.g.,
---@public
---@param arg0 Color
---@return Color
---@overload fun(arg0:float, arg1:float, arg2:float)
---@overload fun(arg0:float, arg1:float, arg2:float, arg3:float)
function Color:set(arg0) end
---@public
---@param arg0 float
---@param arg1 float
---@param arg2 float
---@return Color
function Color:set(arg0, arg1, arg2) end
---@public
---@param arg0 float
---@param arg1 float
---@param arg2 float
---@param arg3 float
---@return Color
function Color:set(arg0, arg1, arg2, arg3) end
I don't think that's ideal, though
It looks very redundant. =/
Agreed
Forgot to update when I did it, but initial gen code is at https://github.com/omarkmu/PZLuaStubGen. I'd still like to rewrite it at some point to analyze dependencies in a better way + be better in general, but if we just want an initial release that'll generate the Lua stubs as they are now
Thanks.
We might share whatever solution works first on that.
@languid walrus Do you have any special way to optimally setup a PZ Lua mod environment with EmmyLua?
at this point, i just throw in umbrella and the game source
I'd like to go ahead and write the instructions.
I'm still also not sure if it's required to add that self thing to Candle.
I haven't tested it thoroughly with IntelliJ but it seems to be divergent behavior exclusive to lua-language-server. I don't know whether it's severe enough to warrant waiting to release, but it will certainly produce diagnostics for valid code
My issue is that I'm distancing from modding, so I am trying to wrap this up to be good enough to release.
So I'll do what I need to get Candle at 100%.
EmmyLua acting different on vscode is a issue in general.
It's a fork which no longer has the aim of being fully backwards-compatible with EmmyLua
For most basic purposes it is, but when generics are implemented fully that'll be a significant difference
I see this as more of an issue with EmmyLua than LuaCATS though, tbh. I didn't get to see the diagnostics, but it has strange behavior for how overloads are interpreted depending on whether a function is declared/called with the colon syntax. LuaCATS, on the other hand, seems to interpret the first argument in both cases as the actual first argument
I think it's the xkcd I send the most (so I wouldn't be surprised to find out I've sent it to you before lol)
@languid walrus @lusty steppe The README.MD is up.
Add your donations / community links where you see fit.
I'd just fix it myself if I were home, but the heading at the top is missing a b
Oh.
Other than that, looks good. I think we could include more detail on how to use them per IDE & maybe provide releases for that
Can always be added in the future
I'm not getting instance functions in IDEA's EmmyLua plugin.
Not sure why.
I do however see them in VSCode's extension.
That's just how both plugins handle functions
I think the only way around that would be a separate instance type, unless there's some way I don't know about
i'm not sure sure i understand what's missing
I might recommend the vscode extension more.
The IDEA plugin is very vague on settings.
the vscode extension is better, it's just in an ide i like less
Also in Manderin.
i saw there was an emmylua idea fork that seemed more similiar in function to luacats, but i haven't gotten around to trying it out yet
I'm avoiding all of those forks for now.
Heheh.
Going for the most universal support.
yeah, i'm just praying for 'works better and doesn't require us to do anything'
Heheh.
I just realized I misread the instance functions thing above
I could make a Umbrella-Template just like PipeWrench has a template so people can use it quicker.
They'll still need to install the EmmyLua extension.
what would be the difference? it seemed as drag and drop as you could make it already
A template can be in a node environment and provide more tools.
Also for vscode a json file is needed for emmylua
A template gives way for opportunities to further improve the modding experience.
We could make umbrella a npmjs dependency even.
That's more effort than I'm willing to put in.
Okay so
Umbrella is live and the README.md is there.
Beyond bug fixes I think this is good for you to do what you want with it.
If I disappear, you have 100% of what is needed to update Candle.
my place should be easily filled too
It'll be a huge disappointment for the community to not gather the willpower to simply run the code that is publicly available in my absence.
Now we'll need to advertise the heck out of Umbrella so people know of it.
Here's assets if you want to try your hand at it.
you'll need to replace my submodule if i vanish from the scene but there's nothing irreplaceable
I think we're thinking of different extensions bc I don't need this
It probably uses root as default if not present.
Are you using one called “EmmyLua”?
The lua-language-server is “Lua”, I believe
I think the other one is a port of the IDEA one. Lemme check the readme
that's correct
it's actually a bit worse than intellij emmylua, which is already the inferior plugin imo
https://marketplace.visualstudio.com/items?itemName=sumneko.lua this is the one I use
Hmm..
Yeah I don't know what the right answer is to recommend for people.
If you liked umbrella, you'll love car car (I expanded them after seeing this, just gave me a laugh)
😮💨
I'd say the Lua one is better to recommend, idt people really use the EmmyLua one
I haven't done a survey to back up that claim, of course, just speaking based on what I've heard + own experiences
You're telling me it's not car car
well just the public install counts should say enough
True, I didn't think to check those
lua language server is by far the dominant lua plugin
dominant enough to not even give itself a consistent name u_u
If I can get help on this front that'd be great.
I'm not the expert here.
This isn't my turf. =/
I'll update it later today if no one else has—at work atm
i haven't used vscode in over a year so i'm not a good candidate to write usage instructions for it
i prefer my jetbrains ides where possible
Now I can get away with hating on Lua because then I could be like "Well this is a thing."
xD
all we have left to blame is lua itself
And I'm slowly continuing to take away everything that can be blamed.
lol
Now if we can convince people to use module exports, we'd be in business.
I'd personally want to eliminate global use of Lua in PZ.
In my ideal world, the only things touching global are pho-namespacing and primitive utilities that are missing in Kahlua.
big agree
Kids are learning that the standard is the code PZ has.
That's terrifying.
ZedScript is just as screwed up.
The coding climate here is still very unacceptable by my standards.
i think i'm possibly *the* most lua positive pz modder but i have to say that making global the default and local a special keyword is a ridiculous blunder
For me, I think I take the most action.
what i mean is you won't really see me hating on lua, i think it's a great language
I think that it is something not to blame when it comes to coding practices of the programmer.
I'm strangely neutral on Lua itself.
What people code in PZ isn't real Lua.
It tries to be Lua really hard but isn't quite.
I'm not just barking up a tree.. I'm barking at the right branches.
xD
It'd be wasteful to simply complain without a course of action or solution.
That's how I feel and I hope that I've lived up to that standard.
x)
you absolutely have
Thanks.
@thick ravine is this something you're aware of? no parameter names for sendClientCommand or sendServerCommand
Taking a look.
It's because I filter non-public methods in Rosetta.
Looking at a fix.
I need a drink rn lol
no rush!
Oh no I can't get one tonight haha
Spent my fun money on my car just to figure out what's wrong with my AC.
aaaaaaaaa
I ended up paying to find out that I have the worst AC issue. xD
Dead Compressor: A heroic journey through the gates of financial hell.
The way that Compressors work and the mechanic market is silly.
Anyways I know the issue here for Candle.
Thanks for reporting.
concerning: every single method with a KahluaTable argument seems to have this issue
Probably the same thing.
something strange seems to have happened here too
not really a critical issue but it seems to have happened in a few places
That's on purpose.
oh? what's the purpose?
oh, i see
It's a magic trick.
disregard then 😅
it's my first time actually sitting down and working on a mod since we started umbrella so i'm only seeing the quirks now
That's how you debug it.
Someone literally having a problem with the method I'm figuring out.
Funny that.
--- @param module String
--- @param command String
--- @param args KahluaTable
--- @return void
--- @overload fun(player: IsoPlayer, module: String, command: String, args: KahluaTable): void
function sendServerCommand(module, command, args) end
Found the issue.
nice!!
Okay. Just pushed changes to Candle, Candle-Compiler and Umbrella.
git submodule update --remote
You should see the changes.
perfect, great work
was trying to work out why git wasn't working properly and it turned out i just needed to reload the library 😅
All good.
Hoping things are in working order.
i haven't run into any issues

it's been a real time saver already
Yeah, that's why I'd mentioned that file as one that should probably be replaced with a description of its type rather than the source
But that'll be after YAML is handled
Ah okay.
This as a problem in pz-zdoc too; it doesn't really cause any issues other than not having Intellisense for the proceduraldistributions table, but something I intend to fix eventually anyhow
Easy fix. :D
I guess that now the burden on further work is on me.
Yaml things.
I can look at the existing .yaml files to figure it out, but I don't think I'll be doing any work (or at least not significant work) on this this weekend
Working on it.
I'm having a stupid amount of trouble getting Yaml schema validation working in vscode so I'm working on a JSON Schema.
Nice
Added Lua schema definitions.
Also events with callback as lamda properties.
I should turn methods back to an array because multiple entries with the same name.
I have at least something of a schema to work on.
There will be a second schema for third party documentation.
Rewrote Rosetta for a JSON format.
Working on a couple things involving generics and then pushing those changes and rewriting my Candle's adapter of Rosetta API.
Generics data will have a full type string and when I decide to code this, a nested breakdown of generic types.
That data will be used when I rewrite pipewrench.
The schema is basically complete. (Apart from descriptions)
@lusty steppe This has schema definitions for Lua. @languid walrus This has schema definitions for events.
A separate repo is now available to get the schema as a raw link
Uploaded JSON and YAML variants.
I think that we'll need to expand on the lua schema for Rosetta.
It's cool to see my JSON Schemas working for both YAML and JSON renders.
I see a couple of concerning renders for the new Rosetta API for Candle but it is rendering stuff.
Hahaha
@languid walrus I just realized that the issue I'm having is due to the differences within one version of the game.
oh?
The JavaDocs = 41.77
oh that's right
They added a boolean flag to serverConnect(...)
I was like.. where was this guy at?
So I spent around 25 minutes looking.
I could do a dirty search
Ehh nah
That'd create some problems.
Not the end of the world.
Will need to spend time performing fixes to the new Rosetta model but am taking a break.
I'm taking this brief moment of time to investigate issues with my rewrite of Rosetta.
Fixed the biggest issue with Rosetta.
@languid walrus @lusty steppe @warped plover Everything's up to date.
Fixes are applied.
New Rosetta API and typings in both YAML and JSON formats.
🥳
A lot of non-named args were fixed from the last, most stable render of Candle.
@languid walrus Do you have your own JSON Schema file?
for events? yeah
although i'm starting to wonder if i used the word schema correctly when i named it 😅
i have a file called schema that defines all the events
Hmm I think you misunderstood what a schema is in the JSON context specifically.
Yeah.
So let me link you to Rosetta's schema
What you did was a dataset that might follow a schematic pattern but you did not write an actual JSON schema, which is ok.
This schema instructs an IDE to validate the implemented JSON file with the schema.
The IDE should then alert the user of type errors, missing data, unknown data, etc.
ohh that's useful
I validated all Rosetta using this schema.
So this file has a prototype schema design for events. I could conform to your design just fine.
My goal is to get us all on a standard.
When this happens, I can write that third-party documenter application so people could add their documentation to Umbrella.
This can also allow for future support for mods doing their own typings.
That'd be down the road but the door's open now.
The ball for moving forward for the Umbrella project is no longer in my court ATM. =)
I did a full rewrite for most of my code and brought forward a schema to improve to suit yours and Omar's works.
Okay. Going silent for a bit. Hope y'all have what you need for the moment.
Nice man great work
Everything good?
Just looked into it. It's possible to write python support for PZ.
This wouldn't immediately work but:
class Event:
def __init__(self) -> None:
pass
@staticmethod
def Add(callback) -> None:
pass
@staticmethod
def Remove(callback) -> None:
pass
class Events:
pass
Events.OnGameBoot = Event()
import Events
def callback():
print("Test")
Events.OnGameBoot.Add(callback)
local Events = require "Events"
local function callback()
print("Test")
end
Events.OnGameBoot.Add(callback)
yeah i've actually been thinking about it
i probably wouldn't even use it, i just think it'd be fun
My issue is knowing how to setup the right environment for such a mod
Using pip3, etc.
This is another puzzle and solving it would likely be a lot of fun.
@cold ruin
It'd be about translating common tasks in Python to Kahlua
This project has a lua translation utility file
It's cool that I already have somewhat of a decent result.
