Aller au contenu

Photo

Want to modify an area I'm playing in. Insane fight.Can it be done?


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

#1
Braethorn

Braethorn
  • Members
  • 10 messages
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 .


#2
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
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

#3
Braethorn

Braethorn
  • Members
  • 10 messages
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.

#4
MrZork

MrZork
  • Members
  • 941 messages

 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 .


#5
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages

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 [b]not[b] want to declair your Vars with a standard initlization like.

int x = 0;

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


#6
MrZork

MrZork
  • Members
  • 941 messages
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.