(@CJ: check post with red text) Blocking Functions!

Started by rtf, Tue 02/03/2004 00:42:09

Previous topic - Next topic

rtf

Aaah!  Perfect timing to screw up.

I'm making this thing from AGS for my multimedia project for English Class.

EVerything was working great, until today, when I loaded my game and tried to test it without changing anything.  I got this dialog box saying "Blocking FUnction Called Before First Room Loaded"  or something like that.

I thought, "No problem, I'll just get rid of my Wait() command in the Introduction room's script.

That diddn't work.  I also checked the splash screen because what have I got to lose?  Oh yeah, 100 freakin points twards my English Grade!!

So then I was all "Duh, stupid Daniel!  Just check the global script!"  Woo-Hoo!  SOlved.

WRONG!!!!

THere was nothing in the global script!  Well, of course there was something in it, but not in the Game_Start function.

So I checked the forums, and checked the help files and everything else.  Nothing is helping me. So I went back and tried another check, but still, I couldn't see anything wrong!


AAAAAAaaa!!!  My teacher only gave us 5 days to work on this, and it's due on Wednesday!

Whoever helps me will get their name in my credits and 20 points extra credit!

And here is my Global Script:

Inventory_Click/ Interface Click and such seemed rather pointless to this, so I left them out.  But just in case they were neccesary, I asure you, there was nothing out of the ordinary up there:


Quote
// main global script file

function game_start() {
 // called when the game starts, before the first room is loaded
}

function repeatedly_execute() {
 // put anything you want to happen every game cycle here
}

function show_inventory_window () {
 // This demonstrates both types of inventory window - the first part is how to
 // show the built-in inventory window, the second part uses the custom one.
 // Un-comment one section or the other below.
 
 // ** DEFAULT INVENTORY WINDOW
 InventoryScreen();
/*  
 // ** CUSTOM INVENTORY WINDOW
 GUIOn (INVENTORY);  
 // switch to the Use cursor (to select items with)
 SetCursorMode (MODE_USE);
 // But, override the appearance to look like the arrow
 SetMouseCursor (6);
*/
}

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.bmp");  // F12
 if (keycode==9)   show_inventory_window();  // 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
}

function on_mouse_click(int button) {
 // called when a mouse button is clicked. button is either LEFT or RIGHT
 if (IsGamePaused() == 1) {
   // Game is paused, so do nothing (ie. don't allow mouse click)
 }
 else if (button==LEFT) {
   ProcessClick(mouse.x, mouse.y, GetCursorMode() );
 }
 else {   // right-click, so cycle cursor
   SetNextCursorMode();
 }
}

Whoever helps will be eternally thankful


Thanks (remember, due on the 3rd!);
I fail at art.

deltamatrix

What AGS version are you using?

Have you tried commenting out all the blocking functions within the room script since the problem doesn't seem to be in the global script unless I'm overlooking something.

Show us your room script code as well please  ;)
BAD WOLF - TORCHWOOD - MR SAXON - THE BEES ARE DISAPPEARING - PANDORICA - RIVER SONG

rtf

Version 2.6, i'm pretty sure.

Here is my splash screen code.  All the other rooms are blank, so far.

Quote
// room script file

function hotspot2_a() {
 // script for hotspot2: Mouse moves over hotspot
 
}

function room_a() {
 // script for room: Player enters screen (before fadein)
 
}

function room_b() {
 // script for room: Player enters screen (before fadein)
DisableCursorMode(MODE_LOOK);
DisableCursorMode(MODE_WALK);
DisableCursorMode(MODE_TALK);  
}

function hotspot2_b() {
 // script for hotspot2: Any click on hotspot
QuitGame(1);  
}

function hotspot1_a() {
 // script for hotspot1: Any click on hotspot
 
}

function hotspot1_b() {
 // script for hotspot1: Any click on hotspot
NewRoomEx(1, 141, 138);  
}
I fail at art.

Gilbert


rtf

I just tried it.

No luck.  Waaah!!  :'(

update::

Noooo! The beta version 2.61 doesn't work either.

And my teacher isn't a big computer person so she won't understand and take into consideration what's wrong so I won't get a pardon on my assignment.  Waaaaaaa  :'(
I fail at art.

Gilbert

Hmmm are there anything in the script headers?

If the problem persists you may consider uploading the game and let others try and figure out what's happening.

rtf

Nothing in the script headers, but here is a .zip file with all the neccesary stuff in it:

http://www.freewebs.com/releasethefrogs/Damnit!!!!.zip

Thanks

The best part is, since Gilbot is in Hong Kong, he has all day to solve my problems  ;D  but I gotta go to bed  >:(  hehehehe

good luck, everybody

edit:  oh, yeah, do Save Target As.  I think all freewebs ones have you do that
I fail at art.

Gilbert

Well just found the problem, it's not easy to notice, just set your player character to start in room 0 instead of room -1, the problem is solved.

You cannot set the player character to start in a non-existing room, because upon start, the engine determines which is the first room to load by checking which room the player character starts in (and if it's 0, the engine will loads intro.crm).

If you don't want him to appear initially, just hide him (using whatever method, just as setting the hidden variable character[EGO].on to 0, or change him to a "blank" view, or, if you just don't want him in the whole room, just hide him in that room's setting, which you had done already).


But I'll say that it's not very friendly for the engine to report an irrevalent error message, I'll stick this topic for CJ to see.

rtf

#8
Aaahhhhhhhh...

Thank you so very much, Gilbert!  :D  Woo-Hoo!

I don't know what else to put here to thank you enough, you just saved my grade in English   ;)  hehehe

I will get to that right away and by tommarow I will almost be done.

Talk to you later, time for bed  :P

PS.  If anyone is interested in the story of baseball activist Curt Flood, than this Non-Adventure is for you.
I fail at art.

LordHart

#9
Now you just have to hope that the teacher likes it and actually gives you those marks. :P

edit: Who the f*** is Curt Flood?

Pumaman

Quote from: Gilbot V7000a on Tue 02/03/2004 05:13:58
But I'll say that it's not very friendly for the engine to report an irrevalent error message, I'll stick this topic for CJ to see.

Good point - you would normally get an error message about the room not existing, but if there is a "room-1.crm" file then you will get this strange message instead.

This is quite a rare situation to occur (in fact this is the first time I've ever heard of it), since it requires you to (a) set the starting room to -1, and (b) have a valid room file saved as "room-1.crm".

Anyway, I'll get the message fixed for the next beta, thanks for the info.

rtf

Quote from: Os àšltimo Quão Queijo ^_^ on Tue 02/03/2004 05:37:35
Now you just have to hope that the teacher likes it and actually gives you those marks. :P

edit: Who the f*** is Curt Flood?


Hehe

Curt Flood was a baseballl player in the 60's who challenged a few big rules in the commision.
I'm kinda a baseball guy.

Our assignment was to make something that reflects workers rights.  I don't know why we did that in English, but that's good enough for me  :)
I fail at art.

Gilbert

Heh I didn't check the file list and didn't know about the existence of room-1.crm, I thought it's giving teh same message whenever the starting room is set like that. My bad. ;)

Etcher Squared Games

I know this thread is 2 years old, but I just wanted to let CJ know that I'm using v2.71 (build 2.71.631) December 2005 and I getting errors about can't load room due to blocking call (which by the way if I commented out my cBla.SetAsPlayer();, the game would load).

But I needed that function where it was, that and it just worked like 5 minutes prior.  They only thing I had done, was I changed the names of all my characters (since they finally have names).

This had some side affects.
I have 6 characters.  I was using 2-6.  2 was my default player and on load up the default SetAsPlayer was player 2.  After the rename, player 1 was the player calling the SetAsplayer, yet player 2 still had the 'player character' still set. 

I'm sorry as I don't recall the state of the initial room numbers as I was trying to frantically get my game working again.

Somewhere in all this I got a "room-1.crm" error.  Thinking somehow I was thinking I had gotten the naming scheme wrong this whole time, I renamed the room, didn't work, renamed back.

Finally, I fixed the room numbers, went ahead and checked player character for player 1 and now my game is loading just as it did.

I'm sorry this is all the information I have, and I can't seem to reproduce this event happening again.
website: http://www.etcher2games.com/
email: etcher2games@yahoo.com
forum: http://www.etcher2games.com/forums

Anyone want to make my website for free?

SMF spam blocked by CleanTalk