Raised This Month: $51 Target: $400
 12% 

how do i make my weapon models keep animating?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Major_victory
Member
Join Date: Nov 2005
Location: Illinois
Old 12-17-2005 , 18:43   how do i make my weapon models keep animating?
Reply With Quote #1

I've tried everything i can think of to do this...

I'm trying to make the animation on the rpg model from HL to KEEP animating even after the user has stopped pressing a button.
Here's what i've learned, tried, and know so far:

1. I know i have to use the function entity_set_int(id, EV_INT_weaponanim, <sequence>)

2. I know what the sequence numbers are and have some constants set up for them:
Code:
#define SEQ_IDLE       0 #define SEQ_FIDGET   1 #define SEQ_RELOAD  2 #define SEQ_FIRE       3

3. I've tried using entity_set_int in client_PreThink and it works only if the person continues to hold down the button, i've also tried a seperate function with the same results. I then tried a system of set_tasks and still had the same results.

4. if i do an if statement in client_PreThink like this:
Code:
if(mysequence = SEQ_RELOAD) {     entity_set_int(id, EV_INT_weaponanim, SEQ_RELOAD) }

then it crashes before i can start a server.

what i need to know is:

1. where to place the entity_set_int function so that it will continue the animation after it has been called once or set in motion.

2. is there any other way to start a players weapon animation?

please reply soon and i'll put your name in the special thanks section of my plugin, which for reference can be found here: http://forums.alliedmods.net/showthread.php?t=20745
__________________
Games i've screwed with:
Battlefield 1942, CNC Generals, Red Faction, Incoming/Incoming Forces, The Sims, Sim City 3k, Unreal Tournament, Fallout 1/2, Ragnarok, Goonzu, and CS 1.6.
Major_victory is offline
Send a message via AIM to Major_victory Send a message via Yahoo to Major_victory
Skym(a)ker
Junior Member
Join Date: Dec 2005
Old 12-18-2005 , 04:12  
Reply With Quote #2

What about useing set_task in it?
Skym(a)ker is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 12-18-2005 , 04:43  
Reply With Quote #3

Code:
new Float:lastFrame[33];  public client_PreThink(id) {     if(entity_get_int(id,EV_INT_weaponanim) != SEQ_RELOAD && isReloading[id]) {         entity_set_int(id,EV_INT_weaponanim,SEQ_RELOAD);         entity_set_float(id,EV_FL_frame,lastFrame[id]);     }     lastFrame[id] = entity_get_float(id,EV_FL_frame);  }
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Major_victory
Member
Join Date: Nov 2005
Location: Illinois
Old 12-18-2005 , 21:50  
Reply With Quote #4

that didn't work, although i see what you're trying to do. for some reason it only works if i hold down one of the attack buttons.

i've tried having it go to idle if no attack buttons were being used and a whole slew of other conditions but it still won't work

this is so frustrating! i can come so close but it always requires the person to hold down the button
__________________
Games i've screwed with:
Battlefield 1942, CNC Generals, Red Faction, Incoming/Incoming Forces, The Sims, Sim City 3k, Unreal Tournament, Fallout 1/2, Ragnarok, Goonzu, and CS 1.6.
Major_victory is offline
Send a message via AIM to Major_victory Send a message via Yahoo to Major_victory
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 12-19-2005 , 03:43  
Reply With Quote #5

You could always try PostThink instead.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Major_victory
Member
Join Date: Nov 2005
Location: Illinois
Old 01-07-2006 , 00:24  
Reply With Quote #6

ok... i'm still having lot's o problem animating this thing. i can't use IN_RELOAD or IN_IDLE because the plugin has it's own reloading and firing commands. I can still get pretty close to animating on it's own by performing +attack on the client while it needs to be animating and performing -attack when i'm done but this creates problems when you switch weapons at diff times. it also requires a fet set_tasks to get the timing right.

what i really need is a way to make it keep animating. i've tried so many different ways it's not even funny any more.

P.S. PostThink didn't do anthing.
__________________
Games i've screwed with:
Battlefield 1942, CNC Generals, Red Faction, Incoming/Incoming Forces, The Sims, Sim City 3k, Unreal Tournament, Fallout 1/2, Ragnarok, Goonzu, and CS 1.6.
Major_victory is offline
Send a message via AIM to Major_victory Send a message via Yahoo to Major_victory
SubFive
Senior Member
Join Date: Dec 2005
Location: USA
Old 01-07-2006 , 00:41  
Reply With Quote #7

Quote:
Originally Posted by XxAvalanchexX
You could always try PostThink instead.
Check my thread with grenade throwing animation. It doesnt work, and if your version does, please share the source.
SubFive is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 01-07-2006 , 00:52  
Reply With Quote #8

Could try this: http://forums.alliedmods.net/showthr...=195090#201225

But SubFive had no luck with it. Although, you might ;)
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
SubFive
Senior Member
Join Date: Dec 2005
Location: USA
Old 01-07-2006 , 00:58  
Reply With Quote #9

It was quite difficult and I still couldnt get the animation working. I'm still hoping Avalanche will come through and spill the beans though, he keeps telling me to do stuff but never has directly given me code.
SubFive is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 01-07-2006 , 13:31  
Reply With Quote #10

Quote:
Originally Posted by SubFive
It was quite difficult and I still couldnt get the animation working. I'm still hoping Avalanche will come through and spill the beans though, he keeps telling me to do stuff but never has directly given me code.
Here's spilling the beans for you:

I did give you code, you dumbass. You just neglected to follow it but cutting half of it out.

When you do finally test it, make sure you have another person watching you as opposed to using a third-person camera because of client prediction.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:35.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode