May 12, 2021, 06:35:05 am

The Gang Garrison 2 Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

NOTICE: Due to a rise in bot activity, new posters need to be approved before posting.

Join the community Discord server!

Poll

what should the chat bubbles vote commands be?

c2, c3, c4, c5
- 7 (77.8%)
c2, c3, c8, c9
- 0 (0%)
x11, x12, x13, x14
- 1 (11.1%)
other(please comment)
- 1 (11.1%)

Total Members Voted: 9


Pages: [1] 2

Author Topic: Another Map Voting Plugin (Beta) (Server plugin)  (Read 4084 times)

MTK5012

  • 2011 Haxxy Finalist
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 773
  • if (ping <= 150) jaw.y += 100;
Another Map Voting Plugin (Beta) (Server plugin)
« on: April 29, 2013, 10:21:16 pm »

 :c1: voting speed increased
 :c1: no mind changing delay (except ping delay)
 :c1: -100% mind changing penalty
 :c1: -100% knockback exploitation
 :c1: increased fun while voting (or depression if you lost the round)
 :c1: can record maps played to see which one is the best/worst
 :z3: is beta version
 :z1: less complicated
 :z1: This plugin is unfinished, feedback is welcome
 :c2: map 1  :c3: map 2  :c4: map 3  :c5: no vote

Code: [Select]
/////////////////////
//MAP VOTING PLUGIN//
///by Gangsterman////
//version 1.0////////
/////////////////////

//chat bubble command (this is based on the chat bubble code)
//0-9: X, 1, 0-9// 10-19: X, 2, 0-9// 20-28: Z, 1-9// 29-35: X, 3-9// 36-44: C, 0-9; // 45: Medic chat bubble
global.VMBubbleCommand[1] = 37; //C2
global.VMBubbleCommand[2] = 38; //C3
global.VMBubbleCommand[3] = 39; //C4
global.VMBubbleCommand[4] = 40; //C5

//retype the tutorial if you change the bubble command or use the random option (keep the message in quote)
global.VMTutorial = "vote for next map: c2: map 1 ; c3: map 2 ; c4: map 3 ; c5: no vote.";

//vote time in second, note there will always be 5 seconds of map trasitioning
global.VMVoteTime = 24;

//hide map 3 name, turn it into a surprise
global.VMRandom = 0;

//next map is random, use when there is no vote at all
global.VMNextMapRandom = 0;

//record maps being picked to see which one is the least/most favourite. Records are stored in Map_Vote_Popularity file which can be opened by notepad
global.VMRecord = 0;


//THE CODE BELOW SHOULD BE LEFT ALONE//

