PDA

View Full Version : Script confusion.



norfolksouthern37
June 21st, 2015, 09:49 AM
In TANE my TFX script is throwing a red bug in a confusing circumstance.

the code is something like



//default smoke values
string[] pfxcolor = new string[4];
pfxcolor[0] = "50";
pfxcolor[1] = "50";
pfxcolor[2] = "50";
pfxcolor[3] = "30";


In game the exception says NULL Array reference where the code says pfxcolor[1]

I am confused.

IT should be worth noting that this code works great in TS12 and fixing it for TANE breaks it in TS12.

TRam__
June 21st, 2015, 09:53 AM
In my case


int i;
string[] tabl_str = new string[9];


for(i=0;i<10;i++)
tabl_str[i]="tabl"+i;
works correct...

norfolksouthern37
June 21st, 2015, 10:28 AM
yes one made like that works for me too as there are several in this .gs file, just the above does not work.

WindWalkr
June 21st, 2015, 08:44 PM
In game the exception says NULL Array reference where the code says pfxcolor[1]

I don't see any problem with this code. I suspect that some other code beyond what you're listing here is interfering. Are you able to create a simple test asset which triggers this behaviour and send it over?

chris