agimouse in Nagi

happyturk2 Okay. I'm trying to use nagi seeing as it's supposed to have mouse support, but there's something not right.

I've tried setting mouse_support to both 10 and 11 in the standard.ini file(wasn't sure which I should be using...) and in both cases, the interpretter registers the mouse(it brings menus down, etc) but none of my mouse-related code is working. I added the required section to the defines file, I was just using the standard mouse_button/mouse_x/mouse_y/etc.

It -seems- like what's happening is that it's not interpretting the code correctly, but I don't really know where to go from here. The intelligent thing to do would be to look at the tutorial on this site, but it's giving a 404, so that's not really a viable option.

If someone can just quickly tell me what steps I need to take here, it would be greatly appreciated. I've got the feeling I'm missing something simple.
Robin_Gravel in standard.ini file change the v2_default=pc by

v2_default=pc_buffbri

This way you'll use the agimouse using nagi.

Robin Gravel
happyturk2 Okay, did that, still not working. The mouse itself works in the menus still (but only if I set the mouse_support in the pc_buffbri definition in standard.ini to 1, 10 and 11 don't seem to work) but it's still not recognizing my code at all.

It's very basic test code at this point:

if(mouse_y >= 1 && mouse_y <= 19 && mouse_x >= 1 && mouse_x <= 41) {
if(mouse_button == mb_left) {
print("Click.");
}
}

Do I need to define my game manually in the standard.ini file? And if so, how does one generate the hex codes?
Robin_Gravel your codes should work unless the define.txt is not enclosed with your game.

I didn't saw a separate command pc_buffbri for agimouse 1.0 and agimouse 1.1 unless Nick was released a new nagi version i don't know.

You should try dg:the agimouse adventure game if it works on your computer under nagi. Dg uses agimouse 1.1.

Since dg is a public domain game, you can put it's codes on your game without my persmission.

Robin Gravel
sonneveld
happyturk2 wrote:

The intelligent thing to do would be to look at the tutorial on this site, but it's giving a 404, so that's not really a viable option.


On NAGI's site or on Brian's site? I hope there's no 404 errors on mine. please let me know if there is.

the AGI mouse spec defines certain variables as mouse_x 'n all that.. maybe you don't have the same variables.

var27 = button state
var28 = x
var29 = y

remember that x's range is 0-160 and y's range is 0-200

the x-range is so small because it's only an 8bit number.. and the y range includes the status bar, so you'll have to take that into account.

To turn on the mouse mode.. just need to do what robin suggests:

in [standard]
set
v2_default=pc_buffbri

- Nick
happyturk2 The 404 is on http://agisci.cjb.net/ , under the main AGI Mouse header, the link to the Agi mouse tutorial.

I set v2_default to pc_buffbri, added this to defines.txt:

#define mouse_button v27
#define mouse_x v28
#define mouse_y v29
#define mb_up 0
#define mb_left 1
#define mb_right 2
#define mb_middle 3

The code compiles fine, and runs under Nagi, but it just doesn't seem to be registering the fact that I'm clicking on the specified area. It -does- bring down menus, however.

Do I need the AGImouse executable in addition to Nagi? I thought that I didn't, but I wasn't certain...

AGI1122 No you don't need the AGIMouse executable and NAGI. You can use one or the other.
sonneveld The menu mouse event happens with or without agimouse.

Are you calling that unknown function to poll the mouse? You need to call that before trying to read in any mouse data. I don't know the particular function off hand though. robin? chris?

- Nick
Robin_Gravel The better advice I can give is to change the logic.0 to another number, extract logic.0 from dg: the agimouse game and load this logic to your game.

It should work unless you've changed the logics number between 90-99.

or put theres commands

else {
unknown171();
if (isset(f255)) {
if ((v30 == 0 ||
v32 == 1)) {
v2 = 4;
}
reset(f255);
}
}

at
new.script...
new.room
}
}

put the added commands here

Robin Gravel
happyturk2 Sorry I didn't reply sooner, my connection's been spotty at best. But yeah, I added that code to the appropriate place in logic 0 and it works fine now. Much thanks!