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 - CopperKatana

#1
Development / How to buy items
June 13, 2022, 02:02:59 AM
Hello, I am trying to program a shop in my game. But I think I'm not quite understanding  how to implement buying things. I watched the official tutorial on Shops and there was a dialog called _shops.question, which says something like:

Price is $v rupees.
$? Buy
$? Don't Buy

And the engine should fill in the item's price in the $v part, and recognize the "Buy/Don't Buy" part as selectable options. While the price of the item is properly displayed in my game, these options are just displayed as text with the $? symbols. The engine does not recognize them as choices.
How can I make it so that these are choices, and how do I control what effect each choice has?
#2
Game art & music / Re: LOZ- GBA Style
September 25, 2019, 07:31:55 PM
Welcome. Are you contributing specifically to GregoryMcGregorson's Minish Resource pack?
#3
Game art & music / Re: Oracle of Seasons Tileset
August 16, 2019, 05:02:11 AM
I see the resource pack got added to the website! Cool stuff! I've just been looking around for projects to help with - currently I'm doing some work on Maloney's Zelda 1 resource pack. If you'd like help with anything in particular, like doing the inspection of needed resources, I'd be happy to do what I can. I will admit I'm not much of an artist, and maybe that's more what you're looking for, but I'd love to help get this pack going. You can send me a DM or add me on Discord if you'd like to discuss it further.
#4
Development / Re: How to configure game window
July 30, 2019, 07:47:51 PM
With your first script, I still get the screen jumping upward. With the second script, I find that it just results in no camera settings being changed at all. We found that if a map already had an on_started() event, then registering the event wouldn't do anything. So, I tried removing the on_started() event from the .lua files for all of the maps in my demo, and I still get the screen jumping up when it scrolls.
What version of Solarus was your project in? I'm using 1.6.0, and I wonder if maybe something was changed that has affected the behavior of the camera.
#5
Development / Re: How to configure game window
July 29, 2019, 09:56:00 PM
So, I'd like to revisit this topic because I'm now trying to do something a bit different. In Golden Axe Warrior, the HUD is on the bottom of the screen, but recently I've tried having the HUD on the top of the screen.
My problem is that when you change maps, the camera will jump up and then down again. Here's a video showing it:
https://www.youtube.com/watch?v=qXnL8aQhP0A&feature=youtu.be

I've tried many things - manipulating dst_surface in game:on_draw, for example. For all I know, it may not even be possible to get this working exactly the way I want.
#6
Your projects / Golden Axe Warrior in Solarus
July 27, 2019, 07:12:11 PM
Hello everyone, recently I've changed my name from Blueblue3D to CopperKatana. But that's not what this post is about. I've been working on a recreation of Golden Axe Warrior in the Solarus engine. It's still very basic, and there remains a lot of work to be done before this could be considered a full game. But I've gotten it to the point where it at least looks a lot like the original game, so I want to post it here to get some feedback and gauge interest in this project.

The video I shared at the bottom of this post sums up what I've done and what needs to be done. The enemies don't have anything more than the default behavior, so that's the next thing I'm focusing on.

I've been interested in expanding Solarus fangame resources beyond the Zelda games, so I thought a simple 8-bit Zelda clone would be a good starting point. Someday this could be a full resource pack, but it's still in the very early stages of development. Even if it never gets that far, maybe it will at least get people talking about other Zelda-like games in Solarus, like Secret of Mana, Soleil, or Ys.

Please feel free to critique or suggest anything. You can see it in action here: https://www.youtube.com/watch?v=BfZxwHcxAuI&feature=youtu.be
#7
I forked the initial quest. I see now that the audio manager is a separate thing. As for the HUD, I tried to add this script to re-enable the HUD when the game starts:

require("scripts/multi_events")
local game_meta = sol.main.get_metatable("game")

local function game_over_restart_game(game)
  game:start()
  game:set_hud_enabled(true)
end

local function game_restart_hud(game)
  game:set_hud_enabled(true)
end

game_meta:register_event("on_game_over_started", game_over_restart_game)
game_meta:register_event("on_started", game_restart_hud)


This didn't change anything, however.
#8
Awesome stuff. I'd like to try and develop a game using level ups at some point, perhaps when at least one of my basic projects is completed.
Could also be used for making a Secret of Mana fangame. My dream is to one day have a Secret of Mana resource pack. Interestingly, Zefk posted an Allied AI script a while back, for having AI control additional characters to help the hero, just like in Secret of Mana. Combining it with this would start to get several of the systems in place.
#9
Hello, I seem to be having a mysterious issue with Solarus. Whenever I die in a game and respawn, my HUD disappears and will not return. That, and anytime my character has low health and it tries to play the low health sound, I get this error:

Error: In timer callback: scripts/hud/hearts.lua:105: attempt to index global 'audio_manager' (a nil value)

What I find very strange is that this is the case for all Solarus games I have on my computer. It isn't just my own game with some messed up script. I'm having the same issues with the Sample Quest and my other projects, but interestingly, not with the Mystery of Solarus dev quest. The sample quest actually has its own issue, which is that when you die and respawn, not only does the HUD disappear, but the music stops too.

Does this sound like an issue anyone might be familiar with? I'm a bit perplexed.
#10
Your scripts / Disable diagonal movement
July 21, 2019, 03:18:35 AM
Hello, I've been working on a Solarus recreation of Golden Axe Warrior from the Sega Master System. In that game, you can only move in four directions, just like in Zelda 1. I don't know of any way to disable diagonal movement or lock movement to four directions natively, so I wrote a script which does it for me.


require("scripts/multi_events")


local game_meta = sol.main.get_metatable("game")

function game_meta:on_command_pressed(command)
  if command == "right" then
    if self:is_command_pressed("up") then
      self:simulate_command_released("up")

    end   
    if self:is_command_pressed("down") then
      self:simulate_command_released("down")   
    end   
  end
 
  if command == "left" then
    if self:is_command_pressed("up") then
      self:simulate_command_released("up")   
    end   
    if self:is_command_pressed("down") then
      self:simulate_command_released("down")   
    end   
  end

  if command == "up" then
    if self:is_command_pressed("left") then
      self:simulate_command_released("left")   
    end   
    if self:is_command_pressed("right") then
      self:simulate_command_released("right")   
    end   
  end
  if command == "down" then
      if self:is_command_pressed("left") then
      self:simulate_command_released("left")   
    end   
    if self:is_command_pressed("right") then
      self:simulate_command_released("right")   
    end   
  end
 
  --Optionally, this disables the spin attack (or anything which would come after a normal attack)
  if command == "attack" then
    self:simulate_command_released("attack")
  end
end


It's not pretty or elegant, but it has held up to my tests thus far and results in a game that plays much more similarly to Zelda 1.
#11
Development / Re: How to configure game window
July 20, 2019, 08:16:16 PM
Thank you very much for all the help! I finally got the code to work, in particular by following Kamigousu's suggestion for registering it to when the map changes.

For the reference of anyone reading this, this is in a file I called "camera_settings.lua" which I required in the main.


require("scripts/multi_events")  --This is required for this script to work. It allows the script to be called on its own.

local game_meta = sol.main.get_metatable("game")

local function set_camera(game)
  if game ~= nil then
    if game:get_map() ~= nil then
      local map = game:get_map() 
      local camera = map:get_camera()
      camera:set_size(256, 160)
      --camera:set_position_on_screen(0, 16)
    end
  end
end

game_meta:register_event("on_map_changed", set_camera)



I've also been adding HUD elements to more closely match Golden Axe, and here's a screenshot of how it's looking now:
https://imgur.com/a/PDMVz2m

Thanks again for all the help.
#12
Development / Re: How to configure game window
July 19, 2019, 05:41:49 PM
I tried to implement that script, but Solarus told me it couldn't get the camera because map was a nil value. I'm not totally sure, but I think that when the game is first started, the map has not been set yet, so it's nil. Then later the map gets set and then the map gets started.

I've been studying up on the Solarus documentation a bit, and I thought to perhaps try something like the following code, where I add these camera settings to the on_started() of every map.


require("scripts/multi_events")  --This is required for this script to work. It allows the script to be called on its own.
print("Hello")  --Used for testing
local map_meta = sol.main.get_metatable("map")
map_meta:register_event("on started", function()
  camera = self.get_camera()
  camera:set_size(256, 160)
  camera:set_position_on_screen(0, 16)
  print("World")   --Used for testing
end)


This code is in a script called "camera_settings" which I have required in my main.
Unfortunately this is not working either. I'll get "Hello" but no "World," and the camera is not changed. So it would seem that it's not actually registering this function into the on_started() for my maps. Perhaps this is not a great way to do things either, but I don't quite understand what isn't working here.
I followed this code as a guide from the API for sol.main.get_metatable(type):


-- Somewhere in your main script, at initialization time:

local map_metatable = sol.main.get_metatable("map")
function map_metatable:add_overlay(image_file_name)
  -- Here, self is the map.
  self.overlay = sol.surface.create(image_file_name)
end

function map_metatable:on_draw(dst_surface)
  if self.overlay ~= nil then
    self.overlay:draw(dst_surface)
  end
end

-- Now, all your maps will have a function map:add_overlay() and an event
-- map:on_draw() that allows to draw an additional image above the map!
#13
Development / Re: How to configure game window
July 17, 2019, 02:37:09 AM
Thanks for the reply. I've been fiddling for a while but I'm having trouble understand how Solarus organizes scripts. If I want to put a camera:set_size() call in game:on_started(), what script file would I put it in? Or would I make a new script?
#14
Development / How to configure game window
July 16, 2019, 09:14:06 PM
Hello, I'm trying to do a Solarus recreation of Golden Axe Warrior on the Sega Master System, a Zelda clone that has since been considered a hidden gem of the system.
I am trying to adjust various aspects of the display such that it closely resembles the setup of the original game. You can see my project in Solarus and a screenshot of the original game at the imgur link on the bottom.
In the original game, the map only takes up part of the screen, and the rest of the screen is colored black. I would like to replicate this if possible. What scripts or files should I edit to achieve this?

https://imgur.com/a/bGcLKX6
#15
Game art & music / Re: Oracle of Seasons Tileset
July 04, 2019, 08:01:08 PM
That's really cool. I've been exploring the Solarus community and I keep thinking that it needs more resource packs. I've been working on putting together some Secret of Mana resources in my free time, but progress is slow. I'd be interested to help with this if you want to expand it to a more complete resource pack - I could help with adding NPCs, for instance.