Merge pull request #1 from lassiterm/dev

Merge dev with main
cleaner
lassiterm 6 years ago committed by GitHub
commit f925a887eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

1
.gitignore vendored

@ -8,7 +8,6 @@ scripts/pal_swap_*
*.wav
*.shader
\#backups
datafiles
help.rtf
extensions
AM2R.exe

@ -1,5 +1,12 @@
# AM2R-Community-Updates
## Co-op Changes
The source code here has the same requirements as the original repo in order for it to work. Only the code and my changes have been included. Also, the string compression scripts are by Homunculus: https://marketplace.yoyogames.com/assets/4560/strict .
Currently syncs all items, metroids, events, and power-ups.
Currently, pressing F1 will make an attempt to connect to the server. F2 will disconnect from the server. DO NOT try to connect on the menu because the game will crash as the script that shows the connect/disconnect prompt can not run until you are in-game.
Put the ip of the server you want to connect to into the ipaddress.txt. The server operates on port 64198 and cannot be changed at the moment.
The server can be found here: https://github.com/lassiterm/AM2R-Server
## What is this?
The source code for the AM2R Community Updates 1.5.x branch, free of copyrighted assets and trademarks.
If you have not played the AM2R Community Updates before, this will be of no use to you!

@ -0,0 +1,259 @@
{
"dictionary": {
"0": 157,
"1": 158,
"2": 159,
"3": 160,
"4": 161,
"5": 162,
"6": 163,
"7": 164,
"8": 165,
"9": 166,
"11": 169,
"111": 170,
"e": 1,
"t": 2,
"a": 3,
"o": 4,
"i": 5,
"n": 6,
"s": 7,
"r": 8,
"h": 9,
"l": 10,
"d": 11,
"c": 12,
"u": 13,
"m": 14,
"f": 15,
"p": 16,
"g": 17,
"w": 18,
"y": 19,
"b": 20,
"v": 21,
"k": 22,
"x": 23,
"j": 24,
"q": 25,
"z": 26,
"th": 27,
"he": 28,
"in": 29,
"er": 30,
"an": 31,
"re": 32,
"on": 33,
"at": 34,
"en": 35,
"nd": 36,
"ti": 37,
"es": 38,
"or": 39,
"te": 40,
"of": 41,
"ed": 42,
"is": 43,
"it": 44,
"al": 45,
"ar": 46,
"st": 47,
"to": 48,
"nt": 49,
"ng": 50,
"se": 51,
"ha": 52,
"id": 53,
"as": 54,
"ou": 55,
"io": 56,
"le": 57,
"ve": 58,
"co": 59,
"me": 60,
"de": 61,
"hi": 62,
"ri": 63,
"ro": 64,
"ic": 65,
"ne": 66,
"ea": 67,
"ra": 68,
"ce": 69,
"li": 70,
"ch": 71,
"ll": 72,
"be": 73,
"ma": 74,
"si": 75,
"om": 76,
"ur": 77,
"ss": 78,
"the": 79,
"and": 80,
"ing": 81,
"ion": 82,
"tio": 83,
"ent": 84,
"ati": 85,
"for": 86,
"her": 87,
"ter": 88,
"hat": 89,
"The": 90,
"tha": 91,
"ere": 92,
"ate": 93,
"his": 94,
"con": 95,
"res": 96,
"ver": 97,
"all": 98,
"ons": 99,
"nce": 100,
"men": 101,
"ith": 102,
"ted": 103,
"ers": 104,
"pro": 105,
"thi": 106,
"wit": 107,
"are": 108,
"ess": 109,
"not": 110,
"ive": 111,
"was": 112,
"ect": 113,
"rea": 114,
"com": 115,
"eve": 116,
"per": 117,
"int": 118,
"est": 119,
"sta": 120,
"cti": 121,
"ica": 122,
"ist": 123,
"ear": 124,
"ain": 125,
"one": 126,
"our": 127,
"iti": 128,
"rat": 129,
"tion": 130,
"atio": 131,
"that": 132,
"ther": 133,
"with": 134,
"ment": 135,
"ions": 136,
"this": 137,
"here": 138,
"from": 139,
"ould": 140,
"ting": 141,
"hich": 142,
"whic": 143,
"ctio": 144,
"ence": 145,
"have": 146,
"othe": 147,
"ight": 148,
"sion": 149,
"ation": 150,
"tions": 151,
"which": 152,
"ction": 153,
"other": 154,
"their": 155,
"http": 156,
"00": 167,
"000": 168,
" t": 171,
" o": 172,
" i": 173,
" s": 174,
" c": 175,
" w": 176,
" h": 177,
" b": 178,
" f": 179,
" m": 180,
"e ": 181,
"s ": 182,
"t ": 183,
"d ": 184,
"n ": 185,
"r ": 186,
"y ": 187,
"f ": 188,
"l ": 189,
"o ": 190,
" ": 191,
".": 192,
",": 193,
" ": 194,
". ": 195,
", ": 196,
" ": 197,
"/": 198,
"\\": 199,
":": 200,
"{": 201,
"}": 202,
"[": 203,
"]": 204,
"\"": 205,
"e, ": 206,
"s, ": 207,
", t": 208,
", a": 209,
" a ": 210,
" th": 211,
"nd ": 212,
" in": 213,
" of": 214,
"of ": 215,
"on ": 216,
" an": 217,
"is ": 218,
" to": 219,
"to ": 220,
"t t": 221,
"e t": 222,
"s t": 223,
"e a": 224,
"s a": 225,
"E": 226,
"T": 227,
"A": 228,
"O": 229,
"I": 230,
"N": 231,
"S": 232,
"R": 233,
"H": 234,
"L": 235,
"D": 236,
"C": 237,
"U": 238,
"M": 239,
"F": 240,
"P": 241,
"G": 242,
"W": 243,
"Y": 244,
"B": 245,
"V": 246,
"K": 247,
"X": 248,
"J": 249,
"Q": 250,
"Z": 251,
"\",": 252,
"\":\"": 253
},
"inv_dictionary": ["","e", "t", "a", "o", "i", "n", "s", "r", "h", "l", "d", "c", "u", "m", "f", "p", "g", "w", "y", "b", "v", "k", "x", "j", "q", "z", "th", "he", "in", "er", "an", "re", "on", "at", "en", "nd", "ti", "es", "or", "te", "of", "ed", "is", "it", "al", "ar", "st", "to", "nt", "ng", "se", "ha", "id", "as", "ou", "io", "le", "ve", "co", "me", "de", "hi", "ri", "ro", "ic", "ne", "ea", "ra", "ce", "li", "ch", "ll", "be", "ma", "si", "om", "ur", "ss", "the", "and", "ing", "ion", "tio", "ent", "ati", "for", "her", "ter", "hat", "The", "tha", "ere", "ate", "his", "con", "res", "ver", "all", "ons", "nce", "men", "ith", "ted", "ers", "pro", "thi", "wit", "are", "ess", "not", "ive", "was", "ect", "rea", "com", "eve", "per", "int", "est", "sta", "cti", "ica", "ist", "ear", "ain", "one", "our", "iti", "rat", "tion", "atio", "that", "ther", "with", "ment", "ions", "this", "here", "from", "ould", "ting", "hich", "whic", "ctio", "ence", "have", "othe", "ight", "sion", "ation", "tions", "which", "ction", "other", "their", "http", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "00", "000", "11", "111", " t", " o", " i", " s", " c", " w", " h", " b", " f", " m", "e ", "s ", "t ", "d ", "n ", "r ", "y ", "f ", "l ", "o ", " ", ".", ",", " ", ". ", ", ", " ", "/", "\\", ":", "{", "}", "[", "]", "\"", "e, ", "s, ", ", t", ", a", " a ", " th", "nd ", " in", " of", "of ", "on ", " an", "is ", " to", "to ", "t t", "e t", "s t", "e a", "s a", "E", "T", "A", "O", "I", "N", "S", "R", "H", "L", "D", "C", "U", "M", "F", "P", "G", "W", "Y", "B", "V", "K", "X", "J", "Q", "Z", "\",", "\":\""],
"max_length": 5
}

