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

Ghaunadaur

Allies
  • Posts

    57
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Ghaunadaur

  1. Did you verify that the script .pex file is on the second computer as well? Just a guess.
  2. Hello, here is my homework for papyrus class #1. This is the script I used: *Script removed - Please send PM*
  3. Hello Wayoftzu, maybe I can help you with that script or at least with some parts of it. That's the easy part. In this case the script will extend Actor. Just remember to give it a unique name, in this example I simply called it '_test'. A bit more complicated. Using the event OnLocationChange will cause the script to react on that whenever the follower enters or leaves a location, so we need to check if the follower actually enters a dungeon, mine or such. Of course you could just add properties for all the locations to check for, but that would end up in a very large property list. For that reason I suggest to check for the keywords that are attached to the locations. And to make things even more complicated, put them in a formlist. The advantage of a formlist, you can add or remove keywords without changing anything to the script. - In Misc -> Formlist, create a new formlist. - Select the keyword category and filter for loc*. - Drag & drop the relevant keywords into the formlist, I think 'LocTypeDungeon' is the most important. After you created the formlist, use the following script on the actor and compile it. Scriptname _test extends Actor Spell Property CandleLight auto MagicEffect Property LightFFSelf auto Formlist Property LocationTypeList auto Event OnLocationChange(Location akOldLoc, Location akNewLoc) int i = LocationTypeList.GetSize() While i > 0 i -= 1 if akNewLoc.HasKeyword(LocationTypeList.GetAt(i) as Keyword) if !HasMagicEffect(LightFFSelf) && IsInInterior() Utility.Wait(2.0) CandleLight.Cast(self) i = 0 ; debug.messagebox("Candlelight was cast") endif endif EndWhile EndEvent One thing left to do, filling the properties. For that, open the 'properties' window. Ideally you named the formlist property in the script equal to the formlist object in Creation Kit, or vice versa. If you did so, you can just hit the button 'auto-fill all' and you're done, otherwise use the dropdown list to the right. I hope it helps.
  4. Welcome to the forums, d18, here's a welcome cookie for you: The issue with the second script is probably this line TreeRef = akActionRef.GetBaseObject() ObjectReference akActionRef is the reference that activated the tree, not the tree that was activated. Most likely it's the player, so the condition will never become true. The function should be called on 'self' and you also need GetReference() to retrieve the reference of the alias. TreeRef = self.GetReference().GetBaseObject()
  5. Um, without actually looking at it, I can only guess. It's unlikely, but make sure those objects don't have an enable parent assigned. Also double check the properties if they are filled with the correct values. Test with a save you made without your mod activated. That's all I can think of atm.
  6. I think the variables need to be defined outside the event block. Now this should compile without errors. ScriptName aaDSoSRandomComboLock extends ObjectReference {Adds a functional 9-button combo lock in game to unlock secret locations or unlock/open gates, etc. Requires 9 buttons of any type, in a T9 keypad configuration, as such: 123 456 789} Import Game Import Utility Import Debug ;Top Buttons ObjectReference Property Button1TopLeft Auto ObjectReference Property Button2TopCenter Auto ObjectReference Property Button3TopRight Auto ;Middle Buttons ObjectReference Property Button4MiddleLeft Auto ObjectReference Property Button5MiddleCenter Auto ObjectReference Property Button6MiddleRight Auto ;Bottom Buttons ObjectReference Property Button7BottomLeft Auto ObjectReference Property Button8BottomCenter Auto ObjectReference Property Button9BottomRight Auto ;Top Buttons GlobalVariable GlobalVariable Property Button1TopLeftGBLVAR Auto {Button GlobalVariables MUST be scripted on all buttons! OnActivate(MyButton) GlobalVariableName.SetValue(1) or whatever!} GlobalVariable Property Button2TopCenterGBLVAR Auto GlobalVariable Property Button3TopRightGBLVAR Auto ;Middle Buttons GlobalVariable GlobalVariable Property Button4MiddleLeftGBLVAR Auto GlobalVariable Property Button5MiddleCenterGBLVAR Auto GlobalVariable Property Button6MiddleRightGBLVAR Auto ;Bottom Buttons GlobalVariable GlobalVariable Property Button7BottomLeftGBLVAR Auto GlobalVariable Property Button8BottomCenterGBLVAR Auto GlobalVariable Property Button9BottomRightGBLVAR Auto ObjectReference Property Light01 Auto {A light in front of each button to let the player know what button they have selected already.} ObjectReference Property Light02 Auto ObjectReference Property Light03 Auto ObjectReference Property Light04 Auto ObjectReference Property Light05 Auto ObjectReference Property Light06 Auto ObjectReference Property Light07 Auto ObjectReference Property Light08 Auto ObjectReference Property Light09 Auto ObjectReference Property HintObject01 Auto {Gives the player a hint for the button combo required. Best when placed AWAY from the Main buttons. This is NOT necessary to have, however since the button combos are randomly generated each time this is recommended!} ObjectReference Property HintObject02 Auto ObjectReference Property HintObject03 Auto ObjectReference Property HintObject04 Auto ObjectReference Property HintObject05 Auto ObjectReference Property HintObject06 Auto ObjectReference Property HintObject07 Auto ObjectReference Property HintObject08 Auto ObjectReference Property HintObject09 Auto int MyRunCheck1 int MyRunCheck2 int MyRunCheck3 Bool RandNum01 Bool RandNum02 Bool RandNum03 Bool RandNum04 Bool RandNum05 Bool RandNum06 Bool RandNum07 Bool RandNum08 Bool RandNum09 int CorrectAttempt int MyRandNum1 int MyRandNum2 int MyRandNum3 int WrongAttemptCnt ;How many times has the Player choosen the wrong button? Spell Property WrongAttemptSpell Auto {The spell to cast at the player after the Wrong Attempts} ObjectReference Property SpellSource Auto {The Source that will cast the Spell} Event OnInit() RegisterForSingleUpdate(5.0) EndEvent Auto State Initialize Event OnInit() ;Randomize and Select 3 buttons for the button combo if MyRunCheck1 == 0 MyRandNum1 = RandomInt(1, 9) if MyRandNum1 == 9 RandNum09 = True ElseIf MyRandNum1 == 8 RandNum08 = True ElseIf MyRandNum1 == 7 RandNum07 = True ElseIf MyRandNum1 == 6 RandNum06 = True ElseIf MyRandNum1 == 5 RandNum05 == True ElseIf MyRandNum1 == 4 RandNum04 == True ElseIf MyRandNum1 == 3 RandNum03 == True ElseIf MyRandNum1 == 2 RandNum02 == True ElseIf MyRandNum1 == 1 RandNum01 == True EndIf Notification("My 1st Number Picked is: " + MyRandNum1) MyRunCheck1 + 1 EndIf if MyRunCheck2 == 0 MyRandNum2 = MyRandNum1 While MyRandNum2 == MyRandNum1 MyRandNum2 = RandomInt(1, 9) EndWhile if MyRandNum2 == 9 RandNum09 = True ElseIf MyRandNum2 == 8 RandNum08 = True ElseIf MyRandNum2 == 7 RandNum07 = True ElseIf MyRandNum2 == 6 RandNum06 = True ElseIf MyRandNum2 == 5 RandNum05 == True ElseIf MyRandNum2 == 4 RandNum04 == True ElseIf MyRandNum2 == 3 RandNum03 == True ElseIf MyRandNum2 == 2 RandNum02 == True ElseIf MyRandNum2 == 1 RandNum01 == True EndIf Notification("My 2nd Number Picked is: " + MyRandNum2) MyRunCheck2 + 1 EndIf if MyRunCheck3 == 0 MyRandNum3 = MyRandNum2 While (MyRandNum3 == MyRandNum2) || (MyRandNum3 == MyRandNum1) MyRandNum3 = RandomInt(1, 9) EndWhile if MyRandNum3 == 9 RandNum09 = True ElseIf MyRandNum3 == 8 RandNum08 = True ElseIf MyRandNum3 == 7 RandNum07 = True ElseIf MyRandNum3 == 6 RandNum06 = True ElseIf MyRandNum3 == 5 RandNum05 == True ElseIf MyRandNum3 == 4 RandNum04 == True ElseIf MyRandNum3 == 3 RandNum03 == True ElseIf MyRandNum3 == 2 RandNum02 == True ElseIf MyRandNum3 == 1 RandNum01 == True EndIf Notification("My 3rd Number Picked is: " + MyRandNum3) MyRunCheck3 + 1 EndIf ;Need a fail-safe incase of a duplicate number. Duplicate Numbers are/could be BAD!!! ;if MyRandNum1 == MyRandNum2 || MyRandNum1 == MyRandNum3 ;|| MyRandNum2 == MyRandNum1 || MyRandNum2 == MyRandNum3 || MyRandNum3 == MyRandNum1 || MyRandNum3 == MyRandNum2 ;Notification("A number was matching with another") ;Else ;Notification("No Matching Numbers!") ;EndIf if RandNum01 == True HintObject01.Enable() EndIf if RandNum02 == True HintObject02.Enable() EndIf if RandNum03 == True HintObject03.Enable() EndIf if RandNum04 == True HintObject04.Enable() EndIf if RandNum05 == True HintObject05.Enable() EndIf if RandNum06 == True HintObject06.Enable() EndIf if RandNum07 == True HintObject07.Enable() EndIf if RandNum08 == True HintObject08.Enable() EndIf if RandNum09 == True HintObject09.Enable() EndIf Wait(3.0) ;Give 3 seconds to ensure that all HintObjects and other stuff has been completed. GoToState("Waiting") EndEvent EndState State Waiting Event OnUpdate() ;Combo Buttons stuff here if RandNum09 == True && Button1TopLeftGBLVAR.GetValue() == 1 Light09.Enable() CorrectAttempt + 1 ElseIf RandNum09 == False && Button1TopLeftGBLVAR.GetValue() == 1 WrongAttemptCnt + 1 EndIf If RandNum08 == True && Button2TopCenterGBLVAR.GetValue() == 1 Light08.Enable() CorrectAttempt + 1 ElseIf RandNum08 == False && Button2TopCenterGBLVAR.GetValue() == 1 WrongAttemptCnt + 1 EndIf ;Wrong Attempt Stuff if WrongAttemptCnt == 3 WrongAttemptSpell.Cast(SpellSource,GetPlayer()) WrongAttemptCnt = 0 EndIf EndEvent EndState
  7. Ok, I have an idea. Maybe someone can come up with a better solution, but you could give this a try: (Only posted the relevant parts of the script) if MyRunCheck2 == 0 int MyRandNum2 = MyRandNum1 While MyRandNum2 == MyRandNum1 MyRandNum2 = RandomInt(1, 9) EndWhile if MyRandNum2 == 9 RandNum09 = True .... The variable MyRandNum2 is initialized with a value equal to MyRandNum1 to ensure that the while loop runs at least once. The loop will run as long as both variables have the same value. If it's different, the script continues. Similar for the third random value, only with a change of the condition to check for MyRandNum1 and MyRandNum2: if MyRunCheck3 == 0 int MyRandNum3 = MyRandNum2 While (MyRandNum3 == MyRandNum2) || (MyRandNum3 == MyRandNum1) MyRandNum3 = RandomInt(1, 9) EndWhile if MyRandNum3 == 9 RandNum09 = True ....
  8. For the properties 'PlayerRef' and 'XMarkerHeading' just hit the auto-fill button.
  9. There are probably several ways to do this. I would make two states in the script, the first state to teleport to the 'TeleportLocation', the second to return to the original location. For the delay, WaitMenuMode would be better in this case I believe, because the game is in menu mode while a book is opened. You could try with this script: ScriptName YourScriptName extends ObjectReference ObjectReference Property TeleportLocation auto Message Property ChoiceMessage auto Static Property XMarkerHeading auto ObjectReference ReturnMarker Actor Property PlayerRef auto auto State TeleportState Event OnRead() Utility.WaitMenuMode(1.0) int choice = ChoiceMessage.Show() if (choice == 0) ; do nothing elseif (choice == 1) ReturnMarker = PlayerRef.PlaceAtMe(XMarkerHeading, 1) PlayerRef.MoveTo(TeleportLocation) GotoState("ReturnState") endif EndEvent EndState State ReturnState Event OnRead() Utility.WaitMenuMode(1.0) int choice = ChoiceMessage.Show() if (choice == 0) ; do nothing elseif (choice == 1) PlayerRef.MoveTo(ReturnMarker) ReturnMarker.Delete() GotoState("TelePortState") endif EndEvent EndState
  10. Hail and welcome, Stubbkrossen. Have a and a , Skol!
  11. DsoS is right, just a small addition. You can't name a property 'Location', because that's a property type. Name it 'TeleportLocation' or something like that.
  12. || http://www.creationkit.com/Operator_Reference
  13. Yes, that's the plan. People here will feed you with cookies until you are fat like a horker, and then....anyway, welcome....and please eat this: :cookie4u:
  14. Hi, I put a small script together. It should work, but will require SKSE. ScriptName InsertScriptNameHere extends ObjectReference MiscObject Property gold001 auto Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer) if GetNumItems() == 0 Game.GetPlayer().RemoveItem(Gold001, 100) endif endEvent
  15. Hi, Logik. Have a welcome cookie or two.
  16. Try using GetItemCount to get the accurate number. int num = Game.GetPlayer().GetItemCount(aBleakItems) Game.GetPlayer().RemoveItem(aBleakItems, num , false, StorageChest)
  17. I agree with WillieSea, the script looks overly complicated, makes it hard to track. Besides that, I can't see any major issues with it. Maybe the problem is not with the script itself. Did you make sure that the objects stage1, 2 , 3, 4 are set to 'initially disabled' and that they don't have an 'enable parent' ? Objects with an enable parent can't get script enabled or disabled. Just a guess.
  18. I don't see how this script could work on all spells. There are many spells that don't deal any damage, for example. However, a different value for the property can be assigned for each instance of the script. That's the good thing about properties.
  19. Hello, you can get the magicka cost of a spell by using this function int magickacost = SpellName.GetMagickaCost() which will return the base cost of the spell, or this function int magickacost = SpellName.GetEffectiveMagickaCost( c) to get the effective cost. In addition, you will need to make a spell property for what I called SpellName in this example. Note that these are SKSE functions.
  20. I was assuming this too. Since it's a cell from the vanilla game there may be several factors influencing the ownership. The cell has a default ownership of 'None' and it gets changed to 'PlayerFaction' by a script of the quest 'HousePurchase'. That's what I know, but there may be other things. To check this, I put a small debug script on the container to show me the ownership of container and cell in game. faction contowner = self.GetFactionOwner() faction cellowner = self.GetParentCell().GetFactionOwner() debug.messagebox("CONT: "+contowner+ " - CELL: "+cellowner) Result: 00000DB1 = PlayerFaction, so this seems to be correct. I also made a new cell to test in a non-vanilla environment, but it's the same. If I leave the cell's ownership to 'None', it works. The ownership changes as soon as the item is dropped out of the container, not before and not after. So I'm quite sure it has something to do with that function. Yes, that would be a possible workaround, but as you stated, it will cause the opposite problem. Maybe I could use GetActorOwner() and GetFactionOwner() to check the ownership. Sadly, the CK Wiki says that GetActorOwner function is possibly broken and always returns 'None'. I'll need to test it. Thank you for the suggestion. EDIT This seems to be a known issue: http://forums.bethsoft.com/topic/1424878-problem-scripped-dropped-item-changes-ownership/
  21. Thanks for the reply. Normally the parameter abSilent needs to be set to 'false' to give a notification, but I don't think it matters in this case. RemoveItem will only show a notification if used on the player anyway. I would have to make a notification message for each item that I want to be removed from the container. That would be a bit tedious, so I will leave it without notification, maybe make a single message for all. The main problem is with the DropObject function. Of course I'm testing with a clean save, without any mods activated. I also tested with different items, some found in game, some added via console command. The ownership of the container and the cell are as described above. It's always the same, when dropped out of the container, the items are flagged as stolen. Maybe DropObject is supposed to work this way, but I couldn't find any information about it. Or maybe it's just a bug?
  22. Hello all, I encountered a strange problem today. This is the scenario: I have an activator, when activated, an item is removed from the player inventory and transferred to an invisible container. Using this function: PlayerRef.RemoveItem(ItemRef, 1, false, ContainerRef) Activated for the second time, the item is dropped out of the container and added to the inventory again. This is the code to make this happen: ObjectReference myRef = ContainerRef.DropObject(ItemRef) PlayerRef.AddItem(myRef) This works fine, but the problem is that the item now is marked as stolen and I have no idea why. The container is actually a duplicate of the PlayerBookshelfContainer. The ownership is set to 'None' so it should inherit the ownership of the cell, which is 'PlayerFaction'. I also tried ContainerRef.RemoveItem(ItemRef, 1, false, PlayerRef) This works correctly. The downside of this, there's no notification that the item is added to player again. I really would like to use the DropObject/AddItem method, so if someone has an idea why the ownership of the item gets messed up and how to prevent this, I'd be very thankful.
  23. According to CK Wiki, it will remove one of each items, if the player has one of it.
  24. Did you make markers visible? This can be toggled either in show/hide window or with the 'M' key.
  25. I doubt this will work. To cast an objectreference to an integer or vice versa is simply not possible. You will get an error from the compiler "types are incompatible...".
×
×
  • Create New...