Question about SetView on Character [Solved]

Started by Dervish, Wed 03/10/2007 08:36:27

Previous topic - Next topic

Dervish

I have a Character pass out and therefore the player can't talk to the character anymore.  So the question is is there another "easier" way to detect if the character is passed out besides variables.  The Passed out view is set up as a different view.  Is there a built in function the detects what the view of a character is?

Gilbert

Yes, look for Character.View in the manual.

Just do something like:
if (player.View==4) {...

Dervish

#2
Thanks Gilbot... I knew there was something there.


Alright well I did the suggestion above but when I Run Script as the interaction under "Talk To Character" it tells me RunDialog is an 'Undefined Token'

Gilbert

Are you using V2.72 and ticked the "Enforce object-based scripting" option ? (I think it's on by default.)

RunDialog() is an old function name, it's renamed to object-style Dialog.Start() (check the manual for usage), so you may either:
1. Uncheck that option mentioned above, the editor will accept obsolete old style scripting then, or, much better
2. Change to use Dialog.Start() and try to stick to the new style object-based scripting.

Dervish

Ok I have tried to figure this out.  Basically I want to Either have the conversation if the guy isn't passed out or display the message "I think he is done for." How can i go about doing this. Becuase I have tried running script in the interaction menu under talk to character but it won't recognize the Dialog in the global script How can I solve this?

Ashen

What EXACTLY have you tried? (As in, post the script.) Something like this should work:
Code: ags

if (cGuy.View != 8) { // or whatever the 'passed out' view is
  dGuydialog.Start(); // Or whetever the script name of your dialog is
}
else {
  player.Say("I think he is done for.");
}
I know what you're thinking ... Don't think that.

Dervish

Thanks for the Code made me realize i needed to use the exact dialog name.  I was using the dialog number.

Ashen

Dervish, please READ THE MANUAL.

Character.View is in there, and not hard to find (you wanted a function that checked a Character's View). Looking up RunDialog will redirect you to Dialog.Start - which tells you the old function is obsolete, and gives you an example of how to use the new one. So, every question in this thread is answered in the manual, which you should be reading before you post.
I know what you're thinking ... Don't think that.

SMF spam blocked by CleanTalk