Quote from: slasher on Tue 11/09/2012 07:33:28EDIT: I should have realised:
Health = (Health-10);
-------------------------------------------------------
Health = -10; // This bit should lose 10 from the bars width (starts at 200 width size)
Just to help clear up what the issue was, in your original code snippet you were directly setting the value of the variable
Health to -10. In your revised code, you're of course reducing its value by 10. You could also write this as:
Health -= 10;
The
-= operator means you're going to reduce the value of the variable on the left by the amount on the right. If that causes any confusion then feel free to steer clear of -= for now, but if you're going to code a lot it will save you having to type the variable name twice (If you're wanting to reduce only by 1, you could also even use the -- operator, such as Health--; which makes it that much shorter if only changing by 1).
Also, you have posted this as being in the region4_WalksOnto event, which is fine, but I see you're referencing your objects via the global object array. If you want to make your room scripts a bit more readable then you can use the object's name directly (set in the room editor) just like you do with characters. Outside of the room script (GlobalScript, etc.) you would still have to use the object array, but inside of room scripts you could do:
oSpider.SetView(8);
oSpider.Animate(0, 4, eRepeat, eNoBlock);
Assuming that object 8 in the room is named oSpider (just guessing from the Elf's response.).
And welcome to the forums by the way. :)