Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Author Topic: on LeftDoubleClick  (Read 3793 times)

0 Members and 1 Guest are viewing this topic.

valter.home

  • Supporter
  • Occasional poster
  • *
  • Karma: 1
  • Offline Offline
  • Gender: Male
  • Posts: 55
    • View Profile
on LeftDoubleClick
« on: October 08, 2015, 04:11:32 PM »

Hello everybody, I would like to know if this is the correct way to proceed.
The character walking with left click but runs with the double left click.
At the moment I just move it without animation.
If in game.script simply I insert the code:

on "LeftDoubleClick"
{
    actor.SkipTo (Game.MouseX, Game.MouseY);
}

the character moves to the mouse but immediately after comes back and starts walking because it probably runs on "LeftClick"
If you use:

on "LeftDoubleClick"
{
    actor.SkipTo (Game.MouseX, Game.MouseY);
    actor.Reset ();
}

the character is not coming back.
Is this the right way to write this code?

Thank you

Valter
Logged

eborr

  • Regular poster
  • ***
  • Karma: 4
  • Offline Offline
  • Posts: 196
    • View Profile
Re: on LeftDoubleClick
« Reply #1 on: October 10, 2015, 12:38:59 AM »

Hello Valter you are using the wrong command for "Walking" you need to use GoTo check the scripting reference under actor.

SkipTo is more a teleport than a move
Logged

valter.home

  • Supporter
  • Occasional poster
  • *
  • Karma: 1
  • Offline Offline
  • Gender: Male
  • Posts: 55
    • View Profile
Re: on LeftDoubleClick
« Reply #2 on: October 10, 2015, 07:49:09 AM »

Hello Eborr , thanks for your answer.
I explained myself badly, I know the difference between GoTo () and SkipTo ().
Forget what I said about the run.
If I want to move the character without walking using SkipTo() in on "LeftDoubleClick" event the character jumps to the coordinates of the mouse but immediately reappears where it started and walking the same path. I think that happens so because run the event on "LeftDoubleClick" but also on "LeftClick". Am I wrong?
If after SkipTo()  I write actor.Reset() the character stays in place.
Logged

anarchist

  • Regular poster
  • ***
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 212
    • View Profile
Re: on LeftDoubleClick
« Reply #3 on: October 10, 2015, 11:09:19 PM »

To make sure, first try using the Debug(); command in LeftClick event to see if its code runs together with LeftDoubleClick.
Logged

valter.home

  • Supporter
  • Occasional poster
  • *
  • Karma: 1
  • Offline Offline
  • Gender: Male
  • Posts: 55
    • View Profile
Re: on LeftDoubleClick
« Reply #4 on: October 11, 2015, 05:01:12 PM »

Thanks, I did not know yet that way, I'm studying  :)
Logged
 

Page created in 0.022 seconds with 23 queries.