Quantcast

Jump to content

» «
Photo

Place Vehicle [CLEO]

13 replies to this topic
rocketfingers14
  • rocketfingers14

    Player Hater

  • Members
  • Joined: 17 Apr 2009

#1

Posted 17 April 2009 - 11:27 AM

I have a problem with a vehicle place. I use this code:

CODE

{$CLEO .cs}
0000: NOP

0247: request_model #INFERNUS
038B: load_requested_models

00A5: $WOZ = create_car #INFERNUS at 2499.2476 -1684.218 12.9276
0175: set_car $WOZ z_angle_to 102.7758

0A93: end_custom_thread


The Car should to stand right here:

user posted image

But this car stand here:

user posted image

So, the question is: What I'm doing bad? And what I must to do to place this car where I want?


PS: I'm sorry, my english is not very good biggrin.gif

Doomed_Space_Marine
  • Doomed_Space_Marine

    Thug

  • Members
  • Joined: 21 Jul 2007

#2

Posted 17 April 2009 - 11:55 AM

Maybe vehicle is created when you are far from its spawn location? Then COLs aren't loaded, vehicle falls through the ground and appears on the nearest point in the cars path. To make it stay near player, it would be better to make it unable to move and when player is near, enable moving. The opcode must be 0519, I think.

Dutchy3010
  • Dutchy3010

    Female SCM coder!

  • Moderator
  • Joined: 30 Jul 2006
  • Netherlands

#3

Posted 17 April 2009 - 02:21 PM

As a addition to the post above.

First, never forget to check if the model is available.

CODE
repeat
wait 0
until Model.Available(#INFERNUS)


Second, don't use global variables in a CLEO script. Use Local Variables instead. wink.gif

CODE
00A5: 1@ = create_car #INFERNUS at 2499.2476 -1684.218 12.9276
0175: set_car 1@ z_angle_to 102.7758

rocketfingers14
  • rocketfingers14

    Player Hater

  • Members
  • Joined: 17 Apr 2009

#4

Posted 17 April 2009 - 03:18 PM Edited by rocketfingers14, 17 April 2009 - 03:23 PM.


Doomed I use this opcode (0519) and everything is ok but the car is
above ground.

PICTURE:

user posted image

What now?

Dutchy3010
  • Dutchy3010

    Female SCM coder!

  • Moderator
  • Joined: 30 Jul 2006
  • Netherlands

#5

Posted 17 April 2009 - 03:27 PM

Don't think too hard. What would you do, if you spawn a car to high? Just lower your z-value. Make it, for example, 11.6276, and it will look beautiful.

Most likely there are other solutions, but this is easy, so why not using it? tounge.gif

rocketfingers14
  • rocketfingers14

    Player Hater

  • Members
  • Joined: 17 Apr 2009

#6

Posted 17 April 2009 - 04:05 PM Edited by rocketfingers14, 17 April 2009 - 04:17 PM.

It doesn't work ;/ I don't know what I'm doing bad. Can you write for me whole skeleton of code?


HAHAHA I do it biggrin.gif I know what I'm doing bad tounge.gif . Thanks for all :]

Dutchy3010
  • Dutchy3010

    Female SCM coder!

  • Moderator
  • Joined: 30 Jul 2006
  • Netherlands

#7

Posted 17 April 2009 - 04:18 PM

This works for me:

CODE
{$CLEO .cs}

0247: request_model #INFERNUS
038B: load_requested_models

repeat
wait 0
until Model.Available(#INFERNUS)

00A5: 1@ = create_car #INFERNUS at 2499.2476 -1684.218 11.6276
0175: set_car 1@ z_angle_to 102.7758
Car.LockInCurrentPosition(1@) = True

repeat
wait 0
until 00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere 2499.2476 -1684.218 12.9276 radius 10.0 10.0 10.0

Car.LockInCurrentPosition(1@) = False

0A93: end_custom_thread


Coding is certainly not only using opcodes, but it is also a bit of creativity. I don't know a "nice" way to make it, I'm afraid, so I invent something.

user posted image

rocketfingers14
  • rocketfingers14

    Player Hater

  • Members
  • Joined: 17 Apr 2009

#8

Posted 18 April 2009 - 08:19 AM

Yea I know, i have to do some new missions with cars, now i know how to place it :]

PS: When i end, maybe i show this missions in gtaforums :]

rocketfingers14
  • rocketfingers14

    Player Hater

  • Members
  • Joined: 17 Apr 2009

#9

Posted 19 April 2009 - 03:30 PM

eeh.. I have next problem ;/

I want to place car here: (2 wheels on the road, 2 on the pavement)

user posted image


I use this code:

CODE

{$CLEO .cs}
0000: NOP

0247: request_model #ADMIRAL
038B: load_requested_models

:check
wait 10
Model.Available(#ADMIRAL)
jf @check

00A5: 2@ = create_car #ADMIRAL at 2472.752 -1737.5663 11.5276
0175: set_car 2@ Z_angle_to 271.3138
0519: set_car 2@ locked 1
wait 1000
0519: set_car 2@ locked 0
 
0A93: end_custom_thread


And the car stay here:

user posted image

What i have to do to place this car as in the picture 1?

Little Psycho
  • Little Psycho

    Unofficial supporter of ms.cooldude mods, lolz

  • BUSTED!
  • Joined: 14 Mar 2009

#10

Posted 19 April 2009 - 03:32 PM

That's impossible to do, dude.

rocketfingers14
  • rocketfingers14

    Player Hater

  • Members
  • Joined: 17 Apr 2009

#11

Posted 19 April 2009 - 03:51 PM

Why?! confused.gif and how you know it? tounge.gif

Maybe It's possible biggrin.gif

Little Psycho
  • Little Psycho

    Unofficial supporter of ms.cooldude mods, lolz

  • BUSTED!
  • Joined: 14 Mar 2009

#12

Posted 19 April 2009 - 03:56 PM

QUOTE (rocketfingers14 @ Apr 19 2009, 15:51)
Why?! confused.gif and how you know it? tounge.gif

Maybe It's possible biggrin.gif

It's hardcoded in all GTA arcade games (from GTA3 to VCS), that all vehicle "weight" stay on the same place, but when you "touch" the vehicle, the weight of car is getting to other sides. However in GTA4, it's fixed. I think it's engine issue.

rocketfingers14
  • rocketfingers14

    Player Hater

  • Members
  • Joined: 17 Apr 2009

#13

Posted 19 April 2009 - 04:03 PM Edited by rocketfingers14, 19 April 2009 - 04:07 PM.

sh*t bored.gif I write script with new mission and cars staying unreal ;/

EDIT: But when i edit main.scm and i create new car, he's staying where i place him and everything is ok.

MOrdecki
  • MOrdecki

    Scripter

  • Members
  • Joined: 10 Jul 2006

#14

Posted 20 April 2009 - 05:35 PM Edited by MOrdecki, 20 April 2009 - 05:42 PM.

QUOTE (rocketfingers14 @ Apr 19 2009, 16:03)
sh*t  bored.gif I write script with new mission and cars staying unreal ;/

EDIT: But when i edit main.scm and i create new car, he's staying where i place him and everything is ok.

Well actually there is an way ..
You can put your car at his place again, it shuld fix.

CODE
Car.PutAt(2@, 2472.752, -1737.5663, 11.5276)


Even if that does't work, try to create random ped in your car then just destroy him, this way MUST work.

CODE
0560: create_random_actor_in_car 2@ handle_as 3@
Actor.DestroyInstantly(3@)




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users