
CodeLover
Members-
Posts
19 -
Joined
-
Last visited
Converted
-
Gender
Undisclosed
-
Personal Text
I am new!
CodeLover's Achievements

Tree Puncher (2/8)
0
Reputation
-
I have already deleted the other code as it didn't work as expected - i can recreate a similar piece if you would like to work from that I was aiming towards a similar this to in the video wherer they slid around the wall at a speed that is set by a variable - i believe that wouldn't be hard to add once you know the bounding blocks for the effect. The tesselator code i am ok at - i know what all the parameters for it are and how it draws the image. I will post the experimental code once i am finished with it
-
I have been staring at the code for a day now and all attempts fail. Cant seem to figure out how - I've been using the method i suggested with a loop that has 360 checks each degree. Ive totally scrapped all that and have come back to ask the best and correct way of implementing this piece of code Thanks
-
I have a basic understanding of vectors and understand most of the code you suggested but cannot think how to implement a similar sort of thing to can an area. I understand the code is creating a vector, that is as long as your reach distance, outwards in line with the crosshair and checking whether or not the end point of that vector is in a block. Would i need a for loop that runs for 360 loops for every degree? Then each degree i get the length of the vector? - If it is that i am unsure on how to actually draw the particle images. Ive got everything like the colour and dots setup now, i just need the drawing
-
Yes they would change the hue of the image. Assuming they're just drawing plain dots, they don't use an image. EntityRenderer.getMouseOver() is a good example of this. EntityLivingBase.rayTrace() --> World.rayTraceBlocks_do_do() does all the work for the blocks part of it. The rest of getMouseOver handles collisions with Entities. -TGG How would i be able to make a solid colour dot as i don't think i can use and image as well as have a custom 3d rendered block as the textures conflict. Ive had a look through the entity renderer but cannot understand much at all and would not know how to implement it in such a way that scans the area then emits the dots on the blocks. How would the block scanning code look?
-
So in the video - they would be using a base image then changing the hue of the image for the different colours? How would they modify the image? also how would you search for a block - would it be a for loo[p with a bunch of statements that ceck if a block is there?
-
HI there Thanks for your reply. I have had a look at some tutorials on a tile entity special renderer. I think i know how i am going to move the dots but i am not sure about the drawing still, Would i need an image or could i get it all done in code?. I am only early stage in learning about tessalators and such. Also how would i find the block locations for the squares to move along? Would you have to go through and check every block around the centre "emitter" or would there be a more efficient way?
-
Hi Everybody I posted on here a few months back now and never got a solid answer to my question, However i did gain more info on what was going on in the code. I really need an effect like the one seen in but i just need one colour. I have learnt that this invokes a render effect within the tile entity class but i have never used such code. I would like it to follow the walls just like in the video but one solid colour of grey. I have been trying to get a similar effect for a few months now with no success. Hopefully i can get an answer thanks
-
I have been trying for a while now to get a similar effect but with just white squares or grey squares and i couldn't figure it out. Could someone pls run me through this?
-
If you look at the constructor it sets the initial motion and the life of the particles and then the onUpdate() updates the position. So you would put in what you want -- do you want them to start out in specific directions, move fast or slow, move randomly, move straight or in circles, etc. And to spawn on the walls you just need to set their initial position to be where the wall is. Whether or not the wall is easy to detect would depend on whether the size and shape of the room is already expected to be a certain way or whether you want your particles to be smart enough to go around any shape and size of room. However, I looked at that video you posted again and it is possible that they did not use particles. They may just be doing some sort of render effect. Anyway, I think it would be possible for the disco ball in that example to have a TileEntity associated which is controlling the effect. In fact, if you keep track of the particles that are created, the TileEntity itself should be able to update the position. I downloaded this mod to play with some mates and found that the classes to do with the Block are as followed: BlockClass and a TileEntityBlockClass (I can't quite remember what they were named) How would i achieve a similar effect with the tile entity because i have never seen anything like this before. EDIT: I have opened the class file to try and see what is going on. This is it: package maaatin.disco; import abw; import asp; import asx; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import java.util.Random; public class TileEntityDiscoBall extends asp { public int lightsPerRow; public int height; public int resolution; public double[][][] possibleLightCoords; public int[][] orientations; public double[][][] allLightXCoordinates; public double[][][] allLightYCoordinates; public double[][][] allLightZCoordinates; public int[][][] allOrientations; public int lightRange; public double angle; public boolean initialized; public int[][] rand; public int counter; public double orientationAngle; public int speed; public TileEntityDiscoBall() { this.lightsPerRow = 16; this.height = 9; this.resolution = 300; this.possibleLightCoords = new double[3][this.resolution][this.height]; this.orientations = new int[this.resolution][this.height]; this.allLightXCoordinates = new double[this.lightsPerRow][this.height][this.resolution]; this.allLightYCoordinates = new double[this.lightsPerRow][this.height][this.resolution]; this.allLightZCoordinates = new double[this.lightsPerRow][this.height][this.resolution]; this.allOrientations = new int[this.lightsPerRow][this.height][this.resolution]; this.lightRange = 16; this.angle = 0.0D; this.initialized = false; this.rand = new int[60][60]; this.speed = 100; } public void h() { if (!this.initialized) { initialize(); } } @SideOnly(Side.CLIENT) public asx getRenderBoundingBox() { return INFINITE_EXTENT_AABB; } public void initialize() { boolean stopLoop = false; for (int h = 1; h < this.height; h++) { if ((!this.k.c(this.l, this.m - h, this.n)) && (!stopLoop)) { this.height = h; stopLoop = true; } } for (int h = 0; h < this.height; h++) { for (int i = 0; i < this.lightsPerRow; i++) { this.rand[i][h] = this.k.s.nextInt(this.resolution / 10); } } for (int h = 0; h < this.height; h++) { this.counter = (this.resolution - 1); this.angle = 0.0D; for (int i = this.resolution - 1; i >= 0; i--) { getCoords(this.l + 0.5D, this.m + 0.5D - h, this.n + 0.5D, this.k, this.angle, h); this.angle += 3.141592653589793D / (this.resolution / 2.0D); this.counter -= 1; } } for (int h = 0; h < this.height; h++) { for (int i = 0; i < this.lightsPerRow; i++) { for (int j = 0; j < this.resolution; j++) { this.allLightXCoordinates[i][h][j] = this.possibleLightCoords[0][((j + (this.rand[i][h] + this.resolution * i / this.lightsPerRow)) % this.resolution)][h]; this.allLightYCoordinates[i][h][j] = this.possibleLightCoords[1][((j + (this.rand[i][h] + this.resolution * i / this.lightsPerRow)) % this.resolution)][h]; this.allLightZCoordinates[i][h][j] = this.possibleLightCoords[2][((j + (this.rand[i][h] + this.resolution * i / this.lightsPerRow)) % this.resolution)][h]; this.allOrientations[i][h][j] = this.orientations[((j + (this.rand[i][h] + this.resolution * i / this.lightsPerRow)) % this.resolution)][h]; } } } this.initialized = true; } public void getCoords(double x, double y, double z, abw world, double angle, int h) { boolean coordinateFilled = false; for (int i = 1; i < this.lightRange; i++) { if ((!coordinateFilled) && (!world.c(truncateDoubleToInt(x + i * Math.cos(angle)), (int)y, truncateDoubleToInt(z + i * Math.sin(angle))))) { if (world.c(truncateDoubleToInt(x + (i - 0.1D) * Math.cos(angle)), (int)y, truncateDoubleToInt(z + (i - 0.1D) * Math.sin(angle)))) { fillCoords(0.1D, x, y, z, i, h); } else if (world.c(truncateDoubleToInt(x + (i - 0.2D) * Math.cos(angle)), (int)y, truncateDoubleToInt(z + (i - 0.2D) * Math.sin(angle)))) { fillCoords(0.2D, x, y, z, i, h); } else if (world.c(truncateDoubleToInt(x + (i - 0.3D) * Math.cos(angle)), (int)y, truncateDoubleToInt(z + (i - 0.3D) * Math.sin(angle)))) { fillCoords(0.3D, x, y, z, i, h); } else if (world.c(truncateDoubleToInt(x + (i - 0.4D) * Math.cos(angle)), (int)y, truncateDoubleToInt(z + (i - 0.4D) * Math.sin(angle)))) { fillCoords(0.4D, x, y, z, i, h); } else if (world.c(truncateDoubleToInt(x + (i - 0.5D) * Math.cos(angle)), (int)y, truncateDoubleToInt(z + (i - 0.5D) * Math.sin(angle)))) { fillCoords(0.5D, x, y, z, i, h); } else if (world.c(truncateDoubleToInt(x + (i - 0.6D) * Math.cos(angle)), (int)y, truncateDoubleToInt(z + (i - 0.6D) * Math.sin(angle)))) { fillCoords(0.6D, x, y, z, i, h); } else if (world.c(truncateDoubleToInt(x + (i - 0.7D) * Math.cos(angle)), (int)y, truncateDoubleToInt(z + (i - 0.7D) * Math.sin(angle)))) { fillCoords(0.7D, x, y, z, i, h); } else if (world.c(truncateDoubleToInt(x + (i - 0.8D) * Math.cos(angle)), (int)y, truncateDoubleToInt(z + (i - 0.8D) * Math.sin(angle)))) { fillCoords(0.8D, x, y, z, i, h); } else if (world.c(truncateDoubleToInt(x + (i - 0.9D) * Math.cos(angle)), (int)y, truncateDoubleToInt(z + (i - 0.9D) * Math.sin(angle)))) { fillCoords(0.9D, x, y, z, i, h); } else { fillCoords(1.0D, x, y, z, i, h); } coordinateFilled = true; } } } public void fillCoords(double j, double x, double y, double z, int i, int h) { this.possibleLightCoords[0][this.counter][h] = (x + (i - j) * Math.cos(this.angle)); this.possibleLightCoords[1][this.counter][h] = y; this.possibleLightCoords[2][this.counter][h] = (z + (i - j) * Math.sin(this.angle)); this.orientations[this.counter][h] = getOrientation(this.possibleLightCoords[0][this.counter][h], this.possibleLightCoords[1][this.counter][h], this.possibleLightCoords[2][this.counter][h]); } public int getOrientation(double x, double y, double z) { this.orientationAngle = 0.0D; for (int i = 0; i < 4; i++) { double j = 0.2D; if (!this.k.c(truncateDoubleToInt(x + j * Math.cos(this.orientationAngle)), truncateDoubleToInt(y), truncateDoubleToInt(z + j * Math.sin(this.orientationAngle)))) { return i; } this.orientationAngle += 1.570796326794897D; } return 0; } public static int truncateDoubleToInt(double par0) { return (int)(par0 + 1024.0D) - 1024; } } Now i this abw is World. asp is TileEntity and asx is maybe Block. I cannot see how this is working just due to the lack of methods actually listed.
-
I thought i would need to override it and add my own but i don't know how i would Implement the movement and i don't know how it would spawn on the walls
-
Has anyone done this before? I have a basic particle(copied large smoke) but now i want it so it will float from the walls in the room. The mod i am aiming to design is a mod that adds "ghost" effects using a single block. That block has a gui(completed) that has different selections. I would like it if that block could have particles coming from it and whizzing around the walls similar to the one in the video i posted.
-
Hi everyone I am fairly new to modding but know java pretty well. I have been practising basic skills e.g. Creating blocks, Custom Renders, Items, Gui's etc but then i came across particle fx. Ive had a scratch about the mine craft code and made some basic particles. recently i found this video of a mod and decided i wanted to do something similar to it. The video: How would i go about creating Similar like this in which the particle is "projected out" as such and follows the wall line? Thanks if anyone could help me.