PDA

View Full Version : Weapon reloads in scripts



nyaa
9th November 2012, 16:52
Hi!
I would like to make the weapon's reloads in script because my mod is a developed botzom called Dream Team's Nazizom, and I want to make the quick reload perk easier to set more weapons in the game. Since, i don't know how to work it, I worked it to set 2 _mp file for one weapon: a fast_mp and a simple _mp. But because of it i must work with less weapons...
Thanks for the answer.
Nyaa

Tally
9th November 2012, 18:50
I would like to help but have no idea what it is you want to do from that description. Could you please rephrase your explanation again, saying what it is you want to do, and what circumstances you want it to happen.

kung foo man
9th November 2012, 19:33
He wants to dynamically adjust the speed of the reload-animation, but i guess thats not possible. :S

nyaa
9th November 2012, 22:19
Its possible. I have seen Tobby's mod, but he isn't so kind people, and doesnt tell me...
So,
I would like to set the weapon's reload time but not in the weapon_mp! In the script, somehow...
Any idea?

Tally
9th November 2012, 22:22
Its possible. I have seen Tobby's mod, but he isn't so kind people, and doesnt tell me...
So,
I would like to set the weapon's reload time but not in the weapon_mp! In the script, somehow...
Any idea?

You can't set any animation settings through script. The engine just doesn't support it. You would have to use multiple weapon files, and switch them back and forth. In fact, I'm not even sure you can adjust an animations speed without re-recording the animation in Maya all over again, and recompiling it back into xanim. I'm pretty sure just trying to adjust any values in a weapon file alone would do diddly squat.

kung foo man
9th November 2012, 23:38
Its possible. I have seen Tobby's mod

Can you post the IP, please?

Killer.Pro
10th November 2012, 04:17
Easy way to do it is when you go to that fast reload perk press F and then the mp_kar98k will change to mp_kar98k_fast....You need to make a copy of that fist file and then open it with note pad,in the data of the weapon you will see reload time and reload start ,reload end and some stuff like that..just change it to how many seconds you want to take while reloading after fast perk :)

Killer.Pro
10th November 2012, 04:26
See the difference between normal and fast kar98k...just cheak it in game without mod because i put it in iwds
normal : http://www.mediafire.com/?7m4ev6c41ns85m8
fast : http://www.mediafire.com/?oufownvdj0evrvl

I didn't rename them but you can do it if you use these in game:)

Tally
10th November 2012, 06:43
Here are the differences:

http://imageshack.us/a/img839/2436/kar98reloadtimes.jpg

the one on the right is the normal reload times; the one on the left, the fast times.

Killer.Pro
10th November 2012, 10:17
FAIL! I think you are mistaking sir :D Isn't right fast and left normal?

Peterlankton
10th November 2012, 10:22
Its possible. I have seen Tobby's mod, but he isn't so kind people, and doesnt tell me...

You serious? :eek: In the iwd files from the last time I played on a server with Tobby's zombots there are 2 _mp files for every weapon.
e.g. ak47_mp and fast_ak47_mp

kung foo man
10th November 2012, 13:45
You serious? :eek: In the iwd files from the last time I played on a server with Tobby's zombots there are 2 _mp files for every weapon.
e.g. ak47_mp and fast_ak47_mp

Thats why i asked for the IP to check it out. :D

@Tally: could you upload images to the forum? Extern sources tend to dont work in some years.

Killer.Pro
10th November 2012, 16:13
Hey IznoGoD, it was just to laugh :D

IzNoGoD
10th November 2012, 16:40
No hard feelings from my side.

On topic:
I've been playing with the idea of making a fast-reload weapon through scripts. Found some way that might work:
1. Create a weapon with a quite slow reload (normal reload maybe)
2. Bind the R-key to "+reload; openscriptmenu inputs reload"
3. Monitor said scriptmenuresponse, monitor all other inputs too (those that might interrupt the reloading process, like bashing or mantling)
4. If fast-reload enabled, give full clip ammo after a while (reduce normal ammo accordingly) and take away the weapon, just to give it back shortly after (0.05 seconds or so... might not even be needed)
5. There you have it, fast reload.

nyaa
10th November 2012, 19:43
Well, in Tobby's V1 mod its fast_ and simple_mp, and i know to how work it...
But, in Tobby's V2 mod there is no fast_mp! IP: 91.82.84.215:28983
Also IzNoGoD's idea may work i think. I will check and notify you, thanks.

kung foo man
11th November 2012, 04:53
IzNoGod made a good post about the logic, this post is about the animation:

In weapons/mp/luger_mp we see:

...\fireAnim\viewmodel_luger_fire\lastShotAnim\vie wmodel_luger_lastfire\...

so we are already able to define TWO reload-animations.

fireAnim is played with more than 0 ammo in magazine
lastShotAnim is played with 0 ammo in magazine

so, before +reload, we need to bind a /openscriptmenu, which is checking for the fast reload perk:
if normal reload: make sure at least 1 bullet is in magazine, so fireAnim will be played
if fast reload: make sure 0 bullets are in magazine, so lastShotAnim will be played

nyaa
11th November 2012, 20:16
kung foo man: I don't think your idea make sense:/
IzNoGoD's idea would good if the reload don't stop in the middle of reloading.
Like: you start reloading, and when you put back the clip the reload ends...

kung foo man
11th November 2012, 21:01
kung foo man: I don't think your idea make sense:/



And why? ;D