Jump to content
Server Maintenance This Week. ×

Don’t know how to approach this problem!


xykudyax

This topic is 2353 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

Hi everyone I’m quite new to FileMaker and though I don’t think this is a FileMaker related problem I don’t know how I can accomplish this:

i have three tables: Actors, Classes and Traits.

each Actor has a Class (til this point everything is okay)

and both Classes and Actors can have multiple Traits (and that is my problem!)

i don’t know how to make the relationships between this tables. Because both class and actors table need to reference the Trait’s one. I though of adding a hidden field in the traits table that could differentiate from actor or class... value=1 actor... value=2 class... this way an identical foreign key value could represent a class or a actor depending on that 2nd variable.

what would be the best approach?! Thank you for your time and help!

Link to comment
Share on other sites

  • Newbies
8 hours ago, doughemi said:

Can you shed a little more light on how Actors, Classes, and Traits are related (in the real world, that is, not in how you are trying to do it in FileMaker)?

Yes of course and sorry for that lack of explanation! look at it like a video game database. I’m creating more of a dev tool.

Actors are players, they have classes (jobs) like “mages”, “warriors”, “healer”... and both of them have specialities (traits).

Actor named Alex has a trait that gives him 4% more attack, warrior is a class that gives 5% more defense... if Alex is a warrior he will have both 4% more attack and 5% more defense.

That this only as an example, attack and defense are also properties (fields).

another example Anne has a basic +10 attack trait. She is a “mage” this classes has a trait that “blocks her from using swords” and only allows “her from using rods”.

That being said “Traits” are no more that a TraitCodeID that is interpreter by the engine and 3 values, that can be used to pass information.

Trait class:

TraiCodeID, Value1, Value2, Value3.

PS: as a bonus question :) can I make it so I can use a portal where traits are added for each Actor and Class... and the trait field names displaying on screen vary depending on the TraitCodeID... for more readability? For example is TraitCodeID is “increase attack by percent”, value1 is “given percent” and value 2 and 3 are “not used”.

 

NOTE: actors and classes are edited in their separated layouts, traits are added directly inside actors and classes as a portal.

EDIT: I'm starting to think what I'm trying to accomplish is impossible :( 

Edited by xykudyax
Link to comment
Share on other sites

Try this for a starter.

Each Traits record will contain information about one instance of one trait for one actor belonging to one class. There may be several records showing different values for one trait; you will use calculations to determine the current value.

Traits::deltaValue is a field to allow the user to input a change value. Calculations will set the current value (previous Value is 3%, deltaValue is 2%, calculate and enter 5% as value).

An additional table for Weapons seems to be required. Weapons::usedBy will contain a list of all Class ids  which can use that weapon.

 

snap.thumb.jpg.92d019447bd4bd64c62e41837db1dba3.jpg

Link to comment
Share on other sites

@doughemi likes to grow his tree sideways and not use Ids for linking.

I'd rather have you learn about Anchor Buy method and join tables.

Have one table separate for the raw layouts: actor, class, trait, class|trait join table. Have one main table for the actors and link the classes and the class|trait join table. Have an ID in each table for their own records. Have 3 Ids in class|trait: 1. ID, 2. IDClass, 3. IDTrait. Then you can link the join table to Actor and Class.

There are lots of ERD (Entity Relationship Diagram) examples you can Google. I also recommend reading the FileMaker Training Series.

Link to comment
Share on other sites

This topic is 2353 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.