Jump to content

broede

Members
  • Posts

    24
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

broede's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. So the best way to do this would be to learn how to do these transformers and use them to add custom hooks, is that what I'm gathering? Do you know of any comprehensive tutorials for Transformers?
  2. So I'd like to make some changes to how certain things work. For instance, one of the major things I went over in the last two months with some help from this forum was how to render a new custom fluid, customizing all the effects such as how the fluid looks while inside of it, how monsters respond to it, etc. I created a fluid called "sludge" which is basically like green water, but it is needed for certain crops to grow. Now, if I used Material.water, then it behaves exactly like water and I can't make it behave like I want. If I try adding a custom fluid the Forge way, it might behave like a fluid in some ways, but I can't get things like custom drip colors, custom fog rendering, custom sunset recoloring, and so forth. The only way I could get it to work was to add my own fluid at the base class level. But, I cannot get it to work outside of the Eclipse IDE -- from what I've read, you can't *actually* change core Minecraft mechanics because they... I don't know, reset? I know what 99% of the people who might read this is going to say... don't edit base classes. I am aware of the perils of that when it comes to making a mod work with others, but the mod I'm working on will be an all-in-one mod for myself and some friends, so I can't even begin to care about that as a problem. Is it at all possible to make this happen? There's a lot about the game that I'd like to tweak and have fun with to bring an extra dimension of fun, so I can squeeze another year or so out of Minecraft before it gets too old hat. Thanks and have a great evening.
  3. Great idea. I posted a thread over there -- let's hope they have time to get around to it for 1.7. As for the tutorial... I'd feel more comfortable if and when they have hooks for the fog effects, though I suppose I could still discuss how to do it anyway, just with the caveat "this requires base class editing -- only do it for experimentation purposes" or something like that.
  4. Greetings to all! I just wanted to make a quick suggestion for Forge modding. It currently appears that adding true fog effects to custom fluids with custom material types requires the editing of base classes (EntityRenderer, ItemRenderer and a couple others -- TheGreyGhost and myself delved into this in the thread linked below). At his suggestion, I'm making the request for hooks to allow people in the future to be able to add their own custom fog effects. If you'd like more in-depth detail than what is provided here, I would be more than happy to oblige. http://www.minecraftforge.net/forum/index.php?topic=14587
  5. So it IS automatically rendering my under-fluid blocks with that darkness, I just didn't notice it for other factors. Once I added the fog effect that takes place OVER the surface (from underneath), it became a lot darker. And ItemRenderer... holy cow. Never would have suspected to find it in there. That's a great catch. As far as I can tell, I've got everything I need to make a custom fluid. The only question I really have left is -- given where a number of these settings/effects are taking place, how would it be possible to make these additions without editing base classes? They just seem so deeply embedded in hard code, like the fog effects. Perhaps a forge hook I haven't come into contact with... Anyway, this has been extremely helpful and I vastly appreciate it. Thank you so much!
  6. Okay, this is currently what's on my plate. Darkening the inside of the fluid. Here's your previous post... Okay, it seems to be that you are right, however, from everything *I* can personally see, there is no differentiation here between fluid types, so shouldn't this automatically render fluids made in Forge with half the brightness? Why is it failing to do so? And I've been looking really deep on this. Well, there's two checks against water that I found in EntityRenderer that are intriguing. One creates a dark fog over the surface of the fluid (which is probably 90% of what I was looking for). This is found in setupFog(): else if (j > 0 && Block.blocksList[j].blockMaterial == Material.water) { GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); if (entitylivingbase.isPotionActive(Potion.waterBreathing)) { GL11.glFogf(GL11.GL_FOG_DENSITY, 0.05F); } else { GL11.glFogf(GL11.GL_FOG_DENSITY, 0.1F - (float)EnchantmentHelper.getRespiration(entitylivingbase) * 0.03F); } } Then there's this... and I'm not entirely sure I see what it does. I added my own fluid to this if-check with Material.water and I couldn't tell a visual difference, but... /** * Changes the field of view of the player depending on if they are underwater or not */ private float getFOVModifier(float par1, boolean par2) { if (this.debugViewDirection > 0) { return 90.0F; } else { EntityLivingBase entityplayer = (EntityLivingBase)this.mc.renderViewEntity; float f1 = 70.0F; if (par2) { f1 += this.mc.gameSettings.fovSetting * 40.0F; f1 *= this.fovModifierHandPrev + (this.fovModifierHand - this.fovModifierHandPrev) * par1; } if (entityplayer.getHealth() <= 0.0F) { float f2 = (float)entityplayer.deathTime + par1; f1 /= (1.0F - 500.0F / (f2 + 500.0F)) * 2.0F + 1.0F; } int i = ActiveRenderInfo.getBlockIdAtEntityViewpoint(this.mc.theWorld, entityplayer, par1); if (i != 0 && Block.blocksList[i].blockMaterial == Material.water) { f1 = f1 * 60.0F / 70.0F; } return f1 + this.prevDebugCamFOV + (this.debugCamFOV - this.prevDebugCamFOV) * par1; } } Anyway, I'm still missing something. If you look carefully, you can see some kind of texture being rendered over the worldview when you are under water. You usually have to be looking for it to notice it. I can't figure out where this is rendered. If anyone happens across this, or just happens to know where it is, I'd be much obliged if you could inform me.
  7. I've been debugging a number of things before I move on to dealing with new things, and one bug I cannot seem to figure out... mobs automatically bob to the surface of water and even lava, but for some reason I cannot seem to get them to bob to the surface of my custom liquids. It's so frustrating. Mobs at the bottom of a pool just sit there. Now, I got them to be able to path across my liquids if they're searching for a player, and they can bob out of the fluid if they are on the surface, but if they sink more than a single block, they never come out. UPDATE: I noticed that jumping when underwater is handled mainly in EntityAISwimming.java, for those of you wanting to know the solution to this. Simply add new fluid checks into the method shouldExecute(). You'll also want to update EntityLiving, EntityLivingBase and Entity with any checks for your fluids, as well.
  8. Come to find out, BlockFluidBase controls flow length with something called "quantaPerBlock". All you have to do is use your new BlockFluidClassic class to call setQuantaPerBlock(number). With the way it is coded, it'll accept any number from 1 (meaning no flow-over) to 16 (flowing outward 15 blocks). This defaults to 8. Here's how I set mine up: public DCBlockFluid(int par1, Fluid par2Fluid, Material par3Material, int quant) { super(par1, par2Fluid, par3Material); this.disableStats(); float f = 0.0F; float f1 = 0.0F; this.setBlockBounds(0.0F + f1, 0.0F + f, 0.0F + f1, 1.0F + f1, 1.0F + f, 1.0F + f1); this.setTickRandomly(true); this.setQuantaPerBlock(quant); } I added the quantity into the constructor, then simply passed it on to setQuantaPerBlock from there. Works like a charm (my Waste block is set to 3, and flows no more than 2 blocks). I'm curious, do you know what "luminosity" does? I set it to 15 and there's very little light. But when I set it to 0 and simply changed the block's LightValue to 1.0F, it lights up like lava (which is what I wanted for my Waste fluid). I'm not sure what the use of luminosity is. Anyway, yes, I've come a long way in just under a week in no small part thanks to you and the others that have given me the right places to look. But I still have a couple more things to deal with before I feel comfortable writing up a tutorial. For instance, when you're underwater, I noticed that there's a deep murkiness to it. Not only is it dark without underwater vision, but there are particles of some kind rendered underneath there. These black dots and some light-colored lines. Do you have any insight on what those might be? EDIT: Good call on the static declarations of my icons, by the way. Can't believe I didn't catch that sooner myself.
  9. It occurred to me... this fluid icons are working. So now, my getIcon() method simply ignores the Block icons and calls them directly from the fluid itself. This may be a weird work-around, but it works! Thanks again for all the help! Last thing to do is look at TGG's suggestion for flow length, and I'll be set.
  10. I opened a logger and went into that method you suggested and logged every detail. This fluid's icons are being set properly. However, check out this log output I called in postInit()... 2013-12-14 06:01:17 [iNFO] [DOOMEDCraft-Client] Running postInit() 2013-12-14 06:01:17 [iNFO] [DOOMEDCraft-Client] Logging fluid details: 2013-12-14 06:01:17 [iNFO] [DOOMEDCraft-Client] fluidSludge >> 2013-12-14 06:01:17 [iNFO] [DOOMEDCraft-Client] Name - sludge 2013-12-14 06:01:17 [iNFO] [DOOMEDCraft-Client] UnlocalizedName - fluid.fluidSludge 2013-12-14 06:01:17 [iNFO] [DOOMEDCraft-Client] Still Icon - dcmod:blockSludgeStill 2013-12-14 06:01:17 [iNFO] [DOOMEDCraft-Client] Flowing Icon - dcmod:blockSludgeFlow 2013-12-14 06:01:17 [iNFO] [DOOMEDCraft-Client] blockSludge >> 2013-12-14 06:01:17 [iNFO] [DOOMEDCraft-Client] UnlocalizedName - tile.blockSludge 2013-12-14 06:01:17 [iNFO] [DOOMEDCraft-Client] Still Icon - dcmod:blockSludgeStill 2013-12-14 06:01:17 [iNFO] [DOOMEDCraft-Client] Flowing Icon - dcmod:blockSludgeFlow 2013-12-14 06:01:17 [iNFO] [DOOMEDCraft-Client] fluidWaste >> 2013-12-14 06:01:17 [iNFO] [DOOMEDCraft-Client] Name - waste 2013-12-14 06:01:17 [iNFO] [DOOMEDCraft-Client] UnlocalizedName - fluid.fluidWaste 2013-12-14 06:01:17 [iNFO] [DOOMEDCraft-Client] Still Icon - dcmod:blockWasteStill 2013-12-14 06:01:17 [iNFO] [DOOMEDCraft-Client] Flowing Icon - dcmod:blockWasteFlow 2013-12-14 06:01:17 [iNFO] [DOOMEDCraft-Client] blockWaste >> 2013-12-14 06:01:17 [iNFO] [DOOMEDCraft-Client] UnlocalizedName - tile.blockWaste 2013-12-14 06:01:17 [iNFO] [DOOMEDCraft-Client] Still Icon - dcmod:blockSludgeStill 2013-12-14 06:01:17 [iNFO] [DOOMEDCraft-Client] Flowing Icon - dcmod:blockSludgeFlow 2013-12-14 06:01:17 [iNFO] [DOOMEDCraft-Client] Leaving postInit() For some reason, the Waste BLOCK, not the fluid, is getting the incorrect icons set. Wait... WHAT?!? I don't even get how! If the fluid icons are being set based on the block icons (due to the call stack -- the blocks are being built, and THEN the fluid icons are being set based on those), then why aren't the fluid's icons incorrect, too? This is making me dizzy. lol
  11. Now we're getting somewhere, unfortunately things are not working as I had hoped they would. Originally, my two fluids, sludge and waste, rendered properly. However, after reading the tutorial linked by TGG, I converted everything over to using the iconStill/iconFlowing as suggested. I made animations, etc. etc. Now, I'm finding something interesting. Both of my fluids are displaying the same files. Here's where I load the two fluids and their blocks: public void BuildFluids() { // Sludge. The result of mixing Waste with Water. Non-toxic. fluidSludge = new DCFluid("Sludge") .setViscosity(2000) .setDensity( .setUnlocalizedName("fluidSludge") .setBlockID(blockRegistry.newID()); FluidRegistry.registerFluid(fluidSludge); blockSludge = (DCBlockFluid) new DCBlockFluid(fluidSludge.getBlockID(), fluidSludge, SLUDGE) .setHardness(100.0F) .setLightOpacity(3) .setUnlocalizedName("blockSludge"); LanguageRegistry.addName(blockSludge, "Sludge"); GameRegistry.registerBlock(blockSludge, "blockSludge"); // Waste. Toxic to the living. Only found in the Bayou dimension. fluidWaste = new DCFluid("Waste") .setViscosity(7500) .setDensity(3) .setLuminosity(15) .setUnlocalizedName("fluidWaste") .setBlockID(blockRegistry.newID()); FluidRegistry.registerFluid(fluidWaste); blockWaste = (DCBlockFluid) new DCBlockFluid(fluidWaste.getBlockID(), fluidWaste, WASTE) .setHardness(100.0F) .setLightValue(1.0F) .setUnlocalizedName("blockWaste"); LanguageRegistry.addName(blockWaste, "Waste"); GameRegistry.registerBlock(blockWaste, "blockWaste"); } And this is the DCBlockFluid class where it registers the icons: @SideOnly(Side.CLIENT) public void registerIcons(IconRegister iconRegister) { this.iconStill = iconRegister.registerIcon(DCMod.modid + ":" + (this.getUnlocalizedName().substring(5)) + "Still"); this.iconFlowing = iconRegister.registerIcon(DCMod.modid + ":" + (this.getUnlocalizedName().substring(5)) + "Flow"); this.getFluid().setIcons(this.iconStill, this.iconFlowing); } Problem is, they're both displaying the "waste" icons now, instead of their own individual icons, whereas they did so before. For some reason, the newer of the two is overlaying their icons over the other. I switch the order of which the fluids were created and this backed up my theory. What can I possibly be doing wrong here?
  12. Like how water has a flow length of 8, but lava has a flow length of 3. The distance of blocks it travels before it stops flowing.
  13. A-ha! EntityLivingBase.moveEntity() disables the jumping mechanism while inside of a fluid. However, you need to tweak EntityLivingBase().moveEntityWithHeading() in order to add the sluggish/swim movements. Also: updateFallState() is useful for splashing into a fluid to prevent fall damage. I thank everyone for the progress, it's been a big help. Still working on flow length and animation, however. Oh, and if anyone is interested, you need to look over GuiIngameForge.java if you want to display the air bar while drowning in a custom fluid type.
  14. That means you've gotten the "signature" wrong on your method so it will never be called - i.e. the name is wrong or the parameters are different. In this case, only BlockFluid has a Material parameter, but BlockFluidClassic derives from BlockFluidBase not BlockFluid. eg BlockFLuid: public static double getFlowDirection(IBlockAccess par0IBlockAccess, int par1, int par2, int par3, Material par4Material) BlockFluidBase: public static double getFlowDirection(IBlockAccess world, int x, int y, int z) If you derive your DCBlockFluid from BlockFluidClassic, you don't need the code to pass the material in because your DCBlockFluid already knows it. BlockFluid is vanilla, BlockFluidClassic is Forge. Use BlockFluidClassic. The renderer will call from RenderBlockFluid.renderWorldBlock (confusing choice of name for that class!), not RenderBlocks.renderBlockFluids. -TGG Thank you for pointing this out. However, now that I've looked things over more closely, I'm not sure those methods will matter anyway, since -- as you pointed out -- the current is handled elsewhere anyway. And if that's the case... what the heck do these methods even do?!?
  15. This information helped quite a bit. My liquids now have the push back, one of them even does custom damage now. However, I still have a couple of problems. The code you suggested I look over for the "swimming" effect... well, the only thing I was able to do by adding checks for my liquids was remove the ability to jump inside of the liquid. Holding the spacebar does nothing, no jumping or swimming. There has to be more to it and I will look over EntityLivingBase.moveEntity() in a few minutes. So, I was able to add liquids, add bucket checks, give flow properties and give custom damage. I even added a few custom particles and figured out custom screen fog. Thanks to everyone for the help thus far. I still need to figure out how to: animate fluids, change movement in fluids/allowing swimming, cause the new fluids to react to other fluids in the way that water and lava interact (I'm pretty sure I already know where to look for this, though). Oh... and flow length. Almost forgot that one. The major, major problem I have is that some of these effects -- I had to edit core Minecraft code. *sigh*
×
×
  • Create New...

Important Information

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