Jump to content

Custom moodles and how to work with existing moodles?


Greeny

Recommended Posts

Hi, yes I am asking for help on my very first post I am literally that cool.

I was actually making some map mods for PZ back when the map was the size of a shoebox, the forum was somewhere else and the Axe never degraded... good times.

 

Anyways I'm back after a long time and this time I have more than just mapping in mind but it's my first time doing lua. I do have some experience with python so how hard can it be right.

 

Getting to the point: How does one go about creating a custom moodle? Is it even possible? I did do some looking into it, a post dated back in April states "MoodleFactory" hasn't been implemented yet.

 

Now if that isn't possible, would a workaround be viable? Basically could I create a variable, attaching it to the player with this getModData() thing I read about, change its value EveryTenMinutes based on a bunch of superfluous if statements and then somehow make a picture appear somewhere on screen if its value is a certain amount?

 

Also how do I get the current value of existing moodles, add/subtract from them and change the rate at which they're changing by default?

 

Thanks for your time.

Link to comment
Share on other sites

It's not possible, unfortunately.

You've have to work around it by first hiding their moodle system then drawing two textures (the front and back of the moodle) in the correct position. This means you'd have to track player statistics you're interested in yourself.

It's quite doable, though.

Link to comment
Share on other sites

Is hiding their moodle system really necessary? I could just put my own moodles at another location. Maybe right next to the existing ones. Also not sure what the front/back thing is about. Tracking should be easy if it's a statistic I put there myself, right? Right. Probably.

 

But yes, doable sounds good. What's the function to draw a texture to the screen? That's the main issue for this workaround to work.

Link to comment
Share on other sites

Not totally necessary, but you might have the game's moodles float up behind your own, and dance. Might be possible to get the number of moodles present on a character, though, so you can guess the number of slots.

Two textures are used by the ingame moodles: one for the background (the colored ring) and one for the foreground (the picture itself). This way you can have one picture represent several things (good, bad, level of severity) all with the same image.

To draw a texture, call this within Events.OnPreUIDraw:

 

	t = getTexture("media/ui/Moodles/Moodle_Icon_Endurance.png")	UIManager.DrawTexture(t, x, y)
Link to comment
Share on other sites

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
×
×
  • Create New...