ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

Unlimited Objects to take?

This forum is the place to learn about and discuss ADRIFT 5. Feel free to mention any bugs you find here, but please also add these to the Bugs & Enhancements list.

Please also refer to the ADRIFT 5 Wiki for more information.

Unlimited Objects to take?

Postby ohhaykfrankk » Sun Mar 10, 2019 4:08 pm

I'm trying to make a flower field. I will need flowers later for quests though so if I pick flowers from this field and give them to someone or drop them, you'd think I'd still be able to pick more flowers from the field. Whether or not I want them to wilt is undetermined as of yet. However, in case of stupidity, I want the flowers to be unlimited at the field.
Is there anyway to do this?
ohhaykfrankk
 
Posts: 11
Joined: Sat Mar 09, 2019 2:18 am

Re: Unlimited Objects to take?

Postby saabie » Sun Mar 10, 2019 11:59 pm

If you only want the player to be able to have one flowers object at a time, then when you enter the field location run a task that checks if the player is carrying the flowers and if not then move the flowers from wherever they are back to the field.
If you want a limited number of flower objects then move a new one into the location from hidden instead of moving the original one.
If you need to be able to have many copies of the same object at multiple locations at the same time then you need to make an integer property of items to count how many of them are located at each item.
You will need to add several tasks to manage taking and dropping these virtual objects.
saabie
 
Posts: 950
Joined: Fri Aug 12, 2011 2:07 am
Location: Adelaide, South Australia
Points: 25

Re: Unlimited Objects to take?

Postby The0didactus » Mon Mar 11, 2019 2:39 pm

Another thing that you can do is have "Flower" be a variable instead of an item. Whenever you "pick" a flower from the field, it increases the variable FLOWERS by 1. Whenever you give one away. You can make certain tasks like "Give flower to X" decrease the number of flowers you have by one, and "look at flowers" only work if you are in the flower field OR if you have more than 0 flowers.

This solution is good if you don't really care what happens to the flowers once you give them away, and ESPECIALLY if you want the player to have lots of flowers at once.

If neither of those are true it's better to use the solutions listed above.
The0didactus
 
Posts: 106
Joined: Sun Mar 30, 2014 8:20 pm
Points: 30

Re: Unlimited Objects to take?

Postby P/o Prune » Mon Mar 11, 2019 4:08 pm

The0didactus wrote:Another thing that you can do is have "Flower" be a variable instead of an item. Whenever you "pick" a flower from the field, it increases the variable FLOWERS by 1. Whenever you give one away. You can make certain tasks like "Give flower to X" decrease the number of flowers you have by one, and "look at flowers" only work if you are in the flower field OR if you have more than 0 flowers.

This solution is good if you don't really care what happens to the flowers once you give them away, and ESPECIALLY if you want the player to have lots of flowers at once.

If neither of those are true it's better to use the solutions listed above.

I'm using this one in my next game. It works :-)
D-Day V.5 in progress 86Kb (Slowly drifting)
Just a Fairy Tale: 47Kb
User avatar
P/o Prune
Site Admin
 
Posts: 4282
Joined: Mon Jun 24, 2002 8:18 am
Location: Denmark
Points: 58

Re: Unlimited Objects to take?

Postby Lumin » Mon Mar 11, 2019 5:28 pm

I like variables, they're simple and they create the illusion of the feeling that I know what I'm doing and have finally moved past all the hilariously hacky solutions I used to go with.
Currently working on: A big fat fantasy CYOA using this sweet map.
User avatar
Lumin
 
Posts: 1903
Joined: Fri Aug 06, 2004 5:48 pm
Location: Texas
Points: 34

Re: Unlimited Objects to take?

Postby The0didactus » Mon Mar 11, 2019 5:36 pm

The entire "inventory" system in Tingalan is variable-based. Items are either a number variable (You have "x" jars of water) or a text variable (You have "No shears"/"A pair of shears") Skybreak is going to be very similar.

Games where you might have to rely on multiple "copies" of the same item might get confusing. The way I'd probably do it is to make a roster of items, perhaps 20, that are all copies, and call them all something... "A Grenade" or whatever. Then I'd designate them all to be part of a group ("grenades") and have all actions concerning them be like "Player must have an object from group "gernade"...but of course, even now, I'm seeing problems with this system. Variables would be easier.

In fact I used exactly this system in Six Silver Bullets: There is an item called "The silver bullets" and when you "Take" that item, the game destroys the item, and sets the bullet counter to 6. Setting up a system that tracked each bullet would be maddening.
The0didactus
 
Posts: 106
Joined: Sun Mar 30, 2014 8:20 pm
Points: 30

Re: Unlimited Objects to take?

Postby Lumin » Mon Mar 11, 2019 5:44 pm

Ask me about how I used to track water levels in a bucket.

(If you guessed 'create as many buckets as there are units of water and swap them out constantly', you're right!)
Currently working on: A big fat fantasy CYOA using this sweet map.
User avatar
Lumin
 
Posts: 1903
Joined: Fri Aug 06, 2004 5:48 pm
Location: Texas
Points: 34

Re: Unlimited Objects to take?

Postby The0didactus » Mon Mar 11, 2019 6:34 pm

I think my dumbest kludge is for Tingalan: I artisinally hand-crafted variables for the numbers "1" through "10" because I didn't realize you could program your own equations on tasks...so about 25% of my tasks in Tingalan have conditions like "and [witsroll] is greater than or equal to [thenumber10]"
The0didactus
 
Posts: 106
Joined: Sun Mar 30, 2014 8:20 pm
Points: 30

Re: Unlimited Objects to take?

Postby DazaKiwi » Wed Mar 13, 2019 10:25 pm

I created a basic system for one of the games i'm making, i had make a little demo to refine it first. This would be tedious to implement for a lot of objects you can stack, however i think there could be way to do this using groups which can force parameters on objects that you want to have multiple instances of and run it through a similar system as my demo. I might tackle that one in the future.

Also in another game where i have a combat system i have 2 characters; 'enemies' and 'enemy' and just have an integer property for number of enemies for character 'enemies', and using these two characters for each enemy encounter.
Attachments
MultipleObjectsDemo_v1.taf
(16.28 KiB) Downloaded 3 times
User avatar
DazaKiwi
 
Posts: 564
Joined: Thu Oct 21, 2010 9:05 am
Location: New Zealand
Points: 16

Re: Unlimited Objects to take?

Postby ohhaykfrankk » Wed Mar 13, 2019 11:28 pm

Oh my, DazaKiwi. I appreciate the effort/time it seems like you put into that demo. It looks amazing. Question about it, so if I drop an apple, is there no way to pick up that one apple I just dropped? And if I don't want the field to run out at all, do I still need the variable for the ground?

My only concern, not a concern really, is that I have like 15 different types of flowers so I need all of those things per flower? Lol, not looking forward to that part but it'll do lol.

Thank you, a lot!
ohhaykfrankk
 
Posts: 11
Joined: Sat Mar 09, 2019 2:18 am

Re: Unlimited Objects to take?

Postby DazaKiwi » Wed Mar 13, 2019 11:41 pm

ohhaykfrankk wrote:Oh my, DazaKiwi. I appreciate the effort/time it seems like you put into that demo. It looks amazing. Question about it, so if I drop an apple, is there no way to pick up that one apple I just dropped? And if I don't want the field to run out at all, do I still need the variable for the ground?

My only concern, not a concern really, is that I have like 15 different types of flowers so I need all of those things per flower? Lol, not looking forward to that part but it'll do lol.

Thank you, a lot!


I made the demo previously for my game where i was trying to get this working properly and just tweaked it a little for demonstration purposes.
Its often a good idea to demo out some game mechanic you have to implement in a game and can be a good demonstration to view again in future when you cant remember how it was set up etc. I had tried a similar system in the past and it got messy and more complicated than it needed to be. This time it was more simple.

Anyway as for your questions, if you drop a red apple in the game you can pick it up again and the held version of the apple just increases in number and variable tracking what is on the ground decreases by 1. Once the apples on the ground count down to zero it is removed (until you drop another red apple on the ground again). So yes you can pick up what you drop.

As for having the field not run out, then for the flower object called say 'Red Flowers' you could have have a very big number for the variable that tracks this, in my demo its for the red apple the variable "RedAG" tracks number on ground. So you could have a variable called 'RedFlowersOnGround' and set the amount to 100 or 500. And everytime the player picks one this decreases by 1 and increases the variable for the 'Red Flowers' held. All the other tasks do is check if those variables reach 0 and removes object if depleted.

Hope that makes sense?
User avatar
DazaKiwi
 
Posts: 564
Joined: Thu Oct 21, 2010 9:05 am
Location: New Zealand
Points: 16

Re: Unlimited Objects to take?

Postby ohhaykfrankk » Thu Mar 14, 2019 8:47 pm

Makes total sense. Thank you so much!
ohhaykfrankk
 
Posts: 11
Joined: Sat Mar 09, 2019 2:18 am


Return to ADRIFT 5.0

Who is online

Users browsing this forum: No registered users and 2 guests

cron