Home » MODDING HQ 1.13 » v1.13 Modding, Customising, Editing » v1.13 XML Customization » Randomitem.XML (How does it work?)
Randomitem.XML[message #359800] Tue, 28 April 2020 03:07 Go to next message
edmortimer

 
Messages:1350
Registered:January 2015
Location: Home Free
Can anybody point me to information on how to modify RandomItem.xml?






Re: Randomitem.XML[message #359801 is a reply to message #359800] Tue, 28 April 2020 03:19 Go to previous messageGo to next message
sevenfm

 
Messages:2314
Registered:December 2012
Location: Russian Federation
edmortimer wrote on Tue, 28 April 2020 05:07
Can anybody point me to information on how to modify RandomItem.xml?
You can take a look how Strohmann implemented maps with random items in SDO mod:
https://ja2svn.mooo.com/source/ja2/branches/Strohmann/Stable_Revision_7435/Data-SDO

There's also information in svn:
r5594
New feature: random items allow spawn not themselves, but an item from a brad selection
- specify random items in RandomItems.xml
- when the game creates a random item, it searches all vialbe items according to random item class and picks one randomly
- this allows mappers to place items in maps that are more independent of the xml-set used, however the random items themselves msut be the same in map&mod
- can also be used to broaden the enemy gun/item choices selection
- for more reference, see http://www.bears-pit.com/board/ubbthreads.php/topics/310793.html#Post310793

r5598
- random items can also be results of merges and item transformations

r5618
- new <usItemClass>: IC_RANDOMITEM (0x40000000 or 1073741824) is used for random items exclusively.

r5648
Reminder: Do NOT put random items into any merchant xml or BR, weirdness can occur here!



7609+AI (r1679) | Unofficial modpack | Win8+ fix | Experimental project | Youtube | Trunk (r8904) | 1.13 Starter Docs

Кто в Москве не бывал, красоты не видал.


Re: Randomitem.XML[message #359802 is a reply to message #359801] Tue, 28 April 2020 03:20 Go to previous messageGo to next message
edmortimer

 
Messages:1350
Registered:January 2015
Location: Home Free
Thanks Seven!

Just FYI: this link doesn't work anymore. http://www.bears-pit.com/board/ubbthreads.php/topics/310793.html#Post310793


I guess I spoke too soon. SDO doesn't answer my question: which is . . . what are the properties of <RandomItem1-10> tag and of <Item1-10> tag.

[Updated on: Tue, 28 April 2020 03:29]







Re: Randomitem.XML[message #359803 is a reply to message #359802] Tue, 28 April 2020 03:24 Go to previous messageGo to next message
sevenfm

 
Messages:2314
Registered:December 2012
Location: Russian Federation
There's also information from Russian 7609 FAQ (use google translate if needed):

Как создавать случайные предметы

Пример из мода SDO.

Items.xml:
Quote:
<ITEM>
     <uiIndex>2748</uiIndex>
     <szItemName>Rnd Misc Item 1</szItemName>
     <szLongItemName>Rnd Face Item</szLongItemName>
     <usItemClass>1073741824</usItemClass>
     <randomitem>7</randomitem>
     ...
</ITEM>
Тег <randomitemcoolnessmodificator> позволяет предмету менять требования coolness для выбора заданных в нем случайных предметов.

RandomItem.xml:
Quote:
<RANDOMITEM>
     <uiIndex>7</uiIndex>
     <szName>Random Face Item, complete</szName>
     <randomitem1>1</randomitem1>
     ...
     <randomitem10>6</randomitem10>
     <item1>0</item1>
     ...
     <item10>0</item10>
</RANDOMITEM>
Теги <item1>..<item10> ссылаются реальные предметы в Items.xml
Теги <randomitem1>..<randomitem10> ссылаются на RandomItem.xml, таким образом случайные предметы ссылаются на другие случайные предметы, которые могут порождать в итоге группы реальных предметов.

RandomItem.xml:
Quote:
<RANDOMITEM>
     <uiIndex>1</uiIndex>
     <szName>Random Face Item, Group 1/6</szName>
     <randomitem1>0</randomitem1>
     ...      
     <randomitem10>0</randomitem10>
     <item1>176</item1>
     ...
     <item10>2306</item10>
</RANDOMITEM>
Items.xml:
Quote:
<ITEM>
     <uiIndex>176</uiIndex>
     <szItemName>Steel Helmet</szItemName>
     <szLongItemName>Steel Helmet</szLongItemName>
     <usItemClass>2048</usItemClass>
     ...
</ITEM>
And also comments from Russian modder:

1) Если вписывать предметы только в теги <itemХ>ХX</itemХ>, то всегда будет браться только предмет <item1>Х</item1>.
2) Если в наборе присутствуют теги <randomitemХ> и <itemХ>, то выбор будет происходить только между <randomitem>.
3) Для корректной работы нужно создавать отдельно предмет <RANDOMITEM ХX>, в который вписываются предметы из Items.xml, и отдельно -  предмет <RANDOMITEM YY>, который ссылается на предмет <RANDOMITEM ХХ> через тег  <randomitemХ>ХХ</randomitemХ>.

[Updated on: Tue, 28 April 2020 03:30]




7609+AI (r1679) | Unofficial modpack | Win8+ fix | Experimental project | Youtube | Trunk (r8904) | 1.13 Starter Docs

Кто в Москве не бывал, красоты не видал.


Re: Randomitem.XML[message #359804 is a reply to message #359803] Tue, 28 April 2020 03:34 Go to previous messageGo to next message
edmortimer

 
Messages:1350
Registered:January 2015
Location: Home Free
Thanks for trying. I still don't understand the most important part - which is #3

1) If you enter items only in the tags <itemX> XX </ itemX>, then only the item <item1> X </item1> will always be taken.
2) If the tags contain <randomitemX> and <itemX> tags, then the selection will occur only between <randomitem>.
3) For correct operation, you need to create a separate object <RANDOMITEM XX>, which contains items from Items.xml, and separately, an object <RANDOMITEM YY>, which refers to an object <RANDOMITEM XX> through the tag <randomitemХ> ХХ </ randomitemХ> .






