Jump to content


Photo

bug in ARU002.baf/bcs


  • Please log in to reply
9 replies to this topic

#1 10th

10th
  • Member
  • 621 posts

Posted 17 July 2011 - 09:45 AM

A user over at the kerzenburg forums reported that he did not get any xp for defeating the demon cultists in Ulgoth's Beard.

He killed almost every cultist in ARU002.are and then killed Aec'Letec. Unfortunately one cultist remained, which meant that Aec'Letec replaced this cultist. Afterwards every cultist and Aec'Letec were dead, but the party did not receive xp for defeating them.

After checking some Globals the problem was narrowed down to the following and similar script blocks in ARU002.bcs:

IF
 Dead("tanar") // Aec'Letec
 !Dead("cultd1") // Wächter des Kultes
THEN
 RESPONSE #100
 ForceSpell("cultd1",TANARI_CHANGE)
 SetGlobal("Sprite_Is_DeadCultd1","GLOBAL",0)
 SetGlobal("Sprite_Is_DeadTanar","GLOBAL",0)
END

Due to SetGlobal("Sprite_Is_DeadCultd1","GLOBAL",0) and the other five SetGlobal()s similar to this one, the following will never be true as those cultists are no longer 'dead':

IF
	Dead("cultd1")
	Dead("cultd2")
	Dead("cultd3")
	Dead("cultd4")
	Dead("cultd5")
	Dead("cultd6")
	Dead("tanar")
	Global("TanariXP","GLOBAL",0)
THEN
	RESPONSE #100
		SetGlobal("TanariXP","GLOBAL",1)
		AddexperienceParty(16000)
		AddJournalEntry(87991,QUEST_DONE) // Retrieve Hurgan's dagger. I was too late in stopping the cultists from summoning the evil demon, so there was no option but to slay it before it wreaked havoc within Ulgoth's Beard and beyond. The battle was quite difficult, I must admit...whenever I thought he was dead, he took the souls of his worshippers and fed it into his own lifeforce. I should tell Hurgan this.
		EraseJournalEntry(87533) // Retrieve Hurgan's dagger. A dwarf named Hurgan Stoneblade has an employment opportunity for us if we wish to hear about it. He is staying at the inn of Ulgoth's Beard.
		EraseJournalEntry(87534) // Retrieve Hurgan's dagger. We have been asked to retrieve an enchanted dagger from Durlag's Tower called 'Soultaker' by Hurgan Stoneblade. The dagger is a family heirloom that he wishes us to return to him in Ulgoth's Beard. The Tower is rumored to be heavily trapped.
		EraseJournalEntry(87535) // Retrieve Hurgan's dagger. Hurgan hadn't told us everything when he sent us to retrieve the dagger. It appears that the dagger contains the soul of an evil demon that killed Hurgan's grandfather. The people that ambushed us are members of the cult that worships the beast. Hurgan believes that they wish to bring the demon back to life within their house in Ulgoth's Beard. Hurgan would like us to stop them.
		EraseJournalEntry(87536) // Retrieve Hurgan's dagger. I was attacked after returning from Durlag's Tower. They wished a dagger I had found, and when I would not turn it over, they attacked and stole it. I shall have to look into this.
		EraseJournalEntry(87537) // Retrieve Hurgan's dagger. Odd... someone I had never met approached me after I returned from the tower. They demanded the dagger I took from Durlag's death chamber. I gave him the item as requested though he seemed none too grateful. What he wanted with such a trinket, I do not know.
		SetGlobal("DaemonCultFinish","GLOBAL",1)
END

Google translate of thread over at kerzenburg

10th

Edited by 10th, 17 July 2011 - 09:48 AM.

Avast! You cannot defeat our titan-mounted submarine staffed by cannibal vikings! - Nodwick

"I grab his deceased spirit and piledrive it back into his body, duplicating raise dead." - Psyren Oots board

#2 Turambar

Turambar
  • Modder
  • 935 posts

Posted 19 July 2011 - 12:23 AM

After checking some Globals the problem was narrowed down to the following and similar script blocks in ARU002.bcs:

IF
 Dead("tanar") // Aec'Letec
 !Dead("cultd1") // Wächter des Kultes
THEN
 RESPONSE #100
 ForceSpell("cultd1",TANARI_CHANGE)
 SetGlobal("Sprite_Is_DeadCultd1","GLOBAL",0)
 SetGlobal("Sprite_Is_DeadTanar","GLOBAL",0)
END

