Scripting, Code & Interaction: Difference between revisions

m
Reverted edits by ReldrOnsit (Talk); changed back to last version by Ashen
*>ReldrOnsit
(darroboc4t)
m (Reverted edits by ReldrOnsit (Talk); changed back to last version by Ashen)
Line 1: Line 1:
racdelrocnar
==Working with variables: the basics==
==Working with variables: the basics==


Line 130: Line 129:
Between the braces ( { } ), insert your code that will run the second the game loads. Do not put animation code there, as no characters have yet been drawn at that point. Only run animations when a room is loaded, and usually only after fade-in.
Between the braces ( { } ), insert your code that will run the second the game loads. Do not put animation code there, as no characters have yet been drawn at that point. Only run animations when a room is loaded, and usually only after fade-in.


For things that you want to happen every time a room is loaded, choose that room in the '''Rooms''' pane and, under '''Room/Settings''', Choose the “'''i'''” button. You will see a list of events that you can use to trigger certain events. If you don't want to use code, most functions and commands are available as interaction commands. Simply double-click the event you wish to use, OR right-click and choose '''Add''' action.... Then, in the drop-down list box, choose what you want to have happen. Note: You can indeed have more than one command running when that event occurs. They will run one after the other.
For things that you want to happen every time a room is loaded, choose that room in the '''Rooms''' pane and, under '''Room/Settings''', Choose the '''i'''button. You will see a list of events that you can use to trigger certain events. If you don't want to use code, most functions and commands are available as interaction commands. Simply double-click the event you wish to use, OR right-click and choose '''Add''' action.... Then, in the drop-down list box, choose what you want to have happen. Note: You can indeed have more than one command running when that event occurs. They will run one after the other.


For example, if you want the player to walk to a certain location after the room is loaded (each and every time), double-click on the '''Player enters room (after fade-in)''' event. You want after fade-in, because you won't see any animations or anything at all before the room fades in. Now, select the '''Character - Move character''' command, and choose the parameters below the drop-down box.
For example, if you want the player to walk to a certain location after the room is loaded (each and every time), double-click on the '''Player enters room (after fade-in)''' event. You want after fade-in, because you won't see any animations or anything at all before the room fades in. Now, select the '''Character - Move character''' command, and choose the parameters below the drop-down box.