HomePortalFAQSearchMemberlistUsergroupsRegisterLog in
Meet the new KITO admins & hear their plans here.
You can use google search to find threads and posts here now. Example

Share | 
 

 one map gets taller grass

View previous topic View next topic Go down 
AuthorMessage
Hamilton

avatar

Game username : Hamilton
Server : Myatar Legends // Dragon's Den
Female Posts : 380
Join date : 2011-10-20
Age : 31
Location : everywhere

PostSubject: one map gets taller grass   Thu May 19, 2016 12:54 am

what this code does:

left=standard grass height
center=special grass height
right=more standard grass height

This bit of code will allow you to set it so that 1 map has grass of a different height than all the rest of the maps in your game. (i've only just got it working lol next step is a per-any map. if you can help with that....)

This code allows for any map to be given specially sized grass via hardcoded goodness. At this stage, it does not work through the .world file (baby steps).


the file you will need to look in is "magixworld.h" (you should still be able to find the code in the newer versions of the source by using the search tool)

the lines you will be replacing are:

Code:
1->setMinimumSize(5,5);
1->setMaximumSize(8,8);

do a search to get to them super fast.

found them? good.

highlight both of them and replace them with the following code:

Quote :
void setMinimumSize(float, float);
{
if(getWorldName() == "Map 1")
{
l->setMinimumSize(15,15);
}
else if(getWorldName() == "Map 2")
{
l->setMinimumSize(35,35);
}
else
{
l->setMinimumSize(5,5);
}
}
void setMaximumSize(float, float);
{
if(getWorldName() == "Map 1")
{
l->setMaximumSize(20,20);
}
else if(getWorldName() == "Map 2")
{
l->setMaximumSize(55,55);
}
else
{
l->setMaximumSize(8,8 );
}
}

red = the name of your map/s that will have the one size of grass.
orange = the name of your map/s that will have a different size of grass.
blue = the sizes for your map/s grass. obviously larger amounts = bigger grass.

the non-color-coded numbers are the size of the normal grass that the rest of the maps will use. you can change this too, but if it's the same as the special sized grass well...what was the point to putting this in? XD


-any map not named will be given the default sized grass (listed under "else")
-you can list multiple maps to use a set of sizes by using " || getWorldName() == "More Maps" " for each map you wish to add
-you can add more sizes by duplicating the "else if" section in the middle


i...think that's pretty much it. easy, yes? lol enjoy~


Last edited by Hamilton on Thu Aug 18, 2016 3:41 am; edited 2 times in total (Reason for editing : i made it better // gosh darn it, stop turning my 8's into faces!)
Back to top Go down
Kawoie

avatar

Game username : Kawoie
Server : Former KITO Administrator
Male Posts : 122
Join date : 2015-11-19
Age : 23

PostSubject: Re: one map gets taller grass   Thu May 19, 2016 5:11 pm

Bless you.
Seriously, praise sweet baby Jesus above this code will help me out in the future.
Back to top Go down
Hamilton

avatar

Game username : Hamilton
Server : Myatar Legends // Dragon's Den
Female Posts : 380
Join date : 2011-10-20
Age : 31
Location : everywhere

PostSubject: Re: one map gets taller grass   Thu Aug 18, 2016 3:39 am

i have fixed up the code a bit so that:
1-it makes more sense
2-it can be used for more than 1 map
3-it can be given more than 2 different sizes
Back to top Go down
Sponsored content




PostSubject: Re: one map gets taller grass   

Back to top Go down
 
one map gets taller grass
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: