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
  1. -- Rockstack script ment for rock piles similar to those in alttp.
  2. --
  3. -- Requires the muti-event script for full functionality.
  4. -- which can be found here;
  5. --
  6. -- This script is a custom entity script and provides the functions:
  7. -- custom_entity:keep_existing() which tells the script to respawn the
  8. -- rockstack after being destoryed.
  9. --
  10. -- custom_entity:get_value() which will return the value of where this
  11. -- entity's destoryed mem state is stored in the save data.
  12. --
  13. -- custom_entity:lift_requirement(lvl)
  14. -- lvl - sets the lifting ability that the hero needs
  15. -- inorder to topple the rockstack.
  16. --
  17. -- Made by yoshimario2000.
  18. -- Version 1.2
  20. -- Local required varables for this script to function properly.
  22. local entity = ...
  23. local game = entity:get_game()
  24. local map = entity:get_map()
  25. local hero = entity:get_game():get_hero()
  26. local name = entity:get_name()
  28. local exist_kep = false
  29. local lvl_chk = 0
  31. local underlayer = map:has_entity(entity:get_name() .. "_destroy")
  32. local remains_exist = map:has_entity(entity:get_name() .. "_remains")
  34. --
  35. function lift_requirement(lvl)
  36.   if lvl >= 0 then
  37.     lvl_chk = lvl
  38.   else
  39.     lvl_chk = 0
  40.   end
  41. end
  43. -- Call if you wish for this entity to respawn after leaving the map.
  44. function keep_existing()
  45.   exist_kep = true
  46. end
  48. -- Call to get the game var state of this entity.
  49. function get_value()
  50.   local map_id_new = string.gsub(entity:get_map():get_id(), "/", "__")
  52.   return map_id_new .. "_" .. entity:get_name() .. "_destoryed"
  53. end
  55. --
  57. local function destroy_self()
  58.   if remains_exists then
  59.     map:get_entity(entity:get_name() .. "_remains"):set_enabled(true)
  60.   end
  61.   if underlayer then
  62.       map:get_entity(entity:get_name() .. "_destroy"):set_enabled(false)
  63.   end
  65.   -- If your sprite has a diffrent animation for being destoryed, change the string "destroy"  into that animation id.
  66.   entity:get_sprite():set_animation("destroy", function()
  67.     print("setting game value: " .. get_value())
  69.     -- code for checking if to continue existing afterwards.
  70.     if not exist_kep then
  71.       game:set_value(get_value(), true)
  72.     end
  73.     entity:set_enabled(false)
  74.   end)
  75. end
  77. -- Event called when the custom entity is initialized.
  78. function entity:on_created()
  79.   entity:set_modified_ground("wall")
  81.   -- code for self removale if the rockstack has already been rammed.
  82.   if game:get_ability("lift") >= lvl_chk then
  83.     if game:get_value(get_value()) then
  84.       if underlayer then
  85.         map:get_entity(entity:get_name() .. "_destroy"):remove()
  86.       end
  87.       entity:remove()
  88.     end
  89.   end
  90. end
  92. -- If you wish to preform the checks another way, please feel free to do so.
  93. -- this was the best way that I could come up with personally though.
  94. map:register_event("on_update", function()
  95.   if map:has_entity(name) then
  96.     if entity:overlaps(hero, "facing") and hero:get_state() == "running" then
  97.       destroy_self()
  98.     end
  99.   end
  100. 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.

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
  1. local entity = ...
  2. local game = entity:get_game()
  3. local map = entity:get_map()
  4. local sprites = entity:get_sprites()
  5. local val = game:get_value("RED_BLOCKADE") or true
  7. function entity:on_created()
  8.   self:bring_to_back()
  9.   self:set_traversable_by(false)
  10. end
  12. function entity:RED_on_activated()
  13.   if val then
  14.     self:set_traversable_by(true)
  15.     sprites:set_animation("lowering", "lowered")
  16.     val = false
  17.   else
  18.     self:set_traversable_by(false)
  19.     sprites:set_animation("raising", "raised")
  20.     val = true
  21.   end
  22. end

Code of Manager for custom entity.
Code: Lua
  1. -- use blockademanager = require("scripts/blockades")
  2. -- and then run blockademanager:swap_color_m(specifiedcolor, map)
  5. local blockademanager = {}
  7. function blockademanager:swap_color_m(color, map)
  8.   local game = map:get_game()
  9.   if color == nil then
  10.     error("No value specified in the colorswap function. Please specify.")
  11.   elseif color:upper() == "RED" then
  12.     if game:get_value("RED_BLOCKADE") == nil then
  13.       game:set_value("RED_BLOCKADE", true)
  14.     else
  15.       game:set_value("RED_BLOCKADE", not game:get_value("RED_BLOCKADE"))
  16.     end
  17.     print(game:get_value("RED_BLOCKADE"))
  18.     if map:get_entities_count("RED_BOCKADE_") >= 1 then
  19.       for i in map:get_entities(map:get_entities_count("RED_BOCKADE_")) do
  20.         i:RED_on_activated()
  21.       end
  22.     end
  23.   else
  24.     error("Value on the BLOCKADE colormode switch function given an invalid value. Doing nothing.")
  25.   end
  26. end
  28. 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
  1. local enemy = ...
  2. local map = enemy:get_map()
  3. local self = enemy
  5. function enemy:on_created()
  6.   self:set_life(1)
  7.   self:set_damage(6)
  8.   self:create_sprite("enemies/ClayRocket1")
  9.   self:set_size(16, 16)
  10.   self:set_invincible()
  11.   self:set_can_hurt_hero_running(true)
  12. end
  14. -- Objesct is to get the rocket to fire from the cannon
  15. local function Move()
  16.   local angle = self:get_sprite():get_direction()
  17.   local m = sol.movement.create("straight")
  18.   m:set_speed(128)
  19.   m:set_angle(angle)
  20.   m:start(self)
  21. end
  23. function enemy:on_restarted()
  24.   Move()
  25. end
  27. -- The Goal is to get the rocket to expolde on impact of a wall.
  28. function enemy:on_obstacle_reached(movement)
  29.   local x, y, layer = enemy:get_position()
  30.   map:create_explosion{
  31.         layer = layer,
  32.         x = x,
  33.         y = y
  34. }
  36.   self:remove()
  37. 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.

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