Update CRAY (for advanced players)

  • motaywo
    13th Dec 2017 Member 3 Permalink

    This can get a bit technical in places. If you have a question, ask!

     

    CRAY is often called one of the "most useful elements in TPT". It's good, but doesn't work as well as it could. Expanding CRAY to behave more like STOR or PIPE would have many benefits with no downsides.

     

    Currently, when CRAY creates new particles, it maps certain properties to those new particles. (cray ... new)

    ctype = type; temp = temp; life = life.

     

    That works well, but is limited compared to STOR, which does: (stor ... new)

    tmp = type; tmp2 = life; temp = temp; pavg0 = tmp; pavg1 = ctype.

     

    All I'm asking is that we use the parts.pavg[0] and parts.pavg[1] properties with CRAY. All of the current functionality would remain, but we'd be able to customize the ctype and tmp of elements created by cray.

    The benefits in electronics and optics would be endless, because for the first time, CRAY'ing CRAY could have a practical use. CRAY'ing DRAY, C5, or PIPE/PPIP with preset properties would let us create better, more finetuned machines.

     

    Basic usage of CRAY would stay the same for new players, and the code to do this already exists in STOR or PIPE - It doesn't need a lot of changing. Just toss in this one little tweak to the next update, and I'll be happy.

  • zaccybot2
    13th Dec 2017 Member 0 Permalink

    So you suggest that the:

    tmp of the new particle is set to the pavg[0] of the CRAY,

    and the:

    ctype of the new particle is set to the pavg[1] of the CRAY?

  • Alexwall
    14th Dec 2017 Member 0 Permalink

    I can see why this would be added. sounds good to me

  • jacob1
    14th Dec 2017 Developer 0 Permalink
    Some kind of PROP tool to set these in a non-confusing way would be nice, if we do it. This special PROP tool could also work on STOR/PIPE

    Actually i've always wanted some kind of PROP tool where you could select an element, and it would list the properties you can set in english

    (Maybe I shouldn't stretch this suggestion too much)

    Is there anything other feature CRAY needs? Just want to make sure this wouldn't take up space that is needed for something else. I doubt we would use pavg for random settings that control how CRAY fires anyway though. Storing more properties seems like the most likely use for pavg.
  • Alexwall
    14th Dec 2017 Member 1 Permalink

    Couldn't the pavg0 and pavg1 values just be added to the prop tool?

  • jacob1
    14th Dec 2017 Developer 0 Permalink
    @ajloveslily (View Post)
    They are already in the prop tool
  • motaywo
    14th Dec 2017 Member 0 Permalink

    @jacob1 (View Post)

     

    jacob1:

    Actually i've always wanted some kind of PROP tool where you could select an element, and it would list the properties you can set in english

     There already kind-of is a way, but it's just more complicated, using the lua console. 

     

    tpt.element("NAME") returns the number id for the element specified, and bit.tohex(#) returns the number input in hexadecimal format. A lot of the PIPE/PPIP formatting I do for decoless saves relies on bit.tohex(tpt.element("EXOT")) for instance. It's time consuming and not very user friendly, but the basic methods are there. Maybe functions like those could be expanded upon? I know very little about programming, and nothing about lua or C, so I don't know how possible that is.

     

    Also, while I've got your attention, is it possible to have the prop tool accept temperatures in celcius and kelvin? (i.e. 273.15 or 0C would work, like with the console) EDIT: I'm as obtuse as a pie.

    Edited once by motaywo. Last: 14th Dec 2017
  • QuanTech
    14th Dec 2017 Member 0 Permalink
    @motaywo (View Post)
    The PROP tool already accepts both kelvin and celsius
  • motaywo
    14th Dec 2017 Member 0 Permalink

    @QuanTech (View Post)

     Huh... you're absolutely right. I guess I just never bothered to try it anymore. :-/

    In any case, thank you for saving me from my life under a rock!

  • xetalim
    16th Dec 2017 Member 0 Permalink

    Wouldn't you also want to use tmp2?

    Tmp2 is already used for CRAY.