Author Topic: does dungeon craft have ?  (Read 2056 times)

Offline noctoskanan

  • Jr. Member
  • **
  • Posts: 72
does dungeon craft have ?
« on: March 19, 2013, 10:41:01 AM »
can you import and export maps and npc's or event chains like you could in unlimited adventures. taking one dungeon lvl with all it's events and more to another design?
if so how and if not then it needs to be worked on that would help save oddles of time in the creating of a game

thanks and good hunting

Offline nologgie

  • Non-resident Non-expert
  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 3465
Re: does dungeon craft have ?
« Reply #1 on: March 19, 2013, 01:54:39 PM »
Maps - You can copy and paste maps within a design, but you can't just 'drop in' maps from other designs.  There is a feature request for copying maps between designs.

NPCs - Nope.  NPCs (who can also be used as pregenerated characters) are stored in the game.dat file, so there is no character file to copy separately.  There is a feature request for this too.

Event Chains - Are you talking about exporting event chains separately?  I don't know a way to do this in UA.  DC allows copy/paste of event chains between dungeons, but not between designs.
Some days it just doesn't pay to gnaw through the straps.

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9809
Re: does dungeon craft have ?
« Reply #2 on: March 19, 2013, 01:55:52 PM »
The short answer is "no" we can't do that in DC right now.

With that said, I do it all the time, but you have to do it manually.

Is there any reason why you couldn't use one design as a base and then modify the databases to add the new stuff?

The reason there is no official/default support for this is that currently there is no way in DC to compare the databases between multiple designs, nor to merge them.

Offline noctoskanan

  • Jr. Member
  • **
  • Posts: 72
Re: does dungeon craft have ?
« Reply #3 on: March 19, 2013, 05:20:11 PM »
I HAD figured those were the case but i hoped not after spending 30 plus hours crafting npc's i was hoping to not lose them to this one game

as for events drafting was not what i meant i was more taking the idea exporting and importing maps that already had events in them.

 humm the denial of importing maps or lvl's from one design to another does poss a serious issue for me and my current plans.

Is there any reason why you couldn't use one design as a base and then modify the databases to add the new stuff?

no this doesn't really work for me basically because i informed and passed on this editor two of my friends who use to always mess with frua and who also played really pen and paper dnd with me and they are currently trying to design not an entire game but dungeons or magical towers to the game i started making 3 weeks ago.

 Are we cheating yes but they both enjoy making maps and designing floor plans more then. i'm an event mapper.

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9809
Re: does dungeon craft have ?
« Reply #4 on: March 19, 2013, 05:47:50 PM »
I didn't say it couldn't be done. just not in DC. :D

Well, I don't know what to do about the NPCs, because those don't import/export currently and Paul has said it's up to someon else to implement this.

Okay, for the levels:
One of you needs to work as the Manager - since you're posting, I nominate you. :D
In your version of the design, create empty levels for all the levels that all 3 of you are using. Assign appropriate levels to each of you - if y'all are working on different level 1s, then two of you need to change the number (copy the level to another slot).
In the master copy, you will have blank levels set to maximum size for each of the levels.
When you get the work from your friends, exit DC, copy their LVL files into the master, choosing to overwrite the blank levels you have in there.
Open up DC, and you'll have to go to each level and resize down if you want.
You should all be using the same databases.

I have done this for a project. All events should be pointing to the right places, etc.

Offline Paul R. Stevens

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2229
Re: does dungeon craft have ?
« Reply #5 on: March 19, 2013, 06:09:20 PM »
Quote from: Manikus
You should all be using the same databases.

In version 0.914 this was absolutely essential.

Starting with version 1.0 it will not be quite so
important.  An 'Acorn' is an 'Acorn' is an 'Acorn'
in the newest editor/engine.  It used to be
that an 'Acorn' was what it was because of its
position in the database.....now it is what it is
because of its name.

That is the major overhaul that has delayed
version 1.0 for several months.  This makes
possible sharing such as is described in this
thread.  I don't have to worry that you had
an 'Aardvark Necklace' in your design that
would push my 'Acorn' down to second place.

Offline Milos Gulan

  • Hero Member
  • *****
  • Posts: 3128
Re: does dungeon craft have ?
« Reply #6 on: March 19, 2013, 06:30:26 PM »
Awesome I hope things will go good for everyone. DC has limits but it is still best :newbie:

Offline noctoskanan

  • Jr. Member
  • **
  • Posts: 72
