Aller au contenu

Photo

Help Scripting Loot - Very Very n00b


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

#1
gamer025

gamer025
  • Members
  • 21 messages
Hello there,

I'm about as n00b as you get with scripting. I'm also terrible at it. I'm fooling around with the toolset, making a simple module to practice a bit. I want to make a chest that will provide the appropriate weapon(s) when opened based on the class who opens it, especially if they have a weapon focus.

This would be very similar to the chest you open in your room in the OC and the first chest you open in NWN OC as well. So for instance, if a melee class opens it (say a fighter,) it could have a longsword as default, and if the fighter has WF: warhammer, it has a warhammer instead.

Also, maybe a few potions in addition. Which script would I need for this, or do I have to write my own?

#2
Kaldor Silverwand

Kaldor Silverwand
  • Members
  • 1 598 messages
I never write my own script when there is one provided. Although sometimes I may enhance the one provided. In this case I've done both. After you turn off the Toolset autosave function you can then safely open any of the OC modules and look at their scripts and the campaign scripts. In this case the script you are looking for is called 11_p_chest_open.

I have a modified version of that script in my Harvest of Chaos: King's Festival + Queen's Harvest campaign (link below) that adds equipment for the Favored Soul, Spirit Shaman, and Swashbuckler classes since those were left out of the original OC script.

Regards

#3
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
Yes, what kaldor said. There are scripts for lots of things and while scripting is tons of fun, it also takes tons of time. If, however, your intent is not just to produce a mod as fast as possible but to also learn to script, taking on projects like this is a good way to do it.

If you are trying to understand the fundamentals of scripting may I recommend

Scripting For Noobs by Knightmare
NWN2Scripting.com by scriptwiz

Both of these can be accessed on the NWVault and NWN2Scripting.com is a website that I used to learn the basics of scripting.

#4
gamer025

gamer025
  • Members
  • 21 messages

Kaldor Silverwand wrote...

I never write my own script when there is one provided. Although sometimes I may enhance the one provided. In this case I've done both. After you turn off the Toolset autosave function you can then safely open any of the OC modules and look at their scripts and the campaign scripts. In this case the script you are looking for is called 11_p_chest_open.

I have a modified version of that script in my Harvest of Chaos: King's Festival + Queen's Harvest campaign (link below) that adds equipment for the Favored Soul, Spirit Shaman, and Swashbuckler classes since those were left out of the original OC script.

Regards


I'm assuming this is "On Open Script?" There's no 11_p_chest_open in the toolset at least under the default. When I type 11 I don't get this option. Is this a script I have to write myself?

#5
gamer025

gamer025
  • Members
  • 21 messages
I can't figure out how to turn off auto-save either :P

#6
M. Rieder

M. Rieder
  • Members
  • 2 530 messages

gamer025 wrote...

I can't figure out how to turn off auto-save either :P



In the upper Left hand corner, go to View->options and then under the options menu you should be able to find it.


To find the script kaldor is talking about, go to File->open script  and then type in the script name.  That should find it for you.

One last bit of advice to save heartache.  Save as a directory, not a file.  When you save, go to File->Save Directory and use that to save.  Directories are much more stable and will not corrupt as much as a file. 

...and always back up your work.  People have lost months of work because of toolset crashes.

Modifié par M. Rieder, 11 février 2012 - 06:09 .


#7
Shaughn78

Shaughn78
  • Members
  • 637 messages

gamer025 wrote...

Kaldor Silverwand wrote...

I never write my own script when there is one provided. Although sometimes I may enhance the one provided. In this case I've done both. After you turn off the Toolset autosave function you can then safely open any of the OC modules and look at their scripts and the campaign scripts. In this case the script you are looking for is called 11_p_chest_open.

I have a modified version of that script in my Harvest of Chaos: King's Festival + Queen's Harvest campaign (link below) that adds equipment for the Favored Soul, Spirit Shaman, and Swashbuckler classes since those were left out of the original OC script.

Regards


I'm assuming this is "On Open Script?" There's no 11_p_chest_open in the toolset at least under the default. When I type 11 I don't get this option. Is this a script I have to write myself?


This is not a golobal script, it is a module script  When you open the toolset open the OC module "1100_West_Harbor",  this will be in your install folder not the my document folder with all the user created modules.

Once you look at the script you can modify it like Kaldor suggests or use it as it is or use his modified version.

There are a number of things that could stand to be fixed and it sounds like Kaldor has done most if not all
-Include additional classes
-Give grey orcs favored great axe
-Weapon finese should give light weapon no long sword.
-It looks like it doesn't take into account small stature. Any character with a spell feat gets a quarter staff and fighters get a greatsword, both these weapons are two handed.

-This script or a similiar one could also check for weapon focus so if your a fighter who wants to use a warmace you won't be given a greatsword. I did this with a chest in Risen Hero, module Risen_Hero_Ch1_02, module script  "wt_tomb_good_end".

#8
Dann-J

Dann-J
  • Members
  • 3 161 messages
I created my own equipment script for Shaar Moan, based loosely on the one used in the first official campaign. I designed the module for level 10 characters, so new characters get +1 weapons instead of non-magical ones, however you can always go through and change the ResRef strings if required.

If you start the game with a character below level 10 you get the chance to level up, then when you open a nearby chest you get weapon preferances based on weapon focus, weapon proficiency or race (rather than class).

#9
The Fred

The Fred
  • Members
  • 2 516 messages
I seem to recall an NWN1 script doing much the same thing, and it probably still exists. I don't know if it would deal with new weapons, though.

#10
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
You also have the option of just putting a variety of equpment in the chest and let the player choose what they want. As long as it is all non-magical, it won't be a big deal if they take it all and sell what they don't want.

#11
gamer025

gamer025
  • Members
  • 21 messages
Thanks guys. Right now my module is pretty crap. I have a four-way road shaped like a cross. The PC starts at the bottom with a chest. At each end of the road is a group of enemies. Kobolds, goblins, and orcs. I built it to practice placing enemies, changing their appearance and inventory load-out. One thing I can't figure out is how to level them. In NWN there was a level-up wizard. If you added new levels or classes it would level them for you, and then you can make adjustments. It seems with NWN2 toolset, if I add levels to "humanoid" nothing happens. There's no level up wizard. I have to change the stats myself and adjust their HP manually. Am I doing something wrong?

ALSO: For some reason now, whenever I try to load a module using a pre-made character, the game crashes. I have no idea what's causing it and it's driving me nuts. Any ideas?

Modifié par gamer025, 13 février 2012 - 10:58 .


#12
Shaun the Crazy One

Shaun the Crazy One
  • Members
  • 183 messages
Regrettably there is no level up wizard in NWN2 toolset. The easiest way to level up creatures is to go under the basic tab, set the levels as you want them (for example you might what to add 2 levels of fighter class to a goblin to make him tougher, or just up his humanoid levels), select a starting package based on that class and press "Reset from Package". You'll have to go under the statistics tab to adjust Hit Points and abilities, and possibly change the items in their inventory in the inventory tab, but other than that your done. I suggest just browsing the property tabs to arranging skill points, feats, and spells (if applicable).

With regard to the crashing, have you baked the area?

#13
gamer025

gamer025
  • Members
  • 21 messages

Shaun the Crazy One wrote...

Regrettably there is no level up wizard in NWN2 toolset. The easiest way to level up creatures is to go under the basic tab, set the levels as you want them (for example you might what to add 2 levels of fighter class to a goblin to make him tougher, or just up his humanoid levels), select a starting package based on that class and press "Reset from Package". You'll have to go under the statistics tab to adjust Hit Points and abilities, and possibly change the items in their inventory in the inventory tab, but other than that your done. I suggest just browsing the property tabs to arranging skill points, feats, and spells (if applicable).

With regard to the crashing, have you baked the area?


Thanks I'll give it a try.

No I haven't baked the area. This occurs even when I try the default module "Uninvited_Guests." I haven't tried the campaign yet. I hope someone has an idea. If it helps, I'm running steam version of the game.

#14
Shaughn78

Shaughn78
  • Members
  • 637 messages
That pre-made character that is crashing the game, was it created in a module/campaign that had custom content in it? If there a classes/feats/abilities or whatever that don't exist in the default game the game can crash since it can't find that material.

#15
gamer025

gamer025
  • Members
  • 21 messages

Shaughn78 wrote...

That pre-made character that is crashing the game, was it created in a module/campaign that had custom content in it? If there a classes/feats/abilities or whatever that don't exist in the default game the game can crash since it can't find that material.


This makes perfect sense. There are some in my list of PCs that were made online. The rest were made offline or are the defaults that come with the platinum edition. I don't even get to see the list. When I click "select character" the game crashes.