Author Topic: "Invisible" Errors  (Read 6568 times)

Teno20

  • Guest
"Invisible" Errors
« on: September 27, 2002, 04:35:01 AM »
I have just finished the first joining dialogue for my character (Ysera), and it comes up with a few errors while compiling, where I don't know what's wrong. Below is an example of what it can't do (the point-of-error is in @s)

IF ~~ THEN BEGIN Refuse
SAY ~Very well, you know where to find me if you change your mind.~
@EXIT@
END

I have compared it with previous blocks, and they compiled OK, but theres about five or six p.o.e.s. I have checked the tildes before you say, that was one reason for one of them, but i've rectified it.

If necessary, I can send the whole thing to someone.

Edit (Oh, before I forget, make sure you have an open mind)                    



[!--EDIT|Teno20|Sep 27 2002, 12:01 PM--]

Dyara

  • Guest
"Invisible" Errors
« Reply #1 on: September 27, 2002, 05:07:06 AM »
I think it has to be...

Code: [Select]
IF ~~ THEN BEGIN Refuse
SAY ~Very well, you know where to find me if you change your mind.~
IF ~~ THEN EXIT
END
                   



[!--EDIT|Dyara|Sep 27 2002, 02:07 PM--]

Teno20

  • Guest
"Invisible" Errors
« Reply #2 on: September 27, 2002, 05:09:52 AM »
Well, I have a few already, so I don't think it's that. Shall I sand you it?                    

Dyara

  • Guest
"Invisible" Errors
« Reply #3 on: September 27, 2002, 06:27:59 AM »
Have you changed your code and tried to compile again? I would suggest that you do that first. Since I have no WeiDU (and no BG2) at work I couldnīt test it anyway at the moment :D).                    

Teno20

  • Guest
"Invisible" Errors
« Reply #4 on: September 27, 2002, 06:30:39 AM »
Well I'm at school so can't try anything either.                    

Dyara

  • Guest
"Invisible" Errors
« Reply #5 on: September 27, 2002, 06:35:14 AM »
Maybe one of the WeiDU professionals reads your post...                    

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7244
"Invisible" Errors
« Reply #6 on: September 27, 2002, 08:40:16 AM »
Dyara is exactly right.                    
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Dark Phantom

  • Guest
"Invisible" Errors
« Reply #7 on: September 27, 2002, 08:43:45 AM »
Teeno, thanks for the post!  you saved me from the same blunder, MANY times over!

A question than: I do not think so, but do you need to have a line such as
IF ~~ THEN GOTO?                    



[!--EDIT|Dark Phantom|Sep 27 2002, 03:47 PM--]

Dyara

  • Guest
"Invisible" Errors
« Reply #8 on: September 27, 2002, 09:25:10 AM »
You need 'GOTO' only if you want to go to another state in the same dialogue file. If you want to exit the dialogue you only need 'EXIT'.                    

Dark Phantom

  • Guest
"Invisible" Errors
« Reply #9 on: September 27, 2002, 09:30:11 AM »
Here is an example of my dialouge:

IF ~!Global ("JunaRomanceActive",3)
      Global("LoveTalk", 2)
      !CheckState(Player1,STATE_SLEEPING)~ THEN BEGIN LT4.1

SAY "Master?  Might I have a word with you, without being punished?"
If ~Global("JunaAbuse", 0)~ THEN REPLY ~Of course, pretty young Juna.  Whats on your mind?~ GOTO LT4.2
IF ~Global("JunaAbuse",1)~ THEN REPLY ~Speak your mind, slut, but be quick about it!~GOTO LT4.3
IF ~Global("JunaAbuse",2) THEN REPLY ~Speak, but If you grumble about your situation again, be prepared to be hurt!~ GOTO LT4.4
IF ~~ THEN REPLY ~No, you may not!  I did not buy you to talk to, but to bed with...UNDERSTAND~ GOTO LT4.6

with all of the "goto's" going to a differant block of text in the file.                    

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7244
"Invisible" Errors
« Reply #10 on: September 27, 2002, 12:34:45 PM »
I see two problems.

You're not using the Global() trigger properly.

The format is

!Global("JunaRomanceActive","GLOBAL",3)

Note that if it IS a GLOBAL (as opposed to a LOCALS or an area variable) you CAN use

!G("JunaRomanceActive",3)

...but G() requires that it IS a GLOBAL.


The other problem is that

Quote
IF ~Global("JunaAbuse",1)~ THEN REPLY ~Speak your mind, slut, but be quick about it!~GOTO LT4.3

I believe you need a space between ~ and GOTO.

Oh, and that state needs an END.


Finally, I'm not entirely sure periods are valid for WeiDU labels. Syntax-meister Weimer?                    



[!--EDIT|jcompton|Sep 27 2002, 01:35 PM--]
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Teno20

  • Guest
"Invisible" Errors
« Reply #11 on: September 27, 2002, 12:46:11 PM »
Well, I have sorted the dialog out, or at least tried, 'cos when I sorted them, a whole new batch came up, and these were fine beforehand. So if anyone can help, that'd be great. I just want to know where I'm going wrong. And like I said before, make sure you have an open mind.                    

Dark Phantom

  • Guest
"Invisible" Errors
« Reply #12 on: September 27, 2002, 01:06:43 PM »
what are the differances between a global, local, and aria?   I have done a bit of programing work, so I would wonder if a global isn't just that which effects throughout the game, instead of say in D'arnes keep, or the theif guild.  Or am I just off in understanding you?   :o                    

Teno20

  • Guest
"Invisible" Errors
« Reply #13 on: September 27, 2002, 02:26:04 PM »
Quote
what are the differances between a global, local, and aria?   I have done a bit of programing work, so I would wonder if a global isn't just that which effects throughout the game, instead of say in D'arnes keep, or the theif guild.  Or am I just off in understanding you?   :o
                   Well, I know aria's are pieces of music, but in relation to BG2, I think Globals refer to everything, local affect one thing (e.g. a character), and area affect one map area. I aren't sure about the last one, and I'm probably wrong with the other two                    

Dark Phantom

  • Guest
"Invisible" Errors
« Reply #14 on: September 27, 2002, 02:38:09 PM »
Just a wee typo                    

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7244
"Invisible" Errors
« Reply #15 on: September 27, 2002, 02:39:19 PM »
Basically, that's right.

A GLOBAL variable can be read or modified by any game script or dialogue.

A LOCALS variable can only be read or modified by the object it belongs to (typically an individual character/creature, but I believe there are other things that can have their own LOCALS)

An area variable is of the form Global("Blah","AR0500",2) and that can only be read or modified from within the specified area.

Some modders, Wes in particular, almost exclusively use GLOBAL variables. It's partially a matter of taste and a matter of convenience.                    
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Teno20

  • Guest
"Invisible" Errors
« Reply #16 on: September 27, 2002, 02:44:26 PM »
Wahey... I was right.  :lol:                    

Dark Phantom

  • Guest
"Invisible" Errors
« Reply #17 on: September 27, 2002, 02:52:12 PM »
So, just to be clear, I want to make a global ("JunaKnows", for example)
I would type in SetGlobal ("JunaKnows","GLOBAL",1), but for say a local it would be "SetGlobal("JunaKnows","LOCAL",1)?  What would the Love talks be, or do you set them?
                   

Teno20

  • Guest
"Invisible" Errors
« Reply #18 on: September 27, 2002, 03:19:08 PM »
Anyway, back to me. Would someone be willing to read through my first dialog, 'cos I can't see what's wrong with it.                    

Dark Phantom

  • Guest
"Invisible" Errors
« Reply #19 on: September 27, 2002, 03:25:18 PM »
sorry to butt in... Not that I intended to.                      

Offline weimer

  • Moderator
  • Planewalker
  • *****
  • Posts: 2222
  • Gender: Male
    • WeiDU and Weimer Mods
"Invisible" Errors
« Reply #20 on: September 27, 2002, 04:12:24 PM »
Syntax: IF~Condition~EXIT is fine, space is almsot always optional in Weimer-land.

The period is not currently a valid label character, but it will be in the next release.

