Jump to content

Untested Character hair customization (+ basics for expansion)


Cheshire
Message added by jcsnider

Warning! There be dragons!: This mod introduces new field(s) into the games' databases. Database migrations are one-way upgrades. Make database backups before applying! If you later decide that you want to remove this mod you will likely have to restore from those backups or manually make dangerous edits to your database in order to get your game running again. 

Recommended Posts

What branch are you using and how often do you update it from the main one? 

 

If you're not using the development branch I fear you might be using the wrong patch. If that is the development branch I'll have to try and apply it to an updated fresh pull.

Link to comment
Share on other sites

On 4/14/2020 at 3:32 PM, Joyce said:

What branch are you using and how often do you update it from the main one? 

 

If you're not using the development branch I fear you might be using the wrong patch. If that is the development branch I'll have to try and apply it to an updated fresh pull.

Yea they changed the server packetsender.cs quite a bit yesterday in the dev branch causing the conflict.

Link to comment
Share on other sites

I'll take a look at it later then, though I reckon running it with merge conflicts and resolving them yourself will likely work as well until then. (that's pretty much what I do to get the patches updated)

 

EDIT: Updated for build 0.6.2.412 

https://s3.us-east-2.amazonaws.com/ascensiongamedev/filehost/427798520f34bd3981dc363447e0987e.patch

Link to comment
Share on other sites

11 hours ago, Joyce said:

I'll take a look at it later then, though I reckon running it with merge conflicts and resolving them yourself will likely work as well until then. (that's pretty much what I do to get the patches updated)

 

EDIT: Updated for build 0.6.2.412 

https://s3.us-east-2.amazonaws.com/ascensiongamedev/filehost/427798520f34bd3981dc363447e0987e.patch

I was in development... With this patch worked!

Thanks

Link to comment
Share on other sites

Thanks for this mod and its flexibility.

 

Is there a way to make all hairs available for any class?

 

I just noticed that in the Class Editor > Hairstyles > Gender, when we click on Female radiobox, the editor crashes.

Spoiler

39a08c3c2d202f9f4d88622b84e630bc.gif

 

 

Here's what is written in the error log file.

Spoiler

2020-04-16 23:25:31.402 [Error] 
  Message: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
    Stack:    at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at Intersect.Editor.Forms.Editors.FrmClass.rbFemale2_Click(Object sender, EventArgs e) in C:\Users\ANT\Documents\GitHub\Intersect-Optimus\Intersect.Editor\Forms\Editors\frmClass.cs:line 1421
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.RadioButton.OnClick(EventArgs e)
   at System.Windows.Forms.RadioButton.OnMouseUp(MouseEventArgs mevent)
   at DarkUI.Controls.DarkRadioButton.OnMouseUp(MouseEventArgs e)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

 

Link to comment
Share on other sites

10 hours ago, luciferofhell said:

 

Is it possible to implement 2 more small arrows to make the consultation and the eyes?

It is, but you'll have to add that yourself. 

 

The development version should be rather simple to add this on to. Most methods and variables are expandable.. And you won't need to add new database fields. But you'll have to write the editor edits and clientside character select parts yourself. As well as telling the rendering engine which files to use and when to render these layers. 

 

8 hours ago, Shenmue said:

Thanks for this mod and its flexibility.

 

Is there a way to make all hairs available for any class?

 

I just noticed that in the Class Editor > Hairstyles > Gender, when we click on Female radiobox, the editor crashes.

  Hide contents

39a08c3c2d202f9f4d88622b84e630bc.gif

 

 

Here's what is written in the error log file.

  Reveal hidden contents

2020-04-16 23:25:31.402 [Error] 
  Message: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
    Stack:    at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at Intersect.Editor.Forms.Editors.FrmClass.rbFemale2_Click(Object sender, EventArgs e) in C:\Users\ANT\Documents\GitHub\Intersect-Optimus\Intersect.Editor\Forms\Editors\frmClass.cs:line 1421
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.RadioButton.OnClick(EventArgs e)
   at System.Windows.Forms.RadioButton.OnMouseUp(MouseEventArgs mevent)
   at DarkUI.Controls.DarkRadioButton.OnMouseUp(MouseEventArgs e)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

 

Ah, must have missed that one. I'll look into it when I get back home today. Selecting a hairstyle first should be OK though. 

 

And yes, by adding the hairstyle to each class. :P there is no global list that's shared between all classes. (though you could probably edit that in) 

Link to comment
Share on other sites

2 hours ago, Joyce said:

É, mas você terá que adicionar isso sozinho. 

 

A versão de desenvolvimento deve ser bastante simples de se adicionar. A maioria dos métodos e variáveis é expansível. E você não precisará adicionar novos campos ao banco de dados. Mas você terá que escrever as edições do editor e selecionar partes do personagem do cliente. Além de informar ao mecanismo de renderização quais arquivos usar e quando renderizar essas camadas. 

 

Ah, deve ter perdido essa. Vou investigar quando voltar para casa hoje. Selecionar um penteado primeiro deve ser bom. 

 

E sim, adicionando o penteado a cada aula. : Pnão há lista global compartilhada entre todas as classes. (embora você provavelmente possa editar isso em) 

Joyce, I know you seem to be asking too much for the work you have done and I confess to being worthy of applause. Could you do a tutorial teaching staff to implement the expansion? Example: if you create an eye implementation tutorial, we would know how to develop any extras.

Link to comment
Share on other sites

16 hours ago, Shenmue said:

I just noticed that in the Class Editor > Hairstyles > Gender, when we click on Female radiobox, the editor crashes.

 

Could you try this patch for me please? https://s3.us-east-2.amazonaws.com/ascensiongamedev/filehost/7b4f51cade9da8a59b8f52d79d353251.patch

 

5 hours ago, luciferofhell said:

Joyce, I know you seem to be asking too much for the work you have done and I confess to being worthy of applause. Could you do a tutorial teaching staff to implement the expansion? Example: if you create an eye implementation tutorial, we would know how to develop any extras.

That sounds an awful lot like "Please write it for me, so I can copy it". And I won't be doing that.

I implore you to look at the patch on a website such as diffy.com and see what I've changed in the client's Player and Entity classes as well as the other classes related to rendering objects. That should give you a clue on how to implement your own custom layer.

 

If you have more direct questions beyond "Please write the entire edit for me" I'd be willing to answer them though.

Link to comment
Share on other sites

I can confirm that Joyce's code is very easy to extend for the additional features that people are asking for. I was extremely happy with the forethought that went into this system and have to commend how well it was done. For example, I added an emotions extension that allows me to display an animated emote underneath the hair layer. I just added a library copying over what methods were used for hair, added the value to the array that was already built for customspritelayer and produced a few extra packets and draw criteria, and before you know it, good to go. If you don't yet understand the level of modification needed to reach the goal of what you want with this system, I urge you to try out other things within the source in small increments until you learn enough. Going through it yourself will not only allow you to learn and understand the source, but will free up developers to continue to do their work.

 

Tutorials are nice to an extent, but sometimes you have to learn through trial and error, and maybe watch some generalized tutorials on C# and build something simple on a separate branch. It's all about the experimentation and learning.

Link to comment
Share on other sites

When no hair is added and you go to events to change hair the editor crashes

2020-04-18 04:11:03.449 [Error] 
  Message: InvalidArgument=Waarde van 0 is niet geldig voor SelectedIndex.
