Jump to content

fg109

Members
  • Posts

    1192
  • Joined

  • Last visited

Everything posted by fg109

  1. Calling a function like this: Fragment_0() only works if the function is also in the same script. If it's in a different script (eg your quest script), then you need to call it like this: (MyQuest as MyQuestScript).Fragment_0() Honestly, this is complicated to explain and I'm not sure how well you know how the scripting works. Let's say you have a quest (eg Quest01). You decided to attach a script to it (eg Quest01Script). Then you decide to add some quest stages, and in those quest stages you write some code in the script fragments. These quest fragment scripts become new functions (eg Fragment_0()) inside the quest fragments script. If you don't already have a quest fragments script, one will be generated for you (eg QF_Quest01_000D64). So at this point, your quest has two scripts on it (Quest01Script and QF_Quest01_000D64). You also decide to add a reference alias to your quest (eg RefAlias01) with its own script (eg RefAlias01Script). In order for this script to use the Fragment_0(), your code has to look something like this: Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) (GetOwningQuest() as QF_Quest01_000D64).Fragment_0() RegisterforSingleUpdate(1) EndEvent In the example, the reference alias script calls the Fragment_0 function (the code for one of the stages in your quest) in the quest fragments script. This actually does the exact same thing as calling SetStage on your quest, except that the stage doesn't change. The reference alias script also calls RegisterForSingleUpdate(1). This tells the reference alias script to run the OnUpdate() in 1 second. This doesn't affect any of the other scripts. They will not run OnUpdate(). I hope this clarifies things for you, otherwise I would need to take a look at what you're trying to do in order to tell you how to fix it.
  2. Sort of. You need to list all the parameters for OnHit, but otherwise you're good. You may want to add a StopCombat for any akAggressor that isn't the player or quest NPC, in case someone interferes. Also, in your new stage, remember to clear the alias holding the player. For the alias script on the NPC, you'll want to condition it so that it only tracks the health in the OnHit event while your quest is in the dueling stage.
  3. You are using OnContainerChanged incorrectly. This event is sent to the item that is being moved into/out of a container. The player will never receive this event unless he/she is added to or removed from a container (which is never going to happen). Instead, you should be using OnItemAdded and OnItemRemoved. I don't know how you are using RegisterForUpdate, so I can't comment on that.
  4. Put some spaces in there. The compiler is thinking that's a "-1" (negative) instead of "- 1" (minus).
  5. I've tried a couple different things since my last post. From what I can tell, activating some animated furniture when an animated furniture is in use will only cause the player to stop using the current furniture. Activating a bed causes the player to play the sleeping animation (what I've manged to get done so far). Activating a chair causes the player to play the sitting animation. Activating an alchemy station causes the player to play the mortar and pestle animation. Etc. If the player is sitting in a chair when the bed is activated, then the player will get up off the chair. If the player is making potions when the bed is activated, the player will stop using the alchemy station. Similarly, if the player is lying in bed when the bed is activated, the player will get off the bed. Until SKSE comes up with a function to call up the sleeping menu with a script command, this mod is impossible for me. Which is not to say it's impossible right now. I have no experience with Script Dragon, but maybe someone who does can make this. For now, the best I could come up with is to create a clone of the player and have the clone play the sleeping animation, and then have the (invisible) player activate the bed to bring up the sleep menu. This has the drawback of the camera not following the clone.
  6. Where's the wiki article that tells you that? It needs to be changed. I can create room markers the same way I create primitives. I select everything I want to be in my "room", then click on the room marker button. That will draw a room marker that contains all the objects that I selected.
  7. Script fragment on quest stage that uses StartCombat and also assigns the player and the NPC to reference aliases with ForceRefTo. GetActorValuePercentage inside the OnHit event of the reference alias scripts. SetStage called after the health check in the player's reference alias script. SetStage called after the health check in the NPC's reference alias script.
  8. http://skyrim.nexusmods.com/downloads/file.php?id=14884
  9. I've been working on this since yesterday. I've managed to get the player to play the go to sleep animation, but I've run into a problem... When the player is lying in bed and then tries to activate the bed, he/she just gets up. I haven't figured out a way to get it to show the sleep menu instead.
  10. You could put a script on the weapon that sets the NPC to essential or non-essential in the OnEquipped and OnUnequipped events. Or if you want to make sure that a follower doesn't kill the boss when you're equipped with the weapon, put a script on the boss with an OnHit event that checks his/her health. If health is lower than 0, and the weapon that hit him/her is the unique weapon, set the boss to unessential and kill him/her.
  11. In other words, you're saying that everything was working fine until you edited the second quest. Then the problem probably has nothing to do with the script you put on the amulet, but whatever you edited in the second quest. You should change one thing in your script though: Event OnContainerChanged(ObjectReference newContainer, ObjectReference oldContainer) if (newContainer == Game.GetPlayer()) && (Amulet.GetStage < 30) Amulet.SetObjectivedisplayed(30) Amulet.SetStage(30) endif EndEvent And the reason that the console said "missing parameter quest" is because you didn't type your quest ID.
  12. You can add in a check for the NPC's rank in CurrentFollowerFaction. Obviously, this method of checking is not very reliable, because it relies on getting random actors around the player. With vanilla papyrus, you can only search for closest or random. If you are willing to use SKSE, GetNumRefs and GetNthRef will let you go through every actor in the cell, without needing to just pull one at random.
  13. Depending on what's your script, the problem could be the collision layer of the trigger zone, whether or not you set the player activate flag on it, the Z axis rotation, etc.
  14. Static Property COCMarker Auto ;;; Actor Player = Game.GetPlayer() Actor TempActor int Count while !TempActor && (Count < 10) TempActor = Game.FindRandomActorFromRef(Player, 4096.0) if (TempActor == Player) TempActor = None endif Count += 1 endwhile if (TempActor) Debug.Trace("Found an actor within one cell length that's not the player!") TempActor.PlaceActorAtMe(Ambusher1, 1) Return endif ObjectReference MarkerRef = Game.FindClosestReferenceOfTypeFromRef(COCMarker, Player, 4096.0) if (MarkerRef) Debug.Trace("Found a COC marker within one cell length of the player!") MarkerRef.PlaceActorAtMe(Ambusher1, 1) else Debug.Trace("No COC markers or actors found within one cell length of the player.") endif ;;;
  15. http://www.creationkit.com/Creating_Primitives
  16. When you created the topic infos, did you remember to copy the script fragments from the vanilla topic infos?
  17. If it doesn't work by editing the vanilla topic infos, how about creating your own? Like how some followers have their own topic infos (eg Farkas), you could have a topic info made specifically for your follower.
  18. So you're saying you added your voice type to the form list "VoicesFollowerNeutral" and nothing happened? Did you remember to edit the topic info reponses so that they use your voice type? Hmm, actually I don't know how to do that.
  19. If you are going to use it as a library script, you just need to import them in your script. Scriptname Example extends Something Import Basketball ;etc. But as I said in the first post:
  20. You change the spell projectile in the magic effect window.
  21. If Ball extends ObjectReference, then Basketball would also extend ObjectReference (through inheritance). Then you could use it just like in the example that I gave, only instead of TestObjectScript, you would be using Basketball. It's possible to set the value to your property without the editor, but not reliable. You would have to use GetForm but since there's no way to tell where someone would put your mod in the load order, this should only be used if the object you are trying to reference is something from Skyrim.esm.
  22. You're correct, nothing is assigned until you use the editor to set the property. I'm just not certain that the editor can set the property if the property is of a type that doesn't extend anything. Form and Alias scripts don't extend anything either, but I think we're allowed to use them since they are hard-coded.
  23. I think you already know, but if you plan on assigning any properties that reference anything (so anything other than bool, int, and float) then the script needs to be attached to something. To reference each instance of the script, you need to somehow reference the object that the script is attached to. Sorry, but I'm not sure how exactly you would do that for your example scripts. If your script extends ObjectReference, then you would be able to simply assign each of the scripted objects to ObjectReference properties. Then you could use casting to reference the script attached to the object. For example, let's say I have a script like this: Scriptname TestObjectScript extends ObjectReference Armor Property MyArmor Auto Weapon Property MyWeapon Auto Function Initialize() ;do stuff EndFunction Let's say that I attach this script to SomeObject01 somewhere in the game world. In order to reference the variables and function of this instance of the script from another script, I would use casting like this: Scriptname SomeScript extends something ObjectReference Property SomeObject01 Auto ;;;Some event or function Armor LocalArmorVariable = (SomeObject01 as TestObjectScript).MyArmor Weapon LocalWeaponVariable = (SomeObject01 as TestObjectScript).MyWeapon (SomeObject01 as TestObjectScript).Initialize() ;;;end event or function If the script extends form, then I would have declared SomeObject01 as a Form property. However, your Ball script doesn't extend anything, so I don't know how I would reference it... In my example "SomeScript" I used casting, but I could also have done this: Scriptname SomeScript02 extends something TestObjectScript Property SomeObject01 Auto ;;;Some event or function Armor LocalArmorVariable = SomeObject01.MyArmor Weapon LocalWeaponVariable = SomeObject01.MyWeapon SomeObject01.Initialize() ;;;end event or function I have never tried declaring a property of a script type that doesn't extend anything, and I don't know how you'll be able to fill such a property, but you could try it.
  24. http://www.youtube.com/watch?v=xVzsZhkf7XA
×
×
  • Create New...