Games Support Forums BioWare Info My Account Login Community Sign Up Store
Neverwinter Nights 2 Forums

NWN2: Builders - NWN2 Toolset

New Topic    Post Reply


    Add this To My Topics

   Go To Bottom

Author Debugging - need some suggestions
seeker of rain
Game Owner
Profile: seeker of rainNWN 2
NWN 2: MotB


Joined: 25 Apr 2007
Posted: Friday, 29 June 2007 01:57PM
I'm working on moudle for quite a long time - and as the size of the module grow the amount of time that i need to spend to test each quest and area getting longer.

How do you debug your module? any suggestions?

thanks
  Profile: seeker of rain   Send Message To: seeker of rain
ciViLiZed
Game Owner
Profile: ciViLiZedNWN
NWN 2
NWN 2: MotB
NWN 2: SoZ
Mass Effect PC


Joined: 15 Feb 2005
From: Montreal, Quebec, Canada
Posted: Friday, 29 June 2007 02:15PM
Funny, I was going to point you to this older thread:

Click Here

then realized you were the OP of that one too!

As far as I'm concerned, the tips there are still valid.

My main personal tips, in summary:
-Start mod closer to where you want to test
-Use EPOlson's debug tool and place some of the debug WPs to jump from WP to WP
-Use the console in DebugMode to modify variables, advance journal etc, or to spawn a debug creature with a convo that allows you to do same (like the DM creature, or the other debug monsters in the OC)
_________________
E.C.Patterson
Gaming Parents Studios

Trinity - A NWN2 adventure Download.

Edited By ciViLiZed on 06/29/07 14:26

  Profile: ciViLiZed   Send Message To: ciViLiZed
seeker of rain
Game Owner
Profile: seeker of rainNWN 2
NWN 2: MotB


Joined: 25 Apr 2007
Posted: Friday, 29 June 2007 02:41PM
I'm doing all those things, yet it is still taking a lot of time.

but thanks again

(the main problem is that there are so many ways each quest influence all the others so each time i need to test everything from the begining...)
  Profile: seeker of rain   Send Message To: seeker of rain
ciViLiZed
Game Owner
Profile: ciViLiZedNWN
NWN 2
NWN 2: MotB
NWN 2: SoZ
Mass Effect PC


Joined: 15 Feb 2005
From: Montreal, Quebec, Canada
Posted: Friday, 29 June 2007 02:58PM
Quote: Posted 06/29/07 14:41 (GMT) by seeker of rain

I'm doing all those things, yet it is still taking a lot of time.

but thanks again

(the main problem is that there are so many ways each quest influence all the others so each time i need to test everything from the begining...)

In my mind, the conditional check to determine whether a quest is available or not is most often comprised of one, or a handful of variables at most. So I don't see how jumping to that quest start point, setting the correct variables' values throught the console, then starting the quest to test it could be such an issue. Of course, you need to know what the variables are, where they are set, and what values they need to be at. For that, a reference document to keep track of them might prove handy.

If a quest depends on the presence of a companion in the party, then spawn the companion at the quest start location. For that, you might want to do like in the OC, iirc, and first spawn a debug creature that has a convo with an option that triggers an action script that goes through all the add companion steps for you.

That said, maybe if you described your issue more specifically, and the complexity of it, it could help to help you better.
_________________
E.C.Patterson
Gaming Parents Studios

Trinity - A NWN2 adventure Download.

Edited By ciViLiZed on 06/29/07 15:00

  Profile: ciViLiZed   Send Message To: ciViLiZed
Grinning Fool
Moderator

Joined: 26 Nov 2003
From: Khalidine
Posted: Friday, 29 June 2007 03:05PM
Here are some further ideas:

