Jump to content

Bishop

Members
  • Posts

    98
  • Joined

  • Last visited

Everything posted by Bishop

  1. Thanks Jason,....practically i have the same code as in your example... this in the playGui.cs function PlayGui::onRightMouseDown(%this, %screenPos, %cameraPos, %worldDir) { showCursor(); Canvas.alwaysHandleMouseButtons = false; Canvas.setCursorPos(840, 500); //set cursor on the center of the screen } //---------------------------------------------------- function PlayGui::onRightMouseUp(%this, %screenPos, %cameraPos, %worldDir) { Canvas.alwaysHandleMouseButtons = true; hideCursor(); Canvas.setCursorPos(840, 500); ItemWindow.setHidden(true); //main window of the 3d Item_viewer } //------------------------------------------------------- function PlayGui::onMouseDown(%this, %screenPos, %cameraPos, %worldDir) { %cursorPos = Canvas.getCursorPos(); %range = 5; %dirScaled = VectorScale (%worldDir, %range); %endPoint = VectorAdd (%cameraPos, %dirScaled); %result = containerRayCast(%cameraPos, %endPoint, $TypeMasks::Static Shape Object Type, LocalClientConnection.getControlObject(), false); if (getWordCount (%result) > 0 && getWord(%result, 0) !$= "0") { %obj = getWord(%result, 0); if (%obj.getinternalName () $= "game_item") { ItemWindow.setHidden(false); Item_viewer.setVisible (true); showCursor(); %obj = %result.getName(); Item_text.setText(%obj.name); Item_viewer.setModel(%obj.shapeName); } else { Item_viewer.setVisible (false); ItemWindow.setHidden(true); } } } ....this code works fine what I need but one thing is that I don't want to display a mouse cursor when i start the game. .....sorry for formatting the script in the post :)
  2. Thanks....I tried alwaysHandleMouseButtons but not working ....mouse event are still blocked when noCursor is set to "1" when the game starts. .....I have to find some other solution.
  3. Thanks,....problem is in the playGui.gui where I have in the new GameTSCtrl(PlayGui) dynamic field variable noCursor = "1".....so when game start mouse cursor is off / hidden.....this is what I need when level is loaded and game start but then this fuctions in the playGui.cs do not work... ....what I need is when player push RightMouseDown then mouse cursor is On..shown and when player release RightMouse button cursor is Off/ hidden and player control fps camera again... .....but this dynamic field variable declared in the playGui.gui disables showing or hiding the cursor by mouse inputs....in other words, it will block those functions in the playGui.cs.....if i delete this variable from the dynamic fields it works but the cursor is just visible at the start of the game but until the player presses the right mouse button later then cursor disappears. .... maybe choose a better place to control the cursor that has a higher priority than playGui.gui?
  4. Hi, .....In the playGui.gui I have a Dynamic Field ....noCursor 0 and I need to change this value in the game runtime by script in the scripts/gui/playGui.cs where I have the functions PlayGui::onRightMouseDown(%this, %screenPos, %cameraPos, %worldDir), this function turns the cursor on and adjusts it to the center of the screen. and vice versa...function PlayGui::onRightMouseUp(...).......turns off and hides the cursor. .....so I need this dynamic field value option to set in these functions. Thanks guys.
  5. Solved...I added an eyeMount node to the itemData -rifle and it works great .... now the rifle follows the camera and crosshair.
  6. Hi, l'm working on the training project for more intrusions in the Torque engine....so this is a rifle shooting arrows.....arrows fires from the muzzlePoint....this works ok....rifle has not any animation yet nor fps hands(no bones)....this is a simple fps setup with rifle only and collision for player....rifle is mounted to the player's mount0 node. .......so the problem is that the rifle rotates with crosshair only horizontally and I would like it to rotate even vertically along with crosshair...Up/Down. ...so I probably need rifle parent to the camera?
  7. ...of course when the picture is somehow bigger so be sure to use one of many free image/file sharing website...or from your website....how he wrote Duion.
  8. ....below the window where you write the text....next to the Options button is Attachments...there will be pictures, etc added.
  9. Thanks...i see!...projected shadows ..I think the best is png....tga, jpge2000....only what they support the alpha channel.
  10. ...what are the cookies for?
  11. Thanks,...I download Jason's Simple FlashLight resource...so on the basis of this I will put together.
  12. I just find great FPS tutorial on the garagegames.com...where it is well explained how to start and where to put your scripts....so I need more study this basics.
  13. Thanks very much for this Jason,....for my project I just need a flashlight so it's great resource....Thanks a lot.
  14. I still did not get where write a function for mounting object....can I write a new cs file...like mounting.cs and then exec is? or where write this functions related to the my player own datablock? Thanks for help guys.
  15. My recommendations for improving this would be : # 1 in the Toggle Visibility Modes - add Render Player collision shape + mount nodes. #2 in the Object - Mount Selection A to B add possibility mount light, particle or other objects in the scene to the player's mount nodes which we'll see through point # 1....just select right mount node and do mount A to B procedure. .....this is such a visual way for mounting. ....also for non visual maybe it would be great if you pick a player in the editor...then in the Inspector add section or use Mounting section and add possibility select object directly from the scene to be mounted.....another thing that occurred to me....in the Shape Editor somehow make that in Advanced Properties - Mounting allow to mounting also non shape objects.... there could be Shape - Browse and ex. SceneObject - Browse - window appears with all possible objects from scene to mounting. .....I think this would be a great improvement.
  16. I found in the editor how to mount object to the object....Object- Mount selection A to B but after I tried mount particle to the player....Torque crash immediately....it works but only vice versa player to particle and then player it was attached/mounted to the particle and could not move....but why is't possible mount particle to player this way?
  17. Thanks...but I not get where I must or can write this script....in Advanced Properties in the Shape editor it's not possible...there is Mounting but for shapes only not for scene objects like light or particle...which would be great to extend for non-shape objects too. Also in the Inspector for all objects is a Mounting section with mountPID...mountNode....mountPos....and mountRot...but what is it for? .....so mount light or particle is possible only by script and not by editor? ....where write this script for mounting a light or particle?! I have in the Datablock - Player Data - player ....so I must in the Datablock Editor save my player datablock to a new file and in this new cs file write all functions for the player?...like mounting etc. ....what is the detailed procedure then? PS....this simple parenting/child procedures must to be somewhat simplified....because a newcomer who wants to create something in this great engine will come but then spend two days how mount /attach the flashlight or particle to the fps controller and going away....which would be a shame because the Torque is a great engine.
  18. Hi,....for my project because the game takes place in the winter so I would like to have a steam from the mouth like a player breathing.....so how I mount particle to the mount node?....also the same for the flashlight. Thanks for help. PS. I know how to mount a mesh but particle or light?
  19. Thanks very much for help guys....I appreciate that. Yes definitely singleplayer....this project it'll be a exploration walking....first person only...with some puzzles...blog about is here http://forums.torque3d.org/viewtopic.php?f=8&t=1542 ....so I get it working by mouse cursor...and the trick I used is that RMB is set to display the mouse cursor...so the screen responds only to the mouse cursor and camera does not move... the player must now hold the RMB pressed....when player release RMB then mouse cursor is hidden and cursor is off....and when cursor is hidden I set his position to the middle of the screen ( where is crosshair ) so when player pressed LMB....hidden mouse cursor raycasting items/objects in the scene so this looks like crosshair do raycasting :) ....and at that moment the 3d model viewer appears with clicked item/object to explore in detail.....then when player clicks again with LMB but only outside of the model/item in the scene, 3dmodel viewer disappears and when RMB is pressed inside or outside of the model/item and 3d model viewer is just on the screen and player don't want to explore anything in the 3d viewer....so it disappears. This works really well and the advantage is that the cursor is available on RMB click for use on other things. .....but i'll try the crosshair raycasting solution but with thisI I'm quite satisfied. ..... I will post later a gif where it will be better to see in action.
  20. getEyeVector() and getEyePoint are in the ShapeBase Class .....so I need get Player shape and his eye node....how to write this in the script?....I'm begginer to the Torque script. EDIT: I get it.....$objID = my_player.getID(); echo("Object ID: " , $objID);........so I get my player capsule collision object and there I have eye node as a child so %obj = $objID is this right?....so.... %obj.getEyePoint()...should find the eye node? EDIT1: %obj = $objID.....this does not work....I got right ID from echo but Unknown command getEyeVector and getEyePoint.
  21. Thanks marauder2k9....where to write that script .... to playGui.cs?.....I wrote it there but get unable to find object '821 493' attempting to call function 'getEyeVector' and same for 'getEyePoint' ....so that means this function can't find these objects? %eyeVec and %startPos....right?.....so I must write in that script function where to look for them?
  22. Thanks Duion, I used the build-in gui 3d model viewer and items text/name is now directly in the model viewer.....this 3d viewer is great for such stuff....thanks developers who works on this....I still have to fine-tune a few things but I'm satisfied with the result....and of course, script manual and engine reference + docs are very useful.
  23. I make it somehow together.....not exactly what I need....but works :) ....I'm using PlayGui::onMouseDown(%this, %screenPos, %cameraPos, %worldDir) function...... ....is there an option to display text when the cursor is over the subject and only in this time display the text?
  24. Thanks .... that would be great ...I think somehow improve that guicrosshair would be nice.... also Torque engine has trigger, zone, zoneportal, etc but RayCast build-in not.....it's a pity!
×
×
  • Create New...