Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - Salamdandersad

#1
I'm really sorry. But I'm very lost, and there aren't any tutorials for AGS in my language, and the ones that exist are too technical or directly advanced.

I'm trying to create a puzzle, a wall with the Einstein game (the typical puzzle where, based on some clues: John lives in the yellow house, the American is John, the Spaniard doesn't live next to the American, the one who buys the newspaper is two houses to the left of the one who buys the magazines... and based on those clues, you have to locate each person, house, nationality...)

The idea is that each element appears on a digital screen, and when you press a button, it changes until it's correct (it's verified to be correct by clicking a hotspot).

I tried doing it roughly, checking that each sprite is in a specific location, and it doesn't work. But from what I read in the guide, there are "arrays," but I'm not quite understanding how they work. Can someone help me with that?
#2
Hello guys, I'm developing a game for the first time with this engine. I have the first rooms, the music, and the GUI for the start and pause menus. The game is in first person, Myst-style. However, when I try to configure the save and load, it doesn't allow me.

The game works with this code. However, when I try to save, it throws me the error message that I have set (it's in Spanish because I'm from Spain).

The button configuration for the GUIs is correct because I see the error messages. Do I need to do anything extra?

<<// main global script file

// called when the game starts, before the first room is loaded
function game_start()
{
    gGui1.Visible = true; // Muestra el menú de inicio
    gPauseMenu.Visible = false; // Asegúrate de que el menú de pausa esté oculto al inicio
    // Auto-save on the save slot 999
    SetRestartPoint();
}

// called on every game cycle, except when the game is blocked
function repeatedly_execute()
{
}

// called on every game cycle, even when the game is blocked
function repeatedly_execute_always()
{
}

// called when a key is pressed
function on_key_press(eKeyCode keycode, int mod)
{
    // Si el juego está pausado, no se procesan otras teclas
    if (IsGamePaused())
    {
        if (keycode == eKeyEscape)
        {
            // Si se presiona Escape, oculta el menú de pausa
            gPauseMenu.Visible = false;
            // Aquí puedes agregar cualquier lógica para reanudar el juego
        }
        else
        {
            // No reacciona a ninguna otra tecla
            return;
        }
    }

    // Lógica para el menú de inicio
    if (keycode == eKeyQ && (mod & eKeyModCtrl))
    {
        // Ctrl-Q will quit the game
        QuitGame(1);
    }
    else if (keycode == eKeyF9)
    {
        // F9 will restart the game
        RestartGame();
    }
    else if (keycode == eKeyF12)
    {
        // F12 will save a screenshot to the save game folder
        SaveScreenShot("screenshot.pcx");
    }
    else if (mod & eKeyModCtrl)
    {
        if (keycode == eKeyS)
        {
            // Ctrl-S will give the player all defined inventory items
            Debug(0, 0);
        }
        else if (keycode == eKeyV)
        {
            // Ctrl-V will show game engine version and build date
            Debug(1, 0);
        }
        else if (keycode == eKeyA)
        {
            // Ctrl-A will show walkable areas
            Debug(2, 3);
        }
        else if (keycode == eKeyX)
        {
            // Ctrl-X will let the player teleport to any room
            Debug(3, 0);
        }
    }

    // Manejo de la tecla Escape para pausar el juego
    if (keycode == eKeyEscape)
    {
        if (gPauseMenu.Visible == false)
        {
            // Mostrar el menú de pausa
            gPauseMenu.Visible = true;
            // Aquí puedes detener la lógica del juego si es necesario
        }
        else
        {
            // Ocultar el menú de pausa
            gPauseMenu.Visible = false;
            // Reanudar el juego
            // Si necesitas hacer algo específico para reanudar, hazlo aquí
        }
    }
}

// called when a mouse button is clicked
function on_mouse_click(MouseButton button)
{
    if (IsGamePaused())
    {
        // El juego está pausado, así que no procesar clics del ratón
        return;
    }
    else if (button == eMouseLeft)
    {
        // clic izquierdo, intenta usar el modo de cursor actual en esta posición
        Room.ProcessClick(mouse.x, mouse.y, mouse.Mode);
    }
    else if (button == eMouseRight)
    {
        // clic derecho, cambia el modo de cursor
        mouse.SelectNextMode();
    }
}

// Maneja el clic del botón para comenzar el juego
function Button1_OnClick(GUIControl *control, MouseButton button)
{
    // Cambia al jugador a la room 1
    player.ChangeRoom(1);
    // Oculta el menú de inicio después de comenzar el juego
    gGui1.Visible = false;
}

// Maneja el clic del botón "Resume" en el menú de pausa
function btnResume_OnClick(GUIControl *control, MouseButton button)
{
    // Oculta el menú de pausa
    gPauseMenu.Visible = false;
    // Aquí puedes agregar cualquier lógica adicional para reanudar el juego
}

// Maneja el clic del botón "Save" en el menú de pausa
function btnSave_OnClick(GUIControl *control, MouseButton button)
{
    // Guarda el juego en el slot 1, con la descripción "Juego guardado"
    if (SaveGameSlot(1, "Juego guardado en el menú de pausa"))
    {
        // Notifica al jugador que el juego se ha guardado correctamente
        Display("El juego se ha guardado correctamente.");
    }
    else
    {
        // Si el guardado falla, muestra un mensaje de error
        Display("Error: No se pudo guardar el juego en el slot 1.");
        Debug(0, 0); // Mostrar información de depuración
    }
}

// Maneja el clic del botón "Load" en el menú de inicio
function btnLoad_OnClick(GUIControl *control, MouseButton button)
{
    // Verifica si existe un archivo de guardado en el slot 1
    if (File.Exists("savegame1.sav")) // Cambiado para verificar la existencia del archivo
    {
        RestoreGameSlot(1); // Cambiado a RestoreGameSlot
        // Oculta el menú de inicio después de cargar el juego
        gGui1.Visible = false; // Opcional: si quieres ocultar el menú de inicio al cargar
    }
    else
    {
        Display("No hay juego guardado en slot 1.");
    }
}

// Función que se llama cuando se muestra el menú de pausa
function on_pause_menu_show()
{
    // Detén cualquier lógica de juego si es necesario
}

// Función que se llama cuando se oculta el menú de pausa
function on_pause_menu_hide()
{
    // Reanuda cualquier lógica de juego si es necesario
}>>
SMF spam blocked by CleanTalk