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.


Messages - Porksteak

Pages: [1] 2
1
Development / Audio buffer error
« on: July 28, 2020, 05:41:23 AM »
Error: Failed to fill the audio buffer with decoded OGG data

Does anyone know what this error means and how to fix it?

2
Development / Is it possible to edit explosion damage?
« on: May 16, 2020, 08:04:11 PM »
Is it possible to make the default explosion do more damage?

3
Development / Re: Prevent attack command from attacking
« on: August 26, 2019, 03:03:50 PM »
Just temporarily depending on if the hero has enough stamina to attack

4
Development / Prevent attack command from attacking
« on: August 23, 2019, 05:46:06 AM »
Is there to make it so the attack command being pressed stops the hero from attacking? I've tried using on_command_pressed(), on_state_changed() and on_stage_changing() but nothing seems to be working for me.

5
Development / Enemy sprite layers
« on: August 12, 2019, 02:05:28 PM »
Hi I was wondering if it would be possible to have an enemy with multiple sprites with one of the sprites being on a higher layer than the others

6
Development / Transparent dynamic tiles
« on: May 26, 2019, 05:44:20 PM »
Is it possible to change the opacity of dynamic tiles? Or would it only be possible by having two sets of tiles with one being opaque and one being transparent?

7
Development / 1.6
« on: June 25, 2018, 10:14:24 PM »
Hi, I'm just curious about if there is an ETA on 1.6? I've been anticipating it for a while and was just curious

8
Development / How to make hero hurt while swimming
« on: June 13, 2018, 05:24:12 PM »
I'm trying to make it so the hero can get hurt while swimming, but whenever he is hurt he goes back to his not swimming animation. I tried making it so that when the state is changed to hurt and his animation was swimming he would instead use a swimming hurt animation but this didn't work.

9
Development / how can you draw similarly to the light_manager
« on: June 01, 2018, 05:43:21 AM »
How can you make a drawable while using the light manager? Basically what I want to do is have a dark room, and rather than lighting a torch making the room lit, it would make a circle of light surrounding the torch. How can I do this?

10
Development / Trail of dust without walking
« on: November 11, 2017, 01:01:01 AM »
Is there a way to make the trail of dust that appears when using the run ability to appear when just walking normal?

11
Development / Re: Item command held on item?
« on: June 28, 2017, 04:25:46 AM »
Yeah, but the problem is the unfreeze() is in the on_command_released function, but when the key is released nothing happens and the hero stays frozen

12
Development / Re: Item command held on item?
« on: June 20, 2017, 05:20:58 PM »
I started the item, but I can't get the command released function to work so the hero stays frozen

This is function:on_using()
Code: ( lua) [Select]
function item:on_using()
local map = game:get_map()
local hero = game:get_hero()

local direction = hero:get_direction()




  if game:is_command_pressed("item_1") or game:is_command_pressed("item_2") then
  state = 1
      if blastlevel < 4 then
    timer = sol.timer.start(2000, function()
      blastlevel = blastlevel + 1
    return true
    end)
  end
  end



    if game:get_item_assigned(2) == "blast" and not game:is_command_pressed("item_2") and state == 1 then
      game:simulate_command_released("item_2")
    end

    if game:get_item_assigned(1) == "blast" and not game:is_command_pressed("item_1") and state == 1 then
      game:simulate_command_released("item_1")
    end


end


function game:on_command_released(command)
  if command == "item_1" or "item_2" then
    timer:stop()
    hero:unfreeze()
    item:fire_blast()
  end
end

13
Development / Item command held on item?
« on: June 19, 2017, 04:12:22 PM »
Hi I wanted to try and make some kind of energy blast attack that gets stronger the longer you hold it. Is there a way in the item to check if the specific item key that the item is assigned to is being held down?

14
Development / Stopping npcs
« on: May 13, 2017, 04:35:53 PM »
Is there a way to make it so usual npcs stop when they collide with another usual npc the way that they stop when they collide with a generalized npc? I'm trying to two npcs walk in a circle, but if one of the npcs is stopped the other one will just walk right through it.

15
Development / custom entity hero movement
« on: March 22, 2017, 03:46:21 AM »
Hi, I was trying to make a custom ice entity that can be used for sliding ice puzzles, but after the hero slides on one and stops he is able to walk for a bit before he is forced into the slide again. Is there a certain collision test that can be done or something?

Code: ( lua) [Select]
local entity = ...
local map = entity:get_map()
local pushing = false
local block_on_switch = false
local lava_crust, ice_patch
local hero = entity:get_map():get_entity("hero")

-- Ice block: special block made of ice that can fill an
-- ice pit, turn lava solid, and freeze water.

