MODULE: GTA-Style Driving

Started by Rocco, Sat 21/11/2009 19:42:10

Previous topic - Next topic

Rocco

Version:      1.00
Date:           21 November 2009
Author:        Rocco
Description: GTA-Style Drive Modul

Requires AGS 3++



Setup Instruction:
============================================================================================
-------------------------------------------------------------------------------------------
create one room where the driving takes place
import one car sprite - up-view (carnose must be straight up)
remember the sprite slot number of your car sprite.

---------------------------------------------------------
this is the only required function to run the module, so with only calling this function you can have a driving car on screen
call function (for instance in the after fade in section of the drive room) :
FUNC_RocGTA_Driver_Init(26,100,180,315);    // first is the sprit slot number of the car, then are the starting coordinates - x and y, the 4th value is the starting angle of the car where 0 = ->

-----------------------------------------------------------
if you want carsounds you have to call this function
here it is important that the rpm sounds are in one row.
FUNC_RocGTA_SetSounds(int engine_rpm_first = -1,  int engine_rpm_last = -1, int engine_start = -1, int engine_idle = -1, int crash_sound = -1, int horn_sound = -1, int backgroundmusic = -1);

---------------------------------------------------
use this function if you want to stop driving
FUNC_RocGTA_Stop_Drive();

----------------------------------------------------
now its also possible to abort driving and go to the last room or quit the game with the <escape> key
you can change this behavior in the Drive.asc script at the bottom in the rep_execute function

**************************************************************************************************
REGIONS:
Region 1 are walls
Region 2 are oil slops where you cant steer
Region 3 are areas where the car slows down

// Use this functions to alter the Car behavior during game play (at gamestart you can set up this values in the DriverInit Function)
import function FUNC_RocGTA_SetTempo(float maxspeed, float minspeed);   // set Tempo
import function FUNC_RocGTA_SetSteering(float steering_angle);            // set Steering Angle
import function FUNC_RocGTA_SetFriction(float friction);                     // set Groundfriction
import function FUNC_RocGTA_SetAccel_Decel(float accel, float decel);   // set Acceleration and Decelaration
import function FUNC_RocGTA_SetDamage(int damage);                           // set Damage
import function FUNC_RocGTA_Change_Driver_Sprite(int vehicle_sprite); // set new car sprite


---------------------------------------------------------------------------------------
in this module-version the handling of tyre-wear, fuel consumption, and car damage is deactivated
you can see this behavior in the demo, where this functionality are in use


-----------------------------------------------------------------------------------------



DOWNLOADS:
AGS-GTA-Style Driving Module (AGS Version 3.00 and above)
AGS-GTA-Style Driving Demo (module included) -> AGS GTA Demo and Source
AGS-GTA-Style Driving Module -> AGS GTA Driving Module


This Game also uses this module -> Super Pitstop Racing


Big Thx and Credits:
Chris Jones - AGS,
KhrisMUC & AGS-Community - Forum help

I hope this module is useful and come in handy one day.
It this happens, I would be very pleased if the game creator sends me a message when their game is finished
so i can play it. :-)

greets,
Rocco


sidenotes:
This module is far away from perfection, the car physic is very basic, the collision response is somehow crappy, and you can get stuck on the oil slops.
I have this module a long time on my harddisk, and think its better to release it as it is now, before it rottens on my computer. (thanks NsMn for making enough pressure)  ;) Maybe someday developers with more physic and math knowledge can enhaunce the module.


Joseph DiPerla

Neat! Tried the demo. Worked great. Nice job.
Joseph DiPerla--- http://www.adventurestockpile.com
Play my Star Wars MMORPG: http://sw-bfs.com
See my Fiverr page for translation and other services: https://www.fiverr.com/josephdiperla
Google Plus Adventure Community: https://plus.google.com/communities/116504865864458899575

suicidal pencil

Quote from: Rocco on Sat 21/11/2009 19:42:10
Maybe someday developers with more physic and math knowledge can enhaunce the module.

challenge accepted!

I'd gladly write the physics in for you.

Danman

Just to ask cause I wanna use this module on my game.  When are you suicidal Pencil going release a version with Physics. Cause that will be really cool 8) . Even though it has been like 3 months since you said that I would like to know if this project is still happening.



suicidal pencil

I've been a bit tied up...but with the permission of Rocco, I'd gladly write in the physics and re-release it

Rocco

#5
you are welcome,  :)
and so everyone who can improve the module.

what i would like to see enhanced is,
a better collision response, (against walls and in the ideal case against other moving objects, like other cars)
and maybe a better car driving physic.

SMF spam blocked by CleanTalk