Jump to content
ℹ️ Intermittent Download History issues ×

fg109

Members
  • Posts

    1192
  • Joined

  • Last visited

Posts posted by fg109

  1. Change the enchantment's magic effect to a script archetype. Attach this script to it:

     

    Scriptname ExampleMEScript extends ActiveMagicEffect
    
    Spell Property Paralyze5SecsOnSelf Auto
    
    Event OnEffectStart(Actor akTarget, Actor akCaster)
    Paralyze5SecsOnSelf.Cast(akTarget)
    EndEvent

  2. I'm going to assume that the skull is the activate parent of your trap, and that's how your trap is triggered.

     

    Scriptname atestSkullText extends ObjectReference
    
    Message property box1 auto
    {Are you sure you want to dishonor the dead? Y/N}
    Message property box2 auto 
    {Fool! Leave my remains alone!}
    Message property box3 auto
    {Stop it or I will kill you}
    Message property box4 auto
    {Now you die!}
    
    Function TurnSkull(Float Angle = 180.0, Float Speed = 180.0)
    ;Angle = how many degrees to turn it clockwise (default 180)
    ;Speed = how fast to turn it in degrees per second (default 180)
    Angle += GetAngleZ()
    if (Angle > 180)
    	Angle -= 360
    elseif (Angle < -180)
    	Angle += 360
    endif
    TranslateTo(X, Y, Z, 0, 0, Angle, 1024.0, Speed)
    EndFunction
    
    Event OnCellAttach()
    StopTranslation()
    BlockActivation()
    SetMotionType(4)
    MoveToMyEditorLocation()
    GoToState("Waiting")
    EndEvent
    
    State Waiting
    Event OnActivate(ObjectReference akActionRef)
    	int choice = box1.Show()
    	if (choice == 0)	;the first choice
    		GoToState("Busy")
    		TurnSkull()
    		Activate(akActionRef, True)
    	endif
    EndEvent
    EndState
    
    State Busy
    Event OnActivate(ObjectReference akActionRef)
    	Debug.Notification("Still busy turning.")
    EndEvent
    
    Event OnTranslationComplete()
    	GoToState("Waiting")
    EndEvent
    EndState

  3. && means AND, || means OR

     

    So in the original script,

     

    if prereqStageOPT == -1 || preQuest.getStageDone(prereqStageOPT) == 1

    means "if prereqStageOPT is -1 (which means it was left at default, unchanged) or if preQuest has finished prereqStageOPT".

     

    In the modified script,

     

    if (prereqStageOPT == -1 || preQuest.getStageDone(prereqStageOPT) == 1) && (prereqStageOPT02 == -1 || preQuest02.getStageDone(prereqStageOpt02) == 1)

    means "if (the stuff from before) AND (the new stuff)".

     

    If both stages are from the same quest, and you only want to use one preQuest property, use this:

     

    f (prereqStageOPT == -1 || preQuest.getStageDone(prereqStageOPT) == 1) && (prereqStageOPT02 == -1 || preQuest.getStageDone(prereqStageOpt02) == 1)

  4. Like jet4571 says, I think that disabled objects would not affect the GPU at all, and will only affect the CPU if you happen to have a lot of them running scripts at the same time.

     

    For example, I just did a test with PlaceAtMe and Delete.

     

    I tried creating 5000 coins one at a time but after around 750 it slowed down and my game got really jerky. By 1000, it was only creating about 1 coin per second. Eventually, it froze my game before it got finished.

     

    Then I set the parameters for PlaceAtMe so that they spawned initially disabled and it worked, spawning coins at a constant rate the whole time.

     

    BTW, my results are that Delete works reliably, all 5000 of the coins got cleaned up.

  5. 1. Add a quest property for your second prerequisite quest (eg preQuest02).

    2. Add an int property for the prerequisite stage of preQuest02 (eg prereqStageOPT02) initialized to -1.

    3. Edit this line in the script:

     

    if prereqStageOPT == -1 || preQuest.getStageDone(prereqStageOPT) == 1

    to this:

     

    if (prereqStageOPT == -1 || preQuest.getStageDone(prereqStageOPT) == 1) && (prereqStageOPT02 == -1 || preQuest02.getStageDone(prereqStageOpt02) == 1)

  6. Scriptname kazanRotateSkull extends ObjectReference
    
    Auto State Waiting
    Event OnActivate(ObjectReference akActionRef)
    GoToState("Busy")
    SetMotionType(4)
    TranslateTo(X, Y, Z, 0, 0, akActionRef.GetAngleZ(), 1024.0, 15.0)
    EndEvent
    EndState
    
    State Busy
    Event OnTranslationComplete()
    GoToState("Waiting")
    EndEvent
    EndState

     

    This is assuming that the orientation of the skull is the same as the player. (EG if the player and the skull have the same Z angle, they are facing the same direction)

  7. You need to read up on properties.

     

    If that page doesn't make sense, basically you can't reference anything directly in a script. You have to create variables known as properties. You use these properties anywhere you want to reference anything. After you compile your script, you can edit the properties so that they point at what you want.

     

    Quest stage script fragments are actually functions in your quest's quest fragments script. You cannot use properties in your quest stage script fragment until you add it to the quest fragments script. If you don't have any quest stage script fragments yet, then you don't have a quest fragments script for your quest. So you should first compile a quest stage script fragment with just a semicolon ";" to generate the quest fragments script, add your properties to the quest fragments script, then edit the quest stage script fragment with your real code.

  8. To someone with experience in high volume data input, even with little modding experience, if they were given the right info (what phrase in scripts trggers the gifting of gold etc, specific instructions as to what to replace it with based on a consistent exchange i.e no rebalancing of the quest rewards) it wouldn't take that long. It would be boring, but not as time consuming as you might expect.

     

    You could do that... but there are lot a of instances where gold is given, and doing it that way won't account for quests from mods. I'd just rename gold to "copper", and put a script on the player to keep track of how much "copper" he/she has. For every 100 "copper" the player has, I'd automatically replace it with one "silver", and for every 100 "silver", replace it with one "gold".


    1.  
    2. It is possible to remove all vanilla abilites/diseases/spells and such from the player with a script.
    3. It is possible to remove all equipped spells from the player with a script.
    4. It is not possible to remove all non-vanilla abilities/diseases from the player with a script, even using SKSE.
    5. It is possible to remove the player's quest items via scripting.
    6. GetKnockedState is not part of the Papyrus scripting language.

  9. Regarding the larger problem, you can use AddForm to add a form to leveled item lists. There's the problem that the changes don't persist through game loads, but there is a way for detecting a newly loaded game on the same page under examples (courtesy of JustinOther).

     

    If they ever fix AddForm so that it persists through game loading, then this will no longer be a problem. If AddForm doesn't get fixed, then you can still exploit it to figure out when the game loads and to use AddForm on the lists you want again.

     

    Example Script:

     

     

    Scriptname Example extends Quest
    
    LeveledItem Property EmptyList Auto
    {An empty Leveled Item list that we use for the GetGameLoaded check.}
    
    ObjectReference Property EmptyContainer Auto
    {An empty container that we use for the GetGameLoaded check.}
    
    LeveledItem Property VanillaList Auto
    {The vanilla Leveled Item list that we want to add our custom item(s) to.}
    
    Form Property CustomItem Auto
    {The custom item that we want to add to VanillaList.}
    
    Int Property ReqLevel Auto
    {The level to add the custom item under in VanillaList.}
    
    Int Property ItemCount Auto
    {The number of the custom item to add in the VanillaList.}
    
    Event OnInit()
    RegisterForSingleUpdate(5)
    EndEvent
    
    Event OnUpdate()
    if (GetGameLoaded(EmptyList, CustomItem, EmptyContainer))
    	VanillaList.AddForm(CustomItem, ReqLevel, ItemCount)
    endif
    ;perform update loop every 5 seconds, forever
    RegisterForSingleUpdate(5)
    EndEvent
    
    Bool Function GetGameLoaded(LeveledItem akLeveledItem = None, Form apForm = None, ObjectReference akContainer = None)
    akContainer.AddItem(akLeveledItem, 1, True)
    If akContainer.GetItemCount(apForm)
    	akContainer.RemoveItem(apForm, akContainer.GetItemCount(apForm), True)
    	Return False
    Else ; Will only return 'True' once per save load
    	akLeveledItem.AddForm(apForm, 1, 1)
    	Return True
    EndIf
    EndFunction

     

  10. Event OnActivate(ObjectReference akActionRef)
    if akActionRef == PlayerRef
    	;do stuff
    endif
    EndEvent
    
    Actor Property PlayerREF Auto

     

    There's no way to filter the activation events to only fire depending on who/what is doing the activating.

  11. If you were going to set up your quest like the blacksmithing tutorial, you could do it. Well, I haven't taken a look at it, so I can only guess.

     

    The way to do it would be through an OnItemAdded event in a script placed on the player (through a reference alias perhaps).

     

    Then you would be able to test each item that gets added to see whether it's an iron dagger, and then whether or not it's been tempered. And when that happens, you set a flag on your quest to enable the dialogue that's supposed to happen when the player has a tempered dagger.

     

    Obviously, this could have a lot of problems such as exactly when you should fill the reference alias with the player, the impossibility of finding out whether or not the player already has a tempered dagger, etc...

     

    Actually, maybe there is a way. You could have a custom container somewhere, and when you need to check the player for a tempered dagger, you silently remove daggers from the player's inventory one at a time. The custom container would be scripted with the OnItemAdded event to check if any of the daggers have been tempered. Then after the process is over, all the items are silently added to the player again.

  12. Did you remember to set your properties? If you named your properties the same as the global variables, then you can just push the "auto-fill all" button.

     

    Something you might want to consider is that each city and each interior is its own world space, with its own set of coordinates.

  13. All code needs to be contained within functions or events. This is a working example of using IsKeyPressed:

     

    Scriptname Example extends Quest
    
    import Input
    
    Event OnInit()
    RegisterForSingleUpdate(0.1)
    EndEvent
    
    Event OnUpdate()
    if (IsKeyPressed(0x57))
    	Debug.MessageBox("You stopped the quest.")
    	Stop()
    else
    	RegisterForSingleUpdate(0.1)
    endif
    EndEvent

  14. This is possible, but it is a little complicated because of the notes on the UseMagic procedure.

     

    An additional complication that is not noted is that if an NPC evaluates to the same package twice in a row, he/she gets stuck until that package is no longer valid. (I wasn't sure whether or not this is only for UseMagic packages so I didn't put it up there.)

  15. @scrivener07

     

    I noticed you put that up on the wiki's example scripts. I tried to change it but you changed it right back. :turned:

     

    Anyway, that first line should be

     

    if (akSourceContainer == Game.GetPlayer())

    otherwise you're just assigning the player to the akSourceContainer variable.

×
×
  • Create New...