Aller au contenu

Photo

[Help] Resource arrays?


  • Veuillez vous connecter pour répondre
3 réponses à ce sujet

#1
Gralamin

Gralamin
  • Members
  • 45 messages
For something I'm working on, it'd be very convenient  to have an array of resources to run through. My attempt at doing so:

resource rOldItem[]={R"gen_im_arm_hel_mas_jug.uti", R"gen_im_arm_bot_mas_jug.uti",                                R"gen_im_arm_glv_mas_jug.uti", R"gen_im_arm_cht_mas_jug.uti"};


Gets a parsing variable list error. I'm guessing my syntax is wrong somehow. Help?

Obviously, we can not do so with strings since there is no native way to convert a string to a resource (unless

string sResource = "a.uti";
resource myResource = RsResource;

or some such works, which I don't believe it does.

#2
Gralamin

Gralamin
  • Members
  • 45 messages
Update that I think deserves its own post.

I can't seem to declare any arrays. Whatever syntax it uses, it is not standard C style.



It also seems you can also not put resources into structures, which could of theoretically allowed such an array.

Evidence:

struct myStruct {

int i;

};


works but,

struct myStruct {

resource r;

};


does not.

#3
AND04

AND04
  • Members
  • 154 messages
resource[] rOldItem;

rOldItem[0] = R"gen_im_arm_hel_mas_jug.uti";

rOldItem[1] = R"gen_im_arm_bot_mas_jug.uti";

rOldItem[2] = R"gen_im_arm_glv_mas_jug.uti";

rOldItem[3] = R"gen_im_arm_cht_mas_jug.uti";



compiled just fine - seems like you just can't init a array.

#4
Gralamin

Gralamin
  • Members
  • 45 messages
Ah, Different Syntax, as I thought. Too bad, the other syntax is more convenient. Guess I'll just make a program to change it for me :P