How does Skyrim check to see if you have enough magicka to c

Post » Tue Jun 19, 2012 9:44 pm

I'm trying to have it do the same thing for a spell of mine, except it needs to check stamina instead of magicka.

EDIT: I kind of think that the engine itself handles it, which would svck. I'm hoping it's a script or something.
User avatar
lucile davignon
 
Posts: 3375
Joined: Thu Mar 22, 2007 10:40 pm

Post » Tue Jun 19, 2012 5:36 pm

It's hardcoded, but you can just use GetAV Stamina I suppose, and then use either DamageActorValue or ModActorValue (I don't know at the moment which one reduces it temporarily, you'll have to try that out.)
User avatar
Juanita Hernandez
 
Posts: 3269
Joined: Sat Jan 06, 2007 10:36 am

Post » Tue Jun 19, 2012 10:09 pm

!@#$ that's what I was thinking. I currently have it set up similar to what you said. It's fully functional, except that when you don't have enough stam, you can still cast, it just doesn't do anything.

I can't believe how hard Beth made this whole process. I want to add a new school of magic that uses stam instead of magicka, and it seems like everything I want to do is hardcoded.

EDIT: I wonder if any of this can be changed by accessing the swf files that contorl the HUD...I bet not, but it's worth a peek I suppose.
User avatar
Jonathan Windmon
 
Posts: 3410
Joined: Wed Oct 10, 2007 12:23 pm

Post » Tue Jun 19, 2012 8:32 pm

You probably simply need to wait for some upcoming SKSE functionality, for example a DisableControl and a TapControl command and a ControlPress Event. You could then make a script start running whenever the player has your spells equipped that both disables and detects the mouse button press, and then re-simulates the mouse button press with TapControl if you have enough stamina, and if not it won't press TapControl so nothing will happen because of DisableControl.
User avatar
FLYBOYLEAK
 
Posts: 3440
Joined: Tue Oct 30, 2007 6:41 am

Post » Wed Jun 20, 2012 6:56 am

Yes that would work as far as getting the spells to behave properly.

I still need to figure out how to add that school of magic though. I'm digging through the swfs now.

EDIT: I didn't see anything in the swfs that would be useful to me. They just tell the game HOW to display the HUD, not WHAT to display. I'll figure this out if it takes me all year.
User avatar
Thema
 
Posts: 3461
Joined: Thu Sep 21, 2006 2:36 am

Post » Wed Jun 20, 2012 2:59 am

Add a school of magic, as in adding a new Skill? That will probably take quite a while before we're capable of that, from what I've seen simply adding a new Actor Value form into Skyrim.esm causes crashes.

MERP is going to add new Skills (and Attributes) as Properties, since we are a total conversion we can change everything that is necessary to make that work. Such a thing will be more complicated for a regular Skyrim mod, at least if you want to display it as a regular Skill.
User avatar
Eliza Potter
 
Posts: 3481
Joined: Mon Mar 05, 2007 3:20 am

Post » Wed Jun 20, 2012 2:01 am

Yeah...I can change a branch of magic to be what I want it to be (by hexing TESV.exe to say Paladin in the magic menu, and changing the AV in the CK to say Paladin in the skills menu), but I haven't even begun to make progress as far as making and additional branch of magic. I kind of think I need to start begging Beth to make this possible, as I'm currently of the belief that what I'm trying to do isn't possible short of disassembling the code.

EDIT: Even if I got the menu to display what I wanted it to, I would still need to add a new skill, or pseudoskill to make it practical. Time to start begging.
User avatar
Wanda Maximoff
 
Posts: 3493
Joined: Mon Jun 12, 2006 7:05 am

Post » Tue Jun 19, 2012 7:23 pm

Hold on doesn't actor extend object in which case you can use the OnSpellCast event and check if its your spell, mind you not sure if that fires before the actual spell cast happens in the world.
User avatar
Britney Lopez
 
Posts: 3469
Joined: Fri Feb 09, 2007 5:22 pm

Post » Wed Jun 20, 2012 8:36 am

Hold on doesn't actor extend object in which case you can use the OnSpellCast event and check if its your spell, mind you not sure if that fires before the actual spell cast happens in the world.

I haven't experimented with http://www.creationkit.com/OnSpellCast_-_ObjectReference yet, but from the context used on the wiki page, I'd say it happens after the spell is cast.

possible convoluted workaround:
There is a condition (with a blank wiki page, so no help there) http://www.creationkit.com/IsCasting. You could try making a scripted ability with a magic effect that uses this condition (so that the effect would only apply when you are casting). Slap a script on the magic effect that checks what spell you have equipped, and if its one of your spells and theres not enough stamina to cast, http://www.creationkit.com/InterruptCast_-_ObjectReference.

edit: I would be interested to hear your results if you test this out or find something else that works.
User avatar
Cesar Gomez
 
Posts: 3344
Joined: Thu Aug 02, 2007 11:06 am


Return to V - Skyrim