Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Mr_Threepwood2

#1
OK I figured it out, had to do a bit of extra stuff to get it to work.


Code: ags

  if (Game.GetLocationName(mouse.x, mouse.y)==""){

		  lblStatus.TextColor=47104;
		  if (mouseAnimating==true){
		    
		    Mouse.ChangeModeGraphic(mouse.Mode, mouseGraphicToUse);
		    mouseAnimating=false;
		    }
		    
		    
}else{
		  lblStatus.TextColor=63488;
					if (mouseAnimating==false){
					mouse.ChangeModeView(mouse.Mode, mouseViewToUse);
					mouseAnimating=true;
		    }
	}



Where mouseGraphicToUse stores the graphic for the current mode, and mouseViewToUse stores the view for the current mouse mode.  I tried to explain my situation about using the easy AGS animation control, here's why I couldn't.

1.  It doesn't animate over inventory icons which I don't like.
2.  I have usermode 8 being 8 effective cursors and each should have different icons, so I can't just switch the views and graphics for it to animate.


What would really be cool in AGS is if all cursors were views no matter what, and just stayed in frame 1 of the view regularly.  I think that would give you better control since then you could do something like mouse.animate, and mouse.goToFrame which would give you more control over it.
#2
OK so here's my situation.

I've set up a Lucas arts style GUI and now I am trying to get the mouse to animate when it goes over hotspots, objects, inv items, etc.  Since I am using mouse mode 8 for most of the game, I knew I'd have to script this in to repeatedly execute.


Here's some of what I have in repeatedly execute
Code: ags

  if (Game.GetLocationName(mouse.x, mouse.y)==""){
		  lblStatus.TextColor=47104;
		  if (mouseAnimating==true){
		    Mouse.UseDefaultGraphic();
		    }
		    
		    
}else{
		  lblStatus.TextColor=63488;
					if (mouseAnimating==false){
					mouse.ChangeModeView(mouse.Mode, mouseViewToUse);
					mouseAnimating=true;
		    }
	}




Now the thing that is the strangest to me is that after I hover over something (it does start to animate at this point) then hover off, it goes to view frame 2 of the view that it was on.  I can't figure out why it isn't going to the one that is set at the default in the editor.


The whole thing with mouse.changeModeView seems odd to me, I was hoping that there was more of a way to control it.  Like if passing -1 to it made it stuck in view frame 1 or something, then I could just keep it always on a view.

So does changeModeView affect the default graphic somehow?  Am I going about this whole business of changing the cursor wrong (considering I will have to use about 8 different views for usermode 8 since it will act as several cursors that all animate over spots)?

Edit:

When I was doing that I was testing around, now I've added this to the first if statement:

Code: ags

		    mouse.ChangeModeView(mouse.Mode, -1);
		    mouseAnimating=false;



and it now goes back to the original graphic.  Is there a better way to control all this business with cursors animating over spots?  So far everything I've done with the cursors has been more or less trial and error.
#3
So you're saying this:

I use a global variable to keep track of the mode, no matter what the current mode is.

If the player clicks use or give on an inventory item, set the global variable appropriatly (so that the status line will still be right), and switch to cursor mode 4.

This will mean that I have to use AGS' default unhandled_event since unhandled calls through mouse mode 4 will happen there.

This also means that for some hotspots/objects I will need to use two of the event triggers (usermode 1, and use inv on object).



That actually sounds pretty good, since it would preserve the inventory item hotspots, and can seperate some of the longer code (since using an inv item on an object may do several things).

The one thing I don't like about it though is having to use the unhandled_event, I can deal with that though it's not so bad.
#4
Yeah maybe I'll just give them all the same hotspot, it would be much easier for something that most people don't even notice anyways.  Plus all inv items have to be the same size to look good in the inventory window anyways, so this shouldn't be a big deal.

I'm thinking that I'll do it all using mode 8 and 0 now since I considered this:

If I do use cursor mode 4 for use inv then it will split up some scripting which makes things uglier, plus I'll still have the same cursor problem when I do "give inv" anyways, so I might as well solve them both the same way.

Great to get this step of the game out of the way, it's what I considered the hardest on my last (still in development, on hold since artist is busy) game.  Last game I also used the global int style but I had just started AGS so I didn't understand a lot of what I was doing, and I didn't change the icons.

Hopefully all goes well with my current project, the biggest problem I always have is getting the artists to keep doing drawings.  The friend I'm working with is pretty committed though so hopefully we can actually get something done.

FYI I am also Mr_Threepwood on these forums but my old email account is gone, and I can't remember the password, hence Mr_Threepwood2 was born.
#5
Ok I think I'm going to go with the global int option since it keeps the code less spread out and doesn't require additional calls to an unhandled event.

The only problem I am facing here is the "Use inv" problem, if I use usermode 8 always is there a way that I can set the cursor to be the active inventory's icon, while preserving the hotspot position of the inventory item that I made in AGS (like where the cursor counts as being over a spot).

I know I can do something like get the active inv and then gets its graphic, but will that change the hotspot of the item as a cursor?

Edit:

Or perhaps the answer is to still keep "use inv" as usermode 4 somehow?

I'd really like to get this part right as it will effect the whole game so I'm trying to find benefits/problems with ways of doing it.  Looking through the help file there doesn't seem to be a cursor.setToInv type thing that preserves the hotspot.  My understanding of cursor mode 4 though is that it is native to the game and has to be called by cursormode 2, which would mean that if I had use as part of the global int I'd have to process a fake click on the inv item (or make use always be usermode 2, and just have the rest as 8 with a global int).
#6
I'm fairly sure that cursors past usermode 2 don't make the call to unhandled_event, I was doing it the way you suggested before and it wouldn't make the call (unless you manually called it using the any click action).

Why would grouping them all together be more beneficial do you think?  Just so the code is more compact and not spread out in different sections?

Another solution I came up with is essentially a combo of 1 and 2, it involves making usermode 2 be two cursors (open and close) using a global into to keep track of them, while the rest of the actions all have their own cursor.


The main concern I have is speed, if I do it all using a global int will it cause more slowdown changing cursor icons all the time than the built in way that AGS does it?  Some of the stuff we plan on doing will be pressing AGS (though we're going to try and workaround thinks like screen filters since those really slow down the game), not to mention the game will be 640x480.
#7
I have read several threads about Lucas Arts style of GUI, I have even made a fully working one before.  The problem I am now facing is more of a "will I trap myself by making it this way" style question.

Basically I have two ideas for making a Lucas Arts Style GUI.

IDEA 1:

This is the idea involves making separate cursors for every cursor mode, which will let me use those nice and easy drop down selections for most of the interactions.  A status line will be based off the current mouse mode.  The problems I am looking at with this style are I don't know if it will cause some troubles setting up a right click (which will do the default interaction on an object), and it will involve some extra coding for.  Another big problem here is unhandled_event won't get called for cursors past 9 (usermode 2).

IDEA 2:

Make the cursor always use usermode 1 unless walking or clicked use on an inv item.  So the actual "mode" of the cursor remains the same but it can be changed using a global int that represents the real mode I'm on.  This means that all interactions will have to dealt with using code under the "any click on" property of objects, characters etc.  Another problem I may have here is that I don't know how I'd go about setting the "use inv" up, and how I'd go about having animated cursors since the cursor is never really changing from usermode 1 (I guess I could set up a function to swap the cursor view based on the global int?).
SMF spam blocked by CleanTalk