[HELP] Error spam. Any way to hide?

  • hax4life
    1st May 2016 Member 0 Permalink

    Hi. on litterly 99% of finishing a modpack,but WHENEVER i place a element,it spams

    "multiplayer.lua:176 attempt to call global 'type' (a number value)"

    while i dont even run a script called multiplayer

    Elements work perfectly fine,alltrough,cant find where its coming form

  • jacob1
    1st May 2016 Developer 0 Permalink
    The problem is that your script is creating a global variable called "type", which is in use by other scripts. "type" is a standard lua function, so you shouldn't use variables by that name. TPT Multiplayer uses this and calls it every frame. In the future maybe I should add a workaround, because this seems to happen a lot.

    A better fix is that you should make all your variables local. Instead of a line like this:

    type = sim.partProperty(i, sim.FIELD_TYPE)

    do

    local type = sim.partProperty(i, sim.FIELD_TYPE)

    This makes a local variable, it will only be defined in that scope (function / if statement it is defined in). You can also define local variables at the very top if you need them all over.
  • hax4life
    2nd May 2016 Member 0 Permalink

    @jacob1

    Ah.thanks,a wholesome of my elements use that (like hotter fire,to have same properitys),ill get onto it now

    EDIT:

    That would break my script,Trough,found a fix,tho still displays 1 error msg per dot(setting it out of the map)

    Also for your mod,id prefer hiding "particle does not exist" messages for projectiles out of the map/make them smaller,they annoy terribly :P. (also apeared for me with your mod a wholesome times)

    gonna need it kind of anyways 

    Edited 3 times by hax4life. Last: 2nd May 2016