Quantcast

Jump to content

» «
Photo

How to learn SCM?

10 replies to this topic
arvark
  • arvark

    Oh yes, we'll keep on trying.

  • BUSTED!
  • Joined: 22 Nov 2013
  • Italy

#1

Posted 03 May 2014 - 03:16 PM

Hi! I'd like to learn SCM for GTA VC and III, I came here because the coding bible is for SA! I know that you don't learn SCM in 24 Hours, I have time!


CharlesVercetti
  • CharlesVercetti

    a.k.a TommyCJFaann

  • Members
  • Joined: 08 Dec 2013
  • India

#2

Posted 03 May 2014 - 03:45 PM Edited by TommyCJFaann, 03 May 2014 - 03:50 PM.

http://gtaforums.com...scm-coding-faq/

 

Read the Opcode database for learning how,and where to use them.

I don't think you'll get a tutorial for this though.


Ashwin.Star
  • Ashwin.Star

    i'll be back...

  • Members
  • Joined: 14 Nov 2010
  • India

#3

Posted 03 May 2014 - 04:25 PM

Well i'll suggest from where i have started,

Read Dutchy's SCM codding tutorial,

 

No matters if the Tutorial is for SA,VC or III,

there won't be any difference other then the Opcode,

when can be easily replaced according to Need,

 

It's won't take too much Time to learn,

If you will keep it on, in next week,

you will be uploading your Own script on Garage,

just be confident

Good Luck...

 

An Advise,

don't make different Topics for starting Question,

ask them in Tutorial Topics, or you may ask here too,


arvark
  • arvark

    Oh yes, we'll keep on trying.

  • BUSTED!
  • Joined: 22 Nov 2013
  • Italy

#4

Posted 03 May 2014 - 04:44 PM

Thanks!


arvark
  • arvark

    Oh yes, we'll keep on trying.

  • BUSTED!
  • Joined: 22 Nov 2013
  • Italy

#5

Posted 03 May 2014 - 06:06 PM

Well i'll suggest from where i have started,

Read Dutchy's SCM codding tutorial,

 

No matters if the Tutorial is for SA,VC or III,

there won't be any difference other then the Opcode,

when can be easily replaced according to Need,

 

It's won't take too much Time to learn,

If you will keep it on, in next week,

you will be uploading your Own script on Garage,

just be confident

Good Luck...

 

An Advise,

don't make different Topics for starting Question,

ask them in Tutorial Topics, or you may ask here too,

 

I only learned how to spawn pickups, peds ecc.


Ashwin.Star
  • Ashwin.Star

    i'll be back...

  • Members
  • Joined: 14 Nov 2010
  • India

#6

Posted 04 May 2014 - 03:25 AM

What else you want to learn ?

Now you are almost ready to make missions & other stuff,

 

there are just few things to be remembered,

# Must wait at least 0 in a Loop,

# The model must be loaded or available before using it for Creating,

# Script must end with End_thread opcode or with a Loop.

# there is a difference between Actor & Player,  $Player_actor must bu used for Actor Opcode while $Player_Char for Player opcodes,

# A car must be treated like car & an actor as an actor, i.e. don't do something like "As_actor 0@ kill_actor $Player_Actor // where 0@ is handle of a Car :p

# the black text written in Opcodes doesn't count anything, don't think changing that text would make any difference, but starting 4 byte will do,(0002: if totally Different from 0001:)

# similarly, use of Integer in place of Float may led to an Crash,

# and few more things...

# Well, memory Part is Quite Big, Don't get into it, until you finish with Script,

 

If you are not sure about any Particular part of scrip,

ask it's author or Ask it here,

  • arvark likes this

arvark
  • arvark

    Oh yes, we'll keep on trying.

  • BUSTED!
  • Joined: 22 Nov 2013
  • Italy

#7

Posted 04 May 2014 - 08:07 AM

What else you want to learn ?

Now you are almost ready to make missions & other stuff,

 

there are just few things to be remembered,

# Must wait at least 0 in a Loop,

# The model must be loaded or available before using it for Creating,

# Script must end with End_thread opcode or with a Loop.

# there is a difference between Actor & Player,  $Player_actor must bu used for Actor Opcode while $Player_Char for Player opcodes,

# A car must be treated like car & an actor as an actor, i.e. don't do something like "As_actor 0@ kill_actor $Player_Actor // where 0@ is handle of a Car :p

# the black text written in Opcodes doesn't count anything, don't think changing that text would make any difference, but starting 4 byte will do,(0002: if totally Different from 0001:)

# similarly, use of Integer in place of Float may led to an Crash,

# and few more things...

# Well, memory Part is Quite Big, Don't get into it, until you finish with Script,

 

If you are not sure about any Particular part of scrip,

ask it's author or Ask it here,

 

What? I got all the rest though


fastman92
  • fastman92

    фастман92 | ف

  • Members
  • Joined: 28 Jul 2009
  • None
  • Contribution Award [Mods]

#8

Posted 04 May 2014 - 01:48 PM

