Menu

Show posts

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

Topics - kIM

#1
I messed up when trying out double click code from topic 12190.0.  When I testet the game, I got the error: "Unable to open custom exe'Compiled\Testgame.exe. Global script, line 9: A blocking function was called before the first room has been loaded."

So I deleted every double click code line in the main global script, the script header, I deleted even the  hotspots. But I still get the message.

EDIT
Thank you for your suggestion, Akatosh and KrisMUC, but there is nothing in there. Game-Start is empty.
As I got error messages, I deleted the code in the game-start section and put everything  in On-mouse-click. and an' int doubleclick' on top of the global script. Now everything is deleted, also in the On-mouse-click-section. I have other code in Rep-exec, but nothing I know of with 'doubleclick'. I think I messed eround too much with the code.  ???

Maybe, as a noob at scripting with glased over eyes, I should ask for advice about my code in the forum, before trying stupid things. :-[
#2
Hallo, his is my first post.

I have no experience with scripting and please excuse my lack of experience with wrighting english too.

I made a script about cursors(see far below), but cannot test or save my game because of following error message: There was an error compiling your script. The problem was: In ‘Global script ‘
Error (line 36): Nested functions not supported (you may have forgotten a closing brace).

I am not aware, that I changed anything in this default script, and I do not see something wrong:

#sectionstart on_key_press  // DO NOT EDIT OR REMOVE THIS LINE
Line 36:  function on_key_press(int keycode) // called when a key is pressed. keycode holds the key's ASCII code
  {
  if (IsGamePaused()==1) keycode=0; // game paused, so don't react to keypresses
  if (keycode==17) QuitGame(1); // Ctrl-Q
  if (keycode==363) SaveGameDialog(); // F5
  if (keycode==365) RestoreGameDialog(); // F7
  if (keycode==367) RestartGame(); // F9
  if (keycode==434) SaveScreenShot("scrnshot.pcx");  // F12
  if (keycode==9) InventoryScreen(); // Tab, show inventory
  if (keycode==19) Debug(0,0); // Ctrl-S, give all inventory
  if (keycode==22) Debug(1,0); // Ctrl-V, version
  if (keycode==1) Debug(2,0); // Ctrl-A, show walkable areas
  if (keycode==24) Debug(3,0); // Ctrl-X, teleport to room
  }
#sectionend on_key_press  // DO NOT EDIT OR REMOVE THIS LINE

Maybe I can delete the whole thing, as I do not use it?

The script I wanted to test should change the mouse.Mode automatically to eModeInteract, wenn over a hotspot, etc. and animate with view INTER, loop 0. When I only change the curor mode automatically, the animation does not work any more. So I must tell the engine in a script, to animate.
I wrote one inspired from a respons from Ashen to a question about animating a cursor wenn over one specific hotspot. Mine is meant to work in all the rooms and also on regions. On regions I want to change the cursor graphic to still another one, also animating, but for a beginning I prefer to try this script first., because I do not know yet where to put the region thing with the Region.GetAtRoomXY …. function in the script. I am sorry, it all looks very complicated to me.

Code:

#sectionstart repeatedly_execute  // DO NOT EDIT OR REMOVE THIS LINE{
  // put anything you want to happen every game cycle here

int cursorset;
function repeatedly_execute(){
if(GetLocationType(mouse.x, mouse.y)==eLocationNothing)
  if(cursorset==0){
mouse.Mode=eModeWalkto;
cursorset=1;
}
else{
  if(cursorset==1){
    mouse.Mode=eModeInteract;
    Mouse.ChangeModeView(eModeInteract,INTER);
   
cursorset=0;
}
}


Maybe I should use global integers here, but I have no clue how to do that.

If anyone with experience would tell me if there is something wrong with what I have written and explain it to me, I would be gratefull.

Kim

SMF spam blocked by CleanTalk