Skip to content
User Avatar
#16
Auto-translated
vasik
I didn't manage to get anything working.

According to the specified value, I have byte 97, in your version it's 98 (+1). Not entirely clear why 97+, rather than 353 - 354

I attached the added file that I was using, changing the extension from zip to h5u. I added the extra spells, but they didn't appear anywhere. Maybe the xml just needs to be replaced directly in the data, rather than adding a new h5u, maybe I missed something somewhere, maybe it doesn't work, or maybe the byte is just incorrect???
Just download what I posted... and as for why 353 in decimal is 161h (hexadecimal) 01 61 - the bytes in the .exe go from least significant to most significant, i.e. 61 01, therefore 354 would be 162h - 62 01

It's better if the extension is .pak and the file should be located in the data folder

By the way, which version did you dig the types.xml from?! It's drastically different from the one in 3.1!

In short, you did something wrong - that's why it didn't work...

Anyway, it turns out that the .exe reserves an array for 354 elements, while in types.xml the array is defined for 353 elements!
<TypeName>Table_Spell_SpellID</TypeName>
<EnclosingNamespace>00000000</EnclosingNamespace>
<Attributes>
<__ClassTypeID>270064327</__ClassTypeID>
<__ObjectData>
<Attributes>
<Item>
<Key>ref_table_is_pointer</Key>
<Data>
<Type>04000000</Type>
<Data>true</Data>
</Data>
</Item>
<Item>
<Key>ref_table</Key>
<Data>
<Type>03000000</Type>
<Data/>
</Data>
</Item>
<Item>
<Key>ref_table_num_objs</Key>
<Data>
<Type>01000000</Type>
<Data>353</Data> вот тут должно быть 354

and a bit below:

			<Fields>
<Item>
<Type>a80da3ef</Type>
<Name>objects</Name>
<ChunkID>2</ChunkID>
<Description/>
<Constraints>
<Item>
<__ClassTypeID>270062596</__ClassTypeID>
<__ObjectData>
<MinElements>353</MinElements> тут тоже 354
<MaxElements>353</MaxElements> и тут 354
</__ObjectData>
</Item>
</Constraints>
<Attributes/>
<DefaultValue>
<Type>00000000</Type>
</DefaultValue>
<ComplexDefaultValue>
<Type>00000000</Type>
</ComplexDefaultValue>
</Item>
</Fields>

In the .exe I only added +1, i.e. you need to run an experiment with one spell... for that, in types.xml you need to replace 353 with 354 in those three places

I attached the correct version to the post... you need to unpack it... put the file vasik_add_spells.pak in the data folder and you need to use the .exe - H5_Game_vasik.exe

I added an uber-freeze spell to Kaspar... check it in the game, unfortunately I can't do it myself since I can't launch the game at work!

In short, I added the spell SPELL_VASIK to Kaspar - a buddy checked it on his laptop... in battle this spell consumes mana, but nothing happens... absolutely nothing...

Conclusion - most likely there's some handler in the .exe that calls the appropriate subroutine by the spell's name... the only hope is for spells like:

				<Item>SPELL_ABILITY_CUSTOM1</Item>
<Item>SPELL_ABILITY_CUSTOM2</Item>
<Item>SPELL_ABILITY_CUSTOM3</Item>
<Item>SPELL_ABILITY_CUSTOM4</Item>


With those, at least somewhat, but you can work... since the esteemed comrade Dyrman successfully uses them in NHF!

С уважением, Psatkha (Псатха)

---------------------------------------------

Неудачное планирование ведёт к неудаче ...

NCF - мод, добавляющий дополнительных существ в HeroesV 3.1

Statistics

Welcome our newest member: leyu