Thread: Combat Tracker...
-
August 30th, 2008, 07:00 #11
Hi Obe
Do you have any skeleton code you have started work on, or are you staring at the default d20 stuff at the moment?
Cheers
Stuart
-
August 30th, 2008, 07:03 #12
I am still poking at the D20 stuff in confusion for now. And even worse? I have barely managed to figure out which side is head and which is arse of it.
- Obe
-
September 2nd, 2008, 08:47 #13
The part I'd need to see most of is just what code sends the "Your turn now" part. I can probably do the rest on my own.
I am figuring that
math.fmod (x, y)
Returns the remainder of the division of x by y that rounds the quotient towards zero.
Means I should be able to send the combat tracker into a loop when repeating over the entries and finding any zeroes with math.fmod (Segment, ActValue_of_character) and then check over their Init for those acting.
-
September 3rd, 2008, 06:42 #14
OK, very sorry about the delay on this one.
The problem with using fmod is that it won't allow you to let a combatant deliberately pause for a few segments, and it won't sort the entries properly. So I think you need a 'next acts' field which counts upwards and shows on which segment a combatant next is allowed to act.
The combat tracker code is spread over a number of files, the most notable being:
combattracker.lua - manages the list within the tracker
combattracker_entry.lua - manages each combatant's window in the list
combattracker_effects.lua - manages the list of effects for each entry
In addition, the utility_combattracker.xml file contains inline script for other elements of the tracker, such as the next actor button.
I think the rough outline of what needs doing is:
- create a 'next acts' numbercontrol on the individual combat tracker entry windowclasses. This will be used to sort (in ascending order) each combatant and control who goes next. For the time being we can ingore what happens when two combatants have the same 'next acts' value and address that later. You could re-use the initiative control for this purpose, but you will have to change onSort to reverse the comparison so lower values appear before higher ones.
- amend the description of the next round button to label it a 'nest segment' button. This will advance the round counter (which is now a segment counter) by one only.
- amend the nextround method in combtatracker.lua to do nothing except increment the round counter for now (just comment the rest of the code out)
- amend the nextactor method in combattracker.lua to add the act-level value to the current combatant's 'next acts' value and invoke applySort() to rearrange the combatants. It should then grab the 'next acts' value of the first entry in the (re-sorted) list and set the roundcounter value equal to the this next acts value. It should set the first combatant to be 'active'.
This approach will allow you to advance play between combatants. it won't be fully functional, but it should give you something that is starting to look like what you need.
Stuart
-
September 9th, 2008, 06:39 #15
Hi Obe, did you get any further on this one?
Stuart
-
September 9th, 2008, 07:20 #16
Not terribly, no. But that is mostly due to lack of time. Found and changed the sorting order, went and switched the name from round to segments and then fell asleep at the keyboard litterarely.
- Obe
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks