Jump to content

cyran0

Members
  • Posts

    55
  • Joined

  • Last visited

Everything posted by cyran0

  1. Ya, I'm still around, but without an active Morrowind forum to unite the community it feels like I am just drifting. I was hoping that Great House Fliggerty would become the de facto center of the community, but with the protracted access problems shortly after the loss of the official boards I fear it will never recover from the resulting exodus. Still, GHF is where I intend to post news about new mod releases.
  2. The 'ashvampire' script that is worn by several of the named dagoths checks to see if Dagoth Ur lives (checks for the journal entry C3_DestroyDagoth >= 50), and if it is true sets the health to zero of those surviving dagoths. Yes, they die as a result of Dagoth Ur being killed.
  3. Open the NPC's profile in the editor and then click on the [AI] button at the bottom of the window. This opens a new window. There are two tabs: 'Packages' and 'Services'. Under 'Packages' you will likely see 'Wander' listed. Double-click on 'Wander' to open a new dialogue box and set the distance to zero. I expect that you created your NPC with the 'Mage Service' or similar class. This gives the NPC the barter service - specifically to sell spells. The spells the NPC sells are those he/she knows. To give the NPC spells to sell, go to his/her inventory. There are two tabs: 'Items' and 'Spells'. Select spells, then drag the spells you want onto the inventory to add them.
  4. You are welcome. It seems the more complicated a script the more likely that we overlook the simple errors. Just to be clear, all variables have an initial value of 0 except for global variables and only if they are set to have a different value in the editor. Because Fargoth is not running very far you are fine running the script off of the activator. However, if that is not the most natural way of triggering the action or if you want to have more options in the future I will explain how to apply a targeted script. A targeted script is a global script that runs on an object like an NPC. The common way of starting a targeted script on an NPC is through dialogue with that NPC. You could create a new greating for Fargoth (filter it so it does not happen all the time). For example, you could make it so he only freaks out at night. Fargoth might say: "What are you doing? Don't touch me!" Then in the dialogue results window for that new greeting you type: Goodbye if ( ( ScriptRunning "poscig" ) == 0 ) StartScript "poscig" endif Goodbye forces the player to close the dialogue window. The check is to make certain the script is not already running on Fargoth. It is possible to have multiple targeted scripts running on an object, but two that are the same could give some strange (and undesirable) results. You could also start the targeted script from the activator. The code for the script you would attach to the activator might look like this: Begin ActivatorScript short doOnce if ( doOnce == 1 ) return endif if ( OnActivate == 1 ) set doOnce to 1 "Fargoth"->StartScript "poscig" endif End At some point you will want to stop the script from executing. Use the line: StopScript "poscig" If you do not already have it, Morrowind Scripting for Dummies is the single, most valuable scripting reference.
  5. The last script you posted has the right structure: you issue the travel package in one state and check for its completion in the next state before traveling to the next waypoint. One thing (there may be other issues) that is preventing your NPCs from moving is the first line after your declaration of variables. Every game cycle you are setting walkstate to 1 which means it repeatedly reassigns the same travel package. If you are coming from Skyrim modding, the error is understandable. Unlike with Papyrus, Morrowind scripts run every frame until they are stopped (that is why the early 'returns' on the menumode check are so important). There is no need to set walkstate to 1. You could make your first logic block check walkstate == 0. But if for some reason you need to set walkstate to 1 before stating the travel code try this: if ( walkstate == 0 ) set walkstate to 1 endif There is no difficulty with using AITravel to cross (exterior) cell boundaries, but it won't work if traveling between interior and exterior cells. AIWander will not cross cell boundaries since pathgrids are restricted to one cell and an adjacent cell would have its own distinct pathgrid. It appears that your script is running on the activator rather than the NPC (Fargoth) himself. This will introduce a limit to how far Fargoth can run since if the player moves too far from the cell where the script is running a point will be reached when the object's cell is no longer 'loaded' and the script will stop executing. You could make it a 'targeted' script to run directly on the NPC if you do not want to add scripts to the NPCs in the editor. Check out the code for the mod that abot linked. You will discover the scripts are more complicated - in part to handle an interruption in the AI by waiting in the cell or fast travel. You may not require that code for your project.
×
×
  • Create New...