Jump to content

Tron Light Trail/Wall Collision boxes


Ninjusk

Recommended Posts

Ok so as some of you may guess im a Tron Fan. Im working on a Tron Mod right now and i want to add the Light Trails that come out of the back of the Cycles and etc. at frist i tried making a trail a bunch of single panels that when spawn together look like a light trail but that ends up having hundreds of entities loaded at once which lags out the game pretty bad. so i wanted to create one that was effectively one entity that is rendered as a smooth continuous object(It would have a limited size but thats implied). The Render its self will just take a large array but how would i go about adding collision detection to a massive continuous entity. note it doest even have to cause collision, i just need to be able to detect if a entity is in the trail. is there some form of boundingbox.addChildBox or a way i can a an extra box to an entities bounding-box. Im not looking for people to giving me all the answers just maybe a new perspective on how to approach this problem.

 

In any case thank you for reading this pretty lame forum post. 

Link to comment
Share on other sites

I would suggest making a particle... It wouldn't quite be the same, but still have an ok effect. And I am guessing that if you had enough determination, then you would be able to figure out a solid line particle.

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

Link to comment
Share on other sites

I would suggest making a particle... It wouldn't quite be the same, but still have an ok effect. And I am guessing that if you had enough determination, then you would be able to figure out a solid line particle.

 

Problem is, I don't think particles have collision boxes.

 

Ninjusk:

You could try using normal blocks.  They'd be solid (and have code that detects collisions, like the cactus) but when the...creator of them dies (should be possible to detect) you trigger one of the blocks (doesn't matter which one) to set its metadata to a specific value, then on its next update, replace itself with air.

 

Then you can use that change in state to set the rest of them to do the same thing (think redstone, but without the signal decay).  I use similar code in my phase blocks mod, which is open source.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Im avoiding using blocks because my vehicles can move anywhere and are not bound to following blocks. so the only logical choice is entities. and really the render is not what im worried about its only collision detection.

Link to comment
Share on other sites

Don't all entities have an onCollide() method? Or is that just throwable entities?

 

Well that gives me an idea. Make the entity a throwable one, then make the bike (or whatever) throw it out behind it. Problem is it would look more like exhaust fumes than anything... But it has an onCollide() method.

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

Link to comment
Share on other sites

Don't all entities have an onCollide() method? Or is that just throwable entities?

 

Well that gives me an idea. Make the entity a throwable one, then make the bike (or whatever) throw it out behind it. Problem is it would look more like exhaust fumes than anything... But it has an onCollide() method.

I know that about the onCollide Method. what im trying to do is to create a entity that has a collision box that is "dynamic" or that gets added on when i add a new segment to the entity. this is nothing like i have ever seen done so theres no previous work to look at or anything.

Link to comment
Share on other sites

The onCollide method is called everytime something collides with it, correct? Then wat is the problem? That is what you wanted no? Try reading through the ORIGINAL onCollide method, it will help you alot.

 

And why not do as I suggested with the "throwable" entity?

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

Link to comment
Share on other sites

The onCollide method is called everytime something collides with it, correct? Then wat is the problem? That is what you wanted no? Try reading through the ORIGINAL onCollide method, it will help you alot.

 

And why not do as I suggested with the "throwable" entity?

 

The Collision detection is not the problem. the problem is the that i wanted to make a entity that grows and i need a way of adding Collision box so that when the end of the trail is 100 blocks away from the original part of the entity it still can have a hit box 

Link to comment
Share on other sites

He's trying to avoid creating a million entities.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

He's trying to avoid creating a million entities.

 

Yes I understand that. But aren't throwable entities alot less resource using? And you can make them die after so many ticks anyway. That way you can have them only "living" for about 5 seconds. Which I am guessing is a little bit to slow/not long enough? Because in reality they can die after however long you want. :P

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

Link to comment
Share on other sites

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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