[ian-reeds-games] Re: Scripters

  • From: Craig Brett <craigbrett17@xxxxxxx>
  • To: ian-reeds-games@xxxxxxxxxxxxx
  • Date: Sun, 20 Jan 2013 11:35:48 -0500 (EST)

Hi Carlos,

It was the type conversion after all. I've got it working with this function.

function announce_width_and_height(e) {
        /// <summary>Announces the width and height of the map</summary>
        /// <param name="e">The event object</param>
        if (e.k != e.key || e.m != e.mod) {
                return; // it's not the key combination we are supposed to 
respond to.
        }
        if (shared.Map.Width && shared.Map.Height) {
                var height = shared.Map.Height.toString();
                var width = shared.Map.Width.toString();
say("This map is " + height + " tiles vertically and " + width + " tiles horizontally. ");
        }
}

Hope this helps and this was also my first script, so it's helped ease me in :)

Cheers,

Craig



Other related posts: