Setterhead Posted April 24, 2012 Share Posted April 24, 2012 (edited) Hello.I were told that you are a scripting god. So can i ask you to follow the link, please?)http://forums.nexusmods.com/index.php?/topic/656197-real-forts-and-outposts/page__gopid__5177430#entry5177430 I relly need some pro help.) Edited April 24, 2012 by Setterhead Link to comment Share on other sites More sharing options...
Woverdude Posted April 24, 2012 Share Posted April 24, 2012 Howdy, It's woverdude from the Way of the Monk mod. So, here's the thing. I have a script that I want to have run whenever the player is hit. The script moves around various global variables as a way of leveling or progressing the Unarmored skill. But I need it to only work when the player does not have anything equipped with the "ArmorHeavy" and "ArmorLight" keywords so that it only levels when they are unarmored. Here's the script: Scriptname UnarmoredLevelingScript extends ObjectReference {Levels your Unarmored as you take hits.} GlobalVariable Property Use autoGlobalVariable Property Mod autoGlobalVariable Property Level autoGlobalVariable Property PointsAvailable autoGlobalVariable Property PointsEarned autoGlobalVariable Property PointsSpent auto Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, \ bool abBashAttack, bool abHitBlocked) Use.SetValue(Use.GetValue()+Mod.Getvalue()) if Use.GetValue() >= 20 Use.SetValue(Use.GetValue() - 20) Level.Setvalue(Level.Getvalue()+1) Debug.Notification("Your Unarmored level has been raised to " + Level.GetValue()) Mod.SetValue(Mod.GetValue() - 0.01) PointsAvailable.SetValue(Level.GetValue()/5 - PointsSpent.GetValue()) PointsEarned.SetValue(PointsSpent.GetValue() + PointsAvailable.GetValue()) endifEndEvent Do you think that you can help? Link to comment Share on other sites More sharing options...
cobrasa9987 Posted April 24, 2012 Share Posted April 24, 2012 HelloHere's a request maybe you can help? :) Request Please help! Link to comment Share on other sites More sharing options...
DarkPhoenixxy Posted April 24, 2012 Share Posted April 24, 2012 Got it working, for some reason line Debug.MessageBox("Item Added") was screwing the code... Thanks for your help! Wthout it i would not be able to complete my mod! Link to comment Share on other sites More sharing options...
fg109 Posted April 24, 2012 Author Share Posted April 24, 2012 @SetterHead Your mod idea doesn't actually require any scripts. Or at most, it would require a simple script to check the stage of a quest (used to keep track of when exactly a fort/outpost is considered cleared) and then either enable or disable an Xmarker. The Xmarker would be the enable parent of all the NPCs (and perhaps banners) in the fort/outpost. @Woverdude Is that a script you're going to put on the player? I think it's better to have the script on a reference alias or magic effect that's then put on the player. Anyway, this is an object reference script: Scriptname UnarmoredLevelingScript extends ObjectReference {Levels your Unarmored as you take hits.} GlobalVariable Property Use auto GlobalVariable Property Mod auto GlobalVariable Property Level auto GlobalVariable Property PointsAvailable auto GlobalVariable Property PointsEarned auto GlobalVariable Property PointsSpent auto Keyword Property ArmorHeavy Auto Keyword Property ArmorLight Auto Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, \ bool abBashAttack, bool abHitBlocked) if ((Self as Actor).WornHasKeyword(ArmorHeavy) || (Self as Actor).WornHasKeyword(ArmorLight)) Return endif Use.SetValue(Use.GetValue()+Mod.Getvalue()) if Use.GetValue() >= 20 Use.SetValue(Use.GetValue() - 20) Level.Setvalue(Level.Getvalue()+1) Debug.Notification("Your Unarmored level has been raised to " + Level.GetValue()) Mod.SetValue(Mod.GetValue() - 0.01) PointsAvailable.SetValue(Level.GetValue()/5 - PointsSpent.GetValue()) PointsEarned.SetValue(PointsSpent.GetValue() + PointsAvailable.GetValue()) endif EndEvent Reference alias script: Scriptname UnarmoredLevelingScript extends ReferenceAlias {Levels your Unarmored as you take hits.} GlobalVariable Property Use auto GlobalVariable Property Mod auto GlobalVariable Property Level auto GlobalVariable Property PointsAvailable auto GlobalVariable Property PointsEarned auto GlobalVariable Property PointsSpent auto Keyword Property ArmorHeavy Auto Keyword Property ArmorLight Auto Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, \ bool abBashAttack, bool abHitBlocked) if (GetActorReference().WornHasKeyword(ArmorHeavy) || GetActorReference().WornHasKeyword(ArmorLight)) Return endif Use.SetValue(Use.GetValue()+Mod.Getvalue()) if Use.GetValue() >= 20 Use.SetValue(Use.GetValue() - 20) Level.Setvalue(Level.Getvalue()+1) Debug.Notification("Your Unarmored level has been raised to " + Level.GetValue()) Mod.SetValue(Mod.GetValue() - 0.01) PointsAvailable.SetValue(Level.GetValue()/5 - PointsSpent.GetValue()) PointsEarned.SetValue(PointsSpent.GetValue() + PointsAvailable.GetValue()) endif EndEvent Not much of a difference. @cobrasa9987 Sorry, I don't think your request is possible with the default scripting commands. Maybe someone who uses Script Dragon can make it, but otherwise you would have to wait for SKSE (the version with scripting functions is still in closed beta). Link to comment Share on other sites More sharing options...
Setterhead Posted April 25, 2012 Share Posted April 25, 2012 Thank you. Link to comment Share on other sites More sharing options...
IluisIndustries Posted April 25, 2012 Share Posted April 25, 2012 Hello there! I'm making a hunger mod and I'm a little stuck. I'm trying to make food "heal" a global hunger variable, but I can't figure it out. Is there any way to have the magnitude of a particular magic effect be used inside a script attached to it? When I go into each food item's "potion" editor, I can add the effect, but that doesn't let me vary the amount of hunger restored from each food item. If not with magnitude, is there any other way to do this? I also thought about grouping items that restore the same amount using keywords? Not that I know how to access the keywords any better than getting the magnitude, lol The whole hunger mod would be extremely easy if the CK let us add/modify actor values. Then I might even be able to make other characters susceptible to hunger as well. Is there a script extender/other editor that can manipulate AV's? Link to comment Share on other sites More sharing options...
fg109 Posted April 25, 2012 Author Share Posted April 25, 2012 @IluisIndustries I don't know of any way to add in new actor values, but I can think of a way to make it seem like there's an actor value like that. Scriptname HungerAbilityScript extends ActiveMagicEffect Faction Property HungerFaction Auto Int Property UpdateInterval Auto Formlist Property FoodsHighList Auto Formlist Property FoodsMidList Auto Formlist Property FoodsLowList Auto Keyword Property VendorItemFood Auto Actor Myself Event OnEffectStart(Actor akTarget, Actor akCaster) Myself = akTarget ;if NPC is not in the hunger faction, add him/her in if (Myself.GetFactionRank(HungerFaction) < 0) Myself.SetFactionRank(HungerFaction, 0) endif ;increment "hunger variable" every UpdateInterval seconds RegisterForUpdate(UpdateInterval) EndEvent Event OnUpdate() if (Myself.GetFactionRank(HungerFaction) < 100) ;increment the "hunger variable" by 1 Myself.ModFactionRank(HungerFaction, 1) else ;die of hunger Myself.Kill() endif EndEvent Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference) if (FoodsHighList.HasForm(akBaseObject)) ;we just ate something from FoodsHighList Myself.ModFactionRank(HungerFaction, -5) elseif (FoodsMidList.HasForm(akBaseObject)) ;we just ate something from FoodsMidList Myself.ModFactionRank(HungerFaction, -3) elseif (FoodsLowList.HasForm(akBaseObject)) ;we just ate something from the FoodsLowList Myself.ModFactionRank(HungerFaction, -1) elseif (akBaseObject.HasKeyword(VendorItemFood)) ;a food not in one of the lists (mod added?) if (akBaseObject.GetGoldValue() < 3) Myself.ModFactionRank(HungerFaction, -1) elseif (akBaseObject.GetGoldValue() < 5) Myself.ModFactionRank(HungerFaction, -3) else Myself.ModFactionRank(HungerFaction, -5) endif endif if (Myself.GetFactionRank(HungerFaction) < 0) ;completely full Myself.SetFactionRank(HungerFaction, 0) endif EndEvent You can give the ability to just the player, or check this to dynamically apply it to all actors. I've also heard that SkyProc can create patches to apply things to all NPCs, but I've never used it (and truthfully I have no idea how to even begin). Link to comment Share on other sites More sharing options...
IluisIndustries Posted April 25, 2012 Share Posted April 25, 2012 (edited) @fg109 Ooh! Hadn't thought of using factions, that's actually way handier than what I was doing. I'll try implementing that after I get back from class today and let you know how it goes. Thanks a billion! Edited April 25, 2012 by IluisIndustries Link to comment Share on other sites More sharing options...
cobrasa9987 Posted April 25, 2012 Share Posted April 25, 2012 @fg109 Thanks for your attention and reply! :)So you think it's imposible to make this kind of mod at this time? Damn I thought it will be easier.. :confused:Maybe you know someone works with this kind of mods or scripting? Link to comment Share on other sites More sharing options...
Recommended Posts