Skip to content

LastSummonerOf() issues

GalactygonGalactygon Member, Developer Posts: 412
This was a known issue in the original game and persists in BGII:EE.

Existing behavior:
LastSummonerOf(Myself) is not stored whenever the game is saved and reloaded. To test this, download and unzip the attached files into the override folder and cast Monster Summoning III until you summon an Ettercap. The Ettercap should then follow the summoner around if it gets too far. Saving the game and then reloading will break this behavior because LastSummonerOf(Myself) is not stored in the saved game.

Expected behavior:
LastSummonerOf(Myself) should be properly stored in a saved game.

Suggested implementation:
My suggestion is to use a similar stat scheme as image projection (stat 138 PUPPETMASTERID on the caster and stat 141 PUPPETID on the duplicate from stats.ids). Each time a .cre is summoned, a stat called SUMMONERID is set on the caster, which is identical to the value of a stat SUMMONEDID set on the .cre. The values themselves are automatically set ingame so each summoner has a unique id, and then unset whenever all summoned .cres of a particular summoner are unsummoned. Both stats (SUMMONERID and SUMMONEDID) would be carried as an external .eff file on the .cre so it would be possible to store them in saved games.

Because using new stat id slots for would break detectable spells and mod compatibility, I suggest using the unused hardcoded stats (143 BERSERKSTAGE1 and 144 BERSERKSTAGE2) as replacements.
CrevsDaak

Comments

  • CrevsDaakCrevsDaak Member Posts: 7,155
    Can confirm this form happening.


    Because using new stat id slots for would break detectable spells and mod compatibility, I suggest using the unused hardcoded stats (143 BERSERKSTAGE1 and 144 BERSERKSTAGE2) as replacements.

    Also BG2EE has DS included by default so only that could be made.
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    edited August 2014
    The berserkstage stats are not unused. Berserkstage2 is 'attack everyone', Berserkstage1 is 'attack enemies'.

    I don't know how the engine assigns summoned creatures in an MP game, though. It should know which player summoned them.
  • DemivrgvsDemivrgvs Member Posts: 315
    @Avenger_teambg are you sure Berserkstage1 is 'attack enemies'? If yes, is there any way to use it? Afaik both opcode 3 and opcode 247 set Berserkstage2 and makes the target attack friends and foes alike.
  • GalactygonGalactygon Member, Developer Posts: 412
    @Avenger_teambg

    If that's true then the IESDP needs to be amended. They are mentioned as "This stat seems never to be set." so I thought they weren't used.

    http://gibberlings3.net/iesdp/files/ids/bg2/stats.htm

    Do you know of any hardcoded stats that are unused? Or is it possible to combine the hardcoded stats 142, 143, and 144 into one stat without breaking anything and free up two new slots?

    Other hardcoded stats I can think of (combining?) are 88 STONESKINS and 199 STONESKINSGOLEM. I do not know what the differece is between the two besides that one is used by opcode 218 and the other by opcode 314.

    Other hardcoded stats I do not know the use are:
    61 IDENTIFYMODE (Identify spell/scroll is hardcoded to look for particular .spl/.itm?)
    196 DEADMAGIC (aren't SPELLFAILURE stats used by opcode 60 which is used in dead magic areas?)

    And then there is
    195 DISABLETRACKING (even infravision is more useful)
  • CrevsDaakCrevsDaak Member Posts: 7,155


    Other hardcoded stats I can think of (combining?) are 88 STONESKINS and 199 STONESKINSGOLEM. I do not know what the differece is between the two besides that one is used by opcode 218 and the other by opcode 314.

    That would break the penalties of the Stoneskin given by the Juggernaut Golem summon (it gives 5 Skins to the caster, and if the caster losses them, the Golem dies).
    Galactygon
  • GalactygonGalactygon Member, Developer Posts: 412
    edited August 2014
    @CrevsDaak Many thanks, I can confirm that behavior. Seems as though I posted this 8 years ago and then completely forgot about this behavior.

    http://forums.gibberlings3.net/index.php?showtopic=6083&p=71998
    EDIT: The above thread also gives answer to what BERSERKSTAGE1 and BERSERKSTAGE2 do.

    stat 199 STONESKINSGOLEM is just a way to bifurcate that from 88 STONESKINS so tha TOMEGOL4.cre can kill itself. See TOMEGOL4.bcs. Might be useful to place this explanation in the IESDP.

    Some trigger like IsSpellActive(I:Spell*Spell,O:Object*) or IsSpellRESActive(S:Spell*,O:Object*) would have been cooler from the legacy devs but that is something not related to this issue.
    Post edited by Galactygon on
    CrevsDaak
  • DemivrgvsDemivrgvs Member Posts: 315
    edited August 2014
    @Galactygon the above link actually doesn't answer my question unless I'm missing something.

    There's note from Avenger saying "245 an 246 are also modifying CHECKFORBERSERK and BERSERKSTAGE1" but unless IESDP is wrong 245 and 246 calls for 247, which sets BERSERKSTAGE to 2, aka attack friends and foe alike. Am I wrong? Is there any way to implement a BERSERKSTAGE1 where the berserker attacks only enemies?
  • GalactygonGalactygon Member, Developer Posts: 412
    edited August 2014
    This is what I found from extensive testing:

    142 CHECKFORBERSERK
    This stat is set by opcode 245 to the value of parameter 2. After a few hundred tries I was unable to get that reported 1% chance of berserking. Apparently this stat (and opcode 245) does nothing. Can anyone disprove this? No .itm or .spl uses this opcode (checked via WeiDU) in the game.

    143 BERSERKSTAGE1
    This stat is set by opcode 246 to the value of parameter 2. Works as reported in the IESDP. No .itm or .spl in the game uses this opcode or modifies this stat.

    144 BERSERKSTAGE2
    This stat is set by opcode 247 to the value of parameter 2. Works as reported in the IESDP. Only SPIN852.spl modifies this stat/uses this opcode.
    DemivrgvsCrevsDaak
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    edited August 2014
    identifymode was a dead stat, but i already repurpose it in one of our top secret projects.

    Deadmagic is used by the spellfailure opcode
  • CrevsDaakCrevsDaak Member Posts: 7,155
    edited August 2014

    identifymode was a dead stat, but i already repurpose it in one of our top secret projects.

    Do you mean Adventure Y or something else?

    also, maybe 198 IMMUNITY_TO_SEQUESTER can be used? AFAIK, the 'immune to sequester' opcode (312) only causes crashes.
    also, what about 108 PROFICIENCYBLACKJACK, is that one even used??
  • GalactygonGalactygon Member, Developer Posts: 412
    198 is marked as "FREEDOM" in the IESDP, actually I overlooked that. :)@Avenger_teambg is DEADMAGIC set to the equivalent to miscast magic percentage or to some other number? Is it hardcoded to be set when opcode 60 uses types 3, 4, and 5? I haven't read anything about this yet.

    So there are plenty of unused hardcoded stats for the developers to choose from should they go with SUMMONEDID and SUMMONERID.
    CrevsDaak
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    edited August 2014
    Immune to sequester is supposed to work in EE
    Galactygon: yes, using opcode 60 with 3/4/5 will set dead magic instead of normal spell failure (just different message)
    The surplus weapon profs are not used.
    CrevsDaak
  • CrevsDaakCrevsDaak Member Posts: 7,155

    Immune to sequester is supposed to work in EE

    But… what does it do?
    Also, does any of these is used?
    75 DONOTJUMP
    77 MENTALSPEED
    78 PHYSICALSPEED
  • GalactygonGalactygon Member, Developer Posts: 412
    75 DONOTJUMP - Used by opcode #184 (do not jump)
    77 MENTALSPEED - Used by opcode #189 (casting speed modifier)
    78 PHYSICALSPEED - Used by opcode #190 (attack speed factor)

    See here: http://gibberlings3.net/iesdp/opcodes/bgee.htm
  • CrevsDaakCrevsDaak Member Posts: 7,155

    75 DONOTJUMP - Used by opcode #184 (do not jump)
    77 MENTALSPEED - Used by opcode #189 (casting speed modifier)
    78 PHYSICALSPEED - Used by opcode #190 (attack speed factor)

    See here: http://gibberlings3.net/iesdp/opcodes/bgee.htm

    Ah, OK, I didn't realize that they were for this opcodes, since the names are actually a little bit misleading :p to start with (and really, I don't delve much with the stats.ids.
  • GalactygonGalactygon Member, Developer Posts: 412
    CrevsDaak said:

    Immune to sequester is supposed to work in EE

    But… what does it do?
    @Avenger_teambg : Seconded. I am also interested in what it actually does.
    CrevsDaak
  • MathsorcererMathsorcerer Member Posts: 3,037
    edited August 2014
    Immune to sequester is supposed to do something like make you immune to being mazed...I think. Doesn't seem to work, though.
  • CrevsDaakCrevsDaak Member Posts: 7,155

    Immune to sequester is supposed to do something like make you immune to being mazed...I think. Doesn't seem to work, though.

    Actually, immunity to maze is gained by using 'Immunity to opcode' and then set the opcode to protect against to the Maze one.
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    All i know, the freedom opcode applies this effect on the character for a short time. It is probably useless, though.
  • MathsorcererMathsorcerer Member Posts: 3,037
    @CrevsDaak‌ Yes, exactly. I was merely testing opcode 312 and it didn't seem to have any effect or make anyone immune to anything that I can see thus far.

    Just out of curiosity, has anyone ever used "protection from opcode" then set opcode 101 as the parameter? Protection from "protection from opcode".
    CrevsDaak
  • CrevsDaakCrevsDaak Member Posts: 7,155

    All i know, the freedom opcode applies this effect on the character for a short time. It is probably useless, though.

    If you ask me--I take that as unused ;P

    Just out of curiosity, has anyone ever used "protection from opcode" then set opcode 101 as the parameter? Protection from "protection from opcode".

    I haven't, but considering how the game engine is likely to crash, I'd bet there could be crash or just prevent future opcodes 101, but I am just assuming.
  • GalactygonGalactygon Member, Developer Posts: 412


    Just out of curiosity, has anyone ever used "protection from opcode" then set opcode 101 as the parameter? Protection from "protection from opcode".

    Yes, I am using it many times in my mods, often embedded as an external .eff. It even works when you place that effect in front of the actual protection from opcode effect from the effects list of a .spl or .itm so that the later effect gets blocked (a bit like a double negative).
    CrevsDaakGrammarsalad
  • MathsorcererMathsorcerer Member Posts: 3,037
    That is what I thought but I had never tried it before.
Sign In or Register to comment.