Page 1 of 1

I want to try and create a Zombie server from fCraft

Posted: August 28th, 2011, 9:14 pm
by Jonty800
Hey, I wanted to try and turn fCraft into a Zombie survival server, much like ven000m has.

I was wondering if there was anything in the code for "player bumping into player" for when a player becomes a Zombie. I can't seem to see anything like that anywhere :S

Also, would you recommend I base this on branch 0.33x for the /nick feature or do you think I'd be able to make a /nick feature for playerDB v3?

Thanks :D

Re: I want to try and create a Zombie server from fCraft

Posted: August 29th, 2011, 2:33 am
by fragmer
To detect players bumping into each other, I suggest adding adding a hook to Server.PlayerMoved event. You'll be able to go ahead and check the new coordinates against all other players' coords, and calculate the distance. If they're closer than a certain threshold, that's a bump. If you don't want to deal with events, modify Session.ProcessMovementPacket() code.

I would very strongly advise against using fCraft 0.33x - it is many months out of date, and is ridden with old bugs. I recommend using 0.536 (latest code on SVN /branch-0.53x/) instead.

Instead of using a /nick command, you can add some custom code to Session.UpdateVisibleEntities(). Around line 1129-1131 there is some code that checks whether player's rank has changed:

Code: Select all

if( entity.LastKnownRank != otherPlayer.Info.Rank ) {
    ReAddEntity( entity, otherPlayer, otherPos );
    entity.LastKnownRank = otherPlayer.Info.Rank;
}...
That's the code that updates players' displayed in-game name when the rank changes. You can expand that to also update players' displayed in-game name when they switch to/from zombies.

Re: I want to try and create a Zombie server from fCraft

Posted: August 29th, 2011, 7:39 am
by Jonty800
Ah! Thanks a lot Fragmer :)

Re: I want to try and create a Zombie server from fCraft

Posted: August 29th, 2011, 10:31 am
by Jonty800
Would it be ok to change the software information in /sinfo to "MyVersionName based on fCraft r701 by Fragmer" or would your license not allow that?

Re: I want to try and create a Zombie server from fCraft

Posted: August 29th, 2011, 11:18 am
by fragmer
Go ahead and mod /sinfo if you'd like, the license doesn't say anything about that :P

Re: I want to try and create a Zombie server from fCraft

Posted: August 29th, 2011, 12:04 pm
by barrowboyjames
You MUST PM me when it's done, the only onw I know of crashes my computer

Re: I want to try and create a Zombie server from fCraft

Posted: August 29th, 2011, 12:17 pm
by Jonty800
*if its done :P

Currently a bit stuck on the "player is same position as target" part.
Also, I decided to use branch 0.60x, I like that branch :P

I don't mind sharing the software once its done.
I guess the one that crashes is the once based on mclawl. "mcz..." cant remember its name.

If anyone wants to help on the project, feel free. You can share your code on au70galaxy.com/forums or tweet me on twitter.com/jonty800