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

#16
Well, my advice is to only load the visible files in the menu when required to show them (i.e. a scrolling menu where only three are shown at a time.), store the variable that you need into a list with in a list (arrays work too). This should spread out the load time to when the user attempts to access the other files additional files. Also, you should probably make it so that it sorts by most recently saved. Most users are not going to touch their old saves unless they want to show off their progress or just mess with it.

You could also attempt to use
Code ( lua) Select
local game_var = require("path/to/save/data.dat")
But don't know if that will work.
#17
General discussion / An example of the Engine.
March 11, 2017, 11:57:40 PM
So I decided to do a test of the engine. Here are the results.
https://youtu.be/bo6Eap4nXQM

The asssets (referring to graphics and music) used in this are ffomega's Hyrule map pack, some custom made sprites, some edits of sprites from alttp, and the remainder are just from ZSDX.

Code is mostly custom made but is based off the code from ZSDX and zelda ROTH SE.
#18
Game art & music / Re: Requesting
March 11, 2017, 04:36:23 PM
Try searching here if you want minish cap tiles, https://www.spriters-resource.com/game_boy_advance/thelegendofzeldatheminishcap/.
Great site for finding sprites and tiles of different games.

Also, house tiles can be found in ffomega's Full Hyrule tileset, which can be found at http://forum.solarus-games.org/index.php/topic,881.0.html
#19
Also, since the topic of errors has been brought up again, I would like to point out this tileset error in all of the dungeon tilesets.
Which should look like,
The red circle highlighting the issue. The outer corner lower cave walls use the incorrect tiling from the walls. (using the middle tile layer instead of the bottom.)
#20
Development / Re: Separator_on_activated direction4
February 14, 2017, 11:44:45 PM
Like Diarandor said, direction4 is a variable, here is how to use it. (This was typed before Diarandor's post had appeared.)

The function of separators "on_activated(direction4)" The information in the brackets are defined when they are called and should be stored in a variable like so:
Code (lua) Select
function generic_separator:on_activated(direction4)
  if direction4 == 3 then
  -- Your code here
  end
end

The reason this works is because when the engine calls this function, it stores the argument that you may need for a script in the variable.

However, one cannot have what they want the call back to be done like so,
Code (lua) Select
function generic_separator:on_activated(3)
  --Your code here
end

This does not work as putting the number three in the variable slot will produce an error as that slot is not for defining what you want that information to be, but rather for a variable that may change.
#21
Game art & music / Re: Game Over animation
February 02, 2017, 11:18:58 PM
The animation has an almost Castlevania vibe to it. Still see the potential for usage though.
#22
General discussion / Re: Pictures in posts
January 28, 2017, 02:54:55 AM
To have an image visible while browsing the forums without being logged-in require you to upload the image to another site (e.g. imgur) and posting the image link on the forums.
Like so;[img]http://i.imgur.com/VriPZoH.gif[/img] produces this ->
#23
Try setting the origin of the sprite to (8, 13).

The reason this happens is due to the fact that the engine hard codes rendering the sprite of a custom entity by rendering the origin of the image 8 pixels right and 13 pixels down from the top left corner of the entity instead of rendering at the center or rendering the sprite center horizontally and subtraction 3 pixels from the total entity size.
#24
Development / Re: How to specify custom attack sprite
December 29, 2016, 06:37:11 PM
Try using the sprite value that is given in the function.
Quote from: http://www.solarus-games.org/doc/1.5/lua_api_enemy.html#lua_api_enemy_on_custom_attack_receivedenemy:on_custom_attack_received(attack, sprite)

Called when this enemy receives an attack with a custom effect.

This function is called if you have set consequence of the attack to "custom". You have to define what happens, for example hurting the enemy, making a special reaction, etc.

attack (string): The attack that was received: "sword", "thrown_item", "explosion", "arrow", "hookshot", "boomerang" or "fire".
sprite (sprite): The sprite of this enemy that receives the attack, or nil if the attack does not come from a pixel-precise collision.

So to run the function I would do,
Code (lua) Select
function enemy:on_custom_attack_received(attack, sprite)
  if attack == "thrown_item"
    and sprite:get_animation_set() == "entities/boss3block" then
    enemy:hurt(1)
    enemy:remove_life(1)
  end
end
#25
Development / Re: Pickable Item with No Shadow
December 25, 2016, 12:31:16 AM
Try this:
Code (lua) Select
item:set_shadow(nil)
nil is a non-existent value and that is what the engine is searching for in this method. It should work as I just ran a quick test in a quest that I'm building from scratch.
#26
Your scripts / Re: [UPDATE 1.1] Dash Required Blockade
November 01, 2016, 10:53:15 PM
Quote from: ffomega on November 01, 2016, 05:26:18 PM
Could you maybe show us an example or maybe how to implement it?
The way that I had implemented the script was by putting it into the entities folder. I guess I never explained how to set it up properly.

Quote from: ffomega on November 01, 2016, 05:26:18 PM
If you can I'd love to add this file to my Full Hyrule entities pack, which includes 8 different dash rock types to use.
There are few edits I would make when using your entities pack. In order for your rocks in the pack to look correct, the origin for the animations needs to be adjusted a bit. Specifically, an origin of x = 16, y = 13. The destroy animation has to have it's own origin of x = 16 and y = 21 to look correct when using this script as of solarus 1.5.0.

Quote from: ffomega on November 01, 2016, 05:26:18 PM
Also, if there is a way, could this script be modified to be a "Left Level Required" blockade like the large rocks in LttP?
Yes, this should be simple to implement. Just a few additional lines of code to add a check for that are necessary for the script, and another function to preform in the Lua file of the map that the entity is on.

I'll start working on the improvement right away.
#27
Your scripts / [UPDATE 1.2] Dash Required Blockade
October 28, 2016, 03:52:51 AM
Today I present to you, the Rock pile script for rock stacks from alttp or other entities with similar behaviors.

Requires the multi-event script which one can find HERE! http://forum.solarus-games.org/index.php/topic,784.0.html

Code (lua) Select
-- Rockstack script ment for rock piles similar to those in alttp.
--
-- Requires the muti-event script for full functionality.
-- which can be found here;
--
-- This script is a custom entity script and provides the functions:
-- custom_entity:keep_existing() which tells the script to respawn the
-- rockstack after being destoryed.
--
-- custom_entity:get_value() which will return the value of where this
-- entity's destoryed mem state is stored in the save data.
--
-- custom_entity:lift_requirement(lvl)
-- lvl - sets the lifting ability that the hero needs
-- inorder to topple the rockstack.
--
-- Made by yoshimario2000.
-- Version 1.2

-- Local required varables for this script to function properly.

local entity = ...
local game = entity:get_game()
local map = entity:get_map()
local hero = entity:get_game():get_hero()
local name = entity:get_name()

local exist_kep = false
local lvl_chk = 0

local underlayer = map:has_entity(entity:get_name() .. "_destroy")
local remains_exist = map:has_entity(entity:get_name() .. "_remains")

--
function lift_requirement(lvl)
  if lvl >= 0 then
    lvl_chk = lvl
  else
    lvl_chk = 0
  end
end

-- Call if you wish for this entity to respawn after leaving the map.
function keep_existing()
  exist_kep = true
end

-- Call to get the game var state of this entity.
function get_value()
  local map_id_new = string.gsub(entity:get_map():get_id(), "/", "__")

  return map_id_new .. "_" .. entity:get_name() .. "_destoryed"
end

--

local function destroy_self()
  if remains_exists then
    map:get_entity(entity:get_name() .. "_remains"):set_enabled(true)
  end
  if underlayer then
      map:get_entity(entity:get_name() .. "_destroy"):set_enabled(false)
  end

  -- If your sprite has a diffrent animation for being destoryed, change the string "destroy"  into that animation id.
  entity:get_sprite():set_animation("destroy", function()
    print("setting game value: " .. get_value())

    -- code for checking if to continue existing afterwards.
    if not exist_kep then
      game:set_value(get_value(), true)
    end
    entity:set_enabled(false)
  end)
end

-- Event called when the custom entity is initialized.
function entity:on_created()
  entity:set_modified_ground("wall")

  -- code for self removale if the rockstack has already been rammed.
  if game:get_ability("lift") >= lvl_chk then
    if game:get_value(get_value()) then
      if underlayer then
        map:get_entity(entity:get_name() .. "_destroy"):remove()
      end
      entity:remove()
    end
  end
end

-- If you wish to preform the checks another way, please feel free to do so.
-- this was the best way that I could come up with personally though.
map:register_event("on_update", function()
  if map:has_entity(name) then
    if entity:overlaps(hero, "facing") and hero:get_state() == "running" then
      destroy_self()
    end
  end
end)


To use this script, put the code into a .lua file in the entities folder of your quest's data.

Feel free to change some of the code around to better fit how you wish for the code to be run.

Edit: Updated for a few bug fixes and improvements in functionality.
#28
Beautiful! I foresee myself using that sometime in the future.
#29
Development / Re: [Help] Sprite rendering
September 20, 2016, 02:07:33 AM
Well, Seeing as that improved built-in functionality probably won't happen until 1.6 or something, I think I'll just go the custom entity route. Shouldn't be hard right?
#30
Development / Re: [Help] Sprite rendering
September 20, 2016, 12:43:35 AM