problem with the "mouse controlled" movement
hi to everybody.
i have a problem with the "mouse controlled movement".
i'm tring to create a pov game.
i want to create a gun so I load an image as an active object in the game. i give to this active the "mouse controlled" movement and i try to move it: the movement it's ok.
So i load another active object, a bullet, and i go to the event editor. I select this action: when user click with the mouse --> the gun shoot an object (the bullet). I go back to the frame editor, i try the frame but.. nothing!! i can move the gun but no shoot!!
So i tried to change the event. i tried to put a sound when the user click, to create an object and more but when i play the frame.. nothing!
It seems that an active controlled by the mouse blocks all the mouse clicks why???
Please help me whan can i do??
Re: problem with the "mouse controlled" movement
Don't use mouse controlled movement, it disables clicking conditions like that. Instead just set the object's position to XMouse and YMouse.
Re: problem with the "mouse controlled" movement
thanks for the very fast reply!
whan means set the object's position to XMouse and YMouse? the gun or the bullet?
Re: problem with the "mouse controlled" movement
Whichever object you had set to Mouse Controlled. Set it to Static instead, and in the event editor Always set its X Position to XMouse and its Y Position to YMouse. XMouse and YMouse are variables you can get from the Mouse & Keyboard object, the same one you use for mouse clicks and such.
Re: problem with the "mouse controlled" movement
ok i go on the event editor i put always as condition than what i have to select? set x position? and where i know the value?
Re: problem with the "mouse controlled" movement
ok great i did it!! Thank you my friend!
Re: problem with the "mouse controlled" movement
I had this same problem and followed your directions. It worked, I can shoot by clicking, but the mouse pointer is about 200 pixels above my active character (the one that shoots) so when i run the game the mouse pointer is sometimes above the application window and clicks the desktop, making my application no longer the active window. how can I get my mouse pointer to be level with my active character?
Re: problem with the "mouse controlled" movement
Ahh, nevermind I got it. It was the hotspot position!
Re: problem with the "mouse controlled" movement
I'm trying to set boundaries for my xmouse ymouse controlled character, as in walls. I tried making a quick backdrop set to "obstacle". Normally I can go in event editor and set movement to stop when he collides with it, but that option is grayed out. so i made the wall an active object. still the same. Then i set his movement to path and set no path. He still is mouse controlled and the option to set movement to stop when he hits the background/object/obstacle is no longer grayed but he still won't stop when he hits it. I'm thinking the set position to mouse over rides this movement stop. Is there any way to accomplish what I'm trying to do?
thanks.
Re: problem with the "mouse controlled" movement
It's because you're setting the object's coordinates, not *moving* to those coordinates with a movement. You can't "stop" because you're not moving.
If you want to lock the mouse cursor itself to inside your window you need to do that, say by using the "mouse movement", or one of several ways of locking the cursor to the window.
Re: problem with the "mouse controlled" movement
instead of always setting the position of the object to xmouse and ymouse, you could compare xmouse and ymouse to certain values, setting the object to move if the mouse is inside those coordinates.
Re: problem with the "mouse controlled" movement
Quote:
Originally Posted by kidz200
instead of always setting the position of the object to xmouse and ymouse, you could compare xmouse and ymouse to certain values, setting the object to move if the mouse is inside those coordinates.
This.