Jump to content


Photo

NearInfinity


  • Please log in to reply
1165 replies to this topic

#761 Crevs Daak

Crevs Daak

    me orc duh duh

  • Member
  • 88 posts

Posted 26 February 2017 - 06:10 PM

It'd be nice if you could specify a .tra file on the .baf (like having the first line be something like  // -*- scripts.tra -*- a la Emacs' major modes) and add the strings referenced in the .tra with @stringnumber into dialog.tlk (and changed them for the strref after you've done that) when the script is compiled. I mean it's useless but it'll make it 100% compatible with WeiDU bafs.

Edited by Crevs Daak, 26 February 2017 - 06:11 PM.


#762 Argent77

Argent77
  • Administrator
  • 1419 posts

Posted 27 February 2017 - 02:59 AM

That's an interesting idea, but I think TRA files are too WeiDU-specific for NI. Even if I attempt to support it there will be features that can't be realized without turning NI into a full-blown WeiDU interpreter.

It would require the full (relative and language-specific) path to the tra file. It would also mean to design and implement a parser for TRA files that would only contain a reduced feature set (without the ability to resolve %variables% and other WeiDU-specific stuff). I doubt that the final outcome is good enough to justify the amount of work required for it.

However, it might be possible to add strings to the dialog.tlk that are used directly in BAF sources, e.g.

IF
  True()
THEN
  RESPONSE #100
    DisplayString(Myself, "Hello World!")   // adds same string to dialog.tlk and dialogf.tlk (if available)
    // or
    DisplayString(Myself, "Hello male World!" "Hello female World!")  // adds different strings to dialog.tlk and dialogf.tlk (if available)
END

could add strings into the dialog.tlk and dialogf.tlk respectively. Would there be interest in this kind of feature?



#763 Crevs Daak

Crevs Daak

    me orc duh duh

  • Member
  • 88 posts

Posted 04 March 2017 - 02:00 PM

Sorry for the later reply.

 

I completely forgot about WeiDU variables in .tra files. Whoops!

I'm not sure if there would be interest in that to be honest (maybe it would to somebody who is modding their own game or making small adjustments), but it'll surely be useful (also, it doesn't seem to be too hard to implement. I mean you can catch it with the parser and add it to the .tlk file, and then replace the string in the .baf file for the strref).



#764 Argent77

Argent77
  • Administrator
  • 1419 posts

Posted 04 March 2017 - 02:25 PM

Well, currently it's not possible to add new strings to the dialog.tlk programmatically as the string table editor doesn't really support write operations yet. I'm planning to overhaul this editor as well though (eventually), after I'm done with the script compilers.

From what I can see in the NI code there are two separate implementations involving dialog.tlk files. The first one is a simple TLK reader which is used to fetch strrefs for all kinds of resources. The second one is directly integrated into the string editor which also provides (poor) write functionality.



#765 Argent77

Argent77
  • Administrator
  • 1419 posts

Posted 12 April 2017 - 03:52 AM

Major update: NearInfinity v2.1-20170412

Lots of changes:

  • Added PST:EE support:
    • New opcodes
    • New resource type MAZE
    • Updated resource types
  • Added a new implementation of BCS compiler and decompiler from scratch:
    • Full support of all available IE games (EE and non-EE)
    • Imposes much fewer restrictions to code formatting
    • Added support for decimal (no prefix), hexadecimal ('0x' prefix), octal ('0' prefix) and binary ('0b' prefix) numeric notations
    • Allows simple OR expressions for numeric or symbolic parameters (e.g. StateCheck(Myself,STATE_SLEEPING | STATE_STUNNED | STATE_HELPLESS))
    • Supports convenience trigger TriggerOverride(O:Object*,T:Trigger*)
    • Detects more potential issues
    • Greatly increased compiling and decompiling speed
    • New submenu Options -> Script compiler contains several compiler-related options
  • Improved script editor:
    • Improved interactive elements
    • Tooltips for identifiers, functions and resources
    • Visual markers for errors and warnings
  • Greatly overhauled string table editor
    • Combines male and female string table (for languages which provide both)
    • Greatly reduced loading time
    • New export option: as TRA
    • A basic undo menu to revert add/remove operations
  • Basic syntax highlighting for text strings:
    • Highlights tokens and EE-specific color codes
    • See related options in menu Options -> Text Editor -> Misc. resource types -> ... for text strings
  • Added a DLG -> WeiDU dialog export option.
  • Increased performance when adding or removing substructures in structured resources.
  • Updated 'Special' parameter of opcode 318 (Restrict item)
  • Minor improvements to quick search feature of resource tree.
  • File extensions of BAM Converter session files are better handled.
  • Updated opcodes 182, 183, 214 and 273.
  • Improved opcode 219 parameter types.
  • Added new condition "Target's spell state is 'Special'" to opcode 232 (Cast spell on condition).
  • Fixed a bug in resources fields which pointed to the wrong UI control after cloning a removable structure.
  • Fixed initial state of EE opcode 328 (Set spell state) based on 'Special' parameter.
  • Fixed a baldur.lua parsing error if the file contains non-ASCII characters.
  • Many more bugfixes and improvements under the hood.


#766 K4thos

K4thos
  • Modder
  • 315 posts

Posted 12 April 2017 - 08:29 AM

amazing update. There seems to be a problem with IncrementGlobalOnceEx decompiling. Compare highlighted result box with DLG action:

http://imgur.com/GcVPBgd

GcVPBgd.png


Edited by K4thos, 12 April 2017 - 08:29 AM.


#767 Argent77

Argent77
  • Administrator
  • 1419 posts

Posted 12 April 2017 - 08:41 AM

Thanks. I'll look into it further.

 

Update: IncrementGlobalOnceEx() and IncrementGlobalOnce() are both using the same action id which confuses NI's script compiler when it processes string parameters. I will add additional checks to prevent this case in the next release.
 


Edited by Argent77, 12 April 2017 - 09:20 AM.


#768 Argent77

Argent77
  • Administrator
  • 1419 posts

Posted 13 April 2017 - 07:15 AM

Update: NearInfinity v2.1-20170413

Changes:

  • Fixed a bug which prevented opening Enhanced Edition games containing DLC archives.
  • Fixed a script compiler bug which incorrectly encoded a certain script action in PST:EE.


#769 K4thos

K4thos
  • Modder
  • 315 posts

Posted 14 April 2017 - 05:06 AM

still some problems with searching on PST:EE. Search -> Text Search -> DLG -> IncrementGlobalOnceEx

No matches found.

 

edit: false alarm? No problem after opening up NI again. The problem occurred when I had different game opened and than moved to PST:EE from bookmarks page, but I can't reproduce it now.


Edited by K4thos, 14 April 2017 - 05:16 AM.


#770 -trigger-

-trigger-
  • Guest

Posted 15 April 2017 - 10:11 PM

I compile in script:

 

TriggerOverride("object",See([PC])) and have error:

 

// Error - TriggerOverride: Unknown type for parameter 16608

 

If I compile:

NextTriggerObject("object")

See([PC])

 

It's all ok.



#771 Argent77

Argent77
  • Administrator
  • 1419 posts

Posted 16 April 2017 - 02:10 AM

Which NI version are you using and in which game is the error message triggered?

It is possible that function definitions in TRIGGER.IDS are screwed up. Please open TRIGGER.IDS, make a search for "40E0" and another search for "16608", and post the results.

Can you also post the whole script block where the error message is triggered?
 



#772 -trigger-

-trigger-
  • Guest

Posted 16 April 2017 - 03:13 AM

BGII:ToB with TobEx, NI version 20170413.

I haven't 40E0 and 16608 in file trigger.ids. I have only 0x4100 NextTriggerObject(O:Object*).

The problem is that all scripts decompile with TriggerOverride. Re-compiling without correcting this will cause an error.



#773 Argent77

Argent77
  • Administrator
  • 1419 posts

Posted 16 April 2017 - 03:24 AM

Thanks. Yes, BG2 with TobEx uses 0x4100 for TriggerOverride. I can reproduce this error myself now.

I'll look into it further.
 



#774 Argent77

Argent77
  • Administrator
  • 1419 posts

Posted 16 April 2017 - 04:20 AM

Update: NearInfinity v2.1-20170416

Changes:

  • Fixed a bug in script compiler that assigned wrong TriggerOverride function ID in BG2+ToBEx installations.
  • Fixed incorrectly referenced BIFF resources if DLC archives are present.
  • Fixed projectile IDs being off by 1.


#775 nullset

nullset
  • Member
  • 18 posts

Posted 18 April 2017 - 12:16 PM

Argent77: There is a bug in the latest (PSTEE capable) version of Nearinfinity. The dialogues for PSTEE as displayed inside Nearinfinity are using the correct language. However, whan a dialogue file is exported, the first language entry in the lang folder is selected, regardless of the language preference set for the game. My German is just not adequate to handle this. I renamed de_DE to xde_DE bringing en_US up to the top of the list, and the export worked giving me the English dialogue. Just thought you should know.



#776 Argent77

Argent77
  • Administrator
  • 1419 posts

Posted 18 April 2017 - 12:37 PM

I can't reproduce this issue. Both language options "Autodetect" and "English" are correctly exporting DLG files into WeiDU D in the selected language.

 

Can you give me the exact steps how to reproduce?



#777 c4_angel

c4_angel
  • Member
  • 18 posts

Posted 27 April 2017 - 10:29 AM

Hello, Agent77. May I ask if it is possible to add Chinese support? I can do the translation work.

#778 Argent77

Argent77
  • Administrator
  • 1419 posts

Posted 27 April 2017 - 01:58 PM

Adding language support to Near Infinity is not feasible. There are countless instances of hardcoded or dynamically generated strings in the sources which are not only used for display, but also needed for checks and other internal processes. A tool as complex as NI would have to be designed for multiple languages from the beginning to make it possible.



#779 c4_angel

c4_angel
  • Member
  • 18 posts

Posted 28 April 2017 - 05:01 PM

Sad...Thank you for reply.

#780 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 5155 posts

Posted 14 May 2017 - 09:43 AM

The .itm/.spl/.eff... editing is somewhat cumbersome as there's no copy paste commands in the effect edit part. Can you add one ? And when ?

Specifically I would want to copy/clone one effect in the same file, you have the add new... but that's like 50 clicks away from cloning the same effect as the last one.


Edited by The Imp, 14 May 2017 - 09:43 AM.

Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.