Please login or register.

Login with username, password and session length
Advanced search  

News:

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.

Topics - greg

Pages: [1]
1
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.actor
Ego.Talk("Hello.");             // Ego should (and does) say this with the TALK animation set
Ego.TalkAnimName = "talk2";     // talk2 is another animation set in ego.actor
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.

Thanks!
Greg

2
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.actor
Ego.Talk("Hello.");         // Ego should (and does) say this with the TALK animation set
Ego.TalkAnimName = "talk2"; // TALK2 is another animation set in ego.actor
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?

Thanks!
Greg

3
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.

ABOUT NOTEPAD++

Notepad++ is a free, powerful text editor available from http://notepad-plus.sourceforge.net/uk/site.htm.  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).

CONFIGURING NOTEPAD++

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]
::wme_check_syntax
"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.


4
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?

Thanks,
Greg

5
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?

Thanks,
Greg

6
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!

Greg

7
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].)

Thanks,
Greg

8
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?

Thanks!
Greg

9
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!

Greg


10
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!

Greg

11
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.GoTo(80,460);
actor.TurnTo(this);
// 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?

Thanks,
Greg

12
Technical forum / Compiler Bugs?
« on: September 24, 2006, 05:23:04 AM »
Hi Mnemonic,

I think I came across two bugs in the compiler:

1. The compiler (wme_comp.exe) complains when I use the following:

Code: [Select]
Game.SelectedItem.Name
However, it allows:

Code: [Select]
var SelItem = Game.SelectedItem;
SelItem.Name

Shouldn't Game.SelectedItem.Name be permitted?

2. In the following "if" statement...

Code: [Select]
if (SelItem != null && SelItem.GetHoverCursor() == null) ...

...if SelItem is null, shouldn't the conditional immediately evaluate to false, meaning (SelItem.GetHoverCursor() == null) would never be evaluated?

When I compile my game and run it, the console prints errors like crazy because it's trying to evaluate SelItem.GetHoverCursor() even when SelItem is null.

Thanks!  Please let me know if you need any additional information.

Greg

PS: For an Item object, what is the difference between the "standard" cursor and "Normal" cursor, e.g. Item.GetCursor() vs. Item.GetNormalCursor()?
PPS: Have you considered adding Item.{Has,Remove}{Normal,Hover}Cursor() to be consistent with Item.{Has,Remove}Cursor()?

13
Technical forum / Inventory Questions
« on: September 24, 2006, 02:42:08 AM »
Hi WME Folks,

I'm interested in creating a customized inventory so that I have more control over the interface.  (Basically, I'd like to make sure that all items, regardless of size, are centered within the cell.)

1. Within the builtin inventory structure, is it possible to center a sprite within a cell?

2. How would one go about creating a custom inventory?  My thought was to create a window and then position the inventory items within the window.  Can I do this with Item objects, or would I need to use Buttons or another form of UI object?  My first attempt was this which, as this post might suggest, failed miserably:

Code: [Select]
var current_point; // coordinates of upper-left corner of current tile
current_point.x = start_point.x;
current_point.y = start_point.y;

for (var i=0; i < Game.NumItems; i=i+1) {
var Item = Game.QueryItem(i);

// display and position the inventory item within the window
Item.X = current_point.x;
Item.Y = current_point.y;
Item.Active = true;

// update current_point
current_point.x = current_point.x + tile_size.x + tile_spacing.x;

// have we reached the end of the row?
if (current_point.x >= (start_point.x + ((tile_size.x + tile_spacing.x) * num_tiles.x))) {
current_point.x = start_point.x;
current_point.y = current_point.y + tile_size.y + tile_spacing.y;

// have we reached the end of the last row?
if (current_point.y >= (start_point.y + ((tile_size.y + tile_spacing.y) * num_tiles.y))) {
break;
}
}
}

3. So that I can center the item within a cell, is it possible to query the width and height of a sprite?

Thanks so much for your help!

Greg

14
Technical forum / Music and Sound Questions
« on: August 21, 2006, 06:41:54 AM »
Hi All,

I'm a newcomer to the Wintermute Engine, and I have a couple questions about its music and sound functionalities:

1. According to the manual, there are 5 music channels.  Are all five of these channels dedicated solely to music and not used by any PlaySound commands?  (Also, by default, does PlayMusic try to use Channel 0?)

2. I know there's not a built-in function for this, but could you suggest a way to filter an audio file within WME as to change the pitch or speed of the playback?

Thanks so much for your help!

Greg

Pages: [1]

Page created in 0.02 seconds with 22 queries.