Jump to content


Photo

Near Infinity checks scripts


  • Please log in to reply
16 replies to this topic

#1 Jewish

Jewish
  • Member
  • 77 posts

Posted 19 October 2004 - 04:00 AM

I've been messing a bit more with NI functions, and it found 1016 errors in triggers and actions files and 1125 errors in scripts (doh!). Some of them are typos, too many/few arguments, missing quotes, argument not found in X.IDS.

Few of them I know how to fix, others I have no clue what is wrong. Some examples:

Too few arguments

TakePartyItem("MISC4Q")
DestroyItem("MISC4Q")
AddexperienceParty(18500)
SetGlobal("AerieTransform","GLOBAL",1)
Wait(1)
Polymorph(MAGE_FEMALE_ELF)
ApplySpell(Myself,AERIE_PORTRAIT)
Wait(2)
StartDialogueNoSet()

In ACTION.IDS: StartDialogNoSet(O:Object*) - 198

Missing quotes

SetGlobal("D0PrisonersFree","GLOBAL",1)
IG("D0Chg2",0,1)
IncrementGlobal("D0Change","GLOBAL",1)
DialogueInterrupt(FALSE)
DestroySelf()

In ACTION.IDS: IG(S:GLOBAL*,S:Area*D0VTYPE,I:Value*) - 163

Too few arguments - Here I assume the state is missing (duh)

IF
!RandomNum(6,4)
OR(2)
!HasBounceEffects(FourthNearestEnemyOf(Myself))
GlobalTimerNotExpired("xyxDoesNotSeeBounce","LOCALS")
OR(2)
GlobalTimerNotExpired("xyxDoesNotSeeBounce","LOCALS")
!HasItemEquiped("CLCK26",FourthNearestEnemyOf(Myself)) // Cloak of Mirroring
!StateCheck(FourthNearestEnemyOf(Myself),)
CheckStat(FourthNearestEnemyOf(Myself),0,SANCTUARY)
OR(2)
GlobalTimerNotExpired("xyxDoesNotSeeImmunity","LOCALS")
CheckStatLT(FourthNearestEnemyOf(Myself),50,RESISTMAGIC)
!Name("Viconia",FourthNearestEnemyOf(Myself))
!HasItem("MINHP1",FourthNearestEnemyOf(Myself)) // No such index
!HasItem("IMOENHP1",FourthNearestEnemyOf(Myself)) // Imoen's Belt
See(FourthNearestEnemyOf(Myself))
False()
THEN
RESPONSE #100
END

In TRIGGER.IDS: StateCheck(O:Object*,I:State*State) - 16439

Well, you get the idea. I'm wondering if NI is going nuts and find errors where there are not... or indeed the errors are there and I'll have to manually fix them? (I guess the shortest way to fix these things is to find their original baf and do it there?)

EDIT:

Some of these scripts might belong to mods, I don't know and probably don't care much. I'm just trying to learn stuff the hard way... so the above are examples and just that.

Just to be clear :)

Edited by Jewish, 19 October 2004 - 04:15 AM.


#2 Jewish

Jewish
  • Member
  • 77 posts

Posted 19 October 2004 - 04:24 AM

Ok, what I'm trying to learn here is why there are so many arguments in scripts that seem incomplete according to their X.IDS.

For Example, if I set in a script this

IF

blah

THEN

CreateCreature("whatever",[500.600])

END

NI will say that it is erroneus, incomplete, because I don't specify to where should face the creature. But ingame the creature spawns normally.

So many of these errors do not seem to be such, just a way to do things without writting too much?

#3 SimDing0

SimDing0

    GROUP ICON

  • Member
  • 1654 posts

Posted 19 October 2004 - 04:27 AM

IG("D0Chg2",0,1) isn't an error. NI just doesn't like it because I've introduced syntax that wasn't supported by the original game. In this respect, the checker is minorly flawed.
Repeating cycle of pubes / no pubes.

A Comprehensive Listing of IE Mods

#4 Jewish

Jewish
  • Member
  • 77 posts

Posted 19 October 2004 - 04:45 AM

I was just looking at that part heh.

So it's possible to add arguments (S:Area*D0VTYPE?) in the .IDS not supported by the game engine. I guess that goes beyond my capacity, I still have not learnt how to make .IDS lines.

