Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
The initial pick of a template script (and therefore any script inside it) is the pick it's assigned to.
By setting it as dynamic, the pick it's assigned to becomes the parent of the gizmo. The layout script, on the other hand, is running as a child inside the gizmo. So in order to get to the same place, it instead needs to transition to its container (which is the gizmo), and then to the parent pick of that container. |
#11 |
Senior Member
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975
|
Oh I see, now I'm trying to figure out the best way to track spent resources on each gadget, can I use a resource pick bootstrapped to it? Or should I just do the math in the component and have it read the fields?
|
#12 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
I'd add resource picks inside the gizmo.
|
#13 |
Senior Member
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975
|
Ok, almost got everything finished up. Is there a way freeze selection? Like when you're in advancement mode?
Also is there a way to set a prereq that is valid if it's on the gizmo? Some traits are specifically for gadgets or characters with a couple specific other traits, the traits are easily covered with checking the #hastrait[] macro that I made, but I'm not sure how to test if it's on a gadget itself Last edited by AndrewD2; October 31st, 2014 at 08:38 PM. |
#14 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
There should be examples of freezing tables in several of the tabs in the skeleton files.
ishero is the test for whether a container is the hero. The initial context of a prereq is the container you're adding something to (or the container it's in if it's a pick), so if you're adding it to a gizmo, ishero = 0, and if you're adding it to the character, ishero <> 0. |
#15 |
Senior Member
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975
|
Also while working on the prereq I setup a prereq on the Traits that is
Code:
~check if we're cyborg, robot, or a gadget. if (tagis[Trait.Gadget] <> 0) then validif (#hastrait[trRobot] + #hastrait[trCyborg] <> 0) validif (container.ishero = 0) else @valid=1 endif |
#16 |
Senior Member
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975
|
Figured it out I remember that just doing tagis is looking at the hero so what I did was add a <match> element for the tag Trait.Gadget and it works.
Last edited by AndrewD2; October 31st, 2014 at 08:53 PM. |
#17 |
Senior Member
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975
|
Thanks I knew I saw freezing somewhere, I just forgot the term used. Works great.
|
#18 |
|
|