Jump to content


c4_angel

Member Since 20 Mar 2017
Offline Last Active Jan 16 2018 11:29 AM

Posts I've Made

In Topic: How to convert a string-like int variable to a real int variable?

15 December 2017 - 04:32 AM

Thanks to all of you.


In Topic: Toss your semi-useful WeiDU macros here

28 November 2017 - 04:55 AM

 

 

 

I made a table of all this here, excluding the values above 6240, as it varies depending on game version.

 

That's a great table. Thank you very much!

 

And I still may need help in two issues:

1. You mentioned "Spellstates 6240+ are dependent on the game campaign/version, read directly from specific offsets of the EXE. Pattern is 32(set) - 160(emtpy) - 32(set), and repeats semi-consistently up to the max (32767)". If I skip 6240-6271, use 6272-6431, then skip 6432-6463 ...etc, will function as expected?

 

2. Can I use splprot.2da to check them in script ? And how?

The semi-consistent part is that it occasionally has an extra multiple of 160 empty SPLSTATES between sets.  For example, BGSOD v2.3.67.3, starting from 6240, has:

3x(32 - 160 - 32) - 160 - 7x(32 - 160 - 32) - 1600 - (32 - 160 - 32) - (32 - 160 - 32) etc...

But I don't know if every game version has the same pattern off extra space or not.  I didn't go very far with it, other than to check from the other end (32767) to see if it was still in effect.  The second 32 of each such set has always had the exact same value though, 0x0000000a, using only bits 1 and 3.

 

SPLPROT only works in spells/items/projectiles, and comes with an entry for checking SPLSTATES, entry 110, using Parameter1 to specifcy the spellstate.

Scripts still have to use CheckSpellState().

 

 

a little confused with the pattern, but try start from 32767 will be a good idea, thank you.


In Topic: Toss your semi-useful WeiDU macros here

27 November 2017 - 09:40 PM

 

I made a table of all this here, excluding the values above 6240, as it varies depending on game version.

 

That's a great table. Thank you very much!

 

And I still may need help in two issues:

1. You mentioned "Spellstates 6240+ are dependent on the game campaign/version, read directly from specific offsets of the EXE. Pattern is 32(set) - 160(emtpy) - 32(set), and repeats semi-consistently up to the max (32767)". If I skip 6240-6271, use 6272-6431, then skip 6432-6463 ...etc, will function as expected?

 

2. Can I use splprot.2da to check them in script ? And how?


In Topic: Toss your semi-useful WeiDU macros here

27 November 2017 - 02:47 PM

 

 

C4_FIND_STAT_SLOT is an action function, checks all creature/item/spell files in game which have effect using opcode #318 (vanilla game) or opcode #328 (EE game), also values in STATS.IDS or SPLSTATE.IDS, find an unused one from 501 to 32767, and append a line with an user defined "identifier"(requred). Return "available_stat" for further usage.

SPLSTATE values 256+ are set by the engine for other purposes. (STATS, Bardsong, Backstab, New Opcodes, some pulled straight from the EXE).

Setting them manually has no effect(mostly), but checking them is not reliable.

 

I did test in my mod at 500+, no bug found by now, is there any range already found? 32767 is top...

 

And are there any reliable way?


In Topic: Toss your semi-useful WeiDU macros here

27 November 2017 - 02:15 PM

I may toss one here, but flawed I think.
 
Since TobEx expands the use of STATS.IDS to support new hard-coded stats and custom stats, this function aims ease-to-use and work in EE engine as well.
It should be used along with script trigger:
CheckStat(O:Object*,I:Value*,I:StatNum*Stats) for vanilla games (so ToBEx must be installed to make this happen) and CheckSpellState(O:Object*,I:State*splstate) for EE games.    
 
If anyone already have a better function to do this job please let me know.
 
Codes are here: https://github.com/S...unique_mark.tpa

Borrowed the FJ_SPL_ITM_REINDEX function for file correction, thanks to authors.
 

Function name: C4_FIND_STAT_SLOT and C4_ADD_UNIQUE_MARK

 

C4_FIND_STAT_SLOT is an action function, checks all creature/item/spell files in game which have effect using opcode #318 (vanilla game) or opcode #328 (EE game), also values in STATS.IDS or SPLSTATE.IDS, find an unused one from 501 to 32767, and append a line with an user defined "identifier"(requred). Return "available_stat" for further usage.

Spoiler

 

C4_ADD_UNIQUE_MARK is a patch function, calls C4_FIND_STAT_SLOT, and uses function CLONE_EFFECT to add an effect to creature/item/spell file with an user defined "identifier"(also requred), other parameters of the "match_" part are same with CLONE_EFFECT.

Spoiler

 

Take mage spell Blur for example:

Spoiler

 

Note the I:Value* must be fixed to 1, since CheckSpellState has no value parameter.