[Mode] Portals API [portals_api]

Post Reply
User avatar
jordan4ibanez
Member
Posts: 1923
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

[Mode] Portals API [portals_api]

by jordan4ibanez » Post

Portals API

This is an API which allows mod creators to easily create portals using items.

Github

Download

Features:
  • The mod creator can define the wall and filler node of the portal
  • Lightweight and easily accessible to new modders
  • Can be modified to change the height and width of portals
  • Portals have no distinct shape, can be shaped to how you like them
How to use:
  • Build any shape you'd like, as long as there are no other nodes inside your portal besides air
  • Portals have a default height of 30 and radius of 15
Bugs:
  • The central node (the node you click to create portals) must be aligned with the highest node in the portal or there will be air pockets on the top of your portal
  • You must click the lowest central node in the portal or there will be air pockets in the bottom of the portal
  • Portals have no teleportation function, so they just build themselves for now
Image

Image

License: WTFPL

Code: Select all

            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
                    Version 2, December 2004

 Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>

 Everyone is permitted to copy and distribute verbatim or modified
 copies of this license document, and changing it is allowed as long
 as the name is changed.

            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

  0. You just DO WHAT THE FUCK YOU WANT TO.
Attachments
screenshot_20161113_165154.png
screenshot_20161113_165154.png (578.37 KiB) Viewed 791 times
Last edited by jordan4ibanez on Tue Nov 15, 2016 06:34, edited 2 times in total.
hello, am program. do language in rust. make computer do. okay i go now.

User avatar
jordan4ibanez
Member
Posts: 1923
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

Re: [Mode] Portals API [portals_api]

by jordan4ibanez » Post

I've made updates to the mod which allow for single node base and 3d portals. It's showcased in my Hell mod.

Here's a little video of it in action
https://youtu.be/CtrUHT-XOlc
hello, am program. do language in rust. make computer do. okay i go now.

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: [Mode] Portals API [portals_api]

by azekill_DIABLO » Post

hail jordan4ibanez! hail!
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

jakab
Member
Posts: 88
Joined: Mon Aug 15, 2016 17:19
IRC: jakab
In-game: jakab

Re: [Mode] Portals API [portals_api]

by jakab » Post

hi!
this is the perfect mod for me as it is now, but it doesent creates the portal. what do i have to click? where? with what?

User avatar
TechNolaByte
Member
Posts: 465
Joined: Wed May 10, 2017 21:00
GitHub: TechNolaByte

Re: [Mode] Portals API [portals_api]

by TechNolaByte » Post

jakab wrote:hi!
this is the perfect mod for me as it is now, but it doesent creates the portal. what do i have to click? where? with what?
this is an api not feature mod meaning this lays the groundwork for you or other coders to register their own portals easier
The great quest of alchemy neither failed nor attained gold; programmers are those great alchemists who transmute caffeine into code.

jakab
Member
Posts: 88
Joined: Mon Aug 15, 2016 17:19
IRC: jakab
In-game: jakab

Re: [Mode] Portals API [portals_api]

by jakab » Post

[quote="jordan4ibanez"]Portals API


[*]You must click the lowest central node in the portal or there will be air pockets in the bottom of the portal
[*]Portals have no teleportation function, so they just build themselves for now[/list]


i know that this is an api, but as you wrote, i tought it still cretes itself...

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [Mode] Portals API [portals_api]

by texmex » Post

In the showcase Hell mod, these are the two functions registering the portal:

Code: Select all

portal.register_filler("hell:portal_filler","Hell Portal Filler","hell_portal.png","hell_portal_particle.png",{a = 180, r = 128, g = 0, b = 128})

portal.register_portal("default:torch","default:obsidian","hell:portal_filler")
The first one tells us how the filler ("the purple stuff") should look like, the second one tells us that a torch is what activates the portal.

Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 18 guests