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 / dark ai and animations

Author
Message
GreenDixy
16
Years of Service
User Offline
Joined: 24th Jul 2008
Location: Toronto
Posted: 30th Mar 2010 23:06
hey i have been working with dark ai and i am having some problems getting them to animate properly i know its "play object objnumber, frame start, frame end" he may move forward with walking but when he straf's side to side how do i get it to switch to thoes animations as its just random movements the ai is doing is there a way to detect witch animation should be played?

===================
No life, Lots of love, 2 Kids, God save me LOL
Teh Stone
14
Years of Service
User Offline
Joined: 12th Dec 2009
Location:
Posted: 31st Mar 2010 00:40
What I would do is to have a variable called somethjn like enemy direction or an array depending on how many enemies you have and then have a series of if statements

puesdo

if enemy_direction = 1
Move sprite enemy,velocity
Play sprite animation
* any other info
endif
GreenDixy
16
Years of Service
User Offline
Joined: 24th Jul 2008
Location: Toronto
Posted: 31st Mar 2010 02:03
found this code searching took me several search's to find it
my question for this one "enemyact$(e)=" wouldin't i need "for e = blahcount" then put this in the do/loop?



===================
No life, Lots of love, 2 Kids, God save me LOL
Dia
19
Years of Service
User Offline
Joined: 16th Jan 2005
Location:
Posted: 31st Mar 2010 16:35
Yes, unless you just want to concentrate on a single enemy (for wahtever value of 'e' is currently in the variable) it needs to be incremented in a for/next loop either directly or indirectly

This is not the Sig you are looking for....
GreenDixy
16
Years of Service
User Offline
Joined: 24th Jul 2008
Location: Toronto
Posted: 1st Apr 2010 00:18
would it be better to have different loops for each enemy instead of a bunch at once making it faster cuz i think if i have say 8 guys on one map or more they are all trying to read from that loop wouldint it glitch out

===================
No life, Lots of love, 2 Kids, God save me LOL
GreenDixy
16
Years of Service
User Offline
Joined: 24th Jul 2008
Location: Toronto
Posted: 3rd Apr 2010 18:17 Edited at: 3rd Apr 2010 18:46
so i got my AI to run the animations key frames and my movements using loop object and else idle frames but i find when the idle frames start he is still jitterbugging a bit moving side to side slightly non stop is there a way to stop him from doing the jitterbug dance? you would think idle frames means he does not move lol

Edit: sorry forgot to put in the code i use for the frame setup

If Upkey()=1
Move Object 1,MSframe#
loop object 1,235,259
else
loop object 1,210,234
endif

The frame code is from

http://www.fpscreator.com/animation_template.html

===================
No life, Lots of love, 2 Kids, God save me LOL
GreenDixy
16
Years of Service
User Offline
Joined: 24th Jul 2008
Location: Toronto
Posted: 3rd Apr 2010 22:20
figured it out so for anyone that is having that small problem on the idle frame dont use loop object use set object frame instead only on the idle part

here is the modified code enjoy



===================
No life, Lots of love, 2 Kids, God save me LOL

Login to post a reply

Server time is: 2024-09-28 16:34:24
Your offset time is: 2024-09-28 16:34:24