Recent Posts

Pages: 1 ... 8 9 [10]
91
Development / Re: Need help making a Redead AI that acts similar to Ocarina of time
« Last post by Diarandor on September 14, 2018, 01:52:36 am »
I think that lines 57 and 69 should go inside their timers above. Otherwise, if the enemy is restarted (and therefore all timers stopped), your enemy will break its behavior, as you can check if I'm not wrong. (Even if the hero is frozen, the enemy could be hurt by the boomerang or other thing, and so restarted too.)
92
Development / Re: Need help making a Redead AI that acts similar to Ocarina of time
« Last post by Akamatsu on September 14, 2018, 12:51:23 am »
Also I'm always looking for help with my project if anyone is interested it's quite a large scale for one person i'll be showing off screenshots and such at a later point once I feel things are up to my standards I could always use another person on the project no matter what you can do.

I'll be sure to give a special thank you to Diarandor and Max
93
Development / Re: Need help making a Redead AI that acts similar to Ocarina of time
« Last post by Akamatsu on September 14, 2018, 12:39:38 am »
Code: Lua
  1. local enemy = ...
  2. local game = enemy:get_game()
  3. local map = enemy:get_map()
  4. local hero = map:get_hero()
  5. local sprite = enemy:create_sprite("enemies/Redead2")
  6. local movement
  7. local IsPlayerFrozen = false
  8.  
  9.  
  10. function enemy:on_created()
  11.  
  12. movement = sol.movement.create("target")
  13.  
  14.   enemy:set_life(8)
  15.  
  16.   enemy:set_damage(10)
  17.  
  18. end
  19.  
  20.  
  21.  
  22.  
  23.  
  24. function enemy:on_restarted()
  25.  
  26. sol.timer.start(self, 3000, function() sol.audio.play_sound("Redead/RedeadMoan") end)
  27.  
  28. self:get_sprite():set_animation("immobilized")
  29.  
  30. enemy:check_hero()
  31.  
  32. end
  33.  
  34.  
  35.  
  36. function enemy:check_hero()
  37.  
  38.    if self:get_distance(hero) <= 80 then
  39.  
  40.    movement = sol.movement.create("target")
  41.  
  42.    self:get_sprite():set_animation("walking")
  43.  
  44.    movement:set_speed(28)
  45.  
  46.    movement:start(enemy)
  47.  
  48. end
  49. sol.timer.start(self, 1000, function() self:check_hero() end)
  50.  
  51. if self:get_distance(hero) <= 80 then
  52.  
  53. if IsPlayerFrozen == false then
  54.  
  55.    sol.timer.start(self, 3000, function() hero:freeze() end)
  56.  
  57.    IsPlayerFrozen = true
  58.  
  59. end
  60.  
  61. end
  62.  
  63. if self:get_distance(hero) <= 80 then
  64.  
  65. if IsPlayerFrozen == true then
  66.  
  67.    sol.timer.start(self, 5000, function() hero:unfreeze() end)
  68.  
  69.     IsPlayerFrozen = false
  70. end
  71. end
  72. end
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81. function enemy:on_dying()
  82.  
  83. sol.audio.play_sound("Redead/RedeadDie")
  84.  
  85. end
94
Development / Re: Need help making a Redead AI that acts similar to Ocarina of time
« Last post by Diarandor on September 14, 2018, 12:11:48 am »
Could you post the last code, so that it can be reviewed for new possible advices? That will help beginners who read your code too.

EDIT: and I forgot: congrats! you completed the challenge! XD
95
Development / Re: Need help making a Redead AI that acts similar to Ocarina of time
« Last post by Akamatsu on September 13, 2018, 11:57:05 pm »
it was already fixed before I tried to change it  :D I just changed it back although I kind of have a rough idea of what was wrong with it.

so enemies do not play walking left and right animations by default?
96
Development / Re: Need help making a Redead AI that acts similar to Ocarina of time
« Last post by Diarandor on September 13, 2018, 11:26:13 pm »
You are right that the code is not ok. And there are a few more things wrong with the last code of Max, but if you read carefully, you can find them (exercise!). You will need to move/rewrite a few things to fix it. I challenge you, Akamatsu, to fix it!

[insert samurai emoticon here]

Edit: I think Max had in mind a different behavior for the Zombi thing, without restarting the freezing feature, or he wrote it too fast.
97
Development / Re: Need help making a Redead AI that acts similar to Ocarina of time
« Last post by Akamatsu on September 13, 2018, 04:16:39 pm »
Not, sure what their is to explain?

if I use the else feature instead of making another if statement it no longer loops like it does before I changed it.

Basically the hero no longer gets unfrozen and frozen more then once.
98
Development / Re: Need help making a Redead AI that acts similar to Ocarina of time
« Last post by Diarandor on September 13, 2018, 02:28:01 pm »
Briefly: explain, this: "the code doesn't work anymore it just runs it once".
99
Development / Re: Need help making a Redead AI that acts similar to Ocarina of time
« Last post by Max on September 13, 2018, 02:01:36 pm »
I'm not sure which part of your code was looping? The only part that should have looped was the check_hero() method, which loops every 1sec. That's why I suggested putting the freezing function in there.

On their own, if/else branches don't loop. They have to be inside a loop for that.
100
Bugs & Feature requests / Re: Feature Request: Emulator (Or Similar) Readable Format
« Last post by Levi on September 13, 2018, 11:34:00 am »
Ended up buying an android-compatible gamepad (my previous ones were tied to a custom retropie and a hacked SNES Mini), so...   At least as the OP, I've now got access to playing it with a pad, as Glob intended.
Pages: 1 ... 8 9 [10]