ps: I have read your tutorial btw, great stuff.

#5 SimDing0

SimDing0

    GROUP ICON

  • Member
  • 1654 posts

Posted 19 October 2004 - 06:24 AM

So it's possible to add arguments (S:Area*D0VTYPE?) in the .IDS not supported by the game engine. I guess that goes beyond my capacity, I still have not learnt how to make .IDS lines.

Yes, it's quite possible. I've given a more detailed explanation of how it works here. I believe my scripting guide also mentions IDS editing briefly.

ps: I have read your tutorial btw, great stuff.

Thanks. Hope you found it useful.
Repeating cycle of pubes / no pubes.

A Comprehensive Listing of IE Mods

#6 Jewish

Jewish
  • Member
  • 77 posts

Posted 19 October 2004 - 07:41 AM

Oookay, I think I got it now. You basically reference the String to another .IDS (D0VTYPE.IDS). You had to do this because WeiDU did not have the new command mentioned in the other thread, so your number of characters had to match with the number of the action that you were trying to replace (this is pure guessing btw, I don't have a clue of WeiDU... yet).

Wow. Simple as.

#7 SimDing0

SimDing0

    GROUP ICON

  • Member
  • 1654 posts

Posted 19 October 2004 - 08:06 AM

That's pretty much it, yes.
Repeating cycle of pubes / no pubes.

A Comprehensive Listing of IE Mods

#8 -Rastor-

-Rastor-
  • Guest

Posted 19 October 2004 - 12:28 PM

I'd use DLTCEP to check scripts. It's a bit less overzealous in what it goes after.

StartDialogueNoSet()


That actually is an error. StartDialougueNoSet(Myself) will fix that problem.

#9 hlidskialf

hlidskialf

    Incarnation of the Eternal Ale Warrior

  • Modder
  • 2510 posts

Posted 19 October 2004 - 12:32 PM

Most cases of (Myself) can be replaced with a simple () without a script error in game.

The great wolf Fenrir gapes ever at the dwelling of the gods.


#10 Jewish

Jewish
  • Member
  • 77 posts

Posted 20 October 2004 - 06:06 AM

I see. So it's possible to cut certain parts of the code without errors in the game. This must be the case in the last script example aswell.

!StateCheck(FourthNearestEnemyOf(Myself),)
Here the script is missing the STATE itself from STATE.IDS, but there is no real need to put it there tho.

I should be fine guessing them by looking at the script then.

EDIT:

One last thing. I've noticed in some scripts (Aerie scripts mainly) some areas marked as OUTSIDE, but in AREATYPE.IDS there is no OUTSIDE flag.

Is there any reason for this, or it is a mistake?

Edited by Jewish, 20 October 2004 - 06:11 AM.


#11 Stone Wolf

Stone Wolf
  • Member
  • 1672 posts

Posted 20 October 2004 - 06:17 AM

I can't find any instances of Outside in any of her scripts, though I do have some mods installed. What I did find was Outdoor, which is in Areatype.ids. Is there anything else in the block that would help me find it?

Edited by Stone Wolf, 20 October 2004 - 06:18 AM.


#12 Jewish

Jewish
  • Member
  • 77 posts

Posted 22 October 2004 - 06:46 AM

Sorry for the late response, I have noticed your answer today.
So far I only found this issue in Aerie, Anomen and Minsc dialogues.

AERIEJ.DLG State trigger 14 (Also in 15 and 16)

GlobalTimerExpired("AerieRemindsQuayle","GLOBAL")
Global("AerieReminder","LOCALS",0)
Global("QuayleJob","GLOBAL",0)
AreaType(OUTSIDE)
AreaType(CITY)
!AreaCheck("AR2000")
CombatCounter(0)
Global("HaerDalisPlotStarted","GLOBAL",0)
Global("HaerDalisFree","GLOBAL",0)

BANOMEN.DLG state trigger 34

PartyRested()
AreaType(OUTSIDE)
See(Player1)
!StateCheck(Player1,STATE_SLEEPING)
Global("BAnomen4","LOCALS",0)

MINSCJ.DLG State trigger 19 (also in 20)

GlobalTimerExpired("MinscRemindsImnesvale","GLOBAL")
Global("TalkedToLloyd","GLOBAL",0)
Global("VillageSaved","GLOBAL",0)
AreaType(OUTSIDE)
!AreaCheck("AR1100")
!AreaCheck("AR1400")
See(Player1)
!StateCheck(Player1,STATE_SLEEPING)
Global("MinscReminder","LOCALS",0)



Unfortunately I have also found a great ammount of typos in the game scripts (missing a letter, parenthesis, etc...) I just thought that maybe it's not worth checking them one by one, there are lots. :(

Edited by Jewish, 22 October 2004 - 06:50 AM.


#13 Stone Wolf

Stone Wolf
  • Member
  • 1672 posts

Posted 22 October 2004 - 07:47 AM

Well, I checked my MinscJ.dlg and it has Outdoor in those spots. I guess some mod or patch fixed those. :unsure:

#14 Jewish

Jewish
  • Member
  • 77 posts

Posted 22 October 2004 - 12:27 PM

That's possible I guess.
I have not found any area coded as outside tho, and as I said the areatype.ids just has outdoor.

Thanks for the answer anyway Stone Wolf!

#15 -Guest-

-Guest-
  • Guest

Posted 22 October 2004 - 01:27 PM

Here are some notes for those new to script checking with or without NI...

1. BCS scripts are compiled, so any legal changes to IDS files during game development or while you are editing or installing mods will automatically be used when the script is decompiled for editing or excecuted by the game.

2. DLG scripts are not compiled, but instead are in ASCII text format like a BAF file. Any changes to IDS files will not automatically be reflected in DLG scripts. Thus either the IDS files have to keep the old specification for the sake of all the DLG files (easier), or all the DLG files need to be updated to be in line with the IDS files (more work).

3. NI bases it's script-checking decisions on, what the author considers to be, "correct" IDS files. This means that any streamlined encodings, such as what Sim did, will give NI fits, even if the game accepts them.

4. Like every other developer, Bioware left many bugs in the game. Though they released patches for awhile, the patches addressed mostly the major bugs that were most noticeable. But due to time and money constraints, they could not release patches forever. So today, in a conservative estimate, the minor bugs number into the hundreds, and a few major bugs still remain. The major bugs tend to be inside the EXE and the vast majority of the minor bugs are in the data files.


Technically, NI's script error report is accurate, but only for verbose coding. If you fixed all of the reported 'errors', the game would run just fine. Since there are more efficient ways you can encode actions and triggers, those would be fine as well. NI just doesn't, at present, know how to deal with them. (You could always e-mail NI's author about this. He won't update NI's script-checking/decompiling abilities unless someone asks him to.)

In line with point #2, at some point in development, Bioware apparently decided to use OUTDOOR instead of OUTSIDE. They changed the IDS entry, but not some of the DLG files. That's why some dialogs correctly contain OUTDOOR and some contain the older OUTSIDE label. A quick fix is to copy the OUTDOOR value in the IDS file and rename the copy to OUTSIDE. You could also edit the DLGs to use OUTDOOR. Until one of these things is done, a bug exists. Notice that Bioware already did this for the different staffmembers who worked on the DLG files; some used 'Dialogue' and others used 'Dialog', so the IDS files contain both spellings.

My suggestion is that you trust the editors until you know what you're doing, and don't hesitate to communicate with the editors' authors.

#16 -Guest-

-Guest-
  • Guest

Posted 22 October 2004 - 01:29 PM

1. BCS scripts are compiled, so any legal changes to IDS files during game development or while you are editing or installing mods will automatically be used when the script is decompiled for editing or excecuted by the game.


This also applies to BS files that you assign to your characters.

#17 Jewish

Jewish
  • Member
  • 77 posts

Posted 22 October 2004 - 03:20 PM

That was a good deal of information, thank you Mr. Guest.

I hoped to learn something useful about NI, scripts or anything related to the script search I made, without wasting anyone's time in excess. I could not thank you guys enought for answering in the thread and all the support provided (let alone the patience).

As for editing, currently I have a safe BG install with which I can mess without worries, so there is where I'm trying every change. I guess the best way to learn would be starting some mod myself for personal use, trial and error, and get hands to work.

Anyway, thanks for all your help and patience, this has been most instructive.