Jump to content

SurfsideNaturals

Premium Member
  • Posts

    50
  • Joined

  • Last visited

Everything posted by SurfsideNaturals

  1. Yes, If the OnUnEquipped() event is not firing either, under your conditions, then you can just put a condition on the perk so it will only work when the shield is equipped. Put Debug.Notifications on both events and test them. I would also like to see your script on the items. Keep in mind ,if you equip an item right out of a container the OnEquipped() event will not fire consistently.
  2. Have you tested if the OnUnEquipped() event is firing under the same conditions? When you equip the two handed weapon does the OnUnEquipped() event fire? When you equip the two handed sword and then look in the menu, are the little arrows still pointing at the shield and sword? I suspect if you tested this with two one handed swords the event would fire when equipped from the favorites menu.
  3. Hey anb2004, To put it bluntly. Your script is a mess. This is ok. You are just learning. Please explain exactly what you want your script to do and how you think the script you have created will accomplish it.
  4. When doing something like this use "else" . if akActivator.getItemCount(ArmorA) && akActivator.getItemCount(ArmorB) Else ; Do something here. You do not have both items. EndIf It would be best if you included your entire script.
  5. This script will work just fine on a weapon in the players left hand. Please try the script before commenting on it. You do not need two variables. Using the global variable to count the uses is a much better idea. You can also use it in your message. Your problem is not a glitch, I told you why your count is off. If you are dual wielding, you will need to determine exactly which sword is being swung. You have stated that certain power events will not fire if a sword is swung from the left hand. So check which hand the sword is in and then use the appropriate events to catch the swing. Meaning, If the sword that is in your effect is not swinging, then the events will not fire on it. https://www.creationkit.com/index.php?title=GetEquippedWeapon_-_Actor If PlayerREF.GetEquippedWeapon(True) == Xsword ; Left Events that will catch the power animation events in the left hand. EndIf If PlayerREF.GetEquippedWeapon() == Xsword ; Right Events that will only catch the power animation events in the right hand. EndIf Now you know exactly which sword was swung and can apply the proper count and spell. Scriptname aXMDDwarvenXElectrocutionerFx extends activemagiceffect {Casts the 1H Dwarven X Sword Projectile} Message Property CoreChargedMSG Auto Message Property CoreDepletedMSG Auto GlobalVariable Property EnergyCount Auto Spell Property SpellHoriz auto Actor Property PlayerREF Auto Weapon Property Xsword Auto ;Int ECount Event OnEffectStart(Actor akTarget, Actor akCaster) registerForAnimationEvent(PlayerREF, "WeaponSwing") registerForAnimationEvent(PlayerREF, "WeaponLeftSwing") EndEvent Event OnEffectFinish(Actor akTarget, Actor akCaster) ;; EndEvent Event OnAnimationEvent(ObjectReference akSource, string EventName) ;EventName == "WeaponSwing" || EventName == "WeaponLeftSwing" You only registered these so you do not need to check for them. ;Please test this and see if the script fires on "unregisted events". ; If akSource == PlayerREF As ObjectReference ; only the play was registered, you really do not need this. ; Else ; Return ; EndIf If PlayerREF.GetAnimationVariableBool("bAllowRotation") Else Return EndIf If PlayerREF.GetEquippedWeapon(True) == Xsword || PlayerREF.GetEquippedWeapon() == Xsword Else Return EndIf If EnergyCount.GetValue() < 11 SpellHoriz.cast(PlayerREF) EnergyCount.Mod(1.0) Else Debug.Notification("DEPLETED") Utility.Wait(30.0) If PlayerREF.GetEquippedWeapon(True) == Xsword || PlayerREF.GetEquippedWeapon() == Xsword Debug.Notification("CHARGED") EndIf EnergyCount.setvalue(0) EndIf EndEvent
  6. You are using animation events. The magic effect is on the player. If you are dual wielding two one handed weapons, how is the game supposed to know which animation event to fire on which magic effect? Can you tell the exact weapon that is being swung? I do not see this script being able to do that. Please include all of the script associated with this. You might also consider finding the actual power attack events instead of this ( PlayerREF.GetAnimationVariableBool("bAllowRotation") ) Scriptname aXMDDwarvenXElectrocutionerFx extends activemagiceffect {Casts the 1H Dwarven X Sword Projectile} Message Property CoreChargedMSG Auto Message Property CoreDepletedMSG Auto GlobalVariable Property EnergyCount Auto Spell Property SpellHoriz auto Actor Property PlayerREF Auto Weapon Property Xsword Auto ;Int ECount Event OnEffectStart(Actor akTarget, Actor akCaster) registerForAnimationEvent(PlayerREF, "WeaponSwing") registerForAnimationEvent(PlayerREF, "WeaponLeftSwing") EndEvent Event OnEffectFinish(Actor akTarget, Actor akCaster) ;; EndEvent Event OnAnimationEvent(ObjectReference akSource, string EventName) ;EventName == "WeaponSwing" || EventName == "WeaponLeftSwing" You only registered these so you do not need to check for them. ;Please test this and see if the script fires on "unregisted events". ; If akSource == PlayerREF As ObjectReference ; only the play was registered, you really do not need this. ; Else ; Return ; EndIf If PlayerREF.GetAnimationVariableBool("bAllowRotation") Else Return EndIf If PlayerREF.IsEquipped(Xsword As Form) ; If the player is swinging a weapon any equipped sword will be out. You really do not need this because the effect will be added and removed when the sword is equipeed and unequipped. Else Return EndIf If EnergyCount.GetValue() < 10 SpellHoriz.cast(PlayerREF) EnergyCount.Mod(1.0) Else Debug.Notification("DEPLETED") Utility.Wait(30.0) If PlayerREF.IsEquipped(Xsword As Form) Debug.Notification("CHARGED") EndIf EnergyCount.setvalue(0) EndIf EndEvent
  7. https://www.creationkit.com/index.php?title=OnPlayerFastTravelEnd_-_Actor
  8. Yes, You will need an on activate script to have the blessing applied. Tutorials are nice, and there are many that could help you with this, but you can also have a look in the CK at things that do something similar to what you want to do. Here is a script from an alter. You could also look at a blessing spell and magic effect to make sure you have yours set up properly. Scriptname TempleBlessingScript extends ObjectReference Conditional Spell Property TempleBlessing Auto Event OnActivate(ObjectReference akActionRef) TempleBlessing.Cast(akActionRef, akActionRef) if akActionRef == Game.GetPlayer() AltarRemoveMsg.Show() BlessingMessage.Show() endif EndEvent Message Property BlessingMessage Auto Message Property AltarRemoveMsg Auto As Maxarturo stated a throne will fire the event more than once. Scriptname ThroneScript extends ObjectReference Spell Property DavesSpell Auto Event OnActivate(ObjectReference akActionRef) If akActionRef == Game.GetPlayer() As ObjectReference ; Is this the player? Else Return Endif ; https://www.creationkit.com/index.php?title=GetSitState_-_Actor If (akActionRef as actor).GetSitState() == 2 ; Only do if the player is staring to sit. Else Return Endif DavesSpell.Cast(akActionRef, akActionRef) ; add any messages you want to display here. EndEvent
  9. This is the text that you would put in your message. - You have fired %.0f projectiles. Int ProjectilesFired Message Property MaxMessage Auto MaxMessage.Show(ProjectilesFired As Float) I do not see how this requires you to display a 100 different #s at the same time. Even if you did you would just use more messages.
  10. You can show #s in a message. Yes this can be done. https://www.creationkit.com/index.php?title=Show_-_Message Int MaxCount Message Property MaxMessage Auto MaxMessage.Show(MaxCount As Float) This is the text that you would put in your message. - The Maxarturo count is %.0f .
  11. Hey Maxarturo, It is. Can you show me an example of the script? int Count Debug.Notification("Max Count = " + Count as Int )
  12. That is why it is important to streamline your scripts. Have a look at this script. You are duplicating functions. ( P.GetItemCount(_00E_YerosCave_SiraSoulbender) ). Function AddGem(ObjectReference P) ;=> I somewhat liked to do all stuff here as of having it easier to track and fix issues. ;=> So I got rid of the FindGem() function. if SiraSoulGemFunctions.ycInt_SiraSoulCounter > 49 ;=> Quest Script Variable :) P.Additem(_00E_WishWell_FrostcliffTavern_BrokenSoulgem, 1, True) SiraSoulGemFunctions.ycInt_SiraSoulCounter = -1 elseif SiraSoulGemFunctions.ycInt_SiraSoulCounter > -1 if UI.IsMenuOpen("InventoryMenu") ;=> A Soul Gem can only be used in inventory menu int[] SoulGemC = new int[6] ;=> Used to take care of eventualities. SoulGemC[0] = P.GetItemCount(_00E_YerosCave_SiraSoulbender) ;=> Like being in a filling process and SoulGemC[1] = P.GetItemCount(SoulGemArray[0]) ;=> quickly opening the menu. SoulGemC[2] = P.GetItemCount(SoulGemArray[1]) ;=> That would have resulted in multiple gems being SoulGemC[3] = P.GetItemCount(SoulGemArray[2]) ;=> added. Now we only have one. SoulGemC[4] = P.GetItemCount(SoulGemArray[3]) SoulGemC[5] = P.GetItemCount(SoulGemArray[4]) if (SoulGemC[0] + SoulGemC[1] + SoulGemC[2] + SoulGemC[3] + SoulGemC[4] + SoulGemC[5]) == 0 P.AddItem(_00E_YerosCave_SiraSoulbender, 1, True) endif endif endif int GC = P.GetItemCount(_00E_YerosCave_SiraSoulbender) If GC > 1 ;=> Just to be sure we only have one empty gem in inventory. ^^ P.RemoveItem(_00E_YerosCave_SiraSoulbender, GC - (GC - 1), true) EndIf ;=> Thanks for making me aware that Papyrus likes firing on weird eventualities. XD EndFunction You do not need to add all of the gems and the way it is done the code has to check every single gem before it finises. It should be set up so it returns a gem as soon as it finds one. if (SoulGemC[0] + SoulGemC[1] + SoulGemC[2] + SoulGemC[3] + SoulGemC[4] + SoulGemC[5]) == 0 P.AddItem(_00E_YerosCave_SiraSoulbender, 1, True) endif Like this for example: if UI.IsMenuOpen("InventoryMenu") ;=> A Soul Gem can only be used in inventory menu if IsFilling() else P.AddItem(_00E_YerosCave_SiraSoulbender, 1, True) endif endif Bool Function IsFilling int i While i < 5 If P.GetItemCount(SoulGemArray[i]) Return True EndIf i = i + 1 EndWhile EndFunction
  13. Now that you are removing the filled gem when you fill, this script is going to be more complicated and take some time to get right. What if someone, when in the middle of trapping souls, went into the menu and filled a weapon? It may be a good idea to set a state on your script when you remove the gem during filling instead of your current idea. ;This goes on your soul trapping script. ;You will need to create the PlayerAlias property and fill it. _00E_YC_PlayerAlias_GemCheckSCR s = PlayerAlias as _00E_YC_PlayerAlias_GemCheckSCR s.GoToState("Filling") ;Remove the gem s.GoToState("") ;This state will go on your _00E_YC_PlayerAlias_GemCheckSCR script State Filling Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer) endEvent EndState This could result in more than one gem being left in the players inventory. This = 1 ( GC - (GC - 1) ) P.RemoveItem(_00E_YerosCave_SiraSoulbender, GC - (GC - 1), true)
  14. Please explain exactly what the script is doing that you do not want it to do and exactly when it is happening. The gems are dropped and placed in containers when in menu also.
  15. You should always test a cell in COC before doing any further problem solving.
  16. Have a look at the levers that turn the swinging blades on and off. As far as your triggers, it sounds like they are not set up properly.
  17. So you will need to use OnEquipped and OnUnEquipped events on the jewelry to have the custom NPC change attire when the jewelry is equipped by the player. The custom NPCs default outfit can make it difficult to get them to equip and unequip individual items. This is something you could try. I am sure if you need more help setting this up others can also help you. Actor Property CNPC Auto Outfit Property OldOutfit Auto Outfit Property NewOutfit Auto Bool B Event OnEquipped(Actor akActor) if akActor == Game.GetPlayer() if B else CNPC.SetOutfit(NewOutfit) B = True endIf endIf endEvent Event OnUnequipped(Actor akActor) if akActor == Game.GetPlayer() if B CNPC.SetOutfit(OldOutfit) B = False endIf endIf endEvent
  18. This could be a gamesave issue. When you work in a cell, always make sure to test it in COC. Use Console Command to Enter the Cell and then test it. If that is not the problem, then I am sure maxarturo will be able to help you once he has all in information he needs to do so.
  19. Hey Beth, It sounds like the event may only be firing once on a stack of items. Strange. Give this a try. I have done a sorting script using arrays but nothing like this script. You might also consider making a test of your idea only using a couple of chests and a couple of items. Once you get that working how you want it, you can add more items. Self.RemoveItem(akBaseItem,GetItemCount(akBaseItem),True,TheCont)
  20. Hey Maxaturo, As far as I know, like Reneer said, the only way to do this for sure would be to first place an xmarker, move it to the position, and then add your explosions. It would be interesting to see what this does. Event OnDying(Actor akKiller) (Self.PlaceAtMe(DeathExplo01, 1)).SetPosition(0, 0, ZaxeExpl01) (Self.PlaceAtMe(DeathExplo02, 1)).SetPosition(0, 0, ZaxeExpl02) EndEvent If that fails, Give this a shot. Don't forget to fill the xmarker property. Scriptname aXMDnpcPlaceExplosionOnDying extends Actor {Places 2 explosions at the actor's position when he starts dying} STATIC Property XMarker Auto Explosion Property DeathExplo01 Auto {First explosion at torso height, ZaxeExpl01} Explosion Property DeathExplo02 Auto {Second explosion at torso bottom, ZaxeExpl02} Float Property ZaxeExpl01 = 100.0 Auto {First explosion at the Z axe, Default = 100} Float Property ZaxeExpl02 = 75.0 Auto {Second explosion at the Z axe, Default = 70} Event OnDying(Actor akKiller) ObjectReference XM = (Self.PlaceAtMe(XMarker, 1)).SetPosition(0, 0, ZaxeExpl01) XM.PlaceAtMe(DeathExplo01, 1) XM.SetPosition(0, 0, ZaxeExpl02) XM.PlaceAtMe(DeathExplo02, 1) EndEvent
  21. I am glad to see your mod going so well. :dance: It seems you are starting to catch on to Papyrus. :wub: Here is an optimized version of your script. I see you are using a GlobalVariable. That will work just fine, but I prefer using VM quest variables. You do have a quest here and can look into that if you are interested. You were also adding the broken gem to the player with the message showing. Remember the player is not supposed to know the gem is being added and removed. If you are using Oninit() and are running large functions, then you should use OnUpdate or OnUpdateGameTime(). In this case you are only setting the filters. As you can see the Soul Gem Array has been changed. This involves you filling the array in properties. Do you see the little Array check box?? You can delete your filled soulgem properties and add them to the Array in "Properties" I also updated your functions for adding the gem and checking the gems because you updated the script. getreference() returns and object reference so you do not need to cast it as an object reference. ;Big thanks to SurfsideNaturals for helping me. ^^ ;+=Just Chill Scriptname _00E_YC_PlayerAlias_GemCheckSCR extends ReferenceAlias ; EVENTS Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer) If akDestContainer ; Gem was placed in container Return EndIf If akItemReference ; According to JustChill Gem was dropped. In some circumstances this could still fill if the gem was removed by the game. Sould be fully tested. Return EndIf If CheckGems(akBaseItem) AddGem(GetReference()) EndIf endEvent Event OnInit() ; In some cases OnInit() will fire more than once and it can make a mess with some scripts. I do not think it will fire here twice on a start game enabled quest. Even if it dose it will have no negative impact on the script. No need for a state. Int i While i < 5 AddInventoryEventFilter(SoulGemArray[i] As Form) i += 1 EndWhile endEvent ; EVENTS END ; FUNCTIONS START Function AddGem(ObjectReference P) Form G = FindGem() int GC = P.GetItemCount(G) If GC If GC > 1 P.RemoveItem(G, GC - 1, true) EndIf Else P.AddItem(G, 1, True) EndIf EndFunction Form Function FindGem() If numSiraFillCounter.GetValue() > 49 numSiraFillCounter.setValue(0) Return _00E_WishWell_FrostcliffTavern_BrokenSoulgem As Form Else Return _00E_YerosCave_SiraSoulbender As Form EndIf EndFunction Bool Function CheckGems(Form G) ; Make sure the item removed is one of the Gems. Int i While i < 5 If G == SoulGemArray[i] As Form Return True EndIf i += 1 EndWhile EndFunction ; PROPERTIES START SoulGem Property _00E_YerosCave_SiraSoulbender Auto SoulGem[] Property SoulGemArray Auto GlobalVariable Property numSiraFillCounter Auto MiscObject Property _00E_WishWell_FrostcliffTavern_BrokenSoulgem Auto ; PROPERTIES END Great Job!! :thumbsup:
  22. Event OnActivate(ObjectReference akActionRef) If akActionRef == game.getplayer() Game.RequestSave() ;or ;Game.RequestAutoSave() EndIf EndEvent https://www.creationkit.com/index.php?title=Game_Script
  23. Are you suggesting that I posted a de-compiled script here? I would not use someone else's work without crediting them. The script I wrote for JustChill was written from scratch. I hope you were talking about someone else. In that case I certainly agree doing that without crediting them and getting their permission is not acceptable.
  24. The first thing someone would suspect is the OnLoad() event is simply not firing evenly on all of the NPCs. If you used oncellattach() you could use a function to make sure the NPC was fully loaded. While !Is3DLoaded() Utility.Wait(0.3) EndWhile This is not something I have ever dealt with before.
  25. Hey JustChill, All you need is P = GetReference() You have made a property of the exact property your script is on. Your script extends the Alias. You should not have shut down the state. In order to do that you will need to change the event to Event OnInit(). You would do that after testing. Did you fully test the script on the player? The errors you are getting seem to be saying none of the properties are filled. Did you fill the properties of the script?
×
×
  • Create New...