If statements for the whole game

Hey, hope this is an easy question:

Where do I have to go in the menu to make, let us call it, general "If"-Statements.
For example, if the player did something cruel everyone perceived and all the NPC don't want to talk to him anymore.
By now I always have to create the If-condition within the verb, room or object, but not for the whole game, this should be possible, shouldn´t it?
This would really save a ton of work...

Thanks for your answers!

Greetings

Fryer


Okay, I'll take a stab at how I'd do it logical, probably not the best way though .

I'd use something like a flag for the player.. lets say "Wicked " then I'd make a command to replace the Generic "Speak" verb and have it split off
"If" the player had the wicked flag the person would be unhelpful, and if they didn't have the flag it would run the speak script from whatever npc you were using.


create/add a Turnscript that is NOT within a specific Room Object, as this makes it global (game-wide):

Turnscripts run their scripts (if they're enabled and/or if they're local room-specific turnscripts when you're within the same room as them) every internal turn (typed in command or mouse-click on hypertext link or the buttons)

http://docs.textadventures.co.uk/quest/elements/turnscript.html

http://docs.textadventures.co.uk/quest/functions/corelibrary/enableturnscript.html
http://docs.textadventures.co.uk/quest/functions/corelibrary/disableturnscript.html

Turnscripts are NOT shown in the "tree of stuff" on the left side, so you got to create/add them through options in the menu bar at the top of the screen, or however else you can access them (right clicking?)

<asl version="550">

  <include ref="English.aslx" />
  <include ref="Core.aslx" />

  <game name="example">
  </game>

  <object name="room">

    <inherit name="editor_room" />

  </object>

  <object name="player">

    <inherit name="editor_object" />
    <inherit name="editor_player" />

    <attr name="parent" type="object">room</attr>

  </object>

  <turnscript name="example_global_turnscript">

    <!--

    the 'enabled' boolean attribute for Turnscripts is whether it's 'turned on / activated' at the start of the game, if you got it turned off (false), then you can toggle it on/off via:

    EnableTurnScript ("NAME_OF_YOUR_TURNSCRIPT") // if error, then try without the double quotes: EnableTurnScript (NAME_OF_YOUR_TURNSCRIPT)

    DisableTurnScript ("NAME_OF_YOUR_TURNSCRIPT") // if error, then try without the double quotes: DisableTurnScript (NAME_OF_YOUR_TURNSCRIPT)

    -->

    <attr name="enabled" type="boolean">true</attr>

    <script>

      // 'if' or 'switch-case' scripting

    </script>

  </turnscript>

</asl>

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums