SCUMM templates - UPDATED 4-8-04

Started by Proskrito, Fri 13/06/2003 22:38:08

Previous topic - Next topic

Scummbuddy

#61
Quote from: a-v-o on Mon 19/01/2004 19:59:39
Scummbuddy:
Can you post the script in (...before fadein) of the first room?
...and maybe the game_start and repeatedly_execute in global script?
One more possibility that could cause an error could be the code in the on_event in the global script.

Maybe the message means that there shouldn't any blocking command. Also display commands shouldn't be executed before fadein.

Code: ags
// room script file

function room_a() {
  // script for room: Player enters screen (after fadein)
StartCutscene(5);
Wait(120);
NewRoomEx(1,750,40);
EndCutscene();
}

function room_b() {
  // script for room: Player enters screen (before fadein)
SetMusicMasterVolume(100);
GUIOff(MAINGUI);  
GUIOff(ACTION);  
HideMouseCursor();
}

function room_c() {
  // script for room: Player leaves screen
GUIOn(MAINGUI);  
GUIOn(ACTION);     
ShowMouseCursor();
}



Quote from: a-v-o on Sun 08/02/2004 20:34:29
I can't see anything wrong either. Maybe there is something in the game_start or repeatedly_execute.

Code: ags

/**/function game_start() {
/**/     // called when the game starts, before the first room is loaded 
/**/////////PUT YOUR SCRIPTS HERE IF POSSIBLE///////////
game.dialog_options_y=1;
game.dialog_options_x=1;
game.items_per_line=4;
game.num_inv_displayed=8;
game.text_speed=10;
SetDefaultMode("walk to"); //edit if you want, but dont delete.

/**/////////////////////////////////////////////////////
/**/DefineTemplateVariables();
/**/SetMode("default");
/**/GUIOff(MAPS);
/**/}
/**/
/**/function repeatedly_execute() {///////////////////////////////////////////////////Repeatedly Execute
/**/    // put anything you want to happen every game cycle here
/**/////////PUT YOUR SCRIPTS HERE IF POSSIBLE///////////


/**/////////////////////////////////////////////////////
/**/
/**/  if (IsGamePaused()!=1) {
/**/   CheckDefaultAction();
/**/   UpdateActionBar();
/**/   }
/**/  if (IsGUIOn(MAPS)){//it moves the gui where the name of what is under the mouse is written in map rooms.
/**/   int guiposx, guiposy, height, namelenght, space;
/**/   string buffer;
/**/   guiposx=mouse.x;
/**/   guiposy=mouse.y;
/**/   GetLocationName(mouse.x,mouse.y,buffer);
/**/   namelenght=StrLen(buffer);
/**/   height = speechfontheight;
/**/   if ((namelenght*speechfontwidth)>=guiMAPSwidth){
/**/     space=guiMAPSwidth/2;
/**/     height=(speechfontheight*2)+2;
/**/     }
/**/   else space=namelenght*speechfontwidth/2;
/**/
/**/   if (mouse.x>320-space) guiposx=320-space;
/**/   if (mouse.x<space) guiposx=space;
/**/   if (mouse.y>200-height) guiposy=200-height;
/**/   SetGUIPosition(MAPS,guiposx-(guiMAPSwidth / 2),guiposy);
/**/   }
/**/ //change the arrows in the inventory to show if you
/**/ //can scroll the inventory:
/**/  if (game.top_inv_item > 0)     //if invent. can scroll up 
/**/    SetButtonPic(MAINGUI,9,1,invUparrowONsprite);   
/**/  else 
/**/    SetButtonPic(MAINGUI,9,1,invUparrowOFFsprite);   
/**/  if (game.top_inv_item < game.num_inv_items - (game.num_inv_displayed-1))   //if invent. can scroll down 
/**/    SetButtonPic(MAINGUI,10,1,invDownarrowONsprite);  
/**/  else 
/**/    SetButtonPic(MAINGUI,10,1,invDownarrowOFFsprite); 
/**/}


Its really upseting that I can no longer test my game to start with. Nothing should have changed between upgrades of the editor. Any ideas?
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

Scummbuddy

Sorry to repost, but I'm stuck. Is avo or Proskrito around lately?
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

Scorpiorus

And what about the content of the global on_event() function? :P

Scummbuddy

This?
Code: ags

#sectionstart on_event  
function on_event (int event, int data) {
  if (event == ENTER_ROOM) MoveToWalkableArea(GetPlayerCharacter());
}
#sectionend on_event  
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

Scorpiorus

Yeah, what it if you temporary rename it to, say, function on_event_off (int event, int data) and see if it helps at all?

Scummbuddy

I'm sorry everyone. I just assumed since the first room was Intro that that must have been the room with the bad code since I assumed it was opening first, and not another room that was scripted to be the first room. My PlayableChar was to start in room 4, but I had forgotten that I told him to, so in that room was the conflicting code.  Thank you all for your patience through my oblivous-ness.   :-[

Something new did crop up though....
---------------------------
Adventure Game Studio
---------------------------
An internal error has occured. Please note down the following information.
If the problem persists, contact Chris Jones.
(ACI version 2.61.735)

Error: run_text_script1: error -1 (Runtime error: wrong number of parameters to exported function 'unhandled_event') running function 'unhandled_event'
---------------------------
I did a search in my global script for the run_text_script1 and it didnt find it.
What happens in the room, is that I start in my starting position, and if I look at my inventory, it crashes, or if I try and walk anywhere it crashes.
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

strazer

The unhandled_event function requires parameters in newer AGS versions, so the function should look like

