Weird question, but

Weird question, but

Postby Catching_Fire » 25 Aug 2011, 07:24

Whats the framework of Lava? (3.5? 4.0?) Im making custom commands that require C# 2010 Visual Studio and i need the framework..
Catching_Fire
 
Posts: 35
Joined: 23 Jul 2011, 05:31

Re: Weird question, but

Postby g0d01w4r99 » 25 Aug 2011, 11:59

Not a weird question at all, Dzienny mentioned in one of his changelogs that he moved MCDzienny to 4.0. If I may ask, what sort of a command are you working on?
Image
User avatar
g0d01w4r99
 
Posts: 453
Joined: 09 May 2011, 13:05
Location: Behind you.

Re: Weird question, but

Postby Catching_Fire » 25 Aug 2011, 17:08

g0d01w4r99 wrote:Not a weird question at all, Dzienny mentioned in one of his changelogs that he moved MCDzienny to 4.0. If I may ask, what sort of a command are you working on?


Some pretty usefull ones, a lot of them that reads .txt files, and moderation tools.
Catching_Fire
 
Posts: 35
Joined: 23 Jul 2011, 05:31

Re: Weird question, but

Postby g0d01w4r99 » 25 Aug 2011, 17:27

Ah, sweet. Could you share them?
Oh and, you seem to be very proficient in C# so Imma ask you a question.
I'm finally finished wrapping up my zombie survival, however, I'm missing one feature I wanted to add, which are levels. I've checked the code so I could copy and paste from somewhere else, but I didn't find anything. Disassembling MCDzienny proved to be not so effective, so I cant steal from it. Any ideas on how I could make an effective level system? The idea I have in mind is making a method read .txt files, XML coding, the same as Dzienny used for his levels. I'm kinda stuck on how to make that though. Any tips?
Image
User avatar
g0d01w4r99
 
Posts: 453
Joined: 09 May 2011, 13:05
Location: Behind you.

Re: Weird question, but

Postby Catching_Fire » 25 Aug 2011, 18:45

