Jump to content

dylbill

Premium Member
  • Posts

    1493
  • Joined

  • Last visited

Everything posted by dylbill

  1. So, a few things to be aware of working with script fragments. 1. Before doing anything, put only a semicolon ; in the fragment and then compile. This will initialize and link the script fragment to your dialogue, quest or what have you. 2. Only add or remove properties with the creation kit, not in the source script directly. 3. Renaming the script fragment is a good idea, but again only do this in the creation kit, there's a button that allows you to rename the script fragments. I would completely delete your dialogue in the creation kit and delete the script (source .psc and .pex files) and redo it with this in mind.
  2. If you're trying to kill Marious, you should have Actor Property Marious Auto. Kill is the function and should not be a property. You also have the Kill property twice which is why you get the "script property Kill already defined" error, but as I said it shouldn't be a property at all.
  3. What does your script extend? If it extends Actor, you should be able to use just StartCombat(game.getPlayer()) If your script extends ReferenceAlias though, you would have to do something like GetActorReference().StartCombat(game.getPlayer()) Basically StartCombat must be used on an actor.
  4. Looks like that uses the ActorValueInfo script, which I think is only for the player as I don't see a way to call it on other actors. Here's an example though: Event OnInit() ActorValueInfo aVI = ActorValueInfo.GetActorValueInfobyName("OneHanded") Float exp = aVI.GetSkillExperience() aVI.SetSkillExperience(exp + 20.0) ;add 20 exp to OneHanded skill EndEventCheck out this wiki on how to get more ActorValueInfos https://www.creationkit.com/index.php?title=ActorValueInfo_Script
  5. You can put a script directly on the bandit chief and use the OnDeath event: Scriptname BanditChiefScript extends Actor Quest Property MyQuest Auto Event OnDeath(Actor akKiller) If akKiller == Game.GetPlayer() MyQuest.SetStage(20) Else ;player didn't kill the bandit chief, do something different here Endif EndEvent Change the script name to something more unique for you mod.
  6. First you define your struct, then you can pass that specific struct type to a function: Struct SomeStruct int A = 1 int B = 2EndStruct Function MyFunction(SomeStruct MyStruct) EndFunction
  7. No problem. I do know that miscUtil.writetofile does work, as I've used it in some of my mods. Off the top of my head, My mod MCM Creator comes to mind: https://www.nexusmods.com/skyrimspecialedition/mods/45647 Source code is provided. If your script is compiling it should work. Make sure you also have all requirements installed as well. SKSE and Address Library if you're working with Skyrim Special Edition.
  8. Looks like that should be working. Make sure you're looking in the right folder for the file. I don't remember where the default folder is for WriteToFile, but It's either the Skyrim root folder or the Data folder. If you can't find it, try first creating an empty CoolDebug.txt file first before running the code and see if that helps.
  9. Hello, just adding my 2 cents. Instead of using a while loop to count, try just using intGems = Game.GetPlayer().getItemCount(1stGems) According to the wiki page if passing in a form list to getItemCount, it will count how many of each item in the form list is in the container and sum it all up. https://www.creationkit.com/index.php?title=GetItemCount_-_ObjectReference Note I haven't tested it, and it might not work for you because you're using object references in the form list, but it's worth a shot.
  10. Yes, in the creation kit, you can put conditions on message buttons. When the message is opened via script using MyMessage.Show() only buttons whose condition evaluate to true will appear.
  11. Here's an example script that should get you started. Attach to a magic effect. It's a toggle, so when cast on an actor it either protects and adds the stuff or clears protection and removes the stuff. Scriptname MyMagicEffectScript extends ActiveMagicEffect Spell Property MySpell Auto Perk Property MyPerk Auto MiscObject Property MyItem Auto Event OnEffectStart(Actor akTarget, Actor akCaster) If akTarget.HasSpell(MySpell) akTarget.RemoveSpell(MySpell) akTarget.RemovePerk(MyPerk) akTarget.RemoveItem(MyItem, 1) akTarget.GetActorBase().SetProtected(False) Debug.Notification("Target is no longer protected") Else akTarget.AddSpell(MySpell) akTarget.AddPerk(MyPerk) akTarget.AddItem(MyItem, 1) akTarget.GetActorBase().SetProtected() Debug.Notification("Target is protected") EndifEndEvent
  12. I think the temp reference has to be persistent for the to work
  13. Math.Floor will work, or you can do String msg4 = (PlayerRef.GetValue(CarryWeightAV) As Int) You don't need to put As String as papyrus does this automatically. Putting As Int though is the same as Math.Floor
  14. Try this link too, maybe it works https://github.com/blu3mania/npp-papyrus Not sure why the other one didn't
  15. I personally use this for scripting: https://www.nexusmods.com/skyrimspecialedition/mods/43691/ although have used Papyrus Plus Plus as well.
  16. The one on Nexus is out of date. The current one is on github: https://github.com/blu3mania/npp-papyrus It includes paths for Skyrim LE, SE and Fallout 4
  17. You should only need to include scripts that you directly altered in your mod. The scripts you altered may reference other scripts, which is why you're seeing them updated when compiling, but you shouldn't include those scripts in your mod if you didn't directly alter them.
×
×
  • Create New...