C
C#6mo ago
chronos

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.
No description
16 Replies
chronos
chronos6mo ago
No description
No description
chronos
chronos6mo ago
extra screenshots for further clarity ok actually i think i got it steamhappy i set temp to itself ok now my program wont stop crashing..
SinFluxx
SinFluxx6mo ago
With what error?
chronos
chronos6mo ago
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....
SinFluxx
SinFluxx6mo ago
Are you debugging it / setting breakpoints so that you can run through it? $debug
MODiX
MODiX6mo ago
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.
chronos
chronos6mo ago
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
chronos
chronos6mo ago
No description
chronos
chronos6mo ago
why would this be making my game freeze
SinFluxx
SinFluxx6mo ago
If nothing is updating the value of h then yes it will just loop infinitely
chronos
chronos6mo ago
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
SinFluxx
SinFluxx6mo ago
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?
chronos
chronos6mo ago
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..
chronos
chronos6mo ago
No description
chronos
chronos6mo ago
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
SinFluxx
SinFluxx6mo ago
Are you saying the program carries on and does something else unless you have the whole loop in place?