Jump to content

Scripted spears(As blade weapon) so that they use different anims


Imrinfected

Recommended Posts

I thought I would try to tackle adding spears into the game with their own animations. I figure I will go about this by adding the spears to the game as either blade or blunt weapons(Whichever make more sense for the spear in question) and use a script to change the animations used.

 

I haven't had much experience with scripting animations, so I don't know what problems it presents(And I'm sure there are problems) or how to work around them.

 

So, scripting wise, how should I change the animations for a weapon in the game using say, these animations http://tesnexus.com/downloads/file.php?id=27865.

 

I'm assuming it would have to run on gamemode using a quest, but that presents problems with delays in heavily modded games, which could make using a spear very messy.

The simple way would be to use the iskeypressed or iscontrolpressed function to play the animation if 1 is returned on that key/control, but I'm not sure what function can be used to play an animation on the player.

 

EDIT: I hope I would not be naive to hope I could get this to work on whoever has the spear equipped, rather than just working on the player. In the past I used a ref variable with getactionref to check if an activating npc was the player or not. Maybe there's a way to do the same thing here with a different variable.

ref SpearUser

set SpearUser to spear.Getcontainer?

Link to comment
Share on other sites

I thought I would try to tackle adding spears into the game with their own animations. I figure I will go about this by adding the spears to the game as either blade or blunt weapons(Whichever make more sense for the spear in question) and use a script to change the animations used.

 

I haven't had much experience with scripting animations, so I don't know what problems it presents(And I'm sure there are problems) or how to work around them.

 

So, scripting wise, how should I change the animations for a weapon in the game using say, these animations http://tesnexus.com/downloads/file.php?id=27865.

 

I'm assuming it would have to run on gamemode using a quest, but that presents problems with delays in heavily modded games, which could make using a spear very messy.

The simple way would be to use the iskeypressed or iscontrolpressed function to play the animation if 1 is returned on that key/control, but I'm not sure what function can be used to play an animation on the player.

 

EDIT: I hope I would not be naive to hope I could get this to work on whoever has the spear equipped, rather than just working on the player. In the past I used a ref variable with getactionref to check if an activating npc was the player or not. Maybe there's a way to do the same thing here with a different variable. Getcontainer on the spear?

 

Hmm, I really do hope that a decent spear animation is created. Especially, a phalanx-esque style of fighting. The ones as of yet are good, but not Alexander-style. Just a bit picky.

 

On scripting animation changes, i have one bit of input. While there may be a way to use gamemode to use a spear, each spear would have to be listed in the script. An easier method that may work is using object scripts. That way if another author decided to create a spear, her could refer to the master file and attach the script to the spear when he wanted. OnEquip, and OnUnEquip would work in this situation. Otherwise, I think Deadly Reflex/Unnecessary Violence has already done this, or something similar.

Link to comment
Share on other sites

I thought I would try to tackle adding spears into the game with their own animations. I figure I will go about this by adding the spears to the game as either blade or blunt weapons(Whichever make more sense for the spear in question) and use a script to change the animations used.

 

I haven't had much experience with scripting animations, so I don't know what problems it presents(And I'm sure there are problems) or how to work around them.

 

So, scripting wise, how should I change the animations for a weapon in the game using say, these animations http://tesnexus.com/downloads/file.php?id=27865.

 

I'm assuming it would have to run on gamemode using a quest, but that presents problems with delays in heavily modded games, which could make using a spear very messy.

The simple way would be to use the iskeypressed or iscontrolpressed function to play the animation if 1 is returned on that key/control, but I'm not sure what function can be used to play an animation on the player.

 

EDIT: I hope I would not be naive to hope I could get this to work on whoever has the spear equipped, rather than just working on the player. In the past I used a ref variable with getactionref to check if an activating npc was the player or not. Maybe there's a way to do the same thing here with a different variable. Getcontainer on the spear?

 

Hmm, I really do hope that a decent spear animation is created. Especially, a phalanx-esque style of fighting. The ones as of yet are good, but not Alexander-style. Just a bit picky.

 

On scripting animation changes, i have one bit of input. While there may be a way to use gamemode to use a spear, each spear would have to be listed in the script. An easier method that may work is using object scripts. That way if another author decided to create a spear, her could refer to the master file and attach the script to the spear when he wanted. OnEquip, and OnUnEquip would work in this situation. Otherwise, I think Deadly Reflex/Unnecessary Violence has already done this, or something similar.

OnEquip and OnUnEquip runs the script once. Unless there's a way to actually replace the animation instead over override the older one like I had previously thought, I don't think that will work.

 

You are right about having to add each spear to the script. I didn't think about that.

Link to comment
Share on other sites

I thought I would try to tackle adding spears into the game with their own animations. I figure I will go about this by adding the spears to the game as either blade or blunt weapons(Whichever make more sense for the spear in question) and use a script to change the animations used.

 

I haven't had much experience with scripting animations, so I don't know what problems it presents(And I'm sure there are problems) or how to work around them.

 

So, scripting wise, how should I change the animations for a weapon in the game using say, these animations http://tesnexus.com/downloads/file.php?id=27865.

 

I'm assuming it would have to run on gamemode using a quest, but that presents problems with delays in heavily modded games, which could make using a spear very messy.

The simple way would be to use the iskeypressed or iscontrolpressed function to play the animation if 1 is returned on that key/control, but I'm not sure what function can be used to play an animation on the player.

 

EDIT: I hope I would not be naive to hope I could get this to work on whoever has the spear equipped, rather than just working on the player. In the past I used a ref variable with getactionref to check if an activating npc was the player or not. Maybe there's a way to do the same thing here with a different variable. Getcontainer on the spear?

 

Hmm, I really do hope that a decent spear animation is created. Especially, a phalanx-esque style of fighting. The ones as of yet are good, but not Alexander-style. Just a bit picky.

 

On scripting animation changes, i have one bit of input. While there may be a way to use gamemode to use a spear, each spear would have to be listed in the script. An easier method that may work is using object scripts. That way if another author decided to create a spear, her could refer to the master file and attach the script to the spear when he wanted. OnEquip, and OnUnEquip would work in this situation. Otherwise, I think Deadly Reflex/Unnecessary Violence has already done this, or something similar.

OnEquip and OnUnEquip runs the script once. Unless there's a way to actually replace the animation instead over override the older one like I had previously thought, I don't think that will work.

 

You are right about having to add each spear to the script. I didn't think about that.

 

Ack, only once? I thought once per equip and unequip, but it seems I was wrong. I almost messed up one of my own script projects!

Link to comment
Share on other sites

I thought I would try to tackle adding spears into the game with their own animations. I figure I will go about this by adding the spears to the game as either blade or blunt weapons(Whichever make more sense for the spear in question) and use a script to change the animations used.

 

I haven't had much experience with scripting animations, so I don't know what problems it presents(And I'm sure there are problems) or how to work around them.

 

So, scripting wise, how should I change the animations for a weapon in the game using say, these animations http://tesnexus.com/downloads/file.php?id=27865.

 

I'm assuming it would have to run on gamemode using a quest, but that presents problems with delays in heavily modded games, which could make using a spear very messy.

The simple way would be to use the iskeypressed or iscontrolpressed function to play the animation if 1 is returned on that key/control, but I'm not sure what function can be used to play an animation on the player.

 

EDIT: I hope I would not be naive to hope I could get this to work on whoever has the spear equipped, rather than just working on the player. In the past I used a ref variable with getactionref to check if an activating npc was the player or not. Maybe there's a way to do the same thing here with a different variable. Getcontainer on the spear?

 

Hmm, I really do hope that a decent spear animation is created. Especially, a phalanx-esque style of fighting. The ones as of yet are good, but not Alexander-style. Just a bit picky.

 

On scripting animation changes, i have one bit of input. While there may be a way to use gamemode to use a spear, each spear would have to be listed in the script. An easier method that may work is using object scripts. That way if another author decided to create a spear, her could refer to the master file and attach the script to the spear when he wanted. OnEquip, and OnUnEquip would work in this situation. Otherwise, I think Deadly Reflex/Unnecessary Violence has already done this, or something similar.

OnEquip and OnUnEquip runs the script once. Unless there's a way to actually replace the animation instead over override the older one like I had previously thought, I don't think that will work.

 

You are right about having to add each spear to the script. I didn't think about that.

 

Ack, only once? I thought once per equip and unequip, but it seems I was wrong. I almost messed up one of my own script projects!

Yeah, it runs it once each time it's equipped when using onequip, and once each time it's unequipped using onunequip.

Link to comment
Share on other sites

Take anything I say with a grain of salt as I am only working on ancient/poor memory (and without experience with animation)...but I thought if the animations were not outright replaced and instead scripted, there would be problems with the animations firing off at the right time.

 

And if you replace an animation, you are essentially replacing one weapon set with another...making the other broken.

 

If this could work effectively, I'd be interested in using it. I have a spear and battlestaff in the current mod I'm working on and they are currently configured like a claymore. I'd rather have the spear held like a longsword in order to utilize the shield. ;)

 

Spear Image

 

LHammonds

Link to comment
Share on other sites

Take anything I say with a grain of salt as I am only working on ancient/poor memory (and without experience with animation)...but I thought if the animations were not outright replaced and instead scripted, there would be problems with the animations firing off at the right time.

 

And if you replace an animation, you are essentially replacing one weapon set with another...making the other broken.

 

If this could work effectively, I'd be interested in using it. I have a spear and battlestaff in the current mod I'm working on and they are currently configured like a claymore. I'd rather have the spear held like a longsword in order to utilize the shield. ;)

 

Spear Image

 

LHammonds

It could be made to work at the right time, but I'm still not convinced that's the best way to go about it. I'm not even sure how to script an animation to play.

Link to comment
Share on other sites

You might be able to get the animations to play by setting up your attack animations as idles and then using pickidle. The method here might work:

http://cs.elderscrolls.com/constwiki/index.php/Forcing_Idle_Animations

 

As far as I know, you'd be overriding your normal melee attack functionality. If that's the case, you would need to set up timers and apply damage via script.

Link to comment
Share on other sites

You might be able to get the animations to play by setting up your attack animations as idles and then using pickidle. The method here might work:

http://cs.elderscrolls.com/constwiki/index.php/Forcing_Idle_Animations

 

As far as I know, you'd be overriding your normal melee attack functionality. If that's the case, you would need to set up timers and apply damage via script.

That is an interesting idea.

 

I should be able to do it using that. Thanks for the input. I was hoping there was a less resource demanding way, though.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...