mouse

Topics regarding Scripting with Reality Factory
Post Reply
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA

mouse

Post by darksmaster923 »

since the menu has no flexibility whatsoever, im adding a menu which is a map where you cant move, no hud, and you select with the mouse. but how do u make it that if you click in a certain area of the screen, it activates another order, or even better, let the mouse klick on a level model or staticmesh or make a pawn follow a mouse cursor
Herp derp.
User avatar
Juutis
Posts: 1511
Joined: Thu Jan 12, 2006 12:46 pm
Location: Finland

Post by Juutis »

You can check if the mouse is within a certain area with
GetMousePosX()
GetMousePosY()

There's also another useful command. The manual:
char* MouseSelect(bool HighlightOnCollision, bool PlayerIsSelectable, float FillColorR, float FillColorG, float FillColorB, float AmbientColorR, float AmbientColorG, float AmbientColorB);

When the mouse pointer is moved over the bounding box of an actor, this command returns the EntityName of that actor. If HighlightOnCollision is true, then the color of the pawn changes when the mouse is over the bounding box of the pawn. If PlayerIsSelectable is true, then also the player is selectable. The default value is false. FillColorR, FillColorG, FillColorB, AmbientColorR, AmbientColorG, AmbientColorB define the highlight color. This color is by default set to white (R, G, B, each beteen 0 ... 255)
Pain is only psychological.
Jay
RF Dev Team
Posts: 1232
Joined: Fri Jul 08, 2005 1:56 pm
Location: Germany

Post by Jay »

It is not possible to select staticmeshes with the MouseSelect command from what i know. You can however select everything that has a bounding box (pawn, staticentityproxy, dynamic entity).

Using the GetMousePosX/Y commands can be a bit tricky, but it is the only way to check if the mouse is in a spceific area i know of.
Everyone can see the difficult, but only the wise can see the simple.
-----
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA

Post by darksmaster923 »

Juutis wrote:You can check if the mouse is within a certain area with

There's also another useful command. The manual:
char* MouseSelect(bool HighlightOnCollision, bool PlayerIsSelectable, float FillColorR, float FillColorG, float FillColorB, float AmbientColorR, float AmbientColorG, float AmbientColorB);

When the mouse pointer is moved over the bounding box of an actor, this command returns the EntityName of that actor. If HighlightOnCollision is true, then the color of the pawn changes when the mouse is over the bounding box of the pawn. If PlayerIsSelectable is true, then also the player is selectable. The default value is false. FillColorR, FillColorG, FillColorB, AmbientColorR, AmbientColorG, AmbientColorB define the highlight color. This color is by default set to white (R, G, B, each beteen 0 ... 255)
how would you read the entity name? is it stored in a variable, cuz that would be perfect thanks

//edit nvm, that was a stupid question
Herp derp.
Post Reply