Steve Jackson Games - Site Navigation
Home General Info Follow Us Search Illuminator Store Forums What's New Other Games Ogre GURPS Munchkin Our Games: Home

Go Back   Steve Jackson Games Forums > Roleplaying > GURPS > GURPS Character Assistant

Reply
 
Thread Tools Display Modes
Old 12-09-2024, 04:26 PM   #1
ratsta
 
Join Date: Nov 2021
Default Creating a formula for Armor Familiarity

I'd like to create a formula for the Armor Familiarity perk. The perk negates -1 in encumbrance penalties (optionally per level of the perk) for the selected unarmed combat or fencing skills (must specialise).

I wrote the following but it's not working. I'm sure I've got syntax errors. Would someone pass a more experienced eye over this and advise?

@if(char::enclevel) >0 then @gives(+1 to "SK:Smallsword::parryat")

I'd also like to make a generic version that picks up the skill from the name extension if that's possible.
ratsta is offline   Reply With Quote
Old 12-09-2024, 10:59 PM   #2
ratsta
 
Join Date: Nov 2021
Default Re: Creating a formula for Armor Familiarity

Spent some more time searching the archives and looking at examples in other advantages. This works:

Add this to Gives in the Perk
Code:
=@if(char::enclevel>0 then +1) to "SK:Smallsword::parryat"
My Smallsword parry now shows as unmodifed when I'm at -1 enc. and parry-1 when I'm at -2 enc. Happy days.

IMPORTANT: After you edit formulae, be sure to hit F5 to recalc!

---

For those searching conditionals and if statements, it appears the correct syntax is:

Code:
@if((condition) then valueA else valueB) to target
e.g.
Code:
@if((true) then 1 else 2) to SK:Broadsword
should add +1 to broadsword skill.
Code:
@if((false) then 1 else 2) to SK:Broadsword
should add +2.
ratsta is offline   Reply With Quote
Old 12-10-2024, 09:11 AM   #3
Armin
GCA Prime
 
Armin's Avatar
 
Join Date: Aug 2004
Location: Portland, OR
Default Re: Creating a formula for Armor Familiarity

I'm glad you got it working.

For the record, I have documentation to help with syntax and such for doing such things here: GCA Data File Reference Guide

Yes, it's focused on data files, but the coverage of the tags and how to write gives() and math functions and such is invaluable for people who are tinkering with writing their own formulas and customizing traits.
__________________
Armin D. Sykes | Visit my GCA5 blog for updates and previews. | Get GURPS Character Assistant 5 now at Warehouse 23.
Armin is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Fnords are Off
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 07:19 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2025, vBulletin Solutions, Inc.