#๐Ÿ”’ I'm Having Trouble Trying To Make Equip Able Items Give The Player Stats

53 messages ยท Page 1 of 1 (latest)

rapid helmBOT
#

@pliant cipher

Python help channel opened

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.

wooden trail
#

!pastebin

rapid helmBOT
#
Pasting large amounts of code

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.

pliant cipher
wooden trail
#

It allows you to share the code you have

pliant cipher
#

!pastebin

#

??

wooden trail
#

I don't think they let you upload files here

pliant cipher
#

they do not

#

I still don't know how to paste it after putting my code into the pastbin??

wooden trail
#

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

pliant cipher
#

Like that?

wooden trail
#

Yes

pliant cipher
#

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

wooden trail
#

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?

pliant cipher
#

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?

wooden trail
#

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

safe quartz
#

honestly their implementation of stats is pretty similar to classes

#

i dont think it would require that much rewriting

pliant cipher
#

I have no idea how to use classes

pliant cipher
#

I want to make a battle UI that activates when you hover over an enemy

#

That uses the stats

safe quartz
#

ok in that case

#

during the start of the battle or something

#

create a dictionary storing the stat buffs/debuffs u want

pliant cipher
#

Oh okay and then update them before a battle?

safe quartz
#

then when attacking add those to the corresponding stats required

safe quartz
#

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

pliant cipher
#

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?

safe quartz
#
#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
pliant cipher
#

Okay and add the damage to the dictionary on the weapon?

safe quartz
#

yup

pliant cipher
#

Okay thank you

safe quartz
#

gl

pliant cipher
#

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

safe quartz
#

dont worry its always tough at the beginning

#

gets easier once u learn various techniques and methods for solving problems

rapid helmBOT
#
Python help channel closed

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.