Parameternaam: SelectedIndex
    Stack:    bij System.Windows.Forms.ComboBox.set_SelectedIndex(Int32 value)
   bij Intersect.Editor.Forms.Editors.Events.Event_Commands.EventCommandChangeHair..ctor(ChangeHairCommand refCommand, FrmEvent editor) in G:\source\Floor100\Intersect-Engine\Intersect.Editor\Forms\Editors\Events\Event Commands\EventCommand_ChangeHair.cs:regel 33
   bij Intersect.Editor.Forms.Editors.Events.FrmEvent.OpenEditCommand(EventCommand command) in G:\source\Floor100\Intersect-Engine\Intersect.Editor\Forms\Editors\Events\frmEvent.cs:regel 1203
   bij Intersect.Editor.Forms.Editors.Events.FrmEvent.lstCommands_NodeMouseDoubleClick(Object sender, TreeNodeMouseClickEventArgs e) in G:\source\Floor100\Intersect-Engine\Intersect.Editor\Forms\Editors\Events\frmEvent.cs:regel 747
   bij System.Windows.Forms.TreeView.OnNodeMouseDoubleClick(TreeNodeMouseClickEventArgs e)
   bij System.Windows.Forms.TreeView.WndProc(Message& m)
   bij System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   bij System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   bij System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

in Intersect.Editor\Forms\Editors\Events\Event Commands\EventCommand_ChangeHair.cs line 27

 

when you change 

if (cmbHair.Items.IndexOf(mMyCommand.Hair) > -1)
{
   cmbHair.SelectedIndex = cmbHair.Items.IndexOf(mMyCommand.Hair);
}
else
{
   cmbHair.SelectedIndex = 0;
}

to

cmbHair.SelectedIndex = cmbHair.Items.IndexOf(mMyCommand.Hair);

that error is fixed

 

ref:

public object SelectedItem { get; set; }
        //
        // Summary:
        //     Gets or sets the index specifying the currently selected item.
        //
        // Returns:
        //     A zero-based index of the currently selected item. A value of negative one (-1)
        //     is returned if no item is selected.
        //
        // Exceptions:
        //   T:System.ArgumentOutOfRangeException:
        //     The specified index is less than or equal to -2.-or- The specified index is greater
        //     than or equal to the number of items in the combo box.

 

Link to comment
Share on other sites

To be fair, the editors were pretty much an afterthought and I never really tested them. Lol

 

I'll look at it in a moment.

 

6 hours ago, wishy said:

When no hair is added and you go to events to change hair the editor crashes

in Intersect.Editor\Forms\Editors\Events\Event Commands\EventCommand_ChangeHair.cs line 27

 

when you change 


if (cmbHair.Items.IndexOf(mMyCommand.Hair) > -1)
{
   cmbHair.SelectedIndex = cmbHair.Items.IndexOf(mMyCommand.Hair);
}
else
{
   cmbHair.SelectedIndex = 0;
}

to


cmbHair.SelectedIndex = cmbHair.Items.IndexOf(mMyCommand.Hair);

that error is fixed

 

ref:

 

I disagree with that as a fix, as it fixes the error, but not the actual issue.

The real issue here is that I never added a ''None'' option.

Also not entirely sure why you decided to add an MSDN article-looking piece of code there.

Link to comment
Share on other sites

15 minutes ago, Joyce said:

To be fair, the editors were pretty much an afterthought and I never really tested them. Lol

 

I'll look at it later today. 

 

I disagree with that as a fix, as it fixes the error, but not the actual issue.

The real issue here is that I never added a ''None'' option.

with fix i meant a fix to the crash, not a fix to your absent mindedness :7_sweat_smile:

Link to comment
Share on other sites

5 minutes ago, wishy said:

with fix i meant a fix to the crash, not a fix to your absent mindedness :7_sweat_smile:

 

And there's nothing wrong with trying to help and fix the crash, but unfortunately the place where a crash occurs doesn't always have to be the same place the actual problem lies in. In this case it was a few lines above it.

 

I slapped together the editors at the end and never really looked back, haha. So I am surprised it took this long for people to break them.

 

Anyway, here's a patch that fixes two editor bugs. One reported by @wishy, the other by @Shenmue

This applies to both stable and development branches.

 

 

Download

Link to comment
Share on other sites

EDIT: Please ignore my dumb post. Somehow when I ported over changes to my server host the config.json file didnt have the correct paperdoll order.

 

Maybe someone can help me take a look at this.

 

