Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Custom Icons & The Big White Blocks

Page: 1 of 1
 HouseOfAmon
08-25-2006, 2:20 PM
#1
Alright, my latest mod needs a custom icon, maybe two, not quite sure how the game deals with them..

Anyways, I already have the icon for this, one will go in the items screen, and the other goes in the armband slot, its the same icon for both places..

I already tried putting these in game, but it didnt work right... I edited the .2da's, made new entries, everything works fine but the custom icons..

Do I need to resize it for the armband slot?? Whats with the big white block?

The item screen icon should have worked, because I used an item screen icon from a different item.. So why did I get a white block instead..

Does anyone have any clues here, because this is all I need before I release my next mod..

Which I think you might like, or not, its kind of a novelty more than anything usefull, but its cool none the less.. :)
 Darth333
08-25-2006, 2:28 PM
#2
Check the "custom icon part" in this tutorial: http://www.lucasforums.com/showthread.php?t=130898) :)

Make sure you save your .tga at 32 bit with alpha channel.
 Mav
08-25-2006, 2:31 PM
#3
To get an icon to work you don't need to edit any .2das.... you just need to make sure the icon is named right. Lets say, as an example that your custom item is a lightsaber and that it has a model variation number of 87, well if that is the case, your icon need to be named, iw_lghtsbr_087, the only way a .2da effects an icon is because of the edited items, baseitem, but thats going into way too much detail, that you shouldn't need to deal with.

Edit: check out the tut DTrips posted, and as a general guidline, most icons are generally 64 x 64 pixels.
 HouseOfAmon
08-25-2006, 2:45 PM
#4
Edit..
 Mav
08-25-2006, 3:00 PM
#5
first of all, what type of item are you making? just a standard lightsaber? and unless your item needs a new line in baseitems.2da, it's safer that you don't edit it at all...
 HouseOfAmon
08-26-2006, 2:22 AM
#6
I have released the mod in question, it still is a work in progress, I would expect at least one more version to work out the bugs..

Anyways, its up on kotor files.. Its called "Lightsaber On/Off Switch v1.0".

So if anyone still wants to help me get this icon working for v1.1, I would appreciate it, go give it a whirl, maybe look into the icon situation.. That way you can see first hand what I need rather than me trying to explain it...

Also sorry about all the edits earlier, but I was getting pretty mad towards the end, as the icon bug was frustrating me, and my post were rated M for mature hehe... So I edited them before I could get into trouble.. :) Would be silly to get banned for cussing out an icon.. lol. ;)

Peace..
 Mav
08-26-2006, 11:56 AM
#7
provide a link to your mod, and I'll see what I can do
 Darth Dragoon
08-26-2006, 12:32 PM
#8
i had the same problem but it was with t3-m4's portrait, its a white portraits!
 HouseOfAmon
08-26-2006, 12:59 PM
#9
 Mav
08-26-2006, 8:00 PM
#10
i had the same problem but it was with t3-m4's portrait, its a white portraits!

your portrait problem probably lies with the fact that for portraits to work, portraits.2da needs to be edited.

@HouseOfAmon - I'll look into your icon issue when I have the time, hopefully tonight

Edit: I haven't installed your mod yet, but judging from the baseitems.2da file and the .uti file, your icon should work as long as it's named: ii_FrArmBnds_008.tga, but the game already has an icon named that so it should already show up, so I'll look into it more later.
 Joff1981
08-26-2006, 8:37 PM
#11
Your problem is that you're using base item 51 as your base, which doesn't have a link to an icon in it's line. If you change the itemclass column for this line to something other than **** for example i_saber then use ii_saber_008.tpc as your texture filename it will work.
I don't know what the added lines to the baseitems.2da are for but if they're not used you should probably get rid of them.

PS. Thanks mav for helping me work out which column to edit, I was trying defaulticon and wondering why it didn't work :)
 Mav
08-26-2006, 8:59 PM
#12
I believe the .uti is only using the base item of 51 as a "placeholder", because the mod uses TSLpatcher, so the patcher program should change the baseitem of the .uti to match whatever line the patcher assigns to the "real" baseitem. So although the .uti says it is baseitem number 51, the patcher program should change the .uti to the correct baseitem line, upon installation.
 Joff1981
