Futurecraft Forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Futurecraft Forums

A forum dedicated to communication and innovation!
 
HomeLatest imagesSearchRegisterLog in
Welcome, one and all, to the Futurecraft Forums!

 

 Stumped on a piece of code, Post here.

Go down 
3 posters
AuthorMessage
GroundBurg_Coder13
Newbie
Newbie
GroundBurg_Coder13


Posts : 59
Join date : 2011-08-31

Stumped on a piece of code, Post here. Empty
PostSubject: Stumped on a piece of code, Post here.   Stumped on a piece of code, Post here. Icon_minitimeTue 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.
Back to top Go down
ectrimble20
DEV
DEV
ectrimble20


Posts : 441
Join date : 2011-11-07

Stumped on a piece of code, Post here. Empty
PostSubject: Re: Stumped on a piece of code, Post here.   Stumped on a piece of code, Post here. Icon_minitimeTue 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.
Back to top Go down
GroundBurg_Coder13
Newbie
Newbie
GroundBurg_Coder13


Posts : 59
Join date : 2011-08-31

Stumped on a piece of code, Post here. Empty
PostSubject: Re: Stumped on a piece of code, Post here.   Stumped on a piece of code, Post here. Icon_minitimeTue 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)
Back to top Go down
The Schmetterling
DEV
DEV
The Schmetterling


Posts : 3123
Join date : 2011-08-31
Location : I'm a butterfly.

Stumped on a piece of code, Post here. Empty
PostSubject: Re: Stumped on a piece of code, Post here.   Stumped on a piece of code, Post here. Icon_minitimeTue Dec 06, 2011 5:02 pm

USE MOD-LOADER.
Back to top Go down
ectrimble20
DEV
DEV
ectrimble20


Posts : 441
Join date : 2011-11-07

Stumped on a piece of code, Post here. Empty
PostSubject: Re: Stumped on a piece of code, Post here.   Stumped on a piece of code, Post here. Icon_minitimeTue 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.
Back to top Go down
GroundBurg_Coder13
Newbie
Newbie
GroundBurg_Coder13


Posts : 59
Join date : 2011-08-31

Stumped on a piece of code, Post here. Empty
PostSubject: Re: Stumped on a piece of code, Post here.   Stumped on a piece of code, Post here. Icon_minitimeTue Dec 06, 2011 6:40 pm

Alright, alright Doc, changing to modloader. I had originally thought that we were not using it.

Back to top Go down
ectrimble20
DEV
DEV
ectrimble20


Posts : 441
Join date : 2011-11-07

Stumped on a piece of code, Post here. Empty
PostSubject: Re: Stumped on a piece of code, Post here.   Stumped on a piece of code, Post here. Icon_minitimeWed 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.
Back to top Go down
GroundBurg_Coder13
Newbie
Newbie
GroundBurg_Coder13


Posts : 59
Join date : 2011-08-31

Stumped on a piece of code, Post here. Empty
PostSubject: Re: Stumped on a piece of code, Post here.   Stumped on a piece of code, Post here. Icon_minitimeWed 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.
Back to top Go down
The Schmetterling
DEV
DEV
The Schmetterling


Posts : 3123
Join date : 2011-08-31
Location : I'm a butterfly.

Stumped on a piece of code, Post here. Empty
PostSubject: Re: Stumped on a piece of code, Post here.   Stumped on a piece of code, Post here. Icon_minitimeMon 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.
Back to top Go down
GroundBurg_Coder13
Newbie
Newbie
GroundBurg_Coder13


Posts : 59
Join date : 2011-08-31

Stumped on a piece of code, Post here. Empty
PostSubject: Re: Stumped on a piece of code, Post here.   Stumped on a piece of code, Post here. Icon_minitimeMon 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!)
Back to top Go down
The Schmetterling
DEV
DEV
The Schmetterling


Posts : 3123
Join date : 2011-08-31
Location : I'm a butterfly.

Stumped on a piece of code, Post here. Empty
PostSubject: Re: Stumped on a piece of code, Post here.   Stumped on a piece of code, Post here. Icon_minitimeTue 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.
Back to top Go down
Sponsored content





Stumped on a piece of code, Post here. Empty
PostSubject: Re: Stumped on a piece of code, Post here.   Stumped on a piece of code, Post here. Icon_minitime

Back to top Go down
 
Stumped on a piece of code, Post here.
Back to top 
Page 1 of 1
 Similar topics
-
» New help for code
» Code for a tester?
» 200,000-piece LEGO Rivendell
» Nobody post here!!!!
» Owls. Post 'em here.

Permissions in this forum:You cannot reply to topics in this forum
Futurecraft Forums :: General Area :: Off-Topic Area-
Jump to: