Single unstackable item not showing Item Name

DragnMaw

Citizen
I have a few items, none of them stackable, that for some reason as soon as I add to the GetProperties for text underneath the normal properties, the name vanishes. (If the item is stackable, and theres 2 it works.)


public class OnlineTicket : Item
{
[Constructable]
public OnlineTicket()
: base(5360)
{
Name = "Online Ticket";
Weight = 0.1;
Hue = 1916;
}

// public override void GetProperties( ObjectPropertyList list )
// {
// base.GetProperties( list );
//
// list.Add( "Reward Item" );
// list.Add( "Double Click: Randomly recieve your rewards" );
// list.Add( "Or turn in to complete a daily quest" );
// }


Theres the code (Commented out atm so it works), and I've looked into everything in Item.cs about AddNameProperty, and GetProperties, and I've even merged the entire GetProperties into the override, even tho it shouldn't need it, and still no go.



public virtual void AddNameProperty(ObjectPropertyList list)
{
string name = Name ?? string.Empty;

if (string.IsNullOrWhiteSpace(name))
{
if (m_Amount <= 1)
{
list.Add(LabelNumber);
}
else
{
list.Add(1050039, "{0}\t#{1}", m_Amount, LabelNumber); // ~1_NUMBER~ ~2_ITEMNAME~
}
}
else
{
if (m_Amount <= 1)
{
list.Add(name);
}
else
{
list.Add(1050039, "{0}\t{1}", m_Amount, Name); // ~1_NUMBER~ ~2_ITEMNAME~
}
}
}

public virtual void GetProperties(ObjectPropertyList list)
{
AddNameProperties(list);

AddItemSocketProperties(list);

if (Spawner != null)
{
Spawner.GetSpawnProperties(this, list);
}

AddItemPowerProperties(list);
}

Anyone know how to make the item name show up properly?
 

Attachments

  • ticketerror.png
    ticketerror.png
    2.5 MB · Views: 4

TheArt

Rookie
see if changing this
{
Name = "Online Ticket";
Weight = 0.1;
Hue = 1916;
}


{
Name = "Online Ticket";
Weight = 0.1;
Hue = 1916;
Stackable = true;
}


Also make sure that the item is actually stackable within tiledate because if it's not, the player won't be able to unstack the items.
 

DragnMaw

Citizen
The item is intended to never be stacked. Do I have to do Stackable = false;? I thought that was a default (It showed Stackable False in the [props window)

I just need the item names to show up when only the one item is present, and I have no idea why it isn't. But it only hides the name as soon as I uncomment the GetProperties line. Maybe the base.GetProperties isn't working right?

Edit - Or is the issue that I'm using a BaseID that in tiledata is always stackable?
 

PyrO

Moderator
The issue is that you use 3 List.Add calls without a cliloc number.

C#:
list.Add( "Reward Item" );
list.Add( "Double Click: Randomly recieve your rewards" );
list.Add( "Or turn in to complete a daily quest" );

is equal display wise to

C#:
list.Add( "Reward Item\n"
+"Double Click: Randomly recieve your rewards\n"
+"Or turn in to complete a daily quest");

yet you use only 1 of the empty clilocs