2 registered members (7th_zorro, dr_panther),
724
guests, and 3
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
mouse_ent A8
#403231
06/16/12 19:20
06/16/12 19:20
|
Joined: Jun 2006
Posts: 2,640 Earth
Germanunkol
OP
Expert
|
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.
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: PadMalcom]
#403242
06/16/12 22:50
06/16/12 22:50
|
Joined: Jun 2004
Posts: 2,234 Wisconsin USA
FoxHound
Expert
|
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
OP
Expert
|
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
Expert
|
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
OP
Expert
|
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: Superku]
#403280
06/17/12 16:05
06/17/12 16:05
|
Joined: Jun 2004
Posts: 2,234 Wisconsin USA
FoxHound
Expert
|
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
OP
Expert
|
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
|
|
|
|