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

Pages: [1] 2 3 ... 6
1
General discussion / [Debug] Pokemon Original Games
« on: June 18, 2017, 07:13:28 am »
I thought this video was interesting. It could help a game creator to think of ways to prevent bugs that pros made in the past.
https://youtu.be/VGlZu2hoAiE?t=92

In my opinion, key items will prevent these bugs from occurring for quests.

2
General discussion / 19 transitions
« on: May 18, 2017, 10:37:10 am »
I made many transitions in Gimp from scratch. I still have some tweaking to do, but I plan to have these 320x240 transitions setup as animations. Of course, I plan to have these as CC0, so they will be free for any usage.

What does everyone think? Did I miss any basic transition?

Gimp Playback Previews:






































3
Development / [Solved]Screen vs entity position?
« on: May 15, 2017, 01:51:17 pm »
Is there a formula I could use to calculate screen image x,y coordinates to the entity position? For example, drawing an image at the hero. I am not sure that entity:get_position() is related to this because is not that position different than image x,y coordinates?

4
Development / [Solved]Array in function?
« on: May 15, 2017, 06:07:00 am »
I get the following error:
Code: [Select]
0] Error: Failed to load script 'scripts/lib/zefk_entity_lib.lua': [string "scripts/lib/zefk_entity_lib.lua"]:2093: '(' expected near '['
when trying this:

Code: Lua
  1.   function sprites[index]:on_animation_finished()
  2.     sprites[index]:set_animation(end_anime)
  3.     sol.audio.play_sound(end_sound)
  4.   end

The following function will only work if I convert my array to a normal variable.

Code: Lua
  1.     sprites2 = sprites[2]
  2.   function sprites2:on_animation_finished()
  3.     sprites[index]:set_animation(end_anime)
  4.     sol.audio.play_sound(end_sound)
  5.   end

Is there a way around this because I'd like to on_animation_finish() without having a limit set. I do not want to do something like this:

Code: Lua
  1.    
  2.  sprites2 = sprites[2]
  3.   function sprites2:on_animation_finished()
  4.     sprites[index]:set_animation(end_anime)
  5.     sol.audio.play_sound(end_sound)
  6.   end
  7.  
  8.  sprites1 = sprites[1]
  9.   function sprites1:on_animation_finished()
  10.     sprites[index]:set_animation(end_anime)
  11.     sol.audio.play_sound(end_sound)
  12.   end
  13.  
  14.  sprites3 = sprites[3]
  15.   function sprites3:on_animation_finished()
  16.     sprites[index]:set_animation(end_anime)
  17.     sol.audio.play_sound(end_sound)
  18.   end
  19.  
  20.  sprites4 = sprites[4]
  21.   function sprites4:on_animation_finished()
  22.     sprites[index]:set_animation(end_anime)
  23.     sol.audio.play_sound(end_sound)
  24.   end
  25.  
  26.  sprites5 = sprites[5]
  27.   function sprites5:on_animation_finished()
  28.     sprites[index]:set_animation(end_anime)
  29.     sol.audio.play_sound(end_sound)
  30.   end
  31.  

5
Development / [solved]Jump movement direction4 error?
« on: May 10, 2017, 05:55:26 am »
I made the following two functions. The bug happens with my entity:jump function. It seems not to want to change the facing direction.

Code: Lua
  1. entity:jump_create() -- default jump sprite Eldran is created for this one.

and

Code: Lua
  1. entity:jump() -- no sprite set to be created

The direction does not change even though I set:

Code: Lua
  1.   function self:on_movement_changed()
  2.      self:set_direction(quick_movement:get_direction4())  
  3.   end

The problem only occurs if I do not manually create the sprite with script. (If I do not pick the sprite from the custom entity.)

Code: Lua
  1.    
  2.   function self:on_created()
  3.      sprite = self:create_sprite(sprite_directory) -- sprite_directory
  4.   end
  5.  
  6.   function self:on_movement_changed()
  7.      sprite:set_direction(quick_movement:get_direction4())  
  8.   end
  9.  

What makes no sense is I have other functions with identical code. For example, entity:wander() and entity:follow(). Both those functions use a sprite I picked from the custom entity and work perfectly.

I used "self:set_direction(quick_movement:get_direction4())" on both of those functions and they change direction correctly.

Code: Lua
  1.   function self:on_movement_changed()
  2.      self:set_direction(quick_movement:get_direction4())  
  3.   end

My only solution was to manually check.
Code: Lua
  1.  if direction8 == 0 or direction8 == 1 then
  2.     if self:get_direction() == 1 then -- up
  3.       self:set_direction(0)
  4.     end
  5.  
  6.     if self:get_direction() == 2 then -- left
  7.       self:set_direction(0)
  8.     end
  9.  
  10.     if self:get_direction() == 3 then -- down
  11.       self:set_direction(0)    
  12.     end
  13.  
  14.     if self:get_direction() == 0 then-- right
  15.       self:set_direction(0)
  16.     end
  17.   end
  18.  
  19.   if direction8 == 2 or direction8 == 3  then
  20.     if self:get_direction() == 1 then -- up
  21.       self:set_direction(1)
  22.     end
  23.  
  24.     if self:get_direction() == 2 then -- left
  25.       self:set_direction(1)
  26.     end
  27.  
  28.     if self:get_direction() == 3 then -- down
  29.       self:set_direction(1)    
  30.     end
  31.  
  32.     if self:get_direction() == 0 then-- right
  33.       self:set_direction(1)
  34.     end
  35.   end
  36.  
  37.   if direction8 == 4 or direction8 == 6 then
  38.     if self:get_direction() == 1 then -- up
  39.       self:set_direction(2)
  40.     end
  41.  
  42.     if self:get_direction() == 2 then -- left
  43.       self:set_direction(2)
  44.     end
  45.  
  46.     if self:get_direction() == 3 then -- down
  47.       self:set_direction(2)    
  48.     end
  49.  
  50.     if self:get_direction() == 0 then-- right
  51.       self:set_direction(2)
  52.     end
  53.   end
  54.  
  55.   if direction8 == 6 or direction8 == 7 then
  56.     if self:get_direction() == 1 then -- up
  57.       self:set_direction(3)
  58.     end
  59.  
  60.     if self:get_direction() == 2 then -- left
  61.       self:set_direction(3)
  62.     end
  63.  
  64.     if self:get_direction() == 3 then -- down
  65.       self:set_direction(3)    
  66.     end
  67.  
  68.     if self:get_direction() == 0 then-- right
  69.       self:set_direction(3)
  70.     end
  71.   end

6
Development / On_interaction error?
« on: May 08, 2017, 12:08:12 pm »
I did the following with a custom entity, but the dialog is still called (if I keep pressing the spacebar) when the entity is far away unless I move the hero. How can I fix this?

Edit: This is probably a bug. A quick solaution is to check the distance with on_interaction() Here

Code: Lua
  1.   function self:on_interaction()
  2.     if hero:get_direction() == 0 then
  3.       self:set_direction(2)
  4.       map:get_game():start_dialog(dialog)
  5.     end
  6.     if hero:get_direction() == 1 then
  7.       self:set_direction(3)
  8.       map:get_game():start_dialog(dialog)
  9.     end
  10.     if hero:get_direction() == 2 then
  11.       self:set_direction(0)
  12.       map:get_game():start_dialog(dialog)
  13.     end
  14.     if hero:get_direction() == 3 then
  15.       self:set_direction(1)
  16.       map:get_game():start_dialog(dialog)
  17.     end
  18.   end


7
Development / Debug.info with pcall question?
« on: May 07, 2017, 06:31:01 am »
My problem is that I do not know how to pcall my function "Error()". Error() needs to be inside the entity:example() to work.

Lib.lua
Code: Lua
  1. local metatable_entity = sol.main.get_metatable("custom_entity")
  2.  
  3. function metatable_entity:example()
  4.   Error()
  5. end
  6.  
  7. function Error()
  8.     local level_1 = debug.getinfo(1) --Error() is level 1
  9.     local level_2 = debug.getinfo(2) --Name of function being called from is level 2
  10.     local level_3 = debug.getinfo(3) -- Return from where ever the function was declared is level 3
  11.     print ("-----------------------------------------------------------------------------------------------------------")
  12.     print(level_3.short_src.." => "..level_1.name.. " was called by function [".. level_2.name.. "] at line " .. level_3.currentline)
  13.     print ("-----------------------------------------------------------------------------------------------------------")
  14. end
  15.  

Entity script:

Code: Lua
  1. entity:example()

Output:
Code: [Select]
-----------------------------------------------------------------------------------------------------------
[string "entities/follower.lua"] => Error was called by function [example] at line 1
-----------------------------------------------------------------------------------------------------------

8
Development / [Solved]pcall metatable?
« on: May 05, 2017, 09:30:23 am »
How does a pcall or xpcall error message work with a metatable?
http://www.solarus-games.org/doc/latest/lua_api_main.html#lua_api_main_get_metatable

9
Game art & music / Plexa Heroine
« on: May 02, 2017, 11:42:51 am »
This is what the current design for the Plexa sprite I mentioned. It took a drastic change from my original design, but the similarities can be noticed. I plan to make her into a full fledged hero sprite.

Credit:
Credit Diarandor and Zane Kukta. Follow the CC-BY-SA 4.0 rules. I modded Diarandor's male Eldran sprite.

I decided to go with this design.






10
Development / [Solved]Bring hero back?
« on: May 01, 2017, 04:38:40 am »
I am wondering if there is a way to being the hero behind other entities without changing the layer. The reason is for my push and pull animation.

I tried hero:bring_to_back(), but the documentation does mention that the hero is not affected by this.

Animation looks funny:
Changing the length of her arms and legs would make her look like she is doing some sort of monkey dance. The only way this could work is if I make the excuse that she has telekinesis psychic powers.


Hero needs to be sent to back:




What I want it to look like, but it has a bug: (In this case...I chopped the heroines legs off.)



I would need to cancel the push/pull animation for everything, but the block. What would be the best way to disable push and pull for everything, but the block entity?

11
Development / [Solved]Freeze hero?
« on: April 27, 2017, 05:38:00 am »
Is there a way to freeze the hero, but still allow hero:set_animation("animation") and then unfreeze the hero?

I know something similar can be done by drawing a sprite at the hero coordinates and setting the hero visibility to false. Also, this can be done with a movement because it disables the hero control and that does not cancel the animation when trying to move the hero until the movement is completed.

12
I set both custom entities not to traverse  "custom_entity".
Code: Lua
  1. entity:set_can_traverse("custom_entity", false)

They still traverse unless I set traversable to false:
Code: Lua
  1. self:set_traversable_by(false)




I set both entities to traverse "custom_entity" when traversable is false and as you can see...they do not traverse.
Code: Lua
  1.  entity:set_can_traverse("custom_entity", true)



It works with the hero. If I set the entities to not traverse the "hero", then they do not traverse the hero.
Code: Lua
  1. entity:set_can_traverse("hero", false)

Both entities in the case of the hero are set to traversable true.
Code: Lua
  1. self:set_traversable_by(true)




13
Your projects / Allied AI Script Project Alpha
« on: April 17, 2017, 01:55:54 am »
Allied AI Project Alpha

I recently started working on a Allied AI script while working on the book project. I am panning only 2 allies like in Secret of Mana (Seiken Densetsu 2).

Finished: (All lag is due to bad gifs, the Solarus engine runs fine)
  • Basic Follower Script - The Ally custom entity follows the hero and when the ally gets stuck (hit an obstacle), it searches for the hero.

I seriously cannot believe at how easy this is to program. Thank you Christopho for the amazing functions.


Not finished:
  • Melee
  • Projectiles
  • Custom Entity Enemy
  • Enemy

14
Game art & music / Female Eldran
« on: April 11, 2017, 04:24:12 pm »
I finished most animations I needed for the female Eldran. She is now a usable heroine for a game. Her name is Eldrina, but her name is Sola in the chain quest for the book project.

Credit:
Credit Diarandor and Zane Kukta. Follow the CC-BY-SA 4.0 rules. I modded Diarandor's male Eldran sprite.

Downloads: (Login to download)

eldrina_v1 (unshaded)

eldrina_v2 (shaded)

V2 Preview:



Some missing animations: (No plans on making these yet.)
-bow
-boomerang1
-boomerang2
-hookshot
-victory
-running

@Diarandor
What should her name be?


Animations:
-carrying_stopped
-carrying_walking
-dead
-dying
-grabbing
-hurt
-lifting
-pulling
-pushing
-stopped
-sword
-throw
-walking
-walking_with_shield
-spin_attack
-sword_tapping
-sword_loading_stopped
-sword_loading_walking
-bubble_heart
-bubble_idea
-bubble_mad
-bubble_question
-bubble_sleep
-bubble_stars (No bubble. Stars spin around her head.)
-bubble_surprise
-bubble_think
-swimming_fast
-swimming_slow
-swimming_stopped
-plunging_water
-jumping
-falling


Note: The gifs are slow







Swimming/falling:


Jumping:


Bubbles: (Her eye changes depending on the bubble.)

15
Development / (Solved)How is a super spin attack setup?
« on: March 26, 2017, 04:56:10 am »
I know the following ability is needed for a super spin attack, but which animations? I kinda wish there was an error message for this.

Code: Lua
  1.     game:set_ability("sword_knowledge", 1)

Pages: [1] 2 3 ... 6