Jump to content

Top Down / Third Person Shooting


WazMeister
 Share

Recommended Posts

Hi All,

 

I've been reading the forums / searching and the posts relating to this just confuse me more.  I've also played around with the FPS Script and some other third person shooting examples but it's left me more confused.

 

Can someone please help me with how (LUA) I would make my character shoot and have a projectile (3d bullet) shoot out at the direction his facing/pointing gun.  I'm just stumped and don't know where to even begin.

 

Many Thanks

 

Dream since child of making games! From Game Programming Starter Kit 3.0, Blitz Basic, Map Creation since Duke 3D, Game Maker, Blitz3D (of recent..2023) and many other engines and years..... never really sticking to it with inner struggles that I've had to fight along with pushing to learn and acheive.

40 years old.. came across Leadwerks on Steam... Learning slowly but surely and loving it!

Learn with me or just watch me fail! at my random Youtube Channel, as I stream adhoc while learning and using LeadWerks and other game creating tools.

https://www.youtube.com/@wazmeister3151/featured

Link to comment
Share on other sites

FPSGun.lua?

 

That's what I've been reading and playing with, just not getting the parts I need to take and understand as it has a lot of other code too....

Examples are great, (wish there were more downloadable templates / game sources to play with.. not much seems to be released for leadwerks to play around with). but as a newbie it can be a struggling in first place knowing what is what, what bits are needed.. eve when changing and playing with the code, it is very difficult.

Maybe a bit of insight to this script you ref and the areas of code that are key would help me on the right path....

 

Dream since child of making games! From Game Programming Starter Kit 3.0, Blitz Basic, Map Creation since Duke 3D, Game Maker, Blitz3D (of recent..2023) and many other engines and years..... never really sticking to it with inner struggles that I've had to fight along with pushing to learn and acheive.

40 years old.. came across Leadwerks on Steam... Learning slowly but surely and loving it!

Learn with me or just watch me fail! at my random Youtube Channel, as I stream adhoc while learning and using LeadWerks and other game creating tools.

https://www.youtube.com/@wazmeister3151/featured

Link to comment
Share on other sites

Okay, so if you want to build something up from scratch, you need to break it down into pieces:

  1. You click the mouse.
  2. A sphere appears (the bullet).
  3. The bullet is positioned and rotated to match the orientation of the point on the gun where the bullet exits (the muzzle)
  4. The bullet has to be updated each frame to move forward a certain amount.
  5. When the bullet hits something it disappears.
  • Like 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

56 minutes ago, Josh said:

Okay, so if you want to build something up from scratch, you need to break it down into pieces:

  1. You click the mouse.
  2. A sphere appears (the bullet).
  3. The bullet is positioned and rotated to match the orientation of the point on the gun where the bullet exits (the muzzle)
  4. The bullet has to be updated each frame to move forward a certain amount.
  5. When the bullet hits something it disappears.

Ha.. It might not be the definitive answer in LUA code but you know what... Sometimes a basic break down like this really tunes in to how I now need to look at it and should be able to achieve on my own.

 

Thanks for that, sometimes a simple process is the answer.  I have a habit of over thinking tings and making them far too complicated than what they seem!

 

Dream since child of making games! From Game Programming Starter Kit 3.0, Blitz Basic, Map Creation since Duke 3D, Game Maker, Blitz3D (of recent..2023) and many other engines and years..... never really sticking to it with inner struggles that I've had to fight along with pushing to learn and acheive.

40 years old.. came across Leadwerks on Steam... Learning slowly but surely and loving it!

Learn with me or just watch me fail! at my random Youtube Channel, as I stream adhoc while learning and using LeadWerks and other game creating tools.

https://www.youtube.com/@wazmeister3151/featured

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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

 Share

×
×
  • Create New...