Senior Member
Join Date: Aug 2011
Posts: 131
|
OK, I see what is happening, but I don't know how to fix it.
When a knowledge skill is chosen for the first time during creation the script is doubling the skill cost and then adding 1 point for the initial buy. When the skill is raised past Smarts, the script again charges double the initial buy cost and then adds 1 point. When a skill is raised to or under Smarts, the script just charges double (which is what it's supposed to do). I think what needs to happen is that the script should just multiply all Knowledge skills by 2. That way for an initial buy or a raise at or under Smarts the cost would be 1*2=2, and for a skill above Smarts the cost would be 2*2=4. Does that make any sense? And how do I fix this. And please, as jbear said, explain this like I'm 5. I'm really new to this . Thanks -Erich |
#11 |
Senior Member
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819
|
I would explain it that way, but I'm not CapedCrusader or Rob as I've only been doing this a little while myself and I'm not that familiar with it either, yet. Which means I have to get on my other computer and actually try to figure it out the same way you are and see if I can make it work. Although first step is figuring out exactly what the code above is doing and then how to modify it to make it do what you need, right?
So the first part Caped gave us goes through the portfolio (that's the "foreach" part) looking for anything that matches "skKnow", ie. Knowledge skills. For each one it finds it's going to do the next line, and perform a macro, the #resspent part, which is just shorthand for a longer bit of code which we don't necessarily know but can infer that it deals with how much a Resource is going to cost us. In this case w'ere saying Skills (resSkill) needs to have some amount modified on it. Remembering that, again, we are only looking at a Knowledge skill that it had to find when we did the "foreach" part. So you can say it costs us 1 more (that's the "+, 1," part) or you could say maybe *, 2 to double it, for example. I don't know if that's right, mind you, but I think that is how that part works. Then it loops backing looking for any more Knowledge skills and making the program think it costs something other than the standard, but again only on Knowledge skills. So that should be for the validation stuff when the program just validates that what already exists on the character sheet matches up to what things should have cost to get there, but it doesn't do anything about when you actually try to spend an Advance on it. The second part is to handle the Advance, I think. So again doing a foreach, but this time checking not the everything on the sheet, but only when doing an Advance and looping through Knowledge skills again. Then the next line, for any Knowledge skill it sees is being selected for an Advance, it then needs to increase that cost. I would have thought for the second one setting it to *2 (the asterisk means "times", BTW, if that wasn't clear) would be appropriate in figuring out if it was a lesser or a greater skill, but it may be a situation like you had before. Where we are SETTING it to *2 instead of adding an additional *2 modifier. Does any of that make sense or give some thoughts on where to take it next? Lenny Zimmermann Metairie, LA, USA Data files authored (please let me know if you see any issues with any of these if you have/use them): Official (In the downloader) 50 Fathoms, Deadlands: Hell On Earth, Deadlands: Noir, East Texas University, Necessary Evil (requires Super Powers Companion), Pirates of the Spanish Main, Space 1889 (original file by Erich), Tour of Darkness, Weird War II, Weird Wars: Rome Coming Eventually Evernight (LWD has completed their review but I have some fixes to make first... although Pinnacle mentioned this might get an overhaul to SWADE so I may just wait for that first. If you just HAVE to have this now, though, just PM me) |
#12 |
Senior Member
Join Date: Aug 2011
Posts: 131
|
OK, I think I understand what you're saying and I think I have the logic figured out, but the code still eludes me.
Here are the various combinations I have tried and the results. Got this one from CapedCrusader Code:
foreach pick in hero where "thingid.skKnow" perform #resspent[resSkill,+,1,"Primitive"] nexteach This is one you suggested Code:
foreach pick in hero where "thingid.skKnow" perform #resspent[resSkill,+,eachpick.field[trtFinal].value,"Primitive"] nexteach And finally here is one I wrote Code:
foreach pick in hero where "thingid.skKnow" perform #resspent[resSkill,*,2,"Primitive"] nexteach I'm really confused with this . -Erich |
#13 |
Senior Member
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819
|
I think that last one just means it won't take * in this context, so I'm guessing only + or - for that is allowed. Do you at least have some idea of why it might be doing what it's doing with those? That's what we really need to figure out and then figure out how to get the right number into that logic. We may have to set up an if-then to modify a variable, but I'd have to try to figure out what it's doing first, which I'm not entirely sure of (although you MIGHT be able to work out some of what it's doing on the wiki). I find it helpful to search there sometimes since it might give me a clue. Like in this case search on #resspent to turn up a link like that one... how helpful it really is, however... Frustrating, I know, but I don't really know the answer or I'd just give it to you.
Lenny Zimmermann Metairie, LA, USA Data files authored (please let me know if you see any issues with any of these if you have/use them): Official (In the downloader) 50 Fathoms, Deadlands: Hell On Earth, Deadlands: Noir, East Texas University, Necessary Evil (requires Super Powers Companion), Pirates of the Spanish Main, Space 1889 (original file by Erich), Tour of Darkness, Weird War II, Weird Wars: Rome Coming Eventually Evernight (LWD has completed their review but I have some fixes to make first... although Pinnacle mentioned this might get an overhaul to SWADE so I may just wait for that first. If you just HAVE to have this now, though, just PM me) |
#14 |
Senior Member
Join Date: Aug 2011
Posts: 131
|
Hmmmm, I'll give the wiki a try and see if I can find any info on the #resspent macro. Then at least I'll have a better idea of the starting point for the code.
Come to think of it, I do have an equipment list to finish. Maybe I'll let this percolate in my brain for a couple of days and then look at it again. -Erich |
#15 |
Senior Member
Volunteer Data File Contributor
Join Date: Aug 2009
Posts: 1,550
|
I've almost got this nailed. Give me another day. I see where I goofed.
|
#16 |
Senior Member
Join Date: Aug 2011
Posts: 131
|
Cool,
I'll just work on all of the gear. -Erich |
#17 |
Senior Member
Volunteer Data File Contributor
Join Date: Aug 2009
Posts: 1,550
|
Forgive me, it's been more than a day. We've been doing a big software release at work and I've had to put in some extra hours. I'm going to be working this weekend on it.
|
#18 |
Senior Member
Join Date: Aug 2011
Posts: 131
|
No worries, I just appreciate the help .
I'm still finishing up the equipment lists anyway, then I have to check all the entries to make sure they are configured right for the file downloader. So realistically, it will be late next week before I'm ready to release this anyway. Again, thanks for the help. -Erich Last edited by Erich; February 22nd, 2013 at 03:58 AM. Reason: Correcting iPad auto spelling |
#19 |
Senior Member
Volunteer Data File Contributor
Join Date: Aug 2009
Posts: 1,550
|
OK, here you go....
Code:
<thing id="mecAdvKnow" name="Double Cost Knowledge Advance" compset="Mechanics"> <usesource source="Space1889"/> <eval phase="Effects" priority="1000"><![CDATA[foreach pick in hero from Advance where "Skill.skKnow" eachpick.field[advCost].value *= 2 nexteach]]></eval> <eval phase="Traits" priority="5000" index="2"><![CDATA[ foreach pick in hero where "Skill.skKnow" perform #resspent[resSkill,+,eachpick.field[trtUser].value - 1,"Hindrance Name"] var modifier as number modifier = maximum(eachpick.field[trtUser].value - eachpick.linkage[attribute].field[trtFinal].value,0) perform #resspent[resSkill,+,modifier,"Hindrance Name"] nexteach ]]></eval> </thing> We add the current Skill Die value to the cost and it effectively doubles it. Then we take this value and subtract the value of the linked Attribute Die type. If it's higher than 0, we add it as the modifier for being above the linked Attribute. Since Hero Lab already adds one extra point to the cost if it's above, this adds the other making it 4 points per level (Whew! Expensive!) |
#20 |
|
|