Help - Search - Members - Calendar
Full Version: Howdo you create a spell?
The Black Wyrm's Lair - Forums > Mod development resources & discussion > Modder's Workshop
blackdevil0742
Hi

Like lots of people I've been playing Badlur's Gate 2 for so long and I still ove it. I've downloaded mods but now I want to do stuff I want in the game. So what I wish is to create a spell similar to the Find Familiar but I want it to summon a Winter Wolf(and make it stay/follow me like the other do). I have NI (didn't find a working link to the other tool) and I've exported some of the files that the Find Familiar(based on the cat) spell uses.

FAMCAT.BAM <cat img
FAMCAT.CRE
SPWI123.SPL <find familiar spell
SPWI123C.BAM <spell icon

Now I have no clue how and what to edit in those files.

I tried though. What I did first was to copy some of the stuff the FAMCAT.CRE into a copy of the winter wolf .CRE file(I think I managed to do it right).

Now how do I get a spell to summon this creature and also how do I export/import the images in the .BAM file?
WizWom
the familiars are set up in the baldur.gam file, and changing them would change all.
You can make a spell which summons any creature (say, a ranger animal companion spell) and then have the monster's script do an "MakeGlobal" and "AddFamiliar".

The trouble comes with cut scene transitions, especially those that move you from one area to another.
blackdevil0742
OK, thanks. I'll try and make a summon spell then.

