Jump to content

Storing per-player data in capability


Spyeedy

Recommended Posts

Ok, so I'm creating a boolean capability and I'm not so sure if I have setup the boolean capability correctly.

Now, what I'm trying to do here is to store the toggle state of the player's increased running speed in a capability as suggested here.

 

So now that intro is done, the questions!

  • How do I retrieve the boolean from the capability?
  • What changes do I need to make to my KeyBindingEvent (that's where the toggle state is occurring. P.S. it's located in client/handler)?
  • Do I attach the capability to the player?

 

Annd my code! Here's the link.
Directions to the classes:

  1. IBooleanData (that's the name of the capability) is located in common/capabilities.
  2. UpdateBooleanData (name of the packet that is sent to the client to update the data) is located in common/network/client

Well, I think that's all you guys need. If you need more info, tell me in your reply and I will add them to the directions list here.

width=620 height=260http://www.startrek.com/uploads/assets/articles/61c89a9d73c284bda486afaeaf01cdb27180359b.jpg[/img]

Till next time. Thank you for delivering funny scenes to Star Trek as Chekov :) . Will always remember you

Link to comment
Share on other sites

Wait what? I set up the methods correctly? getter and setter for the boolean? Anyway, I needed another pair of eyes to see if I setup the capability for booleans correctly. Do I attach the capability to the player in this case with the toggle state?

width=620 height=260http://www.startrek.com/uploads/assets/articles/61c89a9d73c284bda486afaeaf01cdb27180359b.jpg[/img]

Till next time. Thank you for delivering funny scenes to Star Trek as Chekov :) . Will always remember you

Link to comment
Share on other sites

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.