How to make dialog in different rooms change with the same characters

Started by Hibrid, Fri 03/07/2015 03:47:28

Previous topic - Next topic

Hibrid

My first post here, hi

I'm trying to get the hang of AGS, and many of the same characters will appear in different rooms throughout my game

And the dialog in these rooms should be completely different, but the dialog script goes into global, and doesn't work in the room script

This is rather annoying, since I want different dialog trees in each room

I tried searching around, but so I didn't find anything. It would be nice to know how to do this, and (so I don't get stuck later) know if there's a way to make stuff that goes in the global script only apply to a certain room.
There might be a function, I just wasn't able to find one

I hope was I was clear, thanks in advance


Grok

You could do it like this

Code: ags


function cCharact_Talk()
  {
  if (cCharact.Room == 14)
    {  
      ---
    }
  else if(cCharact.Room == 18)
    {
      ---
    }
 }

Hibrid

Very nice, thank you good sir :)

On the side note, I altered your code to also allow me some other useful things :-D

Made my day, thanks again

SMF spam blocked by CleanTalk