Announcements

 Reply to this postStart new topic

Introducing [SANNY]

Deji
post Dec 28 2009, 01:55 AM
Post #1


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



I've added a new BB Code to GTAG that uses the formatting of Sanny Builder (a GTA Modding program used for scripting) to highlight code just like in the program.

This is useful for modders as it allows you to simply paste your code, add Sanny tags and it will appear like it does in Sanny, making it easier to read and prettier than if you were to use [ code ] tags.

I've added bold to keywords and coloured variables, some numbers, labels and strings as well as comments which makes the text blue and use italics.


There are a few bugs in this. Things will still turn their usual colour, even when commented out. Not all numbers will become brown... You can blame this on my limited PHP knowledge wink.gif And not all things go exactly the way Sanny does it. Sorry, but my PHP code is simply finding a certain thing and adding tags to it in order to give it it's looks... And there are restrictions on what I can do with this.


Example

typing...
CODE
[sanny]:DEBUGGR_RETBL
08DA: remove_panel 0@
// line comment
START {block
comment} END
08D4: 0@ = create_panel_with_title 'DBUGGER' position 29.0 170.0 width 180.0 columns 1 interactive 1 background 1 alignment 0
08DB: set_panel $1 column 0 header 'DEBUGR0' data 'DEBUGR1' 'DEBUGR2' 'DEBUGR3' 'DEBUGR4' 'DEBUGR5' 'DEBUGR6' 'DEBUGR7' 'DEBUGR8' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY'
while 0AB0:  key_pressed 0x5A
    wait 0
end
:2DEBUGGR_TBL
goto @2DEBUGGR_TBL
Player.Health(52)[/sanny]


will output...
SANNY
:DEBUGGR_RETBL
08DA: remove_panel 0@
// line comment
START {block
comment}
END
08D4: 0@ = create_panel_with_title 'DBUGGER' position 29.0 170.0 width 180.0 columns 1 interactive 1 background 1 alignment 0
08DB: set_panel $1 column 0 header 'DEBUGR0' data 'DEBUGR1' 'DEBUGR2' 'DEBUGR3' 'DEBUGR4' 'DEBUGR5' 'DEBUGR6' 'DEBUGR7' 'DEBUGR8' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY'
while 0AB0:  key_pressed 0x5A
    wait 0
end
:2DEBUGGR_TBL
goto @2DEBUGGR_TBL
Player.Health(52)



If you don't understand any of what is contained in this topic, don't worry. It's for people with knowledge in coding wink.gif


--------------------
Go to the top of the page
 
+Quote Post
Adler
post Dec 28 2009, 08:05 AM
Post #2


Devil's Advocate

Group Icon

Posts: 413
From: CA US
Joined: 26-July 09



Wow nice! This'll be useful for scripters of the III Era games. rolleyes.gif


--------------------
Go to the top of the page
 
+Quote Post
Deji
post Dec 28 2009, 01:30 PM
Post #3


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



Something I forgot to add was it's based on the San Andreas mode in Sanny, which I thought would be the best one to base it on as it has the most keywords etc.. So games released in the same "era" should be pretty much covered wink.gif


Bugs will be things like this:

SANNY
{ unfortunately, 0@ is not commented out}


--------------------
Go to the top of the page
 
+Quote Post
Spider-Vice
post Dec 29 2009, 04:55 PM
Post #4


In motus...

Group Icon

Posts: 361
From: Portugal
Joined: 28-May 09



tongue.gif Nice tag you made there Deji. tongue.gif Tho we test it for ages.
Go to the top of the page
 
+Quote Post
Reply to this postStart new topic

2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members: