Quantcast
Channel: Help! with 2.0 - Twine Forum
Viewing all articles
Browse latest Browse all 1844

Call an object method with a widget argument

$
0
0
I have several things such as the height and hair color that the player can set about the PC from a pre-defined list. Those lists use a basic setup. They are a link that replaces an above span with a phrase describing what they've picked. Basically it's getting to the point of being somewhat hard to figure out what I'm looking at, and I'd like to make all that into a widget. I believe the following should mostly work.
<<widget "pcConfigLink">><<link $args[0]>><<set $playerCharacter.$args[1] = $args[2]>><<replace ".pc"+$args[1]>><<pc+$args[1]>><</replace>><</link>><</widget>><<widget "pcConfigLink">><<link $args[0]>><<set $playerCharacter.$args[1] = $args[2]>><<replace ".pc"+$args[1]>><<pc+$args[1]>><</replace>><</link>><</widget>>

I would be able to call it for example with:
<<pcConfigLink "Towering" Height 4>>

However it's not liking $playerCharacter.$args[1] for some reason. Any suggestion on how to get this working?

Viewing all articles
Browse latest Browse all 1844

Trending Articles