Scripts / [COMMUNITY] LUA script to drive a vehicle ?

Author
Message
Devcore35
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 5th Aug 2014
Location: Rouen (76) - France
Posted: 15th Mar 2015 11:23
Hello,

I'm sorry in advance if French my English is not so good: /

I had an idea of ??LUA script for the player to drive a vehicle.
TheGameCreators we decided to set this option as 2015 target though perhaps we can work together on a nearly identical system.

I thought of a simple design but I'm not very good at LUA script ... So if anyone want to help and share the final LUA script we can move faster on the idea

To explain quickly the idea of ??LUA script to create and its function is what he will spend:

1 - were placed in a vehicle GameGuru (dynamic).
2 - We will assign the famous LUA script drivecar.lua
3 - In the game when the player approaches the vehicle it displays a message "Press E to use the vehicle."
4 - The player presses "E": the player's camera is placed in front of the vehicle (and of course turned in a good way)
5 - The Player Configuration "Player Start" changes to "Speed" where you would put the value of "250"
6 - When the player advances (with Z or W depending on your keyboard) then the object dynamic vehicle behind the player will follow. Do you understand? It's a bit like if interconnects the player and the vehicle. When the player moves can even put a car engine sounds via the LUA script.
I said that everything done by the player will move will be transcribed on the vehicle.
7 - When the player want to go out there pressed again "E". The player's configuration reverts to "Speed ??= 100" and off the vehicle (at the link).
8 - The player can continue to walk again.

The only problem will be the footsteps of the player but must be removed (otherwise it is very inconvenient for now).

It could be based on the script "door.lua" to enter or exit the vehicle through the interaction of the "E" key on the keyboard.

I create an image editing so you can better see the original idea for the LUA script:



I do not know if I made the right choices at the right place in the LUA script, but you can improve the way you want.

