Arrgghh! MoveCharacterToHotspot problems...

Started by Hollister Man, Wed 16/06/2004 05:39:51

Previous topic - Next topic

Hollister Man

I bet you're all getting tired of me buggin you.

Does anyone else even use the MoveCharacterToHotspot command so as to let me know if its just me?Ã, 

In the original DQ2 Factory, a particular cutscene calls MoveCharacterToHotspot repeatedly to move Roger from one place to another, not sure why it was used rather than coordinates.Ã,  When he was just standing there like an idiot, I figured I goofed something up and would fix it later.Ã,  When I got to the SCI0 room, though, the same thing popped up, except that it directed the player character to move, and locked the game in the wait cursor mode.

I never used this command before, but the syntax appears to be right.  Could it be just a bug that no one noticed because no one cares?
That's like looking through a microscope at a bacterial culture and seeing a THOUSAND DANCING HAMSTERS!

Your whole planet is gonna blow up!  Your whole DAMN planet...

LordHart

Post your code... so we might be able to see whats wrong. :-\

Hollister Man

Okay, the SCI0 room had some odd problem with my GUI, turns out.Ã,  I switched it to use the GUI from the AGI room, and everything worked fine.Ã,  Somehow the game gets paused when that GUI turns on (according to the console) and I can't figure out what.Ã,  Anyway...Ã,  The main hall still has the problem though.Ã,  I hate to post a huge block of code without supporting files, but here goes.

Code: ags

function room_c() {
Ã,  // script for room: REPEATEDLY EXECUTE
if (GetGlobalInt(10)==1)Ã,  // this is triggered from Roger's interaction script
 {
Ã,  MoveCharacterToHotspot(GetPlayerCharacter(),5);Ã,  // PlayerCharacter walks to desk's walk-to point
Ã,  FaceCharacter(GetPlayerCharacter(),ROGER);
Ã,  DisplaySpeech(GetPlayerCharacter(),"Hello.");
Ã,  DisplaySpeech(ROGER,"Welcome to the AGS Games Factory!");
Ã,  DisplaySpeech(ROGER,"I'm your tour guide, Roger.");
Ã,  DisplaySpeech(GetPlayerCharacter(),"Oh, of course.Ã,  You look just like him.");
Ã,  DisplaySpeech(ROGER,"Anyway, let me give you the tour.");
Ã,  MoveCharacter(GetPlayerCharacter(),144,140);
Ã,  MoveCharacter(ROGER,115,133);Ã,          //For some reason, Roger never makes this move, nor any other.
Ã,  Wait(80);
Ã,  Ã,  DisplaySpeech(ROGER,"Let me open this for you.");
Ã,  RestoreWalkableArea(2);
Ã,  MoveObjectDirect(1,90,66,1);
Ã,  PlaySound(3);
Ã,  Wait(60);
Ã,  ObjectOff(1);
Ã,  FaceCharacter(ROGER,GetPlayerCharacter());
Ã,  FaceCharacter(GetPlayerCharacter(),ROGER);
Ã,  DisplaySpeech(ROGER,"This is the Basic Features area.");
Ã,  DisplaySpeech(ROGER,"If you're new here, go to this area first.");
Ã,  Display("Through this door you will find rooms that demonstrate the basic features of rooms and game settings. You know, all the stuff that you need to make a typical adventure game.");
Ã,  MoveCharacterToHotspot(ROGER,1);
Ã,  FaceCharacter(ROGER,GetPlayerCharacter());
Ã,  FaceCharacter(GetPlayerCharacter(),ROGER);
Ã,  DisplaySpeech(ROGER,"This is the fabulous hall of GUIs, or Graphical User Interfaces.");
Ã,  Display("The Hall of GUIs demonstrates how to create new kinds of interfaces, including Lucasarts-type interfaces, parser interfaces and more.");
Ã,  Display("It also shows you how to make custom game controls and windows."); 
Ã,  MoveCharacterToHotspot(ROGER,2);
Ã,  FaceCharacter(ROGER,GetPlayerCharacter());
Ã,  FaceCharacter(GetPlayerCharacter(),ROGER);
Ã,  DisplaySpeech(ROGER,"This small door... uh.. um..");
Ã,  Display("I don't know what goes here. Anything we forgot, I guess.");
Ã,  MoveCharacterBlocking(ROGER,260,145,0);
Ã,  FaceCharacter(ROGER,GetPlayerCharacter());
Ã,  FaceCharacter(GetPlayerCharacter(),ROGER);
Ã,  DisplaySpeech(ROGER,"Through the round portal, you will find the dangerous ADVANCED area.");
Ã,  DisplaySpeech(ROGER,"It's locked for your safety.");
Ã,  Display("This one's for advanced users. It shows how to use complex text scripting to create things like combat systems, arcade games and so on.");
Ã,  Display("It also shows how to use some of the more advanced commands that hardly anybody can figure out.");
Ã,  MoveCharacterToHotspot(ROGER,3);
Ã,  FaceCharacter(ROGER,GetPlayerCharacter());
Ã,  FaceCharacter(GetPlayerCharacter(),ROGER);
Ã,  DisplaySpeech(ROGER,"Finally, this passage leads to the Media wing.");
Ã,  Display("In the Media wing you will learn how to use sounds, speech music, FLIC animations, and graphics of various resolutions and color depth in your game.");
Ã,  // for character ID, you can also use the character's number as well as
Ã,  // name. For example, '2' is the same as 'ROGER'
Ã,  MoveCharacterBlocking(2,187,131,0);
Ã,  FaceCharacter(2,GetPlayerCharacter());
Ã,  FaceCharacter(GetPlayerCharacter(),2);
Ã,  DisplaySpeech(2,"So please take a look around.");
Ã,  SetGlobalInt(10,2);
 }
}
That's like looking through a microscope at a bacterial culture and seeing a THOUSAND DANCING HAMSTERS!

Your whole planet is gonna blow up!  Your whole DAMN planet...

strazer

#3
QuoteI goofed something up and would fix it later
Quotesome odd problem with my GUI

I don't get it.
What are you doing? Are you modifying the Demo game? Do you have a problem with your own game?
And what exactly is the problem? Is code from the repeatedly_execute function executed that isn't supposed to be executed? ???

Edit:
I've just read your other thread. You're working on the new demo game, right?
But I still can't figure out what exactly your problem is.

Wolfgang Abenteuer

Are you sure Roger is on a walkable area?  If he's not, that would explain why he's not moving at all.

Also, I believe most GUIs pause the game when brought up - all except maybe the ones set to "Normal" or "Persistant", so that could be the reason there.

What exactly is it you're trying to do?

~Wolfgang

Scorpiorus

Also make sure the hotspot has a walk-to point, because otherwise the MoveCharacterHotspot function does nothing.

Hollister Man

Thanks for the suggestions, I'll try them this evening.

Yes, Strazer, I'm trying to modify the old room files for the demo to be more understandable and easier to learn from.  Besides the fact that when I imported the old game, everything got 'chewed up' by the editor, most of the rooms wouldn't even load.  It has to be using regions instead of hotspots, there are new functions like ClaimEvent and CallRoomScript to use, and when I created the new player character, I updated all the references to EGO to use GetPlayerCharacter() instead.  Somewhere during this process, Roger broke. :)

You might have stumbled across the right answer Strazer. This was originally in the Rep_EX, but maybe it just doesn't belong there, and the new version of the editor doesn't quite like it?
That's like looking through a microscope at a bacterial culture and seeing a THOUSAND DANCING HAMSTERS!

Your whole planet is gonna blow up!  Your whole DAMN planet...

SMF spam blocked by CleanTalk