Jump to content

Running town scripts from scenario scripts.


Ishad Nha

Recommended Posts

In theory town scripts can't be run from scenario scripts.

In devising an Identify spell for BoA I found that a scenario script could start a dialog node even if nobody was around.

Further, dialog nodes can run town scripts.

In the scenario script a usable item calls state 97, this leads to some choices. Choosing one of them leads to this:

beginstate 130;

if (is_town() == 0)

print_str_color("The spell will only work when you are in a town.",1);

if (is_town() == 1) {

print_str_color("You call upon higher powers.",2);

begin_talk_mode(190);

}

break;

 

In the town dialog script, this occurs at the end:

begintalknode 190;

state = 100;

personality = 38;

nextstate = 101;

condition = 1;

question = "Run this town script.";

text1 = "It is done.";

code =

run_town_script(21);

break;

 

I tested this in town 13, Genmar and it worked okay.

Blades of Exile Terrain property #12, Call local special, would seem to be possible via the same indirect route.

Link to comment
Share on other sites

If only BoA was open source, this could be fixed!

I may be able to fine-tune it a bit. Basically it will look odd, though when you avoid the town script and use it for the Identify spell it is okay.

 

I tried to have the dialog end without the final screen but no luck. Final screen can be blank apart from the Record button and the "1.OK.".

In BoE you can specify what monster is called by a summoning item. In BoA the only hope lies in a scenario script starting a dialog node! Even then it won't work in outdoor zones.

You seem to need a special script to make the monster non-hostile:

"void place_monster(short loc_x,short loc_y,short monst_type,short not_worth_xp)

Makes a monster of type monst_type appear at {loc_x,loc_y}. It is hostile to the party."

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...