Edit: Hm... Where in the summon creature spell .SPL do I find the part where the creature is summoned, or is it somewhere else?
Rabain
I think it is easier for what you want to do if you just take a winter wolf creature file and rename it to the Familiar creature file that is summoned when you cast the spell. You may need to tweak some settings in the creature file (such as changing scripts etc.

Might be an option to open the Familiar creature file and change the animation to a Winter Wolf...less work and your Familiar retains all its dialog...you might need to add extra things to get it to do damage and sound like a winter wolf...but at least you have real winter wolf files to compare this to.

So two options:

1. Change a Winter Wolf to a Familiar by copying a Winter Wolf creature file and renaming it to the familiar creature file name.

2. Change the Familiar creature file so that it uses the Winter Wolf animation.

In both cases you will need to make some changes to the files but at least its possible.

If you wanted to release a mod it would be more complicated but for personal use it is as easy as that.
Rabain
Oh and just a note: Familiars aren't set up in the baldur.gam file. They exist there after they join the party of course...but before that the files themselves can be edited to your hearts content. baldur.gam is also editable after that of course too..but can lead to more issues its best not to get into here.

The Familiar spell is hardcoded to alignment, in the game exe. It is this that makes it very difficult to change but editing the creatures directly is open to any player who chooses to do so.

This I think is the difference between a player doing something for themselves and a modder wishing to release something to the public. More is possible if you do it for yourself because you don't have to worry about compatibility etc.
blackdevil0742
I'd prefer if it wouldn't mess with the game incase(very possible) I do something wrong. I would also like to keep the original stuff.

EDIT: I've looked with DLTC and NI and i cannot find the part where it says what creature is to be summoned.
Rabain
Yeah thats the bit that is hardcoded! It's based on your alignment:

http://www.sorcerers.net/Games/BG2/familiars.php

Copying the creature file and changing it to a Winter Wolf won't destroy the original content. All you need to do to get the original file back is delete your version from the Override directory.

I'll think about adding a winterwolf/blink dog/some kind of dog to the Familiar mod we are working on. See the link in my sig. At the moment all we are considering adding is spider and lim-lim.
blackdevil0742
I'll guess that I'll have to wait for the mod then smile.gif

...What will I need to do if i use the same technique like the summon creature spell instead and skipping the whole familiar part in inventory?
Rabain
Actually I can save you a lot of work.

Download my WTPFamiliars spell. This replaces the core game spell with a new one...where you can choose from a selection of 3 familiars rather than just getting one.

Then change one of my creature files to the winterwolf.

Then you can install the mod (making sure you still have the correct alignment), cast the spell and you are good to go.

Explaining the whole process and everything you would need to do both in the cre file and scripting would take longer than i have right now! smile.gif
blackdevil0742
So i dowloaded the thing. There a re lots of files wacko.gif
care to name all the files I need to alter if I chose the cat to edit(like all the images and so)? wink.gif
Rabain
In the tp2 just search for entries with *cat* and update with your own descriptions, sounds etc etc.

Change the cre file with the cat in the name to use you Winter Wolf animation, give your wolf a wolf portrait and stick your portrait in the override...

So long as you make the changes in the tp2 that I mentioned you won't need to do anything else.

Keep the filename the same to avoid having to do other changes, it won't make any difference either way.

The important things are the creature file, the descriptions in the tp2 and the portrait.

You will find the tra references (@1, @2 etc) in the files in the English directory, in the mod folder.

If you want your Winter Wolf sounds, copy the filenames from a winter wolf and assign them to the [sound] code in the tp2, make sense?
blackdevil0742
I've manged to get the winter wolf into the game smile.gif
But is there a way to make the spell a separate new spell?
If it's too complicated with the find familiar spell couldn't I use a summon spell instead and skip the whole inventory thing. What I want is it to follow me without getting it unsummoned after a time.
Rabain
Well my version is like a normal familiar....it doesn't unsummon by itself. Only a summons unsummons.

A familiar will only unsummon (so to speak) if you talk to it and tell it to go into your backpack.

If you have converted a summons spell then you are not going to like your requirement...which will be to cast it in every area you move to...because a summons won't follow you from area to area and it will unsummon eventually (though you could extend the duration of the spell). Extending the duration will not change the need to summon it in every area you move to.

Its pretty easy to make the spell a separate spell...copy the spell into the override directory...change the filename to a unique name (just make it up). Then use something like DLTCEP or Shadowkeeper to give your mage a copy of the spell to cast....or copy a find familiar spell scroll (.itm) to your override and rename and then use the CLUA console to give yourself a copy of that scroll. Remember to change the spell in the scroll to your new name in the override.

Even what seems simple begins to get complicated...right? smile.gif

If this was easy everyone would have done it in various forms by now!
blackdevil0742
huh. It's very complicated and confusing indeed.
Hw on earth were they able to make a game with that much stuff to it ;D

I also wanted to change the icons and such but I'm way over my head. Will have to try and do other less complicated stuff for now and Thanks for your help. Gonna try and make some items as there at least some tutorials on that tongue.gif

WizWom
QUOTE(Rabain @ Feb 8 2008, 08:03 PM) *
Oh and just a note: Familiars aren't set up in the baldur.gam file. They exist there after they join the party of course...but before that the files themselves can be edited to your hearts content. baldur.gam is also editable after that of course too..but can lead to more issues its best not to get into here.

The Familiar spell is hardcoded to alignment, in the game exe. It is this that makes it very difficult to change but editing the creatures directly is open to any player who chooses to do so.

Good point; the BALDUR.GAM just has the creature resource names and a placeholder zero-filled.
Still - I would say the Better behavior is to have the spell make a summoned crature which acts like a familiar rather than change the existing familiars.

Also, remember, the familiars are "updated" in ToB to more powerful versions.

QUOTE
If you have converted a summons spell then you are not going to like your requirement...which will be to cast it in every area you move to...because a summons won't follow you from area to area and it will unsummon eventually (though you could extend the duration of the spell). Extending the duration will not change the need to summon it in every area you move to.

there is no reason a summoned creature cannot be permanent. And, I already said that you need to MakeGlobal and script it to follow you across areas.
CODE
IF
    !InMyArea(Player1)
THEN
    RESPONSE #100
        MoveGlobalObject(Myself,Player1)
END

IF
    !See([PC])
    ActionListEmpty()
THEN
    RESPONSE #100
        FollowObjectFormation(Player1,9,5)
END


Rabain
Yes...my suggestion was to just replace one of the creatures in my Familiar spell. Link in my sig...downloads section.

A lot of work to get it working otherwise.

Another thing you have to think of with the script...you shouldn't use the creatures script nor InMyArea() because if Player1 is not in your area it is unlikely your script will be running to move the global object!

Best if this is just a check for the familiar itself and is placed in baldur.bcs.
blackdevil0742
I think that I'll stick to other peoples mods as some of the tool do not want to save or have rrors when I run them on Windows Vista x64.

BTW is there a mod for drow armor that doesn't disintegrate? I'm playing a drow with the subrace mod and i wish to be able to use the coolest armor in the game wink.gif I have the tweak pack and it has gradual disitegration but I'd like it to remove it entirely.
Rabain
I believe the drow armor thing is done via script...the script just replaces the armour etc with dust piles.

Two options...1. search baldur.bcs using NI for the item in question and remove the reference to it. 2. Copy a drow armour file and give it another name. Give yourself the armor via CLUA or by adding in Shadowkeeper.
blackdevil0742
OK, tanks wink.gif
WizWom
QUOTE(Rabain @ Feb 9 2008, 07:04 AM) *
Another thing you have to think of with the script...you shouldn't use the creatures script nor InMyArea() because if Player1 is not in your area it is unlikely your script will be running to move the global object!

As it turns out, the script works properly for everything but cut scene transitions.

And I'm not sure a DPlayer3.BCS addition to check for the companion and move it to Player1 works properly, I'd have to re-check.
Rabain
Are you sure about that? Creature scripts don't run for creatures that are not in the area currently.

If that was the case every creature script in the game would be running continuously all the time.

So if you put that block in the familiars script and then the party moved to another area...but the familiar didn't..how is the familiar going to continue to run its script? The Familiar isn't a party member remember so it is not treated as such, also you may experience oddity with scripts in areas that are not in mastarea.2da as they continue to run the area script from the preceeding area.

The way I do it in my version...is add the blocks to baldur.bcs, this covers every contingency because if the familiar is ever not in the same area as Player1 it moves to Player1 (assuming its not in the backpack of course). baldur.bcs is where the developers did all their familiar stuff so i see no reason not to continue to use it.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.