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

Just as the boomerang has speed and distance parameters, it would be nice to have at least a distance parameter for the hookshot. That way it can be enhanced into the longshot or something similar. I know it was mentioned by Christopho that the hookshot isn't customizable yet. Maybe this can be something for a future version? Something along the lines of hero:start_hookshot(max_distance).

Also, a customizable bow. The engine has the bow shoot an arrow entity. But maybe there could be a selection of entities to choose? At least entities of type "arrow"? That way one could have a bow that shoots regular arrows, silver arrows, fire arrows, ice arrows, light arrows, bomb arrows, etc. Maybe there could be a specific entity called "arrow" and it has some variants that can be edited? That way the command could be hero:start_bow(variant) and the variants chosen in the graphics for the arrow sprite. I think that would be awesome. Of course, this wouldn't just be for graphical effects. Since the bow will have variants there could be scripts that call this variant in order to check and reduce for magic when using a magic arrow, or checks for bombs also when using a bomb arrow. The entity could also have scripts that check on it in the case of a fire arrow, ice arrow, light arrow, etc.
Okay, so thanks to several members (particularly Maxs) I've been able to do some steady progress with items. I think I'm getting the hang of how all of this works. Here's an example:

I'm working on making the Book of Mudora. So far I've been able to get the hero to take the book out and read it with this code:

function item:on_using()
   game:start_dialog("book.test", nil, function ()

However, we all know that the book only works in front of places written in Hylian script in order to translate. So what I'd really like the code to do is to just give an error sound when used in an inappropriate place. Simple enough. I can simply do that instead of doing what's done in the previous function. However, I do want it to be used when translating Hylian text. Now, with items, you can use them when in contact with certain npcs thanks to 'item:on_npc_interaction_item(npc,item)'. So this is what I came up with:

local sign = item:get_map():get_entity():get_name()

function item:on_npc_interaction_item(sign,item)
   if sign == "ForestSign" then
      game:start_dialog("book.translation", nil, function ()

However, I get this error:
QuoteError: In items/book: [string "items/book.lua"]:4: bad argument #1 to 'get_map' (sol.item expected, got no value)

So I'm pretty lost as to what to do, lol. As long as I erase the 'sign' variable declaration and the function that interacts with npcs, I get no error. So I know it's in that part of the script.
Development / Assigning Hotkeys to Items
July 30, 2015, 02:16:31 AM
Okay, so I'm testing and I want to be able to quickly go to items - more specifically, hit a key on the keyboard and the same effect as using the item occurs - regardless if the hero has the item or not. I've got the key to work. What I'm doing is using

-- Keyboard testing
  function game:on_character_pressed(key)
   if key == "q" then

inside of quest_manager.lua. The book.lua it's opening is just this:

local item = ...
local game = item:get_game()

game:start_dialog("book.test", nil, function()

and I get the following error:
QuoteError: In book: [string "book.lua"]:2: attempt to index local 'item' (a nil value)
This is an error I keep getting constantly and I really have no idea why. Apart from this error everything else seems to be working. I just gotta overcome this obstacle.
I'm trying to develop a system for the Iron Boots item (like in Ocarina of Time) and I'm able to get it working with sensors because items can't be used during swimming. Is the nullification of item use during swimming hardcoded in Solarus's engine or is there a way to set an item that it can only be used when swimming?
I know this is laziness, but sometimes if there are a lot of maps in a folder and you want to see the script for a map, you have to go all the way to find the map then right click and open its lua. Maybe the map editor could have a button somewhere where you can simply click it and its lua will open. Maybe this button could be in between the Music tab and the tileset window?

Don't know if it would be too much work to do but I think that this could be very helpful for those projects with tons of maps.
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()

function item:on_using()"bush")

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)

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.
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"bush")

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?
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!
So far the destructible objects have many features (Cutting the object, Exploding, and Regeneration) in particular. Maybe for the next update there can be an Indestructible feature where when you throw the destructible object, it doesn't break. It just lands on the ground again. It could also be lifted again. I know this could be done with scripting (Diarandor is working on it with even a bouncing feature after landing) but maybe it could be something default for the destructible entity like Exploding, Cutting, and Regeneration is. At least be done in the sense of just landing instead of breaking (and no bouncing).
I want to create a dynamic tile that moves to the right in an infinite loop. Here's what I got for code:

local map = ...

function map:on_started()
      local movement = sol.movement.create("straight")
      function loop()

The dynamic tile, MovingFloor, is located on 0,96. I want it to move to -256 and then go back to 0,96 to start all over. What am I doing wrong? Hopefully nothing too horribly wrong, lol  :P
I've loved all the tutorial videos on youtube on how to do most of the important things for Solarus involving a quest. However, I'm very anxious to see a Screen tutorial. Apart from menus, I believe this is super important for a quest. It's how you see the map, change keys, equip items, etc. In the mean time (besides the documentation - which is top notch, by the way) where can I go or what can I read that pinpoints and specifies what I need to do to make an inventory screen? Even a rudimentary one. I'm currently designing them and working on the graphics so I can at least occupy my efforts on that. But the programming... Any assistance? I've seen your code for Solarus and while it's very intuitive (great organization and comments) I would still like to see more ways of getting it done, I guess? Thanks in advanced!
I'm trying to recreate the giant stone (the one that's 32x32). I was able to do everything adequately (using the script for lifting other stones (the 16x16 ones)). However, since it's an entity with sprite, only 16x16 of it is like a wall and the rest of it the hero will either go above or behind. Is there a way to make sprites be 100% wall-like as if it were a map tile?
Development / Special characters in text
July 23, 2015, 04:01:14 AM
I don't know if this question was answered or not (used the search tool of the forum but to no avail  :-[), but how do I get special characters to appear in the text in dialogues? For example, directional arrows, the Link face, Hylian text, etc.

Thanks in advanced!