- Joined
- Jul 24, 2007
- Messages
- 308
Making a random doodad, terrain system
In this tutorial, i will learn you how to make a random doodad system, which generates random doodads each game!
Open the trigger editor, then make this big trigger:
Variables:
Random_Terrain : An arrayed Terrain Type
Random_Position : Point
Make such trigger, then test the map, and see yourself.
Congratulations, you just made a random terrain,doodad system!
In this tutorial, i will learn you how to make a random doodad system, which generates random doodads each game!
Open the trigger editor, then make this big trigger:
Variables:
Random_Terrain : An arrayed Terrain Type
Random_Position : Point
-
Ashenvale
-
Events
- Time - Elapsed game time is 1.00 seconds
- Conditions
-
Actions
- Set Random_Terrain[1] = Ashenvale - Dirt
- Set Random_Terrain[2] = Ashenvale - Rough Dirt
- Set Random_Terrain[3] = Ashenvale - Lumpy Grass
- Set Random_Terrain[4] = Ashenvale - Vines
- Set Random_Terrain[5] = Felwood - Grass
- Set Random_Terrain[6] = Felwood - Leaves
- Set Random_Terrain[7] = Ashenvale - Rock
- -------- Random Terrain --------
-
Events
-
//These terrains are the ones which will be used in the map
-
For each (Integer A) from 1 to 600, do (Actions)
-
Loop - Actions
- Set Random_Position = (Random point in (Entire map))
- Environment - Change terrain type at Random_Position to Random_Terrain[(Random integer number between 1 and 5)] using variation -1 in an area of size (Random integer number between 3 and 4) and shape Circle
- Custom script: call RemoveLocation (udg_Random_Position)
-
Loop - Actions
-
For each (Integer A) from 1 to 600, do (Actions)
- //For 600 times, these actions pick a random point in the map, and creates a
-
//3-4 size circle terrain.
- -------- Doodads --------
-
For each (Integer A) from 1 to 256, do (Actions)
-
Loop - Actions
- Set Random_Position = (Random point in (Entire map))
- Destructible - Create a Grass at Random_Position facing (Random angle) with scale (Random real number between 1.00 and 3.00) and variation (Random integer number between 1 and 3)
- Custom script: call RemoveLocation (udg_Random_Position)
-
Loop - Actions
- //For 256 times, this trigger creates a doodad (type : Grass) at a random
- //point in the map, its scale is from 1-3 you can customize the number
-
//of doodads that you want to create
-
For each (Integer A) from 1 to 256, do (Actions)
-
Loop - Actions
- Set Random_Position = (Random point in (Entire map))
- Destructible - Create a Ashenvale Tree Wall at Random_Position facing (Random angle) with scale 0.50 and variation (Random integer number between 1 and 3)
- Custom script: call RemoveLocation (udg_Random_Position)
-
Loop - Actions
-
For each (Integer A) from 1 to 256, do (Actions)
- //same happens in this action, for 256 times it creates an ashenvale tree
-
//at a random point in the map
-
For each (Integer A) from 1 to 256, do (Actions)
-
Loop - Actions
- Set Random_Position = (Random point in (Entire map))
- Destructible - Create a Ashenvale Tree Wall at Random_Position facing (Random angle) with scale (Random real number between 1.00 and 2.00) and variation (Random integer number between 1 and 10)
- Custom script: call RemoveLocation (udg_Random_Position)
-
Loop - Actions
-
For each (Integer A) from 1 to 64, do (Actions)
-
Loop - Actions
- Set Random_Position = (Random point in (Entire map))
- Destructible - Create a Ashenvale Canopy Tree at Random_Position facing (Random angle) with scale 1.00 and variation (Random integer number between 1 and 3)
- Custom script: call RemoveLocation (udg_Random_Position)
-
Loop - Actions
-
For each (Integer A) from 1 to 256, do (Actions)
- //you can continue as much as you want, and change numbers to your choice.
- //the Custom Script was used to fix leaks, leaks are same as
-
//"lagness", they cause the game to lag if they are not fixed
- -------- Misc --------
- Environment - Set sky to Lordaeron Summer Sky
Make such trigger, then test the map, and see yourself.
Congratulations, you just made a random terrain,doodad system!
Last edited: