Jump to content

Trap Doors


Bubbles

Recommended Posts

Taken from the first reply is this code.

 

beginstate 11; //Teleport to Basement

if (get_flag(0,6) == 1)

move_to_new_town(1,13,17);

break;

 

Now let me explain it.

 

beginstate 11; (each chunk of code in a scenario is usually part of a state. (The exceptions are the data scripts, but you don't have to worry about that.) The beginstate identifys that a new state has begun and the number is the number of the state.)

 

I'll skip the if statment because that is not necessary for the most basic use. If you wanted the trap door to only be open some of the time then you would use an if statment.

 

move_to_new_town(1,13,17); (This is the command that moves the party. The first number is the town number the party appears in. If you don't want the party to go to a different town, make the town number the same as the town number of where the trapdoor is. The second number is the x cooridinate where the party appears, and the third number is the y cooridinate where the party appears. If the x and y cooridinate parts doesn't make sense to you then you should go back and read the manual some more as their used in a good deal of calls.)

 

break; (This ends the state. It must be at the end of every state thats defined or the script will not run.)

 

Now your code would look like this with the state number and the 3 numbers inside the move_to_new_town adjusted for your own scenario.

 

beginstate 11;

move_to_new_town(1,13,17);

break;

 

Place it inside the townscript for the town the trapdoor is in, and in the editor, place a special encounter over the trapdoor with the same number as the state you used. (The special encounter button is the one the looks like a black dot.) If you don't know how to make a townscript again its covered in the manual.

 

I hope that helps.

 

PS: Also you may want to check out this link

Link to comment
Share on other sites

You have the code that you want to execute in a defined state in your town script, and you refer to that state by creating a special encounter rectangle in the editor. When you create an encounter with the button that looks like a big dot, a dialog should come up automatically to ask you for what state you want it to be linked to.

 

And you set the town's script name in the Town Details box.

Link to comment
Share on other sites

Ideally, you center the editor's screen around the spot that you want to know the coordinates of and then read them from the thing in the lower right-hand corner (just underneath the Drawing Mode). If you're looking at a square too far over to the side for you to center the screen on it, then count. You can count from the center of the screen or from the edges of the town (the first row on top is 0, and the first column on the left is 0).

 

If you have a Mac, both Khoth's BetterEditor and Isaac's 3D editor have better ways of doing this, but if you have a PC, you're pretty much stuck with that.

 

This was a much longer answer than necessary. *sigh*

Link to comment
Share on other sites

ok. i put a special encounter on the trap door and gave it 11 as the state(special node, whatever). then i attached the script to the town that is supposed to have the player go to(it is written EXACTLY LIKE THIS):

begintownscript; variables; body; beginstate 11; move_to_new_town=(2,16,24); break;

when i walk on the trap door in the first town nothing happens. I also tried attaching the script to the town the trap door was in and that didnt work.HELP!!!

Link to comment
Share on other sites

It's meant to go in the town the trapdoor is in.

 

Did you get any errors when you tried stepping into the rectangle with the script on it? That might help us track down your problem.

 

By the way, you, uh, did separate all those lines by line breaks in the actual script, I hope?

Link to comment
Share on other sites

Line breaks. As in, returns. It should look like this:

Code:
begintownscript; variables; body; beginstate 11;     move_to_new_town(2,16,24); break; 
This isn't mandatory -- as far as I know -- but it looks really, really ugly and confusing if you don't do it.

 

Also, did you go to Town Details and actually name the town script that goes with the town?

Link to comment
Share on other sites

Quote:
Originally written by Bubbles:
ok one more thing how do i find x and y coordinates? start counting from the center?
you can also put an area description on the spot, the trapdoor shall be, to get the coordinates:
use the button "room rectangle", i think, click two times on the field the trapdoor is in and look in the towns menue in area descriptions. there you can read the coordinates and delete the area description, cause you only needed it for getting the coordinates!
Link to comment
Share on other sites

ok now, in the tunnel, i have the trap door ladder and stairs leading to the surface.

1. how do i put 2 of the state 11's in one townscript?how will the computer know I want the ladder going to the trap door and the stairs to the surface?

2.how do i make a party appear on the surface? the move to town wont work.

Thanks in advance

Link to comment
Share on other sites

Ah, yes, this is slightly harder. Don't put two state 11's, first of all. Copy and paste and change the second state to state 12 if you want a second state that does basically the same thing as the first. From that point you can change the move_to_new_town call or whatever.

 

However, there is no call to take the party directly outdoors, which appears to be what you're trying to do. As far as I know, the only way to go from town to outdoors is to walk outside the town boundaries. You can get around this in a couple of ways, the most obvious of which is to have the stairs lead to a cave exit town (basically just a very small cave with the town boundaries right outside), so that the party can walk out from there. In that case, you'd just have another move_to_new_town in state 12 taking the party to the correct location in the new town -- copy, paste, and all you have to do is change the arguments (the stuf inside the parentheses).

Link to comment
Share on other sites

its just not working i have this script:

begintownscript;

variables;

body;

beginstate INIT_STATE;

break;

beginstate EXIT_STATE;

break;

beginstate START_STATE;

break;

beginstate 11;

move_to_new_town(1,4,5);

break;

beginstate 12;

move_to_new_town(4,16,28)

break;

the state 11 moves me from the ladder to the trap door and 12 goes from the stairs to an outdoor town.It wont do anything. I used state 11 in another script. does that matter?

Link to comment
Share on other sites

Uh, then I'm pretty baffled. All you should need to do is:

  • Have a properly formatted scenario, scenario script, and folder (made automatically by the editor, so probably not the problem)
  • Have a properly formatted town script in the same folder
  • Have the appropriate state in that script (state 12, in this case)
  • Put a blue special encounter rectangle on the appropriate spot in the terrain
  • Tell BoA which script to use for the town in the Town Details menu item
  • Save all the preceding items (save the scenario, text files, etc)
  • Enter that scenario using the BoA app -- it may help to start over fresh if you've made a significant change since the last time you entered the scen
  • Step on the spot with a PC

At that point, the script state should run. I'm thinking the problem may be with the last step... is the terrain blocked in some way? Are your stairs on the proper level? Can you actually step on this space?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...