Page 1 of 1

How to make clickable object/entity with Flow Graph RayCast Mouse?

Posted: Wed Nov 28, 2018 4:58 pm
by Propostal000
Hi, I have a little problem, I must to make 3D Main Menu in normal map with Flow Graph RayCast Mouse, I need it in FG, not any scripting or other things, I need only 3D Menu with clickable objects in FG,
for example, when I click mouse at entity/object with texture "Mission 01" then it will load that map and more like that things.
I made it a some time ago with RayCast Mouse and it worked, but I was stupid and delete it, and I don't know how to make again, I spend 2 - 3 days with it and nothing, so I need it as fast as it possible.
The most helpful will be screen from Flow Graph how make it, thanks :)

Sorry for bad English.

Re: How to make clickable object/entity with Flow Graph RayCast Mouse?

Posted: Wed Nov 28, 2018 7:41 pm
by lavizh
Would be so much easier with Scaleform / Flash and FG, but i guess you don't wan't that?

So unless the menu is moving, handling the mouse clicks in Scaleform and setting up map load cvars in FG might be a better and faster solution than doing everything in FG. Best solution would ofcourse be C++ or C#.

Re: How to make clickable object/entity with Flow Graph RayCast Mouse?

Posted: Wed Nov 28, 2018 9:07 pm
by Propostal000
I really need it from RayCasting Mouse in Flow Graph, there's also other things need FG RC Mouse which I don't make in Scaleform or Scripting, I also don't very good in Scripting, and I don't have time to learn and make it with it.
And I also don't know it is possible or easy to make most things what I want in Scaleform/Scripting

Re: How to make clickable object/entity with Flow Graph RayCast Mouse?

Posted: Thu Nov 29, 2018 8:07 am
by mknmknmknjk
fire raytrace hit 3d menu plane, get hit point world position ,convert world position to 3d menu local position, simulate mouse hover over ,off ,click event using local position.

Re: How to make clickable object/entity with Flow Graph RayCast Mouse?

Posted: Thu Nov 29, 2018 3:44 pm
by Propostal000
I don't Understant so can you make for me tutorial or screenshot? :D

Re: How to make clickable object/entity with Flow Graph RayCast Mouse?

Posted: Sun Dec 02, 2018 7:34 pm
by Propostal000
Ok, Nevermind, I don't know how, but I somehow made it :P Topic probably to close :P

Re: How to make clickable object/entity with Flow Graph RayCast Mouse?

Posted: Thu Dec 06, 2018 10:56 am
by Cry-Chris
Cool that you have managed to figure it out,

Other user will most likely come across this topic in the future and look for the solution.
It would be nice if everyone shares his solution so other users can benefit from visiting
this forum post in the future.

I have set up a Flow Graph to demonstrate how a UI can be achieved in Flow Graph.

Image



Mouse Handler:
Image

Code: Select all

<Graph Description="" Group="Mouse_handler"> <Nodes> <Node Id="8" Class="Input:MouseRayCast" pos="18,0,0"> <Inputs RayType="0" EntitiesToIgnore="0"/> </Node> <Node Id="10" Class="Game:Start" pos="-432,0,0"> <Inputs InGame="1" InEditor="1"/> </Node> <Node Id="37" Class="Time:Delay" pos="342,90,0"> <Inputs delay="0.05" resetOnInput="1"/> </Node> <Node Id="55" Class="Logic:Any" pos="828,36,0"> <Inputs /> </Node> <Node Id="58" Name="timeout_when_mouse_is_not_over_the_element_any_more" Class="_comment" pos="342,72,0"/> <Node Id="60" Class="Math:SetInteger" pos="576,90,0"> <Inputs in="0"/> </Node> <Node Id="61" Name="if(timeout){Entity_ID_=_null}" Class="_comment" pos="576,144,0"/> <Node Id="65" Class="Time:Delay" pos="-216,0,0"> <Inputs delay="1" resetOnInput="0"/> </Node> <Node Id="73" Class="Mission:GameTokenModify" pos="990,36,0"> <Inputs gametoken_Token="Level.MouseOverEntityID" Op="0" Type="1" Value=""/> </Node> </Nodes> <Edges> <Edge nodeIn="37" nodeOut="8" portIn="in" portOut="EntityId" enabled="1"/> <Edge nodeIn="55" nodeOut="8" portIn="in1" portOut="EntityId" enabled="1"/> <Edge nodeIn="65" nodeOut="10" portIn="in" portOut="output" enabled="1"/> <Edge nodeIn="60" nodeOut="37" portIn="set" portOut="out" enabled="1"/> <Edge nodeIn="73" nodeOut="55" portIn="Trigger" portOut="out" enabled="1"/> <Edge nodeIn="73" nodeOut="55" portIn="Value" portOut="out" enabled="1"/> <Edge nodeIn="55" nodeOut="60" portIn="in2" portOut="out" enabled="1"/> <Edge nodeIn="8" nodeOut="65" portIn="Enable" portOut="out" enabled="1"/> </Edges> </Graph>


