Raised This Month: $ Target: $400
 0% 

[L4D] Unscrambler


Post New Thread Reply   
 
Thread Tools Display Modes
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 12-29-2008 , 14:47   Re: [L4D] Unscrambler
Reply With Quote #31

Quote:
Originally Posted by Antithasys View Post
Could you not hook a few events, like round start, round end, and change team.

That way if the round starts, and the players team variable is empty, then its a new map and load up the team variables. If the player changes team and the team event fires before the end of the round, then load up his new team in the variable. If the round end fires and then round start fires again, and the variables are not zero'd out, then you need to check teams and put everyone on the right team. You could also use the team index numbers (0,1,2,3,4) etc. instead of the signatures.

Like I said, I am sure there is a reason you are doing it the way you are, just wondering if the method I mentioned would work (if you tried it), and if not why.

I have a windows server so if this method worked, it would work for all.
I don't really understand your suggested method. In particular, "instead of the signatures." If you mean the SDKCall stuff, that's you can't use ChangeClientTeam() to move someone to survivor and have it do what you (probably) want. It won't "spawn" the player in or give them control of a survivor bot.

I don't use round_start or round_end because I only move people when the map begins. I just use OnMapStart to start team checking/fixing and player_team to store teams. I might end up using round_end to fix the problem ChillyWI is experiencing.

If you're suggesting to just use an array indexed by client ID to store teams, then I didn't want to assume everyone will get the same client ID after a map change's disconnect/reconnect. So I track by SteamID.

Almost all the complexity is just edge cases and making it as invisible to random players as possible. If I waited for everyone to load in and did a big mass swap, it'd be easier, but I know random llamas will quit in fear ("OMG WTF HAPPND TIHS SERVAR SUCKS"). Same reason I don't freeze everyone like Chilly asked. Even if I explain in a chat message, people are dumb. And playing 4 on 3 is terrible.

Most of the work is deciding who to swap, and whom to swap them with.

I'm not saying my code doesn't suck, though.
Fyren is offline
Antithasys
Moderator
Join Date: Apr 2008
Old 12-29-2008 , 17:06   Re: [L4D] Unscrambler
Reply With Quote #32

Quote:
Originally Posted by Fyren View Post
I don't really understand your suggested method. In particular, "instead of the signatures." If you mean the SDKCall stuff, that's you can't use ChangeClientTeam() to move someone to survivor and have it do what you (probably) want. It won't "spawn" the player in or give them control of a survivor bot.
Ok that answers a lot of the questions right there. If that doesn't work then you would have to do it with SDK calls.

Quote:
Originally Posted by Fyren View Post
I'm not saying my code doesn't suck, though.
lol. Your code is fine

Was just wondering why you were doing it that way.
__________________
[my plugins]

When you think about asking a question... consider what have you tried?
Antithasys is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 12-29-2008 , 19:50   Re: [L4D] Unscrambler
Reply With Quote #33

Quote:
Originally Posted by ChillyWI View Post
Nope. About a week ago I did a fresh install of L4D and Sourcemod. I removed the nextmap plugin and the "fun" plugins, but otherwise left it stock.
Try the attached smx. It's got debug on and might fix the unexpected full team swapping, but I haven't tested it at all (so it might not properly swap teams at all or make your computer explode or something as untested code is wont to do) and might not get a chance tonight. Don't load both copies of the plugin by accident, heh.

Last edited by Fyren; 12-30-2008 at 10:24. Reason: newer test version below
Fyren is offline
ChillyWI
Senior Member
Join Date: Aug 2008
Old 12-30-2008 , 00:30   Re: [L4D] Unscrambler
Reply With Quote #34

I think it might have worked, but I'll have to test it some more. We played one game tonight. For some reason I had to switch manually on the second stage, but like I said, I'll have to test it some more.
ChillyWI is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 12-30-2008 , 10:25   Re: [L4D] Unscrambler
Reply With Quote #35

Quote:
Originally Posted by ChillyWI View Post
I think it might have worked, but I'll have to test it some more. We played one game tonight. For some reason I had to switch manually on the second stage, but like I said, I'll have to test it some more.
Fixed that. Try this new test version.

Last edited by Fyren; 01-01-2009 at 21:04. Reason: removing test version
Fyren is offline
ChillyWI
Senior Member
Join Date: Aug 2008
Old 12-31-2008 , 00:29   Re: [L4D] Unscrambler
Reply With Quote #36

Think it worked. We played one game and everyone ended up on the right teams, with us getting swapped around at least twice. Looking good so far, but I'll test some more and report back.
ChillyWI is offline
Ydiss
Member
Join Date: Jan 2009
Old 01-01-2009 , 17:30   Re: [L4D] Unscrambler
Reply With Quote #37

The latest built appears to work perfectly. It even re-scrambled an entire team when we just tried it.

I cannot thank you enough for this mod, it's an absolute life-saver and is, without question, the best mod out right now (in as much as the pain is relieves!).

Thank you so much. You should know that hundreds of people enjoy your mod on our server

Keep up the good work.
Ydiss is offline
santaclaus
Senior Member
Join Date: Dec 2008
Old 01-01-2009 , 18:27   Re: [L4D] Unscrambler
Reply With Quote #38

windows *wish*
__________________

santaclaus is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 01-01-2009 , 21:03   Re: [L4D] Unscrambler
Reply With Quote #39

Updated main post with another bug fix, newer than the last test version. Still no Windows, sorry.
Fyren is offline
Number Six
Senior Member
Join Date: Dec 2008
Old 01-02-2009 , 01:37   Re: [L4D] Unscrambler
Reply With Quote #40

Quote:
Originally Posted by Fyren View Post
Updated main post with another bug fix, newer than the last test version. Still no Windows, sorry.
Debug On , the return on that last version ^^ ?
__________________


Number Six is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:56.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode