Menu

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.

Show posts Menu

Topics - eliwolfe92

#1
General discussion / Need Help With Enemy Scripting
October 28, 2018, 07:08:22 PM
I'm trying to create a hallway, not unlike like this one from ALttP...


Here's mine...


I unfortunately can't get my spike traps to act accordingly. Here's the script I made below...
-- Lua script of enemy trap.
-- This script is executed every time an enemy with this model is created.

-- Feel free to modify the code below.
-- You can add more events and remove the ones you don't need.

-- See the Solarus Lua API documentation for the full specification
-- of types, events and methods:
-- http://www.solarus-games.org/doc/latest

local enemy = ...
local game = enemy:get_game()
local map = enemy:get_map()
local hero = map:get_hero()
local sprite
local movement

-- Event called when the enemy is initialized.
function enemy:on_created()

  -- Initialize the properties of your enemy here,
  -- like the sprite, the life and the damage.
  sprite = enemy:create_sprite("enemies/" .. enemy:get_breed())
  enemy:set_invincible(1)
  enemy:set_damage(1)
end

-- Event called when the enemy should start or restart its movements.
-- This is called for example after the enemy is created or after
-- it was hurt or immobilized.
function enemy:on_restarted()

  movement = sol.movement.create("path")
  movement:set_path{4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
  movement:set_speed(96)
  movement:start(enemy)
  path_movement:set_loop(true)
end


Two things I'm trying to get the code to do (unsuccessfully) are...

  • Travel back and forth at a set speed on the same left/right path over and over
  • Not be stopped by the hero, enemies, attacks, anything really. (to add to this I would like it to make that 'tink tink' noise when you slash it, shoot it, try to blow it up whatever)
I'm REALLY new to coding in general so I'd appreciate the input.
#2
Your projects / Some Maps I've been working on...
October 28, 2018, 12:27:28 AM
I've only just recently as of a few weeks ago discovered Solarus but I've been having a lot of fun making maps with the Quest Editor as you can see in the imgur gallery below...

https://imgur.com/a/Wpr65tR

(I wasn't sure how to make my images available in the post, sorry noob here.)

I know they're not great but I thought I'd share anyway. I'll be posting more when I get time. peace

oh and Hi everyone, I'm new here.