Scripts and timers?
Brian5757
07 Jan 2020, 06:01Can be script be given a name so that it can be used again?
Is there a way to create 2 second delay timers between messages
for example:
First line of text
(delay 2 seconds)
Second line of text
(delay 2 seconds)
Final line of text

Y4T5UR0
07 Jan 2020, 15:14First of all, I'm writing all of these in GUI, so I can't be much of help if u need the CLI.
Perhaps you can try doing this
Go to script >> Add script >> "Run a script after few seconds" and input the message you want to input. Based on what you said, I think you want to put "after 2 seconds" before you print a message.
Also, I don't think you can name a script, so if you want to repeat the script, you may want to use either timer (which you have to enable and disable from the choices in the add script menu). I can't come up with a more clever idea to do this though.
Hope it helps
mrangel
07 Jan 2020, 15:55Can be script be given a name so that it can be used again?
That's basically what functions are.
Brian5757
07 Jan 2020, 23:13Not certain what GUI and CLI mean.
One example is the following output:
"There text on the paper, now where did I put my glasses"
(there is a 2 second delay before the player sees the next message)
"Here they are now lets see what this reads"
(there is a 2 second delay before the player sees the next message)
"It says that beware of the evil dwarf, keep away from him"
It makes things appear to happen in real time.
hegemonkhan
09 Jan 2020, 23:14GUI/Editor: graphical user interface (the quest editor: all its buttons, drop down menus, tabs, etc): not working in code (most software is GUI/Editor)
CLI: command line interface (code view): working in code
an example
<game name="NAME_OF_GAME">
<attr name="start" type="script">
EnableTimer (example_timer)
</attr>
</game>
<timer name="example_timer">
<attr name="enabled" type="boolean">false</attr>
<attr name="interval" type="int">2</attr>
<attr name="script" type="script">
if (example_object.example_integer = ListCount (example_object.example_stringlist)) {
example_object.example_integer = 0
DisableTimer (this.name)
} else {
msg (StringListItem (example_object.example_stringlist, example_object.example_integer))
example_object.example_integer = example_object.example_integer + 1
}
</attr>
</timer>
<object name="example_object">
<attr name="example_integer" type="int">0</attr>
<example_stringlist type="stringlist">
<value>There text on the paper, now where did I put my glasses</value>
<value>Here they are now lets see what this reads</value>
<value>It says that beware of the evil dwarf, keep away from him</value>
</example_stringlist>
</object>
Brian5757
11 Jan 2020, 10:30Thanks hegemonkhan.
I'll remember that for future shorthand of these items.