GTAMP.com

Grand Theft Auto Media Press
It is currently Mon Sep 25, 2017 10:03 am

All times are UTC




Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Thu Nov 10, 2011 10:03 pm 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1274
Location: GTAMP.com
Code:
[mis]DO_NOWT[/mis]

Syntax: [ Download ] [ Hide ]
Using GTA2 Script Syntax Highlighting
// MultiSlayer Cage by BenMillard

// Railway Stations
SET_STATION_INFO (trak00, 3, 0, 1) // 3 carriages, 1 box car


// Radio Stations
RADIO_STATION industrial = STATION_INDUSTRIAL (128.0,128.0)
RADIO_STATION residential = STATION_RESIDENTIAL (128.0,128.0)
RADIO_STATION downtown = STATION_DOWNTOWN (128.0,128.0)


// Weapons
GENERATOR health1 = (54.0,145.0,1.0) 0 collect_30 120 120


// Automatic rockets like PZA
COUNTER loop = 1


// Footballs
OBJ_DATA ball1 = (066.0,152.0,255.0) 0 FOOTY // new
OBJ_DATA ball2 = (064.0,148.8,255.0) 0 FOOTY
OBJ_DATA ball3 = (064.5,148.8,255.0) 0 FOOTY


// Towers
OBJ_DATA tower_12 = (059.8,149.2,255.0) 000 TOWER
OBJ_DATA tower_13 = (066.2,148.8,255.0) 000 TOWER
OBJ_DATA tower_14 = (072.2,148.8,255.0) 000 TOWER
OBJ_DATA tower_15 = (059.8,154.2,255.0) 000 TOWER
OBJ_DATA tower_16 = (072.2,154.8,255.0) 000 TOWER
OBJ_DATA tower_17 = (065.2,144.8,255.0) 000 TOWER


// Sounds
SOUND crane3 = (050.5,148.5,2.0) GENERATOR_RUMBLE PLAY_FOREVER
SOUND bugs8  = (036.5,147.0,3.0) CRICKETS         PLAY_FOREVER
SOUND bugs9  = (044.5,140.0,3.0) CRICKETS         PLAY_FOREVER
SOUND bugs10 = (045.5,148.5,5.0) CRICKETS         PLAY_FOREVER
SOUND bugs11 = (050.5,153.5,4.0) CRICKETS         PLAY_FOREVER
SOUND bugs12 = (047.5,159.5,3.0) CRICKETS         PLAY_FOREVER
SOUND bugs13 = (044.5,167.5,3.0) CRICKETS         PLAY_FOREVER
SOUND bugs14 = (076.0,154.5,2.0) CRICKETS         PLAY_FOREVER


// Normal Parked Vehicles:
PARKED_CAR_DATA firetruck1 = (061.0,144.5) -1 090 FIRETRUK // football


// Players:
// 2   3  
//    4 6
//  1   5
PLAYER_PED p1 = (53.7,147.7,1.0) 10 180 // Red
PLAYER_PED p2 = (52.3,142.3,1.0) 09 000 // Orange
PLAYER_PED p3 = (56.3,142.3,1.0) 07 315 // Yellow
PLAYER_PED p4 = (55.5,145.5,1.0) 11 270 // Green
PLAYER_PED p5 = (57.3,147.7,1.0) 13 270 // Dark Blue
PLAYER_PED p6 = (57.3,143.3,1.0) 08 315 // Black



LEVELSTART


// Environment
SET_AMBIENT_LEVEL  (0.33,0)
SET_SHADING_LEVEL (20)
SET_DIR_OF_TV_VANS (130.5,120.0)
DECLARE_POLICELEVEL (4) // SWAT


// Weapons
SWITCH_GENERATOR (health1, ON)


// Automatic Rockets
WHILE (loop=1)
 IF (CHECK_CHARACTER_HEALTH(p1, 0))
  GIVE_WEAPON (p1, ROCKET_LAUNCHER, 99)
 ENDIF
 
 IF (CHECK_CHARACTER_HEALTH(p2, 0))
  GIVE_WEAPON (p2, ROCKET_LAUNCHER, 99)
 ENDIF
 
 IF (CHECK_CHARACTER_HEALTH(p3, 0))
  GIVE_WEAPON (p3, ROCKET_LAUNCHER, 99)
 ENDIF
 
 IF (CHECK_CHARACTER_HEALTH(p4, 0))
  GIVE_WEAPON (p4, ROCKET_LAUNCHER, 99)
 ENDIF

 IF (CHECK_CHARACTER_HEALTH(p5, 0))
  GIVE_WEAPON (p5, ROCKET_LAUNCHER, 99)
 ENDIF
 
 IF (CHECK_CHARACTER_HEALTH(p6, 0))
  GIVE_WEAPON (p6, ROCKET_LAUNCHER, 99)
 ENDIF
ENDWHILE

LEVELEND
Parsed in 0.016 seconds, using GeSHi 1.0.8.10


Top
 Profile  
 
PostPosted: Fri Nov 18, 2011 5:56 pm 
Offline
User avatar

Joined: Wed Mar 17, 2010 4:07 am
Posts: 413
Location: Wales, UK
That looks really cool 8-)

_________________


Top
 Profile  
 
PostPosted: Fri Nov 18, 2011 5:59 pm 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1274
Location: GTAMP.com
Yes, I like it, T.M. did most of it. [syntax=mis] is a bit long. I'd prefer [mis] or even [code] with auto detection of language. I also want show/hide line numbers button.

I know the contracted size is too small and expand should only be displayed if the script is large but I haven't worked out how to fix that just yet.


Top
 Profile  
 
PostPosted: Fri Nov 18, 2011 6:07 pm 
Offline

Joined: Sat May 16, 2009 6:14 am
Posts: 886
Location: London, UK
Numbers with a leading zero are given a different colour. It probably thinks they are octal numbers, per convention. Should be able to set octal numbers to have the same colour as other numbers.

I sometimes give floats a leading zero to help alignment, so it won't just be integers that are affected. In particularly dense lists of coordinates, I've started to use a leading space instead of a leading zero.

_________________
GTA5 Race, DM & Capture | GTA2 Levels & Coding | GTA2 YouTube Videos
Gran Turismo 6 custom track club(Sign in with PSN details, then follow link again.)


Top
 Profile  
 
PostPosted: Fri Nov 18, 2011 6:20 pm 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1274
Location: GTAMP.com
Added this to mis.php:

Syntax: [ Download ] [ Hide ]
Using PHP Syntax Highlighting
'NUMBERS' => GESHI_NUMBER_INT_BASIC | GESHI_NUMBER_OCT_PREFIX | GESHI_NUMBER_FLT_SCI_ZERO,
Parsed in 0.029 seconds, using GeSHi 1.0.8.10

That fixed the numbers with leading zeroes.

Hide is pointless. "Using GTA2 Script Syntax Highlighting" isn't really needed or could just be reduced to "MIS" in the header. The word "Syntax:" needs to be removed from the header and the footer isn't needed either. The left margin could be reduced.


Top
 Profile  
 
 Post subject: Re: syntax highlighting
PostPosted: Sun Nov 20, 2011 12:59 am 
Offline

Joined: Sat May 16, 2009 6:14 am
Posts: 886
Location: London, UK
The .mis highlighter has one too many </div> tags at the end. That causes the message content container to be closed prematurely, so any subsequent text in that message is made tiny.

Not quite sure when it happens but here's an example. (I've seen it happen to TM as well...)

Syntax: [ Download ] [ Hide ]
Using C Syntax Highlighting
Example of C highlighting.
Parsed in 0.003 seconds, using GeSHi 1.0.8.10

This text is fine.

Syntax: [ Download ] [ Hide ]
Using GTA2 Script Syntax Highlighting
Example of .mis highlighting
Parsed in 0.008 seconds, using GeSHi 1.0.8.10

This text is small. (At least, it is in the example!)

Syntax: [ Download ] [ Hide ]
Using GTA2 Script Syntax Highlighting
Example of .mis highlighting
Parsed in 0.008 seconds, using GeSHi 1.0.8.10

Other syntax samples are fine, at least in the subsilver theme. Please don't call it syntax because I always, always typo it first time!

(EDIT) Oh, zomg, there's a <script> doing a document.write to add an extra </div> - that seems rather funky!

_________________
GTA5 Race, DM & Capture | GTA2 Levels & Coding | GTA2 YouTube Videos
Gran Turismo 6 custom track club(Sign in with PSN details, then follow link again.)


Last edited by BenMillard on Mon Nov 21, 2011 9:28 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Sun Nov 20, 2011 1:25 am 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1274
Location: GTAMP.com
Prosilver theme doesn't even have the expand/contract buttons and I update it much less often than Subsilver2. I've seen the small text bug on Prosilver. With Subsilver2, it looks ok in FF8 and IE8 but the code still needs fixing.


Top
 Profile  
 
PostPosted: Sun Nov 20, 2011 1:37 am 
Offline
User avatar

Joined: Wed Mar 17, 2010 4:07 am
Posts: 413
Location: Wales, UK
Yup, I'm using Prosilver and get the small text bug. It also puts the username below the signature. If you're seeing it too then I don't need to send you screenshot unless you want me to.

_________________


Top
 Profile  
 
 Post subject: Re: syntax highlighting
PostPosted: Sun Nov 20, 2011 2:03 pm 
Offline
User avatar

Joined: Fri Jan 29, 2010 3:00 pm
Posts: 945
Location: F21B3EED
BenMillard wrote:
Please don't call it syntax because I always, always typo it first time!
lol yeah, i typed [source] instead :-)

_________________
My GTA2 related projects:


Top
 Profile  
 
 Post subject: Re: syntax highlighting
PostPosted: Mon Nov 21, 2011 5:23 pm 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1274
Location: GTAMP.com
[mis] [cpp] [c] [vb] [php] and over 200 other language tags work. You can still use [syntax] if you are a masochist.

I added the Expand/Contract button to Prosilver theme. If you don't see it then try pushing ctrl+f5 to refresh browser cache.


Top
 Profile  
 
 Post subject: Re: syntax highlighting
PostPosted: Mon Nov 21, 2011 7:00 pm 
Offline
User avatar

Joined: Fri Jan 29, 2010 3:00 pm
Posts: 945
Location: F21B3EED
Sektor wrote:
[mis] [cpp] [c] [vb] [php] and over 200 other language tags work. You can still use [syntax] if you are a masochist.
I thought i told you [mis] tag was bugged, or did you fix that?

_________________
My GTA2 related projects:


Top
 Profile  
 
 Post subject: Re: syntax highlighting
PostPosted: Mon Nov 21, 2011 7:38 pm 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1274
Location: GTAMP.com
It's fixed now. I added it using the recommended way instead of thinking I could do it without RTFM.


Top
 Profile  
 
 Post subject: Re: syntax highlighting
PostPosted: Mon Nov 21, 2011 9:53 pm 
Offline
User avatar

Joined: Wed Mar 17, 2010 4:07 am
Posts: 413
Location: Wales, UK
Looks good now on Prosilver! 8-)

_________________


Top
 Profile  
 
 Post subject: Re: syntax highlighting
PostPosted: Tue Nov 22, 2011 3:50 pm 
Offline
User avatar

Joined: Fri Jan 29, 2010 3:00 pm
Posts: 945
Location: F21B3EED
Im not sure the gray for enums is so good, how about these colors? (changed functions to brighter red too)

Attachment:
syntaxcolors3.png
syntaxcolors3.png [ 9.51 KiB | Viewed 8972 times ]


I also noticed the enum list i made was bugged: some of them had space in the end! fixing it as soon as Sektor comes online.

I ALSO noticed that the syntax highlighter expand button doesnt come visible until the WHOLE page has been fully loaded! super annoying.

_________________
My GTA2 related projects:


Top
 Profile  
 
 Post subject: Re: syntax highlighting
PostPosted: Tue Nov 22, 2011 11:59 pm 
Offline
User avatar

Joined: Wed Mar 17, 2010 4:07 am
Posts: 413
Location: Wales, UK
Those colours are too bright, especially the bright orange which is even harder to read than the grey.

The dark-ish red on syntax highlighter is good as well as other dark-ish colours (blue, green), but I agree the grey could be a little darker. Maybe use purple in there somewhere?

_________________


Top
 Profile  
 
 Post subject: Re: syntax highlighting
PostPosted: Wed Nov 23, 2011 12:41 am 
Offline
User avatar

Joined: Fri Jan 29, 2010 3:00 pm
Posts: 945
Location: F21B3EED
I thought it would be too bright indeed... its just hard to please everyone on a white background based syntax colors.

I cant use purple or everything is so damn blueish there. i chose yellowish because that wasnt used yet.

Black is so much easier background for syntax colors :(

_________________
My GTA2 related projects:


Top
 Profile  
 
 Post subject: Re: syntax highlighting
PostPosted: Wed Nov 23, 2011 9:12 am 
Offline

Joined: Sat May 16, 2009 6:14 am
Posts: 886
Location: London, UK
Might I suggest the Mozilla style syntax colours, as applied for GTA2? Only 200 languages to go, after that! :D

Or just pick the "friendly colours" mode from Mis Pad. Everyone can cope with that.

Red in a code view only makes sense when that bit is an error.

Giving every slightly different thing a completely different, bright colour prevents anything from standing out. It's just noise. That defeats the whole purpose of having colours.

_________________
GTA5 Race, DM & Capture | GTA2 Levels & Coding | GTA2 YouTube Videos
Gran Turismo 6 custom track club(Sign in with PSN details, then follow link again.)


Top
 Profile  
 
 Post subject: Re: syntax highlighting
PostPosted: Wed Nov 23, 2011 9:19 am 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1274
Location: GTAMP.com
Some ADD_SCORE lines are missing ) on http://projectcerbera.com/gta/2/tutorials/multiplayer


Top
 Profile  
 
 Post subject: Re: syntax highlighting
PostPosted: Wed Nov 23, 2011 12:18 pm 
Offline
User avatar

Joined: Fri Jan 29, 2010 3:00 pm
Posts: 945
Location: F21B3EED
BenMillard wrote:
Giving every slightly different thing a completely different, bright colour prevents anything from standing out. It's just noise. That defeats the whole purpose of having colours.
What the hell? By looking at your syntax highlighter, it has everything you whined about here: red as a color and almost same amount of colors as ours have.

_________________
My GTA2 related projects:


Top
 Profile  
 
 Post subject: Re: syntax highlighting
PostPosted: Wed Nov 23, 2011 6:55 pm 
Offline

Joined: Sat May 16, 2009 6:14 am
Posts: 886
Location: London, UK
That's ironic, TM. :roll:

Sektor, CSS can fix long unwrappable lines of code in CSS layouts, such as ProSilver.
Code:
.content .syntax { /* ul_syntax_highlighter.css */
    background-color: #FFFFFF;
    border: 1px solid #D0D0D0;
    color: #444444;
    display: block;
    font-family: Courier,'Courier New',sans-serif;
    font-size: 1em;
    line-height: 1.2em;
    margin: 0;
    white-space: pre-wrap; /* new, supports old Firefox and anything better */
    word-wrap: break-word; /* new, supports IE6 and anything better */
}
I use this for HTML code samples, since URLs are sometimes unwrappable.

Sadly the SubSilver2 theme uses layout table. With a lot of changes you can make the table cells resize more predictably, somewhat like a CSS layout.
Code:
.tablebg { /* stylesheet.css, line 336 */
    background-color: #A9B8C2;
}
.tablebg table { /* new */
    table-layout: fixed; /* topic entry and that entry's content will size a bit more normally */
}
.tablebg td { /* new */
    width: auto; /* nuclear option!! */
}
.tablebg .row1 td + td,
.tablebg .row2 td + td { /* new, supports IE7 and anything better */
    width: 80%; /* 2nd column has <td width="100%"> which squashes 1st column in fixed layout mode */
}
.content .syntax { /* ul_syntax_highlighter.css */
    background-color: #FFFFFF;
    border: 1px solid #D0D0D0;
    color: #444444;
    display: block;
    font-family: Courier,'Courier New',sans-serif;
    font-size: 1em;
    line-height: 1.2em;
    margin: 0;
    white-space: pre-wrap; /* new, supports old Firefox and anything better */
    word-wrap: break-word; /* new, supports IE6 and anything better */
}
I mocked this up in Firebug so it might not actually work! This probably breaks compatibility with IE6. Editing the HTML would mean changing PHP which probably makes updating the forum impossible.

If you try this out, I might get a chance to debug it some more next week. Now I have to go wash those dirty layout tables off my hands.

_________________
GTA5 Race, DM & Capture | GTA2 Levels & Coding | GTA2 YouTube Videos
Gran Turismo 6 custom track club(Sign in with PSN details, then follow link again.)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group