Game Development Community

Create asset(s) using TorqueScript? (SOLVED)

by Beef Churger · in Torque 2D Beginner · 06/11/2014 (7:10 pm) · 1 replies

Hi! I'm new to Torque 2D, however I come from using TGE (yes, the original).

I know how to create assets using .asset.taml files, but I'm wondering if there is a way to create them as objects in TorqueScript? Creating separate files for assets can be a pain.

#1
06/11/2014 (7:50 pm)
If you want to create a new Asset in TorqueScript

new ParticleAsset(){
AssetName = "SomeCleverName";
};

Working with assets from Taml files is easy but creating them directly in script can lead to unexpected behaviors, especially when regarding private assets.

A good reading of The Wiki should really help clarify how to use assets and the AssetManager.

For a working example of Assets created, modified and saved to disk, you can look at the scripts from Particle Effects Editor I've made.