Jump to content

cyran0

Members
  • Posts

    55
  • Joined

  • Last visited

Everything posted by cyran0

  1. Yep, it's our (my) fault. The filtering for that greeting was incomplete. It has been corrected, but in the meantime, there is no good way for you to avoid the problem in your game. Either leave LGNPC Tel Uvirith off of your load list (this means losing the dialogue and services of your retainers at Tel Uvirith), avoid speaking with any of the Erabenimsun Ashlanders, or slaughter the latter (which affects the second solution). Thank you for reporting the issue.
  2. What leads you to believe Madd Leveler is responsible? I do not use Madd Leveler, but the errors are not the sort I associate with leveling mods. If I had to guess (and I do), knowing nothing beyond the theme of the mod, I would suspect Illuminated Order. I am certain you know what mods you have loaded now, but is it possible you had other mods, in particular Illuminate Order, running at one time and then removed them? Unpluging some mods without 'cleaning' your save of any records those mods created may result in errors of the sort you described. By the way, this topic really belongs in the Morrowind Mod Troubleshooting sub-forum.
  3. You didn't mention it but I expect your message does not display either. You are missing an 'endif' after the line player->additem "1soulfragment" 1. These things are more apparent with properly indented code. This is what the game engine is reading: begin 1soulfragmentsummon if ( summonsoulskull == 1 ) set timer to ( timer - getsecondspassed ) if ( timer < 0 ) set summonsoulskull to 0 set timer to 0 player->additem "1soulfragment" 1 endif if ( summonsoulskull == 0 ) if (player->GetSpellEffects callfragament1 == 1 ) set summonsoulskull to 1 set timer to 1.5 MessageBox "test" endif endif end 1soulfragmentsummon It thinks that the second if-block is nested under the first. Seventeen years ago after Morrowind was first released modders used to nitpick over small irregularities in syntax that they supposed could be responsible for scripts not behaving as intended. I don't know how much of that is true and how much of it was because the real source for an error was never identified, but I tend not to leave such things to chance. Use one 'space' consistently between elements in a line and use parenthesis to liberally so there is no confusion what is being compared. E.g. if ( ( player->GetSpellEffects callfragament1 ) == 1 ). Since seems to run continuously, it would be good to include some 'returns' so it does not burden the system too much. It is not necessary for 'summonsoulskull ' to be a global variable unless another script is referencing it. This is an example of what I am describing with a method to limit the number of skulls to 5: Begin 1soulfragmentsummon short summonsoulskull ;short skullCount float timer if ( menumode == 1 ) return endif ;if ( skullCount >= 5 ) ; this would be nice to have, but I suspect skulls can be removed ; return ;endif if ( summonsoulskull == 1 ) set timer to ( timer - getsecondspassed ) if ( timer > 0 ) return ; prevent further processing of script else set summonsoulskull to 0 set timer to 0 ; if ( skullCount >= 5 ) ; this is more efficient than an inventory count if ( ( player->GetItemCount "1soulFragment" >= 5 ) messagebox "No more skulls can be gathered" else player->additem "1soulfragment" 1 ; set skullCount to ( skullCount + 1 ) ; if ( skullCount >= 5 ) ; StopScript "soulfragmentsummon" ; endif endif return endif endif if ( summonsoulskull == 0 ) if ( ( player->GetSpellEffects callfragament1 ) == 1 ) set summonsoulskull to 1 set timer to 1.5 messagebox "Spell effect detected" endif endif End 1soulfragmentsummon If the duration of the spell causing the effect is greater than 1 second, you might want to change that or have the script remove it. Otherwise, all 5 skulls could be gathered at once. Also, (if appropriate) you can stop this script from running after 5 skulls have been collected with StopScript. Edit: I just now noticed you never declared 'timer' as a variable.
  4. Once OnPCDrop is true it continues to be true until it is manually reset to zero (false). That you should do as soon as it is true. Also, GetDetected is a fairly resource-hungry function. I suggest you move it inside the OnPCDrop block since it hardly matters if the player is seen if he/she is not dropping the item. Also, a quick return after the journal is set would be welcome. Something like this might work: Begin 1Dum_ScryDetect short OnPCDrop short doOnce if ( doOnce == 1 ) return elseif ( menumode == 1 ) return endif if ( ( GetPCCell "Sadrith Mora, Telvanni Council House" ) == 1 ) if ( ( GetPCCell "Sadrith Mora Tevlanni Council House, Entry" ) == 0 ) if ( OnPCDrop == 1 ) set OnPCDrop to 0 if ( ( GetDetected Player ) == 0 ) Journal "1Dum_lil_Telvanni" 10 set doOnce to 1 endif endif endif endif End
  5. For what you describe you will require dependency on one of the expansions (Tribunal or Bloodmoon) and if you want to teleport from interior cells you will require a script extender. The script attached to your ring will need to declare some float variables to store the player's position before teleporting to the mudcrab merchant (including rotation on the z axis). You will also need to declare short OnPCEquip and short OnPCSkipEquip (for convenience if you do not what one of your equipped rings to be replace). Declare another short to keep track of which way the player is teleporting. Set PCSkipEquip to 1 Check for OnPCEquip == 1 If true check GetInterior == 1 If true, the teleport attempt fails (a messagebox would be appropriate) Otherwise, update the variable that stores the direction of travel and store the player's current position using SetPos and SetAngle. The next time the ring is equipped the state will return the player to his/her original location. Toggle the state variable back to it previous state and use Position to teleport the player back. Position does not work for interior cells. PositionCell does, however you can't store the cell ID without a script extender. I have had mixed results with Position in the past [edit: when used with variable coordinates] - as often as not it moves the target to the coordiates (0,0,0). SetPos might also work, but it is only reliable if the target location is an active cell - it is good only for short distances.
  6. Congratulations - and well done... you compensated for a flaw in my orginal script. I failed to take into account that the player might remove armor yet still have enough equipped to qualify for a bluff. I stripped all the buffs at once. It would have been fixed the next time the script ran, but your solution is elegant in removing only those buffs that the player did not merit. The student is now the master :wink:
  7. 'armorCount' is independent of 'state' so it should not. It is necessary to reset armorCount to 0 before each inventory check otherwise the stored value would keep growing even if the player had only one piece of armor.
  8. You do realize I did not provide the entire script - just the sections that were edited. You still need your timer and set state to 1 along with your original declarations. I showed the declaration of the new variable - that probably caused confusion.
  9. It is not just time-consuming to write it is also time-consuming to run. HasItemEquipped is probably not as resourse-hungry a command as GetItemCount, but it takes more time to process than a simple variable check. You want to avoid multiple checks of the same item in a given cycle. That can be done if you incorporate something I suggested earlier: update a variable after checking each piece of armor and assign the buff based on that value. You wrote 'buffs' - I assume that means the more pieces of armor the player has of a set the more buffs are applied. Here is a sketch of what I am describing: short armorCount if ( state == 1 ) set armorCount to 0 if ( ( player->HasItemEquipped "adamantium_bracer_left" ) >= 1 ) ; greater than or equal to is more reliable even if is should be impossible set armorCount to ( armorCount + 1 ) endif if ( ( player->HasItemEquipped "adamantium_bracer_right" ) >= 1 ) set armorCount to ( armorCount + 1 ) endif ; etcetera... set state to 2 endif if ( state == 2 ) if ( armorCount >= 2 ) player->AddSpell "RidAz2Set" endif if ( armorCount >= 3 ) player->AddSpell "RidAz3Set" endif ; etcetera... if ( armorCount <= 1 ) ; no sets, remove spells set state to 3 else set state to 0 endif endif if ( state == 3 ) player->RemoveSpell "RidAz2Set" player->RemoveSpell "RidAz3Set" ; etcetera... there is no danger from removing a spell that the player may not have set state to 0 endif If you are not stacking buff but rather assign a single stronger spell as the player accumulates pieces of the armor set the code might look like this: if ( state == 2 ) set state to 0 ; do this now - it will be updated if the player does not have an armor set if ( armorCount >= 8 ) player->AddSpell "RidAz8Set" elseif ( armorCount >= 7 ) player->AddSpell "RidAz7Set" ; etcetera... elseif ( armorCount >= 2 ) player->AddSpell "RidAz2Set" else ; no sets, remove spells set state to 3 ; see I told you ;) endif endif You could also use the binary (bit-packing) solution I mentioned if you want to assign buffs depending on specific combinations of armor. It can be very efficient. I once check the player's inventory for over 8000 possible combinations of equipment and tailored an NPC's dialogue to acknowledge the contents with 150 lines of code and 9 dialogue entries.
  10. That was my fault - I misled you. I was trying to describe where the script needed to be modified not how it was to be modified. It is easier to show you what I mean rather than explain it, but I will try to do both: If ( State == 1 ) If ( Player->HasItemEquipped, "adamantium_bracer_left" == 1 ) If ( Player->HasItemEquipped, "adamantium_bracer_right" == 1 ) ; we only get this far if player has left bracer equipped Set State to 2 Else ; this is true only if the player has the left bracer but not the right bracer Set State to 3 EndIf Else ; if the player does not have the left bracer we still need to set state to 3 Set State to 3 EndIf EndIf It is easier to overlook that hole in the logic when the code is not indented. I meant to say last time that you might try introducing messageboxes at critical parts of your script. This provides real-time feedback as the script runs and lets you know where there is an error in the code.
  11. In your test are you removing the left bracer? If so, the second condition is not satisfied and the script does not process the third layer of this nested if-block where 'state' is set. Try removing just the right bracer to see if it works? Obviously, the solution is to add an 'else' path off of the second condition ( If ( Player->HasItemEquipped, "adamantium_bracer_left" == 1 ) ). I recall a discussion in the old forum about issues with removing diseases, but I am pretty certain it had to do with removing spell effects not RemoveSpell. You are not getting much value out of your timer. It should be set up like a menumode check with an immediate 'return' until the condition you want is satisfied. The script hops over the timer to check the value of state three times - all the way to the end. If fact, I don't understand how your script managed to add the spell (disease) in the first place since it sets the timer to 0 every frame. Try this: set timer to ( timer + GetSecondsPassed ) if ( timer < 5 ) return endif set timer to 0 There are other structural changes I might suggest for the script, but first let's see if we can get it working.
  12. I understand your script has undergone several revisions, but there is no reason to expect your posted script to update the player's status after the initial check to add or remove the spell. Once the state has been set to 10 or 20 it remains so indefinitely... adding or removing the spell continuously. You should assign a different state to the script to prevent that from happening, and at some point it needs to be set back to either 0 or 1 so it will check again to see what armor the player is wearing. This is a local script assigned to a ring that the player wears. Since you want/need it to run continuously you might as well make it a global script unless you want the ring to be associated with the armor set buff. In either case, introducing a timer so the script runs it course only once a second or one every five seconds will reduce the burden of the script running all the time. I gather you intend to expand this script to include more than the two pieces of the same armor (and perhaps other types of armor as well). You might find it easier (and more flexible) to check as each armor piece is equipped and removed to update a local variable. Once those checks are complete (during one 'state') a new state checks the value of the variable and adds or removes the spell, and the state is reset to check again. I say more flexible because you could assign different values to the different pieces of armor, e.g. each gauntlet is worth 1, boots and each pauldron worth 2, helm and greaves worth 3 and cuirass worth 4. The strength of the buff could improve as the total increases. Of course, that can still be true if each piece of armor is 'worth' 1. Alternately, if you what certain combinations to have a special buff, you can assign a unique value to each (1, 2, 4, 8, 16, 32...) so the sum of any combination is unique and recognizable.
  13. I tested the script myself in-game. I did make an error in the second and third branches of the message tree - I forgot the prompt "What would you like to summon?" so the first choice became the prompt. Other than that, the script worked as expected for me. I do suggest that you add an option for the player to cancel the training on each branch. I cannot account for why the original messagebox is not clearing for you after you make your first choice.
  14. Please indent your code to make your script easier to read and understand. I suspect if you select a skeleton warrior it will summon a rat. This is because after each cycle your script runs (and it runs to the end each cycle) you will set the script state to 0 if it is 1 or 3. After the second menu displays and the player makes a choice that choice is applied to the first menu block. You need an early return while the script waits for the player to make a choice. Such returns will improve the efficience of your code as well. After activation you want to set 'ScriptState' to 1 (not 0 as it already is) to prevent the player from activating it a second time before the choice is completed. As a personal choice, there is no need for the message informing the player that creature is summoned, and specifying the level of the summon is immersion-breaking. Rather than try to explain where changes should be made I offer the following untested code: Begin TrainingActivator ; Underscores as the first character of names can be a dangerous practice short scriptState short button if ( menumode == 1 ) return endIf if ( OnActivate == 1 ) if ( scriptState == 0 ) messagebox "What would you like to summon?" "Scrib (20 gold)" "Rat (35 gold)" "Kwama Warrior (45 gold)" "Bonewalker (70 gold)" "Scamp (75 gold)" "Next" set scriptState to 1 endIf endIf if ( scriptState == 1 ) set button to GetButtonPressed if ( button == -1 ) ; the player has not made a choice yet return elseif ( button == 0 ) ; scrib if ( ( player->GetItemCount "Gold_001" ) < 20 ) messagebox "You don't have enough gold." else player->RemoveItem "Gold_001" 20 PlaceAtPC "scrib" 1 128 3 endIf elseif ( button == 1 ) ; rat if ( ( player->GetItemCount "Gold_001" ) < 35 ) messagebox "You don't have enough gold." else player->RemoveItem "Gold_001" 35 PlaceAtPC "rat" 1 128 3 endIf elseif ( button == 2 ) ; kwama warrior - perhaps you meant kwama forager? if ( ( player->GetItemCount "Gold_001" ) < 45 ) messagebox "You don't have enough gold." else player->RemoveItem "Gold_001" 45 PlaceAtPC "kwama warrior" 1 128 3 endIf elseif ( button == 3 ) ; bonewalker - another comparatively high level challenge if ( ( player->GetItemCount "Gold_001" ) < 70 ) messagebox "You don't have enough gold." else player->RemoveItem "Gold_001" 70 PlaceAtPC "bonewalker" 1 128 3 endIf elseif ( button == 4 ) ; scamp - more like it if ( ( player->GetItemCount "Gold_001" ) < 75 ) messagebox "You don't have enough gold." else player->RemoveItem "Gold_001" 75 PlaceAtPC "scamp" 1 128 3 endIf elseif ( button == 5 ) ; next menu branch set scriptState to 2 endif endif if ( scriptState == 2 ) ; second menu branch messagebox "Shalk (60 gold)" "Skeleton Warrior (110 Gold)" "Next" set scriptState to 3 endif if ( scriptState == 3 ) set button to GetButtonPressed if ( button == -1 ) ; the player has not made a choice yet return elseif ( button == 0 ) ; this is first choice on new menu branch - shalk if ( ( player->GetItemCount "Gold_001" ) < 60 ) messagebox "You don't have enough gold." else player->RemoveItem "Gold_001" 60 PlaceAtPC "shalk" 1 128 3 endIf elseif ( button == 1 ) ; skeleton warrior if ( ( player->GetItemCount "Gold_001" ) < 110 ) messagebox "You don't have enough gold." else player->RemoveItem "Gold_001" 110 PlaceAtPC "skeleton warrior" 1 128 3 endif elseif ( button == 2 ) ; next menu branch - just for illustration set scriptState to 4 endif endif if ( scriptState == 4 ) ; third menu branch messagebox "Fargoth (1000 gold)" set scriptState to 5 endif if ( scriptState == 5 ) set button to GetButtonPressed if ( button == -1 ) ; the player has not made a choice yet return elseif ( button == 0 ) ; you get the idea endIf endIf set scriptState to 0 ; the script does not reach this point until the player makes a choice End TrainingActivator Tightening up the first message (choice menu) makes it possible to include more creatures per menu branch. This is expensive training. While it may not be necessary, I uncoupled each menu branch into separate logical blocks. There is an 'instruction limit' for an if-block. Depending on how many choices you plan to offer it is possible the code would have exceeded it.
  15. I am a director, producer, writer and programmer, but I needed to be an artist. I might have asked someone to create models for me, but it might never have happened and even if someone agreed to help it likely would not have been what I conceived in my mind. So I learned how to do some basic work in Blender and NifSkope. It took time (a little longer than the span of time since you started this thread), but I am pleased with the results and my project is moving forward. How are you doing? Dragon, Leonardo and I are not trying to be callous and squash your dream. On the contrary, this advice is to help you progress on your project. There are modders with the skills you seek, but they already have projects - mods that they feel as passionately about completing as you feel about your own. You will wait indefinitely for their participation. Why not take this time while you are waiting for your white knight to arrive and give it a try? You might be surprised by what you can accomplish on your own. I am not an artist, but I learned how to create what I needed. I have dyslexia, but I write up a storm - granted I make many, many mistakes. So will you when you start dabbling in the construction set. When you do, post the problem you are having and if any of us knows the solution we will happily share it with you.
  16. Let's all be nice - I suspect this is just a misunderstanding. I apologize for my part it it by my playful way of pointing to Grumpy's companion script. If you (Krystel) would follow the link I posted earlier you will find a choice between two different companion template mods. If you do not want to use the template, you can still copy the code from the companion script into your own project to create a fully-functional companion (provided you have the required expansion). Building your mod from the template means that the new dialogue topics already have responses created for them. If you take just the script remove the AddTopic lines so errors are not generated when the topics are not found. Both mods are well annotated so read about what each provides.
  17. I don't think PrinceShroob's discussion applies here. Kloppix seems to be puzzling over the irony that doing the right thing by cleaning the official entries on either side of a mod's dialogue insertion point generates a warning. However, cleaning is the right thing to do. One can avoid the warning (really just an advisory in this instance) by not cleaning, but that can lead to unexpected - and undesirable - behavior when different mods attempt to insert dialogue at the same place in the dialogue tree. Cleaning preserves the order of the new dialogue introduced by each mod and resolves mod conflicts in the usual way - the last mod to load wins. In the case of dialogue conflicts, however, the other mods' dialogue entries are not overwritten, but are inserted below the winning mod's entries in the dialogue tree. 'Following string' and 'previous string' refer to how an individual dialogue entry is related to the entry below and above it, respectively. Inexplicably, whether the insertion points are cleaned or not they point correctly to the corresponding following and previous entry (you can export the dialogue data and examine the info IDs to see that it is working). The only reason we clean the insertion points is to control how the new dialogue from two different mods will merge when they are loaded.
  18. First of all let me say that I agree with you about the immersion value of adding these sorts of details even as small as they may be. It gives a sense of progress and gained respect after the lowly player new to Sadrith Mora and harassed about the hospitality papers is subsequently welcome after joining House Telvanni. I certainly like it for snubbing the player should he/she be expelled. The path to the start scripts is correct - we are talking about the same thing. It was a feature introduced with the Tribunal expansion so a player would need to have it or Bloodmoon loaded for a mod using start scripts to work properly. So long as that is true, such a mod could be added to a game in progress (it would not require a new game). Start scripts are initiated each time the game is launched. I mention the dependency because you should know if you plan to release your mod. You need to advise players of that fact. That being said, it is very unlikely that players of Morrowind do not have both expansions sixteen years after the game's release. It must be difficult to find a copy of Morrowind that is not GOTY. I have one, but I also own each of the expansions as well as a GOTY edition. Few modders worry very much about introducing Tribunal dependencies and I don't blame them. Still, I avoid it if I can. That is a decision you have to make for yourself. The easiest way for you to initiate a global script is with start script. To do so with the script function StartScript requires a local script (or dialogue results) which sort of brings you back to the reasons you might choose to avoid using a local script in the first place: where to place it so it will run in a timely fashion. If the player arrives in Sadrith Mora without using magic, he/she will approach from the dock or Wolverine Hall. An invisible activator placed just outside the entrance to Tel Naga will be loaded when the player is in that cell and any of the surrounding eight cells. This covers all of Sadrith Mora, and then some. A local script on that activator will address a player arriving from 'outside'. As for magic, there are the intervention spells. Divine Intervention will send the player to Wolverine Hall. There is no Tribunal Temple in Sadrith Mora so you do not have to worry about the player arriving by Almsivi Intervention. That leaves mark and recall. Even with multimark mods, it is unlikely that the player would leave more than one mark in Sadrith Mora. However, if there is a second or if not in an exterior cell the logical place for it would be in the Telvanni Council House (where the mouths are located). I don't believe there are services available in Tel Naga or in the depths of the Hermitage (Llunela Hleran) so there would be no need to update in any of those interior cells. It is the truly lazy player that leaves mark in Anis Seloth's alchemy shop. So realistically you could get by with two invisible activators: one outside Tel Naga and one in the Telvanni Council House. You could use the invisible activators at those two locations to start the global script, but since these are the only locations where the script needs to run you may as well use a local script to update the player's status in the house. If you decide on the local script the one I posted originally should be fine (it is untested) - I really don't see the need for the timer. It could be made a little more efficient with a CellChanged check, but there are instances where that gives a false negative. Some modders refuse to use it for that reason. It is probably not worth it in this case. There is really little you can do to protect yourself from what other mods might introduce. A Sadrith Mora expansion mod could make the city larger than the nine cells our local script activator will be loaded, or introduce a service-rich interior cell that the player might want to mark. It is possible that there might be a few instances where the player is able to receive services when he/she should be denied. Rather than worry about that I would prefer to roleplay that the merchant is rebeling against Angaredhel.
  19. There is no filter Function: Rank, but if there was it would likely refer to the speaker's rank in the faction, not the player's rank. If by 'start script' you are referring to the feature added with Tribunal then yes, but it will introduce a dependency on that expansion. You could also use the script function Startscript - that is how we initiate global scripts in-game. Either way you are introducing a global script. Modders are discouraged from using global scripts since they run continuously and can tax the game engine. That was more of a concern fifteen years ago when Morrowind was young and processors were less powerful. Still, the cumulative affect of many global scripts all running at the same time may still slow the game for people running many mods. It may be worth it in this case, particularly if you add a timer to the script. Presently, I know of no other location than Sadrith Mora that checks for 'hospitality papers', but you are correct in thinking that a global script would function in other Telvanni settlements where that requirement is added. If you decide to add a timer to the script, remove the menumode (if ( menumode == 1)) block - it will contribute little to making the script more efficient. Replace it with the timer code: float timer ; variable declaration set timer to ( timer + GetSecondsPassed ) ; tracks passage of time if ( timer < 5 ) ; 5 seconds return ; do not process rest of script endif set timer to 0 ; reset for next cycle The rest of the code is as it was in my previous post. This means that the checks for the player's status in House Telvanni are performed only once every five seconds which should be often enough. Honestly, not much is saved since the original code was pretty efficient, but some might argue that the timer is better. Personally, I'm not certain. This was mostly an academic exercise for me. There are other instances when checking the player's faction affiliation is necessary in dialogue and when using a timer can greatly improve a script's performance. However, I can't help to observed that the mod changes you are considering are not really necessary unless you care if the player has been expelled. Only players who are of House Telvanni need the refinements to circumvent the 'Hospitality Papers' nuisance dialogue. Therefore, the best thing for them to do is not load the original mod in first place. Your changes give the Telvanni player the same experience as if the mod was not loaded at all.
  20. I agree that it would be better not to have a 'Telvanni' response just to make the other possible. I gather the difficulty is that not all service providers in Sadrith Mora are of House Telvanni otherwise you would merely filter for Function: SameFaction = 0. I suggest you use a global variable to filter the responses you want for non-Telvanni. Create a new short global variable (e.g. ps_IchBinEinTelvanni). In the dialogue response section for the entry that the player agrees to 'join House Telvanni', add the line: set ps_IchBinEinTelvanni to 1 No you can filtered service refusual to not-Telvanni, non-hospitality paper bearing players by Global: ps_IchBinEinTelvanni != 1 The reason for checking 'not equal to 1' is that you may want to refuse service to Telvanni players who have been expelled. The player cannot be permently expelled from House Telvanni, but the filter PC Expelled will not be satisfied if the speaker and player are not of the same faction (Telvanni). However, you can check for explusion in a script using: if ( PCExpelled "Telvanni" == 1 ) set ps_IchBinEinTelvanni to 2 endif When the player is reinstated by a mouth through 'make amends', add to dialogue results the line: set ps_IchBinEinTelvanni to 1 and all will be right again. Because this has to be done through a script, you will require an invisible activator in the exterior of Sadrith Mora to check if the player has been expelled from House Telvanni. It could also be used to check if the player has joined House Telvanni, in case the mod is added after the player joins (or you do not want to handle it through dialogue). The script might look something like this: Begin ps_CheckTelvanniStatus if ( menumode == 1 ) return endif if ( ps_IchBinEinTelvanni == 1 ) ; player is Telvanni if ( PCExpelled "Telvanni" == 0 ) ; player is in good standing return else ; player has been expelled set ps_IchBinEinTelvanni to 2 endif elseif ( GetPCRank "Telvanni" >= 0 ) ; player is Telvanni... if ( ps_IchBinEinTelvanni == 0 ) ; but global not set yet set ps_IchBinEinTelvanni to 1 endif endif End There are limitations of using a local script on an activator in Sadrith Mora. It will process only when the player enters the exterior. You may want to add a copy of the activator to the Telvanni Council House where the mouths assemble since they are responsible for changing the Telvanni player's expulsion status. Not doing so means that the player would be refused service in those interior cells until he/she steps outside. Also, the player could be expelled in an interior cell and still enjoy services until he/she steps outside for the script to update the status. There is also the matter of the player teleporting between interior cells and not encountering the invisible activator(s) - not an unreasonable thing to expect from Telvanni players. Now you're have to consider placing an activator in any Sadrith Mora cell that offers services. That is doable, but at some point you might decide the 'cost' of a global script might be worth it. Good luck
  21. Do not use 'StartScript' on a local script (a script attached to an object). In Morrowind, local scripts run automatically and continuously when their cell is loaded. 'StartScript' is used to initiate global scripts (scripts not attached to ojects and therefore do not exist in the world). Calling 'StartScript' from dialogue results of an NPC creates what we call a 'targeted global script' since it runs on the calling NPC. In this instance, the script was checking the distance between the calling NPC and the player and prompting a forced greeting. Even though your local script attached to the intended NPC and the new instance of it created by 'StartScript' have the same code, they run independently of each other and this unto itself should not create a problem. Still, get rid of 'StartScript'. Life is easier with unique NPCs created and placed in the world by the player. Journal entries are excellent ways of triggering action. It sounds like there is a journal update at the same time as the NPC is to be enabled (in the same dialogue results box). This is what I would suggest: Have the script attached to the NPC you want to force greet the player disable and enable itself, (you do not need to do so with the StartUp script). This approach is a little cleaner. The script might look like this: Begin AAAASCQForceGreetingCLOSE short doOnce if ( doOnce >= 3 ) return endif if ( menumode == 1 ) return endif if ( doOnce == 0 ) set doOnce to 1 Disable elseif ( doOnce == 1 ) if ( ( GetJournalIndex "YourScriptID" ) == xx ) ; xx is the index of the journal entry to enable NPC set doOnce to 2 Enable endif elseif ( doOnce == 2 ) if ( ( GetDistance player ) <= 512 ) set doOnce to 3 Forcegreeting endif endif End This script disables the NPC the first game cycle (frame) that its cell loads. It will not be observed by the player. The only thing you need to do from dialogue results of the NPC that 'enables' the other NPC is to add the journal entry that the other NPC's script checks to enable it - no 'StartScript' and no 'Enable'. You might want to filter the forced greeting to check for the local variable 'doOnce' to have a value of 3 (set by the NPC's script). Then in dialogue results, 'set doOnce to 4'. This will prevent the NPC from using that greeting a second time, and the value of doOnce will still cause the local script to return quickly.
  22. It is not important if you mod Skyrim. I made an assumption about what preconceptions you might have based on your comment about papyrus script fragments. Also, I miss read "The script starts with a 'StartScript' command in the dialog paprus fragment box" - that's all on me. So let's start again with you giving definitive answers to straight forward questions. Was the disabled NPC placed in the world by you (is it a new, unique NPC) or by Bethesda? How is the NPC initially disabled? Is the script you posted attached to the NPC in question? Does the script compile in the editor (construction set)? Is this script started in dialogue results of a different NPC using StartScript? Is there a journal (quest) entry associated with the enabling of this NPC? Are the two NPCs in the same cell?
  23. There is nothing wrong with your script's syntax that I can see, so I don't understand why it does not compile for you. You imply that it is running from the dialogue results box of the greeting (what you refer to as the 'dialogue papyrus fragment box'). Is this true? Any code in dialogue results is not compiled when the dialogue entry (greeting) is saved, but it may crash in-game if the engine cannot parse it. There are important difference between adding code to dialogue results in Morrowind and adding a papyrus fragment to a dialogue entry in Skyrim (I assume you are coming from there). *The script does not have a name *There is no 'Begin' and 'End' *We cannot declare variables (although we can write and read variables that are declared in a so-called local script attached to the NPC). [study examples from the official dialogue to see how this is done.] Regardless of what you are doing now, what you need to do it attach your script to a local object. The NPC is the logical and best choice. Your script should run perfectly as is. However, if there is a reason you do not want to attach the script to the NPC (perhaps it is an original NPC and you want to avoid any possible mod conflicts), create an activator in the same cell as the NPC and attach the script to it. For it to work, you will need to add 'fixes' so the engine will know on what object reference to run the script: If ( "NPC_ID"->GetDistance, Player <= 512 ) "NPC_ID"->forcegreeting
  24. Your instincts are correct. The script that disables Natalinus Flavonius is 'Startup' that is run when a new game is begun. For that reason, it it not the best approach for disabling your own quest NPCs. First of all, it introduces the potential for conflict with other mods that might make changes to the script, but also that it would require players to begin a new game for the disabling of NPCs to take effect. I prefer to place a script on my quest NPCs that initially disables them and then checks the quest's journal index for the condition that would enable them. However, if you are using existing NPCs in your quest it would be better to not add the script to the NPC, but to an invisible activator in the NPC's cell instead - again, to avoid conflicts with other mods. Alternately, you could enable them through dialogue as Bethesda does in many instances.
×
×
  • Create New...