I'm trying to learn basic scripting, the first thing I want to try is creating a variable for an item (such as apple), display "apples = x" on the HUD, and add +1 to apple total when I pick up an apple.
I'm looking through Bloodbane's Cherry on Top game to see how he does it with coins, but there's so much stuff there its kind of confusing.
First of all, I don't know C, the only programming language I'm familiar with is GML from Game Maker Studio (Though all my experience is from the older GM 8) and I haven't done it in a while so I'm a bit rusty.
To do this in GMS I would declare the variable (varapple = 0) in some controller object (like init_obj) that loads before the HUD loads, and in the HUD object's draw event have something like drawtext(x,y, "apple = " + init_obj.varapple) And I would put the increment in the item's collision event with the player (init_obj.varapple += 1)
In Openbor I'm not sure where to put the scripts. The HUD display text would go in updated.c right?
I assume the variable declaration would be something like
But I don't know where to put it. Is there some kind of pre-game initialize event?
Is there a file for the HUD? The old manual says lifebar.txt is just for colors, the new manual lists a bunch of HUD code but I don't see what file it applies to.
I'm looking through Bloodbane's Cherry on Top game to see how he does it with coins, but there's so much stuff there its kind of confusing.
First of all, I don't know C, the only programming language I'm familiar with is GML from Game Maker Studio (Though all my experience is from the older GM 8) and I haven't done it in a while so I'm a bit rusty.
To do this in GMS I would declare the variable (varapple = 0) in some controller object (like init_obj) that loads before the HUD loads, and in the HUD object's draw event have something like drawtext(x,y, "apple = " + init_obj.varapple) And I would put the increment in the item's collision event with the player (init_obj.varapple += 1)
In Openbor I'm not sure where to put the scripts. The HUD display text would go in updated.c right?
void main()
{
drawstring (10, 20, 2, "apple = " + varapple)
}
I assume the variable declaration would be something like
void main()
{
void oncreate()
{
setglobalvar(varapple, 0)
}
}
But I don't know where to put it. Is there some kind of pre-game initialize event?
Is there a file for the HUD? The old manual says lifebar.txt is just for colors, the new manual lists a bunch of HUD code but I don't see what file it applies to.