Quantcast

Jump to content

» «
Photo

Driving Cars

  • This topic is locked This topic is locked
18 replies to this topic
gtasearcher
  • gtasearcher

    No sh*t.

  • Members
  • Joined: 26 Aug 2008

#1

Posted 07 April 2009 - 12:48 PM Edited by gtasearcher, 08 April 2009 - 04:26 AM.

Why aren't you implementing the AI Car Drive? It's damn easy, I made a simple CLEO that, when you press HOME, you start it, press X to choose starting pos, then press X to choose the ending pos, then press X to view a short 7,5 seconds movie of the car driving itself thru the planned route.

Here's a vid:


And here's the source code:
CODE
{$CLEO .cs}
thread 'TEST'
jump @1

:1
wait 0
if
0AB0: 36
jf @1
if
0449:   actor $PLAYER_ACTOR in_a_car
jf @1
wait 0
03C0: 0@ = actor $PLAYER_ACTOR car
wait 0
gosub @def
wait 0
gosub @2
Car.StorePos(0@, 1@, 2@, 3@)
4@ = Car.Angle(0@)
wait 1000
gosub @2
CAR.StorePos(0@, 5@, 6@, 7@)
wait 1000
gosub @2
wait 0
fade 0 1500
wait 1500
0792: disembark_instantly_actor $PLAYER_ACTOR
wait 0
Car.PutAt(0@, 1@, 2@, 3@)
cAR.Angle(0@) = 4@
wait 0
Car.DriveTo(0@, 5@, 6@, 7@)
wait 0
0679: put_camera_on_car 0@ with_offset 5.0 7.0 0.0 rotation 0.0 0.0 0 0.0 2
wait 0
fade 1 1500
wait 0
02A3: enable_widescreen 1
wait 7500
fade 0 1500
wait 1500
Car.RemoveReferences(0@)
fade 1 1500
wait 0
02A3: enable_widescreen 0
Camera.Restore()
wait 0
jump @1

:2
wait 0
if
0AB0: 88
jf @2
return

:def
wait 0
if
856E:   not car 0@ defined
0AA1: return_if_false
wait 0
jump @def

Sniputer
  • Sniputer

    IM NOT COMING HERE ANYMORE

  • BUSTED!
  • Joined: 01 May 2007

#2

Posted 07 April 2009 - 12:56 PM

So if this makes it to DYOM, the car driving animation is possible?

PatrickW
  • PatrickW

    GTA Juggernaut

  • Moderator
  • Joined: 07 Jan 2004
  • Netherlands

#3

Posted 07 April 2009 - 01:31 PM Edited by PatrickW, 07 April 2009 - 01:37 PM.

We have similar code already, even a bit more sophisticated, with multiple route-points.
But the problem is that in DYOM, many more factors have to be taken into consideration, for example the fact that the car may have to drive into an area that the player hasn't visited yet. This can cause serious problems, as the collision models of the roads aren't loaded than, so the vehicle will sink through the floor.
But even that will be solvable.

Furthermore it will have to be integrated in the whole DYOM environment: menu's, memory-storage, file-storage. Also editing/deleting have to be implemented.

It's quite easy to create such a simple sandbox proto-type (which we are more than capable to do), but it's much harder to get it integrated and working in all possible circumstances.

But you can be assured that such functionality will be available in the V5 release, as we've said before.


BTW:
Why are you putting a "wait 0" on every other line of your CLEO script ?

Sniputer
  • Sniputer

    IM NOT COMING HERE ANYMORE

  • BUSTED!
  • Joined: 01 May 2007

#4

Posted 07 April 2009 - 01:33 PM

Yay, car thing confirmed. Now all we need to know when this V5 will come?

TNTX32
  • TNTX32

    HAAAAAXXX!!!

  • BUSTED!
  • Joined: 23 Feb 2009

#5

Posted 07 April 2009 - 02:51 PM

I wonder why a lot of good ideas will be only released in the 5.0.

But it's SOMETHING, it's not bad colgate.gif

But yes, PatrickW is alright about the car problem.

