Aller au contenu

Photo

Adding lines to module_start?


  • Veuillez vous connecter pour répondre
7 réponses à ce sujet

#1
Elrith Galadon

Elrith Galadon
  • Members
  • 44 messages
 Hello,

I'm trying to add a "import hero" function to the original campaign. I've used Aurora toolset and NWN2 toolset, but I've only messed around with the DA:O toolset to edit morphs. A quick googling told me that:

case EVENT_TYPE_MODULE_START: 

{ object oHero = GetHero(); 
PreloadCharGen(); 
StartCharGen(oHero,0,TRUE); 
break;} 

will do the trick. So here are my questions:

1. Do I add it to sp_module.nss, sp_module_start.nss, or both?
2. How do I extract the script file to place in the override? Or am I going about this the wrong way?

I've tried adding to sp_module_start.nss, so that it'll read

 case EVENT_TYPE_MODULE_START:        
{            
Log_Trace(LOG_CHANNEL_SYSTEMS, "EVENT_TYPE_MODULE_START", "Character generation is disabled, runscript chargen to select an origin, etc.");
SetLoadHint(4);            
if(ReadIniEntry("DebugOptions", "SkipCharGen") != "1")            
{                
CS_LoadCutscene(R"game_intro.cut", PLT_GEN00PT_GENERIC_ACTIONS, GEN_START_CHARGEN);                object oHero = GetHero();                
PreloadCharGen();                
StartCharGen(oHero,0,TRUE); // Notice the default parameter int nImportEnabled = FALSEbreak; 
           }           
 //StartCharGen(GetHero(),0);

but the export yields no file of the same name. 

Any direction would be appreciated. Thanks in advance!

Modifié par Elrith Galadon, 19 novembre 2013 - 12:27 .


#2
dr.drummie

dr.drummie
  • Members
  • 51 messages
hi!
not sure how you exported your file, but when I tested some stuff I didn't changed database resource, just opened a local copy of script (right-click on script -> open local copy), modified it and compile it - save it.. after saving lots of stuff went also in ..documents\\bioware\\dragon age\\modules\\single player\\override\\toolsetexport.. there I deleted all other exported stuff except nss/ncs files that are modified by me.. if I need those files I usually put them one level up into override so i don't delete them on next export (depending on what i'm testing)..

I guess you should change sp_module_start script..

#3
Elrith Galadon

Elrith Galadon
  • Members
  • 44 messages

dr.drummie wrote...

hi!
not sure how you exported your file, but when I tested some stuff I didn't changed database resource, just opened a local copy of script (right-click on script -> open local copy), modified it and compile it - save it.. after saving lots of stuff went also in ..documentsbiowaredragon agemodulessingle playeroverridetoolsetexport.. there I deleted all other exported stuff except nss/ncs files that are modified by me.. if I need those files I usually put them one level up into override so i don't delete them on next export (depending on what i'm testing)..

I guess you should change sp_module_start script..



I've exported both with dependent resources and without, and neither attempt gives me sp_module_start.nss. It goes from rules_h.nss to stats_core_h.nss when sorted in alphabetical order. It's very puzzling. 

I suppose I can open an nss in Aurora or NWN2 engine toolset too, as Bioware seems to like the entire 2da/nss/dlg stuff (so much so that I keep getting confused as I am also editing some files from NWN2 as well). Or notepad++. Would that work? I'm not sure if the toolset appends any headers before saving it as a script... I'm also not sure which version DA:O is using, as Aurora slightly differs from the Electron toolset. 

I think it's a little silly for Bioware to not allow "import characters" to function for modules, but I guess they had their reasons. 

Modifié par Elrith Galadon, 19 novembre 2013 - 06:26 .


#4
Elrith Galadon

Elrith Galadon
  • Members
  • 44 messages
 Well, I've managed to save the edit onto the nss (evidently you need to check out, edit, check in and save...). But adding the lines hasn't managed to do the trick, so either there's a conflict or I'm putting it in the wrong place. The script also won't compile (missing resource error).

For some reason, saving it as sp_module_start_edit.nss and compiling works. But then I can't find the compiled ncs to add to the resource file or put it in override. 

For reference, here was where I got the script:

social.bioware.com/forum/1/topic/9/index/245248#1299716

#5
dr.drummie

dr.drummie
  • Members
  • 51 messages
dont know if u change directly in SP module, but you can create new module, set to extend SP, then mod what you want and above description should work.. everything that's modified locally for SP should go to docs\\bioware\\modules\\singleplayer\\override.. sorry, not sure why you cant find it..

#6
Elrith Galadon

Elrith Galadon
  • Members
  • 44 messages

dr.drummie wrote...

dont know if u change directly in SP module, but you can create new module, set to extend SP, then mod what you want and above description should work.. everything that's modified locally for SP should go to docsbiowaremodulessingleplayeroverride.. sorry, not sure why you cant find it..


I found the script! Thank you so much! I was looking in the wrong override folder.

Now if I can only figure out what's wrong with the script itself... still not working...

Twice before has this been asked and twice has the question "what the heck do I do with the code" ignored. This is all very confusing for a scripting newbie like me. :S


/////////////////////////////////////// Single Player module events/////////////////////////////////////
#include "log_h"#include "utility_h"#include "wrappers_h"#include "events_h"#include "campaign_h"
// Story-so-far plots:#include "plt_mnp00pt_ssf_human_noble"#include "plt_mnp00pt_ssf_prelude"#include "plt_mnp00pt_ssf_elf_city"#include "plt_mnp00pt_ssf_elf_dalish"#include "plt_mnp00pt_ssf_mage"#include "plt_mnp00pt_ssf_nature"#include "plt_mnp000pt_ssf_sacred_urn"#include "plt_mnp00pt_ssf_climax"#include "plt_mnp00pt_ssf_circle"#include "plt_mnp00pt_ssf_critpath"#include "plt_mnp00pt_ssf_paragon"#include "plt_mnp00pt_ssf_dwarf_comm"#include "plt_mnp00pt_ssf_dwarf_noble"#include "plt_mnp00pt_ssf_epilogue"
#include "plt_pre100pt_find_wardens"#include "plt_gen00pt_backgrounds"#include "prept_generic_actions"#include "plt_clipt_main"
#include "pre_functions_h"#include "den_functions_h"#include "orz_functions_h"#include "arl_ssf_h"#include "ntb_ssf_h"#include "urn_ssf_h"#include "cli_ssf_h"#include "cir_ssf_h"#include "bhm_ssf_h"
#include "plt_bhn000pt_main"#include "plt_bec000pt_main"#include "plt_bed000pt_main"
#include "plt_ntb000pt_main"#include "plt_urnpt_main"#include "plt_clipt_main"#include "plt_cir000pt_main"#include "plt_gen00pt_generic_actions"
void SetStorySoFar(){    /*    If epilogue started => show epilogue    If climax started => show climax    If in wow areas (random encounters, Lothering, Lake Calenhad) => show wow (TBD by Sheryl) – this will have some generic global plot logic    If in Broken Circle areas => show Broken Circle    If in Landsmeet areas => show Landsmeet    If in Arl Eamon areas => show Arl Eamon    If in Urn areas => show Urn    If in Nature of the Beast areas => show NTB    If in Paragon areas => show Paragon    If in Prelude => show Prelude    Otherwise: show origin story    */    object oArea = GetArea(GetHero());    string sAreaCode = StringLeft(GetTag(oArea), 3);
    Log_Trace(LOG_CHANNEL_SYSTEMS, "SetStorySoFar", "START ******** area code: " + sAreaCode);
    if(sAreaCode == "epi")        WR_SetStoryPlot(PLT_MNP00PT_SSF_EPILOGUE);    else if(sAreaCode == "cli")        WR_SetStoryPlot(PLT_MNP00PT_SSF_CLIMAX);    else if(sAreaCode == "ran" || sAreaCode == "cam" || sAreaCode == "lot" || sAreaCode == "nrd")        WR_SetStoryPlot(PLT_MNP00PT_SSF_CRITPATH);    else if(sAreaCode == "cir")        WR_SetStoryPlot(PLT_MNP00PT_SSF_CIRCLE);    else if(sAreaCode == "den")    {        if(WR_GetPlotFlag(PLT_DENPT_MAIN, LANDSMEET_PLOT_OPENED))            WR_SetStoryPlot(PLT_MNP00PT_SSF_LANDSMEET);        else            WR_SetStoryPlot(PLT_MNP00PT_SSF_CRITPATH);    }    else if(sAreaCode == "arl")        WR_SetStoryPlot(PLT_MNP00PT_SSF_ARL_EAMON);    else if(sAreaCode == "urn")        WR_SetStoryPlot(PLT_MNP000PT_SSF_SACRED_URN);    else if(sAreaCode == "ntb")        WR_SetStoryPlot(PLT_MNP00PT_SSF_NATURE);    else if(sAreaCode == "orz")        WR_SetStoryPlot(PLT_MNP00PT_SSF_PARAGON);    else if(sAreaCode == "pre")        WR_SetStoryPlot(PLT_MNP00PT_SSF_PRELUDE);    else if(WR_GetPlotFlag(PLT_GEN00PT_BACKGROUNDS, GEN_BACK_HUMAN_NOBLE))        WR_SetStoryPlot(PLT_MNP00PT_SSF_HUMAN_NOBLE);    else if(WR_GetPlotFlag(PLT_GEN00PT_BACKGROUNDS, GEN_BACK_ELF_CITY))        WR_SetStoryPlot(PLT_MNP00PT_SSF_ELF_CITY);    else if(WR_GetPlotFlag(PLT_GEN00PT_BACKGROUNDS, GEN_BACK_ELF_DALISH))        WR_SetStoryPlot(PLT_MNP00PT_SSF_ELF_DALISH);    else if(sAreaCode == "bhm") //Mage origin        WR_SetStoryPlot(PLT_MNP00PT_SSF_MAGE);    else if(WR_GetPlotFlag(PLT_GEN00PT_BACKGROUNDS, GEN_BACK_DWARF_COMMONER))        WR_SetStoryPlot(PLT_MNP00PT_SSF_DWARF_COMM);    else if(WR_GetPlotFlag(PLT_GEN00PT_BACKGROUNDS, GEN_BACK_DWARF_NOBLE))        WR_SetStoryPlot(PLT_MNP00PT_SSF_DWARF_NOBLE);
    Log_Trace(LOG_CHANNEL_SYSTEMS, "SetStorySoFar", "END *******************");
}

void main(){    event ev = GetCurrentEvent();    int nEventType = GetEventType(ev);    int bEventHandled = FALSE;    string sDebug;    object oPC = GetHero();
    Log_Events("", ev);
    switch(nEventType)    {        ////////////////////////////////////////////////////////////////////////        // Sent by: The engine        // When: The module starts. This can happen only once for a single        //       game instance.        ////////////////////////////////////////////////////////////////////////         case EVENT_TYPE_MODULE_START:        {            Log_Trace(LOG_CHANNEL_SYSTEMS, "EVENT_TYPE_MODULE_START", "Character generation is disabled, runscript chargen to select an origin, etc.");
            SetLoadHint(4);            if(ReadIniEntry("DebugOptions", "SkipCharGen") != "1")            {                CS_LoadCutscene(R"game_intro.cut", PLT_GEN00PT_GENERIC_ACTIONS, GEN_START_CHARGEN);                PreloadCharGen();            }          { object oHero = GetHero();PreloadCharGen();StartCharGen(oHero,0,TRUE);break;}            SetStorySoFar();
            // Allow party picker GUI to pop up for debug-jumps into main plots            // The origin story jump should disable this same var.            SetLocalInt(GetModule(), PARTY_PICKER_GUI_ALLOWED_TO_POP_UP, TRUE);
            object oWideOpenWorldMap = GetObjectByTag(WM_WOW_TAG);            WR_SetWorldMapPrimary(oWideOpenWorldMap);
            break;        }        ////////////////////////////////////////////////////////////////////////        // Sent by: The engine        // When: The module loads from a save game. This event can fire more than        //       once for a single module or game instance.        ////////////////////////////////////////////////////////////////////////        case EVENT_TYPE_MODULE_LOAD:        {            Log_Trace(LOG_CHANNEL_SYSTEMS, "EVENT_TYPE_MODULE_LOAD", "Loading singleplayer...");            SetStorySoFar();
            break;        }        ////////////////////////////////////////////////////////////////////////        case EVENT_TYPE_MODULE_PRESAVE:        {            Log_Trace(LOG_CHANNEL_SYSTEMS, "EVENT_TYPE_MODULE_PRESAVE", "module pre-saving...");
            SetStorySoFar();
            int nPREStart = WR_GetPlotFlag(PLT_PREPT_GENERIC_ACTIONS, PRE_GA_END_CAILAN_CONVERSATION);            int nPREEnd = WR_GetPlotFlag(PLT_PRE100PT_GENERIC, PRE_GENERIC_PRELUDE_DONE);            int nBHNStart = WR_GetPlotFlag(PLT_GEN00PT_BACKGROUNDS, GEN_BACK_HUMAN_NOBLE);            int nBHNEnd = WR_GetPlotFlag(PLT_BHN000PT_MAIN,BHN_MAIN_START_PRELUDE,TRUE);            int nBECStart = WR_GetPlotFlag(PLT_GEN00PT_BACKGROUNDS, GEN_BACK_ELF_CITY);            int nBECEnd = WR_GetPlotFlag(PLT_BEC000PT_MAIN,BEC_MAIN_PC_JOINED_GREY_WARDENS,TRUE);            int nBEDStart = WR_GetPlotFlag(PLT_GEN00PT_BACKGROUNDS, GEN_BACK_ELF_DALISH);            int nBEDEnd = WR_GetPlotFlag(PLT_BED000PT_MAIN,BED_MAIN_PC_LEAVES_FOR_GREY_WARDENS,TRUE);            int nBHNSiege = WR_GetPlotFlag(PLT_BHN000PT_MAIN, BHN_MAIN_BATTLE_BEGUN, TRUE);            int nBECKidnapped = WR_GetPlotFlag(PLT_BEC000PT_MAIN,BEC_MAIN_GIRLS_KIDNAPPED,TRUE);            int nBEDMirror = WR_GetPlotFlag(PLT_BED000PT_MAIN,BED_MAIN_DUNCAN_BRINGS_UNCONSCIOUS_PC_TO_CAMP,TRUE);
            if(WR_GetPlotFlag(PLT_CLIPT_MAIN, CLI_MAIN_ARCHDEMON_DEFEATED))                WR_SetPlotFlag(PLT_MNP00PT_SSF_EPILOGUE, SSF_EPI_POST_CORONATION, TRUE);            // if in Prelude            if (nPREStart && ! nPREEnd)            {                PRE_ModulePresave();            }            ////////////////////////////////////////////////////////////////////////////////////            // Human noble has started but before the siege            ////////////////////////////////////////////////////////////////////////////////////            if((nBHNStart == TRUE) && (nBHNEnd == FALSE) && (nBHNSiege == FALSE))            {                WR_SetPlotFlag(PLT_MNP00PT_SSF_HUMAN_NOBLE, SSF_BHN_START, TRUE, TRUE);            }            ////////////////////////////////////////////////////////////////////////////////////            // after the human noble siege            ////////////////////////////////////////////////////////////////////////////////////            else if((nBHNSiege == TRUE) && (nBHNEnd == FALSE))            {                WR_SetPlotFlag(PLT_MNP00PT_SSF_HUMAN_NOBLE, SSF_BHN_SIEGE, TRUE, TRUE);            }            ////////////////////////////////////////////////////////////////////////////////////            // after the human noble            ////////////////////////////////////////////////////////////////////////////////////            else if((nBHNStart == TRUE) && (nBHNEnd == TRUE))            {                WR_SetPlotFlag(PLT_MNP00PT_SSF_HUMAN_NOBLE, SSF_BHN_END, TRUE, TRUE);            }            ////////////////////////////////////////////////////////////////////////////////////            // city elf has started but women not kidnapped            ////////////////////////////////////////////////////////////////////////////////////            else if((nBECStart == TRUE) && (nBECEnd == FALSE) && (nBECKidnapped == FALSE))            {                WR_SetPlotFlag(PLT_MNP00PT_SSF_ELF_CITY, SSF_BEC_START, TRUE, TRUE);            }            ////////////////////////////////////////////////////////////////////////////////////            // city elf started and women kidnapped            ////////////////////////////////////////////////////////////////////////////////////            else if((nBECEnd == FALSE) && (nBECKidnapped == TRUE))            {                WR_SetPlotFlag(PLT_MNP00PT_SSF_ELF_CITY, SSF_BEC_WEDDING_DISRUPTED, TRUE, TRUE);            }            ////////////////////////////////////////////////////////////////////////////////////            // city elf ended            ////////////////////////////////////////////////////////////////////////////////////            else if((nBECStart == TRUE) && (nBECEnd == TRUE))            {                WR_SetPlotFlag(PLT_MNP00PT_SSF_ELF_CITY, SSF_BEC_END, TRUE, TRUE);            }            ////////////////////////////////////////////////////////////////////////////////////            // dalish elf started but before tamlen touches the mirror            ////////////////////////////////////////////////////////////////////////////////////            else if((nBEDStart == TRUE) && (nBEDEnd == FALSE) && (nBEDMirror == FALSE))            {                WR_SetPlotFlag(PLT_MNP00PT_SSF_ELF_DALISH, SSF_BED_START, TRUE, TRUE);            }            ////////////////////////////////////////////////////////////////////////////////////            // dalish elf started and tamlen touched the mirror            ////////////////////////////////////////////////////////////////////////////////////            else if((nBEDEnd == FALSE) && (nBEDMirror == TRUE))            {                WR_SetPlotFlag(PLT_MNP00PT_SSF_ELF_DALISH, SSF_BED_TAINTED, TRUE, TRUE);            }            ////////////////////////////////////////////////////////////////////////////////////            // dalish elf ended            ////////////////////////////////////////////////////////////////////////////////////            else if((nBEDStart == TRUE) && (nBEDEnd == TRUE))            {                WR_SetPlotFlag(PLT_MNP00PT_SSF_ELF_DALISH, SSF_BED_END, TRUE, TRUE);            }


            ARL_HandleStorySoFar();            DEN_ModulePresave();            ORZ_ModulePresave();            NTB_HandleStorySoFar();            URN_HandleStorySoFar();            CIR_HandleStorySoFar(); //Broken Circle story so far            BHM_HandleStorySoFar(); //Mage Origin story so far            Campaign_SetStorySoFar();            CLI_HandleStorySoFar();
            break;        }
    }
    if (!bEventHandled)    {        HandleEvent(ev, RESOURCE_SCRIPT_MODULE_CORE);    }}

That is what I have in my sp_module_start. sp_module also has case EVENT_TYPE_MODULE_START. What am I doing wrong here?

Modifié par Elrith Galadon, 26 novembre 2013 - 02:00 .


#7
dr.drummie

dr.drummie
  • Members
  • 51 messages
I didn't try what you're doing so I don't know the answer..
quick observation on topic you linked said that it is possible to import char made by char creator released by bioware before game itself.. but also one of posts said that import button is read-only for import procedure..
i think that you need to change only one line of that sp_module_start script:
- uncomment "//StartCharGen(GetHero(),0);" and change to "StartCharGen(GetHero(),0, TRUE);".

but not sure if this will work.. I don't know if bioware prevented this somehow.

#8
Elrith Galadon

Elrith Galadon
  • Members
  • 44 messages
Still not working... I really wish I knew what was going on...

It might be that Bioware prevented this. I suppose it's not that big of a deal, as I'm not that fussed about the stats/codex/talents (that can be cheated).

But I still think it's a bit silly they've disallowed the import character feature.