-
Posts
193 -
Joined
-
Last visited
AnimeOtaku102's Achievements
-
Hm, yeah, I understand what you're saying, basically the array will act as a global variable and the quest will just function like a router to make sure the armor and magic effect scripts are paired up to the same entry in the array. The only limitation I can see would be that you have to declare the size of the array in the CK, but realistically speaking it's unlikely you'll ever see more than a handful of NPCs wearing this armor at a time, so it's a moot concern. Thanks for the help, it's quite a lot to think about.
-
Yeah, that's the problem, when it's compiled as extending Armor it fails to work in-game; the only event listeners that work are universal ones like OnInit, but none of them (what few there are) are of any use. It appears the engine doesn't recognize Armor as a type of ObjectReference, so it might just be a lost cause. I'll just have to go with something using global variables and hope no weird Skyrim magic causes the wrong value to be written/read between OnEquipped/Unequipped and OnEffectStart/Finish events. I'm probably just being paranoid. Scriptname armorTestScript extends ObjectReference Spell Property spellRef Auto GlobalVariable Property currentCount auto int count Event OnEquipped(Actor akActor) debug.notification("Armor equipped.") currentCount.SetValueInt(count) akActor.AddSpell(spellRef, false) endEvent Event OnUnequipped(Actor akActor) debug.notification("Armor unequipped.") akActor.RemoveSpell(spellRef) count ==currentCount.GetValueInt() endEvent Scriptname aaDAFEffectScript extends ActiveMagicEffect Armor Property armorRef Auto GlobalVariable Property currentCount auto float temp int count Event OnEffectStart(Actor akTarget, Actor akCaster) count ==currentCount.GetValueInt() endEvent Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked) Actor actorRef = GetTargetActor() if ((abHitBlocked != true) && (akProjectile == None)) debug.notification("Damage taken.") if (abPowerAttack == true) count += 1 endif endif if (count > 5) temp == armorRef.GetItemHealthPercent() if (temp > 1.0) armorRef.SetItemHealthPercent(temp - 0.1) endif count == 0 endif endEvent Event OnEffectFinish(Actor akTarget, Actor akCaster) currentCount.SetValueInt(count) endEvent
-
Whoops, actually that line should be "int count Auto", which makes it a property accessible outside the script; I also believe OnHit will work with ActiveMagicEffect much in the same way it does with ReferenceAlias from what I've been reading, since they're both treating the actor they're pointing at as the object in question (ReferenceAlias has to specify the object via the Quest Alias tab, while ActiveMagicEffect uses the target it's cast on as the object), though admittedly I haven't had the chance to try due to this "extends Actor/extends ObjectReference" issue. The previous version of this script I'm working on actually used the Quest method, but the problem I ran into that is if I want it to work with NPCs, I'll need to create a new Quest Alias for each unique NPC, which is a bit of a pain and also makes it incompatible with custom NPC companions; I asked in this forum if there was a way to dynamically assign which NPC to track and was pointed toward a slaving mod, but couldn't figure out how to get that to work with my mod (if it was possible at all), so I decided to try this armor/magic effect method instead. Everything would be so simple if OnHit automatically tracked the actor wearing the object it's attached to :pinch:
-
Well, this is somewhat annoying, but I've been working on a mod that attaches a script to a piece of armor that adds a spell ability to the character when it is equipped; the ability, in turn, tracks OnHit events on the player and directly changes values in the armor's script as well as the armor itself. An example of the script is as follows: Scriptname armorTestScript extends Armor Armor Property armorRef Auto Spell Property spellRef Auto int count Event OnEquipped(Actor akActor) debug.notification("Armor equipped.") akActor.AddSpell(spellRef, false) endEvent Event OnUnequipped(Actor akActor) debug.notification("Armor unequipped.") akActor.RemoveSpell(spellRef) endEvent Scriptname aaDAFEffectScript extends ActiveMagicEffect armorTestScript Property armorScriptRef Auto float temp Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked) Actor actorRef = GetTargetActor() if ((abHitBlocked != true) && (akProjectile == None)) debug.notification("Damage taken.") if (abPowerAttack == true) armorRef.count += 1 endif endif if (armorScriptRef.count > 5) temp == armorRef.GetItemHealthPercent() if (temp > 1.0) armorRef.SetItemHealthPercent(temp - 0.1) endif armorScriptRef.count == 0 endif endEvent Basically in this iteration it's just a simple mod to track how many times the PC gets smacked by a power attack, if they get hit more than five times (and didn't block), the armor loses a tempering level; the magic effect script directly alters the armor script's count variable so the "damage" persists (no taking the armor off after four power attacks to reset the progress). Now the problem is if I extend the first script to Armor, OnEquipped and OnUnequipped don't work, which pretty much screws the mod over since I can't add the spell ability; however if I extend it as an ObjectReference I can't assign the armor to the magic effect script's property because it wants a Cell and Reference (presumably a piece of furniture, because I get the option to pick the object from the render window, but refuses to list the armor as an option) instead, which also screws the mod over because now the spell ability is added but never triggers because it doesn't know what armor (or actor that has the armor equipped) to track. Is there any way for an Armor script to use OnEquipped/OnUnequipped or an ObjectReference script to accept an inventory item as a property? Thanks in advance. Edit: main reason I wanted to do it this way is so multiple instances of the same armor equipped by the PC and NPCs can be tracked separately, without having to resort to some kind of global variable shuffling (though I suppose I would have to do that if there's no other way) that might lead to incorrect values being passed around.
-
Can a quest track the PC and multiple NPCs?
AnimeOtaku102 replied to AnimeOtaku102's topic in Skyrim's Skyrim LE
Thanks for the heads up, time to sanitize my scalpels! -
im need some help (as always) story line stuff
AnimeOtaku102 replied to swagginthebag's topic in Skyrim's Skyrim LE
Have you tried the Civil War Overhaul? -
Is Skyrim too politically correct?
AnimeOtaku102 replied to Draconious's topic in Skyrim's Skyrim LE
Think about America's history, despite traditional views of how women should behave most of that went out the window during the World Wars, when conscription depleted enough of the male workforce that factories saw an explosion of women laborers. They were major, if not defining, moments in the road toward gender equality. Skyrim is in a fairly similar situation first with the Great War and now a civil war; able men are being conscripted left and right, and women are simply filling the roles that the remaining men cannot. Considering how long it's been the most vocal complaints against the breaking down of gender roles would have died out long before the start of the game, hence why we don't see much of it.- 49 replies
-
- political correctness
- skyrim
-
(and 1 more)
Tagged with:
-
I'm working on a mod that can track OnHit events on the player via a quest, but I would like to extend this to companions as well. From what I can see in the quest alias tab my choices are either specific references or unique actors, but neither of these seem to fit the bill. Does anyone have any suggestions on how I would be able to accomplish this? Is there a specific faction I could reference or some way to track some kind of token that I could hand to companions and have the quest extend the OnHit event listener to the NPC holding the token? Thanks in advance!
-
How to check if player is in combat
AnimeOtaku102 replied to Xander9009's topic in Skyrim's Skyrim LE
I know that feeling, most of the time rather than asking I just Google a question until I find someone else asking how to get a certain function working and figure it out from there, because a lot of times they'll just go "Oh, got it working, thanks!" or "Nevermind, figured it out" and provide absolutely no detail on what they did. That being said, this is an example of where I use IsInCombat(), it's a script for portable crafting so I prevent the user from using it in situations where forging is unreasonable or causes animation breaks: Scriptname MiscCraftingItemScript extends ObjectReference MiscObject Property MiscCraftingItem Auto ObjectReference Property MiscCraftingItemREF Auto Event OnEquipped(Actor akActor) If (akActor == Game.GetPlayer()) If (akActor.IsInCombat()) debug.notification("You cannot use this item while in combat.") ElseIf (akActor.IsSneaking()) debug.notification("You cannot use this item while sneaking.") ElseIf (akActor.IsSwimming()) debug.notification("You cannot use this item while swimming.") ElseIf (akActor.GetAnimationVariableBool("bInJumpState")) debug.notification("You cannot use this item while falling.") ElseIf (akActor.IsOnMount()) debug.notification("You cannot use this item while mounted.") ElseIf (akActor.GetSitState() == 3) debug.notification("You cannot use this item while sitting.") Else Game.DisablePlayerControls(false, false, false, false, false, true, false) utility.wait(0.1) Game.EnablePlayerControls(false, false, false, false, false, true, false) MiscCraftingItemREF.Activate(akActor) EndIf EndIf EndEvent -
How to check if player is in combat
AnimeOtaku102 replied to Xander9009's topic in Skyrim's Skyrim LE
I usually use "akActor.IsInCombat()", which seems to work out well enough. Using GetCombatState() is a bit of a roundabout way since you have to attach it to a magic effect or quest that's referencing the player, but if it works it works, right? -
Can anyone tell me if I am about to have issues?
AnimeOtaku102 replied to xujploxjux's topic in Skyrim's Skyrim LE
For JaySuS Swords you'll want to grab the patched version here instead: http://skyrim.nexusmods.com/mods/26230/? -
Help with portable crafting kit scripting
AnimeOtaku102 replied to AnimeOtaku102's topic in Skyrim's Skyrim LE
Oh hey, that works! I did consider that the first time I tried, but I just assumed the complier would cough back an error since I was passing it an actor instead of an object. Thanks for the help! -
Help with portable crafting kit scripting
AnimeOtaku102 replied to AnimeOtaku102's topic in Skyrim's Skyrim LE
Hm, gave that a shot but didn't work, likely because it's an object reference script rather than an actor script... which is odd, given I can't imagine what jumps other than actors. -
The way armor works is that they have their own body _0 (weight slider 0) and _1 (weight slider 100) meshes that completely replace whatever body they're being put on, with the only thing they're inheriting from the body they're replacing is the skin texture. The problem that comes from this is that CBBE, UNP, and vanilla bodies use different UV maps, which is basically the blueprint for body textures, so if you use an armor that has a different UV map than the body it's being put on, it'll just blindly try to use the skin based on its own blueprint - hence breaks in texture and neck/wrist seams. This isn't a problem for armor mods like Tribunal Robes that don't show any skin. The only thing you'll notice is that the body shape isn't the same. And to stay on topic, I voted for CBBE. Bodyslide is an awesome tool that invalidates any arguments of the body being unrealistic. Don't like the shape? Change it in bodyslide, it's a bloody simple program to use. Not so simple for modders to make Bodyslide compatible armors, sadly.
-
Help with portable crafting kit scripting
AnimeOtaku102 replied to AnimeOtaku102's topic in Skyrim's Skyrim LE
Well, it wouldn't break anything if they use the crafting station in freefall, they'll wind up landing anyway, I was just being obsessive about conditions. Also would have been an opportunity to put in another silly message, something along the lines of "Try as you might, you cannot invent and craft a parachute mid-fall."