I am getting a client crash when attempting to log in to an existing account with hair. When creating a new account or character I have no issues it is only when I try to log back in.

 

I currently have 3 players per account set and the crash happens when it tries to load the character select screen.

 

--------------------------------------------------------------------------------
2020-04-23 05:14:14.987 [Error] 
  Message: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
    Stack:    at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at Intersect.Client.Interface.Menu.SelectCharacterWindow.UpdateDisplay() in C:\Users\Justin\Documents\New Intersect\Intersect-Engine\Intersect.Client\Interface\Menu\SelectCharacterWindow.cs:line 249
   at Intersect.Client.Interface.Menu.SelectCharacterWindow.Show() in C:\Users\Justin\Documents\New Intersect\Intersect-Engine\Intersect.Client\Interface\Menu\SelectCharacterWindow.cs:line 320
   at Intersect.Client.Interface.Menu.MainMenu.CreateCharacterSelection() in C:\Users\Justin\Documents\New Intersect\Intersect-Engine\Intersect.Client\Interface\Menu\MainMenu.cs:line 269
   at Intersect.Client.Interface.Menu.MainMenu.Update() in C:\Users\Justin\Documents\New Intersect\Intersect-Engine\Intersect.Client\Interface\Menu\MainMenu.cs:line 169
   at Intersect.Client.Interface.Menu.MenuGuiBase.Draw() in C:\Users\Justin\Documents\New Intersect\Intersect-Engine\Intersect.Client\Interface\Menu\MenuGuiBase.cs:line 66
   at Intersect.Client.Interface.Interface.DrawGui() in C:\Users\Justin\Documents\New Intersect\Intersect-Engine\Intersect.Client\Interface\Interface.cs:line 175
   at Intersect.Client.Core.Graphics.Render() in C:\Users\Justin\Documents\New Intersect\Intersect-Engine\Intersect.Client\Core\Graphics.cs:line 484
   at Intersect.Client.MonoGame.IntersectGame.Draw(GameTime gameTime) in C:\Users\Justin\Documents\New Intersect\Intersect-Engine\Intersect.Client\MonoGame\IntersectGame.cs:line 247
   at Microsoft.Xna.Framework.Game.DoDraw(GameTime gameTime)
   at Microsoft.Xna.Framework.Game.Tick()
   at Microsoft.Xna.Framework.SdlGamePlatform.RunLoop()
   at Microsoft.Xna.Framework.Game.Run(GameRunBehavior runBehavior)

Here is line 249:

   if (Options.EquipmentSlots.IndexOf(Options.PaperdollOrder[1]) == Options.EquipmentSlots.IndexOf(Options.Equipment.HairSlot))

 

Any ideas?

 

EDIT Please ignore my dumb post. Somehow when I ported over changes to my server host the config.json file didnt have the correct paperdoll order.

Link to comment
Share on other sites

Did you change anything relating to paper dolls away from the defaults? 

 

Mind I haven't tried to update to anything beyond the version I've made this for. So might be related to that. 

 

I'll take a look once I get the time. But I'm back to work so I don't have much time during the day. 

Link to comment
Share on other sites

Hello, I applied your Patch, when I create a character everything is ok, but when I try to go back to the character selection menu, the game crasha, then when again in the account crasha always in the character menu.
I debugged the game and is having trouble on the line

 

Quote

if (Options.EquipmentSlots.IndexOf(Options.PaperdollOrder[1]) == Options.EquipmentSlots.IndexOf(Options.Equipment.HairSlot)) { if (Characters[mSelectedChar].Equipment != String.Empty && Characters[mSelectedChar].Equipment != null) { texture = Characters[mSelectedChar].Equipment; type = GameContentManager.TextureType.Paperdoll; } else { texture = Characters[mSelectedChar].CustomSpriteLayers[(int)Enums.CustomSpriteLayers.Hair]; type = GameContentManager.TextureType.Hair; } } else

\Intersect.Client\Interface\Menu\SelectCharacterWindow.cs

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...