Jump to content

Dead("VOICE") always returning false?


ZFR

Recommended Posts

Posted (edited)

I'm using oIWD (non-EE). I'm playing around with AB's implementation of Voice of Durdel Anatha. AR8009 script has the following

 

IF
	GlobalLT("Voice_No_Spawn","GLOBAL",1)
	Dead("VOICE")
THEN
	RESPONSE #100
		CreateCreature("VOICE",[922.1380],0)
END

Problem is, after VOICE is killed, the CreateCreature never gets triggered.

The problem seems to be with Dead("VOICE") because if I remove the line and change the script to

 

IF
	GlobalLT("Voice_No_Spawn","GLOBAL",1)
THEN
	RESPONSE #100
		CreateCreature("VOICE",[922.1380],0)
END

then CreateCreature does get triggered and infinite copies of Voice get created as expected.

I'm fairly new to IE modding, but could someone tell me how to get this to work? To have a new VOICE get created once the old one is killed?

Edited by ZFR
Posted

I bet VOICE is not the script name of this creature. You need to use that field, not the filename in the check.

Posted

The script name for The Voice of Durdel Anatha in the unmodded game is actually "VOICE". But I don't know if that's changed in the mod. The script name could also be overridden in an ARE file or associated INI file. That's a common practice in IWD.

You could also check whether the creature registers as dead at all. The CRE V9.0 format contains a field (at offset 0x0271) that can suppress setting a death variable. The CRE format also allows to define alternative death variables at offsets 0x027e and 0x029e. Maybe one of these is set instead.

Lastly, you could make a save after you've killed The Voice and check if the list of globals in the ICEWIND.GAM of the save lists The Voice as being dead (e.g. VOICE_DEAD=1).

Posted (edited)
2 hours ago, argent77 said:

The script name for The Voice of Durdel Anatha in the unmodded game is actually "VOICE". But I don't know if that's changed in the mod. The script name could also be overridden in an ARE file or associated INI file. That's a common practice in IWD.

I'm not sure what the script name of a creature means. The .CRE file is called VOICE.CRE. Also, since CreateCreature("VOICE",[922.1380],0) if I remove the Dead condition ,works properly, then I guess VOICE is the correct script name?

Could you direct me how to check if the script name is overriden in the ARE file? AR8009 has no ini.

 

2 hours ago, argent77 said:

Lastly, you could make a save after you've killed The Voice and check if the list of globals in the ICEWIND.GAM of the save lists The Voice as being dead (e.g. VOICE_DEAD=1).

Thanks. I checked that, and found the following globals:

THEVOICEOFDURDELANATHA_DEAD and SPRITE_IS_DEADTHEVOICEOFDURDE

 

 

This is what Infinity Explorer shows me

voice.png

Edited by ZFR
Posted

Update:

 

If I change it to the following:

IF
  GlobalLT("Voice_No_Spawn","GLOBAL",1)
  Dead("THEVOICEOFDURDE")
THEN
  RESPONSE #100
    CreateCreature("VOICE",[922.1380],0)
END

 

The as soon as I kill the Voice, an infinite amount of them start spawning. The spawned creatures however do not initiate dialogue like the original one does. If you talk to them, they have the same dialogue though.

Posted
1 hour ago, ZFR said:

I'm not sure what the script name of a creature means. The .CRE file is called VOICE.CRE. Also, since CreateCreature("VOICE",[922.1380],0) if I remove the Dead condition ,works properly, then I guess VOICE is the correct script name?

The script name, or death variable, is a text field in the CRE file (32-byte limit). Unlike the creature's name, which is a string reference and can thus have unlimited length. Or the resource name, which is the file name before the extension and is limited to 8 characters.

The CreateCreature script action uses the resource name.

Using script names that are the same as resource names is common, and is generally good practice. But it's not universal.

(I don't have IWD, so I can't comment on the specific situation here.)

Posted

He's not in the original game area, so this is something from this unnamed mod. From what you posted above the script name should be THEVOICEOFDURDELANATHA.

