Jump to content

Teleportation


Xaiya

Recommended Posts

I looked through the docs and the appendix, yet I couldn't figure out how to do this. And I don't remember there being a scenario that did what I want.

 

Basically, I want the party to be able to right click on a teleporter. They will be given an option whether or not they want to use the teleporter. And if yes, then they will teleport to a certain location.

 

How can this be done? (And do I need to make a custom terrain script? And if there is one, where is it?)

 

Edit -Not again! I accidentally put this in the BoA forum, and I meant to put it in the BoA editor forum. Oh well. I did it again.

Link to comment
Share on other sites

You need to use a terrain script.

 

If there is only going to be one such portal, you can use the specobj.txt script, which can be found in the Sample Scripts folder (under Terrain Scripts). Just copy it into your scenario folder, assign it to the portal space, and set memory cell 0 to the town state that contains the code for handling the portal.

 

If you're going to have several of them, it's worth making a dedicated terrain script. You can copy the specobj.txt, rename it portal.txt, and replace the "run_town_script" line with the portal handling code.

 

I believe there is a teleport_party command to handle the actual teleportation.

 

Keep in mind that this will only work for teleportation within a town, because you can only move between towns in certain, restrictive situations. If you need to move between towns, you'll probably have to code each portal separately, and you won't be able to make it activate when searched – only when stepped into.

Link to comment
Share on other sites

First of all, I'd like to mention my doubts about activating a terrain by merely clicking it. The old fashioned special encounter pop up functions perfectly. Actually, you have to do this as far as my knowledge is concerned. Just for reference, the following action is in the "town calls" section of the appendix.

 

Anyways, to teleport to another town, the action required is move_to_new_town(Town number, X-coordinate in town, Y- coordinate in town). Basically, if the party selects "yes" in the encounter you only need to include that action. I'm answering on the assumption you already know how to script special encounters.

 

This example demonstrates how to move the party to coordinates (3,42) in town town 5.

 

beginstate14;

//Omitted material

move_to_new_town(5,3,42)

Link to comment
Share on other sites

There is in fact an example of an in-town teleporter in the Za-Khazi Run. There are probably several of them, actually, but I know for sure there is one in the Cunning Crypts (t1Cunning, or something like that). It works as a special encounter instead of as a specobj, but the script will look the same.

 

Specobj will work whenever you search the portal. Kelandon's searchblock is a step up, since it will work if the party steps into the portal as well.

 

Dikiyoba doesn't know why the standard special encounter setup won't work for this portal, since it's what players expect and it's easier to find a working example of. However, if you have a very good reason (like having the portal be in a location where it would be easily triggered by the party passing back and forth) then do it.

Link to comment
Share on other sites

The call "move to new town" is very finicky, you must walk into a placed special encounter rectangle.

 

I have written posts in the Codex about the use of Teleport spells in BoA. You may find inspiration there if you get ambitious.

 

If your teleport moves the party to a town in a different outdoor section, you will need to use change outdoor location in the town's Exit State. Otherwise the party will exit the town and still be in the original out zone.

Link to comment
Share on other sites

Okay, my teleportation script is not working.

I get an "Error- State not found -2" And I do not know what that means.

Here is the script, in case it helps answer my question.

Code:
begintownscript;variables; short body; beginstate INIT_STATE; message_dialog("You enter the cave that Iffy was talking about. But it appears to be a nondescript room. Odd.",""); break;beginstate 20;  teleport_party(16,14,0);break;
Edit -Yes, I put down the special encounter square and typed in "20" (minus the quotes).
Link to comment
Share on other sites

Thankyou, that helped.

And now I tried to put in a message choice thingy.

Only the game says "Error: Unknown command choice in line 26". I tried to figure this one out on my own, yet I can't get it to work.

 

Code:
beginstate 20;  message_dialog("There is a teleporter here. This is the one Iffy was talking about. If you go through, you might not be able to come back that way. Continue?",""); add_dialog_choice(0,"Stay.");add_dialog_choice(1,"Step through the portal."); choice = run_dialog(0); if (choice == 1) set_state_continue(21);break;beginstate 21;teleport_party(16,14,0);break;
Link to comment
Share on other sites

Quote:
Originally written by Iffy:
Do you know of an example of a switch town portal with changing outdoor sections too?
Towns 32 and 33 of Exodus do this. (There's also a cut scene in the middle, but just ignore that code.)

The Land of the Dead has a bunch of town-to-town portals, too, in towns 48, 49, etc.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...