Jump to content

Seniyad helper druids not attacking


Taimon

Recommended Posts

This should probably go into the fixpack or WeiDU forum, but since I encountered the problem with SCS I'll post it here.

 

When I helped Aldeth against the druids on the first cloakwood map, the "helper druids" were not turning hostile. I looked at the scripts and they were waiting for a variable.

 

It turns out that the installation of priest/dw#seni.d did not work as intended, because there was no 'Shout(1)' in seniya.dlg which could be replaced. It had been replaced before and looked like 'Shout(ATTACK1)'. (Same goes for 'Shout(3)', which became 'Shout(HELP3)'.)

 

This was caused by the installtion of the "BG2 Fixpack Modder Pack" combined with BGT. (in that order)

The Modder Pack adds some entries in shoutids.ids. (e.g. 1 -> ATTACK1, 3 -> HELP3)

BGT brings his own version of seniya.d. When this is compiled, WeiDU replaces the shout id (1) with the corresponding value in shoutids.ids (ATTACK1). (btw. same goes for cyderm.d)

 

To reproduce this you simply need to do this:

- clean install of BG2 (still has seniya.dlg)

- install bg2fixpack modder pack

- "weidu seniya.dlg"

- "weidu seniya.d"

- now examine the created seniya.dlg and the ids should have been replaced

[i used WeiDU v203.]

 

Took me quite some time to track this down, so hopefully it'll save someone else some time.

Link to comment

Thank you for reporting!

I will take a look and see what can be done. I may turn it over to Milcoch for fancier scripting, but there is a quick way of fixing this to work correctly by adding a block which emulates the Shout(1) needed:

 

IF
<<attacked by anyone>>
THEN
ActionOverride(<<druidsDV1>>,Enemy())
ActionOverride(<<druidsDV2>>,Enemy())
Enemy())
END

and dropping it on all the actors in this particular drama.

 

Most of our code actually does this, as we try to avoid dealing with combat scripts unless absolutely necessary; I took a quick look for Shout( in project files, and came up with this:

 

Searching for: Shout(

lib\tob2soa.tph(28): REPLACE_TEXTUALLY ~^106 Shout(.*$~ ~106 Shout(I:ID*SHOUTIDS)~

phase2\baf\x#jessup.baf(6): Shout(99)

phase2\baf\x#jessup.baf(14): Shout(99)

phase2\baf\x#runcor.baf(7): Shout(124)

phase2\baf\x#xzjell.baf(5): Shout(151)

phase2\baf\x#xzjell.baf(34): Shout(151)

phase2\baf\x#xzjell.baf(42): Shout(151)

phase2\baf\x#xzjell.baf(52): Shout(151)

phase2\baf\x#xzslim.baf(5): Shout(151)

phase2\baf\x#xzslim.baf(35): Shout(151)

phase2\baf\x#xzslim.baf(43): Shout(151)

phase2\baf\x#xzslim.baf(53): Shout(151)

phase2\dlg\x#jaqu.d(134): IF ~Global("X#JaheiraQuestHelpAldeth","GLOBAL",1)~ THEN DO ~SetGlobal("X#JaheiraQuest","GLOBAL",10) ActionOverride("jaheira",LeaveParty()) ActionOverride("jaheira",EscapeArea()) ActionOverride("khalid",LeaveParty()) ActionOverride("khalid",EscapeArea()) ActionOverride("seniyad",Shout(1)) ActionOverride("seniyad",Enemy())~ EXIT

phase2\dlg\x#jaqu.d(163): IF ~Global("X#JaheiraQuestHelpAldeth","GLOBAL",1)~ THEN DO ~SetGlobal("X#JaheiraQuest","GLOBAL",10) ActionOverride("jaheira",LeaveParty()) ActionOverride("jaheira",EscapeArea()) ActionOverride("khalid",LeaveParty()) ActionOverride("khalid",EscapeArea()) ActionOverride("seniyad",Shout(1)) ActionOverride("seniyad",Enemy())~ EXIT

phase2\dlg\x#jaqu.d(193): IF ~~ THEN DO ~Shout(1) Enemy() SetGlobal("X#JaheiraQuest","GLOBAL",10) AddexperienceParty(5000) SetGlobal("KilledDruids","GLOBAL",4) SetGlobal("HelpAldeth","GLOBAL",1)~ JOURNAL @159 EXIT

phase2\dlg\x#jaqu.d(568): IF ~~ THEN DO ~AddexperienceParty(5000) GiveItemCreate("X#JACLUB",Player1,1,0,0) SetGlobal("SeniyadXP","GLOBAL",1) Shout(3) EscapeArea()~ JOURNAL @169 EXIT

phase2\dlg\x#jaqu.d(583): IF ~~ THEN DO ~AddexperienceParty(5000) GiveItemCreate("X#JACLUB",Player1,1,0,0) SetGlobal("SeniyadXP","GLOBAL",1) Shout(3) EscapeArea()~ JOURNAL @169 EXIT

phase2\dlg\x#jaqu.d(589): IF ~~ THEN DO ~AddexperienceParty(10000) GiveItemCreate("X#JACLUB",Player1,1,0,0) SetGlobal("SeniyadXP","GLOBAL",1) Shout(3) EscapeArea()~ JOURNAL @169 EXIT

phase2\dlg\x#jaqu.d(599): IF ~~ THEN DO ~AddexperienceParty(5000) GiveItemCreate("X#JACLUB",Player1,1,0,0) SetGlobal("SeniyadXP","GLOBAL",1) Shout(3) EscapeArea()~ JOURNAL @169 EXIT

phase2\dlg\x#jaqu.d(606): IF ~~ THEN DO ~AddexperienceParty(5000) GiveItemCreate("X#JACLUB",Player1,1,0,0) SetGlobal("SeniyadXP","GLOBAL",1) Shout(3) EscapeArea()~ JOURNAL @169 EXIT

phase2\dlg\x#kiint.d(366): IF ~~ THEN DO ~Enemy() Shout(1) ~ SOLVED_JOURNAL @86

Found 21 occurrence(s) in 7 file(s)

so not much ground to cover :band:

Link to comment

It's a bit late here and I didn't really understand your reply, sorry. ;)

 

First, I already fixed the druid problem for myself (forgot to mention it, sorry) but thanks anyway.

 

I'm not so sure you really got my point, so I want to summarize it again:

Some mods (like SCS) expect to see 'Shout(1)' (they want to do something like REPLACE_ACTION_TEXT on it) but there only is a 'Shout(ATTACK1)', so the replace action fails. This 1 -> ATTACK1 substitution happens when the Modder Pack (shoutids.ids) is installed and a .D file with Shout(1) is compiled by WeiDU (like seniya.d in BGT).

 

Is this intended behaviour of WeiDU?

I tried looking in the source code but Ocaml seems beyond my programming skills. :band: (Must be somewhere in dc.ml or dparser.mly)

Maybe I'll have another look at it tomorrow.

Link to comment
I will take a look and see what can be done. I may turn it over to Milcoch for fancier scripting
I was under the impression this was an SCS issue, not BG1NPC. In any case, I already fixed the BG1NPC issues where it's relevant in my last build, or recommended what needed to be done (as I recall, basically Seniyad needs to do a Shout(3), though now that I'm thinking about it, that was to get the druids to follow him when he leaves, not attack when he does, which I think was working ok...).
Is this intended behaviour of WeiDU?
Quite possibly. Of course, an intelligently-enough-constructed REPLACE_TEXTUALLY with regexp could account for either occurrence.
Link to comment

@Taimon - ahh - perhaps I did not completely understand. But I will go back over it!

 

In terms of BG1 NPC, you are saying that if the Modder Pack is installed and BGT is installed and BG1 NPC is installed onto that base platform, the code line

 

phase2\dlg\x#jaqu.d(134):

IF ~Global("X#JaheiraQuestHelpAldeth","GLOBAL",1)~ THEN DO ~SetGlobal("X#JaheiraQuest","GLOBAL",10) ActionOverride("jaheira",LeaveParty()) ActionOverride("jaheira",EscapeArea()) ActionOverride("khalid",LeaveParty()) ActionOverride("khalid",EscapeArea()) ActionOverride("seniyad",Shout(1)) ActionOverride("seniyad",Enemy())~ EXIT

 

fails to work as expected. This is because the Shout call here:

ActionOverride("seniyad",Shout(1))

does not parse correctly under those circumstances.

 

Miloch is indicating this is an SCS problem (and probably he is correct); it is happenng with .ids calls, and SCS may need to adjust their regexp to catch SuperHappyFunLucky Modder Pack installs.

 

 

 

But in BG1 NPC, the usual practice is to avoid Shout and similar in favor of a more direct approach. We would recode the instance as

 

ActionOverride("shdruid6",Enemy())

ActionOverride("shdruid6a",Enemy())

ActionOverride("seniyad",Enemy())

 

We do this in 99% of the cases, so our response to this is to replace the Shout() calls to match the rest of our code, thus avoiding the problem, whomever it belongs to :band:

 

(Since we want everyone to install BG1 NPC on any platform and combo possible, sticking with as low level a function call as possible insures that it is darned hard to break stuff. Which reminds me - I need to go back and recode all those MASK_GOOD alignment checks...)

Link to comment

@cmorgan: I did not mention BG1NPC at all, that's why I was a little confused about your reply. :band: (I don't even have it installed at the moment.)

 