It is important conceptually to separate difficulties with Infinity Engine scripting from difficulties with WeiDU. Questions like "what is a global variable" are all about IE Scripting. We're happy to answer them here, but you should note that WeiDU doesn't care at all what you put ~inside tildes~. It passes it verbatim to the game engine which interprets it later.

If you really want us to debug your D file, do the following things:
(1) Post the text of the D file here (in a CODE block, say)
(2) Post the exact complete output of WeiDU as well (cut and paste from the shell). In particular, do not "sort of kind of copy what you think are the important bits" -- copy it all.

We should be able to resolve problems rapidly.                    

Teno20

  • Guest
"Invisible" Errors
« Reply #21 on: September 27, 2002, 04:16:22 PM »
Here it is. When this is sorted out, I'll get the rest done

BEGIN Ysera

IF ~NumTimesTalkedTo(0)~ THEN BEGIN FirstMeeting
SAY ~Hmm?~
 IF ~Gender(Player1,FEMALE)~ THEN REPLY ~Hello?~ GOTO GreetF
 IF ~Gender(Player1,MALE)~ THEN REPLY ~Hello?~ GOTO GreetM
END

IF ~~ THEN BEGIN GreetF
SAY ~Well hello... (She scans her eyes down your body, and stops at your feet, before looking back up at your face) I just love a woman who looks like she can take the rough with the smooth. Tell me, are you in need of a traveling companion? My name is Ysera, and can't wait to know yours~
 IF ~~ THEN REPLY ~Sure. You look like you can take care of yourself too. I would be happy to have you keep me company~  GOTO Check
 IF ~~ THEN REPLY ~Alright, but I aren't the kind of woman you think I am~ GOTO Upset
 IF ~~ THEN REPLY ~No thanks, I don't want anyone else with me~ GOTO Persuade
 IF ~~ THEN REPLY ~No way! I don't want anyone like you with me. Off with you!~ GOTO Angry
END

IF ~~ THEN BEGIN GreetM
SAY ~Hello, I am Ysera. I suppose you want me to come help you~
 IF ~~ THEN REPLY ~Sure... Can always do with someone as beautiful as you along~ GOTO Join
 IF ~~ THEN REPLY ~No thank-you, I don't need any help at the moment.~ GOTO Refuse
 IF ~~ THEN REPLY ~Get away from me! I don't want you anywhere around me. Begone!~ GOTO Angry
END

IF ~~ THEN BEGIN Check
SAY ~It's so good of you to take me with you. I'll make sure it's all worthwhile. (She winks at you)~
 IF ~~ THEN REPLY ~Oooh, behave, you. *giggle*~  GOTO Flirt
 IF ~~ THEN REPLY ~Err...that's not what I meant... I didn't mean it like that.~ GOTO Upset
 IF ~~ THEN REPLY ~Err... I've changed my mind. I don't want you with me.~ GOTO Persuade
END

IF ~~ THEN BEGIN Upset
SAY ~Oh... sorry. Oh well... guess I can't have everything. (She looks down at her feet)~
 IF ~~ THEN REPLY ~Well... I suppose it can't hurt...~ GOTO Flirt
 IF ~~ THEN REPLY ~(Say Nothing)~ GOTO GiveUp
END

IF ~~ THEN BEGIN Persuade
SAY ~Hey, come on... I am more useful than any weapon, and more beautiful. Why do you not want me with you?~
 IF ~~ THEN REPLY ~Well, now that you put it that way...~ GOTO Unsure
 IF ~~ THEN REPLY ~Sorry, I have too many with me as it is, best you stay here for now.~ GOTO Leave
 IF ~~ THEN REPLY ~Simply because I am better than you, and I don't want to associate myself with you!~ GOTO Angry
END

IF ~~ THEN BEGIN Angry
SAY ~Well fine! I'll just have to go and find somewhere else. Good-bye, and I don't want to see you again!~
 IF ~~ THEN DO ~EscapeArea()~
 IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN Join
