FAQ Search Memberlist Usergroups
Jolt Country Forum Index
Register Profile Log in to check your private messages Log in
Log in Log in

DEBASER SMASH HUGO!!!
Goto page 1, 2  Next
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Jolt Country Forum Index -> Hugo's House of Horrors
View previous topic :: View next topic  
Author Message
Debaser



Joined: 25 Jun 2002
Posts: 878
Location: Aurora, IL

PostPosted: Sun Jun 15, 2003 10:04 pm    Post subject: DEBASER SMASH HUGO!!! Reply with quote

Why in the blue hell does the following not compile?

Code:

array transit[5] = 0, 0, 0, 0, 0

routine GoTransit
{
 local a, b, c
 "Choose a destination (0 to remain where you are):"
 for (a=0; a<20; a=a+1)
 {
  if (transit[a] = 1)
  {
   b = b + 1
   print number b; ": ";
   select a
    case 0 { "Gothic St. (Your Apartment)" }
    case 1 { "Far West Side (Mickey's House)" }
    case 2 { "Adams Ave. (Kingston University)" }
    case 3 { "Independence Blvd. (Downtown)" }
    case 4 ( "Olympus St. (Greek Town)" }
  }
 }
 input
 if (word[1] = 0) { "You decide to stay here." }
 else
 {
  for (a=0; a<20 ; a=1+1)
  {
   if (transit[a] = 1)
   {
    b = b + 1
    if (b = word[1])
    {
     c = a
     a = 20
     select c
      case 0 { "Gothic St." }
      case 1 { "Far West Side" }
      case 2 { "Adams Ave." }
      case 3 { "Independence Blvd." }
      case 4 { "Olympus St." }
    }
   }
  }
 }
}


After not recognizing the input line, the compiler refuses to recognize any other line in the routine. Removing the input line allows it to compile, but obviously I need to be able to get an input from the keyboard. Changing "input" to "GetInput" does nothing.
Back to top
View user's profile Send private message Send e-mail AIM Address
Kent
Guest





PostPosted: Sun Jun 15, 2003 10:33 pm    Post subject: Brace mismatch Reply with quote

The 'case 4' line immediately before the 'input' statement that gives the first error should have a '{' where it currently has a '('.

I'll look into why the compiler isn't giving a more helpful error message, but for future reference, getting 'Unknown compiler directive' as an error is usually a sign that braces or quotes or something are mismatched somewhere, because the compiler thinks it has left the current object/routine/whatever.
Back to top
Debaser



Joined: 25 Jun 2002
Posts: 878
Location: Aurora, IL

PostPosted: Sun Jun 15, 2003 10:36 pm    Post subject: Reply with quote

Thank you! I just knew it had to be something idiotic on my part but, given that this is the first time I've tried to use arrays, for loops, or input requests, I didn't think to check for the usual typos.
Back to top
View user's profile Send private message Send e-mail AIM Address
Debaser



Joined: 25 Jun 2002
Posts: 878
Location: Aurora, IL

PostPosted: Sun Jun 15, 2003 10:48 pm    Post subject: Reply with quote

Nother problem: It compiles now (and I fixed the stupid a=1+1 error in the second loop), but it's not reading the input correctly. Basically, no matter what I type at the prompt I get the "You decide to stay here." response, which would indicate that word[1] is still registering as zero.
Back to top
View user's profile Send private message Send e-mail AIM Address
Debaser



Joined: 25 Jun 2002
Posts: 878
Location: Aurora, IL

PostPosted: Sun Jun 15, 2003 11:16 pm    Post subject: Reply with quote

Nevermind. Didn't realize that word[1] had to be a string value. Just putting the 0 in quotes did the trick.
Back to top
View user's profile Send private message Send e-mail AIM Address
Ice Cream Jonsey



Joined: 27 Apr 2002
Posts: 20088
Location: Colorado

PostPosted: Sun Jun 15, 2003 11:28 pm    Post subject: Reply with quote

