STAR TREK 2d20
Page 2 of 2 First 12
  1. #11
    Foen's Avatar
    Join Date
    Jan 2007
    Location
    Suffolk, England
    Posts
    2,007
    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

  2. #12
    Oberoten's Avatar
    Join Date
    May 2006
    Location
    Älvsbyn, Sweden
    Posts
    2,620
    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
    For your Ars Magica needs :
    https://fgrepository.com




    Atque in perpetuum frater, Ave atque vale.

  3. #13
    Oberoten's Avatar
    Join Date
    May 2006
    Location
    Älvsbyn, Sweden
    Posts
    2,620
    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.
    For your Ars Magica needs :
    https://fgrepository.com




    Atque in perpetuum frater, Ave atque vale.

  4. #14
    Foen's Avatar
    Join Date
    Jan 2007
    Location
    Suffolk, England
    Posts
    2,007
    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

  5. #15
    Foen's Avatar
    Join Date
    Jan 2007
    Location
    Suffolk, England
    Posts
    2,007
    Hi Obe, did you get any further on this one?

    Stuart

  6. #16
    Oberoten's Avatar
    Join Date
    May 2006
    Location
    Älvsbyn, Sweden
    Posts
    2,620
    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
    For your Ars Magica needs :
    https://fgrepository.com




    Atque in perpetuum frater, Ave atque vale.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
DICE PACKS BUNDLE

Log in

Log in