Character dump

All development conversation and discussion takes place here

Moderator: Moderator

Post Reply
Message
Author
shani
Halfling
Posts: 83
Joined: Tue Aug 22, 2006 9:27 am
Location: Israel

Character dump

#1 Post by shani »

I started working on a more presentable character dump (I thought of an XML file with XSLT transformation,
but that can be optional since it's an overkill :lol: )
Anyways, How can I rertrieve the inventory? I can't seem to find anything in ActoryInventory
and showing only the '.combat' properties seems lacking...

Shoob
Reaper
Posts: 1535
Joined: Mon Jan 22, 2007 6:31 pm
Location: East of the sun, west of the moon

Re: Character dump

#2 Post by Shoob »

have a look starting at line 123 of game/engine/dialogs/ShowEquipInven.lua

what you probably want is game.player.inven and game.player.inven_def (the first is used for inventory, the last for equipment, the above file shows how to access them).
Oliphant am I, and I never lie.

Antagonist
Higher
Posts: 71
Joined: Sun May 23, 2010 9:55 am

Re: Character dump

#3 Post by Antagonist »

I approve of this project.

darkgod
Master of Eyal
Posts: 10750
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: Character dump

#4 Post by darkgod »

Ohhh thanks !

XML+XSLT yes probably too much for joe average yes ;)
But dumps should be made into both a text format and an html one IMO.

As for iterating all objects:

Code: Select all

	for inven_id, inven in pairs(actor.inven) do
		for item, o in ipairs(inven) do
			
		end
	end
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

shani
Halfling
Posts: 83
Joined: Tue Aug 22, 2006 9:27 am
Location: Israel

Re: Character dump

#5 Post by shani »

No problem... I might help more after I'll finish my exams (Last exams before getting my grade, yay!!! :D )

Meanwhile, I'm working on the textual dump, the HTML one I'll do later.

shani
Halfling
Posts: 83
Joined: Tue Aug 22, 2006 9:27 am
Location: Israel

Re: Character dump

#6 Post by shani »

Here's a Sample dump from the new dump function:

Code: Select all

  [Tome 4.00 @ www.te4.org Character Dump]

Sex              : Male         STR:  14
Race             : Hobbit       DEX:  29
Class            : Slinger      MAG:  10
Level            : 6            WIL:  10
Exp              : 49%          CUN:  20
Gold             : 8783.550000  CON:   12

Attack(Main Hand):  39          Life             :     170/170
Damage(Main Hand):   4          Stamina          :     115/115
APR   (Main Hand):   0          
Crit  (Main Hand):   5%         
Speed (Main Hand): 0.80         

  [Character Equipment]
 In main hand
a) rough leather sling
 In off hand
 On fingers
a) copper ring of dexterity (+2)
b) copper ring of defense (5 def, 0 armor)
 Around neck
a) copper amulet of cunning (+2)
 Light source
a) bright brass lantern of clear sight
 Main armor
a) rough leather armour of nature resistance (1 def, 2 armor)
 On head
 On hands
 On feet
a) pair of rough leather boots (0 def, 1 armor)
 Tool
 Quiver
a) 196 iron shot (8.5-10.2 power, 1 apr)

  [Character Inventory]
a) Blood of Life
b) acid-proof potion of lesser healing
c) giant potion of greater healing
d) 2 giant potion of lesser healing
e) 2 potion of cure poison
f) 13 potion of lesser healing
g) potion of lesser mana
h) potion of see invisible
i) potion of slime mold juice
j) 2 long scroll of identify
k) 14 scroll of identify
l) 5 scroll of light
m) scroll of magic mapping
n) 20 scroll of phase door
o) scroll of teleportation
p) elm staff
q) shimmering linen robe of lightning resistance (0 def, 0 armor)
r) 184 iron shot (8.5-10.2 power, 1 apr)
s) citrine

Fatigue          : 7%           Spellpower:   10
Armor            : 3            Spell Crit:    5%
Class            : 14.65        Spell Speed:   1
Class            : 14.65        


Physical Resist:   7
Spell Resist:      5
Mental Resist:     8

Nature Resist:  10%

Number of NPC killed: 116
Most killed NPC: giant brown mouse (9)
If you have any ideas/modifications/rants let me know.
BTW: To whom should I give/send/post the code to?

Shoob
Reaper
Posts: 1535
Joined: Mon Jan 22, 2007 6:31 pm
Location: East of the sun, west of the moon

Re: Character dump

#7 Post by Shoob »

I would move the inventory/equipment to the very bottom of the file :P

I posted my visible monsters code to the modules forum, and I assume yours would go there too.
Oliphant am I, and I never lie.

shani
Halfling
Posts: 83
Joined: Tue Aug 22, 2006 9:27 am
Location: Israel

Re: Character dump

#8 Post by shani »

Good idea, moved.

Will post now code now.

Post Reply