I need a few conditional scripts for dialog options:
One to check what specific quest is activated
One to check what specific quest entry is activated
One to check to see if you have a specific item on you
One to check to see if you have a specific item equipped
These will be for K1
Thanks
-----Edit-----
Also another that checks to see if you have killed somebody
I need a few conditional scripts for dialog options:
One to check to see if you have a specific item on you
I have these ones.
int StartingConditional()
{
object oPC = GetPCSpeaker();
if (GetItemPossessedBy(oPC, "g_i_mandomask") == OBJECT_INVALID) return FALSE;
return TRUE;
}
Just to ensure myself this is a script to check to see if you have a specific item?
Thats right, to check a certain item, this is probably a little clearer to use:
int StartingConditional() {
if(GetItemPossessedBy(GetFirstPC(), "String_Item_Tag") == OBJECT_INVALID)
return FALSE;
return TRUE;
}
As for seeing if you have a specific item equipped:
int StartingConditional() {
if (GetTag(GetItemInSlot(INVENTORY_SLOT_(Expected Slot), GetFirstPC()) == "Tag_Of_Item")
}
If you want to check for a weapon you will probably have to check both hands.
Arkward K1 scripting, its a pain that you can't use the dialog script parameters. ¬.¬
As for quest tracking, you will have to look into Global's and find out the globals for the quests, as that is how the game tracks how far you are throughout the plots.
The script will likely be something along the lines of:
int StartingConditional() {
if(GetGlobalNumber("Global_Identifier") <= Number it needs to be equal to or more than)
return TRUE;
return FALSE;
}
I can't remember if you can just return (GetGlobalNumber("G_N") <= 4); but the script above should work.
I need a few conditional scripts for dialog options:
One to check what specific quest is activated
If you mean to check if a specific quest is active you can do it like this, where JournalQuestTag should be set to the Tag of the quest from global.jrl:
int StartingConditional() {
return (GetJournalEntry("JournalQuestTag") > 0);
}
One to check what specific quest entry is activated
Very similar to the previous one, just replace the yellow number with the quest stage to check for:
int StartingConditional() {
return (GetJournalEntry("JournalQuestTag") == 10);
}
One to check to see if you have a specific item on you
Change TagOfItem" to the tag of the item as set in the UTI file. Make sure the item has a unique tag:
int StartingConditional() {
return GetIsObjectValid(GetItemPossessedBy(GetFirstPC(), "TagOfItem"));
}
One to check to see if you have a specific item equipped
Change TagOfItem to the tag of the item as set in the UTI file.
int StartingConditional() {
object oPC = GetFirstPC();
string sTag = "TagOfItem";
int i;
for (i = INVENTORY_SLOT_HEAD; i <= INVENTORY_SLOT_CARMOUR; i++) {
if (GetTag(GetItemInSlot(i, oPC)) == sTag) {
return TRUE;
}
}
return FALSE;
}
Also another that checks to see if you have killed somebody
There is no way to directly check this unless the player still is in the same area as the victim, and corpse fade has been turned off on the victim so they stay around permanently. The easiest way around this is to set a global variable in the victim's OnDeath event script and then check for that.
Give the victim a new OnDeath script that looks something like:
void main() {
SetGlobalBoolean(GetTag(OBJECT_SELF) + "_ISDEAD", TRUE);
ExecuteScript("k_ai_master", OBJECT_SELF, 1007);
}
Then add a global boolean variable to the globalcat.2da file with the tag of the NPC followed by "_ISDEAD", for example "Bastila_ISDEAD" if wanting to keep track of if an NPC with the tag "Bastila" has been killed. Then you can later check for that in a dialog anywhere in the game like:
int StartingConditional() {
return GetGlobalBoolean("Bastila_ISDEAD");
}
Thank you so much for your input, for a long time now, I've been stuck where I am because of the lack of these scripts. Everyones' reply has been greatly appreciated.
-----Edit-----
I just thought of this one, would anyone know of a conditional script that checks to see if you are in a specific area? I want to create a trigger and then apply a script or would the rigger be the script that checks what area you're in?
I just thought of this one, would anyone know of a conditional script that checks to see if you are in a specific area? I want to create a trigger and then apply a script or would the rigger be the script that checks what area you're in?
You would create the trigger in the area, I wouldn't imagine that the script would need to check what area your in if the trigger can only be triggered in that area ;)
Okay, I figured that, but just wanted to make sure, thanks.