Page 1 of 1

Affecting a text value to a string variable?

PostPosted: Wed Aug 31, 2005 7:44 pm
by regis
Hello to everybody,

As you may know, I have been developping for 1 year a precalculated 3D shooter game using GE: I am very very close to the end right now (a few days more!).

Currently, I have the following problem: how may I affect a text value to a string variable?

My purpose is to associate a player's name (let's say "Mr X") to a special HiScore value (10000 for instance), and, then, save both variables (let's call them "NameVar" and "ScoreVar") using the "saveVar" script method.

I would like to know the right syntax/method equivalent to the following "code":

ScoreVar = 10000;
NameVar = "Mr X";

Of course, this does not work! :cry:
Have you any suggestion that would be very helpful? :idea:
Many thanks in advance to the GE community! :D

Best Regards,

Regis

PostPosted: Wed Aug 31, 2005 8:24 pm
by BeyondtheTech
ScoreVar=10000;
strcpy(NameVar,"Mr X");

Affecting a text value to a string variable?

PostPosted: Fri Sep 02, 2005 7:19 am
by regis
Many thanks BeyondtheTech!
This perfectly works :wink:
Regis