Jump to content

Fate Spirit question


Grim Squeaker

Recommended Posts

I've been thinking about this one for a while and I cannot think of a way to do it.

 

The Fate Spirit lists the possible NPC's in alphabetical order (in FATESP state 6). A modder can figure out where to add their NPC by looking through the list and selecting the right transitions to squeeze their new transition in-between. However, this will screw up if more than one mod NPC is added (because what was, say, Transition #10, could now be Transition #11 etc).

 

So can anyone think of a shiny piece of code to somehow insert a new NPC at the correct place in the list?

Link to comment

Unless someone comes up with something genius I think I'm just gonna settle for adding it at the top or bottom of the list. Actually, how could you add it one from the bottom of the list (i.e. above the "actually I can't think of anyone" option)? I know that state position number but as you don't know how many positions there are...

Link to comment

Well, I did it like this:

COMPILE ~Esiriak/IJ#es25J.d~
With this:
APPEND ~pdialog.2da~

~IJ#esir IJ#esirP IJ#esirJ IJ#esirD IJ#es25P IJ#es25J IJ#es25D IJ#esi25 IJ#eprT~

UNLESS ~IJ#esir~

 

BEGIN IJ#es25J

 

EXTEND_BOTTOM FATESP 6

 

+ ~!Dead("IJ#esir") !InMyArea("IJ#esir") Global("EsiriakSummoned","GLOBAL",0)~ + ~Bring me Esiriak, the Tanar'ri Abjurer.~ /* this is the custom reply you wish the PC to say. */

DO ~CreateVisualEffect("SPPORTAL",[1999.1228])

Wait(2)

CreateCreature("IJ#esi25",[1999.1228],0) //this brings the .cre

SetGlobal("EsiriakSummoned","GLOBAL",1)~ GOTO 8

 

END

The GOTO 8 is the transition state where it needs to goes next.
Link to comment

It's possible. It will look veeery ugly for another coder, but the user won't notice a thing.

 

Create a separate file for your FATESP interjection. In fact, you'll need several - most likely about a dozen.

 

First file - "vanilla" file - is compiled if no other NPC mods are installed(=no NPC mods that might interfere). For example, in Xan mod my line will be

 

EXTEND_BOTTOM FATESP 6 #2

 

If, for example, someone created a Xena or Xzar mod(does it exist?), I could check for them in my .tp2 and compile "Xena-adjusted" file instead of "vanilla" file. Yes, it will take several .tp2 lines and several long .tp2 checks and several .d files, but as I said, the players won't notice.

 

It's easy to note that my "Xena-and-Xzar-adjusted" file will have this line:

 

EXTEND_BOTTOM FATESP 6 #4

 

I'd also ask to put it into Crossmod Banter Pack, for obvious reasons.

 

 

(I'm not going to do this, because although it's relatively simple, the payoff is not worth it. But I might've considered it, if my NPC's name was Kate, for example).

Link to comment

The problem is you'd have to start guessing or keep updating the files. But it's a nice idea.

 

The ridiculous thoughts I was thinking of were along the lines of:

- DECOMPILE_DLG_TO_D FATESP and regexp each transition or something to read the deathvariable from each transition (as each one starts with !Dead("Foo")

- COPY_EXISTING regexp cre files so we can find out the name that matches the death variable.

- Sort all the names including my NPC's and then we know where to insert it.

 

Perhaps possible but it'd be so hidiously inefficient that it's just not worth it. Oh well.

Link to comment

Build a lookup table for #2 (using arrays) before doing #1. For #3, I'm sure that if you look hard enough you should find a bubble sort implementation in tp2 (which is fast enough for up to about a thousand of entries, and being a stable sort algorithm it deals natively with NPCs with multiple Fate Spirit lines). I and SC developed one once for a worldmap patching macro, but I can't find it anywhere.

PS: IMHO, this component should be added to the crossmod banter pack rather than to individual NPCs to make sure all NPCs are patched (including those from that five years old mod that is only available from Geocities).

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...