Scripts / Helicopters and planes do fly

Author
Message
Lance
21
Years of Service
User Offline
Joined: 22nd Jul 2003
Location: Third planet from Sun
Posted: 12th Mar 2017 17:47 Edited at: 12th Mar 2017 20:20
I am having trouble with my helicopter after the last update (3.10.2017) .I am using Avram's helicopter code and library which would let it take off and fly around . All it want's to do is either slide around the ground or if it does take off it spins and does other crazy things . This code is somewhere here on the forum . This has nothing to do with the helicopter model .

I have put all the pointers to Avram's library in the GameLoopInit each time there is an update to Global in the script bank .
package.path = "scriptbank/?.lua;" --
aConfig = aConfig or { path = "Avram/" } --
require (aConfig.path .. "bootstrap")
_______________________________________________________
-- script by Avram, adapted for helicopter
-- save as helicopter.lua
-- the entity (helicopter) must be set as this: always active = on, physics = off

planes = planes or {}
SndPlaying = SndPlaying or {}
function helicopter_main(e)
planes[e] = planes[e] or {} --initialize plane data
planes[e]['speed'] = planes[e]['speed'] or 1600 + math.random(100,500) -- set plane speed (1600-2000)
planes[e]['turnspeed'] = planes[e]['turnspeed'] or 700 -- set turning speed
planes[e]['fallspeed'] = planes[e]['fallspeed'] or 1000 -- set falling speed
planes[e]['takeoffspeed'] = planes[e]['takeoffspeed'] or 700 -- set takeoff speed
local this = aEntity:new(e, "mustang") -- initialize entity obj
local state = this:attr("state") or "init" -- get current state [defaults to "init"]
local timer = aTimer:new(e) -- initialize timer
local dist = aPlayer:distance(this) -- get distance to player
this:watch_death() -- watch entity for it's death so we can respond to it
-- taking off

if state=="takeoff" and dist <= 4000 then -- GetPlayerDistance(e) >50
timer:start() -- start timer
GravityOff(e) -- turn off gravity
if timer:between(0,3) then
MoveUp(e, planes[e]['takeoffspeed'] - (planes[e]['takeoffspeed'] * 0.7) ) -- start slower (3 secs)
elseif timer:between(3,6) then
MoveUp(e, planes[e]['takeoffspeed']) -- go at takeoff speed (another 3 secs)
elseif timer:greater(6) then
if (g_Entity[e]['y'] <= g_PlayerPosY+500) then -- pull nose up and increase height (takeoff) while below player
SendMessageF("setrotationx",e,-5);
SendMessageF("setpositiony",e,g_Entity[e]['y']+5)
else -- push nose down and set state to fly when above player, also stop the timer
SendMessageF("setrotationx",e,0);
state = "fly"
timer:stop(
end

MoveForward(e, planes[e]['takeoffspeed'] + (planes[e]['takeoffspeed'] * 0.7)) -- move at increased speed while taking off
end
end
-- end -- added
-- turning
if state=="turn" then
MoveForward(e, planes[e]['turnspeed']) -- move at turning speed
timer:start() -- start timer
if timer:between(0,6) then -- rotate towards player for 6 seconds
RotateToPlayerSlowly(e, 2)
else -- after 6 seconds do this:
RotateToPlayerSlowly(e, 100) -- rotate to player
timer:stop() -- stop timer
state = "fly" -- set the plane into flying mode
end
end

-- falling down

if state=="fall" then
MoveForward(e, planes[e]['fallspeed']) -- move at falling speed
RotateX(e, 3) -- rotate a bit
RotateZ(e, 3)
RotateY(e, 3)
RotateX(e, 5) -- rotate a bit again
RotateZ(e, 5)
RotateY(e, 0)
RotateX(e, 7) -- rotate a bit again
RotateZ(e, 7)
RotateY(e, 0)
SendMessageF("setpositiony",e,g_Entity[e]['y']-1); -- move down
timer:start() -- start timer

-- 3 --
if timer:greater(6) or g_Entity[e]['y']<=650 then -- after 3 seconds of falling down or if hit the ground
state = "down" -- change state to down
timer:stop() -- stop the timer
StopParticleEmitter(e) -- stop smoke
SetEntityHealth(e, 0) -- destory (explode) the plane
end
end

-- flying straight
if state=="fly" then
MoveForward(e, planes[e]['speed']) -- move at defined speed
if (math.random(1, 10) == 2) then -- in 10% cases rotate plane a bit and change it's height
RotateX(e, math.random(-10, 10))
RotateZ(e, math.random(-10, 10))
SendMessageF("setpositiony",e,g_Entity[e]['y']+math.random(-10, 10));
end
end

-- initialization
if state=="init" -- and
-- GetPlayerDistance(e) < 1000 -- added this but didn't work
then
GravityOff(e) -- turn gravity off
state = "takeoff" -- take off
end

-- if too far from the player, set to turning state
if state=="fly" and dist > 9000 then
state = "turn"
end
if state=="fly" and dist < 9000 then
LoopSound(e, 0)
SetSoundVolume(80)
end

-- if flying and is shot to death (while keeping entity alive), set falling state and start smoke
if state=="fly" and this:is_dead(true) then
state = "fall"
StartParticleEmitter(e)
StopSound(e, 0)
end

this:attr('state', state) -- store the (modified) state
end
Lance

Joined 22nd Jul 2003

PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 12th Mar 2017 18:17
try turning physics off for the model
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Lance
21
Years of Service
User Offline
Joined: 22nd Jul 2003
Location: Third planet from Sun
Posted: 12th Mar 2017 18:59 Edited at: 12th Mar 2017 19:01
I have tried physics off , it just sits there and if you bump into it you just walk thru it . With physics on , if you bump it , it will start sliding away from you and sometimes then it will start spinning around and lift off eventually but still spinning out of control . I have also tried 'always active' and that doesn't help either . I have tried static = no and also tried yes .

Lance
Lance

Joined 22nd Jul 2003

PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 12th Mar 2017 19:07
Is the helicopter a 'character'?
Been there, done that, got all the T-Shirts!
PM
Lance
21
Years of Service
User Offline
Joined: 22nd Jul 2003
Location: Third planet from Sun
Posted: 12th Mar 2017 19:22
These are the setting that I have always used

;identity details
ischaracter = 0
hasweapon =
isobjective = 1
cantakeweapon = 0

Lance
Lance

Joined 22nd Jul 2003

PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 12th Mar 2017 19:42
I've never managed to get the 'Move' commands to work myself so don't use them but maybe Lee has somehow broken them in the latest build?

I'm surprised though that the script works very well seeing as it is using direct Euler rotations, usually that will result in very strange results (for example the entity will flip upside down when it rotates through the gimbal lock positions (90 and 270 degrees in Y). This sort of thing really needs to be done with quaternions.

Best bet is to email Lee to see if he can work out why it no longer works.

Been there, done that, got all the T-Shirts!
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 12th Mar 2017 21:28
MoveUp doesn't appear to be working, I've re-written the script so it doesn't need the oops library but my entity isn't budging.

Will play around with it a bit more, I'll let you know if I have any joy.
Been there, done that, got all the T-Shirts!
PM
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 12th Mar 2017 21:43
Need to add CollisionOff(e) in there, probably where GravityOff(e) is listed though haven't tested this is the correct place.

Cheers.
Teabone
Forum Support
18
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 12th Mar 2017 22:01 Edited at: 12th Mar 2017 22:10
If its an issue related to the FPE I've put together a list of some of the properties: http://freetoronto.org/gameguru/tutorial_fpe.html

Wondering if its related to phyweight or phyfriction perhaps? Maybe give the entity a "strength" value if your setting it as a character -- as Game Guru may be treating it as if its dead? I'd also set it to not ragdoll. If not a LUA problem.
Twitter - Teabone3 | Youtube - Teabone3 | Twitch - Teabone3 | TGC Assets - Store Link

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GT 740
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 12th Mar 2017 23:00
I'm getting there, slowly.



Just need to add a MoveForward function, but I'll need to know which way the helicopter model points when first placed down as 'forward' is a model specific property.

Also does anyone know where the amount of damage the RPG does is specified? Seems to be one-hit kill no matter how much health I give the helicopter (that's why I'm using the sniper rifle in the video).

Been there, done that, got all the T-Shirts!
PM
Lance
21
Years of Service
User Offline
Joined: 22nd Jul 2003
Location: Third planet from Sun
Posted: 13th Mar 2017 11:32
The original code worked perfectly . I usually place the copter facing away from player . It would take off straight up and then move away from player , turn around towards player ,fly over/past player turn and repeat back and forth unless shot down . It would follow (fly over) player . I am no lua coder so I used it as is and it worked pretty good for me ..

Lance
Lance

Joined 22nd Jul 2003

PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 13th Mar 2017 16:18
MoveForward(e,v)
and
MoveUp(e,v)
(up being a positive value and down being a negative)
both work fine here.
they are FPS based commands so you do get different results depending on the current frame rate but they work.
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 13th Mar 2017 19:05
No worky for me, in fact they've never worked for me so I don't use them.

When my grandson has finished playing Half Life I'll add the MoveForward function and make it FPS independent, I'll leave the rotation as is so it will work the same as the old script.
Been there, done that, got all the T-Shirts!
PM
Lance
21
Years of Service
User Offline
Joined: 22nd Jul 2003
Location: Third planet from Sun
Posted: 13th Mar 2017 19:23
I would really appreciate it if you could fix it for me (and others) ..

Lance
Lance

Joined 22nd Jul 2003

PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 13th Mar 2017 20:48 Edited at: 13th Mar 2017 21:39
Give this a try and let me know how it compares to the original, I don't have a helicopter to try it with!

(make sure to keep a copy of the old one)
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
Lance
21
Years of Service
User Offline
Joined: 22nd Jul 2003
Location: Third planet from Sun
Posted: 14th Mar 2017 15:07 Edited at: 14th Mar 2017 15:09
AmenMoses:

You repaired my helo's , they are flying again .
I tried it with 1 first then 2 helicopters and the takeoff was staggered (by my position ? = good) and flew around without hitting each other and they both would follow the player around (fly over) . I haven't tried to shoot them down yet ...
Mission successful
Thanks !

Strength 250 : This is what I gave them for the test . Strength of 25 will cause them to take off, smoke and then crash .
Isimobile Yes
Physics No
Explode Yes

The model I used was from Gtox (purchased) .
I have an Apache model (don't know who made the model) that I also purchased . It was purchased from the 'The Game Creators' FPSC a long time ago ..
Lance

Joined 22nd Jul 2003

PM
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 14th Mar 2017 15:39
Ok, this one seems down to scripting.

Moving this thread to scripts.

Thanks.
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit, Screen resolution 1680 x 1050.

AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 14th Mar 2017 19:33
Yep, I tried to make it so a single RPG shot would bring it down rather than just destroy it in mid air by checking for health below 100 so the helicopter needs to be more that 100 at the start, unfortunately it didn't work as RPGs seem to just wipe out all the health in one go (in fact the value goes to some stupidly large negative vale!), I'll have to figure out a better way of doing it.

The movement is still rather jerky and not really very natural, I have plans to fix this and also add object avoidance (well terrain and other objects with the same script avoidance at least).

I'll post a new version here when I'm done.
Been there, done that, got all the T-Shirts!
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 18th Mar 2017 13:16 Edited at: 30th Mar 2017 20:44
New version:

Helicopters will now bank and pitch down like real ones, lots of randomness added so they will behave slightly differently from each other (converted script to use quaternions for better control), altered 'death-fall' to be more realistic.

Still need to add collision detection code and terrain following.

This script should also work with any other flying objects. (just tweak the various pitch/bank and speed setting statements until they look right).

btw, avoid setting Y angle to 90 or 270 when first placing the helo's, just turn it slightly away from those angles for smoother take off (those are the 'gimbal lock' positions for GG so some weird things happen until the quaternion code takes over control of the entities).

Edited to add quatlib.lua.
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 18th Mar 2017 13:37
Thank you.
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit, Screen resolution 1680 x 1050.

Lance
21
Years of Service
User Offline
Joined: 22nd Jul 2003
Location: Third planet from Sun
Posted: 18th Mar 2017 19:35
The new code makes the helo look more realistic taking off and turning , but on my machine the frames per second drops from 55 to 19 .

I like the new code ....


i5 Intel
4 gig ram
NVIDIA GeForce GTX 660
Lance

Joined 22nd Jul 2003

PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 18th Mar 2017 19:43
How many helicopters?

I have about ten spaceships flying around without any FPS drop but there is nothing else on the map. As I said I haven't got the helicopter model to try it with, is it a high poly count? You could try commenting out the lines that turn collisions on and off to see if that improves things,
Been there, done that, got all the T-Shirts!
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 18th Mar 2017 20:30
I don't think it's the script that's the problem.



Been there, done that, got all the T-Shirts!
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 18th Mar 2017 23:23
very nice, the falling rotation looks good
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Lance
21
Years of Service
User Offline
Joined: 22nd Jul 2003
Location: Third planet from Sun
Posted: 19th Mar 2017 13:33
Well before I go to work this morning I tried the new script again with the drop ship and it ran at 60fps. . So I tried the military copter and the drop ship together and the frame rate ran at 58-59fps . I then added another copter , 2 warehouse buildings and tried it again and the fps did not drop .
My initial test yesterday only had 1 helo and the start marker .

So , the new script is fine . I think my memory (the one in the PC ) must not have cleared or something like that on other GG stuff I was working on .

Lance
Lance

Joined 22nd Jul 2003

PM
Johno 15
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 25th Aug 2014
Location: Cork, Ireland
Posted: 19th Mar 2017 16:13
@AmenMoses do you need your Quaternion library script for this? I would assume so
'Judge a man not by his answers. But by his questions.'
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 19th Mar 2017 16:19
Last version, I hope , terrain following code added, basic collision avoidance added. It's not perfect but somehow mesmerising to watch, they almost dance with each other.

These new feature only come into effect once the helicopter has fully taken off so you need to give each one a clear take off run, once in 'fly' mode or when turning they should avoid each other (sometimes ) and the terrain.

Are the helicopters animated? If so if you let me know the animation frames I could add them to the script as well.

Other changes I've made are to add randomseed call, tweak the Y angle if exactly 90 or 270 and set the health to 250 if it starts less than 100.
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
Lance
21
Years of Service
User Offline
Joined: 22nd Jul 2003
Location: Third planet from Sun
Posted: 19th Mar 2017 20:52
military helicopter

I wish I could post the model but I purchased it from Gtox unless I added it into the folder where I purchased some things from him?
;anim
animmax = 2
anim0 = 1,15
anim1 = 16,19 (doesn't do much of anything but I left it in there )
playanimineditor = 1
Lance

Joined 22nd Jul 2003

PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 19th Mar 2017 21:24
So 16 frames for the blades? So loop animation from start of take-off should do it, no point spinning the blades up slowly with only 16 frames, should be easy enough to add.

Try this, you might need to play around with the animation speed.
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 19th Mar 2017 21:27
Yes, it uses the quaternion library, attached it to this post. Just put it in the scriptbank directoty.
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
Lance
21
Years of Service
User Offline
Joined: 22nd Jul 2003
Location: Third planet from Sun
Posted: 20th Mar 2017 18:26
The last script with the animation call in there works great , nice and smooth ..

Lance
Lance

Joined 22nd Jul 2003

PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 20th Mar 2017 19:11
Thought I'd finished with this but my brain wouldn't let me sleep last night until it had finished thinking up a much better collision mechanism so as soon as my grandson finishes playing his zombie game I'll dive back into the code again.
Been there, done that, got all the T-Shirts!
PM
Pink Panther
14
Years of Service
User Offline
Joined: 1st Feb 2010
Location:
Posted: 20th Mar 2017 20:07
That is really cool! Thanks
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 21st Mar 2017 22:56
Question; If someone is kind enough to give away a helicopter model (Bod) but it isn't animated, is it acceptable to do this with it?



You've probably guessed, quaternions!

(just in case it's not obvious, I chopped off the blades to be a separate entity, that's about the limit of my modelling ability!)
Been there, done that, got all the T-Shirts!
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 22nd Mar 2017 20:47 Edited at: 22nd Mar 2017 21:49
Take off



Death throws




Now for some working rockets and machine guns. Which might take a while.
Been there, done that, got all the T-Shirts!
PM
gd
8
Years of Service
User Offline
Joined: 21st Jul 2016
Location: Small Darkroom with no red light
Posted: 22nd Mar 2017 23:22
Hi AmenMoses, looking great as always.
Dark Base 900 Pro OJ: Rampage V Ed.10, i7 6950x non-OC, DDR4-3333 64 GB RAM, Win 10/64, Asus Strix GeForce 1080 x 2 SLI mode, Water cooled with an old Victorian cast iron radiator and a industrial leather belt driven fan - That's what you call Steampunked.

Laptop - M17xR3


A new competition running for GG
PM
Lance
21
Years of Service
User Offline
Joined: 22nd Jul 2003
Location: Third planet from Sun
Posted: 22nd Mar 2017 23:53
Nice . Fun isn't it ..

Lance
Lance

Joined 22nd Jul 2003

PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 23rd Mar 2017 22:21


Stage one, muzzle flash. Stage two will be impacts on ground, like always I'm cheating, no real bullets just the impression that there are bullets. Hollywood style in other words.

Rockets will be real though!
Been there, done that, got all the T-Shirts!
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 24th Mar 2017 21:11


Stage two.
Been there, done that, got all the T-Shirts!
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 24th Mar 2017 21:35
now that is cool, need some machine gun sounds though
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 24th Mar 2017 22:35
Fantastic. I am changing my vote for particle systems so you have more to play with.

Great Job as always.
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit, Screen resolution 1680 x 1050.

AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 24th Mar 2017 23:14
The attached image shows what the editor screen looks like (starting on the rockets now), then it looks like this in test:



I've also added player damage from the guns now.

If anyone has any suitable sound effects they can post up here I'll add sound as well.

@Bod, I didn't see the animated version.
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 24th Mar 2017 23:35
Attached the scripts, they are getting a bit messy now, I really need to refactor some of the generic code out into libraries at some point.

What would be really cool would be to have the generic functions moved into C++ and have the ability in the editor to attach parts to models that can then be animated by a simple Lua call, most of the code is related to working out the position of one entity relative to another when they are also being rotated in all three axis, for best performance this part should be probably be done by the engine.

Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 25th Mar 2017 09:29
To answer my question from an earlier post re acceptability of splitting the blades from the helicopter; No, it is generally not acceptable to alter models that you didn't create unless the author has specifically granted permission. In this case the model creator has given their blessing for the purposes of this technical demonstration. Once the rocket scripts are completed I will publish a script set on here which works with the animated version of the helicopter (hopefully also with sound effects if I can source some decent royalty free ones).




Been there, done that, got all the T-Shirts!
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 25th Mar 2017 12:32
i normally use this site for sounds
for the gun you can always use the stock GG sounds though
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 25th Mar 2017 15:32
Rockets! (or rather anti-tank missiles being used as rockets )



Been there, done that, got all the T-Shirts!
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 25th Mar 2017 15:42
did you manage to get the exploded objects reusable or are you just giving the helicopter multiple rockets in the editor (more than 2) ?
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 25th Mar 2017 15:56
Each heli has 4 to start with (so 12 placed in editor, see image I posted earlier) and they are fired randomly, once all 4 are fired they are gone (I made them explodable, I think there is no way back from that) just like real life.

The bullets are all imaginary otoh, the helis never run out.

The same mechanism could be used to add weapons to any vehicle.

I ended up with more scripts than I intended, mainly because the bullet hits are done with 3 separate decals + particle effect.

Next I plan to create a 'safe-zone' entity which can be used to stop the bullet hits and rockets from killing you when indoors as that can really spoil your day.
Been there, done that, got all the T-Shirts!
PM
Lance
21
Years of Service
User Offline
Joined: 22nd Jul 2003
Location: Third planet from Sun
Posted: 25th Mar 2017 17:55

Did you mod the helicopter to accept the gun and rockets ? Where did you add all the scripts ( invisible objects ) ?

Your whole script project has come a long way .

Lance
Lance

Joined 22nd Jul 2003

PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 25th Mar 2017 19:59
No modding of the helicopter was needed, the rockets are standalone models with their own script, two decals are used for the muzzle flash, three for each bullet 'hit'.

Been there, done that, got all the T-Shirts!
PM

Login to post a reply

Server time is: 2024-12-23 05:36:47
Your offset time is: 2024-12-23 05:36:47