Page 1 of 1

Displaying a Variable calling from Alternating Variables.

Posted: Tue Aug 03, 2021 1:17 pm
by Chendzeea
I need to Display the [Survival Points aka SP] of an Active Character since they can be selected at will. Example "[POV] has [SP] Remaining."

$ VICKY_POV = True
$ LEX_POV = False
$ Vicky_SP = 1
$ Lex_SP = 0

if VICKY_POV == True:
$ POV = "Vicky"
elif LEX_POV == False:
$ POV = "Lex"
else:
pass
################################### The Problem is Below ##############################

This doesn't work obviously, but it illustrates how I was trying to get to work.
if VICKY_POV == True:
SP = $ Vicky_SP
elif LEX_POV == True:
SP = $ Lex_SP
else:
pass

Re: Displaying a Variable calling from Alternating Variables.

Posted: Tue Aug 03, 2021 8:18 pm
by hell_oh_world
Using labels you can do it like this...

Code: Select all

default pov = "Vicky"
default vicky_sp = 0
default lex_sp = 1

label display(pov, sp):
   "[pov] has [sp] Remaining."
   return

label start:
  python:
    if pov == "Vicky": sp = vicky_sp
    elif pov == "Lex": sp = lex_sp
    
  call display(pov, sp)

Re: Displaying a Variable calling from Alternating Variables.

Posted: Tue Aug 03, 2021 8:26 pm
by Chendzeea
Yeah I've been going over tutorials. I was going about this wildly wrong. Sorry to bother everyone. It's just difficult sorting through all the sea of awkward tutorial and out of date information. Thank you.