Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Morrowind style game ITEM COLLECTION WITH MOUSE

Author
Message
aprilfan
23
Years of Service
User Offline
Joined: 3rd Oct 2002
Location: Hell
Posted: 5th May 2003 01:53 Edited at: 5th May 2003 01:56
I borrowed this from good ol' Planet Potter and I want to use it to pick up objects (hide them) like you do in morrowind... So whats wrong with it? I can't get the objects to disappear.


if mouseclick = 1
for p=34 to 38
if object visible(p)=1
sx=object screen x(p)
sy=object screen y(p)
mx=mousex() : my=mousey()
if mx>sx-100 and mx<sx+100 and my>sy-100 and my<sy+100
hide object p
endif
endif
next p
endif

We could have handled that better.
APEXnow
Retired Moderator
23
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 5th May 2003 02:07 Edited at: 5th May 2003 02:11
I'm not sure but are the signs of your Y conditions supposed to be the other way round? The best thing to do is actually use the Text command and display the co-ordinates of each of the mouse and objects to see that your values are within range of the object position.

"Man who looses key to woman's appartment...... He get no nookie" - A wise chinese man.
aprilfan
23
Years of Service
User Offline
Joined: 3rd Oct 2002
Location: Hell
Posted: 5th May 2003 02:14
ok I'll try. Thanks!

We could have handled that better.
aprilfan
23
Years of Service
User Offline
Joined: 3rd Oct 2002
Location: Hell
Posted: 5th May 2003 02:30
what did you mean "are the signs of your Y conditions supposed to be the other way round?" I think the problems with the inequality, so explain please.

We could have handled that better.
APEXnow
Retired Moderator
23
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 5th May 2003 02:46
Sorry, thats my fault, I was thinking in terms of the axis of the object and the co-ordinates of the mouse being opposite but obviously the mouse and object screen positions should be of the same co-ordinate mapping. I.e. 0,0 is top left, 640, 480 is bottom right etc. But still, try actually displaying the co-ordinates of the object and mouse to see if the ranges are correct, and also place the sx-100, sx+100, sy-100 and sy+100 in brackets to ensure there's no confusion of B.O.M.D.A.S

"Man who looses key to woman's appartment...... He get no nookie" - A wise chinese man.
David T
Retired Moderator
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 5th May 2003 19:15
Isn't it B.O.D.M.A.S?

Anyway, this is some much simplified code:



You are the th person to view this signature.
Programmers don't die, they just Gosub without return....
APEXnow
Retired Moderator
23
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 6th May 2003 00:58
It's one or the other LOL. Have you managed to get it to work yet?

"Man who looses key to woman's appartment...... He get no nookie" - A wise chinese man.
aprilfan
23
Years of Service
User Offline
Joined: 3rd Oct 2002
Location: Hell
Posted: 6th May 2003 03:34
no It still dosn't work thanks anyways but I might just do math collision.

We could have handled that better.
The Communist
23
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Cyberspace
Posted: 6th May 2003 11:56
the OBJECT IN SCREEN() command is really buggy for me... that might be the problem.

Arise ye workers from your slumbers, Arise ye prisoners of want, For reason in revolt now thunders, And at last ends the age of cant!

Workers of all lands, Unite!
APEXnow
Retired Moderator
23
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 6th May 2003 16:44
I did remember reading somewhere that the command also appears to detect objects even behind the camera, but I'm not sure whether this has been fixed or not. I'm sorry I couldn't be of anymore help. I hope you do get it working though

"Man who looses key to woman's appartment...... He get no nookie" - A wise chinese man.
Fluffy Paul
23
Years of Service
User Offline
Joined: 16th Dec 2002
Location: United Kingdom
Posted: 8th May 2003 19:18
Yeah, it's been fixed in patch 4. OBJECT IN SCREEN now works.

Ending a sentence with a French word is so passé

Login to post a reply

Server time is: 2026-07-11 08:46:52
Your offset time is: 2026-07-11 08:46:52