lfnetwork.com mark read register faq members calendar

01-02-2007, 05:06 PM   #2
stoffe
@stoffe
Mostly dormant

Join Date: Apr 2002
Posts: 5,848

Quote:
 Originally Posted by PrimusPilus Let's take Yusanis Shield as a reference: It has deflect Energy, Electrical 100pts as it's abilities. Now according to your table, the damageflags should be set at 4224 assuming 'Blaster' refers to 'Energy.' The damageflags for Yusanis Shield in the forceshileds.2da, however, is 6208. This has me a bit confused....
I've noticed that the "Lightside" and "Electrical" damage types have switched value between KotOR1 and TSL for some odd reason. The table I posted was for TSL, so if it's for KotOR use 64 for Electrical and 128 for Lightside. Also, in KotOR1 all the standard shields are set to block Ion damage (though the shield takes double damage from it), while this isn't the case for TSL.

Edit - R2-X2 says: "damage types weren't actually switched between the 2 games, and electrical is 128 in K1 just as it is in K2 (and light side 64), the energy shields in K1 simply have a wrong bitflag set, and do not block electrical damage at all."

As for 6208 as damage type, this means for KotOR1 the shield blocks Blaster/Energy (0x1000), Ion (0x0800) and Electrical (0x0040) damage. If you want to see what damage types are set for a shield you can do the math backwards, even though there is an easier way (see below). It's easier to see what you are doing if you convert the values to hexadecimal though, since we are dealing with a bit-field. So the KotOR1 table would be:
Code:
Damage type             Constant value  (in hex)    (in Binary)
----------------------- --------------  --------    --------------
Bludgeoning             1               0x0001      0000000000001
Piercing                2               0x0002      0000000000010
Slashing                4               0x0004      0000000000100
Universal (all)         8               0x0008      0000000001000
Unstoppable (disruptor) 16              0x0010      0000000010000
Cold                    32              0x0020      0000000100000
Electrical              64              0x0040      0000001000000
Light side              128             0x0080      0000010000000
Fire                    256             0x0100      0000100000000
Dark side               512             0x0200      0001000000000
Sonic                   1024            0x0400      0010000000000
Ion                     2048            0x0800      0100000000000
Blaster                 4096            0x1000      1000000000000
Now, 6208 in hexadecimal notation is 0x1840. Check against the table above. We have 0x1000, which is for Blaster/Energy damage, 0x0800 which is for Ion damage, 0x0040 which is for Electrical damage. 0x1000 + 0x0800 + 0x0040 = 0x1840 = 6208.

If you look at the values in binary notation instead it makes even more sense through. Check the table above, now instead of seeing one number, see each digit as a flag/position that can either be turned on (1) or turned off (0). Each position represents a particular type of damage. Essentially you set the position reserved for each damage type to on (1) to make the shield protect against it. The 1 in the table above shows the position representing each type of damage. (Imagine a number of checkboxes lined up next to one another.)

For example, always counting from the right towards the left, position number 7 determines if the shield blocks electrical damage. It is set to 1 to "turn it on", and so the digit there is 1. Cold damage is position number 6, but Yusanis shield does not block Cold, so that position has the value 0. And so on.

So, 6208 is 1100001000000 in binary notation. Here we see that flags number 7 (electrical), 12 (Ion) and 13 (Blaster/Energy) are turned on. Thus Yusani's Shield blocks Energy, Ion and Electrical damage.

You can use the Calculator that comes with Windows to convert numbers between different notation if you set it to Advanced/Scientific mode in the menu.

Quote:
 Originally Posted by PrimusPilus Also, Yusanis Shield also has an expiry when Max damage is taken OR when the seconds expire. Does the example script you posted cover that? You wrote "...Change the green number to the duration, in seconds, that the shield will last (unless it will expire by blocking it's maximum amount of damage before then)."
An EffectForceShield() effect automatically expires whenever the specified amount of damage has been blocked by it. Like with most other effects, you can also apply it with a duration, after which the effect expires if it has not already done so on its own, or been removed by a script by then.

Thus, Yusanis shield will expire either when 100 damage has been blocked, a script calls the ClearAllEffects() function on the character, or when 220 seconds of time has passed, whichever happens first.

You can also apply the shield effect without a duration, by changing the first parameter to the ApplyEffectToObject() function from DURATION_TYPE_TEMPORARY to DURATION_TYPE_PERMANENT and then not specifying any duration number. The shield would then stay on the character either until the specified damage has been blocked, or a script clears effects from the character.

Quote:
 Originally Posted by PrimusPilus Edit: One other note, the script that you wrote is at the bottom of the k_sup_bands.nss file. Would I be able to just add it there by starting with the 'else if(nIindex == Row Label from Spells.2da)' command instead of of creating a brand new script file?
You should be able to, but I see no reason why you would want to do that. As a rule of thumb you should strive for modifying existing standard game files as little as possible when doing mods. If you can create a new script to handle what your mods needs to be done this makes it a lot easier to make several different mods play nice together.

(Sometimes it's unavoidable to modify the standard scripts, like if you modify the creature AI or random loot system, but whenever you can "outsource" your new mod-related stuff to its own uniquely named files it's preferable, in my opinion.)

mt
01-03-2007, 12:20 PM   #3
stoffe
@stoffe
Mostly dormant

Join Date: Apr 2002
Posts: 5,848

