PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Resource Error.  (Read 548 times)

Tyrone Lee

  • Guest
Resource Error.
« on: January 12, 2008, 12:12:56 PM »

I am converting my PB projects to use the FireFly IDE. I continue to get these weird resource errors when embedding simple text files as a resource. These textfiles are the "CONTROL" scripts for my game graphics engine. They enable the game engine to create textboxes and listbox controls that overlay your game. Its simple text, but the resource compile continues to crash.

When I use the standard PB compilers it works perfectly.

Code: [Select]
SetVal {TB_NAME$, NAME$}
SetVal {TB_PARENT$, PARENT$}
SetVal {TB_CAPTION$, CAPTION$}
SetVal {TB_ENABLED$, ENABLED$}
SetVal {TB_COLOR$, COLOR$}
SetVal {TB_FONT$, FONT$}
SetVal {TB_RESIZE$, RESIZE$}
SetVal {TB_LAYER%, LAYER%}
SetVal {TB_STYLE(0-7)%, STYLE%}
SetVal {TB_WORDWRAP$, WORDWRAP$}
SetVal {TB_VRESIZE$, VRESIZE$}
SetVal {TB_LEFT%, LEFT%}
SetVal {TB_TOP%, TOP%}
SetVal {TB_WIDTH%, WIDTH%}
SetVal {TB_HEIGHT%, HEIGHT%}
SetVal {TB_DRAG$, DRAG$}
SetVal {TB_BLT$, BLT$}

BEGIN:#TB_NAME$#
    TYPE = TEXT
    PARENT = #TB_PARENT$#
    POS = #TB_LEFT%#, #TB_TOP%#
    SIZE = #TB_WIDTH%#,#TB_HEIGHT%#
    BLT = #TB_BLT$#
    LAYER = #TB_LAYER%#

    CANDRAG = #TB_DRAG$#
    CANEDIT = TRUE
    TEXTWRAP = #TB_WORDWRAP$#, #TB_VRESIZE$#

    IMAGE = border#TB_STYLE(0-7)%#.res
    If {TB_STYLE(0-7)% > 0}
        BORDER = TRUE, 10
    EndIf:{TB_STYLE(0-7)% > 0}

    ENABLED = #TB_ENABLED$#
    EVENTS = TRUE
    CAPTION = #TB_CAPTION$#

    FONT = #TB_FONT$#
    FONTCOLOR = #TB_COLOR$#
    TEXTPOS = 1, 1

EVENTS:BEGIN
On_Change:
    SetVal {#TB_NAME$#.TEXT$, EMT_CAPTION$}
EndEnc
EVENTS:END
END:#TB_NAME$#

DelVarsLike {TB_}
DelVarsLike {CSYS_}

This is the EXACT resource that fails in FireFly. I don't know why it would fail, its only TEXT. When I add the resource I added this line.

TEXTBOX.OBJ RCDATA "G:\Development\PROJECTS\Driver\Includes\RESOURCES\TEXTBOX.MOTION"


I have tons of the .MOTION files used for dialogs, listboxes, and all the normal GUI objects you'd find in a game, but there are about 10 of them that fail. This is a sample of one of them. Any idea?

Tye
Logged

Tyrone Lee

  • Guest
Re: Resource Error.
« Reply #1 on: January 12, 2008, 12:22:38 PM »

OK... I figured it out..

TEXTBOX.OBJ RCDATA "G:\Development\PROJECTS\Driver\Includes\RESOURCES\CTRL_TEXTBOX.MOTION"

The above line will work.. Apparently, "TEXTBOX" is a reserved word within the file path?!? I don't know why this line will work, but it does. And it makes me think that there is a small bug with the parser. :(

I have renamed all of my resource files to contain a prefix to keep them from bumping into any system files or reserved words. (ie CTRL_{resource}, or FNT_{font file})

Tye
« Last Edit: January 12, 2008, 12:33:50 PM by Tyrone Lee »
Logged