No character interaction? (Solved)

Started by Boco, Fri 28/07/2006 01:04:35

Previous topic - Next topic

Boco

I don't know if this has something to do with the scumm template I picked up but I cannot get any NPC interactions to work at all. Anyone know anything about this?

GarageGothic

Have you set the NPC characters to be clickable?


Khris

Make sure that the template calls the interaction you've added.
There are templates that store the verb in a variable and always call "Usermode1 character" or something similar.

Which template is it? (I shouldn't have to ask this, btw :=)

Boco

its listed as MI2 for ags2.71

Khris

There are at least two websites with templates for AGS, please state exactly where you downloaded the file or post the link to it.

Boco

I got it from the stickied post on LucasArts guis

"June 7th, 2006: The download for the 2.71 version is at http://ssh.me.uk/MI2forags271.zip thanks to SSH. It should also be compatable with the current 2.72 beta, but post any problems here."

Khris

Ok, I've found out what's wrong with it.

If you're not interested in the explanation, just skip to the bold paragraph :=

In the beginning of the global script, there's a constant called ALWAYS_GO_TO_HOTSPOTS. This is set to 1 by default, which makes the player go to a hotspot/object/character first before actually doing what you told him to do.

With NPCs, the game calls Go(), which in turn calls GoTo(), which calls GoToCharacter(), which calls GoToCharacterEx().
This last function tries to make the player walk near the NPC and returns 1 if it succeeded. However, this return value has to be transfered back from function to function until eventually Go() itself returns 1.
This didn't happen, though, because:

There's a "return" missing in line 512.
The function has to look like this:

Code: ags
function GoToCharacter(int charid, int direction, int NPCfacesplayer, int blocking){
Ã,  //same as above but with default x and y offset.
Ã,  int defaultxoffset, defaultyoffset;
Ã,  defaultxoffset=25;
Ã,  defaultyoffset=15;
Ã,  return GoToCharacterEx(player.ID,charid,direction,defaultxoffset,defaultyoffset,NPCfacesplayer,blocking);
}

SSH

I've updated the template on my site. Thanks for finding and debuigging this, khrisMUC
12

Boco

Sweet that fixed it, thanks a lot. You do good work my friends.

SMF spam blocked by CleanTalk