Please login or register.

Login with username, password and session length
Advanced search  

News:

IRC channel - server: waelisch.de  channel: #wme (read more)

Author Topic: Playing Animations in Reverse, and more  (Read 3890 times)

0 Members and 1 Guest are viewing this topic.

greg

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 18
    • View Profile
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

Logged

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Playing Animations in Reverse, and more
« Reply #1 on: November 04, 2006, 08:31:32 AM »

1, nope. You have to create separate sprite.

2, nope. As usually, 1 is true, everything else is false. (Usually you use 1 for true, 0 for false thanks to binary origin of boolean logic).

3, I don't know if I get it here, but are you trying to call a C like pointer to variable? Then, it's not possible. You would have update your variable whenever your Scene property changes. Why not use Scene object directly though?

4, Look at your WME distribution folder into folder template. There is defined what each action (entity creation etc.) performs, so you
can make your own template with script instead of scr if you are so inclined.

Hope that helps.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Playing Animations in Reverse, and more
« Reply #2 on: November 05, 2006, 05:29:00 PM »

2, nope. As usually, 1 is true, everything else is false. (Usually you use 1 for true, 0 for false thanks to binary origin of boolean logic).
Not really, zero = false, non-zero = true. But of course, it only applies when converting integer values to boolean. WME uses a native boolean type for storing logical values.


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?
SceneState is a global variable, it retains the value for the entire game session. Scene variable changes as scenes are changed. Storing some property directly in Scene variable (Scene.Something = 1234;) is allowed, but the value is lost once the scene changes.


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).
The "scr" directory for creating new scripts in SceneEdit is hardcoded and currently it can't be changed.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Playing Animations in Reverse, and more
« Reply #3 on: November 06, 2006, 09:29:30 AM »

Mnemonic: then we ran into bug in WME:

Code: [Select]
var test = 5;

if (test == true) Game.Msg("TRUE");
else
Game.Msg("FALSE");

This prints FALSE

while the following prints true

Code: [Select]
var test = 5;

if (test) Game.Msg("TRUE");
else
Game.Msg("FALSE");

Or is this on design?
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Playing Animations in Reverse, and more
« Reply #4 on: November 06, 2006, 09:43:55 AM »

Well "5" is not equal to "true". You'd have to do something like

if(ToBool(test)==true) ...
« Last Edit: November 06, 2006, 09:46:00 AM by Mnemonic »
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Playing Animations in Reverse, and more
« Reply #5 on: November 06, 2006, 10:36:00 AM »

That's why I was suggesting using 1 and 0 in the original thread to avoid this confusion, because

if(test) is for some people shorthand to if (test == true).  While the former works, the latter doesn't.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Playing Animations in Reverse, and more
« Reply #6 on: November 06, 2006, 10:57:47 AM »

Ah, ok. Anyway, I would avoid comparing logical values with other types.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.046 seconds with 23 queries.