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: controlling scene with mouse  (Read 5057 times)

0 Members and 1 Guest are viewing this topic.

megane

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 13
    • View Profile
controlling scene with mouse
« on: April 06, 2010, 10:25:29 PM »



Hello All,


I searched on forum and documantation.Also i tried alot of methods.but i couldnt do it :)

İ can move scene by keyboard like this

on "Keypress"
{
 
 
if (Scene.CanHandleEvent("Keypress")) Scene.ApplyEvent("Keypress");



switch(Keyboard.KeyCode)
{
case VK_UP:

      Scene.SkipTo(posX, posY-50);
     posY=posY-50;
     break;
    
case VK_DOWN:

      Scene.SkipTo(posX, posY+50);
     posY=posY+50;
     break;

case VK_LEFT:

      Scene.SkipTo(posX-50, posY);
     posX=posX-50;
     break;
    
case VK_RIGHT:

      Scene.SkipTo(posX+50, posY);
     posX=posX+50;
     break;

}

i can move scene with left click like this

on "LeftClick"
{

Scene.SkipTo(Scene.MouseX, Scene.MouseY);
}



But i cant move scene by mouse over :(

What should i do ?




Best Regards.
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: controlling scene with mouse
« Reply #1 on: April 06, 2010, 10:55:48 PM »

Put this to the end of your scene_init.script file for the scene in question.

Code: WME Script
  1. while (1)
  2. {
  3.    Sleep(60);
  4. }
  5.  
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

megane

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 13
    • View Profile
Re: controlling scene with mouse
« Reply #2 on: April 06, 2010, 11:17:34 PM »

Put this to the end of your scene_init.script file for the scene in question.

Code: WME Script
  1. while (1)
  2. {
  3.    Sleep(60);
  4. }
  5.  



Oh really thanks!

I hope that to solve this engine ,i liked it :)

Logged

megane

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 13
    • View Profile
Re: controlling scene with mouse
« Reply #3 on: April 08, 2010, 09:47:48 AM »



Hello ,


İ have different problem.Your code works but so fastly ,also my keyboard code doesnt work with this?
Actually i want to move my scene with mouse over but i couldnt it.
if there is a sample game for this based WME , Can you tell me? i can understand well with a sample.



Best Regards.
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: controlling scene with mouse
« Reply #4 on: April 08, 2010, 11:09:32 AM »

hello,

it was just an example of the principle, not meant to be a working game code. AFAIK there's no game yet with working direct mouse control.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

megane

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 13
    • View Profile
Re: controlling scene with mouse
« Reply #5 on: April 09, 2010, 12:41:18 PM »



This is bad :)

I have idea. background entity has mouse over.. right?
when i came to over backgorund.skipto scene..something like this.. maybe it work.
Can i access backgorund with mouse over?
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: controlling scene with mouse
« Reply #6 on: April 09, 2010, 01:10:47 PM »

please rephrase. I totally don't understand what are you trying to achieve. If you wrote that more clearly, I might be able to help you better.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

megane

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 13
    • View Profile
Re: controlling scene with mouse
« Reply #7 on: April 09, 2010, 05:14:23 PM »



Sorry my english is very crazy :)

Which things can i access with MouseEntry event?
for example: can i access background entity? actors?

if it is possible, it might be usefull for me.


Thanks again.
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: controlling scene with mouse
« Reply #8 on: April 09, 2010, 06:26:22 PM »

what do you mean by "access". Can you tell me a little use case. (eg. "actor stands in the scene, if I place the mouse cursor over it, he dies" :))
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

megane

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 13
    • View Profile
Re: controlling scene with mouse
« Reply #9 on: April 09, 2010, 06:44:38 PM »



yes true.. i meant something like your example.
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: controlling scene with mouse
« Reply #10 on: April 09, 2010, 07:00:51 PM »

then it's standard behavior. Attach a script to your entity in scene editor. In this script write:

Code: WME Script
  1. #include "scripts\base.inc"
  2.  
  3. on "MouseEntry"
  4. {
  5.     Game.Msg("Your mouse entered this entity");
  6. }
  7.  
  8.  
  9. on "MouseLeave"
  10. {
  11.     Game.Msg("Your mouse exited this entity");
  12. }
  13.  
  14. on "LeftClick"
  15. {
  16.     Game.Msg("Your mouse clicked this entity");
  17. }
  18.  

make sure your entity is set to interactive in Scene Editor.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet
 

Page created in 0.025 seconds with 21 queries.