eastern-flames/eastern flames/scripts/utils/utils.gml

72 lines
4.0 KiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

///@function foreach(array,function(entry){})
///@param {array} array
///@param {function} function
///@description its foreach
function foreach(array, func){
for(i = 0; i < array_length(array);i++){
func(array[i]);
}
}
/*exception_unhandled_handler(function(ex){
var amongus = "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣤⣤⣤⣤⣤⣶⣦⣤⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀\n⢀⣴⣿⡿⠛⠉⠙⠛⠛⠛⠛⠻⢿⣿⣷⣤⡀\n⣼⣿⠋⢀⣀⣀⠈⢻⣿⣿⡄\n⣸⣿⡏⣠⣶⣾⣿⣿⣿⠿⠿⠿⢿⣿⣿⣿⣄\n⣿⣿⠁⢰⣿⣿⣯⠁⠈⠙⢿⣷⡄\n⣀⣤⣴⣶⣶⣿⡟⢸⣿⣿⣿⣆🔴🔴⣿⣷\n⢰⣿⡟⠋⠉⣹⣿⡇⠘⣿⣿⣿⣿⣷⣦⣤⣤⣤⣶⣶⣶⣶⣿⣿⣿\n⢸⣿⡇⣿⣿⡇⠹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠃\n⣸⣿⡇⣿⣿⡇⠉⠻⠿⣿⣿⣿⣿⡿⠿⠿⠛⢻⣿⡇\n⣿⣿⠁⣿⣿⡇⢸⣿⣧\n⣿⣿⣿⣿⡇⢸⣿⣿\n⣿⣿⣿⣿⡇⢸⣿⣿\n⢿⣿⡆⣿⣿⡇⢸⣿⡇\n⠸⣿⣧⡀⣿⣿⡇⣿⣿⠃\n⠛⢿⣿⣿⣿⣿⣇⣰⣿⣿⣷⣶⣶⣶⣶⠶⢠⣿⣿\n⣿⣿⣿⣿⡇⣽⣿⡏⠁⢸⣿⡇\n⣿⣿⣿⣿⡇⢹⣿⡆⣸⣿⠇\n⢿⣿⣦⣄⣀⣠⣴⣿⣿⠁⠈⠻⣿⣿⣿⣿⡿⠏\n⠈⠛⠻⠿⠿⠿⠿⠋⠁"
amongus+="\n SUSSY SUSSY SUSSY YOU ARE SUSSY BAKA SUS SUS AMONGUS IMPOSTER SUS";
//var amongus= "Your game has crashed! ctrl+c this and send it to Bread Man#8916 on discord along with how you crashed\n\n";
amongus+="\n"+string(ex.message);
amongus+="\n##############################\n"+string(ex.longMessage);
amongus+="\n##############################\n"+string(ex.script);
amongus+="\n##############################\nat line:"+string(ex.line);
amongus+="\n##############################\n"+string(ex.stacktrace);
amongus+="\n" + global.seed.toString();
log(ex);
log(global.seed);
show_message(amongus);
//show_message(room);
//show_message(instance_number(all))
game_save("test");
//surface_save(global.surfaces.map,"balls.png");
return 0;
});*/
/*exception_unhandled_handler(function(ex){
var amongus = "Congratulations!";
amongus+="\nYou crashed the game!";
amongus+="\nWe tried our best to make sure it wasn't possible, but it happens.";
amongus+= "Ctrl+c this and send it to Bread Man#8916 or in the #bugs channel on discord along with how you crashed.\n\n";
amongus+="\n"+string(ex.message);
amongus+="\n##############################\n"+string(ex.longMessage);
amongus+="\n##############################\n"+string(ex.script);
amongus+="\n##############################\nat line:"+string(ex.line);
amongus+="\n##############################\n"+string(ex.stacktrace);
amongus+="\n" + global.seed.toString();
log(ex);
log(global.seed);
show_message(amongus);
//show_message(room);
//show_message(instance_number(all))
game_save("test");
//surface_save(global.surfaces.map,"balls.png");
return 0;
});*/
function ciel(value) {
return ceil(value);
}
function string_split(str,splitter){
var theArray = [];
for(var i = 0; i < string_length(str); i++){
if(string_char_at(str,i) == splitter){
array_push(theArray,string_copy(str,1,i-1));
str = string_delete(str,1,i);
i = 0;
}
}
array_push(theArray,str);
return theArray;
}
//#macro true (random_range(0,1000) > 1)
#macro nu a = new