Blockland Forums > Modification Help

[Tutorial] Creating A GUI [Updated 4/1/2012]

Pages: << < (10/12) > >>

jes00:


--- Quote from: deathrider on April 05, 2012, 01:00:15 AM ---i made one cant get it to open in game but i can assign a button to it heres client.cs


--- Code: ---exec("./Test.gui");

    $remapDivision[$remapCount] = "Custom made GUI's";
    $remapName[$remapCount] = "Test GUI";
    $remapCmd[$remapCount] = "Open_Test";
    $remapCount++;

function TestButtonPush()
{
talk(hi);
}
--- End code ---

--- End quote ---
Don't forget to create the function to open it.

--- Code: ---function Open_Test(%toggle)
{
if(%toggle)
{
if(YOURGUINAMEGui.isAwake())
{
canvas.popDialog(YOURGUINAMEGui);
}

else
{
canvas.pushDialog(YOURGUINAMEGui);
}
}
}

--- End code ---


deathrider:


--- Quote from: deathrider on April 05, 2012, 01:00:15 AM ---i made one cant get it to open in game but i can assign a button to it heres client.cs


--- Code: ---exec("./Test.gui");

    $remapDivision[$remapCount] = "Custom made GUI's";
    $remapName[$remapCount] = "Test GUI";
    $remapCmd[$remapCount] = "Open_Test";
    $remapCount++;

function TestButtonPush()
{
talk(hi);
}
--- End code ---

--- End quote ---

--- Quote from: jes00 on April 05, 2012, 06:43:26 AM ---Don't forget to create the function to open it.

--- Code: ---function Open_Test(%toggle)
{
if(%toggle)
{
if(YOURGUINAMEGui.isAwake())
{
canvas.popDialog(YOURGUINAMEGui);
}

else
{
canvas.pushDialog(YOURGUINAMEGui);
}
}
}

--- End code ---

--- End quote ---

ok ill add that

edit i get this from console

--- Code: ---Client checking Add-On: Client_Test
Loading Add-On: Client_Test (CRC:-1853063057)
Executing Add-Ons/Client_Test/client.cs.
Add-Ons/Client_Test/Test.gui Line: 11 - Syntax error.
>>> Some error context, with ## on sides of error halt:
/--- OBJECT WRITE BEGIN ---

new GuiControl(Test) {

   profile = "GuiDefaultProfile";

   horizSizing = "right";

   vertSizing = "bottom";

   position = "0 0";

   extent = "640 480";

   minExtent = "8 2";

   visible = "1";



   new GuiWindowCtrl(Test GUI)## ##{

      profile = "GuiWindowProfile";

      horizSizing = "right";

      vertSizing = "bottom";

      position = "204 76";

      extent = "199 304";

      minExtent = "8 2";

      visible = "1";

      accelerator = "escape";

      maxLength = "255";
>>> Error report complete.

Executing Add-Ons/Client_Test/Test.gui.
Add-Ons/Client_Test/Test.gui Line: 11 - Syntax error.
>>> Some error context, with ## on sides of error halt:
/--- OBJECT WRITE BEGIN ---

new GuiControl(Test) {

   profile = "GuiDefaultProfile";

   horizSizing = "right";

   vertSizing = "bottom";

   position = "0 0";

   extent = "640 480";

   minExtent = "8 2";

   visible = "1";



   new GuiWindowCtrl(Test GUI)## ##{

      profile = "GuiWindowProfile";

      horizSizing = "right";

      vertSizing = "bottom";

      position = "204 76";

      extent = "199 304";

      minExtent = "8 2";

      visible = "1";

      accelerator = "escape";

      maxLength = "255";
>>> Error report complete.
--- End code ---

here client.cs


--- Code: ---exec("./Test.gui");

    $remapDivision[$remapCount] = "Custom made GUI's";
    $remapName[$remapCount] = "Test GUI";
    $remapCmd[$remapCount] = "Open_Test";
    $remapCount++;
function Open_Test(%toggle)
{
if(%toggle)
{
if(TestGui.isAwake())
{
canvas.popDialog(TestGui);
}

else
{
canvas.pushDialog(TestGui);
}
}
}
function TestButtonPush()
{
talk(hi);
}
--- End code ---

also what scripting langauge is client.cs c++?

Fluff-is-back:


--- Quote from: deathrider on April 05, 2012, 07:45:26 AM ----snip-

also what scripting langauge is client.cs c++?

--- End quote ---

Those errors are in Test.gui - there are missing '}'s. Remember, for every '{' there will be a closing '}'

And blockland runs on Torque Script.

deathrider:


--- Quote from: Fluff-is-back on April 05, 2012, 09:05:34 AM ---Those errors are in Test.gui - there are missing '}'s. Remember, for every '{' there will be a closing '}'

And blockland runs on Torque Script.

--- End quote ---
ahh i see ok i can fix that
but client.cs is in the right formatting im starting to get this its all about knowing commands and the formatting anywhere i can find all the commands and how to format it

deathrider:

console replys with this error that i cannot fix something about ##

console error
--- Code: ---Client checking Add-On: Client_Test
Loading Add-On: Client_Test (CRC:771396467)
Executing Add-Ons/Client_Test/client.cs.
Add-Ons/Client_Test/Test.gui Line: 11 - Syntax error.
>>> Some error context, with ## on sides of error halt:
/--- OBJECT WRITE BEGIN ---

new GuiControl(Test) {

   profile = "GuiDefaultProfile";

   horizSizing = "right";

   vertSizing = "bottom";

   position = "0 0";

   extent = "640 480";

   minExtent = "8 2";

   visible = "1";

}

   new ##G##uiWindowCtrl(TestGUI) {

      profile = "GuiWindowProfile";

      horizSizing = "right";

      vertSizing = "bottom";

      position = "204 76";

      extent = "199 304";

      minExtent = "8 2";

      visible = "1";

      accelerator = "escape";

      maxLength = "255";
>>> Error report complete.

Executing Add-Ons/Client_Test/Test.gui.
Add-Ons/Client_Test/Test.gui Line: 11 - Syntax error.
>>> Some error context, with ## on sides of error halt:
/--- OBJECT WRITE BEGIN ---

new GuiControl(Test) {

   profile = "GuiDefaultProfile";

   horizSizing = "right";

   vertSizing = "bottom";

   position = "0 0";

   extent = "640 480";

   minExtent = "8 2";

   visible = "1";

}

   new ##G##uiWindowCtrl(TestGUI) {

      profile = "GuiWindowProfile";

      horizSizing = "right";

      vertSizing = "bottom";

      position = "204 76";

      extent = "199 304";

      minExtent = "8 2";

      visible = "1";

      accelerator = "escape";

      maxLength = "255";
>>> Error report complete.
--- End code ---

i fixed one error and was able to get client.cs to run absolutly rine its just the gui its forgeted its self

edit ok so my problem with everything is wtf is ## mean does it want spaces?

Pages: << < (10/12) > >>

Go to full version