Help Ranged Interaction in Rm2k3? I need your help! (Read 543 times)

  • Oy yeah baby!
  • PipPipPipPip
  • Group: Premium Member
  • Joined: Jul 11, 2004
  • Posts: 543
So in two of my projects I need the ability for an object referenced by x & y coordinates to be able to cause a "collision" with another object. Now I am able to get the mechanics working perfectly, where the object comes to hero and then is flung outward, now my question though is how can i get this object to interact with other objects when flung foward?

Let me put this simpler. I have a bullet with X Var stored in 00-, and Y in 00-. Now when the 00-,&00- coords line up with the x&y coords of an enemy I have a generalized action like: Flash, Switch: Erase enemy on... etc. But what ends up happening is that the enemy dies as soon as the map loads or the bullet just goes straight through him. What am I doing wrong?

I'm sorry if im not explaining this well, so here is some pics to help you understand what im saying


This Tracks the enemy and the bullet (bullet labeled fire) I also have another event tracking the hero not pictured here.


This references the bullet and calls it to the hero location before projecting it foward.


This is the actual enemy script, set to run as a parralel process.

Does anyone see a mistake I dont? Am I doing something wrong?
$280 USD Donated GamingW

F*CKING Awsome Games that I support!



  • Avatar of Mineyl
  • Stand back, dragon! Do not touch her!
  • Group: Member
  • Joined: Sep 24, 2008
  • Posts: 80
If they're dying as soon as the map loads, it's probably because this process is activated while all of those variables are still set to 0, meaning that they're all equal, meaning that they die instantaneously.  To fix it, you need to have that first box of code you pasted run BEFORE that final one that is on a parallel process.
Last Edit: October 17, 2009, 07:31:45 am by Mineyl
  • Oy yeah baby!
  • PipPipPipPip
  • Group: Premium Member
  • Joined: Jul 11, 2004
  • Posts: 543
ok that fixed him just dissapearing, but now the bullet just passes directly through the enemy, doing nothing.
$280 USD Donated GamingW

F*CKING Awsome Games that I support!



  • Avatar of Killer Wolf
  • "When you're bound by your own convictions, a discipline can be your addiction."
  • PipPipPipPipPip
  • Group: Premium Member
  • Joined: May 30, 2006
  • Posts: 644
I think Mineyl nailed it. In a system like that, you always need to declare your variables before you reference them. I usually put the tracker for the player's projectile at the top of the collision detection event and let the enemy variables update via a parallel process.

The problem of the bullet going through the enemy without triggering the collision is a little different. I've noticed every now and then that a moving enemy and a moving projectile can seem to pass through each other. I threw in a couple events to let me track the variables in real time and I found out the problem. Depending on the movement speeds involved, the enemy can be moving from one coordinate to another during the overlap. Also, depending on the number of actions within the event, as well as any delays you include (wait 0.0, etc), the sprite's position might differ from its last tracked variable position giving the appearance that the bullet is passing through without triggering a collision

There is probably a more technical way to fix it, but I just messed around with my projectile speed some until I found a rate that seemed to eliminate the problem.

Last Edit: October 17, 2009, 08:38:23 am by Killer Wolf
Vagrancy - Be careful who you wake up in a twenty four hour parking lot.

His name was Not Johnny -  A young man becomes a sort of superhero after a crippling injury. He
  • Oy yeah baby!
  • PipPipPipPip
  • Group: Premium Member
  • Joined: Jul 11, 2004
  • Posts: 543
The enemy in question is stationary. And even after twiddling with the animation speeds its still just passing straight through. Does anyone know the "more technical" way of fixing this?
$280 USD Donated GamingW

F*CKING Awsome Games that I support!



  • Avatar of Killer Wolf
  • "When you're bound by your own convictions, a discipline can be your addiction."
  • PipPipPipPipPip
  • Group: Premium Member
  • Joined: May 30, 2006
  • Posts: 644
Have you tried it without setting the projectile to slip through/phasing? This could be your problem right here. Just set it to "over hero" and see if that helps.
Vagrancy - Be careful who you wake up in a twenty four hour parking lot.

His name was Not Johnny -  A young man becomes a sort of superhero after a crippling injury. He
  • Oy yeah baby!
  • PipPipPipPip
  • Group: Premium Member
  • Joined: Jul 11, 2004
  • Posts: 543
Unfortunatly this still does not solve my problem. Im seriously pulling out chunks of hair over this.
$280 USD Donated GamingW

F*CKING Awsome Games that I support!



  • Avatar of Killer Wolf
  • "When you're bound by your own convictions, a discipline can be your addiction."
  • PipPipPipPipPip
  • Group: Premium Member
  • Joined: May 30, 2006
  • Posts: 644
Did you try assigning the variables for the projectile at the top of the collision detection event? Since I'm half asleep and on pain killers right now, so I'm probably missing a really obvious fix, so here are some shots of my events from a working abs shooter. It looks to me like we're doing pretty much the exact same set of operations, but for some reason you're not getting the same results.

Excuse all the extra trash in my 'code'





Vagrancy - Be careful who you wake up in a twenty four hour parking lot.

His name was Not Johnny -  A young man becomes a sort of superhero after a crippling injury. He
  • Oy yeah baby!
  • PipPipPipPip
  • Group: Premium Member
  • Joined: Jul 11, 2004
  • Posts: 543
success! It would seem that simply putting a .5 second wait WITHOUT defining a coord for the bullet before ANY process  begins, made it work. Thanks for all your help KillerWolf!
$280 USD Donated GamingW

F*CKING Awsome Games that I support!