Attaching and changing attributes of player

Greetings ! I start to make new game recently and ran into one problem.
I'm not entiarly shure how exacly work attributes and how change them.
What I whant to do is change player "form\status" by using an item, but every time I use a debug menu, it's doesn't work properly as I want.
I will gladly accept any help, thanks.

(filler for getting my edited post, updated/posted)
(again, filler for getting my edited post, updated/posted)

here's some links to get you started (in particular, for Attribute usage and the 'if' Script usage, see my 'HK attributes and if script usage guide' link):


in the GUI/Editor:

add new script -> 'variables' section/category -> 'set a variable or attribute' Script -> (see below)


for examples:

(quest can parse/examine the Value, to know what type of Attribute you want it to be if the Attribute doesn't exist yet, as the Value Type must match up with the Attribute Type)

set variable player.strength = [EXPRESSION] 100 // Integer Attribute storing an Integer Value

set variable player.condition = [EXPRESSION] "normal" // String Attribute storing a String Value

set variable orc.dead = [EXPRESSION] false // Boolean Attribute storing a Boolean Value

// create ("katana") // for Object (pointer/reference) Attributes, the Value used, must be an actual existing Object, hence showing this line which would create a 'katana' Object, if the '//' comment symbols were removed to the left of 'create'

set variable player.weapon = [EXPRESSION] katana // Object (pointer/reference) Attribute storing an Object (pointer/reference) Value

human brains do this automatically, but computers need to be helped with data types, as they do matter, we just handle them automatically with our brains, lol:

Data Types:


(aka: text): a collection of characters (alphabet and numeric) and/or symbols (some, not all)

anything within double quotes, is a String Value:

"1" --- this is a String Value, and NOT an amount Value
1 --- is an amount Value (an Integer)


any non-decimal/fractional number

Doubles (Floats, Floating Points, decimal/fractional numbers):

any decimal/fractional number


either it's a 'true' or 'false' Value

here's an example for you:

<game name="NAME_OF_GAME">

<object name="room">

  <inherit name="editor_room" />


<object name="player">

  <inherit name="editor_object" />
  <inherit name="editor_player" />

  <attr name="parent" type="object">room</attr>

  <attr name="condition" type="string">normal</attr>

  <attr name="changedcondition" type="script">

    if (player.condition = "poisoned") {

      poison_turnscript.enabled = true

    } else {

      if (poison_turnscript.enabled) {

        poison_turnscript.enabled = false


      if (player.condition = "dead") {

        msg ("You died or were killed")

        msg ("GAME OVER")





  <attr name="life" type="string">999/999</attr>

  <attr name="maximum_life" type="int">999</attr>

  <attr name="changedmaximum_life" type="script">


      if (player.current_life > player.maximum_life) {

        player.current_life = player.maximum_life

      } = player.current_life + "/" + player.maximum_life



  <attr name="current_life" type="int">999</attr>

  <attr name="changedcurrent_life" type="script">


      if (player.current_life > player.maximum_life) {

        player.current_life = player.maximum_life

      } else if (player.current_life < 0) {

        player.current_life = 0

      } = player.current_life + "/" + player.maximum_life

      if (player.current_life = 0) {

        player.condition = "dead"




  <statusattributes type="stringdictionary">



      <value>Life: !</value>




      <value>Condition: !</value>




<object name="poisoned_apple">

  <attr name="parent" type="object">room</attr>

  <attr name="alias" type="string">poisoned apple</attr>

  <attr name="eat" type="script">

    if (player.condition = "normal")

      player.condition = "poisoned"

      msg ("You eat the poisoned apple, poisoning yourself")

      poisoned_apple.parent = internal_storage

    } else if (player.condition = "poisoned")

      msg ("You're already poisoned, silly")


    // handling another condition that prevent being poisoned, or that you don't want to be over-ridden/over-rided by it: you don't want your current condition to change to being the 'poisoned' condition:

    // optional: 
    // else if (CONDITION_EXPRESSION) {
    // }
    // optional: more/additional else ifs
    // optional:
    // else {
    // }



<object name="cure_poison_potion">

  <attr name="parent" type="object">room</attr>

  <attr name="alias" type="string">cure poison potion</attr>

  <attr name="drink" type="script">

    if (player.condition = "poisoned") {

      player.condition = "normal"

      msg ("You use the pure poison item, curing you of poison")

      cure_poison_potion.parent = internal_storage

    } else {

      msg ("You realize you're NOT poisoned, just in time, preventing you from wasting this item when it wasn't needed to be used")




<object name="internal_storage">




  <defaultexpression>You can't eat that!</defaultexpression>





  <defaultexpression>You can't drink that!</defaultexpression>


<turnscript name="poison_turnscript">

  <attr name="enabled" type="boolean">false</attr>


      player.current_life = player.current_life - 100

      msg ("The poisoning takes its toll on you! (-100 current life)")




if you want to be able to have multiple conditions at the same time, then we'd need to use List/Dictionary Attributes for our 'condition' Attribute, and add/remove the condition items from our 'condition' List/Dictionary Attribute/s

(or you can also instead do Boolean Attributes for each condition... which is easier than learning to use Lists/Dictionaries, but not as effective... if you got a lot of conditions and etc functionality with/involving them)

(in my example, our single 'condition' Attribute is a String Attribute, which can only hold 1 Value, so only one condition at a time for this specific 'condition' String Attribute)

It depends on if you are using online or offline version and what type of attribute it is. First it must be added to the players attributes then when wanting to change it you just call player.attribute = (x) or if doing maths
player.attribute = player.attribute + 6 using maths you can use any math sign doesn't have to just add.

This topic is now closed. Topics are closed after 60 days of inactivity.