Jump to content

Questions about using the TurretHolder


Lopess
 Share

Recommended Posts

It seems to me that using the turrets component it would be possible currently in 0ad (I'm using the alpha 27 version) to create a unit with a turret sub unit, but I'm having difficulties implementing it, I intend to create a turret on top of an armored vehicle in the future , in which the turret has its movement independent of the vehicle, rotating on its own axis fixed above the vehicle.

Code:

<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_unit_cavalry_ranged_javelineer">
  <Identity>
    <Civ>coalition</Civ>
    <SpecificName>VBL</SpecificName>
    <Icon>units/hele/siege_tower.png</Icon>
  </Identity>
  <Promotion disable=""/>
  <Sound>
    <SoundGroups>
      <attack_ranged>attack/weapon/rifle_attack.xml</attack_ranged>
      <walk>actor/human/movement/walk.xml</walk>
      <run>actor/human/movement/run.xml</run>
    </SoundGroups>
  </Sound>
  <TurretHolder>
    <TurretPoints>
	<One>
	<X>0.1</X>
	<Y>0.1</Y>
	<Z>2.0</Z>
	<Template>units/coalition/infantry_rifleman_assalt</Template>
	<Angle>1.54</Angle>
	<Ejectable>false</Ejectable>
	</One>
    </TurretPoints>
  </TurretHolder>
   <UnitMotion>
    <WalkSpeed>19.0</WalkSpeed>
    <RunMultiplier>1.67</RunMultiplier>
  </UnitMotion>
  <VisualActor>
    <Actor>units/coalition/VBL.xml</Actor>
  </VisualActor>
</Entity>

 

Result (The game does not ask for errors, and it seems to me that it identifies the indicated template because when changing its name the game says it cannot find it)

 

Captura de tela de 2023-06-13 16-40-17.png

Link to comment
Share on other sites

6 minutes ago, Stan&#x60; said:

Maybe the unit wasn't set to doesn't have the turretable component?

infantry_rifleman_assalt

Interesting, I can check this here, where would this configuration be?

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

×
×
  • Create New...