Error when exporting GUI (SOLVED)

Started by SupSuper, Mon 31/07/2006 17:44:50

Previous topic - Next topic

SupSuper

Ok, so I get this when trying to export a GUI:

Quote
AGS Editor Error
---------------------------
Mismatched scripts, no sectionend was found for '  #sectionend btnNo_Click '. Do not attempt to manually remove script functions.

The thing is, I didn't manually remove anything. the #sectionstart's and #sectionend's are all there, so I don't see the problem.
Programmer looking for work

Alynn

Does everything compile before you try to export... I'd wager that there is a closing bracket or parenthesis or a missing quotation mark or something.

SupSuper

It all compiles and runs fine. I can post the script if you want.
Programmer looking for work

Gilbert


SupSuper

#4
Well it's pretty much just the default script, I just use it to test out modules and stuff:

Code: ags

// main global script file

#sectionstart game_start  // DO NOT EDIT OR REMOVE THIS LINE
function game_start() {
  // called when the game starts, before the first room is loaded
  Confirm.Show("Now you can create fully customizable dynamically sized automatically centered confirmation boxes with just one function. Custom images, text, font, colors, titlebar, ANYTHING!", "Holy crap!", "NO WAI!", "It's amazing!", 5, eImageRight);
  //Confirm.Show("Are you sure?","","No","");
}
#sectionend game_start  // DO NOT EDIT OR REMOVE THIS LINE


#sectionstart repeatedly_execute  // DO NOT EDIT OR REMOVE THIS LINE
function repeatedly_execute() {
  // put anything you want to happen every game cycle here
}
#sectionend repeatedly_execute  // DO NOT EDIT OR REMOVE THIS LINE


function show_inventory_window () {
  // This demonstrates both types of inventory window - the first part is how to
  // show the built-in inventory window, the second part uses the custom one.
  // Un-comment one section or the other below.
  
  // ** DEFAULT INVENTORY WINDOW
//  InventoryScreen();

  // ** CUSTOM INVENTORY WINDOW
  gInventory.Visible = true;
  // switch to the Use cursor (to select items with)
  mouse.Mode = eModeInteract;
  // But, override the appearance to look like the arrow
  mouse.UseModeGraphic(eModePointer);

}

#sectionstart on_key_press  // DO NOT EDIT OR REMOVE THIS LINE
function on_key_press(int keycode) {
  // called when a key is pressed. keycode holds the key's ASCII code
  if (IsGamePaused() == 1) keycode=0;  // game paused, so don't react to keypresses
  if (keycode==17)  QuitGame(1);   // Ctrl-Q
  if (keycode==360) SaveList.Show();     // F2
  if (keycode==363) SaveGameDialog();   // F5
  if (keycode==365) RestoreGameDialog();  // F7
  if (keycode==367) RestartGame();  // F9
  if (keycode==434) SaveScreenShot("scrnshot.bmp");  // F12
  if (keycode==9)   show_inventory_window();  // Tab, show inventory

  if (keycode==19)  Debug(0,0);  // Ctrl-S, give all inventory
  if (keycode==22)  Debug(1,0);  // Ctrl-V, version
  if (keycode==1)   Debug(2,0);  // Ctrl-A, show walkable areas
  if (keycode==24)  Debug(3,0);  // Ctrl-X, teleport to room
}
#sectionend on_key_press  // DO NOT EDIT OR REMOVE THIS LINE


#sectionstart on_mouse_click  // DO NOT EDIT OR REMOVE THIS LINE
function on_mouse_click(MouseButton button) {
  // called when a mouse button is clicked. button is either LEFT or RIGHT
  if (IsGamePaused() == 1) {
    // Game is paused, so do nothing (ie. don't allow mouse click)
  }
  else if (button == eMouseLeft) {
    ProcessClick(mouse.x, mouse.y, mouse.Mode );
  }
  else {   // right-click, so cycle cursor
    mouse.SelectNextMode();
  }
}
#sectionend on_mouse_click  // DO NOT EDIT OR REMOVE THIS LINE


#sectionstart interface_click  // DO NOT EDIT OR REMOVE THIS LINE
function interface_click(int interface, int button) {
  // This function is obsolete, from 2.62 and earlier versions.
}
#sectionend interface_click  // DO NOT EDIT OR REMOVE THIS LINE


#sectionstart btnInvUp_Click  // DO NOT EDIT OR REMOVE THIS LINE
function btnInvUp_Click(GUIControl *control, MouseButton button) {
  invCustomInv.ScrollUp();
}
#sectionend btnInvUp_Click  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart btnInvDown_Click  // DO NOT EDIT OR REMOVE THIS LINE
function btnInvDown_Click(GUIControl *control, MouseButton button) {
  invCustomInv.ScrollDown();
}
#sectionend btnInvDown_Click  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart btnInvOK_Click  // DO NOT EDIT OR REMOVE THIS LINE
function btnInvOK_Click(GUIControl *control, MouseButton button) {
  
	// They pressed the OK button, close the GUI
	gInventory.Visible = false;
	mouse.UseDefaultGraphic();
}
#sectionend btnInvOK_Click  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart btnInvSelect_Click  // DO NOT EDIT OR REMOVE THIS LINE
function btnInvSelect_Click(GUIControl *control, MouseButton button) {
  
	// They pressed SELECT, so switch to the Get cursor
	mouse.Mode = eModeInteract;
	// But, override the appearance to look like the arrow
	mouse.UseModeGraphic(eModePointer);
}
#sectionend btnInvSelect_Click  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart btnIconInv_Click  // DO NOT EDIT OR REMOVE THIS LINE
function btnIconInv_Click(GUIControl *control, MouseButton button) {
  
  show_inventory_window();
}
#sectionend btnIconInv_Click  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart btnIconCurInv_Click  // DO NOT EDIT OR REMOVE THIS LINE
function btnIconCurInv_Click(GUIControl *control, MouseButton button) {
  
  if (player.ActiveInventory != null)
    mouse.Mode = eModeUseinv;
}
#sectionend btnIconCurInv_Click  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart btnIconSave_Click  // DO NOT EDIT OR REMOVE THIS LINE
function btnIconSave_Click(GUIControl *control, MouseButton button) {
  
  SaveGameDialog();
}
#sectionend btnIconSave_Click  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart btnIconLoad_Click  // DO NOT EDIT OR REMOVE THIS LINE
function btnIconLoad_Click(GUIControl *control, MouseButton button) {
  
  RestoreGameDialog();
}
#sectionend btnIconLoad_Click  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart btnIconExit_Click  // DO NOT EDIT OR REMOVE THIS LINE
function btnIconExit_Click(GUIControl *control, MouseButton button) {
  
  QuitGame(1);
}
#sectionend btnIconExit_Click  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart btnIconAbout_Click  // DO NOT EDIT OR REMOVE THIS LINE
function btnIconAbout_Click(GUIControl *control, MouseButton button) {
  
  Display("Adventure Game Studio v2 run-time engine[[Copyright (c) 1999-2005 Chris Jones");
}
#sectionend btnIconAbout_Click  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart lstGames_SelectionChanged  // DO NOT EDIT OR REMOVE THIS LINE
function lstGames_SelectionChanged(GUIControl *control) {

	SaveList.Select();
}
#sectionend lstGames_SelectionChanged  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart btnLoad_Click  // DO NOT EDIT OR REMOVE THIS LINE
function btnLoad_Click(GUIControl *control, MouseButton button) {
  
  SaveList.Load();
	  
}
#sectionend btnLoad_Click  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart btnSave_Click  // DO NOT EDIT OR REMOVE THIS LINE
function btnSave_Click(GUIControl *control, MouseButton button) {
  
	SaveList.Save();
  
}
#sectionend btnSave_Click  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart btnDelete_Click  // DO NOT EDIT OR REMOVE THIS LINE
function btnDelete_Click(GUIControl *control, MouseButton button) {
  
	SaveList.Delete();
  
}
#sectionend btnDelete_Click  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart btnCancel_Click  // DO NOT EDIT OR REMOVE THIS LINE
function btnCancel_Click(GUIControl *control, MouseButton button) {
  
	SaveList.Hide();
}
#sectionend btnCancel_Click  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart unhandled_event  // DO NOT EDIT OR REMOVE THIS LINE
function unhandled_event(int what, int type) {
  
}
#sectionend unhandled_event  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart dialog_request  // DO NOT EDIT OR REMOVE THIS LINE
function dialog_request(int parameter) {
  
}
#sectionend dialog_request  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart btnNo_Click  // DO NOT EDIT OR REMOVE THIS LINE
function btnNo_Click(GUIControl *control, MouseButton button) {
  
  Confirm.Hide();
}
#sectionend BtnNo_Click  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart btnYes_Click  // DO NOT EDIT OR REMOVE THIS LINE
function btnYes_Click(GUIControl *control, MouseButton button) {

  Confirm.Hide();
}
#sectionend btnYes_Click  // DO NOT EDIT OR REMOVE THIS LINE


Also, the GUI I'm trying to export only uses BtnYes_Click and BtnNo_Click.
Programmer looking for work

SSH

Quote from: SupSuper on Tue 01/08/2006 15:32:22
#sectionstart btnNo_Click  // DO NOT EDIT OR REMOVE THIS LINE
#sectionend BtnNo_Click  // DO NOT EDIT OR REMOVE THIS LINE

spot the difference...
12

Khris

Quote from: SupSuper on Tue 01/08/2006 15:32:22#sectionend BtnNo_ClickÃ,  // DO NOT EDIT OR REMOVE THIS LINE

Well, that was obvious.
Change that to btnNo_Click and you should be fine.

SupSuper

D'oh!

Thanks for pointing out my stupidity. :)
Programmer looking for work

SMF spam blocked by CleanTalk