[Savage Worlds] RPTroll's Campaign File Framework

Moderators: dorpond, trevor, Azhrei, giliath, Gamerdude, jay, Mr.Ice

Post Reply
nortonweb
Cave Troll
Posts: 70
Joined: Tue Apr 07, 2009 8:19 pm

Re: [Savage Worlds] RPTroll's Campaign File Framework

Post by nortonweb »

I might do Pirates next as its one of those well played/known settings (and fun to play :))

Do you think there is much point also including the GM token for the setting properties (languages, knowledge skills, edges etc)? Or just a cut'n'paste of the data itself?

User avatar
simonr43
Cave Troll
Posts: 39
Joined: Mon Feb 09, 2009 9:08 am
Location: Hadrians Wall, UK

Re: [Savage Worlds] RPTroll's Campaign File Framework

Post by simonr43 »

Thanks for the Rippers files. One problem is that the JSON 'thing doesn't seem to like brackets in the names of items. I couldn't successfully select an gear with a bracket in the name, like a lot of the ammo and some of the 'other' equipment (eg matches). Removing the brackets makes it all work great, thanks again!

Si

nortonweb
Cave Troll
Posts: 70
Joined: Tue Apr 07, 2009 8:19 pm

Re: [Savage Worlds] RPTroll's Campaign File Framework

Post by nortonweb »

bummer

User avatar
RPTroll
TheBard
Posts: 3159
Joined: Tue Mar 21, 2006 7:26 pm
Location: Austin, Tx
Contact:

Re: [Savage Worlds] RPTroll's Campaign File Framework

Post by RPTroll »

Yeah, sometimes it has problems with spaces as well. Not really sure why. I plan (someday) to use encode() and decode() so you can put whatever you want in the text strings and it will work.

Note that in the early versions of Maptool 1.4 (whenever that happens) javascript will be supported as the macro language so things will get a lot easier to code after that.
ImageImage ImageImageImageImage
Support RPTools by shopping
Image
Image

nortonweb
Cave Troll
Posts: 70
Joined: Tue Apr 07, 2009 8:19 pm

Re: [Savage Worlds] RPTroll's Campaign File Framework

Post by nortonweb »

I don't think its the JSON as if it was that it would break when you run the update on the Gear token. I think its the HTML in the character sheet. Basically there are a heap of characters you can't have in a url and thats what is constructed in the character sheet... I should have thought of that. Its either change them to character entity's or put a encode/decode in... hummm I may try to add an encode/decode as I've already made changes to the character sheet (I exposed the Notes in the gear use part of the character sheet and implemented Vegi type tool tips in the dice results as well as started work on figuring success by passing over to the dice roll the parry and toughness of the selected target.. oh and I add up the weight and cost of all the gear and show that).

It may well mean my Rippers gear tokens will no longer work unless anyone who is planning on using them removes the brackets.

I'll see if brackets can be avoided when I do the Pirates.

nortonweb
Cave Troll
Posts: 70
Joined: Tue Apr 07, 2009 8:19 pm

Re: [Savage Worlds] RPTroll's Campaign File Framework

Post by nortonweb »

I think I have it

in the gear selection screen you can select what bit of kit and how much of it. Those check boxes and input fields are called

"gear_[r:gType]_[r:name]"

"gearNum_[r:gType]_[r:name]"

so "gearNum_Other_Book(Blank)"

on the screen where you then update the character sheet you then try to get the number entered by doing this

[h:num=eval("gearNum_"+type+"_"+ name)]

thus getting this

eval("gearNum_Other_Book(Blank)")

as it has brackets it presumes its a routine for it to call and errors...

Now I need to find a way to replace those brackets as encode puts % in and it doesn't like that in eval either!!!

nortonweb
Cave Troll
Posts: 70
Joined: Tue Apr 07, 2009 8:19 pm

Re: [Savage Worlds] RPTroll's Campaign File Framework

Post by nortonweb »

The best I have for now is change the line

[h:num=eval("gearNum_"+type+"_"+ name)]

in the macro

UpdateGearDialogOK

on the Lib:Gear token to

[h:num=1]

and it works fine.

Its trying to find another way to pass the number wanted from the gear select screen to the UpdateGearDialogOK macro that I'm stumped at. If I could get getGroup() to function as I'd expect it too then I might have an idea (at item id to the gear_type_name check box and then in the eval use gearNum_type_itemId)... maybe replace name with itemId in the gear select and have a lookup in UpdateGearDialogOK to find the items name???

nortonweb
Cave Troll
Posts: 70
Joined: Tue Apr 07, 2009 8:19 pm

Re: [Savage Worlds] RPTroll's Campaign File Framework

Post by nortonweb »

Done:

In macro

UpdateDialogFormByType

change code to this


[h:wd=getLibProperty(gType)]
[h:itemID=indexOf(wd, name)]


<input type="checkbox" name="gear_[r:gType]_[r:name]||[r:itemID]" value="1" [r:checked]></input>
</td>
<td class="[r:class]">
[r:name]
</td>
<td class="[r:class]">
<input type="text" name="gearNum_[r:gType]_[r:itemID]" size=1 value="[r:value]">
[h:count=count+1]
</td>


then in macro

UpdateGearDialogOK

change code to this

