Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Please read the forum rules before posting.



Check if you are posting in the correct category.



The Off Topic section is not meant for discussing Cookie Clicker.

Bug using Nested Elements with Identifiers

blakemblakem Member Posts: 4
I'm using RandomGen for the first time and ran into a rather limiting bug.
If you have an entity with a nested element, then try to hold that entity with an identifier, it loses anything added to the nested element, and only returns the nested element. It also loses all attributes.

Here is an example that shows what does and what doesn't work:

$guy
Mr. [name] {attribute:anything}

$name
Joe

$phrase
[guy] works fine.
But identifying [guy,#guy] makes him lose the Mr.
Also, attributes break: [#guy,as attribute].
One-off attribute calls work fine, though: [guy,as attribute].


This outputs:
Mr. Joe works fine.
But identifying Joe makes him lose the Mr.
Also, attributes break: Joe.
One-off attribute calls work fine, though: anything.

Has anyone ran into this bug? Is it possible for Orteil to fix this bug?
Here's my test generator if anyone doesn't believe me:
.../randomgen/?gen=rSQ2MTGR

Thanks,
Blake

Comments

  • kenmariokenmario Member Posts: 372 ✭✭✭
    Huh - apart from a few syntax mistakes in your code, it appears you are correct.
    That's rather unfortunate, actually.

    Entering the entity as a list ([Mr. [name]]) seems to break it in a similar manner, as the code completely ignores the '[Mr.' and simply produces '[name]]'.
    Replacing 'Mr.' with another list does work, however - see the example below.
    ?gen=3583XzrW
    Goodbye the old, and welcome the new.
    The Fantasy Item Generator - Over 1.6e+117 Items
  • blakemblakem Member Posts: 4
    Interesting. Ok, I'll try constructing these from all list items as a work-around.
    Thanks.
  • blakemblakem Member Posts: 4
    Ok, more bugs found.
    If you use nested entities like this:

    $entity
    [number][letter]

    Then use an identifier:

    [entity,#entity]

    The references only remember the top-level random choice and will re-randomize the sub-choices every time it's referenced.

    Then I tried "written" on the identifier, which does keep the same choices.
    But! When I try to access attributes from a "written" identifier it just comes back with the name and not the attribute.

    Example:
    ?gen=9u9rPKm7

    Any idea how to fix this?
    Thanks,
    Blake
  • kenmariokenmario Member Posts: 372 ✭✭✭
    Yeah - don't use identifiers that have the same name as other lists.
    The system gets confused between the list and the identifier and, as such, the list takes priority because it was created before the identifier.
    What I usually do is add 'ID' to every identifier and then it's name so I don't get confused and, further, the programming doesn't get confused.
    Goodbye the old, and welcome the new.
    The Fantasy Item Generator - Over 1.6e+117 Items
  • blakemblakem Member Posts: 4
    I changed the name of the identifier and get the same results.
  • kenmariokenmario Member Posts: 372 ✭✭✭
    edited February 2015
    Huh - it appears that it's using the correct attribute but not the correct element.
    Well, that's another bug to add to the list; I don't think any of them will get fixed for a while, however.
    The Written function, as far as I know, does not include attributes - it converts the entirety of the list and entities used into text, nullifying any attributes.
    All I'd say is try to avoid using attributes if you're doing anything like this - as a note to myself and others, here's how to include identifiers for complex lists:
    • If you are only going to use the attribute, don't include anything afterwards.
    • If you are not going to use any attributes, use the Written function.
    Thanks for the bug-searching; always handy to know about these.
    Goodbye the old, and welcome the new.
    The Fantasy Item Generator - Over 1.6e+117 Items
Sign In or Register to comment.