HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Owner of Building in Region help

09-07-2003, 11:15 PM#1
Zachary_Shadow
I wanna make it so that when an player builds in a region, he will start reciving x gold pr second untill it is removed again. But I just can't seem to figure this out...

Anyone have any ideas, cos I know it can be done, seen it before...

Ty :)

ALSO

Is there any way to make triggers add terrain?

Say I have an area that has lava in it, but when a unit enters the area, it will become grass, and back again if another unit enters the area.... Don't think that can be done, but if someone knows, I'll owe u! :)
09-07-2003, 11:18 PM#2
Raptor--
unit finishes construction
unit type == buildingX
(boolean) regionZ contains constructed building
add constructed building to unit group Y

periodic every 1 second
pick all units in unit group Y, add X gold to owner of picked unit

unit dies
unit type == buildingX
remove dying unit from unit group Y


afaik, terrain can't be modified in that manner, only terrain deformations can be done, and blight
09-07-2003, 11:37 PM#3
Zachary_Shadow
Won't this add +1 gold pr second, even if the player has 2 or more buildings?

I need it so, that a player gets for each building he has in regions, but only one pr region. Can that be done too?

Great stuff with that trigger, ur good!! :)) hehe
09-07-2003, 11:59 PM#4
Zachary_Shadow
Great stuff, it works, it adds pr selection!

Now, a problem :P I need to make it so that only ONE building can be in the same region, and will destroy the other building if another is built in the same region... Hope u follow me :)
09-08-2003, 12:10 AM#5
Hunter0000
a unit enters y region

unit = x unit
number of x unit in y region = to 2

remove(or destroy) triggering unit

There I think that works
09-08-2003, 12:57 AM#6
Zachary_Shadow
Actually that won't work fully..

Did this:

Event:
Unit - A unit owned by Player 1 (Red) Begins construction
Cond:
(Unit-type of (Constructing structure)) Equal to Undead Rod
(Region 000 <gen> contains (Constructing structure)) Equal to True
Act:
Unit Group - Add (Constructing structure) to undead
Cond:
(Number of units in (Units in Region 000 <gen> owned by Player 1 (Red))) Greater than or equal to 2
Then Act:
Unit Group - Remove (Constructing structure) from undead
Unit - Kill (Constructing structure)
Else Act:
Do nothing


But it also picks "units" when all I want it to do is pick Structures, or even, the type of the structure..


But I can't seem to get it to do that at all, as no condition will allow you to specify a certain structure.. How can I get the condition to count number of structures, owned by player?...
09-08-2003, 01:05 AM#7
Hunter0000
no, I meant if two of x unit enters, simply use an "AND" condition, then it will work fine


(boolean) x unit = undead rod AND (integer) number of trggering units in area y = 2
09-08-2003, 01:10 AM#8
Grater
Use the "count units in unit group" function, where the group is "units in region matching condition" where the condition is "is a structure AND belongs to player" (or "matching unit is a money making building AND belongs to player")
If it's larger than 0, add 1 gold for that player.

"Matching condition" is really powerful because you can do anything you need with it, just use AND and OR to add more conditions.
09-08-2003, 01:22 AM#9
Zachary_Shadow
It will still count other units if they are within the region, tried it, it doesn't work...

Need to somehow separate the rod from the builder... Just dunno how...
09-08-2003, 01:27 AM#10
Zachary_Shadow
Ok, fixed it with a turn off/on trigger :P

Turns off the trigger when a building is placed in the region, and turns it back on if the building in the region is destroyed..

At least it works

I see what u mean Grater, and it will reduce the length of the trigger very much...I'll need to try that :) Thanks