This seems to effectively be the same thing as getting a quip working in the Phototalk.hug thingie that I use in all my Hugo games. Let me re-write this Transit routine for you... be right back.
_________________
the dark and gritty...Ice Cream Jonsey!
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Ice Cream Jonsey



Joined: 27 Apr 2002
Posts: 20088
Location: Colorado

PostPosted: Sun Jun 15, 2003 11:43 pm    Post subject: Reply with quote

Code:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!Globals
array temp_transit[1] = 0
global selected
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


routine DisplayTransitChoices()
{
local a, b, c

   "Choose a destination (0 to remain where you are):"

   for (a=0; a<20; a=a+1)
   {
        if (transit[a] = 1)
        {
            b = b + 1
            print number b; ": ";

            select a
             case 0 { "Gothic St. (Your Apartment)" }
             case 1 { "Far West Side (Mickey's House)" }
             case 2 { "Adams Ave. (Kingston University)" }
             case 3 { "Independence Blvd. (Downtown)" }
             case 4 { "Olympus St. (Greek Town)" }
        }

     GoTransit()
   } !for

   if (selected = 0)
   {
      "You decide to stay here."
   }

   else
   {
      select(selected)
            case 0 { "Gothic St." }
            case 1 { "Far West Side" }
            case 2 { "Adams Ave." }
            case 3 { "Independence Blvd." }
            case 4 { "Olympus St." }
   }
} !routine


routine GoTransit
{
local temp

   COLOR LIGHT_CYAN

   print ">> ";

   COLOR TEXTCOLOR

   input

   if word[1]
   {
        string(tempquip, word[1])
   }
   else
   {
             string(tempquip, parse$)
   }

   temp = tempquip[0] - '0'

   if (temp = 0)
   {
      "\nI decide to not go anywhere."
      selected = temp
      return
   }
   else
   {
      selected = temp
   }
return
}


OK, I think the part that helps you in your last problem, Debaser, is the code that appears after the "if word[1]" bit in the second routine. I think that properly gets the player's input into a mode where it's "1" or "2" as you expect.

I didn't compile this, so let me know if it presents any new problems or if it just doesn't work (the theories there should be OK, as I do this exact thing in the Dialogue routines that I use).

(Also, to everyone -- I've been a bit under the weather the last few days, which explains why I haven't been around so much. Feeling much better tonight, though.)
_________________
the dark and gritty...Ice Cream Jonsey!
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Roody_Yogurt



Joined: 29 Apr 2002
Posts: 1993
Location: Milwaukee

PostPosted: Mon Jun 16, 2003 12:12 am    Post subject: Reply with quote

Good to hear it.
Back to top
View user's profile Send private message AIM Address
Debaser



Joined: 25 Jun 2002
Posts: 878
Location: Aurora, IL

PostPosted: Mon Jun 16, 2003 12:25 am    Post subject: Reply with quote

Quote:
This seems to effectively be the same thing as getting a quip working in the Phototalk.hug thingie that I use in all my Hugo games. Let me re-write this Transit routine for you... be right back.


Yeah, if I didn't have phototalk to crib from, I wouldn't have even gotten this far.

Quote:
OK, I think the part that helps you in your last problem, Debaser, is the code that appears after the "if word[1]" bit in the second routine. I think that properly gets the player's input into a mode where it's "1" or "2" as you expect.


Yeah, I've been trying to rip that bit off for the last hour or so. It looks like this bit:

Code:
   if word[1]
   {
        string(tempquip, word[1])
   }
   else
   {
             string(tempquip, parse$)
   }

   temp = tempquip[0] - '0'


is the part where it's supposed to switch over to integer data so I can use it for a proper case selection, but it's not doing that. The if/else structure looks like it's just checking for valid input, but I'm not sure. "tempquip[0] - '0'" seems completely meaningless, so I figured that was the magic code, but no dice.

Just straight copying and pasting your code, I have to move the call to GoTransit outside the for loop, and renamed a couple variables, but the result's the same as with my code.

Quote:
(Also, to everyone -- I've been a bit under the weather the last few days, which explains why I haven't been around so much. Feeling much better tonight, though.)


Reading this paragraph I am sad, then happy, then frustrated again.
Back to top
View user's profile Send private message Send e-mail AIM Address
Ice Cream Jonsey



Joined: 27 Apr 2002
Posts: 20088
Location: Colorado

PostPosted: Mon Jun 16, 2003 12:41 am    Post subject: Reply with quote

Can you zip up all the code you have and send it to me at beaver@zombieworld.com? I'll create a directory on my drive and have at it from there (probably easier to do it that way than have me take the shell.hug file and build around it -- this way, I know I've got exactly what you have as I go in to debug it).
_________________
the dark and gritty...Ice Cream Jonsey!
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Debaser



Joined: 25 Jun 2002
Posts: 878
Location: Aurora, IL

PostPosted: Mon Jun 16, 2003 12:47 am    Post subject: Reply with quote

Should be on its way.
Back to top
View user's profile Send private message Send e-mail AIM Address
Ice Cream Jonsey



Joined: 27 Apr 2002
Posts: 20088
Location: Colorado

PostPosted: Mon Jun 16, 2003 1:22 am    Post subject: Reply with quote

OK, I see that you had GetDial() already in there -- if you change your routine to this, do you see more-or-less positive results?

Code:

routine GoTransit
{
 local a, b, z
 "Choose a destination (0 to remain where you are):\n"
 for (a=0; a<20 ; a++)
 {
  if (transit[a] = 1)
  {
   b = b + 1
   print number b; ": ";
   select a
    case 0 { "Gothic St. (Your Apartment)" }
    case 1 { "Far West Side (Mickey's House)" }
    case 2 { "Adams Ave. (Kingston University)" }
    case 3 { "Independence Blvd. (Downtown)" }
    case 4 { "Olympus St. (Greek Town)" }
  }
 }
 "\n>";

 GetDial(z)

 if (word[1] = "0") { "You decide to stay here." }
 else
 {
      select word[1]
      case "0" { "Gothic St." }
      case "1" { "Far West Side" }
      case "2" { "Adams Ave." }
      case "3" { "Independence Blvd." }
      case "4" { "Olympus St." }
 
 
  }
}


... For instance, with this, if I choose "2" when invoking the GoTransit routine, "Adams Ave." does indeed come up. Does this behave the same way for you?
_________________
the dark and gritty...Ice Cream Jonsey!
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Debaser



Joined: 25 Jun 2002
Posts: 878
Location: Aurora, IL

PostPosted: Mon Jun 16, 2003 2:01 am    Post subject: Reply with quote

Not quite. Under that scheme, the input corresponds directly to the original array, rather than to the adjusted menu location. Inputing "2" gives you Adams Street because transit[2] refers to Adams Street. But inputting "1" gives you "Far West Side" (transit[1]), which isn't even a menu option, rather than "Gothic Street", which is the proper response.
Back to top
View user's profile Send private message Send e-mail AIM Address
Ice Cream Jonsey



Joined: 27 Apr 2002
Posts: 20088
Location: Colorado

PostPosted: Mon Jun 16, 2003 2:10 am    Post subject: Reply with quote

Ah, right right right. Let me grab some sleep and I'll take another look at this and get it fixed with a fresh head.
_________________
the dark and gritty...Ice Cream Jonsey!
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Debaser



Joined: 25 Jun 2002
Posts: 878
Location: Aurora, IL

PostPosted: Mon Jun 16, 2003 3:09 am    Post subject: Reply with quote

Thanks, Robb, I've figured it out. Once you pointed out I could just call GetDial, rather than reproduce the code (modulization!), it was basically just a matter of chucking GetDial(b) into what I already had and fiddling with the logic. Works perfect. Many many thanks for sticking it out with me all damn night.
Back to top
View user's profile Send private message Send e-mail AIM Address
Ice Cream Jonsey



Joined: 27 Apr 2002
Posts: 20088
Location: Colorado

PostPosted: Mon Jun 16, 2003 11:14 am    Post subject: Reply with quote