The LOCATION of where the car go, the ROUTE, the PATH and everything else needs to be STORED in a .DAT. And you will also can Edit and Delete it! So it's not that easy.

gtasearcher
  • gtasearcher

    No sh*t.

  • Members
  • Joined: 26 Aug 2008

#6

Posted 08 April 2009 - 04:32 AM Edited by gtasearcher, 08 April 2009 - 04:40 AM.

QUOTE (PatrickW @ Apr 7 2009, 13:31)
BTW:
Why are you putting a "wait 0" on every other line of your CLEO script ?

I know I shouldn't, but when I was a newbie in scripting, I forgot to put a "wait 0" in my loops, which caused my game always to crash without warning --> had to restart the PC --> sometimes the PC will not work anymore....

And now, for safety, I use load's o' waits...

QUOTE (TNTX32)
The LOCATION of where the car go, the ROUTE, the PATH and everything else needs to be STORED in a .DAT.
CODE
{$CLEO .cs}
thread 'TEST'
jump @1

:1
wait 0
if
0AB0: 36
jf @1
if
0449:   actor $PLAYER_ACTOR in_a_car
jf @1
wait 0
03C0: 0@ = actor $PLAYER_ACTOR car
wait 0
gosub @def
wait 0
0A99: chdir 1 // User Files Directory
wait 0
if
0AAB:  file_exists "car_route.dat"
then
wait 0
repeat
wait 0
0A9A: 8@ = openfile "car_route.dat" mode 0x6272  // opens the file for binary reading
until 0A9A: 8@ = openfile "car_route.dat" mode 0x6272  // checks the open of the file for binary reading
wait 0
0A9D: readfile 8@ size 4 to 1@
0A9D: readfile 8@ size 4 to 2@
0A9D: readfile 8@ size 4 to 3@
0A9D: readfile 8@ size 4 to 4@
0A9D: readfile 8@ size 4 to 5@
0A9D: readfile 8@ size 4 to 6@
0A9D: readfile 8@ size 4 to 7@
wait 0
0A9B: closefile 8@
wait 0
jump @car_drive
end
wait 0
gosub @2
Car.StorePos(0@, 1@, 2@, 3@)
4@ = Car.Angle(0@)
wait 1000
gosub @2
CAR.StorePos(0@, 5@, 6@, 7@)
wait 1000
gosub @2
wait 0
jump @car_drive

:car_drive
wait 0
fade 0 1500
wait 1500
0792: disembark_instantly_actor $PLAYER_ACTOR
wait 0
Car.PutAt(0@, 1@, 2@, 3@)
cAR.Angle(0@) = 4@
wait 0
Car.DriveTo(0@, 5@, 6@, 7@)
wait 0
0679: put_camera_on_car 0@ with_offset 5.0 7.0 0.0 rotation 0.0 0.0 0 0.0 2
wait 0
fade 1 1500
wait 0
02A3: enable_widescreen 1
wait 7500
fade 0 1500
wait 1500
Car.RemoveReferences(0@)
fade 1 1500
wait 0
0A99: chdir 1 // User Files Directory
wait 0
repeat
wait 0
0A9A: 8@ = openfile "car_route.dat" mode 0x6277  // opens the file for binary writing
until 0A9A: 8@ = openfile "car_route.dat" mode 0x6277  // checks the open of the file for binary writing
wait 0
0A9E: writefile 8@ size 4 from 1@
0A9E: writefile 8@ size 4 from 2@
0A9E: writefile 8@ size 4 from 3@
0A9E: writefile 8@ size 4 from 4@
0A9E: writefile 8@ size 4 from 5@
0A9E: writefile 8@ size 4 from 6@
0A9E: writefile 8@ size 4 from 7@
wait 0
0A9B: closefile 8@
02A3: enable_widescreen 0
wait 0
jump @1

:2
wait 0
if
0AB0: 88
jf @2
return

:def
wait 0
if
856E:   not car 0@ defined
0AA1: return_if_false
wait 0
jump @def

PatrickW
  • PatrickW

    GTA Juggernaut

  • Moderator
  • Joined: 07 Jan 2004
  • Netherlands

#7

Posted 08 April 2009 - 07:13 AM

