ID:265534
 
Alright, after some harsh, but much needed critism from Lummox, I've decided I need to rework the beam demo I made so so long ago. Now, before I go about doing this, I'd like to know how this should be handled as the way I did it was apparently very wrong.

Thanks for anything you can contribute.
Make a beam "head"

every turf the beam exits, create a beam tail on that turf.
In response to Jermman
See, you're not helpful. Believe it or not, I am pretty serious about doing this, as I hate having a bad reputation because of a demo I put out awhile ago.
In response to SSJ Radditz
How wasn't that helpful? That's exactly how I'd do it, unless I was actually trying to do pixel-perfect line drawing. =)
In response to Jtgibson
How wasn't that helpful? Listen, though my key may suggest it, I'm really not that idiotic. I'm more or less interested in the proper way to handle how the beam interacts with atoms, as Lummox shot my way down.
In response to SSJ Radditz
:-\ The proper way would be to create a head, and then the head spawn a tail after it moves, but using a time frame so it looks real and not crappy, and then having the tail added to a list in the head, and when the head is deleted, the tail it deleted. Wala, works.
In response to Sniper Joe
Did you have problems reading my comment to the last comment that was made along those lines? I know that much Joe, I'm more interested in knowing how to properly make the beam interact with atoms.
In response to SSJ Radditz
No, the question is, can you?
In response to Sniper Joe
Thanks, you answered my question.
In response to SSJ Radditz
SSJ Radditz wrote:
How wasn't that helpful? Listen, though my key may suggest it, I'm really not that idiotic. I'm more or less interested in the proper way to handle how the beam interacts with atoms, as Lummox shot my way down.

See, this is information you didn't give in your post. "How to properly program a beam" is exactly what we were operating on. We had no idea what Lummox JR shot down, because some of us work full time hours and don't read every single post on these boards any more.

Details, man, details. =P
In response to Jtgibson
Well then, you've got some details now. So why not help me with that I asked. =)
In response to SSJ Radditz
What do you mean by (roughly) "how the beam interacts with atoms?" Do you mean what the beam does to the stuff it hits? Because if it's just deleteing itself after it passes it shouldn't harm anything. Or do you mean what procs should it (the beam) use when coming into contact with an atom? Like if you should use Enter or Bump?

If you could control the double buffering in byond...you could just turn that off and it would create a beam. Hehe. Though the results would be less than pretty trying to remove it would be my guess.
In response to Rockinawsome
...Yes, I suppose what procs would be needed? Should I use built-in procs, or create my own or?
In response to SSJ Radditz
Well...In the game I'm developing at the moment, I'm creating projectiles (arrows or bullets) that pass "through" an object depending on their 'cover rating'. To do this easily I chose to use:
turf/Entered(obj/ammo/O)
if(isturf(src)&&istype(O,/obj/ammo))
switch(coverrating)
if(1)
if(prob(20))
del O
if(2)
if(prob(40))
del O
//etc.

I don't have the exact code with me because that comp is getting a video card installed and it's having problems. However, that's a guestimate of how I did it. Now, when I wanted the projectile to interact with a mob, I used obj/ammo/Bump(mob/M). For your Beam, I would guess that if you break Bump up with Entered or Enter, it might be easier for you to diferentiate with how the beam should interact based on the very different procs.

What would be very interesting, considering beams are ussually used for DBZ (at least in BYOND), would be that if one warrior fired a beam at another warrior, and that warrior fired his own in return; when the two beams met in the middle - the beam with the greater power forces the other beam to shrink in size until it reaches its originator, at which point the originator squeals like a little girl and blows up into a million pieces...or something less dramatic.

Even more impressive, and even harder to program, would be a beam that met another beam at an angle,

O
|
|
<-- X---O

and as you can see (CLEARLY) with this diagram, causes the beam to change direction and move in the stronger beam's path.
In response to Rockinawsome
Hmmm. I see. Thanks for such a good response for once, after afew days of nothing. =p

Now, I know the basics for moving the beam and what not, but what about it hitting the edge of the map? How should I handle that? In my current demo, I did it, but I just want to know another's opinion.

*EDIT*

Also, have you any suggestions on how I should do this "beam battle"?
In response to SSJ Radditz
SSJ Radditz wrote:
See, you're not helpful. Believe it or not, I am pretty serious about doing this, as I hate having a bad reputation because of a demo I put out awhile ago.

People are just trying to help you. In my opinion, both people have given a pretty good description of how to program a "beam." It sounds like what you are asking for is less specific, judging from your other posts in this thread. You want to know how to program a projectile that will interact with another atom it sounds like. Since you specified beam though, people are explaining to you how make a beam.

People are going to be less inclined to help you with that attitude though.
Alright, I began working on this not too long ago. I now have the basic creation and movement down. But I'd like to have someone look over it, just to make sure everything is alright with the code. Would anyone be willing to?
http://developer.byond.com/hub/Kunark/ Real-TimeTile-BasedLineEffects

I have no idea what exactly you mean by "beam", but might this help?
In response to Kunark
A big beam of energy, like...
Think of it like...shooting a watergun, but the blast is straight, made of energy, and deadly.
In response to Kunark
Kunark wrote:
http://developer.byond.com/hub/Kunark/ Real-TimeTile-BasedLineEffects

I have no idea what exactly you mean by "beam", but might this help?

That's the problem; neither has he. Now if done properly, a beam should be instantaneous. However if there was some reason to make the beam head travel as slowly as a projectile, that would change the approach.

Lummox JR
Page: 1 2