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 / Keep the animation running

Author
Message
Karz
21
Years of Service
User Offline
Joined: 6th Jan 2003
Location: Netherlands
Posted: 6th May 2003 16:45 Edited at: 6th May 2003 23:47
Hi there, it's me again
I've got a problem when I want my character in my 'third person'-game to do his attack. I want it to perform his attack when I click the mousebutton. The problem is that the animation stops when I don't press the button anymore. Seen the code, that's logical but I don't get to it work. I've tried this

(Here should have been a code but it didn't show up at this topic, but it was by using the timer.)

but that didn't seem to work. Maybe I didn't understand the timer well but I don't know what to do else. Does anybody have a solution for this problem?
I thank you in advance.

One must keep his friends close,
but his enemies even closer. -The Godfather
Megaman Zero
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: United States
Posted: 6th May 2003 19:33
Is there some kind of time statement that you can use, to keep your attack animation playing for a certain ammount of time (the exact attack time), after the button is released, or clicked?

Ive seen this in other engines, but I am not sure if DBClassic or DBPro has it. If it does, that would be what to use.

Karz
21
Years of Service
User Offline
Joined: 6th Jan 2003
Location: Netherlands
Posted: 6th May 2003 23:59
Well, that is the thing I need. I haven't found it yet though. I can't use sleep or wait, cause they cause the wholeprogram to pause. Also I haven't got the timer to work with this problem.
I use 'dark basic: 3D games creator' which is, I think, practically the same as DBClassic

One must keep his friends close,
but his enemies even closer. -The Godfather
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 7th May 2003 00:00
there are commands that get the object's animation frame. Instead of using time, have the animation stop after a particular frame is hit.

I don't remember the name of the exact commands, but you can figure out my pseudocode.

Scorpyo
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 7th May 2003 00:15
do
....
gosub checkanim
.....
loop

checkanim:
if mouseclick()=1 and click=1 then return
if mouseclick()=1 and click=0 then click=1
if click=1 then play object player,startframe,endframe
click=object playing(player)
return

not sure the command "object playing" exists in 3D game creator
it returns 1 if the object is playing the animation, else 0
Mr Underhill
21
Years of Service
User Offline
Joined: 23rd Apr 2003
Location: The Forgotten Worlds...
Posted: 7th May 2003 08:49
This is simple:

If mouseclick()=1 and object playing(blahblah)=0 then play object blahblah,start,end

works for me...

"Not all that is gold does not glitter, not all those who wander are lost, not all that is old does not whither, deep roots are not reached by the frost..." - Aragorn (Strider)
Karz
21
Years of Service
User Offline
Joined: 6th Jan 2003
Location: Netherlands
Posted: 7th May 2003 15:52 Edited at: 7th May 2003 17:27
Hurray, it works! I tried Mr. Underhill's solution and it works perfectly for just one thing: I have a object (idle stance) and appended two stages to it: Walking and attacking. This is why I can't use the 'object playing=0'-part since this condition is always false; the object is always idle, walking or attacking. I use the following code for managing this proces (can't use the button 'code' while I edited this post so see next post of mine):

One must keep his friends close,
but his enemies even closer. -The Godfather
Karz
21
Years of Service
User Offline
Joined: 6th Jan 2003
Location: Netherlands
Posted: 7th May 2003 16:20 Edited at: 7th May 2003 17:34
I tried the next commandline:



but that doesn't work also, does anybody know why?

Another problem is that I want to perform my character an attack: spreading his hands to the side, then to eachother in front of him and then let a bullet shoot out if his hands.I have the animating done, but I can't seem to delay the bullet until my character has his hands together. This is what I tried, but it won't work:



This is the code to let my character attack but the bullet shoots to soon (at mouseclick=1):



Can anybody help me? If you can I promise I will keep quiet for a while

One must keep his friends close,
but his enemies even closer. -The Godfather

Login to post a reply

Server time is: 2024-09-20 07:23:30
Your offset time is: 2024-09-20 07:23:30