STAR TREK 2d20
  1. #1

    Skills and the CT

    I'm trying to make a skills line in the CT, similar to the one in Castles and Crusades except only for NPCs (PCs aren't important to me ). I've got the code to a semi-working state and was wondering how to go about (1) Having only NPCs have this skills line; & (2) Having itself hide until the combat icon is clicked. I've basically cloned the entry for another combat line in the ct_host.xml code I'm modifying but it breaks rules (1) & (2) I was wondering if anyone could help me out on this one.

    Regards,
    SF
    Aliens.... Go fig?

  2. #2

  3. #3
    You will if I can get someone to help.
    Aliens.... Go fig?

  4. #4
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,411
    Have a look at the effects list in the CoreRPG ruleset. It is a <windowlist> control defined in ct\ct_host.xml and a couple of other associated controls, do a search for the comment "Effect subsection" in that xml file.

    Whether it is visible or not is controlled by the setEffectsVisible() function in the ct\scripts\ct_entry.lua script which uses the <controlname>.setVisible method to either show or hide the controls related to effects. This is called from the "activateeffects" button (to just show the effects for one entry) or the window.list.toggleEffects method from the "button_global_effects" button (both of these buttons are in ct\host.xml.

    1. Copy the XML sections related to effects and rename them appropriately for your skills (I'm guessing you've done this already).
    2. In ct\scripts\ct_entry.lua copy function setEffectsVisible() to something like setSkillsVisible() and edit it for your new skills controls.
    3. If you have a global button to show/hide skills: in ct\scripts\ct.lua copy toggleEffects to something like toggleSkills and edit it appropriately to your new controls.
    4. You'll need to add some code to your setSkillsVisible() function so that it only activates if it is an NPC. local sClass,_ = link.getValue(); will return in sClass the classname of the entry in the CT - this will be "charsheet" for a PC and "npc" for a NPC. Do a check for sClass == "npc" in your new setSkillsVisible() function to only set the skills controls visible if sClass == "npc".
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  5. #5

  6. #6
    Quote Originally Posted by damned View Post
    I cant help you Scott - but would love to see the finished code.
    As would I
    Dulux-Oz

    √(-1) 2^3 Σ Π
    ...And it was Delicious!


    Alpha-Geek
    ICT Professional
    GMing Since 1982
    NSW, Australia, UTC +10
    LinkedIn Profile: www.linkedin.com/in/mjblack

    Watch our games on Twitch: www.twitch.tv/dulux_oz

    Support Me on Patreon: www.patreon.com/duluxoz

    Past Games, etc, on my YouTube Channel: www.youtube.com/c/duluxoz

  7. #7
    Thanks Trenloe, I owe you another.
    Aliens.... Go fig?

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