Search Results
|
Post |
Author |
Forum |
Replies |
Views |
Posted
[asc]
|
|
|
Thread: Mobs spawning
Post: RE: Mobs spawning
ok, a little bit to myself - missing pieces in code:
cChunkSender::SendChunk
// TODO: Send entity spawn packets
cChunkSender::Entity
// Nothing needed yet, perhaps in the future when we save enti... |
|
steven2612 |
Development
|
29 |
23,148 |
12-02-2012, 09:54 AM |
|
|
Thread: Mobs spawning
Post: RE: Mobs spawning
i've tried already in setchunkdata() and setalldata ... but then it loops endlessly in the generating loop .. i don't know why |
|
steven2612 |
Development
|
29 |
23,148 |
11-25-2012, 10:45 PM |
|
|
Thread: Mobs spawning
Post: RE: Mobs spawning
I've now tried many variations to create a Mob within th Finishing Generator - but it seem's i'm missing something it wont spawn any mobs ... :(
Maybe someone could help with this ? |
|
steven2612 |
Development
|
29 |
23,148 |
11-25-2012, 01:49 PM |
|
|
Thread: Mobs spawning
Post: RE: Mobs spawning
ok, i tried:
void cEntity::SetPosition( const double & a_PosX, const double & a_PosY, const double & a_PosZ )
{
m_Pos.Set( a_PosX, a_PosY, a_PosZ );
if (m_World!=NULL) {
... |
|
steven2612 |
Development
|
29 |
23,148 |
11-25-2012, 08:26 AM |
|
|
Thread: Mobs spawning
Post: RE: Mobs spawning
ok - in contructor there is no reference to cWorld - but in initialize.
i've now tried:
int x = a_ChunkX+10;
int z = a_ChunkZ+10;
int y = cChunkDef::GetHeight(a_HeightMap, x,... |
|
steven2612 |
Development
|
29 |
23,148 |
11-25-2012, 12:47 AM |
|
|
Thread: Mobs spawning
Post: RE: Mobs spawning
yes ...
void cEntity::Initialize(cWorld * a_World)
{
m_World = a_World;
m_World->AddEntity( this );
MoveToCorrectChunk(true);
} |
|
steven2612 |
Development
|
29 |
23,148 |
11-24-2012, 11:41 PM |
|
|
Thread: Mobs spawning
Post: RE: Mobs spawning
hm .. i looked into the finisher .. i didn't find an example where entities are generated. so i am quite unshure how to generate them.
in world.cpp there is a spawnmob function - but can/should i use ... |
|
steven2612 |
Development
|
29 |
23,148 |
11-24-2012, 11:20 PM |
|
|
Thread: Mobs spawning
Post: RE: Mobs spawning
;)
yes and no - i wanted to have an playable survival server with mcserver .. so i've to do something myself ...
i've not so much spare time, but i try to help as good as i can.
but first of all i wa... |
|
steven2612 |
Development
|
29 |
23,148 |
11-23-2012, 12:56 AM |
|
|
Thread: Mobs spawning
Post: RE: Mobs spawning
xoft Wrote: (11-22-2012, 11:52 PM)
--
If you want to store them, you need to modify WorldStorage/WSSAnvil.h + .cpp to include entities when saving world, and then loading them back again from the fil... |
|
steven2612 |
Development
|
29 |
23,148 |
11-23-2012, 12:03 AM |
|
|
Thread: Mobs spawning
Post: RE: Mobs spawning
As i'm digging in the source code ... as i can see Entities are not yet read or stored with World Data ?
From the wiki:
"Approximately one in ten newly generated chunks will contain mobs, usually in ... |
|
steven2612 |
Development
|
29 |
23,148 |
11-22-2012, 10:54 PM |
|
|
Thread: Mobs spawning
Post: RE: Mobs spawning
ok - that means i've to wait for the client ? I thought the client handles the animation independly of the server ... |
|
steven2612 |
Development
|
29 |
23,148 |
11-20-2012, 09:02 PM |
|
|
Thread: Mobs spawning
Post: RE: Mobs spawning
ok, that's what i've thought. This is done when health=0. I don't understand why the destroying is delayed when health=0 ? |
|
steven2612 |
Development
|
29 |
23,148 |
11-20-2012, 08:24 PM |
|
|
Thread: Mobs spawning
Post: RE: Mobs spawning
Code:
--
m_DestroyTimer += a_Dt/1000;
--
what is a_Dt - when debugging the value is mostly the same - so i can't see what this line will do ?
Is a_Dt the difference time to the last Tick ? Sh... |
|
steven2612 |
Development
|
29 |
23,148 |
11-20-2012, 11:20 AM |
|
|
Thread: Mobs spawning
Post: RE: Mobs spawning
should i post actual patch files when working on it, or do you prefer other ways to share code ? |
|
steven2612 |
Development
|
29 |
23,148 |
11-20-2012, 01:26 AM |
|
|
Thread: Mobs spawning
Post: RE: Mobs spawning
Yes - i've read the spawning alogrithm of vanilla just today - but as i can see it is not so far away from what i've imaged. At the moment i am a little bit experimenting to see how the code works. wi... |
|
steven2612 |
Development
|
29 |
23,148 |
11-20-2012, 01:06 AM |
|
|
Thread: Mobs spawning
Post: RE: Mobs spawning
xoft Wrote: (11-19-2012, 04:33 PM)
--
I think the vanilla spawning algorithm is pretty good, and it is documented quite well in the minecraft wiki. Having that implemented in MCServer would be great.... |
|
steven2612 |
Development
|
29 |
23,148 |
11-19-2012, 11:40 PM |
|
|
Thread: Mobs spawning
Post: Mobs spawning
I am just trying to rework the Mob spawning code.
At first I stopped limitless spawning mobs.
Second I spawn up to 50 mobs every 2 seconds when a player is online.
Third I destroy every mob after 1... |
|
steven2612 |
Development
|
29 |
23,148 |
11-19-2012, 11:56 AM |