basic rpg help, update text box
Hi, I have a question about how to use this function that I have made. I am able to call the update to the text box in the firstencounter method, but that is only when I have the (Form1 temp) set up in the method. In my combat method, it won't let me use Form1 temp because I need to assign it a value like everything else. What value should I give it in the parameters for Combat to make it work? I tried "this" and it didn't work because of the static method.
16 Replies
extra screenshots for further clarity
ok actually i think i got it i set temp to itself
ok now my program wont stop crashing..
With what error?
literally no error thats why im so confused
when i try to advance to the combat section of the game it just freezes and wont run
even after going back to how i had the program previously
hrmm....
Are you debugging it / setting breakpoints so that you can run through it?
$debug
Tutorial: Debug C# code - Visual Studio (Windows)
Learn features of the Visual Studio debugger and how to start the debugger, step through code, and inspect data in a C# application.
yeah im trying breakpoints rn
ok ok i dont thinnk im using the debugger lemme see
ok i tried debugging and nothing still came up.. gah
ok i think it has to do with the temp variable i used
i got it i think? i think a while loop is causing the game to freeze?
yes it is
why would this be making my game freeze
If nothing is updating the value of h then yes it will just loop infinitely
well that was the idea
for it to stay like that until the player pushes a button (h is the enemy health)
but like the battle interface won’t even Start when this code exists
What do you mean "stay like that" don't you just want to set the player.buttonmode, and call the UpdateDialogueBox method, those sound like they only need to be done once?
the idea was to wait until the player inputs a button
as they can attack or defend or run
buttonmode dictates what layout of buttons they can access which in this situation is the combat ones
but you are right about those only needing to be updated once..
so im still stuck on this
if i turn it into an if statement it runs fine
but im trying to have the program wait until a button is pressed by the player, but when i have it as the while loop the program immediately freezes upon trying to run this code
Are you saying the program carries on and does something else unless you have the whole loop in place?