08-26-2006, 9:38 PM
#13
It might be trying to do that but that isn't what is actually happening. Currently after installation the baseitem stays at 51. I think that he needs more assistance in correctly using TSLPatcher because at the moment each line that is added is being added twice as well as the problem of the UTI not pointing where it should for the baseitem.
 Mav
08-26-2006, 9:48 PM
#14
ahhh, ok, I hadn't installed it yet, I just assumed it installed right.
 HouseOfAmon
08-27-2006, 5:16 AM
#15
Thanks for helping me Maverick, the whole no icon thing is sucking.. I actually had done more stuff than what you see, you just have the best working version.. I didnt think it wise to release a broken version.. ;)

BTW, I wanted to use w_lghtsbr_006 as the icon.. It's the lightsaber icon, without the glow effect..
 stoffe
08-27-2006, 6:54 AM
#16
[SaberSwitch.uti]
!ReplaceFile=1
PropertiesList\0\Subtype=2DAMEMORY1
BaseItem=BP_Item1


The above line in changes.ini contains a mistake which would prevent the BaseItem field from being altered in the SaberSwitch.uti file. You assign "BP_Item1", which is a string constant, to the BaseItem field, but that field expects an integer value; the line number in baseitems.2da more specifically. Since there is a data type mismatch the Patcher will skip changing the field since it can't store a string in a field that holds numbers.

In order to reference a new line added to baseitems.2da you will need to store the line number of that row in a 2DAMEMORY token and assign it to the BaseItem field instead.



name=996699
label=BP_Item1
equipableslots=0x00180
modeltype=0
itemclass=I_FrArmBnds
(...snip...)
[b]2DAMEMORY1=RowLabel


You almost do this assignment here already, though you are using 2DAMEMORY1 to store both the Row Label of the new globalcat.2da line, baseitems.2da line and the spells.2da line in the same token, making the earlier values become replaced with the spells number (since it's processed last of the three). Use a different token for each to store both values (and skip storing the row label of globalcat.2da since you aren't using it for anything anyway as far as I can see).

I'd also recommend assigning RowIndex instead of RowLabel, since (unless I am mistaken) both those 2DA files are accessed by line number and not row label. While the line number and row label usually match it's best not to rely on it since some earlier version of KotorTool had the habit of modifying the row labels of 2DA files it opened to start at 1 and count up, regardless of the previous values of the row labels.

