Jump to content

morrowind1979

Members
  • Posts

    571
  • Joined

  • Last visited

Posts posted by morrowind1979

  1. So as the title says I am trying to make a magic effect randomly play one of 3 different sounds each time it is cast. I am struggling with the random papyrus function. This is far as I can get but it isnt playing any sound when the spell is cast. Any help would be appreciated. Thanks:

    Scriptname NSShadowFlareScript extends activemagiceffect  
    
    Sound Property MSFS1  Auto  
    Sound Property FSFS1  Auto  
    Sound Property MSFS2  Auto  
    Sound Property FSFS2  Auto 
    Sound Property MSFS3  Auto  
    Sound Property FSFS3  Auto 
    
    EVENT OnEffectStart(Actor akTarget, Actor akCaster)
    
    int random = Utility.RandomInt()
    
    		If (Game.GetPlayer().GetActorBase().GetSex() == 0)
    			If random <= 33
    				MSFS1.play(Game.GetPlayer())
    			ElseIf random <= 67
    				MSFS2.play(Game.GetPlayer())
    			ElseIf random <= 100
    				MSFS3.play(Game.GetPlayer())
    			EndIf
    		ElseIf (Game.GetPlayer().GetActorBase().GetSex() == 1)
    			If random <= 33
    				MSFS1.play(Game.GetPlayer())
    			ElseIf random <= 67
    				MSFS2.play(Game.GetPlayer())
    			ElseIf random <= 100
    				MSFS3.play(Game.GetPlayer())
    			EndIf
    		EndIf
    EndEvent
    
  2. Of course it fails. You are comparing the inherited spell from the OnSpellCast event's akSpell parameter variable to a scroll property variable. Those two will never match.

     

    Scrolls, if I am not mistaken, end up casting the actual spell itself. So if you compared the akSpell parameter against the actual magelight spell, then it might work. But if you only want it to work when using a scroll rather than any time the spell is cast, I do not know. Sorry.

    Yeah i figured that out after hours of messing around on the CK and google. I already setup up a script that damages the player when they cast the magelight spell but unfortunately the effect does not carry over to the scroll, there doesn't seem to be anyway possible to make this happen for the scroll. Another problem i'm having is to make the placed light hazard damage the player from the magelight spell. through trial and error I have found that the light hazard placed when the player casts the spell is a completely different hazard to the one that can be placed in the CK or is cast by NPC's. I can get the CK/NPC light hazard to damage the player but not the light hazard that is generated when the player casts the spell. It has a different form index and I cant find it anywhere in the CK. If I can solve these 2 issues I would be all set but truthfully I think its beyond the Creation Kits ability.

  3. http://www.creationkit.com/Category:Papyrus -- read the pages linked on the right hand side to get an understanding of the individual parts that make up scripts.

     

    There is no specific walkthrough tutorial that is only about scripting. Since scripts have to be applied to an object, most tutorials will have you create the associated object(s) first and then discuss the script part (and only within the confines of that situation).

     

    Papyrus scripting has a basic structure which you can learn (see link above) but each situation is different and usually requires a different approach.

     

    At any rate, you misunderstood what I stated. You wanted an item to be taken from the player when the player casts a spell. Normally for a single target spell you could apply a script to the effect as you have tried. Since your spell is an AOE, the effect is triggered once for each affected actor. That is undesirable (which you have stated). While it might be possible to interrupt the effect process as I originally suggested, it may be better to use the OnSpellCast event.

     

    Since OnSpellCast is on the ObjectReference script that means that actors inherit the ability to use this event. The event has to be called on an object that does the casting (i.e. an actor, a trap, etc) rather than the effect of the spell. Therefore an alias for the player character needs to be created on a dummy quest (see quote below)

     

    Excerpt from: http://www.creationkit.com/Dynamically_Attaching_Scripts

     

     

    In the Object Window, navigate to Quest under the Character category. Create a new quest by right-clicking on the list and choosing 'New'. For this tutorial we will be naming the quest mymodQuest. Make sure that Start Game Enabled in the Quest Data tab is checked. Click on the Quest Alias tab, then right-click in the empty list and choose 'New Reference Alias'. We will name this alias PlayerAlias. In the Reference Alias window, under Fill Type, select the Specific Reference option and click the 'Select Forced Reference' button. Under Cell choose (any), and Ref should default to PlayerRef (Player). If not, select it from the dropdown menu.

     

     

    Your script may end up being something as follows.

    Scriptname SomeScript Extends ReferenceAlias
    
    Spell Property SpellCasted Auto
    SoulGem Property GemToTake Auto
    Actor Property PlayerRef Auto
    Int Property QtyToTake Auto
    
    Event OnSpellCast(Form akSpell)
    If akSpell == SpellCasted
    PlayerRef.RemoveItem(GemToTake,QtyToTake)
    EndIf
    EndEvent

    The only concern is: Preventing the spell from being cast when player does not have the appropriate quantity of the item. I do not know if spells can have conditions on them that prevent casting. If they can, then that is great. If not, then you are back to the drawing board as the script above removes the item when the spell has been cast. Any checks in this script would not prevent the spell from being cast as it is the casting of the spell that triggers it.

     

    I suppose you could do a "chain cast"... where the player casts a spell which is caught by the script. If the player has the necessary items, then the real spell is cast. If the player does not have the items, then notification of failure is displayed.

    This does not work. I am having a similar issue except all I want to do is damage the players health when they cast a magelight scroll. I followed your instructions to a tee and adapted the script to this:

    EFFECTSHADER PROPERTY effect AUTO
    KEYWORD PROPERTY NSKW AUTO
    SCROLL PROPERTY MLS AUTO
    Actor Property PlayerRef Auto
    
    Event OnSpellCast(Form akSpell)
    	If akSpell == MLS
    		effect.play(PlayerRef)
    		PlayerRef.damageAV("health",200)
    		effect.stop(PlayerRef)
    	EndIf
    EndEvent
    

    When the player casts a magelight scroll nothing happens his health is not damaged.

  4. Hi all. I am updating my Nightspawn race and am making all light spells damage the race when cast. I have successfully done them all except the magelight scroll. I just cant get any scripts to work.

     

    This is what I have attached to the magic effect (u cant attach scripts to spells or scrolls, only magic effects):

    Scriptname NSMagelightDamScript extends activemagiceffect  
    
    EFFECTSHADER PROPERTY effect AUTO
    KEYWORD PROPERTY NSKW AUTO
    
    Event OnEffectFinish(Actor akTarget, Actor akCaster)
    	If akCaster.haskeyword (NSKW)
    		effect.play(akCaster)
    		akCaster.damageAV("health",200)
    		effect.stop(akCaster)
    	EndIf
    EndEvent
    

    When the player casts the spell nothing happens and his/her health is not damaged. Can anyone help me with this please?

    I've just discovered that with aimed magic effects that use projectiles The EventOnEffectStart script only begins once the projectile hits its target. SO what I need to do is make some sort of script that activates when the spell is cast rather than when the projectile hits its target. If anyone could advise me on how to do this, would be great.

  5. Hi all. I am updating my Nightspawn race and am making all light spells damage the race when cast. I have successfully done them all except the magelight scroll. I just cant get any scripts to work.

     

    This is what I have attached to the magic effect (u cant attach scripts to spells or scrolls, only magic effects):

    Scriptname NSMagelightDamScript extends activemagiceffect  
    
    EFFECTSHADER PROPERTY effect AUTO
    KEYWORD PROPERTY NSKW AUTO
    
    Event OnEffectFinish(Actor akTarget, Actor akCaster)
    	If akCaster.haskeyword (NSKW)
    		effect.play(akCaster)
    		akCaster.damageAV("health",200)
    		effect.stop(akCaster)
    	EndIf
    EndEvent
    

    When the player casts the spell nothing happens and his/her health is not damaged. Can anyone help me with this please?

  6. Hi all. I have Dark Souls 2 Scholar of the First Sin and it is the only game that has mods available for that I have never used a single mod with this game ever. I browsed through them all and cant find any need to add a single one of them (thats not to say they aren't good mods, I just have no need for them). What does everyone else think about this?

  7. I will start with saying I have played Dark Souls 2 and got right to the final boss in the throne of want before giving up and overall I loved the game. Now as for Dark Souls 3, first impressions were good. The first area all the enemies went down pretty easy and I bet that inuex gundar boss thing on my second try. So I thought this might not actually be so hard and such a drag to play. Then I got to the High Wall of Lothric and those overgrown hollows in armor with axes killed me in about 3 hits and I barely managed to dent their health bar. At least in Dark Souls 2 you got beginner areas where you could grind and get stronger in order to beat the harder areas. But In DS3 even the beginner area is ridiculously unbalanced against the player. got sick of dying over and over again and now have been put off this game completely. I am aware this post will atract all the "git gud" trolls but all I have to say to them is "nope. nope. nope."

  8. Nope, I've got only obj import - and it's not working correctly either :tongue: I think I have the newest version, I'll try to find yours and then we'll see.

     

    EDIT. I'm not editing meshes, that's the problem. I'm creating them from scratch - like new candles and glasses (primitive work, I know, but I need it).

    Sorry m8 thats about as far as my knowledge on the subject goes. Maye someone esle can help.

  9. Thats strange what version are you using? I use version 2.0.0. Pre-Alpha. From the file menu you choose import, then import .3ds. I should also have mentioned you need to open the old unedited mesh in Nifskope then import your blender .3ds file into that.

  10.  

    ummm so how do I do all that? Lol the only quest event I can find that can be set to level increase is the one on the Quest data tab

     

    Maybe this screenshot sequence will help you get where you need to go. https://imgur.com/a/NUSOyWC

     

    The only thing I did not include is putting the script you have above on the quest. I assume you know how to do that if you've gotten this far already.

     

    Edit: This should get your quest to fire and run the script. But I think you have a logic fault in the if tree. They're all nested. Which means if it doesn't run them all on the first time, then after the first run sets the matched globals, any subsequent run will fail. Also, your repeated calls to Game.GetPlayer() and GetLevel() are going to put a huge slow down burden on things. Try this

     

     

    Scriptname MWDKDeathKnightLevelingScript extends Quest  
    
    SPELL Property DeathCoil  Auto  
    
    SPELL Property DeathCharger  Auto  
    
    SPELL Property RuneBlade  Auto  
    
    SPELL Property IceChains  Auto  
    
    SPELL Property DeathGrip  Auto  
    
    SPELL Property SGargoyle  Auto  
    
    SPELL Property RaiseAlly  Auto  
    
    SPELL Property SoulReaper  Auto  
    
    Message Property DKLUM  Auto
    
    Message Property DKLUCM  Auto
    
    Keyword Property MWDKDeathKnightKeyword  Auto
    
    GlobalVariable Property SDCG  Auto  
    
    GlobalVariable Property DCG  Auto  
    
    GlobalVariable Property SGG  Auto  
    
    GlobalVariable Property SRBG  Auto  
    
    GlobalVariable Property DGG  Auto  
    
    GlobalVariable Property ICG  Auto  
    
    GlobalVariable Property RAG  Auto  
    
    GlobalVariable Property SRPG  Auto
    
    Event OnStoryIncreaseLevel (int aiNewLevel)
        Actor PlayerREF = Game.GetPlayer() ; set a function variable once which is accessed much faster
    
        If PlayerREF.Haskeyword(MWDKDeathKnightKeyword) ; check the keyword first to short circuit all the level checks if we do not match
    
            int iLevel = PlayerREF.GetLevel() ; get the level once to speed things up and not repeatedly call out
            
            ; separate each level check entirely so as to not fail on a second or further run
            If iLevel >= 10  && DCG.GetValue() == 0
                DKLUM.show()
                PlayerREF.addspell(DeathCoil)
                DCG.SetValue(1)
            Endif
            
            If iLevel >= 20  && SDCG.GetValue() == 0
                DKLUM.show()
                PlayerREF.addspell(DeathCharger)
                SDCG.SetValue(1)
            Endif
            
            If iLevel >= 30  && SRBG.GetValue() == 0
                DKLUM.show()
                PlayerREF.addspell(RuneBlade)
                SRBG.SetValue(1)
            Endif
            
            If iLevel >= 40  && ICG.GetValue() == 0
                DKLUM.show()
                PlayerREF.addspell(IceChains)
                ICG.SetValue(1)
            Endif
            
            If iLevel >= 50  && DGG.GetValue() == 0
                DKLUM.show()
                PlayerREF.addspell(DeathGrip)
                DGG.SetValue(1)
            Endif
            
            If iLevel >= 60  && SGG.GetValue() == 0
                DKLUM.show()
                PlayerREF.addspell(SGargoyle)
                SGG.SetValue(1)
            Endif
            
            If iLevel >= 70  && RAG.GetValue() == 0
                DKLUM.show()
                PlayerREF.addspell(RaiseAlly)
                RAG.SetValue(1)
            Endif
            
            If iLevel >= 80  && SRPG.GetValue() == 0
                DKLUM.show()
                PlayerREF.addspell(SoulReaper)
                DKLUCM.show()
                SRPG.SetValue(1)
            Endif
        
        EndIf
    
    EndEvent
    

     

     

     

    Thanks! The leveling system is now working perfectly as it should! Thats the race, spells and leveling system down now I need to recreate the quests. Im gonna sit and have a long think about this part. I know how to do it but the original quests are unfinished and buggy so knowing nothing about WoW lore I'm going to have to do some research first lol.

  11. Hi used your script and set the quest event to level increase. But it still does not work. Nothing happens when the player reaches level 10. I even tried levelling up, selecting my perk and exiting the menu but still nothing nada. Dont know if it is the way I am testing it. What I do is use the following console commands:

     

    coc whiterun: teleport to whiterun exterior

    showracemenu: I choose my Death Knight race with the keyword attached

    player.setlevel 9: Sets the players level to 9

    player.modav health 999999: gives me enough health to take a beating so I can level up

     

    Next I attack the whiterun guards then stand and let them attack me till I level up to level 10 and nothing happens the script does not work.

  12. After reading about TheSkoomaKings broken/unfinishe DeathKnight Race mod I am trying to remake it. I have created a quest and attached the following script to the Quest (it is supposed to add spells to the player as he levels up, but when i reach the desired levels in game the script does not work the message box isn't shown and the spells are not added.) Can anyone tell me what is wong?

    Scriptname MWDKDeathKnightLevelingScript extends Quest  
    
    SPELL Property DeathCoil  Auto  
    
    SPELL Property DeathCharger  Auto  
    
    SPELL Property RuneBlade  Auto  
    
    SPELL Property IceChains  Auto  
    
    SPELL Property DeathGrip  Auto  
    
    SPELL Property SGargoyle  Auto  
    
    SPELL Property RaiseAlly  Auto  
    
    SPELL Property SoulReaper  Auto  
    
    Message Property DKLUM  Auto
    
    Message Property DKLUCM  Auto
    
    Keyword Property MWDKDeathKnightKeyword  Auto
    
    GlobalVariable Property SDCG  Auto  
    
    GlobalVariable Property DCG  Auto  
    
    GlobalVariable Property SGG  Auto  
    
    GlobalVariable Property SRBG  Auto  
    
    GlobalVariable Property DGG  Auto  
    
    GlobalVariable Property ICG  Auto  
    
    GlobalVariable Property RAG  Auto  
    
    GlobalVariable Property SRPG  Auto
    
    Event OnStoryIncreaseLevel (int aiNewLevel)
        If Game.GetPlayer().GetLevel() >= 10 && game.Getplayer().Haskeyword(MWDKDeathKnightKeyword) == 1 && DCG.GetValue() == 0
            DKLUM.show()
            Game.GetPlayer().addspell(DeathCoil)
            DCG.SetValue(1)
        If Game.GetPlayer().GetLevel() >= 20 && game.Getplayer().Haskeyword(MWDKDeathKnightKeyword) == 1 && SDCG.GetValue() == 0
            DKLUM.show()
            Game.GetPlayer().addspell(DeathCharger)
            SDCG.SetValue(1)
        If Game.GetPlayer().GetLevel() >= 30 && game.Getplayer().Haskeyword(MWDKDeathKnightKeyword) == 1 && SRBG.GetValue() == 0
            DKLUM.show()
            Game.GetPlayer().addspell(RuneBlade)
            SRBG.SetValue(1)
        If Game.GetPlayer().GetLevel() >= 40 && game.Getplayer().Haskeyword(MWDKDeathKnightKeyword) == 1 && ICG.GetValue() == 0
            DKLUM.show()
            Game.GetPlayer().addspell(IceChains)
            ICG.SetValue(1)
        If Game.GetPlayer().GetLevel() >= 50 && game.Getplayer().Haskeyword(MWDKDeathKnightKeyword) == 1 && DGG.GetValue() == 0
            DKLUM.show()
            Game.GetPlayer().addspell(DeathGrip)
            DGG.SetValue(1)
        If Game.GetPlayer().GetLevel() >= 60 && game.Getplayer().Haskeyword(MWDKDeathKnightKeyword) == 1 && SGG.GetValue() == 0
            DKLUM.show()
            Game.GetPlayer().addspell(SGargoyle)
            SGG.SetValue(1)
        If Game.GetPlayer().GetLevel() >= 70 && game.Getplayer().Haskeyword(MWDKDeathKnightKeyword) == 1 && RAG.GetValue() == 0
            DKLUM.show()
            Game.GetPlayer().addspell(RaiseAlly)
            RAG.SetValue(1)
        If Game.GetPlayer().GetLevel() >= 80 && game.Getplayer().Haskeyword(MWDKDeathKnightKeyword) == 1 && SRPG.GetValue() == 0
            DKLUM.show()
            Game.GetPlayer().addspell(SoulReaper)
            DKLUCM.show()
            SRPG.SetValue(1)
        Endif
        Endif
        Endif
        Endif
        Endif
        EndIf
        EndIf
        EndIf
    EndEvent
    
  13.  

    I tried to make my own custom dungeons once. I tried to learn snap to grid and if I Remeber right I was supposed to select the dungeon piece I wanted to align and press Q to snap it into place but when I pressed Q nothing happened. So I tried to align the dungeon pieces manually by copying and pasting x,y,z coordinates. This resulted in days of headaches and a fit of rage that almost destroyed my computer lol. I find this proccess mind numbingly boring and monotonous. I guess its back to duplicating and editing existing dungeons then. Sigh...

    Snapping works perfectly when you turn it on thou. It allows you to align vanilla assets in a grid, you don't need to copy x,y,z values to align pieces.

    Always make sure you reference snap object is aligned at 0,0,0 degree angle (ie default angle), and that it is placed on 0,0,0 coordinates. Then from there, you keep adding in pieces that snap to that reference piece.

     

    M8 I went through umpteen tutorials step by step and I cannot for the life of me get snap to grid to work wether its turned off or on. The best way I can describe it is like selective dyslexia from learning snap to grid. ( I dont have dyslexia btw, just the best way I could find to describe it.)

  14. I tried to make my own custom dungeons once. I tried to learn snap to grid and if I Remeber right I was supposed to select the dungeon piece I wanted to align and press Q to snap it into place but when I pressed Q nothing happened. So I tried to align the dungeon pieces manually by copying and pasting x,y,z coordinates. This resulted in days of headaches and a fit of rage that almost destroyed my computer lol. I find this proccess mind numbingly boring and monotonous. I guess its back to duplicating and editing existing dungeons then. Sigh...

×
×
  • Create New...