Oh great @fwiffo ....perhaps you can be of some help with my predicament. I'm writing a very complex dialog with several conversational options. The issue I'm having is that I can't seem to combine the actions properly so they work in tandem. I understand the ; is used to string multiple actions and such together, but that only works if each command in the cascade is true basically and it seems to loop through.
Issue #1
This is the code for a repair vendor I'm trying to set up.
This ALL works wonderfully and the DependsOn cascades accordingly! I would just like to combine these line entries, because this vendor will be repairing 21 different pieces of gear, with 4 line entries per item, that is 84 line entries, it's nuts. What I've noticed is that in combing the Conditions, things loop, then fail to move to the next line entry. So if I had it check the player is carrying more than the minimum amount of gold and that they are carrying more than the minimum, combined with the action of taking the proper amount, the dialog fails, because it loops back to the first condition again. So if the player is carrying exactly 500 gold, the condition fails when it loops around again because the NPC just took that gold.
Any guidance here would be great!
Issue #2
The only other thing I need to figure out to make this more flexible is - In repairing an item, it's easy to use a hard-coded value, but if the player has added durability, that raises the MaxHitPoints on said item. The NPC needs to recognize that and repair the item accordingly. However, this action does not work:
That makes logical sense to me, but Xml disagrees. The NPC still takes the gold, he just doesn't execute the Action with the above code in place. If I have an item that has a randomly created value between the max and min, I run into the same problem.
Example:
Awesome Sword script has these values:
That means that the MaxHitPoints could be a value between 120 and 135. The only way I can get the repair to work is if ALL Awesome Swords have a fixed MaxHitPoint value. What I need to do is have the NPC check the MaxHitPoints and make the HitPoints equal to it.
Issue #3
Formatting the dialog window. This is an absolute pain. I couldn't find any documentation anywhere online that offered solutions for this. I was under the impression that the dialog windows supported basic HTML, but if I try to use a line break <br> the entire dialog breaks and won't open. Is there anyway to add line breaks without just entering a ton of spaces?
Sorry if I just made your head explode dude, but it is fun pushing the boundaries on the Xml stuff lol
Issue #1
This is the code for a repair vendor I'm trying to set up.
Code:
<XmlQuestNPC>
<NPC>
<Name>Kendall</Name>
<Running>True</Running>
<ProximityRange>3</ProximityRange>
<ResetRange>16</ResetRange>
<AllowGhost>False</AllowGhost>
<SpeechPace>10</SpeechPace>
<ResetTime>1</ResetTime>
<ConfigFile>KendallRepair</ConfigFile>
<SpeechEntries>86</SpeechEntries>
</NPC>
<SpeechEntry>
<EntryNumber>0</EntryNumber>
<ID>0</ID>
<Text>Are you in need of my skills?</Text>
<Condition>GETONTRIGMOB,PC=1</Condition>
<DependsOn>-2</DependsOn>
<Pause>1</Pause>
<PrePause>-1</PrePause>
<LockConversation>True</LockConversation>
<IgnoreCarried>False</IgnoreCarried>
<AllowNPCTrigger>False</AllowNPCTrigger>
<SpeechStyle>Regular</SpeechStyle>
<SpeechHue>-1</SpeechHue>
</SpeechEntry>
<SpeechEntry>
<EntryNumber>10</EntryNumber>
<ID>10</ID>
<Keywords>Yes, I need some repairs.</Keywords>
<DependsOn>0</DependsOn>
<Pause>1</Pause>
<PrePause>-1</PrePause>
<LockConversation>True</LockConversation>
<IgnoreCarried>False</IgnoreCarried>
<AllowNPCTrigger>False</AllowNPCTrigger>
<SpeechStyle>Regular</SpeechStyle>
<SpeechHue>-1</SpeechHue>
<Gump>GUMP,Kendall,2/Please tell me the corresponding number of which item needs repair. I am able to repair one item at a time, for a cost of course. 1. Ancient Robe --------- 1,000 Gold</Gump>
</SpeechEntry>
<SpeechEntry>
<EntryNumber>20</EntryNumber>
<ID>20</ID>
<Keywords>1</Keywords>
<Condition>AMOUNTCARRIED,Gold>999</Condition>
<DependsOn>10</DependsOn>
<Pause>1</Pause>
<PrePause>-1</PrePause>
<LockConversation>True</LockConversation>
<IgnoreCarried>False</IgnoreCarried>
<AllowNPCTrigger>False</AllowNPCTrigger>
<SpeechStyle>Regular</SpeechStyle>
<SpeechHue>-1</SpeechHue>
<Gump>GUMP,Kendall,4/That will be 1,000 gold please.;No problem!;Okay;Nevermind.;No</Gump>
</SpeechEntry>
<SpeechEntry>
<EntryNumber>30</EntryNumber>
<ID>30</ID>
<Text>You are not carrying enough gold.</Text>
<Keywords>1</Keywords>
<Condition>AMOUNTCARRIED,Gold<1000</Condition>
<DependsOn>10</DependsOn>
<Pause>1</Pause>
<PrePause>-1</PrePause>
<LockConversation>True</LockConversation>
<IgnoreCarried>False</IgnoreCarried>
<AllowNPCTrigger>False</AllowNPCTrigger>
<SpeechStyle>Regular</SpeechStyle>
<SpeechHue>-1</SpeechHue>
</SpeechEntry>
<SpeechEntry>
<EntryNumber>40</EntryNumber>
<ID>40</ID>
<Text>I have repaired your Ancient Robe.</Text>
<Keywords>Okay</Keywords>
<Action>TAKEBYTYPE,1,1000/Gold</Action>
<DependsOn>20</DependsOn>
<Pause>1</Pause>
<PrePause>-1</PrePause>
<LockConversation>True</LockConversation>
<IgnoreCarried>False</IgnoreCarried>
<AllowNPCTrigger>False</AllowNPCTrigger>
<SpeechStyle>Regular</SpeechStyle>
<SpeechHue>-1</SpeechHue>
</SpeechEntry>
<SpeechEntry>
<EntryNumber>50</EntryNumber>
<ID>50</ID>
<Action>SETONCARRIED,An Ancient Robe,AncientRobe/HitPoints/100</Action>
<DependsOn>40</DependsOn>
<Pause>1</Pause>
<PrePause>-1</PrePause>
<LockConversation>True</LockConversation>
<IgnoreCarried>False</IgnoreCarried>
<AllowNPCTrigger>False</AllowNPCTrigger>
<SpeechStyle>Regular</SpeechStyle>
<SpeechHue>-1</SpeechHue>
</SpeechEntry>
</XmlQuestNPC>
This ALL works wonderfully and the DependsOn cascades accordingly! I would just like to combine these line entries, because this vendor will be repairing 21 different pieces of gear, with 4 line entries per item, that is 84 line entries, it's nuts. What I've noticed is that in combing the Conditions, things loop, then fail to move to the next line entry. So if I had it check the player is carrying more than the minimum amount of gold and that they are carrying more than the minimum, combined with the action of taking the proper amount, the dialog fails, because it loops back to the first condition again. So if the player is carrying exactly 500 gold, the condition fails when it loops around again because the NPC just took that gold.
Any guidance here would be great!
Issue #2
The only other thing I need to figure out to make this more flexible is - In repairing an item, it's easy to use a hard-coded value, but if the player has added durability, that raises the MaxHitPoints on said item. The NPC needs to recognize that and repair the item accordingly. However, this action does not work:
Code:
SETONCARRIED,An Ancient Robe,AncientRobe/HitPoints/GETONCARRIED,An Ancient Robe,AncientRobe/MaxHitPoints
Example:
Awesome Sword script has these values:
Code:
public override int InitMinHits{ get{ return 120; } }
public override int InitMaxHits{ get{ return 135; } }
Issue #3
Formatting the dialog window. This is an absolute pain. I couldn't find any documentation anywhere online that offered solutions for this. I was under the impression that the dialog windows supported basic HTML, but if I try to use a line break <br> the entire dialog breaks and won't open. Is there anyway to add line breaks without just entering a ton of spaces?
Sorry if I just made your head explode dude, but it is fun pushing the boundaries on the Xml stuff lol
Last edited: