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.

FPSC Classic Scripts / Weapon Animations

Author
Message
A r e n a s
16
Years of Service
User Offline
Joined: 9th Jun 2008
Location:
Posted: 29th Dec 2009 01:01 Edited at: 29th Dec 2009 01:02
Does anyone know how to get weapon animations to work? I have Project Blue V1.7 and want to force the weapon to hide while the knife animation is run or the meele animation is run. I can do this by playing the put weapon away and draw weapon aimations. I have tried running each frame but i get a crash when i pick up the weapon. These are the commands i have tried:

animate=X
setframe=X
incframe=X
frameend=X

My question really is, can anyone show me how to run a simple animation of a weapon?

charger bandit
15
Years of Service
User Offline
Joined: 10th Nov 2009
Location: Slovenia
Posted: 29th Dec 2009 14:32
You cant script weapon animations through the pickup.You can use the gunspec to help you,but you cant do meele.Thats only possible in Fenix mod and the weapon must be animated to do that.

A.K.A djmaster
A r e n a s
16
Years of Service
User Offline
Joined: 9th Jun 2008
Location:
Posted: 29th Dec 2009 14:39 Edited at: 29th Dec 2009 14:40
Im using the special part of Project Blue. It allows me to write the script for the weapon (allows me to modify zoom, fire and reload keys). The alternative script is declared in the gunspec as an extra addon (usescript = X, I think thats the command, but wont check just now). I should be able to run the animation that i want from the file but when ever I set the frame, i get a crash :S

charger bandit
15
Years of Service
User Offline
Joined: 10th Nov 2009
Location: Slovenia
Posted: 29th Dec 2009 21:08
I doubt you can run animation of the weapon through weapon scripting system.Try asking Plystire,he made it.

A.K.A djmaster
A r e n a s
16
Years of Service
User Offline
Joined: 9th Jun 2008
Location:
Posted: 30th Dec 2009 00:03
I would but he isnt on msn much and nor is he on the forums as much...

Errant AI
18
Years of Service
User Offline
Joined: 24th Aug 2006
Location:
Posted: 31st Dec 2009 09:12
You need to specify the framerange in gunspec as a custom animation then call the canim either through your weapon script or another script. I've found it easier to call the animation through a regular script. Keep in mind that the weapon scripting is fairly gimped. You don't have but a fraction of the FPI commands which are usable. Likewise, many of the new weapon commands can only be called by a weapon script. So, it takes a lot of work-around.

Also note that:

animate=X
setframe=X
incframe=X
frameend=X

all have zero to do with actual frames of animation. They relate to anim#s assigned via FPE to non-weapon dynamic entities/characters.

I'd post the work I had done with this but I broke the script and subsequently backburnered it.
A r e n a s
16
Years of Service
User Offline
Joined: 9th Jun 2008
Location:
Posted: 31st Dec 2009 09:48 Edited at: 31st Dec 2009 09:48
Do you have any scripts which show how this is done? I would very much like to have a look at how thes are use properly withough causing crashes Would it be possible to also include the gunspec?

Errant AI
18
Years of Service
User Offline
Joined: 24th Aug 2006
Location:
Posted: 31st Dec 2009 10:28
If I can isolate it, I'll show you. (I had 3 or 4 different scripts running to make it happen-as part of a larger system)
A r e n a s
16
Years of Service
User Offline
Joined: 9th Jun 2008
Location:
Posted: 31st Dec 2009 10:51
Okay. Would you be able to show me the relevant things that set up and run the animations so i am able to duplicate and modify it for the G36C.

Errant AI
18
Years of Service
User Offline
Joined: 24th Aug 2006
Location:
Posted: 1st Jan 2010 07:22 Edited at: 1st Jan 2010 07:24
Here you go...

Add this to the G36C gunspec:



The above format is what you need to follow. customanims=x works like specifying soundframes. You can have as many canims as you like. Just name them canim1,canim2,etc. and have customanims=x value match the number of canims. The value for each canim is an explicit frame range.

And here is a simple script for controlling the animation, to get you going:



custanimgun=x value corresponds to the canim number. So, custanimgun=1 calls canim1.

When you press "F" it will play the anim and a generic sound as soon as you release the key. The etimer is there so you can't spam "F" and interrupt the animation. Adjust the timing as you like.

And that's how custom weapon anims work. There are additional options for animating the left vs. right hand gun if dualling in PBUM but it's pretty much the same sort of deal.
A r e n a s
16
Years of Service
User Offline
Joined: 9th Jun 2008
Location:
Posted: 1st Jan 2010 13:12 Edited at: 1st Jan 2010 14:08
Right, that's just what i wanted And this is effectively Hockeykid's meele system. All you need to do is deal the damage which is the easy part. Thanks again EAI

EDIT

EAI, I dont suppose that you have an msn so that asking quick questions like this about your weapons doesnt take days to answer?

If you do and you can give me it, my emal (not msn) is;


EDIT 2

With the custom anim number, are they unique to the weapon? Like if you use number 1 in the g36c and call that anim in a different weapon, will the g36c's anim be played? If so, that would be brill

EDIT 3

I have run a test to determine whether or not you can play external weapon animations. It turns out that you can, the weapon is just not shown, I find this very disappointing... Is there a command which can fix it so that the weapon does show?

Errant AI
18
Years of Service
User Offline
Joined: 24th Aug 2006
Location:
Posted: 2nd Jan 2010 16:47
No public MSN at this time. I'm only online a limited amount of time every day or two and it ends up being too distracting for me.

Not sure what you mean about external weapon anims. If you were hoping to find a weaponswitch loophole, you're out of luck.

The canim numbers are not unique. This is sort of a good thing actually because if you always set canim1 as melee, the same bit of script will work for whatever weapon you're holding. If you want to avoid that (like you have a unique type of anim that others don't share, just make it like canim5 or whatever. When I do that, I still list the other canims in gunspec but give bogus frame ranges.
A r e n a s
16
Years of Service
User Offline
Joined: 9th Jun 2008
Location:
Posted: 2nd Jan 2010 16:59
By external animations, I mean is it possible, when your holding your G36C, to play your combat knifes animation and it is visible? I get the sound from the combat knife, i just don't see any weapon. If this was to be possible, it means that you would be able to melee with a knife while holding any weapon, and then this could advance to using granades

Errant AI
18
Years of Service
User Offline
Joined: 24th Aug 2006
Location:
Posted: 2nd Jan 2010 17:37 Edited at: 2nd Jan 2010 17:38
Different pipeline for hud model and sounds. That's why you can hear the sound. Would need the weapon equipped/loaded to see the anim. You could sort of do it by making the script equip the grenade in the left hand,make it fire, and then unequip it. Should work as long as the right hand is either empty or carrying a dual-able weapon.

That reminds me I should pack up and release an m67 revision. I made it dual-able and I think added a quick-throw anim but not sure. I backburnered it because there was a dual-flak bug in PBUM 1.6 but that's been fixed.
A r e n a s
16
Years of Service
User Offline
Joined: 9th Jun 2008
Location:
Posted: 2nd Jan 2010 18:53
I reckon that any new models are always great Also, would i be able to get my hands on your Scar? I would be willing to pay even if it has now been given your approval for the TGC store yet.

With weapons, do you think it would work if you hid the weapon, switched weapon to a knife or grenade, then fired, then switched back? I reckon that should work, but it needs Fenix mods switchweap and force fire commands as when you have a weapon given or removed, you need to switch weapon and back to see any effect in Project Blue.

Errant AI
18
Years of Service
User Offline
Joined: 24th Aug 2006
Location:
Posted: 3rd Jan 2010 15:11 Edited at: 3rd Jan 2010 15:12
It could likely work with a knife but maybe not with a grenade. The reason is that there's no switch weapon action in PB. The only option is to use the give weapon function. So, with a grenade, you would get free grenades every time. I suppose you could write some variable to govern this in lieu of ammo as long as you also remove the weapon when you're done with it to keep the player from being able to select it as stand-alone. Knife should be less hassle because no ammo to fuss with.

No explicit force fire action is needed. You can do a workaround in PB to control weapon firing from an non-weapon script.

I do it like this (added to the weapon script):


So, you can see all I need to do is have the other script do a temporary setvar=plrfireweap 1 and the weapon will fire.

I would set it up like:


Pretty straight foreward.

One nice thing about the AirMod hide weapon function in PB is that the weapon you hide will be the same weapon returned to when you call the show weapon command. It will actually allow you to do a round-about weaponswitch. But don't think that you'll be able to use it as one because it clears/resets itself each time it's called.

