#๐ I'm Having Trouble Trying To Make Equip Able Items Give The Player Stats
53 messages ยท Page 1 of 1 (latest)
@pliant cipher
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
!pastebin
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
what is that?
It allows you to share the code you have
they do not
I still don't know how to paste it after putting my code into the pastbin??
There's a "Paste" button on the bottom, when you press it your browser takes you to a link
You can copy-paste that link here
Yes
Okay well I want to make a equip able item that gives you extra stats when its equipped.
I was having trouble trying to incorporate this with my code
So from what I see the player stats aren't updated dynamically at all, and you need to be able to change stats on the fly
For example, level up doesn't seem to actually change the player's level?
No it just checks to see if the player needs to and if it does need to it effects the rest of the stats.
Actually no
it checks if the player needs to level up
So first I should have it update within the loop every iteration?
I'm not sure, the code is pretty hard to understand for me
Have you learned classes yet? That would be very useful here, but it would involve rewriting a lot of code
honestly their implementation of stats is pretty similar to classes
i dont think it would require that much rewriting
The code there is the extent of my knowledge
I have no idea how to use classes
when do u use these stats btw
I want to make a battle UI that activates when you hover over an enemy
That uses the stats
ok in that case
during the start of the battle or something
create a dictionary storing the stat buffs/debuffs u want
Oh okay and then update them before a battle?
then when attacking add those to the corresponding stats required
personally i think it'll get messy quickly
i would just do it during an attack itself
say ur base attack was 10
and ur equipped weapon gave u +2
have something like
okay so keep the stats the same but add them on before an attack so it outputs the correct number but is part of the Battle Function?
#start of battle
stat_changes = {"atk" : player["equipped_weapon"]["damage"], ... }
#player picks an attack
enemy["health"] -= player["atk"] + stat_changes["atk"] #the stat_changes["atk"] could be 0 if they have nothing equipped
ye
Okay and add the damage to the dictionary on the weapon?
yup
Okay thank you
gl
Once I'm done with making it a minimum viable product I think I'm going to make it a team effort because this is hard man
dont worry its always tough at the beginning
gets easier once u learn various techniques and methods for solving problems
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.