Jump to content


Photo

Script Error in p#diriel


9 replies to this topic

#1 AstroBryGuy

AstroBryGuy

    Mod Tinker

  • Gibberlings
  • 504 posts
  • Gender:Male
  • Location:Savoy, Illinois, USA

Posted 02 August 2015 - 03:21 PM

Hi Domi,

 

I know IWDNPC2 is no longer supported, but I wanted to post up an error I found in Diriel's script. That way, others can make a fix before installing.

 

It's in P#DIRIE1.BAF, starting at line 1134 (in the Elven PC talks section, "prologue or later" subsection). The script block trigger has only one condition following an OR(2). I just removed the OR(2) from the trigger.

IF
InParty("Diriel") !Dead("Diriel") !StateCheck("Diriel",STATE_SLEEPING)
IsPlayerNumber("charbase",1)
GlobalTimerExpired("P#DirielPCTalkTimer","GLOBAL")
!AnyPCSeesEnemy()
GlobalTimerExpired("P#AllTimer","GLOBAL")
Global("P#DirielELFMatch","GLOBAL",1)
OR(2)
Global("P#DirielPCTalk","GLOBAL",1)
THEN
RESPONSE #100
IncrementGlobal("P#DirielPCTalk","GLOBAL",1)
SetGlobalTimer("P#DirielPCTalkTimer","GLOBAL",1)
SetGlobalTimer("P#AllTimer","GLOBAL",1800)
SetMusic(9,0)
PlaySound("diri000")
ActionOverride("diriel",StartDialogueNoSet(Player1))
END

Also, the version of sox bundled with v5 for audio processing on OSX is REALLY old (like 13 years old). It's so old, it doesn't run on modern Macs, (which use Intel chips instead PowerPC). It's simple enough to replace by the user, but I'd be happy to make a new OSX bundle with an updated sox.



#2 cmorgan

cmorgan

    journeyman investigator

  • Gibberlings
  • 7097 posts
  • Gender:Male
  • Location:Glencoe, IL, USA

Posted 02 August 2015 - 05:54 PM

I just found the same mistake in one of the OH files on 1.3 of BG2:EE - an OR(2) with only one var afterwards :)


I love deadlines. I love the whooshing noise they make as they go by. - Douglas Adams

#3 AstroBryGuy

AstroBryGuy

    Mod Tinker

  • Gibberlings
  • 504 posts
  • Gender:Male
  • Location:Savoy, Illinois, USA

Posted 03 August 2015 - 06:14 AM

Another note - this is probably not an error in IWD2NPC, but rather a problem for NearInfinity.

 

I noticed that some of the Dead() checks in IWD2NPC are checking on the Actor name from the ARE file, not the death variable in the CRE. I notice that the game scripts do this too, so I assume this an IWD2 improvement to the Dead() trigger (useful one too!).

 

NearInfinity, however, is choking on Dead() checks where the name being checked contains a space, e.g. ~Dead("Snow Leopard")~. So, I can't browse the modified DPLAYER3.BCS in NearInfinity. I'll report it to Argent77 as a bug for NearInfinity, since WeiDU doesn't appear to have any problems compiling/decompiling such scripts.

 

EDIT: Ah, looking at TRIGGER.iDS in IWD2 shows that they changed Dead() from checking only on S:Name to an Object check. Very useful. Also, the IESDP is wrong, it lists Dead() as still being a S:Name check.


Edited by AstroBryGuy, 03 August 2015 - 06:24 AM.


#4 lynx

lynx
  • Modders
  • 2864 posts
  • Gender:Male
  • Location:Ljubljana, Slovenija

Posted 03 August 2015 - 07:10 AM

 

I notice that the game scripts do this too

Do you have an example handy?


GemRB - IE anywhere.
Mages needed! Looking for Planescape: Torment testers
Market android version IS NOT SUPPORTED ANYMORE: reported bugs will be ignored! Still looking for builders ...

#5 AstroBryGuy

AstroBryGuy

    Mod Tinker

  • Gibberlings
  • 504 posts
  • Gender:Male
  • Location:Savoy, Illinois, USA

Posted 03 August 2015 - 07:31 AM

Sure.  This is from 1200T07M.BCS:

IF
	ActionListEmpty()
	Dead("07_Goblin_Elite_01")
THEN
	RESPONSE #100
		ChangeCurrentScript("00aMvW")
END

IF
	!IsScriptName("07_Goblin_Elite_01",Myself)
THEN
	RESPONSE #100
		MoveToObjectFollow("07_Goblin_Elite_01")
END

IF
	Global("ML_0","LOCALS",0)
	IsScriptName("07_Goblin_Elite_01",Myself)
	!TimerActive(19)
THEN
	RESPONSE #100
		StartTimer(19,5)
		SetGlobal("ML_0","LOCALS",1)
END

"07_Goblin_Elite_01" is the Name for Actor 94 in AR1200.ARE. The CRE is 12GobE.CRE, which has a death variable of 12GobE.

 

The script is using the Name from the Actor structure as the script name, rather than the CRE death variable.



#6 argent77

argent77
  • Modders
  • 632 posts
  • Gender:Male

Posted 03 August 2015 - 07:41 AM

I noticed that some of the Dead() checks in IWD2NPC are checking on the Actor name from the ARE file, not the death variable in the CRE. I notice that the game scripts do this too, so I assume this an IWD2 improvement to the Dead() trigger (useful one too!).

 

NearInfinity, however, is choking on Dead() checks where the name being checked contains a space, e.g. ~Dead("Snow Leopard")~. So, I can't browse the modified DPLAYER3.BCS in NearInfinity. I'll report it to Argent77 as a bug for NearInfinity, since WeiDU doesn't appear to have any problems compiling/decompiling such scripts.

It's a know problem of NI's script compiler and probably as old as Near Infinity itself. The decompiler is an ancient piece of code and it's very difficult to add any kind of more sophisticated parsing mechanism without completely rewriting the compiler. For now you'll have to avoid using spaces in object names if you want to open the script in NI.

 

The warning messages for creature names based on ARE Actor entries are harmless. They are generated by NI's script name lookup feature. To avoid these warning messages you could uncheck Options -> "Interactive script names" to disable script name lookups altogether.



#7 lynx

lynx
  • Modders
  • 2864 posts
  • Gender:Male
  • Location:Ljubljana, Slovenija

Posted 03 August 2015 - 07:51 AM

Ah yes, that's used aplenty.


GemRB - IE anywhere.
Mages needed! Looking for Planescape: Torment testers
Market android version IS NOT SUPPORTED ANYMORE: reported bugs will be ignored! Still looking for builders ...

#8 AstroBryGuy

AstroBryGuy

    Mod Tinker

  • Gibberlings
  • 504 posts
  • Gender:Male
  • Location:Savoy, Illinois, USA

Posted 03 August 2015 - 08:05 AM

Good to know, Argent77.
 
FYI, IWD2 does not have a DIFFLEVL.IDS file, but NI can't decompile three scripts in IWD2 without it. The scripts are 40INVIS1, 41PARENA, and 61IZBEL2. I think it's due to those scripts using the Difficulty() trigger. They are the only scripts to use it in IWD2 (unmodded). Adding the file DIFFLEVL.IDS from Camdawg's IWD1 Fixpack to override lets NI decompile the scripts.

 

WeiDU (v238) has an issue doing DECOMPILE_AND_PATCH on these files without DIFFLEVL.IDS too. So, anyone looking to mod IWD2 or use NI should add that file to their override.
 

Searched for: Difficulty(
Number of hits: 10
File: 40INVIS1.BCS  Text: Difficulty(NORMAL,GREATER_THAN)  Line: 65
File: 41PARENA.BCS  Text: Difficulty(EASIEST,EQUAL)  Line: 232
File: 41PARENA.BCS  Text: Difficulty(EASY,EQUAL)  Line: 241
File: 41PARENA.BCS  Text: Difficulty(HARD,EQUAL)  Line: 250
File: 41PARENA.BCS  Text: Difficulty(HARDEST,EQUAL)  Line: 259
File: 61IZBEL2.BCS  Text: Difficulty(EASIEST,EQUAL)  Line: 66
File: 61IZBEL2.BCS  Text: Difficulty(EASY,EQUAL)  Line: 76
File: 61IZBEL2.BCS  Text: Difficulty(NORMAL,EQUAL)  Line: 86
File: 61IZBEL2.BCS  Text: Difficulty(HARD,EQUAL)  Line: 96
File: 61IZBEL2.BCS  Text: Difficulty(HARDEST,EQUAL)  Line: 106

Edited by AstroBryGuy, 03 August 2015 - 08:08 AM.


#9 argent77

argent77
  • Modders
  • 632 posts
  • Gender:Male

Posted 03 August 2015 - 08:22 AM

FYI, IWD2 does not have a DIFFLEVL.IDS file, but NI can't decompile three scripts in IWD2 without it. The scripts are 40INVIS1, 41PARENA, and 61IZBEL2. I think it's due to those scripts using the Difficulty() trigger. They are the only scripts to use it in IWD2 (unmodded). Adding the file DIFFLEVL.IDS from Camdawg's IWD1 Fixpack to override lets NI decompile the scripts.

 

WeiDU (v238) has an issue doing DECOMPILE_AND_PATCH on these files without DIFFLEVL.IDS too. So, anyone looking to mod IWD2 or use NI should add that file to their override.

 

The problem lies in the game resources themselves. More specifically, entries in TRIGGER.IDS, such as this

0x40AB Difficulty(I:Level*DiffLevl,I:Mode*diffmode)

tell the compiler to look up symbolic values in DIFFLEVL.IDS for the first parameter. Fixpacks should either provide a DIFFLEVEL.IDS or remove "DiffLevl" from trigger definitions to fix this issue.
 


Edited by argent77, 03 August 2015 - 08:23 AM.


#10 AstroBryGuy

AstroBryGuy

    Mod Tinker

  • Gibberlings
  • 504 posts
  • Gender:Male
  • Location:Savoy, Illinois, USA

Posted 03 August 2015 - 10:12 AM

Thanks. I've made the suggestion over at SHS for the DIFFLEVL.IDS file to be added to Almateria's IWD2 Fixpack.





Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users