Hey, guys, I need some help. I'm currently working on a ModPE script, but I don't know how to get randomly generated structures and ores, and increase/decrease the ore(s) spawn rate. Can you please help? Also, how to map the textures to the ores would be a lot of help. Thanks in advance!
Hey, guys, I need some help. I'm currently working on a ModPE script, but I don't know how to get randomly generated structures and ores, and increase/decrease the ore(s) spawn rate. Can you please help? Also, how to map the textures to the ores would be a lot of help. Thanks in advance!
var h = 16 //Spawn Hight Ceiling
var i = 17 //Replace 17 with the ID of your custom block
var r = Math.floor(Math.random()*10/*RandomSpawning Percentage*/;+1;
for(var x = 0; x < 255; x++)
{
for(var y = 0; y < h; y++)
{
for(var z = 0; z < 255; z++)
{
if(getTile(x,y,z)!=0&&r=0)
{
setTile(x,y,z,i);
setTile(x+1,y,z,i);
setTile(x,y,z-1,i);
}
}
}
}
var h = 16 //Spawn Hight Ceiling
var i = 17 //Replace 17 with the ID of your custom block
var r = Math.floor(Math.random()*10/*RandomSpawning Percentage*/;+1;
for(var x = 0; x < 255; x++)
{
for(var y = 0; y < h; y++)
{
for(var z = 0; z < 255; z++)
{
if(getTile(x,y,z)!=0&&r=0)
{
setTile(x,y,z,i);
setTile(x+1,y,z,i);
setTile(x,y,z-1,i);
}
}
}
}
Use that with a few other variable to toggle it
Hope this helps!
~Matt
Thank you! I'm trying to learn ModPE/JavaScript while developing an advanced program. Once again: thanks!
What mobile application do you recommend I use for textures? And how can I create a custom mob model?
Custom mob model
Sorry I'm no help for textures :3
Also check this out : a mod of mine which adds random structures to the game, in a new biome randomly generated. Take a look at the code!
Custom mob model
Sorry I'm no help for textures :3
Also check this out : a mod of mine which adds random structures to the game, in a new biome randomly generated. Take a look at the code!
= (Math.floor((Math.random()*10)+8)))+8);
Is ((Math.random()*10)+8)) the random genorator? The *10 part, I mean
Custom mob model
Sorry I'm no help for textures :3
Also check this out : a mod of mine which adds random structures to the game, in a new biome randomly generated. Take a look at the code!
(Math.floor((Math.random()*10)+8)))+8);
Is ((Math.random()*10)+8)) the random genorator? The *10 part, I mean
Ouch, you didn't pick the easiest
well well. here's a randomly generated value :
var maxvalue=10;
var minvalue=1
var random=Math.floor((Math.random()*maxvalue)+minvalue);
This will give you a random value between 1 and 10
Hope it helps you out.
Just for you to know, this :
(Math.floor((Math.random()*10)+8)))+8);
Was part of the same type of code.
Only, the maxvalue was random, too!
Which means it looked like something like this :
var minvalue=8;
var random=Math.floor((Math.random()*(Math.floor((Math.random()*10)+1)))+minvalue);
this gives you a value between 9 and more or less 9 to 19 (don't know if this is very clear) xD
Of course, this seems useless : why not make simply a value from 9 to 19 ?
But the generation of the terrain then changed according to the max value, so I choose to do this this way.
DUDE, YOU ROCK!!! THANKS MAN!
(Maybe someday ou and I can create mods together, when I'm not a n00b?)
The Meaning of Life, the Universe, and Everything.
Location:
Auckland
Join Date:
9/20/2014
Posts:
126
Minecraft:
softmage114486
Xbox:
softmage114486
Member Details
You can use mercator to convert the terrain-atlas.tga to a png file then use isopix to edit the texture then convert it back to a tga compress the folder and then you have custom textures if you have a pc i recomend using paint.net because you can edit .tga files without having to convert them, i hope this helps :D!!
Rollback Post to RevisionRollBack
This is my signature..
clicked block quote Hey..How do i turn it off?Help! I'm scared This is my life now...
oh..
To post a comment, please login or register a new account.
var h = 16 //Spawn Hight Ceiling var i = 17 //Replace 17 with the ID of your custom block var r = Math.floor(Math.random()*10/*RandomSpawning Percentage*/;+1; for(var x = 0; x < 255; x++) { for(var y = 0; y < h; y++) { for(var z = 0; z < 255; z++) { if(getTile(x,y,z)!=0&&r=0) { setTile(x,y,z,i); setTile(x+1,y,z,i); setTile(x,y,z-1,i); } } } }Use that with a few other variable to toggle it
Hope this helps!
~Matt
Thank you! I'm trying to learn ModPE/JavaScript while developing an advanced program. Once again: thanks!
What mobile application do you recommend I use for textures? And how can I create a custom mob model?
Thank you, too!
Is ((Math.random()*10)+8)) the random genorator? The *10 part, I mean
Is ((Math.random()*10)+8)) the random genorator? The *10 part, I mean
DUDE, YOU ROCK!!! THANKS MAN!
(Maybe someday ou and I can create mods together, when I'm not a n00b?)
If you need it private message me
I've been using a laptop to write the script on, then I've been testin on my brothers kindle. I'm also out of an android currently : P