Trap Doors

Error message

Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /var/www/pied-piper.ermarian.net/includes/common.inc).

Pages

AuthorTopic: Trap Doors
Apprentice
Member # 4895
Profile #0
How do you you make trap doors take people places?
I want the PC to go to the trap door which takes him(or her) to a tunnel to a stair way which leads to the surface. Do you need to use a special encounter or what?
Thanks

--------------------
The raving lunatic IS HERE!!!
Posts: 18 | Registered: Tuesday, August 24 2004 07:00
Apprentice
Member # 416
Profile #1
That's exactly it. The special encounter does it, I used the following:

beginstate 11; //Teleport to Basement
if (get_flag(0,6) == 1)
move_to_new_town(1,13,17);
break;

The flag is because it is a trap door that has to be open.

Hope this helps.

--------------------
--
KMannKoopa

"You're so much like me, I'm sorry"
Posts: 33 | Registered: Tuesday, December 18 2001 08:00
Apprentice
Member # 4895
Profile #2
oh. crap. thanks for that. I'm a n00b to scripting and dont really understand it is there anything else important i should understand? and is it a terrain script? if so how do i use it?
thanks

--------------------
The raving lunatic IS HERE!!!
Posts: 18 | Registered: Tuesday, August 24 2004 07:00
Agent
Member # 2820
Profile #3
You could make a custom trapdoor terrain and attach a trapdoor script to it with 3 memory cells for where the trapdoor would lead.

But otherwise you could just use a normal spec enc.

--------------------
Thuryl: I mean, most of us don't go around consuming our own bodily fluids, no matter how delicious they are.
====
Alorael: War and violence would end if we all had each other's babies!
====
Drakefyre: Those are hideous mangos.
Posts: 1415 | Registered: Thursday, March 27 2003 08:00
Apprentice
Member # 4895
Profile #4
ummmm... see im a n00b and got no idea how to do that. is there some sort of number to give the script and could i use the script from the first post?

--------------------
The raving lunatic IS HERE!!!
Posts: 18 | Registered: Tuesday, August 24 2004 07:00
Warrior
Member # 250
Profile #5
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
Posts: 61 | Registered: Saturday, November 3 2001 08:00
Apprentice
Member # 4895
Profile #6
ah thank you very much! i understood that completely!
EDIT: How do i attach the script, or more to the point, whats a special node? Is that the state thats called?

[ Wednesday, August 25, 2004 09:10: Message edited by: Bubbles ]

--------------------
The raving lunatic IS HERE!!!
Posts: 18 | Registered: Tuesday, August 24 2004 07:00
Agent
Member # 2820
Profile #7
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.

--------------------
Thuryl: I mean, most of us don't go around consuming our own bodily fluids, no matter how delicious they are.
====
Alorael: War and violence would end if we all had each other's babies!
====
Drakefyre: Those are hideous mangos.
Posts: 1415 | Registered: Thursday, March 27 2003 08:00
Apprentice
Member # 4895
Profile #8
ok one more thing how do i find x and y coordinates? start counting from the center?

[ Wednesday, August 25, 2004 17:53: Message edited by: Bubbles ]

--------------------
The raving lunatic IS HERE!!!
Posts: 18 | Registered: Tuesday, August 24 2004 07:00
Off With Their Heads
Member # 4045
Profile Homepage #9
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*

--------------------
Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens.
Smoo: Get ready to face the walls!
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!: the authorized location for all things by me
The Archive of all released BoE scenarios ever
Posts: 7968 | Registered: Saturday, February 28 2004 08:00
Apprentice
Member # 4895
Profile #10
it mighta been long but it helped thanks

--------------------
The raving lunatic IS HERE!!!
Posts: 18 | Registered: Tuesday, August 24 2004 07:00
Apprentice
Member # 4895
Profile #11
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!!!

--------------------
The raving lunatic IS HERE!!!
Posts: 18 | Registered: Tuesday, August 24 2004 07:00
Off With Their Heads
Member # 4045
Profile Homepage #12
Take the equals sign out of move_to_new_town. It should just read:

move_to_new_town(2,16,24);

not

move_to_new_town=(2,16,24);

--------------------
Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens.
Smoo: Get ready to face the walls!
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!: the authorized location for all things by me
The Archive of all released BoE scenarios ever
Posts: 7968 | Registered: Saturday, February 28 2004 08:00
Apprentice
Member # 4895
Profile #13
still didnt work. i tried it with the script in both towns. Which town is the script supposed to be in?

--------------------
The raving lunatic IS HERE!!!
Posts: 18 | Registered: Tuesday, August 24 2004 07:00
...b10010b...
Member # 869
Profile Homepage #14
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?

[ Wednesday, August 25, 2004 19:05: Message edited by: The Hexamethonium Man ]

--------------------
The Empire Always Loses: This Time For Sure!
Posts: 9973 | Registered: Saturday, March 30 2002 08:00
Apprentice
Member # 4895
Profile #15
Uhhhh... no error messages. what do you mean breaks? i put it all on one line. Is this one of those indentation things or something?

--------------------
The raving lunatic IS HERE!!!
Posts: 18 | Registered: Tuesday, August 24 2004 07:00
Off With Their Heads
Member # 4045
Profile Homepage #16
Line breaks. As in, returns. It should look like this:
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?

[ Wednesday, August 25, 2004 19:47: Message edited by: Kelandon ]

--------------------
Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens.
Smoo: Get ready to face the walls!
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!: the authorized location for all things by me
The Archive of all released BoE scenarios ever
Posts: 7968 | Registered: Saturday, February 28 2004 08:00
Apprentice
Member # 4895
Profile #17
well i did that and i got an
trapdoor1 error: state not found - 0
message. The name of my script is trapdoor1

--------------------
The raving lunatic IS HERE!!!
Posts: 18 | Registered: Tuesday, August 24 2004 07:00
Off With Their Heads
Member # 4045
Profile Homepage #18
Ah, right. It wants your town script to have the normal INIT_STATE. Try this:
begintownscript;
variables;
body;
beginstate INIT_STATE;
break;
beginstate EXIT_STATE;
break;
beginstate START_STATE;
break;
beginstate 11;
move_to_new_town(2,16,24);
break;


[ Wednesday, August 25, 2004 20:05: Message edited by: Kelandon ]

--------------------
Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens.
Smoo: Get ready to face the walls!
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!: the authorized location for all things by me
The Archive of all released BoE scenarios ever
Posts: 7968 | Registered: Saturday, February 28 2004 08:00
Apprentice
Member # 4895
Profile #19
it worked!!! thank you all!!

--------------------
The raving lunatic IS HERE!!!
Posts: 18 | Registered: Tuesday, August 24 2004 07:00
Warrior
Member # 4778
Profile Homepage #20
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!

--------------------
www.bigblue.de.gg BoA graphics and more
Posts: 188 | Registered: Monday, July 26 2004 07:00
Apprentice
Member # 4895
Profile #21
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

--------------------
The raving lunatic IS HERE!!!
Posts: 18 | Registered: Tuesday, August 24 2004 07:00
Off With Their Heads
Member # 4045
Profile Homepage #22
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).

--------------------
Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens.
Smoo: Get ready to face the walls!
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!: the authorized location for all things by me
The Archive of all released BoE scenarios ever
Posts: 7968 | Registered: Saturday, February 28 2004 08:00
Apprentice
Member # 4895
Profile #23
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?

--------------------
The raving lunatic IS HERE!!!
Posts: 18 | Registered: Tuesday, August 24 2004 07:00
Off With Their Heads
Member # 4045
Profile Homepage #24
"An outdoor town" is an oxymoron. Are you trying to move to an outdoor section or a town?

--------------------
Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens.
Smoo: Get ready to face the walls!
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!: the authorized location for all things by me
The Archive of all released BoE scenarios ever
Posts: 7968 | Registered: Saturday, February 28 2004 08:00

Pages