Results 1 to 5 of 5

Thread: DizzyAGE Code Highlighter

  1. #1
    Team Yolkfolk Peter's Avatar
    Join Date
    Jan 2007
    Location
    Brean, Somerset
    Posts
    735

    Arrow DizzyAGE Code Highlighter



    A nice new feature for this forum is the DizzyAGE code highlighter

    to use you need to use the following bbcode [highlight="dizzyage"] code [/highlight]

    example:

    [highlight="dizzyage"]
    func ShowScroll ( id )
    {
    // Set the ids for the objects
    idxtop = ObjFind( id );
    idxbot = ObjFind( id+1 );

    // if any of the ids can't be found then exit the function
    if( idxtop==-1 || idxbot==-1 ) return;

    // Pause the game
    GamePause(1);

    // set the scrolls to their closed state
    oy = ObjGet(idxtop,O_Y);
    ObjSet(idxtop,O_H,8);
    ObjSet(idxbot,O_Y,oy+8);

    // enable the scrolls now they are in the closed state
    ObjSet(idxtop, O_DISABLE, 0);
    ObjSet(idxbot, O_DISABLE, 0);

    // Get the variables from the objects
    // y = the y position on the map for the top of the scroll
    // h = current height of the scroll
    // boxh = the full height of the scroll
    y = ObjGet(idxtop,O_Y);
    h = ObjGet(idxtop,O_H);
    boxh = ObjGet(idxtop,O_SCROLLH);

    while(h != boxh)
    {
    // Open the scroll
    h+=2;
    if (h >= boxh) h=boxh;
    WaitFrames(3);
    // Update the height of the scroll top and bottom
    ObjSet(idxtop,O_H,h);
    ObjSet(idxbot,O_Y,y+h);

    if(h==boxh) break;
    }

    // Wait for the user to press the action key to continue
    DialogRun();

    // Disable the Scroll
    ObjSet(idxtop, O_DISABLE, 1);
    ObjSet(idxbot, O_DISABLE, 1);

    // Unpause the game
    GamePause(0);
    }
    [/highlight]


    Which would output as below....

    [highlight="dizzyage"]
    func ShowScroll ( id )
    {
    // Set the ids for the objects
    idxtop = ObjFind( id );
    idxbot = ObjFind( id+1 );

    // if any of the ids can't be found then exit the function
    if( idxtop==-1 || idxbot==-1 ) return;

    // Pause the game
    GamePause(1);

    // set the scrolls to their closed state
    oy = ObjGet(idxtop,O_Y);
    ObjSet(idxtop,O_H,8);
    ObjSet(idxbot,O_Y,oy+8);

    // enable the scrolls now they are in the closed state
    ObjSet(idxtop, O_DISABLE, 0);
    ObjSet(idxbot, O_DISABLE, 0);

    // Get the variables from the objects
    // y = the y position on the map for the top of the scroll
    // h = current height of the scroll
    // boxh = the full height of the scroll
    y = ObjGet(idxtop,O_Y);
    h = ObjGet(idxtop,O_H);
    boxh = ObjGet(idxtop,O_SCROLLH);

    while(h != boxh)
    {
    // Open the scroll
    h+=2;
    if (h >= boxh) h=boxh;
    WaitFrames(3);
    // Update the height of the scroll top and bottom
    ObjSet(idxtop,O_H,h);
    ObjSet(idxbot,O_Y,y+h);

    if(h==boxh) break;
    }

    // Wait for the user to press the action key to continue
    DialogRun();

    // Disable the Scroll
    ObjSet(idxtop, O_DISABLE, 1);
    ObjSet(idxbot, O_DISABLE, 1);

    // Unpause the game
    GamePause(0);
    }
    [/highlight]

    I case your wondering this is the script that shows the message scroll in my Treasure Island Remake
    Last edited by Peter; 17-01-07 at 05:43 AM. Reason: update content

  2. #2
    Your Backpack is Empty
    Join Date
    Aug 2008
    Posts
    17

    Default

    hi, this looks great! i was also looking for a wordfile to use with a text editor for the same purpose. i saw some ultraedit screenshots on the dizzyage site that had code highlighting, should i ask alex about the wordfile? do you have one as well? thank you!

  3. #3
    Hard Boiled Egg delta's Avatar
    Join Date
    Feb 2007
    Location
    North West
    Posts
    4,005

    Default

    the GS9 language is fairly close to PHP, so maybe a program intended for PHP would work? i'm not sure, i just use notepad





    "Quotes from the internet may not be genuine" - Abraham Lincoln

  4. #4
    Your Backpack is Empty
    Join Date
    Aug 2008
    Posts
    17

    Default

    i noticed that using a C++ configuration for highlighting works fairly well, but i wanted everything specific to GS9. of course, this won't help me understand & learn GS9 faster, i'm just procrastinating

  5. #5
    Hard Boiled Egg NigeC's Avatar
    Join Date
    Nov 2007
    Location
    Co Durham.UK
    Posts
    114

    Default

    I think with SciTE you can define GS9 specific commands, I've seen it done with another game engine.. can't recall which one.. could of been Scream

    its the editor I use anyway
    NigeC Studios
    Also available on Deviant Art for 3D stuff I've done lately

Similar Threads

  1. DizzyAGE News
    By xelanoimis in forum DizzyAGE Help
    Replies: 160
    Last Post: 27-04-10, 09:24 PM
  2. ConTEXT DizzyAGE Highlighter
    By Peter in forum DizzyAGE Help
    Replies: 2
    Last Post: 06-01-10, 02:22 PM
  3. DizzyAGE Easter Competition 2008 [ENDED]
    By xelanoimis in forum Fan Games
    Replies: 185
    Last Post: 23-08-08, 02:01 PM
  4. DizzyAGE games distribution format
    By xelanoimis in forum DizzyAGE Help
    Replies: 18
    Last Post: 30-07-08, 08:47 PM
  5. Warning for all DizzyAGE games
    By xelanoimis in forum DizzyAGE Help
    Replies: 3
    Last Post: 08-05-08, 08:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •