At a standstill with coding


So, I’m alive. I’ve been writing super hard core and decided to put everything in my demo out at once. However there is a problem I have encountered. A scene that allows the MC to get a huge star boost isn’t working the way I want. I’m not even sure how I would code it.

Basically if these four generals you speak to are not drunk, then you have a chance to get stat increases. However you must be on good standing with the leader of these generals. My problem is I have three possible outcomes based on 3 different relationship values.

Over 60 is full +5 to all stats

50-60 is +2

Under 50 is none at all.

I’ve tried a lot of things. Making variables true or false. *if then *if (blank=blank), etc and it always reverts to the middle one for some reason.

I’ve been using
*if (Leifrep>60)
*goto alot
*if (Leifrep>50)
*goto kinda
*goto none

Am I doing it all wrong?


Can you copy paste your actual code? This should work:

*if relationship > 60
  *set stats + 5
  *goto blah
*elseif relationship > 50
  *set stats +2
  *goto blah
  *goto blah


Well, since @RETowers already offered the solution, I’ll point out the mistake you made from that code, @Arasia_Valentia. It’ll be good for us to learn from our mistake, right?

So… hmm… yeah :eyeglasses:

Is the variable Leifrep actually started with a cap? And not leifrep?


Assuming your code is like RETowers, then you are doing it right. In that case, you want to make sure that the stat Leifrep can be greater than 60 or less than 50 at that point. That means checking your earlier options where you have edited that stat value.


You can also run randomtest and check to see there are line hits there. If there aren’t, you can be fairly certain that your stats can’t get that high.

*if (Leifrep>59)
   *goto alot
*if ((Leifrep>50) and (Leifrep <60))
   *goto kinda
   *goto none


Halel, I return. It worked, so thank you all.


Yeah, remembering the range is very important.


yeah :grin: