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

Vehicle Movement

 
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
zoot



Joined: 29 Jul 2004
Posts: 6
Location: On the Level

PostPosted: Sun Aug 01, 2004 3:37 pm    Post subject: Vehicle Movement Reply with quote

I have a car :smile:

I know that any destinations to which the car can travel must have the vehicle name in its vehicle_path property. The thing is that I don't want to make all the possible destinations available until certain puzzles are solved. Sort of, first puzzle solved, add destination one, second puzzle solved, add desination two etc.

To avoid the risk of players accidently guessing destinations, I would like to restrict vehicle_path until I want it to be available in each room. Can I either set vehicle_path to a null entry, or reserve memory to do this another way? If not, I had thought of generating an array that is added to each time a new destination becomes available which is then displayed to the user as a destination list.

Any ideas on the best way to achieve this?
Back to top
View user's profile Send private message Visit poster's website
Debaser



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

PostPosted: Sun Aug 01, 2004 3:49 pm    Post subject: Re: Vehicle Movement Reply with quote

zoot wrote:
If not, I had thought of generating an array that is added to each time a new destination becomes available which is then displayed to the user as a destination list.

Any ideas on the best way to achieve this?


This is what I did in the game I'm working on. I sort of started with Robb's phototalk code (availiable on the IF Archive), and adapted it to provide a list of locations that became "active" as certain plot points passed. Whenever the player boarded the L, a menu list of availiable locations shows up. You can view my ham-fisted work getting it together here.

Since you seem to have a better idea of how arrays and code in general works than I did at the time (and still do), you shouldn't have too much trouble assembling something workable from those two sources. Otherwise, let me know, and I'll just chuck my working code into this thread.
Back to top
View user's profile Send private message Send e-mail AIM Address
zoot



Joined: 29 Jul 2004
Posts: 6
Location: On the Level

PostPosted: Mon Aug 02, 2004 7:53 am    Post subject: Reply with quote

Thanks, DB. That looks like what I need (the link to the dicsussion really helped too).

I wonder if there is a way, however, to reserve the space in the room description, as that woould be even more elegant. The array does leave the possibility, however unlikely, that the player could 'guess' and available destination.

Cheers,

Zoot
Back to top
View user's profile Send private message Visit poster's website
Debaser



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

PostPosted: Mon Aug 02, 2004 8:04 am    Post subject: Reply with quote

zoot wrote:
The array does leave the possibility, however unlikely, that the player could 'guess' and available destination.


Wait... what? I think one of us is missing something. What the code I'm talking about does... okay: You set up an array and each possible destination is a value in one dimension of the array and then each destination has an associated value of 1 or 0. If it's 1 you can go there, if it's 0 you can't. Then when the player starts up the car, you count up all the "1" destinations, and display them as a menu:

Code:
> start car
[i]Vroom vroom!![/i]  Where would you like to go?

1. The Sub Shack
2. The Whorehouse
3. Norway

>  3


If a location isn't "known" yet, it doesn't disply on the menu and can't be selected, dig?
Back to top
View user's profile Send private message Send e-mail AIM Address
zoot



Joined: 29 Jul 2004
Posts: 6
Location: On the Level

PostPosted: Mon Aug 02, 2004 8:43 am    Post subject: Reply with quote

Debaser wrote:


Wait... what? I think one of us is missing something.

If a location isn't "known" yet, it doesn't disply on the menu and can't be selected, dig?


Yes, I probably was missing something. My point was that, because the vehicle must be specified in the vehicle_path property of the rooms that could be reached by the vehicle, the user could just type "Drive to " x, and if x was a valid destination, the car would go there. I would be very interested in seeing the full code for your vehicle object, if that is possible. Thanks again,

Zoot
Back to top
View user's profile Send private message Visit poster's website
Debaser



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

PostPosted: Mon Aug 02, 2004 8:54 am    Post subject: Reply with quote

Alright, this'll be up in t-6 hours, give or take. As soon as I get home from work.
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: Mon Aug 02, 2004 6:15 pm    Post subject: Reply with quote

Sorry: Forgot about this.

Code:
array transit[6] = 1, 1, 0, 0, 1, 0
global lastrans = 999

routine GoTransit
{
 local a, b, c, d
 "Choose a destination (0 to remain where you are):\n"
 for (a=0; a<5 ; 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 { "Lakewalk Blvd. (Ravi's Condominium)" }
    case 3 { "Olympus St. {Greek Town)" }
    case 4 { "Adams Ave. (Jamestown University)" }
  }
 }
 "\n";
 GetDial(b)
 for (a=0; a<5 ; a=a+1)
 {
  if (transit[a] = 1)
  {
   c = c + 1
   if (c = selected)
   {
    d = a
    a = 20
    select d
     case 0 { moveplayer (platform0) }
     case 1 { moveplayer (platform1) }
     case 2 { "Lakewalk" }
     case 3 { "Olympus" }
     case 4 { moveplayer (platform4) }
   }
  }
 }
}


GetDial is a bit of code I copied verbatim from the aforementioned phototalk.
Back to top
View user's profile Send private message Send e-mail 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
Page 1 of 1

 
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