Here you can view your subscribed threads, work with private messages and edit your profile and preferences Registration is free! Calendar Find other members Frequently Asked Questions Search Home

FORUM MENU

 

FORUM STATS

YOUR STATS

ONLINE USERS

 

EDGE NETWORK

 
GameReaction Forums : Powered by vBulletin version 2.0.1 GameReaction Forums > Hosted Site Forums > Team UC > Team UC's Coder's Corner > Custom InfoLink Portraits
  Last Thread   Next Thread
Author
Thread    Post New Thread    Post A Reply
dgale
Junior Member

Registered: Mar 2001
Location: Ice City
Posts: 11

Post Custom InfoLink Portraits

I would like any feedback the more experienced coders have about this. I'm more used to procedural programming, so I've probably made some simple OOP mistakes . . .

An InfoLink portrait is the little picture of the person that appears when recieving an InfoLink. To use your own pictures, do the following:

1) Create your new portaits. I'm not much of a graphics person, so if I'm off base here, let me know. Deus Ex info link portraits are all 8 bit (256 color) and 64x64. The originals (at least in Photoshop) have their "Mode" set to "Indexed Color". Once you have created your picture, save it as a .pcx file, making sure the settings are as described above. When naming the pcx, make the filename match the bindName you will be using in ConEdit for DataLink conversations with this person.

2) Create texture file. This I did with Deus Ex Editor. Open the editor. Set the Browser Bar to "Textures". Load the texture "InfoPortraits". Hopefully those faces look familiar http://www.deus-ex.org/ubb/smile.gif. Now it's time for you to make your own texture file. First, export any of the portraits you plan to use for your game. When exporting, put them in the same directory as your custom portaits.

Now click "Import" Browse to where your portraits are. To make things easier, you can select all the portraits and have them import together. For each portrait that you've selected, you will get a little "Import Texture" box. You shouldn't need to change the Name field, especially on the old textures. Your new textures should have the same name as their file, which should be the same as the bindName you will use when making your level. You can keep group as "None". Package you should change to something like "MyInfoPortraits". Under properties, make sure all boxes are unchecked. Click "OK". You'll get the box for each portrait. This is your chance to verify that the name is correct.

Once they are done importing, the Browser Bar should have your new texture file loaded, with each of your portraits. If everything looks good, click the "Save" button. I was unable to get my custom portraits to work unless I saved them in the same directory as the other Deus Ex textures. If someone knows a way around this, I would certainly appreciate hearing it.

Now that you have your own info portraits texture file, you should be able to easily add and remove portraits as needed.

3) Subclass HUDInfoLinkDisplay. Folling the International OOP Tutorial Conventions, we'll call it MyHUDInfoLinkDisplay http://www.deus-ex.org/ubb/smile.gif. From HUDInfoLinkDisplay copy this:

#exec OBJ LOAD FILE=InfoPortraits

but of course make "InfoPortraits" "MyInfoPortraits"

Next copy the function SetSpeaker().

The one thing you must do is change this line:

portraitStringName = "InfoPortraits." $ Left(bindName, 16);

Again, make "InfoPortraits" "MyInfoPortraits"

If you are not using Paul Denton or Bob Page in any infolinks, then you can chuck most of the code (meaning the two if structures). You may be doing your own dynamic portrait switching, in which case the existing code can give you clues how to accomplish it.

4) OK, we have our new portraits, but we'll need names to match them. To do this, subclass DataLinkPlay to MyDataLinkPlay. At minimum, all we need to do is copy and paste the default properties section. Using the existing infoLinkNames array as a guide, enter in your own bindName and matching displayNames. The order doesn't really matter. If you aren't using exactly 17 people, feel free to redeclare var S_InfoLinkNames infoLinkNames[17] to match your total.

Also, while you are here, you may want to change the default properties that control the display speed of infolinks. This is especially helpful if you aren't using mp3s.

5) Subclass DeusExHUD. We'll call it MyGameHUD. You want to copy the entire CreateInfoLinkWindow function. DO NOT change the return value in the function declaration. You need only change the following line:

infolink = HUDInfoLinkDisplay(NewChild(Class'HUDInfoLinkDispl
ay'));

To:

infolink = HUDInfoLinkDisplay(NewChild(Class'MyHUDInfoLinkDis
play'));


6) Subclass JCDentonMale. If you are already using your own Player Class, you're already done with this step! Everyone else needs to create MyPlayerClass as a subclass of JCDentonMale. You should also download the UC Mod Loader and follow it's instructions for ensuring your custom Player Class is loaded.

7) Inside your new Player Class, you'll need this function:

function Possess()
{

local DeusExRootWindow root;

Super.Possess();

root = DeusExRootWindow(rootWindow);

root.hud.Destroy();
root.hud = DeusexHUD(root.NewChild(Class'MyGameHUD'));

root.hud.UpdateSettings(Self);
root.hud.SetWindowAlignments(HALIGN_Full,VALIGN_Full, 0, 0);

}


Also, you'll need to copy and paste the StartDataLinkTransmission function from DeusExPlayer.uc Look for the following line:

datalinkPlay = Spawn(class'DataLinkPlay')

and change it to:

datalinkPlay = Spawn(class'MyDataLinkPlay')


And that should pretty much do it. After this, you should be able to use DataLinkTriggers just as before. In ConEdit when making DataLink conversations, you can use bindNames that match any of you new (or old) portraits.


[This message has been edited by dgale (edited 03-31-2001).]

Report this post to a moderator | IP: Logged

dgale is offline Old Post 03-31-2001 09:09 PM
Click Here to See the Profile for dgale Click here to Send dgale a Private Message Visit dgale's homepage! Find more posts by dgale Add dgale to your buddy list Edit/Delete Message Reply w/Quote
Steve Tack
Chataholics

Registered: Sep 2000
Location: Arvada, CO, USA
Posts: 295

Post

Sounds about right to me. It kind of sucks that you need a separate texture package just for that though.

I wonder why they needed to do an explicit "OBJ LOAD FILE" like that.

Report this post to a moderator | IP: Logged

Steve Tack is online now Old Post 04-01-2001 08:10 PM
Click Here to See the Profile for Steve Tack Click here to Send Steve Tack a Private Message Visit Steve Tack's homepage! Find more posts by Steve Tack Add Steve Tack to your buddy list Edit/Delete Message Reply w/Quote
All times are GMT. The time now is 04:18 AM.    Post New Thread    Post A Reply
Last Thread   Next Thread
[ Show a Printable Version | Email This Page to Someone! | Receive updates to this thread ]

Forum Jump:
Rate This Thread:

Forum Rules:
You may post new threads
You may post replies
You may post attachments
You may edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
Admin Options:

< Contact Us - GameReaction Forums >

Get vBulletin Today!

Powered by: vBulletin Version 2.0.1
Copyright 2000, 2001, Jelsoft Enterprises Limited.
Copyright 2001 Edge Network. All Rights Reserved.