You are also setting the name cell above in baseitems.2da to a non-existing dialog.tlk StrRef (996699). It's probably best to set it to the default null value **** instead if you aren't going to add a new name for your base item (which isn't used by the game anyway as far as I am aware, but is rather intended for the toolset.)
 HouseOfAmon
08-27-2006, 7:34 AM
#17
@Stoffe

Alright, this got the icon to show up, it still didnt use what I wanted yet, but I think I can get that much, this is still probably wrong, but it works better..

Now, what about v1.0 how will this deal with that, from what I am seeing this will make new entries with the same names for users of v1.0.. So will I have to make an updater version, or is there some way to make this modify the existing values in their .2da's..

[globalcat.2da]
AddRow1=globalcat_row_1002_0
[globalcat_row_1002_0]
name=SPower
type=Number

[spells.2da]
AddRow0=spells_row_bp_saberswitch_0
[spells_row_bp_saberswitch_0]
label=BP_SaberSwitch
forcepoints=0
goodevil=-
usertype=4
guardian=0
consular=0
sentinel=0
weapmstr=0
jedimaster=0
watchman=0
marauder=0
sithlord=0
assassin=0
inate=1
maxcr=3
category=0x1808
range=T
impactscript=SaberPower
conjtime=170
catchtime=0
proj=0
itemimmunity=0
exclusion=0x00
requireitemmask=0x0000
forbiditemmask=0x0000
itemtargeting=1
hostilesetting=0
formmask=0x00
2DAMEMORY3=RowIndex

[baseitems.2da]
AddRow0=baseitems_row_bp_item1_0
[baseitems_row_bp_item1_0]
name=****
label=BP_Item1
equipableslots=0x00180
modeltype=0
itemclass=I_FrArmBnds
genderspecific=0
partenvmap=0
defaultmodel=w_Lghtsbr_006
defaulticon=ii_band
container=0
prefattackdist=0.5
minrange=0
maxrange=40
basecost=1
stacking=99
itemmultiplier=1
invsoundtype=17
maxprops=8
minprops=0
propcolumn=16
reqfeat0=****
ac_enchant=0
baseac=0
dexbonus=-1
accheck=0
armorcheckpen=0
chargesstarting=0
rotateonground=0
tenthlbs=1
powereditem=0
itemtype=48
droidorhuman=1
denysubrace=0x00000000
storepanelsort=65
2DAMEMORY4=RowIndex

[SaberSwitch.uti]
!ReplaceFile=1
PropertiesList\0\Subtype=2DAMEMORY1
BaseItem=2DAMEMORY4
 stoffe
08-27-2006, 8:27 AM
#18
A config like below will probably work better. The more significant changes are bolded to make them easier to spot.

Using "AddRow" 2DA modifiers will always add a new line even if an already identical line exists in the file. You can use the special "ExclusiveColumn" key, like shown below, to avoid this. You set this key to the label of a column in the file. The patcher will then check the value of this column for all rows in the 2DA file. If an existing line whose value in this column match the value of the new line to create, a new line won't be created but the existing found line will be modified instead (like if it had been a "ChangeRow" modifier). Any columns with nothing assigned to them would keep their original value in the 2DA file. If no existing matches were found, the new row would be added instead as usual.

This can be used to prevent multiple lines from being added if running the installer more than once, or to create updates to already installed mods. Needless to say you should only set the ExclusiveColumn key to the label of a column where you can be reasonably sure the value will be unique for your mod. In most cases the label column is perfect for this, when it exists, since it isn't used by the game and can be set to whatever you wish, and serve as a unique identifier for your rows. (And in the case of globalcat.2da you can use the name column instead, since you can't have two globals with the same name tag.)

* * *

So, the config below would add a new line to globalcat.2da unless there is already a line with the value "SPower" in the name column. If such a line exists, that line will be modified and its type column value will be set to "Number". Otherwise a new line will be added at the end, its RowLabel set to the same as the line number, its name value set to "SPower" and its type value set to "Number".

It would then add a new line to baseitems.2da, unless there already exists a line whose label column has the value "BP_Item1". If that happens the existing line would be modified instead, having its column values set as assigned in the modifier. Regardless of which was the case, the line number of the new or modified row will be stored in the 2DAMEMORY1 token.

Next, a new line as added to spells.2da, unless there is already a line where the label column has the value "BP_SaberSwitch", in which case that line is modified instead and no new line added. Whatever the case, the line number of the new or modified row is stored in the 2DAMEMORY2 token.

After that, the SaberSwitch.uti file is modified, where the BaseItem field is set to the value of the 2DAMEMORY1 token (i.e. the line number from baseitems.2da), and the subtype field of its first property is set to the value of the 2DAMEMORY2 token (i.e. the line number from spells.2da).

Finally the file SaberPower.ncs is copied to the override folder, replacing any existing file with the same name found there.

The modified config file:

[Settings]
FileExists=1
WindowCaption=Lightsaber On/Off Switch v1.0
ConfirmMessage=N/A
LogLevel=3
InstallerMode=1
BackupFiles=1
PlaintextLog=0
LookupGameFolder=0
LookupGameNumber=2


; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

[InstallList]
install_folder0=override


[2DAList]
Table0=globalcat.2da
Table1=baseitems.2da
Table2=spells.2da


[GFFList]
File0=SaberSwitch.uti



; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

[globalcat.2da]
AddRow1=globalcat_row_1002_0


[globalcat_row_1002_0]
ExclusiveColumn=name
name=SPower
type=Number


; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


AddRow0=baseitems_row_bp_item1_0


