How to attach/upgrade items when you buy them with coins/points in the game.
DaGreatness
Member Posts: 82
I am trying to figure out how to attach/upgrade/equip my character/actor in the game so that he is able to buy engine parts for his car, from the points he collected. I already know how to add the points and save them, but i am not being able to attach or equip the items that were bought with the coins to the actor/character so they can use it when the game starts.
Basically, i want to know how to equip bought items to my character/actor for him to she he is able to use them in the game.
Thanks in advance
PS sorry, if this is a NOOB question, but some insight or direction would be much appriecated.
Basically, i want to know how to equip bought items to my character/actor for him to she he is able to use them in the game.
Thanks in advance
PS sorry, if this is a NOOB question, but some insight or direction would be much appriecated.
Comments
With that table you can then spawn each upgrade (if by attach you mean visually) if it contains a 1 in the relevant row. You can do all of your rules using that table too I.e. If they press a particular key or button check to see if they have the upgrade and if so do the action for it.
To check if a table cell contains a 1 in a rule try adding a game attribute called something like game.valueOne and set it as 1 by default, then in your rules you check the table like this:
If game.valueOne = tableCellValue(upgradesTable,relevant upgrade row, 2)
If you're using the nightly builds it would be
If tableCellValue(upgradesTable,upgrade row, 2) = 1
You could also set the tableCellValue into a game attribute and use that in the rules if you prefer that, it just means extra code in your game.
I hope I haven't confused you
So I am able to create the table and set up the 4 rows with the values of 0 because i want all 4 items to be locked out for now. and set it so when the player reaches the point value it unlocks.
I kind of got confused when you wrote this
"With that table you can then spawn each upgrade (if by attach you mean visually) if it contains a 1 in the relevant row. You can do all of your rules using that table too I.e. If they press a particular key or button check to see if they have the upgrade and if so do the action for it."
What do you mean do all the rules using that table?