Re: Randomitem.XML[message #359805 is a reply to message #359802] Tue, 28 April 2020 03:34 Go to previous messageGo to next message
sevenfm

 
Messages:2314
Registered:December 2012
Location: Russian Federation
edmortimer wrote on Tue, 28 April 2020 05:20
what are the properties of <RandomItem1-10> tag and of <Item1-10> tag.
As I understand it, ItemXX is reference to Items.xml which translates to real item, RandomItemXX is reference to RandomItems.xml which allows to make a kind of nested tree of random items which finally translate to a set of random items, for example with 10 random items at first level and 10 groups of 10 random items at second level you can have random item in items.xml which translates to 100 random items in RandomItem.xml, for more details try to take any random item in items.xml in SDO mod and follow the reference IDs until you make a table of all possible items.



7609+AI (r1679) | Unofficial modpack | Win8+ fix | Experimental project | Youtube | Trunk (r8904) | 1.13 Starter Docs

Кто в Москве не бывал, красоты не видал.


Re: Randomitem.XML[message #359806 is a reply to message #359804] Tue, 28 April 2020 03:38 Go to previous messageGo to next message
sevenfm

 
Messages:2314
Registered:December 2012
Location: Russian Federation
edmortimer wrote on Tue, 28 April 2020 05:34
Thanks for trying. I still don't understand the most important part - which is #3

1) If you enter items only in the tags <itemX> XX </ itemX>, then only the item <item1> X </item1> will always be taken.
2) If the tags contain <randomitemX> and <itemX> tags, then the selection will occur only between <randomitem>.
3) For correct operation, you need to create a separate object <RANDOMITEM XX>, which contains items from Items.xml, and separately, an object <RANDOMITEM YY>, which refers to an object <RANDOMITEM XX> through the tag <randomitemХ> ХХ </ randomitemХ> .
That means - don't mix itemXX and randomitemXX tags in one record in RandomItem.xml, if you need only 10 possible random items, just make one record with only ItemXX tags, if you need more random items, you have to use nested tree in which case you create one record with only RandomItemXX tags which are ID references to the records in the same file where you can either define itemXX tags so the game translates it to real items or add another level of random items in which case you only use RandomItemXX tags.



7609+AI (r1679) | Unofficial modpack | Win8+ fix | Experimental project | Youtube | Trunk (r8904) | 1.13 Starter Docs

Кто в Москве не бывал, красоты не видал.


Re: Randomitem.XML[message #359807 is a reply to message #359806] Tue, 28 April 2020 03:53 Go to previous messageGo to next message
edmortimer

 
Messages:1350
Registered:January 2015
Location: Home Free
Quote:
That means - don't mix itemXX and randomitemXX tags in one record in RandomItem.xml, if you need only 10 possible random items, just make one record with only ItemXX tags, if you need more random items, you have to use nested tree in which case you create one record with only RandomItemXX tags which are ID references to the records in the same file where you can either define itemXX tags so the game translates it to real items or add another level of random items in which case you only use RandomItemXX tags.

Yeah, I got it now, thank you. I had to think about it a bit, then realized what it meant.






Re: Randomitem.XML[message #361354 is a reply to message #359807] Wed, 23 September 2020 03:24 Go to previous messageGo to next message
edmortimer

 
Messages:1350
Registered:January 2015
Location: Home Free
OK, I've uncovered a problem with RandomItems regarding weapons. They appear correctly, and are loaded with ammunition (though, of course, the game doesn't provide any extra). However when unloading the weapon, regardless of which one it is (as long as it was spawned via RandomItems.XML), the ammunition will disappear. If loaded with new ammo, and then unloaded, that ammo will disappear also. It seems to fire correctly and do damage correctly when loaded, but always disappears the ammo when unloaded. Using Sevenfm's Tactical Panel (7609+AI_r1574) it shows that whenever ammunition is loaded into the randomly spawned weapon it becomes NADA. At least, that's what the Tactical Panel reports.







Re: Randomitem.XML[message #361355 is a reply to message #361354] Wed, 23 September 2020 06:32 Go to previous messageGo to next message
sevenfm

 
Messages:2314
Registered:December 2012
Location: Russian Federation
Does it happen too with default 1.13 ja2.exe? I remember sometimes incorrect ammo is created when weapon is reloaded with cheat code, results in NADA if then unloaded, maybe there is something similar happens here.



7609+AI (r1679) | Unofficial modpack | Win8+ fix | Experimental project | Youtube | Trunk (r8904) | 1.13 Starter Docs

Кто в Москве не бывал, красоты не видал.


Re: Randomitem.XML[message #361356 is a reply to message #361355] Wed, 23 September 2020 07:01 Go to previous message
edmortimer

 
Messages:1350
Registered:January 2015
Location: Home Free
Quote:

Does it happen too with default 1.13 ja2.exe?
Yes. The ammo is NADA while loaded, yet seems to work as intended. It disappears if unloaded.






Previous Topic: What is the Unit of visual range bonuses in Item.xml?
Next Topic: A Serious of Questions
Goto Forum:
  


Current Time: Tue Oct 20 14:25:46 EEST 2020

Total time taken to generate the page: 0.01171 seconds