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

Messages - wizard_wizzle (aka ZeldaHistorian)

#196
Your projects / Re: Zelda: Book of Mudora
July 05, 2015, 04:46:04 PM
Thanks for the reports!

If you were able to provide screenshots for the areas where teleporters fall, I would be able to fix them much more easily.

There have been a few issues with the thief's hide and seek game reported, this is something I plan to correct in the next release.

The area on the other side of the map isn't on the world map given to you by the Gerudo, which is why Link's head isn't showing on it. I'm working on having an alternate map (or none initially) for this area, and it will be included in the next release.

The pyramid was a direct rip from FSA, but I don't recall who did the rip (still working on compiling all the credits). It was a full rip of every sprite in the game together in a zip file, if you're able to find it.
#197
Your projects / Re: Zelda: Book of Mudora
July 03, 2015, 05:00:12 PM
Thanks Christopho, credit added!

New version, and the project is featured on Zelda Fan Game Central!
https://www.dropbox.com/s/173ng4by56nrjhy/zbom-0.44.zip?dl=0
http://zfgc.com/forum/index.php?topic=41338.0

VERSION 0.44 released 15-JUL-2:
- core path of wind tower finish - able to obtain book
- additional warp points
- short cut added to Pyramid
- additional player direction from NPCs, included new attendent in council office
- trading sequence finished - able to obtain feather
- lost woods expanded
- dialog font replaced and dialog line breaks redone to utilize additional space
- sprite, tile and script fixes throughout
#198
Development / Re: Side scrolling functionality
June 28, 2015, 12:24:26 AM
Christopho, your idea worked! I believe I got the basics working, if anyone would like to use it.

game_manager.lua (gravity and jumping):
local game_manager = {}
local map_metatable = sol.main.get_metatable("map")

local gravity = 2
local jump_height = 8
local jumping = false
local i = 0

function game_manager:start_game()

  local exists = sol.game.exists("save1.dat")
  local game = sol.game.load("save1.dat")
  if not exists then
    -- Initialize a new savegame.
    game:set_max_life(1)
    game:set_life(game:get_max_life())
  end
  game:start()

  function game:on_command_pressed(command)

    if command == "up" and not jumping then
      -- override default behaviour and make the hero jump up!
      jumping = true
      i = 0
    end
  end
end

function map_metatable:on_update()

  -- gravity: move entities down one pixel on every update if there's no collision
  --          (like with the ground or a platform)
  local x,y,l = self:get_game():get_hero():get_position()
  if not jumping then
    if not self:get_game():get_hero():test_obstacles(0,gravity) then
      self:get_game():get_hero():set_position(x,y+gravity,l)
    end
  else
    self:get_game():get_hero():set_animation("jumping")
    for i=1, jump_height do
      if not self:get_game():get_hero():test_obstacles(0,-1) then
        self:get_game():get_hero():set_position(x,(y-1),l)
      end
    end
    sol.timer.start(50*jump_height, function()
      jumping = false
      if self:get_game():is_command_pressed("right") or self:get_game():is_command_pressed("left") then
        self:get_game():get_hero():set_animation("walking")
      else
        self:get_game():get_hero():set_animation("stopped")
      end
    end)
  end

  for entity in self:get_entities("g_") do
    local gx,gy,gl = entity:get_position()
    if not entity:test_obstacles(0,gravity) then
      entity:set_position(gx,gy+gravity,gl)
    end
  end

end

return game_manager



monster.lua (example of a goomba-like enemy that you jump on to kill):
local enemy = ...

local state = "stopped"  -- "stopped", "moving", "going_back" or "paused".
local initial_xy = {}
local activation_distance = 24

function enemy:on_created()
  self:set_life(1)
  self:set_damage(2)
  self:create_sprite("enemies/monster")
  self:set_size(32, 32)
  self:set_origin(16, 29)
  initial_xy.x, initial_xy.y = self:get_position()
end

function enemy:on_update()
  local hero = self:get_map():get_entity("hero")
  if state == "stopped" and self:get_distance(hero) <= 192 then
    -- Check whether the hero is close.
    local x, y = self:get_position()
    local hero_x, hero_y = hero:get_position()
    local dx, dy = hero_x - x, hero_y - y

    if math.abs(dy) < activation_distance then
      if dx > 0 then
self:go(0)
      else
self:go(2)
      end
    end
    if state == "stopped" and math.abs(dx) < activation_distance then
      if dy > 0 then
self:go(3)
      else
self:go(1)
      end
    end
  end
end

function enemy:go(direction4)
  local dxy = {
    { x =  8, y =  0},
    { x =  0, y = -8},
    { x = -8, y =  0},
    { x =  0, y =  8}
  }

  -- Check that we can make the move.
  local index = direction4 + 1
  if not self:test_obstacles(dxy[index].x * 2, dxy[index].y * 2) then
    state = "moving"
    self:get_sprite():set_animation("walking")
    local x, y = self:get_position()
    local angle = direction4 * math.pi / 2
    local m = sol.movement.create("straight")
    m:set_speed(40)
    m:set_angle(angle)
    m:set_max_distance(104)
    m:set_smooth(false)
    m:start(self)
  end
end

function enemy:on_obstacle_reached()
  self:go_back()
end

function enemy:on_movement_finished()
  self:go_back()
end

function enemy:on_collision_enemy(other_enemy, other_sprite, my_sprite)
  if other_enemy:get_breed() == self:get_breed() and state == "moving" then
    self:go_back()
  end
end

function enemy:on_attacking_hero(hero, enemy_sprite)
  -- If hero is above the enemy (jumping on its head), kill it; otherwise, hurt the hero
  if self:get_angle(hero) >= 0.8 and self:get_angle(hero) <= 2.2 then
    self:remove_life(2)
  else
    hero:start_hurt(self, 1)
  end
end

function enemy:go_back()
  if state == "moving" then
    state = "going_back"
    self:get_sprite():set_animation("walking")
    local m = sol.movement.create("target")
    m:set_speed(32)
    m:set_target(initial_xy.x, initial_xy.y)
    m:set_smooth(false)
    m:start(self)
  elseif state == "going_back" then
    state = "paused"
    self:get_sprite():set_animation("immobilized")
    sol.timer.start(self, 500, function() self:unpause() end)
  end
end

function enemy:unpause()
  self:get_sprite():set_animation("immobilized")
  state = "stopped"
end
#199
Your projects / Re: Zelda: Book of Mudora
June 26, 2015, 02:31:00 AM
Speaking of credit - Christopho, who created the "firebird" sprite that's in zsdx? I used it as a base in one of my new boss sprites and want to make sure I give correct credit!
#200
Development / Re: Side scrolling functionality
June 25, 2015, 04:26:18 AM
If anyone is curious, I have a game_manager script that takes care of most of the heavy lifting. The script will cause gravity to act on the hero and any entity with a name prefaced by "g_". This will effect any map of the game, but could be limited to only certain ones easily enough.

Updated code is in a post below...
#201
Development / Side scrolling functionality
June 25, 2015, 04:24:13 AM
As a proof-of-concept, I've been figuring out how to build side-scrolling functionality with Solarus (like the sections of Link's Awakening). I can get jumping, gravity and movement pretty well down, but the part I can't figure out is enemy collisions.

I'd like to have it work like Mario where if you jump on certain enemy's heads, they are hurt, but I can't figure out how to detect that the hero has touched only the top of the enemy. If the hero touched the side of the enemy, the hero should be hurt.

I'm guessing that this can't be accomplished with the built-in enemy class, but even with a custom entity and add_collision_test(), I don't see how to detect what was touching what.

EDIT (1/18/21): Don't use this - it's old and there are much better versions out there now. Check out the one PhoenixII54 posted on 1/18/21.
https://gitlab.com/zeldaforce/zelda-alttd/-/blob/dev/data/scripts/maps/sideview_manager.lua
#202
Your projects / Re: Zelda: Book of Mudora
June 25, 2015, 01:33:37 AM
I guess it would depend on which tilesets and where I got them :)

