Wow, that code really did the trick! I still need to tweak it in parts so that it sorts the way I need it to in my particular game, but the actual sorting part worked excellently. Thanks so much!
NiksterG
NiksterG

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu
// room script file
#sectionstart room_a // DO NOT EDIT OR REMOVE THIS LINE
function room_a() {
// script for Room: Player enters room (before fadein)
cPlayer.LockView(35); // sets character view to invisible
#sectionend room_a // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart room_b // DO NOT EDIT OR REMOVE THIS LINE
function room_b() {
// script for Room: Player enters room (after fadein)
FadeIn(1);
Wait(80);
Overlay* credits1 = Overlay.CreateTextual(80, 120, 160, 3, 65472, "Title goes here");
cPlayer.Walk(518, 152, eNoBlock, eAnywhere);
Wait(400);
credits1.Remove();
}
#sectionend room_b // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart room_c // DO NOT EDIT OR REMOVE THIS LINE
function room_c() {
// script for Room: Repeatedly execute
int i=0;
while (i<400) {
jump(cTga.ID, 125, 145);
jump(cTgb.ID, 80, 100);
jump(cTgc.ID, 180, 200);
i++;
}
}
#sectionend room_c // DO NOT EDIT OR REMOVE THIS LINE
// global script
function jump(int characterID, int ymin, int ymax) { // characterID jumps from ymax to a height of ymin, then comes back down
int i = 0;
while (i<2) {
if (character[characterID].y <= ymin) {
while (character[characterID].y < ymax ) {
character[characterID].y++;
Wait(1);
}
}
else if (character[characterID].y >= ymax) {
while (character[characterID].y > ymin) {
character[characterID].y--;
Wait(1);
}
}
i++;
}
}
// room script file
#sectionstart room_a // DO NOT EDIT OR REMOVE THIS LINE
function room_a() {
// script for room: Walk off left screen edge
SetGlobalInt(5, 0); // reset number of correct turns because the player didn't go through correctly
cPlayer.ChangeRoom(21, 300, 170); // go to beginning
}
#sectionend room_a // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart room_b // DO NOT EDIT OR REMOVE THIS LINE
function room_b() {
// script for room: Walk off right screen edge
if ((GetGlobalInt(5) != 1) && (GetGlobalInt(5) != 3)) { // this direction is not correct right now
FadeOut(10);
cPlayer.StopMoving()
cPlayer.x = 20;
cPlayer.y = 170; //place player on opposite side of room; gives the illusion of a new room
SetGlobalInt(5, 0); // wrong way, reset the number of correct turns
Wait(1);
FadeIn(10);
}
else if (GetGlobalInt(5) == 1) { //correct path
FadeOut(10);
cPlayer.StopMoving();
cPlayer.x = 20;
cPlayer.y = 170; //place player on opposite side of room; gives the illusion of a new room
SetGlobalInt(5, 2); // correct path
Wait(1);
FadeIn(10);
}
else if (GetGlobalInt(5) == 3) {
SetGlobalInt(5, 0); //reset correct path for next time player goes through the maze
cPlayer.ChangeRoom(23, 20, 170); // finished maze, go to next room
}
}
#sectionend room_b // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart room_c // DO NOT EDIT OR REMOVE THIS LINE
function room_c() {
// script for room: Walk off bottom screen edge
if (GetGlobalInt(5) == 2) { // correct path
FadeOut(10);
cPlayer.StopMoving();
cPlayer.x = 150;
cPlayer.y = 80; //place player on opposite side of room; gives the illusion of a new room
SetGlobalInt(5, 3);
Wait(1);
FadeIn(10);
}
else { // not the correct path
FadeOut(10);
StopMoving(PLAYER);
character[PLAYER].x = 150;
character[PLAYER].y = 80; //place player on opposite side of room; gives the illusion of a new room
SetGlobalInt(5, 0); // reset number of correct turns
Wait(1);
FadeIn(10);
}
}
#sectionend room_c // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart room_d // DO NOT EDIT OR REMOVE THIS LINE
function room_d() {
// script for room: Walk off top screen edge
if (GetGlobalInt(5) == 0) { //correct path
FadeOut(10);
cPlayer.StopMoving();
cPlayer.x = 160;
cPlayer.y = 220; //place player on opposite side of room; gives the illusion of a new room
SetGlobalInt(5, 1);
Wait(1);
FadeIn(10);
}
else { //not the correct path
FadeOut(10);
cPlayer.StopMoving();
cPlayer.x = 160;
cPlayer.y = 220; //place player on opposite side of room; gives the illusion of a new room
SetGlobalInt(5, 0);
Wait(1);
FadeIn(10);
}
}
#sectionend room_d // DO NOT EDIT OR REMOVE THIS LINE
function transtohuman() {
GUIOff(6);
PlaySound(9);
if (character[PLAYER].view == 10) { //from dragon monster view
SetCharacterView(PLAYER, 10);
AnimateCharacterEx(PLAYER, 3, 5, 0, 1, 1);
}
else if (character[PLAYER].view == 8) { //from Tree Dweller view
SetCharacterView(PLAYER, 10);
AnimateCharacterEx(PLAYER, 0, 5, 0, 1, 1);
}
else if (cPlayer.View == 14) { //from bird
cPlayer.LockView(10);
cPlayer.Animate(4, 5, eOnce, eBlock, eBackwards);
}
else if (cPlayer.View == 16) { //from dragon
cPlayer.LockView(10);
cPlayer.Animate(5, 5, eOnce, eBlock, eBackwards);
}
else if (cPlayer.View == 22) { //from seer
EnableCursorMode(eModeInteract);
cPlayer.LockView(10);
cPlayer.Animate(6, 5, eOnce, eBlock, eBackwards);
}
SetCharacterView(PLAYER, 10);
if (GetGlobalInt(2) == 1) {
AnimateCharacterEx(PLAYER, 2, 5, 0, 0, 1);
SetCharacterViewEx(PLAYER, 6, 0, ALIGN_CENTRE);
cPlayer.SetWalkSpeed(5, 5);
SetCursorMode(0);
}
else{
AnimateCharacterEx(PLAYER, 1, 5, 0, 0, 1);
SetCharacterViewEx(PLAYER, 1, 0, ALIGN_CENTRE);
cPlayer.SetWalkSpeed(5, 5);
SetCursorMode(0);
}
}
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.049 seconds with 14 queries.