Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

How to move a generic object to another room

A topic by Garry Francis created Sep 01, 2019 Views: 116 Replies: 5
Viewing posts 1 to 6
Submitted

When I drop an object, I want it to move to another room. For example:

>DROP SWORD

It falls into the chasm.

I can't use :drop; , as this drops the object in the user's input in the current room, not another room and you can't specify a target.

I can't use :create "blah" target = "room_name"; , as I don't know what object the user referred to to put in "blah".

I would have thought this is a very common requirement, but I can't find anything that covers this in the Ctrl+Space help or the reference guide.

(1 edit)

I used exactly this in Dino Island. Basically when at a certain location. Drop object, if present chasm, destroy dropped item. set flag to true. When in cave under chasm and flag is true, create the item and set flag to false. 

I only allowed certain items to fit in the small chasm so coding it was easier.   All other items remained in the location when dropped. 

You're creating a custom response for the drop command when at the chasm, I presume?

How about when a player types the command to drop an item at the "chasm", you goto "chasm_bottom", do the drop of the item, then goto "chasm" to return back to the top of the chasm... The player doesn't see this movement. 

This should work, Garry...

   : match "drop _" {
         : if (is_at "chasm_top") {
            : goto "chasm_bottom";
            : drop;
            : print "Oh no! It's fallen down the chasm!";
            : goto "chasm_top";
            : done;}}

Perhaps not the most elegant... I really want a silent get & drop in Adventuron... but it does the job.

Submitted(+1)

Talk about thinking outside the square! Both good ideas, but I think Gareth's will work better for me.  There actually is a quiet drop and get. Use : drop quiet = "true" ; and : get quiet = "true" ; , then you can give your custom response.

I was actually using the chasm as an example. In my case, I'm up a tree and the only thing I can get while up the tree is an apple, so I can just test for "drop apple" and create the apple at the bottom of the tree. Apparently, this moves the apple from its current location in order to create it at the new location. Hopefully, this doesn't mess up the count of things in your inventory.

In case you can't tell, this is the first time I've used Adventuron (only started yesterday) and it's proving to be quite a challenge. I'm putting this down to ignorance on my part. My previous adventure writing experience is primarily BASIC and Inform 6, where you can do pretty much anything you like. I was never exposed to The Quill, PAW and GAC, except as a player.

Ah, interesting to know about the "quiet" settings. I lose track of everything that Chris has added to the system since I first looked at it, back in early 2018.

Yes, having just a single (known) object would make things easier in your case. Especially as the player can't take anything else up the tree.

[One thing I would say, and I was very guilty of this with my first attempts to use Adventuron, is that if you come to the system trying to program in a way that another system works (be it BASIC, PAW, Inform or whatever) then you can spend half your time trying to fight and program around Adventuron strengths.

I've found the last couple of games I've written with Adventuron a breeze... simply because I decided to embrace all the little features that Chris has put into it, rather than attempting to code everything how I'd do it if I was using the Quill and PAWs.

Even doing things like using "objects" to represent things I'd usually do with flags & dynamic location text, such as additional location features such as a trapdoor or NPCs, has saved me no end of time. And the has_not_created check has been an absolute godsend.

I'm now coding entire games in a few evenings... rather than weeks or months... with the added bonus with the last full-length game I did, of also almost having an instant 8-bit ZX Spectrum version too.]