Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Malonn

Allies
  • Posts

    31
  • Joined

  • Last visited

Posts posted by Malonn

  1. Hi,

    I'm stuck.  I've a function script that checks to see if the player is wearing all of one type of armor (light or heavy).  If the player is wearing all one type, the scripts then boost the armor rating by 20%.  No problem.  I've got that working.  My problem is if the player changes 1 or more armor pieces, I want to boost those new pieces by 20% too, without adding 20% more of a boost to the armor that didn't get changed (so already has a 20% boost).  Here's the complete set boosting script:

    ScriptName FnBoostArmorRating
    
    Array_var avTempB
    Array_var avBoostEquip
    Ref rCurBoost
    Float fRating
    Float fBoost
    
    Begin Function { }
    
    Let avTempB := ar_Construct StringMap
    	Let avBoostEquip := Player.GetEquippedItems
    	ForEach avTempB <- avBoostEquip
    		Let rCurBoost := avTempB["value"]
    		If IsArmor rCurBoost == 1
    			Let fRating := GetArmorAR rCurBoost
    			Let fBoost := fRating * 0.20
    			Player.ModArmorAR fBoost rCurBoost
    		Endif
    	Loop
    
    End
    

    Any ideas?  Thanks.

  2. Good, good.  Great to hear about the water.

     

    Yeah, I wasn't sure what to think when I saw a torch lit when it first hit the water.  I think it has to do with dropping it from the player inventory or something.  If the torch is equipped and one walks into the water, it goes out.  But if it's a torch that has been dropped via the "Drop" script function it won't go out.  **shrug**  Ah well.  Thanks to you it doesn't matter cuz it now goes out when it's supposed to.

  3. That did more than help, syscrusher, it solved my problem.  By getting the cell's water height and checking that against the torch's height, the torch now goes out when entering water.  I haven't thoroughly tested, but I wonder what would happen in an interior cell that has water above the lowest point??  It wouldn't function as intended in that case I suspect.  I hope there are no cells like that.  Do you know of any?  There could be a pool of water, and later sections of the cell slope downhill or have steps going down into the dungeon.  Don't know, but for now, all is good.

     

    THANKS.

  4. How can I determine if an object is in water?  Not an actor, but a torch dropped to the ground.  I tried "IsSwimming" with the torch and it didn't work.  The player doesn't need to be in the water.  Sometimes a cell has water and the dropped torch slides into the water.  I want it to extinguish when that happens.  Extinguishing flames is simple.  But I'm having trouble figuring out how to determine when the torch slips into the water. 

  5. I'm trying to adjust the light radius of a torch via script.  I can do it, but the problem I'm having is it doesn't show immediately in-game.  You have to open a menu then go back to the regular mode for the light changes to be seen.  I've tried using "Update3D" but doesn't seem to help.  I'm trying to adjust the light raius of a torch on the ly via key presses.  It's all good to go, except it doesn't show immediately.  You have to go to menu mode then back to gameplay mode for the light change to show.  Anyone have any ideas??

  6. I'm a little late here, but I'll reply anyway.

     

    Great suggestions, jamochawoke.  I ended up using the fatigue suggestion for a different part of the script.  To just knock someone down I prefer "PushActorAway" because they get right back up, no need to worry about adjusting fatigue.  But a different section of the script called for an actor to be knocked out, that is where I used your suggestion.  I did it with pure scripting, no spells, but still...

     

    Anyway, thanks.

  7. Great suggestion, syscrusher.  I hadn't thought about a spell.  But, in the time between asking for help and this answer I was able to figure out a pure scripting way to make an NPC fall down (plus I was thinking with a paralyze effect the NPC will freeze and fall; with my way the NPC crumbles with physics to the cround).  The solution I found, for those interested, was to use the "PushActorAway" function.  Double up on the reference when setting the function and set the force parameter to a negative number.  This forces the NPC/creature to fall to the ground and then get right on back up.

     

    Thanks again, though.

  8. What's the easiest way to force an NPC to fall down in a script.  Am I missing a easy way to do it via a function that I've overlooked?  I couldn't find anything.  Currently I've been messing with idle animations, but that has been a little wonky.  Any help would be appreciated.

  9. I've got a question that's really baking my brain.  Probably simple to an experienced scripter.  Well, here it is:  How can I track how many times I hit an NPC with a bash?  I wrote a simple push/shield bash script, and I want to track how many times I hit any given NPC with the bash/push.  If they are pushed 3 times within a certain time frame, they attack.  I'm really having trouble tracking the NPC's because I could push one NPC twice, then go to another NPC and push him/her once, then go to another NPC and push him/her three times.  The script needs to track those individuals and the number of times they've been pushed/bashed.  The script should only track 10 or so NPC's so it doesn't get out of control.  Anything over 10 resets the thing.

     

    Can this be done simply?  I can't figure out how to do it.

     

    EDIT:

     

    Okay.  I buckled down and strapped on my thinking cap and figured out a way to do what I was asking for help to do.  It strikes me as rough and clumsy.  Just not elegant.  Here's the script:

    ScriptName MalonnPushScript
    
    Short sNPCReset
    Short sKeyVar
    Short sStaggerVar
    Short sCountReset
    Short sCounter1
    Short sCounter2
    Short sCounter3
    Short sCounter4
    Short sCounter5
    Float fQuestDelayTime
    Float fAnimDelay
    Ref rCrossRef
    Ref rShield
    Ref rNPC
    Ref rNPC2
    Ref rNPC3
    Ref rNPC4
    Ref rNPC5
    
    Begin GameMode
    
    	If fQuestDelayTime != 0.10
    		Let fQuestDelayTime := 0.10
    	Endif
    
    	Let rCrossRef := GetCrosshairRef
    	Let rShield := Player.GetEquippedObject 13
    	If rCrossRef.GetObjectType == 35
    		If sNPCReset == 0
    			Let rNPC := rCrossRef
    			Let sNPCReset := 1
    			If sCountReset == 1
    				Let sCounter1 := 0
    				Let sCountReset := 2
    			Endif
    		Endif
    		If rNPC != rCrossRef
    			If sNPCReset == 1
    				Let rNPC2 := rCrossRef
    				Let sNPCReset := 2
    				If sCountReset == 2
    					Let sCounter2 := 0
    					Let sCountReset := 3
    				Endif
    			Endif
    		Endif
    		If rNPC != rCrossRef && rNPC2 != rCrossRef 
    			If sNPCReset == 2
    				Let rNPC3 := rCrossRef
    				Let sNPCReset := 3
    				If sCountReset == 3
    					Let sCounter3 := 0
    					Let sCountReset := 4
    				Endif
    			Endif
    		Endif
    		If rNPC != rCrossRef && rNPC2 != rCrossRef && rNPC3 != rCrossRef
    			If sNPCReset == 3
    				Let rNPC4 := rCrossRef
    				Let sNPCReset := 4
    				If sCountReset == 4
    					Let sCounter4 := 0
    					Let sCountReset := 5
    				Endif
    			Endif
    		Endif
    		If rNPC != rCrossRef && rNPC2 != rCrossRef && rNPC3 != rCrossRef && rNPC4 != rCrossRef
    			If sNPCReset == 4
    				Let rNPC5 := rCrossRef
    				Let sNPCReset := 5
    				If sCountReset == 5
    					Let sCounter5 := 0
    					Let sCountReset := 6
    				Endif
    			Endif
    		Endif
    		If rNPC != rCrossRef && rNPC2 != rCrossRef && rNPC3 != rCrossRef && rNPC4 != rCrossRef && rNPC5 != rCrossRef
    			Let sNPCReset := 0
    			Let sCountReset := 1
    		Endif
    	Endif
    
    	If IsKeyPressed3 33 == 1 && sKeyVar == 0
    		Let sKeyVar := 1
    		If Player.IsWeaponOut == 1
    			If Player.IsShieldOut == 1
    				Player.PlayGroup BlockAttack 1
    				Player.PlayGroup Idle 0
    				Let sStaggerVar := 1
    				If Player.GetActorValue Fatigue >= 10
    					Player.ModActorValue2 Fatigue -10
    				Endif
    			Else
    				Player.PlayGroup CastTouch 1
    				Player.PlayGroup Idle 0
    				Let sStaggerVar := 1
    				PlaySound WPNSwishHand
    				If Player.GetActorValue Fatigue >= 10
    					Player.ModActorValue2 Fatigue -10
    				Endif
    			Endif
    		Elseif Player.GetEquipped rShield == 1 && Player.IsWeaponOut == 0 && Player.GetWeaponAnimType <= 1
    			Player.PlayGroup BlockAttack 1
    			Player.PlayGroup Idle 0
    			Let sStaggerVar := 1
    			If Player.GetActorValue Fatigue >= 10
    				Player.ModActorValue2 Fatigue -10
    			Endif
    		Else
    			Player.PlayGroup CastTouchAlt 1
    			Player.PlayGroup Idle 0
    			Let sStaggerVar := 1
    			PlaySound WPNSwishHand
    			If Player.GetActorValue Fatigue >= 10
    				Player.ModActorValue2 Fatigue -10
    			Endif
    		Endif
    	Elseif IsKeyPressed3 33 == 0 && sKeyVar == 1
    		Let sKeyVar := 0
    	Endif
    
    	If rCrossRef.IsActor == 1
    		If sStaggerVar == 1
    		Let fAnimDelay += GetSecondsPassed
    			If fAnimDelay >= 0.6
    				rCrossRef.PlayGroup Stagger 1
    				Let sStaggerVar := 0
    				Let fAnimDelay := 0
    				rCrossRef.ModDisposition Player -10
    				If rCrossRef.IsGuard == 1
    					Player.ModCrimeGold 1000 
    				Endif
    				If rCrossRef == rNPC
    					Let sCounter1 += 1
    				Elseif rCrossRef == rNPC2
    					Let sCounter2 += 1
    				Elseif rCrossRef == rNPC3
    					Let sCounter3 += 1
    				Elseif rCrossRef == rNPC4
    					Let sCounter4 += 1
    				Elseif rCrossRef == rNPC5
    					Let sCounter5 += 1
    				Endif
    			Endif
    		Endif
    	Else
    		Let sStaggerVar := 0
    		Let fAnimDelay := 0
    	Endif
    
    	If sCounter1 >= 3
    		rNPC.StartCombat Player
    		Let sCounter1 := 0
    	Elseif sCounter2 >= 3
    		rNPC2.StartCombat Player
    		Let sCounter2 := 0
    	Elseif sCounter3 >= 3
    		rNPC3.StartCombat Player
    		Let sCounter3 := 0
    	Elseif sCounter4 >= 3
    		rNPC4.StartCombat Player
    		Let sCounter4 := 0
    	Elseif sCounter5 >= 3
    		rNPC5.StartCombat Player
    		Let sCounter5 := 0
    	Endif
    
    End
    

    That's the full script that does what I want.  Is there a more efficient way?  I'm satisfied enough, I suppose.  But insight is always welcome.

  10. I knda found a mod while searching the Nexus that helped me solve this problem.  For anyone intereted it invloves adding an animation for stagger under the correct directory.  That way NPC's stagger when called to via script because that animation is available to them.  The mod is "Idle Stagger and Recoil" by Migck.

     

    I guess there's no way to do it via pure scripting, which had me beating my head.  Anyway, thanks for any potential help that was coming.

  11. Apparently certain animations can only be forced under certain conditions.  Like when a weapon is drawn.  I'm trying to force an actor to stagger even when their weapon isn't drawn.  It can be done, I just don't know how.  Deadly Reflex does it, but I don't feel like combing through and trying to figure out his scripts. 

     

    I've tried SetAlert.  But that forces the actor to draw their weapon.  I want them to stagger from an non-combat idle animation.  I'm doing my own shield bash script and I want the actors to stagger any time I bash them.  Not just when their in combat.  Any help would be appreciated.

  12. Okaay.  The above works.  I created a bow, then I call it and equip when the conditions are met.  The problem is that equipping the "rapid shot" bow goes through the whole drawing of the weapon again.  I don't want that.  Is there a way to circumvent the animation of drawing a bow??

     

    Help me, WillieSea.  Thou hast bountiful knowledge.

  13. WillieSea,

     

    You're thinking of Skyrim.  I checked, and one of the perks for Marksman in that game is a 30% quicker bow draw.  This script I'm working on is for Oblivion.

    Anyone have any other ideas?

     

    EDIT:

     

    On the off chance anyone is interested, I just thought of something having looked at a couple of mods.  What I could do is create a bow with the speed set high.  Then I could add the bow to the inventory and have the PC equip it when the conditions are met for a quick draw.

     

    Will that work?

  14. Interesting, WillieSea, the ever-helpful.  I did not even think about that.

     

    Just for sh*ts and giggles, any idea why the Mod/Set-WeaponSpeed doesn't work?

     

    EDIT

     

    I'm dense.  Where can I find this perk?  Not one of the standard archer perks awarded in-game...

  15. Problem.  I'm trying to increase the speed of a bow via a script (with ModWeaponSpeed or SetWeaponSpeed - OBSE I know, but it's not hard to figure out what it does).  But it doesn't work.  The script does change the speed in practice, but the speed change is not reflected in the animation of drawing and firing the bow.  Plus, the speed is not changed in the stats of the bow.  Is there some kind of trick to actually get the bow speed to change?  I want an actual quicker animation.  I've tried "Update3D", but doesn't make a difference.

     

    Help would be greatly appreciated.

  16. What is the best way to determine how much of the PC's health has been lost by taking melee damage?  Only way I can figure is to take the base health and subtract from the modified health.  Is there a better way?

     

    I am using "(GetBaseAV Health - GetAV Health)"

     

    Is there a more eloquent way?

  17. I'm trying to better familiarize myself with arrays.  So, I'm attempting to use an array in a situation where I know I could easily accomplish what I'm trying to do without an array.  I want to understand arrays.  They seem to open up a lot of options and possibilities with simplifying scripts and such.  Anyway, here's the script:

     

    Let BodySlots := ar_Construct Array
    Let BodySlots[0] := Player.GetEquippedObject 2
    Let BodySlots[1] := Player.GetEquippedObject 3
    Let BodySlots[2] := Player.GetEquippedObject 5
    Let BodySlots[3] := Player.GetArmorType...<--Stuck here
    

    I'm just trying to determine if the items equipped in the body, legs, and feet slots are heavy armor.  That's it for now.  But I'm stuck on the syntax for "GetArmorType" within an array.  GetArmorType requires an ObjectID::Ref.  How do I pass that ref within the element of an array?  I've tried the following (don't laugh :))

     

    Let BodySlots[3] := Player.GetArmorType BodySlots
    

    ...Compiles, but produces an OBSE error during runtime

     

    Let BodySlots[3] := Player.GetArmorType BodySlots[0]
    

    ...Won't compile. 

    I'd really appreciate any help getting past this point.  Like I said, I can do it no problem using the traditional vanilla style scripting.  But I want to better understand arrays, so am practising with them.

    Thanks for any help.

    • Upvote 1
×
×
  • Create New...