[if(matches(prop, "^gear_.*")),code:{
[h:id=strfind(prop, "(\\S+)_(\\S+)_(\\S+)")]
[h:type=getGroup(id, 1, 2)]
[h:nameDD=getGroup(id, 1, 3)]
[h:idDD=indexOf(nameDD,"||")]
[h:name=substring(nameDD,0,idDD)]
[h:IDdd=idDD+2]
[h:itemID=substring(nameDD,IDdd)]

[h:num=eval("gearNum_"+type+"_"+ itemID)]


As theres no item id in the gear pick screen I identify each item by its position in the item type property using indexOf.

I then use that instead of the item name to send across how many items you are selecting.

Space will prob work now too I haven't tested that only the brackets in the Rippers macros....

User avatar
RPTroll
TheBard
Posts: 3159
Joined: Tue Mar 21, 2006 7:26 pm
Location: Austin, Tx
Contact:

Re: [Savage Worlds] RPTroll's Campaign File Framework

Post by RPTroll »

Good job!
ImageImage ImageImageImageImage
Support RPTools by shopping
Image
Image

User avatar
simonr43
Cave Troll
Posts: 39
Joined: Mon Feb 09, 2009 9:08 am
Location: Hadrians Wall, UK

Re: [Savage Worlds] RPTroll's Campaign File Framework

Post by simonr43 »

nortonweb wrote:Done:

In macro

UpdateDialogFormByType

change code to this


[h:wd=getLibProperty(gType)]
[h:itemID=indexOf(wd, name)]


<input type="checkbox" name="gear_[r:gType]_[r:name]||[r:itemID]" value="1" [r:checked]></input>
</td>
<td class="[r:class]">
[r:name]
</td>
<td class="[r:class]">
<input type="text" name="gearNum_[r:gType]_[r:itemID]" size=1 value="[r:value]">
[h:count=count+1]
</td>


then in macro

UpdateGearDialogOK

change code to this

[if(matches(prop, "^gear_.*")),code:{
[h:id=strfind(prop, "(\\S+)_(\\S+)_(\\S+)")]
[h:type=getGroup(id, 1, 2)]
[h:nameDD=getGroup(id, 1, 3)]
[h:idDD=indexOf(nameDD,"||")]
[h:name=substring(nameDD,0,idDD)]
[h:IDdd=idDD+2]
[h:itemID=substring(nameDD,IDdd)]

[h:num=eval("gearNum_"+type+"_"+ itemID)]


As theres no item id in the gear pick screen I identify each item by its position in the item type property using indexOf.

I then use that instead of the item name to send across how many items you are selecting.

Space will prob work now too I haven't tested that only the brackets in the Rippers macros....
Sorry to be thick about this, but can you give specific instructions on what I need to do with these bits of code (or better still, post the modified macros). I have no formal learning in any sort of programming or macro writing, so I work a lot by common sense and trial and error. This level of stuff is beyond me.

While I'm at it asking cheeky favours, what do I need to do to expose the notes on the character sheet. By the way, if I'm asking too much here just let me know, I'm new to all this development stuff and I'm not sure if I'm stepping over the line of interfering with your very generous work that you have shared. (edit: this applies to RPTroll and Nortonweb equally...)
Si

User avatar
RPTroll
TheBard
Posts: 3159
Joined: Tue Mar 21, 2006 7:26 pm
Location: Austin, Tx
Contact:

Re: [Savage Worlds] RPTroll's Campaign File Framework

Post by RPTroll »

There is a function called getNotes() that should do that. There is also a getGMNotes(). Hope that helps.

I really plan on providing 'something' soon on the gear issue even if its a perl script that reads a csv and spits out a JSON.
ImageImage ImageImageImageImage
Support RPTools by shopping
Image
Image

nortonweb
Cave Troll
Posts: 70
Joined: Tue Apr 07, 2009 8:19 pm

Re: [Savage Worlds] RPTroll's Campaign File Framework

Post by nortonweb »

Hi

Here are the two tokens which will allow brackets to work.

Replace the ones in the lib gear token.. oh and use at your own risk. I'd advise exporting whats there first.
Attachments
GearTokens.zip
(2.69 KiB) Downloaded 54 times

User avatar
RPTroll
TheBard
Posts: 3159
Joined: Tue Mar 21, 2006 7:26 pm
Location: Austin, Tx
Contact:

Re: [Savage Worlds] RPTroll's Campaign File Framework

Post by RPTroll »

I actually nade good progress this mornimng on the edit window. Its a slog though. Hope to have something mid week.
ImageImage ImageImageImageImage
Support RPTools by shopping
Image
Image

User avatar
simonr43
Cave Troll
Posts: 39
Joined: Mon Feb 09, 2009 9:08 am
Location: Hadrians Wall, UK

Re: [Savage Worlds] RPTroll's Campaign File Framework

Post by simonr43 »

Cheers for the amended tokens Nortonweb. I did find a missing quotation mark in one macro, the WeaponDamageJSON. in blunderbuss t38 there is a missing " prior to "fires at long range". once this is corrected the weapon damage works correctly. Your changes to the other macros seem to work great, the brackets are no longer causing a problem. I'm still working through the Solomon Kane equipment, and I'll post it as soon as I'm done.

RPTroll, don't rush yourself, the framework is already practical for my current needs, any improvements will be appreciated.

Thanks again,

Si

User avatar
RPTroll
TheBard
Posts: 3159
Joined: Tue Mar 21, 2006 7:26 pm
Location: Austin, Tx
Contact:

Re: [Savage Worlds] RPTroll's Campaign File Framework

Post by RPTroll »

Would everyone be ok with the idea of putting token notes in the lower half of the window when the character sheet is first invoked?
ImageImage ImageImageImageImage
Support RPTools by shopping
Image
Image

Post Reply

Return to “Savage Worlds Frameworks”