Allied AI Script Project Alpha

Started by Zefk, April 17, 2017, 01:55:54 AM

Previous topic - Next topic
April 17, 2017, 01:55:54 AM Last Edit: April 17, 2017, 02:13:21 AM by Zefk
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

May 14, 2017, 02:13:09 AM #1 Last Edit: July 12, 2018, 09:07:09 PM by Zefk
Here is a cool function I made for this project. The lib I am making has a bunch of other functions to make showing images easier. This was made to display stats, item amounts, etc.

Preview: (Login to View)

It is declared like this.

Code ( lua) Select
game:set_value("money", 2)
game:set_value("gem", 3)
game:set_value("silver", 4)

entity:font_draw(1,"MONEY: ", 30, 50, "money")

entity:font_draw(2,"GEM: ", 30, 80, "gem")

entity:font_draw(3,"SILVER: ", 30, 110, "silver")

entity:font_create(3, font_name, text_size, render_mode, color_rgb, map)

--remove gem text

--true remove all text
entity:font_undraw(font_index, true)

May 16, 2017, 09:07:31 AM #2 Last Edit: May 18, 2017, 07:50:58 PM by Zefk
These sprite draw functions that I made for this project can draw a sprite at:

1. The hero
2. An entity
3. A position

It can remove:

1. Any sprite index
2. All of them at once

By default it uses a death animation.

Code ( lua) Select
--create 4 sprites and draw on map
entity:sprite_create(4, map)

--Draw at coordinates
entity:sprite_draw(1,"main_heroes/eldran", 130,100, true)

--Draw at coordinates
entity:sprite_draw(2,"main_heroes/eldran", 100,100, true)

--draw at hero
entity:sprite_draw(3,"main_heroes/eldrina/eldrina", 0,0, true, start_anime, start_sound, end_anime, end_sound, true, hero_visable, false)

--draw at an entity named "old"
entity:sprite_draw(4,"main_heroes/eldrina/eldrina", 0,0, true, start_anime, start_sound, end_anime, end_sound, hero_pos, hero_visable, false, direction, true,"old", entity_visable)

--remove sprite 1

--remove all sprites if true
--remove all sprites if true

They all fall down.