Bridging between scripts?

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).
AuthorTopic: Bridging between scripts?
Warrior
Member # 1320
Profile #0
Long time no see... Although I doubt anyone remembers me. Or gives a doodle. (I forgot, are these forums censored?)

Anyway, I'm trying to recreate the Mark/Recall thing you get in some games. Anyone who has played Baldurs Gate or Morrowind will know what I mean. Problem is, I've gotten as far as making a custom item (an amulet) that will run a scenario state, and mark the location by transforming the location of the first character into three SDFs = The x coordinate, the y coordinate, and the town number.

Then I tried to actually move the party into the marked spot. Now here's where the problems begin.

You can't run the move_to_new_town and teleport_party calls from the scen script. I tried bypassing this by making a run_town_script instead, and making state 60 and 61 in each town script move the party to a new town/teleport party.

Now apparantly, you can't use the run_town_script inside a scen. script either. Which sucks.

So, I'm at a loss. I really want to get the Recall thing in.

Anyone know any solution to this problem? I thought about making this Mark/Recall thing into a custom ability, but its relativily late now, and I'm pretty tired, so I'm gonna chec it out tommorow insteas.

Here's the final script that I came up with. state 60 and 61 in the town scripts will use the calls move_to_new_town or teleport_party based on SDF's 90,10; 90,11; and 90, 12.

(variables are i,j,town,coordx,coordy, and choice)

beginstate 10;
if ((is_town() == 1) && (is_combat() == 0)){
reset_dialog();
add_dialog_str(0,"The bluish amulet glows faintly as you hold it in your hand. Do you want to activate it?",0);
add_dialog_choice(0,"Activate the amulet.");
add_dialog_choice(1,"Put it back in your inventory.");
choice = run_dialog(1);
if ((choice == 1) && (get_flag(90,15) == 0)) {
set_flag(90,15,10);
play_sound(28);
reset_dialog();
add_dialog_str(0,"You concentrate on the amulet, at the way the light reflects across its slightly metallic surface, just like the old wizard taught you. You reach out, carefully, with your mind, caressing the amulet with your essence.",0);
add_dialog_str(1,"The amulet starts to glow more brightly, its bluish light casting surreal shadows everywhere. You concentrate harder, and the crystal fires a beam of light downwards, into the ground.",0);
add_dialog_str(2,"Then, without warning, the amulet ceases its magic, and the surreal light vanishes, leaving only the ever-present marine glow of its harsh surface.",0);
add_dialog_str(3,"You bend down and examine the ground where the ray of light from the amulet had struck. Sure enough, there, on the ground, is a small pentagram, imprinted there by the amulet. Just as the old wizard said.",0);
add_dialog_str(4,"(The amulet has now marked this location, and the next time you use it, it will transport you here.)",0);
add_dialog_choice(0,"OK.");
choice = run_dialog(0);
if (choice == 1){
coordx = char_loc_x(0);
coordy = char_loc_y(0);
town = current_town();
set_flag(90,10,coordx);
set_flag(90,11,coordy);
set_flag(90,12,town);
print_str_color("Your position is now Marked.",4);
end();
}
}
if ((choice == 1) && (get_flag(90,15) == 10)) {
set_flag(90,15,0);
reset_dialog();
add_dialog_str(0,"You concentrate on the amulet, just like you did last time. However, this time, the bluish light of the amulet turns red, as soon as you touch it with your essence. The building glow envelopes you, blinding you, filling your mind with the red light.",0);
add_dialog_str(1,"When the light fades, you realize you are in a different place. You look around, and recognize the familiar setting as the place where you last used the amulet.",0);
add_dialog_str(2,"The glow of the amulet starts to recede, but before it is completely gone, it reaches out and envelops the mark it had left previously. Then, suddenly, the amulet is back to normal, glowing slightly with a bluish tint.",0);
add_dialog_choice(0,"Neat.");
choice = run_dialog(0);
if (choice = 1){
if (current_town() != town)
run_town_script(60);
if (current_town() == town)
run_town_script(61);
}
}
if (choice == 2){
reset_dialog();
add_dialog_str(0,"You put the amulet back into your pack. Magic isn't to be taken for granted.",0);
add_dialog_choice(0,"OK.");
run_dialog(0);
}
}

break;

Its probably pretty poor compared to some of the stuff I've seen in Kelandons and others scenarios, but hey, I ain't that good at this. Yet.

--------------------
-Step aside, worthy adversary!
-T'is but a scratch!
-A scratch! Your arms off!
(pause)
-I've had worse!
-You liar!
-C'mon, you pansy!
(Fighting continues.)
-Allright. We'll call it a draw then.
-Oh I see. Running away are we? You yellow bastard! Come back here and take whats coming for you! I'll bite your legs off!

"You know that you've played Halo 2 to much when you sit down for dinner, pick your fork up, look at the knife, and in the corner of your vision, you see *Press X to pick up Press Y to dual wield*"
Posts: 182 | Registered: Monday, June 17 2002 07:00
Off With Their Heads
Member # 4045
Profile Homepage #1
Here's the real problem: you can't run move_to_new_town from anything but a special rectangle. I mean, you have to step on one of those blue rectangles for it to function.

Nothing else will work.

--------------------
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
Warrior
Member # 1320
Profile #2
How about teleport_party?

--------------------
-Step aside, worthy adversary!
-T'is but a scratch!
-A scratch! Your arms off!
(pause)
-I've had worse!
-You liar!
-C'mon, you pansy!
(Fighting continues.)
-Allright. We'll call it a draw then.
-Oh I see. Running away are we? You yellow bastard! Come back here and take whats coming for you! I'll bite your legs off!

"You know that you've played Halo 2 to much when you sit down for dinner, pick your fork up, look at the knife, and in the corner of your vision, you see *Press X to pick up Press Y to dual wield*"
Posts: 182 | Registered: Monday, June 17 2002 07:00
...b10010b...
Member # 869
Profile Homepage #3
You cannot use teleport_party to send someone to a different town.

--------------------
The Empire Always Loses: This Time For Sure!
Posts: 9973 | Registered: Saturday, March 30 2002 08:00
? Man, ? Amazing
Member # 5755
Profile #4
Can't you use teleport party to move them onto the special rectangle??

*this message, sadly, has no sponsor*

--------------------
WWtNSD?
Posts: 4114 | Registered: Monday, April 25 2005 07:00
Off With Their Heads
Member # 4045
Profile Homepage #5
Yes, but that means you need some place into which to teleport in every town in which you want this item to work. While this could work, it would be prohibitively annoying.

--------------------
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
Warrior
Member # 1320
Profile #6
teleport_party only works inside of towns, when move_to_new_town does not work(or does it?)

Kelandon, what do you mean? The party will use the amulet the first time inside of town, when not in a fight, so they will have to be somewhere where they will fit. The game would remember their locations as SDFs, the x coordinate as (90,10) and the y as (90,11), and then when the amulet was used again, it would move them to these coordinates in this town(90,12).

Anyway, is there any place where I can go and sumbit any wishes for scripts in the next BoA patch? Because if you modified the move_to_new_town call so that it would work everywhere, or at least in scen scripts. No wait, cancel that. If that call would work everywhere, then you would be able to transport an NPC to a new town, which would probably crash the game. Ok, so just in the scen script.

--------------------
-Step aside, worthy adversary!
-T'is but a scratch!
-A scratch! Your arms off!
(pause)
-I've had worse!
-You liar!
-C'mon, you pansy!
(Fighting continues.)
-Allright. We'll call it a draw then.
-Oh I see. Running away are we? You yellow bastard! Come back here and take whats coming for you! I'll bite your legs off!

"You know that you've played Halo 2 to much when you sit down for dinner, pick your fork up, look at the knife, and in the corner of your vision, you see *Press X to pick up Press Y to dual wield*"
Posts: 182 | Registered: Monday, June 17 2002 07:00
Off With Their Heads
Member # 4045
Profile Homepage #7
You may want to re-read what I was responding to. Salmon suggested using teleport_party to move the party to a part of town where a special rectangle is, so that the party would then be forced to step on that special rectangle and then move to the new town. I said, "Yes, but you'd need a special rectangle in every town."

You'd have to designate a corner of each town to have this special rectangle and to have enough space to move the party there. You'd further have to make this not look weird somehow. In theory, it could work, but it would be annoying to make.

And I've already told Jeff that I think move_to_new_town should work everywhere. It was in a community suggestion list a while back.

--------------------
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
Warrior
Member # 1320
Profile #8
Oh, sorry. Didn't realize you were responding to his post, not mine. Never mind. Thanks anyhow!

--------------------
-Step aside, worthy adversary!
-T'is but a scratch!
-A scratch! Your arms off!
(pause)
-I've had worse!
-You liar!
-C'mon, you pansy!
(Fighting continues.)
-Allright. We'll call it a draw then.
-Oh I see. Running away are we? You yellow bastard! Come back here and take whats coming for you! I'll bite your legs off!

"You know that you've played Halo 2 to much when you sit down for dinner, pick your fork up, look at the knife, and in the corner of your vision, you see *Press X to pick up Press Y to dual wield*"
Posts: 182 | Registered: Monday, June 17 2002 07:00