Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by dr_panther. 05/18/24 11:01
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (7th_zorro, dr_panther), 724 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
mouse_ent A8 #403231
06/16/12 19:20
06/16/12 19:20
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline OP
Expert
Germanunkol  Offline OP
Expert

Joined: Jun 2006
Posts: 2,640
Earth
Hi,

Again, a problem when upgrading to A8: "mouse_ent" is always NULL, no matter where I move the mouse.

Code:
while(1)
	{
		draw_text(str_for_num(NULL, mouse_range), 200,150, vector(200, 250,250));
		if(mouse_ent)
		draw_text(str_for_entfile(NULL, mouse_ent), 200,100, vector(200, 250,250));
		else
		draw_text("nil", 200,100, vector(200, 250,250));
		wait(1);
	}


I wrote this code to help me debug: it always prints nil.
Mouse_range is 99999.
Tried with mouse_mode 4 and 0.


~"I never let school interfere with my education"~
-Mark Twain
Re: mouse_ent A8 [Re: Germanunkol] #403236
06/16/12 20:35
06/16/12 20:35
Joined: Mar 2006
Posts: 1,993
Karlsruhe
PadMalcom Offline
Serious User
PadMalcom  Offline
Serious User

Joined: Mar 2006
Posts: 1,993
Karlsruhe
Your mouse_range might be too low.

Re: mouse_ent A8 [Re: PadMalcom] #403242
06/16/12 22:50
06/16/12 22:50
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
FoxHound Offline
Expert
FoxHound  Offline
Expert

Joined: Jun 2004
Posts: 2,234
Wisconsin USA
How wide is the model? Make a square that is just plain silly huge in it's width. If it is still null then assign that square the handle "player" and check to see if mouse_ent is player. I don't always trust "if(mouse_ent)" type equations when it comes to pointers.


---------------------
There is no signature here.


QUIT LOOKING FOR ONE!
Re: mouse_ent A8 [Re: FoxHound] #403254
06/17/12 07:35
06/17/12 07:35
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline OP
Expert
Germanunkol  Offline OP
Expert

Joined: Jun 2006
Posts: 2,640
Earth
Thanks for your replies!

My level IS way too large (back when we started, I made everything to fit the player model) but 99999 should be enough to touch something when I fly close to it. I even tried the highest number the integer can hold. It can't be too low (it always worked in A7 and with the older shadeC - it might also be shadeC).

The code above was only for testing purposes, that's not the real code that tries to work with mouse_ent. The actual code checks mouse_ent == NULL as far as I remember (I'm not at home right now). Still, if(mouse_ent) is the correct syntax, I believe the only time these don't work is when there's multiple terms, like this:
if(a==b && mouse_ent) //this fails sometimes
but
if(mouse_ent) should work.

Funny thing is: even IF shadeC had an entity that blocked it all, then it should either print the name of that entity, or - if the entity is UNTOUCHABLE then it should print the name of the entities behind it, meaning the level entities that I want to get -.-
But it just sticks to "nil".


~"I never let school interfere with my education"~
-Mark Twain
Re: mouse_ent A8 [Re: Germanunkol] #403257
06/17/12 07:50
06/17/12 07:50
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Ive used mouse_ent a few times in A8, and had no problems.

So if it really is the "if(a==b && mouse_ent)" that is failing,
have you tried it as "if((a==b) && (mouse_ent))" instead?


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: mouse_ent A8 [Re: EvilSOB] #403259
06/17/12 07:52
06/17/12 07:52
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline OP
Expert
Germanunkol  Offline OP
Expert

Joined: Jun 2006
Posts: 2,640
Earth
No, sorry, I wasn't clear on that:
I'm not using "if(a==b && mouse_ent", I'm just saying that this could fail, but if(mouse_ent) - which I AM using - should not.


~"I never let school interfere with my education"~
-Mark Twain
Re: mouse_ent A8 [Re: Germanunkol] #403276
06/17/12 13:35
06/17/12 13:35
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Hm you can easily write the mouse_ent feature yourself (using mouse_dir3d and c_trace), I suggest you give that one a try and compare the results.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: mouse_ent A8 [Re: Superku] #403280
06/17/12 16:05
06/17/12 16:05
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
FoxHound Offline
Expert
FoxHound  Offline
Expert

Joined: Jun 2004
Posts: 2,234
Wisconsin USA
start a new project and try this code. If it works then, then there is something else in your code that could be affecting it.


---------------------
There is no signature here.


QUIT LOOKING FOR ONE!
Re: mouse_ent A8 [Re: FoxHound] #403394
06/19/12 10:48
06/19/12 10:48
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline OP
Expert
Germanunkol  Offline OP
Expert

Joined: Jun 2006
Posts: 2,640
Earth
I did. Thanks, it worked.

mouse_ent behaves the same, it's some other code (messing around with camera views) which made it fail.
I'll have to find the problem there...

Thanks for all the replies!


~"I never let school interfere with my education"~
-Mark Twain
Re: mouse_ent A8 [Re: Germanunkol] #403401
06/19/12 13:52
06/19/12 13:52
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Did you try to set all non-camera and non-pp views to UNTOUCHABLE?


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1