Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
      4. Frontier Pursuits
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Diamond Casino & Resort
      2. DLC
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA IV Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA SA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA VC Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA III Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

Seemann

[REL] Sanny Builder

Recommended Posts

Seemann

 

I opened the b2r3 main.txt and added some things to it, because on my old scm i had some parked cars, i edited the cars and they were more economy and i changed the numbers in the code, then i added my parked cars and when i compile the file, the game crashes at the end of the loading..

 

How can i fix this?

 

10x.

Make sure you use the ini with which it was decompilled.

And make sure you start a new game.

Share this post


Link to post
Share on other sites
BMWPower

I started new game, but the main.txt is from tomworld10, so you mean that i should use his ini, right?

 

Thanks.

Share this post


Link to post
Share on other sites
Seemann

 

I started new game, but the main.txt is from tomworld10, so you mean that i should use his ini, right?

 

Thanks.

Yes. So, that is what tomworld10 said:

 

 

main.txt is the source file but is made for Sanny and uses Pynton sascm.ini (forget about that).

 

 

Browse this topic for the ini you need.

 

Share this post


Link to post
Share on other sites
BMWPower

@Seemann: thank you very much for helping me! colgate.gif

 

Greets, BMWPower! xmas.gif

Share this post


Link to post
Share on other sites
pdescobar

Noticed a problem with the MB -> SB syntax converter related to comments occurring immediately after local vars. Given the following MB statement:

 

0623: increase_stat  $STAT by  @3;; integer values

 

the converter changes that into:

 

0623: increase_stat  $STAT by  3//@ integer values

 

Note how the '@' variable identifier gets pushed behind the comment marker, turning the local var into an integer constant.

 

 

Also, is there any provision for user-defined constants similar to how C/C++ allows one to #define something? Given the small number of local variables allowed to threads, a constant identifier that gets compiled as a pre-defined integer or float could be helpful.

If there isn't anything already, maybe something like an extension of the current DEFINE statement such as:

 

DEFINE CONSTANT myConstant 5

 

Then wherever the parser finds "myConstant" after that (perhaps with some identifier prefix and/or suffix) it substitutes "5".

Share this post


Link to post
Share on other sites
Seemann

 

Noticed a problem with the MB -> SB syntax converter related to comments occurring immediately after local vars.

 

 

Fixed, thanks.

 

 

 

Also, is there any provision for user-defined constants similar to how C/C++ allows one to #define something?

 

 

No, from now it is impossible. The support of the constants was already requested by Y_Less and I promised him to make it in SB3.

Share this post


Link to post
Share on other sites
jarjar

Hey Seemann, quick question, will you be continuing in creating a Mission Builder for GTA4 when it is released? As without Barton Waterduck, we properly won't have one. I was going to learn some more about coding and write one myself, but I properly won't be able to. Sorry for the stupid question too, since the game still a year away, but I just wanted to ask anyway. tounge.gif.

Share this post


Link to post
Share on other sites
Seemann

 

Hey Seemann, quick question, will you be continuing in creating a Mission Builder for GTA4 when it is released? As without Barton Waterduck, we properly won't have one. I was going to learn some more about coding and write one myself, but I properly won't be able to. Sorry for the stupid question too, since the game still a year away, but I just wanted to ask anyway. tounge.gif.

It's really hard to answer you, because I do not know what will be in 1 year there. After HotCoffee and using of new engine, R* can make the game resourses inaccessible for the modding (like after "No more Hot Coffee" patch). So, when PS version will be released, we will see what we can do.

Share this post


Link to post
Share on other sites
jarjar
Hey Seemann, quick question, will you be continuing in creating a Mission Builder for GTA4 when it is released? As without Barton Waterduck, we properly won't have one. I was going to learn some more about coding and write one myself, but I properly won't be able to. Sorry for the stupid question too, since the game still a year away, but I just wanted to ask anyway. tounge.gif.

