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.


Topics - PeterB

Pages: [1]
1
Your scripts / Magic Mirror (ALTTP) warp script
« on: February 21, 2021, 08:10:27 am »
Hi Guys,

Just thought I would share my script for my Magic Mirror item.

It allows you to transport between maps as in ALTTP.

Hopefully it should be self explanatory but if not please let me know.

PeterB

Code: [Select]
-- Allows you to travel from Dark world maps to Light world maps
-- Maps need to have the same name or you need to work out how to
-- change to new map. My maps have the same world layout so you can
-- go to the same place/co-ordinates. The map id's however are slightly
-- different, i.e. dark_world/castle versus light_world/castle. Hence the
-- string.sub 11 characters to remove dark_world and add light_world
-- back in the teleport statement.


local item = ...
local game = item:get_game()
 
function item:on_started()
  item:set_savegame_variable("possession_magic_mirror")
  item:set_assignable(true)
end

function item:on_using()
  local hero = game:get_hero()
  local map = item:get_map()
  local map_id = map:get_id()
  if map:get_world() == "dark_world" then -- go from dark_world back to light_world
    new_map = string.sub(map_id, 11)
    -- Teleport.
    sol.audio.play_sound("warp")
    hero:teleport("light_world" .. new_map .. "", "_same", "fade") -- takes you to same position on light_world map
  else
    sol.audio.play_sound("wrong")
  end
  item:set_finished()
end


2
Development / Help with name display code
« on: January 04, 2020, 09:20:50 pm »
Hey guys,

I am after some help with my savegames.lua. I am trying to get the players name from the save1.dat file (or 2 or 3) and print it on the game select screen.

I can't see what I am doing wrong with drawing it on the screen, so am after some help please.

Here is the relevant section of code, and I have attached the savegames.lua file.

Thanks in advance.

Peter

Code: [Select]
local function read_savegames()

  for i = 1, 3 do
    local file_name = get_savegame_file_name(i)
    local surface = sol.surface.create(272, 16)
    surface:set_xy(24, 8 + i * 48)
    savegames_surfaces[i] = surface

player_name_text = sol.text_surface.create{
      font = "alttp",
      font_size = 11,
    }

    if not sol.game.exists(file_name) then
      games[i] = nil
  local name = "- " .. sol.language.get_string("savegames_menu.empty") .. " -"
      player_name_text:set_text(name)
    else
      -- Existing file.
    local game = game_manager:create(file_name)
    games[i] = game

-- Player name get and display
player_name_text:set_text(game:get_value("player_name"))
player_name_text:draw(surface, 90, 16 + i * 48)

    -- Hearts.
    draw_hearts(game, surface)
    end
  end
end

3
Bugs & Feature requests / Tileset upate script in Lttp pack
« on: August 31, 2019, 10:48:45 am »
Hi, does anyone know how to use the update tileset script?

I tried putting the script in the ../data/scripts folder and calling it from the game_manager script but i am getting the below error.

Any ideas, as i can't find any documentation on how to use it?

Error: In on_started: scripts/update_maps_to_rearranged_outside_tilesets.lua:26: attempt to concatenate global 'file_path' (a nil value)
stack traceback:
[C]: in function '__concat'
scripts/update_maps_to_rearranged_outside_tilesets.lua:26: in function 'get_pattern_mapping'
scripts/update_maps_to_rearranged_outside_tilesets.lua:107: in main chunk
[C]: in function 'require'
scripts/game_manager.lua:10: in main chunk
[C]: in function 'require'
scripts/menus/savegames.lua:4: in main chunk
[C]: in function 'require'
main.lua:20: in function <main.lua:9>

4
Game art & music / ALTTP font
« on: August 01, 2019, 11:13:51 pm »
Guys,

In case anyone wants the arrows for the signs in the Link to the past font, here is one i have just done.

It uses " for the up arrow, # for the down arrow and [] for the left and right arrows.

Thanks,

5
Game art & music / Lava flows in ffomega's tiles set
« on: June 28, 2019, 11:21:32 pm »
Hi does anyone know which lava tiles go behind the mini volcanoes?

The first image is the original, and the second my attempt, using the tiles in the third image.

Or is there some sort of tile that goes over the top to mask the bits around the edges???

I keep looking through the tile set but can't seem to replicate the original!!!

6
Development / Quest document - updated pdf
« on: April 20, 2019, 09:33:17 am »
Hi Guys,

Has anyone got an updated pdf of the latest quest document that they could share?

Thanks,

Peter

7
Bugs & Feature requests / Error trying to Run Quest in Ubuntu
« on: January 12, 2019, 08:01:33 pm »
Hey guys,

I am having trying to run my quest in Ubuntu.

I think it may be an issue with GL and the new Shaders?

I have reinstalled all the packages as i thought it may be a SDL2 issue and have reinstalled Solarus and the Editor but with no joy.

The Editor works fine, i just can't run any games from either Solarus or the Editor???

This is what I am getting in the console when trying to run my quest in the Editor.

Info: Solarus 1.6.0
Info: Opening quest '/home/dad/Desktop/My Zelda Quest Draft'
Info: Joypad support enabled: true
Info: SDL: 2.0.8
Fatal: Cannot create the renderer: Could not create GL context: BadValue (integer parameter out of range for operation)


Pages: [1]