11 Replies - 1582 Views - Last Post: 19 June 2010 - 03:22 AM Rate Topic: -----

#1 NiteFlame   User is offline

  • New D.I.C Head

Reputation: -2
  • View blog
  • Posts: 34
  • Joined: 11-June 10

Int Array printed out using a string

Posted 18 June 2010 - 05:36 PM

var ArrayDmgOutput[7];

STRING* BattelOutputText1 = ArrayDmgOutput[1];
STRING* BattelOutputText2 = ArrayDmgOutput[2];
STRING* BattelOutputText3 = ArrayDmgOutput[3];
STRING* BattelOutputText4 = ArrayDmgOutput[4];
STRING* BattelOutputText5 = ArrayDmgOutput[5];
STRING* BattelOutputText6 = ArrayDmgOutput[6];

TEXT* BattelOutput1 = //show the dmg for the battel
{
	pos_x = 300;
   pos_y = 250;
   layer = 3;
   font = arial_font;
   string ("You have hit for", BattelOutputText1, "points of damage.",);
}


im using 3d game studio witch uses a "C-lite" engine, in all the tut ive seen for the engine they say that it has all the power of a normal c/c++ engine and more so far ive seen that to be true.

But,here my problem i have an array that holds numbers and i want to print them out using the text object, how would i do this in a normal engine.

i hope thats enough info, that all that i could think of add but if anyone need more just tell me what could help and ill do the best i can to reply

oh and ive trying using the array rite into the string that does work ether

This post has been edited by NiteFlame: 18 June 2010 - 05:42 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Int Array printed out using a string

#2 NiteFlame   User is offline

  • New D.I.C Head

Reputation: -2
  • View blog
  • Posts: 34
  • Joined: 11-June 10

Re: Int Array printed out using a string

Posted 18 June 2010 - 05:39 PM

var ArrayDmgOutput[7];

STRING* BattelOutputText1 = ArrayDmgOutput[1];
STRING* BattelOutputText2 = ArrayDmgOutput[2];
STRING* BattelOutputText3 = ArrayDmgOutput[3];
STRING* BattelOutputText4 = ArrayDmgOutput[4];
STRING* BattelOutputText5 = ArrayDmgOutput[5];
STRING* BattelOutputText6 = ArrayDmgOutput[6];

TEXT* BattelOutput1 = //show the dmg for the battel
{
	pos_x = 300;
   pos_y = 250;
   layer = 3;
   font = arial_font;
   string ("You have hit for", BattelOutputText1, "points of damage.",);
}


im using 3d game studio witch uses a "C-lite" engine, in all the tut ive seen for the engine they say that it has all the power of a normal c/c++ engine and more so far ive seen that to be true.

But,here my problem i have an array that holds numbers and i want to print them out using the text object, how would i do this in a normal engine.

i hope thats enough info, that all that i could think of add but if anyone need more just tell me what could help and ill do the best i can to reply

oh and ive trying using the array rite into the string that does work ether
Was This Post Helpful? 0
  • +
  • -

#3 PsychoCoder   User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1659
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Int Array printed out using a string

Posted 18 June 2010 - 05:41 PM

Topics merged, please don't create duplicates :)
Was This Post Helpful? 0
  • +
  • -

#4 Oler1s   User is offline

  • D.I.C Lover
  • member icon

Reputation: 1397
  • View blog
  • Posts: 3,884
  • Joined: 04-June 09

Re: Int Array printed out using a string

Posted 18 June 2010 - 05:43 PM

You might not realize this, but this forum is for actual C and C++ questions. The language you are using is not either of these languages...so you should ask on the forums for your game engine. A Google search reveals that 3D Game Studio does have its own forums, and people there can help you with this lite-c language.
Was This Post Helpful? 0
  • +
  • -

#5 NiteFlame   User is offline

  • New D.I.C Head

Reputation: -2
  • View blog
  • Posts: 34
  • Joined: 11-June 10

Re: Int Array printed out using a string

Posted 18 June 2010 - 05:44 PM

sry for the double post dam lag messing with me
Was This Post Helpful? 0
  • +
  • -

#6 NiteFlame   User is offline

  • New D.I.C Head

Reputation: -2
  • View blog
  • Posts: 34
  • Joined: 11-June 10

Re: Int Array printed out using a string

Posted 18 June 2010 - 05:49 PM

View PostOler1s, on 18 June 2010 - 06:43 PM, said:

You might not realize this, but this forum is for actual C and C++ questions. The language you are using is not either of these languages...so you should ask on the forums for your game engine. A Google search reveals that 3D Game Studio does have its own forums, and people there can help you with this lite-c language.


yes i know they have there own forums ive been there they suck this place is much better and they use a c/c++ engine like i said at the start, ive been using this and VS 2005 long enough to know that there basically the same.

