Saturday, 23 January 2010

Neverwinter Nights 2 Custom Store GUI

I've create a Custom store GUI for the persistence world Neversummer 5. The main reason for creating it, is so items can and their costs can be pulled from a database. First step is to make it look like the stock Neverwinter Nights 2 stores. Later on we can improve on them.

One of the things I've been having trouble with, is the dragging of an item from a players inventory to the store window to sell the item. Well with the hope of people in #nwn2cr I've finally got this working. I though I'd post about it as this kind of information is very hard to find.

My main mistake was trying to retrieve the event of a item been dropped on store GUI. This is actually done from the inventory screen.

Their are two events that were confusing me. OnMouseDrop and OnMouseDropReceived. So in a drag operation between two dialogs (in my case the inventory and the store) their is a source and destination of the drag operation. The source will fire the event OnMouseDrop, and the destination will fire OnMouseDropReceived.

I've not been able to figure out how to capture the dragged object details using OnMouseDropReceived, but OnMouseDrop works very well. I used the two following calls to capture the objects ID and send to to the store sell script:

OnMouseDrop0=UIObject_Misc_ExtractData("self:","objectid",0,local:3) OnMouseDrop1=UIObject_Misc_ExecuteServerScript("gui_store_sell",local:3)

Their is another bit of magic that was also need. The above will fire for any event, so you need to know that the item is been dragged to the store. I added the following calls to the store window:

OnMouseEnter=UIObject_Misc_ExecuteServerScript("gui_store_mouse","ENTER")
OnMouseLeave=UIObject_Misc_ExecuteServerScript("gui_store_mouse","LEAVE")

The script gui_store_mouse sets a variable on the player when the mouse pointer enters the store window and deletes it when the mouse pointer leaves. Now the gui_store_sell script can check the variable before selling the item.

I was hoping to use a combination of OnMouseDrop on the inventory dialog and OnMouseDropReceived on the store dialog, but it seems that OnMouseDropReceived is fired before OnMouseDrop.

Hope this helps another scripter/modder :-)

Thursday, 21 January 2010

Neversummer Blog's

This is mostly a test blog entry to see if I can get it to appear on the new neversummer blog planet I'm setting up. The idea is developers can blog about the various projects they are working on within neversummer.

Tuesday, 12 January 2010

Dell Studio 1535, FGLRX and RandR 1.2

I've had a little time to play around with the new RandR 1.2 support in ATI/AMD fglrx graphics drivers and I'm liking what I see. Make the laptop run with dual external monitors or the in-built panel is now really easy. It's a massive improvement over the ati-config approach I was using before.

Here are the commands I used to make the my Dell Studio 1535 run with dual external monitors:

xrandr --output LCD --off
xrandr --output CRT1 --right-of DFP_EXTTMDS --auto --output DFP_EXTTMDS --auto


These commands will now make it run with the laptop panel:

xrandr --output CRT1 --off
xrandr --output LCD --auto --output CRT1 --off --output DFP_EXTTMDS --off

Now I just need a nice way of attaching these commands to the screen setup button on the laptop :-)

Wednesday, 6 January 2010

ATI Drivers get Xrandr 1.2

I've just upgraded my laptop to OpenSUSE 11.2 and whislt I was at it, I pulled in the latest ati fglrx driver and wireless drivers. For some reason the display driver put up a bit of a fight, I think the problem was left over of older versions of the driver.

Once I'd removed the old ones, the new driver installed and work without a problem. The laptop panel came up with my desktop. I took my laptop to the study and plugged into into the two external monitors (LCD and a CRT). Now things started to not work again. It would only use the built in panel. So i tried to use the "aticonfig" tool to fix the issues and I got a error message about aticonfig not working when randr 1.2 was active!!

