GTA: Modification Area

A website for the GTA modding scene

Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» Big-game starts raising Schneider's profile
Sun Mar 04, 2012 2:28 am by lavivi

» [Help] cleo created lighting
Thu Oct 14, 2010 1:03 am by findmy012

» Mission Question
Thu Oct 14, 2010 1:02 am by findmy012

» [IV] Spoiler Script
Thu Oct 14, 2010 1:02 am by findmy012

» Mission mod [help]
Sat Sep 18, 2010 5:50 pm by jayd00

» Bc7 Mod Help
Fri Aug 20, 2010 11:19 am by pengpeng

» Found a bug
Fri Dec 18, 2009 4:22 am by _CJ360_

» [IV] Novitec Rosso 599 GTB
Tue Nov 17, 2009 4:22 pm by Kotton

» Hello/Guidance Request
Mon Oct 12, 2009 6:45 am by Adler

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search
Affiliates
image

Image

Image

Image

Image

Image

Image

Image

Image

Image

image

Image

steve-m.com

Image


----- Русский -----

Если ваш сайт содержит большую коллекцию SCM/CLEO-скриптов (больше 16), напишите на мой e-mail, и я добавлю его в список. Приветствуются скрипты, которые не встречаются на других сайтах ... Спасибо. ))))


----- English -----

If your website has a big enough collection of SCM/CLEO scripts (more than 16) notify me by e-mail
, and I will add it to the list. The unique scripts are preferable ... Thank you. ))))

Log in

I forgot my password



December 2016
MonTueWedThuFriSatSun
   1234
567891011
12131415161718
19202122232425
262728293031 

Calendar Calendar


You are not connected. Please login or register

Mathematical and Arithmetic Expressions, etc..

View previous topic View next topic Go down  Message [Page 1 of 1]

1 Mathematical and Arithmetic Expressions, etc.. on Sat Feb 28, 2009 11:17 am

Mathematical and arithmetic expressions can be written without using the opcode. This is much easier and faster.

INC, This command is an alternative to the usual addition. It increases the value of the first parameter to the number transmitted by the
second parameter.

Code:

$Var += 10


Same as:


Code:

Inc($Var, 10)


By the variable $Var in both versions will be an 10.
Let me remind you that if the second number integer, is a Float type variable, then the compiler automatically converts the number of fractional.
This command is useful if you only need to add one to the variable, as the second parameter by default is 1.

Code:
 
$Var += 1


Same as:

Code:
 
Inc($Var)



DEC, This command is an alternative to the usual addition. It decreases the value of the first parameter to the number transmitted by the
second parameter.

Code:
 
$Var -= 10


Same as:

Code:
 
Dec($Var, 10)


MUL, This command is an alternative to the usual addition. It multiplies the value of the first parameter to the number transmitted by the
second parameter.

Code:
 
$Var *= 5


Same as:

Code:
 
Mul($Var, 5)



DIV, This command is an alternative to the usual addition. It divides the value of the first parameter to the number transmitted by the
second parameter.

Code:
 
$Var /= 5


Same as:

Code:
 
Div($Var, 5)



The procedure calculates the square SQR variable. I.e. it is a replacement operation of multiplication by the variable itself:

Code:
 
$Var *= $Var


Same as:

Code:
 
Sqr($Var)



Random

Code:
 
0208: $Var = random_float 10.0 20.0
0209: $Var = random_int 20 100


Thus, the first is for float-point values, the second opcode is for random INT

Both can be represented as this:

Code:
 
$Var = Random(20, 100)



As you can see, the compiler chooses the opcode, depending on what type of parameters it has,
(e.g. floating-point parameter would be something like, (0.0), where as a INT would be something like (80), for example).
That is how Sanny Builder gets the correct opcode.
If the type is unknown or is not a Integer or Float, the compiler will report an error.


Alloc

As in the present main.scm stored variables and that the DMA(Direct Memory Addresses). This is beyond the scope of this article,
although it may be later described.
So, the team Alloc. It sets the memory address for a variable with a character name:

Code:
 
Alloc($PLAYER_CHAR, 12)


The variable $PLAYER_CHAR will then be compiled as $12.
When using the command Alloc you can build a group of variables in a row, turning them this way in the elements array:

Code:
 
Alloc($Array, 30)
Alloc($Value2, 31)
Alloc($Value3, 32)
Alloc($Value4, 33)


These variables are now an array. Look at this script code:

Code:
 
Alloc($Array, 30)
Alloc($Value2, 31)
Alloc($Value3, 32)
Alloc($Value4, 33)

var
$Array: array 4 of Integer
$Result: Int
end

$Value3 = 0x64
$Index = 0x2
$Result = $Array[$Index]

Player.Money($PLAYER_CHAR) += $Result // + 0x64 = 100

Missions define list, it has the numbers of missions. Any mission team started start_mission.

Code:
 
DEFINE MISSION 2 AT @INTRO


But you must remember these numbers are not always convenient.
Therefore, Sanny Builder was made to replace the number of mission in its name. Name - in this case, the name tags are written in the same block.
Thus, to start the 2nd mission you need to write the following:

Code:
 
start_mission intro


You can access the list of names by pressing Ctrl(Strg) + Space in Sanny Builder. The cursor should be after start_mission, before the number of
that mission.

View user profile http://gtamodding.com
He..He do not you never get tired of changing keyboards all the time?
Or do you have a special keyboard that allows different languages?

View user profile
Alexander wrote:He..He do not you never get tired of changing keyboards all the time?
Or do you have a special keyboard that allows different languages?

Right back at ya. Tounge 1 Well, actually, I do not always switch keyboards.. Some times I use my computer gadgets you see where on my computer in the screen-shot I posted a min ago, it says EN that means I put it in English mode. It's hard to type that way because say for example I'm using a German keyboard, and I'm typing in Russian the keyboard still has the normal characters not the Cyrillic ones. So I can still type in Russian using a normal U.S. keyboard, but the letters on the keyboard are English.. So most of the time, I just change different keyboard(s).

I have German keyboard, I speak English and German with that.
I have Russian keyboard, I speak Russian and English with that.
I have a Japanese keyboard, I speak Japanese and English with that.

Thus, I have same as you have, as you know.

View user profile http://gtamodding.com

Sponsored content


View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum