-
Notifications
You must be signed in to change notification settings - Fork 0
ASSIGNGEN
The ASSIGNGEN command is an assignment statement. It can create new gens from existing ones, or update existing gens. There are two different modes of using it; one is a regular assignment and the other is a subset.
The syntax in both cases is:
ASSIGNGEN newnames = ...
You can put any number of new variable names on the left hand side of the = sign for the new gen. This is helpful if you want to create it under multiple different names. The more typical use case is just to have one new variable name.
ASSIGNGEN works very similarly to ASSIGNLIST, the difference being that ASSIGNGEN creates or updates gens, not lists.
To use with regular assignment syntax, use ASSIGNGEN newnames = assignment expression
where assignment expression involves one or more gens; if more than one item is on the right hand side, then + or - signs indicate what is being added and what is being subtracted. The order of operations on assignment expression is from left to right. Duplicate gen items are removed.
Some examples:
ASSIGNGEN human = character + npc - robot
ASSIGNGEN both bothagain = malelead + femalelead
-
If the new gen name does not yet exist, then its active gen item will be set to the zero position, i.e. the first item in that gen. If the new gen name was already in existence, then YeetWords will attempt to keep the active gen item the same as it was before. If this is not possible (e.g. if the currently active gen item happened to be subtracted away), then the active gen item is set to the zero position i.e. first item.
-
If you are subtracting one gen from another gen, an item in the original and its corresponding subtracted item has to be considered equal via Ruby's
eql?
array test to successfully subtract. Thus, if one of the subset gen items has been heavily modified after becoming a subset, and it is then subtracted through ASSIGNGEN, it's possible that the modified subset gen item is no longer consideredeql?
compared to the corresponding original gen item. In that situation, the original item would remain in the gen since the subtraction could not happen as they are no longer considered equivalent items.
Subset assignment syntax is designed for creating a new gen containing a subset of gens from an existing gen. In this case, the syntax is:
ASSIGNGEN newgen = existinggen number
where number refers to how many gens are to be selected from the existing gen (must be greater than zero).
An example:
ASSIGNGEN randomcharacter = character 1
Both regular assignment and subset syntax commands can be used to split characters or add them back together, for example:
ASSIGNGEN subgroup1 = character 2
ASSIGNGEN subgroup2 = character - subgroup1
Then you can have subgroup1 and subgroup2 go off in different directions and do different things.
GEN, SHUFFLE, SHIFT, ASSIGNLIST, ASSIGNCATALOG
For a hierarchical directory, see the homepage for this Wiki