Jump to content

0x004A Died(O:Object*)


Diana

Recommended Posts

I attempted to script my NPC exclaiming in amazement when he was in a party that killed one of the in-game dragons and added this as the first block in his script. SHADRA01 is the DV for the Shadow Dragon in the Umar Hills. This script never triggers. However, if I added See("SHADRA01") and Dead("SHADRA01") to replace Died("SHADRA01") it works. Has anyone used the Died(O:Object*) successfully? Thanks.

 

IF

InParty(Myself)

CombatCounter(0)

Global("Dragon_Killer","LOCALS",0)

Died("SHADRA01")

THEN

RESPONSE #100

SetGlobal("Dragon_Killer","LOCALS",1)

StartDialogNoSet(Player1)

END

Link to comment
I attempted to script my NPC exclaiming in amazement when he was in a party that killed one of the in-game dragons and added this as the first block in his script. SHADRA01 is the DV for the Shadow Dragon in the Umar Hills.  This script never triggers.  However, if I added See("SHADRA01") and Dead("SHADRA01") to replace Died("SHADRA01") it works.  Has anyone used the Died(O:Object*) successfully?  Thanks.

 

IF

InParty(Myself)

CombatCounter(0)

Global("Dragon_Killer","LOCALS",0)

Died("SHADRA01")

THEN

RESPONSE #100

SetGlobal("Dragon_Killer","LOCALS",1)

StartDialogNoSet(Player1)

END

 

 

I attempted similar thing. I tried to check if my NPC killed a specific monster, so that the player could have a chance to compliment her for that. For that I used Killed(O:Object*), only to discover that it does not respond to death variable, but to the group/category of the creature.

 

Here's a relevant quote from the IESDP:

 

O:Object* - an object specified in the Object.ids file or a script name of a CRE wrapped in quotes "" or the name of a container or door or trap in quotes. When specifying creatures, a special format can be used to allow a whole group/category of creatures to act as the parameter. The format is [EnemyAlly.General.Race.Class.Specifics.Instance.SpecialCase]. Where General is from General.ids for example. A 0 means "any in this category". For example: [ENEMY.0.0.MAGE] specifies all creatures that are enemies of the party, any general category, any race, mages. Some triggers are only useful when types of creatures are specified in this way. Remember: [ANYONE] will allow ANY object to satisfy the trigger. i.e. See([ANYONE]) returns true if any friend or foe is seen.
Link to comment
Dead uses the death variable in BG2. Not object.

 

[edit]

Oops, you said the same :rolleyes:

But your example uses Died.

But still, wouldn't Died("SHADR01") be correct? I want this to trigger only if a certain creature has died in the last script round.

 

Dead("SHADR01") doesn't suit my purposes because the test would still hold true if the npc was not in the party when the other members killed SHADR01 and later rejoined.

 

 

I did a quick scan with Infinity Explorer and the only time I ever saw Died() used was with the cannibalistic halflings in the Planar Sphere, and since the cannibals never survived I never saw if it worked or not.

Link to comment

Died() had been known to be unreliable. I think you will have more success by placing a timer in the Area script that provides a narrow time slot for NPC to react and restricting the interjection to that particular area, if you are very concernd that NPC could be out of party when the critter is killed and piped in immediately after.

Link to comment

Thanks for the replies -- The thing is I wanted it to trigger if they killed any of the 9 different types of dragons available in SOA/TOB.

 

As suggested, maybe this might work.

 

Died([ENEMY.0.0.DRAGON])

 

Since we haven't yet killed Firkrag or the Black Dragon outside the elven city I'll reset my LOCALS and give it a shot.

Link to comment

CombatCounter(0) may be returning false for too long (by the time it's true, Died() may be false).

 

You could try only setting the global with Died(), and then initiate dialogue with a separate block (which has the CombatCounter() check):

IF
Died("ShaDra01")
Global("Dragon_Killer","LOCALS",0)
InParty(Myself)
THEN
RESPONSE #100
SetGlobal("Dragon_Killer","LOCALS",1)
Continue()
END

IF
InParty(Myself)
Global("Dragon_Killer","LOCALS",1)
See(Player1)
!StateCheck(Player1,1)
CombatCounter(0)
THEN
RESPONSE #100
StartDialogueNoSet(Player1)
SetGlobal("Dragon_Killer","LOCALS",2)
END

Then again, Died() is rarely used, so it may just not work.

 

Or you could try something like:

IF
AreaCheck("Ar1402")
Died([0])
Name("ShaDra01",LastTrigger())
InParty(Myself)
Global("Dragon_Killer","LOCALS",0)
THEN
RESPONSE #100
//Stuff
END

Failing that, you could just append the top of the dragon's script with IF Die() THEN R#100 SetGlobal() END.

Link to comment

The point I'm trying to make is that I wanted a single script block to trigger if any of the SOA/TOA dragons got killed while the NPC was in party. You've given me something else to think about. I can try removing the CombatCounter(0) check when I try the script again with the Died([ENEMY.0.0.DRAGON])

 

Thanks.

Link to comment

DevSin is correct, the Died() trigger might be an one time trigger (real trigger) which would become cleared by the time combatcounter resets.

I would give a try to what he suggests as solution.

 

And yeah, using [0.0.0.DRAGON] is more sensible, than using deathvariables.

Link to comment

Archived

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

×
×
  • Create New...