wen i test mi game it screws up

Started by Raider, Sun 18/07/2004 11:56:27

Previous topic - Next topic

Raider

me again...
well i test mi game and the i can only right click.
i tested mi game at mi m8s house and found that if i left click then it gives me an error and shuts down the test and also i cant test mi game in full screen on mi own computer, i have to put it in a window and hold down the top bar on the little window for it to start and if i let go it dusnt wrk. so i cant move or practicly test the game!

menazerus

Left-click error: does it always mess, no matter where you are clicking? maybe you deleted a character-animation. Try using another character as the player-character (just for testing).
Therefore check the boxes:
-This is the player character
-Start in this room

Testing Game:
Does it work if you start in another room instead ?
Maybe there is something wrong with solutions and co-ordinates
or some object/char uses an area that you deleted lately ?

well, just some suggestions. also it might be possible the both problems have the same source...
Let me hear if anything worked.

Raider

nah it hasnt worked. it still comes up with the same error any more sugestions?

Moox


Raider

Error: run_text_script1: error -1 (Runtime error: wrong number of parameters to exported function 'unhandled_event') running function 'unhandled_event'

thats the error and i hav no idea wat it means

menazerus

Did you use this function somewhere ? search it in the global script...

unhandled_event (int what, int type);

if you do, check if all parameters  (what,type) are given correctly.
Also visit the help file and read the "unhandled_event" in the "text script event reference". It shows you which parameters you can choose.

also try to remember if you deleted actions in the character interaction menu. good luck, let me hear if it worked this time

Raider

help i dnt no wat all tht means!
but it does say:
/**/function unhandled_event()
on one line does tht mean nething to u?

Gilbert

Comment that out and see if it works, you can do so just by moving the */ to the end of the line:
/*function unhandled_event()*/


(Note: it can still cause problem as I think that there should be more to it in the lines that follows, if it still doesn't work please paste the whole script here.)

Raider

its complicated :s
Sorry about the big post!

#sectionstart on_event  // DO NOT EDIT OR REMOVE THIS LINE
function on_event (int event, int data) {
  if (event == ENTER_ROOM) MoveToWalkableArea(GetPlayerCharacter());
}
#sectionend on_event  // DO NOT EDIT OR REMOVE THIS LINE

/**/function dialog_request (int parameter) {////////////////////////////////////////////Dialog request
/**/////////PUT YOUR SCRIPTS HERE IF POSSIBLE///////////


/**/////////////////////////////////////////////////////
/**/}
/**/function unhandled_event(){////////////////////////////////////////////unhandled event
/**/  int type=GetLocationType(mouse.x,mouse.y);
/**/  string locationname,usedinvname;//,buffer;
/**/  MouseLocationName(locationname);
/**/  RemoveExtension(locationname);
/**/  if (type==0 && GetInvAt(mouse.x,mouse.y)>=0) type=4;
/**/  if (GSagsusedmode==4){
/**/    GetInvName(player.activeinv,usedinvname);
/**/    RemoveExtension(usedinvname);
/**/    if (type>0) type+=4;
/**/    }
/**/  if (game.used_mode==9 && type<4){}
/**/  else if (IsGUIOn(MAPS)==1 || type==0){}
/**/  else{
//Check modes with: if(UsedMode("mode")), check types by if(type==#). types:
//1   a hotspot
//2   a character
//3   an object
//4   an inventory item.
//5   inv. item on hotspot
//6   inv. item on character
//7   inv. item on object
//8   inv. item on inv. item

// You have the string "locationname" that is the name of
// what you clicked on, and the string "usedinvname" that is
// the name of the item that was used on where you clicked (only for types 5,6,7,8)
/**/////////PUT YOUR SCRIPTS HERE IF POSSIBLE///////////

// REPLACE THIS SAMPLE INTERACTIONS WITH YOURS:
string buffer;
   if (type<4)FaceLocation(GetPlayerCharacter(),mouse.x,mouse.y); //this will make the player look to what he clicked on.
   if (UsedMode("close")){
      Display("I can't close that");
   }
   else if (UsedMode("use") && type>=5){//if inv on inv:
     StrCopy(buffer,"I can't use the ");
     StrCat(buffer, usedinvname);
     StrCat(buffer, " on the ");
     StrCat(buffer, locationname);
     Display(buffer);
   }
   else if (UsedMode("look at")){
     if (type!=2){//if its not a character
       StrCopy(buffer,"Nice ");
       StrCat(buffer,locationname);
       Display(buffer);
       }
     else{
      StrCopy(buffer,"it's ");
      StrCat(buffer,locationname);
      Display(buffer);     
     }
   }
   else if (UsedMode("pick up")){
     if (type==2) Display("I don't want that");
     else Display("I can't pick that up");
   }
   else if (UsedMode("talk to")){
     if (type==2){
        StrCopy(buffer,"I don't want to talk to ");
        StrCat(buffer,locationname);
        Display(buffer);
     }
     else Display("It doesn't talk");
     }
   else{
       StrCopy(buffer,"I can't ");
       StrCat(buffer,GSusedmode);
       StrCat(buffer," that");
       Display(buffer);
   }
/**/////////////////////////////////////////////////////
/**/ }
/**/}
/**/
////////////////////////////////////////////////////////////////////////////////////
/**/export ActionLabelColorNormal,ActionLabelColorHighlighted,maplabelcolour,
/**/       invUparrowONsprite, invUparrowOFFsprite,invDownarrowONsprite,invDownarrowOFFsprite;
////////////////////////////////////////////////////////////////////////////////////
/**/

Gilbert

Actually I don't quite understand why you put that many /**/ which does nothing, they just make the script difficult to read, no harm done, though.

Moreover to make single line comments, double slashes is enough (//), no need to put stuffs like /////////////////

The script is actually quite short compared to average ones, I didn't read all, but obviously you didn't define the function unhandled_event() correctly, as it MUST contain 2 parameters, change the line:
/**/function unhandled_event(){////////////////////////////////////////////unhandled event

to:
function unhandled_event(int event, int data){//unhandled event

Raider

tht didnt wrk i cant save it cos an error came up saying:

There was an error complying your script. The problem was in the main script: Error (line 845): wrong number of parameters in call to 'unhandled_event' do you want to fix your script now?

hmmm

Gilbert

What is in line 845 of the global script?

Raider


Gilbert

As I said before, unhandled_event() MUST take on 2 parameters, so you need to supply it with 2 parameters even if you may not actually use them, just change the line to:
else unhandled_event(0,0);


Raider

OMS
u the man thx heaps that has relieved a lot of frustration thx man hope 2 talk again later

Raider

TerranRich

Please type in full words in the future, Raider, it's a lot easier to read than "tht didnt wrk". Thank you. :)
Status: Trying to come up with some ideas...

SMF spam blocked by CleanTalk