I found this out setting a hotkey for that function because it's an easy way to bypass the stuck weaponswitch bug. So to recap on that; if the plr is using G36C and you call hide weapon the G36 will hide and if another weapon is being used and show weapon is called it will switch back to G36C.

I would try to do it sort of like this:

1.Hide current weapon
2.Give the player the knife (have it placed in the level/respawning,etc)
3.Force-fire the knife
4.Show the previous weapon (to switch back).

The player can still select the knife as stand-alone but can likely only use the special attack 999 times or whatever the spawn limit is.

Potential problem might be if giving the player a weapon they already have it might not auto equip. So, you may need to remove the weapon after the auto attack. If that's the case, and you get it working, it should be easier to set the grenade to do the same thing. The only difference would be that you would want the grenade pickups to do an addvar each time to the var where you're keeping track of perceived 'nade ammo. You would just need to do a vargreater=grenadeammo 0 type check as a condition to initiating the attack sequence.
A r e n a s
16
Years of Service
User Offline
Joined: 9th Jun 2008
Location:
Posted: 3rd Jan 2010 16:58 Edited at: 3rd Jan 2010 17:01
With hiding and showing the weapon, you could use the put away animation and the show animation. That would make it more realistic than the weapon just disappearing. The problem would be firing the other weapon as no matter hat animation is played in another weapon, it wont show unless you have that weapon set to the one that you are holding. That is why i would really like Hockeykid to set the switchweap command into PB.

And with the grenade it would be very easy just to treat a variable as its ammo and pay no attention to its actual ammo. Just only have the grenade work if the variable is above 0. With the grenade, if there was a command to set the life of the grenade, you could also have a hold down and when the button is released a variable would determine how much life is left in the grenade. You would need to pause the grenades throw animation if this was to work effectively however.

Back to the knife anyway. You would not actually be able to see the knife when you played the animation, even if you did mess about with the hideweap and showweap commands.

By the show and hide weapons returning to the weapon which is hidden or shown, would it work running hide weapon in the knife script, and then showing weapon again. Would this switch your weapon to the knife? And then this idea can be used to return to the original weapon, but you would need a chain of possible return weapons. It wouldn't be too much code, around 100 lines worth.

Errant AI
18
Years of Service
User Offline
Joined: 24th Aug 2006
Location:
Posted: 4th Jan 2010 05:00
Quote: "With hiding and showing the weapon, you could use the put away animation and the show animation."


Retrieve and putaway anims play when using hide/show weapon calls. Don't see what the problem is.

Quote: "The problem would be firing the other weapon as no matter hat animation is played in another weapon, it wont show unless you have that weapon set to the one that you are holding."


I don't see the problem there either. There shouldn't be any problem other than the lag time it takes to hide the current weapon, give the alternate weapon and then use it. It doesn't matter what the anim being played with the original weapon when the hide weapon command is called. It'll put it away in a similar manner as having scrolled away from it.

Quote: "You would not actually be able to see the knife when you played the animation, even if you did mess about with the hideweap and showweap commands."


I don't why that would be the case. You aren't calling an animation to be played, per se. You are calling an external trigger to fire/use the weapon. The anim will play assuming you can cause it to be equipped.

Quote: "By the show and hide weapons returning to the weapon which is hidden or shown, would it work running hide weapon in the knife script, and then showing weapon again. Would this switch your weapon to the knife? And then this idea can be used to return to the original weapon, but you would need a chain of possible return weapons. It wouldn't be too much code, around 100 lines worth."


No. You should never be calling hide weapon on the knife because when hide weapon is called it resets which weapon will be shown when show weapon is called.

You should experiment with getting to know how the functions work better because you could have probably achieved it by now
A r e n a s
16
Years of Service
User Offline
Joined: 9th Jun 2008
Location:
Posted: 4th Jan 2010 10:37
I know what function are in terms of DB Pro:

function Test()

endfunction

and subroutines ect... I just dont know what you mean by a function in FPI AI. Could you give me a quick example of what you mean as i cant follow any of your reasoning with this theory.

Errant AI
18
Years of Service
User Offline
Joined: 24th Aug 2006
Location:
Posted: 4th Jan 2010 12:34
Sorry for the misunderstanding. I don't mean function as in any sort of lingo but rather the functionality of how the commands work in real context. I've found a fair share of quirkiness with some of them which don't always line up with preconceived notions based on how they are described in the manuals. The only way around that has been through trial and error. So, it's only so productive to talk about what may or may not work and easier to plod along and fix/circumvent bugs as they arise.

Sorry if that or my previous reply sound at all on the snippy side. Been stressed and in a bit of a mood lately. Unfortunately that spills over into forum behavior sometimes.
A r e n a s
16
Years of Service
User Offline
Joined: 9th Jun 2008
Location:
Posted: 4th Jan 2010 12:43 Edited at: 4th Jan 2010 12:46
Stresses I know what you mean

I am trying:

to get my multiplayer mod to work!
to revise for my mock exams (start tomorrow),
to revise for my GCSE exams,
to find somewhere for work experience,
to restore the dark matter dbpro pack to FPSC for a possible model pack,
to get meele working,
to get grenades working...

And not much of this is happening properly....

[Back on topic]

So are you able to provide me with a small example of what you mean as i cant follow your theory?

[Off topic for a sec]

DAM DB PRO! I get an error saying the command doesnt make sense!



All values in that are integers. How does DB Pro not understand that!

Errant AI
18
Years of Service
User Offline
Joined: 24th Aug 2006
Location:
Posted: 4th Jan 2010 13:48
I'll try to mess with it a bit tonight and post back tomorrow with my findings

Sounds like you have a full plate. Best of luck with all of that!
A r e n a s
16
Years of Service
User Offline
Joined: 9th Jun 2008
Location:
Posted: 4th Jan 2010 13:59
Multiplayer problem fixed, im on a role again Time for my create a class feature to be tested

I look forward to seeing your findings tonight.

On a completely unrelated note. Where would i be able to purchase your scar weapon? And would it be possible to pay you to add several extra animations to your previous weapons? For example meele to P90, or hand signals ect...

Errant AI
18
Years of Service
User Offline
Joined: 24th Aug 2006
Location:
Posted: 4th Jan 2010 17:48 Edited at: 4th Jan 2010 17:50
Not tuned-up real good but IT WORKS! (most of the time)

Had to do things a little different because some of my initial assumptions were wrong. It hasn't been stress tested, so it's probably pretty easy to mess it up by doing random things which can break the script. I'm not going to spend the time making it bullet-proof though because I don't have time. If you need clarification on why I did things a certian way, just ask.

When it breaks, it usually breaks at state 12/13. This is likely some timing or framerate fluctuations causing plrtake lag (or not enough lag). If that can be smoothed out it should be pretty OK. It seems a little more stable if PBUM is running in optimized mode.

If it breaks/hangs between states 12/13 (the G36 will be putaway but the knife not come out), you can scroll to the knife and it will autoattack and reset the script.

You can also break it by spamming the F key.

Anyhow...

Combat Knife Gunspec (gunspec.txt)



Combat Knife Weapon Script (autoknife.fpi)



Combat Knife Pickup Entity Script (eai_autoknife_pickup.fpi)
Set to always active with max respawn and minimum spawn delay.



And finally, assign the actual script to a dynamic light(eai_autoknife.fpi)



(SCAR and the other things are off the table for now unless the money is irresistable- Just no time ATM. I shouldn't have even messed with this but I'm procrastinating.)
A r e n a s
16
Years of Service
User Offline
Joined: 9th Jun 2008
Location:
Posted: 4th Jan 2010 20:10
Well if i get the script to work with no problems i will give you the script and you should use it in your weapons Give a nice knife meele feature. I think my friend is talking about buying a weapon from you, so im gonna wait until he has bought it and i'll ask what it is lacking in (you said that it isnt complete). Until then it looks like i'll be coding my mod

By scar and other things, what exactly are the other things, and how much do these things cost? If you dont want to say online, then could you please email me at:



To be honest, when fenix mods weapswitch command comes into PB, it will enable this idea as you will be able to hide weap, switch weap, show weap, fire and revese. With almost no bugs.

I was thinking how it would be possible to merge these things, and i just thought, for your new set of weapons this year, perhaps you could add in a knife into the actual weapon. Then the user can run hide weap, run the show knife and everything, and it would all be in one weapon. You'd only need animations for showing, hiding and attacking with the knife. The main gun would also need to be hidden first. I cant wait to see what you will be bringing out this year though. Best of luck.

Login to post a reply

Server time is: 2024-11-25 03:34:36
Your offset time is: 2024-11-25 03:34:36