(not a bug) Double teleporters

This forum is for the Lua scriptable clone of DM/CSB called Dungeon Strikes Back by Sophia. Use DSB to build your own highly customised games.

Moderator: Sophia

Forum rules
Please read the Forum rules and policies before posting.
Post Reply
kaypy
Artisan
Posts: 171
Joined: Sun Jan 19, 2014 7:11 am

(not a bug) Double teleporters

Post by kaypy »

More from the "why would you even do this?" list, but...

If the party hits a tile with multiple teleporters, they will be transported to each target location in turn, finishing instantly at the final teleporter's destination but triggering any events in the tiles they momentarily occupy.

Is this correct behaviour? Or should the first teleporter removing the party mean that the others are "out of range"?

---

Code: Select all

dsb_text2map(0, 5, 5, 100, 1, {
"10000",
"10110",
"11110",
"00110",
"00000"} )
dsb_level_wallset(0, wallset.default)
dsb_add_champion(1, "test", "port_mophus", "TEST", "", 1000, 1000, 1000, 400, 400, 400, 400, 400, 400, 400, {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0})
ch_exvar = {
}
dsb_spawnburst_begin(8)
dsb_spawn(7, "trigger", 0, 2, 1, 4)
dsb_spawn(1, "teleporter", 0, 3, 2, 4)
dsb_spawn(2, "trigger", 0, 3, 2, 4)
dsb_spawn(3, "trigger", 0, 3, 2, 4)
dsb_spawn(4, "teleporter", 0, 3, 2, 4)
dsb_spawn(6, "button_blue", 0, 1, 3, 0)
dsb_spawn(8, "trigger", 0, 2, 3, 4)
dsb_spawn(5, "function_caller", 0, 3, 3, 4)
exvar = {
[1] = { y = 1,
x = 2,
opby_thing = true,
opby_party = true },
[2] = { opby_party = true,
const_weight = true,
target = 5,
msg = 100001,
opby_thing = true },
[4] = { y = 3,
x = 2,
opby_thing = true,
opby_party = true },
[5] = { m_d = "ontopittrigger",
m_a = "offpittrigger" },
[6] = { func = "printgap" },
[7] = { func = "marker",
opby_party = true },
[8] = { func = "marker",
opby_party = true },
}
dsb_spawnburst_end()
EDITOR_FLAGS = 255
dsb_champion_toparty(0, 1)
dsb_party_place(0, 0, 0, 0)

Code: Select all

function ontopittrigger()
	__log("ONTOPITTRIGGER")
	dsb_write(debug_color, "ONTOPITTRIGGER" )
end

function offpittrigger()
	__log("OFFPITTRIGGER")
	dsb_write(debug_color, "OFFPITTRIGGER" )
end

function printgap()
	__log("---")
	dsb_write(debug_color, "---" )
end

function marker()
	__log("MARK")
	dsb_write(debug_color, "MARK" )
end
Friends don't let friends eat worm round
User avatar
Sophia
Concise and Honest
Posts: 4239
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Double teleporters

Post by Sophia »

I'm going to go ahead and rule this correct behavior.

While it may be bizarre from a "realistic physics" standpoint, we're talking about teleportation so I don't think that there's much room to complain. :mrgreen:

From the perspective of DSB's mechanics it makes perfect sense: The party steps onto the square, which actuates everything on that square. Each teleporter's code is executed in turn, and each one moves the party to its destination. The fact that the party is no longer at the initial square is not considered because the actuators have all already been triggered.

I don't think it's prudent to insert code to try to eliminate this corner case that may end up breaking (or just needlessly complicating) something else.
kaypy
Artisan
Posts: 171
Joined: Sun Jan 19, 2014 7:11 am

Re: (not a bug) Double teleporters

Post by kaypy »

Does the same apply to teleporters on pits? Due to the whole pit delay thing, you wind up being teleported away, then dragged back and thrown down the pit. (I was a bit worried that it might teleport you, then send you down a level from the portal destination, but you always wind up under the pit)

I am willing to accept the correct behaviour being "Don't put that in a dungeon, you sick monster" 8-) This side of things was me just poking around to try to figure out the trigger-on-a-pit thing...

Code: Select all

dsb_text2map(0, 5, 5, 100, 1, {
"10011",
"10010",
"11111",
"10010",
"10011"} )
dsb_level_wallset(0, wallset.default)
dsb_text2map(1, 5, 5, 0, 1, {
"10111",
"10010",
"10011",
"00010",
"11111"} )
dsb_level_wallset(1, wallset.default)
dsb_text2map(2, 5, 5, 0, 2, {
"11101",
"01001",
"01111",
"00001",
"00001"} )
dsb_level_wallset(2, wallset.default)
dsb_add_champion(1, "test", "port_mophus", "TEST", "", 9990, 1000, 1000, 400, 400, 400, 400, 400, 400, 400, {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0})
ch_exvar = {
}
dsb_spawnburst_begin(22)
dsb_spawn(7, "teleporter", 0, 4, 0, 4)
dsb_spawn(8, "pit", 0, 4, 0, 4)
dsb_spawn(20, "torch", 0, 1, 2, 0)
dsb_set_charge(20, 500)
dsb_spawn(22, "torch", 0, 1, 2, 1)
dsb_set_charge(22, 500)
dsb_spawn(21, "torch", 0, 1, 2, 3)
dsb_set_charge(21, 500)
dsb_spawn(9, "pit", 0, 4, 2, 4)
dsb_spawn(10, "pit", 0, 4, 2, 4)
dsb_spawn(1, "stairsdown", 0, 0, 4, 4)
dsb_spawn(11, "pit", 0, 4, 4, 4)
dsb_spawn(12, "teleporter", 0, 4, 4, 4)
dsb_spawn(2, "stairsdown", 1, 0, 0, 4)
dsb_spawn(3, "stairsdown", 1, 2, 0, 4)
dsb_spawn(4, "stairsup", 1, 0, 4, 4)
dsb_spawn(5, "stairsup", 2, 0, 0, 4)
dsb_spawn(6, "stairsup", 2, 2, 0, 4)
exvar = {
[7] = { y = 2,
opby_party = true,
x = 0 },
[12] = { y = 2,
x = 0,
opby_party = true },
}
dsb_spawnburst_end()
EDITOR_FLAGS = 255
dsb_champion_toparty(0, 1)
dsb_party_place(0, 0, 0, 0)
(The trigger-on-a-pit thing, on the other hand, I genuinely ran into. On the one hand I have closable pits and on the other a trigger based mechanism that makes gor-faces zap the party repeatedly if they stand on the tile in front too long. There didn't *seem* to be any reason to prevent gor-faces looking at pits...)
Friends don't let friends eat worm round
Post Reply