Sign in to follow this  
DarthParametric

[WIP] Lobot-style Cyborg Player Head

Recommended Posts

Some further procrastination, avoiding having to deal with skinning the Nautolans. I was rooting through one of my cargo holds in SWTOR the other day and came across a Cyborg Construct AM-7 headgear. I decided to take a crack at something similar, but for the front half I went with something more in line with the Borg Construct Aj^6 that Lobot wears in The Empire Strikes Back.

 

 

DP_Lobot_Style_Cyborg_Head_WIP_01_TH.jpg

 

The base head is Gadon Thek. His head model is in both K1 and TSL. Other than lopping off his ears and removing the eyebrow ring, he's untouched, so I can just skin wrap him to the original and save myself some grief.

Share this post


Link to post
Share on other sites

Amazing! Your modeling skills are top notch as always. Do you plan only to give Gadon this shiny toy or some other NPCs as well - as its kinda reminds me of the Cyborg race..

Share this post


Link to post
Share on other sites

It will be a player head (edited thread title to clarify). I used Gadon's model as the base as it is one of the few bald heads present in both games (another is Uthar Wynn). There's also Master Dorak's head, which has a hairline modelled in but would probably work ok with this as that area should be covered. I think one of the bald PMB heads is also shared between games.

Share this post


Link to post
Share on other sites

I decided to try out the Master Dorak head mesh to see how that looked, as I preferred the shape of the nose.

 

DP_Lobot_Style_Cyborg_Head_WIP_02_TH.jpg DP_Lobot_Style_Cyborg_Head_WIP_03_TH.jpg

DP_Lobot_Style_Cyborg_Head_WIP_04_TH.jpg DP_Lobot_Style_Cyborg_Head_WIP_05_TH.jpg

DP_Lobot_Style_Cyborg_Head_WIP_06_TH.jpg DP_Lobot_Style_Cyborg_Head_WIP_07_TH.jpg

 

I did want to put an animated texture on it so it would have flashing lights, etc., but the game didn't like me trying to only use one corner of the texture, and you can't use two different textures on a player head. I don't want to make the overall texture tiny just to accomdate animations, so that idea might be out. I was wondering if it might be a better idea just to put in a couple of bald heads, then have the headpiece as a seaparate mask item. It would be prefereable to have it auto-equipped as starting equipment, but is that even possible? And if so I assume it would affect all characters, not just that specific head choice?

Share this post


Link to post
Share on other sites

It appears TSLPatcher can substitute 2DA memory tokens before compiling scripts, so if anyone wants to write a suitable script that will equip an item on a player at the start of the game, go right ahead.

 

Leaving aside the actual writing of the script, how do you get it to fire at the start of the game?

 

Edit: Looking around at various script examples, I tried to cobble together something. What do the resident script gurus think of this?

 

Edit 2: OK, testing in TSL I can get the script to fire and to give the item to the PC and have it equip during the kolto tank scene on Peragus. Doesn't add/equip on PCs using a different appearance.2da row. Here's the script attached to 101awake.dlg:

void main()
{
    object oPC = GetFirstPC();
		
    if(GetAppearanceType(oPC) == #2DAMEMORY2#)
    {
        object oDPCyborg2 = CreateItemOnObject("a_helmet_179", oPC, 1, 1);
		
        AssignCommand(oPC, ActionEquipItem(oDPCyborg2, INVENTORY_SLOT_HEAD, TRUE));
    }
    else if(GetAppearanceType(oPC) == #2DAMEMORY3#)
    {
        object oDPCyborg2 = CreateItemOnObject("a_helmet_179", oPC, 1, 1);
		
        AssignCommand(oPC, ActionEquipItem(oDPCyborg2, INVENTORY_SLOT_HEAD, TRUE));
    }
    else if(GetAppearanceType(oPC) == #2DAMEMORY4#)
    {
        object oDPCyborg2 = CreateItemOnObject("a_helmet_179", oPC, 1, 1);
		
        AssignCommand(oPC, ActionEquipItem(oDPCyborg2, INVENTORY_SLOT_HEAD, TRUE));
    }
    else
    {
    }
}
However, I'm not having any luck getting it to equip on the PC in the medbay during the tutorial. This is the script attached to intro.dlg:

void main()
{
    object oPC = GetFirstPC();
    object oExile = GetObjectByTag("MEDBAY_PC");
		
    if(GetAppearanceType(oPC) == #2DAMEMORY2#)
    {
        object oDPCyborg1 = CreateItemOnObject("a_helmet_179", oExile);
	
        AssignCommand(oExile, ActionEquipItem(oDPCyborg1, INVENTORY_SLOT_HEAD, TRUE));
    }
    else if(GetAppearanceType(oPC) == #2DAMEMORY3#)
    {
        object oDPCyborg1 = CreateItemOnObject("a_helmet_179", oExile);
	
        AssignCommand(oExile, ActionEquipItem(oDPCyborg1, INVENTORY_SLOT_HEAD, TRUE));
    }
    else if(GetAppearanceType(oPC) == #2DAMEMORY4#)
    {
        object oDPCyborg1 = CreateItemOnObject("a_helmet_179", oExile);
	
        AssignCommand(oExile, ActionEquipItem(oDPCyborg1, INVENTORY_SLOT_HEAD, TRUE));
    }
    else
    {
    }
}
Is it to do with the GetFirstPC(); and the tutorial having T3 as the player?

 

Here is a test of the animated lights:

 

Share this post


Link to post
Share on other sites

So I figured out part of my problem with not being able to equip the headgear to unconcious PC in the tutorial, in that it's actually a UTC of a female with a disguise applied to it by the OnEnter script, set to whatever the appearance ID of the player is. I figured I could just delete that one altogether and spawn in my own creature without a disguise that would have the headgear equipped, but again I have hit a roadblock. I can delete the original dummy player and spawn in my own, but it won't show the headgear regardless of being equipped in the UTC or even if I try to force it via the script.

 

It's also being stubborn with positioning. If I try and use the hook that the original uses, "InvisibleLocationMarker", my guy ends too far up the bed, so his head and upper torso clip through the wall. If I try and use a manual position, it seems to ignore height and won't raise him off the ground. Here's the script I have so far (using a manual position):

void main()
{
	object oPC = GetFirstPC();
	object oOrigDummy = GetObjectByTag("MEDBAY_PC");
	vector vLobotVec = Vector (43.0, 36.0, 1.5);
	location lLobot = Location(vLobotVec, 270.0);
	
    if(GetAppearanceType(oOrigDummy) == #2DAMEMORY2#)
    {
        DestroyObject(GetObjectByTag("MEDBAY_PC"));
        object oC_MedbayLobot = GetObjectByTag("DP_Medbay_Dummy", 0);
        if ((!GetIsObjectValid(oC_MedbayLobot))) {
			 oC_MedbayLobot = CreateObject(1, "DP_MedbayLobot", lLobot);
			 AssignCommand(oC_MedbayLobot, ActionPlayAnimation(30, 1.0, (-1.0)));
			}
        object oDPCyborg1 = CreateItemOnObject("a_helmet_179", oC_MedbayLobot, 1, 1);
        AssignCommand(oC_MedbayLobot, ActionEquipItem(oDPCyborg1, INVENTORY_SLOT_HEAD, TRUE));
    }
    else if(GetAppearanceType(oOrigDummy) == #2DAMEMORY3#)
    {
        DestroyObject(GetObjectByTag("MEDBAY_PC"));
        object oC_MedbayLobot = GetObjectByTag("DP_Medbay_Dummy", 0);
        if ((!GetIsObjectValid(oC_MedbayLobot))) {
			 oC_MedbayLobot = CreateObject(1, "DP_MedbayLobot", lLobot);
			 AssignCommand(oC_MedbayLobot, ActionPlayAnimation(30, 1.0, (-1.0)));
			}
        object oDPCyborg1 = CreateItemOnObject("a_helmet_179", oC_MedbayLobot, 1, 1);
        AssignCommand(oC_MedbayLobot, ActionEquipItem(oDPCyborg1, INVENTORY_SLOT_HEAD, TRUE));
    }
    else if(GetAppearanceType(oOrigDummy) == #2DAMEMORY4#)
    {
        DestroyObject(GetObjectByTag("MEDBAY_PC"));
        object oC_MedbayLobot = GetObjectByTag("DP_Medbay_Dummy", 0);
        if ((!GetIsObjectValid(oC_MedbayLobot))) {
			 oC_MedbayLobot = CreateObject(1, "DP_MedbayLobot", lLobot);
			 AssignCommand(oC_MedbayLobot, ActionPlayAnimation(30, 1.0, (-1.0)));
			}
        object oDPCyborg1 = CreateItemOnObject("a_helmet_179", oC_MedbayLobot, 1, 1);
        AssignCommand(oC_MedbayLobot, ActionEquipItem(oDPCyborg1, INVENTORY_SLOT_HEAD, TRUE));
    }
    else
    {
        string cmMessage = "FAILED OR NOT DETECTED";
        SendMessageToPC(oPC, cmMessage);
    }
}
Edit: OK, solved the first issue of the headgear not equiping on the new creature. I forgot it was restricted to the PC only. Whoops. Removing that property allows it to show up, so that was an easy fix. Still stuck with the positioning issue though:

 

Creature_Spawn_Woes_01_TH.jpg Creature_Spawn_Woes_02_TH.jpg

Creature_Spawn_Woes_03_TH.jpg Creature_Spawn_Woes_04_TH.jpg

Share this post


Link to post
Share on other sites

Maybe you could get the exact position from the dummy before destroying it and then spawn your new dummy in that position.

 

If that doesn't work I have no idea what to do. The only reason I can think of that's causing your issues would be that the dummy model and the model you use have different origin coordinates in their model, resulting in their different placement when spawned at the same place.

 

Also, as a sidenote, you could probably make your scripts shorter by using this:

if(GetAppearanceType(oPC) == #2DAMEMORY2# || GetAppearanceType(oPC) == #2DAMEMORY3# || GetAppearanceType(oPC) == #2DAMEMORY4#)

And I really like the animated texture, it looks great :)

Share this post


Link to post
Share on other sites

Yeah I tried grabbing the position of the MEDBAY_PC dummy, but it's the same position as the invisible marker (which makes sense). The original dummy UTC is set to one of the Asian female player appearances and then the script applies a disguise using whatever appearance the player chose. I can't see any reason why my UTC should be different. All character models should have their origin at the feet, notionally. I also tried switching the UTC to other appearances, like Vrook, Atton, etc., and it still does the same thing.

 

If I could get the script to print that position to the log, perhaps I could then try manually specifing it again with a slightly offset value.

 

Thanks for the tip on shortening the script. I have no clue about scripting, so had to cobble these together by looking at the originals and taking relevant bits and pieces from various script advice posts at LucasForums over the last decade.

Share this post


Link to post
Share on other sites

Printing the position to the log should be possible and is most likely very easy, but sadly I don't know how to do it :/

 

Oh, and about that script part I showed you: The || is a logical "or". I probably should have explained that^^ And I know how you feel about the scripts, I'm doing the same right now and it's so hard to find some stuff...

Share this post


Link to post
Share on other sites

I had a peek at the source for the WhereAmI armband and used some of that to print out the position:

    object oOrigDummy = GetObjectByTag("MEDBAY_PC", 0);
    vector MedPCPos = GetPosition(oOrigDummy);
    string X_Coordinate = FloatToString(MedPCPos.x, 5, 5);
    string Y_Coordinate = FloatToString(MedPCPos.y, 5, 5);
    string Z_Coordinate = FloatToString(MedPCPos.z, 5, 5);
    string DummyPos ="> " +  X_Coordinate + "> " + Y_Coordinate + "> " + Z_Coordinate;
Then just used

SendMessageToPC(oPC, DummyPos)
I already knew from my various experiments that the orientation was 270°, so didn't bother getting that as well.

 

Unfortunately, that didn't really help. Altering the position even a little just ends up forcing him onto the floor beside the bed again.

Share this post


Link to post
Share on other sites

If you can decompile the script where it sets the disguise to the dummy character in the medbay, you could probably edit it to spawn the headgear to the character there. I think.

 

And another note, I don't think that the

 

else
{
}
piece of code in the end of the script is required. The one that's empty, you know. If the "if" doesn't match, it simply does nothing, right?

Share this post


Link to post
Share on other sites

A disguise overrides any equipped items. Like using the sandpeople disguise in K1. That's why I decided to try replacing it altogether.

 

I'm wondering now if a better idea might be to make my own dummy full body appearance and force the original to use that as a disguise. Probably quicker to knock that together than continuing to beat my head against this.

Share this post


Link to post
Share on other sites

It's an interesting idea, and I'm loathe to dissuade someone who is quite clearly a gifted character modeler, however, the built in head band is likely going to not play nice with existing head gear that the player can wear. Unless you are going to set the model up so that those particular nodes aren't there so head gear won't show up. That's your choice, however, I prefer to see things like gear and weapons I have selected, appear in-game via my character.

 

Have you thought about perhaps releasing the head model as a replacer for an existing one, and the head band, as a new item that players can equip in-game like any other head gear item?

 

FYI: It's relatively simple to add a script that will have the head band added to a container in one of the nearby rooms.

Share this post


Link to post
Share on other sites

It's already a helmet/mask item. That was the only way to use a separate texture for it. It's already scripted to be equipped while in the kolto tank on Peragus, so the game proper is fine. It's just getting the appearance in the prologue/tutorial to work properly that is a pain in the ass.

Share this post


Link to post
Share on other sites

A disguise overrides any equipped items. Like using the sandpeople disguise in K1. That's why I decided to try replacing it altogether.

Interesting, I didn't know that. Thanks for the info.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this