Most of my tiles are edited from Nintendo resources, so it's not really my place to give permission. They're still their intellectual property, you won't be able to sell your game, and you run the risk of Nintendo shutting you down.
On the flip side, I spent A LOT of time editing tiles and creating something unique for Book of Mudora, so if you do choose to use them I would ask that you at least credit the work that I did.

I would also ask that you not copy every tile and just throw them in your game - feel free to pick and choose and create your own style just like I did for BoM!
#203
Your projects / Re: Zelda: Book of Mudora
June 20, 2015, 04:28:49 PM
I'll look at them - thanks!
#204
Your projects / Re: Zelda: Book of Mudora
June 18, 2015, 11:50:13 PM
Updated version! Download link: https://www.dropbox.com/s/22nv4cyvmy7tgb7/zbom-0.43.zip?dl=0

VERSION 0.43
  - added NPC dialogs, signs and other markers to assist player
  - additional enemy types and overworld bosses
  - additional warp points, heart pieces, and trading sequence
  - mapping of north hyrule and wind tower
  - bug fixes

Christopho, if possible, please use this version when you play next :)
#205
Your projects / Re: Zelda: Book of Mudora
June 16, 2015, 01:59:29 AM
I've encountered that bug before too, and am still tracking down the cause. I believe it's related to the "item not saved" error I'm getting. Interesting that it reappeared for you though!
#206
Development / Re: Collision tests and movement
June 11, 2015, 03:25:36 AM
function entity:on_created()
  self:set_size(16, 16)
  self:snap_to_grid()
  self:set_modified_ground("ice") --is this useful?
  self:set_traversable_by("hero", false)
  self:set_traversable_by("custom_entity", true) --to allow pushing block into pit
  self:create_sprite("entities/ice_block")

  self:add_collision_test("facing", function(self, other)
    if other:get_type() == "hero" and not pushing then
      pushing = true
      local m = sol.movement.create("path")
      m:set_ignore_obstacles(false)
      m:set_snap_to_grid(true)

      if other:get_direction() == 0 then m:set_path({0,0})
      elseif other:get_direction() == 1 then m:set_path({2,2})
      elseif other:get_direction() == 2 then m:set_path({4,4})
      elseif other:get_direction() == 3 then m:set_path({6,6}) end
      m:start(self, function()
pushing = false
      end)
    end
  end)


This is the code that I use, and it works fine.
#207
Development / Re: Item is not saved
June 10, 2015, 01:58:23 PM
I believe it is new to 1.4. Like I said, it doesn't seem to happen all the time. I'll do some further testing and see what other information I can provide.
#208
Your projects / Re: Zelda: Book of Mudora
June 09, 2015, 02:06:14 PM
Hmm... which image was missing for game over? I should be able to replace it.

Nope, don't feel obligated to do it in English on my account - it's your stream! Do what you like!
#209
Development / Re: Item is not saved
June 09, 2015, 02:03:32 PM
I believe I already am. In fact, these scripts should be similar if not still identical to ZSDX.

Bow:
function item:on_created()
  self:set_savegame_variable("i1801")
  self:set_amount_savegame_variable("i1802")
  self:set_assignable(true)
end


Arrow:
function item:on_created()
  self:set_shadow("small")
  self:set_can_disappear(true)
  self:set_brandish_when_picked(false)
end

function item:on_started()
  -- Disable pickable arrows if the player has no bow.
  -- We cannot do this from on_created() because we don't know if the bow
  -- is already created there.
  self:set_obtainable(self:get_game():has_item("bow"))
end
#210
Development / Item is not saved
June 09, 2015, 03:03:56 AM
Occasionally  I've gotten error messages like the following while running my game:

Error: In on_started: [string "items/arrow.lua"]:13: Item 'bow' is not saved
Error: In on_started: [string "hud/rupees.lua"]:26: Item 'rupee_bag' is not saved

It doesn't seem to happen all of the time, and sometimes the "Item" mentioned is different. These items are calling self:set_savegame_variable() in their on_created() functions. Is there something else I'm doing wrong?