@ -0,0 +1,334 @@
<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
<object>
<spriteName>&lt;undefined&gt;</spriteName>
<solid>0</solid>
<visible>0</visible>
<depth>0</depth>
<persistent>-1</persistent>
<parentName>&lt;undefined&gt;</parentName>
<maskName>&lt;undefined&gt;</maskName>
<events>
<event eventtype="0" enumb="0">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>strict_init("dictionary.json");
canSend = false;
alarm[1] = 300;
var type;
type = network_socket_tcp;
var file = file_text_open_read(working_directory + "\ipaddress.txt");
ipaddress = file_text_read_string(file);
file_text_close(file);
port = 64198;
socket = network_create_socket(type);
isConnected = network_connect(socket, ipaddress, port);
var size, type, alignment;
size = 1024;
type = buffer_grow;
alignment = 1;
buffer = buffer_create(size, type, alignment);
global.itemlist[0] = 0;
for(i=0; i&lt;350; i++){
global.itemlist[i] = i;
}
global.onlineList = ds_grid_create(3, 33);
global.onlineSend = ds_grid_create(3, 33);
for(var i=0; i&lt;ds_grid_height(global.onlineList); i++){
ds_grid_set(global.onlineList, 2, i, i);
}
update_variables("prev");
update_variables("onlinevars");
alarm[0] = 5;
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="1" enumb="0">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>network_destroy(socket);
buffer_delete(buffer);
ds_grid_destroy(global.onlineList);
ds_grid_destroy(global.onlineSend);
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="2" enumb="1">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>/*
if(isConnected &lt; 0){
isConnected = network_connect(socket, ipaddress, port);
}
alarm[1] = 300;
*/
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="2" enumb="0">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>
update_variables("onlinevars");
for(var i=0; i&lt;ds_grid_height(global.onlineList); i++){
if(global.onlineList[# 0, i] != global.onlineList[# 1, i] &amp;&amp; i != 0 &amp;&amp; i != 1 &amp;&amp; i != 3){
global.onlineSend[# 0, i] = global.onlineList[# 0, i];
global.onlineSend[# 1, i] = global.onlineList[# 1, i];
global.onlineSend[# 2, i] = global.onlineList[# 2, i];
canSend = true;
alarm[0] = 600;
}
if(i == 0){
for(var f=0; f&lt;array_length_1d(global.item); f++){
if(global.itemPrev[f] != global.item[f]){
global.onlineSend[# 0, 0] = global.onlineList[# 0, 0];
global.onlineSend[# 1, 0] = global.onlineList[# 1, 0];
global.onlineSend[# 2, 0] = global.onlineList[# 2, 0];
show_debug_message(string(global.itemPrev[f]) + " " + string(global.item[f]));
show_debug_message("item changed");
canSend = true;
}
}
}
if(i == 1){
for(var f=0; f&lt;array_length_1d(global.metdead); f++){
if(global.metdeadPrev[f] != global.metdead[f]){
global.onlineSend[# 0, 1] = global.onlineList[# 0, 1];
global.onlineSend[# 1, 1] = global.onlineList[# 1, 1];
global.onlineSend[# 2, 1] = global.onlineList[# 2, 1];
show_debug_message(string(global.metdeadPrev[f]) + " " + string(global.metdead[f]));
show_debug_message("metdead changed");
canSend = true;
}
}
}
if(i == 3){
for(var f=0; f&lt;array_length_1d(global.event); f++){
if(global.eventPrev[f] != global.event[f]){
global.onlineSend[# 0, 3] = global.onlineList[# 0, 3];
global.onlineSend[# 1, 3] = global.onlineList[# 1, 3];
global.onlineSend[# 2, 3] = global.onlineList[# 2, 3];
show_debug_message(string(global.eventPrev[f]) + " " + string(global.event[f]));
show_debug_message("event changed");
canSend = true;
}
}
}
}
if(canSend){
show_debug_message("missiles");
show_debug_message(string(global.missilesPrev) + " " + string(global.missiles));
buffer_delete(buffer);
var size, type, alignment;
size = 1024;
type = buffer_grow;
alignment = 1;
buffer = buffer_create(size, type, alignment);
buffer_seek(buffer, buffer_seek_start, 0);
buffer_write(buffer, buffer_string, strict_compress(ds_grid_write(global.onlineSend)));
var result = network_send_packet(socket, buffer, buffer_tell(buffer));
canSend = false;
}
if(!canSend){
alarm[0] = 30;
}
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="3" enumb="0">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>if(keyboard_check_pressed(vk_f2)){
instance_destroy();
}
if(keyboard_check_pressed(vk_f3)){
var f = 0;
repeat(41){
global.metdead[f] = 1;
f++;
}
}
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="7" enumb="68">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>
var type_event = ds_map_find_value(async_load, "type");
switch(type_event){
case network_type_data:
var _buffer = ds_map_find_value(async_load, "buffer");
show_debug_message(buffer_get_size(_buffer));
buffer_seek(_buffer, buffer_seek_start, 0);
ds_grid_read(global.onlineSend, strict_decompress(buffer_read(_buffer, buffer_string)));
update_variables("disablesame");
update_variables("replaceglobalvars");
update_variables("prev");
alarm[0] = 30;
ds_grid_clear(global.onlineSend, 0);
/*
for(var i=0; i&lt;array_length_1d(vars); i++){
if(global.onlineVars[i, 1] != vars[i, 1]){
global.onlineVars[i, 1] = vars[i, 1];
global.onlineVars[i, 0] = global.onlineVars[i, 1];
}
}
*/
break;
}
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="7" enumb="3">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>network_destroy(socket);
buffer_delete(buffer);
ds_grid_destroy(global.onlineList);
ds_grid_destroy(global.onlineSend);
</string>
</argument>
</arguments>
</action>
</event>
</events>
<PhysicsObject>0</PhysicsObject>
<PhysicsObjectSensor>0</PhysicsObjectSensor>
<PhysicsObjectShape>0</PhysicsObjectShape>
<PhysicsObjectDensity>0.5</PhysicsObjectDensity>
<PhysicsObjectRestitution>0.100000001490116</PhysicsObjectRestitution>
<PhysicsObjectGroup>0</PhysicsObjectGroup>
<PhysicsObjectLinearDamping>0.100000001490116</PhysicsObjectLinearDamping>
<PhysicsObjectAngularDamping>0.100000001490116</PhysicsObjectAngularDamping>
<PhysicsObjectFriction>0.200000002980232</PhysicsObjectFriction>
<PhysicsObjectAwake>-1</PhysicsObjectAwake>
<PhysicsObjectKinematic>0</PhysicsObjectKinematic>
<PhysicsShapePoints/>
</object>

File diff suppressed because one or more lines are too long

@ -0,0 +1,7 @@
var i, tempArray;
tempArray = argument[0];
for(i=0; i<array_length_1d(tempArray); i++){
if(tempArray[i]==argument[1])
return i;
}
return -1;

@ -0,0 +1,55 @@
///strict_compress(input)
/*
Description: Returns a compressed version of the provided input string
Arguments: input (string)
Returns: String
*/
var input, input_size, index, output, ml, dict, verb;
input = argument0;
input_size = string_length(input);
index = 1;
output = "";
ml = _strict_data[? "max_length"];
dict = _strict_data[? "dictionary"];
verb = "";
while(index <= input_size) {
var l = min(input_size-(index-1),ml);
var q = "";
for(var c = l; c > 0; c--) {
var code = ds_map_find_value(dict,string_copy(input,index,c));
if(!is_undefined(code)) {
q += chr(code);
encoded = true;
index += c;
break;
}
}
if(q == "") {
verb += string_char_at(input,index);
index++;
if(string_length(verb) == 255) {
q = strict_encode_verb(verb);
verb = "";
}
}
else {
if(verb != "") {
q = strict_encode_verb(verb) + q;
verb = "";
}
}
output += q;
}
if(verb != "") {
output += strict_encode_verb(verb);
}
return output;

@ -0,0 +1,35 @@
///strict_decompress(input)
/*
Description: Returns a decompressed version of the provided input string
Arguments: input (string)
Returns: String
*/
var input, input_size, output, index, ml, inv_dict;
input = argument0;
input_size = string_length(input);
output = "";
index = 1;
ml = _strict_data[? "max_length"];
inv_dict = _strict_data[? "inv_dictionary"];
while(index <= input_size) {
var char = string_ord_at(input,index);
if(char == 255) {
var n = string_ord_at(input,index+1);
output += string_copy(input,index+2,n);
index += n + 2;
}
else if(char == 254) {
output += string_char_at(input,index+1);
index += 2;
}
else {
output += inv_dict[| char];
index++;
}
}
return output;

@ -0,0 +1,17 @@
///strict_encode_verb(verb)
/*
Description: (called from strict_compress). Returns an encoded verb ready to be added to a compressed output
Arguments: verb (string)
Returns: String
*/
var verb = argument0;
var verb_length = string_length(verb);
if(verb_length > 1) {
return chr(255) + chr(verb_length) + verb;
}
else {
return chr(254) + verb;
}

@ -0,0 +1,18 @@
///strict_init(data file)
/*
Read dictionary file
*/
globalvar _strict_data;
var json_data = "";
var f = file_text_open_read(argument0);
while (!file_text_eof(f)) {
json_data += file_text_read_string(f);
file_text_readln(f);
}
file_text_close(f);
_strict_data = json_decode(json_data);

@ -0,0 +1,262 @@
/// update_variables
switch(argument0){
case "prev":
global.itemPrev = array_clone(global.item);
global.itemstakenPrev = global.itemstaken;
global.metdeadPrev = array_clone(global.metdead);
global.eventPrev = array_clone(global.event);
global.monstersleftPrev = global.monstersleft;
global.maxmissilesPrev = global.maxmissiles;
global.maxsmissilesPrev = global.maxsmissiles;
global.maxpbombsPrev = global.maxpbombs;
global.maxhealthPrev = global.maxhealth;
global.playerhealthPrev = global.playerhealth;
global.morphballPrev = global.morphball;
global.jumpballPrev = global.jumpball;
global.powergripPrev = global.powergrip;
global.spacejumpPrev = global.spacejump;
global.screwattackPrev = global.screwattack;
global.hijumpPrev = global.hijump;
global.spiderballPrev = global.spiderball;
global.speedboosterPrev = global.speedbooster;
global.bombPrev = global.bomb;
global.ibeamPrev = global.ibeam;
global.wbeamPrev = global.wbeam;
global.pbeamPrev = global.pbeam;
global.sbeamPrev = global.sbeam;
global.cbeamPrev = global.cbeam;
global.missilesPrev = global.missiles;
global.smissilesPrev = global.smissiles;
global.pbombsPrev = global.pbombs;
global.etanksPrev = global.etanks;
global.mtanksPrev = global.mtanks;
global.stanksPrev = global.stanks;
global.ptanksPrev = global.ptanks;
global.currentsuitPrev = global.currentsuit;
global.monstersareaPrev = global.monstersarea;
break;
case "onlinevars":
ds_grid_set(global.onlineList, 0, 0, global.itemPrev);
ds_grid_set(global.onlineList, 1, 0, global.item);
ds_grid_set(global.onlineList, 0, 1, global.metdeadPrev);
ds_grid_set(global.onlineList, 1, 1, global.metdead);
ds_grid_set(global.onlineList, 0, 2, global.itemstakenPrev);
ds_grid_set(global.onlineList, 1, 2, global.itemstaken);
ds_grid_set(global.onlineList, 0, 3, global.eventPrev);
ds_grid_set(global.onlineList, 1, 3, global.event);
ds_grid_set(global.onlineList, 0, 4, global.monstersleftPrev);
ds_grid_set(global.onlineList, 1, 4, global.monstersleft);
ds_grid_set(global.onlineList, 0, 5, global.maxmissilesPrev);
ds_grid_set(global.onlineList, 1, 5, global.maxmissiles);
ds_grid_set(global.onlineList, 0, 6, global.maxsmissilesPrev);
ds_grid_set(global.onlineList, 1, 6, global.maxsmissiles);
ds_grid_set(global.onlineList, 0, 7, global.maxpbombsPrev);
ds_grid_set(global.onlineList, 1, 7, global.maxpbombs);
ds_grid_set(global.onlineList, 0, 8, global.maxhealthPrev);
ds_grid_set(global.onlineList, 1, 8, global.maxhealth);
ds_grid_set(global.onlineList, 0, 9, global.playerhealthPrev);
ds_grid_set(global.onlineList, 1, 9, global.playerhealth);
ds_grid_set(global.onlineList, 0, 10, global.morphballPrev);
ds_grid_set(global.onlineList, 1, 10, global.morphball);
ds_grid_set(global.onlineList, 0, 11, global.jumpballPrev);
ds_grid_set(global.onlineList, 1, 11, global.jumpball);
ds_grid_set(global.onlineList, 0, 12, global.powergripPrev);
ds_grid_set(global.onlineList, 1, 12, global.powergrip);
ds_grid_set(global.onlineList, 0, 13, global.spacejumpPrev);
ds_grid_set(global.onlineList, 1, 13, global.spacejump);
ds_grid_set(global.onlineList, 0, 14, global.screwattackPrev);
ds_grid_set(global.onlineList, 1, 14, global.screwattack);
ds_grid_set(global.onlineList, 0, 15, global.hijumpPrev);
ds_grid_set(global.onlineList, 1, 15, global.hijump);
ds_grid_set(global.onlineList, 0, 16, global.spiderballPrev);
ds_grid_set(global.onlineList, 1, 16, global.spiderball);
ds_grid_set(global.onlineList, 0, 17, global.speedboosterPrev);
ds_grid_set(global.onlineList, 1, 17, global.speedbooster);
ds_grid_set(global.onlineList, 0, 18, global.bombPrev);
ds_grid_set(global.onlineList, 1, 18, global.bomb);
ds_grid_set(global.onlineList, 0, 19, global.ibeamPrev);
ds_grid_set(global.onlineList, 1, 19, global.ibeam);
ds_grid_set(global.onlineList, 0, 20, global.wbeamPrev);
ds_grid_set(global.onlineList, 1, 20, global.wbeam);
ds_grid_set(global.onlineList, 0, 21, global.pbeamPrev);
ds_grid_set(global.onlineList, 1, 21, global.pbeam);
ds_grid_set(global.onlineList, 0, 22, global.sbeamPrev);
ds_grid_set(global.onlineList, 1, 22, global.sbeam);
ds_grid_set(global.onlineList, 0, 23, global.cbeamPrev);
ds_grid_set(global.onlineList, 1, 23, global.cbeam);
ds_grid_set(global.onlineList, 0, 24, global.missilesPrev);
ds_grid_set(global.onlineList, 1, 24, global.missiles);
ds_grid_set(global.onlineList, 0, 25, global.smissilesPrev);
ds_grid_set(global.onlineList, 1, 25, global.smissiles);
ds_grid_set(global.onlineList, 0, 26, global.pbombsPrev);
ds_grid_set(global.onlineList, 1, 26, global.pbombs);
ds_grid_set(global.onlineList, 0, 27, global.etanksPrev);
ds_grid_set(global.onlineList, 1, 27, global.etanks);
ds_grid_set(global.onlineList, 0, 28, global.mtanksPrev);
ds_grid_set(global.onlineList, 1, 28, global.mtanks);
ds_grid_set(global.onlineList, 0, 29, global.stanksPrev);
ds_grid_set(global.onlineList, 1, 29, global.stanks);
ds_grid_set(global.onlineList, 0, 30, global.ptanksPrev);
ds_grid_set(global.onlineList, 1, 30, global.ptanks);
ds_grid_set(global.onlineList, 0, 31, global.currentsuitPrev);
ds_grid_set(global.onlineList, 1, 31, global.currentsuit);
ds_grid_set(global.onlineList, 0, 32, global.monstersareaPrev);
ds_grid_set(global.onlineList, 1, 32, global.monstersarea);
break;
/*
case "onlinevarscurrent":
ds_grid_set(global.onlineList, 1, 0, global.item);
ds_grid_set(global.onlineList, 1, 1, global.metdead);
ds_grid_set(global.onlineList, 1, 2, global.itemstaken);
ds_grid_set(global.onlineList, 1, 3, global.event);
ds_grid_set(global.onlineList, 1, 4, global.monstersleft);
ds_grid_set(global.onlineList, 1, 5, global.maxmissiles);
ds_grid_set(global.onlineList, 1, 6, global.maxsmissiles);
ds_grid_set(global.onlineList, 1, 7, global.maxpbombs);
ds_grid_set(global.onlineList, 1, 8, global.maxhealth);
ds_grid_set(global.onlineList, 1, 9, global.playerhealth);
ds_grid_set(global.onlineList, 1, 10, global.morphball);
ds_grid_set(global.onlineList, 1, 11, global.jumpball);
ds_grid_set(global.onlineList, 1, 12, global.powergrip);
ds_grid_set(global.onlineList, 1, 13, global.spacejump);
ds_grid_set(global.onlineList, 1, 14, global.screwattack);
ds_grid_set(global.onlineList, 1, 15, global.hijump);
ds_grid_set(global.onlineList, 1, 16, global.spiderball);
ds_grid_set(global.onlineList, 1, 17, global.speedbooster);
ds_grid_set(global.onlineList, 1, 18, global.bomb);
ds_grid_set(global.onlineList, 1, 19, global.ibeam);
ds_grid_set(global.onlineList, 1, 20, global.wbeam);
ds_grid_set(global.onlineList, 1, 21, global.pbeam);
ds_grid_set(global.onlineList, 1, 22, global.sbeam);
ds_grid_set(global.onlineList, 1, 23, global.cbeam);
ds_grid_set(global.onlineList, 1, 24, global.missiles);
ds_grid_set(global.onlineList, 1, 25, global.smissiles);
ds_grid_set(global.onlineList, 1, 26, global.pbombs);
ds_grid_set(global.onlineList, 1, 27, global.etanks);
ds_grid_set(global.onlineList, 1, 28, global.mtanks);
ds_grid_set(global.onlineList, 1, 29, global.stanks);
ds_grid_set(global.onlineList, 1, 30, global.ptanks);
ds_grid_set(global.onlineList, 1, 31, global.currentsuit);
ds_grid_set(global.onlineList, 1, 32, global.monstersarea);
break;
case "onlinevarsprev":
ds_grid_set(global.onlineList, 0, 0, global.itemPrev);
ds_grid_set(global.onlineList, 0, 1, global.metdeadPrev);
ds_grid_set(global.onlineList, 0, 2, global.itemstakenPrev);
ds_grid_set(global.onlineList, 0, 3, global.eventPrev);
ds_grid_set(global.onlineList, 0, 4, global.monstersleftPrev);
ds_grid_set(global.onlineList, 0, 5, global.maxmissilesPrev);
ds_grid_set(global.onlineList, 0, 6, global.maxsmissilesPrev);
ds_grid_set(global.onlineList, 0, 7, global.maxpbombsPrev);
ds_grid_set(global.onlineList, 0, 8, global.maxhealthPrev);
ds_grid_set(global.onlineList, 0, 9, global.playerhealthPrev);
ds_grid_set(global.onlineList, 0, 10, global.morphballPrev);
ds_grid_set(global.onlineList, 0, 11, global.jumpballPrev);
ds_grid_set(global.onlineList, 0, 12, global.powergripPrev);
ds_grid_set(global.onlineList, 0, 13, global.spacejumpPrev);
ds_grid_set(global.onlineList, 0, 14, global.screwattackPrev);
ds_grid_set(global.onlineList, 0, 15, global.hijumpPrev);
ds_grid_set(global.onlineList, 0, 16, global.spiderballPrev);
ds_grid_set(global.onlineList, 0, 17, global.speedboosterPrev);
ds_grid_set(global.onlineList, 0, 18, global.bombPrev);
ds_grid_set(global.onlineList, 0, 19, global.ibeamPrev);
ds_grid_set(global.onlineList, 0, 20, global.wbeamPrev);
ds_grid_set(global.onlineList, 0, 21, global.pbeamPrev);
ds_grid_set(global.onlineList, 0, 22, global.sbeamPrev);
ds_grid_set(global.onlineList, 0, 23, global.cbeamPrev);
ds_grid_set(global.onlineList, 0, 24, global.missilesPrev);
ds_grid_set(global.onlineList, 0, 25, global.smissilesPrev);
ds_grid_set(global.onlineList, 0, 26, global.pbombsPrev);
ds_grid_set(global.onlineList, 0, 27, global.etanksPrev);
ds_grid_set(global.onlineList, 0, 28, global.mtanksPrev);
ds_grid_set(global.onlineList, 0, 29, global.stanksPrev);
ds_grid_set(global.onlineList, 0, 30, global.ptanksPrev);
ds_grid_set(global.onlineList, 0, 31, global.currentsuitPrev);
ds_grid_set(global.onlineList, 0, 32, global.monstersareaPrev);
break;
*/
case "replaceglobalvars":
global.item = ds_grid_get(global.onlineList, 1, 0);
global.metdead = ds_grid_get(global.onlineList, 1, 1);
global.itemstaken = ds_grid_get(global.onlineList, 1, 2);
global.event = ds_grid_get(global.onlineList, 1, 3);
global.monstersleft = ds_grid_get(global.onlineList, 1, 4);
global.maxmissiles = ds_grid_get(global.onlineList, 1, 5);
global.maxsmissiles = ds_grid_get(global.onlineList, 1, 6);
global.maxpbombs = ds_grid_get(global.onlineList, 1, 7);
global.maxhealth = ds_grid_get(global.onlineList, 1, 8);
global.playerhealth = ds_grid_get(global.onlineList, 1, 9);
global.morphball = ds_grid_get(global.onlineList, 1, 10);
global.jumpball = ds_grid_get(global.onlineList, 1, 11);
global.powergrip = ds_grid_get(global.onlineList, 1, 12);
global.spacejump = ds_grid_get(global.onlineList, 1, 13);
global.screwattack = ds_grid_get(global.onlineList, 1, 14);
global.hijump = ds_grid_get(global.onlineList, 1, 15);
global.spiderball = ds_grid_get(global.onlineList, 1, 16);
global.speedbooster = ds_grid_get(global.onlineList, 1, 17);
global.bomb = ds_grid_get(global.onlineList, 1, 18);
global.ibeam = ds_grid_get(global.onlineList, 1, 19);
global.wbeam = ds_grid_get(global.onlineList, 1, 20);
global.pbeam = ds_grid_get(global.onlineList, 1, 21);
global.sbeam = ds_grid_get(global.onlineList, 1, 22);
global.cbeam = ds_grid_get(global.onlineList, 1, 23);
global.missiles = ds_grid_get(global.onlineList, 1, 24);
global.smissiles = ds_grid_get(global.onlineList, 1, 25);
global.pbombs = ds_grid_get(global.onlineList, 1, 26);
global.etanks = ds_grid_get(global.onlineList, 1, 27);
global.mtanks = ds_grid_get(global.onlineList, 1, 28);
global.stanks = ds_grid_get(global.onlineList, 1, 29);
global.ptanks = ds_grid_get(global.onlineList, 1, 30);
global.currentsuit = ds_grid_get(global.onlineList, 1, 31);
global.monstersarea = ds_grid_get(global.onlineList, 1, 32);
break;
case "disablesame":
for(var i=0; i<ds_grid_height(global.onlineSend); i++){
if(global.onlineSend[# 2, i] != 0){
global.onlineList[# 1, i] = global.onlineSend[# 1, i];
}
}
break;
/*
case "item":
show_debug_message("item");
for(var i=0; i<array_length_1d(global.item); i++){
show_debug_message(string(global.itemPrev[i]) + " " + string(global.item[i]));
if(global.itemPrev[i] != global.item[i]){
global.onlineSend[# 0, 0] = global.onlineList[# 0, 0];
global.onlineSend[# 1, 0] = global.onlineList[# 1, 0];
global.onlineSend[# 2, 0] = global.onlineList[# 2, 0];
show_debug_message("item changed");
return;
}
}
break;
case "event":
show_debug_message("event");
for(var i=0; i<array_length_1d(global.event); i++){
show_debug_message(string(global.eventPrev[i]) + " " + string(global.event[i]));
if(global.eventPrev[i] != global.event[i]){
global.onlineSend[# 0, 3] = global.onlineList[# 0, 3];
global.onlineSend[# 1, 3] = global.onlineList[# 1, 3];
global.onlineSend[# 2, 3] = global.onlineList[# 2, 3];
show_debug_message("event changed");
return;
}
}
break;
case "metdead":
show_debug_message("metdead");
for(var i=0; i<array_length_1d(global.metdead); i++){
show_debug_message(string(global.metdeadPrev[i]) + " " + string(global.metdead[i]));
if(global.metdeadPrev[i] != global.metdead[i]){
global.onlineSend[# 0, 1] = global.onlineList[# 0, 1];
global.onlineSend[# 1, 1] = global.onlineList[# 1, 1];
global.onlineSend[# 2, 1] = global.onlineList[# 2, 1];
show_debug_message("metdead changed");
return;
}
}
break;
*/
}
Loading…
Cancel
Save