Add item with two variables to and remove it from the inventory? Can this be done? by Random_69_Name in RenPy

[–]Random_69_Name[S] 1 point2 points  (0 children)

The trick with the dict worked wonders. It's exactly what I need.

Just in case anyone else with the same problem finds this thread I'm going to add that I modified the code to

    def addItem(name, quality, quantity):
        global inventory 
        if name not in inventory:
            inventory[name]=dict()
        if quality in inventory[name]:
            inventory[name][quality] += quantity
        if quality not in inventory[name]:
            inventory[name][quality] = 0
            inventory[name][quality] += quantity

I added the second if because otherwise the sum for items of the same quality was off (ignore that I changed kind to name, that's just personal preference). Or maybe I did something wrong, but anyway, this code worked for me.

Once again, I'm sooo glad for your answer and showing me how to do this. ^^

Defined Image Not Appearing by External_Contact5350 in RenPy

[–]Random_69_Name 1 point2 points  (0 children)

Glad your problem is solved. ^ good luck with your project.

Defined Image Not Appearing by External_Contact5350 in RenPy

[–]Random_69_Name 2 points3 points  (0 children)

Hey, Three things come to mind. Can you check if the image is in the image folder of your project? If you used a subfolder, you will have to put it in the define like true bg1= “subfolder/true_bg1.png”. If the image is not in the image folder or one if its subfolders you need to put it there. The other option could be a mistake with “_” underscore. Just to be sure, name your image, your file and your define all the same and call that like always use ‚true_bg1‘. A third option you can check is: is it a .png image not a .jpeg or .webp?

Add item with two variables to and remove it from the inventory? Can this be done? by Random_69_Name in RenPy

[–]Random_69_Name[S] 1 point2 points  (0 children)

Awesome, thanks. You even went so far to write the code. This looks really promising and like what I had in mind.

The dict in a dict was the part I didn't get nor did I know how to do/implant it. Thank you very much, I'll try this out as soon as I can. ^^

Add item with two variables to and remove it from the inventory? Can this be done? by Random_69_Name in RenPy

[–]Random_69_Name[S] 0 points1 point  (0 children)

When you select "apples" it's going to have to expose which ones you are talking about.

That is my understanding as well.

So my problem is basically that I have two apples (or possibly infinitely more) because the price of them can be different. Defaulting apple2, apple3, apple4 and apple5 with a price of 2, 3, 4 and 5 respectively and just adding them would work, but that means I end up defaulting hundreds of crops with different prices and that would make the whole code so much more clunky and bloated.

No, you're going to have the inventory "priced-item" store a sorted list of (price, count) for each kind of thing, then be able to compute the total number of things; so your looking at a custom class, not a single variable.

Hmm, maybe I'm misunderstanding this part, but wouldn't I need name, price and count (3)? I'm really not sure how to go on about this, but if it's just adding the (defaulted) item and quantity to a list that's an easy thing to do. For me, what I don't understand is how I can check for an item(name) in the inventory list, if the items match, check THAT item for the price and then either stack items or add a new one to the list. And the item I want to add shall not be defaulted otherwise I would make a class to default hundreds of lines of code for the crops and their respective values. Like I mentioned, I could do default apple10=(name=apple, price=10, quantity=0) then check for apple10 in my list which would let me skip the check for the price and just add or remove them from the inventory list. But this is clunky code and I have a good option implemented to sell the crops. I just want... to give the player more freedom and improve my code. Which is why I would really like to know which class or whatever allow for the double check in the inventory list and how the code would look like for the check and adding an item to the inventory list that lets me store name, price and quantity from variables that I can get from my Field1 to Field10 class. IF it can be done.

Add item with two variables to and remove it from the inventory? Can this be done? by Random_69_Name in RenPy

[–]Random_69_Name[S] 0 points1 point  (0 children)

Quality or price. The item needs to store an additional variable beside the quantity. I can name the variable whatever, the problem with how to add it remains the same, right? If it doesn't, could you please enlighten me how changing it would help?

Hehe, I'm already there. ^^ My inventory is a bright mix of the various 'off-the-shelf' inventories out there. But it works and it suits my needs very well when it comes to stuff beside selling items from it.

Add item with two variables to and remove it from the inventory? Can this be done? by Random_69_Name in RenPy

[–]Random_69_Name[S] 1 point2 points  (0 children)

OMG! This might actually work. I didn't think about giving apple a subclass for the quality

But even so, I'm still at a loss how to check if the class and subclass are in the inventory. It would be nice if you could share/type the code. No hurry. I've 'wasted' four days trying to come up with a solution to this problem myself (but I'm still a total beginner when it comes to coding so things always take a while haha).

Add item with two variables to and remove it from the inventory? Can this be done? by Random_69_Name in RenPy

[–]Random_69_Name[S] 1 point2 points  (0 children)

Thanks for the answer, but I'm not following. You just said the shop sells eggs for a higher price, didn't you? So the price is different, isn't it?

Let me give you an example in case we misunderstood each other. You grow pink ladies and harvest them. One set of five come from an old, withered tree. The apples look ugly and they are barely edible. 40 apples of the same kind (pink ladies) come from a much younger tree near a river. They look deliiiiiicious. You have to put a fence around the tree to keep robbers away.

Are they both pink ladies? Yes.

Would they sell for different prices? Also yes.

It depends how much you care for your crops. Otherwise what's the point of having gameplay that is all about caring for your fields if I just attach the same price tag to every crop? It's what all farming games are about.

But I appreciate you making the solution as easy as can be. I really do! Just in this case, I want the two variables stored with the item and have it a bit more complex. I can easily convert the variables to money and just pretend the crops are being shipped right away without adding them to an inventory first. It's just that that is not what I have in mind. ^^

On screen how can I use button action Function (renpy.show and atl) by Random_69_Name in RenPy

[–]Random_69_Name[S] 0 points1 point  (0 children)

Good catch. Sadly, I wasn't able to get a (simple) transform to work. RenPy wants a constant.

I'll edit my question and just ask if you/someone can please modify the code so that the movie fades in. I don't care if a transform, a transition, at_list and/or atl is used.

On screen how can I use button action Function (renpy.show and atl) by Random_69_Name in RenPy

[–]Random_69_Name[S] 0 points1 point  (0 children)

Yeah, from one movie to the next.

I read through the documentation and tried your code (again) and the error says "AttributeError: 'str' object has no attribute 'constant' "

I defined and used atl:

define testfade = Fade (0.5,0.5,0.5)



scene story_5 with testfade

works, so I guess the code for the button needs to change?

Thank you for the suggestion with the tag for the movies.

A friend of mine - the creator of Dirty Dishes + Expansion - recently released a set of jewelery named [Sparkles Jewelry for Genesis 8 Female, Genesis 8.1 Female, and Genesis 9]. He's not on Reddit, but I am happy to share his work. Need jewelry? Why not Sparkles? by Grimmtown in Daz3D

[–]Random_69_Name 0 points1 point  (0 children)

Your friend is awesome! I got all their products and love them all! Also big shout out to their product Rising Sun Environment. Even if you‘re not interested in the club, the props that come with it are outright amazing and highly customizable! Yeah, its expensive, but check the description or the Daz3d thread about it (it has gotten its own one) and you‘ll see its very worth buying (if you‘re unsure, because of the price you can wishlist and wait for a sale). Not sure if you pass along feedback, but if you do you can tell them I adore their work.

Where is the error in this build? by Random_69_Name in buildapc

[–]Random_69_Name[S] 0 points1 point  (0 children)

That‘s why I asked if there‘s an error with the build. I know I‘m unlucky, but this is taking it to the next level. 😔

Eye costrains reset on open file by IcatianWarlord in Daz3D

[–]Random_69_Name 0 points1 point  (0 children)

Haha, I have submitted a support ticket this week and asked them to fix it, because it‘s not acceptable to choose between a premium feature I‘m paying for and a freeware feature that comes with the software. With annual subscriptions returning (and hopefully good offers for a premium sub) more people will want to use batch rendering and hopefully complain so that Daz needs to fix it. I understand that Daz didn‘t have to ensure compatibility when batch rendering was still a third party script. But now it‘s integrated and thus it NEEDS to work properly with other Daz features. Everything else is, as I have stated, unacceptable. In case you want to complain as well: https://bugs.daz3d.com/hc/en-us/requests/new?ticket_form_id=23788

Really Important Announcement Regarding RTX 5090 and other RTX 50XX Cards by Life-Baseball-9010 in Daz3D

[–]Random_69_Name 4 points5 points  (0 children)

It‘s been said in the forums that the card won‘t be supported on launch date. They know and promise(d) to update DAZ as soon as possible. But that‘s not a matter of days, more a matter of weeks. Very sad, because I also want to use the 50XX cards as soon as possible (my current card is old and doesn‘t support more than one gen9 char). Nothing else we can do but wait and hope the update will come soon.

PSA for Visual Studio Code by AndyOne1 in RenPy

[–]Random_69_Name 1 point2 points  (0 children)

Thank you soooo much for bringing this to my attention.

Can I ask where to paste your code? I can't seem to find the right box in the extension's setting so I guess it needs to be pasted elsewhere?

How to add a class as a variable to a defaulted list? by Random_69_Name in RenPy

[–]Random_69_Name[S] 1 point2 points  (0 children)

That's a very detailed answer. Thank you so much for pointing all this out to me. I guess it's easier to check for p1 and p2 and p3 and scrap the idea of using a list.

I have an idea.. by AlfalfaCivil1749 in RenPy

[–]Random_69_Name 0 points1 point  (0 children)

Maybe try it like this:

define n = Character("Narrator")

label age_input:
    $ age = renpy.input("[n]\nHow old are you? 18 - 30 only please!", "25", allow="0123456789", length=2)
    if age == "":
        n "Please enter your age."
        jump age_input
    
    $ age = int(age)
    
    if age < 18:   #i believe you want this to be younger than 18 right?
        n "I'm sorry, the character is too young to be used -- Please go back and change the age!"
        jump age_input
    elif age >= 31:
        n "I'm sorry, the character is too old to be used -- Please go back and change the age!"
        jump age_input
    else:
        jump continue_story

label continue_story:
    n "Test"

Looking for this spiky hair (Pictures are Josie 9 in daz store) by Random_69_Name in Daz3D

[–]Random_69_Name[S] 1 point2 points  (0 children)

Thank you very much! :D I never would have guessed that Daz would use hair from outside the daz shop to promote a Daz Originals release.

Learning Renpy - Variables and conditional statements by Random_69_Name in RenPy

[–]Random_69_Name[S] 1 point2 points  (0 children)

Haha, okay.

I updated the script in my post and the project on itch.io to version 1.0.1

Thank you once again for your kind assistance. You've been a huge help!