This post has been edited by NiteFlame: 18 June 2010 - 05:50 PM

Was This Post Helpful? 0
  • +
  • -

#7 Oler1s   User is offline

  • D.I.C Lover
  • member icon

Reputation: 1397
  • View blog
  • Posts: 3,884
  • Joined: 04-June 09

Re: Int Array printed out using a string

Posted 18 June 2010 - 05:57 PM

Quote

yes i know they have there own forums ive been there they suck this place is much better and they use a c/c++ engine like i said in my at the start
It's irrelevant what language the engine is programmed in. The engine allows for use in a C++ program, but that's not the case here. You are using that engine's lite-C language. Not C. Not C++.

Quote

ive been using this and VS 2005 long enough to know that there basically the same.
They are not. There's no such thing as a var datatype in C or in C++. var in C++0x means something different.

There's nothing called STRING in C and in C++. There is however, std::string. That is not the string you demonstrate in your code. There is no string constructor that takes two const char* arguments, for the first and third parameter.

There is no such thing as TEXT.

If you wanted to print out an array of integers in C or in C++, you would loop over the array, and use some mechanism to print them out. It depends on where you want it printed. For example, in C, if you wanted to print to console, you would use printf or puts. Or if you wanted to print to string, sprintf. Or if you had something else in mind, you would take the appropriate steps. In C++, you could use the << operator for a stream, like ostream, or ostringstream.

You may have superficially looked at C code and imagined the similar syntax to mean that the languages are the same. But they are not.
Was This Post Helpful? 1
  • +
  • -

#8 PsychoCoder   User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1659
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Int Array printed out using a string

Posted 18 June 2010 - 05:58 PM

Since this isn't C/C++ (never looked at the code in the beginning) Oler1s is correct, this isn't the proper forum. I'll move this to the Game Programming Forum, maybe someone there knows something about this studio
Was This Post Helpful? 0
  • +
  • -

#9 NiteFlame   User is offline

  • New D.I.C Head

Reputation: -2
  • View blog
  • Posts: 34
  • Joined: 11-June 10

Re: Int Array printed out using a string

Posted 18 June 2010 - 06:03 PM

ok so i guess no one here has heard of type casting or anything like a class named text or anything else if your going to say its not c/c++ at least do more research before you just start saying things. but what ever.

and Oler1s i never said anything bout it being written in c so plz dont put words in my mouth its very rude you should try to understand something fully before you start saying thing u dont know anything about seeing you said you had to google it you cant say you know anything bout the program or anything else

This post has been edited by NiteFlame: 18 June 2010 - 06:06 PM

Was This Post Helpful? -3
  • +
  • -

#10 lesPaul456   User is offline

  • D.I.C Addict
  • member icon

Reputation: 175
  • View blog
  • Posts: 729
  • Joined: 16-April 09

Re: Int Array printed out using a string

Posted 18 June 2010 - 06:23 PM

In this case, the language is irrelevant. 3D Game Studio uses it's own set of libraries. In order to provide accurate help, one would need to know the functions and variables that 3D Game Studio provides.
Was This Post Helpful? 0
  • +
  • -

#11 NiteFlame   User is offline

  • New D.I.C Head

Reputation: -2
  • View blog
  • Posts: 34
  • Joined: 11-June 10

Re: Int Array printed out using a string

Posted 18 June 2010 - 08:46 PM

str_for_num is the syntax you need
Was This Post Helpful? 0
  • +
  • -

#12 Bench   User is offline

  • D.I.C Lover
  • member icon

Reputation: 945
  • View blog
  • Posts: 2,464
  • Joined: 20-August 07

Re: Int Array printed out using a string

Posted 19 June 2010 - 03:22 AM

View PostNiteFlame, on 19 June 2010 - 01:03 AM, said:

ok so i guess no one here has heard of type casting or anything like a class named text or anything else if your going to say its not c/c++ at least do more research before you just start saying things. but what ever.
Even if you typedef'ed something to 'TEXT', this block looks absolutely nothing like C or C++ code, since you cannot initialise a pointer using initialiser lists in either C or C++ (The closest language which I've seen to the below is C#)
TEXT* BattelOutput1 = //show the dmg for the battel
{
        pos_x = 300;
   pos_y = 250;
   layer = 3;
   font = arial_font;
   string ("You have hit for", BattelOutputText1, "points of damage.",);
} 
It may well be that 'C-lite' is a domain-specific language which is translated into C or C++ before it is compiled, but that does not make it either of those languages, since it clearly needs to be parsed through some kind of translator first, which may or may not adhere to the C or C++ standards.

As others have mentioned already, your best bet if you'd like support is to go to forums which are dedicated to the language or dialect which your game uses; it seems unlikely that anybody on these forums will have heard of it.

This post has been edited by Bench: 19 June 2010 - 03:29 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1