Author Topic: NI question  (Read 1744 times)

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
NI question
« on: January 29, 2005, 06:02:55 PM »
I need to open up some resources and print their NI-style description into text format. If the general question is too much widespread, I'd need to be able to save into .txt format (or other common format, such as HTML or XLS or similar), printable into a non-IE machine, the memorized spell info for a creature (both the file name and the STR-REF name). Ideas ???
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

Offline NiGHTMARE

  • Idiot
  • Planewalker
  • *****
  • Posts: 1405
  • Gender: Male
Re: NI question
« Reply #1 on: January 29, 2005, 06:39:18 PM »
Everything would be a lot easier if NI actually had a right-click menu ;).

If nothing else, you could always use the PrintScreen key, paste the captured image into a paint program, and then use character recognizition software.  Hopefully there's a more efficient method :).
The Gibberlings Three - home to the BG1 NPC Project, BG2 Tweak Pack, Divine Remix, GemRB, Lands of Intrigue, Song & Silence, and many more!

Offline icelus

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3173
  • Gender: Male
Re: NI question
« Reply #2 on: January 29, 2005, 06:41:42 PM »
I use ctrl-c to copy information out of NI all the time.  Highlight the text, press ctrl-c, and then paste into any text editor, and you should be all set.
<Moongaze> Luckily BWL has a very understanding and friendly admin.

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: NI question
« Reply #3 on: January 29, 2005, 07:30:10 PM »
I use ctrl-c to copy information out of NI all the time.  Highlight the text, press ctrl-c, and then paste into any text editor, and you should be all set.
If that's that easy, then I'm stupider than I used to think. And I don't think so well of my intelligence either  :(
Cannot check, as, after drinking empty a bottle of Vodka, I wisely decided to delete the whole BGII - SOA directory without uninstalling first. Oh well, maybe I should give up drinking  >:(
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

Offline devSin

  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Re: NI question
« Reply #4 on: January 29, 2005, 07:39:02 PM »
Everything would be a lot easier if NI actually had a right-click menu ;).

I'm probably missing something here, but NearInfinity does have a contextual menu. Granted, it doesn't work very well, but it is there.

Offline NiGHTMARE

  • Idiot
  • Planewalker
  • *****
  • Posts: 1405
  • Gender: Male
Re: NI question
« Reply #5 on: January 30, 2005, 02:31:42 AM »
As far as I can tell, it only works in the left sidebar (i.e. the file list).  Move the mouse over to the data field and right click, and nothing will happne.
The Gibberlings Three - home to the BG1 NPC Project, BG2 Tweak Pack, Divine Remix, GemRB, Lands of Intrigue, Song & Silence, and many more!

Offline devSin

  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Re: NI question
« Reply #6 on: January 30, 2005, 03:19:51 AM »
As far as I can tell, it only works in the left sidebar (i.e. the file list).  Move the mouse over to the data field and right click, and nothing will happne.

I don't know how this works on Windows, but, if you click one of the fields, the contextual menu has the standard cut/copy/paste, as well as several Edit As options (so, you can change the view to hexadecimal, decimal, ASCII, etc.). I'm not sure how well Java on Windows supports multi-button mouse functionality; on Mac OS X, you simply have to hold down the Control key and click on the field (this is pretty useful for finding out the hex value of the fields where NearInfinity gives a pop-up list of the resources or IDS entries).

Offline igi

  • IESDP Guardian
  • Planewalker
  • *****
  • Posts: 124
  • IESDP Guardian
Re: NI question
« Reply #7 on: January 30, 2005, 04:11:37 AM »
There is a context menu in the Edit view, though I am not sure there is one in the .. View.. View.. yeah.
If it's a html view of creature files you want, I belive there is an old program for exactly this purpose. I dont recall the address, I am not sure it works, and I dont know it's name. If you find that helpful, I'll try and be more vague next time :P
NPC: Arg || Galoomp || Thash
Mods: Dark Heart of the Xvart || GbG
Tweak Pack: iiTweak

mcwrench.com
mcwrench.com forums

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Problem solved!
« Reply #8 on: February 16, 2005, 04:53:48 AM »
Here is some code I threw together for scanning all the spells on a creature.
Create the folder readspl/backup and readspl/tocheck. Create the empty file readspl/mycre.txt. Put in readspl/tocheck the creatures whose spells you need checked. Run this tp2 from WeiDU 175 or higher, and enjoy.

Code: [Select]
BACKUP ~readspl/backup~
AUTHOR ~The Bigg~

BEGIN ~Read the spells on a cre~
NO_LOG_RECORD

COPY + ~readspl/mycre.txt~ ~override~

COPY ~readspl/tocheck~ ~readspl/tocheck~
  INSERT_BYTES 0 8
  WRITE_EVALUATED_ASCII 0 "%SOURCE_RES%" #8
  READ_ASCII 0 newsource
  DELETE_BYTES 0 8
  INNER_ACTION BEGIN
  APPEND ~mycre.txt~ ~__~
    APPEND ~mycre.txt~ ~___RES___~
    COPY_EXISTING + ~mycre.txt~ ~override~
      REPLACE_TEXTUALLY "___RES___" "%newsource%"
  END
  READ_LONG 0x2b0 memsploff
  READ_LONG 0x2b4 memsplcnt
  FOR (loop = 0 ; loop < memsplcnt ; loop = loop + 1) BEGIN
    READ_ASCII memsploff + loop * 0xc splname
    INNER_ACTION BEGIN
      PRINT ~%splname%.spl~
      COPY_EXISTING ~%splname%.spl~ ~override~
        READ_STRREF 0x08 "my_str"
      BUT_ONLY_IF_IT_CHANGES
      APPEND "mycre.txt" "___name___ ___STR___"
      COPY_EXISTING + ~mycre.txt~ ~override~
        REPLACE_TEXTUALLY "___name___" "%splname%     :"
        REPLACE_TEXTUALLY "___STR___" "'%my_str%'"
    END
  END
BUT_ONLY_IF_IT_CHANGES

COPY + ~override/mycre.txt~ ~readspl/mycre.txt~

If you need to, you can easily change the tp2 a bit to check the items on a creature, the effects on a spell or something like that. (and, if possible, try to post this in some kind of way, maybe someday somebody will gather all of this together and make it a pubblic tool:)
« Last Edit: February 16, 2005, 04:56:26 AM by the bigg »
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

Offline devSin

  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Re: NI question
« Reply #9 on: February 16, 2005, 03:40:38 PM »
Add "let src = Var.substitute_user_vars_only src in" around Line 2941 in src/tp.ml and (re)compile. Then, you can simply APPEND ~mycre.txt~ ~%newsource%~ and somesuch. You can probably also do this for file, at the beginning of TP_Append, so you can APPEND ~%someFile%~ ~%someStuff%~.

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: NI question
« Reply #10 on: February 16, 2005, 06:28:20 PM »
Add "let src = Var.substitute_user_vars_only src in" around Line 2941 in src/tp.ml and (re)compile. Then, you can simply APPEND ~mycre.txt~ ~%newsource%~ and somesuch. You can probably also do this for file, at the beginning of TP_Append, so you can APPEND ~%someFile%~ ~%someStuff%~.
??? *trusts you by principle of authority*
I prefer this to be able to run on a "standard" weidu, for easier public consumption.

(of course, if Wes implements this in standard weidu, I'll amend that tp2. It could surely use a bit of speeding anyhow)
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: