Author Topic: One-Time Script Execution w/o Reappearing Dialouge Lines - Tutorial by PJBottomz  (Read 2645 times)

PJBottomz

  • Captain
  • *****
  • Posts: 700
  • Chibi Toast. It kicks your ass for miles.
    • View Profile
    • PJBottomz First Homepage
So, a lot of people (and I mean a LOT) have been having some trouble with scripts that happen only once. After the script has finished, if you leave a room and re-enter it, cutscene lines appear and stay until you enter another script.

This is a problem because it blocks out a large portion of the screen, including the room name.

Well, I recently was toying 'round with it and found out a way to avoid it.

---

You'll need four scripts to do this. For example:

Code: [Select]
initialflags
initialflagsset
beginning
beginningstart

You don't have to use those names, you can use your own, athough initialflags and initialflagsset are good names to use

---

Now, the tutorial. The first script ("initialflags") will set up the flags needed to excute the script. The second script ("initialflagsset") will prevent the flags from being reset if you enter the script box. The third script ("beginning") is the one placed on the actual map. The fourth script ("beginningstart") does NOT have to be on the map. To do this, simply set up the code and delete the script box/terminal on the map. This will keep the code there.

---

In "initialflags", it should something like this:

Code: [Select]
ifflag(1,initialflagsset)
flag(2,on)
flag(1,on)

The reason that Flag1 is set at the end of the script is because it will activate "initialflagsset".

Now, for "initialflagsset", I simply left it blank, but you can add commands to it. It won't matter.

---

The script "beginning" should look like this:

Code: [Select]
ifflag(2,beginningstart)
If you've done the last two steps correctly, it should go directly to "beginningstart", which is the actual code itself, when you walk in the scriptbox or talk to the terminal.

And finally, "beginningstart" is the script itself:

Code: [Select]
say(2)
I was tired of listening to you.
So I left

reply
What? That doesn't make sense...

flag(2,off)

Flag2 is turned off at the end because it'll prevent the script from playing again. For whatever reason, using this method, I was able to have the script execute only once and the dialouge lines wouldn't appear if I stepped into that scriptbox again.

A level I've seen that uses this method is "Reactor Disaster".

---

Now, many might think that an "initialflags" and "initialflagsset" script has to be created for each script you do. But it doesn't.

"initialflags" sets all of the flags that are executed in the regular scripts. I recommend making "intialflags" and "initialflagsset" after you've made all the basic scripts. For example, if you use flags 2-9, "initialflags" will look like this:

Code: [Select]
ifflag(1,initialflagsset)
flag(2,on)
flag(3,on)
flag(4,on)
flag(5,on)
flag(6,on)
flag(7,on)
flag(8,on)
flag(9,on)
flag(1,on)

---

Well, hope this was helpful!  :viridian:

Damn It AL to Hell

  • Captain
  • *****
  • Posts: 492
  • Mm?
    • View Profile
It would be, but for some reason all that it does is make Viridian skip the script completely and get stuck walking eternaly into the right wall. :victoria:

PJBottomz

  • Captain
  • *****
  • Posts: 700
  • Chibi Toast. It kicks your ass for miles.
    • View Profile
    • PJBottomz First Homepage
What? That REALLY shouldn't happen. This method works fine for me.

Type out EXACTLY what you did/what you put in the code/where you put the scriptboxes.

Damn It AL to Hell

  • Captain
  • *****
  • Posts: 492
  • Mm?
    • View Profile
I wrote

flag(the script name, off)
ifflagset
initialflagset

PJBottomz

  • Captain
  • *****
  • Posts: 700
  • Chibi Toast. It kicks your ass for miles.
    • View Profile
    • PJBottomz First Homepage
Wait, what?

No wonder it didn't work! initflags and initflagsset are script NAMES, not script COMMANDS. And "scriptname" is not a flag command.

What in the world were you trying to do?

And ifflagset is not a command either...