HomePortalFAQSearchMemberlistUsergroupsRegisterLog in
Making threads to link to banned members content grants an automatic ban
Meet the new KITO admins & hear their plans here.
You can use google search to find threads and posts here now. Example

Share | 
 

 Restricted Number of Characters

View previous topic View next topic Go down 
AuthorMessage
Hyper
Admin
avatar

Game username : Hyper
Server : Azoptaos
Male Posts : 483
Join date : 2014-02-09
Age : 19

PostSubject: Restricted Number of Characters   Sun Apr 26, 2015 11:00 pm

Small edit I was able to make that restricts the number of characters people can make. As in, after they create that number of characters, the "New" button disappears

MagixCharScreenManager.cpp (6.0) or MagixCharScreenManager.h (anything else)

in the refreshPage() function

Quote :
else
{
if (charID == numChars)
{
if (!mNextButton->isVisible())mNextButton->show();
mNextButtonText->setCaption("New");
mNextButton->setPosition((Real)(0.85 - mNextButton->getWidth() + mRButton[0]->getWidth()), 0.85);
}
else if (mNextButton->isVisible())mNextButton->hide();
if (mDeleteButton->isVisible())mDeleteButton->hide();
}
return;
}

replace with

Quote :
else
{
if (charID == numChars)
{
if (getNumChars() < 10)
{
if (!mNextButton->isVisible())mNextButton->show();
mNextButtonText->setCaption("New");
mNextButton->setPosition((Real)(0.85 - mNextButton->getWidth() + mRButton[0]->getWidth()), 0.85);
}
else if (getNumChars() >= 10)
{
mAlertBox->showAlert("You already have\n10 characters!", (Real)(0.85 - mNextButton->getWidth() + mRButton[0]->getWidth()), 0.85, 5);
mNextButton->hide();
}
}
else if (mNextButton->isVisible())mNextButton->hide();
if (mDeleteButton->isVisible())mDeleteButton->hide();
}
return;
}

replace 10 with your max

looks like this ingame
Spoiler:
 
Thanks Revaen for the fixed Start button

________________________________


Last edited by Hyper on Thu May 07, 2015 8:56 pm; edited 9 times in total
Back to top Go down
http://azoptaos.boards.net/

Very Helpful
Very Helpful


Male Posts : 314
Join date : 2013-07-21
Age : 16

PostSubject: Re: Restricted Number of Characters   Sun Apr 26, 2015 11:09 pm

11/10 *

Kudos for you, Hyper.
Thanks!
Back to top Go down
Hyper
Admin
avatar

Game username : Hyper
Server : Azoptaos
Male Posts : 483
Join date : 2014-02-09
Age : 19

PostSubject: Re: Restricted Number of Characters   Sun Apr 26, 2015 11:29 pm

edited to include a popup

________________________________
Back to top Go down
http://azoptaos.boards.net/
GlaciaTheWolf
®
®
avatar

Game username : Glacia, GlaciaIceWolf, GlaciaTheWolf
Server : Canis lupus (Owner/creator) DD (member)
Female Posts : 977
Join date : 2013-12-09
Age : 21
Location : Ohio

PostSubject: Re: Restricted Number of Characters   Sun Apr 26, 2015 11:59 pm

Wow hyper this will be helpful!
Back to top Go down
Cloud
Texture Artist
Texture Artist
avatar

Game username : Cloud, Daydream
Server : None
Female Posts : 614
Join date : 2014-07-22
Location : Under your bed

PostSubject: Re: Restricted Number of Characters   Mon Apr 27, 2015 1:34 am

Such a nice way to eliminate rulebreakers who think they can have 13563599536875248086314786421685 characters
Back to top Go down
RedEye
Retired
avatar

Game username : -redeye-
Server : KITO
Male Posts : 2575
Join date : 2011-07-24
Age : 30

PostSubject: Re: Restricted Number of Characters   Mon Apr 27, 2015 6:34 am

Nice. An addition would be to make the Start button invisible

________________________________
Retired
Back to top Go down
ShadoWolfozo

avatar

Game username : ShadoWolfozo
Server : GROWL: Spirits
Male Posts : 875
Join date : 2012-01-22
Age : 21
Location : Australia

PostSubject: Re: Restricted Number of Characters   Mon Apr 27, 2015 6:57 am

Ah, thank you Hyper, just what I was looking for Smile
Back to top Go down
Hyper
Admin
avatar

Game username : Hyper
Server : Azoptaos
Male Posts : 483
Join date : 2014-02-09
Age : 19

PostSubject: Re: Restricted Number of Characters   Mon Apr 27, 2015 9:12 pm

Didn't even notice the start button. It shouldn't be showing???

Tested it and it brings you to a char create page

WELP I'll work on fixing that up

________________________________
Back to top Go down
http://azoptaos.boards.net/
lazyzim

™
avatar

Server : Dragon's Den
Male Posts : 736
Join date : 2011-11-27

PostSubject: Re: Restricted Number of Characters   Thu Apr 30, 2015 10:14 am

This is great.
We have a 15 character limit and the largest player account was 87 characters.
Many players can not count to 15 and ask us to tell them if they have 15 characters.
Looking forward to seeing it fixed.

EDIT:

Quote :

}
if (mNextButton->isVisible())mNextButton->hide();
if (mDeleteButton->isVisible())mDeleteButton->hide();
}
return;
}
Remove the "else" from the "else if (mNextButton->isVisible())mNextButton->hide();"

That will remove the Start Button.
~Lazyzim~
Back to top Go down
Hyper
Admin
avatar

Game username : Hyper
Server : Azoptaos
Male Posts : 483
Join date : 2014-02-09
Age : 19

PostSubject: Re: Restricted Number of Characters   Thu Apr 30, 2015 4:44 pm

Hadn't had time to look at that yet, many thanks Lazy

________________________________
Back to top Go down
http://azoptaos.boards.net/

Very Helpful
Very Helpful


Male Posts : 314
Join date : 2013-07-21
Age : 16

PostSubject: Re: Restricted Number of Characters   Thu May 07, 2015 1:38 am

lazyzim wrote:
This is great.
We have a 15 character limit and the largest player account was 87 characters.
Many players can not count to 15 and ask us to tell them if they have 15 characters.
Looking forward to seeing it fixed.

EDIT:

Quote :

}
if (mNextButton->isVisible())mNextButton->hide();
if (mDeleteButton->isVisible())mDeleteButton->hide();
}
return;
}
Remove the "else" from the "else if (mNextButton->isVisible())mNextButton->hide();"

That will remove the Start Button.
~Lazyzim~
That's not correct.
You would be removing both start and edit button outside the 10 character count, which affects the accounts before create even a character.

I am 99% sure about it, because I tested this and wasn't working.
I fixed it and now works:
Spoiler:
 
Spoiler:
 
Spoiler:
 
Hyper commit a small mistake:
in:
Quote :
}
else if (getNumChars() >= 10)mAlertBox->showAlert("You already have\n10 characters!", (Real)(0.85 - mNextButton->getWidth() + mRButton[0]->getWidth()), 0.85, 5);
}
if (mNextButton->isVisible())mNextButton->hide();
mixing the else if with the content of such parameter.
FIX:
Change the code to this:
Quote :

else
           {
                if (charID == numChars)
                {
                      if (getNumChars() < 10)
                      {
                      if (!mNextButton->isVisible())mNextButton->show();
                      mNextButtonText->setCaption("New");
                      mNextButton->setPosition((Real)(0.85 - mNextButton->getWidth() + mRButton[0]->getWidth()), 0.85);
                      }
  else if (getNumChars() >= 10)
  {
mAlertBox->showAlert("You already have\n10 characters!", (Real)(0.85 - mNextButton->getWidth() + mRButton[0]->getWidth()), 0.85, 5);
mNextButton->hide();
  }
                      }
                    else if (mNextButton->isVisible())mNextButton->hide();

                    if (mDeleteButton->isVisible())mDeleteButton->hide();
                  }
                  return;
                  }
That should do it, at least for my case.
(I am using 5.3 source version)

EDIT:
Added an extra code for remove the "Start" message after have the 10 characters(This make you make a new character even after have 10, so, it would be useless to add this without that!
Cheers. Smile
Back to top Go down
lazyzim

™
avatar

Server : Dragon's Den
Male Posts : 736
Join date : 2011-11-27

PostSubject: Re: Restricted Number of Characters   Thu May 07, 2015 4:13 am

Yes Revaen you are correct my error.
Have used your correction and it works perfectly.
Thanks
Lazyzim
Back to top Go down
Hyper
Admin
avatar

Game username : Hyper
Server : Azoptaos
Male Posts : 483
Join date : 2014-02-09
Age : 19

PostSubject: Re: Restricted Number of Characters   Thu May 07, 2015 8:52 pm

I was confused on why Lazy's code worked without the else? lol I don't even know, I just kind of glanced at it after my build

Thanks Rev, I'll update the post with your fix + credit you for it

________________________________
Back to top Go down
http://azoptaos.boards.net/
ShadoWolfozo

avatar

Game username : ShadoWolfozo
Server : GROWL: Spirits
Male Posts : 875
Join date : 2012-01-22
Age : 21
Location : Australia

PostSubject: Re: Restricted Number of Characters   Mon Jul 06, 2015 2:29 pm

Hey, just wondering how this would affect accounts that already have more than 10 (or whatever number you choose) characters??

Are the character's still editable/playable or do they 'disappear' ?
Back to top Go down

Very Helpful
Very Helpful


Male Posts : 314
Join date : 2013-07-21
Age : 16

PostSubject: Re: Restricted Number of Characters   Mon Jul 06, 2015 6:54 pm

ShadoWolfozo wrote:
Hey, just wondering how this would affect accounts that already have more than 10 (or whatever number you choose) characters??

Are the character's still editable/playable or do they 'disappear' ?

I am assuming this just hides the button option of "New" for who have 10 characters made.
So, yes, probably the characters are still editable and playable.I am not sure though.
Back to top Go down
Hyper
Admin
avatar

Game username : Hyper
Server : Azoptaos
Male Posts : 483
Join date : 2014-02-09
Age : 19

PostSubject: Re: Restricted Number of Characters   Mon Jul 06, 2015 9:31 pm

I'm honestly not sure Shad, I haven't tested it, heh. I'd imagine it'd just hide the new button? Or not let you scroll past the tenth character?

________________________________
Back to top Go down
http://azoptaos.boards.net/
ObeyTheFist

™
avatar

Game username : ObeyTheFist
Server : Dragon's Den
Female Posts : 512
Join date : 2012-09-07
Location : Australia

PostSubject: Re: Restricted Number of Characters   Tue Jul 07, 2015 10:23 am

ShadoWolfozo wrote:
Hey, just wondering how this would affect accounts that already have more than 10 (or whatever number you choose) characters??

Are the character's still editable/playable or do they 'disappear' ?

I can answer that.

It will show you all of your characters, even those above the number limit you set. When it reaches that limit though, you'll see the little message in the corner telling you that you already have X number of characters.

That message will refresh itself every character past the limit that you scroll to. When you reach the blank space reserved for 'new' characters then the necessary create/start buttons will disappear. Until that point you will still be able to edit and select every character you have past the limit.

I hope that made sense and it helped. XD
Back to top Go down
http://dragonsden.freeforums.net
ShadoWolfozo

avatar

Game username : ShadoWolfozo
Server : GROWL: Spirits
Male Posts : 875
Join date : 2012-01-22
Age : 21
Location : Australia

PostSubject: Re: Restricted Number of Characters   Tue Jul 07, 2015 11:57 am

Oh! Okay thank you.

This will be great then, players who already have 10+ characters can keep them while not causing any major issue and the limit applies to any new accounts.

Thank you everyone who contributed to this code Smile
Back to top Go down

Very Helpful
Very Helpful


Male Posts : 314
Join date : 2013-07-21
Age : 16

PostSubject: Re: Restricted Number of Characters   Thu Jul 09, 2015 12:55 am

Code:
      else
         {
           if (charID == numChars)
         {
           if (getNumChars() < 10)
         {
           if (!mNextButton->isVisible())mNextButton->show();
              mNextButtonText->setCaption("New");
              mNextButton->setPosition((Real)(0.85 - mNextButton->getWidth() + mRButton[0]->getWidth()), 0.85);
         }
         else if (getNumChars() >= 10)
         {
              mAlertBox->showAlert("You already have\n10 characters!", (Real)(0.85 - mNextButton->getWidth() + mRButton[0]->getWidth()), 0.85, 5);
              mNextButton->hide();
          }
        else if (getNumChars() > 10)
         {
           if (!mNextButton->isVisible())mNextButton->show();
              mNextButton->hide();
         }
       }
           else if (mNextButton->isVisible())mNextButton->hide();
           if (mDeleteButton->isVisible())mDeleteButton->hide();
        }
      return;
}
That code should fix the problem mentioned by Obey.

I already tested it. Wink

I am thinking this code should also be a tool for allow players have extra characters with play certain amount of in-game money and such(Assuming that at certain point, characters will not be enough for stash or keep all the items you hunt for).

Good luck.
Back to top Go down
NyxTheNightKitten

avatar

Game username : Dragon's Den: shadow300 | Wolf Soul: Starfield
Server : Eagle Eyes (Future IT Server|Owner)
Female Posts : 4
Join date : 2015-05-01
Location : North Of Houston, Texas.

PostSubject: Re: Restricted Number of Characters   Fri Nov 27, 2015 2:12 am

This should be really helpful to me in the future. Thank you very much, Hyper!
Back to top Go down
 
Restricted Number of Characters
View previous topic View next topic Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Keeping I.T. Open :: DOWNLOADABLE CONTENT :: Programming Features-
Jump to: