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

jaxonz

Allies
  • Posts

    32
  • Joined

  • Last visited

  • Days Won

    1

jaxonz last won the day on November 27 2014

jaxonz had the most liked content!

jaxonz's Achievements

Apprentice

Apprentice (3/11)

3

Reputation

  1. Well, I'm not quite clear on what you are trying to accomplish, but I you should probably know that SetAngle, SetPosition and MoveTo functions can be buggy. TranslateTo is far more reliable.
  2. Hi there Matthias, I've read and reread your source code and can't seem to figure out what it is you are trying to accomplish. Perhaps if we start from there I could offer a code snippet that would work for you.
  3. I see you are using the Game.GetFormFromFile function to test for existence of DLC or any other mod. http://www.creationkit.com/GetFormFromFile_-_Game The example code you are using is actually set up to work with arrays and to test for any number of different mods. What you need to do in your mod is edit the properties and assign values for bDLCIsLoaded, iKnownFormID, and sDLCName. Alternatively, if you only want to check for Dawnguard, you could radically simplify the code code as follows: Bool Function CheckForDawnguard() If Game.GetFormFromFile(2048, "Dawnguard.ESM") return true EndIf EndFunction
  4. Looks like the Unlock command you are using is the same as one would use from command console. For Papyrus, you will need the ObjectReference of the door or container you are targeting. An easy way to get that is to use the SKSE function RegisterForCrosshairRef.... if you wish to allow distant unlocking, you will have to use a projectile in your spell and then call the Game.FindClosestReferenceOfTypeFromRef function to get the objectreference. The source code in my Positioner mod shows both methods if you need more detailed examples. See also: http://www.creationkit.com/Lock_-_ObjectReference http://www.creationkit.com/Locking_and_Unlocking_Doors
  5. Basically, the easiest thing to do is to use a pair of Markers one for each teleport destination. In your case, it sounds like one of the 2 markers will be stationary. Before you teleport the player to the desired destination, just move the marker to their position so that you know where to return them. As an example, here is the source from my Ethereal Ring mod: Scriptname JaxonzEtherealRing extends ObjectReference {Script supporting the JaxonzEtherealRing item.} ObjectReference property destWhereEquippedMarker auto ObjectReference property destWhereUnequippedMarker auto sound property soundTeleport auto Event OnEquipped(Actor akActor) ;move equipped marker to present location destWhereEquippedMarker.MoveTo(akActor) ;teleport player to unequipped marker location akActor.MoveTo(destWhereUnequippedMarker ) ;start FX, visuals from attached enchantment soundTeleport.Play(akActor) endEvent Event OnUnequipped(Actor akActor) ;move unequipped marker to present location destWhereUnEquippedMarker.MoveTo(akActor) ;teleport player to unequipped marker location akActor.MoveTo(destWhereEquippedMarker ) ;start FX, visuals from attached enchantment soundTeleport.Play(akActor) endEvent Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer) if akOldContainer && !akNewContainer ;ring dropped to the ground ;reset both markers to current location destWhereEquippedMarker.MoveTo(Game.GetPlayer()) destWhereUnEquippedMarker.MoveTo(Game.GetPlayer()) endIf endEvent Hope that helps.
  6. Wow! That's some really nice work. I'm sure I will be an eager subscriber to your mod. Also happy to pitch in if there's anything I can do from a scripting role.
  7. Hi there, I know you've had some feedback before on another thread and noticed you've had no replies on this one. You might take as a good example, this post http://tesalliance.org/forums/index.php?/topic/7076-wip-the-elders-island/ of how one might generate interest. In short, providing an example of your work in progress goes a long way toward getting people interested in your vision and proving you are a strong contributor. All the best.
  8. REALLY NICE WORK. From an architectural perspective, the consistent ceiling height throughout makes it seem a bit like an office building or budget motel. You've created some palatial areas here. Consider making the ceiling higher and more interesting in focal areas. Also an opportunity to break the rythm of all those columns. Yes, this would cause the distance between floors to increase. This presents an opportunity for more interesting stairs. Maybe spiral, or winding around an open shaft. Just a suggestion to help the spaces you've designed have the impact they deserve.
  9. If I were writing this code, I would use OnActorAction or OnPlayerBowShot to detect when arrows are fired and then create secondary arrows by casting a spell with the same arrow as the projectile. Example source code for detecting when player shoots a bow can be found in my Archery Perks mod http://www.nexusmods.com/skyrim/mods/53268 The trick with the spell will be to make sure to set the projectile type as Arrow. The default Missile type is not affected by gravity. Note that it may be tricky to get timing exact. The secondary arrows may follow slightly behind the original one. Also, since spells fire from a different location on the character model than do arrows shot from bows, the secondary arrows are not guaranteed to hit the same target (I think this is desirable). You COULD get a reference to the projectile shot by the bow (again, see the source code for Archery Perks... JaxonzArrowsGlowEffect.psc for how to do this), but there doesn't seem to be a method to create a projectile object instance that would match the trajectory and velocity of the original. Just my 2 cents. Good luck.
  10. Place the following line of code after the second Else statement in OnMenuClose: iTotalValueDiff = -1 * iTotalValueDiff This inverts the value difference if negative.
  11. Yep. Looks like I inverted the values for calculating the difference in total value. It should read: ;how much gold does the player have? int iTotalValueDiff = (objPlayer as Actor).GetGoldAmount() - iOldTotalValue
  12. OK, in toying with this I think I've actually developed the math you originally wanted. Here's an updated script: Scriptname JaxonzTestGetGold2 extends ReferenceAlias MiscObject Property frmGoldSeptim Auto MiscObject Property frmSilverSeptim Auto MiscObject Property frmCopperSeptim Auto MiscObject Property frmOriginalGold Auto ObjectReference Property objPlayer Auto int Property iGoldCoinValue = 100 Auto int Property iSilverCoinValue = 50 Auto int Property iCopperCoinValue = 1 Auto int iOldTotalValue Int iNumberGoldSeptims Int iNumberSilverSeptims Int iNumberCopperSeptims Event OnInit() RegisterForMenu("BarterMenu") RegisterForMenu("Training Menu") EndEvent Event OnMenuOpen(String MenuName) Debug.Trace("Converting coins to value") ;it really doesn't matter which menu we open... just convert all coins to native gold ;what's in inventory iNumberGoldSeptims = objPlayer.GetItemCount(frmGoldSeptim) iNumberSilverSeptims = objPlayer.GetItemCount(frmSilverSeptim) iNumberCopperSeptims = objPlayer.GetItemCount(frmCopperSeptim) iOldTotalValue = (iNumberGoldSeptims * iGoldCoinValue) + (iNumberSilverSeptims * iSilverCoinValue) + iNumberCopperSeptims ;remove the coins objPlayer.RemoveItem(frmGoldSeptim, iNumberGoldSeptims, True) objPlayer.RemoveItem(frmSilverSeptim, iNumberSilverSeptims, True) objPlayer.RemoveItem(frmCopperSeptim, iNumberCopperSeptims, True) ;replace with native Skyrim gold objPlayer.AddItem(frmOriginalGold, iOldTotalValue, True) EndEvent Event OnMenuClose(String MenuName) Debug.Trace("Converting value to coins") ;how much gold does the player have? int iTotalValueDiff = iOldTotalValue - (objPlayer as Actor).GetGoldAmount() ;make change for difference in gold value if iTotalValueDiff >= 0 ;same or more total value ;just add new coins of proper denomination iNumberGoldSeptims = iNumberGoldSeptims + iTotalValueDiff / iGoldCoinValue iNumberSilverSeptims = iNumberSilverSeptims + (iTotalValueDiff % iGoldCoinValue) / iSilverCoinValue iNumberCopperSeptims = iNumberCopperSeptims + iTotalValueDiff % iSilverCoinValue Else ;less total value if iNumberCopperSeptims >= iTotalValueDiff ;take the entire difference out in coppers iNumberCopperSeptims = iNumberCopperSeptims - iTotalValueDiff Else ;remove change in coppers iNumberCopperSeptims = iNumberCopperSeptims - iTotalValueDiff % iSilverCoinValue iTotalValueDiff = iTotalValueDiff - iTotalValueDiff % iSilverCoinValue if (iNumberSilverSeptims * iSilverCoinValue) >= iTotalValueDiff ;there is enough silver to cover entire value difference iNumberSilverSeptims = iNumberSilverSeptims - (iTotalValueDiff / iSilverCoinValue) Else iNumberSilverSeptims = iNumberSilverSeptims - (iTotalValueDiff / iSilverCoinValue) ;take everything we can out of silver, OK to go negative While iNumberSilverSeptims < 0 ;iterate making change in gold until we have 0 or more silver iNumberCopperSeptims = iNumberCopperSeptims + (iGoldCoinValue / iSilverCoinValue) ;assumes a gold coin value divides equally into silver coin value iNumberGoldSeptims -= 1 iTotalValueDiff = iTotalValueDiff - iGoldCoinValue EndWhile EndIf Endif EndIf ;remove Skyrim gold objPlayer.RemoveItem(frmOriginalGold, iOldTotalValue, True) ;replace with coins objPlayer.AddItem(frmGoldSeptim, iNumberGoldSeptims, True) objPlayer.AddItem(frmSilverSeptim, iNumberSilverSeptims, True) objPlayer.AddItem(frmCopperSeptim, iNumberCopperSeptims, True) EndEvent Notes: You can make the frmCopperSeptim and frmOriginalGold properties point to the same MiscObject if your mod replaces default gold. I left things as they were just in case you decide to use something different. It works both ways. I made the values of each coin properties. You can change them to whatever values you like and the script will still work. However, it does assume that the value of silver coins divides evenly into the value of gold coins (i.e., if iGoldCoinValue = 100, then iSilverCoinValue could equal 1, 2, 5, 10, 20, 25, or 50) Promoting the number of each coin to higher scope allows tracking the original total value and the number of each coin. The intent of this is to preserve the original number of each coin as much as possible. There is more complexity in the OnMenuClose routine so that change can be made. The logic is as follows:​​ If the player has the same or more money Add new coins of optimal denominations to those already existing If the player has less total money Take as much from copper coins as possible Then take as much from silver coins as possible Take gold coins last. If you look close, you will see that I found it easier to take the remainder out in silver, allowing for a negative number of coins, and then iteratively make change from gold until there were 0 or more silver. It compiles, but I don't have your mod installed so I haven't run the code. As I stated before, the more complex the math the greater the odds of something going wrong so you should thoroughly kick the tires on this. Addressing Ghaunadaur's point, you may want to register for other menu types that may exchange money. There is a list at http://www.creationkit.com/UI_Script#Valid_Menu_Names . However, I would NOT enable this for ContainerMenu, GiftMenu, or InventoryMenu as this would cause players to never see your special coins. Enjoy!
  13. Thanks Brett, I have the movement of mannequins already working today in my Positioner mod. What I'm trying to do is extend that capability without ending up with very complex code. http://www.nexusmods.com/skyrim/mods/52583 Someone else made a sort of warehouse companion mod where one can get furniture without stealing if from other locations. http://www.nexusmods.com/skyrim/mods/53813 And, although I haven't tried them yet, it seems that at least a couple mod allow the dynamic creation and movement of mannequins. http://www.nexusmods.com/skyrim/mods/10578/ http://www.nexusmods.com/skyrim/mods/8635/
×
×
  • Create New...