[baseitems_row_bp_item1_0]
[b]ExclusiveColumn=label
label=BP_Item1
name=****
equipableslots=0x00180
modeltype=0
itemclass=I_FrArmBnds
genderspecific=0
partenvmap=0
defaultmodel=I_Null
defaulticon=ii_band
container=0
prefattackdist=0.5
minrange=0
maxrange=40
basecost=1
stacking=99
itemmultiplier=1
invsoundtype=17
maxprops=8
minprops=0
propcolumn=16
ac_enchant=0
baseac=0
dexbonus=-1
accheck=0
armorcheckpen=0
chargesstarting=0
rotateonground=0
tenthlbs=1
powereditem=0
itemtype=20
droidorhuman=1
denysubrace=0x00000000
storepanelsort=65
2DAMEMORY1=RowIndex


; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

[spells.2da]
AddRow0=spells_row_bp_saberswitch_0


[spells_row_bp_saberswitch_0]
ExclusiveColumn=label
label=BP_SaberSwitch
forcepoints=0
goodevil=-
usertype=4
guardian=0
consular=0
sentinel=0
weapmstr=0
jedimaster=0
watchman=0
marauder=0
sithlord=0
assassin=0
inate=1
maxcr=3
category=0x1808
range=T
impactscript=SaberPower
conjtime=170
catchtime=0
proj=0
itemimmunity=0
exclusion=0x00
requireitemmask=0x0000
forbiditemmask=0x0000
itemtargeting=1
hostilesetting=0
formmask=0x00
2DAMEMORY2=RowIndex


; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

[SaberSwitch.uti]
!ReplaceFile=1
PropertiesList\0\Subtype=2DAMEMORY2
BaseItem=2DAMEMORY1


; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

[install_folder0]
Replace0=SaberPower.ncs
 HouseOfAmon
08-27-2006, 8:59 AM
#19
Thank you Stoffe, I appreciate your help, though I havent got it all done yet as this headache is sucking, and making hard to anything,

Regardless, I trust you and you have never led me astray, so I am sure it will be just what I need.. Well, thank you..

I will be sure to give you a credit, for all your help.. And for your patcher..

Anyways, I gotta lay down, my head is bumping.. stupid slow acting medicine.. :(
 HouseOfAmon
08-27-2006, 1:47 PM
#20
Alright, well I am feeling much better now. :)

So I did everything you said to do stoffe, and the mod now works perfect,..

edit
-----

I got it using a similar icon to what I want, but I told it to use saber icon 6, it has no glow effect..

But its using the purple one icon 5.. ???? So what do I have to do to make it use the right one...

Here is what i have so far...

itemclass=w_Lghtsbr
defaultmodel=w_Lghtsbr_006
defaulticon=iw_sword
 Mav
08-27-2006, 2:59 PM
#21
itemclass=w_Lghtsbr
defaultmodel=w_Lghtsbr_001
defaulticon=iw_sword
^^^
fixed, changed the "_006"

Well your icon should be named iw_lghtsbr_006, but your problem probably lies in your .uti file, the baseitem.2da wont define what "number" icon your item uses, the modelvariation number in the item's .uti file defines that, so change the modelvariation number to 6. And to be safe, in you baseitems.2da line for the three columns you have listed above, just use the exact same entries that are their for normal lightsabers, copy and paste.

Edit:So:

itemclass = w_Lghtsbr
defaultmodel = w_Lghtsbr_001
defaulticon = iw_sword
 HouseOfAmon
08-27-2006, 3:36 PM
#22
I havent tried it yet, but thank you maverick, I would have not even remembered to set the variation type..

Now I feel stupid, I totally forgot about that.. :)

Thank you..
 Mav
08-27-2006, 5:24 PM
#23
I havent tried it yet, but thank you maverick, I would have not even remembered to set the variation type..

Now I feel stupid, I totally forgot about that.. :)

Thank you..
no problem, here to help, and for future reference, Mav is fine ;) hopefully it'll work out now.
 HouseOfAmon
08-27-2006, 5:35 PM
#24
no problem, here to help, and for future reference, Mav is fine ;) hopefully it'll work out now.

Well, it worked out perfect as a matter of fact, thanks to you and Stoffe I have already released v1.1, way ahead of schedule I might add, :) so if you wanna try it out feel free..

I made sure to credit you both for your help.. Well I hope like the mod if you decide to try it out, its pretty cool I think, I know Shem likes it.. :)

Here is the link..
http://knightsoftheoldrepublic.filefront.com/file/Lightsaber_OnOff_Switch;68535)
Page: 1 of 1