Missing string replaces in NPC dialogues

Everything about development and the OpenMW source code.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Missing string replaces in NPC dialogues

Post by Zini »

I already said that we won't add anything to the scripting engine. This is like shooting sparrows with cannons anyway.
Zjarek
Posts: 6
Joined: 30 May 2012, 01:02

Re: Missing string replaces in NPC dialogues

Post by Zjarek »

Well, I will probably implement it for my own sake (but I won't insist on merging it into trunk). To avoid having 2 different string escapes I can add simple replacement in Interface::formatMessage for '^' => '%'?

Edit: Also, would it be better to add to DialogueManager additional getters, like getName(), getRace(), getRank(), or just refactor usage of getFaction(), and just make only getActor() (should it return const Actor*, const Actor& and exception to catch, or Ptr to Actor, where Actor is MWClass::NPC?), adding necessary getters to MWClass::NPC?

Edit2: I looked into it, and I got wrong idea about MWClass::NPC. It seems the only way would be to return Ptr and access it using MWClass::NPC.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Missing string replaces in NPC dialogues

Post by Zini »

Well, I will probably implement it for my own sake (but I won't insist on merging it into trunk). To avoid having 2 different string escapes I can add simple replacement in Interface::formatMessage for '^' => '%'?
Not good. You may hit some ^ that are not part of an escape sequence.
Edit: Also, would it be better to add to DialogueManager additional getters, like getName(), getRace(), getRank(), or just refactor usage of getFaction(), and just make only getActor() (should it return const Actor*, const Actor& and exception to catch, or Ptr to Actor, where Actor is MWClass::NPC?), adding necessary getters to MWClass::NPC?

Edit2: I looked into it, and I got wrong idea about MWClass::NPC. It seems the only way would be to return Ptr and access it using MWClass::NPC.
Please forgot about the DialogueManager. Except for putting in a call to the replace function you should not change it. Pass along a Ptr for the dialogue partner and you will be fine.
And you don't use anything from MWClass either. Go through the base class (MWWorld::Class).
Post Reply