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

#31
Development / Re: Thought experiment: Beamos
July 29, 2015, 05:39:00 PM
Quote from: Zeror on July 29, 2015, 02:27:26 PM
Quote from: Christopho on July 29, 2015, 09:37:04 AM
I made a Zora enemy recently, which throws three aligned fireballs, the principle is very similar. I shared the code in this topic. Maybe it can help!
We need a enemy script database on this site. So you can select and download each enemy you want.

This is actually a very good idea. A Link to the Past has so many different enemies that it will allow for a much better experience to play through a game in its style if one were to have access to as many enemies as possible.

I think the same could be said for the other items that are available in A Link to the Past, i.e.: Book of Mudora, the Medallions, Cane of Byrna, Magic Cape, Book of Mudora, etc. (I'm currently trying to produce the Book of Mudora; so far, I got the concept, sprites, and animation; I just have to continue studying up on the documentation to see how I can make it).
#32
Now I get this:
Error: In on_obtained_treasure: [string "maps/Map5.lua"]:25: attempt to call method 'set_item_assigned' (a nil value)
???
Why are these codes not working? I'm pretty much doing what I'm supposed to be doing and nothing. Something so simple as setting an item to a slot is taking me over a day to get to work. This is very frustrating...
#33
That's the thing; I did place it in a chest. I go to the chest first then go to the sensor to equip the item in the slot and nothing happens. I know it should be equipped because I know the sensor is working because I put some sounds to see if it's working. The sound happens but I can't use the item when hitting any of the keys (X or V).
#34
Okay, so I changed everything you told me and I got this as error:
Error: In on_activated: [string "maps/Map5.lua"]:5: attempt to call method 'get_item' (a nil value)
#35
Development / Trying to force equip a usable item.
July 29, 2015, 01:17:42 AM
Okay, so here's the code for the item:

local item = ...

function item:on_created()
  self:set_brandish_when_picked(true)
  self:set_savegame_variable("possession_book")
  self:set_sound_when_picked(nil)
  self:set_assignable(true)
end

function item:on_using()
   sol.audio.play_sound("bush")
end


It exists, has a dialogue, is set to assignable, and presumably everything else I need to be able to use it.

Playing around to see how the Solarus functions work, I made a sensor that will automatically assign that item (book) to one of the item keys like so:

local map = ...
local game = ...

function equipBook:on_activated()
   function game:set_item_assigned(1, book)
   end
end


So, I'm assuming that with the item created and everything specified, that this sensor will equip the item to slot 1 in order to use it (before going over to the item I'm opening a chest with the item to make sure the hero gets it). Unfortunately, I get this error:

Error: Failed to load script 'maps/Map5': [string "maps/Map5.lua"]:5: <name> or '...' expected near '1'
Error: In maps/Map5: attempt to call a string value

I have no idea why.
#36

  -- Keyboard testing
  function game:on_character_pressed(key)
   if key == "q" then
      sol.audio.play_sound("bush")
   end
  end


Thanks! Now I got it! With this I'm ever so closer to making my own menu system.
#37
Alright! Thanks a lot! Over 200 pages! Quite the read! Lol

Now I can print this and easily manage my study of it.
#38
Development / Re: New Enemy Features Code
July 28, 2015, 09:42:32 PM
That all seems like amazing work to be doing! Have you been able to implement them in your own game (or Mystery of Solarus, as you're basing it on)?
#39
Lol, no problem, dude; enjoy your vacation! If nobody is able to do this while you return to a faster internet connection then I guess you can do it. It's still a good resource to have anyways for those who may find themselves internetless  ;).
#40
Okay, so I put this inside of game_manager.lua (after where Christopho showed in the youtube tutorial on rupees):

-- Keyboard testing
  function keyboard()
   if game:on_key_pressed("q") then
      sol.audio.play_sound("bush")
   end
  end


I get no error.txt but again, I can't hear the sound I'm using to prove that the key is doing something when pressed. Again, I have no clue what to do...
#41
And that would be in which .lua? The game_manager.lua? Where exactly then do I use the corresponding code?

EDIT:
Okay, maybe I was too ambiguous:
I was using that code in a map.lua. If I want it to be global for the whole game, where/how would I go about doing it?
#42
Okay, so I won't be able to go to the Solarus documentation and do it myself, it would have to be either Christopho or Neovyse to do it and then host it somewhere?
#43
So I'm testing a custom screen and button configuration. So I'm literally stripping everything down to basics to see what I can accomplished. So far even the first step is proving to be quite the hurdle.


local map = ...

function map:on_started()
   if sol.input.is_key_pressed("q") then
      sol.audio.play_sound("bush")
   end
end


What I want to do with this (for the moment) is just to test if I can get an effect when pressing a key. I run the game, nothing happens when I press the "q" key on the keyboard yet I get no error.txt. So I know that at least the syntax is correct. I'm reading the documentation (the input) and sol.input.is_key_pressed("key") returns a boolean value so this should be working. I understand that Solarus automatically detects whether a key is being pressed so I don't have to go through all the work of coding the keyboard detection each time. So, my hypothesis was that this should've been enough. Apparently it isn't. What's wrong?
#44
Development / .pdf of the Solarus documentation?
July 28, 2015, 07:02:17 PM
I'm not always on my computer but I'd like to be able to study up on the Solarus documentation whenever possible. Does there exist a .pdf or other virtual book with the Solarus documentation? That way I can print it out and take it with me wherever I go. This will also help me highlight, index, bookmark, write notes alongside, etc. (anything I may want to do) - as if it were a physical book. I'm referring to the documentation that appears in the web browser when hitting the F1 key in the Solarus Quest Editor.

Thanks in advanced!
#45
Check line 2592 to see if it's there directly or check to see if you've correctly closed all functions.