LoG2 console changes (components)
Posted: Thu Jan 15, 2015 6:19 am
When I was stuck I sometimers uses these functions in LoG1, but with LoG2 they didn't work anymore.
Corrected forward teleport function (st is the number of steps forward):
The open door function (checking front and back side of a door) not working yet:
Corrected forward teleport function (st is the number of steps forward):
Code: Select all
function Ghost(st)
fa = party.facing;
le = party.level;
xx = party.x;
yy = party.y;
zz = party.elevation;
dx, dy = getForward(fa);
party:setPosition(xx + dx * st, yy + dy * st, fa, zz, le)
endCode: Select all
function Sesame()
fa = party.facing;
le = party.level;
xx = party.x;
yy = party.y;
dx, dy = getForward(fa)
for e in entitiesAt(le, xx, yy) do
if e.setDoorState and e.facing == fa then e:open()
end
end
for e in entitiesAt(le, xx + dx, yy + dy) do
if e.setDoorState and e.facing == (fa + 2) % 4 then e:open()
end
end
end