Author Topic: Conecting teleporters with scripts.  (Read 437 times)

Minefran12

  • Newbie
  • *
  • Posts: 12
    • View Profile
Conecting teleporters with scripts.
« on: February 03, 2018, 08:52:24 pm »
I have to conect more than 100 teleporters with their destination and i was wondering if i can do it with the scripts of the map insted of manualy in each teleporter.

Diarandor

  • Hero Member
  • *****
  • Posts: 1021
  • Cats are cool! (ΦωΦ)
    • View Profile
Re: Conecting teleporters with scripts.
« Reply #1 on: February 03, 2018, 10:21:21 pm »
The usual way to do this is to choose the destination directly from the Map Editor. You can also do it in the map script if you prefer, but the previous option is usually much better: it is easier/faster to find that option in the properties window than to look into the code of a script. However, if you are generating maps randomly, you should probably choose these properties from your code.
“If you make people think they're thinking, they'll love you. But if you really make them think, they'll hate you.”

Minefran12

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Conecting teleporters with scripts.
« Reply #2 on: February 03, 2018, 10:31:58 pm »
I'm not generating aleatory maps, in fact this is for a laberint puzzle with 24 rooms and exactly 90 teleporters and destinations and beaouse is all the same map i will prefer to do it by code to have it more accessible to change, but i looked in the teleporter documents and i didin't find how to do it.

Diarandor

  • Hero Member
  • *****
  • Posts: 1021
  • Cats are cool! (ΦωΦ)
    • View Profile
Re: Conecting teleporters with scripts.
« Reply #3 on: February 04, 2018, 12:44:48 am »
If all is in 1 map, you should probably use separators instead.
“If you make people think they're thinking, they'll love you. But if you really make them think, they'll hate you.”

Christopho

  • Administrator
  • Hero Member
  • *****
  • Posts: 1140
    • View Profile
Re: Conecting teleporters with scripts.
« Reply #4 on: February 04, 2018, 09:02:20 am »
Teletransporters have a scripting API that allows to configure them from a Lua script.

Minefran12

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Conecting teleporters with scripts.
« Reply #5 on: February 04, 2018, 11:15:01 am »
I'm already using separators, but i think the feeling of being lost is bigger and easier to maka with the teleporters and it makes the puzle harder to solve.
Can someone say me the coding to configure them?
Thank you.

Diarandor

  • Hero Member
  • *****
  • Posts: 1021
  • Cats are cool! (ΦωΦ)
    • View Profile
Re: Conecting teleporters with scripts.
« Reply #6 on: February 04, 2018, 11:37:35 am »
I'm already using separators, but i think the feeling of being lost is bigger and easier to maka with the teleporters and it makes the puzle harder to solve.
Can someone say me the coding to configure them?
Thank you.
Just read the Lua API:
http://www.solarus-games.org/doc/1.5/lua_api_teletransporter.html
http://www.solarus-games.org/doc/1.5/lua_api_separator.html
“If you make people think they're thinking, they'll love you. But if you really make them think, they'll hate you.”