Scripts / Airplane script

Author
Message
Avram
GameGuru TGC Backer
17
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Serbia
Posted: 25th Dec 2014 14:05
Here's a script that can control a plane or similar flying object. It can take off, fly over the player and fall down when shot.



More work needed so it can shoot/drop bombs at the player, and rotation sequence can be improved, but I think it's fine.

The script requires my OOP LUA framework which you can find here: https://bitbucket.org/Avram/fpsc-r-toolkit



smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 25th Dec 2014 16:07
very nice

could maybe make the death sequence a little more dramatic, maybe more loss of control?

good to see you back, have a good xmas

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Avram
GameGuru TGC Backer
17
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Serbia
Posted: 25th Dec 2014 16:31
Merry Xmas to you too and to all other forum members who are celebrating.

At first I had a flat level with only one hill (where the player is located) and the script was checking plane height so when you shot it it would graciously fall all the way down to the ground level (height of 600) rotating slowly around all three axes, and then explode. However with a level like this, the plane falls through the hills (remember, physics are off) so I set it to explode after like 3 seconds from being shot, and that's why you can't see it rotating while falling. But the code is there, anyone can adjust it to suit their needs. I will continue improving it in future.

Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 26th Dec 2014 10:03 Edited at: 26th Dec 2014 10:04
Merry Xmas Avram

I've try this script (downloaded "OOP LUA framework for FPSC:R" and put the "Avram" folder in the fpscr "scriptbank", also your final script at the bottom of global.lua)

but still not working for me and I have no clue where I am wrong

Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea

"The best forum, game software, operating system or web platform, it's that software which can give you most of the options and speed, not just amazing graphics."
Avram
GameGuru TGC Backer
17
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Serbia
Posted: 26th Dec 2014 11:27 Edited at: 26th Dec 2014 11:31
Do you get any error message or it simply won't fly? If you don't get any error message then you've installed the OOP framework successfully.



The plane must be set as this: always active = on, physics = off, script = plane.lua ... and it should work. Make sure the player is above the plane on your level start as the takeoff sequence moves plane upwards only while it is below player (+500 units). You may want to set the plane to be explodable for the destruction effect.

Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 26th Dec 2014 11:36 Edited at: 26th Dec 2014 11:41
I got one error at line 17 then at line 95 - "is_dead" something must be nill.....



Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea

"The best forum, game software, operating system or web platform, it's that software which can give you most of the options and speed, not just amazing graphics."
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 26th Dec 2014 11:46
And here is the error of line 95

Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea

"The best forum, game software, operating system or web platform, it's that software which can give you most of the options and speed, not just amazing graphics."

Attachments

Login to view attachments
Avram
GameGuru TGC Backer
17
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Serbia
Posted: 26th Dec 2014 12:28
Whoops! It uses a new function to monitor death of the entity (so it can react when entity is "killed") and I forgot to push the changes to the git. You'll have to re-download my OOP LUA framework, actually you just need to download latest scriptbank\Avram\lib\aEntity.lua (click on "RAW" then choose File / Save As... and save over existing file).

Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 26th Dec 2014 13:05
YES it's work now !
Full thanks Avram !




Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea

"The best forum, game software, operating system or web platform, it's that software which can give you most of the options and speed, not just amazing graphics."
Avram
GameGuru TGC Backer
17
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Serbia
Posted: 26th Dec 2014 13:35
It's nice, though they should fall down when shot (you can still destroy them by inflicting additional damage after they start to fall down). What is their strength? The plane in my video had a strength of 500 (if I remember correctly)

Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 26th Dec 2014 13:43 Edited at: 26th Dec 2014 14:02
Well I forgot to set more strong on it

btw: where to set more damage effect, in the plane.lua script ?

Now I'll try to find how I can animate the helicopter screw ...

Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea

"The best forum, game software, operating system or web platform, it's that software which can give you most of the options and speed, not just amazing graphics."
Avram
GameGuru TGC Backer
17
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Serbia
Posted: 26th Dec 2014 14:03 Edited at: 26th Dec 2014 21:14
The helicopters would use another script (vertical takeoff, leaning a bit forward while flying, flying slower than plane, etc...). I didn't bother with my choppers because I don't have any animated ones, but I guess I could make such script. Will try on non-animated helicopter I have in my entities.



edit: Just set strength to 200 or more. The thing is watch_death() method doubles the entity health (so if you set it to 200 it will change it to 400). Then is_dead(true) method checks if entity health is less or equal to original health (200) and starts falling down and smoking effect. After 3 seconds of falling down it will set entity health to 0 (explode). If is_dead() is called without parameter it will instantly kill the entity (set it's health to 0; todo: hide entity)



So if you set it's strength to 200 you will need to inflict 200 damage to make it fall down and additional 200 to explode it in air (before 3 seconds expire, after which it will explode anyway), but if you set it's damage to e.g. 25 it will have health of 50 which you can take all from couple of uzi shots - that's the most probable reason they are not falling down - you take all their health (even doubled) with couple of direct hits. The solution is to increase the health. This can be implemented in another way, e.g. start falling down when 90% of original health was taken, but it still won't work for small healths.



The way watch_death() works now is great to make script react when you kill existing characters, without messing too much with their script, all you need to do is add this at the start of their main function:





smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 26th Dec 2014 20:59
interesting way to work around the current limit on scripts

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Avram
GameGuru TGC Backer
17
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Serbia
Posted: 26th Dec 2014 21:18
Yeah, thanks. I needed an easy way to give points to player when he kills an enemy. Hopefully you don't use entity health for some other parts of the script, as the fact it is doubling it may affect the rest of the script if that is the case.

Jerry Tremble
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 5th Nov 2012
Location: Sonoran Desert
Posted: 28th Dec 2014 14:26
This is awesome, Avram, thanks!

MAME Cab PC: i7 4770@3.4Ghz (passmark 9945), 12GB RAM, Win 8.1/64, GeForce GTX645 (passmark 1898); Shiny new laptop: i7 4800MQ@2.7Ghz (passmark 8586), 16GB RAM, Win 8.1/64, GeForce GTX870M (passmark 3598); Old laptop: i5@2.3Ghz, 8GB RAM, Win 7/64, Intel 3000 graphics
PM
Avram
GameGuru TGC Backer
17
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Serbia
Posted: 31st Dec 2014 13:18
dimoxinil
18
Years of Service
User Offline
Joined: 20th Mar 2006
Location:
Posted: 5th Jan 2015 13:31
A great script, Thank you for your contribution Avram.
Tingalls
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 5th Nov 2013
Location: Great Northwest, USA
Posted: 8th Jan 2015 02:53 Edited at: 8th Jan 2015 02:54
The Script works great!!! BUT!! all my planes go backwards - 180 out

How do I get them orientated the right way. It does it on all my flying things

Maybe I missed "Model Orientation 101"

Experiencing a cool Game --> Tingalls



Win 7 Home Premium, 64bit(srvPack 1),AMD FX 4100 Quad-core 3.8Ghz @ 8Gb Ram - NVIDIA GeForce GTX 750 Ti @ 2GB Ram
Tingalls
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 5th Nov 2013
Location: Great Northwest, USA
Posted: 8th Jan 2015 02:54
Happy New Year to all - BTW

Experiencing a cool Game --> Tingalls



Win 7 Home Premium, 64bit(srvPack 1),AMD FX 4100 Quad-core 3.8Ghz @ 8Gb Ram - NVIDIA GeForce GTX 750 Ti @ 2GB Ram
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 8th Jan 2015 07:44 Edited at: 8th Jan 2015 08:13
@Tingalls, use "fixnewy=180" in the fpe file to rotate your entity

See here the EXAMPLE:




Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea

"The best forum, game software, operating system or web platform, it's that software which can give you most of the options and speed, not just amazing graphics."
Tingalls
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 5th Nov 2013
Location: Great Northwest, USA
Posted: 8th Jan 2015 10:06
@Old Larry - Thank you ---> That will help me going in the right direction....

Experiencing a cool Game --> Tingalls



Win 7 Home Premium, 64bit(srvPack 1),AMD FX 4100 Quad-core 3.8Ghz @ 8Gb Ram - NVIDIA GeForce GT
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 28th Jan 2015 16:23 Edited at: 28th Jan 2015 16:59
Avram, Your plane.lua script refuse to work in this v 1009 FPSCR

A lot of scripts working fine in the v1085, but no more in the v1009





Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea

"The best forum, game software, operating system or web platform, it's that software which can give you most of the options and speed, not just amazing graphics."
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 28th Jan 2015 18:45
Working Avram's script plane.lua !!!
Was my fault because I've forgot to clear the "dbo" and "bin" files. So sorry...

Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea

"The best forum, game software, operating system or web platform, it's that software which can give you most of the options and speed, not just amazing graphics."
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 28th Jan 2015 20:25 Edited at: 29th Jan 2015 11:01
If you have one Helicopter, then change in the Avram's plane.lua script just few settings (see the picture).

Script "helicopter.lua" here (you can increase some numbers in "rotate", and add the sound with Volume level).

The script was upgraded now:



And one small video here:





Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea

"The best forum, game software, operating system or web platform, it's that software which can give you most of the options and speed, not just amazing graphics."

Attachments

Login to view attachments
DennisW
15
Years of Service
User Offline
Joined: 15th Jun 2008
Location: Ohio
Posted: 29th Jan 2015 02:40
@ Old Larry

I like the work you have been doing with the Helicopter. How did you get the main rotor to turn? I have been working on one that I made the rotor a separate entity from the body of the Helicopter. Then tried to do a animation in Milk Shape.
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 29th Jan 2015 07:57 Edited at: 29th Jan 2015 07:58
The helicopter it's from @ E30Legend

Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea

"The best forum, game software, operating system or web platform, it's that software which can give you most of the options and speed, not just amazing graphics."
DennisW
15
Years of Service
User Offline
Joined: 15th Jun 2008
Location: Ohio
Posted: 13th Feb 2015 17:54
plane.lua not working after last upgrade. Any one else having this problem?

Ham and Eggs Breakfast

The Chicken was involved the Pig was Committed

AGK Community Tester
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 16th Feb 2015 08:34 Edited at: 16th Feb 2015 08:36
DennisW wrote: "plane.lua not working after last upgrade. Any one else having this problem?
"

Do you put in the bottom of the global.lua the Avtam's script ?
Also you must have in the "scriptbank" the Avram's folder.

Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea/

"The best forum, game software, operating system or web platform, it's that software which can give you most of the features and speed, not just amazing graphics."
DennisW
15
Years of Service
User Offline
Joined: 15th Jun 2008
Location: Ohio
Posted: 16th Feb 2015 16:00
Ok I did have it in there have to check if the upgrade took it out thanks.
Ham and Eggs Breakfast

The Chicken was involved the Pig was Committed

AGK Community Tester
DennisW
15
Years of Service
User Offline
Joined: 15th Jun 2008
Location: Ohio
Posted: 16th Feb 2015 16:13
added it to the bottom and still the same thing gets to Preparing Dynamic Lights and stops.
Ham and Eggs Breakfast

The Chicken was involved the Pig was Committed

AGK Community Tester
DennisW
15
Years of Service
User Offline
Joined: 15th Jun 2008
Location: Ohio
Posted: 16th Feb 2015 17:14
When it was locked up I brought up task manager and it said there was a lua error unable to find omegacore.dll . I check and it is in the root of reload. So maybe the file got corrupt . Not sure what my next move would be now.
Ham and Eggs Breakfast

The Chicken was involved the Pig was Committed

AGK Community Tester
DennisW
15
Years of Service
User Offline
Joined: 15th Jun 2008
Location: Ohio
Posted: 16th Feb 2015 18:22
Reinstalled Reload and added script to global.lua and all is right with the world. Thanks for your help

Dennis
Ham and Eggs Breakfast

The Chicken was involved the Pig was Committed

AGK Community Tester
Super Clark
GameGuru TGC Backer
13
Years of Service
User Offline
Joined: 4th Apr 2011
Location: UK
Posted: 19th Feb 2015 12:45
Hi, is it possible to put a step by step guide on how to set this up for us none
scripting folk? I have put the Avram Folder in Scriptbank, but no clue from
ther any chance of a Tutorial for this?

Regards SuperClark
PM
DennisW
15
Years of Service
User Offline
Joined: 15th Jun 2008
Location: Ohio
Posted: 19th Feb 2015 15:41 Edited at: 19th Feb 2015 15:42
Hi Super Clark
If you go to the first post Avram as a link to a WiKi that has a install section. That explains it step by step.
Ham and Eggs Breakfast

The Chicken was involved the Pig was Committed

AGK Community Tester
Super Clark
GameGuru TGC Backer
13
Years of Service
User Offline
Joined: 4th Apr 2011
Location: UK
Posted: 19th Feb 2015 22:11 Edited at: 19th Feb 2015 23:06
Thanks sorted,




It has an issue i noticed when you close play and restart again the planes are flying backwards again
even with fixnewy = 180 set. any ideas?
PM
Super Clark
GameGuru TGC Backer
13
Years of Service
User Offline
Joined: 4th Apr 2011
Location: UK
Posted: 19th Feb 2015 22:38 Edited at: 19th Feb 2015 23:06
Ignor this post
PM
Avram
GameGuru TGC Backer
17
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Serbia
Posted: 20th Feb 2015 15:26
Yeah, each upgrade will overwrite global.lua with the latest one, so you need to add code to initialize my OOP LUA framework again after each upgrade.
The Proost
17
Years of Service
User Offline
Joined: 23rd Feb 2007
Location: Belgium
Posted: 2nd May 2015 16:59 Edited at: 2nd May 2015 17:01
Anybody know how to fix this? " error running function:scriptbank\helicopter.lua:30 attempt to index global 'aEntity' ( a nil value)
Avram
GameGuru TGC Backer
17
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Serbia
Posted: 6th May 2015 16:08
As mentioned in my previous message in this thread, please check if your OOP toolkit is correctly installed in global.lua? Note that (almost) every GG update via Steam (and those now come more often than before) will overwrite modified global.lua with the default one.
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 7th May 2015 18:44
@ Avram
I get all your download links broken, even in your wiki.
I had it installed in Reloaded, but it is outdate now, and I wish (if possible) the latest framework versiĆ³n.
Thanks in advance

3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 8.1 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics

PM
Avram
GameGuru TGC Backer
17
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Serbia
Posted: 8th May 2015 19:34
I think I have updated all URLs in my framework's thread. The new URL (since the name change) is: https://bitbucket.org/Avram/game-guru-toolkit

Direct download of the latest version: https://bitbucket.org/Avram/game-guru-toolkit/get/master.zip
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 8th May 2015 20:26
Thanks too much Avram.

3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 8.1 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics

PM

Login to post a reply

Server time is: 2024-05-03 22:07:34
Your offset time is: 2024-05-03 22:07:34