Jump to content

Concordance of new features


Ascension64

Recommended Posts

I guess you meant bytes, but even that would be wrong. I suggest using words (16 bits).

 

The original opcode uses param1 for secondary and tertiary charge counts.

If there ANY use of secondary and tertiary charges anyway?

 

The notes about the effects are interesting, are they from Taimon or you just thought about some uses?

 

Because opcode 180 already has some function when param2 is nonzero, i just couldn't figure it out (most likely deactivated like the rest of the group).

Link to comment
I guess you meant bytes, but even that would be wrong. I suggest using words (16 bits).

Wouldn't that be a char, since there is 4 of them in a dword?

 

The original opcode uses param1 for secondary and tertiary charge counts.

If there ANY use of secondary and tertiary charges anyway?

Yes, if an item has more than one type of ability (say a wand).

 

The notes about the effects are interesting, are they from Taimon or you just thought about some uses?

 

Because opcode 180 already has some function when param2 is nonzero, i just couldn't figure it out (most likely deactivated like the rest of the group).

They are purely my invention.

 

-Galactygon

Link to comment
I guess you meant bytes, but even that would be wrong. I suggest using words (16 bits).

Wouldn't that be a char, since there is 4 of them in a dword?

A dword (double word) is 2 words, 4 bytes and 32 bits.

A word is 2 bytes, 16 bits.

A char/byte is 8 bits.

 

I hope it is clear now :mad:

 

Using bytes would be wrong because itemtypes are already a word (though no one uses them that way).

It is easier to code (less conversions).

Link to comment
I guess you meant bytes, but even that would be wrong. I suggest using words (16 bits).

Wouldn't that be a char, since there is 4 of them in a dword?

A dword (double word) is 2 words, 4 bytes and 32 bits.

A word is 2 bytes, 16 bits.

A char/byte is 8 bits.

 

I hope it is clear now :mad:

 

Using bytes would be wrong because itemtypes are already a word (though no one uses them that way).

It is easier to code (less conversions).

 

Ok, then yes, words are better in this case.

 

-Galactygon

Link to comment
Guest Guest

