I recently took a head dive into nwn toolset to use it as a narrative for my irl dnd game. At first I was having issues with making it turn based. Instead I ended up using conversation actions to gain control of a creature in question. The issue with this method is the clutter. Having to rewrite a whole new conversation for every single potential enemy.
Is there a way to generalize the target? Some sort of get tag of the players target. I’ve tried every string and combination I can think of.
It’s possible to create an item that does pretty much anything, including fire up a generic dialog, add a creature to the player-party, take possession if you’re the DM, etc.
// 'addtargettoparty'
/*
Console script that adds a creature to the Party of the player who runs this
script.
Right-click target the creature to add. Then at the console:
`
debugmode 1
rs addtargettoparty
debugmode 0
`
*/
void main()
{
object oTarget = GetPlayerCurrentTarget(OBJECT_SELF);
if (GetIsObjectValid(oTarget) && GetObjectType(oTarget) == OBJECT_TYPE_CREATURE)
{
string sTag = GetTag(oTarget);
if (GetRosterNameFromObject(oTarget) == "")
{
AddRosterMemberByCharacter(sTag, oTarget);
}
AddRosterMemberToParty(sTag, OBJECT_SELF);
}
}
I tried to use your script but i couldnt figure how to implement it.
so i followed the item template and still had a hard time. I ended up with this
#include "ginc_item_script"
//i_DMcontrol_ac
/*
Template for an Activate item script.
This script will run each time an item's "custom activation" is used.
How to use this script:
Item needs an item property that will cause a custom activation such as Cast Spell:Unique Power
Replace the word "temp" (in line 1) with the tag of the item. Rename the script with this name.
Additional Info:
In general, all the item "tag-based" scripts will be named as follows:
- a prefix ("i_" by defualt)
- the tag of the item
- a postfix indicating the item event.
This script will be called automatically (by defualt) whether it exists or not. If if does not exist, nothing happens.
Note: this script runs on the module object, an important consideration for assigning actions.
-ChazM
*/
// Name_Date
void main()
{object oPC = GetItemActivator();
object oItem = GetItemActivated();
object oTarget = GetItemActivatedTarget();
location lTarget = GetItemActivatedTargetLocation();
string sRosterName = GetTag(oTarget);
string sTarget = GetTag(oTarget);
string sCreature = GetTag(oTarget);
ExecuteScript("ga_roster_add_object",OBJECT_SELF);
ExecuteScript("ga_roster_selectable",OBJECT_SELF);
ExecuteScript("ga_roster_party_add",OBJECT_SELF);
ExecuteScript("ga_reset_level",OBJECT_SELF);
}
It successfully runs on the item activation, but crashes immediately. is it too much at once or is it missing something?
This works with one exception… it only tracks the first target. If I target another creature i doesnt work. If i remove the first NPC and try again on the second it re adds the fisrt
k… i’ll point out that what you’re doing is nonstandard. Grabbing a creature and rather arbitrarily throwing it onto the roster and into the party – things like this are usually done only in more controlled conditions.
My intentions are kind of irregular. instead of using the module as an rpg. its more for the visuals and table top battle mapping. using a second computer and monitor load them in multiplayer lan DMcontrols for me and a regular account for them i expect bugs but even with bugs its not really a huge deal aslon as i can control the monsters