Jump to content

Home

[WIP] Real Mandalorians


Commas

Recommended Posts

Originally posted by Commas

(snip)

can any one verify whether the above line is writen correctly, and if its not help me figure out how to write it correctly?

 

No, not quite. Just add the function call to the currently existing condition that checks if it's Kelborn. Then use OBJECT_SELF since it will be Kelborn who runs the script if that condition triggers. Like this:

void ST_FixMandalorianHelmet();

void main() {
   // ST: Check if it's a Mandalorian appearance type creature running this.
   if ((GetAppearanceType(OBJECT_SELF) == 35)  
       || (GetAppearanceType(OBJECT_SELF) == 351)
       || (GetAppearanceType(OBJECT_SELF) == 352))
   {
       ST_FixMandalorianHelmet();
   }

   // ST: Do the standard AI heartbeat...
   ExecuteScript("k_ai_master", OBJECT_SELF, 1001);
}

void ST_FixMandalorianHelmet() {
   int    nType   = GetAppearanceType(OBJECT_SELF);
   object oHelm   = GetItemInSlot(INVENTORY_SLOT_HEAD);
   string sTag    = GetTag(oHelm);
   string sResRef = "";

   // ST: It's a blue-armored Mandalorian
   if ((nType == 35) && (!GetIsObjectValid(oHelm) || (sTag != "BlueHelmTag")))  {
       sResRef = "BlueHelmetResref";
   }
   // ST: It's Kelborn...
   else if ((GetTag(OBJECT_SELF) == "npc_kelborn") && (!GetIsObjectValid(oHelm) || (sTag != "KelbornHelmTag"))) {
       sResRef = "KelbornHelmetResref";
       ChangeObjectAppearance(OBJECT_SELF, 671);
   }   
   // ST: It's a non-Kelborn red-armored Mandalorian   
   else if ((nType == 351) && (!GetIsObjectValid(oHelm) || (sTag != "RedHelmTag")))  {
       sResRef = "RedHelmetResref";
   }       
   // ST: It's a yellow-armored Mandalorian
   else if ((nType == 352) && (!GetIsObjectValid(oHelm) || (sTag != "YellowHelmTag")))  {
       sResRef = "YellowHelmetResref";
   }       

   // ST: Proper helmet not equipped, spawn and equip one.
   if (sResRef != "") {
       oHelm = CreateItemOnObject(sResRef, OBJECT_SELF, 1, TRUE);
       ActionEquipItem(oHelm, INVENTORY_SLOT_HEAD, TRUE);

   }
}

 

That should compile. At least it does so here. :)

 

Originally posted by Commas

edit: a quick question about the above script as well, is this meant to be inserted directly into the existing heartbeat script, or done by naming it as the heartbeat script and using ExecuteScript to run the real heartbeat script?

 

The above script is a complete heartbeat script that doesn't need to run any other script. Save it as k_def_heartbt01.nss, compile it and put the resulting k_def_heartbt01.ncs file into the override folder. Then it will replace the default heartbeat script that all the Mandalorians have assigned.

Link to comment
Share on other sites

  • Replies 118
  • Created
  • Last Reply
  • 2 weeks later...

i just wanted to let everyone know that i haven't stoped work on this mod yet, and to proove it here is a sneak peek at

 

Mandalore's New Helmet

 

right now only the visor is shiny as i haven't added the alpha channel to the rest of the texture yet, and the shade of silver doesn't quite match the armor yet, but thats why this is still a WIP :D

Link to comment
Share on other sites

well, i've made one last armor texture, this time a special suit for kelborn that will match his unique helmet much better than his old red suit:

 

Kelborn's New Threads

 

its not completely done yet, but that will give you an idea of the color scheme

 

Ach, I would download that alone in a heartbeat. Kelborn always needed an individual look about him, and you've succeeded in that aspect to a full.

Link to comment
Share on other sites

^^^^ i'm glad you like it. i desinged his helmet, but the red armor just didn't match, so as a result he gets a whole new look. i've actually updated the texture just a tad since i posted that. all those white stripes are now red strips. i'd post a new pic to show you, but i'd rather wait until i finish his new helmet and just show the whole thing all at once.

Link to comment
Share on other sites

Hi, I have a question regarding your patcher and scripts. For my Mandalorian mod I'm changing Kelborn's appearance to a new line in appearance.2da, which your patcher is adding.

 

For me his new line is 671, because i started with a virgin appearance.2da, and that is the line that the new heartbeat script you wrote for me references. But if someone already has an appearance.2da with new lines added to it then the script will point to the wrong line.

 

Is there anyway to make the script dynamically update to match the new line that is getting added to by the patcher? (snip)

 

(I respond here rather than in PM since max PM length is hopelessly low for this kind of thing. I hope you don't mind.)

 

There is a way, though it's a lot less user-friendly than what configuring the rest of the patcher is. I'm using it to update some of the impact scripts in the Force Power mod I made with correct 2DA index numbers. It's a very crude way, but gets the job done in the absence a better solution. :)

 

Since it has a high potential mess-up factor if you aren't careful with it, it is not configurable with ChangeEdit. You'll need to open the changes.ini file in Notepad and add it in manually. It's a little complicated, but I'll do my best to explain:

 

It works by modifying a numeric value at a specified offset in a file, overwriting the value there with a 4 byte integer of your choice. (The scripting language use 4 byte integers to represent whole numbers).

 

To use it, you'll need a hex editor. There should be a link to some in one of the tutorial forums I believe. I'm using UltraEdit, but any hex-editor should do.

 

Compile your modified heartbeat script, and open the resulting NCS file in the hex-editor. Search, in hex, not in ASCII, for the value you want to replace, 671 in your case. You'll need to convert what you look for to a hexadecimal number first, you can use the Windows calculator in Advanced mode for this. 671 in hex is 0000029F, which is what you would search for.

 

Make sure you pad it out to the full 4 byte (ie 8 character in a hex editor) length with leading zeroes as necessary, since the windows calculator would only have said 29F in this example.

 

Search for this value, and make VERY certain you only find a number of matches equal to the number of times that number is present in your script.

 

If you get more matches, open your NSS script and change the value to something else, doesn't matter what as long as its unique since the patcher will replace it anyway. I'm using 999 and 9999 as dummy values in my mod. Recompile the script, then search for the new value. Repeat as necessary until you only find the places where your value is stored in the compiled script.

 

When you find a match, write down the in-file offset where the number begins. Any hex-editor worth the name should be able to display the offset of where you place the cursor.

 

When you have found the offsets for where in the NCS file each of the numbers are stored, open your changes.ini file in Notepad. Look near the top, and between the [GFFList] and [installList] sections, add a new section named [HACKList]. In this section, add the name of the script that should be modified. Should look something like:

 

[GFFList]

[HACKList]
File0=k_def_heartbt01.ncs

[installList]

 

Then scroll down to the end of the changes.ini file, and add a new section named [k_def_heartbt01.ncs]. Under this section, set the Keys to the offset of each number you found in the hex-editor, and the value to the number that should be substituted at that location. For example, if you found the numbers at offset 1200 and 1400, and the number you need is stored in 2DAMEMORY1, it would look like:

 

[k_def_heartbt01.ncs]
1200=2DAMEMORY1
1400=2DAMEMORY1

 

Make sure you specify the offsets in decimal values, not hexadecimal, if your hex-editor displays the offset as that. Use the windows calculator to convert as necessary.

 

Finally, make sure you remove the k_def_heartbt01.ncs file from the Install list of files, since the HACK modifier will copy it to override before modifying it already.

 

One thing to keep in mind about the HACKList is that, since it's so crude, the patcher won't let it modify files that already exist with that name in the Override folder, since there is no way it would know if the offsets specified is still relevant in another copy of the file. If the file already exists in override, the installer will skip it. If you want the patcher to replace the file if it already exists in override with a new copy that will then be modified, you can add a key named ReplaceFile and set it to 1 at the top of the hack-modifier, like:

 

[k_def_heartbt01.ncs]
ReplaceFile=1
1200=2DAMEMORY1
1400=2DAMEMORY1

 

Be careful with that though, since it might break the mod that the script in override belonged to, if present.

 

This is probably a rather confusing description, so feel free to ask if you need anything clarified.

Link to comment
Share on other sites

thanks, i'll give that a try. i do have a quick question about the 2DAMEMORY tokens. in your example you made them both 2DAMEMORY1, do they have to be 2DAMEMORY1, because i've already used this token for the new head. also, will this hack follow the rule where the patcher does everything in order? i'm assuming it does. and also you made both the sample offsets set to 2DAMEMORY1. if i make them 2DAMEMORY2 do they both need to be 2DAMEMORY2 or do i continue to number them in order?

 

also, as you know from the pm i sent you, i can't get the k_def_heartbt01.nss to compile. here is the full heartbeat script. it was giving me a "Syntax error at 'else'" on line 40 which is the entry for Mandalore. i'm also getting "Unexpected end of file"

 

void ST_FixMandalorianHelmet();

void main() {
   // ST: Check if it's a Mandalorian appearance type creature running this.
   if ((GetAppearanceType(OBJECT_SELF) == 35)  
       || (GetAppearanceType(OBJECT_SELF) == 351)
       || (GetAppearanceType(OBJECT_SELF) == 352))
   {
       ST_FixMandalorianHelmet();
   }

   // ST: Do the standard AI heartbeat...
   ExecuteScript("k_ai_master", OBJECT_SELF, 1001);
}

void ST_FixMandalorianHelmet() {
   int    nType   = GetAppearanceType(OBJECT_SELF);
   object oHelm   = GetItemInSlot(INVENTORY_SLOT_HEAD);
   string sTag    = GetTag(oHelm);
   string sResRef = "";

   // ST: It's a blue-armored Mandalorian
   if ((nType == 35) && (!GetIsObjectValid(oHelm) || (sTag != "bluehelm")))  {
       sResRef = "bluehelm";
   }
   // ST: It's Kelborn...
   else if ((GetTag(OBJECT_SELF) == "npc_kelborn") && (!GetIsObjectValid(oHelm) || (sTag != "kelhelm"))) {
       sResRef = "kelhelm";
       ChangeObjectAppearance(OBJECT_SELF, 671);
   }   
   // ST: It's a non-Kelborn red-armored Mandalorian   
   else if ((nType == 351) && (!GetIsObjectValid(oHelm) || (sTag != "redhelm")))  {
       sResRef = "redhelm";
   }       
   // ST: It's a yellow-armored Mandalorian
   else if ((nType == 352) && (!GetIsObjectValid(oHelm) || (sTag != "yellowhelm")))  {
       sResRef = "yellowhelm";

   //For Mandalore
   else if ((nType == 462) && (!GetIsObjectValid(oHelm) || (sTag != "mandhelm"))) {
sResRef = "mandhelm";
   }       

   // ST: Proper helmet not equipped, spawn and equip one.
   if (sResRef != "") {
       oHelm = CreateItemOnObject(sResRef, OBJECT_SELF, 1, TRUE);
       ActionEquipItem(oHelm, INVENTORY_SLOT_HEAD, TRUE);

   }
}

 

i also tried doing it like this:

 

(snip)
   // ST: For Mandalore...
   else if ((GetTag(OBJECT_SELF) == "g_mandalore") && (!GetIsObjectValid(oHelm) || (sTag != "mandhelm"))) {
       sResRef = "mandhelm";
(snip)

 

which also didn't work.

 

thanks for your help :D

Link to comment
Share on other sites

thanks, i'll give that a try. i do have a quick question about the 2DAMEMORY tokens. in your example you made them both 2DAMEMORY1, do they have to be 2DAMEMORY1, because i've already used this token for the new head. also, will this hack follow the rule where the patcher does everything in order? i'm assuming it does. and also you made both the sample offsets set to 2DAMEMORY1. if i make them 2DAMEMORY2 do they both need to be 2DAMEMORY2 or do i continue to number them in order?

 

That was just an example. 2DAMEMORY1 in my example was the memory token that contained the line in appearance.2da that your newly added line has... Use the memory slot you store the RowIndex or RowLabel in after you add your new line.

 

You assign the value to the offset that you want inserted at that offset in the file.

 

If you use this hack function to update the NCS script, make sure that you make a test install (see the TSLPatcher thread for how to make a fake install location) and open the patched/installed NCS file with the hex-editor and check that the value has been inserted in the proper place.

 

It's important that you use the correct offsets, since if you use wrong offsets you will break the script. Remember that it will insert 4 bytes at the offset, so make sure the offset you get include any leading zeroes so the correct 4 bytes will be overwritten. Each group of 2 characters in the hex view in a hex editor represent a byte.

 

As for the order things are done.... TLK-file --> 2DA files --> GFF Files --> File Hacks --> (Unmodified) Install files.

 

 

also, as you know from the pm i sent you, i can't get the k_def_heartbt01.nss to compile. here is the full heartbeat script. it was giving me a "Syntax error at 'else'" on line 40 which is the entry for Mandalore. i'm also getting "Unexpected end of file"

 

You are missing a } closing bracket at line 38... just above the "For Mandalore" comment line.

Link to comment
Share on other sites

thanks stoffe, its always the little things that elude me. :doh:

 

something weird is happening tho. after i got it to compile i went to the mandalorian camp to test it an make sure it worked right, and only half of the mandalorians were wearing helmets. npc mandalore was also not wearing a helmet, i have no idea how to explain it. i haven't tried the hack you were talking about yet, becuase i wanted to test the script first so if there were any problems i would know it wasn't from hacking it. i can send you the files if you want to see what i mean.

 

also, does anyone out there have a save on dxun before taking the shuttle to onderon, perhaps one where you just arrived on dxun? i've been using the warp code to get there cause i dont have any saves, so my character's level is very low so i can't complete any of the mandalorian quests without dying so i can't get to iziz to test the other script, plus the plot is all broken up from warping, so if anyone has a save i can use, PM me or post in this thread, thanks!

Link to comment
Share on other sites

  • 3 weeks later...

Yup, we're bringing it to a close. But you have to remember, we both have lives, which take away a lot of time for us. I barely have time to post here anymore, yet I still try to. If you really want an update, I'll give you my part, but please, don't do it again. :)

 

The models need some stitching issues fixed up, as is they're causing the textures to warp. It's completely fixable, I've had this issue with several models before. I just haven't had the time, or, if I have, I'm just too tired. I've got other mods I want to get a start on, but I just haven't got the time. After I fix the stitching, I just need to make some test models, and fix up the positioning on the head, as it's a little too low and forward from what Commas has told me. Commas I believe is finishing up the skins (Which look great.), the info for stoffe's patcher, and trying to fix the script to actually equip the Mandalorians with the helmets. I think he's also having difficulty getting Kelborn to wear a custom suit, but I'm not sure. If you'd like to help us speed up the process, send Commas a game save just after landing on Dxun for the first time. He's using the warp code at the moment, and he thinks that may be bugging the script. It's a lead anyway.

 

And thanks for the compliment BTW Kenobi. :) Yes Comma's avatar is Kelborn's helmet ingame. Looks like he got the gunmetal shader to work nicely too. :) CM_Baremetal was bad for the helmet. :p He even disguised the texture warping with the angle of that shot. :thumbsup:

Link to comment
Share on other sites

  • 3 weeks later...

Ok, dust blowing time. The texture warping has been fixed, with a bit of annoyance, bit an easily solvable problem all the same, so, here are a few shots of the awesome textures Commas has created. They're somewhat bright due to the shader applied to the texture, so they'll be a bit darker ingame. With the models fixed and the textures in Commas' hands, I feel I can safely say that my part of this mod is now done, unless Commas sends me a quick question or two over AIM.

 

Mandalore.gif

 

Kelborn.gif

 

Red.gif

 

Yellow.gif

 

Blue.gif

 

I know, the green outline Photobucket is putting around my resized .GIFs is just dead sexy. Try to look past it at the update itself.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...