Choose Your Language

Tuesday 26 August 2008

New Era Mechanics - New GUI

The new era for the campaign comes with some new "house rules", which I hope will add a depth to the game, over and above the norm. Accessing these rules, options or basic information was originally planned to be via a conversation menu. However, as I have been getting to grips with coding GUIs more and more, I decided to create a GUI with tabs to give the player a more user-friendly interface to set options for their PC's. Then, I got a little excited about a concept I considered of being able to change this information (live) if the player swapped between their main PC and companions. That was when I introduced myself to a massive coding headache! However, the good news is, after a couple of days of coding, I believe I have the GUI working as I originally hoped.

Here is a screenshot of the first (opening) tab of the GUI. Note, there are two other tabs along the top of the GUI. The first tab (shown) shows the PC's basic information, the second tab gives access to "House Rules" information, and the third tab is the area that allows a player to have their PC with the highest Craft Weapon skill make an improvement to a dead weapon. As you can see, there is potentially room for more tabs if I need them.

The problem where I had coding, was mostly to do with the information available in the first (opening) tab that shows the current PC's Vigour Level, Life Essence Respawn State and Current Test switch. My idea was that a player could open the GUI with one PC, and then switch PCs with the GUI still open and the information would change for the new PC. Keeping track of the Main PC and the companions that were activating or viewing the script was a nightmare, but after many attempts, and debugging, I finally achieved it.


One thing I did learn in the process, is that the GetFirstName function appears to return the first name of the original blueprint used to create a companion and not the new name given it in the toolset. This had me confused for quite a while, and I ended up changing all my uses of GetFirstName to simply GetName.

UPDATE: Loudent2 (Thanks!) helped me to understand that the GetFirstName function actually recalls the original string ref and gave this information in a response in this post:

"Actually, the problem is probably that the string ref name is still set. While this may seem like a benign problem (certain functions returning the str ref name) it's actually more serious than that. I've had items in our world spontaneous reset to the original name and the dm client will also list it by it's original name.

Fortunately it's easy to change, you just have to remember to do it whenever you create an object based of an existing blueprint.To clear, go to the blue print and in localized name (for items and placeables, first and last names for creatures etc) and click the down arrow at the right edge of the field (bringing up the naming dialog).

There will be one line with a pair of edit boxes listing language and gender. Below that will be a line that reads:String Ref: If a number follows that text then click on the "Edit String Ref" button below that line, then in the "Edit String Ref" dialog, click the "clear" button on the right side of the first line and then click "ok"This sounds a lot more complicated than it really is. Anyway, that should solve your issues."

Anyway, here is a brief outline of some of the section of this GUI that the player will use in the game. First, it is accessed by a icon that can be placed in the quickslots. When presented, the initial screen tells the player the date, the current PC's vigour level (combined hunger and tiredness system), the PC's role (either Channeler or Harvester - not shown on the screenshot). From the top screen, the player can also decide if they are going to allow carried Life Essences to allow an auto-respawn upon an untimely death or not. (Don't forget that a death means death in this campaign.) A player might chose to not allow an auto-respawn if they have a PC who can raise them from the dead in some way and they wanted to save the Life Essences.

The second tab brings up the House Rules section, where the player can recall rules for the game as required. New rules will be added to the list as the player explores the world, so they can always have a place to refer to them in game.

The current third and final tab brings up a screen that allows a player to have their PC with the highest Craft Weapon skill (and who must also be in a fit state) improve the quality of the weapon they carry in their right hand at the cost of a Life Essence.

I won't say any more at this stage, but hopefully, you can see how the many unique gaming systems I have been working on for the campaign have now come together in one neat user interface. And with that now done, I can start working in some of the other ideas I have that also work around these systems.

It was interesting to see the new Storm of Zehir video at Gamespot and it looks like Obsidian have also programmed a few of the things along the lines that I have tried to do for my own campaign. They also now have "death means death" and have also made it so individual PC's can have an input (with their own skill usage) in things like conversations in much the same I too am programming a "best PC skill use" in many of my own interactions. One thing that I do like the look of (and is something I will wait until I have seen the expansion) is the new 3d map system. I imagine it is possible to do this with clever use of an area with miniaturised objects, but to have it "officially" available as an editor would be great, and hopefully, easier to use.

6 comments:

Anonymous said...

I like the look of this. Anything that can streamline PC troubles--what's my skill again?, what about my house?--is a good thing.

Also, GUIs are an untapped section of creativity overall. Yours has a professional look, which is certainly something to praise.

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

Hi Chaos Wielder,

I have always enjoyed adding a few of the 'optional' rules or a few 'house rules' to give my campaign a slightly different feel and play to the norm.

Just to clarify though, when I say 'house rules', I don't mean rules to do with an accomodation (house) that a PC may have in a world like some DM's do, but a rule that is specific (house rule) to a campaign. :)

As far as the looks, I decided to try to keep the GUI as simple as possible. I think it could be good to add a few images and fancy bordering, but I prefer to spend time on coding practical aspects rather than the looks of it. ;) But, like you say, I think it looks good enough for what it has to do. :)

Lance.

Frank Perez said...

I have a few questions regarding how players access this GUI that you're showing here. The icon that can be placed in one of the quickslots -- where will this icon come from? Is it something that can be accessed when the player clicks the right mouse button? Can the GUI be mapped to a hotkey? If so, how?

It would be cool if there is an easy way for players to access custom GUIs like what you have here at any time.

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

Hi Frank,

The answers to your questions are yes and yes. :)

And this is the reason why I made it the way I did, because I too liked the idea of being able to access GUIs from a quickslot button. :)

Basically, I added a feat that is automatically added to the player when they join. Activating the feat (which can be dragged to a quick slot) brings up the GUI.

The feat can be activated any time the way I have it set. :)

Lance.

Frank Perez said...

Clever solution. Thanks for sharing. :)

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

Hi Frank,

No problem. :)

It was the same method as I used in my module called "Soul Shaker". Only with NWN2, I used a GUI instead on a conversation box.

Lance.