How do you have single and multiple object versions of get?

I would like to include certain places in the game where you get


Most of my message has been lost.... I wanted to know how you can use the get command with multiple objects in certain circumstances whilst retaining the default behaviour the rest of the time.
So for example : GET FISH WITH NET (to catch the fish in the water)
But later GET FISH (when it has been dropped on the ground).

I can't add GET (or drop) to the VERBS which is how I expected to be able to override the handling, how can you see the get and drop code?

Thanks


Make the fish in the water and the fish out two different objects. The fish out should be set as invisible.
When the fish is caught , vanish the water fish and show the out fish. The water fish can be set as plural and the caught fish singular. Each can have different descriptions and 'take fish' messages, as appropriate. You would unless you want further complications catch only one fish, unless you want to say "you catch several fish" and make it plural. If you set the verb and object ' catch fish' as 'first time' "You catch a fish" else " The fish seem to have cleared off, I don't blame them" the fish vanishing will be more believable.


But how do you add different versions of GET? I could do it with other commands but GET and DROP can't be added to the VERBS list of an object as it says they already exist.

I had created two versions of the object with one visible and one invisible initially and was going to switch but I can't get add a custom version of the GET/TAKE command to switch them.


Get fish
Scripts in fish inventory tab.
Script 1 If fish 1 is visible
print ' you catch a fish it flops onto the bank.
Show fish 2
Move fish 2 to inventory
Hide fish 1
All gets after that will refer to fish 2


The trouble with that is you can't make the first one require two objects and the second one just one. I want to require GET FISH WITH NET the first time and I don't see a way of enforcing that., if the player does GET FISH when it is in the water they should get a message like "You can't catch it as it swims away" or something .

The fish example is just something I made up for the discussion by the way, not actually part of my game.

Thanks for your replies

Simon


I think there are two ways to do this:

  1. Use a command.
    A. I added a command in the room where the pond and fish were.
    B. I typed this in the command box: use net on fish; use the net on the fish; use the net on fish; catch fish with net; get fish with net; grab fish with net; take fish with net; catch fish using net; get fish using net; grab fish using net; take fish using net
    C. I added an 'IF' script here to check if the player was carrying the net and if the player was, then I added a first time script that printed a message indicating a fish was caught, making fish1 visible, and added it to the inventory.
    D. In the otherwise part of this script, I placed a print message script indicating that "You have already caught one fish. There is no need to take another."
    E. In the inventory tab of the fish, I added an 'If' script that checked if the player was carrying the net and if the player was, I added a print message script saying "That's a great idea, but maybe you should try catching a fish using that fancy fish net you are carrying." In the else box here, I added a snarky comment like "You try your best grizzly bear impression but you cannot catch the fish with your mouth or your "bear" hands."

  2. Place an 'If' script in the inventory tab for the fish in the pond.
    A. Essentially do part E above, but instead of making a comment about using the net, just make fish1 visible and add it to the inventory. That way, 'get fish' will catch a fish if the player is carrying the net.

The problem with using either of the above is that you now have two objects by the same name. This will lead to the annoying 'Please choose which 'fish' you mean:' default when trying to catch or take a fish a second time (once your caught fish becomes visible). The work-around here I use is that I name it something slightly different than 'fish' when it is caught. When successfully catching the fish, I might make a comment like "You haul the fish in with your net and upon closer inspection, you find out that you have caught yourself a trout!" The fish you have now caught becomes trout instead of fish.

I am sure there are other ways, but this is how I deal with this.


I used method 1 and it works just as I wanted.

Thank you for your help

Simon


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums