You must be logged in to post messages.
Please login or register

AI, RMS Scripting, and Modding
Moderated by Yeebaagooon, TAG

Hop to:    
Welcome! You are not logged in. Please Login or Register.14 replies
Age of Mythology Heaven » Forums » AI, RMS Scripting, and Modding » Training a new unit Question
Bottom
Topic Subject:Training a new unit Question
WinterGod
Mortal
posted 21 January 2019 07:55 AM EDT (US)         

Hey everyone,

I created a new unit based on Son of Osiris, and I want to make it trainable, and this is where it gets interesting.

I can train the Son of Osiris from the Temple.
But I can't train the Son of Osiris from a Shrine.

It gets really weird, I can train all the other existing units from the shrine, except this new unit that I created.

I have no idea what I am really missing here.
It's possible to train units from the Shrine, and it's possible to train this Son of Osiris from a temple, why can't I train it from a Shrine?
Has anyone ever tried anything like this before?
AuthorReplies:
WarriorMario
Mortal
posted 21 January 2019 09:38 AM EDT (US)     1 / 14       
I think the shrine might be missing a flag that the temple and all other buildings that can train units have. It might just be the building flag. Else you could use the flag ForceBuildingData which the pharaoh has.

We cannot rely on luck to be successful.
XLightningStormL
Mortal
(id: TheBronyKing11)
posted 21 January 2019 09:55 PM EDT (US)     2 / 14       
Make sure that it's row and column numbers don't go past 2, and 6 respectively.

Make sure that the Shrine's SoO's trainline has the correct proto name aswell, people get unit protonames botched all the time, might seem dumb to answer like that, but you can never be certain.

Lead Designer and Producer of Age of Mythology's biggest mod compilation: http://aom.heavengames.com/downloads/showfile.php?fileid=11038

[This message has been edited by XLightningStormL (edited 01-21-2019 @ 09:56 PM).]

WinterGod
Mortal
posted 22 January 2019 01:32 AM EDT (US)     3 / 14       
But it can train other existing units? I checked all the flags I honestly don't understand what's missing.
WarriorMario
Mortal
posted 22 January 2019 06:10 AM EDT (US)     4 / 14       
Did you test this using the same culture? It could be the proto tag onlyallowedculture or something similar.

We cannot rely on luck to be successful.
Izalith
Mortal
(id: Lilitu)
posted 22 January 2019 08:25 AM EDT (US)     5 / 14       
yeah, might be a culture or age restriction in the protounit, or it is not properly allowed to be trained to your civ through a tech. So maybe some typo there.

Azarath Metrion Zinthos

Steam: Order of Azarath
Twitch: twitch.tv/orderofazarath
Discord: Azarath @ https://discord.gg/3ENKJeb
WinterGod
Mortal
posted 22 January 2019 08:40 AM EDT (US)     6 / 14       
It's not culture or age restriction. I checked those quite early on.
Izalith
Mortal
(id: Lilitu)
posted 22 January 2019 08:59 AM EDT (US)     7 / 14       
mh, maybe give us a pastebin of the unit proto, production building proto and techtree entries

Azarath Metrion Zinthos

Steam: Order of Azarath
Twitch: twitch.tv/orderofazarath
Discord: Azarath @ https://discord.gg/3ENKJeb
WinterGod
Mortal
posted 22 January 2019 11:58 PM EDT (US)     8 / 14       
Actually, there is something else I need to mention. I modified a duplicate of the Fire Giant to create this New Son of Osiris. But Shrine has no problem training Greek villagers so I don't really understand it.

Here's the code:

<unit id="494" name="Shrine">
<dbid>2219</dbid>
<displaynameid>16881</displaynameid>
<icon>Icon Building Shrine 64</icon>
<cultureicon civ="Norse">Building Norse Shrine Icon</cultureicon>
<maxcontained>5</maxcontained>
<initialhitpoints>450.0000</initialhitpoints>
<maxhitpoints>450.0000</maxhitpoints>
<los>9.0000</los>
<portraiticon>Icon Building Shrine 64</portraiticon>
<portraiticon civ="Norse">Building Norse Shrine Icon 64</portraiticon>
<obstructionradiusx>2.0000</obstructionradiusx>
<obstructionradiusz>2.0000</obstructionradiusz>
<deadreplacement>Destruction 2x2</deadreplacement>
<maxvelocity>0.0000</maxvelocity>
<movementtype>land</movementtype>
<buildpoints>40.0000</buildpoints>
<buildingworkrate>1.0000</buildingworkrate>
<allowedheightvariance>4.0000</allowedheightvariance>
<cost resourcetype="Food">100.0000</cost>
<cost resourcetype="Wood">100.0000</cost>
<cost resourcetype="Gold">100.0000</cost>
<bounty resourcetype="Favor">4.3200</bounty>
<bountyfactor resourcetype="Favor">1.0000</bountyfactor>
<bounty resourcetype="Gold">5.0000</bounty>
<initialresource resourcetype="Favor">1.0000</initialresource>
<rollovertextid>16557</rollovertextid>
<rollovercounterwithid>20796</rollovercounterwithid>
<rolloverupgradeatid>17742</rolloverupgradeatid>
<buttonpos row="2" page="2" column="0"></buttonpos>
<decay delay="0.0000" duration="1.0000"></decay>
<armor damagetype="Hack" percentflag="1">0.30</armor>
<armor damagetype="Pierce" percentflag="1">0.96</armor>
<armor damagetype="Crush" percentflag="1">0.05</armor>
<unittype>LogicalTypeVolcanoAttack</unittype>
<unittype>LogicalTypeSuperPredatorsAutoAttack</unittype>
<unittype>LogicalTypeAffectedByRestoration</unittype>
<unittype>LogicalTypeTornadoAttack</unittype>
<unittype>LogicalTypeSuperPredatorsAttack</unittype>
<unittype>LogicalTypeConvertsHerds</unittype>
<unittype>LogicalTypeEarthquakeAttack</unittype>
<unittype>LogicalTypeSiegeAutoAttack</unittype>
<unittype>LogicalTypeHandUnitsAutoAttack</unittype>
<unittype>LogicalTypeBuildingNotTitanGate</unittype>
<unittype>LogicalTypeValidDeconstructionTarget</unittype>
<unittype>LogicalTypeBuildingsNotWalls</unittype>
<unittype>LogicalTypeBuildingsNotHouses</unittype>
<unittype>LogicalTypeTimeshift</unittype>
<unittype>LogicalTypeRangedUnitsAutoAttack</unittype>
<unittype>LogicalTypeVillagersAttack</unittype>
<unittype>LogicalTypeHandUnitsAttack</unittype>
<unittype>LogicalTypeRamAttack</unittype>
<unittype>LogicalTypeRangedUnitsAttack</unittype>
<unittype>LogicalTypeTartarianGateValidOverlapPlacement</unittype>
<unittype>LogicalTypeValidForestFireTarget</unittype>
<unittype>LogicalTypeSeaSerpentAttack</unittype>
<unittype>LogicalTypeValidMeteorTarget</unittype>
<unittype>Building</unittype>
<unittype>BuildingClass</unittype>
<unittype>AbstractTemple</unittype>
<unittype>ConvertableBuilding</unittype>
<unittype>MilitaryBuilding</unittype>
<unittype>SharedBuilding</unittype>
<train row="1" page="2" column="1">Another Osiris</train>
<train row="1" page="1" column="0">New Osiris</train>
<tech row="0" page="1" column="0">Wheelbarrow Fake</tech>
<tech row="0" page="1" column="1">Power of Osiris</tech>
<tech row="0" page="1" column="2">Winter Harvest Fake</tech>
<tech row="0" page="1" column="4">Pickaxe</tech>
<tech row="0" page="1" column="4">Shaft Mine</tech>
<tech row="0" page="1" column="3">Carpenters</tech>
<tech row="0" page="1" column="3">Bow Saw</tech>
<tech row="0" page="1" column="4">Quarry</tech>
<flag>ObscuresUnits</flag>
<flag>Immoveable</flag>
<flag>NoBloodOnDeath</flag>
<flag>NonAutoFormedUnit</flag>
<flag>Doppled</flag>
<flag>CollidesWithProjectiles</flag>
<flag>DontFadeInOnBuild</flag>
<flag>SelectWithObstruction</flag>
<flag>HideResourceInventory</flag>
<flag>PaintTextureWhenPlacing</flag>
<flag>NoIdleActions</flag>
<flag>FlattenGround</flag>
<flag>Tracked</flag>
<contain>Relic</contain>
</unit>

[This message has been edited by WinterGod (edited 01-23-2019 @ 00:04 AM).]

Izalith
Mortal
(id: Lilitu)
posted 23 January 2019 09:17 AM EDT (US)     9 / 14       
Did you allow producing this "New Unit" to your civilization in the tech tree?

Azarath Metrion Zinthos

Steam: Order of Azarath
Twitch: twitch.tv/orderofazarath
Discord: Azarath @ https://discord.gg/3ENKJeb
WinterGod
Mortal
posted 23 January 2019 12:00 PM EDT (US)     10 / 14       
It's under Age 1, in the tech tree I believe, but it doesn't belong to a culture. It shows up in all civilizations, at the temple. But never shows up at the Shrine.
heydonis
Mortal
posted 23 January 2019 12:35 PM EDT (US)     11 / 14       
Yeah i had this issue a few days ago. There was a few flags that i had to remove, i think allowedage. But you also need to add to the techtree and proto properly to get it working. Probably can just take out the prereq syntax in the techtree.
WinterGod
Mortal
posted 24 January 2019 00:15 AM EDT (US)     12 / 14       
It's in the techtree. Maybe there is a different problem with the shrine?
heydonis
Mortal
posted 24 January 2019 04:14 AM EDT (US)     13 / 14       
add my discord i could prob help easier there. Ill try adding SoO now as well

skrrrrtttt#1776
XLightningStormL
Mortal
(id: TheBronyKing11)
posted 24 January 2019 05:36 AM EDT (US)     14 / 14       
It's nothing to do with the shrine itself, trust me, I've already worked with the Shrine directly (and you've stated that it works for other units)



Make sure that the "allowedculture" and "buildlimit" stuff is removed or changed too.

The issue with it not training feels to me that you've either (inadvertently) botched either the syntax, or the unit data name that is called.
<train column="x" page="1" row="y">Another Osiris</train>
<train column="z" page="1" row="y">New Osiris</train>

proper techtree lines:
<effect amount="1.00" relativity="Absolute" subtype="Enable" type="Data">
<target type="ProtoUnit">Another Osiris</target>
</effect>
<effect amount="1.00" relativity="Absolute" subtype="Enable" type="Data">
<target type="ProtoUnit">New Osiris</target>
</effect>

Other than that I honestly have no clue, it's most likely dodgy train line code.

Lead Designer and Producer of Age of Mythology's biggest mod compilation: http://aom.heavengames.com/downloads/showfile.php?fileid=11038
You must be logged in to post messages.
Please login or register

Hop to:    

Age of Mythology Heaven | HeavenGames