RPTools.net

Discussion and Support

Skip to content

It is currently Thu Oct 23, 2014 2:12 pm 






Reply to topic  [ 17 posts ]  Go to page 1, 2  Next

Previous topic | Next topic 

  Print view

Author Message
User avatar  Offline
RPTools Team
 
Joined: Tue Feb 07, 2006 1:07 am
Posts: 1759
Location: Austin, Tx
 Post subject: Getting InitTool 1.0 groups from DMGenie
PostPosted: Sat Feb 17, 2007 6:56 pm 
I wrote a little script for DMGenie that will output the current group as an Init Tool Groups (.rpgrp) file. Just add it as one of the action buttons and it will output the XML for the group in the combatant log. Cut and paste that to a file and it can be loaded into GT.

You can get the script from the gallery: DMGenie2RPToolsGroup

The group that is created is for the default Init Tool D&D game. If anybody knows how I could write a file directly from DMGenie, I'll fix it to do that, otherwise it's cut and paste.


Last edited by jay on Fri May 16, 2008 1:18 am, edited 1 time in total.

Top
 Profile  
 
User avatar  Offline
RPTools Team
 
Joined: Tue Feb 07, 2006 1:07 am
Posts: 1759
Location: Austin, Tx
 Post subject:
PostPosted: Mon Feb 19, 2007 1:06 pm 
To add this to DMGenie as an action button do the following:
  1. Select Windows --> General Script Editor from the menu
  2. In the Source drop down select 'Action Buttons'
  3. In the Function drop down select 'ActionButton##' where ## is replaced with a number. Make sure you find one that isn't being used. Unused ones do not have any scripting between the 'Public Sub ActionButton##' and 'End Sub' lines.
  4. Set the 'Button Label' field to something so you can tell what it does like 'RPTools Group XML'. You can set the tooltip if you want.
  5. Copy the script in the code box below into the text area at the bottom of the dialog. Make sure it goes between the 'Public Sub ActionButton##' and 'End Sub' lines.
  6. Click the check syntax button to make sure you copied it right. A little message dialog should come up and say that no syntax errors were found.
  7. The button is now ready to use. It will be located on the Actions or Attacks Tabs in DMGenie. The Description and Hints text box may tell you where to look.
