3 override void CreateActionComponent()
11 GardenPlot m_GardenPlot;
12 private const float CAMERA_PITCH_THRESHOLD = -30;
21 m_Text =
"#make_garden_plot";
24 override void CreateConditionComponents()
35 if ( player.IsPlacingLocal() )
38 Object target_object = target.GetObject();
43 if ( target_object && ( greenHouse || polytunnel ) )
45 string action_selection = target_object.GetActionComponentName( target.GetComponentIndex() );
47 if ( action_selection !=
"soil" )
53 vector pos = target_object.GetPosition();
55 GetGame().GetObjectsAtPosition3D( pos, 2, nearest_objects, proxy_cargos );
57 for (
int i = 0; i < nearest_objects.Count(); ++i )
59 Object object = nearest_objects.Get( i );
61 if (
object.IsInherited( GardenPlot ) )
73 override void OnFinishProgressServer(
ActionData action_data )
77 EntityAI entity_for_placing = action_data.m_MainItem;
78 Object targetObject = action_data.m_Target.GetObject();
80 vector position = targetObject.GetPosition();
87 position[1] = position[1] - 1.15;
89 position[1] = position[1] - 1.05;
91 vector orientation = targetObject.GetOrientation();
93 if (
GetGame().IsMultiplayer() )
98 m_GardenPlot = GardenPlot.Cast(
GetGame().CreateObjectEx(
"GardenPlotPolytunnel", position,
ECE_KEEPHEIGHT ) );
102 m_GardenPlot = GardenPlot.Cast(
GetGame().CreateObjectEx(
"GardenPlotGreenhouse", position,
ECE_KEEPHEIGHT ) );
105 m_GardenPlot.SetOrientation( orientation );