GllenNadix Posted June 24, 2010 Share Posted June 24, 2010 What I'm looking for isn't for someone to make a mod for me, I just don't have much knowledge of TES4 scripting, and I need to write a script that I do not know the commands for. Namely, I need a script to place on a spell (actually, a rather considerable number of spells, but I assume that reusing the script on different spells should be no issue) which will check the player's current endurance attribute (not base endurance, but present effective endurance), and only allow the spell to be cast when the result is greater than zero. I have begun reading the scripting tutorials on the construction set wiki, but I'd like to just get this part over and done with. If anyone can create (or direct me to a concise guide to how to create) such a script, I would be most appreciative.--N.G.Garritano Link to comment Share on other sites More sharing options...
Skevitj Posted June 24, 2010 Share Posted June 24, 2010 So you're after a spell which is only castable if the player has >0 endurance? Or a spell for which the effects are only applied if end>0? Or are the spell effects going to reduce endurance, so you want it to be applied repeatedly untill their endurance is 0 (if so it would probably be much better to just make the spell proportional instead)? GetActorValue (GetAV) is the function you're after to determine a modified stat. Note the difference between ModAV and ModAV2 (OBSE) if you intend to change a stat though. AddSpell is used to add spells, it generates messages though, so AddSpellNS (OBSE) is preferable if you want to avoid the spam. Link to comment Share on other sites More sharing options...
ub3rman123 Posted June 24, 2010 Share Posted June 24, 2010 Wasn't there some trick that if you did a message with the same message as the spell add thing it overrode both? I'm kind of blurry on that, though. Link to comment Share on other sites More sharing options...
GllenNadix Posted June 24, 2010 Author Share Posted June 24, 2010 I'm trying to make the spells uncastable (like when silenced, or out of magicka), if endurance is zero or less.If it is easier to implement, having no effects applied would work just as well.Not sure whether it makes a difference, but I want to do this to spells with unscripted vanilla spell effects, too, so not just making the script effect conditional. Link to comment Share on other sites More sharing options...
ub3rman123 Posted June 24, 2010 Share Posted June 24, 2010 You could run a gamemode check if the player's endurance is above zero and slap a silence on them if it isn't, but that'd affect all spell. Link to comment Share on other sites More sharing options...
GllenNadix Posted June 24, 2010 Author Share Posted June 24, 2010 What I am looking for is a way to place a script on a spell that, if the player's endurance is zero or below, causes the casting to fail. Either that, or (on an endurance value of zero or less) does not allow casting at all. Link to comment Share on other sites More sharing options...
Skevitj Posted June 25, 2010 Share Posted June 25, 2010 ub3rman123's idea is what I was thinking for the implementation. A global script which would silence the player if that spell is active and their endurance is 0. PCSpell (OBSE, I think that's the function) could be used to only apply the silence when the spell is selected, but it would need to check for every spell which could be rendered uncastable, and it would be impossible to expand it to allow for NPCs to cast. A much easier and neater option would be to have all the effects contained in a script effect (in the spell) which can be cast on the target at any time, but only applies it's effects effect if the player's endurance is >0. Still not really expandable for npcs but much neater and no performance hit assuming hundreds of spells needing to be checked. I think the nospam trick was just repeating the same message 2 times I think, which would cancel it or something like that. I just find OBSE too reliable / usefull to not use it though. Here's an idea: I don't know what your spell is trying to do, but you could have it contained entirely within a script effect block which would cast on target/touch. If the player's endurance is 0 though, it will still cast at the target although no effects would be applied, but the shaders for something like shock damage could be played on the player and you could add a damage fatigue 1 pt for 1s debuff to the player, to generate the screen blur as if you've been hit. That would allow a spell which could fail, and would provide clear notification when the spell fails, without generating message spam or looking ridiculous. But thats's Just my 2 cents worth. I may be a bit slow to respond in the future; Just picked up FO3 goty... nuf said really... gimme a few days. Link to comment Share on other sites More sharing options...
GllenNadix Posted June 25, 2010 Author Share Posted June 25, 2010 The second method you suggested for implementation sounds quite nice. It sounds exactly like what I was looking for, to be honest. I just don't know how to actually create that. If someone would be willing to give me a basic framework, I'd be able to handle the rest of it. Link to comment Share on other sites More sharing options...
RebelOConner Posted June 25, 2010 Share Posted June 25, 2010 there's few things that decrise the endurance, don't you talk about fatigue rather endurance.because a mod which give a chance af casting a spell depending of the fatigue level could be interesting.hard to do, but interesting. Link to comment Share on other sites More sharing options...
Rendan Posted June 26, 2010 Share Posted June 26, 2010 Heh well there have been some pretty strange stuff on the Nexus but this does seem interesting. Link to comment Share on other sites More sharing options...
Recommended Posts