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

Topics - YoshiMario2000

#1
Development / blend modes
March 13, 2017, 02:23:49 AM
So I was working on a new light_manager script for my quest, but I've run into an issue with (what I think is) an engine limitation.
I'm trying to get it so that one surface applies to another while inverting it's alpha channel content (Opaque becomes transparent and transparent becomes Opaque). I'd write an algorithm myself in lua, but It would seem (Unless I'm missing something), that this is impossible for the moment.
#2
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.
#3
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.
#4
Development / [Help] Sprite rendering
September 18, 2016, 09:25:30 PM
Wondering If I can change they way sprites are rendered. Rather than having a sprite that has a higher Y-value than the hero be rendered over them, I want the sprite to be rendered beneath the hero.
#5
Development / Help with custom entity code.
September 14, 2016, 12:29:34 AM
So, what I want to do is create a custom method for a custom entity in it's code.
But, The way I was attempting to do it, proved that I wasn't able to do it how I wanted to.

It apears that I can't just call the method from outside the code.

Code of the custom entity.
Code (lua) Select
local entity = ...
local game = entity:get_game()
local map = entity:get_map()
local sprites = entity:get_sprites()
local val = game:get_value("RED_BLOCKADE") or true

function entity:on_created()
  self:bring_to_back()
  self:set_traversable_by(false)
end

function entity:RED_on_activated()
  if val then
    self:set_traversable_by(true)
    sprites:set_animation("lowering", "lowered")
    val = false
  else
    self:set_traversable_by(false)
    sprites:set_animation("raising", "raised")
    val = true
  end
end


Code of Manager for custom entity.
Code (lua) Select
-- use blockademanager = require("scripts/blockades")
-- and then run blockademanager:swap_color_m(specifiedcolor, map)


local blockademanager = {}

function blockademanager:swap_color_m(color, map)
  local game = map:get_game()
  if color == nil then
    error("No value specified in the colorswap function. Please specify.")
  elseif color:upper() == "RED" then
    if game:get_value("RED_BLOCKADE") == nil then
      game:set_value("RED_BLOCKADE", true)
    else
      game:set_value("RED_BLOCKADE", not game:get_value("RED_BLOCKADE"))
    end
    print(game:get_value("RED_BLOCKADE"))
    if map:get_entities_count("RED_BOCKADE_") >= 1 then
      for i in map:get_entities(map:get_entities_count("RED_BOCKADE_")) do
        i:RED_on_activated()
      end
    end
  else
    error("Value on the BLOCKADE colormode switch function given an invalid value. Doing nothing.")
  end
end

return blockademanager


And if your wondering why I don't just put the code into the library. It is because I have two variants of each color. Goal is to replace the built-in system of crystals and blocks.

The sprites are attached below.
#6
Game art & music / Boxes
August 10, 2016, 10:26:35 PM
I created some boxes. Meant to give the player access to customization during their playtime.
Enjoy!
#7
Was working on some menu sprites for a project and made these.
I will be using them I a future project, but for now, you can use them.
Feel free to use them.

(Might have to login to view.)
#8
Development / Another Random Suggestions Post
April 10, 2016, 02:49:23 AM
1. The ability to customize the hero's hit box size
    Should be self explanatory, one may have a hero with a different size than normal, so they want to customize it's size.
2. True Custom Hero naming conventions
    I could be wrong if this has already been changed in 1.5 dev, but I have noticed while browsing the API for the LUA system that the hero's sprite is always Tunic#, Which can be annoying if one wants to have a custom management system for the hero and different sprites for the tunic.
  EX: Say one wants to have a system where you play as multiple heros, and have different variations for each hero. It is possible to do that with the current system, But they would have to keep track of what hero is what tunic ID and variation.

If anything I have specified is already possible, point it out. I want to be able to use this engine greatly and well.

Edit: OK, So I figured out that one can fully customize the hero's tunic sprites just fine. So suggestion 2 can be Eliminated.
#9
Development / [Suggestion] Better Slopes
January 30, 2016, 02:58:56 AM
I was messing around with a map that had a tile set with walls that were slopes that weren't square,
And I got an error message when I attempted to load that map in game.

Fatal: Invalid tile pattern: a tile pattern with a diagonal wall must be square
Error: In on_key_pressed: [string "main.lua"]:26: Internal error: Invalid tile pattern: a tile pattern with a diagonal wall must be square
Note: I setup the main.lua to open the map with a key press, Primary for debugging purposes.