What's your point ?

Did you really think that we don't know how to store 8 variables in a file ? suicidal.gif


gtasearcher
  • gtasearcher

    No sh*t.

  • Members
  • Joined: 26 Aug 2008

#8

Posted 08 April 2009 - 07:17 AM

QUOTE (PatrickW @ Apr 8 2009, 07:13)
What's your point ?

Did you really think that we don't know how to store 8 variables in a file ? suicidal.gif

Nope, I was just answering TNTX32 afirmation.

TNTX32
  • TNTX32

    HAAAAAXXX!!!

  • BUSTED!
  • Joined: 23 Feb 2009

#9

Posted 08 April 2009 - 07:39 AM

QUOTE (gtasearcher @ Apr 8 2009, 07:17)
QUOTE (PatrickW @ Apr 8 2009, 07:13)
What's your point ?

Did you really think that we don't know how to store 8 variables in a file ?  suicidal.gif

Nope, I was just answering TNTX32 afirmation.

I don't know anything about CLEO Coding...

But just wait for 5.0! After all the best of all is to wait for a better thing!

12jango
  • 12jango

    "This is not revenge! This is entertainment!"

  • Members
  • Joined: 08 Mar 2008

#10

Posted 10 April 2009 - 01:55 AM

Yeah, happy new year. alien.gif alien.gif alien.gif

Sniputer
  • Sniputer

    IM NOT COMING HERE ANYMORE

  • BUSTED!
  • Joined: 01 May 2007

#11

Posted 10 April 2009 - 07:59 AM

HAPPY NEW YEAR? WHAT THE...?


TNTX32
  • TNTX32

    HAAAAAXXX!!!

  • BUSTED!
  • Joined: 23 Feb 2009

#12

Posted 10 April 2009 - 02:43 PM Edited by TNTX32, 10 April 2009 - 02:49 PM.

12jango, this is not the attention whore forum, STFU and GTFO sleepy.gif

12jango
  • 12jango

    "This is not revenge! This is entertainment!"

  • Members
  • Joined: 08 Mar 2008

#13

Posted 11 April 2009 - 12:18 PM Edited by 12jango, 13 April 2009 - 02:18 PM.

You're welcome.
I really hope that the version 5 have those features, actors driving cars. That would be great! alien.gif alien.gif

TNTX32
  • TNTX32

    HAAAAAXXX!!!

  • BUSTED!
  • Joined: 23 Feb 2009

#14

Posted 13 April 2009 - 06:24 PM

I think oldmans riding their bicycles would be good first.

Ragga1
  • Ragga1

    From Bulgaria.

  • Members
  • Joined: 25 Mar 2009

#15

Posted 13 April 2009 - 07:15 PM

QUOTE (TNTX32 @ Apr 13 2009, 18:24)
I think oldmans riding their bicycles would be good first.

Uhh, what`s the difference?Just a different ped and vehicle model...

TNTX32
  • TNTX32

    HAAAAAXXX!!!

  • BUSTED!
  • Joined: 23 Feb 2009

#16

Posted 19 April 2009 - 01:46 PM

Not if a fireman drives a Stunt Plane. bored.gif

Ragga1
  • Ragga1

    From Bulgaria.

  • Members
  • Joined: 25 Mar 2009

#17

Posted 19 April 2009 - 04:09 PM

QUOTE (TNTX32 @ Apr 19 2009, 13:46)
Not if a fireman drives a Stunt Plane. bored.gif

As far as I remember, it`s basically different handling.

_-=Zombie=-_
  • _-=Zombie=-_

        

  • BUSTED!
  • Joined: 31 May 2008

#18

Posted 19 April 2009 - 08:20 PM

handling has nothing to do with the drivers of the vehicles.
unless you mean something else

TNTX32
  • TNTX32

    HAAAAAXXX!!!

  • BUSTED!
  • Joined: 23 Feb 2009

#19

Posted 20 April 2009 - 09:24 AM

No.

The fireman is a SPECIAL ACTOR - And the Stunt Plane is not a normal vehicle:

It needs special paths and special flying parameters.

suicidal.gif




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users