Yes i made some very simple functions(for advanced people) for newcomers.They are quite usefull if i say so.
EDIT:To compile with the AI function,you will need the latest version of Goga's DBP plugin.
*18-02-2007:
Updated,added 3 new commands!
Current Functions:
AF_Globals()
AF_SimpleAI(AF_PlayerX#,AF_PlayerY#,AF_PlayerZ#,EnemyObj#,AF_AWAY#,AF_SPEED#)
AF_TopDown(AF_PlayerX2#,AF_PlayerY2#,AF_PlayerZ2#,AF_Height#)
AF_Keys1(AF_ObjectNum#,AF_MoveSpeed#,AF_TurnSpeed#)
AF_Keys2(AF_ObjectNum#,AF_MoveSpeed#,AF_TurnSpeed#)
AF_ChangeWindow(AF_WindowTitle$,AF_WindowHeight#,AF_WindowWidht#)
AF_FPSKeys(AF_CameraNum#,AF_MoveSpeed2#,AF_TurnSpeed2#)
AF_Object(ObjectPath$,TexturePath$,Transperancyflag#)
AF_CostumPrint(AF_FontSize#,AF_R#,AF_G#,AF_B#,AF_Text$)
AF_CreateDefObj(AF_ObjType$,AF_ObjNum#,AF_ObjSize#,AF_R#,AF_G#,AF_B#)
AF_ScreenSettings()
They are basic but they work.
Explanations:
-AF_Globals()
Sets some globals,its not required to use,but it might solve some problems.
-AF_SimpleAI(AF_PlayerX#,AF_PlayerY#,AF_PlayerZ#,EnemyObj#,AF_AWAY#,AF_SPEED#)
Basic AI,
AF_PlayerX# = Player Object X
AF_PlayerY# = Player Object Y
AF_PlayerZ# = Player Object Z
EnemyObj# = The enemy to control
AF_AWAY# = How far away the enmy must be before following player.
AF_SPEED# = The speed in wich the enemy moves(TIP : Keep it lower then the player's movement speed.)
-AF_TopDown(AF_PlayerX2#,AF_PlayerY2#,AF_PlayerZ2#,AF_Height#)
AF_PlayerX2# = Player Object X
AF_PlayerY2# = Player Object Y
AF_PlayerZ2# = Player Object Z
AF_Height# = Camera Height
-AF_Keys1(AF_ObjectNum#,AF_MoveSpeed#,AF_TurnSpeed#)
Lets you control the player object with the arrow keys.
AF_ObjectNum# = Player Object Number
AF_MoveSpeed# = Speed to move object with
AF_TurnSpeed# = Speed to turn object with
AF_Keys2(AF_ObjectNum#,AF_MoveSpeed#,AF_TurnSpeed#)
Lets you control the player object with the W,S,A,D keys.
AF_ObjectNum# = Player Object Number
AF_MoveSpeed# = Speed to move object with
AF_TurnSpeed# = Speed to turn object with
-AF_ChangeWindow(AF_WindowTitle$,AF_WindowHeight#,AF_WindowWidht#)
AF_WindowTitle$ = The window title you want to set it to
AF_WindowHeight# = The height of the window you want it to have
AF_WindowWidht# = The Widht of the window you want to have.
-AF_FPSKeys(AF_CameraNum#,AF_MoveSpeed2#,AF_TurnSpeed2#)
Control your camera in a FPS style
AF_CameraNum# = Camera Number to control
AF_MoveSpeed2# = Speed to move the camera with
AF_TurnSpeed2# = Speed to turn the camera with
-AF_Object(ObjectPath$,TexturePath$,Transperancyflag#)
ObjectPath$ = The path of the object to load
TexturePath$ = The path of the objects texture
Transperancyflag# = The Objects Transparency flag(4 makes true black transperant)
-AF_CostumPrint(AF_FontSize#,AF_R#,AF_G#,AF_B#,AF_Text$)
AF_FontSize# = This is not about a font size,but a POINT size.
AF_R# = Red Value
AF_G# = Green Value
AF_B# = Blue Value
AF_Text$ = The Actual text to display
-AF_CreateDefObj(AF_ObjType$,AF_ObjNum#,AF_ObjSize#,AF_R#,AF_G#,AF_B#)
To create a default object with color(Cone,Cylinder,Cube,Sphere and Plain supported)
AF_ObjType$ = The type of object,e.g. "cube"
AF_ObjNum# = Object Number to use
AF_ObjSize# = The object size
AF_R# = Red Value
AF_G# = Green Value
AF_B# = Blue Value
-AF_ScreenSettings()
For Display settings.(Window modes supported:1-640*480,2-800*600,3-1024*768,4-1280*1024)
Hope this helps the newcomers.
Oh,and offcourse the Functions :
Function AF_SimpleAI(AF_PlayerX#,AF_PlayerY#,AF_PlayerZ#,EnemyObj#,AF_AWAY#,AF_SPEED#)
EnemyX#=Object Position X(EnemyObj#)
EnemyY#=Object Position Y(EnemyObj#)
EnemyZ#=Object Position Z(EnemyObj#)
AF_DIST# = DistanceFormula(AF_PlayerX#,EnemyX#,AF_PlayerY#,EnemyY#,AF_PlayerZ#,EnemyZ#)
If AF_DIST#=<AF_AWAY#
Point Object EnemyObj#,AF_PlayerX#,AF_PlayerY#,AF_PlayerZ#
Move Object EnemyObj#,AF_SPEED#
endif
Endfunction
Function AF_TopDown(AF_PlayerX2#,AF_PlayerY2#,AF_PlayerZ2#,AF_Height#)
Position Camera AF_PlayerX2#,AF_Height#,AF_PlayerZ2#
Point Camera AF_PlayerX2#,AF_PlayerY2#,AF_PlayerZ2#
endfunction
Function AF_Keys1(AF_ObjectNum#,AF_MoveSpeed#,AF_TurnSpeed#)
If keystate(17)=1 then Move Object AF_ObjectNum#,AF_MoveSpeed#
If keystate(31)=1 then Move Object AF_ObjectNum#,-AF_MoveSpeed#
If keystate(30)=1 then turn object left AF_ObjectNum#,AF_TurnSpeed#
If keystate(32)=1 then Turn object right AF_ObjectNum#,AF_TurnSpeed#
endfunction
Function AF_Keys2(AF_ObjectNum#,AF_MoveSpeed#,AF_TurnSpeed#)
If Upkey()=1 then Move Object AF_ObjectNum#,AF_MoveSpeed#
If Downkey()=1 then Move Object AF_ObjectNum#,-AF_MoveSpeed#
If Leftkey()=1 then turn object left AF_ObjectNum#,AF_TurnSpeed#
If rightkey()=1 then Turn object right AF_ObjectNum#,AF_TurnSpeed#
endfunction
Function AF_ChangeWindow(AF_WindowTitle$,AF_WindowHeight#,AF_WindowWidht#)
Set Window Title AF_WindowTitle$
Set Window Size AF_WindowWidht#,AF_WindowHeight#
endfunction
Function AF_FPSKeys(AF_CameraNum#,AF_MoveSpeed2#,AF_TurnSpeed2#)
If keystate(17)=1 then move Camera AF_CameraNum#,AF_MoveSpeed2#
if keystate(31)=1 then move camera AF_CameraNum#,-AF_MoveSpeed2#
If keystate(30)=1 then turn camera left AF_CameraNum#,AF_TurnSpeed2#
If keystate(32)=1 then turn camera Right AF_CameraNum#,AF_TurnSpeed2#
endfunction
Function AF_Globals()
Global AF_PlayerX#
Global AF_PlayerY#
Global AF_PlayerZ#
Global AF_PlayerX2#
Global AF_PlayerY2#
Global AF_PlayerZ2#
Global EnemyObj#
Global AF_AWAY#
Global AF_SPEED#
Global AF_ObjectNum#
Global AF_MoveSpeed#
Global AF_TurnSpeed#
Global AF_WindowTitle$
Global AF_WindowHeight#
Global AF_WindowWidht#
Global AF_CameraNum#
Global AF_MoveSpeed2#
Global AF_TurnSpeed2#
Global AF_PlayerObj#
Global AF_Distance#
Global AF_R#
GLOBAL AF_G#
GLOBAL AF_B#
Global AF_Fontsize#
Global AF_Text$
Global AF_ObjType$
Global AF_ObjNum#
Global AF_ObjSize#
endfunction
Function AF_Object(ObjectPath$,TexturePath$,Transperancyflag#)
For X=1 to 9999
If Object Exist(X)=0 and Image Exist(X)=0
Load Object ObjectPath$,X
Load Image TexturePath$,X
Texture Object X,X
Set Object Transparency X,Transperancyflag#
else
Gosub AF_GO
endif
Next X
AF_GO:
endfunction
Function AF_CostumPrint(AF_FontSize#,AF_R#,AF_G#,AF_B#,AF_Text$)
Ink RGB(AF_R#,AF_G#,AF_B#),0
Set Text Size AF_Fontsize#
Print AF_Text$
Ink RGB(255,255,255),0
Set Text Size 12
endfunction
Function AF_CreateDefObj(AF_ObjType$,AF_ObjNum#,AF_ObjSize#,AF_R#,AF_G#,AF_B#)
AF_OK$=Lower$(AF_ObjType$)
If AF_OK$="cube" then make object cube AF_ObjNum#,AF_ObjSize#
If AF_OK$="sphere" then make object Sphere AF_ObjNum#,AF_ObjSize#
If AF_OK$="plain" then Make Object plain AF_ObjNum#,AF_ObjSize#,AF_ObjSize#
If AF_OK$="cone" then make object cone AF_ObjNum#,AF_ObjSize#
If AF_OK$="cylinder" then make object cylinder AF_ObjNum#,AF_ObjSize#
Color Object AF_ObjNum#,RGB(AF_R#,AF_G#,AF_B#)
Endfunction
Function AF_ScreenSettings()
Print "1-640*480,2-800*600,3-1280*1024"
Do
Ink RGB(255,255,255),0
Text 0,0,"1-640*480,2-800*600,3-1024*768,4-1280*1024"
If Keystate(2)=1
Set window size 640,480
OK#=1
endif
If Keystate(3)=1
Set Window Size 800,600
OK#=1
endif
If Keystate(4)=1
Set Window Size 1024,768
OK#=1
endif
If Keystate(5)=1
Set Window Size 1280,1024
OK#=1
endif
If OK#=1 then Gosub AF_OMG
loop
AF_OMG:
endfunction
-Prince Of Darkness