Please login or register.

Login with username, password and session length
Advanced search  

News:

This forum provides RSS feed. To query recent posts use this url. More...


Author Topic: Skip moving  (Read 4471 times)

0 Members and 1 Guest are viewing this topic.

Suninho

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 6
    • View Profile
Skip moving
« on: January 17, 2014, 07:34:59 PM »

Hi Everyone,
I'm beginner with WME. I have got a little problem. In my Game, Actor goes normally - where I click there he goes, but i wanna skip this if I doubleclick. I tried to write this code to scene.script : on "LeftDoubleClick"{ ... SkipTo(..)...}. Actor jumps to new position, but he immediately get back at old position and goes to new one.

Do you know any solution? Thx.

Sorry for my english...
Logged

piere

  • Supporter
  • Frequent poster
  • *
  • Karma: 4
  • Offline Offline
  • Posts: 301
  • Sorry for any bad english in my posts. Game on !
    • View Profile
Re: Skip moving
« Reply #1 on: January 18, 2014, 11:00:06 AM »

Is this a 2D or 3D character?
Logged

Suninho

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 6
    • View Profile
Re: Skip moving
« Reply #2 on: January 18, 2014, 06:31:38 PM »

2D character
Logged

piere

  • Supporter
  • Frequent poster
  • *
  • Karma: 4
  • Offline Offline
  • Posts: 301
  • Sorry for any bad english in my posts. Game on !
    • View Profile
Re: Skip moving
« Reply #3 on: January 19, 2014, 09:32:42 AM »

This is most likely due to your Hot Spots in your .Sprite file. Make sure to hit the apply to all button to make sure they are also the same. Also check your Move By settings
Logged

NAItReIN

  • Occasional poster
  • **
  • Karma: 1
  • Offline Offline
  • Posts: 69
    • View Profile
Re: Skip moving
« Reply #4 on: January 19, 2014, 10:29:00 AM »

Try this:

Code: WME Script
  1. #include "scripts\base.inc"
  2.  
  3. ////////////////////////////////////////////////////////////////////////////////
  4. on "LeftClick"
  5. {
  6.   // when the scene is left-clicked, just send the actor to the specified point
  7. }
  8.  
  9. on "LeftDoubleClick"
  10. {
  11.   actor.Reset();
  12. }
Logged

Suninho

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 6
    • View Profile
Re: Skip moving
« Reply #5 on: January 19, 2014, 03:21:20 PM »

Yep, it works! thx...

EDIT: Nope, its not good. With doubleclick character skip out of the walkable area... but its maybe a problem with function SkipTo()...
« Last Edit: January 19, 2014, 07:47:34 PM by Suninho »
Logged

NAItReIN

  • Occasional poster
  • **
  • Karma: 1
  • Offline Offline
  • Posts: 69
    • View Profile
Re: Skip moving
« Reply #6 on: January 20, 2014, 03:01:34 PM »

I added a condition to scene.script.

Code: WME Script
  1. #include "scripts\base.inc"
  2.  
  3. on "LeftClick"
  4. {
  5. }
  6.  
  7. on "LeftDoubleClick"
  8. {
  9.   {
  10.         actor.SkipTo(Scene.MouseX, Scene.MouseY);
  11.         actor.Reset();
  12.   }
  13. }
Logged
 

Page created in 0.058 seconds with 25 queries.