Help with my points system!

Hey everyone! I have a question about my point system.

So basically I have 2 separate point systems going… and when I try to do code similar to the code below, I always end up reading the “else” branch.
The code in question:
if (CHAR1 > CHAR2) {

} elif (CHAR1 < CHAR2) {

} else {

}

I noticed that this changes if I have at least 1 point with each character… but is there any way to fix this without going into the beginning of my story and adding 1 point to each character and then rewriting the sections where I calculate points?

Thanks so much!

1 Like

I’m not an expert with points yet (experimenting with them now) but just going off how if/elif/else typically works, delete the elif and remove the CHAR1 < CHAR2, and just put the information for that option in else. So it would look like this:

If (CHAR1 > CHAR2) {

(Dialogue for CHAR1 > CHAR2 option goes here)

} else {

(Dialogue for CHAR2 > CHAR1 option goes here)

}

I would think that you may not need that second code just because it’s only between two characters, if that makes sense.

But again, I’m no expert, just taking my knowledge from standard if/elif/else. I hope this helps :blush:

1 Like

Thank you so much! I’ll go give this a try now :smile:

1 Like

Ok that sort of worked. I only ran into problems when the two characters had equal points. Idrk what to do; I think I’m just going to add that one point in the beginning and be done with it lol. But thank you for your help, I really appreciate it!

1 Like

Is it possible you can include CHAR1 = CHAR2 for them having equal points?

If (CHAR1 > CHAR2) {

}elif (CHAR2 > CHAR1) {

} else {

(CHAR1 = CHAR2 scenes here)

}

If that doesn’t work either, I’m sorry!! I hope you’re able to make it work though! Coding gets so tricky sometimes :sweat_smile::sob:

1 Like

I’ll give it a shot haha! But it can get super frustrating super fast! Sometimes I have to take a two day HIATUS just so I don’t throw my laptop

1 Like

I feel ya there! :laughing::laughing: I Google my questions a lot to see if any related topics from the forums pops up. That’s really helped me a lot over the years!

1 Like

script has sometimes problem to read the points if the reader makes no choice to gain points.

to awoid this add on the start of the story

@CHAR1 =0
@CHAR2 =0

this way it will for sure register the point system even if the reader doesn’t make choice to gain any points.

2 Likes

This worked!! Thank you so much!!!

2 Likes

if you will have similar problem in next chapters (usually only in preview on the portal)

add on the start of new episode
@CHAR1 +0
@CHAR2 +0
this way it will not change the points reader have and it will have the same efect (do not use in future episodes = because that would change the points reader has gained)

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.