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 | 
 

 More different Size values according the rank

View previous topic View next topic Go down 
AuthorMessage

Very Helpful
Very Helpful


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

PostSubject: More different Size values according the rank   Thu Jul 23, 2015 9:39 pm

Hello!

This is a code I made to allow Administrators and Moderators(individually) resize to different size ranges than the " 0.25-1.25" while normal users have the default settings.
I also made a configurable definer to making it easier for you to define the max and min sizes.

So, in other words, no more need to be asking your hoster to re-size your characters to 1.25+ sizes or less than 0.25!
This may also support you to know that since this file .h reads the ranks, you can also make specific body parts for the Staff with using restrictions in normal(false) members. :B I may make a tutorial about such method soon.

Open your compile and add in the file GameConfig.h:
Code:
//STAFF & USERS MAX SIZE
#define ADMINMAXSIZE 9
#define ADMINMINSIZE 0.001
#define MODMAXSIZE 4.5
#define MODMINSIZE 0.001
#define USERMAXSIZE 1.25
#define USERMINSIZE 0.25

Put in anywhere between the #ifndef and #endif is okay.

MagixCharScreenManager.h:
Replace your Void updateSliders and Void getSliderValue with this:
Code:
void updateSliders(const Real &one, const Real &two, const Real &three)
   {
      if(page==PAGE_CUSTOM3)
      {
         colourVal[colourPartID].r = one;
         colourVal[colourPartID].g = two;
         colourVal[colourPartID].b = three;
      }
      else if(page==PAGE_CUSTOM4 || page==PAGE_PRESET2)
      {
         if (mDef->isAdmin)
         {
         const Real tScale = ADMINMINSIZE + (page==PAGE_PRESET2?two:one)*ADMINMAXSIZE;
         mUnit->getObjectNode()->setScale(tScale,tScale,tScale);
         }
         else if (mDef->isMod)
         {
         const Real tScale = MODMINSIZE + (page==PAGE_PRESET2?two:one)*MODMAXSIZE;
         mUnit->getObjectNode()->setScale(tScale,tScale,tScale);
         }
         else
         {         
            const Real tScale = USERMINSIZE + (page==PAGE_PRESET2?two:one)*USERMAXSIZE;
         mUnit->getObjectNode()->setScale(tScale,tScale,tScale);
         }
      }
      refreshPage();
   }
   void getSliderValue(Real &one, Real &two, Real &three)
   {
      if(page==PAGE_CUSTOM3)
      {
         one = colourVal[colourPartID].r;
         two = colourVal[colourPartID].g;
         three = colourVal[colourPartID].b;
      }
      else if(page==PAGE_CUSTOM4)
      {
         if (mDef->isAdmin)
         {
            one = (mUnit->getObjectNode()->getScale().x-ADMINMINSIZE)/ADMINMAXSIZE;
         }
         else if (mDef->isMod)
         {
            one = (mUnit->getObjectNode()->getScale().x-MODMINSIZE)/MODMAXSIZE;
         }
         else
         {
         one = (mUnit->getObjectNode()->getScale().x-USERMINSIZE)/USERMAXSIZE;
         }
      }
      else if(page==PAGE_PRESET2)
      {
         if (mDef->isAdmin)
         {
            two = (mUnit->getObjectNode()->getScale().x-ADMINMINSIZE)/ADMINMAXSIZE;
         }
         else if (mDef->isMod)
         {
            two = (mUnit->getObjectNode()->getScale().x-MODMINSIZE)/MODMAXSIZE;
         }
         else
         {
         two = (mUnit->getObjectNode()->getScale().x-USERMINSIZE)/USERMAXSIZE;
          }
      }
   }

The unique values you need modify are the ones in the GameConfig.h.
You can leave them in my default values though.

P.S: I am using 5.3 source version.If you're having issues for locating certain type of code I suggest you simply to search in other files.
Back to top Go down
Nefadozone

avatar

Game username : Nefadozone
Server : Fucko McShitpo
Male Posts : 176
Join date : 2011-11-11
Age : 23
Location : Satan's Asshole

PostSubject: Re: More different Size values according the rank   Fri Jul 24, 2015 11:09 am

I want to also point out that this kind of logic is good for doing other basic 'staff only' functions in the code within reason. (Including the GUI/item equipping/prey/skills/'restricted manes/tufts etc.' and as seen in maps as well.) Might write up a couple tutorials like this one too if I can find the time, very kind of you Rev!
Back to top Go down
http://wildmidnight.boards.net/
Vιrus
Very Helpful
Very Helpful
avatar

Game username : Virus
Server : Miskai
Female Posts : 486
Join date : 2014-09-05
Age : 17
Location : deep in an existential crisis

PostSubject: Re: More different Size values according the rank   Fri Jul 24, 2015 5:36 pm

Convenient! Thank you for this.
Back to top Go down

Very Helpful
Very Helpful


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

PostSubject: Re: More different Size values according the rank   Fri Jul 24, 2015 7:06 pm

SET wrote:
I want to also point out that this kind of logic is good for doing other basic 'staff only' functions in the code within reason. (Including the GUI/item equipping/prey/skills/'restricted manes/tufts etc.' and as seen in maps as well.) Might write up a couple tutorials like this one too if I can find the time, very kind of you Rev!


You're welcome!
Yes, that is what I was saying with the restriction of body parts for staff use only!
I was also planning make Admins use "auto-staff" other users with a command(and remove their rank as well).The unique issue for this would be the hackers, but if you've Protection against cheat engines, you might be fine!

This would just help to avoid be bugging Hosters a lot.

Maybe even a command for assign presents as well.

With this, I assume hosters would be doing their job better, just host.
Back to top Go down
Furrest

avatar

Game username : Furrest(Everywhere Else) / Frozenfur (Only On DD)
Server : Mythical Realms (Owner/Creator)
Female Posts : 67
Join date : 2015-11-11
Age : 15
Location : United States

PostSubject: Re: More different Size values according the rank   Wed Jun 08, 2016 5:04 pm

I replaced the code and I went in game and my character didn't get bigger. Where am I supposed to change the values of the character? Because when I do go to the character creation menu the sliders don't move.
Back to top Go down
http://mythical-realms.freeforums.net
ObeyTheFist

™
avatar

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

PostSubject: Re: More different Size values according the rank   Wed Jun 08, 2016 11:11 pm

I thought the default player sizes were 0.25 - 1.5?
Back to top Go down
http://dragonsden.freeforums.net
Skyia

avatar

Game username : Skyia
Server : Royal Elements
Female Posts : 144
Join date : 2014-09-14
Age : 16
Location : In your mind

PostSubject: Re: More different Size values according the rank   Thu Jun 09, 2016 2:14 pm

ObeyTheFist wrote:
I thought the default player sizes were 0.25 - 1.5?

They are, 1.25 is just another way of 1.5, it worked for me, just testing it messed up my size editing my character
Back to top Go down
 
More different Size values according the rank
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: