Left MB event
Left MB event
Hello Everyone!
I have written a story I want to publish as P&C game and after some testing and evaluation I did choose this tool.
I’m going to use Coin interface, but I having some problems with it.
Does anyone know how to detect ‘Walk to’ event? If I have an Object on a Room and it has some script, ‘Walk to’ does nothing (Why?), so I need to do it manually. If I catch ‘On (click)’ event, I can make my Hero walk to Object. Now both mouse buttons do the same, resulting that Left MB does what I want, but the Right MB does the same and only after that opens the Coin.
How to detect Left MB event?
How to open Coin manually?
Thanks!
I have written a story I want to publish as P&C game and after some testing and evaluation I did choose this tool.
I’m going to use Coin interface, but I having some problems with it.
Does anyone know how to detect ‘Walk to’ event? If I have an Object on a Room and it has some script, ‘Walk to’ does nothing (Why?), so I need to do it manually. If I catch ‘On (click)’ event, I can make my Hero walk to Object. Now both mouse buttons do the same, resulting that Left MB does what I want, but the Right MB does the same and only after that opens the Coin.
How to detect Left MB event?
How to open Coin manually?
Thanks!
how to detect left MB is also a question which I wanted to ask .
but to open coin manually you just have to disable the Auto-Popup of Coinmenu in the project setup and use popupcoin().
from the pac-dk manual:
but to open coin manually you just have to disable the Auto-Popup of Coinmenu in the project setup and use popupcoin().
from the pac-dk manual:
popupcoin ()
Makes your coin-interface appear. Only necessary if autopopup was disabled for the coinmenu.
me2. I tried different things.Oxilon wrote:But I’m still having the ‘Walk to’ problem.
Atm my script in every objekt looks like that:
Code: Select all
on(mouse)
{
instmouse(1)
setnum(walkx;8)
setnum(walky;16)
}
on(look)
{
.....
}
on(use)
{
......
}
Code: Select all
on(click)
{
walkto(self;[walkx];[walky])
command(use)
}
Now, if you rightclick an object, first the Coinmenu appears. That's great and I wanted this to be like that. But if i do the normal leftclick and my mouse is over the object the character doesn't do anything.
If I use on(click) in my object to make my character walk to the object then he walks first and after that the coinmenu appears.. It's bad that there is no on(leftclick) command.
Maybe there's another clever solution but I don't know it .
EDIT: Hehe . I've got it .
It's as simple as effective.
Just deactivate the auto-popup of the coinmenu and write this into the script of your object:
Code: Select all
on(mouse)
{
instmouse(1)
setnum(walkx;8)
setnum(walky;16)
}
(* important *)
on(rightclick)
{
popupcoin()
break()
}
on(click)
{
walkto(self;[walkx];[walky])
}
on(look)
{
........
}
on(use)
{
........
}
If you click right, the coinmenu appears and the rest of the script is not used (break) and the on(click)-event is not executed. if you click left, the on(rightlick) event does not any effect and the on(click)-event is used.
if you click right the coinmenu appears first. And if you click one of the coin-buttons the character walks to the point [walkx]/[walky] and then the on(command)-Event is executed.
Try it out. It works .
This break() didn’t work for me so I did it this way:
Code: Select all
on (mouse)
{
showinfo (Plate ; false)
setnum(WalkX; 7)
setnum(WalkY; 16)
setbool(RMB; false)
}
on (rightclick)
{
popupcoin()
setbool(RMB; true)
}
on (click)
{
if_bool(RMB; false)
{
walkto(self; [WalkX]; [WalkY])
setbool(RMB; false)
}
}
@Shiman
Hab da mal was im Forum gesehen :
Oxilon wrote:This break() didn’t work for me so I did it this way:
Code: Select all
on (mouse) { showinfo (Plate ; false) setnum(WalkX; 7) setnum(WalkY; 16) setbool(RMB; false) } on (rightclick) { popupcoin() setbool(RMB; true) } on (click) { if_bool(RMB; false) { walkto(self; [WalkX]; [WalkY]) setbool(RMB; false) } }
Es gibt 10 Arten von Usern :
die, die Binärcode verstehen und die, die es nicht tun....
----------------------------------------------------------
STAR TREK FYNE :
http://www.fynegames.homepage.t-online.de
die, die Binärcode verstehen und die, die es nicht tun....
----------------------------------------------------------
STAR TREK FYNE :
http://www.fynegames.homepage.t-online.de
Ups - da bin ich wohl noch im verkehrten Thema hängengeblieben - das sollte eigentlich in den Neuesten Thread - da meintest Du, dass da irgendwo noch was Nützliches rumgeistern müsse aber nicht wiesst, wo...
Es gibt 10 Arten von Usern :
die, die Binärcode verstehen und die, die es nicht tun....
----------------------------------------------------------
STAR TREK FYNE :
http://www.fynegames.homepage.t-online.de
die, die Binärcode verstehen und die, die es nicht tun....
----------------------------------------------------------
STAR TREK FYNE :
http://www.fynegames.homepage.t-online.de