Set variable and journal when all monsters cleared
#1
Posté 01 octobre 2010 - 03:15
#2
Posté 01 octobre 2010 - 04:17
Area Heartbeat script
void main()
{
object oCreature = GetObjectByTag("TAG_OF_CREATURE");
if(!GetIsObjectValid(oCreature))
{
AddJournalQuestEntry("TAG_OF_JOURNAL_HERE", ##, GetFirstPC(), TRUE, FALSE, TRUE);
SetLocalInt(GetModule(), "den_evil", 10);
}
}
Creature's OnDeath script
void main()
{
int nNth = GetLocalInt(GetModule(), "den_evil");
nNth++;
SetLocalInt(GetModule(), "den_evil", nNth);
if (GetLocalInt(GetModule(), "den_evil") == 10)
{
AddJournalQuestEntry("TAG_OF_JOURNAL_HERE", ##, GetFirstPC(), TRUE, FALSE, TRUE);
}
}
FP!
Modifié par Fester Pot, 01 octobre 2010 - 04:17 .
#3
Posté 24 octobre 2010 - 12:25
I wanted to set the variable so I could confirm to the NPC that it was done
(Text appears when)
However, apparntly this scripting didn't work :s
#4
Posté 24 octobre 2010 - 03:13
add
if (GetLocalInt(GetModule(), "den_evil") == 10) return;
above
AddJournalQuestEntry("TAG_OF_JOURNAL_HERE", ##, GetFirstPC(), TRUE, FALSE, TRUE);
FP!
Modifié par Fester Pot, 24 octobre 2010 - 03:13 .
#5
Posté 25 octobre 2010 - 04:30
------------------------
This is on the heartbeat
void main()
{
object oCreature = GetObjectByTag("evilden");
if(!GetIsObjectValid(oCreature))
{
if (GetLocalInt(GetModule(), "den_evil") == 10) return;
AddJournalQuestEntry("den_evil", 2, GetFirstPC(), TRUE, FALSE, TRUE);
SetLocalInt(GetModule(), "den_evil", 10);
}
}
this is for "Text Appears When"
int StartingConditional()
{
// Inspect local variables
if(!(GetLocalInt(GetPCSpeaker(), "den_evil") == 10))
return FALSE;
return TRUE;
}
-------------------------------------------
I did suspect I might need to change if(!(GetLocalInt(GetPCSpeaker(), "den_evil") == 10))
to
if (GetLocalInt(GetModule(), "den_evil") == 10)
but that only resulted in the text appearing BEFORE the cave is cleared.
#6
Posté 25 octobre 2010 - 12:38
int StartingConditional()
{
// Inspect local variables
if(!(GetLocalInt(GetModule(), "den_evil") == 10))
return FALSE;
return TRUE;
}
You must also have it placed in the proper order within the conversation itself for it to appear correctly.
Here's an example of the conversation tree -
1. Cleared monsters (den_evil == 10)
2. Asked to clear monsters
3. Met NPC before
4. First time meeting NPC
Also, after killing all the creatures, use the in-game debug commands to verify the value of den_evil and that it is set to 10 before speaking with the NPC.
FP!
Modifié par Fester Pot, 25 octobre 2010 - 12:58 .





Retour en haut