I do not know if we can develop this kind of script but actually, from what I've seen, it's quite simple (except maybe the player's position put before the hood of the car is d├ęclicat enough ...).
The trouble is that I learn slowly LUA programming and I am very far from being able to do that. That's why more than we could conceive faster this type of script

Thank you to all those who have ideas or who want to work on this type of script
Of course I will try to create this script slowly and I hope to get there and share it free for all.

Good day to all,

Best Regards,

DevCore35

Attachments

Login to view attachments
PM
Pirate Myke
Forum Support
13
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 15th Mar 2015 14:15
Great Idea, and a brilliant way to present it.
This should be come a busy thread.
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

smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 15th Mar 2015 21:33
i've tried it and wasn't happy with the results, my advice would be to try use an image instead of a model now that's available, might look better while turning etc.

moving the player can be quite jerky as it's not a smooth movement but more of a jump in position (with current commands) so you can't really move too fast, hopefully the official update will fix that.
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Devcore35
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 5th Aug 2014
Location: Rouen (76) - France
Posted: 16th Mar 2015 09:53
Hello,
Thank you. So you would rather put a picture of the inside of a vehicle
As the example attached.

Attachments

Login to view attachments
PM
Avram
GameGuru TGC Backer
17
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Serbia
Posted: 18th Mar 2015 08:41
It is possible but I doubt you'll get satisfactory results. First, you can't move/change camera (okay you can set overlay image like the one you attached). Then, I don't think you can modify player speed/bob effect with LUA and so on... we'll have to wait a little bit to be able to make something like this that will actually look and work fine.
Devcore35
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 5th Aug 2014
Location: Rouen (76) - France
Posted: 18th Mar 2015 10:09
You are right. I think that it will be an update of GameGuru which contain new LUA commands such as adjusting the speed of the player. In the meantime I will try to prepare a test version of a LUA script that can be used at the appropriate time after some alterations
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 21st Mar 2015 12:10 Edited at: 23rd Mar 2015 16:05
here's a video of what it looks like if you use a model, note there's no collision so you'd have to find a way to work around that.


edit: forgot to say you need to put the name of the entity inside it's ifused field
press return/enter to get in/out and wasd to drive
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Devcore35
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 5th Aug 2014
Location: Rouen (76) - France
Posted: 23rd Mar 2015 09:48
Hello,

Wonderful idea!
I even think we can improve it to perfectly frame the camera
Thank you very much for sharing that will be able to move things I think!

Thank you!
PM
Devcore35
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 5th Aug 2014
Location: Rouen (76) - France
Posted: 23rd Mar 2015 10:39
Hi,

Sorry for the double post.
After testing the script it turns out it only works properly with the tank in the video. So I adapted (in French keyboard) to the vehicle "Cars 03 (orange)" pack "TGC City Pack".
Everything works fine now, however, I noticed that on your video player is Freeze. However with the script provided the player is not Freeze.
I tried several combination with FreezePlayer () and UnFreezePlayer () without success.
So the player's camera'm not inside the car.
Would you have any idea why this is not working?

P.S. : I put the car in "dynamic".

Thank you again for the original script
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 23rd Mar 2015 16:05
ah sorry i forgot to say you need to put the name of the entity inside it's ifused field
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Devcore35
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 5th Aug 2014
Location: Rouen (76) - France
Posted: 23rd Mar 2015 17:22
Ah ok no problem thank you
I come to you to the final script (v French keyboard).
Anyway congratulations for doing a good simple script
PM
Devcore35
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 5th Aug 2014
Location: Rouen (76) - France
Posted: 23rd Mar 2015 21:32 Edited at: 24th Mar 2015 09:04
Good evening everyone!

FIRST COMMUNITY SHARING OF PACK FOR DRIVING A VEHICLE IN GAMEGURU

First a big thank you to smallg! With its LUA script to drive a vehicle we have improved everything to move forward on the driving.

I share here a complete package (V1.0 Alpha) with LUA script improved functional + vehicle + two sounds to increase the realism.

The idea is to share all your improvements on this to create a near perfect driving super-script

Of course as soon as you improve the script do not forget to re-create the ZIP archive and share your improvements.

After improving the only big flaw is that the vehicle does not have gravity: if you climb a mountain by car you will be stuck in a vacuum (see video below).

For more information check out the video below:

[video]https://youtu.be/OK6IOej6bqQ[/video]
https://youtu.be/OK6IOej6bqQ

To create your vehicle properly place the elements of the package as specify.

Then set the vehicle GameGuru.
Put the vehicle in DYNAMIC.
Select the script you want if you're French and that your keyboard is in French (AZERTY) use "drivecarfrkey.lua."
Otherwise if you are British or Americans and your keyboard is QWERTY use "drivecaruskey.lua."
Then placed the following sounds:

sound0 = start.ogg
sound1 = avancer.ogg

WARNING : In the settings of the vehicle in GameGuru do not forget to put the name of the vehicle in "If Used"!
For information please see the attached image associated with this post!


Start the game and use Z, Q, S and D or W, A, S and D to use the vehicle.

Thank you again to all of you and smallg for the beginning of the script.

Feel free to improve it (see add sounds to the vehicle) to move forward and be able to create a FREE sharing for everyone who would like to use the car driving in GameGuru.

WARNING: This script works only with the vehicle provided! If you have another vehicle you probably bugs!

DOWNLOAD Pack Drive Car V1.0 (Alpha) by DevCore35 and Smallg (Script LUA) : https://mega.co.nz/#!ZhhwgCrZ!YXviylCvaO9v-7q-Z-FZbNzRmHxeeDZrVNlj3hxluBI
The ZIP archive has been tested and has no known virus.

The link does not work?
Try this:

(FTP Server) :

[href=http://algostep-mantrix.fr/Drive Car (Pack V1.0 Alpha).zip]http://algostep-mantrix.fr/Drive Car (Pack V1.0 Alpha).zip[/href]

Attachments

Login to view attachments
PM
Devcore35
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 5th Aug 2014
Location: Rouen (76) - France
Posted: 24th Mar 2015 12:24 Edited at: 24th Mar 2015 12:26
Hello everyone,

REVISION OF THE PACK "Drive Car" AVAILABLE

Version: 1.1

Operation: GameGuru 1.00.021 and higher


Improvements:
- Fixing the collision
- Added text to indicate the keys to player
- Added new sounds
- IfUsed is automatically added to the object
- The LUA script line is automatically added to the object
- The object is automatically placed dynamically
- DDS Texture (car)

Problems encountered:
- Bug gravity on the vehicle: if you climb a mountain the vehicle will remain in the air. Pay attention to this detail not resolved yet.
- The 3 new sounds can not be added to the vehicle as only "soundset0" and "soundset1" are taken into account. Unfortunately for the moment we can not add "soundset2" etc.
- Do not press the "C" key on your keyboard while driving if you apparaîterez under the vehicle instead of appearing on the side.

DOWNLOAD DRIVE CAR PACK V1.1 (Google Chrome Browser required):
https://mega.co.nz/#!ZpIHxIZD!IrONeN-rkuFq45iGpOCriPXxzaG5JMUzZIPk9ZoR9i8
INSTALLATION:

1). Unzip "Drive_Car_Pack (V1.1) -GameGuru."

2). Open the "AudioBank" and place the "cars" folder in "GameGuru Steam \ Files \ AudioBank \ music \"

3). Open the "entitybank" and place the "DriveCar_Pack" folder in "GameGuru Steam \ Files \ entitybank \"

4). Open the "scriptbank" and place the two files "drivecarfrkey.lua" and "drivecaruskey.lua" in "GameGuru Steam \ Files \ scriptbank \"

5). GameGuru place in the vehicle and test the game immediately, you can drive the car! : D

When we have solved the problems we repostera script update pack (V1.2).

Stay affux and remember that if you find how to fix some flaws feel free to repost enhanced LUA script

Smallg and thank you to all of you.

Good test!
PM
Kalle801
10
Years of Service
User Offline
Joined: 8th Jan 2014
Location: Germany
Posted: 17th Apr 2015 18:49
Thank you! Its a Start

Login to post a reply

Server time is: 2024-05-23 22:47:04
Your offset time is: 2024-05-23 22:47:04