Jump to content

lesi123

Premium Member
  • Posts

    82
  • Joined

  • Last visited

Everything posted by lesi123

  1. I'm in the process of remaking a mod that applies a debuff to an actor when the player hits them with a certain weapon type. I'm doing this through dynamically attaching scripts to actors near the player and have followed the guide here: https://www.creationkit.com/index.php?title=Dynamically_Attaching_Scripts Everything is working okay except the Death Dispel code. To check who has the script attached, I selected a Hit Shader on the magic effect and ticked FX Persist. When I placed the Death Dispel code on the script, however, it didn't seem like the magic effect got dispelled when they died since the Hit Shader was still active on the corpses. When I unticked the No Death Dispel box on the magic effect, the Hit Shader disappeared on death. However the wiki states unticking this box can cause errors and it's best to remove the magic effect via the script instead. Death Dispel code: Event OnEffectStart(Actor akTarget, Actor akCaster) ; Any Initialization/Setup code here ; Go to our Alive state GoToState("alive") EndEvent State alive Event OnBeginState() RegisterForSingleUpdate(0.25) EndEvent Event OnUpdate() ; Regular code here RegisterForSingleUpdate(0.25) EndEvent Event OnDying(Actor akKiller) ; Any additional cleanup code here UnregisterForUpdate() GoToState("dead") EndEvent EndState State dead ; Nothing needed here EndState When I saw the Hit Shader persist on the actor, I attempted to use the .Dispel() function under the OnDying event but I receive the error "Dispel is not a function or does not exist" even though the script extends ActiveMagicEffect. Another issue I could foresee after long playthroughs with this scripts attaching to any actor around the player is it will continuously be applied to more and more actors unless the actors die (once I can find out how the Death Dispel code is supposed to work). Is there a way to remove a magic effect with an attached script from an actor based on distance from the player? GetDistance seems to only work with objects and not actors. Basically the goal is to get the script removed from actors that die or obtain a certain distance from the player to prevent bloat. Any help would be greatly appreciated! Here's the script: Scriptname BTDMonitorScript extends activemagiceffect ;PROPERTIES Actor Property PlayerRef Auto Keyword Property WeapTypeBow Auto Spell Property BTDSpellBleedDmgBOW Auto Spell Property BTDSpellBleedExtrasBOW Auto MagicEffect Property BTDMonitorEffect Auto GlobalVariable Property BTDGlobalBleedDurBOW Auto Event OnEffectStart(Actor akTarget, Actor akCaster) ; Any Initialization/Setup code here ; Go to our Alive state GoToState("alive") EndEvent State alive Event OnBeginState() RegisterForSingleUpdate(0.25) EndEvent Event OnUpdate() ; Regular code here RegisterForSingleUpdate(0.25) EndEvent Event OnDying(Actor akKiller) ; Any additional cleanup code here BTDMonitorEffect.Dispel() ;will not compile with this line UnregisterForUpdate() GoToState("dead") EndEvent EndState State dead ; Nothing needed here EndState Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked) if ((akAggressor == PlayerRef) && (akSource as Weapon) && (abHitBlocked != true)) if ((akSource.HasKeyword(WeapTypeBow)) && BTDGlobalBleedDurBOW.GetValue() != 0)) if ((Utility.RandomInt() >= 75) && (PlayerRef.GetActorValue("Marksman") < 30)) if BTDGlobalBleedDurBOW.GetValue() == 1 BTDSpellBleedDmgBOW.cast(PlayerRef) BTDSpellBleedExtrasBOW.cast(PlayerRef) endif endif endif endif EndEvent
  2. It's an OnHit script applied to NPCs with the CK wiki dynamic script attachment method. It applies a debuff spell on them when hit with certain weapons. The current script works, but it feels very clunky and I made it before I knew how powerful global variables could be. It's nice knowing it can be done, but I wanted to improve on it to be more flexible with it's options. I'm still writing the new one, which brought up the question on writing best practices.Thanks for your insight though!
  3. Now that I think about it, I do recall the notifications I set up during testing displaying when conditions in one block were met and the notifications for other blocks didn't. My new question is should I tier my condition checks in the order most needed so it can skip blocks it doesn't need to read? It would make the script longer as a whole, but if it's skipping massive chunks that don't meet the more general conditions, I assume it would still be more efficient than having large grouping checks?
  4. Hello all, I'm combing back though an old mod that I made when I first tried my hand at some more complex scripting and I'm wanting to make some changes. I want to be as efficient with them as possible but I've not found any answers regarding how the scripts are actually read. OnBlahEvent if ConditionA if ConditionB ;do a thing elseif ConditionC ;do another thing endif endif EndEvent When the script is executed, does it jump to the 'EndEvent' if the 'if ConditionA' is not met? Or does it read everything below ConditonA regardless? I have a similar question with groupings: if (ConditionA && ConditionB && ConditionC) || (ConditionD && ConditionE && ConditionF) ;do a thing endif Does the script 'do a thing' once it reads that the group (ConditionA && ConditionB && ConditionC) meets the conditions, or does it continue to read the other groupings anyway?
  5. I'm in the process of converting some of my mods over to SSE. Since these mods were made for Classic Skyrim, I kept dependencies strictly from where game assets were taken. A mod that only used assets from the base game only had Skyrim.esm as its dependent. A mod that used assets from Dawnguard had Skyrim.esm, Update.esm, and Dawnguard.esm as it's dependencies. With SSE having all DLC included, is there any reason that I shouldn't carry over parameters from the Update and DLC master files and have the converted mods need all master files as dependencies?
  6. I tried what you suggested about duplicating the mesh and just deleting a certain section from both, which worked well. However, after I save the file as a .blend and reopen it in Blender 2.49, I get a popup saying "You are opening a 270 file. Key information might get lost, like animation data." Continuing on opening the mesh leaves me with what looks like a wire frame. Exporting that as a .nif and then opening it in NifSkope leaves me with a single NiNode and nothing else, no mesh, nothing. I'm not sure where I'm going wrong since that is how nearly every guide is telling me how to export.
  7. I'm working on an animated eye texture mod but I've hit a snag. The non-beast race eye meshes have a single NiTriShape and I need to apply a controller just to the eyeball. To do this, my main goal is to split the single NiTriShape (in this case, the eyesmale.nif) into two NiTriShapes; the eyelashes and the eyeball. That way, I can have a different texture set on each without the static eyelashes interfering with the moving texture on the eye itself. From what I have read, this is not something NifSkope can do and I will need Blender. I've gotten all the required programs for Blender 2.49 to import the mesh and have been able to load the .nif and save it as a .blend. I then opened it back up in Blender 2.74 but now I'm at a loss on how to do what I'm aiming for. I have seen guides on bisecting but that looks like its splitting a mesh on a plane whereas I need to separate specific vertices. Any advice?
  8. I know I'm late to the party, but it's finally published. For anyone interested: OH GOD BEES - More Bees--More Hives--HD Textures :D There's about 100+ hives now. Have fun finding them all. ;)
  9. Ah! You beat me to it. ;) I'll still release mine when I'm finished, I decided to work on the textures first since the originals ones are terrible imo.
  10. You can take a look at the scripts and magic effects I have made up in my mod Alchemical Cooking Recipes; I have a Detect Life and Detect Dead fire and forget spell that is attached to a dummy effect that is attached to a consumable. The script will update every 2 seconds while the dummy effect is active so the detect spell continues to look for actors while you move.
  11. I'll look into this. I've recently finished my alchemy cooking mod and it can be a little tough finding the hives. I might look into doing a retexture of the hive and bees too, just for kicks...
  12. I have removed my mods from Steam Workshop effective immediately because of this. Please Nexus, don't follow this path. I don't want to have to remove them from here too. If people want to donate, that's great! But this game has been out for over three years with mods made from free utilities, many of which won't see a dime from this and I can't be a part of that.
  13. Wouldn't that just check if the alias(PlayerRef in this case) has the Magic Effect on them already? I don't want my custom spell to be cast on the player when hit by any spell or magic effect. Grrr. Its throwing up the same error of GetActorRef is not a function or does not exist. Nevermind, got it working now! (PlayerRef.HasMagicEffect(FireDamageFFAimedArea) && (PlayerRef.HasMagicEffect(FrostDamageFFAimedArea) is what I needed on that line. Thank you guys for your help! :)
  14. I'm getting the compile errors saying the functions are not a functions or do not exist (I'm trying the top two suggestions since I'm just trying to rule out a total of 2 magic effects). The script is extending ReferenceAlias since it is attached to a quest. Would that be causing the compile error?
  15. I have a completed OnHit script aimed at detecting when the player is hit by certain creatures. I added in the conditions if (!(akSource as Spell) && !(akSource as Explosion)) to make sure the script wouldn't fire due to spells since I wanted it to be melee attacks only. It works prefect except for AimedArea magic effects on spells. I've been testing different conditions with fireball wielding hagravens to try and narrow down what the correct condition is but so far I haven't had any luck. I'm trying to follow the guidelines for what akSource can actually check for according to the wiki (Weapon, Spell, Explosion, Ingredient, Potion, Enchantment) So far I've tried: (akSource as Spell) == None) (akSource as Explosion) == None) (akSource as Spell).HasKeyword(MagicDamageFire) == False (akSource as Explosion).HasKeyword(MagicDamageFire) == False !(akSource as Spell) == Fireball !(akSource as Explosion) == Fireball akProjectile == None I've tried using HasEffectKeyword and HasMagicEffectWithKeyword but it won't compile saying the function doesn't exist. Not sure what that's all about.
  16. Gotchya. That makes sense. I'll add it in and hope that clears up any issues mod users may have. Thank you!
  17. Does anyone know where I can find a guide on identifying or fixing issues related to bloat? I've done some searching around the web and can only find topics for mod users and not the modders.
  18. I have a bloated save report from a user of my mod with the following errors: [Active effect 2 on (000D97F4)].BleedThemDryMonitorScript.OnHit() - "BleedThemDryMonitorScript.psc" Line ? [08/30/2014 - 03:33:01PM] warning: Assigning None to a non-object variable named "::temp2" stack: [Active effect 2 on (000D97F4)].BleedThemDryMonitorScript.OnHit() - "BleedThemDryMonitorScript.psc" Line ? [08/30/2014 - 03:33:01PM] Error: Cannot call HasKeyword() on a None object, aborting function call stack: [Active effect 2 on (000D97F4)].BleedThemDryMonitorScript.OnHit() - "BleedThemDryMonitorScript.psc" Line ? [08/30/2014 - 03:33:01PM] warning: Assigning None to a non-object variable named "::temp7" stack: [Active effect 2 on (000D97F4)].BleedThemDryMonitorScript.OnHit() - "BleedThemDryMonitorScript.psc" Line ? [08/30/2014 - 03:33:01PM] Error: Cannot call HasKeyword() on a None object, aborting function call stack: [Active effect 2 on (000D97F4)].BleedThemDryMonitorScript.OnHit() - "BleedThemDryMonitorScript.psc" Line ? [08/30/2014 - 03:33:01PM] warning: Assigning None to a non-object variable named "::temp2" stack: Below is my script (which uses the dynamic script method) that attaches itself to actors around the player. Scriptname BleedThemDryMonitorScript extends activemagiceffect Actor Property PlayerRef Auto Keyword Property WeapTypeBow Auto Spell Property BTDBleedingDamageSpellBOW Auto Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked) if ((abHitBlocked != true) && (akAggressor == PlayerRef) && ((akSource as Weapon).HasKeyword(WeapTypeBow)) && (Utility.RandomInt() >= 75) && (PlayerRef.GetActorValue("Marksman") < 30)) BTDBleedingDamageSpellBOW.cast(PlayerRef) elseif ((abHitBlocked != true) && (akAggressor == PlayerRef) && ((akSource as Weapon).HasKeyword(WeapTypeBow)) && (Utility.RandomInt() >= 50) && (PlayerRef.GetActorValue("Marksman") >= 30) && (PlayerRef.GetActorValue("Marksman") < 60)) BTDBleedingDamageSpellBOW.cast(PlayerRef) elseif ((abHitBlocked != true) && (akAggressor == PlayerRef) && ((akSource as Weapon).HasKeyword(WeapTypeBow)) && (Utility.RandomInt() >= 25) && (PlayerRef.GetActorValue("Marksman") >= 60) && (PlayerRef.GetActorValue("Marksman") < 90)) BTDBleedingDamageSpellBOW.cast(PlayerRef) elseif ((abHitBlocked != true) && (akAggressor == PlayerRef) && ((akSource as Weapon).HasKeyword(WeapTypeBow)) && (Utility.RandomInt() >= 10) && (PlayerRef.GetActorValue("Marksman") >= 90)) BTDBleedingDamageSpellBOW.cast(PlayerRef) endif EndEvent I'm gathering that the script is trying to attach itself to weapon with no weapon type keyword and assigning it a temporary variable of None and then coming up empty handed when the keyword condition can't be used on a None variable. Is this what's going on? I have been using my own mod and not encountered any savegame bloat so I'm unsure how to recreate the issue or how to troubleshoot it. :/
  19. I figured it out. To grab an actor out of akAggressor I had to use ((akAggressor as Actor).GetActorValue("Marksman") < 50). :)
  20. So I've got an OnHit script setup on NPCs via dynamic script for the player to apply a spell to an enemy on hit with the conditions of a RandomInt and having a certain skill level. I'd like to do it in reverse so the OnHit script that will be attached to the player can check what the attackers skill level is if the RandomInt roll was high enough. Part of the code I have attached to the NPC: Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked) if ((abHitBlocked != true) && (akAggressor == PlayerRef) && ((akSource as Weapon).HasKeyword(WeapTypeBow)) && (Utility.RandomInt() >= 75) && (PlayerRef.GetActorValue("Marksman") < 50)) myDamageSpell.cast(PlayerRef) endif endevent Is here a way to declare a non-specific npc to replace the PlayerRef for the GetActorValue?
  21. I changed the magic effect and spell to aimed delivery with no results. I still get my message box on hit but the effect does not activate. Edit: Hold on, I forget to add it in the property list. Will post results. Edit 2: Nope, still no effect being applied. Still getting the message box though. Edit 3: Okay, Target Actor seems to work. I just put a large number in the range box and arrows seems to properly apply the effect when they hit.
  22. It's a FIre and Forget, Contact spell. It worked as intended before I used the dynamic script method by applying the spell on the target when the arrow hit them. Now I have to fire the bow right next to the NPC for the OnHit to apply the spell.
  23. No idea. I'm really not the best person to be giving advice since there are much more experienced modders than me. :B
  24. I'm kind of doing something similar in regards to manipulating damage magnitude on spells on the fly using global values. You would need to make two magic effects: one to do damage to health and another to do damage to magicka. You would then create 2 global variables, healthGV and magickaGV and set them at 0. Then you'd make a spell and add a bunch of the health and magicka magic effects, each with different magnitudes. Then under the conditions for each magic effect (on the spell), you would put in a condition so that it only runs at that magnitude when your global value is a certain number. You would then use a script to increase the value of the global values every 5 seconds. I have absolutely no idea if this would work though, but thought I'd throw the idea out there.
  25. After some further testing, it seems like the spell will only cast if I am attacking within melee range of the actor. I am still trying to figure out why this is though.
×
×
  • Create New...