I want this game to lean heavily on relationships between PCs and NPCs, but also NPCs with each other. I currently am using a system where NPCs can be added to the party in one of three ‘ally’ slots. (Preferably they’ll decline to join if their relationship with the PC is too weak, but that’s for another day).
What I want to do is:
If Ally2 is part of Ally1’s ‘Like’ list, increase all Ally1’s stats by +5. In reverse, if they’re in the ‘Dislike’ list, decrease all Ally1’s stats by -5.
The issue I’m having is how to have a repeatable subscript that knows which ‘Dis/Like’ list to draw from without me having to ask it to search a specific character’s list. Currently, the ‘Dis/Like’ lists are written as a variable called ‘XLikes’ (where X is the character’s name) and then a string of names. Each character has their own ‘XLikes’ variable, and who’s on there will change over time. I planned on using the ‘contains’ command from CSLIB to retrieve whether or not Ally2 is in Ally1’s ‘Likes’ variable. Increasing all stats for a specific ally has the same issue of not being able to identify X’s stat variable without directly asking for Xstat.
There wouldn’t be much point in showing you the code I’ve got, as it hasn’t gotten off the floor yet due to my inability to comprehend how to get around the problem (so sorry, I’m a complete beginner with overly complicated dreams).
*gosub_scene friends Like "MikeLikes" "Sofia"
*comment except I need 'Mike' to be {ally1_slot}Likes and 'Sofia' to be {ally2_slot}
[The scene below is called friends]
*label Like
*params likes ally_slot2
*gosub_scene cslib_string contains likes {ally_slot2}
*if cslib_ret
*comment YAY (+5 to all ally1 stats)
*else
*goto Dislike
*comment Dislike would be the same as Like except for the XDislike list
*return
In short, what I want to resolve:
How to search/change a specific variable attributed to an NPC without writing out the name of the variable