Jump to content

Unfamiliarity with familiars


OTG

Recommended Posts

I want a custom familiar for a kit I'm creating, and am having no end of trouble...

 

I understand that the familiars that are spawned from the engine's 'Find Familiar' spell are hardcoded in a 2da file, and if I change that, it's going to change what other kits and classes would summon, so that's a no-go and I'm theorising about another approach...

 

If I were to add an override script to the various familiar cre files that checks what kit is assigned to their summoner, is it possible to get that script to:

 

1. Change the long description

2. Change the short description

3. Assign a new dialog

 

In all cases, I would only want the specific instance of the creature to be modified, not every instance (so characters without the kit would still get the standard rabbit, or fairy dragon, or whatever).

 

Thanks, oh wise ones :)

Link to comment

I think your best bet would be to not deal with the find familiar spell and effect at all, but to create a parallel version of it (and then make sure that your kit can't cast the original, an immunity to spwi123 granted at level one should do the trick).

 

You can do anything you want with that version and not alter any original files (and you can rob most of the scripting/items/creatures you'll need to do from the original familiar routine).

 

It's very possible, it'll just take some doing.

Link to comment

Imagine a small boy who's just been given a large ice-cream by a loving parent, only to drop it seconds later. He turns to his mother, wide eyes brimming with tears.

 

That's me, that is. :(

 

Back to my currently non-working eff then... :):)

Link to comment

Both NI and Weidu are telling me that the following has "Too many Arguments":

 

ActionOverride(Player1,AddFamiliar("NewFam1"))

 

Even removing "ActionOverride(Player1," it still craps out with the same message on just AddFamiliar.

 

Am I missing something obvious?

Link to comment

I'm guessing here, but perhaps AddFamiliar() doesn't require an argument because the type of familiar is controlled by a 2da file?

 

The way I'm working round it is to not use the FindFamiliar spell, but a custom spell which summons my own replacement creature and uses effs to replicate the things adding a familiar does. I've also got plans for a script to be added to baldur.bcs (and baldur25.bcs) to cover the ToB upgrade to familiars (can't find another way to do it) and also what happens if the custom familiar gets killed (permanent -1 to con, etc).

 

Try

ActionOverride(Player1,AddFamiliar())

and tell us how you get on.

Link to comment

Which 2da? I can't seem to find a relevant one.

 

Please don't let this be hardcoded!

 

Yes it works with just AddFamiliar(). So really that Action is meaningless considering the Spell Find Familiar does the same and more itself.

 

I wanted to try AddFamiliar because I am assuming it does the necessary engine work to move the Familiar with the party from area to area. I don't really want to consider the work involved in coding all of that manually.

Link to comment

The problem with that is that if the the player isn't in the area most likely the script on the Familiar won't be running to execute that block.

 

Any code like this would have to be in baldur.bcs and I think you have to use MakeGlobal() to add the Familiar to the saved game. Once you have that done you would need to use MoveGlobalObject(O:Object*,O:Target*) to move the Familiar to wherever Player1 happens to be. That is if MoveGlobalObject accepts Player1 as a valid Target.

 

Yes in theory it sounds easy though I think others who have tried "henchmen" have had various issues with one thing or another.

 

I guess another way would be to have a script on Player1

 

IF

Global("IhaveaFamiliar",1)

!InMyArea("MyFamiliar")

THEN

RESPONSE #100

MoveGlobalObject("MyFamiliar",Myself)

END

 

Can you Move something that is not in the area?

Link to comment

Yes, the familiar behavior is hard-coded. There appears to be all kinds of evil stuff to get the familiar to tag along with the party, and the whole system itself isn't really extensible (there's no way you can tap into or modify it).

 

There shouldn't be any 2DA file dealing with familiars; it's not set up that way. I think there's a mod or two that tried custom familiars, but you'd have to search for them.

 

I don't believe there's any way you can get a custom familiar to really behave like one of the hard-coded familiars; it's always going to be some hackish add-on.

 

EDIT: like Nythrun said: fraught with ugly.

Link to comment

Just checked and the game uses MoveGlobalObject in baldur.bcs in order to create the Familiar when it leaves your backpack and it does accept Player1 as a Target.

 

I think that pretty much covers all I need to make a Familiar.

 

The only other thing to take care of is to give the owner of the Familiar a Constitution bonus and to take it away if the Familiar dies but that's easily done via scripting or applying opcode 195 to the Familiar if Player1 is the owner.

 

@devsin: yeah my disappointment at the uselessness of AddFamiliar() is almost making me just drop this idea right here.

 

An issue that was mentioned in the weidu docs (Japheth has a piece on EXTEND_TOP_REGEXP relating to henchmen/hirelings/familiars) is about the creature not MoveGlobaling to some areas. I have a feeling this might have something to do with mastarea.2da as not all areas are listed there. Japheth bypassed this by EXTEND_TOP_REGEXP ing all area scripts with his MoveGlobal rather than putting it in baldur.bcs .

 

It's all very painful and would be so much easier if the system was ran off a 2da.

Link to comment

Right I have this 99.9% complete. My Familiar appears, talks, will go in and out of inventory and follows me from one area to the next even if he is not selected as a moving party member...except for certain small areas (mostly indoor areas) and I can confirm that this is because of areas not listed in mastarea.2da.

 

When i added the area he wasn't going into to the 2da and restarted my game he transitioned as mentioned above even when not selected to move with the party...excellent stuff.

 

Now my questions:

 

1. Would there be any negative impact of appending a full list of BG2 areas to mastarea.2da? Apart from the obvious inability to cater for mod added areas.

 

2. Instead of appending what check can I use in baldur.bcs to move the familiar to the new area? - I thought about !InMyArea("newfam1") but would this default to the PC as it doesn't specify who's area. Perhaps setting a Global when the Familiar is out of Inventory however this doesn't really tell me if the Familiar hasn't moved area's with the party.

Link to comment
1. Would there be any negative impact of appending a full list of BG2 areas to mastarea.2da? Apart from the obvious inability to cater for mod added areas.
Probably.

 

2. Instead of appending what check can I use in baldur.bcs to move the familiar to the new area? - I thought about !InMyArea("newfam1") but would this default to the PC as it doesn't specify who's area. Perhaps setting a Global when the Familiar is out of Inventory however this doesn't really tell me if the Familiar hasn't moved area's with the party.
InActiveArea() returns true if the specified object is in the area currently being viewed (the one that's showing up onscreen); you could use that, but it will lead to some funk if you split up the party and keep switching between areas. I don't know how much closer you can get (I don't quite know the context in which Baldur.bcs runs, but the InMyArea() check would probably always return true or always return false).

 

You may also get some suck with cutscene transitions (whereas the game has hardcode to force the familiar to move, you'll need more scripting hacks), but I don't know that it'll be an issue.

Link to comment

Yeah putting !InMyArea("newfam1") in baldur.bcs constantly returns true...so...while it does move the familiar with the party it also keeps moving it to Player1 while in the area..which is a bit annoying.

 

InActiveArea() works as you describe...my block in baldur.bcs is:

 

IF
!InActiveArea("newfam1")
THEN
RESPONSE #100
	MoveGlobalObject("newfam1",Player1)
END

 

This doesn't constantly return true as the InMyArea does.

 

As my version of this Familiar is for Player1 I shouldn't encounter too many problems if i split the party as I want it to follow Player1. I've checked and even if i split the party the Familiar stays with Player1.

 

Awesome thats about everything with regard to functioning Familiar.

 

Thanks All!

Link to comment

Archived

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

×
×
  • Create New...