ID:167514
 
My game, A Nintendo life, is an okay demo of a game so far (or as some of the players think), but i would like to add summon spells. I was thinking About making the summon attack too, and not just being a pet. I have an overworld battle system, as in instead of a turn based system in a different map, you fight on the overworld with no turn based system. I would like to make the summoned monster to be able to go after an opponent on your command if possible.
this is "Developer How-To" not "Developer Do it for me"

How to make a Summon system
- once you have a working summon system you can move on to making it attack

you will need
1x AI system (or basic follow mob system)
1x Verb or obj to act as the trigger
1x icon for the summon

mix it all up and cook for about 1 hour ^_^
.
.
.
I should just leave it as that but here you go ^_^
.
.
.
.
.
(this is off the top of my head I will get yelled at for not testing it ^_^ use at your own risk!)

basic follow mob system
================
mob
summon
var
mob
owner = null // who summoned it
proc
follow_owner()
if(owner)
if(owner in oview(1,src))
else
step_towards(src,owner)
spawn(PUT A DELAY HERE) follow_owner()
else
world << "Debug - Summon without owner removeing summon"
del(src)


Verb or obj to act as the trigger
=====================================
mob
var
tmp
mob
summon
mysummon = null // link to the summon
verb
summon_pet()
if(mysummon == null)
var/mob/summon/newsummon = new/mob/summon
newsummon.owner = src
mysummon = newsummon
mysummon.loc = locate(src.x,src.y,src.z)
spawn(1) mysummon.follow_owner()
else
src << "you allready have a summon"