Re: does dungeon craft have ?
« Reply #7 on: March 19, 2013, 07:51:14 PM »
thank you for explaining how i could move the work
my friends do to my game i'll just have to be sure they don't waste time trying to create npc's`  but i think we can deal with that fairly easy

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9809
Re: does dungeon craft have ?
« Reply #8 on: March 20, 2013, 01:38:19 PM »
I hope that someday we can import/export NPCs. It's on the very short list of project that someone willing to help us code can work on. :) That is if we can't convince them to fix bugs. :D

I am not going to promise anything, but maybe when we working on the editor to import FRUA designs, maybe something coming out of that will be fhelpful for importing levels from other DC designs. But, no promises.

Offline Milos Gulan

  • Hero Member
  • *****
  • Posts: 3128
Re: does dungeon craft have ?
« Reply #9 on: March 20, 2013, 01:46:17 PM »
How can I learn to code :( I want to learn and help too :idea1:

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9809
Re: does dungeon craft have ?
« Reply #10 on: March 20, 2013, 02:02:25 PM »
How can I learn to code :( I want to learn and help too :idea1:

There are lots of ways to learn to code = take a class, read a book, use online tutorials, etc. Likely some combination of the above. :D
Dungeon Craft is written in C++ and compiled on MicroSoft's Visual Studio 6.0 and above.

Perhaps Paul will offer some advice?

Offline Milos Gulan

  • Hero Member
  • *****
  • Posts: 3128
Re: does dungeon craft have ?
« Reply #11 on: March 20, 2013, 02:23:19 PM »
I have worked with Visual Studio some (not sure which version though), but I really didn't have anything to do so I didn't go any deeper. But now I am willing to learn because I think it would be wonderful if I could do DC and learn other things needed to make it better :). I hope I can work on it actualy as I was looking at other similiar programs and well there is not much beside DC :) I probably could learn from books and other tutorials I was thinking of learning some Java too. Anyway I am willing to try.

Offline Paul R. Stevens

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2229
Re: does dungeon craft have ?
« Reply #12 on: March 20, 2013, 02:43:39 PM »
Quote
I am willing to try.

This, my friend, is your lucky day.

We need to be able to import/export NPCs.

Because I had nothing to do, I started this
project.  It is about the simplest thing that can
be done.  It is independent of all other code
and so cannot break anything.  But it is tedious.

Here is what I will do:  I will attach the code that
I have created thus far.  It include a roadmap of
what still needs to be done.  You go get the
source code from Sourceforge.  You complete the
import/export using a text editor.  It will have
lots of bugs but after you have completed it, you
can decide if you want to go to the next step of
working directly with DC source code.  If so, you
can install it and test it.  Else I will install it and
test it.
Code: [Select]
#ifdef UAFEDITOR

#include "ConfigFile.h"

CHARACTER tempNPC; // Where we build item.
CHAR_LIST *pCharList=NULL;  // Where data will be put




// Handle clearing and storing of entire NPC object
static void NPCObject(CONFIG_PKT *pkt) {
  //static POSITION position;
  static int numNPC, curNPC;
  switch (pkt->func)
  {
  case CONFIG_FUNC_beginObject:
    tempNPC.Clear();
    break;
  case CONFIG_FUNC_storeObject:
    // don't add templates to database
    if (tempNPC.GetName().CompareNoCase("template")!=0)
    {
      CHARACTER_ID NPCId;
      NPCId = tempNPC.GetName();
      //if (pItemData->FindName(tempITEM.IdName()).IsValidItem())
      if (pCharList->LocateCharacter(NPCId) >= 0)
      {
        CString msg;
        msg.Format("Duplicate name in NPC.txt = %s\n",tempNPC.GetName());
        WriteDebugString(msg);
        pkt->status=CONFIG_STAT_key;
      }
      else
        pCharList->AddCharacter(&tempNPC);
    }
    break;
  case CONFIG_FUNC_getFirstObject:
    //position=pItemData->GetHeadPosition();
    curNPC = 0;
    numNPC = pCharList->GetCount();
    //tempITEM.Clear();
    //if (position == NULL)
    if (curNPC >= numNPC)
    {
      pkt->status = CONFIG_STAT_end;
      return;
    };
    //tempITEM = pItemData->PeekAtPos(position);
    tempNPC = *pCharList->PeekCharacter(curNPC);
    //pItemData->GetNext(position);
    pkt->objectName=tempNPC.GetName();
    break;
  case CONFIG_FUNC_getNextObject:
    curNPC++;
    //if (position==NULL)
    if (curNPC >= numNPC)
    {
      pkt->status=CONFIG_STAT_end;
    }
    else
    {
      //tempITEM=pItemData->PeekAtPos(position);
      //tempITEM=*pItemData->PeekItemData(position);
      tempNPC = *pCharList->PeekCharacter(curNPC);
      //pItemData->GetNext(position);
      pkt->objectName=tempNPC.GetName();
    };
    break;
  default:
    pkt->status=CONFIG_STAT_intError;
  };
}