Code:
func.AddToCombatLog "<group-set>"
func.AddToCombatLog "  <game-name>Rodinia</game-name>"
func.AddToCombatLog "  <groups>"
func.AddToCombatLog "    <group>"
func.AddToCombatLog "      <name>DMGenie Group</name>"
func.AddToCombatLog "      <combatants>"
func.GetNextCreatureInit 0
Set MyCreature = func.GetNextCreature
While (Not MyCreature Is Nothing)
  func.AddToCombatLog "        <combatant>"
  func.AddToCombatLog "          <name>" & MyCreature.Name & "</name>"
  func.AddToCombatLog "          <count>1</count>"
  func.AddToCombatLog "          <init-modifier>" & MyCreature.InitBonus & "</init-modifier>"
  func.AddToCombatLog "          <player>" & MyCreature.Desc_PlayerName & "</player>"
  func.AddToCombatLog "          <type>PC</type>"
  func.AddToCombatLog "          <token/>"
  func.AddToCombatLog "          <notes>" & MyCreature.Desc & "</notes>"
  func.AddToCombatLog "          <alignment>" & MyCreature.Alignment & "</alignment>"
  func.AddToCombatLog "          <family>" & MyCreature.RaceName & "</family> <!-- TODO: Change family to race -->"
  func.AddToCombatLog "          <size>" & MyCreature.SizeStr & "</size>"
  func.AddToCombatLog "          <ac>" & MyCreature.AC & "</ac>"
  func.AddToCombatLog "          <touchAc>" & MyCreature.ACTouch & "</touchAc>"
  func.AddToCombatLog "          <flatFootedAc>" & MyCreature.ACFF & "</flatFootedAc>"
  func.AddToCombatLog "          <speed>" & MyCreature.SpeedStr & "</speed>"
  func.AddToCombatLog "          <baseAttack>" & MyCreature.CalculateBABFromClasses() & "</baseAttack>"
  func.AddToCombatLog "          <str>" & MyCreature.Str & "</str>"
  func.AddToCombatLog "          <dex>" & MyCreature.Dex & "</dex>"
  func.AddToCombatLog "          <con>" & MyCreature.Con & "</con>"
  func.AddToCombatLog "          <int>" & MyCreature.Intel & "</int>"
  func.AddToCombatLog "          <wis>" & MyCreature.Wis & "</wis>"
  func.AddToCombatLog "          <cha>" & MyCreature.Cha & "</cha>"
  func.AddToCombatLog "          <grapple>FIXME</grapple>"
  func.AddToCombatLog "          <fortSave>" & MyCreature.FortSave & "</fortSave>"
  func.AddToCombatLog "          <reflexSave>" & MyCreature.RefSave & "</reflexSave>"
  func.AddToCombatLog "          <willSave>" & MyCreature.WillSave & "</willSave>"
  func.AddToCombatLog "          <strBonus>" & MyCreature.StrMod & "</strBonus>"
  func.AddToCombatLog "          <dexBonus>" & MyCreature.DexMod & "</dexBonus>"
  func.AddToCombatLog "          <conBonus>" & MyCreature.ConMod & "</conBonus>"
  func.AddToCombatLog "          <intBonus>" & MyCreature.IntMod & "</intBonus>"
  func.AddToCombatLog "          <wisBonus>" & MyCreature.WisMod & "</wisBonus>"
  func.AddToCombatLog "          <chaBonus>" & MyCreature.ChaMod & "</chaBonus>"
  func.AddToCombatLog "          <gender>" & MyCreature.Gender & "</gender>"
  func.AddToCombatLog "          <levels>" & MyCreature.LevelStr & "</levels>"
  func.AddToCombatLog "          <height>" & MyCreature.Height & "</height>"
  func.AddToCombatLog "          <weight>" & MyCreature.Weight & "</weight>"
  func.AddToCombatLog "          <age>" & MyCreature.Age & "</age>"
  func.AddToCombatLog "          <damageReduction>" & MyCreature.DamageReductionStr & "</damageReduction>"
  func.AddToCombatLog "          <hp>" & MyCreature.HPBase & "</hp>"
  func.AddToCombatLog "          <fortBase>" & MyCreature.FortBase & "</fortBase>"
  func.AddToCombatLog "          <fortMagic>" & MyCreature.FortBonus & "</fortMagic>"
  func.AddToCombatLog "          <reflexBase>" & MyCreature.RefBase & "</reflexBase>"
  func.AddToCombatLog "          <reflexMagic>" & MyCreature.RefBonus & "</reflexMagic>"
  func.AddToCombatLog "          <willBase>" & MyCreature.WillBase & "</willBase>"
  func.AddToCombatLog "          <willMagic>" & MyCreature.WillBonus & "</willMagic>"
  func.AddToCombatLog "          <sizeBonus>" & MyCreature.SizeStr & "</sizeBonus>"
  func.AddToCombatLog "          <armorCheckPenalty>" & MyCreature.FinalCheck & "</armorCheckPenalty>"
  Dim MySkill, i
  for i = 1 to func.GetNumberOf_Skills
    Set MySkill = func.GetSkillObj(CInt(i))
    if func.ValidSk(MySkill) then
      tag = lcase(MySkill.NameUcase)
      tag = replace(tag, "(", "")
      tag = replace(tag, ")", "")
      words = split(tag)
      if ubound(words) >= 0 then
        tag = "skill." & words(0)
        if ubound(words) > 0 then
          for j = 1 to ubound(words)
            tag = tag & func.Capital(words(j))
          next
        end if
        func.AddToCombatLog "          <" & tag & ".total>" & MyCreature.SkillTotal(i) & "</" & tag & ".total>"
        func.AddToCombatLog "          <" & tag & ".rank>" & MyCreature.SkillRanks(i) & "</" & tag & ".rank>"
        func.AddToCombatLog "          <" & tag & ".misc>" & MyCreature.SkillTotal(i) & "</" & tag & ".misc>"
      else
        func.AddToCombatLog "          <!-- skipping a skill without a name -->"
      end if
    end If
  next
  func.AddToCombatLog "        </combatant>"
  Set MyCreature = func.GetNextCreature
