PDA

View Full Version : Copying Data within a Ruleset



Fenloh
June 13th, 2010, 11:40
Hi @all

is there a way to copy and Rename a whole datatree?

e.g. I have a Vehicle with a specific structure its Datatree is charseet.ID-00001.vehicle.ID-00001.....

I want to drag and drop the complete Tree to

npc.ID-00001....

I can sure write a function to get all the data and copy each field, but maybe there is an easier way to do such a thing. (its quite a lot of data in some cases)

Fenloh

Zeus
June 13th, 2010, 12:15
If you take a look in the 4E ruleset in scripts/manager_node.lua you will find a function moon_wizard wrote for copying database nodes. It uses recursion to handle node subtrees.

The function is called copy.

You could use that as an example.