Jump to content

Game crash due a script trigger condition


aigleborgne

Recommended Posts

Hi,

 

As you should know, I'm giving divine remix kits to unjoinable npc in bg1tutu.

 

I made some code to give them all the innates and I tested it in game.

 

For an old innate like berserker rage (use by tempus kit):

IF

!GlobalTimerNotExpired("ja#cast","LOCALS")

HaveSpellRES("spcl321")

THEN

RESPONSE #100

SetGlobalTimer("ja#cast","LOCALS",6)

SpellRES("spcl321",Myself)

END

 

HaveSpellRES("spcl321") works fine.

 

Now, for a new innates like battle axe:

IF

!GlobalTimerNotExpired("ja#cast","LOCALS")

Global("ja#disable_spellcasting","LOCALS",0)

HaveSpellRES("a#tem0b") // Battleaxe - 'Battle Prowess'

THEN

RESPONSE #100

SetGlobalTimer("ja#cast","LOCALS",6)

SpellRES("a#tem0b",Myself) // Battleaxe - 'Battle Prowess'

END

 

This block crashes the game when executed, now if I remove the trigger HaveSpellRES("a#tem0b") // Battleaxe - 'Battle Prowess'

it works fine

 

Now i'm wondering why it doesn't work.

I could replace every test by variable, since they can only have one innate of each spell. But it would be "better" to find out the problem :D

 

After several additionnal tests, it seems to be random. (on certain spells, it crashes everytime, but on others, it crashes sometimes)

I will then try to reinstall everything and try again.

Link to comment

I believe it's the same issue addressed by Scriptable Spells--in order for HaveSpell() to work with innates, they need to be level one.

 

I thought we had been pretty thorough with setting innates to level one, but we missed ths one. I'll review and see if there are others we missed. In the mean time, if you add this to your tp2 your script should work:

 

ACTION_IF FILE_EXISTS_IN_GAME ~a#tem0b.spl~ THEN BEGIN
 COPY_EXISTING ~a#tem0b.spl~ ~override~
   WRITE_LONG 0x34 1
END

Link to comment

Thanks for your response.

It seems to be that problem.

Battle axe was level 2. I set it to level 1 and it works.

I will make a code similar to what you have posted with all innate to correct.

In fact, the game crashes when the trigger is checked, not when the spell is cast.

 

I will then test it everything after :D

 

I believe it's the same issue addressed by Scriptable Spells--in order for HaveSpell() to work with innates, they need to be level one.

 

I thought we had been pretty thorough with setting innates to level one, but we missed ths one. I'll review and see if there are others we missed. In the mean time, if you add this to your tp2 your script should work:

 

ACTION_IF FILE_EXISTS_IN_GAME ~a#tem0b.spl~ THEN BEGIN
 COPY_EXISTING ~a#tem0b.spl~ ~override~
   WRITE_LONG 0x34 1
END

Link to comment

Here is my code :

 

// Divine remix fixes (innate are level 1 spells)

ACTION_IF FILE_EXISTS_IN_GAME ~a#tem0b.spl~ THEN BEGIN

COPY_EXISTING ~a#tem0b.spl~ ~override~

~a#kos0a.spl~ ~override~

~a#og0a.spl~ ~override~

~a#sha0b.spl~ ~override~

~cdslmce.spl~ ~override~

~cdslmsd.spl~ ~override~

~cdxvscm.spl~ ~override~

~cdhmbst.spl~ ~override~

~cdltmac.spl~ ~override~

~nmsun0b.spl~ ~override~

~cdtldst.spl~ ~override~

~cdtlspr.spl~ ~override~

~cdilhnd.spl~ ~override~

WRITE_LONG 0x34 1

END

 

It covers all the innates I will use in bg1. Maybe, there are some others spells.

However, these are the most important :D

 

Globally, all the summoning weapons were level 2, and some other innates were level 3 or more.

Link to comment
Here is my code :

 

// Divine remix fixes (innate are level 1 spells)

ACTION_IF FILE_EXISTS_IN_GAME ~a#tem0b.spl~ THEN BEGIN

COPY_EXISTING ~a#tem0b.spl~ ~override~

        ~a#kos0a.spl~ ~override~

        ~a#og0a.spl~ ~override~

        ~a#sha0b.spl~ ~override~

        ~cdslmce.spl~ ~override~

        ~cdslmsd.spl~ ~override~

        ~cdxvscm.spl~ ~override~

        ~cdhmbst.spl~ ~override~

        ~cdltmac.spl~ ~override~

        ~nmsun0b.spl~ ~override~

        ~cdtldst.spl~ ~override~

        ~cdtlspr.spl~ ~override~

        ~cdilhnd.spl~ ~override~

  WRITE_LONG 0x34 1

END

 

It covers all the innates I will use in bg1. Maybe, there are some others spells.

However, these are the most important :D

 

Globally, all the summoning weapons were level 2, and some other innates were level 3 or more.

 

http://forums.gibberlings3.net/index.php?showtopic=5189

 

It's on Andyr's For Next version list, but FYI: Shar's Curse & Chakram: Discs of Night are two others that have their spell level set incorrectly.

Link to comment

Archived

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

×
×
  • Create New...