Need some coding help - accessing fields in an item record

正在查看此主题的用户

I'm trying to find a way to access and display different fields of an item but I'm not very familiar with python syntax.

For example, if I assigned "itm_sword_of_war" into reg(0), is there a way to reference reg(0) to get the item name, and value (sell price)?
 
Since so many opcodes return a value to reg0, I would avoid using it in your code. The following should do what you want:

插入代码块:
(assign,reg1,'itm_sword_of_war'),
(str_store_item_name,1,reg1), # stores the item name to string register 1
(troop_add_items,'trp_player',reg1,1), # sets up the next operation
(troop_remove_items,'trp_player',reg1,1), # stores the item's value to reg0

It's not the most elegant, but I can't remember if there is an opcode to get the item value directly off the top of my head.
 
Fujiwara 说:
It's not the most elegant, but I can't remember if there is an opcode to get the item value directly off the top of my head.

There is.

Flybyingly,
Winter
 
后退
顶部 底部