Creating a DM tool

I want to create a DM tool that allows a DM to choose a player and set their Faction, but I’m kind of uncertain how I go about it. I see there are “DM Tool” items added in the radial (I think by CEP?), how would I go about replacing one of those with a script?

I know I can make a “picker” script to save a target, but ideally the flow I want is:

  • Select “DM Faction Tool” (or whatever I want to call it)
  • Click on player
  • NUI dialog comes up that they can edit
  • Save the faction info for the player with a save button or just exit otherwise.

The NUI itself is a bit of a tangle for me but I can manage that, what I’m not sure of is:

1] How to override and relabel one of the “DM Tools” in the radial
2] How to make it so the flow is select player then do the thing, rather than having to select the player with a seperate tool first.

Any help much appreciated!

  • May

PCs can’t change faction I believe.

I made a tutorial on DM Tools & Player Tools.

It’s been a feature since 1.69 - CEP not required.

1 Like

I have my own faction system on top of the games, to be clear.

Working through this, as a workaround for DM client problems, it says this:

It has been reported that the DM client does not show class abilities correctly on the radial menu. This may have been the result of a customisation to work around the issue above. The symptom is that one of the classes only shows the horse menu and not the class abilities. A workaround is to assign Commoner as the first class.

How do I set the first class in this way?

I programmed a playertool somewhere in the past. I guess a DM tool is pretty much the same.

How to install:

object NewHide (object oPC, object h)
{
  if (GetIsObjectValid (h)) DestroyObject (h);
  h = CreateItemOnObject ("x3_it_pchide", oPC);
  DelayCommand (0.2, AssignCommand (oPC, ActionEquipItem (h, INVENTORY_SLOT_CARMOUR)));
  return h;
}

void main()
{
  object oPC = GetLastUsedBy();
  object h = GetItemInSlot (INVENTORY_SLOT_CARMOUR, oPC);
  if (GetIsObjectValid (h))
    {
      if (GetResRef (h) != "x3_it_pchide") h = NewHide (oPC, h);
    }
  else h = NewHide (oPC, h);

  itemproperty p = ItemPropertyBonusFeat (IP_CONST_FEAT_PLAYER_TOOL_01);
  AddItemProperty (DURATION_TYPE_PERMANENT, p, h);

  SendMessageToPC (oPC, "Feat Installed");
}

What happens if the player uses the feat, is defined in spells.2da, in my case a script “x3_pl_tool01” is needed. No change of the 2da necessary.

I guess you can do everything within this script, even nuking the whole damn thing … :smiley:

1 Like