Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / AF_Functions for newcomers.(DBP)

Author
Message
Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 18th Feb 2007 14:59 Edited at: 18th Feb 2007 19:58
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:


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 :



-Prince Of Darkness
Dracula
18
Years of Service
User Offline
Joined: 7th Aug 2006
Location: DBP Recreation of Castle Csejthe
Posted: 18th Feb 2007 19:27
Very nice. I'll give them a try when I get to the point of AI needs
Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 18th Feb 2007 19:29 Edited at: 18th Feb 2007 20:01
It only lets the EnemyObj# follow you until you get out of his "visual distance",you need to figure attacking out yourself.

BTW,i am currently working on an update that lets some stuff run better.

added 3 new commands and everything runs fine,forgot some variables as globals...(Still,global calls not required)

-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()

-Prince Of Darkness
Roxas
19
Years of Service
User Offline
Joined: 11th Nov 2005
Location: http://forum.thegamecreators.com
Posted: 19th Feb 2007 08:59
Oh and why you arent using eg. on this :

Function AF_CostumPrint(AF_FontSize#,AF_R#,AF_G#,AF_B#,AF_Text$)

color as dword instead of those AF_R#,AF_G#_AF_B# things oh and why so many Floats? Integers are more better on AF_fontsize AF_r# etc where you dont need number like 24.464565756 Integers are like AF_FontSize without # <- mark


Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 19th Feb 2007 09:58
I have no idea what a Dword is,and i deleted some #'s now.

-Prince Of Darkness
Mr X
19
Years of Service
User Offline
Joined: 25th Sep 2005
Location: Universe, milkyway, sol-system, Earth...
Posted: 19th Feb 2007 10:04
A dword is a variabel type, like an integer or a string. It goes from zero to something much heigher then zero. Anyway, nice work. I'll take a look at this some time.
Roxas
19
Years of Service
User Offline
Joined: 11th Nov 2005
Location: http://forum.thegamecreators.com
Posted: 19th Feb 2007 11:05
dwords are many things lol but this way is like functions what u use setting color or something kinda hard explain:

Function changeInk(color as dword)
ink color,color
endfunction

Then use

changeInk(rgb(255,255,255)) or something


Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 19th Feb 2007 11:05
I know its a variable type,but how to use it is a mystery.

I am currently working on a new AI type in it,Friendly.it will follow you for ever,and with a keystate you can let it stop following you.

-Prince Of Darkness
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 19th Feb 2007 16:59
I have a suggestion: Why make the player input the player x, y and z, instead of just the player number, and then using the object position x( playerNum ).

Pirates of Port Royale
Live the life.
Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 19th Feb 2007 17:01 Edited at: 19th Feb 2007 17:07
I know Gil,that was my mistake,i just didnt fix it yet.i didnt realy pay atention when making that function.

(Gosh,girlfriends realy keep you of of your work)

EDIT:

and i'll try the Dword crap.

Going to add a NORMAL documentation file too.

-Prince Of Darkness

Login to post a reply

Server time is: 2024-11-26 00:44:28
Your offset time is: 2024-11-26 00:44:28