Jump to content
  • 0

Add-Migration failed??


mem981

Question

i tried to Add-Migration new StatsPoint  system but nothing happens

Spoiler

//-------------------------------------
        [JsonIgnore, Column(nameof(StatAddAllocations))]
        public string StatAddJson
        {
            get => DatabaseUtils.SaveIntArray(StatAddAllocations, (int)Enums.Stats.StatCount);
            set => StatAddAllocations = DatabaseUtils.LoadIntArray(value, (int)Enums.Stats.StatCount);
        }

        [NotMapped]
        public int[] StatAddAllocations { get; set; } = new int[(int)Enums.Stats.StatCount];
        //----------------------------------------

da3df5ddc303b871b82d6b2f950cc013.png

a42c89f94556d6d7b7dd3dff1823ea00.png

I did "nofody". am i doing something wrong? thank you so much!

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

I guess that you're making an GameContext migration and Entities are related to PlayerContext. Try use PlayerContext instead.

If that doesnt work, try changing the column name for a constant string instead of using nameof. Dont know if that would work but its a guess.

Also, in the last case, follow the Vitals example on the same file:

        [JsonIgnore, Column("Vitals")]
        public string VitalsJson
        {
            get => DatabaseUtils.SaveIntArray(mVitals, (int) Enums.Vitals.VitalCount);
            set => mVitals = DatabaseUtils.LoadIntArray(value, (int) Enums.Vitals.VitalCount);
        }

        [JsonProperty("Vitals"), NotMapped]
        private int[] mVitals { get; set; } = new int[(int) Enums.Vitals.VitalCount];

 

Link to comment
Share on other sites

  • 0
10 hours ago, boasfesta said:

I guess that you're making an GameContext migration and Entities are related to PlayerContext. Try use PlayerContext instead.

If that doesnt work, try changing the column name for a constant string instead of using nameof. Dont know if that would work but its a guess.

Also, in the last case, follow the Vitals example on the same file:

        [JsonIgnore, Column("Vitals")]
        public string VitalsJson
        {
            get => DatabaseUtils.SaveIntArray(mVitals, (int) Enums.Vitals.VitalCount);
            set => mVitals = DatabaseUtils.LoadIntArray(value, (int) Enums.Vitals.VitalCount);
        }

        [JsonProperty("Vitals"), NotMapped]
        private int[] mVitals { get; set; } = new int[(int) Enums.Vitals.VitalCount];

 

Now I delete the empty Migration file, is there any effect?

Link to comment
Share on other sites

  • 0
15 minutes ago, boasfesta said:

 

Probably no xD

But there is a command for that actually

Test StatAddAllocations[1] += 1000; PacketSender.SendChatMsg(this, StatAddAllocations[1].ToString(), ChatMessageType.Bank, Color.Yellow);

work! but how to add value to character??

StatAddAllocations[0] is Damage

StatAddAllocations[1] is Magicdamage

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...