SCUMM templates - UPDATED 4-8-04

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

Previous topic - Next topic

strazer

#100
Doesn't

Quote from: strazer on Sun 02/05/2004 17:14:13
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);

work?

Scummbuddy

Quote
function unhandled_event (int what, int type)

If I put this in place of my function unhandled_event(), i get 'type already defined' and when i take out the int, i get a parse error. now, is proskrito already using type for something else, so that variable must be renamed, and then i can put type back in the parameters?
- 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

sorry, i've been a bit busy from some time now, (and seems like thats going to continue for some more time : / ) I worked on the new templates during last summer, but i didnt release the new dott template because there were some issues, and (mainly) because i hadnt done the documentation.
i think its at least useable, so if you want to try what i had done here it is:
http://usuarios.lycos.es/golfapagina/templates/
you can read the documentation from the other templates, although there are some things only in the dott one that obviously are not commented on those, so if you have some problems or questions i'll try to answer them as soon as possible.

sorry for all the inconveniences!

Bombadil

What's the difference between DOTT, FoA and MI2 templates? They all have the same actions.

Anyway, is any of them working without bugs?

Proskrito

#104
1- what's the difference between DOTT, FOA and MI2 lucasarts games?
i tried to copy these games.
just in case, remember that a template is not a gui.
2- without bugs? i dont think so. But if you find a bug, post it here and i'll try to correct it.

Bombadil

Thanks Proskrito!

Then I will try one of those templates...

Sonim

i d/l MI2 template from the last link u postet, proskrito and got the message "that GUI is already set for a local (or global)" and so on.
i got 2.7 and am absolute (obsolete  ;D) no clue of scripting. just wanted to tell you that.

peace

Lazarus

#107
I'd like to start with that *raises hand in the air* by saying that i am quite new at this, only 3 weeks.

I started with version 2.62 and using Proskrito's MI2 templatev2.0c which works fine, i then downloaded version 2.7 with the same template and got the gui,objects and hotspot global errors which i have sorted out.

The problem i then got was with:

Line 445:Ã,  Function declaration has wrong number of arguments to prototype.

function GoToCharacterEx(int charidwhogoes, int charidtogo, int direction, int xoffset, int yoffset, int NPCfacesplayer, int blocking){
Ã,  //Goes to a character staying at the side defined by 'direction': 1 up, 2 right, 3 down, 4 left
Ã,  //and it stays at xoffset or yofsset from the character. NPCfacesplayer self-explained.
Ã,  // blocking: 0=non-blocking; 1=blocking; 2=semi-blocking.
Ã,  // returns 1 if player arrived.
Ã,  int playerchar,charidx,charidy,playerx,playery;
Ã,  if (charidwhogoes!=GetPlayerCharacter() && blocking==2) blocking=0;//npcs cant perform semi-blocking actions
Ã,  playerchar=charidwhogoes;
Ã,  charidx=character[charidtogo].x;
Ã,  charidy=character[charidtogo].y;
Ã,  playerx=character[playerchar].x;
Ã,  playery=character[playerchar].y;
Ã,  Ã,  Ã,  int arrived = 1;
Ã,  Ã,  Ã,  if ((Offset (playerx, charidx) > xoffset) || (Offset (playery, charidy) > yoffset)){
Ã,  Ã,  Ã,  Ã,  if (direction==0){ // shortest way.
Ã,  Ã,  Ã,  Ã,  Ã,  if (Offset(charidx,playerx)>=Offset(charidy,playery)){ // left or right
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  if (playerx>=charidx) direction=2; //right
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  else direction=4; //left
Ã,  Ã,  Ã,  Ã,  Ã,  }
Ã,  Ã,  Ã,  Ã,  Ã,  else{
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  if (playery>=charidy) direction=3; //down
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  else direction=1;
Ã,  Ã,  Ã,  Ã,  Ã,  }
Ã,  Ã,  Ã,  Ã,  }
Ã,  Ã,  Ã,  Ã,  // calculate target position
Ã,  Ã,  Ã,  Ã,  if (direction==1) charidy-=yoffset;
Ã,  Ã,  Ã,  Ã,  else if (direction==2) charidx+=xoffset;
Ã,  Ã,  Ã,  Ã,  else if (direction==3) charidy+=yoffset;
Ã,  Ã,  Ã,  Ã,  else if (direction==4) charidx-=xoffset;
Ã,  Ã,  Ã,  Ã,  // move character
Ã,  Ã,  Ã,  Ã,  if (blocking==0){
Ã,  Ã,  Ã,  Ã,  Ã,  MoveCharacter(playerchar,charidx,charidy);
Ã,  Ã,  Ã,  Ã,  Ã,  arrived = 0;
Ã,  Ã,  Ã,  Ã,  }
Ã,  Ã,  Ã,  Ã,  else if (blocking==1){
Ã,  Ã,  Ã,  Ã,  Ã,  MoveCharacterBlocking(playerchar,charidx,charidy,0);
Ã,  Ã,  Ã,  Ã,  Ã,  arrived = 1;
Ã,  Ã,  Ã,  Ã,  }
Ã,  Ã,  Ã,  Ã,  else if (blocking==2) arrived = MovePlayer(charidx,charidy);
Ã,  Ã,  Ã,  }
Ã,  Ã,  Ã,  if (arrived > 0){
Ã,  Ã,  Ã,  Ã,  // characters only face each other after the moving character arrived at the target point
Ã,  Ã,  Ã,  Ã,  if (NPCfacesplayer==1)Ã,  FaceCharacter(charidtogo, playerchar);
Ã,  Ã,  Ã,  Ã,  FaceCharacter(playerchar, charidtogo);
Ã,  Ã,  Ã,  }
Ã,  Ã,  Ã,  return arrived;
}

So i deleted this Function which then gave me the following error message

Line 500:Ã,  Wrong number of parameters in call to 'GoToCharacterEx'

GoToCharacterEx(GetPlayerCharacter(),charid,direction,defaultxoffset,defaultyoffset,NPCfacesplayer,blocking);

So i deleted this Function aswell then the template worked ok.

So i was wondering what exactly these functions did and are they important or not, in that can i get away without needing them?

Thanks in advance.
*Currently using AGS Editor 2.70 (Build 2.70.601)*

Lazarus

Bit of an update i think the problem was with the 'GoTo' command as i changed the line:

From
function GoToCharacterEx(int charidwhogoes, int charidtogo, int direction, int xoffset, int yoffset, int NPCfacesplayer, int blocking){

To
function CharacterEx(int charidwhogoes, int charidtogo, int direction, int xoffset, int yoffset, int NPCfacesplayer, int blocking){

And also the line:
From
GoToCharacterEx(GetPlayerCharacter(),charid,direction,defaultxoffset,defaultyoffset,NPCfacesplayer,blocking);

To
CharacterEx(GetPlayerCharacter(),charid,direction,defaultxoffset,defaultyoffset,NPCfacesplayer,blocking);

Don't know if this is correct or not, but it seems to work
*Currently using AGS Editor 2.70 (Build 2.70.601)*

Gilbert

Hmmm is it possible that there's a line like:
import function GoToCharacterEx(blarghblarghblar...);
in the script header (Pressing ctrl-H in the editor will bring up the header), whose number of parameters doesn't match the number used in the function declaration?

Just a suggestion to check if it's the problem, I'm just too lazy to download the template and check it myself.

monkey0506

Just curious.  What was the purpose of dragging this up when there is clearly a sticky thread (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=7616.0) in the Beginner's forum?

I can see that these are your first posts in this forums, but...maybe you should pay better attention to dates, and try looking for a newer thread.

SMF spam blocked by CleanTalk