Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

For my mod, I need to make an entity that is comprised of more than one model (OBJ or Techne) For example, it renders a body, but then whatever the condition may be, other parts such as the arms are changed. I could just make models of every single combination; however, that would be tedious and would be a last resort. You could say that I want to stitch models together in minecraft.

 

Anybody got an idea on how this can be created?

Create a model containing all or both, then create separate render methods to call depending on the situation?

if (leftArm.activeWeapon == Weapon.cannon)

renderLeftArmCannon(..args..);

else

renderSomethingElse();

 

Check into how people are rendering cables depending on whether they are connected or not, that should give you the general idea :)

If you guys dont get it.. then well ya.. try harder...

  • Author

Thats what I was thinking of doing however since the sheer amount of things that could be modified just doesn't make it viable. For example, the entity's head, body, legs, and arms, as well as weapons on both arms will change. Plus there are around 12-18 different parts for each section. (if you haven't guessed yet, it is going to be a mech)

 

I was thinking for having the entity be the body, then if the other parts are equipped, it is rendered another model relative to the position of the body. This works in theory, but I just don't know how to code/approach it.

Try getting the theoretical stuff down on paper, write everything down.

Then look at each part of the problem and try to break it down into smaller problems.

 

Maybe each part has it's own class which gets called by the body?

Then each part got the responsibility to render itself according to the parameters?

 

Thats what I was thinking of doing however since the sheer amount of things that could be modified just doesn't make it viable.

Why not? What problems do you see? :)

If you guys dont get it.. then well ya.. try harder...

how about you make a method for each area that can have a part and make them accept a byte as a parameter. and based on the byte you could render the parts differently. where 0 is none, 1 is cannon, 2 is arm, etc.

Take a look at the Player Renderer !

 

Player special's like capes, or Deathmau5's ears are rendered on a special way. they do not belong to the basic model. that way, you just need a variable for each part of the body, and depending on that variable, it will render another part. I think this is the easiest option you can get :)

  • Author

Thanks. I'll check the Player Renderer when I have time and i'll see if I can get something to work. If I need further help from there, I'll post again on this thread.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.