Jump to content

Bridging between scripts?


:Slash:

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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