I think this block should swap the two death variables, instead of setting them both to 0 (since the cultist is not dead, I can't see why his DV should be set to 0...). IMO, the correct block should be:
IF
 Dead("tanar") // Aec'Letec
 !Dead("cultd1") // Wächter des Kultes
THEN
 RESPONSE #100
 ForceSpell("cultd1",TANARI_CHANGE)
 SetGlobal("Sprite_Is_DeadCultd1","GLOBAL",[b]1[/b])
 SetGlobal("Sprite_Is_DeadTanar","GLOBAL",0)
END

IF
	Dead("cultd1")
	Dead("cultd2")
	Dead("cultd3")
	Dead("cultd4")
	Dead("cultd5")
	Dead("cultd6")
	Dead("tanar")
	Global("TanariXP","GLOBAL",0)
THEN
	RESPONSE #100
		SetGlobal("TanariXP","GLOBAL",1)
		AddexperienceParty(16000)
		AddJournalEntry(87991,QUEST_DONE) //bla bla bla
		[other journal entries]
		SetGlobal("DaemonCultFinish","GLOBAL",1)
END

Should those "Dead()" triggers be changed with 'Global("SPRITE_IS_DEAD.."...)' triggers? I've read somewhere that they work better in BG2.

I have not checked if that works or if it has other side-effects, but I will check it in some days time.
Will it be directly fixed in BGT, or do you prefer that I add a fix for that in my fix mod (I hope to release a new version soon)?

Google translate of thread over at kerzenburg

I had a look there, and wanted to access the original page as well... For some mysterious reason, my ISP (which is my local telecom, not a mysterious offshore company...) is banned from that website:

Spammer tolerant host network. -> rmatch("retail.telecomitalia.it")


Edited by Turambar, 19 July 2011 - 12:36 AM.

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#3 -Hurricane-

-Hurricane-
  • Guest

Posted 19 July 2011 - 04:47 AM

I vote for this issue being addressed within BGT. The mod already fixes a great couple of bugs from the original BG1 code material, that's why most users rely on BGT as a self-sufficient fixpack for that part of the game. Hence for any problems that surface during the BG1 part, BGT should take care of them, no matter whether they originate from BG1 or are introduced by the mod itself.

#4 10th

10th
  • Member
  • 621 posts

Posted 19 July 2011 - 08:30 AM

@Hurricane
Actually BGT introduces this bug, therefore it's preferable if it fixes its own bugs.


If it's not fixed in BGT, I'd vote for an inclusion in the BWP Fixpack in the meantime, but that's probably a given.

10th
Avast! You cannot defeat our titan-mounted submarine staffed by cannibal vikings! - Nodwick

"I grab his deceased spirit and piledrive it back into his body, duplicating raise dead." - Psyren Oots board

#5 Turambar

Turambar
  • Modder
  • 935 posts

Posted 19 July 2011 - 09:52 AM

I've installed a new copy of BGT, almost unmodded, and I don't apparently have your bug.
Despite the script being the same as the one you posted, I tried killing the cultists and aec-letec(s) in different orders, and I always got the reward and journal entry.
I must say I only tested it by ctrl+Y-ing them.
Perhaps, it might have to do with the Dead(...) trigger as well, because the script, as it is now, should work as you reported, and I don't understand why I still get my exp...

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#6 10th

10th
  • Member
  • 621 posts

Posted 19 July 2011 - 12:58 PM

I thought that maybe TobEX beta 20 could be causing it, but after looking through the ini-file I doubt it, as there seems to be no entry that deals with possible problems (dead() trigger, parsing of variables).

10th
Avast! You cannot defeat our titan-mounted submarine staffed by cannibal vikings! - Nodwick

"I grab his deceased spirit and piledrive it back into his body, duplicating raise dead." - Psyren Oots board

#7 Turambar

Turambar
  • Modder
  • 935 posts

Posted 20 July 2011 - 02:01 AM

I thought that maybe TobEX beta 20 could be causing it, but after looking through the ini-file I doubt it, as there seems to be no entry that deals with possible problems (dead() trigger, parsing of variables).

10th

I did test it with tobex (it's required for bgt music, now), and I did get the XP.

first, I'll add a SPOILER warning, so that I can describe things clearly below







Next, my script is just like yours:
IF
	Dead("tanar")
	!Dead("cultd1")
THEN
	RESPONSE #100
		ForceSpell("cultd1",TANARI_CHANGE)
		SetGlobal("Sprite_Is_DeadCultd1","GLOBAL",0)
		SetGlobal("Sprite_Is_DeadTanar","GLOBAL",0)
END








I CLUACed to the area and Set cult1 to 1 => the cultists appeared. They talked, the demon appeared, I paused the game.
I checked all DVs, all were not set yet.
So, I ctrl+y-ed the demon (keeping the game paused), and checked DVs again: the demon's was set to 1, cultist 1's was still not yet set. (hence, it works as expected).
I unpaused, the cultist transformed into the demon, I paused again and checked variables: the demon's DV was 0 again, as expected.
The cultist's was 1, which appears contraddictory with the first SetGlobal instruction (which IMO should be removed anyway).
Perhaps, the spell takes some more time to take effect than the script does to change the cultist's DV, or some other strange bug happens, and the DV is not decreased (as should happen due to the script), and this second bug solves the bug in the script; maybe, the person you talked about had that delay issue solved for other mysterious reasons.
I'll try removing the first SetGlobal from the script and see if it works
edit: removing all SetGlobal("Sprite_Is_DeadCultd[1-6]","GLOBAL",0) does not create any problem, so I'd suggest to change the BGT script like that, in order to avoid any problem. Let's wait for Asc64

BTW, I checked the spell; it has all durations set to 0/instant, so that should not be a problem. I've noticed it uses a 9th level mage (SPWI) spell slot; wouldn't it be better to change its name to, say, BGTCULTD.spl, and use the ForceSpellRES action, so that it doesn't take one of the limited slots which should be used for usable 9th level spells?

Edited by Turambar, 20 July 2011 - 02:49 AM.

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#8 Ascension64

Ascension64
  • Modder
  • 5983 posts

Posted 23 July 2011 - 06:29 PM

Probably a typo in the fix for a Dead() trigger problem. I think the issue was killing multiple cultists at the same time with a big fireball, which seems to cause all kinds of sporadic, non-reproducible problems with Dead() and Die() triggers.
The extra SetGlobal for the CULTD# was to fix an issue for BGT 1.02

Fixed a bug where killing Aec’Letec would not result in the gaining of experience and the completion of the quest if one of the cultists transformed into Aec’Letec

I probably typo'ed the fix meaning to set the global to 1 rather than 0. Will fix.

ForceSpell() is a BG1 construct kept in BG2, so that will stay.

Edited by Ascension64, 23 July 2011 - 06:32 PM.

--------------
Retired Modder
Note: I do not respond to profile comments/personal messages in regards to troubleshooting my modifications. Please post on the public forums instead.

Baldur's Gate Trilogy-WeiDU and Mods
Throne of Bhaal Extender (TobEx)

Contributions: (NWN2) A Deathstalker (voice acting) - (IWD2) IWD2 NPC Project (soundset editing) - (Misc) SHS PC Soundsets (voice acting)
Legacy: (BG/Tutu/BGT) Beregost Crash Fixer 1.9 (18 Jul 10) - (BG2) Enable conversations with charmed/dominated creatures (18 Jul 10) - (BG2) Experience Corrections (18 Jul 10) - (Misc) Platform Conversion Utility RC2 (13 Feb 10)


#9 Turambar

Turambar
  • Modder
  • 935 posts

Posted 24 July 2011 - 12:43 AM

ForceSpell() is a BG1 construct kept in BG2, so that will stay.

I don't mean you should use a different action than ForceSpell(), but only that it would be better (for compatibility with other mods) if you used prefixes instead of using 9th level spells (as suggested by Galactygon here).
Since only spells which have the SPWI[level][00-99] name can be learnt by sorcerers, and some SPWI9[00-99] spells have already been used by HLAs, it is very difficult to add 9th level spells to the games and completely integrate them into the game.
So, my suggestion would be to use a different name for the spell (such as BG1[name].SPL); you could use the same ForceSpell action but would have to change its syntax a little: from iesdp,

113 ForceSpell(O:Target,I:Spell*Spell)
113 ForceSpellRES(S:RES*, O:Target)
113 ForceSpellRES(S:RES*, O:Target,I:CastingLevel)

is the same action (#113), and can be written in different ways depending whether the spell is in the SP... form or prefixed.

Edited by Turambar, 24 July 2011 - 12:44 AM.

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#10 Ascension64

Ascension64
  • Modder
  • 5983 posts

Posted 24 July 2011 - 02:09 AM

Well if you come across a mod that overrides the use of TANARI_CHANGE, then let me know.
The scripting and the spell came straight from BG1.

--------------
Retired Modder
Note: I do not respond to profile comments/personal messages in regards to troubleshooting my modifications. Please post on the public forums instead.

Baldur's Gate Trilogy-WeiDU and Mods
Throne of Bhaal Extender (TobEx)

Contributions: (NWN2) A Deathstalker (voice acting) - (IWD2) IWD2 NPC Project (soundset editing) - (Misc) SHS PC Soundsets (voice acting)
Legacy: (BG/Tutu/BGT) Beregost Crash Fixer 1.9 (18 Jul 10) - (BG2) Enable conversations with charmed/dominated creatures (18 Jul 10) - (BG2) Experience Corrections (18 Jul 10) - (Misc) Platform Conversion Utility RC2 (13 Feb 10)