Jump to content

GetNthRecoveryTime


DaylenTheMaleficar

Recommended Posts

So I'm trying to see if I can get shouts to cost stamina but I'm having trouble getting this function to compile.

 

The error I'm getting:

 

"cannot call the member function GetNthRecoveryTime alone or on a type, must call it on a variable"

 

Relevant code:

Import Shout

;stuff

Event OnKeyDown(Int Keycode)
	if Keycode == ShoutKey
		staminacost1 = 2 * Shout.GetNthRecoveryTime(0) as int
		staminarate = playerref.getav("StaminaRate") as int
		playerref.setav("StaminaRate", 0)
	endif
EndEvent

Also, while I'm here, does anyone know of a way to detect the currently equipped shout? Can't find anything on shouts beyond skse's 6 little functions.

Link to comment
Share on other sites

GetNthRecoveryTime is to be called on a Shout variable or property.

 

That also doesn't do what you think it does. GetNthRecoveryTime returns the cooldown value for shouts. SetNthRecoveryTime changes this to what you want. Furthermore, these are Nth functions, similar to GetNthRef.. but there isn't a "GetNumShouts" or whatnot..

Edited by Terra Nova
Link to comment
Share on other sites

Must be because "Shout" is not a Shout, but actually the script called "Shout".

 

 

GetNthRecoveryTime is to be called on a Shout variable or property.

 

That also doesn't do what you think it does. GetNthRecoveryTime returns the cooldown value for shouts. SetNthRecoveryTime changes this to what you want. Furthermore, these are Nth functions, similar to GetNthRef.. but there isn't a "GetNumShouts" or whatnot..

 

Ah, thank you both for clearing that up, but getting the cooldown value is exactly what I want to do, as the stamina cost of shouts was to be a function of shout cooldowns. I'd hoped I could avoid rewriting every shout in the game as to maintain compatibility with other shout mods and possibly even new shout mods.

 

So, with this in mind, I guess this leaves me with the issue of detecting the currently equipped shout so I can keep the script dynamic. Any thoughts? Or, you know I could just search the wiki and find getequippedshout lol.

Edited by DaylenTheMaleficar
Link to comment
Share on other sites

OK I understand what you're saying and I can offer a different approach.

Event OnKeyDown(Int Keycode)
    if Keycode == ShoutKey
        staminacost1 = 2 * playerref.GetActorValue("ShoutRecoveryMult")
        playerref.setav("Stamina", staminacost1)
    endif
EndEvent

Don't need to cast to int. Also you stored the stamina rate but did nothing with it, perhaps you thought passing it into set actor value was going to take that value, but it doesn't work that way, since "StaminaRate" is a string and StaminaRate was a float. Can't pass a float variable to a string argument. And since you want Stamina itself to be the cost, use stamina. StaminaRate only affects the rate of Stamina regeneration. Just a bit of clearing up.

 

This should(untested by me) work as intended. But you want to print out(using debug) what ShoutRecoveryMult actually returns to make sure the stamina being used is the kind of balance you want. Since this actorvalue returns something of a global value that affects all the shouts.

 

EDIT: Alright, I've tested GetNthRecoveryTime and it will return the value of cooldown for that specific word within the shout being called. You knew that already from the code you post, however this is new to me hehe, so I learned something, and will create the page on the wiki with the info.

 

So you have two choices: If you want to affect all shouts, use my method. If you want to effect specific shouts and their specific words, use GetNthRecoveryTime and this will require a bit advance scripting.

 

0-2(0, 1, 2) = Word1, Word2, Word3.

Edited by Terra Nova
Link to comment
Share on other sites

Also, while I'm here, does anyone know of a way to detect the currently equipped shout? Can't find anything on shouts beyond skse's 6 little functions.

 

Have you already tried GetEquippedShout ?

 

Nevermind...already solved.

 

 

...and will create the page on the wiki with the info.

Kudos to you for doing this, good man. Still much work to do..;-)

Edited by Ghaunadaur
Link to comment
Share on other sites

The wiki is pretty much maintained by like ..2 people. Myself being one of them, and UN-FREAKING-FORTUNATELY, I don't have a lot of scripting knowledge to make really big edits for the pages that really need some attention, 90% of them being SKSE functions. The other(the only active SysOp left) just comes and bans the occasional spammer. Sometimes someone makes an edit but it is rare these days. LlHammonds himself pointed out right from the get go that the wiki wasn't going to get as much contribution as the CSWiki if people other than the ones that been around before but moved on, don't step up. He was right.

Edited by Terra Nova
Link to comment
Share on other sites

The wiki is pretty much maintained by like ..2 people. Myself being one of them, and UN-FREAKING-FORTUNATELY, I don't have a lot of scripting knowledge to make really big edits for the pages that really need some attention, 90% of them being SKSE functions. The other(the only active SysOp left) just comes and bans the occasional spammer. Sometimes someone makes an edit but it is rare these days. LlHammonds himself pointed out right from the get go that the wiki wasn't going to get as much contribution as the CSWiki if people other than the ones that been around before but moved on, don't step up. He was right.

 

I made a lot of changes, then I got banned and someone reverted all of them and some of them are very wrong.

Link to comment
Share on other sites

OK I understand what you're saying and I can offer a different approach.

Event OnKeyDown(Int Keycode)
    if Keycode == ShoutKey
        staminacost1 = 2 * playerref.GetActorValue("ShoutRecoveryMult")
        playerref.setav("Stamina", staminacost1)
    endif
EndEvent

 

Hmm, that's probably way better than what I was planning on doing, though obviously I'd have to change it to an onActorAction(shoutfire) or the stamina cost would always be 0 ;). This method would be quite preferable to the mess of updates and states I had in mind, if I can get it to work properly.

 

Also, don't worry about that staminarate thing. Was gonna make it so stamina doesn't regen while charging a shout but I have since removed that feature.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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