michtoen
Administrator
 
Karma: +30/-5
Posts: 1204
|
 |
« on: May 04, 2007, 01:47:20 am » |
|
Hello
I start now to write some Tutorials. I will post them to the forum as sticky thread, but there is no reason we don't include them elsewhere too.
This Tutorials are written for map makers, collecting the technical docs and dev notes, but they are interesting for everyone dealing with daimonin and development.
Note to other devs and map makers: You are free to edit this thread or to add information or remove them when they changed.
Lets start...
randomitems - how to call treasure lists ----------------------------------------
As described in the tutorial before, a treasure list is a drop list, inserting objects in the inventory of another object. That drops can be simple loot when killing a mob (money, torches, ...) or special system objects like spell forces, traps or something.
In the map editor, the command "randomitems" is used, to insert the from the TL defined items/objects inside the objects inventory.
(please note: Don't use ATM the treasurelist button inside the attribute window - it will add an TL in crossfire format. Thats still legal but you can't edit there the string to use the advanced daimonin format. For editing the "randomitems" string, use the text window. Don't forget to press apply after changing something there).
The treasure list is defined in the file "treasures" which can be found in /arch folder (for a server it is copied to /server/lib). Read the file "treasurelists" in the /doc folder.
To use such a treasure, just add "randomitems <list>" the the settings of a object. Random treasure will then be generated whenever such a monster is generated by a generator/spawn point, or when a map containing that object is loaded for the first time.
A randomitems command can have a list of treasurelists names. The format is:
randomitems <list1>;<list2>;<list3>;...
The list "none" is a special maker list. Command "randomitems none" will skip a possible default arch randomitems setting and generate no items for that object.
A <list> entry is the name of a treasure list inside the "treasures" file.
"randomitems weapon_misc" will generate a weapon (or nothing) "randomitems weapon_misc;armour_misc" will generate a weapon and a armour piece (or nothing)
A <list> entry can have parameters, which controls the treasure list called. A <paramter> has a single char as command marker and a value.
The format is: <ID><value> = "a100" or "s1"
Its called in this way:
<list_name>&<paramter1>,<parameter2>,...;<list_name>&<parameter1>,...
A <parameter> ends with a ',' (it follows another paramter), a ';' or a EOL. There can be any number of lists attached to a "randomitems" command.
Example:
randomitems weapon_misc&s1,a100;armour_misc&s1
This will generate a weapon with s = t_style 1 and a artifact chance of 100. So, IF a weapon is generated, it will be in 100% of all cases a fire related artifact weapon. The armour will be also fire related, but the artifact chance is normal. But when a artifact is generated, it will be always from style fire.
The commands are the same as descriped in the treasure lists docs if not described different.
NOTE: The "one char" identifier will allows fast parsing, as the whole structure of this system. This is a real-time issue - parsing of this list and creation of a linked list structure will happen everytime when a object/map is loaded and saved. So, performance is critical here because this is done in a bottleneck part (parsing objects, maps and loading/saving).
The paramter commands are:
m<value>: set "magic" M<value>: set "magic_chance" x<value>: set "difficulty" a<value>: set "artifact_chance" s<value>: set "t_style" r<value>: set "item_race" i<value>: set (items) "material_real" c<value>: set "material_quality" C<value>: set "material_range" q<value>: set "quality" Q<value>: set "quality_range"
d<value>: Drop chance 1/d. This will do a random check of (random % d) before calling the list. If it not 0, it skips the list. AFTER that, if the drop chance has not failed, the normal treasurelist chances of generating and dropping are called. D<value>: Drop chance in %. Same as d<value> but this is a value between 0 and 100. 100 means drop always, 25 means only in 25% of all cases. I: sets the IDENTIFIED flag for the generated item(s) B: sets a breakpoint. If the tlist with that parameter successfully generates an item, tlist generation stops and skips all possible lists after it.
|