sorry, about the use of code, but it is so much faster to write~type it in for me, then trying to detailedly explain the steps via using the GUI~Editor, and also just needing to copy and paste it around as well, laughs.
----------------
there is this link, if you got a general understand of quest's structure:
viewtopic.php?f=18&t=4771--------------
I set this scripting as a Function, so~as it can be 'called upon ~ loaded ~ used' from anywhere (any other scripting in your game), and as for this example, it needs to be repeatable (loopable), thus I used a Function, as in quest, Functions allow for easy looping (repeating).
here's an example of calling up it via the 'start' Script (Game -> Scripts -> 'start' Script -> Add new~a script -> 'output' or 'script' category: not sure what category it is under, lol -> 'call function' Script):
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Testing Game Stuff">
<gameid>an_algorithm_generated_unique_string</gameid>
<version>1.0</version>
<firstpublished>2014</firstpublished>
<author>HegemonKhan</author>
<start type="script">
mantra_function
</start>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
</object>
<function name="mantra_function">
msg ("What was that mantra?")
get input {
// internally, the 'get input' Script sets: result = (your typed-in input)
// String Matching:
if (result = "My mind is a fortress, but my heart is free.") {
// if ("My mind is a fortress, but my heart is free." = "My mind is a fortress, but my heart is free.") {
player.parent = room2
msg ("You remember the correct mantra, and after uttering it, the strange brainwashing goes away, and you now can see your true surroundings.")
} else {
mantra_function
}
}
</function>
</asl>
and here's an example of not using it as a Function, but still for example of placing it in the 'start' Script:
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Testing Game Stuff">
<gameid>an_algorithm_generated_unique_string</gameid>
<version>1.0</version>
<firstpublished>2014</firstpublished>
<author>HegemonKhan</author>
<start type="script">
msg ("What was that mantra?")
get input {
// internally, the 'get input' Script sets: result = (your typed-in input)
// String Matching:
if (result = "My mind is a fortress, but my heart is free.") {
// if ("My mind is a fortress, but my heart is free." = "My mind is a fortress, but my heart is free.") {
player.parent = room2
msg ("You remember the correct mantra, and after uttering it, the strange brainwashing goes away, and you now can see your true surroundings.")
} else {
// the way to loop~repeat a Script Attribute (an alternative to using Functions):
invoke (game.start)
}
}
</start>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
</object>
</asl>
but we can place this else where too (ignore the il-logic of this, lol), for example:
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Testing Game Stuff">
<gameid>an_algorithm_generated_unique_string</gameid>
<version>1.0</version>
<firstpublished>2014</firstpublished>
<author>HegemonKhan</author>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
<object name="orc">
<inherit name="editor_object" />
<talk type="script">
msg ("What was that mantra?")
get input {
// internally, the 'get input' Script sets: result = (your typed-in input)
// String Matching:
if (result = "My mind is a fortress, but my heart is free.") {
// if ("My mind is a fortress, but my heart is free." = "My mind is a fortress, but my heart is free.") {
player.parent = room2
msg ("You remember the correct mantra, and after uttering it, the strange brainwashing goes away, and you now can see your true surroundings.")
} else {
// the way to loop~repeat a Script Attribute (an alternative to using Functions):
invoke (game.start)
}
}
</talk>
</object>
</object>
</asl>