so i have this statue the player will touch set as plot and useable with this script in the on used tab:
#include "pqj_inc"//Put this script OnUsedvoid main(){ object oPC = GetLastUsedBy(); object oItem; { if (!GetIsPC(oPC)) return; if (GetItemPossessedBy(oPC, "plot_quill")== OBJECT_INVALID) return; if (GetItemPossessedBy(oPC, "plot_parchment")== OBJECT_INVALID) return; if(RetrieveQuestState("q_pirates", GetLastUsedBy()) == 0) return; }
CreateItemOnObject("plot_p_note", oPC);AddJournalQuestEntry("q_pirates", 10, oPC, FALSE, FALSE);}
it compiles and all, but dosn't seem to work. no update or note is given. obviously i'm thinking i did something wrong, but im no scripter, so please help me if you can.
thanks
is this wrong?
Débuté par
zero-feeling
, nov. 11 2013 01:19
#1
Posté 11 novembre 2013 - 01:19
#2
Posté 11 novembre 2013 - 02:59
See if the tags match the intended items. Capitalization could be an issue.
#3
Posté 11 novembre 2013 - 08:47
#include "pqj_inc"
//Put this script OnUsed
void main()
{
object oPC = GetLastUsedBy();
object oItem;
{
if (!GetIsPC(oPC)) return;
if (GetItemPossessedBy(oPC, "plot_quill")== OBJECT_INVALID) return;
if (GetItemPossessedBy(oPC, "plot_parchment")== OBJECT_INVALID) return;
if (RetrieveQuestState("q_pirates", oPC) == 0) return;
}
CreateItemOnObject("plot_p_note", oPC);
AddJournalQuestEntry("q_pirates", 10, oPC, FALSE, FALSE);
}
If I'm looking at the script right:
Declared "object oItem" but didn't use it in the script.
A couple extra curly brackets you don't need.
You already have object oPC declared as GetLastUsedBy(). Might as well use it instead.
And finally it's always kinda fun to add debug messages in your script to tell you in testing where you're getting hung up:
#include "pqj_inc"
//Put this script OnUsed
void main()
{
object oPC = GetLastUsedBy();
SendMessageToPC(oPC, "Ok you used the item...");
if (!GetIsPC(oPC))
{
SendMessageToPC(oPC, "You are not a pc..return");
return;
}
if (GetItemPossessedBy(oPC, "plot_quill")== OBJECT_INVALID)
{
SendMessageToPC(oPC, "You don't have the plot_quill...return");
return;
}
if (GetItemPossessedBy(oPC, "plot_parchment")== OBJECT_INVALID)
{
SendMessageToPC(oPC, "You don't have plot_parchment...return");
return;
}
if (RetrieveQuestState("q_pirates", oPC) == 0)
{
SendMessageToPC(oPC, "q_pirates quest state at zero...return");
return;
}
CreateItemOnObject("plot_p_note", oPC);
AddJournalQuestEntry("q_pirates", 10, oPC, FALSE, FALSE);
}
Hope it helps.
//Put this script OnUsed
void main()
{
object oPC = GetLastUsedBy();
object oItem;
{
if (!GetIsPC(oPC)) return;
if (GetItemPossessedBy(oPC, "plot_quill")== OBJECT_INVALID) return;
if (GetItemPossessedBy(oPC, "plot_parchment")== OBJECT_INVALID) return;
if (RetrieveQuestState("q_pirates", oPC) == 0) return;
}
CreateItemOnObject("plot_p_note", oPC);
AddJournalQuestEntry("q_pirates", 10, oPC, FALSE, FALSE);
}
If I'm looking at the script right:
Declared "object oItem" but didn't use it in the script.
A couple extra curly brackets you don't need.
You already have object oPC declared as GetLastUsedBy(). Might as well use it instead.
And finally it's always kinda fun to add debug messages in your script to tell you in testing where you're getting hung up:
#include "pqj_inc"
//Put this script OnUsed
void main()
{
object oPC = GetLastUsedBy();
SendMessageToPC(oPC, "Ok you used the item...");
if (!GetIsPC(oPC))
{
SendMessageToPC(oPC, "You are not a pc..return");
return;
}
if (GetItemPossessedBy(oPC, "plot_quill")== OBJECT_INVALID)
{
SendMessageToPC(oPC, "You don't have the plot_quill...return");
return;
}
if (GetItemPossessedBy(oPC, "plot_parchment")== OBJECT_INVALID)
{
SendMessageToPC(oPC, "You don't have plot_parchment...return");
return;
}
if (RetrieveQuestState("q_pirates", oPC) == 0)
{
SendMessageToPC(oPC, "q_pirates quest state at zero...return");
return;
}
CreateItemOnObject("plot_p_note", oPC);
AddJournalQuestEntry("q_pirates", 10, oPC, FALSE, FALSE);
}
Hope it helps.
#4
Posté 12 novembre 2013 - 12:48
so ty ghost for the debugs. im not sure how the debug works, but i did get 2 messages when testing.
first : Ok you used the item...
second : q_pirates quest state at zero...return
no other messages were given and no journal update and no note given. i've checked all the tags on all plot items involved and all are correct. thanks again.
first : Ok you used the item...
second : q_pirates quest state at zero...return
no other messages were given and no journal update and no note given. i've checked all the tags on all plot items involved and all are correct. thanks again.
#5
Posté 12 novembre 2013 - 02:34
This means that the script does not think that you have begun the quest. If the quest is displayed in your quest log, then check the quest name "q_pirates" against what it was originally named.
#6
Posté 12 novembre 2013 - 04:18
well the quest is not supposed to be started yet. this is the start.
AddJournalQuestEntry("q_pirates", 10, oPC, FALSE, FALSE);
this is the first entry of the quest journal as i do them in intervals of 10, 20 being step 2. in this script there's supposed to be a check to see if the quest has been started and add if not, and the player has the 2 required items, they get the first update and the note to go on to the second part.
if it matters at all, i'm using the sea idol placeable, set to plot and useable for this. i have the script in the OnUsed tab as well.
the quest enty does not get added either, so the last 2 lines in the script are not working for sure.
AddJournalQuestEntry("q_pirates", 10, oPC, FALSE, FALSE);
this is the first entry of the quest journal as i do them in intervals of 10, 20 being step 2. in this script there's supposed to be a check to see if the quest has been started and add if not, and the player has the 2 required items, they get the first update and the note to go on to the second part.
if it matters at all, i'm using the sea idol placeable, set to plot and useable for this. i have the script in the OnUsed tab as well.
the quest enty does not get added either, so the last 2 lines in the script are not working for sure.
#7
Posté 12 novembre 2013 - 06:57
In that case, change this line:
to this:
The problem is that the line was aborting the script if the quest was not started. Instead, you want to abort if it has already been started.
if (RetrieveQuestState("q_pirates", oPC) == 0)to this:
if (RetrieveQuestState("q_pirates", oPC) > 0)The problem is that the line was aborting the script if the quest was not started. Instead, you want to abort if it has already been started.
Modifié par Squatting Monk, 12 novembre 2013 - 06:59 .
#8
Posté 12 novembre 2013 - 01:04
thank you much monk, works now and thanks to all that replied as well... so funny that one little change makes all the difference.
thanks again guys
thanks again guys





Retour en haut







