Scripting Help

Started by Emperor Wilbers, April 15, 2012, 10:27:33 PM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

Emperor Wilbers

I have missed something in my very basic scripting and cannot find the problem in it. I'm trying to talk to a guard dude that I put in a tent and when I click Tent Guard 1 in Talk To the dialogue doesn't appear. Here's the scripting I put in the tent:

Quotefunction OnFirstEnter(){
  Echo("Tent Guard 1: You're finally awake are you? Good, when you are fully readied to go come and speak to me, please.")
}
function OnDialogue(){
  Echo("Tent Guard 1: Good, you're done. Head outside to the Courtyard to recieve further instruction form Hulius Faramel. He will be waiting for you.")
}

Please help!

Throndir

Try:

function OnDialog(){

}

Emperor Wilbers

Can someone proofread this for any errors, please?

function OnFirstEnter(){
  Echo("Tent Guard 1: You're finally awake are you? Good, when you are fully readied to go come and speak to me, please.");
}
function OnDialog(){
AddOption(0,"I'm all done!","op1();","");
AddOption(0,"Um, guard. I'm done.","op2();","");
AddOption(0,"Guard! I'm finished. Now, where do I go?","op3();","");
ProcessOptions();
}
function op1(){
Echo("Tent Guard 1: Great, now head outside to the courtyard and talk to Hulius Faramel.");
}
function op2(){
Echo("Tent Guard 1: You don't have to be so shy, scum. Now get out to the courtyard and speak to Hulius Faramel, now.")
}
function op3(){
Echo("Tent Guard 1: Well aren't you assertive. I like that. Head to the courtyard and speak to Hulius Faramel for further instruction.");
}


What I'm trying to get as a result is:

You're finally awake are you? Good, when you are fully readied to go come and speak to me, please. (Okay, so that's the first thing the guard automatically says)

(Then I click on Talk To, then Tent Guard 1, and want to show up is):

These are the choices of things I want to say to the guard to notify him that I'm done, BTW.
1. "I'm all done!"
2. "Um, guard. I'm done."
3. "Guard! I'm finished. Now, where do I go?"

(Then, for whatever option I choose I want the following responses to display, which are function op1-function op3.)

When I click on Talk To Tent Guard 1 the only thing that appears is

[Richard: Talk to Tent Guard 1]

in a green color.


Please help.




Throndir

#3
The function OnFirstEnter() should be in the Script part of the Location.

While the function OnDialog() should be placed in the Script section of an NPC in that location.

Also once you feel like it, advertise your project on the official LT forums too. :D Might bring some people in.

Emperor Wilbers

Great, that helped a lot. BIG reliever. lol

Throndir

I will also advise you to save often. Also, to make weekly backups. By this I mean copying your Projects folder in the LT folder, and copying it somewhere else. There's this evil bug in LT 1.6 which Humangus never fixed which can potentially corrupt your whole project.