void DNPCVersion(CONFIG_PKT *pkt)
{
  if (pkt->IsStoring)
  {
    pkt->DWordValue = CHARACTER_VERSION;
  }
  else
  {
  };
}

static void DNPCName(CONFIG_PKT *pkt)
{
  if (pkt->IsStoring)
  {
    pkt->value=tempNPC.GetName();
    return;
  };
  pkt->status=CONFIG_DECODE_string(
    pkt->value,
    pkt->errorMsg,
    pkt->objectName);
  tempNPC.SetName(pkt->objectName);
}

static void DNPCType(CONFIG_PKT *pkt)
{
  if (pkt->IsStoring)
  {
    pkt->DWordValue = tempNPC.GetType();
  }
  else
  {
    tempNPC.SetType(pkt->DWordValue);
  };
}

static void DNPCUndeadType(CONFIG_PKT *pkt)
{
  if (pkt->IsStoring)
  {
    pkt->value = tempNPC.undeadType;
  }
  else
  {
    tempNPC.undeadType = pkt->value;
  };
}


static void DNPCRace(CONFIG_PKT *pkt)
{
  if (pkt->IsStoring)
  {
    pkt->value = tempNPC.RaceID();
  }
  else
  {
    RACE_ID raceID;
    raceID = pkt->value;
    tempNPC.RaceID(raceID);
  };
}


static void DNPCGender(CONFIG_PKT *pkt)
{
  int i;
  static CONFIGID genders[] =
  {
    CONFIGID( "male"   ,0),
    CONFIGID( "female" ,1),
    CONFIGID( ""       ,0)
  };
  if (pkt->IsStoring)
  {
    CONFIG_ENCODE_enum(pkt->value,genders,tempNPC.GetGender());
  }
  else
  {
    pkt->status=CONFIG_DECODE_enum (
      pkt->value,
      &pkt->errorMsg,
      genders,
      i);
    tempNPC.SetGender(i);
  };
}

static void DNPCClass(CONFIG_PKT *pkt)
{
  if (pkt->IsStoring)
  {
    pkt->value = tempNPC.GetClass();
  }
  else
  {
    CLASS_ID classID;
    classID = pkt->value;
    tempNPC.SetClass(classID);
  };
}

static void DNPCAlignment(CONFIG_PKT *pkt)
{
  int i;
  static CONFIGID alignments[] =
  {
    CONFIGID("LawfulGood"    ,LawfulGood),
    CONFIGID("NeutralGood"   ,NeutralGood),
    CONFIGID("ChaoticGood"   ,ChaoticGood),
    CONFIGID("LawfulNeutral" ,LawfulNeutral),
    CONFIGID("TrueNeutral"   ,TrueNeutral),
    CONFIGID("ChaoticNeutral",ChaoticNeutral),
    CONFIGID("LawfulEvil"    ,LawfulEvil), 
    CONFIGID("NeutralEvil"   ,NeutralEvil),
    CONFIGID("ChaoticEvil"   ,ChaoticEvil),
    CONFIGID( ""             ,ChaoticEvil)
  };
  if (pkt->IsStoring)
  {
    CONFIG_ENCODE_enum(pkt->value,alignments,tempNPC.GetAlignment());
  }
  else
  {
    pkt->status=CONFIG_DECODE_enum (
      pkt->value,
      &pkt->errorMsg,
      alignments,
      i);
    tempNPC.SetAlignment((alignmentType)i);
  };
}

static void DNPCStatus(CONFIG_PKT *pkt)
{
  int i;
  static CONFIGID stati[] =
  {
    CONFIGID("Okay"       ,Okay),       
    CONFIGID("Unconscious",Unconscious ),
    CONFIGID("Dead"       ,Dead),
    CONFIGID("Fled"       ,Fled),
    CONFIGID("Petrified"  ,Petrified),
    CONFIGID("Gone"       ,Gone),
    CONFIGID("Animated"   ,Animated),
    CONFIGID("Temp Gone"  ,TempGone),
  CONFIGID("Running"    ,Running),
    CONFIGID("Dying"      ,Dying),
    CONFIGID( ""          ,Okay)
  };
  if (pkt->IsStoring)
  {
    CONFIG_ENCODE_enum(pkt->value,stati,tempNPC.GetStatus());
  }
  else
  {
    pkt->status=CONFIG_DECODE_enum (
      pkt->value,
      &pkt->errorMsg,
      stati,
      i);
    tempNPC.SetStatus((charStatusType)i);
  };
}