function entity:on_created()
  self:set_size(16, 16)
  self:snap_to_grid()
  self:set_modified_ground("traversable")
  self:set_traversable_by("hero", true)
  self:create_sprite("entities/icepatch")

  self:add_collision_test("facing", function(self, other)
    if other:get_type() == "hero" and not pushing then
      pushing = true
      local m = sol.movement.create("path")
      m:set_ignore_obstacles(false)
      m:set_snap_to_grid(true)
      m:set_speed(120)

      hero:freeze()       
 
      local sx, sy, sl = self:get_position()
      if other:get_direction() == 0 then
        if map:get_ground(sx+8,sy,sl) ~= "wall" and map:get_ground(sx+16,sy,sl) ~= "wall" then m:set_path({0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}) end
      elseif other:get_direction() == 1 then
        if map:get_ground(sx,sy+8,sl) ~= "wall" and map:get_ground(sx,sy+16,sl) ~= "wall" then m:set_path({2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}) end
      elseif other:get_direction() == 2 then
        if map:get_ground(sx-8,sy,sl) ~= "wall" and map:get_ground(sx-16,sy,sl) ~= "wall" then m:set_path({4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4}) end
      elseif other:get_direction() == 3 then
        if map:get_ground(sx,sy-8,sl) ~= "wall" and map:get_ground(sx,sy-16,sl) ~= "wall" then m:set_path({6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6}) end
      end
      m:start(other, function() pushing = false hero:unfreeze() end)
    end
  end)

  self:add_collision_test("overlapping", function(self, other)
    if other:get_type() == "switch" then
      block_on_switch = true
      other:set_activated(true)
      if other:on_activated() ~= nil and not other.active then
        other:on_activated()
        other.active = true
      end
      sol.timer.start(map, 1000, function()
        if block_on_switch then
          return true
        else
          block_on_switch = false
          other:set_activated(false)
          if other:on_inactivated() ~= nil and other.active then
            other:on_inactivated()
            other.active = false
          end
        end
      end)
    elseif other:get_type() == "hole" then
      sol.audio.play_sound("hero_falls")
      self:remove()
    elseif other:get_type() == "fire" then
      sol.audio.play_sound("ice_melt")
      self:remove()
    elseif other:get_type() == "explosion" then
      sol.audio.play_sound("ice_melt")
      self:remove()
    else
      block_on_switch = false
    end
  end)

  local sx, sy, sl = self:get_position()
  self:on_position_changed(sx, sy, sl)
end

function entity:on_position_changed(x, y, layer)
  for e in map:get_entities("") do
    if e:get_type() == "dynamic_tile" then
      if self:overlaps(e) then --if block overlaps dynamic tile
        if map:get_ground(e:get_position()) == "lava" then
          self:remove()
  if map:get_hero():get_direction() == 0 then
            lava_crust = map:create_custom_entity({ x=x+8, y=y-16, layer=layer, width=32, height=32, direction=0 })
  elseif map:get_hero():get_direction() == 1 then
            lava_crust = map:create_custom_entity({ x=x-16, y=y-48, layer=layer, width=32, height=32, direction=0 })
  elseif map:get_hero():get_direction() == 2 then
            lava_crust = map:create_custom_entity({ x=x-40, y=y-16, layer=layer, width=32, height=32, direction=0 })
  elseif map:get_hero():get_direction() == 3 then
            lava_crust = map:create_custom_entity({ x=x-16, y=y, layer=layer, width=32, height=32, direction=0 })
  end
          lava_crust = map:create_custom_entity({ x = x, y = y, layer = layer, width = 32, height = 32, direction = 0 })
          lava_crust:snap_to_grid()
          sol.audio.play_sound("freeze")
          lava_crust:create_sprite("entities/lava")
          lava_crust:set_modified_ground("traversable")
          lava_crust:set_traversable_by("hero", true)
          lava_crust:set_traversable_by("enemy", true)
          lava_crust:set_traversable_by("block", true)
  sol.timer.start(map, 15000, function() lava_crust:remove() end)
        elseif map:get_ground(e:get_position()) == "deep_water" then
          self:remove()
  if map:get_hero():get_direction() == 0 then
            ice_patch = map:create_custom_entity({ x=x+8, y=y-16, layer=layer, width=32, height=32, direction=0 })
  elseif map:get_hero():get_direction() == 1 then
            ice_patch = map:create_custom_entity({ x=x-16, y=y-48, layer=layer, width=32, height=32, direction=0 })
  elseif map:get_hero():get_direction() == 2 then
            ice_patch = map:create_custom_entity({ x=x-40, y=y-16, layer=layer, width=32, height=32, direction=0 })
  elseif map:get_hero():get_direction() == 3 then
            ice_patch = map:create_custom_entity({ x=x-16, y=y, layer=layer, width=32, height=32, direction=0 })
  end
          sol.audio.play_sound("freeze")
          ice_patch:create_sprite("entities/ice")
          ice_patch:set_modified_ground("ice")
          ice_patch:set_traversable_by("hero", true)
          ice_patch:set_traversable_by("enemy", true)
          ice_patch:set_traversable_by("block", true)
  sol.timer.start(map, 15000, function() ice_patch:remove() end)
        end
      end
    elseif e:get_type() == "wall" or e:get_type() == "hole" then
      hero:unfreeze()
      e:stop_movement()
    end
  end
end

function entity:on_removed()
  self:get_sprite():set_animation("destroy")
end

Pages: [1] 2