* make a GUI that lets you toggle or set all the different variables you need
* make a script that handles different starting points (a parameter to "main" will name the starting point. For a given starting point, it port the player to the right place, sets all of the variables to a known starting state, and spawn in appropriate companions, creatures, etc. Run the script using the "runscript" console command. Don't forget to include test conditions for when variables are in unexpected states.
* Instead of using the console command, make a dialog that executes that script. Display the dialog when a debug item is used, and give the debug item to player on entering the module. This way you don't have to remember specific "labels" that you give the different starting points in the script

You'll notice that those 'ideas' are basically more elaborate versions of what ciV suggested. Unfortunately, unless you want to run through the entire module every time, you essentially /have/ to do some additional scripting to support your testing.
_________________
NWN2 Creature/NPC Wizard, Toolset Enhancements, and More
NWN2 Chat

Edited By Grinning Fool on 06/29/07 15:13

  Profile: Grinning Fool   Send Message To: Grinning Fool
Grinning Fool
Moderator

Joined: 26 Nov 2003
From: Khalidine
Posted: Friday, 29 June 2007 03:15PM
Two more thoughts:

Set up your module to use a campaign, and create the dialogs and scripts as campaign resources. This will let you create a very small module in the campaign, strictly for testing of dialogs/scripts. That way, you can avoid loading the 'real' module (which is probably slow to load), and test more quickly.

My final suggestion is to configure your game to run in windowed mode while you are testing. Use Ctrl+F5 to run the game directly from the toolset. If you have a dual-core CPU, this will let you keep the game running in the background while you make your script changes. Recompile the scripts, save the module, then return to the game. Exiting to main menu will automatically reload the module you just saved, and is much faster than closing the game and relaunching, waiting for securom, etc. (If you have single-core, it may run too slowly for this to be practical).
_________________
NWN2 Creature/NPC Wizard, Toolset Enhancements, and More
NWN2 Chat

Edited By Grinning Fool on 06/29/07 15:18

  Profile: Grinning Fool   Send Message To: Grinning Fool
jackyo123
Game Owner
Profile: jackyo123NWN 2
NWN 2: MotB


Joined: 13 Dec 2006
Posted: Friday, 29 June 2007 03:26PM
Quote: Posted 06/29/07 14:15 (GMT) by ciViLiZed

Funny, I was going to point you to this older thread:

Click Here

then realized you were the OP of that one too!

As far as I'm concerned, the tips there are still valid.

My main personal tips, in summary:
-Start mod closer to where you want to test
-Use EPOlson's debug tool and place some of the debug WPs to jump from WP to WP
-Use the console in DebugMode to modify variables, advance journal etc, or to spawn a debug creature with a convo that allows you to do same (like the DM creature, or the other debug monsters in the OC)
Hi Civ -

how do you 'set' variable values with the debugconsole? I see that you can 'see' the values via the Print command - but I dont see any 'set' commands.

I've been doing it via script or widget - if its doable via command, please tell us how!

thanks
  Profile: jackyo123   Send Message To: jackyo123
ciViLiZed
Game Owner
Profile: ciViLiZedNWN
NWN 2
NWN 2: MotB
NWN 2: SoZ
Mass Effect PC


Joined: 15 Feb 2005
From: Montreal, Quebec, Canada
Posted: Friday, 29 June 2007 03:30PM
Quote: Posted 06/29/07 15:26 (GMT) by jackyo123

Quote: Posted 06/29/07 14:15 (GMT) by ciViLiZed

Funny, I was going to point you to this older thread:

Click Here

then realized you were the OP of that one too!

As far as I'm concerned, the tips there are still valid.

My main personal tips, in summary:
-Start mod closer to where you want to test
-Use EPOlson's debug tool and place some of the debug WPs to jump from WP to WP
-Use the console in DebugMode to modify variables, advance journal etc, or to spawn a debug creature with a convo that allows you to do same (like the DM creature, or the other debug monsters in the OC)
Hi Civ -

how do you 'set' variable values with the debugconsole? I see that you can 'see' the values via the Print command - but I dont see any 'set' commands.

I've been doing it via script or widget - if its doable via command, please tell us how!

thanks

I've used runscript ga_local_int( "all parameters here in quotes" ) for instance. These parameter-based scripts are really god-sends. Admitedly, a debug tool or debug creature with the set option is quicker in the end, but that's extra work that one may or may not feel is worth doing.
_________________
E.C.Patterson (aka ciViLiZed)
Available for part-time building on ongoing projects

Edited By ciViLiZed on 06/29/07 15:40

  Profile: ciViLiZed   Send Message To: ciViLiZed
jackyo123
Game Owner
Profile: jackyo123NWN 2
NWN 2: MotB


Joined: 13 Dec 2006
Posted: Friday, 29 June 2007 03:44PM
Quote: Posted 06/29/07 14:41 (GMT) by seeker of rain

I'm doing all those things, yet it is still taking a lot of time.

but thanks again

(the main problem is that there are so many ways each quest influence all the others so each time i need to test everything from the begining...)
I had this exact same problem.

Here is my solution (if you download my mod Night Howls in Nestlehaven, open it up in the toolset, and go to scripts, and look at the scripts dj_jump_my_npcs_to_xxxxxx.

Also look at the convo dj_debug


Here is what I did.

1 > Make sure EVERY area has a Client Enter and Client Exit script. Even if they are just blank void main().

2 > When you need to debug a certain area/event/quest, you create a bunch of waypoints near where you want to start the debugging run. I call them npcname_#. For example, I need Jonas in my party for one quest, so I drop a waypoint jonas_sp_5.

I then put a note in my spreadsheet, under the debugging section, that waypoint sp_5 is for debugging quest 'x' (whatever x is)

Next, I create a script, called 'dj_debug_jumpto_xxxx (where xxx is the quest name or place I am jumping to).

In that script, I do all my 'housekeeping' to set the game up EXACTLY as it would be when I arrived at that point.

I set

a> variables
b > any quest states
c > join the correct party members
d > move or kill others who should be in certain places

Once this is done (***and remmeber - this only needs to be done once*****) I then call this script via an ExecuteScript command from the CLIENTENTER script for the area I am going to jump-into.

I set it so that it will only execute once (so if i go into a building and return it doesnt execute again) via a simple if statement.

Finally, I drop my START LOCATION right next to the waypoints I created.

Voila!

Start a new game. It jumps you and your npc's directly to where you need to be, with all variables and values set.

When you are done - simple REMARK out the ExecuteScript line in your client enter script, and move the STARTLOCATION back to where it is supposed to be.


Once you've done this, you can use this script as a basis to make 20 more scripts. Ive got about 10 of these scripts, that can jump me all over the map to any quest, any state, any situation. Takes maybe 30 seconds to set-up once the scripts are done.

Its been an absolute savior. The only differences between the scripts are the values that the variables and quest-states get, and maybe one or 2 custom conditions (such as moving an npc from one place to another, if he is supposed to be in acertian location.

A few more things:

- I also create DEBUG OGRES that have debug_convos attached. They let me do many things - change variables, change quests, spawn certain key items, open doors, kill npcs (test death scripts), kill PC, turn people hostile (for balance checking and other things), etc etc etc. I plop one or 2 in every area. When I am in beta test mode, I leave them there for the testers to use, so they dont always need to start again if somnething goes wrong (I even left 3 in my final release - has saved many players from having to start ALL OVER AGAIN if they hit some unforseen bug - just put them in out-of-the way places so they arent obtrusive).

- Conversations. Sometimes its important that, say, midgame, when you test something, that a convo begins at a certain node (suppose you are testing the quest for an npc that has already given you 5 other quests, and you dont want to have to go through the first 4 again, as they change variables to things they shouldnt be at this stage in your test).

What I do for this is simple: I put conditionals on each of the nodes BEFORE the 'test' node that I need to be on - they will say something like 'gc_local_int' 'withers_debug' '0'. The node that I want to start with, I set the gc to check for '1'. I then go to the preceding line, and do a ga_setlocal to '1' (just in case, later on, I forget to come and change the '1' on the quest line back to zero).

Now, finally, I put a new line into my 'launch' script (my dj_jump_npcs_to_xxxxxx - it sets the debug variable that I just created to '1'.

The effect of this is simple - when I go talk to this guy, all the first 4 convo branches will be skipped, as they dont have the debug variable set to '1' - it will start EXACTLY where I want it to.

And furthermore - If, somehow, I FORGET to remove that '1' check later on, I am assured that, during the regular game, the variable WILL get set to 1 so the line will execute. Thats what the ga_ set on the previous line was for (its still best practice to go back and set ALL the conditionals to ZERO).


For part2 of my NHIN mod, I plan on putting these conditional debug check conditions into the key quest convos FROM THE BEGINING. Thus, when I am ready to debug/test, I can simply change the one branch I want to run to '1' and I am good to go.

I estimate that, setting up all this debug stuff, took maybe 3 hours. And I estimate that it saved me over 100 hours in actual playtesting.
_________________
Night Howls in Nestlehaven - Click Here
Cutscene Tutorial - Click Here
NHIN team - Click Here
  Profile: jackyo123   Send Message To: jackyo123
jackyo123
Game Owner
Profile: jackyo123NWN 2
NWN 2: MotB


Joined: 13 Dec 2006
Posted: Friday, 29 June 2007 03:47PM
Quote: Posted 06/29/07 15:30 (GMT) by ciViLiZed

Quote: Posted 06/29/07 15:26 (GMT) by jackyo123

Quote: Posted 06/29/07 14:15 (GMT) by ciViLiZed

Funny, I was going to point you to this older thread:

Click Here

then realized you were the OP of that one too!

As far as I'm concerned, the tips there are still valid.

My main personal tips, in summary:
-Start mod closer to where you want to test
-Use EPOlson's debug tool and place some of the debug WPs to jump from WP to WP
-Use the console in DebugMode to modify variables, advance journal etc, or to spawn a debug creature with a convo that allows you to do same (like the DM creature, or the other debug monsters in the OC)
Hi Civ -

how do you 'set' variable values with the debugconsole? I see that you can 'see' the values via the Print command - but I dont see any 'set' commands.

I've been doing it via script or widget - if its doable via command, please tell us how!

thanks

I've used runscript ga_local_int( "all parameters here in quotes" ) for instance. These parameter-based scripts are really god-sends. Admitedly, a debug tool or debug creature with the set option is quicker in the end, but that's extra work that one may or may not feel is worth doing.
ahh, ok. I've used that before, when I use rs gr-dm to spawn a dungeon master.

I never tried it with the ga_ scripts before.

Hey, have you ever figured out a way to 'pause' the scroll during output from things like printcreatures? If youve got more than 1 screenful, you cant see the first few.

thanks
  Profile: jackyo123   Send Message To: jackyo123

New Topic    Post Reply

What do these icons mean?
Where can I learn how to use the forums?

Jump To:

Search Forums | Forums FAQ | Forum Archives

 

 

  Visit the Official Site | Technical Support
Neverwinter Nights 2 Official Support
Hide/Show

English
Deutsch
Français
Español
Italiano

Hide/Show

6,251,296 Users
178 Online
13 Logged In

9,046,484 posts in forums

Newest Forum Topics:
1. These forums are now closed (NWN 1: Scripting)

2. These forums are now closed (NWN2: Guilds and Registry)

3. These forums are now closed (BioWare News Discussion)

4. Can you level items? (NWN 1: Scripting)

5. Thank you! (NWN 1: Scripting)


Current time is: (set time)
Fri, 03 September 2010 12:55AM