Adventure Game Studio

AGS Support => Modules, Plugins & Tools => Topic started by: Rocco on Sat 21/11/2009 19:42:10

Title: MODULE: GTA-Style Driving
Post by: Rocco on Sat 21/11/2009 19:42:10
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 (http://www.virtual-illusion.com/download/files/gta-test-source.zip)
AGS-GTA-Style Driving Module -> AGS GTA Driving Module (http://www.virtual-illusion.com/download/files/AGS-Modules/Driving.zip)


This Game also uses this module -> Super Pitstop Racing (http://www.adventuregamestudio.co.uk/games.php?action=detail&id=1063)


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.

Title: Re: MODULE: GTA-Style Driving
Post by: Joseph DiPerla on Mon 23/11/2009 03:38:33
Neat! Tried the demo. Worked great. Nice job.
Title: Re: MODULE: GTA-Style Driving
Post by: suicidal pencil on Mon 23/11/2009 21:36:46
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.
Title: Re: MODULE: GTA-Style Driving
Post by: Danman on Tue 16/02/2010 15:54:49
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.
Title: Re: MODULE: GTA-Style Driving
Post by: suicidal pencil on Sun 21/02/2010 03:55:21
I've been a bit tied up...but with the permission of Rocco, I'd gladly write in the physics and re-release it
Title: Re: MODULE: GTA-Style Driving
Post by: Rocco on Sun 21/02/2010 11:25:55
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.