Jump to content

ReDragon2013

Members
  • Posts

    640
  • Joined

  • Last visited

Everything posted by ReDragon2013

  1. I finally go through the papyrus source code and I was really astonished about this construct Function Update_HAC_Spells(Spell akSpell) string s = akSpell.GetName() ; get the spell name as string StorageUtil.SetFormValue(None, s, akSpell as Form) ; Make sure that the spell name string is mapped to the correct formid StorageUtil.StringListAdd(None, "HAC_Spells", s, False) ; Add a new spell name to stringlist with allowdupes == FALSE EndFunction(1) Next code line makes no sense, should be removed! StorageUtil.SetFormValue(None, s, akSpell as Form) ; Make sure that the spell name string is mapped to the correct formid(2) We know its not possible to have a duplicated spell by creation process, so we take the default value StorageUtil.StringListAdd(None, "HAC_Spells", s) ; Add a new spell name to stringlist with allowdupes == TRUEversion 10 with threading For race specific spells, you have to create a formlist which has the vanilla spells. If DLCs or other mods should have such spells you can look for mod loaded by GeFormFromFile() and add such spell to list on the fly by using this https://www.creationkit.com/index.php?title=AddForm_-_FormList Sometimes it makes a different in runtime to use Utility.Wait() in functions and/or events. (3) maybe its faster to use this SKSE native spell function instead to get the MagicEffect of spell and check for ME.castingtype() ; return the base magicka cost of the spell int Function GetMagickaCost() native
  2. version 9 like Sphered gave us the hint. https://www.creationkit.com/index.php?title=GetNthSpell_-_Actor About version 8:
  3. Like Sphered wrote anything to reduce the spell array entries and is fast in runtime would speed up your stringlist creation. You wrote: "And I can't for the life of me figure out why....." Not every script change is always the way in the right direction. As you know "Trial and Error" is the way to go. So I was thinking about my theory in version 6 and 7 and come to this. version 8 consists of 3 scripts its70_PlayerAliasGlobal its70_PlayerAliasScriptExtender its70_PlayerAliasScript
  4. I changed the code from version 6 and add to the same posting of mine version 7.
  5. I do not have any experience with skyui event management. suggestion version 6a What is new? Try to get speed up by using two threads to create the final stringlist, required more conditions, more code and more script variables Be warned it's an approach, not fully tested! In theory we could run three threads at time without using "futures or callbacks". https://www.creationkit.com/index.php?title=Creating_Multithreaded_Skyrim_Mods suggestion version 7 required some debugging to calculate the right counter conditions for the loops !!
  6. suggestion version 5 What is new? - OnSpellLearned() got own thread handling - You should try, if its useful to make "string s" as script variable instead of function variable! - The conditions in main loop has been changed. Maybe useful for speed up!
  7. as Sphered wrote: this code int i i = i + 1do the same as next code int i i += 1BUT, what is better to understand? Keep in mind there is no different in papyrus executable script. wiki link: https://www.creationkit.com/index.php?title=Statement_Reference version 3 for code optimization version 4 for studying, it is creating the formlist first and the stringlist after
  8. (1) Keep in mind: If I rewrite the papyrus code I thought something about it. My version do the same, but is faster code. If (akSpell) && akSpell.GetNthEffectMagicEffect(0).GetCastingType() ; get the first MagicEffect of the spellyour version If (akSpell) && akSpell.GetNthEffectMagicEffect(0).GetCastingType() > 0 ; get the first MagicEffect of the spell(2) about event handling, try this: (3) Its surely faster to store only one formlist like "HAC_SpForms" and create a temporary Stringlist like "HAC_Spells" on th fly, if its recomended by MCM menu. But without to see code dependencies its a hint only.
  9. IA710 wrote: "Any suggestions are welcome." Maybe you remember to an older MCM posting, I wrote similiar 'use functions to separate code and reduce redundancy'. I think the use of "HAC_PlSpellForms" does not make sense. Link to storageutil papyrus source: https://github.com/Vicyntae/SCLSE/blob/master/Data/Source/Scripts/StorageUtil.psc My optimizations as follow:
  10. Hmm.. to get them work you have to change the script from extending objectReference into actor (I edited my previous posting)! But that is out of "good coding practice" for the player or any other unique vanilla actor. https://www.creationkit.com/index.php?title=OnObjectEquipped_-_Actor So we have to change the whole script as follow. https://www.creationkit.com/index.php?title=OnEquipped_-_ObjectReference colo_FluidAnimationScript v2
  11. or this way by using google search "skyrim OSA" you'll find https://www.nexusmods.com/skyrim/mods/76744?tab=files download the archive: OSA-Plus Preview 1
  12. (1) you wrote: "I'm VERY NEW to scripting." Well.. a reason, but no thank you or any other good sign of you. I am really disappointed, in older days your postings were called "script kiddies"! original scriptnames DF_Script_Trophy_Base.psc DF_Script_Trophy_Misc.psc DF_Script_Trophy_Activator.pscmy scriptnames wilw_Trophy_Base.psc wilw_Trophy_Misc.psc wilw_Trophy_Activator.psc (oRef as wilw_Trophy_Activator).myF_Init(i) ; <-- By changing script name adjust here !!!your scriptnames cg_Trophy_Base.psc cg_Trophy_Misc.psc cg_Trophy_Activator.psc (oRef as cg_Trophy_Activator).myF_Init(i) ; <-- By changing script name adjust here !!!(2) you wrote: "how do i make a spoiler tag" Did you have a brain? If yes, use an internet web searcher or the forum search function (right on top).
  13. DF_Script_Trophy_Activator wilw_Trophy_Activator Advantage you do not have to deal with a lot of "X axis position of the X-Marker".
  14. Sometimes its a good idea to use spoiler tags and its always fine to post a link where to find the original scripts. Keep it in mind! mod: "Ressource Pack" made by Darkfox127 https://www.nexusmods.com/skyrim/mods/79519?tab=files video: "Creation Kit (Custom Trophy Stands)", How to create multiple trophies? https://www.youtube.com/watch?v=-4igxAUcJ3A The trophy creation is using next three scripts. 1 - DF_Script_Trophy_Base.psc 2 - DF_Script_Trophy_Misc.psc 3 - DF_Script_Trophy_Activator.pscAt first do not use the scriptnames (from above) provided by ressource pack. Make it unique enough like next: wilw_Trophy_Base.psc wilw_Trophy_Misc.psc wilw_Trophy_Activator.pscNow I changed the original scripts in some code parts to make it easier to handle. You have to use an array and also to create a formlist. DF_Script_Trophy_Base wilw_Trophy_Base DF_Script_Trophy_Misc wilw_Trophy_Misc
  15. As Sphered already mentioned: What ever you do, do never use x, y or z as variable or property names within scripts of type objectreference! Its caused by vanilla script "ObjectReference.psc", so the papyrus compiler handles x as self.X etc.
  16. while (i >= 0) ;;; Schedule = BB_ActiveSchedules.GetAt(0) As Quest ; you code line quest q = BB_ActiveSchedules.GetAt(i) As Quest referenceAlias RA = q.GetAlias(0) As ReferenceAlias IF ( RA ) RA.Clear() ENDIF i = i - 1 endwhilejust another approach by using array
  17. The question is a) one baseobject "Trophy_Item" or b) 21 different baseobjects with 21 markers to place a single trophy? MiscObject Property Trophy_Item Auto{This is the item created by the crafting menu which triggers these events. This is the item this script is attached to.} And are the GlobalVariables used within these two scripts only? GlobalVariable Property Global_Trophy_Placed_0x Auto{The trophy global for the trophy base to know if a trophy is already in place.}
  18. I would suggest next code for this script. Keep in mind the script "DLC2ReferenceAliasArrayScript" has the same bug! DLC1ReferenceAliasArrayScript
  19. Unfortuantely papyrus script language is not always very easy to understand. Very often is an 'improvement' of vanilla scripts, a step forward to get runtime errors with improved version. But here we have a papyrus compiler bug. https://web.archive.org/web/20200216210550/http://forums.bethsoft.com/topic/1610844-ckse-persisting-script-engine-bugs/ THHIS BUG WAS NEVER SOLVED by any release of UNOFFICIAL PATCHES! Inci wrote (2016-Nov-01): "The compiler for SSE is still unable to properly manage temporary variables, when it compiles a nested function call inside an array index evaluation. Such a statement is compiled in a way, which causes temporary variable corruption during execution. This is the issue of 'myArray[myArray.Find(none)] = newValue' not working properly (although the same issue would actually affect a larger range of possible cases). Unfortunately, as the forum search functionality is still unavailable, I am unable to find and link to the thread, where this was originally discussed." DLC1ReferenceAliasArrayScript (vanilla code) DLC1ReferenceAliasArrayScript (Usleep version) DLC1ReferenceAliasArrayScript (subhuman version)
  20. https://www.creationkit.com/index.php?title=PlayAnimation_-_ObjectReference You wrote: "I ask for help from those who understand scripts and can write a simple script, the animation on IdleMarker should play for example (1 minute), then the character accepts its standard Idle animation." Its not as simple as you think. You have to save the actor who is doing the animation related to IdleMarker. Now the script has to wait for each actor 60 seconds and then a stop animation has to be called to revert the actor to normal behavior. Best way would be to create a new spell (fire and forget) with a script on magic effect. lis8IdleMarkerMGEFScript What is the problem? I do not know how to cast the spell on the actor. You do not tell us with your post, what have you done to make the actor to interact with the idlemarker. In the same interaction you should cast the spell on the actor.
  21. You wrote: "I want to create a script based magic effect, and then be able to access that script effect so I can call functions from it." Depends on: 1. count of actors be involved by this kind of magic effect 2. content of function code to run here there are various ways to come along with. A simple way would be the use of a GlobalVariable with different values, which makes the magic effect to do somethings depends on value. A script of type activemagiceffect do not have "really" a self on it! So there is no way to call functions here from other scripts like external function call, as well as property get or set. But you can use OnUpdate() to wait for and respond of the value from a GlobalVariable. In other scripts you set the value to force action in the base magic effect. zorakConstantMGEFScript
  22. mod: "Lawbringer" v1.3.0.2 by EpicCrab https://www.nexusmods.com/skyrimspecialedition/mods/29882 MLQ_LCOQuestScript Without a specific error line its impossible to say what kind of code is throwing the errors. So I have the script partly rewritten. If you want to compile next source keep in mind I do not added the single function from original script. Maybe the mod needs this function getControllerIndex() to work properly. MLQ_LCOQuestScript
  23. Keep in mind EquipItem() is for actors only. Your script is extending to type ObjectReference, that could be the reason why you are adding/using this: Actor Property MySelf Auto avid_FollowerEquipScript
  24. You wrote: "any thoughts would be welcome" I think you should split your function in subfunctions to get a better overview. In my opinion the "Adventurer_Array" is wrong initialized! maybe next code is useful to you
  25. You wrote: "I am trying to make a lesser power" This kind of scripting is called cheating. Nothing more to write.
×
×
  • Create New...