Energy particles help

  • ThunderSt
    18th Aug 2012 Member 0 Permalink

    How do I mod an element into energy-like particles which act like neutrons, electrons or photons?

     

    Edit: having the possibility of copying the element properties from the elements (only the ones which work with lua) would be great..

     

    Edit 2: everyone views and no one replies, JUST REPLY SOMETHING, please. This is going to get burried without a single reply, why are you ignoring this thread?

  • jacob1
    24th Aug 2012 Developer 0 Permalink
    @ThunderSt (View Post)
    You are allowed to double post after 1 day.

    Give it the property TYPE_ENERGY and it should work. (tpt.el.xxxx.properties = 16/0x10). You then have to give it the other properties of energy particles, these properties are all 0, except airloss is 1, loss is 1, collid is -0.99, and weight is -1. After that, it needs an update function, so that when it's created, it gets a random velocity. I'll make an example script to do this now.

    You could also just modify PHOT, ELEC, or NEUT directly.

    Edit:
    tpt.el.bran.menu = 1
    tpt.el.bran.enabled = 1
    tpt.el.bran.menusection = 9
    tpt.el.bran.airloss = 1
    tpt.el.bran.loss = 1
    tpt.el.bran.collision = -.99
    tpt.el.bran.weight = -1
    tpt.el.bran.heat = 295.15
    tpt.el.bran.hconduct = 251
    tpt.el.bran.properties = 0x14410

    function update_energy(i, x, y, surround, nt)
    if tpt.get_property("tmp",i) == 0 then
    --phot
    local a = (math.random(8)-1) * 0.78540;
    --tpt.set_property("life",680,i) -- my exapmle has infinite life
    tpt.set_property("vx",3*math.cos(a),i)
    tpt.set_property("vy",3*math.sin(a),i)

    --elec
    --local a = (math.random(360)-1) * 0.01745329;
    --tpt.set_property("life",680,i)
    --tpt.set_property("vx",2*math.cos(a),i)
    --tpt.set_property("vy",2*math.sin(a),i)

    --neut
    --local r = (math.random(128)+127) / 127;
    --local a = (math.random(360)-1) * 0.01745329;
    --tpt.set_property("life",math.random(480)+479,i)
    --tpt.set_property("vx",r*math.cos(a),i)
    --tpt.set_property("vy",r*math.sin(a),i)

    tpt.set_property("tmp", 1, i)
    end
    end
    tpt.element_func(update_energy, tpt.el.bran.id, 1)
  • ThunderSt
    24th Aug 2012 Member 0 Permalink

    Thank you for replying (and about the 1 day double post thing).

     

    Edit: I tried using 'tpt.el.bran.properties = 346128', which includes hot metal glow property, but the element simply doesn't have hot metal glow ingame!

  • jacob1
    24th Aug 2012 Developer 0 Permalink
    @ThunderSt (View Post)
    It loos like the hot metal glow property only works when the element has a high temperature element transition, if not, it doesn't work. Try using tpt.eltransition.bran.tempHighValue = [Value], and it will start glowing 800 degrees below value.
  • ThunderSt
    25th Aug 2012 Member 0 Permalink

    @jacob1 (View Post)

     

    Thanks, and I thought it would make the element have the same graphical effects as AWSM and gasses.. I don't remember how I got awsm with that effect..