static void DNPCAllowInCombat(CONFIG_PKT *pkt)
{
  if (pkt->IsStoring)
  {
    pkt->boolValue = tempNPC.GetAllowInCombat();
  }
  else
  {
    tempNPC.SetAllowInCombat(pkt->boolValue);
  };
}




#undef df
#undef dh
#define df(a) DNPC##a
#define dh(a) IDS_HELP_NPC_##a




// default define
#define DEFID(a,b,c)    CONFIGID(a, CONFIG_DATA_##b, df(c), dh(c), 1, false, false)


CONFIGID NPCIDs[] =
{
CONFIGID( "" ,CONFIG_DATA_object ,NPCObject),
DEFID ( "name"                    ,string      ,Name),
DEFID ( "version"                 ,long        ,Version),



//    ar << CHARACTER_VERSION;
    //ar << uniqueKey;
    //ar << type;
DEFID ( "type"                    ,long        ,Type),
    //temp = m_race;
    //ar << temp;
    //ar << race;
DEFID ( "race"                    ,string      ,Race),
//    temp = gender;
DEFID ( "gender"                  ,enum        ,Gender),
//    ar << temp;
    //temp = charClass;
    //ar << temp;
    //ar << classID;
DEFID ( "class"                   ,string      ,Class),
//    temp = alignment;
//    ar << temp;
DEFID ( "alignment"               ,enum        ,Alignment),
   
    //ar << allowInCombat;
DEFID ( "allowInCombat"           ,BOOL        ,AllowInCombat),

//    temp = status;
//    ar << temp;
DEFID ( "status"                  ,enum        ,Status),
    //temp = undead;
    //temp = undeadLevel;
//    ar << undeadType;
DEFID ( "undeadType"              ,string      ,UndeadType),
//    temp = creatureSize;
//    ar << temp;
DEFID ( "size"                    ,enum        ,Size),

//    AS(ar,name);
/*
    ar << FighterExperience;
    ar << ClericExperience;
    ar << RangerExperience;
    ar << PaladinExperience;
    ar << MUExperience;
    ar << ThiefExperience;
    ar << DruidExperience;
*/
//    ar << THAC0;
DEFID ( "THAC0"                   ,long        ,THAC0),
//    ar << morale;
DEFID ( "morale"                  ,long        ,Morale),
//    ar << encumbrance;
DEFID ( "encumbrance"             ,long        ,Encumbrance),
    //ar << maxEncumbrance;
DEFID("max encumbrance",long,MaxEncumbrance),
    ar << m_AC;
DEFID("armor class",long,ArmorClass),
    ar << hitpoints;
DEFID( "hitPoints",long,HitPoints),
    ar << maxHitPoints;
DEFID( "max hitpoints",long,MaxHitPoints),
    ar << nbrHitDice;
DEFID("nbr hit dice",long,NbrHitDice),
    ar << age;
DEFID("age",long,Age),
    ar << maxAge;
DEFID("max age",long,MaxAge),
    ar << birthday;
DEFID("birthday",long,Birthdat),
    ar << m_iMaxCureDisease;
DEFID("max cure disease",long,MaxCureDisease),
    ar << unarmedDieS;
DEFID("unarmed dice small",dice,UnarmedDiceSmall),
    ar << unarmedNbrDieS;
    ar << unarmedBonus;
    ar << unarmedDieL;
    ar << unarmedNbrDieL;
DEFID("unarmed dice large",dice,UnarmedDiceLarge),
    //ar << ItemMask;
    ar << maxMovement;
DEFID("max movement",long,MaxMovement),
    ar << readyToTrain;
DEFID("ready to train",BOOL,ReadyToTrain),
    ar << canTradeItems;   
DEFID("can trade items",BOOL,CanTradeItems),
   
    ar << GetStr();
DEFID("strength",long,Strength),
    ar << GetStrMod();
DEFID("strength mod",long,StrengthMod),
    ar << GetInt();
DEFID("intelligence",long,Intellignece),
    ar << GetWis();
DEFID("wisdom",long,Wisdom),
    ar << GetDex();
DEFID("dexterity",long,Dexterity),
    ar << GetCon();
DEFID("constitution",long,Constitution),
    ar << GetCha();
DEFID("charisma",long,Charisma),
    ar << openDoors;
DEFID("open doors",long,OpenDoors),
    ar << openMagicDoors;
DEFID("open magic doors",long,OpenMagicDoors),
    ar << BB_LG;
DEFID("bend bars lift gates",long,BendBarsLiftGates),
    ar << hitBonus;
DEFID("hit bonus",long,HitBonus),
    ar << dmgBonus;
DEFID("damage bonus",ling,DamageBonus),
    ar << magicResistance;
    //ar << saveVsParPsnDMag;
    //ar << saveVsPetPoly;
    //ar << saveVsRdStWnd;
    //ar << saveVsBreath;
    //ar << saveVsSpell;
    //ar << pickPockets;
    //ar << openLocks;
    //ar << findRemoveTrap;
    //ar << moveSilent;
    //ar << hideInShadows;
    //ar << hearNoise;
    //ar << climbWalls;
    //ar << readLanguages;

/*
    ar << FighterLevel;
    ar << ClericLevel;
    ar << RangerLevel;
    ar << PaladinLevel;
    ar << MULevel;
    ar << ThiefLevel;
    ar << DruidLevel;
    ar << prevFighterLevel;
    ar << prevClericLevel;
    ar << prevRangerLevel;
    ar << prevPaladinLevel;
    ar << prevMULevel;
    ar << prevThiefLevel;
    ar << prevDruidLevel;
    ar << pdFighterLevel;
    ar << pdClericLevel;
    ar << pdRangerLevel;
    ar << pdPaladinLevel;
    ar << pdMULevel;
    ar << pdThiefLevel;
    ar << pdDruidLevel;
*/
//    {
//      int i, count;
//      count = GetBaseclassStatsCount();
//      ar << count;
//      for (i=0; i<count; i++)
//      {
//        baseclassStats[i].Serialize(ar);
//      };
//    };
DEFID("baseclass",string,Baseclass),

//    ar << IsPreGen;
DEDFID("pregen",BOOL,IsPreGen),
    ar << CanBeSaved;
DEFID("can be saved",BOOL,CanBeSaved),
    ar << HasLayedOnHandsToday;
DEFID("has laid today",BOOL,HasLayedOnHandsToday),
    money.Serialize(ar, version);
DEFID("money",string,Money),
    ar << NbrAttacks;
DEFID("number of attacks",long,NuberOfAttacks),
#ifdef SIMPLE_STRUCTURE
    icon.Serialize(ar,version, rte.IconArtDir());
DEFID("icon",string,Icon),
#else
    icon.Serialize(ar,version);
#endif
    ar << iconIndex;
DEFID("icon index",long,IconIndex),
    ar << origIndex;
DEFID("original index",long,OrigIndex),
    ar << uniquePartyID;
DEFID("unique party id",long,UniquePartyID),
    ar << DisableTalkIfDead;
DEFID("disable talk if dead",BOOL,DisableTalkIfDead),
    ar << TalkEvent;
DEFID("talk event",long,TalkEvent),
    AS(ar, TalkLabel);
DEFID("talk label",string,TalkLabel),
    ar << ExamineEvent;
DEFID("examine event",long,ExamineEvent),
    AS(ar, ExamineLabel);
DEFID("examine label",string,ExamineLabel),
   
    //ar << spells;
    m_spellbook.Serialize(ar, version);
DEFID("spell",string,Spell),

    //ar << detectingMagic;
    ar << detectingInvisible;
DEFID("detecting invisible",BOOL,DetectingInvisible),
    ar << detectingTraps;
DEFID("detecting traps",BOOL,DetectingTraps),
    ar << m_spellEffects.GetCount();
    POSITION pos = m_spellEffects.GetHeadPosition();
    while (pos!=NULL)
      m_spellEffects.GetNext(pos).Serialize(ar,version);
DEFID("spell effect",string,SpellEffect),
    blockageData.Serialize(ar);
DEFID("blockage",string,BlockageData),


CONFIGID( "" ,CONFIG_DATA_end ,NULL)
};



#endif

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9809
Re: does dungeon craft have ?
« Reply #13 on: March 20, 2013, 03:07:22 PM »
With which set of source code should one be working on this?

For example, with the code currently at SourceForge? Or something newer, i.e. not yet updated to SF.net?

Offline Milos Gulan

  • Hero Member
  • *****
  • Posts: 3128
Re: does dungeon craft have ?
« Reply #14 on: March 20, 2013, 03:38:12 PM »
I hope it is my lucky day but I can't find anything on Sourceforge at this link http://sourceforge.net/projects/uaf/. I have to say that I have looked DC Documentation and I am sure it has 200+ pages and I was thinking if I could learn scripting for DC then I probably will be able to learn C++. But for now I don't have C++ installed or Visual Basic, I only have some basic knowledge abot programing, I know some HTML and PHP.

I wish I could do that but now I don't think I will be able, but if I start learning I might get better and with time who knows :) I might be able to help and do some good things.