ChangeRoom WITHOUT walking to position

Started by johto760, Wed 19/09/2012 11:46:52

Previous topic - Next topic

johto760

Just like what the title says,

So far whenever I call the ChangeRoom function in the interact function of something like so:

Code: AGS

function hGoLivingRoom_Interact()
{
  player.ChangeRoom(2, 615, 640);
}


The engine goes to the position where I clicked, that's good and all, since I opted to have the character "Automatically move in walk mode" in my general settings.... so here's my question:

Is there a way to not have the player WALK to the position before going to the other room? To rephrase: "Make the character go to some room when a user clicks somewhere around a hotspot, WITHOUT the walking scene"....


I tried something like this:
Code: AGS

function hGoLivingRoom_Interact()
{
  StartCutscene(eSkipMouseClick);
    player.Move(hGoLivingRoom.WalkToX, hGoLivingRoom.WalkToY, eNoBlock);
  EndCutscene();
  player.ChangeRoom(2, 615, 640);
}


'coz I've noticed that during look/interact mode in other hotspots, I am able do something like talk FIRST before going to that hotspot like so:
Code: AGS


function hUnderBed_Look()
{
  player.Say("Let me look under mah bed there");
  player.Walk(hUnderBed.WalkToX, hUnderBed.WalkToY, eBlock);
}


and I could totally override the walking stage of my character by changing the coordinates or something,

But during the ChangeRoom function, I seem to not have that control anymore, if I do something like:

Code: AGS


function hGoLivingRoom_Interact()
{
  player.Say("yeah");
  player.ChangeRoom(2, 615, 640);
}


the walking stage would always go first before the say function, I wanna be able to make a double click on that hotspot and the character will be INSTANTLY teleported to another room WITHOUT having the character WALK first, just INSTANT, no scene, no walking, just an instant fadeInAndOut, WITHOUT walking..

I hope I'm making myself clear by restating my problem again and again and again..

I'm using version:  (Build 3.2.1.111)

Khris

You are conflating two issues here.
If you set a walkto point in a hotspot's properties, the character will walk there before AGS even looks at what's inside the hotspot's interact function.
The .ChangeRoom() command always transfers the character to the new room (and optionally, new position) instantly.

If you want to keep using the "automatic walking to hotspots" feature but disable it occasionally, you need to tackle this differently.

One solution would be to set up a custom property. If you do that, you can disable the automatic walking on a per hotspot basis.
You could also use my GotThere which adds the nice feature of being able to interrupt the blocking walk to the hotspot by clicking somewhere else.

Of course you could also disable the option entirely and make the character walk manually to the hotspot in each of its functions.

johto760

Thanks for pointing that one out...

I think I'm gonna do the manual thing... thanks again...

SMF spam blocked by CleanTalk