| Stumped on a piece of code, Post here. | |
|
|
Author | Message |
---|
GroundBurg_Coder13 Newbie
Posts : 59 Join date : 2011-08-31
| Subject: Stumped on a piece of code, Post here. Tue Dec 06, 2011 12:21 am | |
| Ok, this may sound dumb, but does anyone know how to code a new textureFX for a new custom block?
For the life of me i can not figure it out. | |
|
| |
ectrimble20 DEV
Posts : 441 Join date : 2011-11-07
| Subject: Re: Stumped on a piece of code, Post here. Tue Dec 06, 2011 2:07 am | |
| you mean just add a new block image? if you're using MCP/ModLoader, there's a function called addOverride (I think) that should allow you to over ride the default texture. see if I can find a snippet. here we go: - Code:
-
mod_BlockUranium.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/BlockUranium.png"); just replace the mod_BlockUranium with your class and the BlockUranium.png with your image. Do that in your main declaration class where you define your objects and it should do what I think you're trying to accomplish. If that's not what you need, just specify what exactly your trying to do and I'll attempt a better answer. | |
|
| |
GroundBurg_Coder13 Newbie
Posts : 59 Join date : 2011-08-31
| Subject: Re: Stumped on a piece of code, Post here. Tue Dec 06, 2011 4:48 pm | |
| Thanks but no, I was looking for making an actual animated texture ( similar to the portal block). Ive looked through its coding and have very little idea on how it works.
Also, im working with base src code, not modloader ( not sure whether that is good or not, it seems like it make it a whole lot more difficult to incorporate stuff) | |
|
| |
The Schmetterling DEV
Posts : 3123 Join date : 2011-08-31 Location : I'm a butterfly.
| Subject: Re: Stumped on a piece of code, Post here. Tue Dec 06, 2011 5:02 pm | |
| | |
|
| |
ectrimble20 DEV
Posts : 441 Join date : 2011-11-07
| Subject: Re: Stumped on a piece of code, Post here. Tue Dec 06, 2011 5:39 pm | |
| well, for compatibility issues with the mod, I've been attempting to work everything I'm building into modloader, however, I think some of our stuff will need to be stand alone, so I'm thinking its not a bad idea, just do not modify base classes, add new classes that extend existing classes and we shouldn't have problems with compatibility.... though who the hell cares if some crappy ore mod doesn't work with our stuff? right? screw them haha.
Anyway, I'll be home kinda late tonight, but once I get there I'll spin through the portal block code and see if I can provide a bit more assistance then. | |
|
| |
GroundBurg_Coder13 Newbie
Posts : 59 Join date : 2011-08-31
| Subject: Re: Stumped on a piece of code, Post here. Tue Dec 06, 2011 6:40 pm | |
| Alright, alright Doc, changing to modloader. I had originally thought that we were not using it.
| |
|
| |
ectrimble20 DEV
Posts : 441 Join date : 2011-11-07
| Subject: Re: Stumped on a piece of code, Post here. Wed Dec 07, 2011 12:49 am | |
| Post full code and full error please, thats not enough for me to go on. All I can tell you about the abstract is what you already know (i.e you must declare certain things with the abstract methods blah blah).
As for the original question, I've been digging through the BlockPortal.java to see what makes it tick. BlockPortal is kinda vague as to what directly handles the animation, its properties are set the same as other blocks (via Materials.java, BlockBreakable.java, Block.java etc) but it also has a spawn particals call in it.
So I've also taken a look at fire, since its a more animated block.
Would appear to me that the "randomDisplayTick" method in the class controls the update tick for the animation, but I haven't found anything directly related to its animation. I'll have to dig at little more before I had a better answer for you. | |
|
| |
GroundBurg_Coder13 Newbie
Posts : 59 Join date : 2011-08-31
| Subject: Re: Stumped on a piece of code, Post here. Wed Dec 07, 2011 1:10 am | |
| Alright, Thanks. For fire, it seems like the texture is pulled out of thin air, so the full transition must be in the colour hex values.
And for the previous error, I figured it out as not initializing a specific portion of the code, but thanks anyway. | |
|
| |
The Schmetterling DEV
Posts : 3123 Join date : 2011-08-31 Location : I'm a butterfly.
| Subject: Re: Stumped on a piece of code, Post here. Mon Jan 16, 2012 6:22 am | |
| Does anybody notice that most of our extra developers just seem to come all bright eyed and bushy tailed (funny, in the case of Fr0stbyte), then just fade away. | |
|
| |
GroundBurg_Coder13 Newbie
Posts : 59 Join date : 2011-08-31
| Subject: Re: Stumped on a piece of code, Post here. Mon Jan 16, 2012 11:04 pm | |
| Yeah, sorry Doc, ive been trying small things here and there with code when i have time, but god school takes so much time.
Hopefully ill be back in full force in a few weeks ( as its a new semester) not to mention a lot of free time to do coding ( Yay!) | |
|
| |
The Schmetterling DEV
Posts : 3123 Join date : 2011-08-31 Location : I'm a butterfly.
| Subject: Re: Stumped on a piece of code, Post here. Tue Jan 17, 2012 2:21 am | |
| - GroundBurg_Coder13 wrote:
- Yeah, sorry Doc, ive been trying small things here and there with code when i have time, but god school takes so much time.
Hopefully ill be back in full force in a few weeks ( as its a new semester) not to mention a lot of free time to do coding ( Yay!) Excellent! I'm now glad I decided to necro-post, despite the fact that Fr0stbyte is a necrophobic. | |
|
| |
Sponsored content
| Subject: Re: Stumped on a piece of code, Post here. | |
| |
|
| |
| Stumped on a piece of code, Post here. | |
|