Jump to content

How to set an unit to be buildable only one per time?


HK-47
 Share

Recommended Posts

I created a new hero to the Empire, Admiral Hezar, but it's code is in SpaceUnitsCorvettes.xml, instead of the default hero xml. In the end of the code, there are two lines about the unit being buildable only one by time, but they don't work... Is there some code that I can put in to prevent the unit being buildable twice by time?

 

http://img185.imageshack.us/img185/5945/admiralhezaren3.png

Link to comment
Share on other sites

The easiest way for that is making him a real hero (it does not matter in what files you put him, as long as you name the unittype right) and then asuring, that he is in the sandbox.xmls, saying when he has to appear and when not.

 

Or did you not make him a hero for a reason?

to Bria Tharen!

 

http://img118.imageshack.us/img118/7831/ueawsig4mu9.png

http://www.vereinte-nationen.de/german.gif Ich spreche auch Deutsch.

Link to comment
Share on other sites

I didn't made him a hero because I thought if I do that, I'll need to create entries in other files like the team hero, named hero units, etc... (I forgot the "real" name of the files...

When you said unit type, you mean the category?

 

This is the code I used for him:

 

	<SpaceUnit Name="Tartan_Patrol_Cruiser_MKIII">
	<!-- Changed from Carrack-Class Cruiser -->
	<Text_ID>TEXT_UNIT_TARTAN_CRUISER_MKIII</Text_ID>
	<Encyclopedia_Good_Against> Vengeance_Frigate Alliance_Assault_Frigate Nebulon_B_Frigate </Encyclopedia_Good_Against>
	<Encyclopedia_Vulnerable_To> B-wing Y-wing </Encyclopedia_Vulnerable_To>
	<GUI_Row> 1 </GUI_Row>
	<Space_Model_Name>EV_TartanCruiser.alo</Space_Model_Name>
	<Select_Box_Scale>370</Select_Box_Scale>
	<Select_Box_Z_Adjust>-30</Select_Box_Z_Adjust>
	<Mass>0.9995</Mass>
	<Scale_Factor>0.56</Scale_Factor>
	<No_Colorization_Color> 255, 255, 255, 255 </No_Colorization_Color>
	<Dense_FOW_Reveal_Range_Multiplier>0.2</Dense_FOW_Reveal_Range_Multiplier>

        	<Ranking_In_Category>7</Ranking_In_Category>
	<Ranged_Target_Z_Adjust>0</Ranged_Target_Z_Adjust>

	<Max_Speed>7.00</Max_Speed>
	<Max_Rate_Of_Turn>1.4</Max_Rate_Of_Turn>
	<MovementClass> Space </MovementClass>
	<Space_Layer> Corvette </Space_Layer>
	<Layer_Z_Adjust>0</Layer_Z_Adjust>
	<Max_Rate_Of_Roll>0.2</Max_Rate_Of_Roll>
	<Bank_Turn_Angle>15</Bank_Turn_Angle>
	<OverrideAcceleration> .065 </OverrideAcceleration>
	<OverrideDeceleration> .065 </OverrideDeceleration>

	<Armor_Type> Armor_Tartan </Armor_Type>
        <Shield_Armor_Type>Shield_Corvette</Shield_Armor_Type>
	<Max_Thrust>0.8</Max_Thrust>
	<Hyperspace>Yes</Hyperspace>
	<Hyperspace_Speed>2.5</Hyperspace_Speed>
	<Maintenance_Cost>0.05</Maintenance_Cost>

	<Affiliation>Empire</Affiliation>
	<Tech_Level>0</Tech_Level>
	<Required_Ground_Base_Level>0</Required_Ground_Base_Level>
	<Required_Star_Base_Level>6</Required_Star_Base_Level>
	<Shield_Points>1500</Shield_Points>
	<Tactical_Health>3000</Tactical_Health>
	<Damage>40</Damage>
	<Autoresolve_Health>2500</Autoresolve_Health>
	<Execute_Script_On_Type>true</Execute_Script_On_Type>
	<Lua_Script>FleetCommander</Lua_Script> 
	<Shield_Refresh_Rate>50</Shield_Refresh_Rate>
	<Energy_Capacity>4500</Energy_Capacity>
	<Energy_Refresh_Rate>450</Energy_Refresh_Rate>
	<Ship_Class>corvette</Ship_Class>
	<Formation_Priority>5</Formation_Priority>
	<Is_Escort>no</Is_Escort>
	<Is_Bomber>no</Is_Bomber>
	<Political_Control>0</Political_Control>
	<Squadron_Capacity>5</Squadron_Capacity>
	<Transport_Capacity>4</Transport_Capacity>
	<Number_per_Squadron>1</Number_per_Squadron>
	<Build_Cost_Credits>2700</Build_Cost_Credits>
	<Piracy_Value_Credits>50</Piracy_Value_Credits>
	<AI_Combat_Power>1550</AI_Combat_Power>
	<Build_Time_Seconds>35</Build_Time_Seconds>
	<Build_Tab_Space_Units>Yes</Build_Tab_Space_Units>
	<Size_Value>120</Size_Value>
	<Behavior>ABILITY_COUNTDOWN, DUMMY_STARSHIP, SELECTABLE, POWERED, SHIELDED</Behavior>
	<SpaceBehavior> SIMPLE_SPACE_LOCOMOTOR, TARGETING, SELECTABLE, REVEAL, HIDE_WHEN_FOGGED, UNIT_AI, DAMAGE_TRACKING, ION_STUN_EFFECT, NEBULA </SpaceBehavior>

	<Collidable_By_Projectile_Living>Yes</Collidable_By_Projectile_Living>
	<Death_Explosions>Large_Explosion_Space_Empire</Death_Explosions>

	<Death_Clone>Damage_Normal, Tartan_Patrol_Cruiser__Death_Clone</Death_Clone>
	<Space_FOW_Reveal_Range>1600.0</Space_FOW_Reveal_Range>
	<Targeting_Max_Attack_Distance>2500.0</Targeting_Max_Attack_Distance>

	<Hardpoints>
			HP_Tartan_CruiserMKIII_00, HP_Tartan_CruiserMKIII_01, HP_Tartan_CruiserMKIII_02, HP_Tartan_CruiserMKIII_03, HP_Tartan_CruiserMKIII_04
	</Hardpoints>

	<Space_FOW_Reveal_Range>1600.0</Space_FOW_Reveal_Range>
	<Targeting_Max_Attack_Distance>1000.0</Targeting_Max_Attack_Distance>

	<CategoryMask> SpaceHero </CategoryMask>
	<Icon_Name>i_button_ei_fleet_commander_bust.tga</Icon_Name>
	<GUI_Model_Name>EV_TartanCruiser.alo</GUI_Model_Name>
	<GUI_Distance>900</GUI_Distance>
	<GUI_Offset>0 0 0</GUI_Offset>
	<GUI_Velocity>45</GUI_Velocity>
	<Victory_Relevant>yes</Victory_Relevant>
	<Has_Space_Evaluator>True</Has_Space_Evaluator>

	<SFXEvent_Build_Started>EHD_Build_Vehicle</SFXEvent_Build_Started>
	<SFXEvent_Build_Cancelled>EHD_Unit_Canceled</SFXEvent_Build_Cancelled>
	<SFXEvent_Build_Complete>Unit_Complete_Tartan</SFXEvent_Build_Complete>
	<SFXEvent_Ambient_Loop>Unit_Carrack_Moving_Engine_Loop</SFXEvent_Ambient_Loop>
	<SFXEvent_Select>Unit_Select_Empire_Field</SFXEvent_Select>
	<SFXEvent_Move>Unit_Move_Empire_Field</SFXEvent_Move>
	<SFXEvent_Fleet_Move>Unit_Fleet_Move_Tartan</SFXEvent_Fleet_Move>
	<SFXEvent_Attack>Unit_Attack_Empire_Field</SFXEvent_Attack>
	<SFXEvent_Guard>Unit_Guard_Empire_Field</SFXEvent_Guard>
	<SFXEvent_Stop>Unit_Stop_Tartan</SFXEvent_Stop>
	<SFXEvent_Barrage>Unit_Barrage_Tartan</SFXEvent_Barrage>
	<SFXEvent_Move_Into_Nebula> Unit_Nebula_Tartan </SFXEvent_Move_Into_Nebula>

	<SFXEvent_Attack_Hardpoint> HARD_POINT_WEAPON_LASER, Unit_HP_LASER_Tartan </SFXEvent_Attack_Hardpoint>
	<SFXEvent_Attack_Hardpoint> HARD_POINT_WEAPON_MISSILE, Unit_HP_MISSILE_Tartan </SFXEvent_Attack_Hardpoint>
	<SFXEvent_Attack_Hardpoint> HARD_POINT_WEAPON_TORPEDO, Unit_HP_TORP_Tartan </SFXEvent_Attack_Hardpoint>
	<SFXEvent_Attack_Hardpoint> HARD_POINT_WEAPON_ION_CANNON, Unit_HP_ION_Tartan </SFXEvent_Attack_Hardpoint>
	<SFXEvent_Attack_Hardpoint> HARD_POINT_SHIELD_GENERATOR, Unit_HP_SHIELDS_Tartan </SFXEvent_Attack_Hardpoint>
	<SFXEvent_Attack_Hardpoint> HARD_POINT_ENGINE, Unit_HP_ENGINES_Tartan </SFXEvent_Attack_Hardpoint>
	<SFXEvent_Attack_Hardpoint> HARD_POINT_GRAVITY_WELL, Unit_HP_GRAV_Tartan </SFXEvent_Attack_Hardpoint>

	<SFXEvent_Engine_Idle_Loop> Unit_Tartan_Idle_Engine_Loop </SFXEvent_Engine_Idle_Loop>
	<SFXEvent_Engine_Moving_Loop> Unit_Tartan_Moving_Engine_Loop </SFXEvent_Engine_Moving_Loop>
	<SFXEvent_Engine_Cinematic_Focus_Loop> Unit_Tartan_Cinematic_Engine_Loop </SFXEvent_Engine_Cinematic_Focus_Loop>

	<Tactical_Bribe_Cost/>

	<Death_SFXEvent_Start_Die>Unit_Corvette_Death_SFX</Death_SFXEvent_Start_Die>

	<Is_Visible_On_Radar>Yes</Is_Visible_On_Radar>

	<MovementClass> Space </MovementClass>
	<Guard_Chase_Range>1000.0</Guard_Chase_Range>
	<Idle_Chase_Range>400.0</Idle_Chase_Range>
	<Attack_Move_Response_Range>400.0</Attack_Move_Response_Range>
	<Targeting_Stickiness_Time_Threshold>5.0</Targeting_Stickiness_Time_Threshold>
	<Targeting_Priority_Set>Corvette</Targeting_Priority_Set>
	<Autonomous_Move_Extension_Vs_Attacker>300.0</Autonomous_Move_Extension_Vs_Attacker>



	<!-- Non-Hero unit abilities description -->
	<Unit_Abilities_Data SubObjectList="Yes">
		<!-- Primary ability -->



	</Unit_Abilities_Data>




	<Encyclopedia_Text>TEXT_TOOLTIP_TARTAN_MKIII</Encyclopedia_Text>
	<Encyclopedia_Unit_Class>TEXT_ENCYCLOPEDIA_CLASS_HERO_MINOR</Encyclopedia_Unit_Class>
	<Score_Cost_Credits> 1550</Score_Cost_Credits>

	<!--<MULTIPLAYER SKIRMISH VALUES BEGIN>-->
	<Tactical_Build_Cost_Multiplayer>3000</Tactical_Build_Cost_Multiplayer>
	<Tactical_Build_Time_Seconds>35</Tactical_Build_Time_Seconds>
	<Tactical_Build_Prerequisites />
	<Tactical_Production_Queue>Tactical_Units</Tactical_Production_Queue>
	<!--<Build_Limit_Current_Per_Player>1</Build_Limit_Current_Per_Player>-->
	<!--<Build_Limit_Lifetime_Per_Player>1</Build_Limit_Lifetime_Per_Player>-->  
	<!--<MULTIPLAYER SKIRMISH VALUES END>-->
	<Population_Value>3</Population_Value>
</SpaceUnit>

Link to comment
Share on other sites

They affect GC as well. I'm pretty sure, since uhh..well, it worked for me.

You might want to change the lifetime limit to -1(infinity) since...uhh..once you lose is you lose it permanently the way you have it now.

http://img.photobucket.com/albums/v423/kc1991/droid803sig.jpg

"That was fun"

Link to comment
Share on other sites

MajorPayne suggested that I should add the following code in both parts of the ship entry (not only in GC) and it worked, but I can only build it one time (if it's die, it died).

<!--<Build_Limit_Current_Per_Player>1</Build_Limit_Current_Per_Player>-->
<!--<Build_Limit_Lifetime_Per_Player>1</Build_Limit_Lifetime_Per_Player>-->  

 

I'll change the lifetime limit as D803 said to see what happens...

Link to comment
Share on other sites

The Sandbox files has nothing to do with how many times a unit is buildable, all it does is put a hero in game. You can do it that way so you have the unit as a 'major' hero in game. Making buildable heroes is better however, as they can be called in at any time when you unlock the planet that they can be built from. So they don't show in the game until you want them anyway.

 

The correct code for restricting unit builds was already posted.. but if your making more heroes for the game - the code for Vader is a good starting point on how to do buildable heroes - instead of using sandbox files. Your restricted to 11 heroes in any case. But by building them, at least you have a choice of who exactly you want to fill a hero slot. Then retire them from the game if you need to.

 

JC

http://i37.photobucket.com/albums/e99/drone_pilot/JC_Sig.jpg

 

Sote Mod Website @

 

http://sote-mod.com/forum/index.php?act=home

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

Copyright (c) 1999-2022 by SWRebellion Community - All logos and trademarks in this site are property of their respective owner. The comments are property of their posters. Star Wars(TM) is a registered trademark of LucasFilm, Ltd. We are not affiliated with LucasFilm or Walt Disney. This is a fan site and online gaming community (non-profit). Powered by Invision Community

×
×
  • Create New...