March 16, 2011

The Magic of GUI...

Their mysteries are now revealed to me... and I like what I see. Up until recently I was pretty clueless about GUI's in NWN2, sure I could fiddle with (Oooo Errr!) existing ones and move things around and change only minor aspects but now ive finally understood how to work the meat and potatoes (Oooo Errrr!) of them... ie Variables and their ilk along with GUI to module and vice versa events.

All I can say is the possibilities are endless really. And first up in my adventures is a Custom Polymorph Spell GUI... talk about jumping in head first. After finding out that the Polymorph forms no longer have abilities tied to them I got rather annoyed. "Why Obsidian why!" I cried, "Why F me around with all those neat Polymorph based spells ive been adding to my Mod!". After getting angry I eventually got around to thinking... how can I fix this. Well with a few GUIs that is...

So far its working a treat, Ive got it so that the Caster of Polymorph gets a pop up GUI with a collection of portraits of the various forms they can take after they cast the spell. This GUI is modal and pauses the game until they make a decision on form. I tried to go fancy and spent most of today bug fixing all sorts of problems but I learned alot from, it and now its running great. The Caster then selects the form they want and the game unpauses, the GUI closes and they pop into the form they choose.

Now the neat thing about this is, is its independent of the radial spells in the Spells.2da meaning I can have dozens or more forms to choose from rather than the old maximum of 5 only. Also with some jiggery pokery (Oooo Errr!) ive got a 'mostly' working abilities GUI that is linked to the primary hotbar. This Abilities GUI reads what the polymorph forms SPELL1 SPELL2 and SPELL3 entries are in Polymorph.2da, stores them for the spells duration on the Polymorphed target and updates these 3 special buttons on the main Hotbar dependent on which Polymorphed character is being controlled by the Player at that time. They reference the correct spells and allow for targeting when clicked on, they even reference the Spell Icon correctly. My only issue with them at the moment is getting them to update dependent on the character under control, ie are they polymorphed and what are the polymorphed into... currently they dont change from the initial forms abilities of the Player and they persist after polymorph has ended, but ive worked out how to make it work properly but leaving it to the end until ive finished the main stuff.

To top it off ive also found out I can do a simple few lines in my GUI to disable forms based on the target or the Casters HD as per the PnP rules. This means adding new forms is easy and only requires a cut and paste and couple of edited words and numbers.

All in all as I go along I find what I could make growing and growing... wonder what ill be able to do once I figure out Listboxs, Grids, data dumps, radials menus and those sorts of things...

Oh and my old custom Party bar GUI is still there, and its changed somewhat, and with what I know now I can make it even better. Unless its got alot of hardcoded stuff in it... hmmm.

2 comments:

  1. GUI = <3 Come on, man, 4 months without posting!

    ___
    call New Zealand

    ReplyDelete
  2. Heh sorry about that... yeah 4 months is now hmmm almost 2 years... Ive been rather busy (you mean lazy dont you?, shhh subconscious!) and havent been able to get this damn blog off the ground. Although im now working on it again and hopefully can get some damn NWN2 stuff going along with this blog.

    ReplyDelete