I feel so embarrassed asking this cause it should be easy but my template I used for battle didn't come with all the basic GUIs. So I tried to add every thing by starting a new game with the GUIs built in and copying the scripts from it to my battle game but the GUIs won't work
Here is a sample of my script
function btnInvOK_Click(GUIControl *control, MouseButton button) {
// They pressed the OK button, close the GUI
gInventory.Visible = false;
mouse.UseDefaultGraphic();
}
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);
}
function btnIconInv_Click(GUIControl *control, MouseButton button) {
show_inventory_window();
}
function btnIconCurInv_Click(GUIControl *control, MouseButton button) {
if (player.ActiveInventory != null)
mouse.Mode = eModeUseinv;
}
function btnIconSave_Click(GUIControl *control, MouseButton button)
{
show_save_game_dialog();
}
function btnIconLoad_Click(GUIControl *control, MouseButton button)
{
show_restore_game_dialog();
}
function btnIconExit_Click(GUIControl *control, MouseButton button) {
QuitGame(1);
I believe the problem should be in there some where.
So you made GUIs and copied existing code over from another script?
That doesn't work- you need to set up all function handlers for GUI elements before. As in, you create your gui, you set up the on_click/on_change etc. functions, and then you enter the code.
Thank you I did what you said and it worked.