All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: More Tutorials
PostPosted: Sat Jul 21, 2012 3:30 am 
Offline

Joined: Fri Jul 20, 2012 10:48 pm
Posts: 4
Hello I am new to java code in general and I really want to mod Minicraft
I have made a new chest thing but I want to make a new mob, new item and other cool this
there are no tutorials on mobs besides the preventing them from spawning but I want to learn so PLEASE put up more tutorials


Top
 Profile  
 
 Post subject: Re: More Tutorials
PostPosted: Sat Jul 21, 2012 4:32 am 
Offline

Joined: Tue Dec 27, 2011 4:15 pm
Posts: 113
I am rather new to Java myself, but I can share a bit of my knowledge.

To make a new monster, copy com.mojang.ld22.entity.Zombie.java and rename it to whatever you want. In this case we will call it a ghost, so Ghost.java is the new name.
Near the start, the word zombie is used twice. This will need to be changed to Ghost. So where it says :
public class Zombie extends Mob { it needs to say,
public class Ghost extends Mob { and so forth.

Then in com.mojang.ld22.level.Level.java you will need to import the new monster, and then set it up to show up.

I have added a slew of monsters, In my mod, that part looks like this:

public void trySpawn(int count) {
for (int i = 0; i < count; i++) {

int minLevel = 1;
int maxLevel = 1;
if (depth < 0) {
maxLevel = (-depth) + 1;
}
if (depth > 0) {
minLevel = maxLevel = 4;
}

int lvl = random.nextInt(maxLevel - minLevel + 1) + minLevel;
Mob mob;

if (random.nextInt(3) == 0)
mob = new Slime(lvl);
else
if(random.nextInt(3) == 0)
mob = new Zombie(lvl);
else
if(random.nextInt(3) == 0)
mob = new Girl(lvl);
else
if(random.nextInt(5) == 0)
mob = new GhostGirl(lvl);
else
if(depth != 0 )
mob = new Zombie(lvl); //This prevents animals downstairs
else
if(random.nextInt(3) == 0)
mob = new Turducken(lvl);
else
if(random.nextInt(3) == 0)
mob = new Ship(lvl);
else
if(random.nextInt(3) == 0)
mob = new Muncher(lvl);
else
if(random.nextInt(3) == 0)
mob = new Piggy(lvl);
else
if(random.nextInt(3) == 0)
mob = new MonkeyBoy(lvl);
else
if(random.nextInt(3) == 0)
mob = new Saurus(lvl);
else
if(random.nextInt(3) == 0)
mob = new LandShark(lvl);
else
mob = new Zombie(depth);

if (mob.findStartPos(this)) {
this.add(mob);
}
}

So we will need to add a bit into the above code. A set of lines that would look like this:

else
if(random.nextInt(3) == 0)
mob = new Ghost(lvl);

The (3) in the code above controls how likely the monster created will be this monster. The code above, tries the first, and if it fails, it goes down the list until a monster is added.

At this point you have added a monster, but it is exactly like a zombie. Not much point in that.
So you will have to edit the icon.png file that you have in source or alter the monsters color.

In Ghost.java, since it is a blatant rip of Zombie.java, there will be a line of code like this at the beginning of the render statement:
int xt = 0;
int yt = 14;


This tells the software where to grab the images from. On my sheet of images, here some of the references I use:

xt = 0; // Original Form
yt = 14;

xt = 16; // Girl
yt = 14;

xt = 8; // Wizard
yt = 14;

xt = 24; // Old Man
yt = 14;

xt = 8; // MonkeyBoy
yt = 26;

xt = 8; // MossMan
yt = 22; }


If you are going to do much work with modding this stuff, you will have to spend some quality time testing positions and tweaking values on your own.

Changing color is easier. The code looks like this:
int col = Color.get(-1, 10, 252, 050);
if (lvl == 2) col = Color.get(-1, 100, 522, 050);
if (lvl == 3) col = Color.get(-1, 111, 444, 050);
if (lvl == 4) col = Color.get(-1, 000, 111, 020);
This code changes the color of the zombie on different levels. in the top example, where it says Color.get(-1, 100, 522, 050); The four colors that will be shown will be -1 for transparent, 10 for dark green, 252 for light green and 050 for green. the three numbers are Red-Green-Blue. 10 means 0 red, 1 green and 0 blue. White would be 555.

So now you have a different looking monster, but it is still a zombie inside. Making it tougher to kill or more dangerous is OK, but it has been done and it does not add a whole lot to the experience. My ghost girl can walk through stone and trees. When she touches you, you change into a girl. When she dies, she leaves a small pile of gems behind. This makes her a bit dangerous, and hard to track down at times. But she is well worth tracking down.

Simple changes can alter the mood and that is a good thing, since figuring out good changes and how to make them is going to be the challenge and what makes your mod unique.

Now I am going back to the code myself. Now that I have fungus eating make you glow in the dark, I need to make eating too much fungus bad for you.


Top
 Profile  
 
