I think you were rihht the first time jotomicron, well check out my link about "the best AI technique ever" but I'll sum it up.
1. When you are gonna create a special object more than once use a Function such as Create_Goblin(Object_number,x,y,z) where it loads and appends all of its object data and sets up it's default values...
2. To "AI" an object us a function I call AT(object,action), object= object to "AI" and action will be to use lets say goblin AI,wild animal AI...stuff like that
3. Make sure the function AI will handle everything such as collision, HP nd stuff like that...
Create_Pig(1,0,0,10)
Do
AI(1,1)
sync
Loop
Function Create_Pig(n,x,y,z)
Load Object "pig.x",n
Rem Append all animation data...such as Idle,dead,attack,ect
Set Object Speed n,25
Rem blah blah blah
endfunction
Function AI(n,a)
If a=1
rem put actions,collisions,if-thens and stuff here
rem the following is an example
Turn Object Right n,1
endif
endfunction
ITS REALLY EASY! I think I inveted this meathod cause I've never seen anyone else but myself use it...the only draw back is that it can ONLY use local variables and arrays...
If you want to use global I recommend converting my AI function into a label...
Create_Pig(1,0,0,10)
Do
action=1
AIobject=1
Gosub AI
sync
Loop
Function Create_Pig(n,x,y,z)
Load Object "pig.x",n
Rem Append all animation data...such as Idle,dead,attack,ect
Set Object Speed n,25
Rem blah blah blah
endfunction
AI:
If action=1
rem put actions,collisions,if-thens and stuff here
rem the following is an example
Turn Object Right AIobject,1
endif
return
HOPE THIS HELPS!
If life gives you a lemon, shove it up a water gun and squirt it into someone's eyes!