Each individual button Flow Graph
Image

Code: Select all

<Graph Description="" Group=""> <Nodes> <Node Id="76" Class="Input:MouseButtonInfo" pos="-378,-252,0"> <Inputs MouseButton="1" MouseWheel="0"/> </Node> <Node Id="80" Class="Game:Start" pos="-594,-252,0"> <Inputs InGame="1" InEditor="1"/> </Node> <Node Id="86" Class="Mission:GameTokenGet" pos="-72,-252,0"> <Inputs gametoken_Token="Level.MouseOverEntityID"/> </Node> <Node Id="91" Name="Entity_ID" Class="_comment" pos="-72,-270,0"/> <Node Id="92" Name="Logic" Class="_commentbox" pos="684,-486.69418,0"> <Inputs TextSize="1" Color="0.27451,0.352941,0.705882" DisplayFilled="1" DisplayBox="1" SortPriority="16"/> <ResizeBorder X="0" Y="0" Width="1818" Height="252"/> <NodeSize Width="1818" Height="325.78305"/> </Node> <Node Id="98" Class="Movement:RotateEntityToEx" pos="720,-396,0" GraphEntity="0"> <Inputs entityId="0" Destination="90,0,0" DynamicUpdate="0" ValueType="1" Value="0.025" CoordSys="1"/> </Node> <Node Id="101" Class="Math:EqualCheck" pos="468,-306,0"> <Inputs A="0" B="0"/> </Node> <Node Id="102" Name="If_"this"_entity_is_clicked_then_execute_logic" Class="_commentbox" pos="-90,-442.05923,0"> <Inputs TextSize="1" Color="1,1,1" DisplayFilled="1" DisplayBox="1" SortPriority="16"/> <ResizeBorder X="0" Y="0" Width="702" Height="180"/> <NodeSize Width="1051.9512" Height="253.78305"/> </Node> <Node Id="107" Class="Entity:EntityInfo" pos="270,-360,0" GraphEntity="0"> <Inputs entityId="0"/> </Node> <Node Id="112" Class="Time:Timer" pos="-306,90,0"> <Inputs period="0.1" min="0" max="0" paused="1"/> </Node> <Node Id="114" Class="Mission:GameTokenGet" pos="-72,90,0"> <Inputs gametoken_Token="Level.MouseOverEntityID"/> </Node> <Node Id="115" Name="Entity_ID" Class="_comment" pos="-72,72,0"/> <Node Id="116" Class="Math:EqualCheck" pos="468,36,0"> <Inputs A="0" B="0"/> </Node> <Node Id="117" Name="On_"this"_entity_mouse_hover_over_execute_logic" Class="_commentbox" pos="-90,-107.8294,0"> <Inputs TextSize="1" Color="1,1,1" DisplayFilled="1" DisplayBox="1" SortPriority="16"/> <ResizeBorder X="0" Y="0" Width="702" Height="198"/> <NodeSize Width="1177.8105" Height="271.78305"/> </Node> <Node Id="118" Class="Entity:EntityInfo" pos="270,-18,0" GraphEntity="0"> <Inputs entityId="0"/> </Node> <Node Id="119" Class="Material:EntityMaterialChange" pos="720,36,0" GraphEntity="0"> <Inputs entityId="0" slot="-1" mat_Material="materials/generic/fabric/cloth_fine_black" Serialize="0"/> </Node> <Node Id="120" Class="Material:EntityMaterialChange" pos="720,234,0" GraphEntity="0"> <Inputs entityId="0" slot="-1" mat_Material="materials/generic/plastic/rough_white" Serialize="0"/> </Node> <Node Id="128" Class="Mission:GameTokenSet" pos="1890,-288,0"> <Inputs gametoken_Token="Level.Game_Running" Value="1"/> </Node> <Node Id="129" Name="Logic" Class="_commentbox" pos="684,-107.82946,0"> <Inputs TextSize="1" Color="0.27451,0.352941,0.705882" DisplayFilled="1" DisplayBox="1" SortPriority="16"/> <ResizeBorder X="0" Y="0" Width="468" Height="432"/> <NodeSize Width="468" Height="505.78305"/> </Node> <Node Id="137" Class="Movement:RotateEntityToEx" pos="1008,-396,0" GraphEntity="0"> <Inputs entityId="0" Destination="180,0,0" DynamicUpdate="0" ValueType="1" Value="0.025" CoordSys="1"/> </Node> <Node Id="138" Class="Movement:RotateEntityToEx" pos="1296,-396,0" GraphEntity="0"> <Inputs entityId="0" Destination="270,0,0" DynamicUpdate="0" ValueType="1" Value="0.025" CoordSys="1"/> </Node> <Node Id="139" Class="Movement:RotateEntityToEx" pos="1584,-396,0" GraphEntity="0"> <Inputs entityId="0" Destination="360,0,0" DynamicUpdate="0" ValueType="1" Value="0.025" CoordSys="1"/> </Node> <Node Id="143" Class="Camera:View" pos="2268,-396,0" EntityGUID="1ce81fa6-b4d7-f242-fa47-a7c02bb862bc"> <Inputs entityId="0" Enable="0" Disable="0" FOV="60" Blend="0" BlendFOVSpeed="5" BlendFOVOffset="0" BlendPosSpeed="5" BlendPosOffset="0,0,0" BlendRotSpeed="10" BlendRotOffset="0,0,0"/> </Node> <Node Id="145" Class="Mission:GameToken" pos="-864,126,0"> <Inputs gametoken_Token="Level.Game_Running" compare_Value="1" FireOnStart="1" FireOnlyOnResultChange="1"/> </Node> <Node Id="147" Class="Math:BooleanTo" pos="-504,144,0"> <Inputs /> </Node> </Nodes> <Edges> <Edge nodeIn="86" nodeOut="76" portIn="Trigger" portOut="MousePressed" enabled="1"/> <Edge nodeIn="76" nodeOut="80" portIn="Enable" portOut="output" enabled="1"/> <Edge nodeIn="101" nodeOut="86" portIn="B" portOut="OutValue" enabled="1"/> <Edge nodeIn="101" nodeOut="86" portIn="Check" portOut="OutValue" enabled="1"/> <Edge nodeIn="107" nodeOut="86" portIn="Get" portOut="OutValue" enabled="1"/> <Edge nodeIn="137" nodeOut="98" portIn="Start" portOut="Done" enabled="1"/> <Edge nodeIn="98" nodeOut="101" portIn="Start" portOut="true" enabled="1"/> <Edge nodeIn="101" nodeOut="107" portIn="A" portOut="Id" enabled="1"/> <Edge nodeIn="114" nodeOut="112" portIn="Trigger" portOut="out" enabled="1"/> <Edge nodeIn="116" nodeOut="114" portIn="B" portOut="OutValue" enabled="1"/> <Edge nodeIn="116" nodeOut="114" portIn="Check" portOut="OutValue" enabled="1"/> <Edge nodeIn="118" nodeOut="114" portIn="Get" portOut="OutValue" enabled="1"/> <Edge nodeIn="119" nodeOut="116" portIn="Set" portOut="true" enabled="1"/> <Edge nodeIn="120" nodeOut="116" portIn="Set" portOut="false" enabled="1"/> <Edge nodeIn="116" nodeOut="118" portIn="A" portOut="Id" enabled="1"/> <Edge nodeIn="143" nodeOut="128" portIn="Enable" portOut="OutValue" enabled="1"/> <Edge nodeIn="138" nodeOut="137" portIn="Start" portOut="Done" enabled="1"/> <Edge nodeIn="139" nodeOut="138" portIn="Start" portOut="Done" enabled="1"/> <Edge nodeIn="128" nodeOut="139" portIn="Trigger" portOut="Done" enabled="1"/> <Edge nodeIn="147" nodeOut="145" portIn="false" portOut="Equal False" enabled="1"/> <Edge nodeIn="147" nodeOut="145" portIn="true" portOut="Equal True" enabled="1"/> <Edge nodeIn="112" nodeOut="147" portIn="paused" portOut="out" enabled="1"/> </Edges> </Graph>

Re: How to make clickable object/entity with Flow Graph RayCast Mouse?

Posted: Mon Dec 10, 2018 2:30 pm
by Propostal000
If someone want, I made it like that :D
I think it's easy way to make it.

Re: How to make clickable object/entity with Flow Graph RayCast Mouse?

Posted: Mon Dec 17, 2018 12:28 pm
by BlueMoodDark
If someone want, I made it like that :D
I think it's easy way to make it.
Great! - I see you attach this to the Entity requiring to be clicked.

Re: How to make clickable object/entity with Flow Graph RayCast Mouse?

Posted: Fri Jan 18, 2019 8:32 am
by 3dkoktebel
To correct work of RayCasting You need to place 6 Entities planes from all sides of scene... For example if Raycasting happens on horisont or sky it do not work properly! When make borders with cube planes from all sides Raycasting works perfect!!!! Thank You for these flowgraphs!