I want to try and create a Zombie server from fCraft

For all mod-related questions and custom code.
Post Reply
Jonty800
Offline
Posts: 280
Joined: August 21st, 2011, 6:31 am
Location: United Kingdom
Contact:

I want to try and create a Zombie server from fCraft

Post 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
You cannot use certain BBCodes: [img].

User avatar
fragmer
fCraft Developer
Offline
Posts: 1386
Joined: May 21st, 2011, 10:53 pm

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

Post 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.

Jonty800
Offline
Posts: 280
Joined: August 21st, 2011, 6:31 am
Location: United Kingdom
Contact:

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

Post by Jonty800 »

Ah! Thanks a lot Fragmer :)
You cannot use certain BBCodes: [img].

Jonty800
Offline
Posts: 280
Joined: August 21st, 2011, 6:31 am
Location: United Kingdom
Contact:

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

Post 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?
You cannot use certain BBCodes: [img].

User avatar
fragmer
fCraft Developer
Offline
Posts: 1386
Joined: May 21st, 2011, 10:53 pm

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

Post by fragmer »

Go ahead and mod /sinfo if you'd like, the license doesn't say anything about that :P

barrowboyjames
Offline
Posts: 309
Joined: June 25th, 2011, 2:02 pm

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

Post by barrowboyjames »

You MUST PM me when it's done, the only onw I know of crashes my computer
Bloody_Llama wrote:Portals are like flavored condoms: an interesting idea, but not something you ever actually want to use in practice.
0_o
Ollieboy wrote:The taste runs out really quickly, and then your just stuck sucking on a bit of rubber around a banana.

Jonty800
Offline
Posts: 280
Joined: August 21st, 2011, 6:31 am
Location: United Kingdom
Contact:

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

Post 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
You cannot use certain BBCodes: [img].

Post Reply