Hi,
Sorry. Beginner here, and I imagine my mistake is simple, but I’m not sure how to proceed
I’m trying to dynamically place my characters based on their type. I’d like to eventually select my units dynamically as well, but this is the beginning.
I am trying to set global last in the choice function and then access it in the place function, but it’s always blank when I look at it in the log.
Thanks in advance!
def roundStartFunction(state):
global counter
global last
counter = 0
last = 0
def choiceFunction(state):
type = myTeam[counter % 9][0]
last = type
return type
def placeFunction(state):
n = myTeam[counter % 9][1]
counter += 1
game.log("OUTPUT = ", last)
return 5
if last == "warrior":
return 0
if last == "knight":```