Problems with hotspot pointer thingies

Started by Gregjazz, Thu 02/06/2005 07:36:56

Previous topic - Next topic

Gregjazz

I'm having trouble with these new pointer things in AGS.

Code: ags
if (hotspot[Hotspot.GetAtScreenXY(mouse.y, mouse.y)].GetProperty("Direction") == 0) cur_mode = 0;


And it won't let me. In the older versions I could do this:

Code: ags
if (hotspot[GetHotspotAt(mouse.y, mouse.y)].GetProperty("Direction") == 0) cur_mode = 0;


Could someone please help me fast. Maybe this thread should be moved to the beginner's technical forum, too. :P

Rui 'Trovatore' Pires

Fast fast fast? := Ok, here's a fast help:

Hotspot *hot=Hotspot.GetAtScreenXY(mouse.y, mouse.y);
if (hot.GetProperty("Direction") == 0) cur_mode = 0;

Pity that it has to go in two lines. Me, I'm still waiting for the feature that lets us go,

if (Hotspot.GetAtScreenXY(mouse.y, mouse.y).GetProperty("Direction") == 0) cur_mode = 0;
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Gregjazz

Quote from: Rui "Brisby" Pires on Thu 02/06/2005 07:42:51
Fast fast fast? := Ok, here's a fast help:

Hotspot *hot=Hotspot.GetAtScreenXY(mouse.y, mouse.y);
if (hot.GetProperty("Direction") == 0) cur_mode = 0;

Pity that it has to go in two lines. Me, I'm still waiting for the feature that lets us go,

if (Hotspot.GetAtScreenXY(mouse.y, mouse.y).GetProperty("Direction") == 0) cur_mode = 0;


Can't believe I didn't think of that. Thanks so much for the quick reply!

Getting used to the new stuff in 2.7 is hard. But it makes more sense and is cooler... :)

Gilbert

Quote from: Geoffkhan on Thu 02/06/2005 07:36:56
Maybe this thread should be moved to the beginner's technical forum, too. :P
You're right probably. Also, descriptive topics.

Gregjazz

Quote from: Gilbot V7000a on Thu 02/06/2005 07:45:57
Quote from: Geoffkhan on Thu 02/06/2005 07:36:56
Maybe this thread should be moved to the beginner's technical forum, too. :P
You're right probably. Also, descriptive topics.

Heheh, thanks so much.

But see, I added an extra 'g' to the "arggh." :P

Won't happen again.

Gregjazz

Still need help...

I did a little test, like this:

Code: ags
Hotspot *walk = Hotspot.GetAtScreenXY(mouse.y, mouse.y);
walk.GetName(buffer);
lblStatus.SetText(buffer);


So that way it will display the name of whatever hotspot in a GUI. This is purely as a test.

It doesn't seem to be getting the right hotspot positions and stuff... almost like there are pieces of each hotspot strewn around. This is really weird. Arggh!

Rui 'Trovatore' Pires

Er, if that's a direct copy/paste, you got mouse.y twice instead of mouse.x,mouse.y...
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Gregjazz

#7
Quote from: Rui "Brisby" Pires on Thu 02/06/2005 09:03:47
Er, if that's a direct copy/paste, you got mouse.y twice instead of mouse.x,mouse.y...

...

I think I will go commit seppuku. Please excuse me.

I will cherish this as a classic moment. (Mouse.y, mouse.y). Brilliant. Genius. I seriously spent nearly 2 hours over this problem.

Let this be a lesson to you, kiddies.

EDIT: Must've been all this cranberry juice I've been drinking to keep myself awake. Clogged my brain passages, it did.

Rui 'Trovatore' Pires

#8
What is seppuku? If it's some dark ritualistic ceremony count me in!

EDIT - Go to sleep. :) Those are the kind of mistakes we make when it's 1am, we NEED to go to sleep, but we still want to figure out just that one more line of code. Just Say No!
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

nihilyst

offtopic: As far as I know, seppuku is, what we usually call hara-kiri.

Or something like that. ;)

Rui 'Trovatore' Pires

even more offtopic: Sounds like fun.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

SMF spam blocked by CleanTalk