Wend
func.AddToCombatLog "      </combatants>"
func.AddToCombatLog "    </group>"
func.AddToCombatLog "  </groups>"
func.AddToCombatLog "</group-set>"

Edit 05/09/2008: Added <notes> field to output
Edit 05/15/2008: Fixed problem of forum removing text after dashes.


Last edited by jay on Thu May 15, 2008 2:19 pm, edited 4 times in total.

Top
 Profile  
 
 Offline
Giant
 
Joined: Wed Feb 01, 2006 2:11 pm
Posts: 205
 Post subject:
PostPosted: Mon Feb 19, 2007 5:00 pm 
Nicely done Jay, I was thinking of this very thing but having no time nor the correct skill to create it quickly had left it alone.

We can use this for either A. putting in the group into Init tool and then dragging the tokens into Maptool or B. creating an xml import in Maptool that use the same file.


Top
 Profile  
 
User avatar  Offline
Site Admin
 
Joined: Mon Jun 12, 2006 12:20 pm
Posts: 11998
Location: Tampa, FL
 Post subject:
PostPosted: Mon Feb 19, 2007 11:53 pm 
Jay, can InitTool get the XML directly from the cut buffer, ie. the clipboard?

I'm thinking it would be nice for the user to highlight a chunk of text, activate the InitTool window, then type Ctrl-V (or some other keystroke), and presto! the group now exists! And the user doesn't have to go through the pain of creating a file somewhere (on the desktop?), open it, paste into it, save it, then select File->Open... in InitTool, etc.

Thanks. :)


Top
 Profile  
 
User avatar  Offline
RPTools Team
 
Joined: Tue Feb 07, 2006 1:07 am
Posts: 1759
Location: Austin, Tx
 Post subject:
PostPosted: Mon Feb 19, 2007 11:56 pm 
I'm trying to get 1.0 ready for release so I'd like to stay away from new functionality until it is ready. I will add a tracker for it though.


Top
 Profile  
 
User avatar  Offline
RPTools Team
 
Joined: Tue Feb 07, 2006 1:07 am
Posts: 1759
Location: Austin, Tx
 Post subject:
PostPosted: Wed Feb 21, 2007 12:44 am 
I just found a bug in my script. I've updated it in the code box above and removed it from the gallery.


Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Thu Aug 17, 2006 9:37 am
Posts: 627
Location: Brockton, MA
 Post subject:
PostPosted: Wed Feb 21, 2007 8:23 am 
jay wrote:
I just found a bug in my script. I've updated it in the code box above and removed it from the gallery.


Just remember Jay there is no such thing as bugs! :D Just :Undocumented Features that need product enhancement" :lol:

_________________
--
Big Mac


Top
 Profile  
 
 Offline
Cave Troll
 
Joined: Sat Oct 28, 2006 10:50 am
Posts: 93
 Post subject:
PostPosted: Wed Feb 21, 2007 7:41 pm 
Hi!

Assuming the code in the box above is updated, I get a runtime error 9

subscript out of range: [number 0]
line 65 column 6

I made it an action button (number 15)

Primarch


Top
 Profile  
 
User avatar  Offline
RPTools Team
 
Joined: Tue Feb 07, 2006 1:07 am
Posts: 1759
Location: Austin, Tx
 Post subject:
PostPosted: Wed Feb 21, 2007 8:57 pm 
I just cut and paste it into my action button 15 and it worked correctly. Is it possible that you typed in an extra character before you saved it? Or didn't copy everything?

If that is not the problem, then you might have a skill defined in your DMGenie instance that has a blank name. I added a blank skill name to my dmgenie data and it got the same error. To see if this is the problem select Windows --> Custom Data Editor --> Skills tab. See if there is a blank line in the skill list. I'll also put a check in the next incarnation of the script that handles that.


Top
 Profile  
 
User avatar  Offline
RPTools Team
 
Joined: Tue Feb 07, 2006 1:07 am
Posts: 1759
Location: Austin, Tx
 Post subject:
PostPosted: Wed Feb 21, 2007 9:05 pm 
primarch wrote:
Hi!

Assuming the code in the box above is updated, I get a runtime error 9

subscript out of range: [number 0]
line 65 column 6

I made it an action button (number 15)

Primarch
I updated the script in the code box above to handle this case. It will now output a XML comment saying that it skipped a skill with a blank name. I also 'enhanced' a small 'undocumented feature' out of the script as well. I don't think it was breaking IT, but it needed 'enhancement'.


Top
 Profile  
 
 Offline
Cave Troll
 
Joined: Sat Oct 28, 2006 10:50 am
Posts: 93
 Post subject:
PostPosted: Wed Feb 21, 2007 9:46 pm 
jay wrote:
primarch wrote:
Hi!

Assuming the code in the box above is updated, I get a runtime error 9

subscript out of range: [number 0]
line 65 column 6

I made it an action button (number 15)

Primarch
I updated the script in the code box above to handle this case. It will now output a XML comment saying that it skipped a skill with a blank name. I also 'enhanced' a small 'undocumented feature' out of the script as well. I don't think it was breaking IT, but it needed 'enhancement'.


Hi!

This change "fixed" it, since I no longer so an error. My newbie question is after I click my custom button, what do I do next? I open ITool and don't see anything and I don't seem to be able to find a file anywhere.

Perhaps a step by step (idiot proof) instruction is in order.

Thanks for your help!

Primarch


Top
 Profile  
 
User avatar  Offline
RPTools Team
 
Joined: Tue Feb 07, 2006 1:07 am
Posts: 1759
Location: Austin, Tx
 Post subject:
PostPosted: Wed Feb 21, 2007 10:14 pm 
primarch wrote:
This change "fixed" it, since I no longer so an error.
Did you have a skill with a blank name in it? Because if that isn't the case there may be some other problem.

primarch wrote:
My newbie question is after I click my custom button, what do I do next? I open ITool and don't see anything and I don't seem to be able to find a file anywhere.

Perhaps a step by step (idiot proof) instruction is in order.

Here you go:
  1. In DMGenie click on the combat log, hit Ctrl-A and then Delete. This will empty out your combat log to make it easier to grab the group that is being created.
  2. Press the action button that will execute the script. It should print out a lot of XML to the combat log.
  3. Click on the combat log in DMGenie again, hit Ctrl-A and then Ctrl-C. This will copy all of the XML output by the script on to the clipboard.
  4. Open up windows Notepad, or any other simple little file editor and hit Ctrl-V. This will paste all of the XML from DMGenie into the editor.
  5. Save the file (Ctrl-S in Notepad). Give it a name that has a file type of .rpgrp.
  6. Start Init Tool and then select Tools --> Group Tool from the menu. This will pop up the Group Tool window.
  7. On the Group Tool Window select File --> Open --> Group Set...
  8. Find the file that you created above in the file dialog and press the 'Open' button. That should load your data into group tool.


Top
 Profile  
 
User avatar  Offline
RPTools Team
 
Joined: Thu Jun 01, 2006 1:05 pm
Posts: 5503
Location: Buffalo, NY
 Post subject:
PostPosted: Thu Feb 22, 2007 11:00 am 
Hey Jay, this is really nice! I just tested it out and it worked well.

Do you plan on making this script grab the other custom properties like speed, attacks, qualities, etc?

This is cool!


Top
 Profile  
 
 Offline
Giant
 
Joined: Wed Feb 01, 2006 2:11 pm
Posts: 205
 Post subject:
PostPosted: Fri Feb 23, 2007 10:50 am 
Modifing the script to get that information from DM Genie shouldnt be hard.


Top
 Profile  
 
User avatar  Offline
RPTools Team
 
Joined: Tue Feb 07, 2006 1:07 am
Posts: 1759
Location: Austin, Tx
 Post subject:
PostPosted: Fri Feb 23, 2007 11:53 am 
dorpond wrote:
Do you plan on making this script grab the other custom properties like speed, attacks, qualities, etc?
Yes, I've not gotten around to it yet.


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 17 posts ]  Go to page 1, 2  Next

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Who is online

In total there are 0 users online :: 0 registered, 0 hidden and 0 guests (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: No registered users and 0 guests





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman