#PreloadLib: Simple Preloading Library

1 messages · Page 1 of 1 (latest)

royal sparrow
#
#

I am unsure how useful this will be to anyone. Maybe people do this for their games and I just don't know. But, it has been fun to make.

#

I know for myself, atleast, I'll be using this in my game

vagrant horizon
#

hmm whats this

old scaffold
#

Library

royal sparrow
royal sparrow
# vagrant horizon hmm whats this

Essentially the idea is to wrap PreloadAsync in a way that allows people to easily add behaviour like on progress on batch on asset and to safely capture and store errors in those functions as well as actua asset fetch failures

solar summit
#

like i give a meshpart a "PRELOAD" tag

old scaffold
#

Table of instances

vagrant horizon
#

Im gonna check it out rn

solar summit
#

also what if the path changes

old scaffold
#

That's not I meant lol 😭

#

I meant it should just have support for tables which have instances in it

#

So then you could preload tagged instances

royal sparrow
#

Let me know if that's not working!

solar summit
#

let's take an eyes 👀

#

a look even 👀

royal sparrow
#

A peak, perhap?!

solar summit
#

⛰️

#

peak

#

peek 👀

#

is this module peak ⛰️ or not even worth taking a peek 👀

vagrant horizon
#

2 times today

#

I tried to open the link

#

and it failed

#

I got lazy and close the tab off

#

this will be my 3rd time

#

yep

#

its not loading

#

@royal sparrow can you drop the file

#

I fucking hate roblox

#

I can help you setup github

#

if you want

royal sparrow
vagrant horizon
#

doesn't matter to send me

#

but for github

#

use luau

#

oh wait

#

the code in the post

#

is that the entire thing?

royal sparrow
#

Yes

vagrant horizon
#

ohh

#

let me check it out then

royal sparrow
#

Okay thank you

vagrant horizon
#

looks good at a first glance

#

I just don't like camelCase for table entries

#

to keep it consistent with roblox

#

but that's stylistic preference

#

I like the callback style signaling

#

seems pretty easy to use

#

the asset type can be made a lot more specific instead of any

#

but that's fine considering there are many types of assets

#

returns a result

#

even tho some stuff here I don't understand

#

like total

#

guessing its total assets

#

would be better to name it TotalAssets

#

or simply AssetCount

#

overall looks solid and intuitive

#

@royal sparrow good job

royal sparrow
vagrant horizon
#

is what roblox uses

royal sparrow
vagrant horizon
#

they deprecated camelCase for table entries and class fields

royal sparrow
royal sparrow
vagrant horizon
#

but even as simple as Instance | string

#

would at least give users a starting point

#

without reading anything about it

#

orlike Instance | string | {any}

royal sparrow
#

Ahh, that makes sense

#

Thank you for the guidance, I'll probably make a small 1.1 update just to correct these sorts of things

vagrant horizon
#

np just let me know if you need help

#

like I can help you setup github

#

if you ever want

royal sparrow
#

Okay, when/if I decide to do so, I'll let you know

vagrant horizon
#

or if you just want to keep it as source code

#

that's also fine

royal sparrow
#

I think it's small enough for now to be src

vagrant horizon
#

ye ye

#

fairs

royal sparrow
#

But it might grow. I'm waiting for feedback as to what else can be done to make this even more applicable

vagrant horizon
#

I think this covers a lot of the cases with asset preloading

#

although for animations it may be weak a bit but that's what #1490093613747798098 is for

royal sparrow
#

It's definitely a lot cleaner than the janky stuff I do in my games because I hate working with content provider. Probably the biggest thing for this is batches, since I think if the batch is too large, it'll just not work

vagrant horizon
#

Imma be fr

#

it's too hard to manage

#

I just let roblox do its thing

#

and accept a little delay for the first time

#

but for a loading screen

royal sparrow
#

Yeah, like I havent tested this on my actually finished game to see if this even works

vagrant horizon
#

this would be incredible

royal sparrow
#

For sure, the clamped percentage just makes that whole loading bar jazz that much easier

#

I just wonder if silly people will pass 10000 item table for "preloading" 💀

old scaffold
#

For Roblox I get, but if it's you scripting? Use what you want

vagrant horizon
#

Im forced to use roblox

#

so I see pascal and camel at the same time

#

in same code base

#

just creates inconsistency overall

old scaffold
#

use camelCase for mostly everything, use PascalCase for classes and types

cunning gate
# royal sparrow [Developer Forum post](https://devforum.roblox.com/t/preloadlib-simple-preloadin...

cvan u add utility to keep shit loaded

like how if u have an imagelabel in trhe corner of the screen with size 0,1,0,1 it keeps that image loaded even if it isnt visible and stops roblox from unloading
or how roblox keeps all decals in workspace loaded at all times

preloadasync is nice but there r still cases where roblox will unload ur assets, would be nioce to have a module that makes preloading and unloading stuff easioer without having to worry about roblox Snatching the asset right outta ur hands mid-session

like :ForceLoad(): id and :Unload(id) or something would ve nice, beats having to do instance.new() and gui[id]:destroy() when i wanna force load and unload somthing

#

if u dont wanna cus its not necessarily part of preloadasync thats fine, jsut a suggestion based on what i think has no utility rn

#

this is mostly for vfx and ui since those r the two asset types roblox will try unloading if its not in use (even if u preload it)

cunning gate
#

you have not lived rthrough the horrors of image loading that i have,,, you do not know how evil roblxo can be...

#

"oh you wanna change somethings texture in runtime? 🥺

nice thatll be 15 seconds of delay and im gonna IMMEDIATELY forget the assetid it used to be lol hope u dont mind"

old scaffold
#

schrodinger's texture

royal sparrow
cunning gate
cunning gate
#

its a bit tedious to do normally across scripts so i look forward to whatever simplification u end up w

vagrant horizon
#

knowing this exists

#

😭

cunning gate
#

😭