Quote:
 Originally Posted by PrimusPilus 3. Using Kotor Tool, added a new line by copy and paste to effecticon.2da and changed the row label, label, and iconresref, saved to override. There was no cloumn for me to change the 'namestrref' like you said in your description, the column just wasn't there.
The namestrref column was added to effecticon.2da in KotOR2:TSL (since it shows a text description of the effect instead of an icon like KotOR1), and does not exist for KotOR1.

Quote:
 Originally Posted by PrimusPilus 7. Using Kotor Tool, tried to modify the .uti by using the Activate Item property, however, the Subtype will not show up. SO, it looks to me like all the changes are made but I cannot get the Activate Item Property/Subtype to access the new subtype I just created.
In KotorTool, check in the Tools Menu --> Options --> Other that the "Look in game's override folder for 2DA files" is checked. If it's not, check it and restart KotorTool and it should recognize your changes.

If it still doesn't work you can open the UTI file with a GFF Editor and change the subtype value in the PropertiesList --> # --> Subtype field for your property.

(Also don't forget to compile the script. The game does not use NSS source code files for anything, only NCS bytecode files.)
01-03-2007, 01:49 PM   #4
stoffe
@stoffe
Mostly dormant

Join Date: Apr 2002
Posts: 5,848

Quote:
 Originally Posted by PrimusPilus The effect Icon isn't showing up. I have made the change in effecticon.2da to the .tga icon in my override. Is their another specific Icon that the game uses for the Effect Icon? I just pointed it to the Icon that displays in the inventory screen. Here's the script:
The KotOR games are usually pretty picky when it comes to image dimensions. I'd recommend that you open another of the effect icons (listed in the effecticon.2da file) and check what dimensions, resolution, TXI and alpha-channel setup that icon has, and make your own icon accordingly. Unless my memory completely fails me the inventory icons are larger than the effect icons displayed on the character record.

Also make sure the name of your icon is a valid ResRef (max 16 characters not counting the file type extension, alphanumerical characters and underscore only).
 01-03-2007, 02:19 PM #5 ChAiNz.2da @ChAiNz.2da Leave Everything to Me!     Join Date: Oct 2004 Location: Tennessee (USA) Posts: 6,850 what are you naming your icon? it must be (safer to) in the ii_frarmbands_xxx format with the xxx being your variation number, defined in your .uti file. If your variation number is only 2 digits.. put a '0' before it. eg. 2 = 002 / 16 = 016 Also, i can't remember, but try saving it in both 24bit & 32bit. One or the other works.. but I can't remember which is required for icons. Or if you can, simply choose another game icon that would be similar to yours rather than making an entirely new icon. Just make sure to change those number values. "Eagles May Soar, But Weasels Don't Get Sucked Into Jet Engines" | Mods (FF) (DS) | Folding | SWK.com | FB: (LF) (Me) | Steam | The Herd | you may: quote & reply,
01-03-2007, 03:37 PM   #6
stoffe
@stoffe
Mostly dormant

Join Date: Apr 2002
Posts: 5,848

Quote:
 Originally Posted by PrimusPilus So, I double-checked and counted and it does match. The effecticon.2da line numbers run concurrently up to line 59, then it switches to line 61, the three(3) 63's so it looks like this 59 61 63 63 63 I added my line number after the last 63 and labelled it 64.
The line number is the actual counted number, from he top (line 0) down, increasing the count with 1 for each line. It does not have the match the number in the (Row Label) column. KotorTool's 2DA editor does (unfortunately) not display the line number. But you must refer to your new line by line number, not Row Label, in the script.

Often the row label is set to the same as the line number, but in some files this is messed up, and this is one of them. Thus, if you have no other mods adding lines to effecticon.2da, your new line would have line number 62. Thus you would use the number 62 in your impact script.

(The Row Label numbering skips over 56, 58, 60.)

mt
01-03-2007, 03:50 PM   #7
stoffe
@stoffe
Mostly dormant

Join Date: Apr 2002
Posts: 5,848

Quote:
 Originally Posted by PrimusPilus Just out of curiosity, how did you come up with 62? My thinking was 59 = 59, 61 = 60, 63 = 61, the second 63 = 62 and the third 63 = 63, thus making the next line 64.
The Row Label numbering in effecticon.2da for KotOR1 skips over the numbers 56, 58, 60. Just count the lines manually to be sure (or export the 2DA to text and use a text editor with line numbering to make it easier to check ).

In short, don't blindly trust the Row Label values in 2DA files that are indexed by row number, there is no guarantee that the sequence is unbroken, since the game doesn't actually use those numbers for anything. (Though it's worth keeping in mind that there are a few 2DA files which are indexed by Row Label instead of line number, just to confuse matters further.)
 LucasForums > Creating a new energy shield

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home -------------------- Network     Star Wars Gamer     Knights of the Old Republic     XWingAlliance.net     Mixnmojo.com     Monkey Island Discussion     Brutal Legend Discussion     Grim Fandango Discussion     Psychonauts Discussion at Razputin's Domain     Sam And Max.Net     The Dig Museum     Full Throttle Discussion     IndyJones.net     Fracture     Forum Help & Feedback Center     LucasForums Archive         LEGO Star Wars series         Star Wars         Star Wars: Battlefront series         Star Wars: Classic Gaming         Star Wars: Empire At War         Star Wars: The Force Unleashed series         Star Wars: Galaxies         Star Wars: Jedi Knight series         Star Wars: The Old Republic         Star Wars: Republic Commando         Star Wars: Rogue Squadron series