HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Random Grass Generators...

12-26-2009, 01:50 AM#1
Sunwarrior25
Anyone have a good method of generating grass models? My attempt kinda crashed the game.

bad trigger :(

Trigger:
Generate Grass
Collapse Events
Time - Elapsed game time is 0.00 seconds
Conditions
Collapse Actions
Collapse For each (Integer A) from 0 to 8019, do (Actions)
Collapse Loop - Actions
Trigger - Run SetGenLocIfGrassRand <gen> (checking conditions)
Special Effect - Create a special effect at (Point(Gen_X, Gen_Y)) using war3campImported\grassAnimated2.mdx
Trigger:
SetGenLocIfGrassRand
Events
Conditions
Collapse Actions
Set Gen_X = (Random real number between 0.00 and (Max X of (Entire map)))
Set Gen_Y = (Random real number between 0.00 and (Max Y of (Entire map)))
Set Gen_Loc = (Point(Gen_X, Gen_Y))
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Terrain type at Gen_Loc) Equal to Lordaeron Summer - Grass
Collapse Then - Actions
Set Gen_Loc = (Point(Gen_X, Gen_Y))
Collapse Else - Actions
Trigger - Run SetGenLocIfGrassRand <gen> (checking conditions)

12-26-2009, 03:41 AM#2
DioD
you ran infinitive loop.

anyway this wont work due watchdog (oplimit)
12-26-2009, 01:42 PM#3
Sunwarrior25
Ah well, I guess I'll have to spam those grass doodads wherever the player's going to see their character... or something.
12-26-2009, 05:12 PM#4
Zandose
What are you trying to do exactly?
12-27-2009, 12:03 AM#5
DioD
use timer 0.01 (timer 0.00 will desync in multiplayer) and 8190 iterations will complete in 9 seconds.
12-28-2009, 12:53 AM#6
Sunwarrior25
I'll try timer 0.01, and it's for a single player campaign. Still don't know whether I should try to use the animated grass (from a pack on this site) as an effect or a doodad for this effect.

EDIT: Holy hell did that work! I had a little confusion between seasons where tilesets are concerned, but other than that it works fine now! Now, I'd +rep ya, but I gotsta spread it around some first.

What I did


Trigger:
Melee Initialization
Collapse Events
Map initialization
Conditions
Collapse Actions
Melee Game - Use melee time of day (for all players)
Melee Game - Limit Heroes to 1 per Hero-type (for all players)
Melee Game - Set starting resources (for all players)
Cinematic - Fade out over 0.00 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
Cinematic - Turn on letterbox mode (hide interface) for (All players): fade out over 0.00 seconds
Cinematic - Disable user control for (All players)
Game - Display to (All players) the text: Generating Grass. P...
Set Gen_Amt = 0
Countdown Timer - Start Gen_Timer as a Repeating timer that will expire in 0.01 seconds
Set Gen_Timer = (Last started timer)
Trigger - Turn on SpawnGrass <gen>
Trigger:
SpawnGrass
Collapse Events
Time - Gen_Timer expires
Conditions
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Gen_Amt Greater than or equal to 6000
Collapse Then - Actions
Trigger - Turn off (This trigger)
Game - Display to (All players) the text: Done! Spawning Tre...
Trigger - Turn on SpawnTrees <gen>
Collapse Else - Actions
Set Gen_X = (Random real number between (Min X of (Playable map area)) and (Max X of (Playable map area)))
Set Gen_Y = (Random real number between (Min Y of (Playable map area)) and (Max Y of (Playable map area)))
Set Gen_Loc = (Point(Gen_X, Gen_Y))
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Terrain type at Gen_Loc) Equal to Lordaeron Fall - Grass
Collapse Then - Actions
Destructible - Create a Animated Grass (Spawnable) at Gen_Loc facing (Random angle) with scale (Random real number between 0.85 and 2.00) and variation 0
Set Gen_Amt = (Gen_Amt + 1)
Else - Actions
Trigger:
SpawnTrees
Collapse Events
Time - Gen_Timer expires
Conditions
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Gen_Amt Greater than or equal to 6200
Collapse Then - Actions
Trigger - Turn off (This trigger)
Countdown Timer - Pause Gen_Timer
Game - Display to (All players) the text: Done!
Cinematic - Fade in over 2.00 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
Cinematic - Turn off letterbox mode (show interface) for (All players): fade in over 2.00 seconds
Cinematic - Enable user control for (All players)
Collapse Else - Actions
Set Gen_X = (Random real number between (Min X of (Playable map area)) and (Max X of (Playable map area)))
Set Gen_Y = (Random real number between (Min Y of (Playable map area)) and (Max Y of (Playable map area)))
Set Gen_Loc = (Point(Gen_X, Gen_Y))
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Terrain type at Gen_Loc) Equal to Lordaeron Fall - Grass
Collapse Then - Actions
Destructible - Create a Fall Tree Wall at Gen_Loc facing (Random angle) with scale (Random real number between 0.80 and 1.20) and variation (Random integer number between 0 and 9)
Set Gen_Amt = (Gen_Amt + 1)
Else - Actions