function unhandled_event (int what, int type) {
// ...
}

regardless whether you use these parameters or not.
Similarly, if you have imported it into the script header, change it to

import function unhandled_event(int what,int type);

Scummbuddy

any chance of un updated DOTT styled template? the previous one wont work for the same reasons as the other old ones (FOA, MI), but your new FOA and MI do work well with the newest ags version.
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

Proskrito

Quote from: Scummbuddy on Mon 10/05/2004 20:50:18
any chance of un updated DOTT styled template?
yes, as soon as i can get a new computer (hopefully soon), i'll update the templates, and try to improve them a bit.

Scummbuddy

that would seriously be great. and i hope any images you may have been working on can be moved to your new computer...  ;)  ;D
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

MarvinS

I found a bug in the FOA template.
I was unable to perform an action to an object with the left mouse button (but it works with the rigth button).

Here is my fix :

In the global script

Replace

else if (GetHotspotAt(mrx-GetViewportX(),mry-GetViewportY())==0) SetMode("default");

by

else if ((GetHotspotAt(mrx-GetViewportX(),mry-GetViewportY())==0) && (GetObjectAt(mrx-GetViewportX(),mry-GetViewportY())==-1)) {SetMode("default");}

I hope this will help somebody  ;)

OneOneZero

#72
I'm sorry to sound like an idiot... but how do I use the MI2 GUI? I can't seem to import it and I can't seem to open it as a game in AGS either (it only looks for *.dta files).

I'm sure there's a really obvious answer... sorry!

I can't wait for the updated version with scrolling!!

Thanks.

Edit: Figured it out: It's a GAME TEMPLATE!! :)

OneOneZero

All new problem. I exported the GUI and imported it into my 640x480 game but it says there's a problem with the line:

    if (button == 0)  SetMode("give");

Apparently it doesn't know what "SetMode" is. Blimey, this coding stuff sure is complicated :/

Scummbuddy

Related to MI2 template
I have tried a couple different variations upon the following
Code: ags

Ã,  // script for hotspot7: Walk to hotspot
if (MovePlayer(301,110)==1) // Start going to coords 100,300 and if
	{Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, // the player does not abort do:
		//SetCharacterView(EGO,9);
		//AnimateCharacter(EGO,0,0,0);
		SetCharacterFrame(EGO,GUYPICKUP,0,0);
		Wait(20);
		ReleaseCharacterView(EGO);
		NewRoomEx(7,225,35); //go to room 4 at these coordinates
	} 


but sometimes, if my guy is walking and i click on my hotspot with intentions to go to walk to the hotspot, do an characterframe, and then go to the new room, he'll stop walking wherever he is, and do the char frame, and then the new room will be called. but the weird thing is, is that it doesn't always work this way. sometimes he'll make it all the way to the hotspot before doing his char frame change and then new room.

this also happens when i dont call a char frame change, but as the char is walking and ill click on a hotspot, he'll instantly transport to the new room without him reaching his destination. should i add in a conditional if char is on the hotspot?

I just feel its worth mentioning because it doesn't always work, which kinda bugs me. After just testing and refreshing my memory, I have found it most often happens if you don't move after coming into a new room, and then clicking on a new hotspot.
Any ideas?
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

Borborygmus

Could someone post the newest DOTT/MI2 interface please?  The link is dead, I'm afraid...

If hosting is an issue, please instant message me at nurikosbuns, I would be happy to host for everyone and I have plenty of bandwidth and space to use.

Scummbuddy

heres the link:
http://www.freewebs.com/skimbleshanks/templates.htm

and if anyone can help with my problem, id be more than appreciative (two posts up)
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

Proskrito

#77
I'm working on a new version of the templates,(have it almost finished) which (at least i think) should be less buggy.
In order to make it somewhat 'backwards compatible', i'd like to know which template features you have used, like what template functions you have used, if you have used any template global variables in anything in your game, if you have used the $ character instead the > one in extensions...; anything you customized, or anything related to the template that should be working the same, please tell me.

(scummy, i've tried your problem with the new template, and it doesnt seem to happen. would it be much trouble upgrading to the new one? i could help you if you want)

Thanks for the offer Borborygmus : ) , i'll consider it, as the server where they were uploaded erased my rar files, so i might contact you whenever i finish them.

Borborygmus

Thanks, Scummydead!

Quote from: Proskrito on Tue 06/07/2004 15:55:55Thanks for the offer Borborygmus : ) , i'll consider it, as the server where they were uploaded erased my rar files, so i might contact you whenever i finish them.

Feel free to do so.  Thanks for making something so cool.

email: borborygmus at combogods dot com
AIM: nurikosbuns

artphobia

Quote from: Proskrito on Tue 06/07/2004 15:55:55
I'm working on a new version of the templates...


:Rubs hands together: ;D
I REALLY look forward to the DOTT template update.  Also if you need a second place/mirror site to host the coming files I can help you also Proskrito.  I get 3gb a month bandwidth so it should be fine on there also.  But anyways I mostly wanted to give ya a boost and say "thank you".


SELF INTRO
I haven't posted before but, have been reading alot about using ASG.  I grew up with these games (like most people here I am sure) and have always wanted to create my own so it feels GREAT to finally get that chance.  I've really scripted any thing before but, from reading it doesn't seem too terribly hard just alot to rememeber.  Still that's why I printed the manual out.  I like to think of the biggest / most compliacted designs when doing my artwork... so the game I am starting to work on will be just that.

Scott Jarvis's Developer Profile
http://www.ambitiousgamer.com

SMF spam blocked by CleanTalk