Problem with ChangeModeView

Started by , Fri 23/02/2007 03:06:00

Previous topic - Next topic

Dag

My plan is: when the mousecursor moves over a hotspot which represents an exit to a new room, i want to change the mousecursor into an arrow, pointing towards the direction of the exit. So i have made 3 views with arrows pointing either up, left or right.

I have set the cursor to change into an arrow when over an exit-hotspot, but
when my mousecursor moves over an exit on the left side of the screen i want to use the view i made with an arrow pointing left. Then the ChangeModeView function seems like just the thing im looking for. BUT no matter where in the script i put the command the view remains the same, and i only got an arrow pointing right.

the line i wrote for mouse over hotspot is:

mouse.ChangeModeView(eModePickup, VIEW11);

    (i use the pickupmode for my arrow, and arrow pointing left is for me view11)

after this the view for my cursor when moving over the acual hotspot was still 9 (the view for arrow pointing right) in other words, nothing changed.

then i tried just entering the numeric value of the view instead of its name :

mouse.ChangeModeView(eModePickup, 11);

Still no change, the arrow is still pointing right.

Then i got a bit confused, seemed to me that the ChangeModeView simply didnt work, so i tried changing the cursor view under "player enters room" just to be sure, but the arrow is still stuck on view 9.

How do i get this to work?

In short, what i want is, my cursor to change into an arrow pointing left if my cursor is over a door on the left side of the screen. Same thing, only pointing right, when the mouse is over a door on the right side.




Khris

I've never used this interaction, so I'm not sure what went wrong, but fortunately one doesn't have to put this code into every hotspot's mouseover-interaction.

There's was a very similar question some time ago which I've answered here:
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=29123.msg371031#msg371031

Dag

hmm, i tried following the instructions at the link u posted, but when i try to save the game after editing the script i get an error-message saying theres not enough parameters to call function :S 

Khris

#3
I was able to spot the error just by looking at the code, but PLEASE post the EXACT error message, the line number and the related code snippet next time. Are we supposed to help, or are we supposed to take wild guesses...?

The last line of the code I've posted is supposed to be:

mouse.ChangeModeView(eModeWalkto, DEFAULT);

Edit:
BTW, you could've easily solved this problem on your own.
A simple search in the manual:
http://www.adventuregamestudio.co.uk/manual/Mouse.ChangeModeView.htm

Sorry for this ranty post.

Dag

I cencerely apologize, i did not know that the line number was relevant as i thought my script lines were unique for me:S

As for easily solving this on my own, i did sit for 2 whole days trying to figure it out  on my own before i posted anything, reading every word in the manual 10 times, and as i stated in my first post i was using the command from the manualpage u linked, so i clearly have seen it. I still cant get it to work and i still dont understand what im doing wrong.  But i guess i will wait with posting here again until i am a lot more comfortable with scripting as it seems my problems doesnt even qualify for the beginners tech-forum:P

Again, i do apologize, i did not know i was causing any inconvenience:(

Scorpiorus

Quote from: Dag on Fri 23/02/2007 03:06:00...no matter where in the script i put the command the view remains the same, and i only got an arrow pointing right.

I would recommend check your script for Mouse.ChangeModeView() being invoked from within repeatedly execute. Maybe it's repeatedly changed back to view 9?

Khris

Quote from: KhrisMUC on Fri 23/02/2007 10:35:11you could've easily solved this problem on your own
I wasn't talking about why you opened this thread, I was talking about "not enough parameters". And you're right, the line number won't help, but the line causing the error would have helped. :)

I didn't test my code, and I've just noticed that it probably won't work for animated cursor views. I'll test it and report back.

SMF spam blocked by CleanTalk