It's really hard to answer you, because I do not know what will be in 1 year there. After HotCoffee and using of new engine, R* can make the game resourses inaccessible for the modding (like after "No more Hot Coffee" patch). So, when PS version will be released, we will see what we can do.

Yep, thats a good answer, and to be honest what I expected, but I just wanted to check anyway icon14.gif.

 

Thanks for taking the time to answer me smile.gif.

Share this post


Link to post
Share on other sites
Bigun

 

Hey Seemann, quick question, will you be continuing in creating a Mission Builder for GTA4 when it is released? As without Barton Waterduck, we properly won't have one. I was going to learn some more about coding and write one myself, but I properly won't be able to. Sorry for the stupid question too, since the game still a year away, but I just wanted to ask anyway. tounge.gif.

It's really hard to answer you, because I do not know what will be in 1 year there. After HotCoffee and using of new engine, R* can make the game resourses inaccessible for the modding (like after "No more Hot Coffee" patch). So, when PS version will be released, we will see what we can do.

Yep, thats a good answer, and to be honest what I expected, but I just wanted to check anyway icon14.gif.

 

Thanks for taking the time to answer me smile.gif.

We don't even know if there will still be a SCM with the new engine and all. And as said even if there is, as said, R* may lock the files due to Hot Coffee. Some people say they might not even release it for PC but it's highly unlikely they will throw away all that money, and modding on consoles is possible as well.

Share this post


Link to post
Share on other sites
jarjar
Hey Seemann, quick question, will you be continuing in creating a Mission Builder for GTA4 when it is released? As without Barton Waterduck, we properly won't have one. I was going to learn some more about coding and write one myself, but I properly won't be able to. Sorry for the stupid question too, since the game still a year away, but I just wanted to ask anyway. tounge.gif.

It's really hard to answer you, because I do not know what will be in 1 year there. After HotCoffee and using of new engine, R* can make the game resourses inaccessible for the modding (like after "No more Hot Coffee" patch). So, when PS version will be released, we will see what we can do.

Yep, thats a good answer, and to be honest what I expected, but I just wanted to check anyway icon14.gif.

 

Thanks for taking the time to answer me smile.gif.

We don't even know if there will still be a SCM with the new engine and all. And as said even if there is, as said, R* may lock the files due to Hot Coffee. Some people say they might not even release it for PC but it's highly unlikely they will throw away all that money, and modding on consoles is possible as well.

I'm aware of that Bigun, I was simple asking because I wanted to find out if we would be having any kind of Mission Builder for GTA4 if we are able to mod. For god sakes, I know about the new engine mate. And I bet there will be things changed and new file formats, but we've done it once before with GTA3, and we'll do it again, there's a lot of smart modders out there, who will crack the way to mod no matter what icon14.gif.

 

But yes, in generally, I was just asking a simple question, whether GTA4 is moddable or not is currently irrelevant.

Share this post


Link to post
Share on other sites
steve-m

The scm scripting system has been developed in-house by R*, and it was extended heavily for SA. I guess they're quite happy with it, and it's not unlikely they'll use it for their new game engine as well.

 

Speaking of which, does anyone have that Tabletennis game and can take a look at the files?

Share this post


Link to post
Share on other sites
jarjar
The scm scripting system has been developed in-house by R*, and it was extended heavily for SA. I guess they're quite happy with it, and it's not unlikely they'll use it for their new game engine as well.

 

Speaking of which, does anyone have that Tabletennis game and can take a look at the files?

Really, I didn't realise that Rockstar created it themselves, I thought it used due to the Game Engine they are currently using. But if they created it themselves in-house, and as you said, looking at how much it was extended in San Andreas, then there's no doubt they will use the scm format again.

 

Sadly no, but now I think I might buy it actually, it looks like a good game and it could give us a good insight into how the new engine works. icon14.gif.

Share this post


Link to post
Share on other sites
Bigun

Well of course they created it... How else would you explain that all the opcodes are "GTA-like"? It was pretty obviously created by R*. But RAGE is created by them too, and they might as well use a different system instead of SCM. They upgraded the SCM for VC as well for SA, it doesn't guarantee anything. But this isn't the right topic for discussing this (actually there's nothing to discuss, we won't know until GTA4 is released).

Share this post


Link to post
Share on other sites
steve-m

@jarjar: Well, it's part of the game engine. What you probably mean is the graphics engine (Renderware Graphics), which they licensed for the GTA3 trilogy on PS2/XBOX/PC.

 

@Bigun: No, that's not obvious. They could as well have used a third-party scripting engine, like the famous Lua that many games use. Such engines are just a framework, consisting of a pre-designed programming language and interpreters/compilers - the actual (game-specific) functions are always added by the developers. But then there'd surely be no need for community-made custom compilers like this one.

Share this post


Link to post
Share on other sites
tupac_sad

Keep it in your own topic, kthnx.

Edited by DexX

Share this post


Link to post
Share on other sites
Seemann

Sanny Builder v2.99 build 449

 

http://sannybuilder.com/downloads

 

This version includes:

* new version of Sanny Builder

* Xieon’s SA Memory Patch v1.0

* Source Converter v1.0

* All GTA’s GXT Texts

* 4 languages pack

 

Sanny Builder version changes:

 

Major changes:

- added new commands WriteMem and ReadMem (2.6)

- support of the hexadimal numbers (2.2)

- HEX..END statement can accept the labels and the global variables (2.9)

- full support of &-datatype (ADMA)

- opportunity to give the custom names to the labels (3.13)

- opportunity to choose a different case for the custom names and the strings (Options-> Format)

- added the console in order to switch the special options of SB (3.14)

- decompiler supports the GXT-files of GTA III & GTA VC

- added special symbol constants in the long strings (2.2)

 

Minor changes:

- information about an INI file (version, author, date)

- classes support an original order of the parameters (like in SASCM.INI from PLPython). In order to support such order there should be a line {$VERSION x.0.xxxx}, see comments in the INI about this.

- added option to confirm the exit

- quick switching of the Edit Mode (3.11)

- converting of the selected piece of code

- opportunity to pass the current file name to the external tool (3.12)

- corrected some mistakes in the configuration files

- removed auto-casting of an integer number to a float one when the variable was declared as Float. Now the compiler chooses an opcode depending on the number type only (in math expressions without opcodes)

- reading/writing of the player’s z_angle in Coord Manager; quick insertion of this one in a script by pressing Ctrl+Shift+E (for SA)

 

Other notes:

(!) The following opcodes were changed in SASCM.INI: 0181, 00c3, 00c4 in order to support the commands WriteMem and ReadMem. In original files these opcodes are not used and the game are not supported them, so there should be no problem.

 

(!) The class member Car.SetSpeedInstantly was named incorrectly (with wrong opcode) in the file classes.db for SA. If you will get the error message about this method at compilation, rename it in Actor.DrivingPlane manually. We apologize.

 

 

 

Share this post


Link to post
Share on other sites
pdescobar

OK, I started moving over to the new version today. Already I love the ability to use hex number constants (e.g. 0x100); that's really helpful when messing around with memory-hacking. I have a few suggestions/corrections mostly related to documentation.

 

A bit of the English readme didn't get translated. In section 2.9 it says the following:

 

:get_offset

hex

  04 00 02 $PLAYER_CHAR 01 @get_offset

end

 

Ýòî áóäåò òîæå ñàìîå, ÷òî 0004: $PLAYER_CHAR = @get_offset

Should that say "It will be compiled as 0004:..." as in the previous example?

 

The file CustomLabels.ini looks to be tailored to the unmodified SA version 1. To have a CustomLabels.ini for the unmodified SA version 2 scripts, some location adjustments need to be made. All the MAIN labels should be 21 less, the 3 (commented out) "sub-mission" labels inside Mission 11 should be all 1 less, and the final JFUD_Remove_Food label inside External Script 65 should be at 3487960. Also, the label MS_Game_Dualuty should be spelled MS_Game_Duality. I can upload a version with the changes if you wish.

 

In the SASCM.ini, opcode 080B looks like this:

080B,1,nop_consume_string %1d% 

It's a NOP so it may not matter, but that syntax is different from everything else in the file and should probably be changed to

080B=1,nop_consume_string %1d% 

(note the equals sign after the opcode number instead of a comma).

 

In the SASCM.ini comments, you have "like Python's one" and in the readme you have "from PLPython"; the same is true for the link to his site. Please note that his username is spelled "PLPynton". wink.gif

 

The SA GXT string file is missing somewhere between 2000 and 2500 entries. For example, the key '10_R_20' with value '~z~10 or 20' isn't listed. If you'd like, I can translate the reference I use to that format, although the sorting may be a little different. (I use an american.txt generated by Hammer83's GXT editor using a custom INI containing readable key names for everything.)

Share this post


Link to post
Share on other sites
PLPynton

Are you going to implement for arrays: arrays number as index?

i.e. v$MyAnim(144) ...

 

because it looks like that for now, after i decompile:

 

SB:

05A9: s$6503 = 'INT2_CA' // 8-byte strings // ~z~Hey, Old Reece still run the barber shop?

05A9: s$6505 = 'INT2_CB' // 8-byte strings // ~z~Like a raggedy-assed motherf*cker!

MB:

05A9: s$6503 = 'INT2_CA' ;; 8-byte global strings ; (text not found)

05A9: s$6503(1) = 'INT2_CB' ;; 8-byte global strings ; (text not found)

 

well, MB was decompiling fixed length string variable arrays with numerical index incorrectly (16 bytes as 4 byte) but SB does decompile them as simple variables and that is not right do not you agree.

Share this post


Link to post
Share on other sites
Y_Less

For someone who is trying to be a stcikler for doing things exactly as R* did I would have thought you would prefer that. MB makes up arrays based on the variables.ini file, SB decompiles them correctly as they are in the file.

Share this post


Link to post
Share on other sites
PLPynton

yes, that is some point actually. anyway i have found copying parts of code from one script to another quite unuserfriendly, it is because of fact that it can happen, that you have to paste in an array of 100 or more fixed lenght strings. in such a case you have to rewrite them all, all over again or define index with variable each time to define its value and that is consuming.

necessity of having to look manually where each array starts and where it ends makes some pain and looking for all its components around the code is hell of a job, it would be nice to have it you know. at least i think so.

besides the variables.ini has nothing to arrays except the custom name for globals. MB has investigated the effective range of i.e global array and indexing or naming correctly its components so there is no problem in further process of identifying "where belongs this global now..."

Edited by PLPynton

Share this post


Link to post
Share on other sites
pdescobar

Sanny 2.99 default CustomVariables.ini has duplicate entries (74 & 75):

 

73=tempvar_Float_174=tempvar_Float_275=tempvar_Float_2

 

Given the context, I assume it's a typo and that the alias for 75 should be tempvar_Float_3.

 

Also for 2.99, when the opcode search tool window is up, some of the function keys don't work properly and they appear to be intercepted by the main program. For example, F5 is supposed to "put the cursor to the search edit" but instead opens up the open dialog as if you had chosen the Decompile command from the Run menu (also F5) and F6 is supposed to "put the cursor to the list" but instead runs a compile. Those function keys which do not have analogues in the main program (like F11 and F12) do work properly. One time I did manage to do something to have F5 and F6 work properly, but the rest of the time I see the buggy behaviour described above. I'm running XP Professional SP2 for what it's worth

 

Share this post


Link to post
Share on other sites
Y_Less

PLP if you use the special array definition you can use C style arrays:

 

$array[4] = 67

 

with no problem. Can't remember the exact code to define an array but it's in the readme.

Share this post


Link to post
Share on other sites
Seemann

 

I can upload a version with the changes if you wish.

 

OK, if you can, why not? smile.gif I need for the help everytime. I think it will not be a problem if you ADD new offsets to that file without removing of already existing entries. E.g.

 

3495695=JFUD_Remove_Food; for v1.03487960=JFUD_Remove_Food; for v1.1

 

if there is no another label with such offset.

 

 

Should that say "It will be compiled as 0004:..." as in the previous example?

 

Yeah, I missed this.

 

 

It's a NOP so it may not matter, but that syntax is different from everything else in the file and should probably be changed to

 

Looks like you used the Source Converter that is able to find such typos. As for SB it doesn't matter what kind of a separator is used, but OK, it's need to be changed.

 

 

If you'd like, I can translate the reference I use to that format, although the sorting may be a little different.

 

This file was completed by tomworld10, I have just uploaded it with SB. It seems, you can add the missing entries? If so, it will be great, because I know that there are should be about 17.000 entries.

 

 

when the opcode search tool window is up, some of the function keys don't work properly and they appear to be intercepted by the main program

 

Yeah, it's a serious bug. I'll try to fix.

 

 

Are you going to implement for arrays: arrays number as index?

 

Yes. The new compiler (SB3) will be able to parse such arrays (I hope smile.gif). Not only numbers, but also the expressions as the indexes, too

 

$array[$var+1] = 0

 

 

But I still can not to continue my work on this, because of tons of little bugs in the current versions (like typos in the config files). And now, I should publish the update for v2.99 to fix already posted ones.

 

 

Can't remember the exact code to define an array but it's in the readme

 

 

var$array: array 10 of intend$array[$index] = 67

 

But the number constants (like in your example) are not supported.

 

Share this post


Link to post
Share on other sites
pdescobar

 

Looks like you used the Source Converter that is able to find such typos. As for SB it doesn't matter what kind of a separator is used, but OK, it's need to be changed.

Not exactly the source converter, but a somewhat similar script I wrote to do some INI comparisons.

 

 

If you'd like, I can translate the reference I use to that format, although the sorting may be a little different.

 

This file was completed by tomworld10, I have just uploaded it with SB. It seems, you can add the missing entries? If so, it will be great, because I know that there are should be about 17.000 entries.

OK, here is an archive containing the v2 customlabels.ini, and 2 versions of the complete SA gxt strings; the one called GTASAtext_byTable.txt is divided into a section for each table and the one called GTASAtext_combined.txt has all the entries from all the tables grouped together like the version you had before. Feel free to distribute any of them. http://pdescobar.home.comcast.net/tmp/GXT_Strings.rar

Share this post


Link to post
Share on other sites
Bigun

Can you add optional extra notation for labels instead of @, which is same for local vars therefore a bit harder to distuinguish, especially for those used to SAMB. You can decide whatever char you want, I know you already have a few more datatypes than SAMB so I dunno what chars are "free". But please make the local-global labels specifying same as SA-MB for that char (I know its autodetermined with @): if its one of that char, local label. If it's two times of that char, global. This also solves Demarest's suggestion of that. In case these are free, choose one (in order of priority but of course choosing is up to you):

 

 \ (comments are // only, right? so no problem) , | , > , ^ , < )

 

 

Also remembering comments. Dunno if that's implemented yet so sorry if it is, I saw some multi-line comments with // at each line in someones code. So how about easy true multiline comments with beginning and ends, like this ( using /* and */ )

 

:PsuedoLabel0001: wait  1000 ms00D6: if  and0256:   player $PLAYER_CHAR defined/*Comment bla bla bla blaComment bla bla bla bla Comment bla bla bla blaComment bla bla bla bla Comment bla bla bla blaComment bla bla bla bla Comment bla bla bla bla*/004D: jump_if_false ££PsuedoLabel

 

 

Thanks. smile.gif

Share this post


Link to post
Share on other sites
Seemann

@Bigun

 

 

But please make the local-global labels specifying same as SA-MB for that char (I know its autodetermined with @): if its one of that char, local label

 

This was discussed already. I did not get any examples when it is REALLY necessary. The compiler choose what the offset should be written for a label based on where it is placed in a code. If a label is in the MAIN part of a code it's compiled as a GLOBAL label (with a positive offset), if a label is within a mission or a script it's compiled as a LOCAL one (with a negative offset). As all the threads are placed in the MAIN all create_threads (even in a mission) have global offsets. And once more, I have no example when you really need to distinguish between global and local label MANUALLY (specified it by using @ or @@). All the GTA compilers

except SAMB use the only data type for the labels.

 

As for local variables I'm not going to change any data types. I don't think that implementing ! for the locals (1!, 2!) could be more useful (the same goes for !label).

 

 

Dunno if that's implemented yet so sorry if it is, I saw some multi-line comments with // at each line in someones code.

 

Yes, it's implemented. Read section 3.13 in the Readme. I use { } to comment out multiple lines (or a part of a line)

 

 

@Seemann: Can you also add more advanced pre-proccessor functions? Like something as this:

 

#IF COMPILER_VERSION 

 

 

Note: #CRASH/ERROR directive cancels compiling and displays the msg after it in an error box. It doesnt crash the program. 

Also you should have a function that "hardcodedly" auto-checks mempatch installation for mods that REQUIRE it (this menu spawner doesnt) as an easy "one-line" check for the compiler, as this (also another function and syntax for CRASH, the one above should still be accepted) directive:

 

 

  #IF MEMPATCH_INSTALLED != 1#CRASH("The compiler didn't detect the SA Memory Patch!",ASK=1)#ENDIF

 

 

If SB didn't detect the mempatch installed, it will pause compiling and display an alert box with the text "The compiler didn't detect the SA Memory Patch!", and under it "Do you want to continue?" with Yes and No buttons which obviously decide if the compilation will halt or not. Note that you might as well have this check hardcoded into SB if mempatch not detected and it's opcodes are used.

 

In addition to COMPILER_VERSION and MEMPATCH_INSTALLED, how about these constants as well: GAME_VERSION, "SA","VC,"GTA3") INI_VERSION (as you supported extra info in INIs), INI_AUTHOR. They'd be useful as well.

 

And these extra preproccessor commands too:

 

#ELSE(IF_FALSE) (used after #IF and before #ENDIF)#IDE c:\mods\modded_vehicles.ide (used only on top of file OR pretty much anywhere...can be used to load custom IDEs for this file. they will be used in addition with orig one to replace model names),#UNLOAD_ORIG_IDE (will make SB only use custom ides loaded with previous directive),#DEFINE Name value (to make custom constants for use with other preproccessor commands AND are replaced in code itself with associated value(I think the last bit was requested already)),#COMPILE (used to conditionally compile code. used between #IF and #ENDIF. normal SCM SB code goes after this and ends with #ENDCOMPILE. That code is only compiled if the #IF was true and otherwise SB skips it). 

 

Note: Yes, this IS "stolen" from other programming langs. Some are my ideas though.

 

I hope all of this can be done, it can get very useful.

 

I answer you here.

First of all, I can not make the directives in C-like style (beginning with #), because this sign (#) has been used as a model for years. So, I can only use Delphi-like style {$DEFINE} (although it's ugly for me).

 

#IDE is a very interesting directive, I like the idea. Could not understand the meaning of #COMPILE. If the compiler pass #IF directive it will continue to compile the code within #IF..#ENDIF itself, without special directives.

 

 

Share this post


Link to post
Share on other sites
Bigun

 

This was discussed already. I did not get any examples when it is REALLY necessary. The compiler choose what the offset should be written for a label based on where it is placed in a code. If a label is in the MAIN part of a code it's compiled as a GLOBAL label (with a positive offset), if a label is within a mission or a script it's compiled as a LOCAL one (with a negative offset). As all the threads are placed in the MAIN all create_threads (even in a mission) have global offsets. And once more, I have no example when you really need to distinguish between global and local label MANUALLY (specified it by using @ or @@). All the GTA compilers

except SAMB use the only data type for the labels.

 

As for local variables I'm not going to change any data types. I don't think that implementing ! for the locals (1!, 2!) could be more useful (the same goes for !label).

 

I know all that. My request wasn't to change an existing data type, just to provide an extra one (normal one is still recongnized) for people who want it; I didn't suggest changing the LOCAL datatype, leaving just one as [email protected] is ok, I can live with it easily. It was like that in some older VC MBs as well. Actually my suggestion isn't mainly to make getting used to SB easier, I just think different datatypes should have different signs to make them easier to grasp when quickly skimming down a code. So my suggestion was to ONLY provide an extra notation for labels, like \Label for local jumps or \\Label for global. Old @ is still recongized, so this is just an extra one. I don't see any damage done from adding that, and actually TBH I see no advantage of manually specifying jump modes myself, but the user SHOULD be able to in case it has to be used. Sure, currently theres NO reason to use it, but you see how stuff go quite fast in this community. You saw stuff Dem released with savegame compabillity involving byte counting and the like, you've seen (and probably helped create one too) memory accessing threw SCM. So if maybe now it seems useless, it may be useful in the future. And by adding that function in a NEW datatype (\ or \\) I think everyone will be satisfied.

 

 

First of all, I can not make the directives in C-like style (beginning with #), because this sign (#) has been used as a model for years. So, I can only use Delphi-like style {$DEFINE} (although it's ugly for me).

 

Why not? I DID think of that when posting. And uh, so what, $ is used for global vars for years? lol. What I thought when posting is that it's going to be REALLY easy for the compiler to distingiush between #WORD as model ID or preproccessor command. Preproccessor commands have these special qualities:

1. No opcode number for their lines (wont help much tho since in SB thankfully you dont always have to specify opcode num).

2. The whole line begins with "#". There may be an opcode or two found using models as first parameter, but there should be the text description before that, too.

3. The string following # SHOULDN'T be found in any IDE. Of course, IDEs can be modded, but I dont see people naming their cars 'if','crash' etc, lol.

 

Although ugly-or-not, as long as you can implement it it shouldn't matter. Thanks for considering it.

 

 

#IDE is a very interesting directive, I like the idea. Could not understand the meaning of #COMPILE. If the compiler pass #IF directive it will continue to compile the code within #IF..#ENDIF itself, without special directives.

 

Oh, alright then, that possibillity happened to slip past me. icon14.gif

Share this post


Link to post
Share on other sites
Seemann

@Bigun

 

 

So if maybe now it seems useless, it may be useful in the future.

 

Maybe you right, maybe sometime such ability will be necessary. If it will happen I make this.

 

Currently, in order to find out the global/local offset of a local/global label (and jump to it using such offset) it's possible to use something like this

 

 

//-------------MAIN---------------:[email protected] = @MISSION_START // get the global mission [email protected] -= @local_2_global  // now [email protected] keeps the GLOBAL offset of the LOCAL labeljump [email protected] // jump to the label with global offset:[email protected] = @MAIN_START // get the MAIN start [email protected] -= @global_2_local // now [email protected] keeps the LOCAL offset of the GLOBAL labeljump [email protected] // jump to the label with local offset end_thread                //-------------Mission 0---------------// Test mission:MISSION_STARTwait 250:local_2_globalend_thread

 

 

 

Why not? I DID think of that when posting. And uh, so what, $ is used for global vars for years?

 

It is not $__, but {$__} (note: it is within the brackets).

I know that to make the compiler detect if there is a directive name goes after # is very easy (just compare its name with all existing directives names listing somewhere in a file). But even so there are some problems.

 

One of them is how to highlight them: as a model or a directive (it will be necessary add extra routines to the highlighter), second: if there will be a modded model named the same as one of the directive (not sure if it's possible but..).

Also, you said it's a bit harder to distinguish between local vars and label because of the same data char. If the same char will be for models and directives (#), I think it became even more harder to understand.

 

That's why I want to implement different data type for directives.

 

The alternate way: change the model char to another (maybe gtama-like: %), and set directives sign to # without any problems smile.gif

 

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.