Author Topic: Aspiring Scripter/Module builder  (Read 459 times)

Legacy_ScottyChaos

  • Newbie
  • *
  • Posts: 36
  • Karma: +0/-0
Aspiring Scripter/Module builder
« on: February 19, 2013, 04:50:24 pm »


               Hello NWN community. As stated in the topic title, I'm an aspiring Scripter/module maker. I've played a lot of the great modules such as Tortured Hearts and Rose of Eternity.

As such, these modules inspired me to want to create a fantastic module of my own (not all at once however. '<img'>). However, there's just one problem:

I don't know a lick of scripting or how to make triggers and such. :|

I'd love to learn how to do it, but it's very difficult for me, as I have a learning disability (and namely ADHD).

It sucks because I'd REALLY love to make a module, but the moment I try I'm easily distracted.

Is there any way shape or form (or any type of software) that could teach me scripting/module making?

If so, could you point me in the right direction?

Any help is greatly appreciated. ':wub:'
               
               

               
            

Legacy_Ribouldingue

  • Newbie
  • *
  • Posts: 42
  • Karma: +0/-0
Aspiring Scripter/Module builder
« Reply #1 on: February 19, 2013, 08:19:36 pm »


               Lilac's soul script generator and NWN Lexicon are both very helpful.

You can find them there: http://nwvault.ign.c...r.detail&id=625 and http://www.nwnlexico...x.php/Main_Page

Well you can find them even closer, there are two sticky topics at the top of this forum: Scripting tools and resources and NWN Lexicon.
               
               

               


                     Modifié par Ribouldingue, 19 février 2013 - 08:22 .
                     
                  


            

Legacy_ScottyChaos

  • Newbie
  • *
  • Posts: 36
  • Karma: +0/-0
Aspiring Scripter/Module builder
« Reply #2 on: February 19, 2013, 08:52:28 pm »


               Thank you for the reply. But finding great programs like that on here isn't the problem. :/ When I read the scripting and stuff, I can't seem to really understand it. I wanna actually LEARN what it all means.
               
               

               
            

Legacy_Fester Pot

  • Hero Member
  • *****
  • Posts: 1698
  • Karma: +0/-0
Aspiring Scripter/Module builder
« Reply #3 on: February 19, 2013, 08:59:14 pm »


               Lilac Soul's script gen. certainly helped me get through my first module, for it does a lot of the basic work for you. With the script assistance hat Bioware added in one of their patches, it also does a lot of the basic work for you - variable setting, reward giving/taking - so it's worth getting familiar with that too. (It's the little red hat you see when writing conversations).

Download the Omnibus, for it has an archive of messages from the legacy Bioware scripting forum. It's a great resource if you're searching for a script or on how it's done, and usually, the scripts folks have posted will be included in the message. It's worth having for referencing.

When in trouble, post for help. Showing the script you're trying to get working and asking for assistance will grab attention quicker than posting, "Need someone to make me scripts for an amazing PW I'm working on".

As for module making, try the tutorials and go through them. It'll give you a basic idea of how to get scripts working alongside of quests.

Tutorial (module building)
Tutorial (scripting)
Tutorial (module building course)

Tutorial (full list of all tutorials available for Neverwinter Nights building)

FP!
               
               

               


                     Modifié par Fester Pot, 19 février 2013 - 09:04 .
                     
                  


            

Legacy_ScottyChaos

  • Newbie
  • *
  • Posts: 36
  • Karma: +0/-0
Aspiring Scripter/Module builder
« Reply #4 on: February 19, 2013, 09:10:36 pm »


               Thank you so much Fester. Your post helped me a lot.
               
               

               
            

Legacy_Fallyn Rayne

  • Newbie
  • *
  • Posts: 34
  • Karma: +0/-0
Aspiring Scripter/Module builder
« Reply #5 on: February 25, 2013, 09:17:09 pm »


               I can't build a script from scratch to save my life. I think the key is getting a basic understanding of how scripts work and have some good references to use to help build your scripts. The links that Fester Pot posted are excellent to give you an understanding. Just don't feel like you have to memorize script code. Here's my process:

1. Determine in my mind the specific action that needs to take place in the module.

2. Use tools and references to help build my script. Here is what I use in order of preference:
  a. Lilac Soul's Script generator - A must! I couldn't build modules without it. 90% of my scripts are built with this tool

  b. NWN Lexicon website. Has just about every script function that you can possibly use with examples of each.

  c. nwn.wikia.com - search the script directory. There are a lot of examples of unique scripts that help spark some ideas.

  d. Look at scripts in other modules - If you see something in another module that you want to mimic or get ideas from then pull that module up in the tool set and find the script. I've only had to do this a few times but it's saved me.

Those are the only references I use. The more you attempt to build scripts with these tools the more creative you'll get and eventually you'll figure out how to make your own unique custom scripts.

This process has worked for me and I have a module that is currently in the top 50 on the vault with a lot of custom scripts. So you don't have to be a master coder, just know where the resources are to show you what code to use.

FallynRayne
               
               

               
            

Legacy_ScottyChaos

  • Newbie
  • *
  • Posts: 36
  • Karma: +0/-0
Aspiring Scripter/Module builder
« Reply #6 on: February 26, 2013, 02:21:13 pm »


               Thank you Rayne. I'll keep your advice in mind, and hopefully when I complete my Module I'll make sure to add your name into the credits. '<img'>
               
               

               
            

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
Aspiring Scripter/Module builder
« Reply #7 on: February 27, 2013, 02:59:17 am »


               I like to think of it as if it is parts of sentence.  Then a paragraph, and maybe even writing a poem, or a sonnet.  So the old subject, usually object_self, or the caller of the scrip, then the object which may also be the subject. For npc's activities would be an example.  Sort of just ambient behavior which does nothing more than provide color.  But there are many colors,  if you catch my meaning.
So it's like a canvas of words and pictures created through scripting, where the object may be real and immediate. If this happens to the subject. if 'I was attacked'..then...'attack back.'
So something specific.
While you can have much more general types of scripts that have many possible results, depending on many varibles.  Time of day, condition of PC, specific areas with various local int's set on the areas...any number of things.  There is a lot to it all in all.  It's sort of an osmotic process if you will.
               
               

               
            

Legacy_Morbane

  • Jr. Member
  • **
  • Posts: 79
  • Karma: +0/-0
Aspiring Scripter/Module builder
« Reply #8 on: February 27, 2013, 10:44:27 am »


               if u study LS SG u will eventually get the basis for creating ur own stuff
               
               

               
            

Legacy_CaveGnome

  • Sr. Member
  • ****
  • Posts: 432
  • Karma: +0/-0
Aspiring Scripter/Module builder
« Reply #9 on: February 27, 2013, 01:29:55 pm »


               Hello ScottyChaos,

I can recommand the original "Bioware Module Construction tutorial". This is a easy step by step module build for getting you started made by the Bioware staff. There is a PDF and the finished mod for you to tinker. You can find it (in the Tutorials paragraph) and lots of other useful info at:

http://www.neverwint...fo/builders.htm

As others said, the Lexicon is a must. It contains his own very well made tutorial sections. I found the internet-not-dependant version more easy to use, but the net version is more updated i think.

Cheers
               
               

               
            

Legacy_Sadira of Tyr

  • Sr. Member
  • ****
  • Posts: 299
  • Karma: +0/-0
Aspiring Scripter/Module builder
« Reply #10 on: February 27, 2013, 10:54:13 pm »


               I would recommend the script generator as well. I started building about two years ago, and I didn't know a thing about building. The tutorials posted above were a great help for me. I got started with scripting by copying other scripts, and changing names and tags. When I started using the script generator, it helped me to learn how scripts work.

Now after two years, I find myself doing things that the script generator cannot do, but I still need help now and then. However there plenty of nice people here willing to help make everything work nice again. Just post your script, and explain what you need, and someone will help. Maybe it will even be me, but I'm usually the one needing help, lol.
               
               

               
            

Legacy_Terrorble

  • Sr. Member
  • ****
  • Posts: 370
  • Karma: +0/-0
Aspiring Scripter/Module builder
« Reply #11 on: February 28, 2013, 05:48:05 am »


               I failed computer science my first semester of college 15 years ago. My next brush with programming was looking at a few spell scripts after playing NWN for a couple years.  I realized I could understand them, made some modifications and with help here, tutorials, etc got to where I generally do what I want.  

Good luck.
               
               

               
            

Legacy_Highv Priest

  • Full Member
  • ***
  • Posts: 170
  • Karma: +0/-0
Aspiring Scripter/Module builder
« Reply #12 on: March 11, 2013, 06:04:09 am »


               Really in nwn to script you just need an understanding of how the flow of nwn is working. Instead of telling you to go to tutorials I'll go ahead and explain basically all the "hard parts" of scripting that snagged me before I overcame them. The actual use of functions is well... Explained... By BioWare in the functions comments. Any other information then the explanations by BioWare about the functions can be found in nwnlexicon in well detailed format.

1). In order to apply an effect you need to first create an object to apply it to(which is well explained by BioWare in the functions or nwnlexicon) and then create said effect and then use ApplyEffectToObject or ApplyEffectAtLocation, Examples:

object oEnter = GetEnteringObject(); //Useful for anytime an animate thing is entering something.
effect eHeal = EffectHeal(100); //100 is just a number I stuck in there and the amount to heal.
ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oEnter);

Note that I first declared the object it's being applied to and then created the effect to apply to it and then applied the effect. Duration types are ultimately logical and thus I didn't go into detail as to why I chose instant(it's something that has no duration).

In order to apply something to a location we must first HAVE a location. Well declaring a location is also explained quite well by BioWare in many functions. A good example however is this:
location lSelf = GetLocation(OBJECT_SELF);
effect eExplosion = EffectVisualEffect(VFX_FNF_BLINDDEAF );
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplosion, lSelf);

Effects applied at locations are mostly visuals with the one exception being persistent AreaOfEffect's.

---------------------------------------------LOOPS---------------------------------------------------------------------------------------------------
As can be expected you can't always know how many things are going to be impacted by a particular script. So in order to handle any number of objects you have to use a loop.

NWN supports all standard loop methods, while, for, and do while. If you put a "return;" statement within a loop, it will cancel it. Basically the return statement tells a computer that the goal of the script has been accomplished and there is no more reason to run it.

A while loop is actually quite simple(despite HOW MANY TIMES I caused TMI errors because I couldn't comprehend the rules of it, despite how obvious the rules are). Example:

object oPC = GetFirstPC();
while(GetIsObjectValid(oPC)) //or you can use oPC != OBJECT_INVALID, not sure if there is a notable difference.
{
SendMessageToPC(oPC, "Hi!");
if(GetName(oPC) == "Smarty")
{
SendMessageToPC(oPC, "Smarty!");
}
oPC = GetNextPC();
}

The condition put into the brackets of the "while" statement are it's basis for how many times the loop should itinerate. In this case the while is going to keep looping until oPC becomes invalid.(runs out of PCs). Any statements put inside of a while loop will be repeated everytime the loop makes it's loop. The MOST IMPORTANT RULE WITH A WHILE LOOP is to make sure the condition in the brackets EVENTUALLY becomes wrong(you eventually want there to be no more PCs left in this situation.


A for loop is much simpler, but less universal because it has a set number of times you will make it loop. For instance to perform the function we did with the while would require having the server's onenter/onexit events setting a local variable that lets us know how many PCs are in the server before we perform the for loop. Thus a for loop is mostly used by programmers simply for allowing them to repeat an action multiple times without typing it ALL THOSE TIMES(Yay laziness!). NWN has one difference in it's for loop in that the initializing variable must be declared outside of the loop. Example of for:
int i;
int nMonkey = 2;
for(i=0; i<=nMonkey; i++)
{
if(i>=2)
SendMessageToAllDMs("OMG THERE IS"+IntToString(i)+" MONKEYS HERE!!!!!!!");
}

The i=0 is the initializing variable. This is the starting point of the for loop. The i<=nMonkey is saying that as long as nMonkey is greater in value then i that we will execute this script. The final part which is i++ simply means
i = i+1 and essentially this is increasing the starting number by 1 each time. The goal is that eventually the condition in the middle of the for's brackets will become wrong. The i++ is done at the completion of each loop.

The Do While loop I'm actually a bit rusty on myself because it's never really been something I've needed to use >.>, but still I'm quite certain I know how it works. Essentially it's a while loop that performs each block of code FIRST and THEN checks the condition. Example:
object oPC = GetFirstPC();
do
{
SendMessageToPC(oPC, "Got your nose!");
oPC = GetNextPC();
}
while(oPC != OBJECT_INVALID); //Note the semicolon there.

Same mechanics as while, but it executes first and then checks if it should continue.

If you want to know more then just let me know and I can explain some further possible snags for you.
               
               

               


                     Modifié par Highv Priest, 11 mars 2013 - 06:36 .