While Galc's idea are interesting and useful, I'd pleased with anyone not to implement them in the manner suggested - they seem very short sighted, and there is no consistency (they'd be worth than the existing mess of opcodes!)

Link to comment
While Galc's idea are interesting and useful, I'd pleased with anyone not to implement them in the manner suggested - they seem very short sighted, and there is no consistency (they'd be worth than the existing mess of opcodes!)

 

Convince me. What are your ideas?

 

-Galactygon

Link to comment

Finally had a chance to squizz through all of this. I made a list of the triggers/actions/effect changes listed.

 

Vanilla compatibility is a priority for TobEx - the only case where this wouldn't apply is that if a user builds a mod that uses a new opcode or such (would otherwise result in an Assertion Error, say for a new effect). Ideally, new opcodes/parameters would do nothing in vanilla, but this would not always be the case.

 

I just ask you that if you add something to ToBEX, make it so it remains compatible with the original engines (a tob game or tob mod would still be playable on ToBEX, and that you don't add options to existing opcodes that would clash with iwd/pst).

 

If you reimplement an iwd/pst feature in place it is good. Also, if you add some new option, because we cannot stray from iwd/pst either.

Any GemRB-only options are alterable if there is a better idea and the change doesn't involve a large heap of code.

I think this is manageable, although I am clutching at straws. Because TobEx only works with ToB, I have no familiarity with PS:T, IWD1/2, or BG1. I assume that because they use the same engine, implementations are fairly similar, although differing file versions can be an issue. Is there anything drastically different in the way that struct/classes are designed, since I have no data on these?

 

It would be useful to get a list of opcode implementations (IWD/PST/BG/BG2/hybrid) that GemRB uses as Galactygon has mentioned. If anything, TobEx could mimic much of this. Externalisation is posslbe, although I currently know so little of GemRB code it would take some delving.

 

Are opcodes 400+ in IWD2 made cross-compatible with BG2? This is possibly something for the far future when opcodes grow up to that number. It is definitely possible to avoid use of these opcodes if required to prevent issues with GemRB.

Link to comment
Externalisation is posslbe, although I currently know so little of GemRB code it would take some delving.

 

If you need any pointers, do just ask (or drop by on IRC).

 

Are opcodes 400+ in IWD2 made cross-compatible with BG2? This is possibly something for the far future when opcodes grow up to that number. It is definitely possible to avoid use of these opcodes if required to prevent issues with GemRB.

 

The opcode numbers are taken from our effect.ids file, so we could always just assign them non-conflicting numbers if it's a problem for you, I guess? (right now we only assign iwd2 effect 425 in bg2 mode, and only for internal use).

 

At a glance I'm not sure what from TobEx we should be implementing as "obvious fixes" and what we should be adding feature flags for, but thankyou *so* much for providing source, it will make everything much easier for us.

Link to comment

I just wish it could be better coded, and there were more explanations! :undecided:

 

One question: just browsing through the source I was unable to find where you implemented the effect opcodes. Is it in EffectQueue.cpp somewhere? I found the actions in Actions.cpp and triggers in Triggers.cpp.

 

0x12a (pocketplane) will let you run any cutscene stored in the resource field. It of course defaults to cut250a

It will always store the party locations.

Does this differ from Taimon's implementation, described thus?

// This modifies the effect 0x12A allowing you to specify an arbitrary

// script (cutscene). The script resref has to be in the resource1 field.

// You have to set param1 to 1 to enable the new behavior. Param2 configures

// if and where the party locations are stored.

// 0 = pocketplane slot

// 1 = normal slot

// 2 = dont save locations

Link to comment
One question: just browsing through the source I was unable to find where you implemented the effect opcodes. Is it in EffectQueue.cpp somewhere? I found the actions in Actions.cpp and triggers in Triggers.cpp.

 

See plugins/FXOpcodes, plugins/IWDOpcodes and plugins/PSTOpcodes.

 

Does this differ from Taimon's implementation, described thus?

 

This is what Avenger called fx_cutscene2, I guess: it seems we trigger the custom resource based on param2 and not param1, and we only handle the plane locations case, but it would be no problem to change it to match Taimon's.

 

Is there a list of these already-existing opcode modifications somewhere? Are they all in ToBEx?

Link to comment
See plugins/FXOpcodes, plugins/IWDOpcodes and plugins/PSTOpcodes.
Ah, there they are. Thanks.

 

This is what Avenger called fx_cutscene2, I guess: it seems we trigger the custom resource based on param2 and not param1, and we only handle the plane locations case, but it would be no problem to change it to match Taimon's.

 

Is there a list of these already-existing opcode modifications somewhere? Are they all in ToBEx?

TobEx doesn't actually add many opcode features at the moment. The ones added are:

-Fix for opcode Awaken (0x2) - correct opcode removed

-Fix for opcode Cure Drunkenness (0xa4) - correct opcode removed

-Fix for opcode Invisible (0x14) - correct permanent Improved Invisibility

-Fix for opcode Dispel (0x3a) - correct formula

-Fix for opcode Mirror Image (0x77) - keep caster level

-Modification for opcode Damage (0xc) - tagged opcode Awaken at the end of it

-Fix for opcode Blindness (0x4a) - two options in TobEx; one removing cumulative -10 to hit penalty, the other option changes entire opcode to -4 to hit, 4 point armor penalty

-Fix for opcode Magic Resistance Modifier (0xa6) - added support for TIMING_PERMANENT, and adds percentage modifier (param2 = 2)

-Adds opcode 0x13e - simply displays a debug message and is of no consequence

 

Taimon describes a number of modifications to opcodes in his tob_hacks mod: http://forums.gibberlings3.net/index.php?showtopic=17833.

TobEx does not apply all of them at the moment (see readme.txt).

Link to comment

This is how I have implemented effect 0x12A Cutscene 2

 

//#298 (0x12A) Cutscene 2 [298]

//Parameter #1: Store party location behaviour

//Parameter #2: Use custom cutscene script

//Description:

//Starts a cutscene, whereby the default settings (0, 0) executes cut250a.bcs and stores current party locations in the list used specifically for pocket plane.

//Values for 'Store party location behaviour':

//0 Use list specifically for pocket plane (default)

//1 Use list normally used by StorePartyLocations() action - restore with RestorePartyLocations() action

//2 Do not store party locations

//Values for 'Use custom script':

//0 Use cut250a.bcs (default)

//1 Use cutscene script specified by the Resource field

 

Basically, I have adopted GemRB's use of param2 to toggle the custom cutscene script. I then used Taimon's location storing options as param1 instead of Taimon's param2.

Link to comment
This is how I have implemented effect 0x12A Cutscene 2

 

//#298 (0x12A) Cutscene 2 [298]

//Parameter #1: Store party location behaviour

//Parameter #2: Use custom cutscene script

//Description:

//Starts a cutscene, whereby the default settings (0, 0) executes cut250a.bcs and stores current party locations in the list used specifically for pocket plane.

//Values for 'Store party location behaviour':

//0 Use list specifically for pocket plane (default)

//1 Use list normally used by StorePartyLocations() action - restore with RestorePartyLocations() action

//2 Do not store party locations

//Values for 'Use custom script':

//0 Use cut250a.bcs (default)

//1 Use cutscene script specified by the Resource field

 

Basically, I have adopted GemRB's use of param2 to toggle the custom cutscene script. I then used Taimon's location storing options as param1 instead of Taimon's param2.

 

I like GemRB's handling of opcode 298. Jumping to opcode 124 (teleport) in GemRB (no pun intended), setting IWD2 setting parameter2 to 2 returns the creature to saved location. I wonder if it's identical to RestorePartyLocations(), and what happens if NPCs are affected.

 

What would make these effects even more versatile is to have a new type of "Store party location behaviour" setting, that stores the locations in a local/global variable referenced in the 2nd resource key. The effect would set the global/local (if param1 is set to 3 or 4) variable MYVARIABLE_MYAREA_XPOS_YPOS to 0. Then opcode 124 would need to be modified accordingly, so it has the option to restore the party locations based on the variable referenced in the resource key. It would be nice for both global and local variables to work.

 

This setting would only be used in external .effs.

 

-Galactygon

Link to comment

In iwd2 (iwd, and maybe even pst) there is a position/face setting that is saved in the creature structure. That is the saved location. (GemRB supports these fields, but saves them only in an iwd game)

 

And now for something different:

0x7f - randomsummon has an unspecified function, if param2 is>9, it summons friendly anisum03.2da critters.

GemRB extends this by:

 

1. if the resource field is set, it uses the resref from it, instead of anisum03.

2. in case of external effects, resource2 and resource3 may contain the summoning animation BAM resrefs, if the 2da doesn't specify them.

 

About the cutscene opcode: i will implement it the same as ToBeX does this, as long as there is a custom script option.

So it is up to you to negotiate this with Ascension64.

Link to comment
And now for something different:

0x7f - randomsummon has an unspecified function, if param2 is>9, it summons friendly anisum03.2da critters.

GemRB extends this by:

 

1. if the resource field is set, it uses the resref from it, instead of anisum03.

2. in case of external effects, resource2 and resource3 may contain the summoning animation BAM resrefs, if the 2da doesn't specify them.

 

Isn't this already (according to the IESDP) in ToB? What use does resource3 have for .bam files when .bam file from resource2 is played on the critter summoned?

 

-Galactygon

Link to comment

Archived

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

×
×
  • Create New...