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 / Play/Loop object problems

Author
Message
Bigsnake
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: England
Posted: 18th Aug 2010 18:37 Edited at: 18th Aug 2010 21:44
I've got a gun into my game and i've got it setup so when you are just standing a idle animation plays, same for walking and sprinting but I can't seem to get the reloading and fire weapon working. Here is the code for the animtions and weapon load :


Now for the reloading and firing animations i've tried flags and functions but either work, it just changes to the first frame of the animations.

Thx for any help

Windows 7, Amd Athlon 7750 Black Editon (64 bit,3ghz + Dual Core), ATI Readon HD 4870 1gb Edition, 4gb Ram.
luskos
17
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 18th Aug 2010 22:02
loop object 100,40,85
Is the only place you actually play your gun's animation.You said that idle animation is playing good so i suppose this is it.

And where are others?

Did you expect when you fire your weapon is gonna automaticly play/loop fire animation?Reloading = same question!?

Coding is My Kung Fu!
And My Kung Fu is better than Yours!
Bigsnake
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: England
Posted: 18th Aug 2010 22:08 Edited at: 18th Aug 2010 22:09
Oh, I havn't included everything there

The other things I forgot to include was :



And the first loop object 100,40,85 has been removed since I posted the thread.

Quote: "Did you expect when you fire your weapon is gonna automaticly play/loop fire animation?Reloading = same question!?"


I did say that I tried looping/playing the animations before hand but I removed them when they didn't work so I could continue coding other stuff without the lines of code getting in the way.

Windows 7, Amd Athlon 7750 Black Editon (64 bit,3ghz + Dual Core), ATI Readon HD 4870 1gb Edition, 4gb Ram.
luskos
17
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 18th Aug 2010 23:14
Something like this should work tell me if it does really, i didn't test it so...



Coding is My Kung Fu!
And My Kung Fu is better than Yours!
Bigsnake
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: England
Posted: 19th Aug 2010 02:22
thx but unfortatly it doesn't work. It blocks 3 animations (Fire,Reloading and Walking)

Windows 7, Amd Athlon 7750 Black Editon (64 bit,3ghz + Dual Core), ATI Readon HD 4870 1gb Edition, 4gb Ram.
Dia
19
Years of Service
User Offline
Joined: 16th Jan 2005
Location:
Posted: 19th Aug 2010 12:58 Edited at: 19th Aug 2010 13:02
if you use a variable to hold the state of your gun, you can then divide your code into two parts.

the first part of your code will modify the state of the gun, while the second part will 'pick' which animation to play based on the chosen state

something along the lines of:



I haven't tested this out exactly myself, since I dont have any useful models lying around atm, but something along these lines should sort you out

bear in mind that the way I have it written means the player will stop moving in order to reload

you can also wrap the two parts into functions or subroutines (makes it easier to read and MUCH easier to handle multiple units in the case of an rts of something)

This is not the Sig you are looking for....
Bigsnake
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: England
Posted: 19th Aug 2010 17:15
thank you, very usefull

Windows 7, Amd Athlon 7750 Black Editon (64 bit,3ghz + Dual Core), ATI Readon HD 4870 1gb Edition, 4gb Ram.

Login to post a reply

Server time is: 2024-11-23 11:29:46
Your offset time is: 2024-11-23 11:29:46