Miloch is right, this is an SCS issue (that's why I posted it here) but there may be some other mods whose authors are not aware of this "shout id substitution" upon compilation.

 

I finally was able to dig into the WeiDU code and found the relevant parts. This is definitely intended. (For the interested: Take a look at bcs.ml and search for print_arg_list [918] and sym_of_int [547] – arg_file is parsed in idsparser.mly [52])

 

/Edit:

While I was fixing the scripts for myself I noticed something different: REPLACE_ACTION_TEXT is case-sensitive. There are some parts of SCS that ignore this fact. For example in gretek.d, SCS tries to replace ActionOverride("wilf", ...) but in my gretek.dlg it looked like ActionOverride("WILF", ...)

 

/Edit2:

There is a TP2 action that may help fixing the Shout problem: LOOKUP_IDS_SYMBOL_OF_INT. The regex should include both values (number and symbol) because the substitution only occurs on compilation.

LOOKUP_IDS_SYMBOL_OF_INT s_1 ~shoutids~ 1

REPLACE_ACTION_TEXT ~mydialog~
~Shout(1\|%s_1%)~
~SetGlobal(...)~

This is untested, though.

Link to comment

Cool stuff - I should have been clearer the first time that I was on a sideline, and not on point :)

 

also to help, CASE_INSENSITIVE is available; I bet it can be applied to REPLACE_ACTION_TEXT;

 

REPLACE_TEXTUALLY CASE_INSENSITIVE ~^_MINSCJ\( +[^ ]+ +[^ ]+ +\)[^ ]+~ ~_MINSCJ\1_MINSCD~

Link to comment

And I should have slept before answering, because I had no problem understanding your post this morning. :)

 

I also looked at the CASE_INSENSITIVE modifier but this can not be applied to REPLACE_ACTION_TEXT. (Same goes for REPLACE_TRIGGER_TEXT and family.)

At least not up to WeiDU v203. I checked the README and the code.

(The reason behind this is, that these actions are in a different parser than REPLACE_TEXTUALLY. I guess if someone askes the_bigg nicely, he will be able to code it in five minutes. Although, testing takes more time. ;) )

Link to comment
I also looked at the CASE_INSENSITIVE modifier but this can not be applied to REPLACE_ACTION_TEXT. (Same goes for REPLACE_TRIGGER_TEXT and family.)
Well, I guess until bigg codes this, one will have to resort to even uglier regexp like REPLACE_ACTION_TEXT ~[Ww][ii][Ll][Ff]~ ~...~ or just give two statements - one for each case.
Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...