Example:
014B: create_car_generator 2435.302 -1671.848 12.8007 angle 90.0 model #RHINO color -1 -1 force_spawn 1 alarm 0 doorlock 0 delay 0 10000 store_to $PARKED_RHINO
What matters to the game is command ID and arguments.

Text is ignored by Sanny Builder during compilation.

Here

Command ID: 0x014B
Arguments:
2435.302 -1671.848 12.8007
90.0
#RHINO
-1
-1
1
0
0
0
10000
$PARKED_RHINO

arvark
  • arvark

    Oh yes, we'll keep on trying.

  • BUSTED!
  • Joined: 22 Nov 2013
  • Italy

#9

Posted 04 May 2014 - 03:36 PM

Can someone explain this code?  

Code 1
//-------------Mission 0---------------

Code 2
:DOCTRCK
thread "DOCTRCK" 

:DOCTRCK_11
wait 10 
if Player.Defined($PLAYER_CHAR)
else_jump @DOCTRCK_11 
if or
00DE: player $PLAYER_CHAR driving_vehicle_type #BOXVILLE 
00DE: player $PLAYER_CHAR driving_vehicle_type #TOPFUN 
else_jump @DOCTRCK_11 
if 
00E1: key_pressed 0 2 
else_jump @DOCTRCK_11 
03C1: 0@ = player $PLAYER_CHAR car 
02E3: 1@ = car 0@ speed 
if Car.Model(0@) == #BOXVILLE
else_jump @DOCTRCK_141 
10@ = 189 // integer values 
040D: unload_wav 2 
03CF: load_wav 'LIFTOP' as 2 
jump @DOCTRCK_165 

:DOCTRCK_141
10@ = 228 // integer values 
040D: unload_wav 2 
03CF: load_wav 'LIFTCL' as 2 

:DOCTRCK_165
Model.Load(10@)

:DOCTRCK_170
wait 0 
if and
Model.Available(10@)
03D0: wav 2 loaded 
else_jump @DOCTRCK_170 
03D1: play_wav 2 
0407: create_coordinate 1@ 2@ 3@ from_car 0@ offset 0.0 0.0 100.0 
012A: put_player $PLAYER_CHAR at 1@ 2@ 3@ and_remove_from_car 
0407: create_coordinate 1@ 2@ 3@ from_car 0@ offset 0.0 -5.0 0.0 
Camera.SetPosition(1@, 2@, 3@, 0.0, 0.0, 0.0)
0407: create_coordinate 1@ 2@ 3@ from_car 0@ offset 0.0 0.0 -1.25 
0460: set_camera_pointing_time 0.0 100 
Camera.PointAt(1@, 2@, 3@, 1)
4@ = Car.Angle(0@)
02E3: 5@ = car 0@ speed 
6@ = Car.Health(0@)
Car.Destroy(0@)
0@ = Car.Create(10@, 1@, 2@, 3@)
Car.Angle(0@) = 4@
04BA: set_car 0@ speed_instantly 5@ 
Car.Health(0@) = 6@
wait 0 
0369: put_player $PLAYER_CHAR in_car 0@ 
Camera.Restore
Camera.SetBehindPlayer
Model.Destroy(10@)
wait 500 
jump @DOCTRCK_11

Code 3
create_thread @BTTF3

Code 4
create_thread @DOCTRCK

Things I don't get: 

03C1: 0@ = player $PLAYER_CHAR car 
02E3: 1@ = car 0@ speed 
10@ = 189 // integer values
040D: unload_wav 2
03CF: load_wav 'LIFTOP' as 
jump @DOCTRCK_165 Why create_thread @BTTF3 if BTT3 De Lorean doesn't matter in this script?

Another thing, how do I create an animation (In blender) and how do I put it in this script? Instead of changing the model, play the animation and THEN change? Please! I'll be very greatfull!


Ashwin.Star
  • Ashwin.Star

    i'll be back...

  • Members
  • Joined: 14 Nov 2010
  • India

#10

Posted 04 May 2014 - 03:46 PM

03C1: 0@ = player $PLAYER_CHAR car

# This opcode is Storing the Handle of Player's Current Car into the 0@ variable,

02E3: 1@ = car 0@ speed

# Storing the Value of Current Speed of Car 0@, in local variable 1@

10@ = 189 // integer values
# It's so simple, it stores 189 in var 10@

 

040D: unload_wav 2

# unloading a Wav file which may be loaded before,

 

03CF: load_wav 'LIFTOP' as (missing ???)

# a WAV file, name LIFTOP is loaded A INTEGER which is not written i think,

jump @DOCTRCK_165 // Why create_thread @BTTF3 if BTT3 De Lorean doesn't matter in this script?

# it makes the Game start reading from Given Lable,


arvark
  • arvark

    Oh yes, we'll keep on trying.

  • BUSTED!
  • Joined: 22 Nov 2013
  • Italy

#11

Posted 04 May 2014 - 03:58 PM

What about if I wanna the truck to play an animation and THEN change model?





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users