HenryRichard wrote: ↑Tue Oct 09, 2018 8:40 pm
ClapClop wrote: ↑Tue Oct 09, 2018 6:21 pm
HenryRichard wrote: ↑Sun Sep 03, 2017 11:24 pm
You can't currently. You'll have to do it with Lua.
I did not understand, how I use lua to be able to use the warp vertically
Throw something like this in your onTick() function. You'll have to change the coordinates to match your section's, and probably limit it to the current section as well.
Code: Select all
if player.y >= -140000 then --coords
player.y = -140632
end
if player.y <= -140638 then
player.y = -140004
end
This code is from Hypnosis Redo - I don't know if Enjl wants credit for this or not (more likely than not he doesn't care, but I'd be on the safe side).
Someone in codehaus needed vertical wrap recently so here's a more dynamic variant:
Code: Select all
local _scrollSections = {0, 1, 2}
local scrollSectionMap = {}
for k,v in ipairs(scrollSections) do
scrollSectionMap[v] = true
end
local allNPCIDs = {}
for i=1, 300 do
allNPCIDs[i] = i
end
function onTickEnd()
local checkedNPCSections = {}
for _,p in ipairs(Player.get()) do
if scrollSectionMap[p.section] then
local s = Section(p.section)
local b = s.boundary
local sheight = b.bottom - b.top + 32
if p.y > b.bottom + 16 then
p.y = p.y - sheight
elseif p.y + p.height < b.top - 16 then
p.y = p.y + sheight
end
if not checkedNPCSections[p.section] then
for k,v in ipairs(NPC.get(allNPCIDs, p.section)) do
if v:mem(0x12A, FIELD_WORD) > 0 then
if v.y > v.bottom + 16 then
v.y = v.y - sheight
elseif v.y + v.height < v.top - 16 then
v.y = v.y + sheight
end
end
end
end
checkedNPCSections[p.section] = true
end
end
end
Just adjust scrollSections with the section numbers you want to scroll. Remember that section numbers are 0-indexed so Section 1 in the editor is Section 0 in game.
No credit needed.