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

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

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

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

5
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

6
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
  1. function item:on_using()
  2. local map = game:get_map()
  3. local hero = game:get_hero()
  4.  
  5. local direction = hero:get_direction()
  6.  
  7.  
  8.  
  9.  
  10.   if game:is_command_pressed("item_1") or game:is_command_pressed("item_2") then
  11.   state = 1
  12.       if blastlevel < 4 then
  13.     timer = sol.timer.start(2000, function()
  14.       blastlevel = blastlevel + 1
  15.     return true
  16.     end)
  17.   end
  18.   end
  19.  
  20.  
  21.  
  22.     if game:get_item_assigned(2) == "blast" and not game:is_command_pressed("item_2") and state == 1 then
  23.       game:simulate_command_released("item_2")
  24.     end
  25.  
  26.     if game:get_item_assigned(1) == "blast" and not game:is_command_pressed("item_1") and state == 1 then
  27.       game:simulate_command_released("item_1")
  28.     end
  29.  
  30.  
  31. end
  32.  
  33.  
  34. function game:on_command_released(command)
  35.   if command == "item_1" or "item_2" then
  36.     timer:stop()
  37.     hero:unfreeze()
  38.     item:fire_blast()
  39.   end
  40. end
  41.  

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

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

9
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
  1. local entity = ...
  2. local map = entity:get_map()
  3. local pushing = false
  4. local block_on_switch = false
  5. local lava_crust, ice_patch
  6. local hero = entity:get_map():get_entity("hero")
  7.  
  8. -- Ice block: special block made of ice that can fill an
  9. -- ice pit, turn lava solid, and freeze water.
  10.  
  11. function entity:on_created()
  12.   self:set_size(16, 16)
  13.   self:snap_to_grid()
  14.   self:set_modified_ground("traversable")
  15.   self:set_traversable_by("hero", true)
  16.   self:create_sprite("entities/icepatch")
  17.  
  18.   self:add_collision_test("facing", function(self, other)
  19.     if other:get_type() == "hero" and not pushing then
  20.       pushing = true
  21.       local m = sol.movement.create("path")
  22.       m:set_ignore_obstacles(false)
  23.       m:set_snap_to_grid(true)
  24.       m:set_speed(120)
  25.  
  26.       hero:freeze()        
  27.  
  28.       local sx, sy, sl = self:get_position()
  29.       if other:get_direction() == 0 then
  30.         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
  31.       elseif other:get_direction() == 1 then
  32.         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
  33.       elseif other:get_direction() == 2 then
  34.         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
  35.       elseif other:get_direction() == 3 then
  36.         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
  37.       end
  38.       m:start(other, function() pushing = false hero:unfreeze() end)
  39.     end
  40.   end)
  41.  
  42.   self:add_collision_test("overlapping", function(self, other)
  43.     if other:get_type() == "switch" then
  44.       block_on_switch = true
  45.       other:set_activated(true)
  46.       if other:on_activated() ~= nil and not other.active then
  47.         other:on_activated()
  48.         other.active = true
  49.       end
  50.       sol.timer.start(map, 1000, function()
  51.         if block_on_switch then
  52.           return true
  53.         else
  54.           block_on_switch = false
  55.           other:set_activated(false)
  56.           if other:on_inactivated() ~= nil and other.active then
  57.             other:on_inactivated()
  58.             other.active = false
  59.           end
  60.         end
  61.       end)
  62.     elseif other:get_type() == "hole" then
  63.       sol.audio.play_sound("hero_falls")
  64.       self:remove()
  65.     elseif other:get_type() == "fire" then
  66.       sol.audio.play_sound("ice_melt")
  67.       self:remove()
  68.     elseif other:get_type() == "explosion" then
  69.       sol.audio.play_sound("ice_melt")
  70.       self:remove()
  71.     else
  72.       block_on_switch = false
  73.     end
  74.   end)
  75.  
  76.   local sx, sy, sl = self:get_position()
  77.   self:on_position_changed(sx, sy, sl)
  78. end
  79.  
  80. function entity:on_position_changed(x, y, layer)
  81.   for e in map:get_entities("") do
  82.     if e:get_type() == "dynamic_tile" then
  83.       if self:overlaps(e) then --if block overlaps dynamic tile
  84.         if map:get_ground(e:get_position()) == "lava" then
  85.           self:remove()
  86.           if map:get_hero():get_direction() == 0 then
  87.             lava_crust = map:create_custom_entity({ x=x+8, y=y-16, layer=layer, width=32, height=32, direction=0 })
  88.           elseif map:get_hero():get_direction() == 1 then
  89.             lava_crust = map:create_custom_entity({ x=x-16, y=y-48, layer=layer, width=32, height=32, direction=0 })
  90.           elseif map:get_hero():get_direction() == 2 then
  91.             lava_crust = map:create_custom_entity({ x=x-40, y=y-16, layer=layer, width=32, height=32, direction=0 })
  92.           elseif map:get_hero():get_direction() == 3 then
  93.             lava_crust = map:create_custom_entity({ x=x-16, y=y, layer=layer, width=32, height=32, direction=0 })
  94.           end
  95.           lava_crust = map:create_custom_entity({ x = x, y = y, layer = layer, width = 32, height = 32, direction = 0 })
  96.           lava_crust:snap_to_grid()
  97.           sol.audio.play_sound("freeze")
  98.           lava_crust:create_sprite("entities/lava")
  99.           lava_crust:set_modified_ground("traversable")
  100.           lava_crust:set_traversable_by("hero", true)
  101.           lava_crust:set_traversable_by("enemy", true)
  102.           lava_crust:set_traversable_by("block", true)
  103.           sol.timer.start(map, 15000, function() lava_crust:remove() end)
  104.         elseif map:get_ground(e:get_position()) == "deep_water" then
  105.           self:remove()
  106.           if map:get_hero():get_direction() == 0 then
  107.             ice_patch = map:create_custom_entity({ x=x+8, y=y-16, layer=layer, width=32, height=32, direction=0 })
  108.           elseif map:get_hero():get_direction() == 1 then
  109.             ice_patch = map:create_custom_entity({ x=x-16, y=y-48, layer=layer, width=32, height=32, direction=0 })
  110.           elseif map:get_hero():get_direction() == 2 then
  111.             ice_patch = map:create_custom_entity({ x=x-40, y=y-16, layer=layer, width=32, height=32, direction=0 })
  112.           elseif map:get_hero():get_direction() == 3 then
  113.             ice_patch = map:create_custom_entity({ x=x-16, y=y, layer=layer, width=32, height=32, direction=0 })
  114.           end
  115.           sol.audio.play_sound("freeze")
  116.           ice_patch:create_sprite("entities/ice")
  117.           ice_patch:set_modified_ground("ice")
  118.           ice_patch:set_traversable_by("hero", true)
  119.           ice_patch:set_traversable_by("enemy", true)
  120.           ice_patch:set_traversable_by("block", true)
  121.           sol.timer.start(map, 15000, function() ice_patch:remove() end)
  122.         end
  123.       end
  124.     elseif e:get_type() == "wall" or e:get_type() == "hole" then
  125.       hero:unfreeze()
  126.       e:stop_movement()
  127.     end
  128.   end
  129. end
  130.  
  131. function entity:on_removed()
  132.   self:get_sprite():set_animation("destroy")
  133. end

10
Your projects / Re: The Legend of Zelda
« on: January 06, 2017, 07:17:26 pm »
Do you think that the github will be updated soon?

11
Your scripts / Re: Raft script
« on: November 08, 2016, 11:17:06 pm »
Thanks so much, Diarandor! ^-^

Pages: [1]