Help with the Plot Wizard
Ugly_Duck
Member Posts: 182
I spent a few hours trying to get a quest made using the Plot Wizard, and I failed miserably. Is there any improvements available to the Plot Wizard, or better alternatives?
0
Comments
You can find the current build on GitHub here if you want to check it out.
TR
1.) Kill a guy & get AMULET_001
2.) Take AMULET_001 to a friendly npc, and exchange it for MAP_001
3.) Use the MAP_001; destroy MAP_001 & give the player MAP_002.
4.) Player uses MAP_002 and it gets destroyed.
The rundown is this - Kill the cult member and get an amulet marked with the cult's sign. Return the amulet to the town guard. The town guard gives you the first map. The first map, when used, teleports the player to a new area. The first map gets destroyed, and a second map is created in the players backpack. The second map teleports the player back to the town they left from & also gets destroyed.
The great thing about hanging your story on conversations is that you immediately get “text appears when”, “Actions taken” and even “other actions” tabs to perform checks and do things.
From the top of my head, 1&2 sound like a “Fetch and deliver” type plot, 3 and 4 will need Script Generator at least for the teleporting etc. if you don’t want to use conversations or scripting. I’ll get back to you. .
I had a play this morning and here's what I could achieve with PW.
1. Fetch and retrieve plot ( no maps available had to use scroll).
2. Guard gives plot, cult member is villain, use chest and item to retrieve is amulet.
3. Return to guard, he takes amulet and he gives map (scroll I'm afraid). It appears in your inventory.
So far so good. This all works fine. Your problem comes at the next point when you want to use the scroll to teleport him on use of the map. This is where you really need a competent scripter as the scroll given by the guard doesn't have script slots when I do this in PW.
What I did do was use a placeable map ( which does have a script tab ) which I placed on the ground beside the guard, added a dismissive bit in the conversation about "it's lying over there" and used a Script Generator script in the OnUsed to teleport the PC ( complete with vfx!) to a waypoint somewhere else which also destroyed the map. I'm guessing, although I didn't have time to do it that I could easily have added to give the PC a new item ( map2) to the SG script.
So, no, you couldn't do much of this in PW but you could achieve what I've outlined above ( and probably better as I didn't have a lot of time) without knowing scripting by using the combination of PW and SG ( which is absolutely the non scripter's friend).
TR
Ok, here is what I got:
// ** This script uses "tag-based" item scripting.
// ** If you use the item this script it named after, target yourself with the curser
// then, it will teleport you to the TAG of the Waypoint named in this script.
// To use: Name this SCRIPT after the ITEM to be used. On the ITEM, give it the item property "Unique Power".
// Select yourself as the target of the "Unique Power"; the VFX will fire & you'll be teleported there.
//
//
/* Script generated by
Lilac Soul's NWN Script Generator, v. 2.3
For download info, please visit:
http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */
void main()
{
object oPC;
if (GetIsInCombat(GetItemActivator())
){
SendMessageToPC(GetItemActivator(), "Improper use of item!");
return;}
oPC = GetItemActivator();
object oTarget;
location lTarget;
oTarget = GetWaypointByTag("WP_BSCULT_TELE_LOC_002");
lTarget = GetLocation(oTarget);
//only do the jump if the location is valid.
//though not flawless, we just check if it is in a valid area.
//the script will stop if the location isn't valid - meaning that
//nothing put after the teleport will fire either.
//the current location won't be stored, either
if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return;
AssignCommand(oPC, ClearAllActions());
DelayCommand(3.0, AssignCommand(oPC, ActionJumpToLocation(lTarget)));
oTarget = oPC;
//Visual effects can't be applied to waypoints, so if it is a WP
//the VFX will be applied to the WP's location instead
int nInt;
nInt = GetObjectType(oTarget);
if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), oTarget);
else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oTarget));
oPC = GetItemActivatedTarget();
object oItem;
oItem = GetFirstItemInInventory(oPC);
while (GetIsObjectValid(oItem))
{
if (GetTag(oItem)=="BSCULT_MAP_002") DestroyObject(oItem);
oItem = GetNextItemInInventory(oPC);
}
// ** This line of code is commented out because I used it for a similar item, and just copied the script.
// CreateItemOnObject("bscult_map_002", oPC);
}
Assuming you only need to have it work for activation you can add something like this near the top of your script.
if (GetUserDefinedItemEventNumber() != X2_ITEM_EVENT_ACTIVATE) return;
The everything after this will only happen on activation and it won't do anything on acquire anymore.