Jump to content

Recommended Posts

Posted

I'm planning to add some RPG skills to my mod (strength,agility... stuff like that), but I dont know how to do that.

What classes I should start check out or are there any tutorials about this topic?

 

 

Posted

You'll probably want to use

IExtendedEntityProperties

to store the stats for each player. coolAlis has a tutorial on the system here.

 

To implement the effects of these stats, just use the hooks and events provided by Forge. How you do this depends on what you actually want to do.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

  • 2 weeks later...
Posted

That is a pretty complicated topic though...

 

I'm author of https://github.com/LambdaInnovation/AcademyCraft, which is a mod that focuses entirely on super abilities, so I will explain a bit about my thoughts on a skill system and experience gained through developement.

 

1. Controlling

---

It differs largely by how you want your skills to be controlled. In my mod the skills are controlled using independant keys. In this way, you probably want to implement a personal key-listening mechanism and have vanilla MC key disabled when your skills are ready to use. Or you can use one or two keys that doesn't collide with vanilla keys, that's completely fine.

 

2. Data storage

---

Skills usually point to per-player data storage for skill points and other properties. You can use IExtendedEntityProperties for that. Note that there are some tricky points to implement it correctly, especially PlayerEvent.Clone......

 

If you want your client to display GUIs or something about those states, you also have to create packets(messages) to synchronize the data.

 

3. Actual effects

---

Skills almost always affects both server and client. Creating a uniformed way to represent those changes easily can be challenging, depends on what effect you want to implement. If it is as simple as press a key and do things right away, just send packets when the key is pressed. But if you want to have skills that charges themselves, have interactive interfaces, and more complicated features, things starts to get messy quickly if you don't think hard. Here's a few tips:

 

* Create an 'action' class that communicates in client/server and sends event about keydown/tick/keyup/abort.

* Client-side render can be achieved by client-only entities, or server-side synced entities. You can choose as what you like, but the client-only approach might be cleaner.

 

 

That's pretty much all the basic points I can think of. The design decision really differs greatly, depends on what kind of effect and content you are trying to achieve. Feel free to refer to the src :)

Posted

I'm author of https://github.com/LambdaInnovation/AcademyCraft, which is a mod that focuses entirely on super abilities,

 

Awesome mod btw. I was linked to it a few weeks back. I loved the series (both, actually) and think it was a cool mod concept.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.