attack animation help--> M16A2 shoots bullets as dagger

Post » Tue Jun 19, 2012 6:11 pm

I have finally done it. I made the M16A2 that can fire 'ammorounds'. No magic in this formula, and do not have to fire it like a bow. Problem is, holding it like a 1hd sword and firing a round off isn't good looking. Really need some animation help on that, even if that meant it's held like a staff striaght out, thats fine. Also, I don't think it's firing off a semi-automatic amount of 3. The spoiler below has the script I made by taking other scripts and chopping them up and putting them together. Also as motivation and credit to the creator of the Dwemerrifle for without his mod, I wouldn't have had the motivation and some idea of where to start.


Spoiler
Scriptname reallyalteredFireWeaponScript extends ObjectReference  {Script for firing projectiles from FireWeaponMarker-The default setting is to fire whatever weapon/ammo you, every 4-6 seconds, if the marker is enabled-If you just want it to fire once then set MinWaitTime to 0.0, MaxWaitTime to 0.1, and TimesFired to 1import utilityimport weaponimport debug;---------------------------;--Hidden Properties;---------------------------int Property TimesFired Auto Hidden{How many times i've already fired}Function Fire(ObjectReference akWeapon, Ammo akAmmo = None) Nativefloat Property WaitTimer Auto hidden{Rand wait time generated based on the Min and Max wait times};---------------------------;--Editable Properties;---------------------------int Property TimesToFire = -1 Auto{Maximum number of times you want this to fire once it's enabled. (-1 = until disabled)}float Property MaxWaitTime = 6.0 auto{Maximum wait between refire, Default = 6.0}float Property MinWaitTime = 4.0 auto{Minimum wait between refire, Default = 4.0}weapon Property Weapontype Auto{Type of weapon you want to fire, (ie. "HuntingBow")}ammo Property Ammotype Auto{Type of ammo you would like to fire, (ie. "IronArrow")}Message Property FailureMessage Auto  {Message to say why you can't use this}Projectile Property m16a2ammoprojectile AutoEvent OnLoad()	BlockActivation(true)endEventEvent OnUnload()	; safety measure	UnregisterForEvents()endEventauto STATE normalEvent OnActivate(ObjectReference akActionRef)	gotoState("busy"); 	debug.trace(self + "OnActivate")	if akActionRef == Game.GetPlayer()		; check if player has m16a2		if Game.GetPlayer().GetItemCount(weapontype) > 0			RegisterForEvents(); ;			debug.trace(self + "player activation START")			Activate(akActionRef, true); ;			debug.trace(self + "player activation END")		else			FailureMessage.Show()		endif	endif	gotoState("normal")endEventendStateSTATE busy	; do nothingendStateEvent OnAnimationEvent(ObjectReference akSource, string asEventName); 	debug.trace(self + ": animation event received=" + asEventName)	if asEventName == "Fire"		WeaponType.fire( self as objectReference, Ammotype)	;I'm enabled so fire.			endifendEventbool isRegisteredForEvents = falsefunction RegisterForEvents()	; centralize this	isRegisteredForEvents = true	RegisterForAnimationEvent(Game.GetPlayer(), "Fire")endFunctionfunction UnregisterForEvents()	; centralize this		if isRegisteredForEvents		isRegisteredForEvents = false		UnRegisterForAnimationEvent(Game.GetPlayer(), "Fire")	endifendFunction 
User avatar
luis ortiz
 
Posts: 3355
Joined: Sun Oct 07, 2007 8:21 pm

Post » Tue Jun 19, 2012 4:52 am

I'm not really on topic here, and excuse me for that...but what's the motivation for firearms? There are games that are completely designed from the ground up for firearm combat. Why fit a square peg in a round hole?
User avatar
mike
 
Posts: 3432
Joined: Fri Jul 27, 2007 6:51 pm

Post » Tue Jun 19, 2012 3:48 pm

Why fit a square peg in a round hole?
Why not? :wink:
User avatar
kasia
 
Posts: 3427
Joined: Sun Jun 18, 2006 10:46 pm

Post » Tue Jun 19, 2012 7:29 pm

is this script attached to a dagger? because i did but can't make it work...
User avatar
TRIsha FEnnesse
 
Posts: 3369
Joined: Sun Feb 04, 2007 5:59 am

Post » Tue Jun 19, 2012 4:49 am

I made it to where you have to actually go into the crafting kit, and set up what weapon and ammo you want... not even sure I needed to add the line <Projectile Property m16a2ammoprojectile Auto> . So it should work if you made the weapon property a weapon like a knife... Haven't put it through all the tests though.
User avatar
Nikki Hype
 
Posts: 3429
Joined: Mon Jan 01, 2007 12:38 pm

Post » Tue Jun 19, 2012 8:12 am

I'm not really on topic here, and excuse me for that...but what's the motivation for firearms? There are games that are completely designed from the ground up for firearm combat. Why fit a square peg in a round hole?

Well, to see if I could, and also that is the point. There are games made for that, so it's trivial, but this is a game not made for these type of weapons. Also, those type of games are designed from the ground up and typically have everything else associated with that. I at this moment don't do so well with games or movies that are too similiar to military combat, therefore M16A2 killing rats, dragons, and trolls I am ok. Military forces with M16's, I don't do so well right now.
User avatar
Logan Greenwood
 
Posts: 3416
Joined: Mon Jul 30, 2007 5:41 pm


Return to V - Skyrim