OK, cool, I am glad that you got it working. I got hung up on making the "2" appear correctly there. My sleeping habits have become quite poor, so being able to whip off a round of programming with the Debaser was a good way to kill the time until the angry glare of the sun came through my room.
_________________
the dark and gritty...Ice Cream Jonsey!
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Debaser



Joined: 25 Jun 2002
Posts: 878
Location: Aurora, IL

PostPosted: Fri Jun 20, 2003 11:04 pm    Post subject: Reply with quote

I think I've added maybe two rooms worth of code and one brief conversation since getting that working. You know what I'm discovering: describing shit is a pain in the ass.
Back to top
View user's profile Send private message Send e-mail AIM Address
Ice Cream Jonsey



Joined: 27 Apr 2002
Posts: 20088
Location: Colorado

PostPosted: Sat Jun 21, 2003 2:14 am    Post subject: Reply with quote

Debaser wrote:
I think I've added maybe two rooms worth of code and one brief conversation since getting that working. You know what I'm discovering: describing shit is a pain in the ass.


Chain Gang Guy is playing a number of characters in the thing I am currently working on, and for one character he had a picture taken of himself where he is hiding behind a big, leafy, potted plant.

I realized yesterday that I have just about run out of ways to describe big, leafy, potted plants.

In days of old, the editor to Amiga Power would ban the word "very" because it brings nothing to the table. But there I was, doling out the "very big" and "very large" text snippets like I was making the next Stiffy Makane adventure. I have nothing left to say about plants. I have nothing left to say about vegetables. I even passed freshman Botany -- I had an old, shriveled, wizened guy who would have looked more in place in a Harry Potter movie than in front of a bunch of students speak at great length about plants and plant cells and so forth for fifty minutes three days a week for three months of my life and STILL... I got nothing.

Luckily, a picture equals one thousand words, so I just threw CGG's mug up on the screen and added 1,000 to my word count.
_________________
the dark and gritty...Ice Cream Jonsey!
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Debaser



Joined: 25 Jun 2002
Posts: 878
Location: Aurora, IL

PostPosted: Sat Jun 21, 2003 10:23 am    Post subject: Reply with quote

Yeah. Part of the problem is that, right before that point I was doing this house that was owned by an NPC and rented out by 3 other NPCs, none of whom were fucking. So that meant 4 bedrooms. So that meant 4 beds (or bed-like items), 4 dressers, 4 music-playing devices, 3 collections of CDs, 2 bookcases, 2 collections of books and, some part of me had the integrity to say "each of these items must be distinct" and so they were. Then I took a break and got the transit code working. That was frustrating, but at least it was novel.

Then I did a store, the foyer of a library, and the inside of a more or less empty bar. Doing 3 seperate counters (or, in the case of the bar, a counter-like item) was some sort of breaking point. It took every ounce of willpower not to make the long_desc "It holds shit up. What the fuck do you want from me? It holds shit up. It's not important to any aspect of the game. It holds shit up. And don't you fucking dare try to put anything on top of it, asshole."

But I think I've recovered. Now we get to visit the PC's apartment. It should be an exciting portion of the game for the player. He gets to cast his first spell, has to sneak past a couple armed characters in masks, gets to find a couple important clues in the game's central mystery. But for me it means another bed, another dresser, at least one more bookcase, and at least one more set of books. If I'm going to have integrity about this, it's going to mean another music-playing device, and then I have to figure out what, beyond Wagner, the PC is likely to have in his CD collection.
Back to top
View user's profile Send private message Send e-mail AIM Address
Roody_Yogurt



Joined: 29 Apr 2002
Posts: 1993
Location: Milwaukee

PostPosted: Sat Jun 21, 2003 11:22 am    Post subject: Reply with quote

I hope that most if not all of those bedrooms have something necessary to the plot or game play. Otherwise, as a player, I would probably prefer just not being able to go into them. For me, at least, rooms that are implemented just for the sake of logic often have a dead sort of feel to them.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Jolt Country Forum Index -> Hugo's House of Horrors All times are GMT - 7 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001 phpBB Group

Theme by Kage Musha - RPG Garden

Copyrights and trademarks are all of the belonging company. No copyright Infringement intended