TOUR
PRICING
HELP
Stencylpedia
Blocks Guide
Sample Games
Developer Center
FORUMS
CHAT
#MADEINSTENCYL
EDUCATION
SIGN IN
×
Welcome back!
Username or E-mail
Password
(
Forgot?
)
C
OMMUNITY
Home
Issue Tracker
Inbox [0]
New Posts
New Replies
Search
Stencyl Community
→
Stencyl
→
Ask a Question
→
Issues with mapping and lists
Pages:
1
Issues with mapping and lists
johnjanowskibsc
Posts: 158
June 19, 2021, 06:31:58 am
Hi,
I have been struggling a little with an issue with maps.
Fir the game I am making I have used a map to store 11 teams (from a list) and points from a list. It works. I have been able to sort the list according to the points total.
However, when I want to empty the list and repopulate with a new set of team names and new points I have found that sporadically it will only store 10 teams not 11.
I have tried using other lists to populate the map but come across the same issue. I have attached the output issues and what they look like.
Has anyone come across this issue before and how did they solve it? Any help would be great!
Thanks
John
yoplalala
Posts: 1632
June 19, 2021, 07:11:11 am
How many teams are there in League ?
I would set randomVal between 0 and the number of items in League. (not 20)
Suppose you are not lucky and everytime you get a 20 from the random val
you'll have team20, then null , null, null null ....
johnjanowskibsc
Posts: 158
June 19, 2021, 10:51:48 am
I've changed the randomVal so when I've chosen the second team I am choosing from 19 teams, not 20 as one has gone from the list. However, this didn't make a difference as I was using a "repeat until team2 =not null" etc.
Its funny that it should work the majority of the time then occasional it decides to omit just one value but not insert any NULL values.
yoplalala
Posts: 1632
June 19, 2021, 10:59:38 am
No I mean you should do randomVal to ( random integer between 0 and ( number of items in ( league)) and use blocks.
You should use the block null , not write "null" . ( Because it thinks it the text "null")
johnjanowskibsc
Posts: 158
June 19, 2021, 01:08:42 pm
Thanks for taking an interest and answering my question.
After lots of digging I found that the issue was in assigning the computer teams against my team. If my team was to be the last one chosen in the list then it removed a team from the league list...not sure why. I've just readjusted the upper limit to 1 less for my team. I've cycled through 30 new seasons and the bug hopefully has gone...
Just read this back and am pretty sure what I have just said doesn't make sense
Pages:
1