Aller au contenu

Photo

help! Script dont work anymore


  • Veuillez vous connecter pour répondre
3 réponses à ce sujet

#1
el.sombrero

el.sombrero
  • Members
  • 100 messages
 Hey guys...
 I'm almost going crazy here. I had designed this really big script that would give information on the player behavior through a maze. The information it would give back were of 2 kinds. The first is the time taken by the player to complete the maze. The second is the order of doors choosen by the player to solve the maze (there are multiple solutions possible).
 The thing is I completed that script some time ago and, when I tried to run it today, it didint work. It just informed me of the time taken and the FIRST door choose by the player, the feedback about the other doors was not delivered... can anyone help me out here? I've been looking at this script for the last hour and a half and couldn't find the mistake.

The script is this:

void main(){object oPC = GetEnteringObject(); //for check triggers
if(!GetIsPC(oPC)) return;
//Calculate the total time spent
int nCurrentMinute = GetTimeMinute();int nCurrentSecond = GetTimeSecond();
int nMinutesTaken = nCurrentMinute - GetLocalInt(oPC, "time_minute");int nSecondsTaken = nCurrentSecond- GetLocalInt(oPC, "time_seconds");
//Inform the total time taken.
SendMessageToPC(GetFirstPC(), IntToString(nMinutesTaken) + " Minutes and " + IntToString(nSecondsTaken) + " seconds were taken to solve the maze.");
/* Inform the players decision. There are 4 mazes (a, b, c, d). They are "T" mazes. This mean that the choice of the player occour at a junction, were it has to choose between left ("A" doors) or right ("B" door) each maze has 7 junctions. At the end of a maze, the player is teleported to the next one. There a circuit through the mazes... first maze A, then B, then C, then D... but, when the player finishes maze D he is teleported to the beggining of maze A again, and has to solve al the circuit again. Just when he finishes maze D by the second time the player is really free from the mazes. */
SendMessageToPC(GetFirstPC(), "FIRST TRIAL");
//MAZE A if ((GetLocalInt(oPC, "LA1a")== 1) ||(GetLocalInt(oPC, "LA1a")== 3))  {   SendMessageToPC(GetFirstPC(), "LA1a"); } if ((GetLocalInt(oPC, "LA1b")== 1) ||(GetLocalInt(oPC, "LA1b")== 3))  {   SendMessageToPC(GetFirstPC(), "LA1b"); } if ((GetLocalInt(oPC, "LA2a")== 1) ||(GetLocalInt(oPC, "LA2a")== 3))  {   SendMessageToPC(GetFirstPC(), "LA2a"); } if ((GetLocalInt(oPC, "LA2b")== 1) ||(GetLocalInt(oPC, "LA2b")== 3))  {   SendMessageToPC(GetFirstPC(), "LA2b"); } if ((GetLocalInt(oPC, "LA3a")== 1) ||(GetLocalInt(oPC, "LA3a")== 3))  {   SendMessageToPC(GetFirstPC(), "LA3a"); } if ((GetLocalInt(oPC, "LA3b")== 1) ||(GetLocalInt(oPC, "LA3b")== 3))  {   SendMessageToPC(GetFirstPC(), "LA3b"); } if ((GetLocalInt(oPC, "LA4a")== 1) ||(GetLocalInt(oPC, "LA4a")== 3))  {   SendMessageToPC(GetFirstPC(), "LA4a"); } if ((GetLocalInt(oPC, "LA5a")== 1) ||(GetLocalInt(oPC, "LA5a")== 3))  {   SendMessageToPC(GetFirstPC(), "LA5a"); } if ((GetLocalInt(oPC, "LA5b")== 1) ||(GetLocalInt(oPC, "LA5b")== 3))  {   SendMessageToPC(GetFirstPC(), "LA5b"); } if ((GetLocalInt(oPC, "LA6a")== 1) ||(GetLocalInt(oPC, "LA6a")== 3))  {   SendMessageToPC(GetFirstPC(), "LA6a"); } if ((GetLocalInt(oPC, "LA6b")== 1) ||(GetLocalInt(oPC, "LA6b")== 3))  {   SendMessageToPC(GetFirstPC(), "LA6b"); } if ((GetLocalInt(oPC, "LA7a")== 1) ||(GetLocalInt(oPC, "LA7a")== 3))  {   SendMessageToPC(GetFirstPC(), "LA7a"); } if ((GetLocalInt(oPC, "LA7b")== 1) ||(GetLocalInt(oPC, "LA7b")== 3))  {   SendMessageToPC(GetFirstPC(), "LA7b"); }
//MAZE B if ((GetLocalInt(oPC, "LB1a")== 1) ||(GetLocalInt(oPC, "LB1a")== 3))  {   SendMessageToPC(GetFirstPC(), "LB1a"); };
 if ((GetLocalInt(oPC, "LB1b")== 1) ||(GetLocalInt(oPC, "LB1b")== 3))  {   SendMessageToPC(GetFirstPC(), "LB1b"); } if ((GetLocalInt(oPC, "LB2a")== 1) ||(GetLocalInt(oPC, "LB2a")== 3))  {   SendMessageToPC(GetFirstPC(), "LB2a "); } if ((GetLocalInt(oPC, "LB2b")== 1) ||(GetLocalInt(oPC, "LB2b")== 3))  {   SendMessageToPC(GetFirstPC(), "LB2b "); } if ((GetLocalInt(oPC, "LB3a")== 1) ||(GetLocalInt(oPC, "LB3a")== 3))  {   SendMessageToPC(GetFirstPC(), "LB3a "); } if ((GetLocalInt(oPC, "LB3b")== 1) ||(GetLocalInt(oPC, "LB3b")== 3))  {   SendMessageToPC(GetFirstPC(), "LB3b "); } if ((GetLocalInt(oPC, "LB4a")== 1) ||(GetLocalInt(oPC, "LB4a")== 3))  {   SendMessageToPC(GetFirstPC(), "LB4a"); } if ((GetLocalInt(oPC, "LB5a")== 1) ||(GetLocalInt(oPC, "LB5a")== 3))  {   SendMessageToPC(GetFirstPC(), "LB5a"); } if ((GetLocalInt(oPC, "LB5b")== 1) ||(GetLocalInt(oPC, "LB5b")== 3))  {   SendMessageToPC(GetFirstPC(), "LB5b"); } if ((GetLocalInt(oPC, "LB6a")== 1) ||(GetLocalInt(oPC, "LB6a")== 3))  {   SendMessageToPC(GetFirstPC(), "LB6a"); } if ((GetLocalInt(oPC, "LB6b")== 1) ||(GetLocalInt(oPC, "LB6b")== 3))  {   SendMessageToPC(GetFirstPC(), "LB6b"); } if ((GetLocalInt(oPC, "LB7a")== 1) ||(GetLocalInt(oPC, "LB7a")== 3))  {   SendMessageToPC(GetFirstPC(), "LB7a"); } if ((GetLocalInt(oPC, "LB7b")== 1) ||(GetLocalInt(oPC, "LB7b")== 3))  {   SendMessageToPC(GetFirstPC(), "LB7b"); }
//MAZE C
 if ((GetLocalInt(oPC, "LC1a")== 1) ||(GetLocalInt(oPC, "LC1a")== 3))  {   SendMessageToPC(GetFirstPC(), "LC1a"); }
 if ((GetLocalInt(oPC, "LC1b")== 1) ||(GetLocalInt(oPC, "LC1b")== 3))  {   SendMessageToPC(GetFirstPC(), "LC1b"); } if ((GetLocalInt(oPC, "LC2a")== 1) ||(GetLocalInt(oPC, "LC2a")== 3))  {   SendMessageToPC(GetFirstPC(), "LC2a "); } if ((GetLocalInt(oPC, "LC2b")== 1) ||(GetLocalInt(oPC, "LC2b")== 3))  {   SendMessageToPC(GetFirstPC(), "LC2b "); } if ((GetLocalInt(oPC, "LC3a")== 1) ||(GetLocalInt(oPC, "LC3a")== 3))  {   SendMessageToPC(GetFirstPC(), "LC3a "); } if ((GetLocalInt(oPC, "LC3b")== 1) ||(GetLocalInt(oPC, "LC3b")== 3))  {   SendMessageToPC(GetFirstPC(), "LC3b "); } if ((GetLocalInt(oPC, "LC4a")== 1) ||(GetLocalInt(oPC, "LC4a")== 3))  {   SendMessageToPC(GetFirstPC(), "LC4a"); } if ((GetLocalInt(oPC, "LC5a")== 1) ||(GetLocalInt(oPC, "LC5a")== 3))  {   SendMessageToPC(GetFirstPC(), "LC5a"); } if ((GetLocalInt(oPC, "LC5b")== 1) ||(GetLocalInt(oPC, "LC5b")== 3))  {   SendMessageToPC(GetFirstPC(), "LC5b"); } if ((GetLocalInt(oPC, "LC6a")== 1) ||(GetLocalInt(oPC, "LC6a")== 3))  {   SendMessageToPC(GetFirstPC(), "LC6a"); } if ((GetLocalInt(oPC, "LC6b")== 1) ||(GetLocalInt(oPC, "LC6b")== 3))  {   SendMessageToPC(GetFirstPC(), "LC6b"); } if ((GetLocalInt(oPC, "LC7a")== 1) ||(GetLocalInt(oPC, "LC7a")== 3))  {   SendMessageToPC(GetFirstPC(), "LC7a"); } if ((GetLocalInt(oPC, "LC7b")== 1) ||(GetLocalInt(oPC, "LC7b")== 3))  {   SendMessageToPC(GetFirstPC(), "LC7b"); }
//MAZE D
 if ((GetLocalInt(oPC, "LD1a")== 1) ||(GetLocalInt(oPC, "LD1a")== 3))  {   SendMessageToPC(GetFirstPC(), "LD1a"); }
 if ((GetLocalInt(oPC, "LD1b")== 1) ||(GetLocalInt(oPC, "LD1b")== 3))  {   SendMessageToPC(GetFirstPC(), "LD1b"); } if ((GetLocalInt(oPC, "LD2a")== 1) ||(GetLocalInt(oPC, "LD2a")== 3))  {   SendMessageToPC(GetFirstPC(), "LD2a "); } if ((GetLocalInt(oPC, "LD2b")== 1) ||(GetLocalInt(oPC, "LD2b")== 3))  {   SendMessageToPC(GetFirstPC(), "LD2b "); } if ((GetLocalInt(oPC, "LD3a")== 1) ||(GetLocalInt(oPC, "LD3a")== 3))  {   SendMessageToPC(GetFirstPC(), "LD3a "); } if ((GetLocalInt(oPC, "LD3b")== 1) ||(GetLocalInt(oPC, "LD3b")== 3))  {   SendMessageToPC(GetFirstPC(), "LD3b "); } if ((GetLocalInt(oPC, "LD4a")== 1) ||(GetLocalInt(oPC, "LD4a")== 3))  {   SendMessageToPC(GetFirstPC(), "LD4a"); } if ((GetLocalInt(oPC, "LD5a")== 1) ||(GetLocalInt(oPC, "LD5a")== 3))  {   SendMessageToPC(GetFirstPC(), "LD5a"); } if ((GetLocalInt(oPC, "LD5b")== 1) ||(GetLocalInt(oPC, "LD5b")== 3))  {   SendMessageToPC(GetFirstPC(), "LD5b"); } if ((GetLocalInt(oPC, "LD6a")== 1) ||(GetLocalInt(oPC, "LD6a")== 3))  {   SendMessageToPC(GetFirstPC(), "LD6a"); } if ((GetLocalInt(oPC, "LD6b")== 1) ||(GetLocalInt(oPC, "LD6b")== 3))  {   SendMessageToPC(GetFirstPC(), "LD6b"); } if ((GetLocalInt(oPC, "LD7a")== 1) ||(GetLocalInt(oPC, "LD7a")== 3))  {   SendMessageToPC(GetFirstPC(), "LD7a"); } if ((GetLocalInt(oPC, "LD7b")== 1) ||(GetLocalInt(oPC, "LD7b")== 3))  {   SendMessageToPC(GetFirstPC(), "LD7b"); }
SendMessageToPC(GetFirstPC(), "SECOND TRIAL");
//MAZE A
 if ((GetLocalInt(oPC, "LA1a")== 2) ||(GetLocalInt(oPC, "LA1a")== 3))  {   SendMessageToPC(GetFirstPC(), "LA1a"); } if ((GetLocalInt(oPC, "LA1b")== 2) ||(GetLocalInt(oPC, "LA1b")== 3))  {   SendMessageToPC(GetFirstPC(), "LA1b"); } if ((GetLocalInt(oPC, "LA2a")== 2) ||(GetLocalInt(oPC, "LA2a")== 3))  {   SendMessageToPC(GetFirstPC(), "LA2a"); } if ((GetLocalInt(oPC, "LA2b")== 2) ||(GetLocalInt(oPC, "LA2b")== 3))  {   SendMessageToPC(GetFirstPC(), "LA2b"); } if ((GetLocalInt(oPC, "LA3a")== 2) ||(GetLocalInt(oPC, "LA3a")== 3))  {   SendMessageToPC(GetFirstPC(), "LA3a"); } if ((GetLocalInt(oPC, "LA3b")== 2) ||(GetLocalInt(oPC, "LA3b")== 3))  {   SendMessageToPC(GetFirstPC(), "LA3b"); } if ((GetLocalInt(oPC, "LA4a")== 2) ||(GetLocalInt(oPC, "LA4a")== 3))  {   SendMessageToPC(GetFirstPC(), "LA4a"); } if ((GetLocalInt(oPC, "LA5a")== 2) ||(GetLocalInt(oPC, "LA5a")== 3))  {   SendMessageToPC(GetFirstPC(), "LA5a"); } if ((GetLocalInt(oPC, "LA5b")== 2) ||(GetLocalInt(oPC, "LA5b")== 3))  {   SendMessageToPC(GetFirstPC(), "LA5b"); } if ((GetLocalInt(oPC, "LA6a")== 2) ||(GetLocalInt(oPC, "LA6a")== 3))  {   SendMessageToPC(GetFirstPC(), "LA6a"); } if ((GetLocalInt(oPC, "LA6b")== 2) ||(GetLocalInt(oPC, "LA6b")== 3))  {   SendMessageToPC(GetFirstPC(), "LA6b"); } if ((GetLocalInt(oPC, "LA7a")== 2) ||(GetLocalInt(oPC, "LA7a")== 3))  {   SendMessageToPC(GetFirstPC(), "LA7a"); } if ((GetLocalInt(oPC, "LA7b")== 2) ||(GetLocalInt(oPC, "LA7b")== 3))  {   SendMessageToPC(GetFirstPC(), "LA7b"); }
//MAZE B


 if ((GetLocalInt(oPC, "LB1a")== 2) ||(GetLocalInt(oPC, "LB1a")== 3))  {   SendMessageToPC(GetFirstPC(), "LB1a"); }
 if ((GetLocalInt(oPC, "LB1b")== 2) ||(GetLocalInt(oPC, "LB1b")== 3))  {   SendMessageToPC(GetFirstPC(), "LB1b"); } if ((GetLocalInt(oPC, "LB2a")== 2) ||(GetLocalInt(oPC, "LB2a")== 3))  {   SendMessageToPC(GetFirstPC(), "LB2a "); } if ((GetLocalInt(oPC, "LB2b")== 2) ||(GetLocalInt(oPC, "LB2b")== 3))  {   SendMessageToPC(GetFirstPC(), "LB2b "); } if ((GetLocalInt(oPC, "LB3a")== 2) ||(GetLocalInt(oPC, "LB3a")== 3))  {   SendMessageToPC(GetFirstPC(), "LB3a "); } if ((GetLocalInt(oPC, "LB3b")== 2) ||(GetLocalInt(oPC, "LB3b")== 3))  {   SendMessageToPC(GetFirstPC(), "LB3b "); } if ((GetLocalInt(oPC, "LB4a")== 2) ||(GetLocalInt(oPC, "LB4a")== 3))  {   SendMessageToPC(GetFirstPC(), "LB4a"); } if ((GetLocalInt(oPC, "LB5a")== 2) ||(GetLocalInt(oPC, "LB5a")== 3))  {   SendMessageToPC(GetFirstPC(), "LB5a"); } if ((GetLocalInt(oPC, "LB5b")== 2) ||(GetLocalInt(oPC, "LB5b")== 3))  {   SendMessageToPC(GetFirstPC(), "LB5b"); } if ((GetLocalInt(oPC, "LB6a")== 2) ||(GetLocalInt(oPC, "LB6a")== 3))  {   SendMessageToPC(GetFirstPC(), "LB6a"); } if ((GetLocalInt(oPC, "LB6b")== 2) ||(GetLocalInt(oPC, "LB6b")== 3))  {   SendMessageToPC(GetFirstPC(), "LB6b"); } if ((GetLocalInt(oPC, "LB7a")== 2) ||(GetLocalInt(oPC, "LB7a")== 3))  {   SendMessageToPC(GetFirstPC(), "LB7a"); } if ((GetLocalInt(oPC, "LB7b")== 2) ||(GetLocalInt(oPC, "LB7b")== 3))  {   SendMessageToPC(GetFirstPC(), "LB7b"); }
//MAZE C
 if ((GetLocalInt(oPC, "LC1a")== 2) ||(GetLocalInt(oPC, "LC1a")== 3))  {   SendMessageToPC(GetFirstPC(), "LC1a"); }
 if ((GetLocalInt(oPC, "LC1b")== 2) ||(GetLocalInt(oPC, "LC1b")== 3))  {   SendMessageToPC(GetFirstPC(), "LC1b"); } if ((GetLocalInt(oPC, "LC2a")== 2) ||(GetLocalInt(oPC, "LC2a")== 3))  {   SendMessageToPC(GetFirstPC(), "LC2a "); } if ((GetLocalInt(oPC, "LC2b")== 2) ||(GetLocalInt(oPC, "LC2b")== 3))  {   SendMessageToPC(GetFirstPC(), "LC2b "); } if ((GetLocalInt(oPC, "LC3a")== 2) ||(GetLocalInt(oPC, "LC3a")== 3))  {   SendMessageToPC(GetFirstPC(), "LC3a "); } if ((GetLocalInt(oPC, "LC3b")== 2) ||(GetLocalInt(oPC, "LC3b")== 3))  {   SendMessageToPC(GetFirstPC(), "LC3b "); } if ((GetLocalInt(oPC, "LC4a")== 2) ||(GetLocalInt(oPC, "LC4a")== 3))  {   SendMessageToPC(GetFirstPC(), "LC4a"); } if ((GetLocalInt(oPC, "LC5a")== 2) ||(GetLocalInt(oPC, "LC5a")== 3))  {   SendMessageToPC(GetFirstPC(), "LC5a"); } if ((GetLocalInt(oPC, "LC5b")== 2) ||(GetLocalInt(oPC, "LC5b")== 3))  {   SendMessageToPC(GetFirstPC(), "LC5b"); } if ((GetLocalInt(oPC, "LC6a")== 2) ||(GetLocalInt(oPC, "LC6a")== 3))  {   SendMessageToPC(GetFirstPC(), "LC6a"); } if ((GetLocalInt(oPC, "LC6b")== 2) ||(GetLocalInt(oPC, "LC6b")== 3))  {   SendMessageToPC(GetFirstPC(), "LC6b"); } if ((GetLocalInt(oPC, "LC7a")== 2) ||(GetLocalInt(oPC, "LC7a")== 3))  {   SendMessageToPC(GetFirstPC(), "LC7a"); } if ((GetLocalInt(oPC, "LC7b")== 2) ||(GetLocalInt(oPC, "LC7b")== 3))  {   SendMessageToPC(GetFirstPC(), "LC7b"); }
// MAZE D
 if ((GetLocalInt(oPC, "LD1a")== 2) ||(GetLocalInt(oPC, "LD1a")== 3))  {   SendMessageToPC(GetFirstPC(), "LD1a"); }
 if ((GetLocalInt(oPC, "LD1b")== 2) ||(GetLocalInt(oPC, "LD1b")== 3))  {   SendMessageToPC(GetFirstPC(), "LD1b"); } if ((GetLocalInt(oPC, "LD2a")== 2) ||(GetLocalInt(oPC, "LD2a")== 3))  {   SendMessageToPC(GetFirstPC(), "LD2a "); } if ((GetLocalInt(oPC, "LD2b")== 2) ||(GetLocalInt(oPC, "LD2b")== 3))  {   SendMessageToPC(GetFirstPC(), "LD2b "); } if ((GetLocalInt(oPC, "LD3a")== 2) ||(GetLocalInt(oPC, "LD3a")== 3))  {   SendMessageToPC(GetFirstPC(), "LD3a "); } if ((GetLocalInt(oPC, "LD3b")== 2) ||(GetLocalInt(oPC, "LD3b")== 3))  {   SendMessageToPC(GetFirstPC(), "LD3b "); } if ((GetLocalInt(oPC, "LD4a")== 2) ||(GetLocalInt(oPC, "LD4a")== 3))  {   SendMessageToPC(GetFirstPC(), "LD4a"); } if ((GetLocalInt(oPC, "LD5a")== 2) ||(GetLocalInt(oPC, "LD5a")== 3))  {   SendMessageToPC(GetFirstPC(), "LD5a"); } if ((GetLocalInt(oPC, "LD5b")== 2) ||(GetLocalInt(oPC, "LD5b")== 3))  {   SendMessageToPC(GetFirstPC(), "LD5b"); } if ((GetLocalInt(oPC, "LD6a")== 2) ||(GetLocalInt(oPC, "LD6a")== 3))  {   SendMessageToPC(GetFirstPC(), "LD6a"); } if ((GetLocalInt(oPC, "LD6b")== 2) ||(GetLocalInt(oPC, "LD6b")== 3))  {   SendMessageToPC(GetFirstPC(), "LD6b"); } if ((GetLocalInt(oPC, "LD7a")== 2) ||(GetLocalInt(oPC, "LD7a")== 3))  {   SendMessageToPC(GetFirstPC(), "LD7a"); } if ((GetLocalInt(oPC, "LD7b")== 2) ||(GetLocalInt(oPC, "LD7b")== 3))  {   SendMessageToPC(GetFirstPC(), "LD7b"); }
}

#2
el.sombrero

el.sombrero
  • Members
  • 100 messages
ps: it is not a compilation problem. it compiles ok.

#3
Lugaid of the Red Stripes

Lugaid of the Red Stripes
  • Members
  • 955 messages
I don't know how the forum formatting might have messed up your line returns, but I see a problem here:

//MAZE A if ((GetLocalInt(oPC, "LA1a")== 1) ||(GetLocalInt(oPC, "LA1a")== 3)) { SendMessageToPC(GetFirstPC(), "LA1a"); } if ((GetLocalInt(oPC, "LA1b")== 1) ||(GetLocalInt(oPC, "LA1b")== 3)) { SendMessageToPC(GetFirstPC(), "LA1b"); } if

Commenting out "MAZE A" also comments out that conditional, and the open bracket that follows it. That means that the close bracket on the next line closes out the whole script, or, more precisely, ends your main function.

#4
el.sombrero

el.sombrero
  • Members
  • 100 messages
Hey guys, problem solved. Thx

Modifié par el.sombrero, 10 septembre 2012 - 06:41 .