Hey guys, I figured I would release some code to show you how to make entities programmatically. Tommorow I'm going to be posting a tutorial on vTables and adding different behaviors/attributes to your entities (ex health, drop item, movement, etc.), but this is a good start =).
/*
Entity Creation Research and Code by Carter Feldman - aka TreeBl
If you use this, you MUST NOT remove this comment block.
Licensed under the creative commons attribution license.
*/
//Add this to the top of your tweak
typedef void (*int2)(int a, int B);
typedef void (*int3)(int a, int b, int c);
typedef void (*ifff)(int a, float b, float c, float d);
int2 MakeAnimal;
int2 LevelAddEnt;
int3 MobSetSize;
ifff setPos;
//--End
//Add this below
unsigned int * makeChicken(float x, float y, float z, char * imageName)
{
unsigned int * chicken = new unsigned int[0xC30/4];
MakeAnimal((int)chicken,(int)levelAddr);
chicken[0] = (unsigned int)(0x207AA8-0x1000+myPidAddr);//vtable
*((char *)((int)chicken+0xC14)) = 0;
chicken[0xC18/4] = 0;
chicken[0xC1C/4] = 0;
chicken[0xC20/4] = 0;
chicken[0xC24/4] = 0;
chicken[0xC28/4] = 0x3F800000;
chicken[0xC2C/4] = 0;
chicken[0xb0/4] = 6;
std::string * charImg = (std::string *)((int)chicken+0xB64);
*charImg = imageName;
MobSetSize((int)chicken, 0x3E99999A, 0x3F333333);
setPos((int)chicken,x,y,z);
LevelAddEnt(levelAddr,(int)chicken);
return chicken;
}
unsigned int * makeCow(float x, float y, float z, char * imageName)
{
unsigned int * cow = new unsigned int[0xC30/4];
MakeAnimal((int)cow,(int)levelAddr);
cow[0] = (unsigned int)(0x207CF8-0x1000+myPidAddr);
cow[0xb0/4] = 7;
std::string * charImg = (std::string *)((int)cow+0xB64);
*charImg = imageName;
MobSetSize((int)cow, 0x3f666666, 0x3FA66666);
setPos((int)cow,x,y,z);
LevelAddEnt(levelAddr,(int)cow);
return cow;
}
//--End
//Add this somewhere else and call it on init
void setupCFunctions(int baseAddress)//Call this with the base address of minecraftpe
{
int myPidAddr=baseAddress;
MakeAnimal = (int2)(0xB2004-0x1000+myPidAddr);
MobSetSize = (int3)(0xC124C-0x1000+myPidAddr);
setPos = (ifff)(0xB5174-0x1000+myPidAddr);
LevelAddEnt = (int2)(0xF4FAC-0x1000+myPidAddr);
}
//--End
Example Usage:
unsigned int * myCow = makeCow(10.0f, 100.0f, 20.0f, "mob/cow.png");
unsigned int * myCow2 = makeCow(10.0f, 100.0f, 20.0f, "mob/customskin.png");
unsigned int * myChicken = makeChicken(10.0f, 100.0f, 20.0f, "mob/chicken.png");
unsigned int * myChicken2 = makeChicken(10.0f, 100.0f, 20.0f, "mob/customchicken.png");
Personally I don't care when it comes out cause it will come out he's working on lots of boundries most people thought were not possible SO GIVE HIM TIME
please make a really thorough tutorial. this is exactly what i need to make the mod i wanted to. can you please also show how to give an animal properties of two different mobs? is it possible to make a mob catch you on fire when it attacks you?
Hey guys, I figured I would release some code to show you how to make entities programmatically. Tommorow I'm going to be posting a tutorial on vTables and adding different behaviors/attributes to your entities (ex health, drop item, movement, etc.), but this is a good start =).
Example Usage:
Check out my game! It's an open-world, sandbox text adventure.
Follow @hexdro_
Hexdro © 2012-2015
Personally I don't care when it comes out cause it will come out he's working on lots of boundries most people thought were not possible SO GIVE HIM TIME
I am not sure when I will release it, stop asking.
How long have you been playing Pocket Edition?
Ok DUDE
ARE YOU STILL WORKING ON IT?
Sorry I meant encoded it
I'm one of the 90%
Wrong topic, bud...
here
you need his mod to execute those strings. how could you miss that on the video? so on your mod topic, does it mean it isn't real?