Error in Auto Turret

Started by DaemonDeathAngel, July 11, 2015, 10:43:34 PM

Previous topic - Next topic

DaemonDeathAngel

I have been working on making an automatic Mortar, and when it fires (only the first time) I get the following error;

TurretAutoMortar35908 gave an inspect string over five lines (some may be empty):
Power needed: 350 W
Connected rate/stored: 3250 W / 0 Wd
Installed: Explosive mortar
Minimum range: 30
Can fire in: 50.0 seconds
Not loadedEND


Why would it be throwing this error? It has power, and I am assuming part of it might be the fat that it fires without ammunition, which I can easily fix that.

mipen

It's giving that error because you are writing too many lines to the inspect string,in the GetInspectString() method

DaemonDeathAngel

And the easiest way to fix that? Just remove those lines and it will be fine?

skullywag

yep limitation of the engine due to UI constraints i believe. I.e more than 5 lines wont fit in the box....???
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

RawCode

It wont fit into standard UI with standard font size and warning come not from engine, this is "user code" DrawInspectStringFor() placed behind "if (Prefs.DevMode)".

Easy fix - disable devmode.

If you want "long" inspect string that work properly - you will need custom GUI render (hard).

Dirty hack alternative - provide two or more inspect strings that "loop" with 3-5 seconds interval and show additional data (avg).

A bit better alternative - monitor keyboard, provide additional inspect string if shift is pressed (avg, probably best option).

mrofa

Remove <turretShellDef> line from your mortar xml, since its a extra string "Not loaded" and if you dont use manned comp turret wont use ammo anyways, it shoudnt generate string error then
All i do is clutter all around.

DaemonDeathAngel

Hmm. Okay, that all makes sense. Thank you guys. Also, mrofa, did you get my message about my Skype? Lol