Aller au contenu

Photo

C++ Syntax Problem, please help!


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

#1
JackFuzz

JackFuzz
  • Members
  • 408 messages
How do I get the following code to work?  My syntax is off somehow. I need the cutscene name to be dynamically generated.

void fTemp_Test(string sRaceGender)
{
resourece rCutscene = R"this_cutscene_is_for_" + sRaceGender + "_you_see.cut";
CS_LoadCutscene(rCutscene);
}

Modifié par JackFuzz, 25 février 2010 - 10:25 .


#2
thebigMuh

thebigMuh
  • Members
  • 98 messages
AFAIK there is currently no function that generates a resource out of a string at runtime.



R is a macro and as such gets resolved during compilation.



Ciao, muh!

#3
Challseus

Challseus
  • Members
  • 1 032 messages

thebigMuh wrote...

AFAIK there is currently no function that generates a resource out of a string at runtime.

R is a macro and as such gets resolved during compilation.

Ciao, muh!


Yep, you're right. They need to be hardcoded, unfortunately...

#4
Sunjammer

Sunjammer
  • Members
  • 926 messages
Hopefully the next toolset update will bring us a StringToResource function.

#5
fluffyamoeba

fluffyamoeba
  • Members
  • 264 messages
Is that some kind of subtle hint?

#6
JackFuzz

JackFuzz
  • Members
  • 408 messages
aww.... :(

This means I have to write redundant code.  ewww..

This is going to add a WHOLE bunch of extra lines that just don't need to be there.  I promised myself years ago that I would never write sloppy code. *sigh*

Modifié par JackFuzz, 25 février 2010 - 06:21 .


#7
Challseus

Challseus
  • Members
  • 1 032 messages

JackFuzz wrote...
...I promised myself years ago that I would never write sloppy code. *sigh*

I dare you to find me one programmer who has kept this promise :devil:

Modifié par Challseus, 25 février 2010 - 06:29 .


#8
JackFuzz

JackFuzz
  • Members
  • 408 messages

Challseus wrote...

JackFuzz wrote...
...I promised myself years ago that I would never write sloppy code. *sigh*

I dare you to find me one programmer who has kept this promise :devil:


hah so true!

On a side note I added a mere 811 lines of extra code since we can't dynamically create cutscene names lol.

#9
CID-78

CID-78
  • Members
  • 1 124 messages
can't you use a .Get2MDAResource() for that and keep the list in a .2da instead of in the code.

#10
JackFuzz

JackFuzz
  • Members
  • 408 messages

CID-78 wrote...

can't you use a .Get2MDAResource() for that and keep the list in a .2da instead of in the code.


I probably could, but the logic that determines: sex, gender & cutscene still needs to take place.

Modifié par JackFuzz, 25 février 2010 - 08:30 .


#11
CID-78

CID-78
  • Members
  • 1 124 messages
well you can switch .2da the same way that you would build the resource. but your right that the logic must be there, like it would if you had a StringToResource() function.

#12
JackFuzz

JackFuzz
  • Members
  • 408 messages

CID-78 wrote...

well you can switch .2da the same way that you would build the resource. but your right that the logic must be there, like it would if you had a StringToResource() function.


But still, you brought Get2MDAResource to my attention. This should come in handy actually :)