Multiple lists

johnjanowskibsc

  • Posts: 116
Hi,

I'm making a game where the player is assigned a team from a list. The cycle through 9 games against 9 other teams and if their team is above position 7 in the list then it dumps  that list (as in the game no longer looks at that list) and then chooses a new team from a new list and populates a map with 9 other teams from a new list. This is to model the scenario of escaping relegation with 1 team and then getting hired by another club in a higher league.

Only snag is the game likes the first list but when I try to implement the new list and start up a new season the game crashes. I have created a game attribute called seasontranistion to call up the use of a new list.

if season transition = 0 then
Select 9 teams from list1
Otherwise if season transition = 1 then
Select 9 teams from list2

I used a number attribute as I hope to build in 3 other leagues.

I would send through some code but its getting quite big! Any help with this would be great! Thanks

Luyren

  • *
  • Posts: 2584
Lists crashing can either be:
1- Your list is hidden and you didn't initialize it (set it to create new list before doing anything with it);
2- You are trying to access something in that list that has a null value, and highjinks ensue.

Without seeing the code, that's all I got.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
Twitter

johnjanowskibsc

  • Posts: 116
Hi Luyren,

Yes it was option 2 - Before starting the season I was resetting all teams in the league to a null value. However I wrote "null" meaning that the code couldn't flood the new league with teams and was crashing as it was reading null as a string. I eventually sussed this and have found the dull "null" block. Now working as hoped!

Thanks for your help