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...

SkyrimModHunter

Allies
  • Posts

    14
  • Joined

  • Last visited

SkyrimModHunter's Achievements

Novice

Novice (2/11)

0

Reputation

  1. So I've stopped trying to give a perk to an NPC through a magic effect. Instead, I've attached the following script to my magic hazard spell. This script will successfully "blind" (aka set incoming melee damage to zero), X% of the time. Additionally, this racial power is going to unlock a "silence" effect when the caster's level is 30 and above. In order to achieve such a feat, I was planning to capture the enemy's magicka amount and magicka regen rate, temporarily disable both, and then re-enable them after the effect wears off. PROBLEM: My problem is that variable's captured within one event, seem to get erased as soon as the event ends (even within the same script!). I'd like to know how to get Papyrus to share those variables between the two events that I've got in the below script. Can anyone help? In particular, I want to drop those 9999 values listed below, and replace them with the previously captured float values of (fx1) and (fx2). If that can be done, then I'd also be able to share the CasterLevel integer. I guess global variables could be used, but that doesn't seem very intuitive. Scriptname yyyRacialDrowGlobeDebluffs extends activemagiceffect Event OnEffectStart(Actor akTarget, Actor akCaster) Int CasterLevel = akCaster.getlevel() Int RandomInt = Utility.RandomInt(0, 100) If (RandomInt <= (MissChance)) ; adds a x% chance for attacks to "miss" (aka deal zero damage) akTarget.SetAV("attackDamageMult", 0.0) ; temporarily set's target's damage to zero EndIf If CasterLevel > 29 ;these will be needed later to restore values BUT seem to need to be a GLOBAL variable, since the EventOnEffectFinish cannot find them... Float fx1 = akTarget.GetAV("Magicka") Float fx2 = akTarget.GetAV("MagickaRate") ;no magicka regeneration and setting magika bar to zero effectively silences casters unless their spells magicka cost is zero akTarget.ForceAV("MagickaRate", 0.0) akTarget.ForceAV("Magicka", 0.0) EndIf endEvent Event OnEffectFinish(Actor akTarget, Actor akCaster) akTarget.SetAV("attackDamageMult", 1) Int CasterLevelAgain = akCaster.getlevel() ; since I don't know how to get PAPYRUS to keep previous value... If CasterLevelAgain > 29 akTarget.RestoreAV("Magicka", 9999) ; 9999 just input for testing; need global variable? and can then use (fx1) in place of the value akTarget.RestoreAV("MagickaRate", 9999) ; 9999 just input for testing; need global variable? and can then use (fx2) in place of the value EndIf endEvent Int property MissChance auto EDIT: nevermind... someone helped me figure this out. YOu just need to declare the variables in the "main body" of the script, rather than within the events. Then the script seems to retain them until it's finished.
  2. 1.) You would add the perk by having the pc use a spell? I tried that method but the "perk to apply" doesn't work on NPC's. The CK wiki confirms this problem and I also just managed to get a very knowledgeable spell maker also confirm that no method exists. Based on his confirmation and my prior testing, I believe he's right too. 2.) Did you add the perk to your magic effect anyway? In this case, I was using hazard to apply the magic effect, which works because the shader I have selected is showing up. I then used the "perk to apply" option to attempt to give the NPC's that "debuff" perk. 3.) How do you know that it applies only to the player? It's not that perk's apply only to the player, but rather that the game engine seems incapable of giving an NPC a perk via a script using "akTarget.addperk(akPerk)" or via a magic effect using the "perk to apply option." Therefore, I guess my only option is to try to mimic the results of the perk, via a script. I'm just new to papyrus, so this probably isn't something I can figure out in any short period of time. Here's what I'm looking to do if anyone wants to help. Racial Power: "Globe of Darkness" - When cast a globe of darkness is summoned at the targeted location. Enemies inside the globe miss with X% of their attacks and have trouble finding their enemy. To accomplish this sort of theme, I was going to use the following "Entry Point" types, 1.) Mod Detection Light: Set Value = 0 2.) Mod Detection Movement: Set Value = 0 3.) Mod Attack Power: Set Value = 0 AND add a "Perk Owner" condition "GetRandomPercent" less than or equal to X, which would be ran on the "Subject". X represents whatever percent I want those inside to "miss" with their attacks. Technically, the enemies would "hit" the player, but X% of the time, their damage would be reduced to zero, which I consider the same thing as dodging the attack. I need the spell to not only work if cast by the player, but also if cast by and against other NPC's. If anyone has any ideas on how to spice up the spell, please let me know. Right now I've got the visuals (big orbiting dark ball) working successfully with a cooldown timer, and the magic effect triggers against those in the desire area of effect, but I need that magic effect to do something, so that it feels like a globe of darkness.
  3. The "Perk to Apply" magic effect drop down in the creation kit only works if the target is the player. I'm trying to give NPC's a temporarily spell de-bluff via a perk. I could manually add the perk to every blasted actor in the game, by opening up each actor's associated ID and going to the "SPELLLIST" tab and then adding the perk to the perk box. The perk could have a "HasKeyword" condition to make the perk unless, until my desired spell temporarily attaches the needed keyword, via a magic effect. Nevertheless, there are thousands of actors in the game and mods add even more actors for which I cannot manually edit their spell list's perk box. Therefore, I either need to scrap the idea or come up with a way to alter an actor's SPELLLIST perk box, via a script. Does anyone know how to do such a feat? This is the most useful info I found using Google and it just confirmed that I cannot use aktarget.addperk(myperkhere) to dynamically add a perk via a script.
  4. Did you happen to find a way to get the real base max health, without using SKSE? If you did, I would love to know the method because I have no idea how to make a mod work with SKSE stuff.
  5. I think I may have found the right event to use so that scripts run after character selection. Event OnRaceSwitchComplete() Debug.Trace("This actor's race has finished changing") endEvent I'm hoping that it'll trigger when first selecting your race, rather than just if one had used "~ showracemenu" to forcefully change it. Well, time to go test it. EDIT: I tested this event out, but have been unsuccessful getting it to trigger. I attached the script to the Actor ID of one of the races preset character gen options. When I pick that particular character preset, shouldn't the below script get attached to that actor, so that after character creation, the OnRaceSwitchComplete() event would trigger? I've never used an "extends Actor" type of script before, so it's highly likely that I'm doing something wrong. Scriptname yyyRacialDrowRaceChangeManager extends Actor Event OnRaceSwitchComplete() Debug.Trace("This actor's race has finished changing") endEvent
  6. Hello, I'm looking for a way to trigger a script after one picks their race. I will use this script to add starting powers and perks. The benefit of adding them after character selection is that they can later be removed, while spells that are "hard coded" to the race cannot be removed (at least I haven't found a way) even forcefully via a script. At first I was just going to use this script to add the starting stuff, but since the script triggers before the player picks their race, they don't yet have the ActorTypeDrow keyword. Thanks for any help that someone might be able to provide. Scriptname yyyRacialDrowStartingSpells extends Quest Event OnInit() RegisterForSingleUpdate(2.0) actor target = Game.GetPlayer() Debug.Notification("Checking if Drow") if target.hasKeyword(ActorTypeDrow) Debug.Notification("Target is a Drow, so adding starter spells") target.addspell(ShadowScourgeTigger) target.addspell(ShadowStalkerTrigger) target.addspell(ShadowSlayerTrigger) target.addspell(ShadowSorcererTrigger) target.addperk(FearedHeritage_0) target.addspell(FaerieFire_0) target.addspell(DancingLightTrigger) target.addspell(Levitate_0) endif EndEvent Keyword Property ActorTypeDrow Auto Perk Property FearedHeritage_0 Auto Spell Property ShadowScourgeTigger Auto Spell Property ShadowStalkerTrigger Auto Spell Property ShadowSlayerTrigger Auto Spell Property ShadowSorcererTrigger Auto Spell Property FaerieFire_0 Auto Spell Property DancingLightTrigger Auto Spell Property Levitate_0 Auto
  7. Schatten, you were right on the money. Here's how I ended up modifying the script to have the game correctly call out the new trap. I basically learned that if you've got a form ID, you should figure out what kind of property to call it out as in a script, so that you can map to it in the property manager and thereby allow the CK to keep everything straight, without having to define the load order into which the mod will end up getting placed. Does that sound right? I'm still trying to learn enough of papyrus to be dangerous, but feel like I'm still on the "Hello World" tutorial. Scriptname yyyShadowScourgeExplosionMarker extends ObjectReference ObjectReference refPutridExplosion Event OnInit() refPutridExplosion = SELF.PlaceAtMe(yyyShadowScourgeExplosiveGasTrap) RegisterForSingleUpdate(0.5) ;; this adds a .5 second delay EndEvent Event OnUpdate() refPutridExplosion.Enable() refPutridExplosion.damageObject(5.0) ;; makes the poison start damaging in the AOE SELF.Delete() ;; Destructs xMarker EndEvent Activator Property yyyShadowScourgeExplosiveGasTrap Auto Now that I'm able to tweak the new trap without worrying about messing up vanilla files, here's the script that I've been working on to try and attach to the new trap. It's failing horribly. I can't even get it to compile... any suggestions would be appreciated! Scriptname yyyShadowScourgePutridExplosionDamage extends ObjectReference int level = Game.GetPlayer().GetLevel() Event OnTrapHit(ObjectReference akTarget, float afXVel, float afYVel, float afZVel, float afXPos, float afYPos, \ float afZPos, int aeMaterial, bool abInitialHit, int aeMotionType) Float TargetMaxHealth = akTarget.GetAV("MaxHealth") if (level >= 60) akTarget.DamageActorValue("health", TargetMaxHealth * 1.0) Debug.Notification("Explosion dealt 100% of targets max life") elseif (level >= 50) akTarget.DamageActorValue("health", TargetMaxHealth * .75) Debug.Notification("Explosion dealt 75% of targets max life") elseif (level >= 40) akTarget.DamageActorValue("health", TargetMaxHealth * .50) Debug.Notification("Explosion dealt 50% of targets max life") elseif (level >= 30) akTarget.DamageActorValue("health", TargetMaxHealth * .35) Debug.Notification("Explosion dealt 35% of targets max life") elseif (level >= 20) akTarget.DamageActorValue("health", TargetMaxHealth * .30) Debug.Notification("Explosion dealt 30% of targets max life") elseif (level >= 0) akTarget.DamageActorValue("health", TargetMaxHealth * .25) Debug.Notification("Explosion dealt 25% of targets max life") else Debug.Notification("Putrid Explosion has failed to deal any damage to one of the hit actors!") endif EndEvent
  8. Thanks for the links and the extra suggestions. I'll do so research, testing, and let you know how it turns out!
  9. Thank you for the help Schatten; however, I'm a very beginner for scripting. I typically have to guess and check for hours to get anything to work. Might you be able to toss together an example script that I could yse as a reference, or point me to a link where I could read up on how to do what you've described above?
  10. I've returned back to this spell and have had some success, but am still searching for help. I can now get the game to cast a invisible MarkerX at an actors location if they've died while poisoned. This MarkerX is then used to trigger an explosion by placing a trap at a specified location. I think the final piece of the puzzle is to attach a script to the trap that causes the X% of max health damage. My current problem is that I don't want to attach a script to the game's default trap, but rather I want to duplicate the trap I've been referencing and attach a script to the new trap, so that the origional game's trap remains fully intact. Here's the script that casts the trap ID# 00082E18. Scriptname yyyShadowScourgeExplosionMarker extends ObjectReference ObjectReference refPutridExplosion Event OnInit() refPutridExplosion = SELF.PlaceAtMe(Game.GetForm(0x00082E18)) RegisterForSingleUpdate(0.5) ;; this adds a .5 second delay EndEvent Event OnUpdate() refPutridExplosion.Enable() refPutridExplosion.damageObject(5.0) SELF.Delete() ;; Destructs xMarker EndEvent When duplicating the trap, I come up with a new ID# of 042D6B15; however, when I swap out 00082E18 for 042D6B15, no explosion happens. I suspect that the "0x" in front of the 00082E18 is some sort of form list reference that needs to match up with something to do with my mod's install number. Is that true? How can I make the new trap work without preventing the script from working no matter what order someone might have it installed (if that is indeed my problem)? refPutridExplosion = SELF.PlaceAtMe(Game.GetForm(0x042D6B15)) // When I make this change nothing happens. EDIT: After some more diggering, maybe 042D6B15 needs to be placed in game somewhere, before I can call upon it in the above script. Might that be the case?
  11. I've got a script that casts a spell with has a spell cost of X (as is designed in the associated SPEL form type). However, when the script triggers and the spell is cast, I don't lose any magicka... Is there a way to make the game know to use the designed spell cost or can I somehow hardcode the desired spell cost to be reduced when the spell is cast during the script? If the latter is needed, can anyone provide a template script for such an action? I'd imagine that such a script would need to first check to see that the player had enough magicka to cast the spell. If true then cast the spell and somehow deduce the magicka cost. If false, then do nothing. Thank you in advance for anyone how can provide any help or insight into this issue.
  12. Hi! Thank you in advance for any help that you may provide. My goal is to hit a target and apply a magic effect when poisoning an enemy. If the enemy dies while poisoned, I want them to explode and deal X% of their total health to enemies within Y distance. Using the creation kits "target conditions" and the below script, I've had some success. Scriptname yyyDrowOnKillShadowScourge extends ActiveMagicEffect Event OnDying(actor akKiller) Debug.Notification("an enemy has died!") if (akKiller == game.getPlayer()) Debug.Notification("The player has killed something! SUMMON FLAME ATRONACH!") Spell_Tier0.cast(akKiller,akTarget = None) else Debug.Notification("The player did not kill that enemy...") endif EndEvent Spell Property Spell_Tier0 Auto So far, I've managed to mark the poisoned target with a magic effect and upon death cast a spell. The only spell that I've successfully cast was "ConjureFlameAtronach" and it only triggers if I kill something while being very close to it (maybe a lenght of space equal to the character's height away). I think the script's weakness is that AkTarget = None. I don't know how to define AkTarget. Is there a way to clarify what actor(s) is/are akTarget? ---------------------------------------------------------- Finally, if I can get enough help to get the spell firing all of the time, then I'd like to move onto creating the script that will deal damage equal to a percentage of whatever died's max health, to all enemies within Y distance of their dead corpse. I think it a script similar to this will be needed, but I can't get this one to compile. Scriptname yyyShadowScourgeKillBonusExplosion extends ActiveMagicEffect Event OnEffectStart(Actor akTarget, Actor akCaster) Debug.Trace("Magic effect was started on " + akTarget) Float TargetMaxHealth TargetMaxHealth = akTarget.GetAV("health") akTarget.DamageActorValue("health", TargetMaxHealth * .25) endEvent If if I did get it to compile, I fear that the script would only be attempting to damage the dead targets health bar, rather than the health of those around it... Might anyone have suggestions for this one too? I'm reading up on scripting where ever possible, but am still very very ignorant of how just about everything works.
  13. I wrote this script for my WIP Dhaerrow race mod. Here it is, although I'm triggering different spells depending on the players level, so I think you'll want to remove the lines that I put a strike through, in order to get what you want. Scriptname yyyDrowOnKillShadowStalker extends ActiveMagicEffect Event OnDying(actor akKiller) Debug.Notification("akKiller has killed something!") if (akKiller == game.getPlayer()) Debug.Notification("The player has killed something!") int level = akKiller.getLevel() if (level >= 60) Spell_Tier5.cast(akKiller,akKiller) Debug.Notification("TESTING Spell Tier 5 cast") elseif (level >= 50) Spell_Tier4.cast(akKiller,akKiller) Debug.Notification("TESTING Spell Tier 4 cast") elseif (level >= 40) Spell_Tier3.cast(akKiller,akKiller) Debug.Notification("TESTING Spell Tier 3 cast") elseif (level >= 30) Spell_Tier2.cast(akKiller,akKiller) Debug.Notification("TESTING Spell Tier 2 cast") elseif (level >= 20) Spell_Tier1.cast(akKiller,akKiller) Debug.Notification("TESTING Spell Tier 1 cast") elseif (level >= 0) Spell_Tier0.cast(akKiller,akKiller) Debug.Notification("TESTING Spell Tier 0 cast") else Debug.Notification("This message should never appear, right?") endif endif EndEvent Spell Property Spell_Tier5 Auto Spell Property Spell_Tier4 Auto Spell Property Spell_Tier3 Auto Spell Property Spell_Tier2 Auto Spell Property Spell_Tier1 Auto Spell Property Spell_Tier0 Auto I attached the script to a magic effect that has a target condition of the player having a getlightlevel of <= 40, which triggers my fun "on kill bonus spell" whenever something dies, while the player was in the shadows. This scripts works for me from kiling bunnies to summons to whatever else might die within the area of the magic effect for which it's been attached. If anyone can help improve the script to only work when the player kills the target, please let me know! I don't like it when a follower dies and my character gets the "on kill bonus." I also would like for it to only target against hostile enemies, but am not sure how to do that either and am concerned that doing so would prevent the script from triggering against enemies that the player one shot kills...??? Finally, might it be possible to limit the script to only triggering when the player caused the damage that killed the actor that had died? Again, it's kind of cheap when a summon or follower finishes something off and my player gets this bonus.
  14. Greetings to everyone who was bored enough to open this topic! When I'm not playing video games, I like to play soccer, work out, playing frisbee with my border collie and hang out with my wife. I've joined this forum in search of people who might be willing to aid my scripting attempts, in my goal to create a new race mod for Skyrim, which will be inspired by various forgotten realms books about the Drow. The race will be titled the Dhaerrow, which I believe means "traitor" in elvish, but was later used as slang to represent the Drow race. I'm very excited to find out if people will be willing to take the time to repond to my requests for coaching or just straight up help, as I've been working on this since June of this year and am close to have my first phase of core goals completed. This will become my first and possibly only mod, but I have ambitious ideas to improve upon the mod's design. Thanks in advance for everyone's time and efforts! ~SkyrimModHunter
×
×
  • Create New...