Jump to content


Photo

BGTutu and NPCs - trouble with area codes


  • Please log in to reply
2 replies to this topic

#1 Mekelan

Mekelan
  • Member
  • 4 posts

Posted 08 March 2009 - 01:40 PM

Hi everyone, I've been lurking around here reading tutorials and (in a very small way) started modding my installation of BGTutu.

I followed one of the NPC creation tutorials, and have got everything working (yay!) but I run into a problem when I try and "customize" the NPC a bit.

What I would like to do is add the NPC I've created to the Candlekeep area, outside the Inn (right next to the "spawn point" for the PC really).

However, when I get the area code (using ctrl-x) it reports FW2600, which appears to be a different format to the ones used for BG 2 (makes sense).

I can't really get the NPC to spawn. I've tried downloading a few of the BGTutu NPC mods, and poking around the code, but I haven't been able to figure it out.

I have tried searching, but there are many possible headings something like this could be under, and I haven't found it yet.

The NPC I'm creating is called Molly.

In my Setup-MF#MOL1.tp2 file, I have this:
EXTEND_TOP ~AR0602.BCS~ ~MF#MOL1/MF#CKeep.baf~

and inside MF#CKeep.baf I have this:
IF

Global("MOLLYExists","AR0602",0)

THEN

RESPONSE #100

SetGlobal("MOLLYExists","AR0602",1)

CreateCreature("MOLLY",[3076.2738],3)

END

As you can see, I've changed it to spawn inside Irenicus' prison, which works just fine (on a BG2 install). I did that to see if there was something fundamentally wrong with the code, but it appears to be the difference between BG1 and BG2 playing up.

I hope someone can help with this!

Thanks in advance,

Mekelan

Edited by Mekelan, 08 March 2009 - 01:40 PM.


#2 Jarno Mikkola

Jarno Mikkola

    The Imp in his pink raincoat.

  • Member
  • 10911 posts

Posted 08 March 2009 - 02:24 PM

Well, the game reports the are to be that cause it according this... so if you wish to spawn the NPC there, you need to change the Setup-MF#MOL1.tp2 code into:
EXTEND_TOP ~_AR2600.bcs~ ~MF#MOL1/MF#CKeep.baf~
The area script is easy to find with Near Infinity, in the when you look the link for the areas. Make sure you put the _ mark too!
And MF#CKeep.baf into:
IF
  Global("MOLLYExists","FW2600",0)
THEN
  RESPONSE #100
	SetGlobal("MOLLYExists","FW2600",1)
	CreateCreature("MOLLY",[3076.2738],3)
END

Edited by Jarno Mikkola, 08 March 2009 - 02:26 PM.

Deactivated account. The user today is known as The Imp.


#3 Mekelan

Mekelan
  • Member
  • 4 posts

Posted 08 March 2009 - 10:35 PM

Thanks VERY much. This works great! Such a small change, but that's coding (of any kind) in a nutshell :)