nice, but how do you put the nodes name inside a variable and how do you load the Lvl.1txt inside a variable too
In coppercube's documentation there is a Javascript reference glossary: https://www.ambiera.com/coppercube/doc/index.html
But basically, once you created the txt file using 5v3n plugin you can use 'ccbReadFileContent(filename)' to load the file and
'ccbSetCopperCubeVariable(varname, value)' to send them into a var. something like this:
ccbSetCopperCubeVariable("nodes",ccbReadFileContent("Lvl1.txt"));
You may need to first create the coppercube variable in the engine doing a 'When scene load' -> 'set or change a variable'
(IDK how is in english, i have coppercube in Spanish).
Is one of the very first thing the game does. The .ccb is inside the folder in case you wanna check it out. Sorry i didn't documented it.
Here, simply create a js file with this:
/*
<action jsname="action_send_txt_file_to_var" description="Read a txt file and send it to a variable">
<property name="Filename" type="string" default="Filename.txt" description="Enter the Filemname to be entered"/>
<property name="Variable_Name" type="string" default="" description="Enter the name of variable to be loaded"/>
</action>
*/
action_send_txt_file_to_var = function () {
};
action_send_txt_file_to_var.prototype.execute = function (currentNode)
{
ccbSetCopperCubeVariable(this.Variable_Name,ccbReadFileContent(this.Filename));
};
You can either use this script or what i said ' ccbSetCopperCubeVariable("nodes",ccbReadFileContent("Lvl1.txt"));' inside the action 'execute a javascript'
Don't be afraid to ask me anything else. :-) lucks.
You are welcome pal. :-)
To be clear. You don't put the nodes as is in the variables, you put the names of the nodes either by doing a 'ccbSetCopperCubeVariable(varname, value)' or by using the action 'Set or change a variable'.
So if you wanna move a character to a node named "chair", you either do a ccbSetCopperCubeVariable("end_node", "chair") or a 'Set or change a variable' -> VariableName = 'end_node' , operation = 'Set (=)' , ValueType = 'Value' , Value = 'chair'
Thanks, though I can't take the credit. I made it with ChatGPT.
:-/
And honestly, why don't I create an enemy action or behavior from there? Well, for one thing, it didn't occur to me, haha. For another, there are many types of enemies that work differently: soldiers who take cover, zombies, blind monsters that react to sound, paranormal entities, a math teacher, etc.
Need help making a specific enemy? I can’t promise anything, and I’m busy with an asset pack, but I can try to give you a hand.
:-)