Author Topic: What is wrong with these lines?  (Read 1337 times)

Offline vociferate

  • Planewalker
  • *****
  • Posts: 10
What is wrong with these lines?
« on: June 23, 2006, 03:44:31 PM »
IF ~~ THEN BEGIN Busy
SAY ~Oh.  Okay... Well, then take this.  Read it when you arn't busy.~
IF ~(SetGlobal("6DQ1","GLOBAL",1)~ THEN DO ~SetGlobal("6DQ1","GLOBAL",2) GiveItemCreate("6Scr01",Player1,0,0,0)~
    IF ~~ THEN REPLY ~What is it?~ +Scroll
    IF ~~ THEN REPLY ~Sure.  I will do that.  Good day.~ DO ~EscapeAreaDestroy(20)~ EXIT
    IF ~~ THEN REPLY ~No thanks.~ ~DropItem("6Scr01",[-1.-1])~ +GoAway
END

Player1 (my character, right?) is not getting the scroll.  Also, I am not sure the globals are setting because once 6DQ1 is set to 2, it is supposed to spawn another guy to talk to in a different area.

Offline Lu

  • Planewalker
  • *****
  • Posts: 750
  • Gender: Female
Re: What is wrong with these lines?
« Reply #1 on: June 23, 2006, 04:06:33 PM »
No GOTO or EXIT on line 3

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7246
Re: What is wrong with these lines?
« Reply #2 on: June 23, 2006, 04:09:59 PM »
IF ~(SetGlobal("6DQ1","GLOBAL",1)~

This doesn't make sense. SetGlobal is an action (part of a DO statement) not a trigger (part of an IF statement).

Also, if your intention is to skip the replies entirely and perform the DO action if 6DQ1=1, you must put that trigger at the bottom of the transition list (below the replies.) Transitions evaluate from the bottom up, and as soon as the engine sees at least one valid reply it will ignore any non-reply transitions higher up in the list.
« Last Edit: June 23, 2006, 04:23:28 PM by jcompton »
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Offline Lu

  • Planewalker
  • *****
  • Posts: 750
  • Gender: Female
Re: What is wrong with these lines?
« Reply #3 on: June 23, 2006, 04:18:41 PM »
Quote
This doesn't make sense. SetGlobal is an action (part of a DO statement) not a trigger (part of an IF statement)
  Then perhaps it always returns TRUE (or FALSE, or chooses it randomly, not that I really want to know what it actually returns)?

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7246
Re: What is wrong with these lines?
« Reply #4 on: June 23, 2006, 04:24:17 PM »
Quote
This doesn't make sense. SetGlobal is an action (part of a DO statement) not a trigger (part of an IF statement)
  Then perhaps it always returns TRUE (or FALSE, or chooses it randomly, not that I really want to know what it actually returns)?

Neither, WeiDU won't let you compile an action as a trigger.

Lu's also right about the lack of a valid transition destination (GOTO/EXTERN/EXIT) on that line, incidentally.
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Offline vociferate

  • Planewalker
  • *****
  • Posts: 10
Re: What is wrong with these lines?
« Reply #5 on: June 23, 2006, 05:50:10 PM »
IF ~~ THEN BEGIN Busy
SAY ~Oh.  Okay... Well, then take this.  Read it when you arn't busy.~
    IF ~~ THEN REPLY ~What is it?~ +Scroll
    IF ~~ THEN REPLY ~Sure.  I will do that.  Good day.~ DO ~EscapeAreaDestroy(20)~ +GoAway
    IF ~~ THEN REPLY ~No thanks.~ ~DropItem("6Scr01",[-1.-1])~ +GoAway
IF ~(Global("6DQ1","GLOBAL",1)~ THEN DO ~SetGlobal("6DQ1","GLOBAL",2) GiveItemCreate("6Scr01",Player1,0,0,0)~ +Scroll
END

Alright.  So now I think it makes sense, but I do not think it is doing what I want it to.  I want it to run like this

Boy says: Oh. Okay... Well, then take this.  Read it when you arn't busy.
Then this hapens: Your party has gained an item.
And then the pc must chose from the 3 replies: "what is it" / "Sure I will do that. Good day" / "No thanks"

I believe I am setting it up wrong.

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7246
Re: What is wrong with these lines?
« Reply #6 on: June 23, 2006, 07:05:13 PM »
IF ~~ THEN BEGIN Busy
SAY ~Oh.  Okay... Well, then take this.  Read it when you arn't busy.~
    IF ~~ THEN REPLY ~What is it?~ +Scroll
    IF ~~ THEN REPLY ~Sure.  I will do that.  Good day.~ DO ~EscapeAreaDestroy(20)~ +GoAway
    IF ~~ THEN REPLY ~No thanks.~ ~DropItem("6Scr01",[-1.-1])~ +GoAway
IF ~(Global("6DQ1","GLOBAL",1)~ THEN DO ~SetGlobal("6DQ1","GLOBAL",2) GiveItemCreate("6Scr01",Player1,0,0,0)~ +Scroll
END

Alright.  So now I think it makes sense, but I do not think it is doing what I want it to.  I want it to run like this

Boy says: Oh. Okay... Well, then take this.  Read it when you arn't busy.
Then this hapens: Your party has gained an item.
And then the pc must chose from the 3 replies: "what is it" / "Sure I will do that. Good day" / "No thanks"

I believe I am setting it up wrong.

If the party is ALWAYS supposed to get the item and ALWAYS should have the reply options available, then you should delete that last IF line and put a DO statement performing the GiveItemCreate after all of the replies. I can't tell precisely what you intend to go on with that variable, though, so I can't be more descriptive.
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Offline Lu

  • Planewalker
  • *****
  • Posts: 750
  • Gender: Female
Re: What is wrong with these lines?
« Reply #7 on: June 23, 2006, 11:26:31 PM »
  There's still a syntax error, Vociferate, i.e instead of
 IF ~(Global("6DQ1","GLOBAL",1)~

  there sholud be
 IF ~Global("6DQ1","GLOBAL",1)~

  Get rid of the first (left) parenthesis

Offline vociferate

  • Planewalker
  • *****
  • Posts: 10
Re: What is wrong with these lines?
« Reply #8 on: June 25, 2006, 11:48:19 AM »
Thanks guys, I'll let you know if I get it working how I want it to.

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: