Jump to content

Request for clarification from Nythrun, please :)


Yovaneth

Recommended Posts

Hi Nythrun

 

Sometime back you helped me out with the code to insert a new bam into BG2. I've now been asked about it for another mod, but I've realised that I don't understand some of the flags you've used. If you have time, could you please clarify the options for the lines marked ** below?

 

WRITE_ASCII ("o" + 0x00) ~Newdoor~ // name this animation entry, you've got 32 characters to work with

WRITE_SHORT ("o" + 0x20) 0x1e4 // top left x coordinate (hex)

WRITE_SHORT ("o" + 0x22) 0x95 // top left y coordinate (hex)

** WRITE_LONG ("o" + 0x24) 0xffffffff // hours when it's active, this is active all the time

WRITE_ASCII ("o" + 0x28) ~ndoor1~ // your eight character resource reference for the bam you've made

WRITE_SHORT ("o" + 0x30) 0x0 // animation number within the .bam, I'm assuming there's just one

WRITE_SHORT ("o" + 0x32) 0x0 // stopping frame number within the .bam

** WRITE_LONG ("o" + 0x34) 0b00000000000000000001000000000101 // various flags, we're setting "is shown", "not light source", and "display in combat"

** WRITE_SHORT ("o" + 0x38) 0x0 // center point z coordinate, you'll have to find these (where zero = always on top?)

WRITE_SHORT ("o" + 0x3a) 0x0 // transparency, use a higher number if the door's made of glass :crazyeyes:

WRITE_SHORT ("o" + 0x3c) 0x0 // starting frame number. In this bam I only have one frame.

WRITE_BYTE ("o" + 0x3e) 0x0 // looping chance where zero equals 100 percent i.e. in this case always there

WRITE_BYTE ("o" + 0x3f) 0x0 // starting delay, shouldn't be any because we need the 'door' to appear immediately

WRITE_ASCII ("o" + 0x40) ~~ // resref to the palette bitmap (blank)

WRITE_LONG ("o" + 0x48) 0x0 // unused

 

If you can find time to do this, I would be very grateful. If not, I'm still very grateful because of the help you've already given.

 

-Y-

Link to comment

Okies, the forum's eating posts again.

 

Active Hours: this is a bitfield, ticking the first bit (0b00000000000000000000000000000001) makes an animation run from after midnight to after one a.m. While there are thirty-two bits in a dword, and only twenty-four hours in a day, Bioware by convention ticks off every bit for animations that run all the time, so I did as well.

 

Z coordinates: check out the fountains all over Athkatla to see how this is used - zero is along the ground (or maybe even below it, check your heights). There are also some screen shots in the Fixpack documentation of stove flames burning on top of the stove's hood and other bad z-pos animation slop that devSin fixed. You can also set z coordinates in your animation, but since most animations are heavily recycled, it needs to be attended to here also.

 

"Is shown" does what you think it does, always check it.

 

"Not light source" check out the the spiraling electricity in the Temple District or almost any fire to see what happens when this is checked - very apparent in nighttime areas. Most doors are not radioactive enough to glow.

 

"Display in combat" it won't wink out in a fight if this isn't checked, Bioware almost never used it (Pocket Plane and a couple other times) - you can probably skip if you don't want.

 

Back later, if one of the dozens of other folks who know areas better than I don't jump in first :crazyeyes:

Link to comment

Let me be stupidly cautious here, because I do intend to document all this for public use as part of my area-editing tutorials:

Active Hours: this is a bitfield, ticking the first bit (0b00000000000000000000000000000001) makes an animation run from after midnight to after one a.m.

So 0b00000000011111111111011111111111 will give me midnight to 23.00 but not 12.00-13.00, yes?

Z coordinates: check out the fountains all over Athkatla to see how this is used - zero is along the ground (or maybe even below it, check your heights).

I'll experiment with this one. Screenshots comparisons have got to be the best way of seeing exactly what is happening.

"Not light source" check out the the spiraling electricity in the Temple District or almost any fire to see what happens when this is checked - very apparent in nighttime areas.

Ditto. I have a nice big bonfire in one area that will help.

"Display in combat" it won't wink out in a fight if this isn't checked, Bioware almost never used it (Pocket Plane and a couple other times) - you can probably skip if you don't want.

Interesting. I've actually checked that flag for every animation I've used within my mod. So assuming that Avenger has put the checkboxes for the animation flags in a logical order in DLTCEP, I should be able to figure out the rest of that bitfield from the information you've given. I may be back to ask for confirmation when I've done it :groucho:

Thank you very, very much! :crazyeyes:

-Y-

Link to comment

These are the bitfield display flags that I know about, as defined by Avenger for DLTCEP (just the first thirteen bits):

 

0 = visible

1 = blend colours (always use for an animated bam otherwise you get a terrible black edge)

2 = not light source ('illumination off' in DLTCEP)

3 = partial animation (define 'partial'?)

4 = Synchronise draw with other (similar) bams

5 = not known

6 = not covered by a wallgroup

7 = invisible in fog (not used as fog was never implemented? Or does that mean invisible in fog of war?)

8 = use transparency

9 = draw all cycles (when would you not draw all cycles?)

10 = use palette bitmap

11 = mirrored (as in mirror across a vertical line - see fire1_b.bam)

12 = don't remove in combat

 

Can anyone help clear up those few queries?

 

-Y-

Link to comment

Partial Animation: run the first frame only. Never used; Bioware just did the sensible thing and made one frame .bams, in which case ticking the flag makes no difference.

 

Invisible in Fog: the animation (and the ground beneath it) won't be re-covered once revealed by fog of war. Subtle effect, seldom used.

 

When would you not draw all cycles? When you're recycling an animation and cycles after the first aren't appropriate to the context. Not many area animations are large enough to have been split up into separate cycles anyway, this is rarely used.

 

I don't know what bit 5 does, sorry.

Link to comment

Afaik, partial animation will stop at the last frame (as opposed to periodic animation).

So, it is not a still image of the first frame.

It is useful for animations that happen only once.

 

Blend is per pixel transparency. Each pixel will have a transparency based on its darkness. (black pixels are invisible). Area animations usually want this, especially smoke and flame.

 

draw all cycles is used only for large animations where the animation is split among cycles. This is a resource hungry thing, so it is better to be flagged. Aside from recycling, where you want to draw a particular cycle of a given animation, or where you want to change which the cycle of the animation is displayed.

StaticSequence is the action to switch between cycles. Obviously it is useless, or resulting in oddity when used on a 'draw all cycles' animation.

 

use palette bitmap: this is used by StaticPalette, but you can of course do it yourself.

 

Some of the bits: draw in combat, draw in fog of war seem to be working only with special settings. I've never seen the fog of war bit working.

Link to comment

After changing an area animation to shwater and ticking bit four, it displayed frame eight only without having run sequentially through the first seven frames. I'm not entirely clear on what's going on with that, or why it only ran the first frame last time I looked at it, but "run once" should be handled by script with a variable check :p

 

The fog of war bit I only ever tested with the bubble tanks for pod people in Chateau Irenicus: if it's unticked, leaving through the door allows visibility of the rest of the room to lapse. It could stand for another runthrough.

 

/edit

 

Does that mean you have gotten the "draw only in combat" bit to do anything, Avenger? I don't even know why it has the name.

Link to comment

Actually, the 'use transparency' flag is not correctly named.

The animation will use the transparency field, if you don't use the blend flag.

The 'use transparency' field is used for ground animations, where the actors can 'stand on it'.

This could be simulated with negative height too. (iwd/pst use negative height for the same effect).

This ground animation is used for ripples on water, animated cracks on the ground, etc.

Therefore i renamed it to 'ground' in future DLTCEP releases.

Link to comment

Nythrun, the 'don't remove during combat' flag (only you call it 'draw only in combat') is meaningful only if you have this setting:

 

Disable Statics During Combat=1

 

btw, i just seen this:

 

Disable Placed Sounds During Combat=0

 

So, a bit in ambients (aka placed sounds), might mean they are played regardless of this setting.

 

These settings are accessible from bgconfig.exe

Link to comment

Or "draw as background" as it is in NI :p

 

There're a smattering of negative z coordinates in BGII also (it's a signed short, so it ought to able to keep up with Widescreen Mod madness).

 

/edit

 

No, I called it "I don't know what this bit does" :p

 

/edit

 

Disable Placed Sounds During Combat=1 doesn't do anything for me?

Link to comment

Archived

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

×
×
  • Create New...