ID:263432
 
Code:
var/list/MonList //Creates the list
for(var/i = 1 to 15) //Loops through 15 elements
MonList[i] = new/mob/monsters/Muscrat //Assigns it to a new instance
MonList[i].name = "Hyper Muscrat" //Expected end of Statement error here
MonList[i].Strength += 500//Expected end of statement here
MonList[i].BattleNum = NPCFightCount //Expected end of statement here


Problem description:
areas.dm:200:error: .: expected end of statement
areas.dm:201:error: .: expected end of statement
areas.dm:202:error: .: expected end of statement

It spits out these errors.
--It won't work at all anyway since you copied from Android Data's example, and it doesn't initialize the list variable.

--There's no need to use the index number like you have; and it won't work either, that syntax is of associated lists. Just use the += operator (or Add() proc), and it will have the desired effect (adding the item to list in the last position), anyway.

--You can't access an object's variables by using it's value directly from the list. This should be pretty obvious, especially with the '.' operator since the compiler can't know what kind of an object is in the list therefore can't know it's variables.
Instead, you need to typecast a var as an object, and store the object reference from the list to it.

Fixed code:
var/list/MonList = new //NOW it actually creates the list
for(var/i = 1 to 15) //Loops through 15 elements
MonList += new/mob/monsters/Muscrat //Adds a new instance
var/mob/M = MonList[i] //stores the mob into a typecasted var
M.name = "Hyper Muscrat"
//...



THOUGH, in this case, you're just creating the object and you don't need to resort to that at all...just do it like this:
var/list/MonList = new //NOW it actually creates the list
for(1 to 15) //Loops 15 times
var/mob/M = new() //creates a new instance of a mob and stores the mob into a typecasted var
M.name = "Hyper Muscrat" //sets the mob's name
//... (set other vars)
MonList += M //NOW, add it (note that if you wanted, you could actually add it at any time, before or during the variables settings