Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
problem valure limit?

camagames
Registered User
Quote
2018-06-14 12:17:56

Hello I have a problem tried to load in a scene 500 files with the values but does not load even one and I used examples and tutorials but nothing happens to be a limit? Thank you


just_in_case
Moderator
Quote
2018-06-14 13:09:30

What do u mean by values... Do u meam variables, textures, models or anything else???


camagames
Registered User
Quote
2018-06-14 16:37:59

Variables I would like to save 500 out of 500 .DAT files and possible? Because he does not do it to me


just_in_case
Moderator
Quote
2018-06-14 22:18:41

Which command are you using to save varaibles to files....
And do u know that you have to put your varaible name into quotes /inverted commas..

For example ccbsetcoppercubevariable("player_health",10)

And same rule aplly for the filename...
Filename should be in inverted commas...
For example ccbwritefilecontent("filename.txt", player_health = 100)

Or you can use my behavior to read a specific line from a file... So that you don't have to read variables from 500 files... You can use a single file to save all your variables and then read specific line of variables from that file...

If you want more details on how to do it... Then just ask me..


camagames
Registered User
Quote
2018-06-15 09:17:54

OK what is your method how do you save 500 values in a single DAT file? Thank you


just_in_case
Moderator
Quote
2018-06-15 11:54:25

For example ypu want to load player health from line 1 then you can use this command where i have a file saved as filename.txt with a value like 100 or anything as a player_health and i want to use it as a vraible in my game..

var Line_to_print = 1 ;

var text = ccbReadFileContent("Filename.txt");
var lines = text.split("\n");
var stringlength = lines.length + 1 - Line_to_print;

var renderlines = lines[lines.length-stringlength];
var effect = renderlines;
ccbSetCoppercubevariable("player_health",effect)


Here line to print is the line you want to use as value for the variable player_health

You can also use thia method to wite your own behavior to load a line from a file and then use it to set coppercube variable...
If possible i will create this behavior after a week.... Cause am out of town right now..
Hope the above code will work as expected.


camagames
Registered User
Quote
2018-06-19 18:48:03

better an example thanks


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internationa?" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact