var/list/l1[1] |
The problem is that it believes that there is no mob in the list when I have added it.
ID:830166
Jun 23 2012, 9:13 am
|
||
The problem is that it believes that there is no mob in the list when I have added it. | ||
#1 Jun 23 2012, 9:27 am
|
|
how do I define the size of the list?
| |
#2 Jun 23 2012, 9:28 am
|
|
Actually, "var L[0]" is proper syntax for creating an empty list object.
The problem here is order of operations in the expression, "!m in l1", which reads "(not m) in l1", or "null in l1". This can be fixed by putting parentheses around the "in" operation, like so: !(m in l1) | |
#3 Jun 23 2012, 9:35 am
|
||
That worked. Why doesn't this:
| ||
#5 Jun 23 2012, 10:13 am
|
|
What is it that you expect this thing to do? As far as I can tell, it's just a jumble of nonsense. I'm surprised it even compiles.
You're asking if x and y, objects in the list you're referencing, are in fact in the list, when they HAVE to be in the list in order for the code to even be executing at all. If they WEREN'T in the list, it would never even GET to the if statements. What are you trying to accomplish by constantly moving 2 mobs to the same place forever? | |
#6 Jun 23 2012, 10:49 am
|
|
If I am asking these questions, maybe I am just a novice after all. I thought I was intermediate because I managed to do a lot of things I wanted to do through trial and error. But I don't know many basics and much of my codings are a mess.
| |
#7 Jun 23 2012, 10:51 am
|
|
Which is what we've been telling you, and what I tried to make you understand last night.
| |
#8 Jun 23 2012, 10:58 am
|
||
There, this is the code I managed to get to work:
Just wanted to share that that's all. | ||