Posted

And that's a problem.

Quote

Variables in the IE are limited to a length of 32 characters (or 18 characters for the death variable, due to the preprending of SPRITE_IS_DEAD).

"THEVOICEOFDURDELANATHA" is 22 characters. It fits in the CRE file's field, but the variable created from it to track the creature's death gets cut off. You'll only get a check that works if you look for the death status of exactly the right truncation of that; probably "THEVOICEOFDURDELAN".

Or it would work a lot better if the mod in question simply used a script name that fit within the death variable limit.

Posted

The iwd version of the dead trigger takes objects, not strings, so it should be fine in this case. But yes, best keep to shorter names when possible.

Posted

The mod in question is Auril's Bane (sorry I should have mentioned the full name in the original post instead of AB).

 

 

If I look at "Death Variable" using infinity explorer, it shows it as "Voice"

I did try the truncation. If I do this

 

IF
  GlobalLT("Voice_No_Spawn","GLOBAL",1)
  Dead("THEVOICEOFDURDE")
THEN
  RESPONSE #100
    CreateCreature("VOICE",[922.1380],0)
END

Then the CreateCreature does get triggered. The problem is, it starts getting triggered infinitely many times since Dead("THEVOICEOFDURDE") keeps returning true, even after VOICE is created. Also, the newly created VOICE doesn't have any scripts attached to it, so it doesn't initiate dialogue and it doesn't remember NumTimesTalkedTo

Posted
5 minutes ago, ZFR said:

The problem is, it starts getting triggered infinitely many times since Dead("THEVOICEOFDURDE") keeps returning true, even after VOICE is created.

That's intended behavior. Spawning a new creature instance does not automatically reset the death variable. You could either reset it manually by setting the death variable to 0, or use a guard variable so that the script block is called only once (the better and more compatible option).

Posted
21 minutes ago, argent77 said:

That's intended behavior. Spawning a new creature instance does not automatically reset the death variable. You could either reset it manually by setting the death variable to 0, or use a guard variable so that the script block is called only once (the better and more compatible option).

Gotcha.

Just one last thing.

The first Voice that I encounter has the following script (It's VOICE.BCS file in override folder).

IF
  See([PC])
  !Allegiance(Myself,ENEMY)
THEN
  RESPONSE #100
    StartCutSceneMode()
    ClearAllActions()
    SetDialogueRange(300)
    MultiPlayerSync()
    Dialogue([PC])
END

IF
  !Allegiance(Myself,ENEMY)
  AttackedBy([GOODCUTOFF],DEFAULT)
THEN
  RESPONSE #100
    ChangeEnemyAlly(Myself,EVILCUTOFF)
    AttackReevaluate(LastAttackerOf(Myself),105)
END

IF
  See(NearestEnemyOf(Myself))
  Allegiance(Myself,ENEMY)
THEN
  RESPONSE #100
    AttackReevaluate(LastSeenBy(Myself),105)
END

The first part of which forces a dialogue. However any subsequent Voice that I create using CreateCreature("VOICE",[922.1380],0) don't have it.

Is there a way to add it? (And is there a way of preserving NumTimesTalkedTo, so all subsequent incarnations don't start dialogue from the very beginning)?

Posted

NumTimesTalkedTo is tied to the specific creature instance. Creating a new creature instance resets any local settings (local variables and other scripted changes there were applied to the original instance of the creature).

oIWD seems to support the SetNumTimesTalkedTo() action which could be used to set it to the desired value. But that may not be enough to make the creature behave like intended. It this is your own addition to the character then I'd rather suggest to install your own version of the creature, with scripts and dialogs.

Posted

@argent77 @jmerry @lynx

Thank you for your help.

 

For my particular game, I guess I'll just CreateCreature Voice as a quick solution. However when I have free I'll sit and see if I can fix this "properly". (Auril's Bane seems to be unsupported and superseeded by Unfinished Business, at Least its Voice of Durdel Anatha component, but it would be good modding practice for me).

 

Cheers.

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...