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.

Topics - YoshiMario2000

Pages: [1] 2
Development / blend modes
« on: 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.

General discussion / An example of the Engine.
« on: March 11, 2017, 11:57:40 pm »
So I decided to do a test of the engine. Here are the results.

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.

Your scripts / [UPDATE 1.2] Dash Required Blockade
« on: 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!,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
    lvl_chk = 0

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

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


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

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

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

  -- 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()

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

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.

Development / [Help] Sprite rendering
« on: 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.

Development / Help with custom entity code.
« on: 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()

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

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)
      game:set_value("RED_BLOCKADE", not 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
    error("Value on the BLOCKADE colormode switch function given an invalid value. Doing nothing.")

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.

Game art & music / Boxes
« on: August 10, 2016, 10:26:35 pm »
I created some boxes. Meant to give the player access to customization during their playtime.

Game art & music / Some Generic Equipment Items I made
« on: May 25, 2016, 02:24:11 am »
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.)

Development / Another Random Suggestions Post
« on: 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.

Development / [Suggestion] Better Slopes
« on: 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.

Code: [Select]
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?

Your projects / [Enemy] Clay Rocket
« on: 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_size(16, 16)

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

function enemy:on_restarted()

-- 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()
layer = layer,
x = x,
y = y

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.

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.

Development / Customizing items sprites for menus and inv.
« on: 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.

Bugs & Feature requests / REQUEST Direction decetion
« on: 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.

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.

Bugs & Feature requests / [AFR] Map to image.
« on: 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.)

Pages: [1] 2