Status Variables and Timers

ender
13 Aug 2011, 14:28
I'm trying to build a combat system ... and I thought I'd make it a little more challenging by using a timer to determine when the enemy attacks ... which seems to work great ... but I found one problem ... the player's hit points are in a status variable ... and it appears that while the base attribute can be updated using a timer ... it doesn't update the status variable in the display ... so the player gets hit but doesn't know how many hit points they have left ...

Is there a way to update the display of the status attributes using a timer?

The Pixie
13 Aug 2011, 14:50
Say you have an attribute called base_hits, which changes when hit by an enemy, and a status variable calc_hits, which is calculated from the base_hits, and needs to be displayed...

Set calc_hits as a status variable.

Create a script attribute on the player called changedbase_hits. This script will automatically be run whenever base_hits changes, so you can use this to modify the value of calc_hits.

Pertex
13 Aug 2011, 19:28
There was a problem with timer and refreshing exits and the other panes. Perhaps is the statuspane still buggy?

ender
13 Aug 2011, 20:54
The status pane doesn't seem to update unless the player takes a 'turn' ... this is also true of the debug pane ...

Pertex
14 Aug 2011, 09:24
THis seems to be #753 in the issue tracker: http://quest.codeplex.com/workitem/753

ender
14 Aug 2011, 23:15
I solved my problem by putting the line 'UpdateStatusAttributes' in my timer ... this is the funciton that core.aslx runs when it wants to update the status attributes ... so I thought I'd give it a try and it worked.

Alex
15 Aug 2011, 11:19
Reopened on the Issue Tracker so will look at this when I get back.