Please login or register.

Login with username, password and session length
Advanced search  


Forum rules - please read before posting, it can save you a lot of time.

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - greg

Pages: [1] 2
Not a bug / Actor.TalkAnimName
« on: April 04, 2008, 07:51:44 PM »
I'd posted about this in the Technical forum, and it looks like a bug (rather than user error on my part), so I'm posting it here:


When using TalkAnimName to change the talk animation for a character, whatever value I set TalkAnimName to, the character still speaks with the default talk animation.

Code: [Select]
Game.Msg(Ego.TalkAnimName);     // This prints "talk" which corresponds with the TALK animation set in
Ego.Talk("Hello.");             // Ego should (and does) say this with the TALK animation set
Ego.TalkAnimName = "talk2";     // talk2 is another animation set in
Game.Msg(Ego.HasAnim("talk2")); // This prints "true"
Ego.Talk("Hello, again.");      // Ego says this with the TALK animation set, not talk2

I can change the talk animation with Actor.ForceTalkAnim(), just not Actor.TalkAnimName.


Technical forum / Using Actor.TalkAnimName
« on: March 31, 2008, 01:52:16 AM »
I'm trying to (temporarily) change the talk animation for a character, but, whatever value I set TalkAnimName to, the character still speaks with the previous talk animation.

For example;

Code: [Select]
Game.Msg(Ego.TalkAnimName); // This prints "talk" which corresponds with the TALK animation set in
Ego.Talk("Hello.");         // Ego should (and does) say this with the TALK animation set
Ego.TalkAnimName = "talk2"; // TALK2 is another animation set in
Ego.Talk("Hello, again.");  // Ego says this with the TALK animation set.  Shouldn't it be with the TALK2 animation set?

Am I setting the value incorrectly?


Scripts, plugins, utilities, goodies / Using Notepad++ with WME
« on: January 26, 2008, 04:42:30 PM »
This morning, I spent a couple hours configuring Notepad++ to work with WME.  I'm posting the instructions here so that others don't need to duplicate my effort.


Notepad++ is a free, powerful text editor available from  Compared to Crimson Editor (which I was using previously), here are its advantages and disadvantages.

Pros: You can rearrange tabs and collapse bracket pairs within a script.  It's open source and still being maintained.
Cons: You can't assign shortcut keys to user-defined commands (i.e. checking WME syntax).


The following instructions assume that Notepad++ is installed in C:\Program Files\Notepad++:

 1. Console.  In C:\Program Files\Notepad++\plugins\Config\NppExec.ini, change "Visible=0" to "Visible=1".
 **This will cause the console to show automatically when you open Notepad++.

 2. Highlighting and Formatting.  Select Settings > Styler Configurator.
  a. Select Enable Global Font and Enable Global Font Size.
  **This will cause Notepad++ to display the entire script (even comments) in the same-size fixed-width font.
  b. Under Language, select Java.  Add script to the User ext field.
  **This will cause Notepad++ to automatically highlight .script files as if they were written in Java.

 3. Syntax checking.  In C:\Program Files\Notepad++\plugins\Config\npes_saved.txt, add the following:
Code: [Select]
"C:\Program Files\WME DevKit\wme_comp.exe" -project "C:\Program Files\WME DevKit\projects\[project]\[project].wpr" -script "$(FULL_CURRENT_PATH)"

 Where C:\Program Files\WME DevKit\projects\[project]\[project].wpr is the path to your WME project file.
 **Now, to check the syntax of a script, press F6, change the dropdown menu to wme_check_syntax, and press OK.

Technical forum / Resetting Character's Queued Actions
« on: September 17, 2007, 03:52:31 PM »
Often a character's action will consist of multiple parts.  For example, suppose the character tries to open a gate:

Code: [Select]
on "Open" {
   Ego.GoTo(walkto.x, walkto.y);    // walk to the gate
   Ego.TurnTo(turnto.x, turnto.y);  // face the gate
   Ego.Talk("The gate is locked."); // say "The gate is locked."

If, while the character is walking toward the gate, the player clicks elsewhere, I'd like to cancel all the pending actions (walk, turn, talk) except for the player's new click.  Ego.Reset() cancels just the walk, but the character will still perform the Turn and Talk.  Is there a way to override Reset() to cancel all the character's queued actions?


Technical forum / Changing Resolution
« on: April 10, 2007, 05:22:40 AM »
Is it possible to change resolutions in the middle of the game?  My game is 1024x768, but, to save disk space, when playing full-screen cinematics (in Theora format), I would like to change the resolution to 640x480, so that 640x480 videos appear to be full-screen.

Alternately, is it possible to scale an 640x480 Theora file in WME so that it fills the entire 1024x768 screen?


Done / Re: Sprite flip
« on: February 10, 2007, 04:27:44 AM »
Hi Mnemonic,

I'm not sure if the proper protocol is to start a new topic or to append to this one.  However, I wanted to add my support to Guardian's request for sprite flipping.  Since a lot of a characters' animations are mirror images of one another (e.g. right/left, down-right/down-left, up-right/up-left), roughly 40% of disk space per character animation (3 mirrored directions / 8 directions total) could be saved by implementing sprite flipping in software, rather than the developer needing to include files for the flipped sprites.

For games with a lot of moving characters, this could prove most useful.  Thanks!


Technical forum / Automatically Select Last Dialogue Response
« on: January 16, 2007, 04:39:10 PM »
Is there a way of overriding Game.GetResponse() so that, if there's only one response available, it automatically selects it?

I tried the following definition:

Code: [Select]
// newestResponseId tracks the id of the last response added by Game.AddResponse(responseId, stringId).
// If there's only one response, it follows that newestReponseId == responseId.
var newestResponseId;

method GetResponse() {
if (Game.GetNumResponses() == 1) {
return newestResponseId;
return Game.GetResponse();

However, even though this causes the switch statement to run the proper response (case n, where n == newestResponseId), WME doesn't remove the response from the list of responses (causing the response to appear as an option when the branch exits and returns to its parent branch).

Thanks for your help!


Technical forum / Accessing an Object's Member Variable
« on: January 06, 2007, 01:03:28 AM »
Hi All,

How can I access an object's member variable from a non-member function?

Within the game daemon script, I'm trying to access a member variable of the active object:

== my_object.script ==

var myState = "foo";

== game_daemon.script ==

var active_object = Game.GetActiveObject();
var active_object_state = active_object.myState;
Game.Msg(active_object_state); // this prints [null]

So far, the only way I can get this to work is by creating a GetMyState() method in my_object.script that returns myState and then calling active_object.GetMyState() from game_daemon.script.

Do I need to write a wrapper method for every variable I need to access from a non-member function?  If so, is there a way to put the method in a script attached to the object (via this.AttachScript()), so that I don't need to copy the wrapper methods into every instance of the object?  (In my testing, calling Game.Msg(this.myState) from the attached script also displays [null].)


Technical forum / .X Questions
« on: November 30, 2006, 07:28:27 PM »
Hi All,

I have two, possibly naive questions about .X files:

1. Can a 3D character consist of multiple meshes, or do .X files not permit this?

2. If a character has multiple textures--for example, Trinity has a body texture and a belt-buckle texture--where (and how) is it specified which texture applies to which part of the mesh?


Technical forum / Playing Animations in Reverse, and more
« on: November 04, 2006, 07:25:40 AM »
Hi All,

I have four (hopefully simple) questions:

1. Is it possible to play a sprite animation in reverse, aside from creating a new sprite with all the frames in reverse order?

2. In WME, what integer values correspond to boolean true and false?  Is 0 false and every other integer true?

3. If I define a variable in the beginning of a script associated with a room object (e.g. var object_property = SceneState.some_property), is the variable only updated when the scene is loaded?  Namely, even if SceneState.some_property changes during the course of the scene, would object_property not be updated until the scene were reloaded?

4. How do I change a Scene's default script directory?  I renamed the folder from "scr" to "scripts," but, whenever I create a new script in SceneEdit, it puts the new script in the "scr" folder (and creates the "scr" folder, if it doesn't exist).

Thanks for your help!


Technical forum / Re: Tracking which lines have been said...
« on: October 29, 2006, 05:36:56 PM »
Main question:

For global variable x and w = x.y.z (or w = x.y[z]), how can I edit w so that future references to x.y.z (or x.y[z]) (from different scripts, etc) will reflect the updated w?


As a corrolary to the previous post, I'm now trying this method:

Code: [Select]
// if actor.dialogue[stringId] is true, then the actor has said the line corresponding to stringId.
// in the following code, "this" refers to the actor who's speaking

var string_state = this.dialogue; // because wme doesn't like this.dialogue[stringId]
method TalkOnce(stringId) {
var string_state = this.dialogue;
if (!string_state[stringId]) {
string_state[stringId] = true;

However, even though I'm setting actor.dialogue[stringId] to true, the next time I call the method, actor.dialogue[stringId] has reverted to its previous null value.  I suspect this is a pass-by-reference/pass-by-value problem.  Namely, when I update string_state, I'm updating a copy of actor.dialogue (pass by value) rather than the actual actor.dialogue (pass by reference).  Is this true?  If so...

For global variable x and w = x.y.z (or w = x.y[z]), how can I edit w so that future references to x.y.z (or x.y[z]) (from different scripts, etc) will reflect the updated w?


Technical forum / Tracking which lines have been said...
« on: October 29, 2006, 03:35:15 PM »
I'm trying to track what dialogue lines a character has said (and how many times he has said them).

To do this, my first thought was to use a hash table, a la:

Code: [Select]
// stringId is the ID of the dialogue line in the string table (in the format X_##_##_##, which is [ActorID]_[RoomID]_[ObjectID]_[LineId])
if (actor.dialogue[stringID]) {
   actor.dialogue[stringID] = actor.dialogue[stringID] + 1;
} else {
   actor.dialogue[stringID] = 1;

Since WME doesn't have hash tables but instead approximates them with the variable.subvariable format, my next thought was to do something like:

Code: [Select]
var lineState = actor.dialogue;
if (lineState.stringId) {
   lineState.stringId = lineState.stringId + 1;
} else {
   lineState.stringId = 1;

This wouldn't work though, because lineState.stringId would be treated as "lineState.stringId" rather than being resolved to lineState.X_##_##_##.

I suppose I could create a hash function which turns the stringId (X_##_##_##) into an integer (######) and then use that integer to index into an array of length maximumPossibleNumberOfLinesGivenStringIdFormat (######, which would be, egad, 1,000,000).

Is there a better--or more memory efficient--way of tracking which lines have been said, though?

Thanks for your help!


Technical forum / Re: Sprite frame opacity
« on: October 02, 2006, 03:25:59 AM »
Hi All,

Is a sprite's alpha channel independent of its AlphaColor?  After reading through the documentation and forum, my understanding is as follows:

1. The alpha channel is a greyscale mask placed over an image that determines the transparency of various parts of the image.  (Black on the mask corresponds to an opaque part of the image, whereas white corresponds to a completely transparent part of the image.  Intermediate values--namely, greys--correspond to a partially transparent parts of the image.)

2. The AlphaColor determines the transparency of the entire image.  For example,

SomeFrame.AlphaColor = MakeRGBA(255, 255, 255, 0);    // fully transparent
SomeFrame.AlphaColor = MakeRGBA(255, 255, 255, 128); // partially transparent
SomeFrame.AlphaColor = MakeRGBA(255, 255, 255, 255); // fully opaque

Is this accurate?  In setting the AlphaColor with MakeRGBA(red_value, green_value, blue_value, alpha_value), would {red,green,blue}_value ever be set to a non-255 value?  If so, how would this affect the image?

Thanks so much for your help!


Technical forum / 3D Character Walks While Talking
« on: September 26, 2006, 06:33:42 AM »
Hi Wintermute Folks,

I've created a 2.5D scene, using Trinity and a simple .3DS geometry file (walkplane, camera, lights only).  Trinity navigates the environment as expected.  However, whenever she's given a command of the type "walk somewhere and then say something," she walks in place *after* she's reached her destination until she's done saying the line.  (I can also reproduce this problem in the WME 3D Demo.  For example, when I tell Trinity to look at the crates, she walks to the crates and then walks in place as she says, "A stack of crates. An inevitable requisite of any modern game.".)

Consider the following code from an object in my scene:

Code: [Select]
on "LookAt"
// actor.StopAnim(); // stops *all* animations, not just walking
// actor.StopAnimChannel(0); // ditto
// actor.StopAnimChannel(1); // no effect
// while (actor.IsWalking()) { wait(10); } // no effect
// actor.Reset(); // no effect
// actor.DirectWalkStop(); // no effect

  actor.Talk("Pithy line.");

The commented lines represent my various attempts to get Trinity to stop walking after she reaches her destination.  As the comments indicate, nothing has really worked.  StopAnim() comes the closest, but this halts the idle (and talk) animation as well.

So, two questions:

1. How can I get a 3D Character to walk to a destination and then say a line without walking in place?
2. Is the walk animation for a 3D character always played on a particular channel?  The idle animation?


Technical forum / Re: Compiler Bugs?
« on: September 25, 2006, 06:03:29 AM »

Pages: [1] 2

Page created in 0.213 seconds with 23 queries.