
What's the best way (in a script) for opening up lots of doors (like all 56 doors in a dungeon or 30 doors in a door maze). Furthermore, can you open up every door with one script regardless of the door type?
Thanks for any assistance as always.

Code: Select all
grimq.fromAllEntitiesInWorld().where(grimq.isDoor):foreach(function(door) door:open(); end)
Code: Select all
for door in grimq.fromAllEntitiesInWorld().where(grimq.isDoor):toIterator() do
door:open()
end
Code: Select all
for level = 1, getMaxLevels() do
for entity in allEntities(level) do
if (entity.setDoorState ~= nil) then
entity:open()
end
end
end
Code: Select all
for i in allEntities(party.level) do
if i.id:sub(1,4) == "door" then
if i:isOpen() then
i:close()
else
i:open()
end
end
end
Code: Select all
for i in allEntities(party.level) do
if i.class == "Door" then
if i:isOpen() then
i:close()
else
i:open()
end
end
end
Code: Select all
for i in allEntities(party.level) do
if i.class == "Door" then
i:open()
end
end
Code: Select all
for i in allEntities(party.level) do
if i.class == "Door" then i:open() end end
Code: Select all
for i = 1,4 do
party:getChampion(i):modifyAttackPower(20)
Code: Select all
for i = 1,4 do
party:getChampion(i):modifystat("attack power", 20)
Code: Select all
function yadda_yadda()
spawn("poison_cloud", 2, 20, 13, 1)
spawn("poison_cloud", 2, 19, 13, 1)
spawn("poison_cloud", 2, 21, 13, 1)
spawn("poison_cloud", 2, 18, 13, 1)
spawn("poison_cloud", 2, 20, 14, 1)
spawn("poison_cloud", 2, 19, 14, 1)
spawn("poison_cloud", 2, 21, 14, 1)
spawn("poison_cloud", 2, 18, 14, 1)
-- repeat ad nausam
end
Code: Select all
-- Spawn a grid of the same type of entity.
-- @param entityName The entity to spawn.
-- @param level The level on the dungeon to spawn the entities on
-- @param minX The first X coordinate to spawn in
-- @param maxX The last X coordinate to spawn in
-- @param minY The first Y coordinate to spawn in
-- @param maxY The last Y coordinate to spawn in
-- @param facing All entities will be spawned with this facing
--
function spawn_grid(entityName, level, minX, minY, maxX, maxY, facing)
for x=minX, maxX do
for y=minY, maxY do
spawn(entityName, level, x, y, facing);
end
end
end
Code: Select all
-- Open all doors in the region between (minX, minY) and (maxX, maxY) on the given floor.
--
function open_all_doors(level, minX, minY, maxX, maxY)
for x = minX, maxX do
for y = minY, maxY do
for e in entitiesAt(level, x, y) do
if ( e.class == "Door" ) then
if ( e:isClosed() ) then
e:open();
end
end
end
end
end
end
Code: Select all
function PoisonRoom("poison_cloud", 1, 15, 15, 17, 17, 1) -- to fill a room from 15;15 to 17;17 with poison
for x=15, 17 do
for y=15, 17 do
spawn("poison_cloud", 1, 15, 15, 1) --This is where I think I have no idea what I'm doing
end
end
end
Code: Select all
function PoisonRoom("poison_cloud", 1, 15, 15, 17, 17, 1) -- still no idea why this is here though
for x=15, 17 do
for y=15, 17 do
spawn("poison_cloud", 1, x, y, 1) -- putting x and y in here which have been previously defined?????????
end
end
end