FANDOM


    The *bug command is a testing / debugging aid. It enables you - under specific circumstances - to purposely cause a game-stopping crash and generate an error message of your own wording.

Useage

In the following example, we have reached a stage in the game where we intend that by now the protagonist should have met the love of his/her life, and so now aim to direct the game to a suitable romantic scene. Although we're pretty certain choosing one or the other of the named NPCs in an earlier scene should be unavoidable, we can use the *bug command here just to make absolutely certain.

*if partner_name = "Jill"
    *goto romance_jill

*if partner_name = "Jack"
    *goto romance_jack

*if partner_name = "Susie"
    *goto romance_susie

*if partner_name = "Frank"
    *goto romance_frank

*bug Our protagonist is still unlucky in love!

In this example, in the unlikely event that our partner_name variable at this point does not contain any of the above names, the *bug command will catch this and halt the game to inform us of that fact, rather than blithely continue on into whatever scripting follows this section. This allows us to check back through our earlier code to learn precisely why no partner has yet been chosen, and to fix it accordingly.

Quicktest and Randomtest

Another advantage of the *bug command is that the automated 'Quicktest' does not, as a rule, like to see a series of *if commands such as those above (i.e. to be on the safe side, it has to assume you've inadvertently missed a vital *if condition and so may eventually error for a player); it much prefers *if / *elseif / *else combinations. However, including a *bug  possibility in your series of *if commands essentially puts Quicktest's mind to rest and it will now allow this code to pass unchallenged - you've allowed for the possibility of error here (no matter how remote), so Quicktest doesn't need to.

'Randomtest', however, does not ignore the *bug command and allow your code to go unchallenged, and this is also entirely to your advantage. If a *bug command ever causes Randomtest to halt, it means that it is entirely possible for an actual player of the game to encounter it - i.e. your *bug is indeed a genuine game design bug and needs fixing. Note that since Randomtest shows you the step-by-step route it took to reach that *bug, it also makes it relatively easy for you to trace back through your code to the cause of the problem.

Useful links

For further details of both the *bug command and its special relationship with the automated tests, we highly recommend visiting CoG's own page on the subject.


More commands
Choice *choice, *fake_choice, *disable_reuse, *hide_reuse, *allow_reuse, *selectable_if
Variable *create, *temp, *set, Arithmetic operators, *delete, *input_number, *input_text, *print, *rand
Conditional *if, *elseif, *else
Goto *label, *goto, *goto_scene, *goto_random_scene, *gosub, *gosub_scene, *finish
Formatting Bold text, Italic text, *image, *line_break, *page_break, *link, *stat_chart
Miscellaneous *comment, *scene_list, *title, *author, *achieve, *achievement, *check_achievements, *bug, *ending, *more_games, *share_this_game, *show_password, *script

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.