Scripts / Amenmoses 2 question's

Author
Message
Blacknyt46
8
Years of Service
User Offline
Joined: 29th Feb 2016
Location:
Posted: 22nd Nov 2019 06:02
Amenmoses, I love your "moonlander thingy" script soo much. That I wanted to know, if it's possible to shoot weapons from the moonlander? I tried messing around with your spitfire script. I just for the love of God,cannot figure out what parts of the script to use. And also,I like the way you can make the spitfire switch from 1st person to cockpit view. I would love to incorporate the two. I been working in blender a lot (trying hard)making my own models for my game. And I understand that I would have to make a cockpit etc? I don't need any movable gauges or anything to elaborate. I just want to be able to fire weapons and switch cockpit view. Thanks
Jim C
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 22nd Nov 2019 09:06
Referring to the latest spitfire script:
line 412
local function ShootWeapon( wTyp, h, toeIn, barrelPos, velocity, numExtraShots, xA, yA, zA )

Basically just uses a particle emitter to generate the 'shot', then uses a raycast to detect if anything is in the firing line and if it is calls the AddTarget function.

line 379
local function AddTarget( h, x, y, z, dist, vel, obj )

Adds the targets to the target list

line 394
local function ProcessTargets( h )

This function is called every frame and generates the particle effect of the bullet hit and if the target is an entity sets the health of the target to 0.

In/Out of cab is simply a different camera position, variables playerPos1 and playerPos2, pressing R key Iline 693) switches between the two positions. The AttachPlayer function (line 239) handles the setting of the camera angle relative to the plane.


Been there, done that, got all the T-Shirts!
PM
Blacknyt46
8
Years of Service
User Offline
Joined: 29th Feb 2016
Location:
Posted: 22nd Nov 2019 23:18
Ok I'll give it ago. And thanks for putting that up there. This will be interesting I'm really going to try to make sense of it. I'll let you know how I did. And Thanks again,your one of the Masters.
Jim C

Login to post a reply

Server time is: 2024-12-22 09:07:58
Your offset time is: 2024-12-22 09:07:58