Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Author Topic: Skipping talk lines  (Read 2756 times)

0 Members and 1 Guest are viewing this topic.

Mr_Threepwood

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 8
    • View Profile
Skipping talk lines
« on: July 02, 2007, 12:57:32 AM »

Ok so I thought this would be an easy thing to do seeing as there's a selection box on the left side of the project editor that lets you set a button for how to skip talk lines, but for some reason it's not working for me.

Here's what i have for my LeftClick event in the Game script (I'm trying to get a lucas arts style gui working).
 
Code: [Select]
on "LeftClick"
{

  var ActObj = Game.ActiveObject;

if (ActObj.Type!="window"&&ActObj.Type!="button"){

if (actionMode=="Walk"){
Scene.ApplyEvent("LeftClick");
}else if (ActObj!=null){
currentAction=actionMode;
actionMode="Walk";
if (ActObj.CanHandleEvent(currentAction)){
ActObj.ApplyEvent(currentAction);
}else if(currentAction=="Talk"){
actor.Talk("I can't talk to that.  sdfa fasd fasd  fasd asdf fasd asdf  sdfa fasd sdfa fasd  sdfa fasd f.sdasd fa asdfas fdasd f fasd.");
}else if(currentAction=="Use"){
actor.Talk("I can't Use that.");
}else if(currentAction=="Take"){
actor.Talk("I can't take that.");
}else if(currentAction=="Open"){
actor.Talk("I can't open that.");
}else if(currentAction=="Close"){
actor.Talk("I can't close that.");
}else if(currentAction=="Give"){
actor.Talk("I can't give that.");
}
//unhandled events on objects will have to go here
}
//walkMode=true;
actionMode="Walk";

//actionMode="Walk";
}
}

Originally I didn't use "currentAction" and always just used my actionMode variable, but I was doing some testing to try and figure out this speech skipping (but couldn't).

So what happens right now is it will skip the speech, but it only seems to be doing that because it has something else to do in the script.  IE you can't just skip speech, it has to trigger a scene event (walk, close, etc).  I've set my skip button option to both, but right click doesn't work at all.

Is there something that I'm missing that must be done for actor.Talk to skip properly?
Logged

Mr_Threepwood

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 8
    • View Profile
Re: Skipping talk lines
« Reply #1 on: July 02, 2007, 04:47:02 PM »

Nevermind this was a stupid question, all it required was a more in depth forum dig to find out that all I had to do was override the Talk method in the actor object.

In case someone else is has this same problem ever, here is the solution:

In your actor script put this following:

Code: [Select]
method Talk (var txt,var soundfile,var duration, var stances, var alignment){
Game.Interactive=false;
this.Talk (txt,soundfile,duration,stances,alignment);
Game.Interactive=true;
}

This is because the skip text feature only works if the game is not interactive, otherwise it just tries to do whatever is in the game script.
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Skipping talk lines
« Reply #2 on: July 02, 2007, 06:04:01 PM »

Yes, exactly. I will only add it's not necessary to override the Talk method, the Game.Interactive property can be set directly in the scripts when needed. But of course, if you want to set it always, overriding is the way to go.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.03 seconds with 23 queries.