How do I start a cutscene after passing a door?

From OHRRPGCE-Wiki
Jump to navigation Jump to search

Suppose that you want to trigger a cutscene (plotscript) the first time you enter a certain map from a door that leads to a certain location. (If you want to trigger the cutscene from the use of only one of several doors that leads to the same location, that is a harder problem, not covered here.)

Well it might seem difficult at first side but in fact it isn't (especially for olbies). We'll use a map autorun script on the destination map. We'll also need a tag to make sure it runs just once. Create a new tag, we call it "door used". Edit your .hss file and include and customise the following script:

plotscript, autorunmap4, begin

  if (check tag(tag:door used)==off) then (
    if ((hero X (me))==8) then (
      if ((hero Y (me))==11) then (
        # an example cutscene
        suspend player
        show text box (20)
        wait for text box
        resume player
        # end of cutscene

        set tag (tag:door used, on)
      )
    )
  )

end

Don't forget to reexport your hsi file, compile, and set the script as the map autorun script.

This script runs each time you enter the map, however, the three if commands make sure that the cutscene only happens if the hero enters through a door that leads to position 8,11 on the map. Any other door will not trigger the cutscene.

The tag:door used tag is checked and set to make sure that the cutscene only happens once.

Just edit your game and pick the map on which the cutscene is supposed to happen. Edit the doors and find the location of the one you want to use launch the plotscript.

If you have any question; don't hesitate to ask for help at the Castle Paradox!

See Also[edit]