Jump to content

Creature re-creation for BGII, help needed


ericp07

Recommended Posts

Should be SetGlobal (with an L) and TimerExpired (no space). Yeah, you probably copied stuff from IESDP examples, where there are a lot of typos, but always check your syntax and at least test COMPILE your scripts to make sure they do at least that (then testing them in-game to see if they actually work as intended is another thing). You might be able to get away with Polymorph() or ChangeAnimation() instead of creating and destroying the CRE (which will also reset HP etc.) but only if the abilities aren't different, and they probably are. You could also ApplySpell a custom spell to *change* the abilities appropriately but that gets rather complex, so I'd just leave it as-is for now and focus on dialogue etc.

Silly question, perhaps, and I think I already know the answer, but...this creature's animation is an all-black big cat. Perhaps I went overboard in assigning the black color to all the color fields in the .cre (major, minor, skin, armor, etc.). Would a change in any of the color fields to red show up on the animation? It would be nice to apply some red color highlights, but only if they don't look absurd If not, I'll leave the creature a solid black.
The animation isn't paletted, meaning it gets whatever colours are hardcoded in the animation .bam files. So it makes no difference what those fields are set to, but it doesn't hurt to set them to how it *should* look. You could apply a red colouring with a couple different effects, but they're dodgy and tend to make the creature all red. So as I said earlier, I'd wait until your mod gets closer to completion then ask someone in the Infinity Animations forum to port the NWN Beast of Malar. IIRC, that is only the panther form - the slayer is more wolverinish or something but who knows, maybe there's a suitable animation for that too somewhere.
Link to comment
Should be SetGlobal (with an L) and TimerExpired (no space). Yeah, you probably copied stuff from IESDP examples, where there are a lot of typos, but always check your syntax and at least test COMPILE your scripts to make sure they do at least that (then testing them in-game to see if they actually work as intended is another thing). You might be able to get away with Polymorph() or ChangeAnimation() instead of creating and destroying the CRE (which will also reset HP etc.) but only if the abilities aren't different, and they probably are. You could also ApplySpell a custom spell to *change* the abilities appropriately but that gets rather complex, so I'd just leave it as-is for now and focus on dialogue etc.
Silly question, perhaps, and I think I already know the answer, but...this creature's animation is an all-black big cat. Perhaps I went overboard in assigning the black color to all the color fields in the .cre (major, minor, skin, armor, etc.). Would a change in any of the color fields to red show up on the animation? It would be nice to apply some red color highlights, but only if they don't look absurd If not, I'll leave the creature a solid black.
The animation isn't paletted, meaning it gets whatever colours are hardcoded in the animation .bam files. So it makes no difference what those fields are set to, but it doesn't hurt to set them to how it *should* look. You could apply a red colouring with a couple different effects, but they're dodgy and tend to make the creature all red. So as I said earlier, I'd wait until your mod gets closer to completion then ask someone in the Infinity Animations forum to port the NWN Beast of Malar. IIRC, that is only the panther form - the slayer is more wolverinish or something but who knows, maybe there's a suitable animation for that too somewhere.

 

Changes made to BAF. Must have been a data entry error :suspect: Yes, the creature's two forms have different abilities, and yes, I do want the second form to appear with max HP, so I didn't think polymorphing was the way to go for the change. Part of me feels that a special visual effect might be nice, one that's consistent with a creature changing shape/form as we see in the game, but I'll wait on that part till I know the script works as intended.

 

I understand about the animation. The slayer form is indeed described as a large, low-slung (?) wolverine with a wide mouth full of sharp teeth. I still need to go into NI and look at all the animal animations (BAM? PLT?) to see if anything looks close enough. If I find anything, I'll of course want it to be all black, to be consistent. I'll see about the IA Beast of Malar later, as advised.

 

Thanks very much!

Eric

Link to comment

I need to test the Beast of Malar content of my mod, so I've commented out everything in my .tp2 that doesn't pertain to it (so I don't install more than I need) and attempted to install with weidu-mac. I get a parsing error that has to do with the CreateCreature line in EP#MABSH.baf. Here's the content of that file:

 

IF
See(NearestEnemyOf(Myself))
Global("TimerStarted","LOCALS",0)
THEN
RESPONSE #100
SetGlobal("TimerStarted","LOCALS",1)
StartTimer("PanthAttack",12)
END
IF
TimerExpired("PanthAttack")
THEN
RESPONSE #100
CreateCreature("EP#MABCS.cre"[-1.-1],0)
DestroySelf()
END

 

The parse error mentioned column 1-36, near "]", so I'm guessing the installer doesn't like the coordinates, or the direction the created creature faces. Or is it something else?

 

Please help me to fix this, so I can install and test the creatures.

 

Thanks,

Eric

Link to comment
Try this instead:

CreateCreature("EP#MABCS",[-1.-1],0)

 

I'm a dope :) Thanks!

- E

 

Oops...but this change didn't help :suspect: Attempting to install the mod again yields this result:

 

[Hinaeari/script/EP#MABSH.baf] PARSE ERROR at line 13 column 1-32

Near Text: ]

syntax error

 

[Hinaeari/script/EP#MABSH.baf] ERROR at line 13 column 1-32

Near Text: ]

Parsing.Parse_error

ERROR: parsing [Hinaeari/script/EP#MABSH.baf]: Parsing.Parse_error

ERROR: error compiling [Hinaeari/script/EP#MABSH.baf]: Parsing.Parse_error

ERROR: compiling [Hinaeari/script/EP#MABSH.baf]!

Stopping installation because of error.

 

What else could be wrong here?

 

[Edit] I think I know what the problem is: there's a comma missing. I'll fix... [/Edit]

 

Thanks,

Eric

Link to comment

The Beast of Malar lives! :suspect:

 

This portion of the mod behaves as it should when I install just the beast's content (still have to read about setting up the .tp2 so components may be installed or not at the user's option). I must say the Claw Slayer packs a wallop! My main character nearly died when fighting it.

 

Claws and fangs both appear as lootable ground items when the beast dies. The icon on the ground for the fangs is way too large, though, being about the size of a character animation on the screen, when it should really be about the size of the claw/paw icon. I don't know what to do about that, as I haven't seen any other icon that's suitable for animal teeth/fangs.

 

So, this portion of the mod is functional. Should I ask for a volunteer to test it?

 

Thanks,

Eric

Link to comment
The icon on the ground for the fangs is way too large, though, being about the size of a character animation on the screen, when it should really be about the size of the claw/paw icon. I don't know what to do about that, as I haven't seen any other icon that's suitable for animal teeth/fangs.
Ground icons are really miniscule anyway, so I wouldn't worry about them. Something like ggem01.bam or gmisc94.bam will probably do for now, unless you're really concerned about making all the icons unique (in which case, you'll want unique inventory and description BAMs as well). If you own PS:T, you might browse through its icons as IIRC there are a lot of teeth and such, but I don't know if it pays much attention to ground BAM detail (BG2 doesn't either). Anyhow, they'd need to be resized too, as PS:T BAMs are bigger.

 

I don't think you'll need to get a volunteer just to test one creature with script. I'm sure you'll be tweaking it as you go along, and it's tough to get mod testers anyway. I guess folks don't want unfinished mods, though they tend to come flocking once it's released (or at least in beta).

Link to comment
The icon on the ground for the fangs is way too large, though, being about the size of a character animation on the screen, when it should really be about the size of the claw/paw icon. I don't know what to do about that, as I haven't seen any other icon that's suitable for animal teeth/fangs.
Ground icons are really miniscule anyway, so I wouldn't worry about them. Something like ggem01.bam or gmisc94.bam will probably do for now, unless you're really concerned about making all the icons unique (in which case, you'll want unique inventory and description BAMs as well). If you own PS:T, you might browse through its icons as IIRC there are a lot of teeth and such, but I don't know if it pays much attention to ground BAM detail (BG2 doesn't either). Anyhow, they'd need to be resized too, as PS:T BAMs are bigger.

 

I don't think you'll need to get a volunteer just to test one creature with script. I'm sure you'll be tweaking it as you go along, and it's tough to get mod testers anyway. I guess folks don't want unfinished mods, though they tend to come flocking once it's released (or at least in beta).

 

Heh, I figured this one out myself :suspect: I had set iwolf.bam as the ground icon, when I should have used gwolf.bam. Now I see the difference between an Inventory icon, a Ground icon, and a Carried icon, so all is well. Changed it, and now they show up on the beast's corpse (or among the blood, if the beast got chunked).

 

I solved that .bam issue, but now the item that drops is the default "skull" and not my custom EP#MABPB.itm that was dropping before. That's because I tried installing the entire content of the mod, and of course it wouldn't install because not everything is in place yet. So, now I have to re-install just the Beast of Malar portion of the mod, and test again.

 

Thanks,

Eric

Link to comment
Should be SetGlobal (with an L) and TimerExpired (no space). Yeah, you probably copied stuff from IESDP examples, where there are a lot of typos, but always check your syntax and at least test COMPILE your scripts to make sure they do at least that (then testing them in-game to see if they actually work as intended is another thing). You might be able to get away with Polymorph() or ChangeAnimation() instead of creating and destroying the CRE (which will also reset HP etc.) but only if the abilities aren't different, and they probably are. You could also ApplySpell a custom spell to *change* the abilities appropriately but that gets rather complex, so I'd just leave it as-is for now and focus on dialogue etc.
Silly question, perhaps, and I think I already know the answer, but...this creature's animation is an all-black big cat. Perhaps I went overboard in assigning the black color to all the color fields in the .cre (major, minor, skin, armor, etc.). Would a change in any of the color fields to red show up on the animation? It would be nice to apply some red color highlights, but only if they don't look absurd If not, I'll leave the creature a solid black.
The animation isn't paletted, meaning it gets whatever colours are hardcoded in the animation .bam files. So it makes no difference what those fields are set to, but it doesn't hurt to set them to how it *should* look. You could apply a red colouring with a couple different effects, but they're dodgy and tend to make the creature all red. So as I said earlier, I'd wait until your mod gets closer to completion then ask someone in the Infinity Animations forum to port the NWN Beast of Malar. IIRC, that is only the panther form - the slayer is more wolverinish or something but who knows, maybe there's a suitable animation for that too somewhere.

 

The transformation and accompanying visual effect are sorted out now :suspect: Here's the content of EP#MABSH.BAF:

 

IF
See(NearestEnemyOf(Myself))
Global("TimerStarted","LOCALS",0)
THEN
RESPONSE #100
SetGlobal("TimerStarted","LOCALS",1)
StartTimer("PanthAttack",12)
END
IF
TimerExpired("PanthAttack")
THEN
RESPONSE #100
CreateCreature("EP#MABCS",[-1.-1],0)
CreateVisualEffectObject("SPPOLYMP","EP#MABCS")
DestroySelf()
END

 

Heh, I feel a bit exposed when I post these things here in a general forum, but doing so still appears appropriate at this stage. Anyway, how does this BAF look? I've tested it in-game, and it works exactly as I want it to.

 

Always nice when things have a happy ending :) Now the Beast is complete, except for physical appearance, which I'm putting on hold for now, as advised. I'll still look through animations with NearInfinity, just in case I spot something that would look better for the Claw Slayer. If not, no big deal. What's important is that the thing works!

 

Next, I can work on the NPC herself, and start writing some dialogues...

 

Thanks,

Eric

Link to comment

All that remains now is to randomly spawn the Hunting Panther in some of the map areas. I've made a list of the areas I'd like to use, but I want to give a random chance, each time a party enters, of the creature spawning at all, and then set the spawn point to one of three possible sets of coordinates that I'll choose. Whenever the creature spawns, I'd like it to move about the map at random, if possible; I already have it set up to attack a party on sight.

 

What I need to know is where to find the coding I'll use to make this happen. Mike1072 mentioned that I'll need to extend the areas in question, which suggests to me that I'll be adding lines to my .tp2 to EXTEND_TOP ~ARxxxx.bcs~ ~Hinaeari/script/ARxxxx.baf~, for each area in which the creature might spawn, and that I'll need to create a separate BAF for each of these areas. Is this correct?

 

Is there a more efficient/simplified way to do this?

 

I'm ready to search through iesdp, once I know what I'm looking for. I tried looking at the conditional statements involving Area, but couldn't determine which one is appropriate for my needs. I think I also saw something in there about generating random numbers, and thought I might need to use something like that.

 

Please lead me to knowledge on this, so I can complete the Beast of Malar, test it, and then proceed with the rest of the mod :suspect:

 

Thanks,

Eric

Link to comment
Whenever the creature spawns, I'd like it to move about the map at random, if possible; I already have it set up to attack a party on sight.

This would belong in the creature's script, and I'd guess you'd implement it using RandomWalk(). I'm unfamiliar with this myself, but a good place to start would be to see if an existing creature has behaviour similar to what you want, then check out its scripts.

 

What I need to know is where to find the coding I'll use to make this happen. Mike1072 mentioned that I'll need to extend the areas in question, which suggests to me that I'll be adding lines to my .tp2 to EXTEND_TOP ~ARxxxx.bcs~ ~Hinaeari/script/ARxxxx.baf~, for each area in which the creature might spawn, and that I'll need to create a separate BAF for each of these areas. Is this correct?

 

Is there a more efficient/simplified way to do this?

There are a few different ways you can do this without needing a separate .baf for each area. One way is by using WeiDU variables to handle the different spawn points in the different areas.

 

Then your .baf file could contain a script block like this:

IF
 Global("EP#SpawnBeast","MYAREA",0)
THEN
 RESPONSE #100 // don't spawn creature
SetGlobal("EP#SpawnBeast","MYAREA",1)
Continue()
 RESPONSE #100 // spawn at first location
SetGlobal("EP#SpawnBeast","MYAREA",1)
CreateCreature("EP#MABCS",[%p1%],0)
Continue()
 RESPONSE #100 // spawn at second location
SetGlobal("EP#SpawnBeast","MYAREA",1)
CreateCreature("EP#MABCS",[%p2%],0)
Continue()
 RESPONSE #100 // spawn at third location
SetGlobal("EP#SpawnBeast","MYAREA",1)
CreateCreature("EP#MABCS",[%p3%],0)
Continue()
END

 

And you would use this code to extend an area script with it, specifying the coordinates for the different spawn points in that area:

EXTEND_TOP ~AR1900.BCS~ ~Hinaeari/script/beast_spawn.baf~
 TEXT_SPRINT p1 ~500.800~
 TEXT_SPRINT p2 ~2000.1250~
 TEXT_SPRINT p3 ~1000.2000~
 EVALUATE_BUFFER

Link to comment
Whenever the creature spawns, I'd like it to move about the map at random, if possible; I already have it set up to attack a party on sight.

This would belong in the creature's script, and I'd guess you'd implement it using RandomWalk(). I'm unfamiliar with this myself, but a good place to start would be to see if an existing creature has behaviour similar to what you want, then check out its scripts.

In-game creatures are embedded in the area file. The area file contains two sets of coordinates, their spawn coordinates and their destination coordinates. The latter controls their random movement. It doesn't appear in their script.

 

Using the panther as an exampe, catjag01.cre, it's override script is gensht01.bcs

IF
AttackedBy([GOODCUTOFF],DEFAULT)
Allegiance(Myself,NEUTRAL)
THEN
RESPONSE #100
	Shout(ATTACK89)
	Enemy()
END

IF
HitBy([GOODCUTOFF],CRUSHING)
THEN
RESPONSE #100
	Shout(ATTACK89)
	Continue()
END

IF
OR(5)
	AttackedBy([PC],DEFAULT)
	AttackedBy([FAMILIAR],DEFAULT)
	AttackedBy([ALLY],DEFAULT)
	AttackedBy([CONTROLLED],DEFAULT)
	AttackedBy([CHARMED],DEFAULT)
Allegiance(Myself,ENEMY)
ActionListEmpty()
THEN
RESPONSE #100
	Shout(ATTACK89)
	Continue()
END

IF
Heard([ANYONE],ATTACK89)
Allegiance(Myself,NEUTRAL)
!Class(Myself,INNOCENT)
THEN
RESPONSE #100
	Enemy()
	MoveToObject(LastHeardBy(Myself))
END

IF
Heard([ANYONE],ATTACK89)
Allegiance(Myself,NEUTRAL)
THEN
RESPONSE #100
	Enemy()
END

IF
Heard([ANYONE],ATTACK89)
!Class(Myself,INNOCENT)
!See(NearestEnemyOf(Myself))
THEN
RESPONSE #100
	MoveToObject(LastHeardBy(Myself))
	Continue()
END

It's race script is hunter.bcs

IF
Detect([PC])
!Range(LastSeenBy(Myself),15)
See([0.0.0.FOOD_CREATURE])
THEN
RESPONSE #100
	AttackReevaluate(LastSeenBy(Myself),30)
END

It's default script is wtasight.bcs

IF
Heard([ANYONE],WARNALARM)
THEN
RESPONSE #100
	MoveToObject(NearestEnemyOf(Myself))
END

IF
AttackedBy([GOODCUTOFF],DEFAULT)
!Allegiance(Myself,ENEMY)
THEN
RESPONSE #100
	Enemy()
END

IF
See(NearestEnemyOf(Myself))
THEN
RESPONSE #100
	AttackReevaluate(NearestEnemyOf(Myself),30)
END

IF
AttackedBy([ANYONE],DEFAULT)
THEN
RESPONSE #100
	Attack(LastAttackerOf(Myself))
END

You could always modify this to include random walk behavior, like this script for a peasant in the Den of the Seven Vales. It's wdrunsgt.bcs

IF
AttackedBy([GOODCUTOFF],DEFAULT)
Allegiance(Myself,NEUTRAL)
THEN
RESPONSE #100
	Enemy()
END

IF
See(NearestEnemyOf(Myself))
THEN
RESPONSE #100
	RunAwayFrom(NearestEnemyOf(Myself),150)
END

IF
AttackedBy([ANYONE],DEFAULT)
THEN
RESPONSE #100
	RunAwayFrom(LastAttackerOf(Myself),150)
END

IF
True()
THEN
RESPONSE #100
	RandomWalk()
END

Link to comment
Whenever the creature spawns, I'd like it to move about the map at random, if possible; I already have it set up to attack a party on sight.

This would belong in the creature's script, and I'd guess you'd implement it using RandomWalk(). I'm unfamiliar with this myself, but a good place to start would be to see if an existing creature has behaviour similar to what you want, then check out its scripts.

 

What I need to know is where to find the coding I'll use to make this happen. Mike1072 mentioned that I'll need to extend the areas in question, which suggests to me that I'll be adding lines to my .tp2 to EXTEND_TOP ~ARxxxx.bcs~ ~Hinaeari/script/ARxxxx.baf~, for each area in which the creature might spawn, and that I'll need to create a separate BAF for each of these areas. Is this correct?

 

Is there a more efficient/simplified way to do this?

There are a few different ways you can do this without needing a separate .baf for each area. One way is by using WeiDU variables to handle the different spawn points in the different areas.

 

Then your .baf file could contain a script block like this:

IF
 Global("EP#SpawnBeast","MYAREA",0)
THEN
 RESPONSE #100 // don't spawn creature
SetGlobal("EP#SpawnBeast","MYAREA",1)
Continue()
 RESPONSE #100 // spawn at first location
SetGlobal("EP#SpawnBeast","MYAREA",1)
CreateCreature("EP#MABCS",[%p1%],0)
Continue()
 RESPONSE #100 // spawn at second location
SetGlobal("EP#SpawnBeast","MYAREA",1)
CreateCreature("EP#MABCS",[%p2%],0)
Continue()
 RESPONSE #100 // spawn at third location
SetGlobal("EP#SpawnBeast","MYAREA",1)
CreateCreature("EP#MABCS",[%p3%],0)
Continue()
END

 

And you would use this code to extend an area script with it, specifying the coordinates for the different spawn points in that area:

EXTEND_TOP ~AR1900.BCS~ ~Hinaeari/script/beast_spawn.baf~
 TEXT_SPRINT p1 ~500.800~
 TEXT_SPRINT p2 ~2000.1250~
 TEXT_SPRINT p3 ~1000.2000~
 EVALUATE_BUFFER

 

Would that be the extent of a file "beast_spawn.baf" for this, or am I adding it to the Hunting Panther's override script? The Hunting Panther's .cre currently has the override script and default script specified, and I've just added Hunter.bcs as the race script; the override script is set to the one I created that handles the shapeshift from one form to the other (EP#MABSH), and the default script is set to WTASIGHT. Would beast_spawn become a customized version of WTASIGHT that I would create, and then specify as the default script?

 

Thanks,

Eric

Link to comment
Would that be the extent of a file "beast_spawn.baf" for this?

That should be all you need to spawn the creature in an area.

 

Also, which script would this be (I have nothing specified for class, race, or general)? The Hunting Panther's .cre has only the override script and default script specified; the override script is set to the one I created that handles the shapeshift from one form to the other (EP#MABSH), and the default script is set to WTASIGHT. Would beast_spawn become a customized version of WTASIGHT that I would create and then specify as the default script?

The script block in beast_spawn.baf should not be executed by the creature. With EXTEND_TOP, we add this block to the beginning of different area scripts in the game, so the creature can be created when the party first visits that area.

 

The creature's scripts start running after the creature is created. The RandomWalk() behaviour should go in one of them and execute when the creature is not attacking.

 

I wasn't aware that RandomWalk() was rarely used in the vanilla game, so thanks for pointing that out, Berelinde. In the example wdrunsgt script, the RandomWalk() block is located at the very bottom. This ensures it will only occur when the creature is not doing anything more important. It should be easy to create a customised WTASIGHT by adding the same block to the end to achieve similar behaviour.

 

Note that the creature spawning and random movement are two very separate tasks, and I would try to implement them one at a time.

Link to comment

Archived

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

×
×
  • Create New...