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 / monster AI

Author
Message
Nameless
20
Years of Service
User Offline
Joined: 11th Apr 2004
Location: U.S.A.
Posted: 28th Mar 2005 04:04
I'm not trying to create anything to fancy here this is all I want.

1.When the player gets in a ceratin range of the monster(I test for collision from a hidden object)I want the monster to rotate to face them

2Then I want the monster to move forward and charge the player.

3.when they get close enough start attacking.

If anyone could give me an idea of how to do this i would greatly appreciate it.thanks
dre
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: West Side
Posted: 28th Mar 2005 09:42
1. Use the distance formula:


Keep track of the distance between them, and when it's a certain value, attack.

2. Coding the attack is up to you because you have the model and animations.

3. Answered above.

im not tall, youre just short
Soy Cocktail
20
Years of Service
User Offline
Joined: 23rd Dec 2003
Location:
Posted: 28th Mar 2005 10:25
I like the variable arrays what i would probably do is create an array to be able to track what they are doing. An array like dim guys(maxguys,2) I would then make a for loop that goes from a=1 to maxguys and then takes the value of guys(a,1) if it is = to 1 then wander =2 then they charge =3 then they attack. I would use (a,2) to track where they are going. If they are in wandering state move them to a placeholder (inviable) object when they hit it move the object to a random spot. With the charging but this inviable object at the player and have them move to it, once they get there increase their action to 3 from 2. Hope this helps. Probably has a lot of typos, but I'm tired.

When life hands you lemons go buy some oranges to make orange juice, and stop expecting everything to be given to you.
Nameless
20
Years of Service
User Offline
Joined: 11th Apr 2004
Location: U.S.A.
Posted: 29th Mar 2005 03:49
Thanks guys. I think i will use an array but do you have any idea how i could rotate the monster to face the player?
Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 29th Mar 2005 05:05
point object or you can make a command that caculates angles etc then rotates the object gradually towards the person...id post some code but meh stuff is unavaible...

Making better games everday!
Oh yeah and just so you know its Oh-nek-a not One-ka!
Nameless
20
Years of Service
User Offline
Joined: 11th Apr 2004
Location: U.S.A.
Posted: 29th Mar 2005 06:55
When I use the point object command the monster pointe his ass at the player instead of his head. How can i fix this?
Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 29th Mar 2005 07:45
rotate model by 180degrees then fix object pivot to make it permanent for the time being

Making better games everday!
Oh yeah and just so you know its Oh-nek-a not One-ka!
Metrion
19
Years of Service
User Offline
Joined: 8th Jul 2005
Location: In the darkest cave
Posted: 13th Jul 2005 05:23
You could also use the 'atanfull' command...

try this:

atanfull(monsterX#-playerX#,monsterZ#-playerZ#)-monsterAngY#

gl =]

Login to post a reply

Server time is: 2024-09-23 15:37:43
Your offset time is: 2024-09-23 15:37:43