[MOD] Portal [Testing]
- Hackeridze
- Member
- Posts: 310
- Joined: Thu Nov 03, 2011 13:35
Fix: for now the activated portal's blocks are not diggable, so you should deactivate portal before removing.
My game: RTMG
GENTOO USER
GENTOO USER
- Hackeridze
- Member
- Posts: 310
- Joined: Thu Nov 03, 2011 13:35
- Hackeridze
- Member
- Posts: 310
- Joined: Thu Nov 03, 2011 13:35
- cisoun
- Member
- Posts: 232
- Joined: Tue Apr 19, 2011 18:56
- GitHub: cisoun
- IRC: cisoun
- In-game: cisoun
- Location: Switzerland
- Contact:
'sup!
Just FYI: you should take a look at Jachoo's fork which provides portals (with acceleration support like Portal). Should be inspiring.
Just FYI: you should take a look at Jachoo's fork which provides portals (with acceleration support like Portal). Should be inspiring.
Not here for a while due to some troubles between my graphic card and Minetest.
Cisoun's Texture Pack | The Conifers Mod (deprecated) | Faenza icons for Minetest |
Website
Cisoun's Texture Pack | The Conifers Mod (deprecated) | Faenza icons for Minetest |
Website
- Hackeridze
- Member
- Posts: 310
- Joined: Thu Nov 03, 2011 13:35
Why?cisoun wrote:'sup!
Just FYI: you should take a look at Jachoo's fork which provides portals (with acceleration support like Portal). Should be inspiring.
My game: RTMG
GENTOO USER
GENTOO USER
Nice ^_^ works great, would be nice to see support for linking portals (i.e. so p1 can only got to p2 because its linked) and also automated tp so when a player stands on the portal it will tp them without having to use commands?
I like the idea of commands as you dont have to be at a portal base to goto another one but If lots of portals are added trying to keep track of which one is which (i.e. names for the command) might get a bit much.
I like the idea of commands as you dont have to be at a portal base to goto another one but If lots of portals are added trying to keep track of which one is which (i.e. names for the command) might get a bit much.
I have patch your code for not have need to stand on the middle stone.
It's probably not better way, but it's my first lines in LUA.
I have modified (check_activated_portal_integrity), and add a function (split)
Thanks
It's probably not better way, but it's my first lines in LUA.
I have modified (check_activated_portal_integrity), and add a function (split)
Code: Select all
function split(str,sep)
local ret={}
local i=1
repeat
--skip the separator repeated at the begining of search
while str:find(sep,i,true)==i do i=i+sep:len() end
--end it if we reached the end of the string
if i>=str:len() then break end
startPos=i
endPos=str:find(sep,i,true)
if endPos then
element=str:sub(startPos,endPos-1)
i=endPos
else
element=str:sub(startPos)
end
table.insert(ret,element)
until endPos==nil
return ret
end
check_activated_portal_integrity = function(pos)
block = split(minetest.env:get_node({x = pos.x,y = pos.y-0.2,z = pos.z}).name, "_")
if block[1]~="portal:baph" then return false; end
-- poc = pos corrected
poc = {z = pos.z+(((math.floor((math.floor(block[2])-1)/3))-1)*-1),y=pos.y,x = pos.x+((math.mod((math.floor(block[2])-1),3)-1)*-1)}
local co = 1
for i=-1,1 do
for j=-1,1 do
p = {x = poc.x+j,y = poc.y-0.2,z = poc.z+i}
if minetest.env:get_node(p).name~="portal:baph_" .. co .. "_act" then return false; end
co = co +1
end
end
return true
end
- jordan4ibanez
- Member
- Posts: 1923
- Joined: Tue Sep 27, 2011 18:44
- GitHub: jordan4ibanez
- IRC: jordan4ibanez
- In-game: jordan4ibanez
- Death Dealer
- Member
- Posts: 1379
- Joined: Wed Feb 15, 2012 18:46
- Location: Limbo
- Contact:
Who is online
Users browsing this forum: No registered users and 11 guests