It seems like one of toughs silly things that haven't been coded into the game,
Maybe have the engine create the slopes dynamically for the requirements of the tiles?
#10
Your projects / [Enemy] Clay Rocket
November 05, 2015, 02:24:27 AM
Simple enemy I made for my project,
Also somewhat of a pain due to my noobness at programming.

Code (lua) Select

local enemy = ...
local map = enemy:get_map()
local self = enemy

function enemy:on_created()
  self:set_life(1)
  self:set_damage(6)
  self:create_sprite("enemies/ClayRocket1")
  self:set_size(16, 16)
  self:set_invincible()
  self:set_can_hurt_hero_running(true)
end

-- Objesct is to get the rocket to fire from the cannon
local function Move()
  local angle = self:get_sprite():get_direction()
  local m = sol.movement.create("straight")
  m:set_speed(128)
  m:set_angle(angle)
  m:start(self)
end

function enemy:on_restarted()
  Move()
end

-- The Goal is to get the rocket to expolde on impact of a wall.
function enemy:on_obstacle_reached(movement)
  local x, y, layer = enemy:get_position()
  map:create_explosion{
layer = layer,
x = x,
y = y
}
  sol.audio.play_sound("explosion")
  self:remove()
end


Bit of advice, Use a switch, sensor, and/or auto-spawn to use these rockets.
They start moving as soon as they are active in the map.

Also on line 8,
Put the string where you saved the attachments below.
#11
What I'm saying to have an option when your holding Ctrl down to not select certain tiles when mutiselecting due to misclicks,
or have the click and drag function not select certain tiles for the ease of map editing, and not by dragging it to a different area.

Example: editing a large map with a hole in the background that a tile,
I want to use the layer that the hole is in while still not having to move it if I want to select multiple things at once.
#12
Development / Customizing items sprites for menus and inv.
September 20, 2015, 11:52:16 PM
Is it possible to have different sprites for items in the overworld than in your inventory,
I imagine that this is possible, But I haven't tried it my self.
#13
Bugs & Feature requests / REQUEST Direction decetion
August 23, 2015, 09:10:54 PM
Can you add a function for On_direction change and the ability to detect the direction that the npc/enemy change. So for things that have uneven directions like 8x16 or 16x32.
#14
Error: Failed to load data file: [string "data file"]:2592: '}' expected (to close '{' at line 2588) near ']'

I have no idea what this means. Or where to fix it.
#15
Bugs & Feature requests / [AFR] Map to image.
July 27, 2015, 04:00:28 PM
You know, It would be nice to have the ability to save your map as an image (preferably a .png) So making maps wouldn't be as hard.
You'll still have to Polish it and everything, but it could be useful as a placeholder and Would actually help a lot in making good maps.

Still IT's a request, It don't HAVE to be done, It's something that adds polish to the editor.

By the way, How did you get the images for SolarusDX's Map images for the Text-based walk though. (I used google translate.)
(By the way AFR stands for ANOTHER FEATURE REQUEST.)
#16
Development / Updating from 1.3 to 1.4?
July 12, 2015, 02:07:08 AM
Extactly what do I need to do inorder to update to 1.4 from 1.3?
(this Question is a little late...)

I'm using ubuntu for my OS. Anything else I need for updating?
#17
Development / Bubble + boomerang = fairy?
June 13, 2015, 06:02:18 PM
Is it possible to trow a boomerang at a bubble and get a fairy?
#18
Development / Tunic damage editing?
June 07, 2015, 11:23:02 PM
would it be possible to change how much damage the player takes based on tunic level?
Because sifting though solarus DX's fires shows that the sword has damage variants.
Is the tunic connected to that?
#19
Your projects / Legend of Zelda; A fishy tale
June 03, 2015, 03:16:25 AM
Here's a project That I am currently working on.
I'm currently working with the title "A fishy tale."

As you can probably see, It's still in early alpha.
Please report any and all bugs you can find. Also, Error.txt data also helps.
Updated to 1.4.2
Download Link:
Google drive files
I'll add photos and development things here as I go along.

Edit: oh and before I forget, Most of the stuff In the project that seem to come from Mystery of Solarus DX is from there.
This is technically a modified version of that. But I plan to become more of My own thing as I get farther into the game.

So credits to the solarus team for the Mystery of Solarus DX and who ever made the Heart Meter used in here.
#20
Development / A few Questions.
May 31, 2015, 11:55:05 PM
Is it possible to set the hero textures and hit box set to 16x16 or no?

Support for ubuntu on 1.4.1 without using wine?

Possible to set how much damage the player receives when wearing a certain tunic?
For like support for both male and female heroes?