//Initialization
global.VMOption[1] = "";
global.VMOption[2] = "";
global.VMOption[3] = "";
global.VMOption[4] = "";
global.VMMapVoting = 0;
global.VMMaps = ds_list_create();
global.VMResult = ds_priority_create();
ds_priority_add(global.VMResult, 1, 0);
ds_priority_add(global.VMResult, 2, 0);
ds_priority_add(global.VMResult, 3, 0);
ds_priority_add(global.VMResult, 4, 0);
object_event_add(Player, ev_create, 0, "
VMVote = 4;
");
global.VMMessage = "";

//not enough maps
if ds_list_size(global.map_rotation) < (4+sign(global.VMNextMapRandom)) {
show_message("Map voting plugin failed to load, please have more than 3 maps in the map rotation.");
exit;
}

//////////
//VOTING//
//////////

object_event_add(GameServer, ev_step, ev_step_begin, "
//BEGIN OF VOTING SESSION
if (impendingMapChange == 1)
if (global.nextMap != global.currentMap) and (global.VMMapVoting == 0) {
//voting session
global.VMMapVoting = 1;
impendingMapChange = ceil(global.VMVoteTime*30);
//pick 3 different maps
randomize();
ds_list_copy(global.VMMaps, global.map_rotation);
ds_list_delete(global.VMMaps, ds_list_find_index(global.VMMaps, global.currentMap));
global.VMOption[1] = ds_list_find_value(global.VMMaps, irandom(ds_list_size(global.VMMaps)-1));
ds_list_delete(global.VMMaps, ds_list_find_index(global.VMMaps, global.VMOption[1]));
global.VMOption[2] = ds_list_find_value(global.VMMaps, irandom(ds_list_size(global.VMMaps)-1));
ds_list_delete(global.VMMaps, ds_list_find_index(global.VMMaps, global.VMOption[2]));
global.VMOption[3] = ds_list_find_value(global.VMMaps, irandom(ds_list_size(global.VMMaps)-1));
ds_list_delete(global.VMMaps, ds_list_find_index(global.VMMaps, global.VMOption[3]));
global.VMOption[4] = ds_list_find_value(global.VMMaps, irandom(ds_list_size(global.VMMaps)-1));
ds_list_delete(global.VMMaps, ds_list_find_index(global.VMMaps, global.VMOption[4]));
ds_list_clear(global.VMMaps);
//send the map name
if (global.VMRandom)
global.VMMessage = 'map 1: '+string(global.VMOption[1])+'  ;  map 2: '+string(global.VMOption[2]);
else
global.VMMessage = 'map 1: '+string(global.VMOption[1])+'  ;  map 2: '+string(global.VMOption[2])+'  ;  map 3: '+string(global.VMOption[3]);
ServerMessageString(global.VMMessage, global.sendBuffer);
with (NoticeO) instance_destroy();
notice = instance_create(0, 0, NoticeO);
notice.notice = NOTICE_CUSTOM;
notice.message = global.VMMessage;
}

//VOTING SESSION
if (global.VMMapVoting == 1) {
//humiliation is over, respawn if dead to vote
with (Player) {
if (object == -1) and (global.isHost) and (team != TEAM_SPECTATOR) {
var group, spawnpointID, numSpawnPoints;
group = selectSpawnGroup(team);
if (group == -1)
group = 0;
if(team == TEAM_RED) {
numSpawnPoints = ds_list_size(global.spawnPointsRed[0, group]);
} else {
numSpawnPoints = ds_list_size(global.spawnPointsBlue[0, group]);
}
spawnpointID = floor(random(numSpawnPoints));
sendEventSpawn(id, spawnpointID, group);
doEventSpawn(id, spawnpointID, group);
}
}
//map name -> instruction -> map name
if (impendingMapChange == ceil(global.VMVoteTime*22.5)) {
ServerMessageString(global.VMTutorial, global.sendBuffer);
with (NoticeO) instance_destroy();
notice = instance_create(0, 0, NoticeO);
notice.notice = NOTICE_CUSTOM;
notice.message = global.VMTutorial;
}
if ((impendingMapChange == ceil(global.VMVoteTime*15)) or (impendingMapChange == ceil(global.VMVoteTime*7.5))) {
ServerMessageString(global.VMMessage, global.sendBuffer);
with (NoticeO) instance_destroy();
notice = instance_create(0, 0, NoticeO);
notice.notice = NOTICE_CUSTOM;
notice.message = global.VMMessage;
}
//receive vote
with (Player) {
if (object != -1)
if (object.bubble.alarm[0] > 55) { //paranoia
if (object.bubble.image_index == global.VMBubbleCommand[1])
VMVote = 1;
if (object.bubble.image_index == global.VMBubbleCommand[2])
VMVote = 2;
if (object.bubble.image_index == global.VMBubbleCommand[3])
VMVote = 3;
if (object.bubble.image_index == global.VMBubbleCommand[4])
VMVote = 4;
}
}
}

//END OF VOTING SESSION
if ((global.VMMapVoting == 1) and (impendingMapChange == 1)) {
//count vote
with (Player) {
ds_priority_change_priority(global.VMResult, VMVote, ds_priority_find_priority(global.VMResult, VMVote)+1);
}
//no vote doesn't count; But if there are no vote, it still win
ds_priority_change_priority(global.VMResult, 4, 0.5);
//no vote go to a random map
if (global.VMNextMapRandom)
global.nextMap = global.VMOption[4];
//change map
if (ds_priority_find_max(global.VMResult) != 4)
global.nextMap = global.VMOption[ds_priority_find_max(global.VMResult)];
//announce result
ServerMessageString('Next Map: '+global.nextMap, global.sendBuffer);
with (NoticeO) instance_destroy();
notice = instance_create(0, 0, NoticeO);
notice.notice = NOTICE_CUSTOM;
notice.message = 'Next Map: '+global.nextMap;
//5s to see result
impendingMapChange = 150;
global.VMMapVoting = 2;
}

//CLEAR DATA AND SWITCH MAP
if ((global.VMMapVoting == 2) and (impendingMapChange == 1)) {
//record map
if (global.VMRecord) {
ini_open('Map_Vote_Popularity.ini');
ini_write_real('Popularity',global.nextMap,ini_read_real('Popularity',global.nextMap,0)+1);
ini_close();
}
//clear data
ds_priority_change_priority(global.VMResult, 1, 0);
ds_priority_change_priority(global.VMResult, 2, 0);
ds_priority_change_priority(global.VMResult, 3, 0);
ds_priority_change_priority(global.VMResult, 4, 0);
Player.VMVote = 4;
global.VMMapVoting = 0;
impendingMapChange = 0;
}
");

(click to show/hide)

(click to show/hide)

PUBLIC TESTING IS WELCOME

bullets (obviously)

  • Seasoned Member
  • *****
  • Karma: 40
  • Offline Offline
  • Posts: 1962
Re: [Server-Sent] Map Voting (Alpha)
« Reply #1 on: April 29, 2013, 10:39:53 pm »

Why not a non-serversent plugin that sends a message line to players telling them to :z1: through :z5: for various maps (during humiliation), or some similar text & bubble based voting?
Btw, just a suggestion i had floating around my mind, not a criticism of your implementation
« Last Edit: April 29, 2013, 10:40:16 pm by bullets (obviously) »
Logged

MTK5012

  • 2011 Haxxy Finalist
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 773
  • if (ping <= 150) jaw.y += 100;
Re: [Server-Sent] Map Voting (Alpha)
« Reply #2 on: April 29, 2013, 10:49:54 pm »

Why not a non-serversent plugin that sends a message line to players telling them to :z1: through :z5: for various maps (during humiliation), or some similar text & bubble based voting?
Btw, just a suggestion i had floating around my mind, not a criticism of your implementation
It's actually a good idea! I don't even think about it :p
I just want to try and make a server-sent plugin using the PluginPacket thing
I think your idea might be a better one, just freeze players and let them vote through bubble, but I will finish this one first

Phantom Brave

  • All Hail Classicwell
  • Moderator
  • *****
  • Karma: 70
  • Offline Offline
  • Posts: 12701
  • Another one --
Re: [Server-Sent] Map Voting (Alpha)
« Reply #3 on: April 29, 2013, 11:27:31 pm »

I'm actually surprised nobody posted about a chat bubble voting idea before. However, there will be bias towards certain bubbles regardless of the map used. I think it would work if you used the directional pointer bubbles.
Logged

http://steamcommunity.com/id/wareya/
ladies and gentlemen i would like to announce that the fact of the matter is up that the fact of the matter is a fact and it matters

MTK5012

  • 2011 Haxxy Finalist
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 773
  • if (ping <= 150) jaw.y += 100;
Re: [Server-Sent] Map Voting (Alpha)
« Reply #4 on: April 30, 2013, 12:23:57 am »

I'm actually surprised nobody posted about a chat bubble voting idea before. However, there will be bias towards certain bubbles regardless of the map used. I think it would work if you used the directional pointer bubbles.
maybe I should change to this plugin, it shouldn't be hard
so for the options: no vote, random, 2 random-server-picked map?

Chu

  • Dino man
  • 2011 Haxxy Award Winner
  • *
  • Karma: 26
  • Offline Offline
  • Posts: 2732
  • hm
    • Steam Account
Re: [Server-Sent] Map Voting (Alpha)
« Reply #5 on: April 30, 2013, 12:52:53 am »

I honestly don't think random map is necessary as long as you give people a few options to vote for. The people that aren't going to care will just randomly pick one of the options anyway. If you put a random option in, then more often than not it will split the vote and the maps people actually want to play won't get played and you end up with randoms all the time.
Logged
Click links.

MTK5012

  • 2011 Haxxy Finalist
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 773
  • if (ping <= 150) jaw.y += 100;
Re: [Server-Sent] Map Voting (Alpha)
« Reply #6 on: April 30, 2013, 02:25:25 am »

okay, I don't really have time to test so if anyone can do so, I would be grateful (this is non server sent)
Code: [Select]
if ds_list_size(global.map_rotation) < 4 {
show_message("Map voting plugin failed to load, please have more than 3 maps in the map rotation.");
exit;
}

global.VMOption[1] = "";
global.VMOption[2] = "";
global.VMOption[3] = "";
global.VMMapVoting = 0;
global.VMMaps = ds_list_create();
global.VMResult = ds_priority_create();
ds_priority_add(global.VMResult,1,0);
ds_priority_add(global.VMResult,2,0);
ds_priority_add(global.VMResult,3,0);
ds_priority_add(global.VMResult,4,0);
object_event_add(Player,ev_create,0,"
VMVote = 4;
");

object_event_add(GameServer,ev_step,ev_step_begin,"
//BEGIN OF VOTING SESSION
if ((impendingMapChange == 1)
and !(global.winners == TEAM_RED and global.currentMapArea < global.totalMapAreas) and (!global.VMMapVoting)) {
//humiliation is over, respawn if dead
with (Player) {
if (object == -1) and (global.isHost) and (team != TEAM_SPECTATOR)
var group, spawnpointID, numSpawnPoints;
group = selectSpawnGroup(team);
if (group==-1) {
show_message('This map does not contain valid spawn points');
game_end();
}
if(team == TEAM_RED) {
numSpawnPoints = ds_list_size(global.spawnPointsRed[0,group]);
} else {
numSpawnPoints = ds_list_size(global.spawnPointsBlue[0,group]);
}
spawnpointID = floor(random(numSpawnPoints));
sendEventSpawn(id, spawnpointID, group);
doEventSpawn(id, spawnpointID, group);
}
//voting session
global.VMMapVoting = 1;
impendingMapChange = 450;
//pick 3 different maps
randomize();
ds_list_copy(global.VMMaps,global.map_rotation);
ds_list_delete(global.VMMaps,ds_list_find_index(global.VMMaps,global.currentMap));
global.VMOption[1] = ds_list_find_value(global.VMMaps,irandom(ds_list_size(global.VMMaps)-1));
ds_list_delete(global.VMMaps,ds_list_find_index(global.VMMaps,global.VMOption[1]));
global.VMOption[2] = ds_list_find_value(global.VMMaps,irandom(ds_list_size(global.VMMaps)-1));
ds_list_delete(global.VMMaps,ds_list_find_index(global.VMMaps,global.VMOption[2]));
global.VMOption[3] = ds_list_find_value(global.VMMaps,irandom(ds_list_size(global.VMMaps)-1));
ds_list_delete(global.VMMaps,ds_list_find_index(global.VMMaps,global.VMOption[3]));
ds_list_clear(global.VMMaps);
//send the map name
ServerMessageString('map 1: '+string(global.VMOption[1])+'  ;  map 2: '+string(global.VMOption[2]), global.sendBuffer);
}
//VOTING SESSION
if (global.VMMapVoting) {
//prevent killing: set hp over 9000 (need a way to prevent kill boxes)
with (Character) {
maxHp = 9999;
hp = 9999;
}
//instruction and then map name again
if (impendingMapChange == 360)
ServerMessageString('vote for next map: c2: map 1 ; c3: map 2 ; c4: random map ; c5: no vote.', global.sendBuffer);
if (impendingMapChange == 180)
ServerMessageString('map 1: '+string(global.VMOption[1])+'  ;  map 2: '+string(global.VMOption[2]), global.sendBuffer);
//receive vote
with (Player) {
if (object != -1)
if (object.bubble.alarm[0] > 55) { //paranoia
if (object.bubble.image_index == 37) //c2
VMVote = 1;
if (object.bubble.image_index == 38) //c3
VMVote = 2;
if (object.bubble.image_index == 39) //c4
VMVote = 3;
if (object.bubble.image_index == 40) //c5
VMVote = 4;
}
}
}
//END OF VOTING SESSION
if ((global.VMMapVoting) and (impendingMapChange == 1)) {
//count vote
with (Player) {
ds_priority_change_priority(global.VMResult,VMVote,ds_priority_find_priority(global.VMResult,VMVote)+1);
}
//no vote doesn't count, but if there are no vote it still win
ds_priority_change_priority(global.VMResult,4,0.5);
//change map
if (ds_priority_find_max(global.VMResult) != 4)
global.nextMap = global.VMOption[ds_priority_find_max(global.VMResult)];
//announce result
ServerMessageString('Next Map: '+global.nextMap, global.sendBuffer);
//3s to see result
VMMapVoting = 0;
Player.VMVote = 4;
impendingMapChange = 90;
//clear data
ds_priority_change_priority(global.VMResult,1,0);
ds_priority_change_priority(global.VMResult,2,0);
ds_priority_change_priority(global.VMResult,3,0);
ds_priority_change_priority(global.VMResult,4,0);
}
");
I honestly don't think random map is necessary as long as you give people a few options to vote for. The people that aren't going to care will just randomly pick one of the options anyway. If you put a random option in, then more often than not it will split the vote and the maps people actually want to play won't get played and you end up with randoms all the time.
I'll make a poll

Phantom Brave

  • All Hail Classicwell
  • Moderator
  • *****
  • Karma: 70
  • Offline Offline
  • Posts: 12701
  • Another one --
Re: [Server-Sent] Map Voting (Alpha)
« Reply #7 on: April 30, 2013, 02:28:52 am »

you should add "random vote" to the poll :rolleyes:
Logged

http://steamcommunity.com/id/wareya/
ladies and gentlemen i would like to announce that the fact of the matter is up that the fact of the matter is a fact and it matters

MTK5012

  • 2011 Haxxy Finalist
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 773
  • if (ping <= 150) jaw.y += 100;
Re: [Server-Sent] Map Voting (Alpha)
« Reply #8 on: April 30, 2013, 05:44:56 pm »

you should add "random vote" to the poll :rolleyes:
I did, it's in the question
ok I will make it more visible then
and when I think of it, It actually make sense to not have a random map

Phantom Brave

  • All Hail Classicwell
  • Moderator
  • *****
  • Karma: 70
  • Offline Offline
  • Posts: 12701
  • Another one --
Re: [Server-Sent] Map Voting (Alpha)
« Reply #9 on: April 30, 2013, 05:46:21 pm »

whoosh
Logged

http://steamcommunity.com/id/wareya/
ladies and gentlemen i would like to announce that the fact of the matter is up that the fact of the matter is a fact and it matters

MTK5012

  • 2011 Haxxy Finalist
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 773
  • if (ping <= 150) jaw.y += 100;
Re: Better Map Voting (Beta)
« Reply #10 on: April 30, 2013, 09:01:16 pm »

Finally finished debugging and testing
Tested on:
-multi areas maps
-arena maps
To do:
-Public test (anybody willing to do this?)

the useless soldier

  • Full Member
  • ***
  • Karma: 5
  • Offline Offline
  • Posts: 249
Re: Better Map Voting (Beta)
« Reply #11 on: April 30, 2013, 09:16:43 pm »

n0 m04r r4Nd0m 0pt10N p10x.

Saniblues

  • Onion Knight
  • Administrator
  • *****
  • Karma: -1305
  • Offline Offline
  • Posts: 12416
Re: Better Map Voting (Beta)
« Reply #12 on: May 01, 2013, 05:11:02 pm »

The option to select a random map should be present. This is an add-on, though; in this case, the server host should ideally be able to very easily remove said option.
Logged
Quote from: mop
Quote from: MR MAGN3TIC
I don't like it.  :nah:
Oh, well, you might as well pack up and stop now, because he doesn't like it
I'm bored out of my skull, Lets play a different game!
Lets take a visit down below And cast the world in flames!

MTK5012

  • 2011 Haxxy Finalist
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 773
  • if (ping <= 150) jaw.y += 100;
Re: Better Map Voting (Beta)
« Reply #13 on: May 02, 2013, 12:53:02 am »

n0 m04r r4Nd0m 0pt10N p10x.
already
The option to select a random map should be present. This is an add-on, though; in this case, the server host should ideally be able to very easily remove said option.
added, the host need to edit the plugin though
I was going to make a menu for the plugin but it's complicated and not really necessary so I scrapped it

I hosted for the whole day today and figure out people don't really know about the voting (some of them does)
they just want to have fun killing the humiliated team over and over and over and over and over and over and over and over and over and over and over

thelostshadow

  • Full Member
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 288
  • I play on a toaster
Re: Better Map Voting (Beta)
« Reply #14 on: May 02, 2013, 12:55:55 am »

My suggestion is that like tf2, the voting happens when the map is still being played. The directional bubbles are not that commonly used and it shouldn't affect gameplay too much. Also, it might run a bit smoother as in transitioning time.
Logged

Pages: [1] 2
 

Page created in 0.033 seconds with 40 queries.