Graphics, Characters, Text & Rooms: Difference between revisions
Jump to navigation
Jump to search
Graphics, Characters, Text & Rooms (view source)
Revision as of 01:38, 1 December 2005
, 1 December 2005→World map feature (with hidden locations) in your game
Line 192: | Line 192: | ||
==World map feature (with hidden locations) in your game== | ==World map feature (with hidden locations) in your game== | ||
''I need to include a world map type of feature in my game. I want certain locations to have the ability to be toggled on and off. I also need all locations to go to a different room when clicked on. How do I implement this?'' | |||
This is a rather simple thing to implement, and it involves basic knowledge of AGS, including objects, hotspots, GlobalInts, and some basic scripting. | |||
First, your world map screen must be an independent room (this works better than a GUI if you want toggle-able locations). Any locations that are fixed (that is, will not be toggled on or off) should be drawn onto the background. Just assign hotspots to them so that, when clicked, will lead to a new room. | |||
For all the locations that are toggled, create them as objects. Assign a sprite to each of them that corresponds to the location it represents. Then, when clicked, these objects will also lead to different rooms. | |||
As for the '''GlobalInts''', you must assign one to each of the objects (toggle-able locations) in the world map room. Each will store "1" for on and "0" for off. For example, Object 0 will be controlled by GlobalInt #20, object 1 will be #21, etc. Then, everytime the world map room loads, you must check each GlobalInt and use the data there to determine whether each object should be on or off. This is necessary because you cannot (at this time) control object states from other rooms. | |||
Each time an event somewhere else triggers a certain location to be toggled ON, simply set its corresponding GlobalInt to "1". Then, when the world map screen loads, AGS will check that location's object's GlobalInt value and turn it on if it's "1". That's it! | |||
==White lines around character sprites== | ==White lines around character sprites== | ||
==Disabling diagonal walking altogether (only walk up/down/sideways)== | ==Disabling diagonal walking altogether (only walk up/down/sideways)== |