Author Topic: Want to modify an area I'm playing in. Insane fight.Can it be done?  (Read 437 times)

Legacy_Braethorn

  • Newbie
  • *
  • Posts: 18
  • Karma: +0/-0


               Still playing Dragon Dominant but one encounter is insanely
difficult. There are 3 encounters in the ToolSet that generate between 2 and 8
Moderate to difficult Lizard men. I counted 18 one time and 22 another. And
apparently you can't simply pass this by.

Why do modders do that? Must be a console game thingy where there are
"boss" monsters that are virtually impossible to defeat.

Anyway , I tried modifying the encounters in the Tool Kit to make them doable
but when i load my saved game , my changes haven't taken effect.

What could I doing wrong , can it even BE done and if so , is there a trick ala
modifying a playing character?

Txs
               
               

               


                     Modifié par Braethorn, 17 octobre 2011 - 01:57 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Want to modify an area I'm playing in. Insane fight.Can it be done?
« Reply #1 on: October 17, 2011, 07:14:59 am »


               The problem is that you are no longer playing the module,  You are playing the saved game.  When you save a game it saves the entire module.    
The simplest solution would be to add a script to your override folder that will modify the encounters for you.  

something like:

const string ENCOUNTER_TAG = "put the tag of the encounter here";
const string AREA_TAG      = "PUT the tag of the area here" ;
const int    MAX_SPAWN     = 4;   // enter what you want the max spawn to be.
void main()
{
 int x;
 object oEncounter =GetObjectByTag(ENCOUNTER_TAG,x);
 while (oEncounter != OBJECT_INVALID)
 {
    if (GetObjectType(oEncounter)== OBJECT_TYPE_ENCOUNTER
      &&GetTag(GetArea(oEncounter)) ==AREA_TAG )
    {
       SetEncounterDifficulty(ENCOUNTER_DIFFICULTY_NORMAL, oEncounter);
       SetEncounterSpawnsMax( MAX_SPAWN, oEncounter) ;
    }
    x++ ;
    oEncounter =GetObjectByTag(ENCOUNTER_TAG,x);
 }
}  

after you compile the script and drop it in you override folder, you will be able to run it with  the console commands
               
               

               
            

Legacy_Braethorn

  • Newbie
  • *
  • Posts: 18
  • Karma: +0/-0
Want to modify an area I'm playing in. Insane fight.Can it be done?
« Reply #2 on: October 17, 2011, 03:03:12 pm »


               Thank you.
I had wondered what was in the saved game. Always thought it was just the map co-ordinates of the players and the module/area names.
Didn't realize it was the entire module.
               
               

               
            

Legacy_MrZork

  • Hero Member
  • *****
  • Posts: 1643
  • Karma: +0/-0
Want to modify an area I'm playing in. Insane fight.Can it be done?
« Reply #3 on: October 17, 2011, 07:58:12 pm »


               

 int x;
 object oEncounter =GetObjectByTag(ENCOUNTER_TAG,x);

Lightfoot8, the code above made me curious: Does nwscript initialize variables without explicit assignment? E.g., does it set int and float variables to zero, strings to empty strings, etc? I try to do that explicitly, but it would be useful to know if the compiler does something reliable when I forget...
               
               

               


                     Modifié par MrZork, 17 octobre 2011 - 06:59 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Want to modify an area I'm playing in. Insane fight.Can it be done?
« Reply #4 on: October 18, 2011, 12:56:12 am »


               

MrZork wrote...

 int x;
 object oEncounter =GetObjectByTag(ENCOUNTER_TAG,x);

Lightfoot8, the code above made me curious: Does nwscript initialize variables without explicit assignment? E.g., does it set int and float variables to zero, strings to empty strings, etc? I try to do that explicitly, but it would be useful to know if the compiler does something reliable when I forget...


*smiles*   I like this question,  It is however going to take me a little but to get you a full answer.  So fore right now , the answer is yes. The compiler virtual machine that runs nwScripts, initlizes varaiables to NULL/Zero/OBJECT_INVALID or whatever the default is when storage for the var is allocated on the stack.   

Hopefully,  I will find the time to give a more compleate answer that will show why you may not want to declair your Vars with a standard initlization like.

int x = 0;
               
               

               


                     Modifié par Lightfoot8, 17 octobre 2011 - 11:56 .
                     
                  


            

Legacy_MrZork

  • Hero Member
  • *****
  • Posts: 1643
  • Karma: +0/-0
Want to modify an area I'm playing in. Insane fight.Can it be done?
« Reply #5 on: October 18, 2011, 02:25:19 am »


               Cool; if something tricky is going on, I'd like to know. If it's complicated to explain, maybe there is a link to an earlier discussion? I googled around (and looked in the NWN Omnibus) a bit before I posted, but I was having some trouble getting relevant results. (Probably, not using the correct terms was my problem.) Thanks.