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.

DarkBASIC Discussion / can anyone help me with ai?

Author
Message
Lucifer
19
Years of Service
User Offline
Joined: 26th Dec 2005
Location:
Posted: 3rd Sep 2006 03:01
I'm trying to make ai for a ghost. it's for my medieval game. I would like to make it so that if the player gets close enough to the ghost the ghost follows the camera and goes up to it.

I have been trying to do some stuff myself with no luck, i have a very little idea on where to start. i would like to make it so that ghost faces the camera at all times, so it wont look dumb .

Well, if anyone can tell me where to start and/or show me a little code (doesnt have to be much). i accept any help i can get i hope i am understandable

Tíhí..
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 3rd Sep 2006 03:04
Well, is the player the camera or is the player an object? And my advice? Make him fly around waypoints randomly and when you get in range, he starts following you. If you want something like that, tell me, and I'll cook up some code for you.


Lucifer
19
Years of Service
User Offline
Joined: 26th Dec 2005
Location:
Posted: 3rd Sep 2006 03:59
well it's an fps game so i guess the camera is the player.

Quote: "Make him fly around waypoints randomly and when you get in range, he starts following you. If you want something like that, tell me, and I'll cook up some code for you."


can you find a code for me like that? that would be awesome

thnx...

Tíhí..
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 3rd Sep 2006 04:56
Find you a code? I'll whip up an example for you. I'll work quick.


Lucifer
19
Years of Service
User Offline
Joined: 26th Dec 2005
Location:
Posted: 3rd Sep 2006 05:04
thank you, you're awesome

Tíhí..
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Lucifer
19
Years of Service
User Offline
Joined: 26th Dec 2005
Location:
Posted: 3rd Sep 2006 05:55
thanks very very much

Tíhí..
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 3rd Sep 2006 05:57
No problem, I'm glad to help.


Lucifer
19
Years of Service
User Offline
Joined: 26th Dec 2005
Location:
Posted: 3rd Sep 2006 06:22
you didnt write this in dbpro did you? some of the commands dont seem to work, but even so, i can play around with it and make it fit with dbc

Tíhí..
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 3rd Sep 2006 06:23
Oh, my mistake, I didn't check with DBC

Mind showing me which commands don't work?


Lucifer
19
Years of Service
User Offline
Joined: 26th Dec 2005
Location:
Posted: 3rd Sep 2006 06:29


parameter mismatch...



another parameter mismatch



unrecognized command



unknown



syntax error, parameter mismatch something



another one like that...

Tíhí..
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 3rd Sep 2006 06:43
This is all I could figure out without using DBC.. cuz its uninstalled over where I am. I really don't know whats wrong with the last two errors, maybe you do?





Lucifer
19
Years of Service
User Offline
Joined: 26th Dec 2005
Location:
Posted: 3rd Sep 2006 06:47 Edited at: 3rd Sep 2006 06:51
Quote: "I really don't know whats wrong with the last two errors, maybe you do?"


i think i just might know what it is, the "AngleY" thing might not be regocnized by dbc or dbc understands it in another way than it is already being used..?

thanks for all the time you have put into helping me i'll definetly put you in the credits in my game

Tíhí..
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 3rd Sep 2006 06:54
Say, do the two match functions in the Distance and AngleY functions I made light up in blue (like the rest of the commands)?


Lucifer
19
Years of Service
User Offline
Joined: 26th Dec 2005
Location:
Posted: 3rd Sep 2006 06:56
nope, that didnt bitch about anything

Tíhí..
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 3rd Sep 2006 06:58
Oh wait, I don't remember if db had syntax highlighting...


Do you think you can tell me the entire error that it gives there?


Lucifer
19
Years of Service
User Offline
Joined: 26th Dec 2005
Location:
Posted: 3rd Sep 2006 07:02 Edited at: 3rd Sep 2006 07:03
it doesnt give any error at the functions but the "ANG#=AngleY(1,WP#+10)" says, "syntax error. parameters differ between function call and declaration at line" i'm going to continue figuring this out tomorrow i'm a little tired right now and i'm going to bed..

Tíhí..
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 3rd Sep 2006 07:04
Ohhh...

does this work?





Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 3rd Sep 2006 07:14
going to bed in about 30 seconds, hoping for an answer so I know...


Lucifer
19
Years of Service
User Offline
Joined: 26th Dec 2005
Location:
Posted: 3rd Sep 2006 07:20
ah sorry, i am 1 sec from going to bed said that in my last post...

Tíhí..
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 3rd Sep 2006 07:23
hehe, ok, figure this out tomorrow then


Lucifer
19
Years of Service
User Offline
Joined: 26th Dec 2005
Location:
Posted: 3rd Sep 2006 15:21
ok, i think you are very close now it works for a while untill it gives me an error "Runtime error. Specified angle must be between 0 and 360"

Tíhí..
Robot
20
Years of Service
User Offline
Joined: 27th May 2004
Location:
Posted: 3rd Sep 2006 16:50
You just need a couple of wrapvalue commands in there.



Also made the turning slightly faster due to personal preference.
Lucifer
19
Years of Service
User Offline
Joined: 26th Dec 2005
Location:
Posted: 3rd Sep 2006 17:40
oh yay! it works now! thanks guys!

Tíhí..
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 3rd Sep 2006 18:06
Hahahahaha, I forgot about wrapvalue!!

Well, it looks like we completed the DBC version, I'll put that in the AI example thread too!


Login to post a reply

Server time is: 2025-05-25 22:29:42
Your offset time is: 2025-05-25 22:29:42