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.

Pages: [1] 2  All

Author Topic: characters' text speed  (Read 14253 times)

0 Members and 1 Guest are viewing this topic.

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
characters' text speed
« on: April 10, 2003, 09:02:16 AM »

Is it possible to adjust the text speed when a character is talking. I can't find it anywhere (or I didn't look enought).
Logged
fl*p

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:characters' text speed
« Reply #1 on: April 10, 2003, 09:32:55 AM »

The complete syntax of the Talk method is:

actor.Talk(text, sound, duration, stances, text_align)

If you specify the sound file, the subtitle is displayed until the sound finishes. Otherwise you can specify the "duration" in milliseconds. If you don't specify it, the duration is calculated depending on the length of the text. This automatic calculation cannot be adjusted, although I could add some attribute to make that possible.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re:characters' text speed
« Reply #2 on: April 10, 2003, 10:12:17 AM »

The problem is that I don't have any speech and to specify every line in milliseconds it's not a good idea (it's slow, you have to test every line a few times.... e.t.c).
I think that the best idea is to be able to adjust the automatic calculation. Something like
actor.Talk("blah, blah, blah", 120%) so the duration will be the 120% of the automatic calculation.
Logged
fl*p

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:characters' text speed
« Reply #3 on: April 10, 2003, 10:40:42 AM »

Yes, I understand the problem. IMHO it would be much better to specify the "120%" (or something like that) as a Game's attribute instead of adding it to every Talk() call. I'll do that, it's gonna be easy.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re:characters' text speed
« Reply #4 on: April 10, 2003, 10:50:26 AM »

Yes, you are right, that would be the best method.
I hope this (easy) feature will be in the next build.
Logged
fl*p

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:characters' text speed
« Reply #5 on: April 10, 2003, 10:52:14 AM »

It will ;)
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Brassfire

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 69
    • View Profile
    • The Unknown Hero
Re:characters' text speed
« Reply #6 on: April 11, 2003, 12:22:05 PM »

If that is a game attribute, does that mean it would be possible to let advanced users modify the attribute in-game?

Like, would something like this be a way to avoid the problems certain commercial games ran into when computers got faster and therefore sped up games too much? (Open advanced options in the game, set the speed of calculation and talking, and then your game runs at a normal speed even on supercomputers. 8))

Just wondering.
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:characters' text speed
« Reply #7 on: April 11, 2003, 02:01:41 PM »

Quote
If that is a game attribute, does that mean it would be possible to let advanced users modify the attribute in-game?
Yes, if you expose the attribute to the user somehow (using some settings window etc.)


Quote
Like, would something like this be a way to avoid the problems certain commercial games ran into when computers got faster and therefore sped up games too much? (Open advanced options in the game, set the speed of calculation and talking, and then your game runs at a normal speed even on supercomputers. )
Well, this shouldn't be the case of WME, because all the timing in is based on time, not on the speed of the computer. But setting the subtitles speed will be handy; for slow readers :) and also different languages may need different subtitles speed.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Ravet

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 1
  • I'm NOT a llama!
    • View Profile
Re:characters' text speed
« Reply #8 on: April 12, 2003, 04:35:26 AM »

Hi
I'm new here

I'm discovering  the langage and I was wondering if I could add my own functions to 'predefined' objects eg :

function  actor.MyTalk(text, sound)
{
   actor.Talk(text, sound,  text.length() * my_coeff,  default_stuffs.....)

}

otherwise one solution could be

function talk(actor, text)
{
     actor.Talk(text,sound, text.length() * my_coeff, ....)

}

???
Logged

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re:characters' text speed
« Reply #9 on: April 12, 2003, 07:58:37 AM »

Mnemonic thanks for the Game.SubtitlesSpeed. That was really fast.

You said that it would be possibly to adjust the subtitles attribute while in-game. But (I think) the value the played has entered would be reset when he quits the game (unless he saves a game??? is that information saved in a savegame?). Wouldn't a method for creating a gamename.ini file would be handy in this thing? And also a method for reading that file (as I sujested in another post in the WishList forum). Maybe I am just saing stupid things (I am usually do this all the time. :( ) If this is the case  please ignore this post.  ;)
Logged
fl*p

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:characters' text speed
« Reply #10 on: April 12, 2003, 09:16:25 AM »

Quote
I'm discovering  the langage and I was wondering if I could add my own functions to 'predefined' objects eg :
No, unfortunately it's not possible at the moment. The problem is the script functions are local, they are not shared across multiple scripts, while the objects are... Although I'd like to do something about it, because sharing functions would be extra handy sometimes.


Quote
is that information saved in a savegame?
Yes, it is. But you're right it might not be always the best option.


Quote
Wouldn't a method for creating a gamename.ini file would be handy in this thing?
Well, WME allows you to read/write values from/to the Windows registry and IMHO that's equivalent to game.ini.

Code: [Select]
// save subtiles speed to te registry
Game.RegWriteNumber("SubtitlesSpeed", Game.SubtitlesSpeed);

// ...and restore it
// 70 is a default value, if the registry key doesn't exist yet
Game.SubtitlesSpeed = Game.RegReadNumber("SubtitlesSpeed", 70);

There are also Game.RegWriteString and Game.RegReadString methods available.


And if you insist on game.ini file :) you can use the new DLL functionality to call the native Windows functions for INI files:
Code: [Select]
external "kernel32.dll" bool WritePrivateProfileStringA(string lpAppName, string lpKeyName, string lpString, string lpFileName);
external "kernel32.dll" int GetPrivateProfileIntA(string lpAppName, string lpKeyName, int nDefault, string lpFileName);

function GameIniTest()
{
  // write to game.ini
  WritePrivateProfileStringA("MySettings", "SubtitlesSpeed", Game.SubtitlesSpeed, ".\game.ini");
 
  // read from game.ini
  Game.SubtitlesSpeed = GetPrivateProfileIntA("MySettings", "SubtitlesSpeed", 70, ".\game.ini");
}
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re:characters' text speed
« Reply #11 on: April 12, 2003, 11:31:49 AM »

OK...Thanks... I have read the manual about 100 times and
I could swear that I didn't find anything concerning the registry there (I hate when this happens) :(

One last question. Where does it store the values in registry?
Does the engine create a different directory for every game? If not then think about having two or more games created with wintermute engine. Then the settings from the second game could overwrite the setting from the first game if they share the same name (SubtitlesSpeed in our example). In this case your example  for using the kernel32.dll to create an .ini file will be a better solution. (I should thank you for that example... I know very very very little things about programming to think something like that. But I am able to create a simple demo with your engine which states that Wintermute engine is not only powerfull but also very easy!!!)

Also the game.ini file sounds like a better idea IMHO for two reasons:
1)The player can modify the games' settings while he is not playing the game and I always loved to be able to do that (Well, he can modify the registry too but I think that most of the people don't know how or don't want to mess with the registry).
2)It wouldn't leave traces in the registry after the uninstall.
« Last Edit: April 12, 2003, 11:39:31 AM by odnorf »
Logged
fl*p

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:characters' text speed
« Reply #12 on: April 12, 2003, 11:41:32 AM »

OK...Thanks... I have read the manual about 100 times and
I could swear that I didn't find anything concerning the registry there (I hate when this happens) :(
Yes, the documentation sucks, but I'm working on an updated version in this very moment :) Just give me some time to finish it.


One last question. Where does it store the values in registry?
Does the engine create a different directory for every game?
You can specify a registry path to be used in the project settings in ProjectMan. This registry path is later used for storing engine's internal settings and also for values stored using the functions mentioned above.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re:characters' text speed
« Reply #13 on: April 12, 2003, 12:01:19 PM »

Aaaaaaargh. I can't follow the response time you have. :)

And about the registry: AAAAAaaaaaaargh (again). I have been using that registry path in project settings but I forgot everything when I asked "where". But I have an excuse. :) I'm terrible sick right now and it seems that I can't think logically. :(

While you are creating the new documentation I think it's a good idea to include a link to Nullsoft installation system NSIS (it's what I'm using :) ). It's really powerfull and opensource.
http://www.winamp.com/nsdn/nsis/

Another engine is the Mad Engine (http://mad-project.sourceforge.net/
It's opensource and it's what the hero6 team is using to create their game. There are a few more engines but they are not finished yet.

Another great archiving utility is 7-zip http://www.7-zip.com/
It's opensource (GPL) and has the best compression ratio (but it can be slow sometimes).
« Last Edit: April 12, 2003, 12:37:31 PM by odnorf »
Logged
fl*p

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:characters' text speed
« Reply #14 on: April 12, 2003, 02:02:51 PM »

OK, thanks. I'll include those.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
Pages: [1] 2  All
 

Page created in 0.019 seconds with 20 queries.