SAY ~Hmm... (she looks like shes eyeing you up) Very well...~
 IF ~~ THEN REPLY ~Glad to have you join us~ GOTO Welcome
 IF ~~ THEN REPLY ~You don't sound too happy~ GOTO Reply
 IF ~~ THEN REPLY ~Well if that's how you're going to be, then begone!~ GOTO Angry
END

IF ~~ THEN BEGIN Refuse
SAY ~Very well, you know where to find me if you change your mind.~
 IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN Flirt
SAY ~Well, now, I can see that we're going to have a great time~
 IF ~~ THEN REPLY ~*Giggle* Well, you haven't even experienced what a woman like me can do~ GOTO FBack
 IF ~~ THEN REPLY ~You said it!~ GOTO LetsGo
END

IF ~~ THEN BEGIN FBack
SAY ~Oh really? Well I guess there's going to be no end of our pleasure together, but it's best we move on.~
 IF ~~ THEN REPLY ~Oooh, I can't wait~ GOTO LetsGo
END

IF ~~ THEN BEGIN LetsGo
SAY ~Well, let's go, my sweet~
 IF ~~ THEN DO ~SetGlobal("YseraJoined","LOCALS",1) JoinParty()~
 IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN GiveUp
SAY ~Oh I give up, I guess you can't be persuaded. *Sigh* Well, let's go~
 IF ~~ THEN DO ~SetGlobal("YseraJoined","LOCALS",1) JoinParty()~
 IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN Unsure
SAY ~And that means?~
 IF ~~ THEN REPLY ~Let's go, and we'll talk about it later~ GOTO Accepted
 IF ~~ THEN REPLY ~Nah, too full. If I lose someone, I'll come and get you.~ GOTO Leave
 IF ~~ THEN REPLY ~No way!~ GOTO Angry
END

IF ~~ THEN BEGIN Accepted
SAY ~Well, I'll have to try to persuade you again later.~
 IF ~~ THEN DO ~SetGlobal("YseraJoined","LOCALS",1) JoinParty()~
 IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN Leave
SAY ~Very well, you know where I'll be.~
 IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN Welcome
SAY ~Bet you are~
 IF ~~ THEN DO ~SetGlobal("YseraJoined","LOCALS",1) JoinParty()~
 IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN Reply
SAY ~Well, I don't really go for men. I was looking for a woman actually, but I guess we'll find one on the way.~
 IF ~~ THEN REPLY ~Well just my luck to find a beautiful lesbian. *sigh* let's go~ GOTO Party
 IF ~~ THEN REPLY ~Oh... OK then, well, anyway, let's go.~ GOTO Party
END

IF ~~ THEN BEGIN Party
SAY ~Very well~
 IF ~~ THEN DO ~SetGlobal("YseraJoined","LOCALS",1) JoinParty()~
 IF ~~ THEN EXIT
END                    

Offline weimer

  • Moderator
  • Planewalker
  • *****
  • Posts: 2222
  • Gender: Male
    • WeiDU and Weimer Mods
"Invisible" Errors
« Reply #22 on: September 27, 2002, 07:34:08 PM »
Line 46:

IF ~~ THEN DO ~EscapeArea()~

needs an "EXIT" at the end.

Same with lines 75 and 81 and 94 and 106 *and* 118:

IF ~~ THEN DO ~SetGlobal("YseraJoined","LOCALS",1) JoinParty()~

*Every* transition needs to end in either EXIT, GOTO or EXTERN. Infinity Engine Rules, sorry.

Fixing these causes your D file to compile.

By the way, I *highly* recommend *against* using "Reply" as a state label. It's very close to a WeiDU keyword.
                   

Teno20

  • Guest
"Invisible" Errors
« Reply #23 on: September 28, 2002, 01:06:19 AM »
Thanks :D it worked!

Anyway, just out of interest, is it pronounced Vee-do, Vie-du, wee-du, or wei-du                    

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7244
"Invisible" Errors
« Reply #24 on: September 28, 2002, 01:44:46 AM »
Why-D-U. At least, that's how I say it, and I helped coin it, so even if by chance Wes pronounces his last name differently, I'm afraid it doesn't matter. :)                    



[!--EDIT|jcompton|Sep 28 2002, 02:45 AM--]
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

 

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)?: