Skip to content
#1495
Auto-translated
I spawned monsters using a loop, so there's no need to get all the monster names, at least that's what I think.
Here's the script:
for x=66,67 do
for y=127,159 do
if IsTilePassable(x, y, 0)==1 then
CreateMonster ("name"..i, 32, 1, x, y, 0,1,2,270)

if x==67 and y==130 then
PlayObjectAnimation ("name"..i, "death", ONESHOT_STILL)
end
if x==67 and y==154 then
PlayObjectAnimation ("name"..i, "death", ONESHOT_STILL)
end
if x==66 and y==155 then
PlayObjectAnimation ("name"..i, "death", ONESHOT_STILL)
end
i=i+1
end
end
end

That is, the result should be monsters standing in a rectangle, some of them dead. However, the game doesn't play the death animation for creatures at the checked coordinates, and the console says that a monster with the name name(...) was not found.
If I put a sleep between CreateMonster and the checks, the monsters don't spawn in a rectangle, but are scattered randomly according to some unclear principle. What could be the problem?

Statistics

Welcome our newest member: dodoD0D0

Users Online 2 users 1418 guests