Remember me
You are here: HomeForumCyberix3D ForumGeneral Discussion
Welcome, Guest
Username: Password: Remember me

TOPIC: Shooting a bullet from the 'enemy' instance

Shooting a bullet from the 'enemy' instance 8 years 3 months ago #619

  • Ganderoleg
  • Ganderoleg's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 115
  • Thank you received: 12
What I wanted to do is this:

1. Enemy instance should shoot a bullet at the player at a specific time-interval.
2. Bullet should go through other enemy instances to avoid friendly-fire.
3. Bullet should not go through static level/room geometry.

What I managed to do is this:

www.gamemaker3d.com/player?pid=051530017239
Shooting a bullet is done with a Right Mouse Button.

The system is that I have a fake camera and a fake bullet with collisions underneath the 'real' room and a 'real' bullet :blink: The 'real' bullet has no collision and it's just following the fake bullet under the room.

This is actually not an extremely bad solution for my project since the enemy instance is a 'wizard' and 'bullets' can fly around until they hit the player :lol:

However it would be great to have a not-so-difficult-and-strange solution and I do have a problem with bullet not being rotated towards the player in a moment of shooting if player is moving around.

If anyone can think of a better system or can at least have an idea on how to proparly rotate the bullet before the shooting that would be very helpful and very appreciated :)
Last Edit: 8 years 3 months ago by Ganderoleg.
The administrator has disabled public write access.

Shooting a bullet from the 'enemy' instance 8 years 3 months ago #620

  • cyberix3d
  • cyberix3d's Avatar
  • OFFLINE
  • Administrator
  • Posts: 703
  • Thank you received: 697
This is a nice workaround, but we want to add a new feature to make it simpler.
We want to add a Ghost Object feature. The Ghost Object will act like a normal object, with collision detection, but could go through walls.
That way you can "stick" the bullet to the Ghost Object until it hits some objects you choose.
We will let you know when the "Ghost Object" is ready.
Regards,
Cyberix3D team
Last Edit: 8 years 3 months ago by cyberix3d.
The administrator has disabled public write access.
The following user(s) said Thank You: Ganderoleg

Shooting a bullet from the 'enemy' instance 8 years 3 months ago #622

  • Ganderoleg
  • Ganderoleg's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 115
  • Thank you received: 12
That's exactly what I had in mind :)

'Bullet' object just needs to go from specified position towards the player until it hits it or until the bullet-time runs out (to avoid further collision-checking with other geometry).
The administrator has disabled public write access.

Shooting a bullet from the 'enemy' instance 8 years 3 months ago #630

  • Ganderoleg
  • Ganderoleg's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 115
  • Thank you received: 12
...I finalized a simplest way for enemy-bullet-firing with available editor features and my available code-abilities :lol:

www.gamemaker3d.com/player?pid=051530017394

It's extremely simple: Bullet X and Bullet Y are being incremented with -/+ variable (bulletspeed) depending on where the Camera is. Once the bullet is in +/- 5 radius from the Camera the hit-sound is being played.

It's functioning o.k. in this example and when the variable (bulletspeed) is higher (about 8/10) it looks like a real bullet fire :)
The administrator has disabled public write access.
Time to create page: 0.078 seconds