This is great news, it means we now have proper randr in the ATI comerical drivers (if I've not made a mistake and load the free drivers :-) ). So I can now configure the mointor setup using standard randr tools. Also Xrandr is much easier to work with than aticonfig. I suspect it should be possible to write a script and attach it to the monitor key on the laptop.

I'll post again when I've had time to play with this a little more

Sunday, 8 November 2009

OpenSuSE 11.2, KDE 4.3 on dell vostro 1520

I while ago, my mum's laptop died. It was a old Acer laptop (for quite a while I had one of these too). This laptop had been running OpenSuSE for quite a while and mum had been very happy with the KDE desktop. The main reason for installing Linux, was that Windows XP had become unusable. A clean install of XP is nice had fast and responsive, however if you then install all the service packs and updates, the system becomes unusable! Recently the hardware had started to fail, first the battery, then the wireless...... So it was time for a new laptop.

After much looking around we got a Dell Vostro 1520 laptop. Now people who have seen my previous posts will know I'm a big fan of the dell laptops. The are built very well and have good hardware at a decent price. The part of the dell website that lets you customize the computer you are buying is fantastic. It means when I spec out laptops for people, it could be tailored differently for the person that will use it. We did look at other makes, but they were either to expensive (Sony, apple...) , a brand I've not heard of, or don't meet the required specs.

I decided to install OpenSuSE 11.2 RC2 as the the time of installing it, their were about 5 days till it's released. I have to say, once again OpenSuSE has made some big step forwards in areas that I care about. With a install using just the packages off the DVD, it was great and pretty much ready to use. However I add a few of the repositories amongst them are Mozilla, Packman and the latest stable KDE repos.

So in the previous release the things I had issues with were broken kde4 wireless application and no way to rip music to mp3 from a CD (k3b was not setup to do this). Both of these seem to have been sorted. Setting up the wireless was a joy. It was very easy. Ripping music from CD to mp3 is still a bit clunky. I would like music to be ripped to the hard disc automatically when a CD is put into the drive. However I get prompted if I would like to extract the audio with K3b or listen to the music with other apps. This works well, k3b was able to extract the audio. Slightly confusing for mum as she did not understand the term Ripping. Maybe these buttons should be called "Extract Audio" in the same way the dialog that prompts be for what to do with the inserted disc.

Their is one other thing I really like in the latest OpenSuSE is the KDE intergration with firefox. This is really awesome. I would like to see this go a bit further. For example use kget as the download manager. At the moment I use flexget to send stuff to kget, but that's a bit clunky. I'd also like passwords to be stored in the KDE wallet. I'm now also wondering if the FireFox hacks could be applied to all GTK apps? I use Eclipse at work and it's very annoying to me that it does not fit with my desktop.

All the hardware in the laptop is working great. Probably the first time that I've installed on a dell laptop and had all hardware working without tweaking. That might be down to the bleeding edge version of OpenSuSE though :-) The only thing that need a bit of tweaking were the special media buttons (play, next, prev, etc....). The just needed to be assigned to the amaork. Would be nice if this was done by default in KDE (though it does depend which media app you use). The volume controls were already assigned to the mixer app, so that was nice.

Monday, 26 October 2009

Ubuntu Karmic Koala (9.10)

I mentioned in a previous post that a friend had installed ubunt 9.04 on his new dell studio 1555 laptop and that their were no real problems. Well it seems after a bit of time a few problems did show up. The 64-bit kernel (2.6.28) in ubuntu 9.04 had some problems with suspend.

So he installed Ubuntu 9.10 (kernel 2.6.31) and that fixed all the problems with suppend. He has to ad 'noapic' to the kernel line in grub/menu.lst because to get some the special laptop keys working. Their is a bug on it, so maybe it will be fixed in the next few months. Their is also no need to add entries into the modprobe.conf anymore to get the sound working.

So it looks like next release of Ubuntu (9.10) will be a good one for dell studio laptops.

Sunday, 25 October 2009

Released PodCaster version 1.0

Just made a release (1.0) of PodCaster. This is the fist time I've removed the beta status from the project. The release is mostly a bug fix release as it's been though quite a bit of testing and bug fixing.

Due to this been a bug fix release, the features are pretty much unchanged:
  • Capture Internet radio to audio files.
  • Create MP3, WAV and MP4 files.
  • Encodes metadata and cover art into the media files.
  • Create pod cast from captured radio stations.
  • Supports real audio and Microsoft ASF format.
Please goto here to find out more details and download the release.