 Post subject: Re: More Tutorials
PostPosted: Tue Jul 24, 2012 4:40 am 
Offline

Joined: Fri Jul 20, 2012 10:48 pm
Posts: 4
Thanks alot man I did copy Zombie but not level.java thanks ALOT :D .

Your mod sounds awesome I would like to play it can you put up the source code or not it doesn't matter but i would like it

thx!!!!


Top
 Profile  
 
 Post subject: Re: More Tutorials
PostPosted: Tue Jul 24, 2012 5:36 am 
Offline

Joined: Tue Dec 27, 2011 4:15 pm
Posts: 113
Glad to help, my mod is in the Mod Showcase, it is called MiniCrate. I post the Jar and the source. I have also kept each version and posted them there.


Top
 Profile  
 
 Post subject: Re: More Tutorials
PostPosted: Tue Jul 24, 2012 12:05 pm 
Offline
Site Admin

Joined: Fri Dec 23, 2011 2:55 am
Posts: 253
Thanks Bob this is great

I added it to the PlayMinicraft Tutorial area :)

_________________
Image
Image
Image


Top
 Profile  
 
 Post subject: Re: More Tutorials
PostPosted: Tue Jul 24, 2012 3:44 pm 
Offline

Joined: Fri Jul 20, 2012 10:48 pm
Posts: 4
I downloaded the source and is it ok if i use it
as a refrence for other stuff like new items, new furniture, and other cool stuff?

I havent played it yet but it sounds amazing :D


Top
 Profile  
 
 Post subject: Re: More Tutorials
PostPosted: Tue Jul 24, 2012 5:34 pm 
Offline

Joined: Tue Dec 27, 2011 4:15 pm
Posts: 113
The images there are all my own drawing, Notch's original work or modifications on Notch's work. I have been inspired by other peoples work,1 :lol: but have not copied them.
So here is the policy on using my work on Minicraft mods. As long as you extend the right to others to modify and loot your Minicraft mod work, and provide your source, Do it! Please!
With that in mind, I don't mind anyone taking my source and working from it as their starting point.

There is one exception to my requirement that you share forward and provide source if you use my code, images or whatever, if you are Notch, with my thanks you may take my work on MiniCraft, and use it as you will.


There are too many really brilliant mods out there that have not been touched for months. Their code could be live with tweaks, fixes and alterations.

I would love to add my silly transformations to delux, throw in the cloud shadows from cursed inventory, and add the cursed inventory options.

Each mod seems to have a goal built in. If they could be combined, the results could be spectacular.

Delux added depth, literally and figuratively. Delux also has some great mood work in it. Cursed Inventory added mystery and puzzle with some great mood work as well.. Alecraft was the first for building and mood. Infinity has added a wide selection of things and has potential to make minicraft more than just a cult following.

My own direction is to add fun. Seriously, the second you think you are able to dish out enough damage, swim out and defeat a boat. Tooling around the seas in a boat attacking other boats and turducken is a hoot. It also facilitates placing, odd objects, mysteries and buildings in remote places. A lot of my mods give an advantage that can suddenly go away at the wrong time, especially if you are not careful. So as much as throwing silly stuff in, a lot of the stuff has a cumulative effect.

I have a staff that can be made after you have a glowing golden anvil and a gem pick to harvest boxium. With the staff, you can plant flowers downstairs. Then you can unleash glowing fungus in the underworld and light up the levels, trapping monsters in the fungus forests. Then, if you go downstairs as a monkey, you can travel through the mushrooms entirely unmolested by anything but the ghost girl. You can always put sand downstairs and plant a cactus to stop her, but that hurts you too. Silly stuff, but as you combine the effects, it adds to the range and fun!

Bob


Top
 Profile  
 
 Post subject: Re: More Tutorials
PostPosted: Tue Jul 24, 2012 5:54 pm 
Offline

Joined: Tue Dec 27, 2011 4:15 pm
Posts: 113
shylor wrote:
Thanks Bob this is great

I added it to the PlayMinicraft Tutorial area :)


Sweet, I am happy to share the little that I have figured out so far!


Top
 Profile  
 
 Post subject: Re: More Tutorials
PostPosted: Fri Feb 08, 2013 4:38 pm 
Offline

Joined: Fri Feb 08, 2013 4:28 pm
Posts: 1
Thank you! Being 13-14 I haven't had much time to study code and all the funny ways it works.
I do know that it can be VERY difficult and challenging. 2% working 98% bugfixes.

I try and play as many mods as I can. Tootaloo!

PS: I player minicrate and it was great! (and Ima powt and I didnt know it)

Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Style created by © Matti, gry komputerowe, reklama sem reklama seo

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group