Movement Manager and Mouse Selection Related Questions
by Jorge Luis Gandulfo · in Torque Game Engine · 04/23/2004 (1:14 am) · 5 replies
I made a code to select objects using Mouse2 (for this i used the trigger[1] and named it selector)
K i have all working, but this code below
This is placed in Updatemove of player.cc
where should i put this so i dont get repeated findselectobject request with one click?
As its right now, i get 4 or 5 times per 1 mouse2 click (well actually i know this is not the place to put this or i have to create some kind of flag)
i store the selected object in the game connection class, i made some get and set functions along with a mselectedobject.
I think this shouldn't go in game connection, but as im still a noob, i didnt find a better solution for this, if i stored this on the player data i didnt knew how to access this from other objects.
Any idea on how to do this better?
Maybe instead of storing the mselectedobject, wich isn't of much use, i should do this below..
Letting the script know whats going on.
should i create an event for this?
where would be wise to put that event?
This event should be used for pick up, trade, npc chat, etc..
maybe once the script player get an event it can dispatch the corresponding action to take from this moment on.
can you help me?
btw this is a great idea for RPG or FPS games, i hate the mouse click point style selection.
If anyone of you played neocron, this kind of selection rox.
I will post a resource as soon as i get this done.
K i have all working, but this code below
// Using Selector
if ( move->trigger[1])
{
findSelectedObject();
}This is placed in Updatemove of player.cc
where should i put this so i dont get repeated findselectobject request with one click?
As its right now, i get 4 or 5 times per 1 mouse2 click (well actually i know this is not the place to put this or i have to create some kind of flag)
i store the selected object in the game connection class, i made some get and set functions along with a mselectedobject.
I think this shouldn't go in game connection, but as im still a noob, i didnt find a better solution for this, if i stored this on the player data i didnt knew how to access this from other objects.
Any idea on how to do this better?
Maybe instead of storing the mselectedobject, wich isn't of much use, i should do this below..
Letting the script know whats going on.
should i create an event for this?
where would be wise to put that event?
This event should be used for pick up, trade, npc chat, etc..
maybe once the script player get an event it can dispatch the corresponding action to take from this moment on.
can you help me?
btw this is a great idea for RPG or FPS games, i hate the mouse click point style selection.
If anyone of you played neocron, this kind of selection rox.
I will post a resource as soon as i get this done.
#2
04/25/2004 (10:16 am)
The quote tags make it really hard to follow what you're saying. Can you post a short summary of your questions?
#3
So all i have to do is use the trigger[1] (its the MVTRIGGER2 in script), and select the object my char is pointing at (yeah same as crosshair), and then let the scripts know whats going on.
I did most of the job, but i have some things i couldnt solve.. thats what im trying to ask up there :)
04/25/2004 (4:08 pm)
My english is so noob as my knowledge in torque, anyway im trying to make a selector/pickup/trade system with second mouse button, instead of pressing a key to get the mouse pointer and then have to click on the object wich is not pratical thing.So all i have to do is use the trigger[1] (its the MVTRIGGER2 in script), and select the object my char is pointing at (yeah same as crosshair), and then let the scripts know whats going on.
I did most of the job, but i have some things i couldnt solve.. thats what im trying to ask up there :)
#4
04/25/2004 (8:20 pm)
I would bind the mouse click event to a serverCmd that did the selection. The trigger stuff is for controlling shooting and whatnot, so it's not a very good fit for this task.
#5
04/26/2004 (12:11 am)
Well i figured out the C++ Code to select an object, but guess i have to make a scripting function to do that, im still learning torque script.
Torque 3D Owner Jorge Luis Gandulfo