*SOLVED* Python problem (with using property)

I have some problem i dont know exactly how to work with property i can show a string of code

PRonrel = OBweaponinfo['Wep_onreload_'+str(PRcurwep)]

where PRcurwep is integer
so for example if PRcurwep = 1 Then PRonrel is linked to property with name Wep_onreload_1 how i must write if i want my code work?

Sorry for my English :o

check this http://blenderartists.org/forum/showthread.php?t=189107 from resource forum

hm… maybe i dont undestand something? I didnt find something about that quastion in your url?

Perhaps you could clarify your problem a bit more.


I have property i need get it using “some text”+string

can someone help me?

Oh thank to all i got the unswer of my question

Here 's more info on and functions you can use with dictionaries.


So you did not understand that little helper page …hm… than you should have a look into the Game Engine API.

The information you provide us is not complete. The question I have to you is (the same that Python has):

  • What is OBweaponinfo?

If that is a KX_GameObject the code seems to be fine.

Yes it’s KX_GameObject

PVD, thanks for saying this… but I still do not know what the problem is.

My problem as in that i thought that for example PRreltim was linked to property Weapon_reload_time and so if i changed PRreltim the property Weapon_reload_time changed to. But in real not a link just integer with value as property Weapon_reload_time. And thats was all problem