Choose Your Language

Tuesday 19 August 2008

The Campaign Editor & Other Things

I have been quite busy over the last few days ... doing a lot of things and feeling as though I am getting nowhere fast. In all fairness though, I have probably been going through another learning curve and fighting with scripts quite a bit. Some of you may know about these discoveries I made already, but as they were new to me, I thought I would share them just in case they help others.

Campaign Editor

First, I took a closer look at the Campaign Editor. I have been into it before, but this time I took a closer look and found a couple of useful points:

1) KeepJournalSynchedToLeader: This solved my problem when companions joining after a journal entry was given, were missing entries. It also solved entries that companions would sometimes ignore for no apparent reason.

2) PlayersCanAttackNeutrals: I was overjoyed when I discovered this one. One of the let downs for me when I first saw NWN2 was the players inability to attack anybody at any time by right clicking and choosing attack. It was something that was always allowed in NWN1, but for NWN2, you need this switch. I now have it on, and a player can now attack whoever they like, with the added advantage of another switch UsesPersonalReputations set to FALSE stopping the factions getting too out of control.

I would still like to know what PartyCreation does, and so if anybody knows, please leave me a comment. Thanks.

Factions

I have also been spending time looking at how factions react with each other. I had written a script to take care of combat between some factions, but discovering the Campaign Editor switch (mentioned above) took care of my requirements and meant one less script to worry about. I still need to work on a script that handles alignment changing when someone kills for evil reasons, but that is almost completed now. Suffice to say, I have a number of groups set up now that react as they should do, in that they help each other out in combat if they are friendly to one another.

The one major thing to remember about factions, however, is that factions appear to affect NPC's and that it is reputation with these factions that affects the PCs. Bear this in mind when reading about the new functions below.

Death Issue

One of my main problems today was related to an old set of scripts that I thought were fine until I checked them again today. Some of the options I had were not quite as I liked them. The player will have an option they can turn on or off for each character that will help govern how death is handled in each case. Then there is also a difference if the player is controlling a companion or the main PC, as well as taking into account if the game is multi-player or single-player. I believe I finally have all the options working as they should now, although I had to rewrite a script that altered the stack of an item because it would disappear from the inventory when the stack quantity was altered. This appears to be a NWN2 bug and not my coding, as debug code confirmed the items were still being carried, but simply did not show any icon!

PC Options

I finally worked out how to make an icon draggable this week as well. I have a "feat"that every player gets when they join the game. However, I wanted this feat icon to be able to be dragged to the quickslots if they wanted to. It turned out that I needed to set the TOOLSCATEGORIES to 2 within the feat.2da for the feat. This is worth remembering if I make any more feats.

New Functions

I have also spent quite some time trying to understand more functions. Here is a list of some I have looked at closer, with an explanation of what I think they do:

1) ChangeFaction: Use this to make an NPC change to a faction of another NPC.
2) ChangeToStandardFaction: Use this to make an NPC change to one of the standard factions.
3) GetStandardFactionReputation: Use this to see how a standard faction feels about an object (PC or another NPC).
4) SetStandardFactionReputation: Use this to alter how a standard faction feels about an object (PC or another NPC).

5) AdjustReputation: Use this to adjust how a whole faction feels towards an object (PC or NPC).
6) ClearPersonalReputation: Use this to clear a reputation between two objects (PC or NPC).
7) GetReputation: Used to determine how object A feels about object B.

8) SetClockOnForPlayer: Turns on a clock for the player. I also found there was a way to show only the time (and not the date), which was useful because the names of the months do not match the names in my campaign. Requires UpdateClockForAllPlayers in module heartbeat.
9) SetNoticeText: I think this one allows text messages to be shown in a cutscene conversation, which the normal text message functions cannot do. (Untested.)
10) MakeConversable: Ensures a PC is put in a state where a conversation will work.

I also learned more about how alignment functions work and revised the roster functions, which can get exceedingly complicated when trying to work around the death system I have in place.

So, as you can see, I have been quite busy with refreshing my knowledge of the toolset. Much of what I have looked at should help me start to work with it more effectively. I never got my intro cutscene written yet, but I did work on the Life Essence drop script, which is why I needed to look into alignment changing scripts, which led to the faction work. As you can see (and probably know if a fellow builder), one thing led to another. Hopefully now though, I am in a position to get back to the cutscene and give that a go. I learned a few more things about the conversation editor as well, which may help me in that department too.

4 comments:

dgraf said...

Lance - great work - this really helps beginners such as myself. One of the great disappointment when first taking on the toolset, is having to search through all the forums, tutorials, trying to find what you need. When you first start you don't even share the language, so often folks misunderstand when you post a question. Unavoidable, but discouraging all the same. So a bog thank-you for sharing this. I am planning a sequel utilizing "campaign" and this info is invaluable!

Lance Botelle (Bard of Althéa) said...

Hi Dgraf,

Thanks for your kind words. :)

Like you, I also feel I am only really a beginner at this ort of thing, even though I may have been "at it" for a number of years.

Maybe we can discover some things together. :)

If you find anything I write innacurate, do let me know as well.

Lance.

Wyrin said...

never noticed PartyCreation before - quick guess is it came in 1.13 patch and is related to the option in the upcoming expansion SoZ to allow players to create all the members of a party - but could be wrong

SetNoticeText displays the yellow test across the middle of the screen - in and out of cutscenes. Used in journal updates, but useful for more visual displays of metagame info too. But yes, this will display a notice in cutscenes where the message window is not visible.

It's true there's some handy things in the campaigneditor that make it compelling to use even if you are just producing one module file

Lance Botelle (Bard of Althéa) said...

Hi Wyrin,

PartyCreation ... I did wonder, as I had not noticed it before either. Just thought it was me, but it may have come with the patch.

SetNoticeText ... Good to hear. Culd be useful then. :)

Campaign Editor ... Yes, my first use of it was just to get to grips with the map system.

Lance.