Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Fliggerty

Ambassadors
  • Posts

    20
  • Joined

  • Last visited

Everything posted by Fliggerty

  1. Thanks for the cookies! Happy New Year!

  2. Phew...you guys had me pretty worried for a while there. But now I'm just relieved.
  3. Good morning class and welcome to Morrowind Scripting 101 I am your instructor Fliggerty. You can call me Mr. E. if you wish. Before we being, I want to discuss the primary goals and objectives of this course. First and foremost you are here to learn how to use Morrowind scripts to accomplish various effects in your mods. But why am I here? Simply put, I have learned many tips and tricks over the years. I have pioneered various techniques, and done what others have said is impossible. And I give full credit to those who have shared their knowledge with, and those who have created new tools for us to use. I believe in giving freely of what I have freely received. I am not much of a programmer. I understand the theory of various programming languages, and have certainly tried to learn how to use it. I just have a hard time with programming for the most part. And yet I understand scripting. So that's good news you don't have to be a programmer to be a scripter! In fact many programmers find themselves bored and frustrated with the simplistic scripting language we use (which has worked in our favor by enticing them to create things such as MWSE.) So what is going to make this class any different than the myriad scripting tutorials available? Variety, for one thing. But while I am going to start at the beginning, we will go through that part quickly. I intend to spend the majority of our time on more advanced concepts. I am going to include using MWSE and MGE nearly from the beginning. I am going to teach you things that are not found in any tutorial yet written. Since we are going to go through the beginning quickly, this may be nothing more than a boring read. If you want a more interactive version of Lesson 1, I would suggest creating my_first_script as outlined starting on page 13 of Morrowind Scripting for Dummies. (I suggest that for everyone, even if you do read through all of this.) What is a script? When someone is making a movie they use a script to tell the actors what to say, when to say it, and where to stand. A script in Morrowind is essentially the same thing. It tells the game engine what to do, how to do it, and when. In fact, in many tutorials you read, an NPC might be referred to as an actor. There are two types of scripts: local and global. A local script is one that is attached to a specific object and is always running when the object is present. An example of this is the OutsideBanner script which makes banners wave in the wind. The second type of script is a global script. A global script, once started, will always be running until it is stopped regardless of objects that are or are not present. An example of this is dbattackscript which makes the Dark Brotherhood attack no matter where the player is. There is a type of global script that we call a targeted script. To better explain what that is though, we ought to first discuss some terminology. Script Terminology and Syntax Functions are the building blocks of a script. A function is a command that is used to retrieve information from the engine, or to pass information back to it. For example, the function GetHealth will tell you how many health points are left. SetHealth will change the health points to the value you specify. The next major component of a script is the variable. MW scripting has 3 types of variables: short,long, and float. A short variable is used for smaller integer values, those from -32768 to 32767; a long is for integer values from -2,147,483,648 to 2,147,483,647; and a float is used for decimal integers, or partial numbers. MWSE also introduces string variables, which we will discuss later. Most functions will return or require a specific type of variable, so make sure to use the correct one. Before you can use any variable, you have to first declare it. This will tell the script what the variable name is and what type. Let's say we want to use a variable that will store the players current health. GetHealth returns a float variable according to MWSFD (Morrowind Scripting for Dummies.) So we will declare a float variable and call it PCHealth: float PCHealth This is usually done at the top of the script. It's a good idea to declare all of your variables together. I try to keep them nice and neat, placing all of the shorts together, then the longs, and the floats. Its not necessary, but it sure does help in keeping them straight. Some people also identify what type of variable they declared by appending an s, l, or f to the beginning. So they would have ftemp, or stemp instead of just temp. Generally when you use a function you need four things: a condition, an operator, an infix, and a postfix. Take this line (by the way, a line such as the one below is called a conditional statement): if ( player->GetHealth > 1 ) The condition here is if Other conditions are while, else, and elseif. The operator is > (greater than.) Others are < (less than,) == (equal to,) != (not equal,) <less>= (greater than or equal.) The infix (also called a calling actor or reference, which is the term I will usually use) is player. Infix refers to the data that is being passed into the function. We are telling the GetHealth function to look at the player reference. Postfix refers to the data returned by the function. In our example the postfix is 1. With most vanilla scripting functions the postfix is a numerical value. Let's now assume that we will need to know how much health the player has left in several parts of a script. We could call the GetHealth function each time, or we could simply use a variable. set PCHealth to player->GetHealthif ( PCHealth > 1 ) This is essentially the same as the statement we used above, except that we can now use that same variable in more than one place, for as many statements as we need. There are a few things to note about Morrowind scripting. Spacing can be a very important thing. It is imperative that you put a single space on each side of every parenthesis ( or ) that you use. Failure to do so will cause weird errors. Also, never put a space on either side of a -> despite what some tutorials say. I have seen lots of glitches caused by doing this. if (player->GetHealth > 1) ;wrongif ( player -> GetHealth > 1 ) ;wrongif ( player->GetHealth > 1 ) ;correct Commas are another thing to be careful with. Consistency seems to be the important factor with them. Some functions supposedly require a comma between parameters: PlaceAtPC, Fargoth, 1, 100, 1 I find that proper comma usage can become confusing, so I make it a practice to never use them. Everything works just fine without it. Remember that consistency is the key here, so either always use a comma or never use it. I hold the same rule with quotes. I always put quotes around any ID, whether it be an NPC's ID, or the ID of a script that I am starting. It is necessary to use them when the ID happens to have two or more words, but not when it is only one word. However, once again being consistent is important. Now that we've learned some terminology, I want to touch briefly on a targeted script. A targeted script is simply a global script. The difference between these and a normal global script is that they have an <em class='bbc'>inherited</em> infix. Let's say I have a script that will display the health of its target every 5 seconds. I would like it to work for any NPC, rather than just the player. So instead of using this statement: set PCHealth to player->GetHealth I would use this: set PCHealth to GetHealth Do you notice anything missing? Where is the infix? It doesn't have one. So how does the engine know what reference to look for? The answer is simple. In another script I would have this line: player->StartScript gethealth_script That is defining the infix for the entire gethealth_script script. So any function called in that script that does not have a specific infix will default to the player. Alternatively, I could call StartScript in the results box of a dialogue entry and it would run on the NPC that I am talking to. Basically every global script is a targeted script, with the exceptions being Start Scripts that the engine runs when the game is loaded (we'll touch on those more in Lesson 2.) Every script has a beginning, a middle, and an end. The middle is optional, but the rest isn't. You tell the engine where your script starts, and what the script's ID is by using the begin statement. Likewise, you tell it where to finish by using end. begin sample_script ;do some cool stuff hereend Most tutorials will tell you to include the script ID after the end, but it's not necessary. When a script is running, the engine will start at the top and work its way down, line by line, until it comes to the end, or it is interrupted. So if you want one thing to happen before another, all you need to do is put the first action above the second. In some cases though, we don't want the script to go past a certain point. In such a situation we use the return function. This will act like the end of the script, telling the engine to return back to the top. A common use of this is to halt the script entirely when the player is in a menu (this is a good idea to always include unless your script specifically needs to run while the player is in a menu.) if ( MenuMode == 1 ) ReturnEndif So whenever the player is in inventory, dialogue, or any other menu, the engine will not run anything past this point. Another common function used in many scripts is the MessageBox. This is how we display data to the player, and also retrieve information. The primary use that I put it to is debugging. I will usually declare a variable called <em class='bbc'>debug</em> which I set to 1 when I am testing a script. if ( debug == 1 );MessageBox it seems to be working just fine Endif We'll be using some better examples of this in most of the following lessons. The final basic concept we need to talk about is commenting your script. Do it! Do it well and thoroughly. I am horrible at following through with this advice, and I have paid the price by having to spend hours trying to decipher something I wrote months ago. You can put as many comments in a script as you like. All you have to do is precede it with the ; symbol. Anything after that will not be compiled and will not affect the function of the script. Software We Use Most people use the Construction Set for scripting. That's just fine, but I don't. It doesn't allow you to compile MWSE or MGE functions, and the compiler tends to miss things sometimes (it often won't tell you if you forget to declare a variable.) That is why I require you to write your scripts for this course in MWEdit. There are many advantages to using MWEdit. It is simple and quick, you don't need to wait for Morrowind.esm to load, just your esp. It has a syntax highlighter, which means that different parts of your script will be displayed in various colors. This becomes incredibly helpful when trying to debug. It has a built-in indenter, which assists in reading a script. And the compiler is much more thorough than the CS. So get MWEdit (the link is available in the syllabus thread) and install it. These tutorials will all be based around using it as our primary piece of software. Enchanted Editor is another thing that we will use. It has capabilities that nothing else available does. I won't explain any of that here as the uses are pretty specific. But rest assured that we will need it, and you will find it to be a valuable tool. Well that's the first lesson and the boring one. But all of that information is vital in being able to write a script. Until I am able to finish lesson 2, I strongly suggest you take some time to read through any other tutorials you can find. Again I recommend the Scripting Tutorial found in MWSFD. It will take you through many essentials that I only briefly covered here. Until next time, class dismissed!
  4. The second attack was a last ditch effort using a well-hidden script that we didn't find the first time. It has been identified and deleted. The script with the security hole he originally used has been removed. GHF is back up and running again. It will continue to be up and running, despite any efforts from any hacker. I will not be kept down under any circumstances.
  5. Of course, I'd be more than happy to.
  6. Thanks for the welcome. I'd sure love to see that haunted castle of yours!
  7. Try to get everyone you know of who has a fan site to join the TES Mod Webring.
  8. Howdy old friend. I'm hoping that perhaps GHF and TES Alliance can start to work together on bringing the general community together a bit. I've been enjoying getting to know DarkRider a bit today, and look forward to meeting more of you!
  9. [align=center]I am pleased to officially announce The Second Semi-Annual Great House Fliggerty Modding Invitational! All modders are invited to attend and participate in this groundbreaking event! *************************************** Any modder who is not a Hall of Fame modder at Planet Elder Scrolls, and has not released a mod that has attained a cumulative download count of 5000 for any single mod, is eligible to enter any original work. On the other hand, any HoF modder and those who do have a download count of 5000 are invited to act as Honorary Invitational Judges! *************************************** The main purpose of this event is to encourage up-and-coming modders by giving them a showcase for their creations, and providing a non-biased opportunity to receive constructive criticism and tips from more experienced members of the community. *************************************** The deadline for entries is Midnight, MST, January 5, 2009.[/align] *************************************** Only entries from members of Great House Fliggerty with a total of 50 posts or more will be accepted. The deadline allows for plenty of time to achieve that number of posts without any inappropriate spamming. *************************************** The categories are: -- A Tavern -- A H.E.L.L.U.V.A. Add-on *************************************** This time around the categories will be different. Not only are the categories themselves changed, but the entry rules for one of them has been altered. The first category is the "beginner" category. The purpose of it is to allow for those who have not done very much with the CS, aside from perhaps world building, to feel comfortable participating in the invitational. As such, entry in this category is limited to: -- only those who have publicly released no more than two mods -- and those who did not submit an entry in the previous invitational. A submission this category should have a building designed to accommodate those adventurers who need to stop and rest every once in a while. It ought to be populated with at least a bar-keep of some sort; although any number of NPC's is just fine. Quest's are not necessary, but sure would increase the appeal of such a mod. Any other additions to the basic "tavern" concept are welcome! *************************************** The second category is all about finding (or creating!) and utilizing community resources. H.E.L.L.U.V.A. stands for Hugely Expanded Leveled Lists Ultimate Version Addition. The purpose of this project was to provide a simple and seamless way to add new content to the game without causing conflicts. Sandman101 has released the Merchant Containers resource, which greatly simplifies everything. All that is needed to add things to merchants all over Vvardenfell is to drop your objects into the leveled lists, and then for the player to use a list merger. This category is very wide open, anything that can be added to an item list can be submitted. In the spirit of H.E.L.L.U.V.A. Bountiful Books, H.E.L.L.U.V.A. Wicked Weapons, and H.E.L.L.U.V.A. Awesome Armor, add anything you can find or make! Collect retextured cups and make H.E.L.L.U.V.A. Classy Cups; maybe dig through all of the thousands of cheat mods, collecting all of the rings with some sort of cheat effect and make H.E.L.L.U.V.A. Rancid Rings. Unlimited possibilities! H.E.L.L.U.V.A. Merchant Containers can be found here. You'll need this. The download also contains a tutorial written by Sandman101 that will teach you how to prepare your H.E.L.L.U.V.A. Incredible Invitational Submission. Some of the things we will look for in the H.E.L.L.U.V.A. category are things like balance (the price and benefit of the item versus the spawn rate,) a good name that keeps with the convention Sandman101 has used (not important really, but it's always a nice touch,) and creative use of resources. Another large aspect of this is acquiring the necessary permissions to use the resources. Those that are publicly available as resources are of course acceptable. Anything else you use though, should have permission given. So any submission in this category should have included all proper credits, and all permissions given. *************************************** There will be a "Best of Category" award given for each of these. Additionally awards will be given for several sub-categories: [*]Technical Proficiency (no clipping, dialogue loops, broken scripts, etc.) [*]Most Innovative Design [*]Best Story [*]Best Overall Character [*]Most Creative Use of Modder's Resources [*]Most Creative Use of Only Stock Resources [*]and more! The judges and I reserve the right to add any further categories as the collection of mods dictates. *************************************** Team mods are allowed, as long as all members of the team fit the eligibility guidelines. Obviously publicly available modder's resources are permissible. This isn't to say that mods not using these resources won't be judged fairly. There is definitely a lot of skill that can be used to make use of stock resources! *************************************** Please do not submit anything that you do not want publicly released. I intend to release all submissions when the winners are announced. *************************************** There will be a submission form at GHF on the main menu. If you wish to be included as a judge, please contact me. We are all excited for this event, and look forward to the outstanding collection of mods that are sure to be entered! Mod away!
  10. Hello! I am Fliggerty, Arch-Magister of Great House Fliggerty and now the Morrowind Scripting Scholar here at TES Alliance. It's a pleasure to be here, and I look forward to sharing the odds and ends of scripting that I have picked up over the years. I've been playing Morrowind since shortly after release, and started modding shortly after Bloodmoon. My first release was Vvardefell Druglord, at which time I also got actively involved in the community. I am an avid supporter of all things Morrowind, I work to preserve interest in Morrowind modding however I can. As such, I am pleased to be among the ranks of the scholars here! Thank you!
×
×
  • Create New...