Here, This is a code from zombiegame in MCForge (https://github.com/mcforge/MCForge-Vani ... bieGame.cs)

This may help

Code: Select all
  public void changeLevel()
        {
            if (Server.ZombieModeOn == false)
                return;
            if (amountOfRounds == 1)
                return;
            Server.lastPlayerToInfect = "";
            Server.infection = false;
            try
            {
                DirectoryInfo di = new DirectoryInfo("levels/");
                FileInfo[] fi = di.GetFiles("*.lvl");
                int levelCount = 0;

                foreach (FileInfo file in fi)
                {
                    levelCount = levelCount + 1;
                }

                if (levelCount < 2)
                {
                    Player.GlobalMessage("You need more than 2 levels to enable the change levels function!");
                    return;
                }

                if (Server.queLevel == true)
                {
                    foreach (FileInfo file in fi)
                    {

                        String next = Server.nextLevel.ToLower();
                        Server.queLevel = false;
                        Server.nextLevel = "";
                        Command.all.Find("load").Use(null, next.ToLower());
                        Player.GlobalMessage("The next map has been chosen - " + c.red + next.ToLower());
                        Player.GlobalMessage("Please wait while you are transfered.");
                        String oldLevel = Server.mainLevel.name;
                        Server.mainLevel = Level.Find(next.ToLower());
                        Server.infection = false;
                        Player.players.ForEach(delegate(Player player)
                        {
                            if (player.level.name != next)
                            {
                                player.SendMessage("Going to the next map!");
                                Command.all.Find("goto").Use(player, next);
                                Thread.Sleep(1000);
                                // Sleep for a bit while they load
                                while (player.Loading) { Thread.Sleep(250); }
                            }
                        });
                        Command.all.Find("unload").Use(null, oldLevel);
                        return;

                    }
                }
                Random nextLevel = new Random();
                int level = nextLevel.Next(0, levelCount);
                int count = 0;
                Level current = Server.mainLevel;
                String level1 = "";
                String level2 = "";
                while (level1 == "")
                {
                    foreach (FileInfo file in fi)
                    {
                        string hi = file.Name.Replace(".lvl", "").ToLower();

                        if (count == level && hi != current.name.ToLower() && level2 != hi && Server.lastLevelVote1 != hi && Server.lastLevelVote2 != hi)
                        {
                            level1 = file.Name.Replace(".lvl", "").ToLower();
                            Server.lastLevelVote1 = hi;
                        }
                        else if (count == levelCount)
                        {
                            level = nextLevel.Next(0, levelCount);
                            count = 0;
                        }
                        else
                        {
                            count = count + 1;
                        }
                    }
                }
                int level5 = nextLevel.Next(0, levelCount);
                count = 0;
                while (level2 == "")
                {
                    foreach (FileInfo file in fi)
                    {
                        string hi = file.Name.Replace(".lvl", "").ToLower();

                        if (count == level5 && hi != current.name.ToLower() && level1 != hi && Server.lastLevelVote1 != hi && Server.lastLevelVote2 != hi)
                        {
                            level2 = file.Name.Replace(".lvl", "").ToLower();
                            Server.lastLevelVote2 = hi;
                        }
                        else if (count == levelCount)
                        {
                            level5 = nextLevel.Next(0, levelCount);
                            count = 0;
                        }
                        else
                        {
                            count = count + 1;
                        }
                    }
                }
                Server.votingforlevel = true;
                Server.NoLevelVotes = 0;
                Server.YesLevelVotes = 0;
                Player.GlobalMessage(" " + c.black + "Next Level Vote: " + Server.DefaultColor + level1 + " or " + level2 + " " + "(" + c.lime + "1 " + Server.DefaultColor + "/ " + c.red + "2" + Server.DefaultColor + ")");
                System.Threading.Thread.Sleep(15000);
                Server.votingforlevel = false;
                Player.players.ForEach(delegate(Player winners)
                {
                    winners.voted = false;
                });
                String nextl = "main";
                if (Server.NoLevelVotes >= Server.YesLevelVotes)
                {
                    nextl = level2;
                }
                else
                {
                    nextl = level1;
                }
                if (Server.queLevel == true)
                {
                    nextl = Server.nextLevel.ToLower();
                    Server.queLevel = false;
                    Server.nextLevel = "";
                }
                Command.all.Find("load").Use(null, nextl.ToLower());
                Player.GlobalMessage("The next map has been chosen - " + c.red + nextl.ToLower());
                Player.GlobalMessage("Please wait while you are transfered.");
                String oldLevelL = Server.mainLevel.name;
                Server.mainLevel = Level.Find(nextl.ToLower());
                Server.infection = false;
                Player.players.ForEach(delegate(Player player)
                {
                    if (player.level.name != nextl)
                    {
                        player.infected = false;
                        player.SendMessage("Going to the next map!");
                        player.color = player.group.color;
                        Player.GlobalDie(player, false);
                        Player.GlobalSpawn(player, player.pos[0], player.pos[1], player.pos[2], player.rot[0], player.rot[1], false);
                        Command.all.Find("goto").Use(player, nextl);
                        Thread.Sleep(1000);
                        // Sleep for a bit while they load
                        while (player.Loading) { Thread.Sleep(250); }
                    }
                });
                Command.all.Find("unload").Use(null, oldLevelL);
                return;
            }
            catch
            {
                Server.s.Log("An error occured");
                changeLevel();
            }
            changeLevel();
        }
Catching_Fire
 
Posts: 35
Joined: 23 Jul 2011, 05:31

Re: Weird question, but

Postby g0d01w4r99 » 25 Aug 2011, 19:44

Ah ehm, sorry mate, I didn't make myself clear enough. I meant the levels, the tiers.. the thing that grants you more water and such at the start of the map.
This:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<!--You can add as many tiers as you wish, but minimum number is 10. Also tier 1 always requires 0 experience.-->

<Levels>
<Level level="1" experience="0" water="0" hammer="0" door="0" sponge="0" />
<Level level="2" experience="500" water="0" hammer="0" door="0" sponge="0" />
<Level level="3" experience="1300" water="0" hammer="0" door="0" sponge="0" />
so on and so forth...
</Levels>

I got everything else to work properly, just those tiers/levels are giving me a headache :\
Image
User avatar
g0d01w4r99
 
Posts: 453
Joined: 09 May 2011, 13:05
Location: Behind you.

Re: Weird question, but

Postby Catching_Fire » 25 Aug 2011, 19:56

ooo.

I don't know, I stoped using the software long ago because the bugs are to severe.
Catching_Fire
 
Posts: 35
Joined: 23 Jul 2011, 05:31

Re: Weird question, but

Postby g0d01w4r99 » 26 Aug 2011, 08:55

Oh okay :)
Image
User avatar
g0d01w4r99
 
Posts: 453
Joined: 09 May 2011, 13:05
Location: Behind you.

Re: Weird question, but

Postby Catching_Fire » 26 Aug 2011, 19:05

But i do say, You might wanna use MCForge when it comes to Zombie Survival.
Catching_Fire
 
Posts: 35
Joined: 23 Jul 2011, 05:31

Re: Weird question, but

Postby g0d01w4r99 » 26 Aug 2011, 20:28

Ah yeah, I noticed they finished the Infection type zombie survival too. And it seems they're doing spleef and lava too. Pfft. This makes MCDzienny useless :\. But I doubt they'll do levels and such so MCDzienny is still better when it comes to lava survival IMO.
Image
User avatar
g0d01w4r99
 
Posts: 453
Joined: 09 May 2011, 13:05
Location: Behind you.

Next

Return to Help

Who is online

Users browsing this forum: No registered users and 23 guests

cron