HeroEngine Forums

HeroEngine Support => Scripting & Programming => Topic started by: lileebeta on Sep 24, 11, 02:58:09 PM

Title: [Resolved] A good randomization for object placement script?
Post by: lileebeta on Sep 24, 11, 02:58:09 PM
Hello all, I'm in search of a good way of randomizing my fiolage assets when I place them onto the terrain, I have heard that these scripts exist which can be attached to library items anybody have a clue?
Title: Re: A good randomization script?
Post by: HE-JAY on Sep 26, 11, 10:27:57 AM
There does not currently exist any script-driven way of randomizing or applying a filter to the placement of asset library instances.

There are, however, several ways for you to write this functionality in script and either attach it to library assets or use your own custom placement tool.

Method 1. Using Chat Commands
Within the asset library, any asset may have a command attached to it (right click on the asset, select 'edit command'). This command is a 'chat command' interpreted by script and initially registered with the '/register' command (a description of chat commands can be found here: http://hewiki.heroengine.com/wiki/Chat_command). You could implement a command that will randomize (or offset) the placement of assets as they are added to the area.

Method 2. Using Your Own Custom Tool
Nearly all of HeroBlade's functionality is either script-driven or script-influenced. If you choose to, you may write your own asset placement tool which interacts with the $EDIT system node to place assets after performing some pre-processing. This is a non-trivial task, as it would require a decent amount of work to implement.

Method 3. TLC
The route most people choose is to manually place assets like trees and shrubs and then create asset instance clumps (i.e. groups of instances) which may be added from the library to simulate random placement. They also leverage other tools like the 'clone brush' and various terrain limiters to speed up development time by copying and pasting effective dressing, texturing and vertex coloring between pieces of terrain. While in no way automated, this often gives the best results.