HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Create Mushrooms ability:

01-31-2004, 11:37 PM#1
Gurrgel
Why doesn't these triggers work, I have these buildings, goblin huts, and want to spawn Mushrooms around them (The Underground-Tileset tree wall). They should only do this when the research is researched. Here below are the triggers I made, but they don't work.

This is the first one, made to recognise if a player has researched the upgrade:
__________________________________________________
Mushroom Farming Upgrade
Events
Unit - A unit Finishes research
Conditions
(Researched tech-type) Equal to Mushroom Farming
Actions
Trigger - Turn on Mushroom Farming <gen>
__________________________________________________
This is the trigger that get's activated by the above upgrade, that should create mushrooms:
__________________________________________________
Mushroom Farming
Events
Time - Every (25.00 + (Random real number between 5.00 and 35.00)) seconds of game time
Conditions
Actions
Unit Group - Pick every unit in (Units of type Goblin Hut) and do (Actions)
Loop - Actions
Destructible - Create a Dungeon Tree Wall at ((Position of (Picked unit)) offset by ((Random real number between -300.00 and 300.00), (Random real number between -300.00 and 300.00))) facing (Random angle) with scale (Random real number between 0.25 and 0.50) and variation (Random integer number between 1 and 8)
Destructible - Set life of (Last created destructible) to (Random real number between 25.00 and 50.00)%
_________________________________________________

Pls help me to get this working
01-31-2004, 11:55 PM#2
Newhydra
A few questions:
1. Does the second trigger ever run? Assuming it does:
2. What is the base building? It might take up more space than 300 units so the mushrooms are being created under it (and thus unplaceable...or hidden).

And a suggestion:
Change the trigger to remove all of the random stuff, and just create one mushroom well (500/600 units) away from the farm when it's built, and in a constant direction. Then test the map and see if that mushroom is there. If it is, then you know the problem lies somewhere in the random stuff.
02-01-2004, 12:19 AM#3
Gurrgel
What do you mean with "does the second trigger ever run", it isn't initially on, but the first trigger activates it, and then it runs every 25+5-35 seconds of the game.
02-01-2004, 07:01 AM#4
th15
As far as i know, its impossible to make a periodic time event fire at random intervals. I've always used wait and run-trigger actions to acheive this effect (trigger has no event, just a wait and run - this trigger action a the end ofthe trigger witht eh random number generated by a variable.)
02-01-2004, 07:15 AM#5
Newhydra
After you turn it on, does the second trigger ever execute?
02-01-2004, 09:54 AM#6
BlackSlash
I think it's better to use a timer variable.
in pseudocode:

Event:
<timer> expires
Actions:
.
.
.
Create a ONE SHOT timer that expires in 25.00 + (Random real number between 5.00 and 35.00).

In this manner you simulate a pseudo periodic event.