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.

3 Dimensional Chat / Attack Animation

Author
Message
Imperiex
21
Years of Service
User Offline
Joined: 4th Aug 2004
Location:
Posted: 17th Dec 2004 00:18
I've been having a problem with the animation on my main character. I made him in 3DS Max 6, then animated him so the first 50 frames is a repeatable walk animation and then the last 30 are a punch attack. I have it set up as you see in the code snippet. He does nothing at all when I press forward or enter as of right now. Pressing forward is supposed to loop frames 0-50 and pressing enter is supposed to play frames 70-100 of the models animation but it does not. Any suggestions?
Clueless
22
Years of Service
User Offline
Joined: 16th Feb 2004
Location: Corbin, KY, USA
Posted: 17th Dec 2004 07:31
It might be this:

Quote: "
if upkey()=1 then loop object 1,0,50
"


try instead:

if upkey()=1
if object playing(1) = 0
loop object 1, 0, 50
endif
endif

What's happening (I think) is that you're giving your object several hundred "start playing at frame zero" commands every second. Humans aren't fast enough to press a single keystroke, in the eyes of the computer. To verify this, try:

intCounter = 0
do
if upkey() = 1 then intCounter = intCounter + 1
set cursor 0,0
print intCounter
sync
loop

If you can hit the upkey and release it fast enough to show a counter value of "1" on the screen, then you're superhuman!

There's a concept in digital electronics called "debouncing". It applies to mechanical switches. The metallic surface of the switch, at a microscopic level, has imperfections so that when you close the switch, it "bounces" and sends a slew of on/off "signals" as the connection opens and closes.

A simple circuit known as a "debouncer" is put in place to prevent this -- the very first time the switch is closed, the debouncing logic notes the fact and doesn't allow any more "on/off" signals to pass through.

And that's pretty much what you need to do when you're checking for a keypress to start or stop an event, like your object playing.

Login to post a reply

Server time is: 2026-07-14 02:44:39
Your offset time is: 2026-07-14 02:44:39