1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Hey Guest, is it this your first time on the forums?

    Visit the Beginner's Box

    Introduce yourself, read some of the ins and outs of the community, access to useful links and information.

    Dismiss Notice

Switch a player's team upon death

Discussion in 'Modding Help' started by Frikman, Sep 6, 2016.

Tags:
  1. Frikman

    Frikman Bison Rider

    Messages:
    162
    Hi, there's a little detail I'd like to adress for ZFM+, and that is switching players to the undead team upon death. I tried something quite simple to achieve it
    Code:
        void onPlayerDie(CPlayer@ victim, CPlayer@ killer, u8 customData)
        {
            if (!rules.isMatchRunning()) { return; }
    
            if (victim !is null )
            {
                if (killer !is null && killer.getTeamNum() != victim.getTeamNum())
                {
                    addKill(killer.getTeamNum());
                    Zombify ( victim ); //currently not working, this should switch players to the red team and make them zombies
                }
            }
        }
       
        void Zombify( CPlayer@ player)
        {
            PlayerInfo@ pInfo = getInfoFromName( player.getUsername() );
            print( ":::ZOMBIFYING: " + pInfo.username );
            ChangePlayerTeam( player, 1 );
        }
    But, sadly, it does nothing. At some point (when it actually works) I want to make this check the day/gametime and start switching people only after day 6-7 or something. Any ideas of why it doesn't work?
     
  2. makmoud98

    makmoud98 You are already DEAD Forum Moderator Staff Alumni Tester

    Messages:
    586
    Regular zombies are not players, they are only blobs. This code would only work if someone was already playing as a zombie and they killed a human.
     
    blackjoker77777 likes this.
  3. Learner

    Learner Base Burner

    Messages:
    9
    Err, pardon my (lengthy) intrusion, for I have no direct advice on how to help solve your problem, but because I have some burning questions on the balancing changes (and maybe designer's vision) this would cause to the gameplay, I was hoping that this was sufficient enough for me to show up and ask maybe? (If that's all right I mean? Also, please excuse it's lengthiness! I didn't realize how long it had become!)

    So... in short, with what you're trying to achieve, are you implying that past the midway point of a game (7 days into a 15 day long game), that anyone who dies would become an undead zombie, working for the opposing team, for good until the game's end?

    If so, wouldn't this gameplay design change drastically weigh the odds against the survivors? Semi-brainless AI zombies are predictable, and that makes them simple to manage, but they're an attrition to any structure given enough time. But human players however... they're thoroughly cunning, dangerously persistent, and sometimes dirty rats.

    In addition, how would this change interact with some other functions? Would human necromancers resurrect undead players and bring them back to the survivor's side? Would there be some risk & reward for retrieving an enemy players corpse and bringing it to a wizard shop? Is there any possibility for the survivors to restore a zombie players humanity?

    More importantly, what about any cases where a player would endlessly throw his life away at the first opportunity to work with the undead, just so that he or she could justifiably troll, wreck, and destroy the survivor's creations? Or vice-versa, (in the possibility that this hasn't already been thought of) where a player might try to quit and reconnect after dying, to try and rejoin the survivors?

    There's a lot of dangerous possibilities to this. If you're adamant about going through with this, I at the very least and as politely as I can possibly be, request that you reconsider the point at which players will then start becoming undead. Please forgive me for my presumptuous statements (aka me telling you how things are), but allowing team conversion only halfway through a game (which to me feel like it's around the point where things really start to pick up) just simply feels a little too soon.

    The longer a game goes on, the more emotionally invested a player would become in their possible victory (unless there's extreme lag). This usually means there's less incentive to be risky, which means fewer deaths by bold foolishness! (In my mind though, I feel like the deaths still even out, because of the heightened difficulty from the zombies.)

    This is why I feel like Day 10 would be an appropriate starting point. Plus to add to that, its not only a nice double digit number, but it's a noteworthy day, because a boss spawns on that day (I think anyways), and is also the 3/4ths completion point in the game.

    Anyways... these are just my thoughts on the matter... by no means are you obligated to read or listen to any of this! (Plus, considering how long and boring it looks to read, I wouldn't fault you for not reading it...)

    What's important is that it's still your mod project, so ultimately it's your decision to decide how you want it to be played, what you choose to put in it, and who you choose to listen to when they have stuff to say about it. Even if you decided to give the zombies rocks and molotovs to throw, made gregs drop water bombs on your face, and gave the zombie knights giant riot shields, I'd still play it! (Can you say "Angry Undead Mob Simulator"?)

    And even if you considered all of my ideas to be terrible, I'd be happy enough knowing you trudged on through and chose to read them. Lastly and most importantly, you already have my like, appreciation and respect for putting so much effort in the mod, and there's no losing that no matter how you react or what you put into the game. So please, do keep up the good work! (And thank you for bothering to read this stuff if you did!) ::):
     
    Last edited: Sep 7, 2016
    Frikman likes this.
  4. Frikman

    Frikman Bison Rider

    Messages:
    162
    This is quite interesting. I tested it and, in fact, works like that, which gives me a few naughty ideas :^)
    Currently the only way you could become an undead is by finding a scroll, but letting undead players "zombify" alive players sounds really tasty, like some sort of disease or plague. I still want to know how I could make players become undead if they die by other means, but for now this works.

    7 was just a random number, but I too feel might be soon. As a planned feature I thought it would be nice to add a "purification" scroll that makes you human again, so there's that. I'm happy to know you enjoy the mod and that you're willing to write long messages to adress things, but next time you should post this questions on the resource page to keep this topic-related c:
     
    Learner likes this.
  5. Learner

    Learner Base Burner

    Messages:
    9
    My bad man. I sort of assumed it was topic related, because it pertained to the subject of zombifying players upon death, of which the OP was a question on how to obtain that.